cgma
OCCHistory.hpp
Go to the documentation of this file.
00001 
00002 
00003 #ifndef OCCHistory_hpp
00004 #define OCCHistory_hpp
00005 
00006 #include <map>
00007 #include <vector>
00008 #include <set>
00009 #include <list>
00010 #include "DLIList.hpp"
00011 #include "TopologyBridge.hpp"
00012 #include "CGMHistory.hpp"
00013 
00014 class RefEntity;
00015 class TopoDS_Shape;
00016 
00017 class OCCHistory
00018 {
00019   public:
00020     OCCHistory();
00021     ~OCCHistory();
00022 
00023     //Event is a record of a change that occurred during an operation
00024     struct OCCEvent
00025     {
00026       // the type of event this is
00027       CGMHistory::EventType eventType;
00028 
00029       // the entities this event applies to
00030       std::vector<int> entities;
00031 
00032       // extra data associated with event
00033       std::vector<int> other_entities;
00034     };
00035 
00036     struct CGMEvent
00037     {
00038       // the type of event this is
00039       CGMHistory::EventType eventType;
00040 
00041       // the entities this event applies to
00042       std::vector<RefEntity*> RefEnts;
00043 
00044       // extra data associated with event
00045       std::vector<TopologyBridge*> TopologyBridges;
00046     };
00047 
00048     // add an event to this history
00049     void add_event( const OCCEvent &event );
00050 
00051     // add a RefEntity, TopoDS_Shape pair
00052     void add_refentity_tracking_id_pair( RefEntity *ref_ent, int tracking_id ); 
00053     void add_to_tracking_ids_tb_map( std::set<int> &tracking_ids, TopologyBridge *tb ); 
00054 
00055     void collect_relevant_pairs( std::set<int> &seed_set,
00056            std::vector< std::pair< std::set<int>, TopologyBridge*> > &found_pairs );
00057 
00058     int generate_next_tracking_id();
00059 
00060     void print();
00061 
00062     void create_cgm_history_objects();
00063 
00064     void create_port_event( CGMHistory::EventType event_type, 
00065            std::vector< std::pair< std::set<int>, TopologyBridge*> > &found_pairs );
00066 
00067     void add_TopoDS_Shape( TopoDS_Shape *ent );
00068     void remove_attributes();
00069 
00070     bool highLevelCopying; 
00071 
00072   private:
00073     // the list of events
00074     std::vector<OCCEvent> eventList;
00075     std::vector< std::pair<RefEntity*, int> > refentity_tracking_id_map;
00076     std::list< std::pair< std::set<int>, TopologyBridge* > > tracking_ids_to_tb_map;
00077     std::vector<CGMEvent> cgmEventList;
00078     int trackingId;
00079     std::vector<TopoDS_Shape*> all_ents;
00080 };
00081 
00082 #endif
00083 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines