File indexing completed on 2025-01-18 10:03:24
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef _Draw_Drawable3D_HeaderFile
0018 #define _Draw_Drawable3D_HeaderFile
0019
0020 #include <Standard_CString.hxx>
0021 #include <Standard_Type.hxx>
0022 #include <Standard_Transient.hxx>
0023 #include <Standard_IStream.hxx>
0024 #include <Standard_OStream.hxx>
0025 #include <Draw_Interpretor.hxx>
0026
0027 class Draw_Display;
0028
0029 DEFINE_STANDARD_HANDLE(Draw_Drawable3D, Standard_Transient)
0030
0031 class Draw_Drawable3D : public Standard_Transient
0032 {
0033 DEFINE_STANDARD_RTTIEXT(Draw_Drawable3D, Standard_Transient)
0034 public:
0035
0036
0037 typedef Handle(Draw_Drawable3D)(*FactoryFunction_t)(Standard_IStream& theStream);
0038
0039
0040
0041
0042 Standard_EXPORT static void RegisterFactory (const Standard_CString theType,
0043 const FactoryFunction_t& theFactory);
0044
0045
0046
0047
0048
0049 Standard_EXPORT static Handle(Draw_Drawable3D) Restore (const Standard_CString theType,
0050 Standard_IStream& theStream);
0051
0052
0053
0054 #define Draw_Drawable3D_FACTORY \
0055 static void RegisterFactory() { Draw_Drawable3D::RegisterFactory (get_type_name(), &Restore); } \
0056 Standard_EXPORT static Handle(Draw_Drawable3D) Restore (Standard_IStream& theStream);
0057
0058 public:
0059
0060 Standard_EXPORT virtual void DrawOn (Draw_Display& dis) const = 0;
0061
0062
0063 Standard_EXPORT virtual Standard_Boolean PickReject (const Standard_Real X, const Standard_Real Y, const Standard_Real Prec) const;
0064
0065
0066 Standard_EXPORT virtual Handle(Draw_Drawable3D) Copy() const;
0067
0068
0069 Standard_EXPORT virtual void Dump (Standard_OStream& S) const;
0070
0071
0072 Standard_EXPORT virtual void Save (Standard_OStream& theStream) const;
0073
0074
0075 Standard_EXPORT virtual void Whatis (Draw_Interpretor& I) const;
0076
0077
0078 virtual bool Is3D() const { return true; }
0079
0080
0081 virtual bool IsDisplayable() const { return true; }
0082
0083 void SetBounds (const Standard_Real theXMin, const Standard_Real theXMax,
0084 const Standard_Real theYMin, const Standard_Real theYMax)
0085 {
0086 myXmin = theXMin;
0087 myXmax = theXMax;
0088 myYmin = theYMin;
0089 myYmax = theYMax;
0090 }
0091
0092 void Bounds (Standard_Real& theXMin, Standard_Real& theXMax,
0093 Standard_Real& theYMin, Standard_Real& theYMax) const
0094 {
0095 theXMin = myXmin;
0096 theXMax = myXmax;
0097 theYMin = myYmin;
0098 theYMax = myYmax;
0099 }
0100
0101 Standard_Boolean Visible() const { return isVisible; }
0102
0103 void Visible (const Standard_Boolean V) { isVisible = V; }
0104
0105 Standard_Boolean Protected() const { return isProtected; }
0106
0107 void Protected (const Standard_Boolean P) { isProtected = P; }
0108
0109 Standard_CString Name() const { return myName; }
0110
0111 virtual void Name (const Standard_CString N) { myName = N; }
0112
0113 protected:
0114
0115 Standard_EXPORT Draw_Drawable3D();
0116
0117 private:
0118
0119 Standard_Real myXmin;
0120 Standard_Real myXmax;
0121 Standard_Real myYmin;
0122 Standard_Real myYmax;
0123 Standard_CString myName;
0124 Standard_Boolean isVisible;
0125 Standard_Boolean isProtected;
0126
0127 };
0128
0129 #endif