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

NhalfEdgeMesh Class Reference

#include <NhalfEdgeMesh.h>

Inheritance diagram for NhalfEdgeMesh:

Inheritance graph
[legend]
List of all members.

Detailed Description

half-edge mesh data structure

Definition at line 14 of file NhalfEdgeMesh.h.

Public Member Functions

void clear ()
 clear the mesh.. deletes memory for edges and vertices

constructors
 NhalfEdgeMesh ()
 basic constructor

 ~NhalfEdgeMesh ()
 basic destructor ..deletes memory for edges and vertices

adding edges and vertices
NhalfEdgeVertexaddVertex ()
 create a new vertex in the mesh

void addVertex (NhalfEdgeVertex *pVertex)
 insert a new vertex into the mesh

NhalfEdgeaddHalfEdge (NhalfEdgeVertex *pV1, NhalfEdgeVertex *pV2)
 create a new half edge in the mesh

void addHalfEdge (NhalfEdge *pEdge)
 insert a new half edge into the mesh

deleting edges and vertices
void deleteVertex (NhalfEdgeVertex *pVertex)
 delete a vertex from the mesh

void deleteEdge (NhalfEdge *pEdge)
 deletes an edge from the mesh

void deleteFace (NhalfEdge *pEdge)
 deletes a face from the mesh

temporary deletion of edges and vertices
void deActivateEdge (NhalfEdge *pEdge)
 deactivate an edge in the mesh

void activateEdge (NhalfEdge *pEdge)
 activate an edge in the mesh

void activateVertex (NhalfEdgeVertex *pVertex)
 activate a vertex in the mesh

void deActivateVertex (NhalfEdgeVertex *pVertex)
 de-activates vertex in the mesh

void activatePartition (const U32 partition)
 de-activates vertices and edges not part of a partition

void reActivate ()
 re-activates all vertices and edges in the mesh

simple mesh queries
U32 getNumVertices () const
 gets the number of vertices in the mesh

U32 getNumEdges () const
 gets the number of edges in the mesh

U32 getNumFaces ()
 gets the number of faces in the mesh

U32 getNumPartitions () const
 gets the number of edges in the mesh

BOOL isInHalfEdgeMesh (const NhalfEdgeVertex *pVertex)
 tests to see if a vertex is in the mesh or not

BOOL isInHalfEdgeMesh (const NhalfEdge *pEdge)
 tests to see if a vertex is in the mesh or not

BOOL allVerticesVisited ()
 tests whether all vertices have been visited

BOOL allVerticesVisited (const U32 partition)
 tests whether all vertices for a partition have been visited

U32 getPartitionCount (U32 partition)
 get the number of vertices for a given partition

BOOL allEdgesVisited ()
 tests to see whether all edges have been visited

BOOL depthFirstSearch ()
 performs a depth first search to see if all "active" vertices are connected

BOOL depthFirstSearch (const U32 partition)
 performs a depth first search to see if all "active" vertices in a partition are connected

simple mesh operations
void markVerticesUnVisited ()
 marks all active vertices in the graph as unvisited

void markVerticesUnVisited (const U32 partition)
 marks all vertices in a given partition as unvisited

void markEdgesUnVisited ()
 test to see whether all edges have been visited

void getActiveEdgeList (std::vector< NhalfEdge * > *pEdgeArray)
 gets a list of pointers to active edges

NhalfEdgegetFirstActiveEdge ()
 gets the first active edge in the graph

void getActiveVertexList (std::vector< NhalfEdgeVertex * > *pVertexArray)
 gets a list of pointers to active vertices in the graph

NhalfEdgeVertexgetFirstActiveVertex ()
 gets the first active vertex

NhalfEdgeVertexgetFirstActiveVertex (const U32 partition)
 gets the first active vertex in a partition

complex mesh operations
NhalfEdgeVertexcollapseEdge (NhalfEdge *pEdge)
 edge collapse for simplification and partitioning

NhalfEdgeuncollapseVertex (NhalfEdgeVertex *pVertex1)
 edge uncollapse for simplification and partitiong

void setPartitionFeatures (const R32 percentContraction, const U32 FMopt, const R32 FMbalance)
 settings for partitioning code

void putActiveVerticesInPartition (const U32 partition)
 put all active vertices into a partition

void partition (const U32 partitions)
 partitioning

void partitionFromConnectedness ()
 create partitions by connectedness

void log ()
 writes mesh to execution log

void computeCutSize ()
 compute the size of the cut

R32 getCutSize () const
 get the size of the cut


Protected Member Functions

private memory mesh operations
void cleanUpVertexList ()
 performs lazy deletion...

void cleanUpEdgeList ()
 performs lazy deletion...

private complex operations
void normalizeEdgeWeights ()
void normalizeVertexWeights ()
 make vertex weights sum to 1

