b311480e |
1 | -- Created on: 1997-02-10 |
2 | -- Created by: Alexander BRIVIN |
3 | -- Copyright (c) 1997-1999 Matra Datavision |
973c2be1 |
4 | -- Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | -- |
973c2be1 |
6 | -- This file is part of Open CASCADE Technology software library. |
b311480e |
7 | -- |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
13 | -- |
973c2be1 |
14 | -- Alternatively, this file may be used under the terms of Open CASCADE |
15 | -- commercial license or contractual agreement. |
7fd59977 |
16 | |
17 | class LOD from Vrml inherits TShared from MMgt |
18 | |
19 | ---Purpose: defines a LOD (level of detailization) node of VRML specifying properties |
20 | -- of geometry and its appearance. |
21 | -- This group node is used to allow applications to switch between |
22 | -- various representations of objects automatically. The children of this |
23 | -- node typically represent the same object or objects at the varying |
24 | -- of Levels Of Detail (LOD), from highest detail to lowest. |
25 | -- |
26 | -- The specified center point of the LOD is transformed by current |
27 | -- transformation into world space, and yhe distancefrom the transformed |
28 | -- center to the world-space eye point is calculated. |
29 | -- If thedistance is less than the first value in the ranges array, |
30 | -- than the first child of the LOD group is drawn. If between |
31 | -- the first and second values in the range array, the second child |
32 | -- is drawn, etc. |
33 | -- If there are N values in the range array, the LOD group should |
34 | -- have N+1 children. |
35 | -- Specifying too few children will result in the last child being |
36 | -- used repeatedly for the lowest lewels of detail; if too many children |
37 | -- are specified, the extra children w ll be ignored. |
38 | -- Each value in the ranges array should be greater than the previous |
39 | -- value, otherwise results are undefined. |
40 | |
41 | uses |
42 | |
43 | HArray1OfReal from TColStd, |
44 | Vec from gp |
45 | |
46 | is |
47 | |
6e33d3ce |
48 | Create returns LOD from Vrml; |
7fd59977 |
49 | |
50 | Create ( aRange : HArray1OfReal from TColStd; |
51 | aCenter : Vec from gp ) |
6e33d3ce |
52 | returns LOD from Vrml; |
7fd59977 |
53 | |
54 | SetRange ( me : mutable; aRange : HArray1OfReal from TColStd ); |
55 | Range ( me ) returns HArray1OfReal from TColStd; |
56 | |
57 | SetCenter ( me : mutable; aCenter : Vec from gp ); |
58 | Center ( me ) returns Vec from gp; |
59 | |
60 | Print ( me; anOStream: in out OStream from Standard) returns OStream from Standard; |
61 | ---C++: return & |
62 | |
63 | fields |
64 | |
65 | myRange : HArray1OfReal from TColStd; -- Distance ranges for LOD switching |
66 | myCenter : Vec from gp; -- Center for distance computation |
67 | myRangeFlag : Boolean from Standard; |
68 | |
69 | end LOD; |
70 | |