cgma
RefVertex Class Reference

#include <RefVertex.hpp>

Inheritance diagram for RefVertex:
BasicTopologyEntity TopologyEntity RefEntity CubitEntity CubitObservable ToolDataUser CubitAttribUser

List of all members.

Public Types

typedef RefEdge ParentType

Public Member Functions

virtual ~RefVertex ()
virtual const char * class_name () const
DagType dag_type () const
 Returns the dag type of this enity.
const std::type_info & entity_type_info () const
 Returns the type info of this enity.
TBPointget_point_ptr ()
TBPoint const * get_point_ptr () const
CubitVector coordinates () const
virtual CubitVector center_point ()
 Return the approximate (spatial) center of this RefEntity.
virtual int dimension () const
void get_parent_ref_entities (DLIList< RefEntity * > &entity_list)
void common_ref_edges (RefVertex *other_vertex, DLIList< RefEdge * > &common_ref_edges, RefFace *owning_face=NULL)
RefEdgecommon_ref_edge (RefVertex *other_vertex, RefFace *owning_face=NULL)
CubitBoolean about_spatially_equal (RefVertex *ref_vertex_ptr_2, double tolerance_factor=1.0, CubitBoolean notify_ref_entity=CUBIT_FALSE)

Static Public Member Functions

static const char * get_class_name ()

Protected Member Functions

 RefVertex (TBPoint *pointPtr)

Private Member Functions

void initialize ()
 RefVertex (const RefVertex &)
void operator= (const RefVertex &)

Friends

class RefEntityFactory

Detailed Description

Definition at line 10 of file RefVertex.hpp.


Member Typedef Documentation

Definition at line 14 of file RefVertex.hpp.


Constructor & Destructor Documentation

RefVertex::~RefVertex ( ) [virtual]

Definition at line 74 of file RefVertex.cpp.

{
}
RefVertex::RefVertex ( TBPoint pointPtr) [protected]

Definition at line 47 of file RefVertex.cpp.

{
   // Set the GeometryEntity pointer
   if (pointPtr != NULL)
   {
      set_geometry_entity_ptr(pointPtr) ;
   }
   else
   {
      PRINT_ERROR("In the RefVertex(TBPoint*) constructor\n");
      PRINT_ERROR("       Input TBPoint pointer is NULL\n");
      assert(CUBIT_FALSE);
   }
   
   // Initialize the member data
   initialize();
}
RefVertex::RefVertex ( const RefVertex ) [private]

Member Function Documentation

CubitBoolean RefVertex::about_spatially_equal ( RefVertex ref_vertex_ptr_2,
double  tolerance_factor = 1.0,
CubitBoolean  notify_ref_entity = CUBIT_FALSE 
)

Definition at line 214 of file RefVertex.cpp.

{
   if( this == ref_vertex_ptr_2 )
   {
      if (notify_ref_entity)
        remove_compare_data();
      return CUBIT_TRUE;
   }
 
   const CubitVector vertex_1_position = this->coordinates();
   const CubitVector vertex_2_position = ref_vertex_ptr_2->coordinates();
   if (!GeometryQueryTool::instance()-> about_spatially_equal(
     vertex_1_position, vertex_2_position, tolerance_factor))
     return CUBIT_FALSE;
     
   if ( notify_ref_entity == CUBIT_TRUE )
     this->comparison_found(ref_vertex_ptr_2);

   return CUBIT_TRUE;
}  

Return the approximate (spatial) center of this RefEntity.

Reimplemented from RefEntity.

Definition at line 135 of file RefVertex.cpp.

{
   return this->coordinates();
}
virtual const char* RefVertex::class_name ( ) const [inline, virtual]

Reimplemented from BasicTopologyEntity.

Definition at line 27 of file RefVertex.hpp.

     {
       return get_class_name();
     }
RefEdge * RefVertex::common_ref_edge ( RefVertex other_vertex,
RefFace owning_face = NULL 
)

Definition at line 169 of file RefVertex.cpp.

{
    //- returns an edge sharing the other vertex and owned by owning_face
    //- (if non-NULL)
    //- The edge must have this vertex and other_vertex as its
    //- start and end vertices.
  DLIList<RefEntity*> temp_list;
  join(other_vertex, temp_list);

  int i;
  for (i = temp_list.size(); i > 0; i--) {
    RefEdge *common_edge = CAST_TO(temp_list.get(), RefEdge);

    if( NULL == common_edge )
      continue;

      //This extra 'if' block is needed in case other_vertex == this
    if ( ( common_edge->start_vertex() == other_vertex &&
           common_edge->end_vertex() == this) ||
         ( common_edge->start_vertex() == this &&
           common_edge->end_vertex() == other_vertex ) )
    {
      if (common_edge && (!owning_face || common_edge->is_child(owning_face)))
        return common_edge;
      else
        temp_list.step();
    }
    else
      temp_list.step();
  }
  
  return NULL;
}
void RefVertex::common_ref_edges ( RefVertex other_vertex,
DLIList< RefEdge * > &  common_ref_edges,
RefFace owning_face = NULL 
)

