cgma
TopologyEntity.hpp
Go to the documentation of this file.
00001 //-------------------------------------------------------------------------
00002 // Filename      : TopologyEntity.hpp
00003 //
00004 // Purpose       : This file contains the declarations of the class 
00005 //                 TopologyEntity.
00006 //                 This class is the base class of all the topological 
00007 //                 entities in the Virtual Geometry Interface subsystem.
00008 //
00009 // Special Notes : This is a pure virtual class.
00010 //
00011 // Creator       : Malcolm Panthaki 
00012 //
00013 // Creation Date : 07/11/96
00014 //
00015 // Owner         : Malcolm J. Panthaki
00016 //-------------------------------------------------------------------------
00017 
00018 #ifndef TOPOLOGY_ENTITY_HPP
00019 #define TOPOLOGY_ENTITY_HPP
00020 
00021 // ********** BEGIN STANDARD INCLUDES      **********
00022 // ********** END STANDARD INCLUDES        **********
00023 
00024 // ********** BEGIN CUBIT INCLUDES         **********
00025 #include "BridgeManager.hpp"
00026 #include "DagType.hpp"
00027 // ********** END CUBIT INCLUDES           **********
00028 
00029 // ********** BEGIN FORWARD DECLARATIONS   **********
00030 class RefEntity ;
00031 template <class X> class DLIList ;
00032 class RefVolume ;
00033 class RefFace ;
00034 class RefEdge ;
00035 class RefVertex ;
00036 class Shell;
00037 class Loop;
00038 class Chain;
00039 class CoVolume;
00040 class CoFace;
00041 class CoEdge;
00042 class CoVertex;
00043 class GeometryQueryEngine ;
00044 class RefVertex;
00045 class RefEdge;
00046 class RefFace;
00047 class RefVolume;
00048 class Body;
00049 class RefGroup;
00050 
00051 // ********** END FORWARD DECLARATIONS     **********
00052 
00053 // ********** BEGIN MACROS DEFINITIONS     **********
00054 // ********** END MACROS DEFINITIONS       **********
00055 
00056 class CUBIT_GEOM_EXPORT TopologyEntity
00057 {
00058 public :
00059   
00060   TopologyEntity() ;
00061     //- The default constructor
00062   
00063   virtual ~TopologyEntity();
00064     //- A pure virtual destructor - this ensures that the class is
00065     //- non-instantiable.
00066 
00067   static const char* get_class_name()
00068      { return "TopologyEntity"; }
00069   
00070   virtual const char* class_name() const
00071      { return get_class_name(); }
00072   
00073   GeometryQueryEngine* get_geometry_query_engine() const;
00074     //R GeometryQueryEngine*
00075     //R- A pointer to the geometry query engine associated with
00076     //R- the object.
00077     //- This function returns a pointer to the geometry query engine
00078     //- associated with the object.  If this TE has been merged, the
00079     //- merged TEs may have different GQEs.  In that case, the GQE used
00080     //- for evaluations is returned.
00081   
00082   CubitBoolean is_directly_related( TopologyEntity* entity );
00083     //- Return TRUE if entity is this or a direct parent or child of this.
00084   
00085   CubitStatus bodies(DLIList<Body*>& body_list);
00086   CubitStatus shells(DLIList<Shell*>& shell_list);
00087   CubitStatus loops( DLIList<Loop*>& loop_list );
00088   CubitStatus chains(DLIList<Chain*>& chain_list);
00089   CubitStatus ref_volumes(DLIList<RefVolume*>& ref_volume_list);
00090   CubitStatus ref_faces(DLIList<RefFace*>& ref_face_list);
00091   CubitStatus ref_edges(DLIList<RefEdge*>& ref_edge_list);
00092   CubitStatus ref_vertices(DLIList<RefVertex*>& ref_vertex_list);
00093   CubitStatus co_volumes(DLIList<CoVolume*>& co_volume_list);
00094   CubitStatus co_faces(DLIList<CoFace*>& co_face_list);
00095   CubitStatus co_edges(DLIList<CoEdge*>& co_edge_list);
00096   CubitStatus co_vertices(DLIList<CoVertex*>& co_vertex_list);
00097 
00098   RefVertex *ref_vertex();
00099   RefEdge *ref_edge();
00100   RefFace *ref_face();
00101   RefVolume *ref_volume();
00102   Body *body();
00103     //R CubitStatus
00104     //R- CUBIT_SUCCESS/FAILURE
00105     //O body/ref_volume/ref_face/ref_edge/ref_vertex/shell/loop/chain/covolume/
00106     //O coface/coedge/covertex _list
00107     //O- List of Bodies/RefVolumes/RefFaces/RefEdges/RefVertex'es/Loops/
00108     //O- Shells/Chains/CoVolumes/CoFaces/CoEdge/CoVertices
00109     //- Append the appropriate list of TopologyEntities associated with
00110     //- this TopologyEntity.  
00111     //- There are 2 types of queries involved:
00112     //- a) Return all "owned" entities such as all the RefFaces owned by
00113     //-    a RefVolume.
00114     //- b) Return all "owning" entities such as all the Refvolumes that
00115     //-    own this RefFace
00116     //- CUBIT_FAILURE is returned if this entity has the same type as
00117     //- the requested list - e.g., if ref_edges is called on a RefEdge
00118     //- object. 
00119     //-
00120 
00121   CoEdge *co_edge();
00122   int num_loops();
00123   int num_ref_volumes();
00124   int num_ref_faces();
00125   int num_ref_edges();
00126   int num_ref_vertices();
00127 
00128   const BridgeManager* bridge_manager() const
00129     { return &bridgeMan; }
00130   BridgeManager* bridge_manager()
00131     { return &bridgeMan; }
00132 /*  
00133   virtual EntityType get_topology_bridge_type() const
00134     { return TopologyBridge_TYPE; }
00135     // Returns the generic TB type associated with this TE.
00136 */  
00137   virtual void reverse_topology() {}
00138     // This method is used by owned BridgeManagers to
00139     // notify their owning TopologyEntity when the sense
00140     // of the geometry has changed (due to a different
00141     // TopologyBridge being used as the primary rep.)
00142 
00143   virtual int get_children( DLIList<TopologyEntity*>* list = 0 ) const = 0;
00144   virtual int get_parents ( DLIList<TopologyEntity*>* list = 0 ) const = 0;
00145      //- Returns number of parents/children.
00146      //- If a list is passed, pointers to parents/children will
00147      //- be appended to the passed list.
00148 
00149   virtual DagType dag_type() const = 0;
00150 
00151   void deactivated(CubitBoolean flag) ;
00152   CubitBoolean deactivated() const ;
00153      //- Get and set funtions for the deactivation flag.
00154 
00155   CubitStatus remove_from_DAG(CubitBoolean recursive_flag = CUBIT_FALSE);
00156   void disconnect_from_DAG();
00157   virtual CubitStatus remove_child_link( TopologyEntity* child_ptr ) = 0;
00158 
00159   virtual CubitStatus
00160    disconnect_all_children( DLIList<TopologyEntity*>* children = 0 ) = 0;
00161   virtual CubitStatus
00162    disconnect_all_parents( DLIList<TopologyEntity*>* parents = 0 ) = 0;
00163 
00164 protected:
00165 
00166   CubitStatus set_topology_bridge(TopologyBridge* TB_ptr);
00167     // Sets the TB for this TE to be TB_ptr ONLY (removes other TBs).
00168 
00169   friend class ModelQueryEngine ;
00170   //friend class GroupingEntity;
00171 
00172   virtual CubitBoolean query_append_parents( DLIList<TopologyEntity*>& list ) = 0;
00173   virtual CubitBoolean query_append_children(DLIList<TopologyEntity*>& list ) = 0;
00174 
00175   cBit deactivatedStatus_ : 1;
00176     //- The deactivated flag
00177 
00178   cBit encountered_ : 1;
00179    // Indicates if it has already been found in
00180    // in a DAG query.
00181 
00182   
00183 private:
00184   BridgeManager bridgeMan;
00185   
00186   TopologyEntity( const TopologyEntity& );
00187   void operator=( const TopologyEntity& );
00188 };
00189 
00190 // ********** BEGIN INLINE FUNCTIONS       **********
00191 // ********** END INLINE FUNCTIONS         **********
00192  
00193 // ********** BEGIN FRIEND FUNCTIONS       **********
00194 // ********** END FRIEND FUNCTIONS         **********
00195  
00196 // ********** BEGIN EXTERN FUNCTIONS       **********
00197 // ********** END EXTERN FUNCTIONS         **********
00198  
00199 // ********** BEGIN HELPER CLASSES         **********
00200 // ********** END   HELPER CLASSES         **********
00201 
00202 #endif
00203 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines