Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

NhalfEdgeVertex Class Reference

#include <NhalfEdgeVertex.h>

Inheritance diagram for NhalfEdgeVertex:

Inheritance graph
[legend]
Collaboration diagram for NhalfEdgeVertex:

Collaboration graph
[legend]
List of all members.

Detailed Description

vertex for use with half-edge mesh data structure

Definition at line 18 of file NhalfEdgeVertex.h.

Public Member Functions

constructors
 NhalfEdgeVertex ()
 basic constructor

operators
BOOL operator< (NhalfEdgeVertex &vertex)
 less than operator based on gain

BOOL operator> (NhalfEdgeVertex &vertex)
 greator than operator based on gain

BOOL operator<= (NhalfEdgeVertex &vertex)
 less than equals operator based on gain

queries
BOOL isVisited () const
 is visited

BOOL isActive () const
 is active

BOOL isDeleted () const
 is deleted

BOOL isComposite () const
 is composite

BOOL onPartition ()
 is the vertex on the border between partitions

BOOL isIsolated ()
 is the vertex connectd to another in the same partition

BOOL isConnectedTo (NhalfEdgeVertex *pVertex)
 is the vertex connected to another vertex

BOOL isMovable ()
 can the vertex be moved from one partition to another?

U32 getValence ()
 get the valence

U32 getTotalIncidentEdges ()
 get the total number of incident edges

U32 getPartition () const
 get the partition number

R32 getGain ()
 get the gain

BOOL findEdge (const NhalfEdge *pEdge)
 find whether an edge impact a vertex

NhalfEdgefindEdge (const NhalfEdgeVertex *pVertex)
 get the edge between two vertices

NhalfEdgefindDirectedEdge (const NhalfEdgeVertex *pVertex)
 get the directed edge between two vertices

R32 getWeight () const
 get the weight of the vertex

BOOL getNeighbors (std::vector< NhalfEdgeVertex * > *pVertexArray)
 gets the neighbors of the vertex .. possibly in fan order

set properties
void setVisited (const BOOL visited)
 set the vertex visited

void setActive (const BOOL active)
 set the vertex active

void setDeleted (const BOOL deleted)
 set the vertex deleted

void setPartition (const U32 index)
 set the vertex's partition number

void setWeight (const R32 weight)
 set the weight of the vertex

complex operations
void addEdge (NhalfEdge *pEdge)
 sets the weight for the vertex

void removeEdge (NhalfEdge *pEdge)
 remove an edge from the vertex

void clearEdgeList ()
 clear the edge list for a vertex


Protected Member Functions

private composite operations
void setComposite (const BOOL composite)
 make the vertex a composite or not

NhalfEdgeVertexgetCompositeVertexA ()
 get one vertex contained within composite vertex

NhalfEdgeVertexgetCompositeVertexB ()
 get the other vertex contain within the composite

void setComposite (NhalfEdgeVertex *pV1, NhalfEdgeVertex *pV2)
 make the vertex a composite

private basic operations
U32 getIndex () const
 get the index for the vertex

void setIndex (const U32 index)
 set the index for the vertex

private debug operations
void log ()
 write the iformation for the vertex to a file


Protected Attributes

U32 m_index
 index to be used by NhalfEdgeMesh only

U32 m_valence
 valence of the vertex

U32 m_attributeMask
 attribute mask

U32 m_partition
 partition number

R32 m_weight
 weight

NhalfEdgem_savedEdge
 data for "composite" nodes

NhalfEdgeVertexm_pSavedV1
 saved vertex

NhalfEdgeVertexm_pSavedV2
 saved vertex

std::vector< NhalfEdge * > m_OutGoingEdgeList
 edge list of outgoing half edges

std::vector< NhalfEdge * > m_InComingEdgeList
 edge list of incoming half edges


Friends

class NhalfEdgeMesh
class NhalfEdge


Constructor & Destructor Documentation

