7fd59977 |
1 | #ifndef _Sample2D_Image_HeaderFile |
2 | #define _Sample2D_Image_HeaderFile |
3 | #include <Standard_Macro.hxx> |
4 | #include <Standard_DefineHandle.hxx> |
5 | |
6 | #include <OSD_File.hxx> |
7 | #include <Quantity_Length.hxx> |
7fd59977 |
8 | #include <Quantity_Factor.hxx> |
9 | #include <Standard_Boolean.hxx> |
10 | #include <Standard_CString.hxx> |
7fd59977 |
11 | #include <Standard_Integer.hxx> |
5c1f974e |
12 | #include <SelectMgr_Selection.hxx> |
7fd59977 |
13 | #include <Standard_OStream.hxx> |
14 | #include <Standard_IStream.hxx> |
9e3ca93a |
15 | class Sample2D_Image; |
5c1f974e |
16 | DEFINE_STANDARD_HANDLE(Sample2D_Image,AIS_TexturedShape) |
17 | class Sample2D_Image : public AIS_TexturedShape { |
7fd59977 |
18 | |
19 | public: |
20 | |
5c1f974e |
21 | Standard_EXPORT Sample2D_Image(TCollection_AsciiString& aFileName, |
7fd59977 |
22 | const Quantity_Length X = 0.0, |
23 | const Quantity_Length Y = 0.0, |
7fd59977 |
24 | const Quantity_Factor aScale = 1.0); |
7fd59977 |
25 | Standard_EXPORT inline virtual void GetCoord(Quantity_Length& X,Quantity_Length& Y) const; |
26 | Standard_EXPORT inline virtual void SetCoord(const Quantity_Length X,const Quantity_Length Y) ; |
7fd59977 |
27 | Standard_EXPORT inline Quantity_Factor GetScale() const; |
28 | Standard_EXPORT inline void SetScale(const Quantity_Factor aNewScale) ; |
5c1f974e |
29 | Standard_EXPORT virtual void SetContext(const Handle(AIS_InteractiveContext)& theContext) ; |
7fd59977 |
30 | |
9e3ca93a |
31 | DEFINE_STANDARD_RTTI(Sample2D_Image,AIS_TexturedShape) |
5c1f974e |
32 | private: |
33 | void MakeShape(); |
7fd59977 |
34 | protected: |
5c1f974e |
35 | TopoDS_Face myFace; |
36 | TCollection_AsciiString myFilename; |
7fd59977 |
37 | Quantity_Length myX; |
38 | Quantity_Length myY; |
7fd59977 |
39 | Quantity_Factor myScale; |
7fd59977 |
40 | |
41 | }; |
42 | |
43 | // other inline functions and methods (like "C++: function call" methods) |
44 | // |
45 | |
46 | inline void Sample2D_Image::GetCoord(Quantity_Length& X, Quantity_Length& Y) const |
47 | { |
48 | X = myX; |
49 | Y = myY; |
50 | } |
51 | |
52 | inline void Sample2D_Image::SetCoord(const Quantity_Length X, const Quantity_Length Y) |
53 | { |
54 | myX = X; |
55 | myY = Y; |
56 | } |
57 | |
7fd59977 |
58 | inline Quantity_Factor Sample2D_Image::GetScale() const |
59 | { |
60 | return myScale; |
61 | } |
62 | |
63 | inline void Sample2D_Image::SetScale(const Quantity_Factor aNewScale) |
64 | { |
65 | myScale = aNewScale; |
66 | } |
67 | |
7fd59977 |
68 | |
69 | |
70 | #endif |