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

Purpose: Defines a generic surface as an object in the model.

Derivation: SURFACE : ENTITY : ACIS_OBJECT : -

SAT Identifier: "surface"

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

Description: SURFACE is a model geometry class that contains a pointer to a (lowercase) surface, 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.


A SURFACE provides the basic framework for the range of surface geometries implemented in the modeler. Additional classes are derived from SURFACE to define specific types of surfaces, such as CONE, MESHSURF, PLANE, SPHERE and TORUS.


Along with the usual ENTITY class methods, SURFACE has member methods to provide access to specific implementations of the geometry. For example, a surface can be transformed by a given transform operator, resulting in another surface.


A use count allows multiple references to a SURFACE. The construction of a new SURFACE 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 ENTITY

by KERN FACE, pattern_holder

Constructor: public: SURFACE::SURFACE ();


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.




Destructor: public: virtual void SURFACE::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 SURFACE::~SURFACE ();


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 SURFACE(...) then later x->lose.)



Methods: public: virtual void SURFACE::add ();


Increments the use count. 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 SURFACE::add_owner (


ENTITY* owner,
// owner


logical increment_use_count // increment use



= TRUE
// count or not


);


Adds owner argument to the list of owners.






protected: virtual logical


SURFACE::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 identical_comparator 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: virtual void SURFACE::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: virtual logical SURFACE::deletable () const;


Indicates whether this entity is normally destroyed by lose (TRUE), or whether it is shared between multiple owners using a use count, and so gets destroyed implicitly when every owner has been lost (FALSE). The default for SURFACE is FALSE.






public: virtual surface const&


SURFACE::equation () const;


Returns the surface's equation.






public: virtual surface&


SURFACE::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: int SURFACE::get_owners (


ENTITY_LIST& list // list of owners

) const;


Copies the list of owners from this object to the list argument. The method returns the number of owners copied.






public: virtual int SURFACE::identity (


int
// level



= 0


) const;


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






public: virtual logical SURFACE::is_deepcopyable (


) const;


Returns TRUE if this can be deep copied.






public: virtual logical SURFACE::is_use_counted (

) const;


Returns TRUE if the entity is use counted.






public: virtual SPAbox SURFACE::make_box (


LOOP*, // list of LOOPs


SPAtransf const* t = NULL, // for future use


logical tight_box // for future use



= FALSE,


SPAbox* untransformed_box // for future use



= NULL


) const;


Constructs a bounding box for a FACE. Although the generic record type should never exist, this function is defined for it, to return a box enclosing all the edges of the given list of LOOPs. This is sufficient for any ruled surface type, for which any point in a FACE must be a linear combination of some two points on its boundary.






public: virtual void SURFACE::operator*= (


SPAtransf const& // transform


);


Transforms the SURFACE equation. 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 void SURFACE::remove (


logical lose_if_zero // flag for lose



= TRUE


);


Decrements the use count. If the use count reaches 0, the SURFACE is deleted. 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 SURFACE::remove_owner (


ENTITY* owner, // owner


logical // decrement use



= TRUE, // count flag


logical // lose if



= TRUE // zero flag


);


Removes the owner argument from the list of owners.






public: void SURFACE::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.


if (restore_version_number < PATTERN_VERSION

read_ptr APATTERN index


if (apat_idx != (APATTERN*)(-1)))


restore_cache();

if ( !get_standard_save_flag() )

read_int use count data

// Nothing to copy or restore under normal circumstances.






public: virtual void SURFACE::set_use_count (


int val // value to set


);


Sets the reference use count of the SURFACE.






public: virtual surface* SURFACE::trans_surface (


SPAtransf const&
// transform



= * (SPAtransf* ) NULL_REF,


logical
// reversed



= FALSE


) const;


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






public: virtual const char*


SURFACE::type_name () const;


Returns the string "surface".






public: virtual int SURFACE::use_count () const;


Returns the use count for the SURFACE.

Internal Use: full_size, save, save_common




Related Fncs: is_SURFACE
PDF/KERN/37CLSR.PDF
HTM/DATA/KERN/KERN/37CLSR/0009.HTM