NhalfEdgeVertex::NhalfEdgeVertex  ) 
 

basic constructor

Definition at line 9 of file NhalfEdgeVertex.cpp.

References FALSE, m_attributeMask, m_index, m_partition, m_pSavedV1, m_pSavedV2, m_savedEdge, m_valence, m_weight, setActive(), setComposite(), setDeleted(), and TRUE.

Referenced by gmVertex::gmVertex().


Member Function Documentation

void NhalfEdgeVertex::addEdge NhalfEdge pEdge  ) 
 

sets the weight for the vertex

Parameters:
pEdge a pointer to an edge the connect the vertex to another
See also:
findEdge()

removeInComingEdge()

removeOutGoingeEdge()

Definition at line 416 of file NhalfEdgeVertex.cpp.

References NhalfEdge::getOpposite(), NhalfEdge::getVertexA(), NhalfEdge::getVertexB(), m_InComingEdgeList, m_OutGoingEdgeList, and m_valence.

Referenced by NhalfEdgeMesh::addHalfEdge(), and NhalfEdgeMesh::uncollapseVertex().

void NhalfEdgeVertex::clearEdgeList  ) 
 

clear the edge list for a vertex

Definition at line 606 of file NhalfEdgeVertex.cpp.

References m_InComingEdgeList, and m_OutGoingEdgeList.

NhalfEdge * NhalfEdgeVertex::findDirectedEdge const NhalfEdgeVertex pVertex  ) 
 

get the directed edge between two vertices

See also:
findEdge()
Returns:
returns half edge going from this to pVertex

Reimplemented in gmVertex, and ParticleVertex.

Definition at line 474 of file NhalfEdgeVertex.cpp.

References m_OutGoingEdgeList.

Referenced by ParticleVertex::findDirectedEdge(), gmVertex::findDirectedEdge(), and isMovable().

NhalfEdge * NhalfEdgeVertex::findEdge const NhalfEdgeVertex pVertex  ) 
 

get the edge between two vertices

See also:
findDirectedEdge()
Returns:
returns half edge going from this to pVertex

Reimplemented in gmVertex, and ParticleVertex.

Definition at line 455 of file NhalfEdgeVertex.cpp.

References m_InComingEdgeList, and m_OutGoingEdgeList.

BOOL NhalfEdgeVertex::findEdge const NhalfEdge pEdge  ) 
 

find whether an edge impact a vertex

Returns:
returns true if this edge connects to vertex

Definition at line 432 of file NhalfEdgeVertex.cpp.

References BOOL, FALSE, NhalfEdge::getVertexA(), NhalfEdge::getVertexB(), NhalfEdge::isActive(), m_InComingEdgeList, m_OutGoingEdgeList, and TRUE.

Referenced by NhalfEdgeMesh::activatePartition(), NhalfEdgeMesh::collapseEdge(), ParticleVertex::findEdge(), gmVertex::findEdge(), and NhalfEdge::isContractable().

NhalfEdgeVertex * NhalfEdgeVertex::getCompositeVertexA  )  [protected]
 

get one vertex contained within composite vertex

See also:
getCompositeVertexB()

NhalfEdge::collapseEdge()

NhalfEdge::unCollapseVertex()

Returns:
pointer to the uncollaped vertex

Definition at line 180 of file NhalfEdgeVertex.cpp.

References isComposite(), isDeleted(), and m_pSavedV1.

Referenced by NhalfEdgeMesh::uncollapseVertex().

NhalfEdgeVertex * NhalfEdgeVertex::getCompositeVertexB  )  [protected]
 

get the other vertex contain within the composite

See also:
getCompositeVertexA()

NhalfEdge::collapseEdge()

NhalfEdge::unCollapseVertex()

Returns:
pointer to the uncollaped vertex

Definition at line 197 of file NhalfEdgeVertex.cpp.

References isComposite(), isDeleted(), and m_pSavedV2.

