Public Member Functions | Public Attributes

PatchVert Class Reference

Search for all occurrences

Detailed Description

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:
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).

#include <patch.h>

Inheritance diagram for PatchVert:
Inheritance graph
[legend]

List of all members.

Public Member Functions

CoreExport  PatchVert ()
CoreExport  PatchVert (PatchVert &from)
  ~PatchVert ()
CoreExport PatchVert operator= (PatchVert &from)
CoreExport void  ResetData ()
CoreExport int  FindVector (int index)
CoreExport void  AddVector (int index)
CoreExport void  DeleteVector (int index)
CoreExport int  FindPatch (int index)
CoreExport void  AddPatch (int index)
CoreExport void  DeletePatch (int index)
CoreExport int  FindEdge (int index)
CoreExport void  AddEdge (int index)
CoreExport void  DeleteEdge (int index)
void  Transform (Matrix3 &tm)
CoreExport void  SetHidden (BOOL sw=TRUE)
BOOL  IsHidden ()
CoreExport IOResult  Save (ISave *isave)
CoreExport IOResult  Load (ILoad *iload)

Public Attributes

Point3  p
IntTab  vectors
IntTab  patches
IntTab  edges
DWORD  flags
int  aux1
int  aux2

Constructor & Destructor Documentation

CoreExport PatchVert ( )
Remarks:
Constructor. The location is set to 0,0,0. The flags are set to 0.
CoreExport PatchVert ( PatchVert from )
Remarks:
Constructor. The data members are copied from the from PatchVert.
Parameters:
PatchVert &from

The source PatchVert.
~PatchVert ( ) [inline]
Remarks:
Destructor. Deletes the elements from the vectors table and patches table.
{ ResetData(); }

Member Function Documentation

CoreExport PatchVert& operator= ( PatchVert from )
Remarks:
Assignment operator.
Parameters:
PatchVert& from

The patch vertex to copy from.
CoreExport void ResetData ( )
Remarks:
This method deletes the elements from the vectors table and patches table.
CoreExport 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.
CoreExport 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.
CoreExport 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.
CoreExport 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.
CoreExport 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.
CoreExport 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.
CoreExport 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.
CoreExport 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.
CoreExport 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.
void Transform ( Matrix3 tm ) [inline]
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.
{ p = p * tm; }
CoreExport void SetHidden ( BOOL  sw = TRUE ) [inline]
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.
            {
            if(sw)
                flags |= PVERT_HIDDEN;
            else
                flags &= ~PVERT_HIDDEN;
            }
BOOL IsHidden ( ) [inline]
Remarks:
This method is available in release 3.0 and later only.

Returns TRUE if the vertex is hidden; otherwise FALSE.
{ return (flags & PVERT_HIDDEN) ? TRUE : FALSE; }
CoreExport IOResult Save ( ISave isave )
Remarks:
This method is used internally to save the class data to disk storage.
CoreExport IOResult Load ( ILoad iload )
Remarks:
This method is used internally to load the class data from disk storage.
Operators:

Member Data Documentation

DWORD flags
int aux1
int aux2

PatchVert PatchVert PatchVert PatchVert PatchVert PatchVert PatchVert PatchVert PatchVert PatchVert
PatchVert PatchVert PatchVert PatchVert PatchVert PatchVert PatchVert PatchVert PatchVert PatchVert