Class PatchVert
See Also: Class PatchMesh, Template Class Tab, Working with Patches.
Description:
This class stores the information associated with a patch vertex and provides methods to access the data associated with this vertex. All methods of this class are implemented by the system.
Data Members:
public:
Point3 p;
The vertex location.
IntTab vectors;
The list of vectors attached to this vertex. There can be any number of vectors attached to a vertex. For example consider the north pole of a sphere made from a set of triangular patches. If there were 16 patches meeting at this point there would be 16 vectors. The table contains the indices of these vectors. This is set up automatically when a developer calls buildLinkages().
Note: typedef Tab<int> IntTab;
Note that the methods below allow a developer to manipulate the tables of this class. Developers must be careful when doing so as it is easy to corrupt the patch data structures. It may be easier for developers to manipulate the patches, delete vertices, etc., by manipulating them in the PatchMesh and then call buildLinkages() again. The methods below do work however and may be used.
IntTab patches;
The list of patches using this vertex.
IntTab edges;
This data member is available in release 4.0 and later only.
The list of edges using this vertex. This table will be set up automatically when a developer calls buildLinkages().
DWORD flags;
The patch vertex flags
PVERT_COPLANAR
This constrains things such that this vertex and all the vectors that are attached to it are coplanar. If this is set, and you call ApplyConstraints(), the system will adjust the vectors to the average plane that they are in and then constrain them to it.
PVERT_CORNER
The vertex is a corner.
PVERT_HIDDEN
The vertex is hidden.
int aux1;
Used to track topo changes during editing (Edit Patch).
int aux2;
Used to track topology changes during editing (PatchMesh).
Methods:
Prototype:
PatchVert();
Remarks:
Constructor. The location is set to 0,0,0. The flags are set to 0.
Prototype:
PatchVert(PatchVert &from);
Remarks:
Constructor. The data members are copied from the from PatchVert.
Parameters:
PatchVert &from
The source PatchVert.
Prototype:
~PatchVert();
Remarks:
Destructor. Deletes the elements from the vectors table and patches table.
Prototype:
void ResetData();
Remarks:
This method deletes the elements from the vectors table and patches table.
Prototype:
int FindVector(int index);
Remarks:
Returns the index in this classes vectors table of the vector whose index is passed. If not found, -1 is returned.
Parameters:
int index
The index in the PatchMesh class vectors table (vecs) of the vector to find.
Prototype:
void AddVector(int index);
Remarks:
Adds the specified vector to this vector table.
Parameters:
int index
The index in the PatchMesh class vectors table (vecs) of the vector to add.
Prototype:
void DeleteVector(int index);
Remarks:
Deletes the specified vector from this vector table.
Parameters:
int index
The index in the PatchMesh class vectors table (vecs) of the vector to delete.
Prototype:
int FindPatch(int index);
Remarks:
Returns the index in this classes patches table of the patch whose index is passed. If not found, -1 is returned.
Parameters:
int index
The index in the PatchMesh class patches table (patches) of the patch to find.
Prototype:
void AddPatch(int index);
Remarks:
Adds the specified patch to this vector table.
Parameters:
int index
The index in the PatchMesh class patches table (patches) of the patch to add.
Prototype:
void DeletePatch(int index);
Remarks:
Deletes the patch specified by the index.
Parameters:
int index
The index in the PatchMesh class patches table (patches) of the patch to delete.
Prototype:
int FindEdge(int index);
Remarks:
Returns the index in this classes edges table of the patch whose index is passed. If not found, -1 is returned.
Parameters:
int index
The index in the PatchMesh class edges table (edges) of the edge to find.
Prototype:
void AddEdge(int index);
Remarks:
Adds the specified edge to this vector table.
Parameters:
int index
The index in the PatchMesh class edges table (edges) of the edge to add.
Prototype:
void DeleteEdge(int index);
Remarks:
Deletes the edge specified by the index.
Parameters:
int index
The index in the PatchMesh class edges table (edges) of the edge to delete.
Prototype:
void Transform(Matrix3 &tm);
Remarks:
This method is available in release 3.0 and later only.
Transform the vertex by the specified matrix.
Parameters:
Matrix3 &tm
The matrix which transforms the point.
Prototype:
void SetHidden(BOOL sw = TRUE);
Remarks:
This method is available in release 3.0 and later only.
Sets the hidded state of the vertex.
Parameters:
BOOL sw = TRUE
TRUE to set to hidden; FALSE for visible.
Prototype:
BOOL IsHidden();
Remarks:
This method is available in release 3.0 and later only.
Returns TRUE if the vertex is hidden; otherwise FALSE.
Prototype:
IOResult Save(ISave* isave);
Remarks:
This method is used internally to save the class data to disk storage.
Prototype:
IOResult Load(ILoad* iload);
Remarks:
This method is used internally to load the class data from disk storage.
Operators:
Prototype:
PatchVert& operator=(PatchVert& from);
Remarks:
Assignment operator.
Parameters:
PatchVert& from
The patch vertex to copy from.