Referenced by NhalfEdgeMesh::uncollapseVertex().

R32 NhalfEdgeVertex::getGain  ) 
 

get the gain

Returns:
returns cut improvement

Definition at line 562 of file NhalfEdgeVertex.cpp.

References getPartition(), m_InComingEdgeList, m_OutGoingEdgeList, and R32.

Referenced by NhalfEdgeMesh::FMoptimization(), NhalfEdgeVertexPtrGain::operator()(), operator<(), operator<=(), operator>(), and NhalfEdgeMesh::switchPartitions().

U32 NhalfEdgeVertex::getIndex  )  const [protected]
 

get the index for the vertex

See also:
setIndex()
Returns:
returns the index for the vertex

Definition at line 74 of file NhalfEdgeVertex.cpp.

References U32.

Referenced by NhalfEdgeMesh::collapseEdge(), and isMovable().

BOOL NhalfEdgeVertex::getNeighbors std::vector< NhalfEdgeVertex * > *  pVertexArray  ) 
 

gets the neighbors of the vertex .. possibly in fan order

Parameters:
pVertexArray an array to store the neighbor pointers
Returns:
returns true if fan ordering, otherwise false.

Definition at line 233 of file NhalfEdgeVertex.cpp.

References BOOL, FALSE, NhalfEdge::getNext(), NhalfEdge::getOpposite(), NhalfEdge::getVertexA(), NhalfEdge::getVertexB(), NhalfEdge::isActive(), m_InComingEdgeList, and TRUE.

Referenced by NhalfEdgeMesh::depthFirstSearch(), ParticleVertex::getNeighbors(), gmVertex::getNeighbors(), NhalfEdge::isContractable(), and isMovable().

U32 NhalfEdgeVertex::getPartition  )  const
 

get the partition number

Returns:
returns the partition number for the vertex

Definition at line 93 of file NhalfEdgeVertex.cpp.

References U32.

Referenced by NhalfEdgeMesh::activatePartition(), NhalfEdgeMesh::FMoptimization(), getGain(), isIsolated(), isMovable(), NhalfEdgeMesh::switchPartitions(), and NhalfEdgeMesh::uncollapseVertex().

U32 NhalfEdgeVertex::getTotalIncidentEdges  ) 
 

get the total number of incident edges

Returns:
returns the total number of incident edges.

Definition at line 497 of file NhalfEdgeVertex.cpp.

References m_InComingEdgeList, m_OutGoingEdgeList, and U32.

U32 NhalfEdgeVertex::getValence  ) 
 

get the valence

Returns:
the valence of the vertex

Definition at line 488 of file NhalfEdgeVertex.cpp.

References m_valence, and U32.

R32 NhalfEdgeVertex::getWeight  )  const
 

get the weight of the vertex

Returns:
returns the weight stored at the vertex

Definition at line 404 of file NhalfEdgeVertex.cpp.

References R32.

Referenced by NhalfEdgeMesh::collapseEdge(), NhalfEdgeMesh::drawInitialPartitions(), and NhalfEdgeMesh::switchPartitions().

BOOL NhalfEdgeVertex::isActive  )  const
 

is active

See also:
setActive()
Returns:
returns true if vertex is active

Definition at line 123 of file NhalfEdgeVertex.cpp.

References BOOL, FALSE, and N_VERTEX_ACTIVE.

Referenced by NhalfEdgeMesh::activateVertex(), NhalfEdgeMesh::depthFirstSearch(), isConnectedTo(), NhalfEdgeMesh::isInHalfEdgeMesh(), NhalfEdgeMesh::partitionFromConnectedness(), and NhalfEdgeMesh::switchPartitions().

BOOL NhalfEdgeVertex::isComposite  )  const
 

is composite

See also:
NhalfEdge::contractEdge()
Returns:
returns true if vertex is a composited

Definition at line 145 of file NhalfEdgeVertex.cpp.

References BOOL, and N_VERTEX_COMPOSITE.

Referenced by getCompositeVertexA(), and getCompositeVertexB().

BOOL NhalfEdgeVertex::isConnectedTo NhalfEdgeVertex pVertex  ) 
 

is the vertex connected to another vertex

Parameters:
pVertex pointer to vertex
Returns:
returns true if vertex connected to pVertex by an edge

Definition at line 525 of file NhalfEdgeVertex.cpp.

References BOOL, FALSE, isActive(), m_InComingEdgeList, m_OutGoingEdgeList, and TRUE.

BOOL NhalfEdgeVertex::isDeleted  )  const
 

is deleted

See also:
setDeleted()
Returns:
returns true if vertex has been deleted

Definition at line 212 of file NhalfEdgeVertex.cpp.

References BOOL, and N_VERTEX_DELETED.

Referenced by NhalfEdgeMesh::cleanUpVertexList(), getCompositeVertexA(), getCompositeVertexB(), NhalfEdgeMesh::isInHalfEdgeMesh(), operator<(), operator<=(), operator>(), and NhalfEdgeMesh::switchPartitions().

BOOL NhalfEdgeVertex::isIsolated  ) 
 

is the vertex connectd to another in the same partition

Returns:
returns true if vertex connected to vertex in same partition

Definition at line 544 of file NhalfEdgeVertex.cpp.

References BOOL, getPartition(), m_InComingEdgeList, and m_OutGoingEdgeList.

Referenced by NhalfEdgeMesh::FMoptimization().

BOOL NhalfEdgeVertex::isMovable  ) 
 

can the vertex be moved from one partition to another?

Definition at line 277 of file NhalfEdgeVertex.cpp.

References BOOL, FALSE, findDirectedEdge(), getIndex(), getNeighbors(), NhalfEdge::getNext(), getPartition(), NhalfEdge::getVertexB(), TRUE, and U32.

Referenced by NhalfEdgeMesh::FMoptimization().

BOOL NhalfEdgeVertex::isVisited  )  const
 

is visited

See also:
setVisited()
Returns:
returns true if vertex has been visited

Definition at line 103 of file NhalfEdgeVertex.cpp.

References BOOL, and N_VERTEX_VISITED.

Referenced by NhalfEdgeMesh::depthFirstSearch(), and NhalfEdgeMesh::partitionFromConnectedness().

void NhalfEdgeVertex::log  )  [protected]
 

write the iformation for the vertex to a file

Definition at line 615 of file NhalfEdgeVertex.cpp.

Referenced by NhalfEdgeMesh::collapseEdge().

BOOL NhalfEdgeVertex::onPartition  ) 
 

is the vertex on the border between partitions

Returns:
returns true if vertex connected to neighbors in different partitions

Definition at line 591 of file NhalfEdgeVertex.cpp.

References BOOL, FALSE, m_InComingEdgeList, m_OutGoingEdgeList, m_partition, and TRUE.

BOOL NhalfEdgeVertex::operator< NhalfEdgeVertex vertex  ) 
 

less than operator based on gain

See also:
getGain()
Parameters:
vertex a half edge vertex

Definition at line 25 of file NhalfEdgeVertex.cpp.

References BOOL, getGain(), isDeleted(), and vertex.

BOOL NhalfEdgeVertex::operator<= NhalfEdgeVertex vertex  ) 
 

less than equals operator based on gain

See also:
getGain()
Parameters:
vertex a half edge vertex

Definition at line 51 of file NhalfEdgeVertex.cpp.

References BOOL, getGain(), isDeleted(), and vertex.

BOOL NhalfEdgeVertex::operator> NhalfEdgeVertex vertex  ) 
 

greator than operator based on gain

See also:
getGain()
Parameters:
vertex a half edge vertex

Definition at line 38 of file NhalfEdgeVertex.cpp.

