cgma
CAMergePartner.hpp
Go to the documentation of this file.
00001 //- Class:          CAMergePartner
00002 //- Owner:          Greg Nielson
00003 //- Description:    Cubit attribute for merge partners.
00004 //- Checked by:
00005 //- Version:
00006 
00007 #ifndef CA_MERGE_PARTNER_HPP
00008 #define CA_MERGE_PARTNER_HPP
00009 
00010 #include "CubitAttrib.hpp"
00011 #include "CubitString.hpp"
00012 #include "CubitDefines.h"
00013 #include "CADefines.hpp"
00014 
00015 class RefEntity;
00016 class RefEntity;
00017 template <class X> class DLIList;
00018 
00019 class CUBIT_GEOM_EXPORT CAMergePartner: public CubitAttrib
00020 {
00021 
00022 private:
00023   int mergeID;
00024     //- a unique id to verify proper merging
00025 
00026   int isSurvivor;
00027   CubitSense bridge_sense_;
00028 
00029 public:
00030   CAMergePartner(RefEntity*, const CubitSimpleAttrib&);
00031     //- construct a CAMP from a simple attribute
00032 
00033   void initialize();
00034     //- initialize the data for this CA
00035 
00036   virtual ~CAMergePartner();
00037 
00038   CubitStatus actuate();
00039   
00040   CubitStatus actuate_list(DLIList<RefEntity*>);
00041 
00042   CubitStatus update();
00043 
00044   CubitStatus reset();
00045     //- just reset the merge id
00046 
00047   CubitSimpleAttrib cubit_simple_attrib();
00048   
00049   CubitSimpleAttrib cubit_simple_attrib(CubitString);
00050   
00051   int merge_id(){return mergeID;}
00052 
00053   int int_attrib_type() {return CA_MERGE_PARTNER;}
00054     //- returns the enumerated attribute type
00055     
00056   CubitSense bridge_sense()
00057     { return bridge_sense_; }
00058   
00059   static void set_survivor( CubitSimpleAttrib& csa, int is_survivor );
00060   static CubitBoolean is_survivor( const CubitSimpleAttrib& csa );
00061 
00062   static void set_bridge_sense(CubitSimpleAttrib& csa, CubitSense sense);
00063   static CubitSense get_bridge_sense( const CubitSimpleAttrib& csa_ptr );
00064   
00065   static void set_saved_id( CubitSimpleAttrib& csa, int id );
00066   static int get_saved_id( const CubitSimpleAttrib& csa );
00067     // returns zero if not set.
00068   
00069   void merge_prepare(DLIList<RefEntity*> &merge_list);
00070     //- pass back a list of mergable entities with same unique id
00071 
00072   virtual void print();
00073     //- print the info in this attribute
00074 
00075 };
00076 
00077 inline CubitStatus CAMergePartner::reset() 
00078 {
00079   mergeID = -1;
00080   hasUpdated = CUBIT_FALSE;
00081   hasActuated = CUBIT_FALSE;
00082   hasWritten = CUBIT_FALSE;
00083   deleteAttrib = CUBIT_FALSE;
00084   bridge_sense_ = CUBIT_UNKNOWN;
00085   return CUBIT_SUCCESS;
00086 }
00087 
00088 CubitAttrib* CAMergePartner_creator(RefEntity* entity, const CubitSimpleAttrib &p_csa);
00089 
00090 #endif
00091 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines