cgma
PartitionLoop Class Reference

#include <PartitionLoop.hpp>

Inheritance diagram for PartitionLoop:
LoopSM TopologyBridge

List of all members.

Public Member Functions

 PartitionLoop ()
virtual ~PartitionLoop ()
PartitionSurfaceget_surface () const
virtual CubitBoolean is_external ()
virtual LoopType loop_type ()
PartitionCoEdgefirst_coedge ()
PartitionCoEdgenext_coedge (PartitionCoEdge *after_this)
PartitionCoEdgeprev_coedge (PartitionCoEdge *before_this)
int num_coedges ()
CubitStatus insert_after (PartitionCoEdge *coedge, PartitionCoEdge *after)
CubitStatus insert_before (PartitionCoEdge *coedge, PartitionCoEdge *before)
CubitStatus remove (PartitionCoEdge *coedge)
CubitStatus remove_all_coedges (DLIList< PartitionCoEdge * > *removed=0)
void get_parents_virt (DLIList< TopologyBridge * > &parents)
void get_children_virt (DLIList< TopologyBridge * > &children)
int layer () const
GeometryQueryEngineget_geometry_query_engine () const
void append_simple_attribute_virt (const CubitSimpleAttrib &)
void remove_simple_attribute_virt (const CubitSimpleAttrib &)
void remove_all_simple_attribute_virt ()
CubitStatus get_simple_attribute (DLIList< CubitSimpleAttrib > &)
CubitStatus get_simple_attribute (const CubitString &, DLIList< CubitSimpleAttrib > &)
void reverse ()
void print_debug_info (const char *line_prefix=0)

Private Member Functions

 PartitionLoop (const PartitionLoop &)

Private Attributes

PartitionSurfacemySurface
PartitionCoEdgefirstCoedge
PartitionLoopnextInSurface
int numCoedges

Friends

class PartitionSurface

Detailed Description

Definition at line 19 of file PartitionLoop.hpp.


Constructor & Destructor Documentation

Definition at line 17 of file PartitionLoop.cpp.

  : mySurface(0), firstCoedge( 0 ), nextInSurface( 0 ), numCoedges( 0 )
{
}

Definition at line 52 of file PartitionLoop.cpp.

{
  if( mySurface )
  {
    mySurface->remove( this );
    mySurface = 0;
  }
    
  CubitStatus s = remove_all_coedges();
  assert( s );
  if (CUBIT_SUCCESS != s) {
    PRINT_ERROR("Failed to remove all coedges.\n");
  }
}

Member Function Documentation

Implements TopologyBridge.

Definition at line 264 of file PartitionLoop.cpp.

{ }

Definition at line 77 of file PartitionLoop.hpp.

  { return firstCoedge; }
void PartitionLoop::get_children_virt ( DLIList< TopologyBridge * > &  children) [virtual]

Implements TopologyBridge.

Definition at line 219 of file PartitionLoop.cpp.

{
  PartitionCoEdge* coedge = firstCoedge;
  
  if( coedge ) do
  {
    children.append( coedge );
    coedge = next_coedge( coedge );
  } while( coedge != firstCoedge );
}

Implements TopologyBridge.

Definition at line 252 of file PartitionLoop.cpp.

void PartitionLoop::get_parents_virt ( DLIList< TopologyBridge * > &  parents) [virtual]

Implements TopologyBridge.

Definition at line 206 of file PartitionLoop.cpp.

  { if( mySurface ) parents.append( mySurface ); }

Implements TopologyBridge.

Definition at line 270 of file PartitionLoop.cpp.

{ return CUBIT_FAILURE; }

Implements TopologyBridge.

Definition at line 272 of file PartitionLoop.cpp.

{ return CUBIT_FAILURE; }

Definition at line 74 of file PartitionLoop.hpp.

  { return mySurface; }

Definition at line 76 of file PartitionLoop.cpp.

{
  if( insert->myLoop != 0 )
    return CUBIT_FAILURE;
  
  if( numCoedges == 0 )
  {
    if( after )
      return CUBIT_FAILURE;
    
    insert->loopNext = insert;
    insert->loopPrev = insert;
    firstCoedge = insert;
  }
  else
  {
    if( !after || after->myLoop != this )
      return CUBIT_FAILURE;
    
    insert->loopPrev = after;
    insert->loopNext = after->loopNext;
    insert->loopNext->loopPrev = insert;
    insert->loopPrev->loopNext = insert;
  }
  
  insert->myLoop = this;
  numCoedges++;
  return CUBIT_SUCCESS;
}