References BOOL, getGain(), isDeleted(), and vertex.

void NhalfEdgeVertex::removeEdge NhalfEdge pEdge  ) 
 

remove an edge from the vertex

Parameters:
pEdge a pointer to the incoming edge

Definition at line 506 of file NhalfEdgeVertex.cpp.

References NhalfEdge::getOpposite(), NhalfEdge::getVertexA(), NhalfEdge::getVertexB(), m_InComingEdgeList, m_OutGoingEdgeList, and m_valence.

Referenced by NhalfEdgeMesh::activatePartition(), NhalfEdgeMesh::collapseEdge(), NhalfEdgeMesh::deleteEdge(), NhalfEdgeMesh::deleteFace(), NhalfEdgeMesh::deleteVertex(), and NhalfEdgeMesh::uncollapseVertex().

void NhalfEdgeVertex::setActive const BOOL  active  ) 
 

set the vertex active

Parameters:
active TRUE if you want vertex visited otherwise FALSE
See also:
isVisited()

Definition at line 134 of file NhalfEdgeVertex.cpp.

References BOOL, m_attributeMask, and N_VERTEX_ACTIVE.

Referenced by NhalfEdgeMesh::activateVertex(), NhalfEdgeMesh::deActivateVertex(), and NhalfEdgeVertex().

void NhalfEdgeVertex::setComposite NhalfEdgeVertex pV1,
NhalfEdgeVertex pV2
[protected]
 

make the vertex a composite

See also:
NhalfEdge::contractEdge()

Definition at line 165 of file NhalfEdgeVertex.cpp.

References m_attributeMask, m_pSavedV1, m_pSavedV2, and N_VERTEX_COMPOSITE.

void NhalfEdgeVertex::setComposite const BOOL  composite  )  [protected]
 

make the vertex a composite or not

Parameters:
composite TRUE if you want vertex a composite otherwise FALSE
See also:
isComposite()

Definition at line 155 of file NhalfEdgeVertex.cpp.

References BOOL, m_attributeMask, and N_VERTEX_COMPOSITE.

Referenced by NhalfEdgeMesh::collapseEdge(), and NhalfEdgeVertex().

void NhalfEdgeVertex::setDeleted const BOOL  deleted  ) 
 

set the vertex deleted

Parameters:
deleted TRUE if you want vertex deleted otherwise FALSE
See also:
isDeleted()

Definition at line 222 of file NhalfEdgeVertex.cpp.

References BOOL, m_attributeMask, and N_VERTEX_DELETED.

Referenced by NhalfEdgeMesh::deleteVertex(), NhalfEdgeVertex(), and NhalfEdgeMesh::uncollapseVertex().

void NhalfEdgeVertex::setIndex const U32  index  )  [protected]
 

set the index for the vertex

See also:
getIndex()
Returns:
returns the index for the vertex

Definition at line 64 of file NhalfEdgeVertex.cpp.

References m_index, and U32.

Referenced by NhalfEdgeMesh::addVertex().

void NhalfEdgeVertex::setPartition const U32  partition  ) 
 

set the vertex's partition number

Parameters:
partition The new partition number for the vertex
See also:
getPartition()

Definition at line 84 of file NhalfEdgeVertex.cpp.

References m_partition, and U32.

Referenced by NhalfEdgeMesh::drawInitialPartitions(), NhalfEdgeMesh::partitionFromConnectedness(), NhalfEdgeMesh::switchPartitions(), and NhalfEdgeMesh::uncollapseVertex().

void NhalfEdgeVertex::setVisited const BOOL  visited  ) 
 

set the vertex visited

Parameters:
visited TRUE if you want vertex visited otherwise FALSE
See also:
getVisited()

Definition at line 112 of file NhalfEdgeVertex.cpp.

References BOOL, m_attributeMask, and N_VERTEX_VISITED.

