cgma
|
#include <CoEdge.hpp>
Public Member Functions | |
CoEdge () | |
virtual | ~CoEdge () |
CoEdge (RefEdge *edgePtr, CubitSense sense) | |
CoEdge (CoEdgeSM *OSMEPtr) | |
DagType | dag_type () const |
RefEdge * | get_ref_edge_ptr () |
RefFace * | get_ref_face () |
Loop * | get_loop_ptr () |
virtual void | switch_child_notify (TopologyEntity const *newChild, TopologyEntity const *oldChild) |
CoEdgeSM * | get_co_edge_sm_ptr () const |
CubitStatus | set_co_edge_sm_ptr (CoEdgeSM *) |
CubitBoolean | about_spatially_equal (CoEdge *other_coedge, CubitSense relative_sense, double tolerance_factor=1.0, CubitBoolean notify_refEntity=CUBIT_FALSE) |
RefVertex * | start_vertex () |
RefVertex * | end_vertex () |
Private Member Functions | |
CoEdge (const CoEdge &) | |
void | operator= (const CoEdge &) |
Definition at line 34 of file CoEdge.hpp.
CoEdge::CoEdge | ( | ) |
Definition at line 45 of file CoEdge.cpp.
{ }
CoEdge::~CoEdge | ( | ) | [virtual] |
Definition at line 58 of file CoEdge.cpp.
{ remove_from_observers(); }
CoEdge::CoEdge | ( | RefEdge * | edgePtr, |
CubitSense | sense | ||
) |
Definition at line 73 of file CoEdge.cpp.
{ attach_basic_topology_entity(edgePtr) ; set_sense(sense) ; }
CoEdge::CoEdge | ( | CoEdgeSM * | OSMEPtr | ) |
Definition at line 88 of file CoEdge.cpp.
{ set_co_edge_sm_ptr(osme_ptr); }
CoEdge::CoEdge | ( | const CoEdge & | ) | [private] |
CubitBoolean CoEdge::about_spatially_equal | ( | CoEdge * | other_coedge, |
CubitSense | relative_sense, | ||
double | tolerance_factor = 1.0 , |
||
CubitBoolean | notify_refEntity = CUBIT_FALSE |
||
) |
Definition at line 246 of file CoEdge.cpp.
{ RefEdge* this_ref_edge = get_ref_edge_ptr(); RefEdge* other_ref_edge = other_coedge->get_ref_edge_ptr(); CubitSense edge_sense; if (!this_ref_edge->about_spatially_equal( other_ref_edge, tolerance_factor, &edge_sense, notify_refEntity )) return CUBIT_FALSE; if (this_ref_edge->get_curve_ptr()->geometry_type() == POINT_CURVE_TYPE || other_ref_edge->get_curve_ptr()->geometry_type() == POINT_CURVE_TYPE) return CUBIT_TRUE; if (edge_sense == CUBIT_UNKNOWN) { PRINT_WARNING("Failed to determine relative sense of curves.\n"); return CUBIT_TRUE; } bool coedges_reversed = get_sense() != other_coedge->get_sense(); bool want_reversed = edge_sense != relative_sense; if (coedges_reversed == want_reversed) return CUBIT_TRUE; // if (notify_refEntity) // { // this_ref_edge->remove_compare_data(); // other_ref_edge->remove_compare_data(); // } return CUBIT_FALSE; }
DagType CoEdge::dag_type | ( | ) | const [inline, virtual] |
Implements TopologyEntity.
Definition at line 55 of file CoEdge.hpp.
{ return DagType::co_edge_type(); }
RefVertex * CoEdge::end_vertex | ( | ) |
Definition at line 299 of file CoEdge.cpp.
{ return get_sense() == CUBIT_REVERSED ? get_ref_edge_ptr()->start_vertex() : get_ref_edge_ptr()->end_vertex(); }
CoEdgeSM * CoEdge::get_co_edge_sm_ptr | ( | ) | const |
Definition at line 220 of file CoEdge.cpp.
{ return static_cast<CoEdgeSM*>(bridge_manager()->topology_bridge()); }
Loop * CoEdge::get_loop_ptr | ( | ) |
Definition at line 121 of file CoEdge.cpp.
{ return STATIC_CAST_TO( get_grouping_entity_ptr(), Loop ); }
Definition at line 102 of file CoEdge.cpp.
{ // Call the generic function defined in the SenseEntity class to // do the real work BasicTopologyEntity* BTEPtr = get_basic_topology_entity_ptr(); // Cast the returned pointer to RefEdge and return it return STATIC_CAST_TO( BTEPtr, RefEdge ); }
RefFace * CoEdge::get_ref_face | ( | ) |
Definition at line 137 of file CoEdge.cpp.
{ return static_cast<RefFace*>(get_parent_basic_topology_entity_ptr()); }
void CoEdge::operator= | ( | const CoEdge & | ) | [private] |
Definition at line 226 of file CoEdge.cpp.
{ if (!bridge_manager()->topology_bridge()) return bridge_manager()->add_bridge(ptr); else if(bridge_manager()->topology_bridge() != ptr) return CUBIT_FAILURE; else return CUBIT_SUCCESS; }
Definition at line 293 of file CoEdge.cpp.
{ return get_sense() == CUBIT_FORWARD ? get_ref_edge_ptr()->start_vertex() : get_ref_edge_ptr()->end_vertex(); }
void CoEdge::switch_child_notify | ( | TopologyEntity const * | newChild, |
TopologyEntity const * | oldChild | ||
) | [virtual] |
Definition at line 161 of file CoEdge.cpp.
{ // Make sure the entities being switched are RefEdges. If not, // get out of this function. TopologyEntity* tmp_new_child = const_cast<TopologyEntity*>(newChild); TopologyEntity* tmp_old_child = const_cast<TopologyEntity*>(oldChild); RefEdge * newChildRefEdge = CAST_TO(tmp_new_child, RefEdge) ; RefEdge * oldChildRefEdge = CAST_TO(tmp_old_child, RefEdge) ; if ( ( newChildRefEdge == NULL ) || ( oldChildRefEdge == NULL ) ) { return ; } // If the children are RefEdges, get the sense of the old RefEdge // relative to the new one. CubitSense sense; CubitBoolean spatially_equal; //We really don't care at this point if the two are spatially equal. // The user could have done a force merge and in which case they are not. // So just ignore that spatial comparison. //When this function is called, the merge has already taken place, so force // merge actually makes more sense to use here... CubitBoolean force_merge = CUBIT_TRUE; /*CubitStatus stat = */ newChildRefEdge->relative_sense( oldChildRefEdge, GeometryQueryTool::get_geometry_factor(), &sense, spatially_equal, force_merge ); // If the sense of the old RefEdge relative to the new RefEdge is // same, nothing needs to be done. However, if the relative sense // is reversed, switch the sense of the CoEdge. if ( sense == CUBIT_REVERSED ) { if ( get_sense() == CUBIT_FORWARD ) { set_sense(CUBIT_REVERSED) ; } else { set_sense(CUBIT_FORWARD) ; } } }