1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2002 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
37 \*---------------------------------------------------------------------------*/
39 #ifndef _OSG_TILE_GEOMETRY_LOAD_H_
40 #define _OSG_TILE_GEOMETRY_LOAD_H_
45 #include "OSGClusterDef.h"
46 #include "OSGGeometry.h"
47 #include "OSGCamera.h"
48 #include "OSGViewport.h"
54 #define FACE_DISTRIBUTION_SAMPLING_COUNT 8
56 /*! \ingroup GrpClusterWindowBalancer
57 \ingroup GrpLibOSGCluster
61 class OSG_CLUSTER_DLLMAPPING TileGeometryLoad
63 /*========================== PUBLIC =================================*/
67 /*---------------------------------------------------------------------*/
68 /*! \name Constructors */
71 TileGeometryLoad(UInt32 nodeId
,bool useFaceDistribution
=false);
72 TileGeometryLoad(const TileGeometryLoad
&source
);
75 /*---------------------------------------------------------------------*/
76 /*! \name Destructor */
79 virtual ~TileGeometryLoad(void);
82 /*---------------------------------------------------------------------*/
83 /*! \name load calculation */
86 void updateView ( Matrix
&viewing
,
91 void updateGeometry ( );
92 bool checkRegion ( Int32 min
[2],
94 bool isVisible ( ) const;
97 /*---------------------------------------------------------------------*/
101 void setValid(bool s
);
104 /*---------------------------------------------------------------------*/
108 Node
* getNode() const;
109 const Int32
* getMin();
110 const Int32
* getMax();
112 Real32
getVisibleFraction( const Int32 wmin
[2],
116 bool getVisibleArea ( const Int32 wmin
[2],
121 bool isInvalid(void);
124 /*---------------------------------------------------------------------*/
125 /*! \name your_operators */
129 /*---------------------------------------------------------------------*/
130 /*! \name Assignment */
133 TileGeometryLoad
& operator = (const TileGeometryLoad
&source
);
136 /*---------------------------------------------------------------------*/
137 /*! \name Comparison */
140 bool operator < (const TileGeometryLoad
&other
) const;
141 //bool operator == (const TileGeometryLoad &other) const;
142 //bool operator != (const TileGeometryLoad &other) const;
145 /*---------------------------------------------------------------------*/
152 /*========================= PROTECTED ===============================*/
156 /*---------------------------------------------------------------------*/
157 /*! \name utilities */
160 Real32
getFaceDistribution(UInt32 dir
,Real32 cut
);
164 /*---------------------------------------------------------------------*/
173 std::vector
<std::vector
<Real32
> > _faceDistribution
;
174 UInt32 _faceDistDirX
;
175 UInt32 _faceDistDirY
;
177 bool _useFaceDistribution
;
183 /*---------------------------------------------------------------------*/
184 /*! \name static elements */
187 static std::vector
<Plane
> _directions
;
191 /*========================== PRIVATE ================================*/
198 #include "OSGTileGeometryLoad.inl"
200 #endif /* OSG_TILE_GEOMETRY_LOAD_H */