cgma
|
#include <CGMApp.hpp>
Public Member Functions | |
~CGMApp () | |
void | startup (const std::vector< CubitString > &args) |
void | shutdown () |
CubitAttribManager * | attrib_manager () |
void | save_current_attribute_states () |
void | restore_previous_attribute_states () |
Static Public Member Functions | |
static CGMApp * | instance () |
static void | delete_instance () |
static void | initialize_settings () |
Private Member Functions | |
CGMApp () | |
void | register_attributes () |
Private Attributes | |
CubitBoolean | mAppStarted |
CubitAttribManager | mAttribManager |
CubitBoolean * | caUpdateFlgs |
CubitBoolean * | caActuateFlgs |
CubitBoolean * | caWriteFlgs |
CubitBoolean * | caReadFlgs |
Static Private Attributes | |
static CGMApp * | instance_ = NULL |
Definition at line 45 of file CGMApp.hpp.
CGMApp::~CGMApp | ( | ) |
Definition at line 81 of file CGMApp.cpp.
{ instance_ = NULL; }
CGMApp::CGMApp | ( | ) | [private] |
Definition at line 65 of file CGMApp.cpp.
{ mAppStarted = CUBIT_FALSE; // CGMApp depends on there being an AppUtil AppUtil::instance(); // initialize my settings initialize_settings(); caUpdateFlgs = NULL; caActuateFlgs = NULL; caWriteFlgs = NULL; caReadFlgs = NULL; }
Definition at line 241 of file CGMApp.cpp.
{ return &mAttribManager; }
static void CGMApp::delete_instance | ( | ) | [inline, static] |
Definition at line 51 of file CGMApp.hpp.
void CGMApp::initialize_settings | ( | ) | [static] |
Definition at line 115 of file CGMApp.cpp.
{ GeometryQueryTool::instance()->initialize_settings(); GeometryModifyTool::instance()->initialize_settings(); BoundingBoxTool::initialize_settings(); CubitSimpleAttrib::initialize_settings(); RefEntityName::initialize_settings(); SurfaceOverlapTool::initialize_settings(); MergeTool::initialize_settings(); OldUnmergeCode::initialize_settings(); }
CGMApp * CGMApp::instance | ( | ) | [static] |
Definition at line 51 of file CGMApp.cpp.
void CGMApp::register_attributes | ( | ) | [private] |
Definition at line 128 of file CGMApp.cpp.
{ CubitStatus result; result = mAttribManager.register_attrib_type(CA_MERGE_PARTNER, "merge", "MERGE_PARTNER", CAMergePartner_creator, CUBIT_FALSE, CUBIT_FALSE, CUBIT_TRUE, CUBIT_TRUE, CUBIT_FALSE, CUBIT_FALSE); if (CUBIT_SUCCESS != result) { PRINT_ERROR("Failed to register attribute type merge.\n"); return; } result = mAttribManager.register_attrib_type(CA_ENTITY_NAME, "name", "ENTITY_NAME", CAEntityName_creator, CUBIT_TRUE, CUBIT_TRUE, CUBIT_TRUE, CUBIT_TRUE, CUBIT_TRUE, CUBIT_FALSE); if (CUBIT_SUCCESS != result) { PRINT_ERROR("Failed to register attribute type name.\n"); return; } result = mAttribManager.register_attrib_type(CA_GROUP, "group", "GROUP", CAGroup_creator, CUBIT_FALSE, CUBIT_FALSE, CUBIT_TRUE, CUBIT_TRUE, CUBIT_FALSE, CUBIT_FALSE); if (CUBIT_SUCCESS != result) { PRINT_ERROR("Failed to register attribute type group.\n"); return; } result = mAttribManager.register_attrib_type(CA_ENTITY_ID, "id", "ENTITY_ID", CAEntityId_creator, CUBIT_FALSE, CUBIT_FALSE, CUBIT_TRUE, CUBIT_TRUE, CUBIT_TRUE, CUBIT_FALSE); if (CUBIT_SUCCESS != result) { PRINT_ERROR("Failed to register attribute type id.\n"); return; } result = mAttribManager.register_attrib_type(CA_ENTITY_TOL, "tolerance", "ENTITY_TOL", CAEntityTol_creator, CUBIT_FALSE, CUBIT_FALSE, CUBIT_TRUE, CUBIT_TRUE, CUBIT_FALSE, CUBIT_TRUE); if (CUBIT_SUCCESS != result) { PRINT_ERROR("Failed to register attribute type tolerance.\n"); return; } result = mAttribManager.register_attrib_type(CA_UNIQUE_ID, "unique id", "UNIQUE_ID", CAUniqueId_creator, CUBIT_FALSE, CUBIT_FALSE, CUBIT_TRUE, CUBIT_TRUE, CUBIT_TRUE, CUBIT_FALSE); if (CUBIT_SUCCESS != result) { PRINT_ERROR("Failed to register attribute type unique id.\n"); return; } result = mAttribManager.register_attrib_type(CA_DEFERRED_ATTRIB, "deferred attrib", "DEFERRED_ATTRIB", CADeferredAttrib_creator, CUBIT_FALSE, CUBIT_FALSE, CUBIT_TRUE, CUBIT_TRUE, CUBIT_FALSE, CUBIT_FALSE); if (CUBIT_SUCCESS != result) { PRINT_ERROR("Failed to register attribute type deferred attrib.\n"); return; } result = mAttribManager.register_attrib_type(CA_ENTITY_COLOR, "color", "ENTITY_COLOR", CAEntityColor_creator, CUBIT_FALSE, CUBIT_FALSE, CUBIT_TRUE, CUBIT_TRUE, CUBIT_FALSE, CUBIT_TRUE); if (CUBIT_SUCCESS != result) { PRINT_ERROR("Failed to register attribute type color.\n"); return; } result = mAttribManager.register_attrib_type(CA_MERGE_STATUS, "merge status", "MERGE_STATUS", CAMergeStatus_creator, CUBIT_FALSE, CUBIT_FALSE, CUBIT_TRUE, CUBIT_TRUE, CUBIT_FALSE, CUBIT_FALSE); if (CUBIT_SUCCESS != result) { PRINT_ERROR("Failed to register attribute type merge status.\n"); return; } result = mAttribManager.register_attrib_type(CA_SOURCE_FEATURE, "source feature", "SOURCE_FEATURE", CASourceFeature_creator, CUBIT_TRUE, CUBIT_TRUE, CUBIT_TRUE, CUBIT_TRUE, CUBIT_TRUE, CUBIT_FALSE); if (CUBIT_SUCCESS != result) { PRINT_ERROR("Failed to register attribute type source feature.\n"); return; } result = mAttribManager.register_attrib_type(CA_ENTITY_SENSE, "entity sense", "ENTITY_SENSE", CAEntitySense_creator, CUBIT_TRUE, CUBIT_TRUE, CUBIT_TRUE, CUBIT_TRUE, CUBIT_FALSE, CUBIT_FALSE); if (CUBIT_SUCCESS != result) { PRINT_ERROR("Failed to register attribute type entity sense.\n"); return; } #ifdef CAT result = mAttribManager.register_attrib_type(CA_PRO_WELD, "pro weld", "PRO_WELD", CAProWeld_creator, CUBIT_TRUE, CUBIT_TRUE, CUBIT_TRUE, CUBIT_TRUE, CUBIT_TRUE, CUBIT_FALSE); if (CUBIT_SUCCESS != result) { PRINT_ERROR("Failed to register attribute type pro weld.\n"); } #endif }
Definition at line 279 of file CGMApp.cpp.
{ DLIList<int> attrib_types; mAttribManager.get_registered_types(attrib_types); int num_att = attrib_types.size(); attrib_types.reset(); int i; for( i=0; i<num_att; i++ ) { int att_type = attrib_types.get(); mAttribManager.set_auto_update_flag( att_type, caUpdateFlgs[i] ); mAttribManager.set_auto_actuate_flag( att_type, caActuateFlgs[i] ); mAttribManager.set_auto_write_flag( att_type, caWriteFlgs[i] ); mAttribManager.set_auto_read_flag( att_type, caReadFlgs[i] ); attrib_types.step(); } delete [] caUpdateFlgs; delete [] caActuateFlgs; delete [] caWriteFlgs; delete [] caReadFlgs; caUpdateFlgs = NULL; caActuateFlgs = NULL; caWriteFlgs = NULL; caReadFlgs = NULL; }
Definition at line 247 of file CGMApp.cpp.
{ //all pointers must be NULL if( !!caUpdateFlgs && !!caActuateFlgs && !!caWriteFlgs && !!caReadFlgs ) { PRINT_ERROR("Problem setting attribute flags\n"); return; } DLIList<int> attrib_types; mAttribManager.get_registered_types(attrib_types); caUpdateFlgs = new CubitBoolean[attrib_types.size()]; caActuateFlgs = new CubitBoolean[attrib_types.size()]; caWriteFlgs = new CubitBoolean[attrib_types.size()]; caReadFlgs = new CubitBoolean[attrib_types.size()]; int num_att = attrib_types.size(); attrib_types.reset(); int i; for( i=0; i<num_att; i++ ) { int att_type = attrib_types.get(); caUpdateFlgs[i] = mAttribManager.auto_update_flag( att_type ); caActuateFlgs[i] = mAttribManager.auto_actuate_flag( att_type ); caWriteFlgs[i] = mAttribManager.auto_write_flag( att_type ); caReadFlgs[i] = mAttribManager.auto_read_flag( att_type ); attrib_types.step(); } }
void CGMApp::shutdown | ( | ) |
Definition at line 100 of file CGMApp.cpp.
{ GeometryHealerTool::delete_instance(); GeometryModifyTool::delete_instance(); GeometryQueryTool::delete_instance(); GeometryFeatureTool::delete_instance(); AnalyticGeometryTool::delete_instance(); RefEntityName::delete_instance(); MergeTool::delete_instance(); ModelQueryEngine::delete_instance(); DAG::delete_instance(); mAppStarted = CUBIT_FALSE; }
void CGMApp::startup | ( | const std::vector< CubitString > & | args | ) |
Definition at line 86 of file CGMApp.cpp.
{ if (mAppStarted) return; // make sure apputil has started AppUtil::instance()->startup(); // register attributes register_attributes(); mAppStarted = CUBIT_TRUE; }
CubitBoolean* CGMApp::caActuateFlgs [private] |
Definition at line 84 of file CGMApp.hpp.
CubitBoolean* CGMApp::caReadFlgs [private] |
Definition at line 86 of file CGMApp.hpp.
CubitBoolean* CGMApp::caUpdateFlgs [private] |
Definition at line 83 of file CGMApp.hpp.
CubitBoolean* CGMApp::caWriteFlgs [private] |
Definition at line 85 of file CGMApp.hpp.
CGMApp * CGMApp::instance_ = NULL [static, private] |
Definition at line 75 of file CGMApp.hpp.
CubitBoolean CGMApp::mAppStarted [private] |
Definition at line 76 of file CGMApp.hpp.
CubitAttribManager CGMApp::mAttribManager [private] |
Definition at line 77 of file CGMApp.hpp.