void findMatching (std::vector< NhalfEdge * > *pMatchingArray)
 find a matching on the mesh

void optimalPartition ()
 optimalPartition

void FMoptimization ()
 FM optimization used by the partitioning algorithm.

void drawInitialPartitions ()
 A greedy algorithm for drawing a partition on the graph.

BOOL partitionsBalanced () const
 Returns true if the partitions are balanced with tolerance.

void switchPartitions (NhalfEdgeVertex *pV, const U32 dest)
 move a vertex from one partition to another

void computePartitionWeights ()
 computes the weight of the partitions

void contractMesh (std::stack< NhalfEdgeVertex * > *pContractionStack, const R32 percentage)
 contract the mesh down to a certain percentage


Protected Attributes

U32 m_vertexCount
 number of vertices in the mesh

U32 m_edgeCount
 number of edges in the mesh

R32 m_cutSize
 size of the cut

R32 m_totalWeight
 total weight of the graph ???

U32 m_partitions
 number of partitions

std::vector< R32m_partitionWeight
 weight for each partition

std::vector< NhalfEdge * > * m_pEdgeList
 list of halfedges

std::vector< NhalfEdgeVertex * > * m_pVertexList
 list of vertices

std::vector< NhalfEdge * > m_tempPartitionEdgeList
 list of temporary halfedges

R32 m_percentContraction
 amount to contract the graph down to

U32 m_FMopt
 whether to perform FM optimization

R32 m_FMbalance
 strictness of the balance criteria

std::stack< NhalfEdgeVertex * > m_contractionStack
 stack to store contracted vertices

U32 m_greatestContractionLevel


Constructor & Destructor Documentation

NhalfEdgeMesh::NhalfEdgeMesh  ) 
 

basic constructor

Definition at line 10 of file NhalfEdgeMesh.cpp.

References clear(), m_pEdgeList, and m_pVertexList.

NhalfEdgeMesh::~NhalfEdgeMesh  ) 
 

basic destructor ..deletes memory for edges and vertices

Definition at line 22 of file NhalfEdgeMesh.cpp.

References clear().


Member Function Documentation

void NhalfEdgeMesh::activateEdge NhalfEdge pEdge  ) 
 

activate an edge in the mesh

Parameters:
pEdge points to a edge in the mesh to be deleted

Definition at line 223 of file NhalfEdgeMesh.cpp.

References NhalfEdge::isActive(), m_edgeCount, NhalfEdge::setActive(), and TRUE.

Referenced by reActivate(), and uncollapseVertex().

void NhalfEdgeMesh::activatePartition const U32  partition  ) 
 

de-activates vertices and edges not part of a partition

Parameters:
partition partition to remain active

Definition at line 270 of file NhalfEdgeMesh.cpp.

References addHalfEdge(), deActivateEdge(), deActivateVertex(), depthFirstSearch(), NhalfEdge::disconnectFromOpposite(), NhalfEdgeVertex::findEdge(), getActiveVertexList(), NhalfEdge::getNext(), NhalfEdgeVertex::getPartition(), NhalfEdge::getVertexA(), NhalfEdge::getVertexB(), NhalfEdge::isActive(), NhalfEdge::isDeleted(), m_pEdgeList, m_pVertexList, m_tempPartitionEdgeList, reActivate(), NhalfEdgeVertex::removeEdge(), NhalfEdge::setNext(), NhalfEdge::setOpposite(), NhalfEdge::setWeight(), and U32.

void NhalfEdgeMesh::activateVertex NhalfEdgeVertex pVertex  ) 
 

activate a vertex in the mesh

Parameters:
pVertex points to a edge in the graph to be deleted

Definition at line 255 of file NhalfEdgeMesh.cpp.

References NhalfEdgeVertex::isActive(), m_vertexCount, NhalfEdgeVertex::setActive(), and TRUE.

Referenced by reActivate(), and uncollapseVertex().

void NhalfEdgeMesh::addHalfEdge NhalfEdge pEdge  ) 
 

insert a new half edge into the mesh

note the edge pointed to by pEdge gets destroyed when the graph is destroyed!

Parameters:
pEdge pointers to an edge;

Definition at line 111 of file NhalfEdgeMesh.cpp.

References NhalfEdgeVertex::addEdge(), NhalfEdge::getVertexA(), NhalfEdge::getVertexB(), m_edgeCount, m_pEdgeList, and NhalfEdge::setIndex().

NhalfEdge * NhalfEdgeMesh::addHalfEdge NhalfEdgeVertex pV1,
NhalfEdgeVertex pV2
 

create a new half edge in the mesh

Parameters:
pV1 pointers to a vertex in the mesh
pV2 pointer to a vertex in the mesh different from pV1
Returns:
pointer to the newly created half edge in the mesh

Definition at line 87 of file NhalfEdgeMesh.cpp.

References NhalfEdgeVertex::addEdge(), m_edgeCount, m_pEdgeList, and NhalfEdge::setIndex().

Referenced by activatePartition(), ParticleMesh::addHalfEdge(), gmMesh::addHalfEdge(), and collapseEdge().

void NhalfEdgeMesh::addVertex NhalfEdgeVertex pVertex  ) 
 

insert a new vertex into the mesh

Parameters:
pVertex .. a point to a new mesh vertex

Definition at line 74 of file NhalfEdgeMesh.cpp.

References m_pVertexList, m_vertexCount, and NhalfEdgeVertex::setIndex().

NhalfEdgeVertex * NhalfEdgeMesh::addVertex  ) 
 

create a new vertex in the mesh

Returns:
pointer to the newly created vertex in the mesh

Reimplemented in gmMesh, and ParticleMesh.

Definition at line 61 of file NhalfEdgeMesh.cpp.

References m_pVertexList, m_vertexCount, and NhalfEdgeVertex::setIndex().

Referenced by ParticleMesh::addVertex(), gmMesh::addVertex(), and collapseEdge().

BOOL NhalfEdgeMesh::allEdgesVisited  ) 
 

tests to see whether all edges have been visited

Returns:
returns true if all edges have been visited

Definition at line 545 of file NhalfEdgeMesh.cpp.

References BOOL, FALSE, m_pEdgeList, and TRUE.

BOOL NhalfEdgeMesh::allVerticesVisited const U32  partition  ) 
 

tests whether all vertices for a partition have been visited

Parameters:
partition the partition number of the vertices in question
See also:
activateEdge()

deActivateEdge()

Returns:
true if all "active" vertices have been visited in partition

Definition at line 518 of file NhalfEdgeMesh.cpp.

References BOOL, FALSE, m_pVertexList, TRUE, and U32.

BOOL NhalfEdgeMesh::allVerticesVisited  ) 
 

tests whether all vertices have been visited

See also:
activateEdge()

deActivateEdge()

Returns:
true if all "active" vertices have been visited

Definition at line 502 of file NhalfEdgeMesh.cpp.

References BOOL, FALSE, m_pVertexList, and TRUE.

Referenced by depthFirstSearch().

void NhalfEdgeMesh::cleanUpEdgeList  )  [protected]
 

performs lazy deletion...

check to see whether edges marked for deletion are more than half the total number of nodes in the graph. if so, then it actually performs deletion of edges.

See also:
deleteVertex()

cleanUpEdgeList()

Definition at line 409 of file NhalfEdgeMesh.cpp.

References m_edgeCount, and m_pEdgeList.

Referenced by deleteEdge(), deleteFace(), deleteVertex(), partition(), and reActivate().

void NhalfEdgeMesh::cleanUpVertexList  )  [protected]
 

performs lazy deletion...

check to see whether vertices marked for deletion are more than half the total number of nodes in the graph. if so, then it actually performs deletion of vertices.

See also:
deleteVertex()

cleanUpEdgeList()

Definition at line 384 of file NhalfEdgeMesh.cpp.

References NhalfEdgeVertex::isDeleted(), m_pVertexList, and m_vertexCount.

Referenced by deleteVertex(), partition(), and reActivate().

void NhalfEdgeMesh::clear  ) 
 

clear the mesh.. deletes memory for edges and vertices

frees up all memory

Reimplemented in ParticleMesh.

Definition at line 32 of file NhalfEdgeMesh.cpp.

References m_cutSize, m_edgeCount, m_FMbalance, m_FMopt, m_partitions, m_pEdgeList, m_percentContraction, m_pVertexList, m_totalWeight, m_vertexCount, and TRUE.

Referenced by NhalfEdgeMesh(), and ~NhalfEdgeMesh().

NhalfEdgeVertex * NhalfEdgeMesh::collapseEdge NhalfEdge pCollapseEdge  ) 
 

edge collapse for simplification and partitioning

Creates a new vertex and deactivates old vertices. Also creates a new edges, and deactivates old ones. Allows for later uncollapse.

Parameters:
pCollapseEdge The "active" edge to be collapsed attaching to "active" vertices
See also:
uncollapseVertex()
Returns:
newly created vertex

Reimplemented in gmMesh, and ParticleMesh.

Definition at line 638 of file NhalfEdgeMesh.cpp.

References addHalfEdge(), NhalfEdge::addToWeight(), addVertex(), deActivateEdge(), deActivateVertex(), NhalfEdgeVertex::findEdge(), NhalfEdgeVertex::getIndex(), NhalfEdge::getNext(), NhalfEdge::getOpposite(), NhalfEdge::getVertexA(), NhalfEdge::getVertexB(), NhalfEdge::getWeight(), NhalfEdgeVertex::getWeight(), NhalfEdge::isContractable(), NhalfEdgeVertex::log(), NhalfEdgeVertex::m_InComingEdgeList, NhalfEdgeVertex::removeEdge(), NhalfEdgeVertex::setComposite(), NhalfEdge::setNext(), NhalfEdge::setOpposite(), NhalfEdge::setWeight(), and NhalfEdgeVertex::setWeight().

