Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _GEOM_Object_HeaderFile
00024 #define _GEOM_Object_HeaderFile
00025
00026 #ifndef _Standard_TypeMismatch_HeaderFile
00027 #include <Standard_TypeMismatch.hxx>
00028 #endif
00029 #ifndef _Standard_HeaderFile
00030 #include <Standard.hxx>
00031 #endif
00032 #ifndef _Standard_Macro_HeaderFile
00033 #include <Standard_Macro.hxx>
00034 #endif
00035 #ifndef _Standard_HeaderFile
00036 #include <Standard.hxx>
00037 #endif
00038 #ifndef _Handle_MMgt_TShared_HeaderFile
00039 #include <Handle_MMgt_TShared.hxx>
00040 #endif
00041 #ifndef _MMgt_TShared_HeaderFile
00042 #include <MMgt_TShared.hxx>
00043 #endif
00044 #ifndef _Standard_GUID_HeaderFile
00045 #include <Standard_GUID.hxx>
00046 #endif
00047 #ifndef _TopoDS_Shape_HeaderFile
00048 #include <TopoDS_Shape.hxx>
00049 #endif
00050 #ifndef _TDF_Label_HeaderFile
00051 #include <TDF_Label.hxx>
00052 #endif
00053 #ifndef _TColStd_HSequenceOfTransient_HeaderFile
00054 #include <TColStd_HSequenceOfTransient.hxx>
00055 #endif
00056 #ifndef _TCollection_AsciiString_HeaderFile
00057 #include <TCollection_AsciiString.hxx>
00058 #endif
00059 #ifndef _Aspect_TypeOfMarker_HeaderFile
00060 #include <Aspect_TypeOfMarker.hxx>
00061 #endif
00062
00063
00064 class Handle_TColStd_HSequenceOfTransient;
00065 class Standard_Transient;
00066 class Handle_Standard_Type;
00067 class Handle(MMgt_TShared);
00068 class GEOM_Object;
00069
00070
00071 Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(GEOM_Object);
00072
00073 class Handle(GEOM_Object) : public Handle(MMgt_TShared) {
00074 public:
00075 inline void* operator new(size_t,void* anAddress)
00076 {
00077 return anAddress;
00078 }
00079 inline void* operator new(size_t size)
00080 {
00081 return Standard::Allocate(size);
00082 }
00083 inline void operator delete(void *anAddress)
00084 {
00085 if (anAddress) Standard::Free((Standard_Address&)anAddress);
00086 }
00087
00088 Handle(GEOM_Object)():Handle(MMgt_TShared)() {}
00089 Handle(GEOM_Object)(const Handle(GEOM_Object)& aHandle) : Handle(MMgt_TShared)(aHandle)
00090 {
00091 }
00092
00093 Handle(GEOM_Object)(const GEOM_Object* anItem) : Handle(MMgt_TShared)((MMgt_TShared *)anItem)
00094 {
00095 }
00096
00097 Handle(GEOM_Object)& operator=(const Handle(GEOM_Object)& aHandle)
00098 {
00099 Assign(aHandle.Access());
00100 return *this;
00101 }
00102
00103 Handle(GEOM_Object)& operator=(const GEOM_Object* anItem)
00104 {
00105 Assign((Standard_Transient *)anItem);
00106 return *this;
00107 }
00108
00109 GEOM_Object* operator->()
00110 {
00111 return (GEOM_Object *)ControlAccess();
00112 }
00113
00114 GEOM_Object* operator->() const
00115 {
00116 return (GEOM_Object *)ControlAccess();
00117 }
00118
00119 Standard_EXPORT ~Handle(GEOM_Object)() {};
00120
00121 Standard_EXPORT static const Handle(GEOM_Object) DownCast(const Handle(Standard_Transient)& AnObject);
00122 };
00123
00124
00125 #include <Standard_GUID.hxx>
00126 #include <TDataStd_TreeNode.hxx>
00127 #include "GEOM_Function.hxx"
00128 #include "GEOM_Engine.hxx"
00129
00130 class GEOM_Object : public MMgt_TShared
00131 {
00132 friend class GEOM_Engine;
00133
00134 public:
00135 struct Color {
00137 double R;
00139 double G;
00141 double B;
00142 };
00143
00144 public:
00145 inline void* operator new(size_t,void* anAddress)
00146 {
00147 return anAddress;
00148 }
00149 inline void* operator new(size_t size)
00150 {
00151 return Standard::Allocate(size);
00152 }
00153 inline void operator delete(void *anAddress)
00154 {
00155 if (anAddress) Standard::Free((Standard_Address&)anAddress);
00156 }
00157
00158
00159
00160 Standard_EXPORT friend Handle_Standard_Type& GEOM_Object_Type_();
00161 Standard_EXPORT const Handle(Standard_Type)& DynamicType() const { return STANDARD_TYPE(GEOM_Object) ; }
00162 Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)& AType) const
00163 { return (STANDARD_TYPE(GEOM_Object) == AType || MMgt_TShared::IsKind(AType)); }
00164
00165 private:
00166 GEOM_Object(TDF_Label& theLabel);
00167
00168 public:
00169 Standard_EXPORT GEOM_Object(TDF_Label& theEntry, int theType);
00170 Standard_EXPORT ~GEOM_Object();
00171
00172
00173 Standard_EXPORT static Handle(GEOM_Object) GetObject(TDF_Label& theLabel);
00174
00175
00176 Standard_EXPORT static Handle(GEOM_Object) GetReferencedObject(TDF_Label& theLabel);
00177
00178
00179 Standard_EXPORT static const Standard_GUID& GetObjectID();
00180
00181
00182 Standard_EXPORT static const Standard_GUID& GetSubShapeID();
00183
00184
00185
00186
00187
00188
00189 Standard_EXPORT Handle(TDataStd_TreeNode) GetRootNode() { return _root; }
00190
00191
00192 Standard_EXPORT TDF_Label GetEntry() { return _label; }
00193
00194
00195 Standard_EXPORT int GetType();
00196
00197
00198 Standard_EXPORT void SetType(int theType);
00199
00200
00201 Standard_EXPORT int GetTic();
00202 Standard_EXPORT void SetTic(int theTic);
00203 Standard_EXPORT void IncrementTic();
00204
00205
00206 Standard_EXPORT int GetDocID();
00207
00208
00209 Standard_EXPORT TopoDS_Shape GetValue();
00210
00211
00212 Standard_EXPORT void SetName(const char* theName);
00213
00214
00215 Standard_EXPORT char* GetName();
00216
00217
00218 Standard_EXPORT void SetColor(const Color& theColor);
00219
00220
00221 Standard_EXPORT Color GetColor();
00222
00223
00224 Standard_EXPORT void SetAutoColor(bool theAutoColor);
00225
00226
00227 Standard_EXPORT bool GetAutoColor();
00228
00229
00230 Standard_EXPORT void SetMarkerStd(const Aspect_TypeOfMarker theType, double theSize);
00231
00232
00233 Standard_EXPORT void SetMarkerTexture(int theTextureId);
00234
00235
00236 Standard_EXPORT Aspect_TypeOfMarker GetMarkerType();
00237
00238
00239 Standard_EXPORT double GetMarkerSize();
00240
00241
00242 Standard_EXPORT int GetMarkerTexture();
00243
00244
00245 Standard_EXPORT void UnsetMarker();
00246
00247
00248 Standard_EXPORT void SetAuxData(const char* theData);
00249
00250
00251 Standard_EXPORT TCollection_AsciiString GetAuxData();
00252
00253
00254 Standard_EXPORT void SetParameters(const TCollection_AsciiString& theParameters);
00255
00256
00257 Standard_EXPORT TCollection_AsciiString GetParameters() const;
00258
00259
00260
00261
00262
00263
00264 Standard_EXPORT bool IsMainShape();
00265
00266
00267
00268
00269
00270
00271 Standard_EXPORT void SetIOR(TCollection_AsciiString& theIOR) { _ior = theIOR; }
00272
00273
00274 Standard_EXPORT TCollection_AsciiString GetIOR() { return _ior; }
00275
00276
00277
00278
00279
00280
00281
00282 Standard_EXPORT Handle(GEOM_Function) AddFunction(const Standard_GUID& theGUID, int theFunctionType);
00283
00284
00285 Standard_EXPORT int GetNbFunctions();
00286
00287
00288 Standard_EXPORT Handle(GEOM_Function) GetFunction(int theFunctionNumber);
00289
00290
00291 Standard_EXPORT Handle(GEOM_Function) GetLastFunction();
00292
00293
00294 Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetAllDependency();
00295
00296
00297 Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetLastDependency();
00298
00299
00300
00301
00302
00303
00304 Standard_EXPORT TDF_Label GetFreeLabel();
00305
00306 private:
00307 Handle(TDataStd_TreeNode) _root;
00308 TDF_Label _label;
00309 TCollection_AsciiString _ior;
00310 TCollection_AsciiString _parameters;
00311 int _docID;
00312
00313
00314 };
00315
00316 #endif