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

Purpose: Represents the position of a point as an object in the model.

Derivation: APOINT : ENTITY : ACIS_OBJECT : -

SAT Identifier: "point"

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

Description: APOINT is a model geometry class that records the object space position of a point. 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.


The geometric definition of a point is stored as a SPAposition in the APOINT class. Cartesian coordinates are assumed, though in principle other coordinate systems might be implemented.


Along with the usual ENTITY class methods, APOINT has member methods to provide access to specific implementations of the geometry. For example, methods are available to set and retrieve the coordinates of a point.


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


This class is named APOINT to avoid compile and link conflicts with the Microsoft class POINT.

References: KERN ENTITY

by KERN VERTEX, pattern_holder

BASE SPAposition

Constructor: public: APOINT::APOINT ();


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: APOINT::APOINT (


double, // x value


double, // y value


double // z value


);


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.






public: APOINT::APOINT (


SPAposition const& // position


);


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.






protected: virtual logical


APOINT::bulletin_no_change_vf (


ENTITY const* other,

// other method


logical identical_comparator
// comparator


) const;


Indicate whether this entity is normally destroyed by lose, or whether it gets destroyed implicitly when every owner has been lost. Most entities are destroyed explicitly using lose, and so the default returns TRUE.




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


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



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


Increments the use_count. Before performing a change it checks whether the data structure has been posted on the bulletin board. If not, the routine calls backup to put an entry on the bulletin board.






public: void APOINT::add_owner (


ENTITY*, // owner


logical // increment use



= TRUE // flag


);


Add this owner to the list of owners.






public: SPAposition const& APOINT::coords () const;


Returns the coordinates of the APOINT as a SPAposition.






public: virtual void APOINT::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 APOINT::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 APOINT is FALSE.






public: int APOINT::get_owners (


ENTITY_LIST& list // list of owners


) const;


Returns the number of owners in the list.






public: virtual int APOINT::identity (


int
// level



= 0


) const;


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






public: virtual logical


APOINT::is_deepcopyable () const;


Returns TRUE if it is deep copyable.






public: virtual logical APOINT::is_use_counted () const;


Returns TRUE if the entity is use counted.






public: void APOINT::operator*= (


SPAtransf const& // transform


);


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






public: virtual void APOINT::remove (


logical lose_if_zero // use count equals zero



= TRUE


);


Decrements the use_count. When the use_count reaches zero, the APOINT is deleted. Before performing a change it checks whether the data structure has been posted on the bulletin board. If not, the routine calls backup to put an entry on the bulletin board.






public: void APOINT::remove_owner (


ENTITY*, // owner


logical // decrement use



= TRUE, // flag


logical // lose if zero



= TRUE // flag


);


Remove this owner from the list of owners.






public: void APOINT::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 ( !get_standard_save_flag()


read_int


use count data






public: void APOINT::set_coords (


SPAposition const& // coordinates


);


Sets the coordinates of the APOINT. Before performing a change it checks whether the data structure has been posted on the bulletin board. If not, the routine calls backup to put an entry on the bulletin board.






public: virtual void APOINT::set_use_count (


int val // value to be set


);


Sets the reference use count of the APOINT.






public: virtual const char*


APOINT::type_name () const;


Returns the string "point".






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


Returns the number of times the APOINT is referenced.

Internal Use: full_size, save, save_common




Related Fncs: is_APOINT
PDF/KERN/27CLA.PDF
HTM/DATA/KERN/KERN/27CLA/0006.HTM