cgma
CAActuateSet.hpp
Go to the documentation of this file.
00001 //-------------------------------------------------------------------------
00002 // Filename      : CAActuateSet.hpp
00003 //
00004 // Purpose       : Maintain the list of entities for which attributes are
00005 //                 being actuated such that any entities destroyed 
00006 //                 during actuation (e.g. merging) get removed from the
00007 //                 list.
00008 //
00009 // Special Notes : 
00010 //
00011 // Creator       : Jason Kraftcheck
00012 //
00013 // Creation Date : 05/28/02
00014 //-------------------------------------------------------------------------
00015 
00016 #ifndef CA_ACTUATE_SET_HPP
00017 #define CA_ACTUATE_SET_HPP
00018 
00019 #include "DLIList.hpp"
00020 #include "CubitObserver.hpp"
00021 #include "DagType.hpp"
00022 #include "CGMGeomConfigure.h"
00023 
00024 class RefEntity;
00025 
00026 class CUBIT_GEOM_EXPORT CAActuateSet : public CubitObserver
00027 {
00028   public:
00029   
00030     CAActuateSet( DLIList<RefEntity*>& actuate_list );
00031       //- Constructor
00032       //- Passed list of entities such that attributes will
00033       //- be actuated for the passed entities and all child
00034       //- entities.
00035     
00036     ~CAActuateSet();
00037       //- Destructor
00038     
00039     void set_current_dimension( int dimension );
00040       //- Populate the "current list" with all entities
00041       //- of the specified dimension (4 = body, 3 = volume, etc.)
00042       //- "current list" is populated with all entities of
00043       //- the specified dimension from the actuate_list passed
00044       //- to the constuctor, and children of entities in the
00045       //- actuate_list with the passed dimension.
00046     
00047     inline RefEntity* remove_next();
00048       //- Pop one entity from the "current list".  Returns NULL
00049       //- when there are no more entities.
00050     
00051     virtual void notify_observer( const CubitEvent* observer_event);
00052       //- Update for destroyed entities.
00053       
00054   private:
00055   
00056     void append_to_current( DLIList<RefEntity*>& query_results );
00057       //- Append passed entities to currentList
00058       
00059     static DagType get_type_id( int dimension );
00060   
00061     DLIList<RefEntity*> typeList[5];
00062       //- Lists containing the entities passed to the constructor,
00063       //- grouped and indexed by dimension (body = 4).
00064     
00065     DLIList<RefEntity*> currentList;
00066       //- The list of entities of the same dimension D, including
00067       //- the entities from the typeList of dimension D and children
00068       //- of dimension D for all entities in the typeLists above 
00069       //- with dimension > D.
00070     
00071     int currentDimension;
00072       //- The dimension of entities in currentList.
00073 };
00074  
00075 //-------------------------------------------------------------------------
00076 // Purpose       : Pop one entity from the current list.
00077 //
00078 // Special Notes : 
00079 //
00080 // Creator       : Jason Kraftcheck
00081 //
00082 // Creation Date : 05/28/02
00083 //-------------------------------------------------------------------------
00084 inline RefEntity* CAActuateSet::remove_next()
00085 {
00086   return currentList.size() ? currentList.pop() : 0;
00087 }
00088 
00089 #endif
00090 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines