cgma
CompositePoint Class Reference

#include <CompositePoint.hpp>

Inheritance diagram for CompositePoint:
TBPoint TBOwner GeometryEntity TopologyBridge

List of all members.

Public Member Functions

 CompositePoint (TBPoint *real_pt)
virtual ~CompositePoint ()
CompositeCurvenext_curve (CompositeCurve *prev=0) const
TBPointget_point () const
void append_simple_attribute_virt (const CubitSimpleAttrib &csa)
void remove_simple_attribute_virt (const CubitSimpleAttrib &csa)
void remove_all_simple_attribute_virt ()
CubitStatus get_simple_attribute (DLIList< CubitSimpleAttrib > &list)
CubitStatus get_simple_attribute (const CubitString &name, DLIList< CubitSimpleAttrib > &attrib_list)
GeometryQueryEngineget_geometry_query_engine () const
void get_parents_virt (DLIList< TopologyBridge * > &)
void get_children_virt (DLIList< TopologyBridge * > &)
int layer () const
CubitVector coordinates () const
CubitStatus remove_bridge (TopologyBridge *bridge)
CubitStatus swap_bridge (TopologyBridge *old_tb, TopologyBridge *new_tb, bool)
void notify_reversed (TopologyBridge *bridge)
void print_debug_info (const char *prefix=0, bool brief=false) const
CubitStatus stitch (CompositePoint *point)
void unstitch_all ()
void get_stitched (DLIList< CompositePoint * > &result)

Public Attributes

int HadBridgeRemoved

Private Attributes

CompositeCurvefirstCurve
TBPointrealPoint
CompositePointstitchNext

Friends

class CompositeCurve

Detailed Description

Definition at line 23 of file CompositePoint.hpp.


Constructor & Destructor Documentation

Definition at line 17 of file CompositePoint.cpp.

  : HadBridgeRemoved(0), firstCurve(0), realPoint(real_pt), stitchNext(0)
{
  if( real_pt->owner() )
    real_pt->owner()->swap_bridge( real_pt, this, false );
  real_pt->owner(this);
}

Definition at line 25 of file CompositePoint.cpp.

{
    // remove from all curves
  while( firstCurve )
  {
    CompositeCurve* curve = firstCurve;
    if( curve->start_point() == this )
      curve->start_point(0);
    if( curve->end_point() == this )
      curve->end_point(0);
    assert(firstCurve != curve);
  }

  if( stitchNext )
  {
      // unmerge
    unstitch_all();
  }
  
  if (realPoint)
  {
      // update owner
    assert(realPoint->owner() == this);
    realPoint->owner(0);
    if( owner() )  
      owner()->swap_bridge( this, realPoint, false );
    
    realPoint = 0;
  }
}

Member Function Documentation

void CompositePoint::append_simple_attribute_virt ( const CubitSimpleAttrib csa) [inline, virtual]

Implements TopologyBridge.

Definition at line 39 of file CompositePoint.hpp.

CubitVector CompositePoint::coordinates ( void  ) const [inline, virtual]

Implements TBPoint.

Definition at line 74 of file CompositePoint.hpp.

  { 
    if(get_point())
      return get_point()->coordinates(); 
    return CubitVector(0,0,0);
  }

Implements TopologyBridge.

Definition at line 108 of file CompositePoint.cpp.

{
}

Implements TopologyBridge.

Definition at line 223 of file CompositePoint.cpp.

void CompositePoint::get_parents_virt ( DLIList< TopologyBridge * > &  list) [virtual]

Implements TopologyBridge.

Definition at line 69 of file CompositePoint.cpp.

{
  DLIList<TopologyBridge*> point_parents;
  realPoint->get_parents_virt( point_parents );
  for( int i = point_parents.size(); i--; )
  {
    TopologyBridge* tb = point_parents.get_and_step();
    if( CompositeCurve* curve = dynamic_cast<CompositeCurve*>(tb->owner()) )
    {
      if( ! dynamic_cast<HiddenEntitySet*>(curve->owner()) )
        list.append_unique( curve );
    }
    else if( ! dynamic_cast<HiddenEntitySet*>(tb->owner()) )
      list.append( tb );
  }

    // get point-curves also
  CompositeCurve* curve = 0;
  while ((curve = next_curve(curve)))
    if (curve->num_curves() == 0)
      list.append(curve);
  
  if (stitchNext)
  {
    point_parents.clean_out();
    stitchNext->get_parents_virt( point_parents );
    point_parents.reset();
    for (int j = point_parents.size(); j--; )
    {
      TopologyBridge* bridge = point_parents.get_and_step();
      CompositeCurve* curv = dynamic_cast<CompositeCurve*>(bridge);
      if (curv)
        list.append_unique( curv->primary_stitched_curve() );
      else
        list.append_unique( bridge );
    }
  }
}
TBPoint* CompositePoint::get_point ( ) const [inline]

Definition at line 36 of file CompositePoint.hpp.

    { return realPoint; }

Implements TopologyBridge.

Definition at line 54 of file CompositePoint.hpp.

  { 
    if(get_point()) 
      return get_point()->get_simple_attribute( list );
    return CUBIT_FAILURE; 
  }
