cgma
CoEdge Class Reference

#include <CoEdge.hpp>

Inheritance diagram for CoEdge:
SenseEntity ToolDataUser TopologyEntity CubitObservable

List of all members.

Public Member Functions

 CoEdge ()
virtual ~CoEdge ()
 CoEdge (RefEdge *edgePtr, CubitSense sense)
 CoEdge (CoEdgeSM *OSMEPtr)
DagType dag_type () const
RefEdgeget_ref_edge_ptr ()
RefFaceget_ref_face ()
Loopget_loop_ptr ()
virtual void switch_child_notify (TopologyEntity const *newChild, TopologyEntity const *oldChild)
CoEdgeSMget_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)
RefVertexstart_vertex ()
RefVertexend_vertex ()

Private Member Functions

 CoEdge (const CoEdge &)
void operator= (const CoEdge &)

Detailed Description

Definition at line 34 of file CoEdge.hpp.


Constructor & Destructor Documentation

Definition at line 45 of file CoEdge.cpp.

{
}
CoEdge::~CoEdge ( ) [virtual]

Definition at line 58 of file CoEdge.cpp.

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]

Member Function Documentation

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(); }

Definition at line 220 of file CoEdge.cpp.

{
  return static_cast<CoEdgeSM*>(bridge_manager()->topology_bridge());
}

Definition at line 121 of file CoEdge.cpp.

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 );
}

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;
}
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) ;
    }
  }
}

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