cgma
GeometryEvent.hpp
Go to the documentation of this file.
00001 //- Class: CubitMeshEvent
00002 //- Description: Class describing an mesh event such as mesh creation, deletion and modification.
00003 //-
00004 //- Owner:  
00005 
00006 #ifndef GeometryEvent_hpp
00007 #define GeometryEvent_hpp
00008 
00009 #include "CubitEvent.hpp"
00010 #include "CGMGeomConfigure.h"
00011 #include "CubitTransformMatrix.hpp"
00012 class RefEntity;
00013 class TopologyEntity;
00014 
00015 class CUBIT_GEOM_EXPORT GeometryEvent : public CubitEvent
00016 {
00017   public:
00018     enum Type
00019     {
00020        TOPOLOGY_ENTITY_CONSTRUCTED,
00021          /* A TopologyEntity was created */
00022        TOPOLOGY_ENTITY_MODIFIED,
00023          /* A TopologyEntity was changed */
00024        TOPOLOGY_ENTITY_DESTRUCTED,
00025          /* A TopologyEntity was deleted */
00026        DEVELOPER_COMMAND_FLAG_MODIFIED,
00027         /* The 'set developer command on/off' was issued */
00028        MESH_SETTING_MODIFIED,
00029          /* a mesh setting on a geometry entity was modified */
00030        GEOMETRY_TOPOLOGY_MODIFIED,
00031          /* Both geometry and topology was
00032           modified. e.g. partitioned.
00033          */
00034        TOPOLOGY_MODIFIED,
00035          /* The topology of a RefVolume or one of its sub-entities
00036           * was changed.  Used for virtual topology. */
00037        GEOMETRY_MODIFIED,
00038          /* The geometry of a RefEntity was altered. */
00039        NEW_ENTITY_UNMERGED,
00040          /*A surface, curve, or vertex was unmerged. */
00041        FREE_REF_ENTITY_GENERATED,
00042          /* A vertex that is not a part of a curve,
00043           * or a curve that is not a part of a surface,
00044           * was just generated */
00045        TOP_LEVEL_ENTITY_DESTRUCTED,
00046          /* A body or free entity and all it's children
00047           * are about to be destructed.
00048           * The pointer is still valid at this point for all
00049           * calls except geometry queries. 
00050           * The pointer can be cast to a higher level entity
00051           * if desired. */
00052 
00053        ENTITY_NAME_CHANGED,
00054          /* the name for an entity changed */
00055        
00056        ENTITY_GEOMETRY_COLOR_CHANGED,
00057        ENTITY_VISIBILITY_CHANGED,
00058         /* the visibility of an entity changed */
00059        
00060        ENTITIES_MERGED,
00061          /* two entities are merged together. See MergeEvent. */
00062        ID_SET,
00063          /* an entity had its id set (changed). See IdSetEvent. */
00064        GROUP_MODIFIED,
00065          // Group was modified.  Sent only once after all
00066          // modifications are complete.
00067        GEOMETRY_TRANSFORMED,
00068 
00069        VIRTUAL_STATUS_CHANGED
00070 
00071     };
00072 
00073     GeometryEvent(Type type, RefEntity* entity);
00074     ~GeometryEvent();
00075 
00076     RefEntity* get_entity() const;
00077     Type get_type() const;
00078 
00079   protected:
00080 
00081     Type mType;
00082     RefEntity* mRefEntity;
00083 };
00084 
00085 class CUBIT_GEOM_EXPORT TopologyEvent : public CubitEvent
00086 {
00087   public:
00088     enum Type
00089     {
00090        TOPOLOGY_ENTITY_CONSTRUCTED,
00091          /* A TopologyEntity was created */
00092        TOPOLOGY_ENTITY_MODIFIED,
00093          /* A TopologyEntity was changed */
00094        TOPOLOGY_ENTITY_DESTRUCTED
00095       /* A TopologyEntity was deleted */
00096     };
00097 
00098     TopologyEvent(Type type, TopologyEntity* entity);
00099     ~TopologyEvent();
00100 
00101     TopologyEntity* get_entity() const;
00102     Type get_type() const;
00103 
00104   private:
00105 
00106     Type mType;
00107     TopologyEntity* mRefEntity;
00108 };
00109 
00110 class CUBIT_GEOM_EXPORT GeometryIdSetEvent: public GeometryEvent
00111 {
00112 public:
00113   GeometryIdSetEvent(RefEntity* ent, int old_id, int new_id);
00114   ~GeometryIdSetEvent();
00115 
00116  int get_old_id() const { return oldId; }
00117  int get_new_id() const { return newId; }
00118 
00119 private:
00120   int oldId;
00121   int newId;
00122 };
00123 
00124 class CUBIT_GEOM_EXPORT UnMergeEvent : public GeometryEvent
00125 {
00126   public:
00127 
00128     UnMergeEvent( RefEntity *old_ptr, RefEntity *new_ptr );
00129     ~UnMergeEvent();
00130 
00131     RefEntity* const mOldEntity;
00132 
00133     RefEntity* const mNewEntity;
00134 };
00135 
00136 class CUBIT_GEOM_EXPORT TransformEvent: public GeometryEvent
00137 {
00138 public:
00139   TransformEvent( const CubitTransformMatrix &transformation, std::vector<RefEntity*> ents );
00140   ~TransformEvent();
00141 
00142  const CubitTransformMatrix get_transformation() const; 
00143  std::vector<RefEntity*> get_ref_ents() const;
00144 
00145 private:
00146   std::vector<RefEntity*> refEnts;
00147   const CubitTransformMatrix transformation;
00148 };
00149 
00150 class CUBIT_GEOM_EXPORT MergeEvent: public GeometryEvent
00151 {
00152 public:
00153   MergeEvent( RefEntity *lost_entity, RefEntity *kept_entity );
00154   ~MergeEvent();
00155 
00156  RefEntity *get_lost_entity() const;
00157  RefEntity *get_kept_entity() const;
00158 
00159 private:
00160   RefEntity *keptEntity;
00161 };
00162 
00163 
00164 class CUBIT_GEOM_EXPORT CompositeCombineEvent : public GeometryEvent
00165 {
00166   public:
00167     CompositeCombineEvent(GeometryEvent::Type event_type);
00168     CompositeCombineEvent(GeometryEvent::Type event_type,
00169                           RefEntity *keep_ptr,
00170                           RefEntity *delete_ptr );
00171     ~CompositeCombineEvent();
00172 
00173     RefEntity* const mKeptEntity;
00174     RefEntity* const mDeleteEntity;
00175 };
00176 
00177 
00178 
00179 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines