cgma
|
00001 //- Class: CubitSimpleAttrib 00002 //- Owner: Greg Nielson 00003 //- Description: This class is used to carry information from 00004 //- the cubit attribute classes to the solid model 00005 //- attributes. 00006 //- Checked By: 00007 //- Version: $Id: 00008 00009 #ifndef CUBIT_SIMPLE_ATTRIB_HPP 00010 #define CUBIT_SIMPLE_ATTRIB_HPP 00011 00012 #if defined(_MSC_VER) 00013 #pragma warning(push) 00014 #pragma warning(disable : 4251) // hide warnings about template dll exports 00015 #endif 00016 00017 #include "CubitString.hpp" 00018 #include "CubitDefines.h" 00019 #include <vector> 00020 #include "CGMGeomConfigure.h" 00021 #include <new> 00022 00023 class CUBIT_GEOM_EXPORT CubitSimpleAttrib { 00024 private: 00025 00026 std::vector<CubitString> stringDataList; // List of CubitString attribute data 00027 00028 std::vector<double> doubleDataList; // List of double attribute data 00029 00030 std::vector<int> intDataList; // List of int attribute data 00031 00032 static CubitBoolean pushAttribs; 00033 //- if true, when saving attributes, push them to non-primary bridges 00034 //- on merged ref entities 00035 00036 public: 00037 00038 // returns whether this CSA is valid (it is invalid if the data is empty) 00039 bool isEmpty() const; 00040 00041 CubitSimpleAttrib(); 00042 //- default constructor 00043 00044 explicit CubitSimpleAttrib(const CubitString new_character_type, 00045 const CubitString new_string_data = CubitString(), 00046 const CubitString new_more_string_data = CubitString(), 00047 const int* new_integer_data = NULL, 00048 const double* new_double_data = NULL); 00049 //- constructor 00050 00051 explicit CubitSimpleAttrib(const std::vector<CubitString> *string_list, 00052 const std::vector<double> *double_list = NULL, 00053 const std::vector<int> *int_list = NULL); 00054 //- constructor 00055 00056 CubitSimpleAttrib(const CubitSimpleAttrib& csa_ptr); 00057 //- copy constructor, sort of 00058 00059 ~CubitSimpleAttrib(); 00060 //- destructor 00061 00062 CubitSimpleAttrib& operator=(const CubitSimpleAttrib &other); 00063 00064 CubitString character_type() const; 00065 //- returns the type of attribute from the first item in the string list 00066 00067 static void initialize_settings(); 00068 00069 const std::vector<CubitString>& string_data_list() const {return stringDataList;} 00070 std::vector<CubitString>& string_data_list() {return stringDataList;} 00071 00072 void string_data_list( const std::vector<CubitString>& new_list); 00073 00074 const std::vector<double>& double_data_list() const {return doubleDataList;} 00075 std::vector<double>& double_data_list() {return doubleDataList;} 00076 00077 void double_data_list(const std::vector<double>& new_list); 00078 00079 const std::vector<int>& int_data_list() const {return intDataList;} 00080 std::vector<int>& int_data_list() {return intDataList;} 00081 00082 void int_data_list(const std::vector<int>& new_list); 00083 00084 00085 bool operator==(const CubitSimpleAttrib& other) const; 00086 //- return true if the two csa's are equivalent 00087 00088 void print() const; 00089 //- print the contents of this simpleattrib 00090 00091 static CubitBoolean get_push_attribs() {return pushAttribs;}; 00092 static void set_push_attribs(CubitBoolean flag) {pushAttribs = flag;}; 00093 //- get/set pushAttribs 00094 00095 }; 00096 00097 00098 #if defined(_MSC_VER) 00099 #pragma warning(pop) 00100 #endif 00101 00102 #endif 00103 00104 00105 00106 00107 00108 00109 00110