cgma
|
00001 //------------------------------------------------------------------------- 00002 // Filename : TopologyBridge.hpp 00003 // 00004 // Purpose : This file contains the declarations of the base class 00005 // TopologyBridge. Sub-classes of TopologyBridge 00006 // represent the link between the Cubit representation 00007 // of an entity (such as RefVertex) and the GME representation 00008 // of an entity (such as an acis VERTEX). 00009 // 00010 // Creator : Darryl Melander 00011 // 00012 // Creation Date : 01/10/99 00013 // 00014 // Owner : Darryl Melander 00015 //------------------------------------------------------------------------- 00016 00017 #ifndef MODEL_ENTITY_BRIDGE_HPP 00018 #define MODEL_ENTITY_BRIDGE_HPP 00019 00020 // ********** BEGIN CUBIT INCLUDES ********** 00021 #include "CubitDefines.h" 00022 #include "CGMGeomConfigure.h" 00023 // ********** END CUBIT INCLUDES ********** 00024 00025 // ********** BEGIN FORWARD DECLARATIONS ********** 00026 class TopologyEntity; 00027 class RefVolume; 00028 class GeometryQueryEngine; 00029 class CubitSimpleAttrib; 00030 class CubitSimpleAttrib; 00031 class CubitString; 00032 class BridgeManager; 00033 class TBOwner; 00034 template <class X> class DLIList; 00035 class Lump; 00036 class ShellSM; 00037 class Surface; 00038 class LoopSM; 00039 class Curve; 00040 class CoEdgeSM; 00041 class TBPoint; 00042 class TopologyBridge; 00043 class TopologyEntity; 00044 class BodySM; 00045 class Lump; 00046 class ShellSM; 00047 class Surface; 00048 class LoopSM; 00049 class Curve; 00050 class CoEdgeSM; 00051 00052 // ********** END FORWARD DECLARATIONS ********** 00053 00054 class CUBIT_GEOM_EXPORT TopologyBridge 00055 { 00056 public: 00057 TopologyBridge() 00058 : bridgeOwner(0), 00059 bridgeSense(CUBIT_FORWARD) 00060 {} 00061 00062 virtual ~TopologyBridge(); 00063 00064 virtual void append_simple_attribute_virt(const CubitSimpleAttrib&) = 0; 00065 //R void 00066 //I name 00067 //I- A reference to a constant CubitString object which is the name 00068 //I- that is to be appended to the TopologyBridge object. 00069 //- The purpose of this function is to append a string 00070 //- attribute to the TB. The name is attached to each 00071 //- of the underlying solid model entities. 00072 00073 virtual void remove_simple_attribute_virt(const CubitSimpleAttrib&) = 0; 00074 //R void 00075 //I CubitSimpleAttrib* 00076 //I- A reference to a CubitSimpleAttrib object which is the object 00077 //I- that is to be removed to this TB object. 00078 //- The purpose of this function is to remove a simple 00079 //- attribute from the TB. The attribute is attached to each of the 00080 //- underlying solid model entities this one points to. 00081 00082 virtual void remove_all_simple_attribute_virt() = 0; 00083 //R void 00084 //I- 00085 //- The purpose of this function is to remove all simple 00086 //- attributes from the TB. 00087 00088 virtual CubitStatus get_simple_attribute(DLIList<CubitSimpleAttrib>&) = 0; 00089 //R CubitSimpleAttrib* 00090 //R- the returned cubit simple attribute. 00091 //- The purpose of this function is to get the attributes 00092 //- of the geometry entity. The name is attached to the underlying solid 00093 //- model entity(ies) this one points to. 00094 //- The default implementation returns a NULL. 00095 //- MJP Note: 00096 //- This is the code that implements the requirement that names 00097 //- of VGI Entities propagate across solid model boolean 00098 //- operations. The success of this relies, of course, on the underlying 00099 //- solid modeler being able to propagate attributes across 00100 //- such operations on its entities. If it cannot, then "names" 00101 //- of VGI entities will not propagate. 00102 00103 virtual CubitStatus get_simple_attribute(const CubitString& name, 00104 DLIList<CubitSimpleAttrib>& ) = 0; 00105 00106 TopologyEntity* topology_entity() const; 00107 //R TopologyEntity* 00108 //R- Pointer to the TopologyEntity using this TopologyBridge. 00109 //- This (pure virtual) function returns a pointer to the 00110 //- TopologyEntity that is using this object, i.e. owner of this 00111 //- TopologyBridge. It is implied that a TopologyBridge is not 00112 //- used by more than one TopologyEntity. 00113 00114 TBOwner* owner() const 00115 { return bridgeOwner; } 00116 00117 void owner( TBOwner* new_owner ) 00118 { bridgeOwner = new_owner; } 00119 00120 BridgeManager* bridge_manager() const; 00121 void bridge_manager(BridgeManager* manager); 00122 00123 CubitSense bridge_sense() 00124 { return bridgeSense; } 00125 void reverse_bridge_sense() 00126 { bridgeSense = bridgeSense == CUBIT_UNKNOWN ? CUBIT_UNKNOWN : 00127 bridgeSense == CUBIT_FORWARD ? CUBIT_REVERSED : 00128 CUBIT_FORWARD; } 00129 //- Get or switch the bridge sense. 00130 //- 00131 //- The bridge sense is the sense of the TopologyBridge with 00132 //- respect to it's owning TopologyEntity. The results of 00133 //- geometric evaluation functions on the ownging TopologyEntity 00134 //- may be affected by this value. 00135 //- 00136 //- Currently, this is only set for Surfaces and Curves, as the 00137 //- sense of either may be opposite that of its owning RefFace 00138 //- or RefEdge when merging occurs. It is not set/used on Loops 00139 //- or CoEdges because a) there are no geometric evaluations on 00140 //- the underlying LoopSMs or CoEdgeSMs and b) the relative sense 00141 //- can be inferred from that of the corresponding Surface and 00142 //- Curve. 00143 //- 00144 //- This value is saved in the MergePartner attribute. 00145 00146 virtual GeometryQueryEngine* get_geometry_query_engine() const = 0; 00147 //- This function returns a pointer to the geometry query engine 00148 //- associated with the object. 00149 00150 virtual int validate(const CubitString&, 00151 DLIList <TopologyEntity*>&) 00152 { return 0; } 00153 //- Check that entity is valid. Returns number of problems detected. 00154 //- For sub-classes that don't implement this, just assume there are 00155 //- no problems and return 0. 00156 00157 00158 enum { MAX_TB_LAYER = 255 }; 00159 virtual int layer() const { return 0; } 00160 //- Bridge layer at which this bridge occurs. 00161 //- 0 - real geometry 00162 //- 126 - sub-composite partition layer 00163 //- 127 - composite layer 00164 //- 128 - super-composite partition layer 00165 00166 void get_parents(DLIList<TopologyBridge*> &parents); 00167 //- get parent topology bridges 00168 00169 void get_children(DLIList<TopologyBridge*> &children, 00170 bool return_hidden_entities = false, 00171 int layer = MAX_TB_LAYER ); 00172 //- get child topology bridges 00173 00174 void bodysms(DLIList<BodySM*> &bodies,bool unique = true); 00175 void lumps(DLIList<Lump*> &lumps,bool unique = true); 00176 void shellsms(DLIList<ShellSM*> &shellsms,bool unique = true); 00177 void surfaces(DLIList<Surface*> &surfaces,bool unique = true); 00178 void surfaces_ignore_virtual(DLIList<Surface*> &surfaces,bool unique = true); 00179 void loopsms(DLIList<LoopSM*> &loopsms,bool unique = true); 00180 void curves(DLIList<Curve*> &curves, bool unique = true); 00181 void curves_ignore_virtual(DLIList<Curve*> &curves, bool unique = true); 00182 void coedgesms(DLIList<CoEdgeSM*> &coedgesms,bool unique = true); 00183 void points(DLIList<TBPoint*> &points,bool unique = true); 00184 //- topology traversal of TB's; implemented based on native traversal 00185 //- functions in the modeler 00186 00187 BodySM *bodysm(); 00188 Lump *lump(); 00189 LoopSM *loopsm(); 00190 00191 virtual void get_parents_virt(DLIList<TopologyBridge*> &parents ) = 0; 00192 //- Get parent topology bridges as returned by solid modeler. 00193 //- Derived classes must provide this method for use in the 00194 //- implementation of get_parents(..). You probably want to 00195 //- be using get_parents(..) rather than this method. 00196 00197 virtual void get_children_virt(DLIList<TopologyBridge*> &children ) = 0; 00198 //- Get child topology bridges as returned by solid modeler. 00199 //- Derived classes must provide this method for use in the 00200 //- implementation of get_children(..). You probably want to 00201 //- be using get_children(..) rather than this method. 00202 00203 private: 00204 00205 00206 TBOwner* bridgeOwner; 00207 00208 CubitSense bridgeSense; 00209 //- (See comments for bridge_sense() method.) 00210 00211 }; 00212 00213 #endif 00214