Definition at line 106 of file PartitionLoop.cpp.

{
  if( insert->myLoop != 0 )
    return CUBIT_FAILURE;
  
  if( numCoedges == 0 )
  {
    if( before ) 
      return CUBIT_FAILURE;
    
    insert->loopNext = insert;
    insert->loopPrev = insert;
    firstCoedge = insert;
  }
  else
  {
    if( !before || before->myLoop != this )
      return CUBIT_FAILURE;
    
    insert->loopNext = before;
    insert->loopPrev = before->loopPrev;
    insert->loopNext->loopPrev = insert;
    insert->loopPrev->loopNext = insert;
  }
  
  insert->myLoop = this;
  numCoedges++;
  return CUBIT_SUCCESS;
}

Definition at line 32 of file PartitionLoop.cpp.

{
          PRINT_ERROR( "This command is not supported with this engine.\n");
          return CUBIT_FAILURE;
}
int PartitionLoop::layer ( ) const [virtual]

Reimplemented from TopologyBridge.

Definition at line 240 of file PartitionLoop.cpp.

  { return get_surface()->layer(); }

Implements LoopSM.

Definition at line 38 of file PartitionLoop.cpp.

{
  return LOOP_TYPE_UNKNOWN;
}

Definition at line 83 of file PartitionLoop.hpp.

  { return prev->myLoop == this ? prev->loopNext : 0; }
int PartitionLoop::num_coedges ( ) [inline]

Definition at line 80 of file PartitionLoop.hpp.

  { return numCoedges; }

Definition at line 86 of file PartitionLoop.hpp.

  { return next->myLoop == this ? next->loopPrev : 0; }
void PartitionLoop::print_debug_info ( const char *  line_prefix = 0)

Definition at line 301 of file PartitionLoop.cpp.

{
/*
  if( line_prefix == 0 )
    line_prefix = "";
    
  char* new_prefix = new char[strlen(line_prefix)+3];
  strcpy( new_prefix, line_prefix );
  strcat( new_prefix, "  " );
  
  PRINT_INFO("%sPartitionLoop @ %p : \n", line_prefix, this );
  PartitionCoEdge* coedge = first_coedge();
  if( !coedge )
    PRINT_INFO("%s  No CoEdges!!\n");
  else do
  {
    coedge->print_debug_info( new_prefix );
    coedge = next_coedge( coedge );
  } while( coedge != first_coedge() );
  
  delete [] new_prefix;
*/
}

Definition at line 146 of file PartitionLoop.cpp.

{
  if( coedge->myLoop != this )
    return CUBIT_FAILURE;
  
  if( numCoedges == 1 )
  {
    assert( coedge->loopNext == coedge &&
            coedge->loopPrev == coedge );
    firstCoedge = 0;
  }
  else
  {
    coedge->loopNext->loopPrev = coedge->loopPrev;
    coedge->loopPrev->loopNext = coedge->loopNext;
    if( firstCoedge == coedge )
      firstCoedge = coedge->loopNext;
  }
  
  numCoedges--;
  coedge->myLoop = 0;
  coedge->loopNext = 0;
  coedge->loopPrev = 0;
  
  return CUBIT_SUCCESS;
}

Definition at line 185 of file PartitionLoop.cpp.

{
  while( firstCoedge )
  {
    if( list )
      list->append( firstCoedge );
    remove( firstCoedge );
  }
  
  return CUBIT_SUCCESS;
}

Implements TopologyBridge.

Definition at line 268 of file PartitionLoop.cpp.

{ }

Implements TopologyBridge.

Definition at line 266 of file PartitionLoop.cpp.

{ }

Definition at line 287 of file PartitionLoop.cpp.

{
  PartitionCoEdge* coedge = firstCoedge;
  if( coedge ) do
  {
    PartitionCoEdge* temp = coedge->loopNext;
    coedge->loopNext = coedge->loopPrev;
    coedge->loopPrev = temp;
    coedge->reverse_sense();
    coedge = temp;
  } while( coedge != firstCoedge );
}

Friends And Related Function Documentation

friend class PartitionSurface [friend]

Definition at line 21 of file PartitionLoop.hpp.


Member Data Documentation

Definition at line 69 of file PartitionLoop.hpp.

Definition at line 68 of file PartitionLoop.hpp.

Definition at line 70 of file PartitionLoop.hpp.

Definition at line 71 of file PartitionLoop.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines