cgma
CAEntitySense Class Reference

#include <CAEntitySense.hpp>

Inheritance diagram for CAEntitySense:
CubitAttrib

List of all members.

Public Member Functions

 CAEntitySense (RefEntity *=NULL)
 CAEntitySense (RefEntity *, const CubitSimpleAttrib &)
void initialize ()
virtual ~CAEntitySense ()
virtual const type_info & entity_type_info () const
CubitStatus actuate ()
CubitStatus update ()
CubitStatus reset ()
CubitSimpleAttrib cubit_simple_attrib ()
int int_attrib_type ()
void print ()

Private Attributes

CubitSense entitySense

Detailed Description

Definition at line 21 of file CAEntitySense.hpp.


Constructor & Destructor Documentation

CAEntitySense::CAEntitySense ( RefEntity new_attrib_owner = NULL)

Definition at line 42 of file CAEntitySense.cpp.

       : CubitAttrib(new_attrib_owner)
{
 entitySense = CUBIT_FORWARD;
}
CAEntitySense::CAEntitySense ( RefEntity new_attrib_owner,
const CubitSimpleAttrib csa_ptr 
)

Definition at line 22 of file CAEntitySense.cpp.

        : CubitAttrib(new_attrib_owner)
{
  std::vector<int, std::allocator<int> > i_list = csa_ptr.int_data_list();

  if( i_list.size() > 0)
  {
    int i =  i_list[0];
    if( i == -1 )
      entitySense = CUBIT_UNKNOWN;
    else if( i == 0 )
      entitySense = CUBIT_FORWARD;
    else if( i == 1 )
      entitySense = CUBIT_REVERSED;
  }
  else
    entitySense = CUBIT_UNKNOWN;
}

Definition at line 48 of file CAEntitySense.cpp.

{
}

Member Function Documentation

Implements CubitAttrib.

Definition at line 53 of file CAEntitySense.cpp.

{
   if ( hasActuated)
      return CUBIT_SUCCESS;
   
   if ( !attribOwnerEntity )
      return CUBIT_FAILURE;
   
   deleteAttrib = CUBIT_FALSE;  

   int dimension = attribOwnerEntity->dimension();
   if( 1 == dimension || 2 == dimension )
   {
     BasicTopologyEntity* bte_ptr = CAST_TO(attribOwnerEntity, BasicTopologyEntity);
     CubitSense tmp_sense = CUBIT_UNKNOWN;
     if( bte_ptr )     
     {
       tmp_sense = bte_ptr->bridge_manager()->topology_bridge()->bridge_sense();
       if( tmp_sense != entitySense )
       {
         if( 1==dimension )
         {
           RefEdge *ref_edge = dynamic_cast<RefEdge*>( bte_ptr );
           ref_edge->reverse_tangent();
         }
         else if( 2 == dimension )
         {
           RefFace *ref_face = dynamic_cast<RefFace*>( bte_ptr );
           ref_face->reverse_normal();
         }
       }
     }
   }
   
   hasActuated = CUBIT_TRUE;
   return CUBIT_SUCCESS;
}

Implements CubitAttrib.

Definition at line 108 of file CAEntitySense.cpp.

{
  std::vector<CubitString> cs_list;
  std::vector<int, std::allocator<int> >  i_list;

  i_list.push_back( entitySense );
    
  cs_list.push_back(att_internal_name());

  CubitSimpleAttrib csattrib_ptr(&cs_list, NULL, &i_list);

  return csattrib_ptr;
}
virtual const type_info& CAEntitySense::entity_type_info ( ) const [inline, virtual]

Definition at line 40 of file CAEntitySense.hpp.

     { return typeid(CAEntitySense);}
int CAEntitySense::int_attrib_type ( ) [inline, virtual]

Implements CubitAttrib.

Definition at line 57 of file CAEntitySense.hpp.

{return CA_ENTITY_SENSE;}
void CAEntitySense::print ( ) [virtual]

Reimplemented from CubitAttrib.

Definition at line 122 of file CAEntitySense.cpp.

{
    // print info on this attribute
  
  PRINT_INFO("CAEntitySense: owner = %s %d:   color ",
             attribOwnerEntity->class_name(), attribOwnerEntity->id());
  if( entitySense == CUBIT_UNKNOWN )
     PRINT_INFO("                             CUBIT_UNKNOWN\n");
  else if( entitySense == CUBIT_FORWARD )
    PRINT_INFO("                             CUBIT_FORWARD\n");
  else if( entitySense == CUBIT_REVERSED )
    PRINT_INFO("                             CUBIT_REVERSED\n");  
}
CubitStatus CAEntitySense::reset ( ) [inline, virtual]

Implements CubitAttrib.

Definition at line 51 of file CAEntitySense.hpp.

{return CUBIT_SUCCESS;}

Implements CubitAttrib.

Definition at line 91 of file CAEntitySense.cpp.


Member Data Documentation

Definition at line 26 of file CAEntitySense.hpp.


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