File indexing completed on 2025-01-18 10:03:49
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef _Graphic3d_StructureManager_HeaderFile
0018 #define _Graphic3d_StructureManager_HeaderFile
0019
0020 #include <Aspect_GenId.hxx>
0021 #include <Graphic3d_CView.hxx>
0022 #include <Graphic3d_MapOfObject.hxx>
0023 #include <Graphic3d_MapOfStructure.hxx>
0024 #include <Graphic3d_ViewAffinity.hxx>
0025 #include <Graphic3d_ZLayerId.hxx>
0026 #include <Graphic3d_ZLayerSettings.hxx>
0027 #include <Standard_Transient.hxx>
0028 #include <NCollection_IndexedMap.hxx>
0029 #include <Standard.hxx>
0030 #include <Standard_Integer.hxx>
0031 #include <Standard_Type.hxx>
0032 #include <TColStd_Array2OfReal.hxx>
0033
0034 typedef NCollection_IndexedMap<Graphic3d_CView*> Graphic3d_IndexedMapOfView;
0035
0036 class Graphic3d_GraphicDriver;
0037 class Graphic3d_Structure;
0038 class Graphic3d_DataStructureManager;
0039
0040
0041
0042
0043
0044
0045
0046 class Graphic3d_StructureManager : public Standard_Transient
0047 {
0048 friend class Graphic3d_Structure;
0049 DEFINE_STANDARD_RTTIEXT(Graphic3d_StructureManager, Standard_Transient)
0050 public:
0051
0052
0053
0054
0055
0056
0057
0058
0059 Standard_EXPORT Graphic3d_StructureManager (const Handle(Graphic3d_GraphicDriver)& theDriver);
0060
0061
0062 Standard_EXPORT ~Graphic3d_StructureManager();
0063
0064
0065 Standard_EXPORT virtual void Update (const Graphic3d_ZLayerId theLayerId = Graphic3d_ZLayerId_UNKNOWN) const;
0066
0067
0068 Standard_EXPORT virtual void Remove();
0069
0070
0071 Standard_EXPORT virtual void Erase();
0072
0073
0074
0075 Standard_EXPORT void DisplayedStructures (Graphic3d_MapOfStructure& SG) const;
0076
0077
0078
0079 Standard_EXPORT void HighlightedStructures (Graphic3d_MapOfStructure& SG) const;
0080
0081
0082
0083 Standard_EXPORT virtual void ReCompute (const Handle(Graphic3d_Structure)& theStructure);
0084
0085
0086
0087 Standard_EXPORT virtual void ReCompute (const Handle(Graphic3d_Structure)& theStructure, const Handle(Graphic3d_DataStructureManager)& theProjector);
0088
0089
0090 Standard_EXPORT virtual void Clear (Graphic3d_Structure* theStructure, const Standard_Boolean theWithDestruction);
0091
0092
0093 Standard_EXPORT virtual void Connect (const Graphic3d_Structure* theMother,
0094 const Graphic3d_Structure* theDaughter);
0095
0096
0097 Standard_EXPORT virtual void Disconnect (const Graphic3d_Structure* theMother,
0098 const Graphic3d_Structure* theDaughter);
0099
0100
0101 Standard_EXPORT virtual void Display (const Handle(Graphic3d_Structure)& theStructure);
0102
0103
0104 Standard_EXPORT virtual void Erase (const Handle(Graphic3d_Structure)& theStructure);
0105
0106
0107 Standard_EXPORT virtual void Highlight (const Handle(Graphic3d_Structure)& theStructure);
0108
0109
0110 Standard_EXPORT virtual void SetTransform (const Handle(Graphic3d_Structure)& theStructure, const Handle(TopLoc_Datum3D)& theTrsf);
0111
0112
0113 Standard_EXPORT virtual void ChangeDisplayPriority (const Handle(Graphic3d_Structure)& theStructure,
0114 const Graphic3d_DisplayPriority theOldPriority,
0115 const Graphic3d_DisplayPriority theNewPriority);
0116
0117
0118
0119 Standard_EXPORT virtual void ChangeZLayer (const Handle(Graphic3d_Structure)& theStructure, const Graphic3d_ZLayerId theLayerId);
0120
0121
0122 Standard_EXPORT const Handle(Graphic3d_GraphicDriver)& GraphicDriver() const;
0123
0124
0125 Standard_EXPORT Standard_Integer Identification (Graphic3d_CView* theView);
0126
0127
0128 Standard_EXPORT void UnIdentification (Graphic3d_CView* theView);
0129
0130
0131 Standard_EXPORT const Graphic3d_IndexedMapOfView& DefinedViews() const;
0132
0133
0134
0135
0136 Standard_EXPORT Standard_Integer MaxNumOfViews() const;
0137
0138
0139 Standard_EXPORT virtual Handle(Graphic3d_Structure) Identification (const Standard_Integer AId) const;
0140
0141
0142 Standard_EXPORT virtual void UnHighlight (const Handle(Graphic3d_Structure)& AStructure);
0143
0144
0145 Standard_EXPORT virtual void UnHighlight();
0146
0147
0148
0149 Standard_EXPORT void RecomputeStructures();
0150
0151
0152 Standard_EXPORT void RecomputeStructures (const NCollection_Map<Graphic3d_Structure*>& theStructures);
0153
0154 Standard_EXPORT void RegisterObject (const Handle(Standard_Transient)& theObject,
0155 const Handle(Graphic3d_ViewAffinity)& theAffinity);
0156
0157 Standard_EXPORT void UnregisterObject (const Handle(Standard_Transient)& theObject);
0158
0159 Standard_EXPORT const Handle(Graphic3d_ViewAffinity)& ObjectAffinity (const Handle(Standard_Transient)& theObject) const;
0160
0161
0162 Standard_Boolean IsDeviceLost() const { return myDeviceLostFlag; }
0163
0164
0165 void SetDeviceLost() { myDeviceLostFlag = Standard_True; }
0166
0167
0168 Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
0169
0170 protected:
0171
0172
0173
0174
0175 Standard_EXPORT Standard_Integer NumberOfDisplayedStructures() const;
0176
0177 protected:
0178
0179 Aspect_GenId myViewGenId;
0180 Graphic3d_MapOfStructure myDisplayedStructure;
0181 Graphic3d_MapOfStructure myHighlightedStructure;
0182 Graphic3d_MapOfObject myRegisteredObjects;
0183 Handle(Graphic3d_GraphicDriver) myGraphicDriver;
0184 Graphic3d_IndexedMapOfView myDefinedViews;
0185 Standard_Boolean myDeviceLostFlag;
0186 };
0187
0188 DEFINE_STANDARD_HANDLE(Graphic3d_StructureManager, Standard_Transient)
0189
0190 #endif