cgma
CompositeShell Class Reference

#include <CompositeShell.hpp>

Inheritance diagram for CompositeShell:
ShellSM TopologyBridge

List of all members.

Public Member Functions

 CompositeShell ()
virtual ~CompositeShell ()
CompositeLumpget_lump () const
CompositeShellnext_shell () const
CompositeCoSurffirst_co_surf () const
CompositeCoSurfnext_co_surf (CompositeCoSurf *prev) const
CubitStatus add (CompositeCoSurf *cosurf)
CubitStatus remove (CompositeCoSurf *cosurf)
CompositeCoSurfadd (CompositeSurface *surface, CubitSense sense)
CompositeCoSurffind_first (const CompositeSurface *surface) const
CompositeCoSurffind_next (const CompositeCoSurf *prev) const
CubitSense find_sense (const CompositeSurface *surface) const
void append_simple_attribute_virt (const CubitSimpleAttrib &simple_attrib_ptr)
void remove_simple_attribute_virt (const CubitSimpleAttrib &simple_attrib_ptr)
void remove_all_simple_attribute_virt ()
CubitStatus get_simple_attribute (DLIList< CubitSimpleAttrib > &attrib_list)
CubitStatus get_simple_attribute (const CubitString &name, DLIList< CubitSimpleAttrib > &attrib_list)
void get_parents_virt (DLIList< TopologyBridge * > &parents)
void get_children_virt (DLIList< TopologyBridge * > &children)
GeometryQueryEngineget_geometry_query_engine () const
int layer () const
void print_debug_info (const char *line_prefix=0)

Private Attributes

CompositeLumpmyLump
CompositeShelllumpNext
CompositeCoSurffirstCoSurf

Friends

class CompositeLump

Detailed Description

Definition at line 23 of file CompositeShell.hpp.


Constructor & Destructor Documentation

Definition at line 19 of file CompositeShell.cpp.

  : myLump(0), lumpNext(0), firstCoSurf(0)
{
}

Definition at line 24 of file CompositeShell.cpp.

{
//  if( myLump ) 
//    myLump->remove( this );
  
  while( firstCoSurf )
  {
    CompositeCoSurf* cosurf = firstCoSurf;
    remove( cosurf );
    if( cosurf->get_surface() )
      cosurf->get_surface()->remove( cosurf );
    delete cosurf;
  }
  
  assert( !myLump );
}

Member Function Documentation

Definition at line 51 of file CompositeShell.cpp.

{
  if( cosurf->myShell )
    return CUBIT_FAILURE;
  
  cosurf->shellNext = firstCoSurf;
  firstCoSurf = cosurf;
  cosurf->myShell = this;

  return CUBIT_SUCCESS;
}

Definition at line 85 of file CompositeShell.cpp.

{
  CompositeCoSurf* cosurf = new CompositeCoSurf( sense );
  if( !surface->add( cosurf ) || !add( cosurf ) )
  {
    delete cosurf;
    cosurf = 0;
  }
  return cosurf;
}
void CompositeShell::append_simple_attribute_virt ( const CubitSimpleAttrib simple_attrib_ptr) [virtual]

Implements TopologyBridge.

Definition at line 165 of file CompositeShell.cpp.

{ }

Definition at line 97 of file CompositeShell.cpp.

{
  CompositeCoSurf* cosurf = firstCoSurf;
  while( cosurf && cosurf->get_surface() != surf )
    cosurf = cosurf->shellNext;
  return cosurf;
}

Definition at line 105 of file CompositeShell.cpp.

{
  CompositeCoSurf* cosurf = prev->shellNext;
  while( cosurf && cosurf->get_surface() != prev->get_surface() )
    cosurf = cosurf->shellNext;
  return cosurf;
}

Definition at line 113 of file CompositeShell.cpp.

{
  CompositeCoSurf* first = find_first( surf );
  if( !first )
    return CUBIT_UNKNOWN;
  
  CompositeCoSurf* next = first;
  while( (next = find_next( next )) )
    if( next->sense() != first->sense() )
      return CUBIT_UNKNOWN;
  
  return first->sense();
}

Definition at line 75 of file CompositeShell.hpp.

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

Implements TopologyBridge.

Definition at line 135 of file CompositeShell.cpp.

{ 
  for( CompositeCoSurf* c = firstCoSurf; c; c = c->next_in_shell() )
    children.append( c->get_surface() );
}

Implements TopologyBridge.

Definition at line 152 of file CompositeShell.cpp.

Definition at line 72 of file CompositeShell.hpp.

  { return myLump; }
void CompositeShell::get_parents_virt ( DLIList< TopologyBridge * > &  parents) [virtual]

Implements TopologyBridge.

Definition at line 132 of file CompositeShell.cpp.

  { if( myLump ) parents.append( static_cast<TopologyBridge*>(myLump) ); }

Implements TopologyBridge.

Definition at line 171 of file CompositeShell.cpp.

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

Implements TopologyBridge.

Definition at line 173 of file CompositeShell.cpp.

{ return CUBIT_FAILURE; }
int CompositeShell::layer ( ) const [inline, virtual]

Reimplemented from TopologyBridge.

Definition at line 60 of file CompositeShell.hpp.

{ return COMPOSITE_LAYER; }

Definition at line 41 of file CompositeShell.cpp.

{ 
  if (0 == prev)
    return firstCoSurf;
  else if (this == prev->myShell)
    return prev->shellNext;
  else
    return 0;
}
void CompositeShell::print_debug_info ( const char *  line_prefix = 0)

Definition at line 187 of file CompositeShell.cpp.

{
  if( prefix == 0 ) prefix = "";
  PRINT_INFO("%sCompositeShell @ %p : \n", prefix, (void*)this );
    
  char* new_prefix = new char[strlen(prefix)+3];
  strcpy( new_prefix, prefix );
  strcat( new_prefix, "  " );
  
  CompositeCoSurf* cosurf = first_co_surf();
  if( !cosurf )
    PRINT_INFO("%sNo Surfaces!!\n", prefix);
  else for (; cosurf; cosurf = next_co_surf( cosurf ))
    cosurf->print_debug_info( new_prefix );
  
  delete [] new_prefix;
}

Definition at line 63 of file CompositeShell.cpp.

{
  if( cosurf->myShell != this )
    return CUBIT_FAILURE;
  
  if( firstCoSurf == cosurf )
    firstCoSurf = cosurf->shellNext;
  else 
  {
    CompositeCoSurf* prev = firstCoSurf;
    while( prev && prev->shellNext != cosurf )
      prev = prev->shellNext;
    assert( prev != 0 );
    prev->shellNext = cosurf->shellNext;
  }
  
  cosurf->myShell = 0;
  cosurf->shellNext = 0;
  return CUBIT_SUCCESS;
}

Implements TopologyBridge.

Definition at line 169 of file CompositeShell.cpp.

{ }
void CompositeShell::remove_simple_attribute_virt ( const CubitSimpleAttrib simple_attrib_ptr) [virtual]

Implements TopologyBridge.

Definition at line 167 of file CompositeShell.cpp.

{ }

Friends And Related Function Documentation

friend class CompositeLump [friend]

Definition at line 25 of file CompositeShell.hpp.


Member Data Documentation

Definition at line 69 of file CompositeShell.hpp.

Definition at line 67 of file CompositeShell.hpp.

Definition at line 66 of file CompositeShell.hpp.


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