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
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.
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.
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.
21 deferred class TextureRoot from Graphic3d
23 inherits TShared from MMgt
25 ---Purpose: This is the texture root class enable the dialog with the GraphicDriver
26 -- allows the loading of texture.
30 CInitTexture from Graphic3d,
31 GraphicDriver from Graphic3d,
32 StructureManager from Graphic3d,
33 TypeOfTexture from Graphic3d,
36 HArray1OfReal from TColStd
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.
55 IsDone (me) returns Boolean from Standard;
57 ---Purpose: Checks if a texture class is valid or not
58 -- returns true if the construction of the class is correct
60 IsValid (me) returns Boolean from Standard;
62 ---Purpose: Checks if a texture class is valid or not
63 -- returns true if the construction of the class is correct
65 Path (me) returns Path from OSD;
68 -- Returns the full path of the defined texture.
69 ---C++: return const &
71 Type (me) returns TypeOfTexture from Graphic3d;
74 -- Returns the texture type.
76 LoadTexture (me : mutable; theImage : PixMap from Image) returns Boolean from Standard;
79 -- Updates the current texture from a requested image.
81 TextureId (me) returns Integer from Standard;
84 -- returns the Texture ID which references the
85 -- texture to use for drawing. Used by the graphic driver.
87 GetTexUpperBounds(me) returns HArray1OfReal from TColStd;
90 ---Gets upper bounds of texture coordinates. This is used when sizes
91 ---of texture are not equal to the powers of two
97 Update (me) is protected;
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;