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

Purpose: Represents a corner of a FACE and/or the end of an EDGE.

Derivation: VERTEX : ENTITY : ACIS_OBJECT : -

SAT Identifier: "vertex"

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

Description: A vertex is a 0-dimensional, topological entity that is used to bound an edge or a tedge. Generally, an edge is bounded by two distinct vertices; however, if the edge is closed, both ends of the edge are bounded by the same vertex. A vertex embodies the user's view of a corner of a face or the junction point of two edges. Each vertex is represented by a point in the geometric model. Two vertices can not exist at the same point.


A vertex maintains pointers to one or more of the edges which it bounds. Generally, a vertex contains a pointer to one of the edges it bounds. The other edges can be found by following the next, previous, and partner pointers of the coedges of the edges. When a body is nonmanifold at a vertex (i.e., more than one manifold group of faces meet at a vertex or a wire attaches to a face at a vertex), then the vertex must maintain a pointer to an edge in each group of faces and wires. The other edges in a manifold group of faces or a wire can be found by following coedge pointers.


Users may be interested in the topological traversal function sg_q_edges_around_vertex or sg_q_coedges_around_vertex, which returns a list of edges or coedges that share a given vertex. Users may also find the topological traversal functions located in kernel/sg_husk/query/q_vert.hxx useful for generating lists of vertices on other topological entities.

References: KERN APOINT, EDGE

by KERN EDGE, pattern_holder

Data: protected APOINT *geometry_ptr;

Pointer to the position of a VERTEX in space.


protected EDGE *edge_ptr;

Pointer to one edge on which the the VERTEX lies. If NULL, it may indicate that the vertex has a vertedge attribute that holds pointers to several edges at the vertex.

Constructor: public: VERTEX::VERTEX ();


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


APOINT* // point


);


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 VERTEX using the specified parameters. The argument defines the APOINT entity defining the position of this VERTEX in space and increments the APOINT's use count to reflect this new use.




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


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



Methods: public: void VERTEX::add_edge (


EDGE* // EDGE to add


);


Adds a pointer to the given EDGE to those pointers already in the 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 logical


VERTEX::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: logical VERTEX::copy_pattern_down (


ENTITY* target
// target


) const;


Copies the pattern through all children of the target entity.






public: int VERTEX::count_edges () const;


Counts the number of EDGEs pointed to by the VERTEX. The number of EDGEs ending in the VERTEX is equal to or, greater than, the number of pointers in the VERTEX.






public: virtual void VERTEX::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: void VERTEX::delete_edge (


EDGE* // edge pointer to remove


);


Removes a pointer to the given edge from the vertex. Does nothing if no such pointer exists.






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


Gets an EDGE at a VERTEX known to contain at most one pointer to an EDGE. This function returns NULL if the VERTEX contains more than one EDGE pointer.






public: EDGE* VERTEX::edge (


int
// ith EDGE


) const;


Gets the ith EDGE pointed to by the VERTEX. Use this function when the VERTEX contains pointers to more than one EDGE. An argument of zero (0) returns the expected result if the EDGE contains one pointer. Returns NULL if i is too great or negative.






public: logical VERTEX::edge_linked (


EDGE* // EDGE to test


) const;


Test if the given EDGE is pointed to by the VERTEX.






public: APOINT* VERTEX::geometry () const;


Returns the APOINT that defines the position of the VERTEX.






public: void VERTEX::get_all_patterns (


VOID_LIST& list
// pattern list


);


Returns all patterns in the list.






public: virtual double VERTEX::get_tolerance ();


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






public: virtual double


VERTEX::get_tolerance () const;


Returns the tolerance of the tolerant TVERTEX made from this VERTEX. 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 VERTEX::identity (


int
// level



= 0


) const;


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






public: virtual logical VERTEX::is_deepcopyable (


) const;


Returns TRUE if this can be deep copied.






public: logical VERTEX::is_pattern_child () const;


Returns TRUE if this is a pattern child. An entity is a "pattern child" when it is not responsible for creating new entities when the pattern is applied. Instead, some owning entity takes care of this.






public: TVERTEX* VERTEX::make_tolerant (


double tol // tolerance


);


Makes a tolerant TVERTEX from this VERTEX.






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


Returns a pointer to the owning entity.






public: logical VERTEX::remove_from_pattern_list ();


Remove from the pattern list.






public: void VERTEX::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_ptr Pointer to record in save file for an edge which uses vertex

read_ptr



Pointer to record in save file for point at which vertex lies






public: void VERTEX::set_edge (


EDGE*, // EDGE to set


logical reset_pattern // reset or not



= TRUE


);


Deletes any existing pointers to EDGEs in the VERTEX and then places a pointer to the given EDGE in the 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.






public: void VERTEX::set_geometry (


APOINT*, // geometry to set


logical reset_pattern // reset or not



= TRUE


);


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 VERTEX::set_pattern (


pattern* in_pat
// pattern


);


Set the current pattern.






public: virtual const char*


VERTEX::type_name () const;


Returns the string "vertex".

Internal Use: save, save_common




Related Fncs: is_VERTEX
PDF/KERN/39CLU.PDF
HTM/DATA/KERN/KERN/39CLU/0010.HTM