cgma
|
#include <CompositePoint.hpp>
Definition at line 23 of file CompositePoint.hpp.
CompositePoint::CompositePoint | ( | TBPoint * | real_pt | ) |
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); }
CompositePoint::~CompositePoint | ( | ) | [virtual] |
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; } }
void CompositePoint::append_simple_attribute_virt | ( | const CubitSimpleAttrib & | csa | ) | [inline, virtual] |
Implements TopologyBridge.
Definition at line 39 of file CompositePoint.hpp.
{ if(get_point()) get_point()->append_simple_attribute_virt( csa ); }
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); }
void CompositePoint::get_children_virt | ( | DLIList< TopologyBridge * > & | ) | [virtual] |
GeometryQueryEngine * CompositePoint::get_geometry_query_engine | ( | ) | const [virtual] |
Implements TopologyBridge.
Definition at line 223 of file CompositePoint.cpp.
{ return VirtualQueryEngine::instance(); }
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; }
CubitStatus CompositePoint::get_simple_attribute | ( | DLIList< CubitSimpleAttrib > & | list | ) | [inline, virtual] |
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; }
void CompositePoint::get_stitched | ( | DLIList< CompositePoint * > & | result | ) |
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] |
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() ); } }
void CompositePoint::remove_all_simple_attribute_virt | ( | ) | [inline, virtual] |
Implements TopologyBridge.
Definition at line 49 of file CompositePoint.hpp.
{ if(get_point()) get_point()->remove_all_simple_attribute_virt(); }
CubitStatus CompositePoint::remove_bridge | ( | TopologyBridge * | bridge | ) | [virtual] |
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.
{ if(get_point()) get_point()->remove_simple_attribute_virt( csa ); }
CubitStatus CompositePoint::stitch | ( | CompositePoint * | point | ) |
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; }
void CompositePoint::unstitch_all | ( | ) |
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; } }
friend class CompositeCurve [friend] |
Definition at line 25 of file CompositePoint.hpp.
CompositeCurve* CompositePoint::firstCurve [private] |
Definition at line 93 of file CompositePoint.hpp.
Definition at line 28 of file CompositePoint.hpp.
TBPoint* CompositePoint::realPoint [private] |
Definition at line 95 of file CompositePoint.hpp.
CompositePoint* CompositePoint::stitchNext [private] |
Definition at line 97 of file CompositePoint.hpp.