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
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _Graphic3d_Texture1Dsegment_HeaderFile
18 #define _Graphic3d_Texture1Dsegment_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <Standard_ShortReal.hxx>
24 #include <Graphic3d_Texture1D.hxx>
25 #include <Graphic3d_NameOfTexture1D.hxx>
26 class TCollection_AsciiString;
29 class Graphic3d_Texture1Dsegment;
30 DEFINE_STANDARD_HANDLE(Graphic3d_Texture1Dsegment, Graphic3d_Texture1D)
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
42 //! Creates a texture from a file
43 Standard_EXPORT Graphic3d_Texture1Dsegment(const TCollection_AsciiString& theFileName);
45 //! Creates a texture from a predefined texture name set.
46 Standard_EXPORT Graphic3d_Texture1Dsegment(const Graphic3d_NameOfTexture1D theNOT);
48 //! Creates a texture from the pixmap.
49 Standard_EXPORT Graphic3d_Texture1Dsegment(const Handle(Image_PixMap)& thePixMap);
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);
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;
62 DEFINE_STANDARD_RTTIEXT(Graphic3d_Texture1Dsegment,Graphic3d_Texture1D)
72 Standard_ShortReal myX1;
73 Standard_ShortReal myY1;
74 Standard_ShortReal myZ1;
75 Standard_ShortReal myX2;
76 Standard_ShortReal myY2;
77 Standard_ShortReal myZ2;
88 #endif // _Graphic3d_Texture1Dsegment_HeaderFile