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

Purpose: Represents a bounded, connected portion of space.

Derivation: LUMP : ENTITY : ACIS_OBJECT : -

SAT Identifier: "lump"

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

Description: A lump represents a connected portion of a body. Usually a body consists of a single lump which is bounded by an outer shell and zero, one, or more inner shells representing voids within the body. However, when an operation returns a body composed of several unconnected pieces, such as a Boolean subtraction or intersection, each piece is represented by a lump.

References: KERN BODY, SHELL

by KERN BODY, SHELL, pattern_holder
Constructor: public: LUMP::LUMP ();


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


SHELL*, // pointer to a SHELL


LUMP* // ptr to another LUMP


);


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.


This constructor initializes all the class data, and records the creation in the bulletin board. The first argument is the start of a list of SHELLs contained in the LUMP, and the second argument sets the pointer to the next LUMP in the owning BODY. The constructor sets the backpointers in the SHELLs in the given list. The calling routine must setbody_ptr and, if desired, bound_ptr, using set_body and set_bound.




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


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



Methods: public: BODY* LUMP::body () const;


Returns a pointer to the containing BODY.






public: SPAbox* LUMP::bound () const;


Returns a pointer to the geometric bounding region (SPAbox) that contains the entire LUMP (with respect to the internal coordinate system of the BODY). This function returns NULL if the bounding box was not calculated since the LUMP was last modified.






protected: virtual logical


LUMP::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 LUMP::copy_pattern_down (


ENTITY* target
// target

) const;


Copies the pattern through all children of the target entity.






public: virtual void LUMP::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: void LUMP::get_all_patterns (


VOID_LIST& list
// pattern list


);


Returns all patterns in the list.






public: virtual int LUMP::identity (


int
// level



= 0


) const;


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






public: virtual logical LUMP::is_deepcopyable (


) const;


Returns TRUE if this can be deep copied.






public: logical LUMP::is_pattern_child () const;


Returns TRUE if this is a pattern child. An entity is a "pattern child" when it is not responsible for creating new entities when the pattern is applied. Instead, some owning entity takes care of this.






public: LUMP* LUMP::next (


PAT_NEXT_TYPE next_type // lump type



= PAT_CAN_CREATE // for patterns

) const;


Returns a pointer to the next LUMP in the list of LUMPs. 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 lump 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 lump is to be generated from a pattern, but hasn't yet been created, bypass it and return the pointer of the next already-created lump (if any).

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






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


Returns a pointer to the owning BODY.






public: logical LUMP::patternable () const;


Returns TRUE.






public: logical LUMP::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 LUMP::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 LUMP::remove_pattern ();


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






public: void LUMP::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 LUMP in body

read_ptr Pointer to record in save file for first SHELL in lump

read_ptr



Pointer to record in save file for BODY containing lump






public: void LUMP::set_body (


BODY*, // BODY


logical reset_pattern // reset or not



= TRUE


);


Sets the LUMP's BODY backpointer to the given BODY. Before performing a change, it checks if the data structure is posted on the bulletin board. If not, the method calls backup to put an entry on the bulletin board.






public: void LUMP::set_bound (


SPAbox* // bounding box


);


Sets the LUMP's SPAbox pointer to the given SPAbox. Before performing a change, it checks if the data structure is posted on the bulletin board. If not, the method calls backup to put an entry on the bulletin board.






public: void LUMP::set_next (


LUMP*, // next LUMP


logical reset_pattern // reset or not



= TRUE


);


Sets the LUMP's next LUMP pointer to the given LUMP. Before performing a change, it checks if the data structure is posted on the bulletin board. If not, the method calls backup to put an entry on the bulletin board.






public: void LUMP::set_pattern (


pattern* in_pat
// pattern


);


Set the current pattern.






public: void LUMP::set_shell (


SHELL*, // SHELL


logical reset_pattern // reset or not



= TRUE


);


Sets the LUMP's SHELL pointer to the given SHELL. Before performing a change, it checks if the data structure is posted on the bulletin board. If not, the method calls backup to put an entry on the bulletin board.






public: SHELL* LUMP::shell () const;


Returns a pointer to the first SHELL contained in the LUMP.






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


Returns the string "lump".




Related Fncs: is_LUMP
PDF/KERN/33CLL.PDF
HTM/DATA/KERN/KERN/33CLL/0003.HTM