LOOP
List of: Classes
Subjects: Model Topology, SAT Save and Restore
Contents: Kernel

Purpose: Set of connected EDGEs that bounds a FACE.

Derivation: LOOP : ENTITY : ACIS_OBJECT : -

SAT Identifier: "loop"

Filename: kern/kernel/kerndata/top/loop.hxx

Description: A loop represents a connected portion of the boundary of a face. Loops may be open or closed. Refer to the description of FACE for details. A loop maintains a pointer to a coedge of the loop. Other coedges of the loop can be found by following the next or previous pointers of the coedges.

References: KERN COEDGE, FACE

by KERN FACE, pattern_holder
Constructor: public: LOOP::LOOP ();


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


COEDGE*, // first COEDGE


LOOP* // next LOOP


);


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.


Creates and initializes a new LOOP, setting owner pointers in COEDGEs. The arguments initialize the first COEDGE on this LOOP and the next LOOP on the list of LOOPs bounding a FACE, respectively. If the given COEDGE is not NULL, the constructor also sets back pointers to the new LOOP in each COEDGE of the LOOP; therefore, the COEDGEs must be correctly linked together before this constructor is called.




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


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



Methods: public: SPAbox* LOOP::bound () const;


Returns a pointer to a geometric bounding region (a SPAbox) that contains the entire LOOP. The return may be NULL if no bound was calculated since the LOOP was last changed.






protected: virtual logical


LOOP::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: logical LOOP::copy_pattern_down (


ENTITY* target
// target


) const;


Copies the pattern through all children of the target entity.






public: virtual void LOOP::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: FACE* LOOP::face () const;


Returns a pointer to the FACE containing the LOOP. Each LOOP may belong to only one FACE.






public: void LOOP::get_all_patterns (


VOID_LIST& list
// pattern list


);


Returns all patterns in the list.






public: virtual int LOOP::identity (


int
// level



= 0


) const;


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






public: virtual logical LOOP::is_deepcopyable (


) const;


Returns TRUE if this can be deep copied.






public: LOOP* LOOP::next (


PAT_NEXT_TYPE next_type // next type



= PAT_CAN_CREATE


) const;


Returns a pointer to the next LOOP in a list of LOOPs bounding a FACE.


The next_type argument controls how the next method treats patterns, and can take any one of three values:


PAT_CAN_CREATE: if the next loop is to be generated from a pattern, create it if it doesn't yet exist and return its pointer.

PAT_NO_CREATE: if the next loop is to be generated from a pattern, but hasn't yet been created, bypass it and return the pointer of the next already-created loop (if any).

PAT_IGNORE: behave as though there is no pattern on the loop.






public: ENTITY* LOOP::owner () const;


Returns a pointer to the owning entity.






public: logical LOOP::patternable () const;


Returns TRUE.






public: logical LOOP::remove_from_pattern ();


Removes the pattern element associated with this entity from the pattern. Returns FALSE if this entity is not part of a pattern element, otherwise TRUE.


Note The affected entities are not destroyed, but are merely made independent of the pattern. The pattern itself is correspondingly modified to "drop out" the newly disassociated element.






public: logical LOOP::remove_from_pattern_list ();


Removes this entity from the list of entities maintained by its pattern, if any. Returns FALSE if no pattern is found, otherwise TRUE.






public: logical LOOP::remove_pattern ();


Removes the pattern on this and all associated entities. Returns FALSE if no pattern is found, otherwise TRUE.






public: void LOOP::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 Pointer to record in save file for APATTERN on loop


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


restore_cache();

read_ptr Pointer to record in save file for next LOOP in boundary of face

read_ptr Pointer to record in save file for first COEDGE in loop

read_ptr



Pointer to record in save file for FACE which loop bounds






public: void LOOP::reverse ();


Reverses the sense of a loop of coedges and their pcurves.






public: void LOOP::set_bound (


SPAbox* // bounding box


);


Sets the LOOP's bounding SPAbox to be the given SPAbox. 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 LOOP::set_face (


FACE*, // face


logical reset_pattern // reset or not



= TRUE


);


Sets the LOOP to belong to the given FACE. 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 LOOP::set_next (


LOOP*, // loop


logical reset_pattern // reset or not



= TRUE


);


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 LOOP::set_pattern (


pattern* in_pat
// pattern

);


Set the current pattern.






public: void LOOP::set_start (


COEDGE*, // coedge


logical reset_pattern // reset or not



= TRUE


);


Sets the first COEDGE in a list of COEDGEs belonging to the LOOP. 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: COEDGE* LOOP::start () const;


Returns a pointer to one COEDGE in the LOOP. If the LOOP is closed, any COEDGE may be chosen for its traversal. If the LOOP is not closed, its start COEDGE pointer always points to the first COEDGE in the COEDGE list. A LOOP can always be traversed completely from the start COEDGE by following the COEDGE next pointer until a NULL is returned in an open LOOP, or until the start COEDGE is returned the second time in a closed LOOP.






public: virtual const char* LOOP::type_name () const;


Returns the string "loop".




Related Fncs: is_LOOP
PDF/KERN/33CLL.PDF
HTM/DATA/KERN/KERN/33CLL/0002.HTM