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

Purpose: Represents a physical edge.

Derivation: EDGE : ENTITY : ACIS_OBJECT : -

SAT Identifier: "edge"

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

Description: An edge represents a physical edge as recognized by the user. It consists of a bounded portion of a space curve, the bounds being given as object-space vertices. (Any parametric bounds required for a parametric curve may be recorded with the EDGE. These bounds are calculated from the vertex information and may be NULL if they have not been regenerated since the edge was last modified or retrieved.)


The vertex pointer at either or both ends can be NULL, in which case the EDGE is taken to be unbounded in that direction. If the underlying curve is infinite, so is the unbounded edge. If the curve is closed, the vertex pointers must both be present or both NULL. In the latter case, the edge is the whole curve.


As a special case, the geometry pointer can be NULL while both vertex pointers reference the same VERTEX. This means that the "edge" is an isolated point, such as the apex of a cone. Isolated points often represent nonmanifold vertices and therefore require special care when encountered. Edges with NULL geometry pointers should not be connected to edges with geometry. Some algorithms, such as Boolean operations, may use them during the course of the algorithm.


The kernel/kerndata/top/query.hxx file contains topological traversal functions that are useful for generating lists of edges on other topological entities. Similarly, sg_get_edges_of_wire or sg_q_edges_around_vertex may be of interest. Several geometric inquiry functions are located in kernel/kerndata/geometry/geometry.hxx. When splitting an edge, sg_split_edge_at_vertex may be helpful, and get_edge_box may be useful to retrieve or recalculate an the bounding box of an edge.

References: KERN COEDGE, CURVE, VERTEX

by KERN ATTRIB_VERTEDGE, COEDGE, VERTEX, pattern_holder

BASE SPAinterval

Data: protected COEDGE *coedge_ptr;

Pointer to one of the COEDGEs lying on the EDGE.


protected CURVE *geometry_ptr;

The geometric shape of the EDGE. The geometry pointer can be NULL while both VERTEX pointers point to the same VERTEX.


protected EDGE_cvty cvty;

The convexity of the EDGE.


protected REVBIT sense_data;

The sense of the curve. Every curve description is of a directed curve; the sense defines whether the edge shares this direction.


protected VERTEX *end_ptr;

Pointer to the end vertex of the edge. The VERTEX pointer at either or both ends may be NULL.


protected VERTEX *start_ptr;

Pointer to the start vertex of the edge. The VERTEX pointer at either or both ends can be NULL.


protected SPAinterval param_bound;

Interval bounding the parametric region, within which the entire edge lies (with respect to its body's internal coordinate system). It may be infinite if no such bound has been calculated since the edge was last changed.

Constructor: public: EDGE::EDGE ();


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


VERTEX* start,
// start VERTEX


VERTEX* end,
// end VERTEX


CURVE* geometry,
// curve geometry


REVBIT,
// sense


EDGE_cvty
// convexity of the



= EDGE_cvty_unknown,
// edge


SPAinterval const& domain // interval bounding



= * (SPAinterval* )NULL_REF// the parametric





// region of the edge


);


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 arguments initialize the start VERTEX, the end VERTEX, the CURVE, and the sense of the EDGE relative to the underlying CURVE geometry. If necessary, the EDGE pointers in the two VERTEXes are set to the EDGE, and the use count in the CURVE geometry is incremented.




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


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



Methods: public: SPAbox* EDGE::bound () const;


Returns a pointer to a geometric bounding region (a SPAbox), within which the entire EDGE lies (with respect to the internal coordinate system of the BODY). The pointer can be NULL if no such bound was calculated since the EDGE was last changed.






protected: virtual logical


EDGE::bulletin_no_change_vf (


ENTITY const* other,
// other entity





// in bulletin


logical identical_comparator // identity check


) 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: logical EDGE::closed () const;


Returns TRUE if the edge is closed.






public: COEDGE* EDGE::coedge () const;


Returns a pointer to one of the COEDGEs lying on the EDGE. No significance is attached to the choice of COEDGE, which can change during a modeling operation.






public: COEDGE* EDGE::coedge (


FACE* // pointer to face


) const;


Returns a pointer to one of the COEDGEs lying on the EDGE, associated with the given FACE.






public: char const* EDGE::convexity_string () const;


Returns a string representing the convexity of the edge, for example, "concave", "tangent", "unknown", etc.






public: logical EDGE::copy_pattern_down (


ENTITY* target
// target


) const;


Copy the pattern holder of this entity to target, and add the target entity to the other_ents list of the pattern holder. Should be overridden if there are child entities that should implement this behavior as well.






public: virtual void EDGE::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: VERTEX* EDGE::end () const;


Returns a pointer to the end VERTEX. The pointer can be NULL.






public: virtual SPAvector EDGE::end_deriv () const;


Returns the derivative at the end parameter of the EDGE.






public: SPAparameter EDGE::end_param ();


Returns the parameter defining the end of the EDGE. This routine is for backwards compatibility. It saves the evaluated range and cannot be declared const.






public: SPAparameter EDGE::end_param () const;


Returns the parameter defining the end of the EDGE. This const version of this function is less efficient than the non-const version because it cannot store the computed parameter range in the edge for future use, but is required for constant edges.






public: virtual SPAposition EDGE::end_pos () const;


Returns the end position of the EDGE.






public: CURVE* EDGE::geometry () const;


Returns the pointer to the underlying CURVE geometry.






public: void EDGE::get_all_patterns (


VOID_LIST& list
// list of patterns


);


Adds the pattern on this entity, if any, to the list, if the pattern is not already there. Needs overriding if there are child entities to be queried.






public: EDGE_cvty EDGE::get_convexity () const;


Returns the convexity of the EDGE.






public: virtual double EDGE::get_tolerance ();


Returns the tolerance of the tolerant TEDGE made from this EDGE. This routine is for backwards compatibility. It saves the evaluated range and cannot be declared const.






public: virtual double EDGE::get_tolerance () const;


Returns the tolerance of the tolerant TEDGE made from this EDGE. This const version of this function is less efficient than the non-const version because it cannot store the computed parameter range in the edge for future use, but is required for constant edges.






public: virtual int EDGE::identity (


int
// level



= 0


) const;


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






public: virtual logical EDGE::is_deepcopyable (


) const;


Returns TRUE if this can be deep copied.






public: logical EDGE::is_pattern_child () const;


An entity is a "pattern child" when it is not responsible for creating new entities when the pattern is applied, this being the responsibility of some owning entity. If an entity is either always or never a pattern child, this can be overridden to always return either TRUE or FALSE.






public: double EDGE::length () const;


Returns the length of the underlying geometry curve.






public: TEDGE* EDGE::make_tolerant (


double tol // tolerance


);


Makes a tolerant TEDGE from this EDGE.






public: virtual SPAvector EDGE::mid_point_deriv (


logical approx // use approximation


= TRUE // or not


) const;


Returns the derivative at the mid-point parameter of the EDGE.






public: virtual SPAposition EDGE::mid_pos (


logical approx // use approximation


= TRUE // or not


) const;


Returns the mid-point parameter of the EDGE.






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


Returns a pointer to the owning entity.






public: SPAinterval EDGE::param_range ();


Returns the parameter range. This is the preferred routine when there is a need for both parameters. It saves the evaluated range and cannot be declared const.






public: SPAinterval EDGE::param_range () const;


Returns the parameter range. This const version of this function is less efficient than the non-const version because it cannot store the computed parameter range in the edge for future use, but is required for constant edges.






public: logical EDGE::periodic () const;


Returns TRUE if the edge is periodic.






public: logical EDGE::remove_from_pattern_list ();


Removes the entity from its pattern list. Should be overridden if there are child entities to be removed as well.






public: void EDGE::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 edge record at version 1.6. Prior to 1.6, there were explicit end parameter values. These are now computed on the fly, so are not saved or retrieved. When reading an old save file, ignore the saved values.


