00001 /*---------------------------------------------------------------------------*\ 00002 * OpenSG * 00003 * * 00004 * * 00005 * Copyright (C) 2000-2002 by the OpenSG Forum * 00006 * * 00007 * www.opensg.org * 00008 * * 00009 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de * 00010 * * 00011 \*---------------------------------------------------------------------------*/ 00012 /*---------------------------------------------------------------------------*\ 00013 * License * 00014 * * 00015 * This library is free software; you can redistribute it and/or modify it * 00016 * under the terms of the GNU Library General Public License as published * 00017 * by the Free Software Foundation, version 2. * 00018 * * 00019 * This library is distributed in the hope that it will be useful, but * 00020 * WITHOUT ANY WARRANTY; without even the implied warranty of * 00021 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00022 * Library General Public License for more details. * 00023 * * 00024 * You should have received a copy of the GNU Library General Public * 00025 * License along with this library; if not, write to the Free Software * 00026 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * 00027 * * 00028 \*---------------------------------------------------------------------------*/ 00029 /*---------------------------------------------------------------------------*\ 00030 * Changes * 00031 * * 00032 * * 00033 * * 00034 * * 00035 * * 00036 * * 00037 \*---------------------------------------------------------------------------*/ 00038 00039 #ifndef _OSG_TILE_GEOMETRY_LOAD_H_ 00040 #define _OSG_TILE_GEOMETRY_LOAD_H_ 00041 #ifdef __sgi 00042 #pragma once 00043 #endif 00044 00045 #include <OSGBaseTypes.h> 00046 #include <OSGSystemDef.h> 00047 #include <OSGGeometry.h> 00048 #include <OSGCamera.h> 00049 #include <OSGViewport.h> 00050 00051 #include <vector> 00052 00053 OSG_BEGIN_NAMESPACE 00054 00055 #define FACE_DISTRIBUTION_SAMPLING_COUNT 8 00056 00057 class OSG_SYSTEMLIB_DLLMAPPING TileGeometryLoad 00058 { 00059 /*========================== PUBLIC =================================*/ 00060 public: 00061 00062 /*---------------------------------------------------------------------*/ 00066 TileGeometryLoad(UInt32 nodeId,bool useFaceDistribution=false); 00067 TileGeometryLoad(const TileGeometryLoad &source); 00068 00070 /*---------------------------------------------------------------------*/ 00074 virtual ~TileGeometryLoad(void); 00075 00077 /*---------------------------------------------------------------------*/ 00081 void updateView ( Matrix &viewing, 00082 Matrix &projection, 00083 Real32 near, 00084 UInt32 width, 00085 UInt32 height ); 00086 void updateGeometry ( ); 00087 bool checkRegion ( Int32 min[2], 00088 Int32 max[2] ); 00089 bool isVisible ( ) const; 00090 00092 /*---------------------------------------------------------------------*/ 00096 void setValid(bool s); 00097 00099 /*---------------------------------------------------------------------*/ 00103 NodePtr getNode() const; 00104 const Int32 * getMin(); 00105 const Int32 * getMax(); 00106 UInt32 getFaces(); 00107 Real32 getVisibleFraction( const Int32 wmin[2], 00108 const Int32 wmax[2], 00109 Int32 viswmin[2], 00110 Int32 viswmax[2] ); 00111 bool getVisibleArea ( const Int32 wmin[2], 00112 const Int32 wmax[2], 00113 Int32 viswmin[2], 00114 Int32 viswmax[2] ); 00115 00116 bool isInvalid(void); 00117 00119 /*---------------------------------------------------------------------*/ 00124 /*---------------------------------------------------------------------*/ 00128 TileGeometryLoad& operator = (const TileGeometryLoad &source); 00129 00131 /*---------------------------------------------------------------------*/ 00135 bool operator < (const TileGeometryLoad &other) const; 00136 //bool operator == (const TileGeometryLoad &other) const; 00137 //bool operator != (const TileGeometryLoad &other) const; 00138 00140 /*---------------------------------------------------------------------*/ 00144 void dump(void); 00145 00147 /*========================= PROTECTED ===============================*/ 00148 protected: 00149 00150 /*---------------------------------------------------------------------*/ 00154 Real32 getFaceDistribution(UInt32 dir,Real32 cut); 00155 00158 /*---------------------------------------------------------------------*/ 00162 UInt32 _nodeId; 00163 GeometryPtr _geometry; 00164 UInt32 _faces; 00165 Int32 _min[2]; 00166 Int32 _max[2]; 00167 std::vector<std::vector<Real32> > _faceDistribution; 00168 UInt32 _faceDistDirX; 00169 UInt32 _faceDistDirY; 00170 bool _visible; 00171 bool _useFaceDistribution; 00172 Real32 _areaSize; 00173 bool _valid; 00174 00177 /*---------------------------------------------------------------------*/ 00181 static std::vector<Plane> _directions; 00182 00185 /*========================== PRIVATE ================================*/ 00186 private: 00187 00188 }; 00189 00190 OSG_END_NAMESPACE 00191 00192 #include <OSGTileGeometryLoad.inl> 00193 00194 #define OSGTILEGEOMETRYLOAD_HEADER_CVSID "@(#)$Id:$" 00195 00196 #endif /* OSG_TILE_GEOMETRY_LOAD_H */
1.5.5