cgma
CompositeLoop Class Reference

#include <CompositeLoop.hpp>

Inheritance diagram for CompositeLoop:
LoopSM TopologyBridge

List of all members.

Public Member Functions

 CompositeLoop ()
virtual ~CompositeLoop ()
CompositeSurfaceget_surface () const
CompositeLoopnext_loop () const
CompositeCoEdgefirst_coedge () const
CompositeCoEdgenext_coedge (CompositeCoEdge *after_this) const
CompositeCoEdgeprev_coedge (CompositeCoEdge *before_this) const
int num_coedges () const
CubitStatus insert_after (CompositeCoEdge *coedge, CompositeCoEdge *after)
CubitStatus insert_before (CompositeCoEdge *coedge, CompositeCoEdge *before)
CubitStatus remove (CompositeCoEdge *coedge)
CubitStatus remove_all_coedges (DLIList< CompositeCoEdge * > *removed=0)
void get_parents_virt (DLIList< TopologyBridge * > &parents)
void get_children_virt (DLIList< TopologyBridge * > &children)
GeometryQueryEngineget_geometry_query_engine () const
int layer () const
virtual LoopType loop_type ()
virtual CubitBoolean is_external ()
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 &name, DLIList< CubitSimpleAttrib > &attrib_list)
void reverse (bool b_reverse_coedges)
void print_debug_info (const char *line_prefix=0)

Private Attributes

CompositeSurfacemySurface
CompositeCoEdgemyCoedge
CompositeLooploopNext
int numCoedges

Friends

class CompositeSurface

Detailed Description

Definition at line 21 of file CompositeLoop.hpp.


Constructor & Destructor Documentation

Definition at line 17 of file CompositeLoop.cpp.

  : mySurface(0), myCoedge(0), loopNext(0), numCoedges(0)
{
}

Definition at line 31 of file CompositeLoop.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 252 of file CompositeLoop.cpp.

{ }

Definition at line 83 of file CompositeLoop.hpp.

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

Implements TopologyBridge.

Definition at line 219 of file CompositeLoop.cpp.

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

Implements TopologyBridge.

Definition at line 240 of file CompositeLoop.cpp.

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

Implements TopologyBridge.

Definition at line 206 of file CompositeLoop.cpp.

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

Implements TopologyBridge.

Definition at line 258 of file CompositeLoop.cpp.

{ return CUBIT_FAILURE; }
CubitStatus CompositeLoop::get_simple_attribute ( const CubitString name,
DLIList< CubitSimpleAttrib > &  attrib_list 
) [virtual]

Implements TopologyBridge.

Definition at line 260 of file CompositeLoop.cpp.

{ return CUBIT_FAILURE; }

Definition at line 77 of file CompositeLoop.hpp.

  { return mySurface; }

Definition at line 55 of file CompositeLoop.cpp.

{
  if( insert->myLoop != 0 )
    return CUBIT_FAILURE;
  
  if( numCoedges == 0 )
  {
    if( after )
      return CUBIT_FAILURE;
    
    insert->nextCoedge = insert;
    insert->prevCoedge = insert;
    myCoedge = insert;
  }
  else
  {
    if( !after || after->myLoop != this )
      return CUBIT_FAILURE;
    
    insert->prevCoedge = after;
    insert->nextCoedge = after->nextCoedge;
    insert->nextCoedge->prevCoedge = insert;
    insert->prevCoedge->nextCoedge = insert;
  }
  
  insert->myLoop = this;
  numCoedges++;
  return CUBIT_SUCCESS;
}

Definition at line 85 of file CompositeLoop.cpp.

{
  if( insert->myLoop != 0 )
    return CUBIT_FAILURE;
  
  if( numCoedges == 0 )
  {
    if( before ) 
      return CUBIT_FAILURE;
    
    insert->nextCoedge = insert;
    insert->prevCoedge = insert;
    myCoedge = insert;
  }
  else
  {
    if( !before || before->myLoop != this )
      return CUBIT_FAILURE;
    
    insert->nextCoedge = before;
    insert->prevCoedge = before->prevCoedge;
    insert->nextCoedge->prevCoedge = insert;
    insert->prevCoedge->nextCoedge = insert;
  }
  
  insert->myLoop = this;
  numCoedges++;
  return CUBIT_SUCCESS;
}

Definition at line 186 of file CompositeLoop.cpp.

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

Reimplemented from TopologyBridge.

Definition at line 45 of file CompositeLoop.hpp.

{ return COMPOSITE_LAYER; }

Implements LoopSM.

Definition at line 192 of file CompositeLoop.cpp.

{
  return LOOP_TYPE_UNKNOWN;
}
CompositeCoEdge * CompositeLoop::next_coedge ( CompositeCoEdge after_this) const [inline]

Definition at line 89 of file CompositeLoop.hpp.

  { return prev->myLoop == this ? prev->nextCoedge : 0; }

Definition at line 80 of file CompositeLoop.hpp.

  { return loopNext; }
int CompositeLoop::num_coedges ( ) const [inline]

Definition at line 86 of file CompositeLoop.hpp.

  { return numCoedges; }
CompositeCoEdge * CompositeLoop::prev_coedge ( CompositeCoEdge before_this) const [inline]

Definition at line 92 of file CompositeLoop.hpp.

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

Definition at line 289 of file CompositeLoop.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("%sCompositeLoop @ %p : \n", line_prefix, (void*)this );
  CompositeCoEdge* coedge = first_coedge();
  if( !coedge )
    PRINT_INFO("%s  No CoEdges!!\n", line_prefix);
  else do
  {
    coedge->print_debug_info( new_prefix );
    coedge = next_coedge( coedge );
  } while( coedge != first_coedge() );
  
  delete [] new_prefix;
}

Definition at line 125 of file CompositeLoop.cpp.

{
  if( coedge->myLoop != this )
    return CUBIT_FAILURE;
  
  if( numCoedges == 1 )
  {
    assert( coedge->nextCoedge == coedge &&
            coedge->prevCoedge == coedge );
    myCoedge = 0;
  }
  else
  {
    coedge->nextCoedge->prevCoedge = coedge->prevCoedge;
    coedge->prevCoedge->nextCoedge = coedge->nextCoedge;
    if( myCoedge == coedge )
      myCoedge = coedge->nextCoedge;
  }
  
  numCoedges--;
  coedge->myLoop = 0;
  coedge->nextCoedge = 0;
  coedge->prevCoedge = 0;
  
  return CUBIT_SUCCESS;
}

Definition at line 164 of file CompositeLoop.cpp.

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

Implements TopologyBridge.

Definition at line 256 of file CompositeLoop.cpp.

{ }

Implements TopologyBridge.

Definition at line 254 of file CompositeLoop.cpp.

{ }
void CompositeLoop::reverse ( bool  b_reverse_coedges)

Definition at line 275 of file CompositeLoop.cpp.

{
  CompositeCoEdge* coedge = myCoedge;
  if( coedge ) do
  {
    CompositeCoEdge* temp = coedge->nextCoedge;
    coedge->nextCoedge = coedge->prevCoedge;
    coedge->prevCoedge = temp;
    if (b_reverse_coedges) coedge->reverse();
    coedge = temp;
  } while( coedge != myCoedge );
}

Friends And Related Function Documentation

friend class CompositeSurface [friend]

Definition at line 23 of file CompositeLoop.hpp.


Member Data Documentation

Definition at line 73 of file CompositeLoop.hpp.

Definition at line 72 of file CompositeLoop.hpp.

Definition at line 71 of file CompositeLoop.hpp.

Definition at line 74 of file CompositeLoop.hpp.


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