if (restore_version_number < PATTERN_VERSION

read_ptr APATTERN index

read_ptr // start vertex

if (old_version) { // if pre-tolerant modeling


read_real // skip start parameter value

else if (tol_mod_version) { // else tolerant modeling


read_real // set start parameter


read_real // start parameter

read_ptr // end vertex

if (old_version) { // if pre-tolerant modeling


read_real // skip end parameter value

else if (tol_mod_version) { // else tolerant modeling


read_real // set end parameter


read_real // end parameter

read_ptr // coedge pointer

read_ptr // geometry pointer

read_logical // rev bit for sense

if ( tol_mod_version ) { // if tolerant modeling




read_string
// convexity






public: REVBIT EDGE::sense () const;


Returns the sense defining whether the EDGE shares the direction of the underlying CURVE, or has the opposite direction.






public: void EDGE::set_bound (


SPAbox* // bounding box


);


Sets the EDGE's bounding box to be the given SPAbox. 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 EDGE::set_coedge (


COEDGE*, // COEDGE


logical reset_pattern // reset or not


= TRUE


);


Sets the start of a list of COEDGEs corresponding to this EDGE. 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 EDGE::set_convexity (


EDGE_cvty, // edge convexity


logical reset_pattern // reset or not


= TRUE


);


Sets the convexity of the edge to the given value.






public: void EDGE::set_end (


TVERTEX*, // end TVERTEX


logical reset_pattern // reset or not


= TRUE


);


Sets the EDGE's end TVERTEX. 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 EDGE::set_end (


VERTEX*, // end VERTEX


logical reset_pattern // reset or not


= TRUE


);


Sets the EDGE's end VERTEX. 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.






protected: virtual void EDGE::set_end_ptr (


VERTEX*, // end vertex


logical reset_pattern // reset or not


= TRUE


);


Assigns a pointer to the end vertex of the edge. The VERTEX pointer at either or both ends can be NULL, in which case the edge is taken to be unbounded in that direction. If the underlying curve is infinite, then so is the unbounded edge; if the curve is closed, then the vertex pointers must both be present or both NULL, and in the latter case the edge is the entire curve.






public: virtual void EDGE::set_geometry (


CURVE*, // geometry


logical reset_pattern // reset or not


= TRUE


);


Sets the geometry of the EDGE to be the given CURVE. Side effects of this method adjust the use counts of the existing and new geometry, and delete the existing geometry if it is no longer referenced. Before performing a change, this method checks whether the data structure is posted on the bulletin board. If not, it calls backup to put an entry on the bulletin board.






protected: virtual void EDGE::set_geometry_ptr (


CURVE* // curve geometry


);


Sets the pointer to the underlying curve geometry.






public: logical EDGE::set_param_range (


SPAinterval const& // interval range


);


This function checks the given range with the start and end vertexes if they do not agree it returns FALSE and does not set the range. If the range could be set it returns TRUE.






public: void EDGE::set_pattern (


pattern* in_pat
// pattern


);


Sets the pattern on this entity, replacing any existing pattern. This needs to be overridden if the pattern needs passing down to any child or sibling entities.






public: virtual void EDGE::set_sense (


REVBIT, // sense


logical reset_pattern // reset or not


= TRUE


);


Sets the sense of the EDGE relative to the underlying CURVE. 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 EDGE::set_start (


TVERTEX*, // start TVERTEX


logical reset_pattern // reset or not


= TRUE


);


Sets the EDGE's start TVERTEX. 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 EDGE::set_start (


VERTEX*, // start VERTEX


logical reset_pattern // reset or not


= TRUE


);


Sets the EDGE's start VERTEX. 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.






protected: virtual void EDGE::set_start_ptr (


VERTEX*, // start vertex


logical reset_pattern // reset or not


= TRUE


);


Assigns a pointer to the start vertex of the edge. The VERTEX pointer at either or both ends can be NULL, in which case the edge is taken to be unbounded in that direction. If the underlying curve is infinite, then so is the unbounded edge; if the curve is closed, then the vertex pointers must both be present or both NULL, and in the latter case the edge is the entire curve.






public: VERTEX* EDGE::start () const;


Returns a pointer to the start VERTEX. The pointer can be NULL.






public: virtual SPAvector EDGE::start_deriv () const;


Returns the derivative at the start parameter of the EDGE.






public: SPAparameter EDGE::start_param ();


Returns the parameter defining the start of the EDGE. This routine is for backwards compatibility. It saves the evaluated range and cannot be declared const.






public: SPAparameter EDGE::start_param () const;


Returns the parameter defining the start of the EDGE. This const version of this function is less efficient than the non-const version because it cannot store the computed parameter range in the edge for future use, but is required for constant edges.






public: virtual SPAposition EDGE::start_pos () const;


Returns the start position of the EDGE.






public: EDGE_cvty EDGE::string_convexity (


char* string // edge convexity


) const;


Assigns the convexity to the EDGE, for example, "concave", "tangent", "unknown", etc.






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


Returns the string "edge".






public: logical EDGE::vertex_bounded () const;


Returns TRUE if the edge is bounded by vertices.

Internal Use: save, save_common




Related Fncs: is_EDGE
PDF/KERN/31CLE.PDF
HTM/DATA/KERN/KERN/31CLE/0001.HTM