| 1 | //------------------------------------------------------------------------- |
|---|
| 2 | // Filename : CAActuateSet.hpp |
|---|
| 3 | // |
|---|
| 4 | // Purpose : Maintain the list of entities for which attributes are |
|---|
| 5 | // being actuated such that any entities destroyed |
|---|
| 6 | // during actuation (e.g. merging) get removed from the |
|---|
| 7 | // list. |
|---|
| 8 | // |
|---|
| 9 | // Special Notes : |
|---|
| 10 | // |
|---|
| 11 | // Creator : Jason Kraftcheck |
|---|
| 12 | // |
|---|
| 13 | // Creation Date : 05/28/02 |
|---|
| 14 | //------------------------------------------------------------------------- |
|---|
| 15 | |
|---|
| 16 | #ifndef CA_ACTUATE_SET_HPP |
|---|
| 17 | #define CA_ACTUATE_SET_HPP |
|---|
| 18 | |
|---|
| 19 | #include "DLIList.hpp" |
|---|
| 20 | #include "CubitObserver.hpp" |
|---|
| 21 | #include "DagType.hpp" |
|---|
| 22 | #include "CubitGeomConfigure.h" |
|---|
| 23 | |
|---|
| 24 | class RefEntity; |
|---|
| 25 | |
|---|
| 26 | class CUBIT_GEOM_EXPORT CAActuateSet : public CubitObserver |
|---|
| 27 | { |
|---|
| 28 | public: |
|---|
| 29 | |
|---|
| 30 | CAActuateSet( DLIList<RefEntity*>& actuate_list ); |
|---|
| 31 | //- Constructor |
|---|
| 32 | //- Passed list of entities such that attributes will |
|---|
| 33 | //- be actuated for the passed entities and all child |
|---|
| 34 | //- entities. |
|---|
| 35 | |
|---|
| 36 | ~CAActuateSet(); |
|---|
| 37 | //- Destructor |
|---|
| 38 | |
|---|
| 39 | void set_current_dimension( int dimension ); |
|---|
| 40 | //- Populate the "current list" with all entities |
|---|
| 41 | //- of the specified dimension (4 = body, 3 = volume, etc.) |
|---|
| 42 | //- "current list" is populated with all entities of |
|---|
| 43 | //- the specified dimension from the actuate_list passed |
|---|
| 44 | //- to the constuctor, and children of entities in the |
|---|
| 45 | //- actuate_list with the passed dimension. |
|---|
| 46 | |
|---|
| 47 | inline RefEntity* remove_next(); |
|---|
| 48 | //- Pop one entity from the "current list". Returns NULL |
|---|
| 49 | //- when there are no more entities. |
|---|
| 50 | |
|---|
| 51 | virtual CubitStatus notify_observer( CubitObservable* observable, |
|---|
| 52 | const CubitEvent& observer_event, |
|---|
| 53 | CubitBoolean from_observable ); |
|---|
| 54 | //- Update for destroyed entities. |
|---|
| 55 | |
|---|
| 56 | private: |
|---|
| 57 | |
|---|
| 58 | void append_to_current( DLIList<RefEntity*>& query_results ); |
|---|
| 59 | //- Append passed entities to currentList |
|---|
| 60 | |
|---|
| 61 | static DagType get_type_id( int dimension ); |
|---|
| 62 | |
|---|
| 63 | DLIList<RefEntity*> typeList[5]; |
|---|
| 64 | //- Lists containing the entities passed to the constructor, |
|---|
| 65 | //- grouped and indexed by dimension (body = 4). |
|---|
| 66 | |
|---|
| 67 | DLIList<RefEntity*> currentList; |
|---|
| 68 | //- The list of entities of the same dimension D, including |
|---|
| 69 | //- the entities from the typeList of dimension D and children |
|---|
| 70 | //- of dimension D for all entities in the typeLists above |
|---|
| 71 | //- with dimension > D. |
|---|
| 72 | |
|---|
| 73 | int currentDimension; |
|---|
| 74 | //- The dimension of entities in currentList. |
|---|
| 75 | }; |
|---|
| 76 | |
|---|
| 77 | //------------------------------------------------------------------------- |
|---|
| 78 | // Purpose : Pop one entity from the current list. |
|---|
| 79 | // |
|---|
| 80 | // Special Notes : |
|---|
| 81 | // |
|---|
| 82 | // Creator : Jason Kraftcheck |
|---|
| 83 | // |
|---|
| 84 | // Creation Date : 05/28/02 |
|---|
| 85 | //------------------------------------------------------------------------- |
|---|
| 86 | inline RefEntity* CAActuateSet::remove_next() |
|---|
| 87 | { |
|---|
| 88 | return currentList.size() ? currentList.pop() : 0; |
|---|
| 89 | } |
|---|
| 90 | |
|---|
| 91 | #endif |
|---|