CubitStatus CompositePoint::get_simple_attribute ( const CubitString name,
DLIList< CubitSimpleAttrib > &  attrib_list 
) [inline, virtual]

Implements TopologyBridge.

Definition at line 60 of file CompositePoint.hpp.

  { 
    if(get_point())
      return get_point()->get_simple_attribute( name, attrib_list ); 
    return CUBIT_FAILURE;
  }

Definition at line 211 of file CompositePoint.cpp.

{
  CompositePoint* pt = dynamic_cast<CompositePoint*>(owner());
  if (!pt)
    pt = this;
  while (pt)
  {
    result.append(pt);
    pt = pt->stitchNext;
  }
}
int CompositePoint::layer ( ) const [inline, virtual]

Reimplemented from TopologyBridge.

Definition at line 72 of file CompositePoint.hpp.

{ return COMPOSITE_LAYER; }
CompositeCurve* CompositePoint::next_curve ( CompositeCurve prev = 0) const [inline]

Definition at line 33 of file CompositePoint.hpp.

    { return prev ? prev->next( this ) : firstCurve; }
void CompositePoint::notify_reversed ( TopologyBridge bridge) [virtual]

Implements TBOwner.

Definition at line 180 of file CompositePoint.cpp.

  { }
void CompositePoint::print_debug_info ( const char *  prefix = 0,
bool  brief = false 
) const

Definition at line 159 of file CompositePoint.cpp.

{
  if( prefix == 0 ) prefix = "";

#ifdef TOPOLOGY_BRIDGE_IDS
  PRINT_INFO("%sCompositePoint %d : %s %d\n", prefix, get_id(),
    realPoint ? fix_type_name(typeid(*realPoint).name()) : "NO REAL POINT", 
    realPoint ? realPoint->get_id() : 0 );
#else  
  PRINT_INFO("%sCompositePoint %p : %s %p\n", prefix, (void*)this,
    realPoint ? fix_type_name(typeid(*realPoint).name()) : "NO REAL POINT", 
    (void*)realPoint);
#endif
  
  if ( !brief )
  {  
    CubitVector p = coordinates();
    PRINT_INFO("%s  (%f,%f,%f)\n", prefix, p.x(), p.y(), p.z() );
  }
}

Implements TopologyBridge.

Definition at line 49 of file CompositePoint.hpp.

Implements TBOwner.

Definition at line 113 of file CompositePoint.cpp.

{
  if( bridge->owner() != this  )
  {
    assert(0);
    return CUBIT_FAILURE;
  }
  
  if( bridge == realPoint )
  {
    realPoint = 0;
  }
  else
  {
    return CUBIT_FAILURE;
  }
  
  bridge->owner(0);
  
  if (!realPoint)
    CompositeEngine::instance().notify_deactivated(this);

  HadBridgeRemoved = 1;

  return CUBIT_SUCCESS;
}
void CompositePoint::remove_simple_attribute_virt ( const CubitSimpleAttrib csa) [inline, virtual]

Implements TopologyBridge.

Definition at line 44 of file CompositePoint.hpp.

Definition at line 183 of file CompositePoint.cpp.

{
  if( !point || point->owner() != this->owner() )
  {
    assert(0);
    return CUBIT_FAILURE;
  }
  
  if( point->owner() )
    point->owner()->notify_merged( point, this );
  
  if( point->owner() )
    point->owner()->remove_bridge( point );

  point->owner( this );
  CompositePoint* end = point;
  while (end->stitchNext)
  {
    end->stitchNext->owner( this );
    end = end->stitchNext;
  }
  
  end->stitchNext = stitchNext;
  stitchNext = end;
  
  return CUBIT_SUCCESS;
}
CubitStatus CompositePoint::swap_bridge ( TopologyBridge old_tb,
TopologyBridge new_tb,
bool   
) [virtual]

Implements TBOwner.

Definition at line 140 of file CompositePoint.cpp.

{
  TBPoint* oldpt = dynamic_cast<TBPoint*>(oldtb);
  TBPoint* newpt = dynamic_cast<TBPoint*>(newtb);
  if( !(oldpt && newpt) || newpt->owner() )
    return CUBIT_FAILURE;

  assert(oldpt == realPoint );

  realPoint = newpt;

  newtb->owner(this);
  oldtb->owner(0);
  return CUBIT_SUCCESS;
}

Definition at line 56 of file CompositePoint.cpp.

{
  assert( !firstCurve );
  while (stitchNext)
  {
    stitchNext->owner(0);
    if (owner())
      owner()->notify_copied( stitchNext, this );
    stitchNext = stitchNext->stitchNext;
  }
}

Friends And Related Function Documentation

friend class CompositeCurve [friend]

Definition at line 25 of file CompositePoint.hpp.


Member Data Documentation

Definition at line 93 of file CompositePoint.hpp.

Definition at line 28 of file CompositePoint.hpp.

Definition at line 95 of file CompositePoint.hpp.

Definition at line 97 of file CompositePoint.hpp.


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