File indexing completed on 2025-01-18 10:02:59
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef _Aspect_Window_HeaderFile
0017 #define _Aspect_Window_HeaderFile
0018
0019 #include <Aspect_Background.hxx>
0020 #include <Aspect_GradientBackground.hxx>
0021 #include <Aspect_FBConfig.hxx>
0022 #include <Aspect_FillMethod.hxx>
0023 #include <Quantity_Color.hxx>
0024 #include <Aspect_GradientFillMethod.hxx>
0025 #include <Aspect_TypeOfResize.hxx>
0026 #include <Aspect_Drawable.hxx>
0027 #include <Graphic3d_Vec2.hxx>
0028 #include <Standard.hxx>
0029 #include <Standard_Transient.hxx>
0030 #include <Standard_Type.hxx>
0031 #include <TCollection_AsciiString.hxx>
0032
0033 class Aspect_DisplayConnection;
0034
0035 DEFINE_STANDARD_HANDLE(Aspect_Window, Standard_Transient)
0036
0037
0038 class Aspect_Window : public Standard_Transient
0039 {
0040 DEFINE_STANDARD_RTTIEXT(Aspect_Window, Standard_Transient)
0041 public:
0042
0043
0044 Standard_EXPORT Standard_Boolean IsVirtual() const;
0045
0046
0047 Standard_EXPORT void SetVirtual (const Standard_Boolean theVirtual);
0048
0049
0050 Graphic3d_Vec2i TopLeft() const
0051 {
0052 Graphic3d_Vec2i aTopLeft, aBotRight;
0053 Position (aTopLeft.x(), aTopLeft.y(), aBotRight.x(), aBotRight.y());
0054 return aTopLeft;
0055 }
0056
0057
0058 Graphic3d_Vec2i Dimensions() const
0059 {
0060 Graphic3d_Vec2i aSize;
0061 Size (aSize.x(), aSize.y());
0062 return aSize;
0063 }
0064
0065
0066 const Handle(Aspect_DisplayConnection)& DisplayConnection() const { return myDisplay; }
0067
0068
0069 Standard_EXPORT Aspect_Background Background() const;
0070
0071
0072 Standard_EXPORT Aspect_FillMethod BackgroundFillMethod() const;
0073
0074
0075 Standard_EXPORT Aspect_GradientBackground GradientBackground() const;
0076
0077
0078 Standard_EXPORT void SetBackground (const Aspect_Background& theBack);
0079
0080
0081 Standard_EXPORT void SetBackground (const Quantity_Color& theColor);
0082
0083
0084 Standard_EXPORT void SetBackground (const Aspect_GradientBackground& theBackground);
0085
0086
0087 Standard_EXPORT void SetBackground (const Quantity_Color& theFirstColor, const Quantity_Color& theSecondColor, const Aspect_GradientFillMethod theFillMethod);
0088
0089 public:
0090
0091
0092
0093 Standard_EXPORT virtual Standard_Boolean IsMapped() const = 0;
0094
0095
0096 Standard_EXPORT virtual void Map() const = 0;
0097
0098
0099 Standard_EXPORT virtual void Unmap() const = 0;
0100
0101
0102 Standard_EXPORT virtual Aspect_TypeOfResize DoResize() = 0;
0103
0104
0105
0106 Standard_EXPORT virtual Standard_Boolean DoMapping() const = 0;
0107
0108
0109
0110 Standard_EXPORT virtual Standard_Real Ratio() const = 0;
0111
0112
0113 Standard_EXPORT virtual void Position (Standard_Integer& X1, Standard_Integer& Y1, Standard_Integer& X2, Standard_Integer& Y2) const = 0;
0114
0115
0116 Standard_EXPORT virtual void Size (Standard_Integer& Width, Standard_Integer& Height) const = 0;
0117
0118
0119 Standard_EXPORT virtual Aspect_Drawable NativeHandle() const = 0;
0120
0121
0122 Standard_EXPORT virtual Aspect_Drawable NativeParentHandle() const = 0;
0123
0124
0125 Standard_EXPORT virtual Aspect_FBConfig NativeFBConfig() const = 0;
0126
0127
0128 virtual void SetTitle (const TCollection_AsciiString& theTitle) { (void )theTitle; }
0129
0130
0131
0132
0133
0134
0135
0136
0137
0138 virtual void InvalidateContent (const Handle(Aspect_DisplayConnection)& theDisp) { (void )theDisp; }
0139
0140 public:
0141
0142
0143 virtual Standard_Real DevicePixelRatio() const { return 1.0; }
0144
0145
0146 virtual Graphic3d_Vec2d ConvertPointToBacking (const Graphic3d_Vec2d& thePnt) const
0147 {
0148 return thePnt * DevicePixelRatio();
0149 }
0150
0151
0152 virtual Graphic3d_Vec2d ConvertPointFromBacking (const Graphic3d_Vec2d& thePnt) const
0153 {
0154 return thePnt / DevicePixelRatio();
0155 }
0156
0157 public:
0158
0159
0160 Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
0161
0162 protected:
0163
0164
0165 Standard_EXPORT Aspect_Window();
0166
0167 protected:
0168
0169 Handle(Aspect_DisplayConnection) myDisplay;
0170 Aspect_Background MyBackground;
0171 Aspect_GradientBackground MyGradientBackground;
0172 Aspect_FillMethod MyBackgroundFillMethod;
0173 Standard_Boolean MyIsVirtual;
0174
0175 };
0176
0177 #endif