0022591: Migration to FreeImage: texture management
[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 
26     -- allows the loading of texture.
27
28 uses
29
30     CInitTexture     from Graphic3d,
31     GraphicDriver    from Graphic3d,
32     StructureManager from Graphic3d,
33     TypeOfTexture    from Graphic3d,
34     PixMap           from Image,
35     Path             from OSD,
36     HArray1OfReal    from TColStd
37
38 is
39
40     Initialize (theSM       :  StructureManager from Graphic3d;
41                 thePath     :  CString from Standard;
42                 theFileName :  CString from Standard;
43                 theType     :  TypeOfTexture from Graphic3d);
44     ---Purpose: Creates a texture from a file          
45     --  Warning: Note that if <FileName> is NULL the texture must be realized
46     -- using LoadTexture(image) method.
47
48     Destroy (me);
49     ---C++ : alias ~
50
51     --
52     -- public methods
53     --
54
55     IsDone (me) returns Boolean from Standard;
56     ---Level: public
57     ---Purpose: Checks if a texture class is valid or not
58     -- returns true if the construction of the class is correct
59
60     IsValid (me) returns Boolean from Standard;
61     ---Level: public
62     ---Purpose: Checks if a texture class is valid or not
63     -- returns true if the construction of the class is correct
64
65     Path (me) returns Path from OSD;
66     ---Level: public
67     ---Purpose:
68     -- Returns the full path of the defined texture.
69     ---C++: return const &
70
71     Type (me) returns TypeOfTexture from Graphic3d;
72     ---Level: public
73     ---Purpose:
74     -- Returns the texture type.
75
76     LoadTexture (me : mutable; theImage : PixMap from Image) returns Boolean from Standard;
77     ---Level: advanced
78     ---Purpose:
79     -- Updates the current texture from a requested image.
80
81     TextureId (me) returns Integer from Standard;
82     ---Level: advanced
83     ---Purpose:
84     -- returns the Texture ID which references the
85     -- texture to use for drawing. Used by the graphic driver.
86
87     GetTexUpperBounds(me) returns HArray1OfReal from TColStd;
88     ---Level: advanced
89     ---Purpose:
90     ---Gets upper bounds of texture coordinates. This is used when sizes
91     ---of texture are not equal to the powers of two
92
93     --
94     -- private methods
95     --
96
97     Update (me) is protected;
98
99 fields
100
101     myGraphicDriver  : GraphicDriver from Graphic3d;
102     myTexId          : Integer from Standard;
103     MyCInitTexture   : CInitTexture from Graphic3d is protected;
104     myPath           : Path from OSD;
105     myType           : TypeOfTexture from Graphic3d;
106     myTexUpperBounds : HArray1OfReal from TColStd;
107
108 end TextureRoot;