Referenced by ParticleMesh::collapseEdge(), gmMesh::collapseEdge(), and contractMesh().

void NhalfEdgeMesh::computeCutSize  ) 
 

compute the size of the cut

See also:
getCutSize()

Definition at line 1399 of file NhalfEdgeMesh.cpp.

References m_cutSize, m_pEdgeList, markEdgesUnVisited(), NhalfEdge::setVisited(), and TRUE.

Referenced by optimalPartition(), and partition().

void NhalfEdgeMesh::computePartitionWeights  )  [protected]
 

computes the weight of the partitions

Definition at line 1448 of file NhalfEdgeMesh.cpp.

References m_partitions, m_partitionWeight, m_pVertexList, m_totalWeight, and U32.

Referenced by drawInitialPartitions(), optimalPartition(), and partition().

void NhalfEdgeMesh::contractMesh std::stack< NhalfEdgeVertex * > *  pContractionStack,
const R32  percentage
[protected]
 

contract the mesh down to a certain percentage

Parameters:
pContractionStack pointer to a stack to put order of contracted vertices
percentage the amount to contract the graph down to

Definition at line 1008 of file NhalfEdgeMesh.cpp.

References BOOL, collapseEdge(), FALSE, findMatching(), getNumVertices(), m_vertexCount, R32, and U32.

Referenced by partition().

void NhalfEdgeMesh::deActivateEdge NhalfEdge pEdge  ) 
 

deactivate an edge in the mesh

See also:
deActivateEdge()
Parameters:
pEdge points to a edge in the mesh to be deleted

Definition at line 208 of file NhalfEdgeMesh.cpp.

References FALSE, m_edgeCount, and NhalfEdge::setActive().

Referenced by activatePartition(), and collapseEdge().

void NhalfEdgeMesh::deActivateVertex NhalfEdgeVertex pVertex  ) 
 

de-activates vertex in the mesh

Parameters:
pVertex points to a vertex in the mesh to be deleted

Definition at line 240 of file NhalfEdgeMesh.cpp.

References FALSE, m_vertexCount, and NhalfEdgeVertex::setActive().

Referenced by activatePartition(), and collapseEdge().

void NhalfEdgeMesh::deleteEdge NhalfEdge pEdge  ) 
 

deletes an edge from the mesh

See also:
cleanUpEdgeList()
Parameters:
pEdge pointa to a edge in the graph to be deleted

Definition at line 161 of file NhalfEdgeMesh.cpp.

References cleanUpEdgeList(), NhalfEdge::disconnectFromOpposite(), NhalfEdge::getVertexA(), NhalfEdge::getVertexB(), m_edgeCount, NhalfEdge::reconnectPrevious(), NhalfEdgeVertex::removeEdge(), NhalfEdge::setDeleted(), and TRUE.

void NhalfEdgeMesh::deleteFace NhalfEdge pEdge  ) 
 

deletes a face from the mesh

See also:
deleteEdge()
Parameters:
pEdge points to the edge who's face is to be deleted

Definition at line 184 of file NhalfEdgeMesh.cpp.

References cleanUpEdgeList(), NhalfEdge::disconnectFromOpposite(), NhalfEdge::getNext(), NhalfEdge::getPrevious(), NhalfEdge::getVertexA(), NhalfEdge::getVertexB(), m_edgeCount, NhalfEdgeVertex::removeEdge(), NhalfEdge::setDeleted(), NhalfEdge::setNext(), and TRUE.

Referenced by ModButterflySubdivision::subdivide().

void NhalfEdgeMesh::deleteVertex NhalfEdgeVertex pVertex  ) 
 

delete a vertex from the mesh

See also:
cleanUpVertexList()
Parameters:
pVertex pointa to a vertex in the mesh to be deleted

Definition at line 127 of file NhalfEdgeMesh.cpp.

References cleanUpEdgeList(), cleanUpVertexList(), NhalfEdge::disconnectFromOpposite(), NhalfEdge::getNext(), NhalfEdge::getVertexA(), NhalfEdge::getVertexB(), m_edgeCount, NhalfEdgeVertex::m_OutGoingEdgeList, m_vertexCount, NhalfEdgeVertex::removeEdge(), NhalfEdge::setDeleted(), NhalfEdgeVertex::setDeleted(), and TRUE.

BOOL NhalfEdgeMesh::depthFirstSearch const U32  partition  ) 
 

performs a depth first search to see if all "active" vertices in a partition are connected

