0028832: MMgt_TShared can be replaced by Standard_Transient
[occt.git] / src / Vrml / Vrml_LOD.hxx
1 // Created on: 1997-02-10
2 // Created by: Alexander BRIVIN
3 // Copyright (c) 1997-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
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
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _Vrml_LOD_HeaderFile
18 #define _Vrml_LOD_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22
23 #include <TColStd_HArray1OfReal.hxx>
24 #include <gp_Vec.hxx>
25 #include <Standard_Boolean.hxx>
26 #include <Standard_Transient.hxx>
27 #include <Standard_OStream.hxx>
28 class gp_Vec;
29
30
31 class Vrml_LOD;
32 DEFINE_STANDARD_HANDLE(Vrml_LOD, Standard_Transient)
33
34 //! defines a LOD (level of detailization) node of VRML specifying properties
35 //! of geometry  and its appearance.
36 //! This  group  node  is  used  to  allow  applications  to  switch  between
37 //! various  representations  of  objects  automatically. The  children  of  this
38 //! node  typically  represent  the  same  object  or  objects  at  the  varying
39 //! of  Levels  Of  Detail  (LOD),  from  highest  detail  to  lowest.
40 //!
41 //! The  specified  center  point  of  the  LOD  is  transformed  by  current
42 //! transformation  into  world  space,  and  yhe  distancefrom  the  transformed
43 //! center  to  the  world-space  eye  point  is  calculated.
44 //! If  thedistance  is  less  than  the  first  value  in  the  ranges  array,
45 //! than  the  first  child  of  the  LOD  group  is  drawn.  If  between
46 //! the  first  and  second  values  in  the  range  array,  the  second  child
47 //! is  drawn,  etc.
48 //! If  there  are  N  values  in  the  range  array,  the  LOD  group  should
49 //! have  N+1  children.
50 //! Specifying  too  few  children  will  result  in  the  last  child  being
51 //! used  repeatedly  for  the  lowest  lewels  of  detail;  if  too  many  children
52 //! are  specified,  the  extra  children  w ll  be  ignored.
53 //! Each  value  in  the  ranges  array  should  be  greater  than  the previous
54 //! value,  otherwise  results  are  undefined.
55 class Vrml_LOD : public Standard_Transient
56 {
57
58 public:
59
60   
61   Standard_EXPORT Vrml_LOD();
62   
63   Standard_EXPORT Vrml_LOD(const Handle(TColStd_HArray1OfReal)& aRange, const gp_Vec& aCenter);
64   
65   Standard_EXPORT void SetRange (const Handle(TColStd_HArray1OfReal)& aRange);
66   
67   Standard_EXPORT Handle(TColStd_HArray1OfReal) Range() const;
68   
69   Standard_EXPORT void SetCenter (const gp_Vec& aCenter);
70   
71   Standard_EXPORT gp_Vec Center() const;
72   
73   Standard_EXPORT Standard_OStream& Print (Standard_OStream& anOStream) const;
74
75
76
77
78   DEFINE_STANDARD_RTTIEXT(Vrml_LOD,Standard_Transient)
79
80 protected:
81
82
83
84
85 private:
86
87
88   Handle(TColStd_HArray1OfReal) myRange;
89   gp_Vec myCenter;
90   Standard_Boolean myRangeFlag;
91
92
93 };
94
95
96
97
98
99
100
101 #endif // _Vrml_LOD_HeaderFile