Test for 0022778: Bug in BRepMesh
[occt.git] / src / Graphic3d / Graphic3d_TextureRoot.cdl
1 -- Created on: 1997-07-28
2 -- Created by: Pierre CHALAMET
3 -- Copyright (c) 1997-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
5 --
6 -- The content of this file is subject to the Open CASCADE Technology Public
7 -- License Version 6.5 (the "License"). You may not use the content of this file
8 -- except in compliance with the License. Please obtain a copy of the License
9 -- at http://www.opencascade.org and read it completely before using this file.
10 --
11 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 --
14 -- The Original Code and all software distributed under the License is
15 -- distributed on an "AS IS" basis, without warranty of any kind, and the
16 -- Initial Developer hereby disclaims all such warranties, including without
17 -- limitation, any warranties of merchantability, fitness for a particular
18 -- purpose or non-infringement. Please see the License for the specific terms
19 -- and conditions governing the rights and limitations under the License.
20
21 deferred class TextureRoot from Graphic3d
22
23 inherits TShared from MMgt
24
25   ---Purpose: This is the texture root class enable the dialog with the GraphicDriver allows the loading of texture.
26
27 uses
28
29   TextureParams from Graphic3d,
30   TypeOfTexture from Graphic3d,
31   PixMap        from Image,
32   PixMap_Handle from Image,
33   Path          from OSD,
34   AsciiString   from TCollection
35
36 is
37
38   Initialize (theFileName : AsciiString from TCollection;
39               theType     : TypeOfTexture from Graphic3d);
40   ---Purpose: Creates a texture from a file
41   --  Warning: Note that if <FileName> is NULL the texture must be realized
42   -- using LoadTexture(image) method.
43
44   Destroy (me);
45   ---C++ : alias ~
46
47   --
48   -- public methods
49   --
50
51   IsDone (me) returns Boolean from Standard
52   is virtual;
53   ---Level:   public
54   ---Purpose: Checks if a texture class is valid or not.
55   -- @return true if the construction of the class is correct
56
57   Path (me) returns Path from OSD;
58   ---Level:   public
59   ---Purpose:
60   -- Returns the full path of the defined texture.
61   -- It could be empty path if GetImage() is overridden to load image not from file.
62   ---C++: return const &
63
64   Type (me) returns TypeOfTexture from Graphic3d;
65   ---Level:   public
66   ---Purpose: @return the texture type.
67
68   GetId (me) returns AsciiString from TCollection;
69   ---Level:   advanced
70   ---Purpose:
71   -- This ID will be used to manage resource in graphic driver.
72   -- .
73   -- Default implementation generates unique ID although inheritors may re-initialize it.
74   -- .
75   -- Multiple Graphic3d_TextureRoot instancies with same ID
76   -- will be treated as single texture with different parameters
77   -- to optimize memory usage though this will be more natural
78   -- to use same instance of Graphic3d_TextureRoot when possible.
79   -- .
80   -- Notice that inheritor may set this ID to empty string.
81   -- In this case independent graphical resource will be created
82   -- for each instance of Graphic3d_AspectFillArea3d where texture will be used.
83   -- .
84   -- @return texture identifier.
85
86   GetImage (me) returns PixMap_Handle from Image
87   is virtual;
88   ---Level   : Public
89   ---Purpose :
90   -- This method will be called by graphic driver each time when texture resource should be created.
91   -- Default implementation will dynamically load image from specified path within this method
92   -- (and no copy will be preserved in this class instance).
93   -- Inheritors may dynamically generate the image or return cached instance.
94   -- @return the image for texture.
95
96   GetParams (me) returns TextureParams from Graphic3d;
97   ---Level: public
98   ---Purpose: @return low-level texture parameters
99   ---C++: return const &
100
101   TexturesFolder (myclass) returns AsciiString from TCollection;
102   ---Level   : Public
103   ---Purpose :
104   -- The path to textures determined from CSF_MDTVTexturesDirectory or CASROOT environment variables.
105   -- @return the root folder with default textures.
106
107 fields
108
109   myParams : TextureParams from Graphic3d is protected;
110   myTexId  : AsciiString from TCollection is protected;
111   myPath   : Path from OSD is protected;
112   myType   : TypeOfTexture from Graphic3d;
113
114 end TextureRoot;