Parameters:
partition the partition in question

Definition at line 604 of file NhalfEdgeMesh.cpp.

References allVerticesVisited(), BOOL, FALSE, getFirstActiveVertex(), NhalfEdgeVertex::getNeighbors(), NhalfEdgeVertex::isActive(), NhalfEdgeVertex::isVisited(), markVerticesUnVisited(), NhalfEdgeVertex::setVisited(), TRUE, and U32.

BOOL NhalfEdgeMesh::depthFirstSearch  ) 
 

performs a depth first search to see if all "active" vertices are connected

Returns:
returns true if all vertices in graph are connected

Definition at line 576 of file NhalfEdgeMesh.cpp.

References allVerticesVisited(), BOOL, FALSE, getFirstActiveVertex(), NhalfEdgeVertex::getNeighbors(), NhalfEdgeVertex::isActive(), NhalfEdgeVertex::isVisited(), markVerticesUnVisited(), NhalfEdgeVertex::setVisited(), and TRUE.

Referenced by activatePartition(), drawInitialPartitions(), optimalPartition(), and partition().

void NhalfEdgeMesh::drawInitialPartitions  )  [protected]
 

A greedy algorithm for drawing a partition on the graph.

Definition at line 1038 of file NhalfEdgeMesh.cpp.

References computePartitionWeights(), depthFirstSearch(), getActiveVertexList(), NhalfEdgeVertex::getWeight(), Nabs(), putActiveVerticesInPartition(), R32, NhalfEdgeVertex::setPartition(), switchPartitions(), and U32.

Referenced by partition().

void NhalfEdgeMesh::findMatching std::vector< NhalfEdge * > *  pMatchingArray  )  [protected]
 

find a matching on the mesh

a list of edges that touch all active vertices

Parameters:
pMatchingArray a pointer to an array to be filled with edges in matching

Definition at line 1288 of file NhalfEdgeMesh.cpp.

References getActiveEdgeList(), markVerticesUnVisited(), and TRUE.

Referenced by contractMesh(), ParticleMesh::findMatching(), and gmMesh::findMatching().

void NhalfEdgeMesh::FMoptimization  )  [protected]
 

FM optimization used by the partitioning algorithm.

Definition at line 1133 of file NhalfEdgeMesh.cpp.

References BOOL, FALSE, getActiveVertexList(), getCutSize(), NhalfEdgeVertex::getGain(), NhalfEdgeVertex::getPartition(), NhalfEdgeVertex::isIsolated(), NhalfEdgeVertex::isMovable(), m_partitions, m_partitionWeight, MIN_R32, partitionsBalanced(), R32, NhalfEdgeVertex::setVisited(), switchPartitions(), TRUE, and U32.

Referenced by partition().

void NhalfEdgeMesh::getActiveEdgeList std::vector< NhalfEdge * > *  pEdgeArray  ) 
 

gets a list of pointers to active edges

See also:
getActiveVertexList()
Parameters:
pEdgeArray a pointer to an array to be filled with edge pointers

Definition at line 1327 of file NhalfEdgeMesh.cpp.

References m_pEdgeList.

Referenced by findMatching(), ParticleMesh::getActiveEdgeList(), and gmMesh::getActiveEdgeList().

void NhalfEdgeMesh::getActiveVertexList std::vector< NhalfEdgeVertex * > *  pVertexArray  ) 
 

gets a list of pointers to active vertices in the graph

See also:
getActiveEdgeList()
Parameters:
pVertexArray a pointer to an array to be filled with vertex pointers

Definition at line 1367 of file NhalfEdgeMesh.cpp.

References m_pVertexList.

Referenced by activatePartition(), drawInitialPartitions(), FMoptimization(), ParticleMesh::getActiveVertexList(), gmMesh::getActiveVertexList(), and optimalPartition().

R32 NhalfEdgeMesh::getCutSize  )  const
 

get the size of the cut

See also:
computeCutSize()

Definition at line 1419 of file NhalfEdgeMesh.cpp.

References R32.

Referenced by FMoptimization().

NhalfEdge * NhalfEdgeMesh::getFirstActiveEdge  ) 
 

gets the first active edge in the graph

Returns:
active edge

Definition at line 1313 of file NhalfEdgeMesh.cpp.

References m_pEdgeList.

NhalfEdgeVertex * NhalfEdgeMesh::getFirstActiveVertex const U32  partition  ) 
 

gets the first active vertex in a partition

Parameters:
partition the partitions for the first active vertex.
Returns:
active vertex

Reimplemented in gmMesh, and ParticleMesh.

Definition at line 1353 of file NhalfEdgeMesh.cpp.

References m_pVertexList, and U32.

NhalfEdgeVertex * NhalfEdgeMesh::getFirstActiveVertex  ) 
 

gets the first active vertex

