cgma
CoFace Class Reference

#include <CoFace.hpp>

Inheritance diagram for CoFace:
SenseEntity TopologyEntity CubitObservable

List of all members.

Public Member Functions

 CoFace ()
virtual ~CoFace ()
 CoFace (RefFace *facePtr, CubitSense sense)
DagType dag_type () const
RefFaceget_ref_face_ptr ()
RefVolumeget_ref_volume ()
Shellget_shell_ptr ()
virtual void switch_child_notify (TopologyEntity const *newChild, TopologyEntity const *oldChild)

Private Member Functions

 CoFace (const CoFace &)
void operator= (const CoFace &)

Detailed Description

Definition at line 33 of file CoFace.hpp.


Constructor & Destructor Documentation

Definition at line 57 of file CoFace.cpp.

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

Definition at line 70 of file CoFace.cpp.

{
}
CoFace::CoFace ( RefFace facePtr,
CubitSense  sense 
)

Definition at line 84 of file CoFace.cpp.

{
   attach_basic_topology_entity(facePtr) ;
   set_sense(sense) ;
}
CoFace::CoFace ( const CoFace ) [private]

Member Function Documentation

DagType CoFace::dag_type ( ) const [inline, virtual]

Implements TopologyEntity.

Definition at line 51 of file CoFace.hpp.

{ return DagType::co_face_type(); }

Definition at line 100 of file CoFace.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 RefFace and return it
   return CAST_TO( BTEPtr, RefFace );   
}

Definition at line 137 of file CoFace.cpp.

{
   BasicTopologyEntity* bte_ptr = get_parent_basic_topology_entity_ptr();

   // Cast the returned pointer to RefFace and return it
   return dynamic_cast<RefVolume*>(bte_ptr);
}

Definition at line 119 of file CoFace.cpp.

{
   GroupingEntity* gpe_ptr = get_grouping_entity_ptr();

   // Cast the returned pointer to RefFace and return it
   return CAST_TO( gpe_ptr, Shell );   
}
void CoFace::operator= ( const CoFace ) [private]
void CoFace::switch_child_notify ( TopologyEntity const *  newChild,
TopologyEntity const *  oldChild 
) [virtual]

Definition at line 163 of file CoFace.cpp.

{
   // Make sure the entities being switched are RefFaces. If not,
   // get out of this function.
  TopologyEntity* tmp_new_child = const_cast<TopologyEntity*>(newChild);
  TopologyEntity* tmp_old_child = const_cast<TopologyEntity*>(oldChild);
   RefFace* new_child_ref_face = CAST_TO(tmp_new_child, RefFace) ;
   RefFace* old_child_ref_face = CAST_TO(tmp_old_child, RefFace) ;

   if ( ( new_child_ref_face == NULL ) || ( old_child_ref_face == NULL ) )
   {
      return ;
   }

   CubitSense sense =
       old_child_ref_face->compare_alignment( new_child_ref_face );
   
     // If the sense of the old RefFace relative to the new RefFace is 
     // same, nothing needs to be done. However, if the relative sense
     // is reversed, switch the sense of the CoFace.
   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