cgma
|
#include <CompositeCoEdge.hpp>
Definition at line 25 of file CompositeCoEdge.hpp.
CompositeCoEdge::CompositeCoEdge | ( | CoEdgeSM * | coedge_ptr | ) |
Definition at line 31 of file CompositeCoEdge.cpp.
: myLoop(0), nextCoedge(0), prevCoedge(0), myCurve(0), nextOnCurve(0) { mySense = coedge->sense(); coedgeSet.push( coedge ); if( coedge->owner() ) coedge->owner()->swap_bridge( coedge, this, false ); coedge->owner(this); }
CompositeCoEdge::CompositeCoEdge | ( | CompositeCurve * | point_curve | ) |
Definition at line 45 of file CompositeCoEdge.cpp.
: mySense(CUBIT_FORWARD), myLoop(0), nextCoedge(0), prevCoedge(0), myCurve(0), nextOnCurve(0) { assert(point_curve->num_curves() == 0); CubitStatus stat = point_curve->add(this); assert(stat); if (CUBIT_SUCCESS != stat) { PRINT_ERROR("Failed to add a coedge to point curve.\n"); } }
Definition at line 79 of file CompositeCoEdge.cpp.
{ if( myLoop ) myLoop->remove(this); if( myCurve ) myCurve->remove(this); assert( !prevCoedge && !nextCoedge && !nextOnCurve ); for( int i = 0; i < coedgeSet.size(); i++ ) if( coedgeSet[i]->owner() == this ) coedgeSet[i]->owner(0); }
CompositeCoEdge::CompositeCoEdge | ( | ) | [private] |
Definition at line 61 of file CompositeCoEdge.cpp.
: mySense(CUBIT_UNKNOWN), myLoop(0), nextCoedge( 0 ), prevCoedge( 0 ), myCurve(0), nextOnCurve(0) {}
void CompositeCoEdge::append_simple_attribute_virt | ( | const CubitSimpleAttrib & | simple_attrib_ptr | ) | [virtual] |
CubitStatus CompositeCoEdge::combine | ( | CompositeCoEdge * | dead_coedge, |
bool | prepend | ||
) |
Definition at line 185 of file CompositeCoEdge.cpp.
{ int insert; if ( prepend ) { insert = 0; coedgeSet.size_end( coedgeSet.size() + dead->coedgeSet.size() ); } else { insert = coedgeSet.size(); coedgeSet.size( coedgeSet.size() + dead->coedgeSet.size() ); } for( int i = 0; i < dead->coedgeSet.size(); i++ ) { CoEdgeSM* coedge = dead->coedgeSet[i]; assert( coedge->owner() == dead ); coedge->owner(this); coedgeSet[insert++] = coedge; } dead->coedgeSet.size(0); return CUBIT_SUCCESS; }
CubitBoolean CompositeCoEdge::contains_bridge | ( | TopologyBridge * | bridge | ) | const [virtual] |
Reimplemented from TBOwner.
Definition at line 443 of file CompositeCoEdge.cpp.
{ CompositeCoEdge* coedge = dynamic_cast<CompositeCoEdge*>(bridge); return (index_of(coedge) < 0) ? CUBIT_FALSE : CUBIT_TRUE; }
Definition at line 528 of file CompositeCoEdge.cpp.
{ return mySense == CUBIT_FORWARD ? myCurve->end_point() : myCurve->start_point(); }
void CompositeCoEdge::get_children_virt | ( | DLIList< TopologyBridge * > & | children | ) | [virtual] |
Implements TopologyBridge.
Definition at line 278 of file CompositeCoEdge.cpp.
{ if( myCurve ) { children.append( myCurve->primary_stitched_curve() ); } /* else if( num_coedges() ) { DLIList<TopologyBridge*> coedge_children; coedge(0)->get_children( coedge_children ); assert( coedge_children.size() == 1 ); children.append( coedge_children.get() ); } */ }
CoEdgeSM * CompositeCoEdge::get_coedge | ( | int | index | ) | const [inline] |
Definition at line 120 of file CompositeCoEdge.hpp.
{ return coedgeSet[index]; }
CompositeCurve * CompositeCoEdge::get_curve | ( | ) | const [inline] |
Definition at line 138 of file CompositeCoEdge.hpp.
{ return myCurve; }
GeometryQueryEngine * CompositeCoEdge::get_geometry_query_engine | ( | ) | const [virtual] |
Implements TopologyBridge.
Definition at line 462 of file CompositeCoEdge.cpp.
{ return VirtualQueryEngine::instance(); }
CompositeLoop * CompositeCoEdge::get_loop | ( | ) | const [inline] |
Definition at line 135 of file CompositeCoEdge.hpp.
{ return myLoop; }
Definition at line 349 of file CompositeCoEdge.cpp.
{ LoopSM* result = get_loop(); if( !result && num_coedges() ) { DLIList<TopologyBridge*> parents(1); get_coedge(0)->get_parents_virt( parents ); assert( parents.size() == 1 ); result = dynamic_cast<LoopSM*>(parents.get()); } return result; }
void CompositeCoEdge::get_parents_virt | ( | DLIList< TopologyBridge * > & | parents | ) | [virtual] |
Implements TopologyBridge.
Definition at line 260 of file CompositeCoEdge.cpp.
{ LoopSM* result = get_parent_loop(); if( result ) { parents.append( result ); } }
CubitSense CompositeCoEdge::get_sense | ( | int | index | ) | const |
CubitStatus CompositeCoEdge::get_simple_attribute | ( | DLIList< CubitSimpleAttrib > & | attrib_list | ) | [virtual] |
Implements TopologyBridge.
Definition at line 480 of file CompositeCoEdge.cpp.
{ return CUBIT_FAILURE; }
CubitStatus CompositeCoEdge::get_simple_attribute | ( | const CubitString & | name, |
DLIList< CubitSimpleAttrib > & | attrib_list | ||
) | [virtual] |
Implements TopologyBridge.
Definition at line 482 of file CompositeCoEdge.cpp.
{ return CUBIT_FAILURE; }
int CompositeCoEdge::index_of | ( | CoEdgeSM * | coedge_ptr | ) | const [inline] |
Definition at line 123 of file CompositeCoEdge.hpp.
int CompositeCoEdge::index_of | ( | Curve * | curve_ptr | ) | const |
Definition at line 123 of file CompositeCoEdge.cpp.
{ int i; DLIList<TopologyBridge*> curve_list; TopologyBridge* curve = ptr; for( i = coedgeSet.size() - 1; i > 0; i-- ) { curve_list.clean_out(); coedgeSet[i]->get_children( curve_list ); if( curve_list.is_in_list( curve ) ) break; } return i; }
CubitStatus CompositeCoEdge::insert_coedge | ( | int | index, |
CoEdgeSM * | coedge | ||
) |
Definition at line 548 of file CompositeCoEdge.cpp.
{ if( index < 0 || index > coedgeSet.size() ) return CUBIT_FAILURE; coedgeSet.insert(coedge, index); coedge->owner(this); return CUBIT_SUCCESS; }
int CompositeCoEdge::layer | ( | ) | const [inline, virtual] |
Reimplemented from TopologyBridge.
Definition at line 81 of file CompositeCoEdge.hpp.
{ return COMPOSITE_LAYER; }
CompositeCoEdge * CompositeCoEdge::next | ( | ) | const [inline] |
Definition at line 132 of file CompositeCoEdge.hpp.
{ return nextCoedge; }
void CompositeCoEdge::notify_reversed | ( | TopologyBridge * | bridge | ) | [virtual] |
int CompositeCoEdge::num_coedges | ( | ) | const [inline] |
Definition at line 117 of file CompositeCoEdge.hpp.
CompositeCoEdge* CompositeCoEdge::prev | ( | ) | const |
void CompositeCoEdge::print_debug_info | ( | const char * | line_prefix = 0 , |
bool | brief = false |
||
) |
Definition at line 558 of file CompositeCoEdge.cpp.
{ if( prefix == 0 ) prefix = ""; const char* sense = mySense == CUBIT_FORWARD ? "Forward" : mySense == CUBIT_REVERSED ? "Reverse" : "UNKNOWN"; PRINT_INFO("%sCompCoEdge %p %s ", prefix, (void*)this, sense ); if ( num_coedges() == 1 ) PRINT_INFO("%s %p ", fix_type_name(typeid(*get_coedge(0)).name()), (void*)get_coedge(0)); else PRINT_INFO("%d coedges ", num_coedges() ); if( !myCurve ) PRINT_INFO("NULL CURVE\n"); else if( brief ) #ifdef TOPOLOGY_BRIDGE_IDS PRINT_INFO("curve %d\n", myCurve->get_id() ); #else PRINT_INFO("curve %p\n", (void*)myCurve ); #endif else { PRINT_INFO("\n "); myCurve->print_debug_info(prefix, true); } /* if( coedgeSet.size() == 0 ) PRINT_INFO(" No CoEdgeSMs!\n"); else if( coedgeSet.size() == 1 ) PRINT_INFO(" CoEdgeSM=%p\n", coedgeSet[0] ); else { PRINT_INFO("\n"); for( int i = 0; i < coedgeSet.size(); i++ ) PRINT_INFO("%s CoEdgeSM[%d] = %p\n", prefix, i, coedgeSet[i] ); } */ }
void CompositeCoEdge::remove_all_simple_attribute_virt | ( | ) | [virtual] |
CubitStatus CompositeCoEdge::remove_bridge | ( | TopologyBridge * | bridge | ) | [virtual] |
Implements TBOwner.
Definition at line 373 of file CompositeCoEdge.cpp.
{ int index; for( index = coedgeSet.size() - 1; index >= 0; index-- ) if( coedgeSet[index] == bridge ) break; if( index < 0 ) return CUBIT_FAILURE; coedgeSet.remove( index ); bridge->owner(0); /* if ( coedgeSet.size() > 0 ) return CUBIT_SUCCESS; if ( get_curve() ) get_curve()->remove(this); if ( get_loop() ) { CompositeLoop* loop = get_loop(); loop->remove(this); if ( loop->first_coedge() == 0 ) delete loop; } delete this; */ return CUBIT_SUCCESS; }
CubitStatus CompositeCoEdge::remove_coedge | ( | int | index | ) |
Definition at line 536 of file CompositeCoEdge.cpp.
{ if( index < 0 || index >= coedgeSet.size() ) return CUBIT_FAILURE; coedgeSet[index]->owner(0); coedgeSet.remove( index ); return CUBIT_SUCCESS; }
void CompositeCoEdge::remove_simple_attribute_virt | ( | const CubitSimpleAttrib & | simple_attrib_ptr | ) | [virtual] |
void CompositeCoEdge::reverse | ( | ) |
Definition at line 489 of file CompositeCoEdge.cpp.
{ switch( mySense ) { case CUBIT_FORWARD: mySense = CUBIT_REVERSED; break; case CUBIT_REVERSED: mySense = CUBIT_FORWARD; break; default: mySense = CUBIT_UNKNOWN; } int half = coedgeSet.size() / 2; for( int i = 0; i < half; i++ ) { int j = coedgeSet.size() - i - 1; CoEdgeSM* tmp = coedgeSet[i]; coedgeSet[i] = coedgeSet[j]; coedgeSet[j] = tmp; } }
CubitSense CompositeCoEdge::sense | ( | ) | [inline, virtual] |
void CompositeCoEdge::sense | ( | CubitSense | sense | ) | [inline] |
Definition at line 126 of file CompositeCoEdge.hpp.
{ assert( sense != CUBIT_UNKNOWN ); mySense = sense; }
CompositeCoEdge * CompositeCoEdge::split | ( | int | index | ) |
Definition at line 147 of file CompositeCoEdge.cpp.
{ if( index < 0 || index >= coedgeSet.size() ) return 0; ++index; CompositeCoEdge* new_cce = new CompositeCoEdge(); new_cce->mySense = mySense; int new_cce_count = coedgeSet.size() - index; new_cce->coedgeSet.size( new_cce_count ); for( int i = 0; i < new_cce_count; i++ ) { new_cce->coedgeSet[i] = coedgeSet[i+index]; new_cce->coedgeSet[i]->owner( new_cce ); } coedgeSet.size( index ); if( myLoop ) { CubitStatus s; if( mySense == CUBIT_FORWARD ) s = myLoop->insert_after( new_cce, this ); else s = myLoop->insert_before( new_cce, this ); assert( s ); if (CUBIT_SUCCESS != s) { PRINT_ERROR("Failed to insert a child coedge.\n"); return NULL; } } new_cce->mySense = mySense; return new_cce; }
Definition at line 522 of file CompositeCoEdge.cpp.
{ return mySense == CUBIT_FORWARD ? myCurve->start_point() : myCurve->end_point(); }
CubitStatus CompositeCoEdge::swap_bridge | ( | TopologyBridge * | old_tb, |
TopologyBridge * | new_tb, | ||
bool | reversed | ||
) | [virtual] |
Implements TBOwner.
Definition at line 413 of file CompositeCoEdge.cpp.
{ CoEdgeSM* old_coedge = dynamic_cast<CoEdgeSM*>(old_tb); CoEdgeSM* new_coedge = dynamic_cast<CoEdgeSM*>(new_tb); int index = index_of( old_coedge ); if( index < 0 || !new_coedge || index_of(new_coedge) >= 0 ) return CUBIT_FAILURE; coedgeSet[index] = new_coedge; old_tb->owner(0); if( new_tb->owner() ) new_tb->owner()->remove_bridge( new_tb ); new_tb->owner(this); return CUBIT_SUCCESS; }
friend class CompositeCurve [friend] |
Definition at line 28 of file CompositeCoEdge.hpp.
friend class CompositeLoop [friend] |
Definition at line 27 of file CompositeCoEdge.hpp.
VGArray<CoEdgeSM*> CompositeCoEdge::coedgeSet [private] |
Definition at line 105 of file CompositeCoEdge.hpp.
CompositeCurve* CompositeCoEdge::myCurve [private] |
Definition at line 113 of file CompositeCoEdge.hpp.
CompositeLoop* CompositeCoEdge::myLoop [private] |
Definition at line 109 of file CompositeCoEdge.hpp.
CubitSense CompositeCoEdge::mySense [private] |
Definition at line 107 of file CompositeCoEdge.hpp.
CompositeCoEdge* CompositeCoEdge::nextCoedge [private] |
Definition at line 110 of file CompositeCoEdge.hpp.
CompositeCoEdge* CompositeCoEdge::nextOnCurve [private] |
Definition at line 114 of file CompositeCoEdge.hpp.
CompositeCoEdge* CompositeCoEdge::prevCoedge [private] |
Definition at line 111 of file CompositeCoEdge.hpp.