Returns:
active vertex

Reimplemented in gmMesh, and ParticleMesh.

Definition at line 1339 of file NhalfEdgeMesh.cpp.

References m_pVertexList.

Referenced by depthFirstSearch(), ParticleMesh::getFirstActiveVertex(), and gmMesh::getFirstActiveVertex().

U32 NhalfEdgeMesh::getNumEdges  )  const
 

gets the number of edges in the mesh

See also:
addEdge()

deleteEdge()

activateEdge()

deActivateEdge()

Returns:
number of active edges in the graph

Definition at line 1484 of file NhalfEdgeMesh.cpp.

References U32.

U32 NhalfEdgeMesh::getNumFaces  ) 
 

gets the number of faces in the mesh

See also:
getNumEdges()

getNumVertices()

Returns:
number of partitions in the graph

Definition at line 1506 of file NhalfEdgeMesh.cpp.

References m_pEdgeList, markEdgesUnVisited(), TRUE, and U32.

U32 NhalfEdgeMesh::getNumPartitions  )  const
 

gets the number of edges in the mesh

See also:
partitionFromConnectedness()

partition()

Returns:
number of partitions in the graph

Definition at line 1495 of file NhalfEdgeMesh.cpp.

References U32.

U32 NhalfEdgeMesh::getNumVertices  )  const
 

gets the number of vertices in the mesh

See also:
addVertex()

deleteVertex()

activateVertex()

deActivateVertex()

Returns:
number of active vertices in the graph

Definition at line 1471 of file NhalfEdgeMesh.cpp.

References U32.

Referenced by contractMesh().

U32 NhalfEdgeMesh::getPartitionCount U32  partition  ) 
 

get the number of vertices for a given partition

Parameters:
partition the partition number of the vertices in question
See also:
activateVertex()

deActivateVertex()

markVerticesUnVisited()

Returns:
the number of vertices in the partition

Definition at line 561 of file NhalfEdgeMesh.cpp.

References m_pVertexList, and U32.

Referenced by partition().

BOOL NhalfEdgeMesh::isInHalfEdgeMesh const NhalfEdge pEdge  ) 
 

tests to see if a vertex is in the mesh or not

See also:
activateEdge()

deActivateEdge()

Returns:
true if the edge is "active" and in the graph

Definition at line 453 of file NhalfEdgeMesh.cpp.

References BOOL, FALSE, NhalfEdge::isActive(), NhalfEdge::isDeleted(), m_pEdgeList, and TRUE.

BOOL NhalfEdgeMesh::isInHalfEdgeMesh const NhalfEdgeVertex pVertex  ) 
 

tests to see if a vertex is in the mesh or not

See also:
activateVertex()

deActivateVertex()

Returns:
true if the vertex is "active" and in the graph

Definition at line 434 of file NhalfEdgeMesh.cpp.

References BOOL, FALSE, NhalfEdgeVertex::isActive(), NhalfEdgeVertex::isDeleted(), m_pVertexList, and TRUE.

Referenced by ModButterflySubdivision::subdivide().

void NhalfEdgeMesh::log  ) 
 

writes mesh to execution log

See also:
NexecutionLog

Definition at line 1584 of file NhalfEdgeMesh.cpp.

Referenced by optimalPartition(), and partition().

void NhalfEdgeMesh::markEdgesUnVisited  ) 
 

test to see whether all edges have been visited

See also:
activateEdge()

deActivateEdge()

markEdgesUnVisited()

Definition at line 534 of file NhalfEdgeMesh.cpp.

References FALSE, and m_pEdgeList.

Referenced by computeCutSize(), getNumFaces(), and ModButterflySubdivision::subdivide().

void NhalfEdgeMesh::markVerticesUnVisited const U32  partition  ) 
 

marks all vertices in a given partition as unvisited

Parameters:
partition the partition in question

Definition at line 487 of file NhalfEdgeMesh.cpp.

References FALSE, m_pVertexList, and U32.

void NhalfEdgeMesh::markVerticesUnVisited  ) 
 

marks all active vertices in the graph as unvisited

See also:
activateVertex()

deActivateVertex()

markVerticesUnVisited()

Definition at line 475 of file NhalfEdgeMesh.cpp.

References FALSE, and m_pVertexList.

Referenced by depthFirstSearch(), findMatching(), and partitionFromConnectedness().

void NhalfEdgeMesh::normalizeEdgeWeights  )  [protected]
 

See also:
normalizeVertexWeights() normalizes the edge weights so that they sum to 1.0

Definition at line 1268 of file NhalfEdgeMesh.cpp.

References m_pEdgeList, and R32.

Referenced by partition().

void NhalfEdgeMesh::normalizeVertexWeights  )  [protected]
 

make vertex weights sum to 1

See also:
normalizeEdgeWeights() normalizes the vertex weights so that they sum to 1.0

Definition at line 1248 of file NhalfEdgeMesh.cpp.

References m_pVertexList, and R32.

Referenced by partition().

void NhalfEdgeMesh::optimalPartition  )  [protected]
 

optimalPartition

Definition at line 952 of file NhalfEdgeMesh.cpp.

References computeCutSize(), computePartitionWeights(), depthFirstSearch(), getActiveVertexList(), log(), m_partitionWeight, m_vertexCount, Nabs(), partition(), R32, U32, and U8.

Referenced by partition().

void NhalfEdgeMesh::partition const U32  partitions  ) 
 

partitioning

Definition at line 861 of file NhalfEdgeMesh.cpp.

References BOOL, cleanUpEdgeList(), cleanUpVertexList(), computeCutSize(), computePartitionWeights(), contractMesh(), depthFirstSearch(), drawInitialPartitions(), FMoptimization(), getPartitionCount(), log(), m_contractionStack, m_cutSize, m_edgeCount, m_FMopt, m_greatestContractionLevel, m_partitions, m_partitionWeight, m_percentContraction, m_vertexCount, normalizeEdgeWeights(), normalizeVertexWeights(), optimalPartition(), putActiveVerticesInPartition(), TRUE, U32, and uncollapseVertex().

Referenced by optimalPartition().

void NhalfEdgeMesh::partitionFromConnectedness  ) 
 

create partitions by connectedness

Definition at line 1536 of file NhalfEdgeMesh.cpp.

References NhalfEdge::getVertexB(), NhalfEdgeVertex::isActive(), NhalfEdgeVertex::isVisited(), NhalfEdgeVertex::m_OutGoingEdgeList, m_partitions, m_pVertexList, markVerticesUnVisited(), NhalfEdgeVertex::setPartition(), NhalfEdgeVertex::setVisited(), and TRUE.

BOOL NhalfEdgeMesh::partitionsBalanced  )  const [protected]
 

Returns true if the partitions are balanced with tolerance.

Returns:
TRUE of partition is "balanced"

Definition at line 1428 of file NhalfEdgeMesh.cpp.

References BOOL, FALSE, Nabs(), R32, TRUE, and U32.

Referenced by FMoptimization().

void NhalfEdgeMesh::putActiveVerticesInPartition const U32  partition  ) 
 

put all active vertices into a partition

Parameters:
partition the partition to place the vertices into

Definition at line 1527 of file NhalfEdgeMesh.cpp.

References m_pVertexList, and U32.

Referenced by drawInitialPartitions(), and partition().

void NhalfEdgeMesh::reActivate  ) 
 

re-activates all vertices and edges in the mesh

Definition at line 343 of file NhalfEdgeMesh.cpp.

References activateEdge(), activateVertex(), cleanUpEdgeList(), cleanUpVertexList(), m_edgeCount, m_pEdgeList, m_pVertexList, m_tempPartitionEdgeList, and TRUE.

Referenced by activatePartition().

void NhalfEdgeMesh::setPartitionFeatures const R32  percentContraction,
const U32  FMopt,
const R32  FMbalance
 

settings for partitioning code

See also:
NexecutionLog

amount to contract the graph down to

whether to perform FM optimization

strictness of the balance criteria

Definition at line 1571 of file NhalfEdgeMesh.cpp.

References m_FMbalance, m_FMopt, m_percentContraction, R32, and U32.

void NhalfEdgeMesh::switchPartitions NhalfEdgeVertex pV,
const U32  dest
[protected]
 

move a vertex from one partition to another

updates total cut size and balance

Parameters:
pV a pointer to an active vertex
dest destination partition

Definition at line 1381 of file NhalfEdgeMesh.cpp.

References NhalfEdgeVertex::getGain(), NhalfEdgeVertex::getPartition(), NhalfEdgeVertex::getWeight(), NhalfEdgeVertex::isActive(), NhalfEdgeVertex::isDeleted(), m_cutSize, m_partitionWeight, NhalfEdgeVertex::setPartition(), and U32.

Referenced by drawInitialPartitions(), and FMoptimization().

NhalfEdge * NhalfEdgeMesh::uncollapseVertex NhalfEdgeVertex pVertex  ) 
 

edge uncollapse for simplification and partitiong

Parameters:
pVertex a pointer to an active composite vertex;
See also:
collapseEdge()
Returns:
unCollapsedEdge newly created vertex

Reimplemented in gmMesh, and ParticleMesh.

Definition at line 785 of file NhalfEdgeMesh.cpp.

