Purpose:
|
Defines a torus as an object in the model.
|
|
Derivation:
|
TORUS : SURFACE : ENTITY : ACIS_OBJECT : -
|
|
SAT Identifier:
|
"torus"
|
|
Filename:
|
kern/kernel/kerndata/geom/torus.hxx
|
|
Description:
|
TORUS is a model geometry class that contains a pointer to a (lowercase)
torus, the corresponding construction geometry class. 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.
|
|
|
TORUS is one of several classes derived from
SURFACE to define a specific type of surface. The
torus class defines a torus as a circular thickening of a circular spine, defined by a center, normal, major radius, and minor radius.
|
|
|
Along with the usual
SURFACE and
ENTITY class methods,
TORUS has member methods to provide access to specific implementations of the geometry. For example, methods are available to set and retrieve the radius, center, and other information about a torus.
|
|
|
A use count allows multiple references to a
TORUS. The construction of a new
TORUS 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.
|
|
References:
|
KERN
|
torus
|
|
Constructor:
|
public: TORUS::TORUS
();
|
|
|
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: TORUS::TORUS
(
|
|
|
SPAposition const&,
|
// center
|
|
|
SPAunit_vector const&,
|
// normal
|
|
|
double,
|
// major radius
|
|
|
double
|
// minor radius
|
|
|
);
|
|
|
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.
|
|
|
Creates a
TORUS from a center point, normal
SPAunit_vector, major radius, and minor radius.
|
|
|
|
|
|
|
public: TORUS::TORUS
(
|
|
|
torus const&
|
// torus object
|
|
|
);
|
|
|
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.
|
|
|
|
|
Destructor:
|
public: virtual void TORUS::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 TORUS::~TORUS
();
|
|
|
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 TORUS(...) then later
x->lose.)
|
|
|
|
Methods:
|
protected: virtual logical
|
|
|
TORUS::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 identical_comparator 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: SPAposition const& TORUS::centre
() const;
|
|
|
Returns the center of the
TORUS.
|
|
|
|
|
|
|
public: virtual void TORUS::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: surface const& TORUS::equation
() const;
|
|
|
Returns the
surface equation of a
TORUS for reading only.
|
|
|
|
|
|
|
public: surface& TORUS::equation_for_update
();
|
|
|
Returns a pointer to
surface equation for update operations. 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: virtual int TORUS::identity
(
|
|
|
int
|
|
// level
|
|
|
|
= 0
|
|
|
) const;
|
|
|
If
level is unspecified or 0, returns the type identifier
TORUS_TYPE. If
level is specified, returns
TORUS_TYPE for that level of derivation from
ENTITY. The level of this class is defined as
TORUS_LEVEL
|
|
|
|
|
|
|
public: virtual logical TORUS::is_deepcopyable
(
|
|
|
) const;
|
|
|
Returns
TRUE if this can be deep copied.
|
|
|
|
|
|
|
public: double TORUS::major_radius
() const;
|
|
|
Returns the major radius of the
TORUS.
|
|
|
|
|
|
|
public: SPAbox TORUS::make_box
(
|
|
|
LOOP*,
|
// list of LOOPs
|
|
|
SPAtransf const* t
|
// for future use
|
|
|
|
= NULL,
|
|
|
logical tight_box
|
// for future use
|
|
|
|
= FALSE,
|
|
|
SPAbox* untransformed_box
|
// for future use
|
|
|
|
= NULL
|
|
|
) const;
|
|
|
Makes a bounding
box for the
SPHERE's entire
surface (ignoring the
LOOP argument). This routine can be changed to box the
LOOP portion of the surface by setting the
tight_sphere_box option on.
|
|
|
|
|
|
|
public: double TORUS::minor_radius
() const;
|
|
|
Returns the minor radius of the
TORUS.
|
|
|
|
|
|
|
public: SPAunit_vector const& TORUS::normal
() const;
|
|
|
Returns the normal of the
TORUS.
|
|
|
|
|
|
|
public: void TORUS::operator*=
(
|
|
|
SPAtransf const&
|
// transform
|
|
|
);
|
|
|
Transforms the
TORUS. 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 TORUS::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.
|
|
|
torus::restore_data
|
|
Low-level torus geometry definition
|
|
|
|
|
|
|
public: void TORUS::set_centre
(
|
|
|
SPAposition const&
|
// center
|
|
|
);
|
|
|
Sets the
TORUS's center point to the given
SPAposition. 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 TORUS::set_major_radius
(
|
|
|
double
|
// major radius
|
|
|
);
|
|
|
Sets the
TORUS's major radius to the given value. 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 TORUS::set_minor_radius
(
|
|
|
double
|
// minor radius
|
|
|
);
|
|
|
Sets the
TORUS's minor radius to the given value. 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 TORUS::set_normal
(
|
|
|
SPAunit_vector const&
|
// normal
|
|
|
);
|
|
|
Sets the
TORUS's normal to the given
SPAunit_vector. 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: surface* TORUS::trans_surface
(
|
|
|
SPAtransf const&
|
|
// transform
|
|
|
|
= * (SPAtransf* ) NULL_REF,
|
|
|
logical
|
|
// reversed
|
|
|
|
= FALSE
|
|
|
) const;
|
|
|
Returns the transformed
surface equation. If the logical is
TRUE, the
surface is reversed.
|
|
|
|
|
|
|
public: virtual const char*
|
|
|
TORUS::type_name () const;
|
|
|
Returns the string "torus".
|
|
Internal Use:
|
full_size
|
|
|
|
|
Related Fncs:
|
is_TORUS
|