PCURVE
List of: Classes
Subjects: Model Geometry, SAT Save and Restore
Contents: Kernel

Purpose: Defines a 2D parameter-space approximation to a curve as an object in the model.

Derivation: PCURVE : ENTITY : ACIS_OBJECT : -

SAT Identifier: "pcurve"

Filename: kern/kernel/kerndata/geom/pcurve.hxx

Description: The purpose of a PCURVE is to provide a persistent, logable, savable object to manage pcurve information associated with a COEDGE.


PCURVE is a model geometry class that provides a (lowercase) pcurve, 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.


A PCURVE provides a procedural 2D parameter-space representation of a CURVE lying on a parameterized SURFACE. The representation may be a private copy(i.e., contained within a lowercase pcurve associated with the PCURVE), or it may refer to information contained within an intcurve. In either case, it may be negated from the underlying parameter space representation. Because there is only one such representation, this class does not need to have derived classes for specific geometries.


Along with the usual ENTITY class methods, PCURVE has member methods to provide access to specific implementations of the geometry. For example, a pcurve can be transformed by a given transform operator.


A use count allows multiple references to a PCURVE. The construction of a new PCURVE 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 CURVE, ENTITY, pcurve

by KERN COEDGE, pattern_holder

BASE SPApar_vec

Constructor: public: PCURVE::PCURVE ();


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


CURVE*,
// existing CURVE


int,
// definition





// type index


logical
// negated



= FALSE,


SPApar_vec const&
// parameter



= * (SPApar_vec* ) NULL_REF// space vector


);


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.


Make a PCURVE to point to an existing PCURVE (via a CURVE). The index is positive 1 or 2, representing the two surfaces in order. A logical value of TRUE means the PCURVE referenced via the CURVE is considered negated, and SPApar_vec offsets the spline surface in parametric space.






public: PCURVE::PCURVE (


PCURVE* // existing PCURVE


);


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.






public: PCURVE::PCURVE (


pcurve const& // pcurve object


);


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 PCURVE::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 PCURVE::~PCURVE ();


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



Methods: public: virtual void PCURVE::add ();


Increments the value of the use count for the PCURVE. 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 PCURVE::add_owner (


ENTITY* owner,
// owner


logical increment_use_count // increment use



= TRUE
// flag


);


Adds owner argument to list of owners.






protected: virtual logical


PCURVE::bulletin_no_change_vf (


ENTITY const* other,
// other pointer in





// change bulletin


logical identical_comparator // comparator


) const;


A virtual compare function. Compare this object with its change bulletin partner to see if the two entities are really the same.






public: virtual void PCURVE::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: pcurve const& PCURVE::def_pcur () const;


Returns the definition pcurve, or NULL if the pcurve is not private.






public: virtual logical PCURVE::deletable () const;


Indicates whether this entity is normally destroyed by lose (TRUE), or whether it is shared between multiple owners using a use count, and so gets destroyed implicitly when every owner has been lost (FALSE). The default for PCURVE is FALSE.






public: pcurve PCURVE::equation () const;


Returns the CURVE equation, for reading only.






public: int PCURVE::get_owners (


ENTITY_LIST& list // list of owners


) const;


Copies the list of owners from this object to the list argument. It returns the number of owners copied.






public: virtual int PCURVE::identity (


int
// level



= 0


) const;


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






public: int PCURVE::index () const;


Returns the definition type of the PCURVE. A 0 value indicates a private pcurve. A positive 1 or 2 represents the first or second pcurve in an intcurve definition while a negative 1 or 2 represents the reverse of the corresponding pcurve.






public: virtual logical PCURVE::is_deepcopyable (


) const;


Returns TRUE if this can be deep copied.






public: virtual logical PCURVE::is_use_counted (

) const;


Returns TRUE if the entity is use counted.






public: void PCURVE::negate ();


Negates the pcurve, either by reversing the pcurve or by reversing the value of a nonzero def_type. 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: SPApar_vec PCURVE::offset () const;


Returns the SPApar_vec parameter space vector offset. Offset is the displacement in parameter space between the "fit" definition and this PCURVE. This allows the PCURVE to be positioned in the infinite parameter space of a periodic surface, so continuous curve sequences in object space are continuous in parameter space. The components of this vector should always be integer multiples of the corresponding surface parameter period, zero if it is not periodic in that direction.






public: void PCURVE::operator*= (


SPAtransf const& // transform


);


Transforms the PCURVE. If the definition is a CURVE reference, it assumes that the curve will be transformed as well, so it does nothing. 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: CURVE* PCURVE::ref_curve () const;


Returns the reference CURVE.






public: virtual void PCURVE::remove (


logical lose_if_zero // flag for lose



= TRUE


);


Decrements the value of the use count for the PCURVE. If the use count reaches 0, the record is deleted using lose. 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 PCURVE::remove_owner (


ENTITY*, // owner


logical // decrement use



= TRUE, // count flag


logical // lose if



= TRUE // zero flag


);


Removes the owner argument from the list of owners.






public: void PCURVE::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 APATTERN index


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


restore_cache();

read_int Type of pcurve.

if (def_type == 0)

pcurve::restore_data Save the data from the underlying low-level geometry definition.

else

read_ptr Pointer to the CURVE definition.

if (restore_version_number < PCURVE_VERSION)


// Set off = SPApar_vec(0, 0)

else


read_real du


read_real dv


// Set off = SPApar_vec(du, dv)

if ( !std_acis_save_flag )




read_int

use count data






public: void PCURVE::set_def (


CURVE*,
// CURVE


int,
// nth pcurve


logical
// negate



= FALSE,


SPApar_vec const&
// parameter



= * (SPApar_vec* ) NULL_REF// space vector


);


Sets set_def to the nthpcurve of an existing CURVE, where n as a positive integer. The logical negate is TRUE for a reversed pcurve. Removes any previous reference in cur to a CURVE, and increments the use-count for the given CURVE. Makes a NULL pcurve and sets it in def. 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 PCURVE::set_def (


pcurve const& // pcurve


);


Checks that this PCURVE has been backed up, then zeros def_type, removes any curve referred to by cur (which is set to NULL), sets def_type to zero, and puts the given pcurve in def. 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 void PCURVE::set_use_count (


int val // use count


);


Sets the use count to the given value.






public: void PCURVE::shift (


SPApar_vec const& // parameter space vector


);


Shifts the PCURVE in parameter space by integral multiples of the period on a periodic surface. 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: pcurve* PCURVE::trans_pcurve (


SPAtransf const&
// transform



= * (SPAtransf* ) NULL_REF,


logical
// negate



= FALSE


) const;


Construct a transformed pcurve. The logical is TRUE if the pcurve is considered to be reversed. 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 const char*


PCURVE::type_name () const;


Returns the string "pcurve".






public: virtual int PCURVE::use_count () const;


Returns the value of the use count.

Internal Use: full_size




Related Fncs: is_PCURVE
PDF/KERN/34CLP.PDF
HTM/DATA/KERN/KERN/34CLP/0004.HTM