References activateEdge(), activateVertex(), NhalfEdgeVertex::addEdge(), NhalfEdgeVertex::getCompositeVertexA(), NhalfEdgeVertex::getCompositeVertexB(), NhalfEdge::getNext(), NhalfEdgeVertex::getPartition(), NhalfEdge::getVertexA(), NhalfEdge::getVertexB(), m_edgeCount, NhalfEdgeVertex::m_InComingEdgeList, NhalfEdgeVertex::m_OutGoingEdgeList, m_vertexCount, NhalfEdgeVertex::removeEdge(), NhalfEdgeVertex::setDeleted(), NhalfEdge::setDeleted(), NhalfEdge::setNext(), NhalfEdgeVertex::setPartition(), and TRUE.

Referenced by partition(), ParticleMesh::uncollapseVertex(), and gmMesh::uncollapseVertex().


Member Data Documentation

std::stack< NhalfEdgeVertex *> NhalfEdgeMesh::m_contractionStack [protected]
 

stack to store contracted vertices

Definition at line 193 of file NhalfEdgeMesh.h.

Referenced by partition().

R32 NhalfEdgeMesh::m_cutSize [protected]
 

size of the cut

Definition at line 173 of file NhalfEdgeMesh.h.

Referenced by clear(), computeCutSize(), partition(), and switchPartitions().

U32 NhalfEdgeMesh::m_edgeCount [protected]
 

number of edges in the mesh

Definition at line 171 of file NhalfEdgeMesh.h.

Referenced by activateEdge(), addHalfEdge(), cleanUpEdgeList(), clear(), deActivateEdge(), deleteEdge(), deleteFace(), deleteVertex(), partition(), reActivate(), and uncollapseVertex().

R32 NhalfEdgeMesh::m_FMbalance [protected]
 

strictness of the balance criteria

Definition at line 191 of file NhalfEdgeMesh.h.

Referenced by clear(), and setPartitionFeatures().

U32 NhalfEdgeMesh::m_FMopt [protected]
 

whether to perform FM optimization

Definition at line 189 of file NhalfEdgeMesh.h.

Referenced by clear(), partition(), and setPartitionFeatures().

U32 NhalfEdgeMesh::m_greatestContractionLevel [protected]
 

Definition at line 195 of file NhalfEdgeMesh.h.

Referenced by partition().

U32 NhalfEdgeMesh::m_partitions [protected]
 

number of partitions

Definition at line 177 of file NhalfEdgeMesh.h.

Referenced by clear(), computePartitionWeights(), FMoptimization(), partition(), and partitionFromConnectedness().

std::vector< R32 > NhalfEdgeMesh::m_partitionWeight [protected]
 

weight for each partition

Definition at line 179 of file NhalfEdgeMesh.h.

Referenced by computePartitionWeights(), FMoptimization(), optimalPartition(), partition(), and switchPartitions().

std::vector<NhalfEdge *>* NhalfEdgeMesh::m_pEdgeList [protected]
 

list of halfedges

Definition at line 181 of file NhalfEdgeMesh.h.

Referenced by activatePartition(), addHalfEdge(), allEdgesVisited(), cleanUpEdgeList(), clear(), computeCutSize(), getActiveEdgeList(), getFirstActiveEdge(), getNumFaces(), isInHalfEdgeMesh(), markEdgesUnVisited(), NhalfEdgeMesh(), normalizeEdgeWeights(), and reActivate().

R32 NhalfEdgeMesh::m_percentContraction [protected]
 

amount to contract the graph down to

Definition at line 187 of file NhalfEdgeMesh.h.

Referenced by clear(), partition(), and setPartitionFeatures().

std::vector<NhalfEdgeVertex *>* NhalfEdgeMesh::m_pVertexList [protected]
 

list of vertices

Definition at line 183 of file NhalfEdgeMesh.h.

Referenced by activatePartition(), addVertex(), allVerticesVisited(), cleanUpVertexList(), clear(), computePartitionWeights(), getActiveVertexList(), getFirstActiveVertex(), getPartitionCount(), isInHalfEdgeMesh(), markVerticesUnVisited(), NhalfEdgeMesh(), normalizeVertexWeights(), partitionFromConnectedness(), putActiveVerticesInPartition(), and reActivate().

std::vector<NhalfEdge *> NhalfEdgeMesh::m_tempPartitionEdgeList [protected]
 

list of temporary halfedges

Definition at line 185 of file NhalfEdgeMesh.h.

Referenced by activatePartition(), and reActivate().

R32 NhalfEdgeMesh::m_totalWeight [protected]
 

total weight of the graph ???

Definition at line 175 of file NhalfEdgeMesh.h.

Referenced by clear(), and computePartitionWeights().

U32 NhalfEdgeMesh::m_vertexCount [protected]
 

number of vertices in the mesh

Definition at line 169 of file NhalfEdgeMesh.h.

Referenced by activateVertex(), addVertex(), cleanUpVertexList(), clear(), contractMesh(), deActivateVertex(), deleteVertex(), optimalPartition(), partition(), and uncollapseVertex().


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