Mesh Oriented datABase  (version 5.5.1)
An array-based unstructured mesh library
moab::BSPTreePoly::VertexUse Struct Reference
+ Collaboration diagram for moab::BSPTreePoly::VertexUse:

Public Member Functions

 VertexUse (Edge *edge, Vertex *vtx)
 
 ~VertexUse ()
 
void set_vertex (BSPTreePoly::Vertex *&vtx_ptr)
 

Public Attributes

BSPTreePoly::VertexUsenextPtr
 
BSPTreePoly::VertexUseprevPtr
 
BSPTreePoly::VertexvtxPtr
 
BSPTreePoly::EdgeedgePtr
 

Detailed Description

Definition at line 34 of file BSPTreePoly.cpp.

Constructor & Destructor Documentation

◆ VertexUse()

moab::BSPTreePoly::VertexUse::VertexUse ( BSPTreePoly::Edge edge,
BSPTreePoly::Vertex vtx 
)

Definition at line 203 of file BSPTreePoly.cpp.

203  : vtxPtr( vtx ), edgePtr( edge )
204 {
205  if( !vtx->usePtr )
206  {
207  vtx->usePtr = prevPtr = nextPtr = this;
208  return;
209  }
210 
211  nextPtr = vtx->usePtr;
213  assert( prevPtr->nextPtr == nextPtr );
214  nextPtr->prevPtr = this;
215  prevPtr->nextPtr = this;
216 }

References nextPtr, prevPtr, and moab::BSPTreePoly::Vertex::usePtr.

◆ ~VertexUse()

moab::BSPTreePoly::VertexUse::~VertexUse ( )

Definition at line 218 of file BSPTreePoly.cpp.

219 {
220  if( nextPtr == this )
221  {
222  assert( prevPtr == this );
223  assert( vtxPtr->usePtr == this );
224  vtxPtr->usePtr = 0;
225  delete vtxPtr;
226  }
227  else if( vtxPtr->usePtr == this )
228  vtxPtr->usePtr = nextPtr;
229 
232  nextPtr = prevPtr = 0;
233 }

Member Function Documentation

◆ set_vertex()

void moab::BSPTreePoly::VertexUse::set_vertex ( BSPTreePoly::Vertex *&  vtx_ptr)

Definition at line 235 of file BSPTreePoly.cpp.

236 {
237  if( vtxPtr )
238  {
239  if( nextPtr == prevPtr )
240  {
241  assert( nextPtr == this );
242  vtxPtr->usePtr = 0;
243  delete vtx;
244  vtx = 0;
245  }
246  else
247  {
250  if( vtxPtr->usePtr == this ) vtxPtr->usePtr = nextPtr;
251  }
252  }
253 
254  if( vtx )
255  {
256  vtxPtr = vtx;
258  prevPtr = vtxPtr->usePtr;
259  nextPtr->prevPtr = this;
260  vtxPtr->usePtr->nextPtr = this;
261  }
262 }

References nextPtr, prevPtr, and moab::BSPTreePoly::Vertex::usePtr.

Referenced by moab::split_edge().

Member Data Documentation

◆ edgePtr

◆ nextPtr

◆ prevPtr

BSPTreePoly::VertexUse * moab::BSPTreePoly::VertexUse::prevPtr

◆ vtxPtr


The documentation for this struct was generated from the following file: