Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:49

0001 // Created on: 1997-07-28
0002 // Created by: Pierre CHALAMET
0003 // Copyright (c) 1997-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _Graphic3d_Texture2Dplane_HeaderFile
0018 #define _Graphic3d_Texture2Dplane_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 
0022 #include <Graphic3d_NameOfTexturePlane.hxx>
0023 #include <Graphic3d_Texture2D.hxx>
0024 #include <Graphic3d_NameOfTexture2D.hxx>
0025 class TCollection_AsciiString;
0026 
0027 
0028 class Graphic3d_Texture2Dplane;
0029 DEFINE_STANDARD_HANDLE(Graphic3d_Texture2Dplane, Graphic3d_Texture2D)
0030 
0031 //! This class allows the management of a 2D texture defined from a plane equation
0032 //! Use the SetXXX() methods for positioning the texture as you want.
0033 class Graphic3d_Texture2Dplane : public Graphic3d_Texture2D
0034 {
0035 
0036 public:
0037 
0038   
0039   //! Creates a texture from a file
0040   Standard_EXPORT Graphic3d_Texture2Dplane(const TCollection_AsciiString& theFileName);
0041   
0042   //! Creates a texture from a predefined texture name set.
0043   Standard_EXPORT Graphic3d_Texture2Dplane(const Graphic3d_NameOfTexture2D theNOT);
0044   
0045   //! Creates a texture from the pixmap.
0046   Standard_EXPORT Graphic3d_Texture2Dplane(const Handle(Image_PixMap)& thePixMap);
0047   
0048   //! Defines the texture projection plane for texture coordinate S
0049   //! default is <1.0, 0.0, 0.0, 0.0>
0050   Standard_EXPORT void SetPlaneS (const Standard_ShortReal A, const Standard_ShortReal B, const Standard_ShortReal C, const Standard_ShortReal D);
0051   
0052   //! Defines the texture projection plane for texture coordinate T
0053   //! default is <0.0, 1.0, 0.0, 0.0>
0054   Standard_EXPORT void SetPlaneT (const Standard_ShortReal A, const Standard_ShortReal B, const Standard_ShortReal C, const Standard_ShortReal D);
0055   
0056   //! Defines the texture projection plane for both S and T texture coordinate
0057   //! default is NOTP_XY meaning:
0058   //! <1.0, 0.0, 0.0, 0.0> for S
0059   //! and  <0.0, 1.0, 0.0, 0.0> for T
0060   Standard_EXPORT void SetPlane (const Graphic3d_NameOfTexturePlane thePlane);
0061   
0062   //! Defines the texture scale for the S texture coordinate
0063   //! much easier than recomputing the S plane equation
0064   //! but the result is the same
0065   //! default to 1.0
0066   Standard_EXPORT void SetScaleS (const Standard_ShortReal theVal);
0067   
0068   //! Defines the texture scale for the T texture coordinate
0069   //! much easier than recompution the T plane equation
0070   //! but the result is the same
0071   //! default to 1.0
0072   Standard_EXPORT void SetScaleT (const Standard_ShortReal theVal);
0073   
0074   //! Defines the texture translation for the S texture coordinate
0075   //! you can obtain the same effect by modifying the S plane
0076   //! equation but its not easier.
0077   //! default to 0.0
0078   Standard_EXPORT void SetTranslateS (const Standard_ShortReal theVal);
0079   
0080   //! Defines the texture translation for the T texture coordinate
0081   //! you can obtain the same effect by modifying the T plane
0082   //! equation but its not easier.
0083   //! default to 0.0
0084   Standard_EXPORT void SetTranslateT (const Standard_ShortReal theVal);
0085   
0086   //! Sets the rotation angle of the whole texture.
0087   //! the same result might be achieved by recomputing the
0088   //! S and T plane equation but it's not the easiest way...
0089   //! the angle is expressed in degrees
0090   //! default is 0.0
0091   Standard_EXPORT void SetRotation (const Standard_ShortReal theVal);
0092   
0093   //! Returns the current texture plane name or NOTP_UNKNOWN
0094   //! when the plane is user defined.
0095   Standard_EXPORT Graphic3d_NameOfTexturePlane Plane() const;
0096   
0097   //! Returns the current texture plane S equation
0098   Standard_EXPORT void PlaneS (Standard_ShortReal& A, Standard_ShortReal& B, Standard_ShortReal& C, Standard_ShortReal& D) const;
0099   
0100   //! Returns   the current texture plane T equation
0101   Standard_EXPORT void PlaneT (Standard_ShortReal& A, Standard_ShortReal& B, Standard_ShortReal& C, Standard_ShortReal& D) const;
0102   
0103   //! Returns  the current texture S translation value
0104   Standard_EXPORT void TranslateS (Standard_ShortReal& theVal) const;
0105   
0106   //! Returns the current texture T translation value
0107   Standard_EXPORT void TranslateT (Standard_ShortReal& theVal) const;
0108   
0109   //! Returns the current texture S scale value
0110   Standard_EXPORT void ScaleS (Standard_ShortReal& theVal) const;
0111   
0112   //! Returns the current texture T scale value
0113   Standard_EXPORT void ScaleT (Standard_ShortReal& theVal) const;
0114   
0115   //! Returns the current texture rotation angle
0116   Standard_EXPORT void Rotation (Standard_ShortReal& theVal) const;
0117 
0118 
0119 
0120 
0121   DEFINE_STANDARD_RTTIEXT(Graphic3d_Texture2Dplane,Graphic3d_Texture2D)
0122 
0123 protected:
0124 
0125 
0126 
0127 
0128 private:
0129 
0130 
0131   Graphic3d_NameOfTexturePlane myPlaneName;
0132 
0133 
0134 };
0135 
0136 
0137 
0138 
0139 
0140 
0141 
0142 #endif // _Graphic3d_Texture2Dplane_HeaderFile