Purpose:
|
Represents a wire, sheet, or solid body.
|
|
Derivation:
|
BODY : ENTITY : ACIS_OBJECT : -
|
|
SAT Identifier:
|
"body"
|
|
Filename:
|
kern/kernel/kerndata/top/body.hxx
|
|
Description:
|
A
BODY models a wire, sheet, or solid body. A body may be several disjoint bodies treated as a collection of lumps.
|
|
|
Lumps represent solids, sheets, and wires. In a manifold solid, every edge is adjacent to two faces. A nonmanifold solid may have edges that are adjacent to more than two faces. A nonmanifold solid may also have more than one set of faces at a vertex. Edges in a sheet may bound any number of faces. Edges of a wire do not bound any faces.
|
|
|
A pure wire body contains wires, edges, coedges, and vertices, but no faces. Wires can represent isolated points, open or closed profiles, and general wireframe models that are unsurfaced, i.e., have no faces. Wires are attached as a component of a shell and are not directly attached to the body.
|
|
|
A solid body is represented by the boundary of the region of space that is enclosed by a single lump. The lump is composed of one or more disjoint shells that contain no wires.
|
|
|
The geometry of body is given in a local coordinate system. This relates to the universal one by a transformation stored with the body.
|
|
|
Functions for traversing the topology are located in
kernel/kerndata/top/query.hxx. These are useful for generating lists of faces, edges, and vertices on other topological entities. Other functions of note include:
get_body_box to retrieve or recalculate the bounding box of a body;
point_in_body to determine the containment of a point versus a body; and
raytest_body to determine the intersections of a ray with a body.
|
|
References:
|
KERN
|
LUMP, TRANSFORM, WIRE
|
|
by KERN
|
LUMP, pattern_holder
|
|
Constructor:
|
public: BODY::BODY
();
|
|
|
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: BODY::BODY
(
|
|
|
LUMP*
|
// LUMP pointer
|
|
|
);
|
|
|
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: BODY::BODY
(
|
|
|
WIRE*
|
// WIRE pointer
|
|
|
);
|
|
|
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.
|
|
|
|
|
Destructor:
|
public: virtual void BODY::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 BODY::~BODY
();
|
|
|
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 BODY(...) then later
x->lose.)
|
|
|
|
Methods:
|
public: SPAbox* BODY::bound
() const;
|
|
|
Returns the pointer to a geometric bounding region (a box) that includes the complete body with respect to its internal coordinate system. The pointer is
NULL if a bound was not calculated since the body was last changed.
|
|
|
|
|
|
|
protected: virtual logical
|
|
|
BODY::bulletin_no_change_vf (
|
|
|
ENTITY const* other,
|
|
// other pointer
|
|
|
logical identical_comparator
|
// comparator
|
|
|
) const;
|
|
|
Compare this object with its change bulletin partner to see if the two entities are really the same.
|
|
|
|
|
|
|
public: virtual void BODY::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 int BODY::identity
(
|
|
|
int
|
|
// level
|
|
|
|
= 0
|
|
|
) const;
|
|
|
If
level is unspecified or 0, returns the type identifier
BODY_TYPE. If
level is specified, returns
BODY_TYPE for that level of derivation from
ENTITY. The level of this class is defined as
BODY_LEVEL.
|
|
|
|
|
|
|
public: virtual logical BODY::is_deepcopyable
(
|
|
|
) const;
|
|
|
Returns
TRUE if this can be deep copied.
|
|
|
|
|
|
|
public: logical BODY::is_pattern_child
() const;
|
|
|
Returns
TRUE if this is a pattern child.
|
|
|
|
|
|
|
public: LUMP* BODY::lump
() const;
|
|
|
Returns a pointer to the beginning of the list of bounding lumps of a body.
|
|
|
|
|
|
|
public: logical BODY::patternable
() const;
|
|
|
Returns
TRUE.
|
|
|
|
|
|
|
public: logical BODY::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 BODY::remove_pattern
();
|
|
|
Removes the pattern on this and all associated entities. Returns
FALSE if no pattern is found, otherwise
TRUE.
|
|
|
|
|
|
|
public: void BODY::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.
|
|
|
There is a change to the body record at version 1.6. Previously there was a direct
SHELL pointer. Now it indirects through a
LUMP list. When reading an old save file, construct the intervening lump.
|
|
|
if (restore_version_number >= PATTERN_VERSION)
|
|
read_ptr
|
Pointer to record in save file for APATTERN on loop
|
|
if (apat_idx != (APATTERN*)(-1))
|
|
pattern_ptr->restore_cache();
|
|
if (restore_version_number <LUMP_VERSION)
|
|
read_ptr
|
Pointer to shell tag
|
|
if ((int)shell_tag >= 0)
|
if the
shell_tag is not
NULL, then create a new
LUMP pointer.
|
|
else
|
if the
shell_tag is
NULL, then the
LUMP pointer is also
NULL.
|
|
else
|
if the lump is not
NULL
|
|
read_ptr
|
Pointer to record in save file for first
LUMP shell in body
|
|
read_ptr
|
Pointer to record in save file for first
WIRE in body.
|
|
read_ptr
|
|
|
|
|
Pointer to record in save file for body
TRANSFORM.
|
|
|
|
|
|
|
public: void BODY::set_bound
(
|
|
|
SPAbox*
|
// pointer to new box
|
|
|
);
|
|
|
Sets the body's
SPAbox pointer to point to the given
SPAbox. This method is generally called internally in conjunction with the
get_body_box function. 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 BODY::set_lump
(
|
|
|
LUMP*,
|
// pointer to new LUMP
|
|
|
logical reset_pattern
|
// reset or not
|
|
|
|
= TRUE
|
|
|
);
|
|
|
Sets the body's
LUMP pointer to point 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 BODY::set_pattern
(
|
|
|
pattern* in_pat
|
|
// pattern
|
|
|
);
|
|
|
Set the pattern.
|
|
|
|
|
|
|
public: void BODY::set_transform
(
|
|
|
TRANSFORM*
|
// ptr to new TRANSFORM
|
|
|
);
|
|
|
Sets the body's
TRANSFORM pointer to point to the given
TRANSFORM. 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 BODY::set_wire
(
|
|
|
WIRE*,
|
// pointer to new WIRE
|
|
|
logical reset_pattern
|
// reset or not
|
|
|
= TRUE
|
|
|
);
|
|
|
Sets the body's
WIRE pointer to point to the given
WIRE. 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: TRANSFORM* BODY::transform
() const;
|
|
|
Returns a pointer to the transformation that relates the local coordinate system to the global one in which the body resides.
|
|
|
|
|
|
|
public: void BODY::transform_patterns
(
|
|
|
const SPAtransf& tform
|
|
// transform
|
|
|
);
|
|
|
Perform the transform on the pattern.
|
|
|
|
|
|
|
public: virtual const char* BODY::type_name
() const;
|
|
|
Returns the string "body".
|
|
|
|
|
|
|
public: WIRE* BODY::wire
() const;
|
|
|
Returns a pointer to the start of list-of-wires of a body.
|
|
|
|
|
Related Fncs:
|
is_BODY
|