Definition at line 139 of file RefVertex.cpp.

{
    //- returns an edge sharing the other vertex and owned by owning_face 
    //- (if non-NULL)
    //- The edge must have this vertex and other_vertex as its
    //- start and end vertices.
  DLIList<RefEntity*> temp_list;
  join(other_vertex, temp_list);

  int i;
  for (i = temp_list.size(); i > 0; i--)
  {
    RefEdge *common_edge = CAST_TO(temp_list.get(), RefEdge);
      //This extra 'if' block is needed in case other_vertex == this
    if (common_edge &&  
        ((common_edge->start_vertex() == other_vertex &&
           common_edge->end_vertex() == this) ||
         ( common_edge->start_vertex() == this &&
           common_edge->end_vertex() == other_vertex )))
    {
      if (common_edge && (!owning_face || common_edge->is_child(owning_face)))
        common_ref_edges.append(common_edge);
    }
    temp_list.step();
  }
  return;
}

Definition at line 107 of file RefVertex.cpp.

{
  const TBPoint* point_ptr = get_point_ptr();
  
  if (point_ptr != NULL)
  {
    return point_ptr->coordinates();
  }
  else
  {
    PRINT_ERROR("In RefVertex::coordinates\n"
                "       RefVertex %d has no GeometryEntity attached to it.\n"
                "       THIS IS A BUG - PLEASE REPORT IT.\n", id());
    assert( point_ptr != NULL );
    return CubitVector();
  }
}
DagType RefVertex::dag_type ( ) const [inline, virtual]

Returns the dag type of this enity.

Implements BasicTopologyEntity.

Definition at line 32 of file RefVertex.hpp.

virtual int RefVertex::dimension ( ) const [inline, virtual]

Returns the geometric dimension of the entity. vertex == 0, edge == 1, etc.

Reimplemented from RefEntity.

Definition at line 51 of file RefVertex.hpp.

      { return 0; }
const std::type_info& RefVertex::entity_type_info ( ) const [inline, virtual]

Returns the type info of this enity.

Implements RefEntity.

Definition at line 33 of file RefVertex.hpp.

{ return typeid(RefVertex); }
static const char* RefVertex::get_class_name ( ) [inline, static]

Reimplemented from BasicTopologyEntity.

Definition at line 22 of file RefVertex.hpp.

     {
       return "Vertex";
     }
void RefVertex::get_parent_ref_entities ( DLIList< RefEntity * > &  entity_list) [virtual]

Appends all RefEntities that own this (parent RefEntities) to entity_list. (The query goes up just one dimension. For example, if this is a vertex, the resulting list contains only RefEdges).

Implements RefEntity.

Definition at line 276 of file RefVertex.cpp.

{

  // First get the type of RefEntity that is a child of "this" one
  DagType parent_type = get_parent_ref_entity_type();;

  DLIList<TopologyEntity*> tempList ;

  CubitStatus result = ModelQueryEngine::instance()->
      query_model( *this, parent_type, tempList );
  if (result == CUBIT_FAILURE)
  {
    PRINT_ERROR("In RefEntity::get_parent_ref_entities\n");
    PRINT_ERROR("       Query failed for unknown reason.\n");
    return;
  }

  entity_list.clean_out();
  for(int i=0; i<tempList.size(); i++)
  {
    entity_list.append(static_cast<ParentType*>(tempList[i]));
  }
}

Definition at line 87 of file RefVertex.cpp.

const TBPoint * RefVertex::get_point_ptr ( ) const

Definition at line 92 of file RefVertex.cpp.

void RefVertex::initialize ( ) [private]

Definition at line 254 of file RefVertex.cpp.

{
   GeometryEntity* geom_ptr = get_geometry_entity_ptr();
   int saved_id = geom_ptr->get_saved_id();
   if ( !saved_id || RefEntityFactory::instance()->get_ref_vertex(saved_id) )
   {
     saved_id =  RefEntityFactory::instance()->next_ref_vertex_id();
     geom_ptr->set_saved_id(saved_id);
   }
   entityId = saved_id;

   // Initialize some attributes

     // read and initialize attributes
   auto_read_cubit_attrib();
   auto_actuate_cubit_attrib();
   
   // Assign a default entity name
   assign_default_name();

}
void RefVertex::operator= ( const RefVertex ) [private]

Friends And Related Function Documentation

friend class RefEntityFactory [friend]

Definition at line 16 of file RefVertex.hpp.


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