Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

OSGTileGeometryLoad.h

Go to the documentation of this file.
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(NodePtr node,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     /*---------------------------------------------------------------------*/
00097     /*---------------------------------------------------------------------*/
00101     NodePtr           getNode() const;
00102     const Int32 *     getMin();
00103     const Int32 *     getMax();
00104     UInt32            getFaces();
00105     Real32            getVisibleFraction( const Int32 wmin[2],
00106                                           const Int32 wmax[2],
00107                                                 Int32 viswmin[2],
00108                                                 Int32 viswmax[2] );
00109     bool              getVisibleArea    ( const Int32 wmin[2],
00110                                           const Int32 wmax[2],
00111                                                 Int32 viswmin[2],
00112                                                 Int32 viswmax[2] );
00113 
00115     /*---------------------------------------------------------------------*/
00120     /*---------------------------------------------------------------------*/
00124     TileGeometryLoad& operator = (const TileGeometryLoad &source);
00125 
00127     /*---------------------------------------------------------------------*/
00131     bool operator < (const TileGeometryLoad &other) const;
00132     //bool operator == (const TileGeometryLoad &other) const;
00133     //bool operator != (const TileGeometryLoad &other) const;
00134 
00136     /*---------------------------------------------------------------------*/
00140     void dump(void);
00141 
00143     /*=========================  PROTECTED  ===============================*/
00144   protected:
00145 
00146     /*---------------------------------------------------------------------*/
00150     Real32 getFaceDistribution(UInt32 dir,Real32 cut);
00151 
00154     /*---------------------------------------------------------------------*/
00158     NodePtr                            _node;
00159     GeometryPtr                        _geometry;
00160     UInt32                             _faces;
00161     Int32                              _min[2];
00162     Int32                              _max[2];
00163     std::vector<std::vector<Real32> >  _faceDistribution;
00164     UInt32                             _faceDistDirX;
00165     UInt32                             _faceDistDirY;
00166     bool                               _visible;
00167     bool                               _useFaceDistribution;
00168     Real32                             _areaSize;
00169 
00172     /*---------------------------------------------------------------------*/
00176     static std::vector<Plane>    _directions;
00177 
00180     /*==========================  PRIVATE  ================================*/
00181   private:
00182 
00183 };
00184 
00185 OSG_END_NAMESPACE
00186 
00187 #include <OSGTileGeometryLoad.inl>
00188 
00189 #define OSGTILEGEOMETRYLOAD_HEADER_CVSID "@(#)$Id:$"
00190 
00191 #endif /* OSG_TILE_GEOMETRY_LOAD_H */

Generated on Thu Aug 25 04:11:43 2005 for OpenSG by  doxygen 1.4.3