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

Public Member Functions

 EdgeUse (Edge *edge)
 
 EdgeUse (Edge *edge, Face *face)
 
 ~EdgeUse ()
 
BSPTreePoly::Vertexstart () const
 
BSPTreePoly::Vertexend () const
 
int sense () const
 
void insert_after (BSPTreePoly::EdgeUse *prev)
 
void insert_before (BSPTreePoly::EdgeUse *next)
 

Public Attributes

BSPTreePoly::EdgeUseprevPtr
 
BSPTreePoly::EdgeUsenextPtr
 
BSPTreePoly::EdgeedgePtr
 
BSPTreePoly::FacefacePtr
 

Detailed Description

Definition at line 46 of file BSPTreePoly.cpp.

Constructor & Destructor Documentation

◆ EdgeUse() [1/2]

moab::BSPTreePoly::EdgeUse::EdgeUse ( BSPTreePoly::Edge edge)

Definition at line 264 of file BSPTreePoly.cpp.

264 : prevPtr( 0 ), nextPtr( 0 ), edgePtr( edge ), facePtr( 0 ) {}

◆ EdgeUse() [2/2]

moab::BSPTreePoly::EdgeUse::EdgeUse ( BSPTreePoly::Edge edge,
BSPTreePoly::Face face 
)

Definition at line 266 of file BSPTreePoly.cpp.

266  : edgePtr( edge ), facePtr( face )
267 {
268  assert( !face->usePtr );
269  face->usePtr = prevPtr = nextPtr = this;
270 
271  if( !face->usePtr )
272  {
273  face->usePtr = prevPtr = nextPtr = this;
274  return;
275  }
276 
277  nextPtr = face->usePtr;
279  assert( prevPtr->nextPtr == nextPtr );
280  nextPtr->prevPtr = this;
281  prevPtr->nextPtr = this;
282 }

References nextPtr, and prevPtr.

◆ ~EdgeUse()

moab::BSPTreePoly::EdgeUse::~EdgeUse ( )

Definition at line 312 of file BSPTreePoly.cpp.

313 {
314  if( facePtr->usePtr == this ) facePtr->usePtr = ( nextPtr == this ) ? 0 : nextPtr;
315 
316  if( edgePtr->forwardPtr == this ) edgePtr->forwardPtr = 0;
317  if( edgePtr->reversePtr == this ) edgePtr->reversePtr = 0;
318 
319  if( !edgePtr->forwardPtr && !edgePtr->reversePtr ) delete edgePtr;
320 
323  nextPtr = prevPtr = 0;
324 }

Member Function Documentation

◆ end()

BSPTreePoly::Vertex * moab::BSPTreePoly::EdgeUse::end ( ) const
inline

Definition at line 346 of file BSPTreePoly.cpp.

347 {
348  if( edgePtr->forwardPtr == this )
349  return edgePtr->end();
350  else if( edgePtr->reversePtr == this )
351  return edgePtr->start();
352  else
353  return 0;
354 }

Referenced by moab::BSPTreePoly::get_vertices(), insert_after(), moab::BSPTreePoly::is_valid(), and moab::split_face().

◆ insert_after()

void moab::BSPTreePoly::EdgeUse::insert_after ( BSPTreePoly::EdgeUse prev)

Definition at line 284 of file BSPTreePoly.cpp.

285 {
286  // shouldn't already be in a face
287  assert( !facePtr );
288  // adjacent edges should share vertices
289  assert( start() == prev->end() );
290 
291  facePtr = prev->facePtr;
292  nextPtr = prev->nextPtr;
293  prevPtr = prev;
294  nextPtr->prevPtr = this;
295  prevPtr->nextPtr = this;
296 }

References end(), facePtr, nextPtr, and prevPtr.

Referenced by moab::BSPTreePoly::cut_polyhedron(), moab::BSPTreePoly::set(), and moab::split_edge().

◆ insert_before()

void moab::BSPTreePoly::EdgeUse::insert_before ( BSPTreePoly::EdgeUse next)

Definition at line 298 of file BSPTreePoly.cpp.

299 {
300  // shouldn't already be in a face
301  assert( !facePtr );
302  // adjacent edges should share vertices
303  assert( end() == next->start() );
304 
305  facePtr = next->facePtr;
306  prevPtr = next->prevPtr;
307  nextPtr = next;
308  nextPtr->prevPtr = this;
309  prevPtr->nextPtr = this;
310 }

References facePtr, nextPtr, prevPtr, and start().

Referenced by moab::split_edge().

◆ sense()

int moab::BSPTreePoly::EdgeUse::sense ( ) const

Definition at line 326 of file BSPTreePoly.cpp.

327 {
328  if( edgePtr->forwardPtr == this )
329  return 1;
330  else if( edgePtr->reversePtr == this )
331  return -1;
332  else
333  return 0;
334 }

◆ start()

BSPTreePoly::Vertex * moab::BSPTreePoly::EdgeUse::start ( ) const
inline

Definition at line 336 of file BSPTreePoly.cpp.

337 {
338  if( edgePtr->forwardPtr == this )
339  return edgePtr->start();
340  else if( edgePtr->reversePtr == this )
341  return edgePtr->end();
342  else
343  return 0;
344 }

Referenced by insert_before(), moab::BSPTreePoly::is_valid(), and moab::split_face().

Member Data Documentation

◆ edgePtr

BSPTreePoly::Edge* moab::BSPTreePoly::EdgeUse::edgePtr

◆ facePtr

◆ nextPtr

◆ prevPtr

BSPTreePoly::EdgeUse* moab::BSPTreePoly::EdgeUse::prevPtr

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