Referenced by NhalfEdgeMesh::depthFirstSearch(), NhalfEdgeMesh::FMoptimization(), and NhalfEdgeMesh::partitionFromConnectedness().

void NhalfEdgeVertex::setWeight const R32  weight  ) 
 

set the weight of the vertex

Parameters:
weight vertex weight
See also:
getWeight()

Definition at line 395 of file NhalfEdgeVertex.cpp.

References m_weight, and R32.

Referenced by NhalfEdgeMesh::collapseEdge().


Friends And Related Function Documentation

friend class NhalfEdge [friend]
 

Definition at line 20 of file NhalfEdgeVertex.h.

friend class NhalfEdgeMesh [friend]
 

Definition at line 19 of file NhalfEdgeVertex.h.


Member Data Documentation

U32 NhalfEdgeVertex::m_attributeMask [protected]
 

attribute mask

Definition at line 131 of file NhalfEdgeVertex.h.

Referenced by NhalfEdgeVertex(), setActive(), setComposite(), setDeleted(), and setVisited().

std::vector< NhalfEdge *> NhalfEdgeVertex::m_InComingEdgeList [protected]
 

edge list of incoming half edges

Definition at line 145 of file NhalfEdgeVertex.h.

Referenced by addEdge(), clearEdgeList(), NhalfEdgeMesh::collapseEdge(), findEdge(), getGain(), getNeighbors(), getTotalIncidentEdges(), isConnectedTo(), isIsolated(), onPartition(), removeEdge(), and NhalfEdgeMesh::uncollapseVertex().

U32 NhalfEdgeVertex::m_index [protected]
 

index to be used by NhalfEdgeMesh only

Definition at line 127 of file NhalfEdgeVertex.h.

Referenced by NhalfEdgeVertex(), and setIndex().

std::vector< NhalfEdge *> NhalfEdgeVertex::m_OutGoingEdgeList [protected]
 

edge list of outgoing half edges

Definition at line 143 of file NhalfEdgeVertex.h.

Referenced by addEdge(), clearEdgeList(), NhalfEdgeMesh::deleteVertex(), findDirectedEdge(), findEdge(), getGain(), getTotalIncidentEdges(), isConnectedTo(), isIsolated(), onPartition(), NhalfEdgeMesh::partitionFromConnectedness(), removeEdge(), and NhalfEdgeMesh::uncollapseVertex().

U32 NhalfEdgeVertex::m_partition [protected]
 

partition number

Definition at line 133 of file NhalfEdgeVertex.h.

Referenced by NhalfEdgeVertex(), onPartition(), and setPartition().

NhalfEdgeVertex* NhalfEdgeVertex::m_pSavedV1 [protected]
 

saved vertex

Definition at line 139 of file NhalfEdgeVertex.h.

Referenced by getCompositeVertexA(), NhalfEdgeVertex(), and setComposite().

NhalfEdgeVertex* NhalfEdgeVertex::m_pSavedV2 [protected]
 

saved vertex

Definition at line 141 of file NhalfEdgeVertex.h.

Referenced by getCompositeVertexB(), NhalfEdgeVertex(), and setComposite().

NhalfEdge* NhalfEdgeVertex::m_savedEdge [protected]
 

data for "composite" nodes

Definition at line 137 of file NhalfEdgeVertex.h.

Referenced by NhalfEdgeVertex().

U32 NhalfEdgeVertex::m_valence [protected]
 

valence of the vertex

Definition at line 129 of file NhalfEdgeVertex.h.

Referenced by addEdge(), getValence(), NhalfEdgeVertex(), and removeEdge().

R32 NhalfEdgeVertex::m_weight [protected]
 

weight

Definition at line 135 of file NhalfEdgeVertex.h.

Referenced by NhalfEdgeVertex(), and setWeight().


The documentation for this class was generated from the following files:
Generated on Mon Jun 28 15:02:32 2004 for Advanced Surface Library by doxygen 1.3.4