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

OSGRenderNode.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002  *                                OpenSG                                     *
00003  *                                                                           *
00004  *                                                                           *
00005  *           Copyright (C) 2000-2002,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 _CLUSTERNODE_H_
00040 #define _CLUSTERNODE_H_
00041 #ifdef __sgi
00042 #pragma once
00043 #endif
00044 
00045 #include <OSGSystemDef.h>
00046 #include <OSGBaseTypes.h>
00047 #include <OSGBinaryDataHandler.h>
00048 #include <OSGWindow.h>
00049 
00050 OSG_BEGIN_NAMESPACE
00051 
00052 class OSG_SYSTEMLIB_DLLMAPPING RenderNode 
00053 {
00054     /*==========================  PUBLIC  =================================*/
00055   public:
00056     /*---------------------------------------------------------------------*/
00060     RenderNode(           Real32  invisibleFaceCost = 1.0 /  15000000,
00061                           Real32  visibleFaceCost   = 1.0 /  10000000,
00062                           Real32  drawPixelCost     = 1.0 / 120000000,
00063                           Real32  readPixelCost     = 1.0 /  20000000,
00064                           Real32  writePixelCost    = 1.0 /  20000000,
00065                const std::string &vendor            = "Unknown",
00066                const std::string &renderer          = "Unknown");
00067     RenderNode(const RenderNode &source);
00068 
00070     /*---------------------------------------------------------------------*/
00074     virtual ~RenderNode(void);
00075 
00077     /*---------------------------------------------------------------------*/
00081     Real32      getVisibleFaceCost  (void) const;
00082     Real32      getInvisibleFaceCost(void) const;
00083     Real32      getDrawPixelCost    (void) const;
00084     Real32      getReadPixelCost    (void) const;
00085     Real32      getWritePixelCost   (void) const;
00086     std::string getVendor           (void) const;
00087     std::string getRenderer         (void) const;
00088 
00090     /*---------------------------------------------------------------------*/
00094     void setVisibleFaceCost  (           Real32      value);
00095     void setInvisibleFaceCost(           Real32      value);
00096     void setDrawPixelCost    (           Real32      value);
00097     void setReadPixelCost    (           Real32      value);
00098     void setWritePixelCost   (           Real32      value);
00099     void setGroup            (const      RenderNode *begin,
00100                               const      RenderNode *end);
00101     void setVendor           (const std::string     &value);
00102     void setRenderer         (const std::string     &value);
00103 
00105     /*---------------------------------------------------------------------*/
00109     void   determinePerformance(WindowPtr &prt           );
00110     Real32 estimatePerformance (Real32     invisibleFaces,
00111                                 Real32     visibleFaces,
00112                                 Real32     pixel         ) const;
00113     
00115     /*---------------------------------------------------------------------*/
00119     void copyToBin  (BinaryDataHandler &handle);
00120     void copyFromBin(BinaryDataHandler &handle);
00121 
00123     /*---------------------------------------------------------------------*/
00127     RenderNode & operator =(const RenderNode &source);
00128 
00130     /*---------------------------------------------------------------------*/
00134     void dump(void) const;
00135     
00137     /*=========================  PROTECTED  ===============================*/
00138   protected:
00139 
00140     /*---------------------------------------------------------------------*/
00144          Real32 _visibleFaceCost;
00145          Real32 _invisibleFaceCost;
00146          Real32 _drawPixelCost;
00147          Real32 _readPixelCost;
00148          Real32 _writePixelCost;
00149     std::string _vendor;
00150     std::string _renderer;
00151 
00153     /*---------------------------------------------------------------------*/
00157     double runFaceBench  ( float w,int size );
00158     double runRasterBench( void             );
00159 
00161     /*==========================  PRIVATE  ================================*/
00162   private:
00163     /*---------------------------------------------------------------------*/
00167     static RenderNode *_prefefined[];
00168 
00170 };
00171 
00172 OSG_END_NAMESPACE
00173 
00174 #define OSG_CLUSTERNODE_HEADER_CVSID "@(#)$Id:$"
00175 
00176 #include "OSGRenderNode.inl"
00177 
00178 #endif /* _CLUSTERNODE_H_ */
00179 
00180 
00181 
00182 

Generated on Thu Aug 25 04:09:07 2005 for OpenSG by  doxygen 1.4.3