cgma
CubitAttribUser.hpp
Go to the documentation of this file.
00001 //- Class:       CubitAttribUser
00002 //- Owner:       Greg Nielson
00003 //- Description: Base class inherited by the RefEntity class that
00004 //-              gives attribute functionality to the RefEntitys.
00005 //- Checked By:
00006 //- Version: 
00007 
00008 #ifndef CUBIT_ATTRIB_USER_HPP
00009 #define CUBIT_ATTRIB_USER_HPP
00010 
00011 // #include "CubitString.hpp"
00012 
00013 class RefEntity;
00014 
00015 #include "CubitDefines.h"
00016 #include "CubitAttrib.hpp"
00017 #include "DLIList.hpp"
00018 #include "CubitSimpleAttrib.hpp"
00019 #include "CGMGeomConfigure.h"
00020 
00021 class TopologyBridge;
00022 
00023 //template <class X> class DLIList;
00024 //class CubitAttrib;
00025 //class CubitSimpleAttrib;
00026 //class CAEntityName;
00027 
00028 
00029 class CUBIT_GEOM_EXPORT CubitAttribUser
00030 {
00031 private:
00032 //  CubitStatus remove_attrib_geometry_entity (CubitSimpleAttrib*);
00033     CubitAttribUser( const CubitAttribUser& );
00034     void operator=( const CubitAttribUser&);
00035 
00036   
00037 protected:
00038   CubitAttrib* headAttrib;
00039 
00040 public:
00041 // bad function CubitAttribUser() {headAttrib = NULL;}
00042 
00043   virtual ~CubitAttribUser();
00044 
00045   CubitAttribUser(CubitAttrib* = NULL);
00046 
00047   CubitAttrib* get_cubit_attrib (int attrib_type,
00048                                  CubitBoolean create_if_missing = CUBIT_TRUE);
00049 
00050   CubitStatus add_cubit_attrib (CubitAttrib* cubit_attrib_ptr);
00051     //- appends this attrib to the list
00052 
00053 private:
00054 //________  Change Code by DZ of Cat,  3/11/99 12:19:10 PM  ________
00055   CubitStatus put_simple_attrib (const CubitSimpleAttrib& cubit_simple_attrib_ptr,
00056      CubitBoolean append_it = CUBIT_TRUE);
00057 //________  Change End by DZ of Cat,  3/11/99 12:19:10 PM  ________
00058 
00059 public:
00060   void append_simple_attribute(TopologyBridge* bridge, const CubitSimpleAttrib& attrib_ptr);
00061   void append_attrib_internal( TopologyBridge* bridge, const CubitSimpleAttrib& attrib_ptr );
00062   void remove_all_simple_attribute(TopologyBridge* bridge);
00063   void remove_simple_attribute(TopologyBridge* bridge, const CubitSimpleAttrib& attrib_ptr);
00064 
00065   CubitStatus clear_simple_attribs();
00066     // Remove all CubitSimpleAttrib from TopologyBridges.
00067 
00068   CubitStatus clear_simple_attribs_set_to_actuate();
00069     // Remove all CubitSimpleAttrib from TopologyBridges if attrib type's actuate was set to true
00070   
00071 public:
00072   CubitStatus auto_read_cubit_attrib ();
00073     //moves all attributes from the SME to CUBIT
00074 
00075   CubitStatus read_cubit_attrib (int attrib_type);
00076     //moves a specific cubit attribute type from the SME to CUBIT
00077   
00078   //CubitStatus read_cubit_attrib(CubitBoolean read_children = CUBIT_FALSE);
00079     // reads all attribs from SME to CUBIT, and optionally for children
00080   
00081   CubitStatus write_specific_cubit_attrib (CubitAttrib* cubit_attrib_ptr);
00082     //moves a specific cubit attribute from CUBIT to the SME
00083   
00084   CubitStatus write_cubit_attrib_by_type (int attrib_type);
00085     //moves a specific cubit attribute type from CUBIT to the SME
00086 
00087   CubitStatus write_cubit_attrib_list (DLIList<CubitAttrib*> attrib_list);
00088     //moves a list of cubit attributes from CUBIT to the SME
00089 
00090   CubitStatus write_cubit_attribs ();
00091     //moves all cubit attributes from CUBIT to the SME
00092 
00093 public:
00094   void split_owner(DLIList<CubitSimpleAttrib> &csa_list);
00095     //- if owner is to be split, get simple attribs for new entity
00096 
00097   void merge_owner(RefEntity *deletable_entity);
00098     //- if owner is to be merged, combine attribs from deletable_entity with this
00099 
00100   void transf_owner(const CubitVector &matrow1,
00101                     const CubitVector &matrow2,
00102                     const CubitVector &matrow3,
00103                     const CubitVector &translate_vec,
00104                     const double scale_factor);
00105     //- called if owner is to be transformed
00106 
00107 private:
00108   void auto_create_for_merge(RefEntity *deletable_entity);
00109     //- create any attribs on deletable_entity and not on this
00110 
00111 public:
00112   //static CubitBoolean cubit_simple_attrib_equivalent(CubitSimpleAttrib*,
00113   //                                                   CubitSimpleAttrib*);
00114 
00115   //int cubit_attrib_equivalent(CubitAttrib*,CubitAttrib*);
00116 
00117   //CubitStatus make_simple_attrib (CubitSimpleAttrib**,
00118   //                                CubitAttrib*);
00119 
00120   CubitStatus actuate_cubit_attrib (int attrib_type);
00121 
00122 private:
00123   CubitStatus actuate_cubit_attrib (DLIList<CubitAttrib*>);
00124   CubitStatus actuate_cubit_attrib (CubitAttrib*);
00125 
00126 public:
00127   static CubitStatus actuate_cubit_attrib (DLIList<RefEntity*>,int);
00128     //- actuate attributes of the specified type on entities in the list
00129 
00130   //CubitStatus actuate_cubit_attrib ();
00131 
00132   CubitStatus auto_actuate_cubit_attrib (CubitBoolean from_constructor = CUBIT_TRUE,
00133                                          CubitBoolean after_geom_changes = CUBIT_FALSE);
00134 
00135   //CubitStatus update_cubit_attrib ();
00136 
00137   //CubitStatus update_cubit_attrib (CubitAttrib*);
00138 
00139   CubitStatus update_cubit_attrib (int);
00140 
00141   //CubitStatus update_cubit_attrib (DLIList<CubitAttrib*>);
00142 
00143   CubitStatus auto_update_cubit_attrib ();
00144     //- for this cau, automatically create and update ca's
00145 
00146 public:
00147   static CubitStatus auto_update_cubit_attrib (DLIList<RefEntity*> &entity_list,
00148                                                CubitBoolean write_too = CUBIT_TRUE);
00149     //- for entity_list, auto create, update and write ca's
00150 
00151   static CubitStatus clear_all_simple_attrib( DLIList<RefEntity*>& entity_list );
00152     //- remove all CubitSimpleAttrib from TopologyBridges.
00153 
00154   static CubitStatus clear_all_simple_attrib_set_to_actuate( DLIList<RefEntity*>& entity_list );
00155     //- remove all CubitSimpleAttrib from TopologyBridges that have actuate flag set to true.
00156 
00157 private:
00158   static void auto_reset_cubit_attrib(DLIList<RefEntity*> ref_ents);
00159     //- set the update flag on all attribs on these entities and their children to false
00160 
00161 public:
00162   //void auto_reset_cubit_attrib();
00163     //- set the update flag on all my attribs to false
00164 
00165   void find_cubit_attrib_type (int, DLIList<CubitAttrib*>&) const;
00166   
00167 private:
00168   CubitStatus remove_cubit_attrib (DLIList<CubitAttrib*>);
00169 
00170 public:
00171   CubitStatus remove_cubit_attrib (int attrib_type);
00172 
00173   CubitStatus remove_cubit_attrib (CubitAttrib*);
00174 
00175   //CubitStatus remove_cubit_attrib ();
00176 
00177   CubitStatus remove_attrib_geometry_entity (CubitAttrib*);
00178 
00179   //CubitStatus remove_attrib_geometry_entity ();
00180 
00181   void get_cubit_attrib_list (DLIList<CubitAttrib*>&);
00182 
00183   int num_cubit_attrib();
00184     // returns number of cubit attributes
00185 
00186   void set_updated_flag(CubitBoolean flag);
00187   void set_written_flag(CubitBoolean flag);
00188 
00189   //void print_attribs();
00190     //- finds and prints all CA's on this entity
00191 };
00192 
00193 #endif
00194                      
00195   
00196 
00197   
00198   
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines