File indexing completed on 2025-01-18 10:03:48
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef _Graphic3d_GraphicDriver_HeaderFile
0018 #define _Graphic3d_GraphicDriver_HeaderFile
0019
0020 #include <Aspect_GenId.hxx>
0021 #include <Graphic3d_CStructure.hxx>
0022 #include <Graphic3d_ZLayerId.hxx>
0023 #include <Graphic3d_ZLayerSettings.hxx>
0024 #include <Graphic3d_TypeOfLimit.hxx>
0025 #include <TColStd_SequenceOfInteger.hxx>
0026
0027 class Aspect_DisplayConnection;
0028 class Aspect_Window;
0029 class Graphic3d_CView;
0030 class Graphic3d_Layer;
0031 class Graphic3d_StructureManager;
0032 class TCollection_AsciiString;
0033
0034 DEFINE_STANDARD_HANDLE(Graphic3d_GraphicDriver, Standard_Transient)
0035
0036
0037
0038 class Graphic3d_GraphicDriver : public Standard_Transient
0039 {
0040 DEFINE_STANDARD_RTTIEXT(Graphic3d_GraphicDriver, Standard_Transient)
0041 public:
0042
0043
0044 virtual Standard_Integer InquireLimit (const Graphic3d_TypeOfLimit theType) const = 0;
0045
0046
0047 Standard_Integer InquireLightLimit() const { return InquireLimit (Graphic3d_TypeOfLimit_MaxNbLights); }
0048
0049
0050 Standard_Integer InquirePlaneLimit() const { return InquireLimit (Graphic3d_TypeOfLimit_MaxNbClipPlanes); }
0051
0052
0053 Standard_Integer InquireViewLimit() const { return InquireLimit (Graphic3d_TypeOfLimit_MaxNbViews); }
0054
0055 public:
0056
0057
0058 virtual Handle(Graphic3d_CStructure) CreateStructure (const Handle(Graphic3d_StructureManager)& theManager) = 0;
0059
0060
0061 virtual void RemoveStructure (Handle(Graphic3d_CStructure)& theCStructure) = 0;
0062
0063
0064 virtual Handle(Graphic3d_CView) CreateView (const Handle(Graphic3d_StructureManager)& theMgr) = 0;
0065
0066
0067 virtual void RemoveView (const Handle(Graphic3d_CView)& theView) = 0;
0068
0069
0070 virtual void EnableVBO (const Standard_Boolean status) = 0;
0071
0072
0073 virtual bool IsVerticalSync() const = 0;
0074
0075
0076 virtual void SetVerticalSync (bool theToEnable) = 0;
0077
0078
0079 virtual Standard_Boolean MemoryInfo (Standard_Size& theFreeBytes, TCollection_AsciiString& theInfo) const = 0;
0080
0081 virtual Standard_ShortReal DefaultTextHeight() const = 0;
0082
0083
0084 virtual void TextSize (const Handle(Graphic3d_CView)& theView,
0085 const Standard_CString theText,
0086 const Standard_ShortReal theHeight,
0087 Standard_ShortReal& theWidth,
0088 Standard_ShortReal& theAscent,
0089 Standard_ShortReal& theDescent) const = 0;
0090
0091
0092
0093
0094
0095
0096 Standard_EXPORT virtual void InsertLayerBefore (const Graphic3d_ZLayerId theNewLayerId,
0097 const Graphic3d_ZLayerSettings& theSettings,
0098 const Graphic3d_ZLayerId theLayerAfter) = 0;
0099
0100
0101
0102
0103
0104 Standard_EXPORT virtual void InsertLayerAfter (const Graphic3d_ZLayerId theNewLayerId,
0105 const Graphic3d_ZLayerSettings& theSettings,
0106 const Graphic3d_ZLayerId theLayerBefore) = 0;
0107
0108
0109
0110
0111
0112 Standard_EXPORT virtual void RemoveZLayer (const Graphic3d_ZLayerId theLayerId) = 0;
0113
0114
0115 Standard_EXPORT virtual void ZLayers (TColStd_SequenceOfInteger& theLayerSeq) const;
0116
0117
0118 Standard_EXPORT virtual void SetZLayerSettings (const Graphic3d_ZLayerId theLayerId, const Graphic3d_ZLayerSettings& theSettings) = 0;
0119
0120
0121 Standard_EXPORT virtual const Graphic3d_ZLayerSettings& ZLayerSettings (const Graphic3d_ZLayerId theLayerId) const;
0122
0123
0124
0125 virtual Standard_Boolean ViewExists (const Handle(Aspect_Window)& theWindow, Handle(Graphic3d_CView)& theView) = 0;
0126
0127
0128 Standard_EXPORT const Handle(Aspect_DisplayConnection)& GetDisplayConnection() const;
0129
0130
0131 Standard_EXPORT Standard_Integer NewIdentification();
0132
0133
0134 Standard_EXPORT void RemoveIdentification(const Standard_Integer theId);
0135
0136
0137 Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
0138
0139 protected:
0140
0141
0142 Standard_EXPORT Graphic3d_GraphicDriver(const Handle(Aspect_DisplayConnection)& theDisp);
0143
0144 protected:
0145
0146 Handle(Aspect_DisplayConnection) myDisplayConnection;
0147 Aspect_GenId myStructGenId;
0148 NCollection_List<Handle(Graphic3d_Layer)> myLayers;
0149 NCollection_DataMap<Graphic3d_ZLayerId, Handle(Graphic3d_Layer)> myLayerIds;
0150
0151 };
0152
0153 #endif