cgma
|
#include <CAEntitySense.hpp>
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 |
Definition at line 21 of file CAEntitySense.hpp.
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; }
CAEntitySense::~CAEntitySense | ( | ) | [virtual] |
Definition at line 48 of file CAEntitySense.cpp.
{ }
CubitStatus CAEntitySense::actuate | ( | ) | [virtual] |
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; }
CubitSimpleAttrib CAEntitySense::cubit_simple_attrib | ( | ) | [virtual] |
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);}
void CAEntitySense::initialize | ( | ) |
int CAEntitySense::int_attrib_type | ( | ) | [inline, virtual] |
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] |
CubitStatus CAEntitySense::update | ( | ) | [virtual] |
Implements CubitAttrib.
Definition at line 91 of file CAEntitySense.cpp.
{ int dimension = attribOwnerEntity->dimension(); if( 1 == dimension || 2 == dimension ) { BasicTopologyEntity* bte_ptr = CAST_TO(attribOwnerEntity, BasicTopologyEntity); entitySense = CUBIT_UNKNOWN; if( bte_ptr ) entitySense = bte_ptr->bridge_manager()->topology_bridge()->bridge_sense(); } if( entitySense == CUBIT_FORWARD || entitySense == CUBIT_UNKNOWN ) delete_attrib(CUBIT_TRUE); return CUBIT_SUCCESS; }
CubitSense CAEntitySense::entitySense [private] |
Definition at line 26 of file CAEntitySense.hpp.