Branch data Line data Source code
1 : : //-------------------------------------------------------------------------
2 : : // Filename : TopologyBridge.hpp
3 : : //
4 : : // Purpose : This file contains the declarations of the base class
5 : : // TopologyBridge. Sub-classes of TopologyBridge
6 : : // represent the link between the Cubit representation
7 : : // of an entity (such as RefVertex) and the GME representation
8 : : // of an entity (such as an acis VERTEX).
9 : : //
10 : : // Creator : Darryl Melander
11 : : //
12 : : // Creation Date : 01/10/99
13 : : //
14 : : // Owner : Darryl Melander
15 : : //-------------------------------------------------------------------------
16 : :
17 : : #ifndef MODEL_ENTITY_BRIDGE_HPP
18 : : #define MODEL_ENTITY_BRIDGE_HPP
19 : :
20 : : // ********** BEGIN CUBIT INCLUDES **********
21 : : #include "CubitDefines.h"
22 : : #include "CGMGeomConfigure.h"
23 : : // ********** END CUBIT INCLUDES **********
24 : :
25 : : // ********** BEGIN FORWARD DECLARATIONS **********
26 : : class TopologyEntity;
27 : : class RefVolume;
28 : : class GeometryQueryEngine;
29 : : class CubitSimpleAttrib;
30 : : class CubitSimpleAttrib;
31 : : class CubitString;
32 : : class BridgeManager;
33 : : class TBOwner;
34 : : template <class X> class DLIList;
35 : : class Lump;
36 : : class ShellSM;
37 : : class Surface;
38 : : class LoopSM;
39 : : class Curve;
40 : : class CoEdgeSM;
41 : : class TBPoint;
42 : : class TopologyBridge;
43 : : class TopologyEntity;
44 : : class BodySM;
45 : : class Lump;
46 : : class ShellSM;
47 : : class Surface;
48 : : class LoopSM;
49 : : class Curve;
50 : : class CoEdgeSM;
51 : :
52 : : // ********** END FORWARD DECLARATIONS **********
53 : :
54 : : class CUBIT_GEOM_EXPORT TopologyBridge
55 : : {
56 : : public:
57 : 177304 : TopologyBridge()
58 : : : bridgeOwner(0),
59 : 177304 : bridgeSense(CUBIT_FORWARD)
60 : 177304 : {}
61 : :
62 : : virtual ~TopologyBridge();
63 : :
64 : : virtual void append_simple_attribute_virt(const CubitSimpleAttrib&) = 0;
65 : : //R void
66 : : //I name
67 : : //I- A reference to a constant CubitString object which is the name
68 : : //I- that is to be appended to the TopologyBridge object.
69 : : //- The purpose of this function is to append a string
70 : : //- attribute to the TB. The name is attached to each
71 : : //- of the underlying solid model entities.
72 : :
73 : : virtual void remove_simple_attribute_virt(const CubitSimpleAttrib&) = 0;
74 : : //R void
75 : : //I CubitSimpleAttrib*
76 : : //I- A reference to a CubitSimpleAttrib object which is the object
77 : : //I- that is to be removed to this TB object.
78 : : //- The purpose of this function is to remove a simple
79 : : //- attribute from the TB. The attribute is attached to each of the
80 : : //- underlying solid model entities this one points to.
81 : :
82 : : virtual void remove_all_simple_attribute_virt() = 0;
83 : : //R void
84 : : //I-
85 : : //- The purpose of this function is to remove all simple
86 : : //- attributes from the TB.
87 : :
88 : : virtual CubitStatus get_simple_attribute(DLIList<CubitSimpleAttrib>&) = 0;
89 : : //R CubitSimpleAttrib*
90 : : //R- the returned cubit simple attribute.
91 : : //- The purpose of this function is to get the attributes
92 : : //- of the geometry entity. The name is attached to the underlying solid
93 : : //- model entity(ies) this one points to.
94 : : //- The default implementation returns a NULL.
95 : : //- MJP Note:
96 : : //- This is the code that implements the requirement that names
97 : : //- of VGI Entities propagate across solid model boolean
98 : : //- operations. The success of this relies, of course, on the underlying
99 : : //- solid modeler being able to propagate attributes across
100 : : //- such operations on its entities. If it cannot, then "names"
101 : : //- of VGI entities will not propagate.
102 : :
103 : : virtual CubitStatus get_simple_attribute(const CubitString& name,
104 : : DLIList<CubitSimpleAttrib>& ) = 0;
105 : :
106 : : TopologyEntity* topology_entity() const;
107 : : //R TopologyEntity*
108 : : //R- Pointer to the TopologyEntity using this TopologyBridge.
109 : : //- This (pure virtual) function returns a pointer to the
110 : : //- TopologyEntity that is using this object, i.e. owner of this
111 : : //- TopologyBridge. It is implied that a TopologyBridge is not
112 : : //- used by more than one TopologyEntity.
113 : :
114 : 1775333 : TBOwner* owner() const
115 : 1775333 : { return bridgeOwner; }
116 : :
117 : 274631 : void owner( TBOwner* new_owner )
118 : 274631 : { bridgeOwner = new_owner; }
119 : :
120 : : BridgeManager* bridge_manager() const;
121 : : void bridge_manager(BridgeManager* manager);
122 : :
123 : 123267 : CubitSense bridge_sense()
124 : 123267 : { return bridgeSense; }
125 : 140 : void reverse_bridge_sense()
126 : 140 : { bridgeSense = bridgeSense == CUBIT_UNKNOWN ? CUBIT_UNKNOWN :
127 : 140 : bridgeSense == CUBIT_FORWARD ? CUBIT_REVERSED :
128 [ + - ][ + - ]: 140 : CUBIT_FORWARD; }
129 : : //- Get or switch the bridge sense.
130 : : //-
131 : : //- The bridge sense is the sense of the TopologyBridge with
132 : : //- respect to it's owning TopologyEntity. The results of
133 : : //- geometric evaluation functions on the ownging TopologyEntity
134 : : //- may be affected by this value.
135 : : //-
136 : : //- Currently, this is only set for Surfaces and Curves, as the
137 : : //- sense of either may be opposite that of its owning RefFace
138 : : //- or RefEdge when merging occurs. It is not set/used on Loops
139 : : //- or CoEdges because a) there are no geometric evaluations on
140 : : //- the underlying LoopSMs or CoEdgeSMs and b) the relative sense
141 : : //- can be inferred from that of the corresponding Surface and
142 : : //- Curve.
143 : : //-
144 : : //- This value is saved in the MergePartner attribute.
145 : :
146 : : virtual GeometryQueryEngine* get_geometry_query_engine() const = 0;
147 : : //- This function returns a pointer to the geometry query engine
148 : : //- associated with the object.
149 : :
150 : 0 : virtual int validate(const CubitString&,
151 : : DLIList <TopologyEntity*>&)
152 : 0 : { return 0; }
153 : : //- Check that entity is valid. Returns number of problems detected.
154 : : //- For sub-classes that don't implement this, just assume there are
155 : : //- no problems and return 0.
156 : :
157 : :
158 : : enum { MAX_TB_LAYER = 255 };
159 : 1680758 : virtual int layer() const { return 0; }
160 : : //- Bridge layer at which this bridge occurs.
161 : : //- 0 - real geometry
162 : : //- 126 - sub-composite partition layer
163 : : //- 127 - composite layer
164 : : //- 128 - super-composite partition layer
165 : :
166 : : void get_parents(DLIList<TopologyBridge*> &parents);
167 : : //- get parent topology bridges
168 : :
169 : : void get_children(DLIList<TopologyBridge*> &children,
170 : : bool return_hidden_entities = false,
171 : : int layer = MAX_TB_LAYER );
172 : : //- get child topology bridges
173 : :
174 : : void bodysms(DLIList<BodySM*> &bodies,bool unique = true);
175 : : void lumps(DLIList<Lump*> &lumps,bool unique = true);
176 : : void shellsms(DLIList<ShellSM*> &shellsms,bool unique = true);
177 : : void surfaces(DLIList<Surface*> &surfaces,bool unique = true);
178 : : void surfaces_ignore_virtual(DLIList<Surface*> &surfaces,bool unique = true);
179 : : void loopsms(DLIList<LoopSM*> &loopsms,bool unique = true);
180 : : void curves(DLIList<Curve*> &curves, bool unique = true);
181 : : void curves_ignore_virtual(DLIList<Curve*> &curves, bool unique = true);
182 : : void coedgesms(DLIList<CoEdgeSM*> &coedgesms,bool unique = true);
183 : : void points(DLIList<TBPoint*> &points,bool unique = true);
184 : : //- topology traversal of TB's; implemented based on native traversal
185 : : //- functions in the modeler
186 : :
187 : : BodySM *bodysm();
188 : : Lump *lump();
189 : : LoopSM *loopsm();
190 : :
191 : : virtual void get_parents_virt(DLIList<TopologyBridge*> &parents ) = 0;
192 : : //- Get parent topology bridges as returned by solid modeler.
193 : : //- Derived classes must provide this method for use in the
194 : : //- implementation of get_parents(..). You probably want to
195 : : //- be using get_parents(..) rather than this method.
196 : :
197 : : virtual void get_children_virt(DLIList<TopologyBridge*> &children ) = 0;
198 : : //- Get child topology bridges as returned by solid modeler.
199 : : //- Derived classes must provide this method for use in the
200 : : //- implementation of get_children(..). You probably want to
201 : : //- be using get_children(..) rather than this method.
202 : :
203 : : private:
204 : :
205 : :
206 : : TBOwner* bridgeOwner;
207 : :
208 : : CubitSense bridgeSense;
209 : : //- (See comments for bridge_sense() method.)
210 : :
211 : : };
212 : :
213 : : #endif
214 : :
|