SPHERE
List of: Classes
Subjects: Model Geometry, SAT Save and Restore
Contents: Kernel

Purpose: Defines a sphere as an object in the model.

Derivation: SPHERE : SURFACE : ENTITY : ACIS_OBJECT : -

SAT Identifier: "sphere"

Filename: kern/kernel/kerndata/geom/sphere.hxx

Description: SPHERE is a model geometry class that contains a pointer to a (lowercase) sphere, the corresponding construction geometry class. In general, a model geometry class is derived from ENTITY and is used to define a permanent model object. It provides model management functionality, in addition to the geometry definition.


SPHERE is one of several classes derived from SURFACE to define a specific type of surface. The sphere class defines a sphere by its center point and radius.


Along with the usual SURFACE and ENTITY class methods, SPHERE has member methods to provide access to specific implementations of the geometry. For example, methods are available to set and retrieve the center and radius of a sphere.


A use count allows multiple references to a SPHERE. The construction of a new SPHERE initializes the use count to 0. Methods are provided to increment and decrement the use count, and after the use count returns to 0, the entity is deleted.

References: KERN sphere

Constructor: public: SPHERE::SPHERE ();


C++ allocation constructor requests memory for this object but does not populate it. The allocation constructor is used primarily by restore. Applications should call this constructor only with the overloaded new operator, because this reserves the memory on the heap, a requirement to support roll back and history management.






public: SPHERE::SPHERE (


SPAposition const&, // center point


double // radius


);


C++ initialize constructor requests memory for this object and populates it with the data supplied as arguments. Applications should call this constructor only with the overloaded new operator, because this reserves the memory on the heap, a requirement to support roll back and history management.






public: SPHERE::SPHERE (


sphere const& // sphere


);


C++ copy constructor requests memory for this object and populates it with the data from the object supplied as an argument. Applications should call this constructor only with the overloaded new operator, because this reserves the memory on the heap, a requirement to support roll back and history management.




Destructor: public: virtual void SPHERE::lose ();


Posts a delete bulletin to the bulletin board indicating the instance is no longer used in the active model. The lose methods for attached attributes are also called.






protected: virtual SPHERE::~SPHERE ();


This C++ destructor should never be called directly. Instead, applications should use the overloaded lose method inherited from the ENTITY class, because this supports history management. (For example, x=new SPHERE(...) then later x->lose.)



Methods: protected: virtual logical


SPHERE::bulletin_no_change_vf (


ENTITY const* other,
// other entity


logical identical_comparator // comparator


) const;


Virtual function for comparing subclass data - called by bulletin_no_change. For the identical_comparator argument to be TRUE requires an exact match when comparing doubles and returns the result of memcmp as a default (for non-overridden subclasses). FALSE indicates tolerant compares and returns FALSE as a default.






public: SPAposition const& SPHERE::centre () const;


Returns the center of the SPHERE.






public: virtual void SPHERE::debug_ent (


FILE* // file pointer


) const;


Prints the type and address of this object, roll back pointer, attributes, and any unknown subtype information to the specified file. Refer to the ENTITY class for more details.






public: surface const& SPHERE::equation () const;


Returns the surface equation of a SPHERE.






public: surface& SPHERE::equation_for_update ();


Returns a pointer to surface equation for update operations. Before performing a change it checks whether the data structure is posted on the bulletin board. If not, the routine calls backup to put an entry on the bulletin board.






public: virtual int SPHERE::identity (


int
// level



= 0


) const;


If level is unspecified or 0, returns the type identifier SPHERE_TYPE. If level is specified, returns SPHERE_TYPE for that level of derivation from ENTITY. The level of this class is defined as SPHERE_LEVEL.






public: virtual logical SPHERE::is_deepcopyable (


) const;


Returns TRUE if this can be deep copied.






public: SPAbox SPHERE::make_box (


LOOP*, // list of LOOPs


SPAtransf const* t // for future use



= NULL,


logical tight_box_switch // for future use



= FALSE,


SPAbox* untransformed_box// for future use



= NULL


) const;


Makes a bounding box for this surface. The box contains the complete underlying surface and ignores the bounding EDGEs, unless the tight_sphere_box option is on.






public: void SPHERE::operator*= (


SPAtransf const& // transform


);


Transforms a SPHERE. Before performing a change it checks whether the data structure is posted on the bulletin board. If not, the routine calls backup to put an entry on the bulletin board.






public: double SPHERE::radius () const;


Returns the radius of the SPHERE.






public: void SPHERE::restore_common ();


The RESTORE_DEF macro expands to the restore_common method, which is used in reading information from a SAT file. This method is never called directly. It is called by a higher hierarchical function if an item in the SAT file is determined to be of this class type. An instance of this class will already have been created through the allocation constructor. This method then populates the class instance with the appropriate data from the SAT file.


sphere::restore_data
low-level geometry definition for sphere data.






public: void SPHERE::set_centre (


SPAposition const& // center point


);


Sets the SPHERE's center point to the given SPAposition. Before performing a change it checks whether the data structure is posted on the bulletin board. If not, the routine calls backup to put an entry on the bulletin board.






public: void SPHERE::set_radius (


double // radius


);


Sets the SPHERE's radius to the given value. Before performing a change it checks whether the data structure is posted on the bulletin board. If not, the routine calls backup to put an entry on the bulletin board.






public: surface* SPHERE::trans_surface (


SPAtransf const& // transform



= * (SPAtransf* ) NULL_REF,


logical // reversed



= FALSE


) const;


Returns the transformed surface equation. If the logical is TRUE, the surface is reversed.






public: virtual const char*


SPHERE::type_name () const;


Returns the string "sphere".

Internal Use: full_size




Related Fncs: is_SPHERE
PDF/KERN/36CLSA.PDF
HTM/DATA/KERN/KERN/36CLSA/0005.HTM