42cf5bc1 |
1 | // Created on: 1997-07-28 |
2 | // Created by: Pierre CHALAMET |
3 | // Copyright (c) 1997-1999 Matra Datavision |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
5 | // |
6 | // This file is part of Open CASCADE Technology software library. |
7 | // |
8 | // This library is free software; you can redistribute it and/or modify it under |
9 | // the terms of the GNU Lesser General Public License version 2.1 as published |
10 | // by the Free Software Foundation, with special exception defined in the file |
11 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
12 | // distribution for complete text of the license and disclaimer of any warranty. |
13 | // |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
16 | |
17 | #ifndef _Graphic3d_Texture1Dsegment_HeaderFile |
18 | #define _Graphic3d_Texture1Dsegment_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_Type.hxx> |
22 | |
23 | #include <Standard_ShortReal.hxx> |
24 | #include <Graphic3d_Texture1D.hxx> |
25 | #include <Graphic3d_NameOfTexture1D.hxx> |
42cf5bc1 |
26 | class TCollection_AsciiString; |
27 | |
28 | |
29 | class Graphic3d_Texture1Dsegment; |
30 | DEFINE_STANDARD_HANDLE(Graphic3d_Texture1Dsegment, Graphic3d_Texture1D) |
31 | |
32 | //! This class provides the implementation |
33 | //! of a 1D texture applyable along a segment. |
34 | //! You might use the SetSegment() method |
35 | //! to set the way the texture is "streched" on facets. |
36 | class Graphic3d_Texture1Dsegment : public Graphic3d_Texture1D |
37 | { |
38 | |
39 | public: |
40 | |
41 | |
42 | //! Creates a texture from a file |
43 | Standard_EXPORT Graphic3d_Texture1Dsegment(const TCollection_AsciiString& theFileName); |
44 | |
45 | //! Creates a texture from a predefined texture name set. |
46 | Standard_EXPORT Graphic3d_Texture1Dsegment(const Graphic3d_NameOfTexture1D theNOT); |
47 | |
48 | //! Creates a texture from the pixmap. |
a13f2dc4 |
49 | Standard_EXPORT Graphic3d_Texture1Dsegment(const Handle(Image_PixMap)& thePixMap); |
42cf5bc1 |
50 | |
51 | //! Sets the texture application bounds. Defines the way |
52 | //! the texture is stretched across facets. |
53 | //! Default values are <0.0, 0.0, 0.0> , <0.0, 0.0, 1.0> |
54 | Standard_EXPORT void SetSegment (const Standard_ShortReal theX1, const Standard_ShortReal theY1, const Standard_ShortReal theZ1, const Standard_ShortReal theX2, const Standard_ShortReal theY2, const Standard_ShortReal theZ2); |
55 | |
56 | //! Returns the values of the current segment X1, Y1, Z1 , X2, Y2, Z2. |
57 | Standard_EXPORT void Segment (Standard_ShortReal& theX1, Standard_ShortReal& theY1, Standard_ShortReal& theZ1, Standard_ShortReal& theX2, Standard_ShortReal& theY2, Standard_ShortReal& theZ2) const; |
58 | |
59 | |
60 | |
61 | |
92efcf78 |
62 | DEFINE_STANDARD_RTTIEXT(Graphic3d_Texture1Dsegment,Graphic3d_Texture1D) |
42cf5bc1 |
63 | |
64 | protected: |
65 | |
66 | |
67 | |
68 | |
69 | private: |
70 | |
71 | |
72 | Standard_ShortReal myX1; |
73 | Standard_ShortReal myY1; |
74 | Standard_ShortReal myZ1; |
75 | Standard_ShortReal myX2; |
76 | Standard_ShortReal myY2; |
77 | Standard_ShortReal myZ2; |
78 | |
79 | |
80 | }; |
81 | |
82 | |
83 | |
84 | |
85 | |
86 | |
87 | |
88 | #endif // _Graphic3d_Texture1Dsegment_HeaderFile |