Purpose:
|
Represents common data and functionality for all attributes.
|
|
Derivation:
|
ATTRIB : ENTITY : ACIS_OBJECT : -
|
|
SAT Identifier:
|
"attrib"
|
|
Filename:
|
kern/kernel/kerndata/attrib/attrib.hxx
|
|
Description:
|
ATTRIB is the generic class for user and system attributes. It provides housekeeping to maintain
ENTITY attribute lists. Every entity may have one or more attributes. These hang off the
ENTITY's attribute pointer, and are arranged as a doubly-linked chain.
|
|
|
Macros simplify the definition of derived user attributes. Many of the methods required for any attribute are the same for all attributes at the source level. Other methods have elements in common. All of these methods are defined in the nested macros in the
at_macro.hxx file.
|
|
References:
|
KERN
|
ENTITY
|
|
by KERN
|
ENTITY, pattern_holder
|
|
Constructor:
|
public: ATTRIB::ATTRIB
(
|
|
|
ENTITY*
|
// owning ENTITY
|
|
|
|
= NULL
|
|
|
);
|
|
|
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.
|
|
|
The attribute is chained into the head of the owning entity's current attribute list. Usually an
ATTRIB is created in one of its derived incarnations, but may occur stand-alone when a derived attribute in a save file is not recognized by the receiving system.
|
|
|
|
|
Destructor:
|
public: virtual void ATTRIB::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 ATTRIB::~ATTRIB
();
|
|
|
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 ATTRIB(...) then later
x->lose.)
|
|
|
|
Methods:
|
public: virtual logical ATTRIB::copyable
() const;
|
|
|
Indicates whether this attribute should be included when the owning entity is copied. The default is to call
duplicatable.
|
|
|
|
|
|
|
public: virtual void ATTRIB::copy_owner
(
|
|
|
ENTITY*
|
// entity to copy
|
|
|
);
|
|
|
This function should be called when the attributes owning
ENTITY is copied without using the
copy_scan mechanism. (Using
copy_scan automatically copies the entity's attributes, unless the virtual method
ATTRIB::duplicatable has been overridden. Both
copy_entity_from_entity and
copy_body_from_body use the
copy_scan mechanism.)
|
|
|
The default behavior of
copy_owner is to do nothing. Users may want to override this default behavior so their attributes are copied, deleted, etc, during copies that do not use the copy scan mechanism.
|
|
|
|
|
|
|
public: virtual void ATTRIB::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 ATTRIB::deletable
() const;
|
|
|
Indicates whether this entity is normally destroyed by
lose, or whether it is shared between multiple owners using a use count, and so gets destroyed implicitly when every owner has been lost. Most entities are destroyed explicitly using
lose. Attributes, however, are not deleted explicitly, but disappear implicitly when their owner is lost, so
deletable returns
FALSE by default.
|
|
|
|
|
|
|
public: virtual logical
|
|
|
ATTRIB::duplicatable () const;
|
|
|
Indicates whether the given attribute may be duplicated via either copy or save/restore of the owning entity. The default is
TRUE.
|
|
|
|
|
|
|
public: virtual void ATTRIB::from_tolerant_owner
(
|
|
|
ENTITY* non_tol_ent
|
// new non-tolerant
|
|
|
|
|
// entity
|
|
|
);
|
|
|
Replaces the owner entity of this attribute with a non-tolerant entity and deletes it. The default action is to move the attribute onto the new non-tolerant entity as long as moveable() is
TRUE.
|
|
|
|
|
|
|
public: ENTITY* ATTRIB::entity
() const;
|
|
|
Returns the pointer to the owning entity for this attribute.
|
|
|
|
|
|
|
public: virtual int ATTRIB::identity
(
|
|
|
int
|
|
// level
|
|
|
|
= 0
|
|
|
) const;
|
|
|
If
level is unspecified or 0, returns the type identifier
ATTRIB_TYPE. If
level is specified, returns
ATTRIB_TYPE for that level of derivation from
ENTITY. The level of this class is defined as
ATTRIB_LEVEL.
|
|
|
|
|
|
|
public: virtual logical
|
|
|
ATTRIB::is_deepcopyable () const;
|
|
|
Returns
TRUE if the attribute is deep copyable.
|
|
|
|
|
|
|
public: virtual void ATTRIB::lop_change_owner
();
|
|
|
Notifies the
ATTRIB that its owning
ENTITY will be changed by a local operation, remove faces, or shelling. The default action is to do nothing.
|
|
|
|
|
|
|
public: virtual void ATTRIB::merge_owner
(
|
|
|
ENTITY*,
|
// given entity
|
|
|
logical
|
// deleting owner
|
|
|
);
|
|
|
Notifies the
ATTRIB that its owning
ENTITY is about to be merged with given entity. The application has the chance to delete or otherwise modify the attribute. After the merge, this owner will be deleted if the logical deleting owner is
TRUE, otherwise it will be retained and other entity will be deleted. The default action is to do nothing. This function is supplied by the application whenever it defines a new attribute, and is called when a merge occurs.
|
|
|
|
|
|
|
public: virtual ATTRIB* ATTRIB::move
(
|
|
|
ENTITY*
|
// new owning ENTITY
|
|
|
);
|
|
|
Moves the
ATTRIB to a new owning entity.
|
|
|
|
|
|
|
public: virtual logical ATTRIB::moveable
() const;
|
|
|
Returns
TRUE if this is moveable.
|
|
|
|
|
|
|
public: ATTRIB* ATTRIB::next
() const;
|
|
|
Returns the next attribute in the list.
|
|
|
|
|
|
|
public: virtual ENTITY* ATTRIB::owner
() const;
|
|
|
Identifies the owner, if any, in the data structure of this entity.
NULL indicates no owner or an unidentifiable one. Objects of the base class have no identifiable owner.
|
|
|
|
|
|
|
public: logical ATTRIB::owner_is_saved
() const;
|
|
|
Returns
TRUE if the owner is saved.
|
|
|
|
|
|
|
public: virtual logical ATTRIB::pattern_compatible
() const;
|
|
|
Returns
TRUE if this is pattern compatible.
|
|
|
|
|
|
|
public: ATTRIB* ATTRIB::previous
() const;
|
|
|
Returns the previous attribute in the list.
|
|
|
|
|
|
|
protected: virtual void ATTRIB::private_set_entity
(
|
|
|
ENTITY* ent
|
// entity
|
|
|
);
|
|
|
The mesh class attributes do not use the scan/copy/fix mechanism and they need access to this data. Sets the pointer to an entity.
|
|
|
|
|
|
|
protected: void ATTRIB::private_set_next
(
|
|
|
ATTRIB* att
|
// previous attribute
|
|
|
);
|
|
|
Sets the next pointer to an attribute. The mesh class attributes do not use the scan/copy/fix mechanism and they need access to this data.
|
|
|
|
|
|
|
protected: void ATTRIB::private_set_previous
(
|
|
|
ATTRIB* att
|
// previous attribute
|
|
|
);
|
|
|
Sets the previous pointer to an attribute. The mesh class attributes do not use the scan/copy/fix mechanism and they need access to this data.
|
|
|
|
|
|
|
public: virtual void ATTRIB::replace_owner
(
|
|
|
ENTITY*,
|
// other_entity
|
|
|
logical
|
// replacing_owner
|
|
|
);
|
|
|
Notifies the
ATTRIB that its owning
ENTITY will be replaced with the
other_entity, when the logical
replacing_owner is
TRUE. The
other_entity will be replaced with the owning
ENTITY, when
replacing_owner is
FALSE. For example, this method is called from within local operations when a
SURFACE,
PCURVE,
CURVE, or
APOINT is replaced by a different
SURFACE,
PCURVE,
CURVE, or
APOINT, to change the shape of a
FACE,
COEDGE,
EDGE, or
VERTEX, respectively. The default action is to do nothing.
|
|
|
|
|
|
|
public: virtual void ATTRIB::replace_owner_geometry
(
|
|
|
ENTITY*
|
// new_geometry
|
|
|
);
|
|
|
Notifies the
ATTRIB that its owning
ENTITY will be given
new_geometry, possibly changing its shape. This method is called from within local operations, remove faces, and shelling, when a
FACE,
COEDGE,
EDGE, or
VERTEX will be given a new
SURFACE,
PCURVE,
CURVE, or
APOINT, respectively. The default action is to do nothing.
|
|
|
|
|
|
|
public: void ATTRIB::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.
|
|
|
read_ptr
|
Pointer to record in save file for next attribute owned by entity
|
|
read_ptr
|
Pointer to record in save file for previous attribute owned by entity
|
|
read_ptr
|
|
|
|
|
Pointer to record in save file for owning entity
|
|
|
|
|
|
|
public: virtual logical ATTRIB::savable
() const;
|
|
|
Indicates whether this attribute should be included when the owning entity is saved. The default is to call
duplicatable.
|
|
|
|
|
|
|
public: virtual void ATTRIB::split_owner
(
|
|
|
ENTITY*
|
// new entity
|
|
|
);
|
|
|
Notifies the
ATTRIB that its owner is about to be split into two parts. The application has the chance to duplicate or otherwise modify the attribute. The default action is to do nothing. This function is supplied by the application whenever it defines a new attribute, and is called when a split occurs.
|
|
|
|
|
|
|
public: virtual void ATTRIB::to_tolerant_owner
(
|
|
|
ENTITY* tol_ent
|
// new tolerant
|
|
|
|
|
// entity
|
|
|
);
|
|
|
Replaces the owner entity of this attribute with a tolerant entity and deletes it. The default action is to move the attribute onto the new tolerant entity as long as moveable() is
TRUE.
|
|
|
|
|
|
|
public: virtual void ATTRIB::trans_owner
(
|
|
|
SPAtransf const&
|
// transformation
|
|
|
);
|
|
|
Notifies the
ATTRIB that its owner is about to be transformed. The application has the chance to transform the attribute. The default action is to do nothing. This function is supplied by the application whenever it defines a new attribute, and is called when a transformation occurs.
|
|
|
|
|
|
|
public: virtual void ATTRIB::trans_owner_list
(
|
|
|
SPAtransf const&,
|
// transformation
|
|
|
ENTITY_LIST&
|
// entity list
|
|
|
);
|
|
|
Notifies the
ATTRIB that its owner is about to be transformed. The application has the chance to transform the attribute. The default action is to call
trans_owner.
|
|
|
|
|
|
|
public: virtual const char*
|
|
|
ATTRIB::type_name () const;
|
|
|
Returns the string "attrib".
|
|
|
|
|
|
|
public: ATTRIB* ATTRIB::unhook
();
|
|
|
Removes the
ATTRIB from the chain of attributes of its owning entity. This method always backs up the attribute, so changes to its pointers may subsequently be made freely.
|
|
|
|
|
|
|
public: virtual void ATTRIB::warp_owner
(
|
|
|
law*
|
// defines how to warp
|
|
|
);
|
|
|
This member function allows geometric attributes to warp themselves when their owner is warped.
|
|
Internal Use:
|
save, save_common
|
|
|
|
|
Related Fncs:
|
copy_attrib, find_attrib, find_leaf_attrib, find_next_attrib, find_next_leaf_attrib, is_ATTRIB, merge_attrib, replace_attrib, replace_geometry_attrib, split_attrib, trans_attrib
|