cgma
|
#include <CAEntityTol.hpp>
Public Member Functions | |
virtual | ~CAEntityTol () |
CAEntityTol (RefEntity *) | |
CAEntityTol (RefEntity *, const CubitSimpleAttrib &) | |
virtual const type_info & | entity_type_info () const |
CubitStatus | actuate () |
CubitStatus | update () |
CubitStatus | reset () |
void | merge_owner (CubitAttrib *deletable_attrib) |
CubitSimpleAttrib | split_owner () |
CubitSimpleAttrib | cubit_simple_attrib () |
int | int_attrib_type () |
double | tolerance () |
void | print () |
Private Attributes | |
double | entityTol |
Definition at line 21 of file CAEntityTol.hpp.
CAEntityTol::~CAEntityTol | ( | ) | [virtual] |
Definition at line 58 of file CAEntityTol.cpp.
{ }
CAEntityTol::CAEntityTol | ( | RefEntity * | new_attrib_owner | ) |
Definition at line 48 of file CAEntityTol.cpp.
: CubitAttrib(new_attrib_owner) { entityTol = 0.0; PRINT_DEBUG_95( "Creating ENTITY_TOL attribute for %s %d\n", (attribOwnerEntity ? attribOwnerEntity->class_name() : "(none)"), (attribOwnerEntity ? attribOwnerEntity->id() : 0)); }
CAEntityTol::CAEntityTol | ( | RefEntity * | new_attrib_owner, |
const CubitSimpleAttrib & | csa_ptr | ||
) |
Definition at line 30 of file CAEntityTol.cpp.
: CubitAttrib(new_attrib_owner) { entityTol = 0.0; if(!csa_ptr.isEmpty()) { PRINT_DEBUG_95( "Creating ENTITY_TOL attribute from CSA for %s %d\n", (attribOwnerEntity ? attribOwnerEntity->class_name() : "(none)"), (attribOwnerEntity ? attribOwnerEntity->id() : 0)); const std::vector<double>& d_list = csa_ptr.double_data_list(); assert(d_list.size() == 1); entityTol = d_list[0]; } }
CubitStatus CAEntityTol::actuate | ( | ) | [virtual] |
Implements CubitAttrib.
Definition at line 68 of file CAEntityTol.cpp.
{ if ( hasActuated) return CUBIT_SUCCESS; if ( !attribOwnerEntity ) return CUBIT_FAILURE; deleteAttrib = CUBIT_FALSE; //- If actuating after import, change the tol. Else (auto actuated) tol is already changed... if( attribOwnerEntity->local_tolerance() == 0.0 ) { attribOwnerEntity->local_tolerance(entityTol); } hasActuated = CUBIT_TRUE; return CUBIT_SUCCESS; }
CubitSimpleAttrib CAEntityTol::cubit_simple_attrib | ( | ) | [virtual] |
Implements CubitAttrib.
Definition at line 136 of file CAEntityTol.cpp.
{ std::vector<CubitString> cs_list; std::vector<double> d_list; std::vector<int, std::allocator<int> > i_list; d_list.push_back ( entityTol ); cs_list.push_back(att_internal_name()); CubitSimpleAttrib csattrib_ptr(&cs_list, &d_list, &i_list); return csattrib_ptr; }
virtual const type_info& CAEntityTol::entity_type_info | ( | ) | const [inline, virtual] |
Definition at line 38 of file CAEntityTol.hpp.
{ return typeid(CAEntityTol);}
int CAEntityTol::int_attrib_type | ( | ) | [inline, virtual] |
void CAEntityTol::merge_owner | ( | CubitAttrib * | deletable_attrib | ) | [virtual] |
Reimplemented from CubitAttrib.
Definition at line 127 of file CAEntityTol.cpp.
{ // take the id with the lowest value CAEntityTol *other_ca_tol = CAST_TO(deletable_attrib, CAEntityTol); if (other_ca_tol && ( entityTol == 0.0 || entityTol < other_ca_tol->tolerance() )) entityTol = other_ca_tol->tolerance(); }
void CAEntityTol::print | ( | ) | [virtual] |
Reimplemented from CubitAttrib.
Definition at line 151 of file CAEntityTol.cpp.
{ // print info on this attribute PRINT_INFO("CAEntityTol: owner = %s %d: tolerance =%f\n", attribOwnerEntity->class_name(), attribOwnerEntity->id(), entityTol); }
CubitStatus CAEntityTol::reset | ( | ) | [virtual] |
CubitSimpleAttrib CAEntityTol::split_owner | ( | ) | [virtual] |
Reimplemented from CubitAttrib.
Definition at line 161 of file CAEntityTol.cpp.
{ // if this entity is to be split, pass back a simple attribute with // duplicate tol data to be put on new entity PRINT_DEBUG_95("CAEntityName::split_owner()\n"); update(); return cubit_simple_attrib(); }
double CAEntityTol::tolerance | ( | ) | [inline] |
Definition at line 58 of file CAEntityTol.hpp.
{return entityTol;}
CubitStatus CAEntityTol::update | ( | ) | [virtual] |
Implements CubitAttrib.
Definition at line 88 of file CAEntityTol.cpp.
{ //delete_attrib(CUBIT_TRUE); //return CUBIT_SUCCESS; if (hasUpdated) return CUBIT_SUCCESS; PRINT_DEBUG_95( "Updating ENTITY_TOL attribute for %s %d\n", attribOwnerEntity->class_name(), attribOwnerEntity->id()); // set the updated flag hasUpdated = CUBIT_TRUE; // first, remove this attrib in its old form from the geometry entity if (hasWritten == CUBIT_TRUE) { attribOwnerEntity->remove_attrib_geometry_entity(this); hasWritten = CUBIT_FALSE; } double local_tol = attribOwnerEntity->local_tolerance(); if( local_tol == 0.0) { delete_attrib(CUBIT_TRUE); return CUBIT_SUCCESS; } else { // reset the delete flag if it was set before delete_attrib(CUBIT_FALSE); // now, write to geometry entity entityTol = local_tol; attribOwnerEntity->write_specific_cubit_attrib(this); } return CUBIT_SUCCESS; }
double CAEntityTol::entityTol [private] |
Definition at line 25 of file CAEntityTol.hpp.