fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / Cluster / Base / OSGRenderNode.inl
blob1da05074d586419d4abd3154b00d72f28e4356b9
1 /*---------------------------------------------------------------------------*\
2  *                                OpenSG                                     *
3  *                                                                           *
4  *                                                                           *
5  *           Copyright (C) 2000-2002,2002 by the OpenSG Forum                *
6  *                                                                           *
7  *                            www.opensg.org                                 *
8  *                                                                           *
9  *   contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de          *
10  *                                                                           *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
13  *                                License                                    *
14  *                                                                           *
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.                               *
18  *                                                                           *
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.                          *
23  *                                                                           *
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.                 *
27  *                                                                           *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
30  *                                Changes                                    *
31  *                                                                           *
32  *                                                                           *
33  *                                                                           *
34  *                                                                           *
35  *                                                                           *
36  *                                                                           *
37 \*---------------------------------------------------------------------------*/
39 OSG_BEGIN_NAMESPACE
41 inline 
42 Real32 RenderNode::getVisibleFaceCost(void) const
44     return _visibleFaceCost;
47 inline 
48 Real32 RenderNode::getInvisibleFaceCost(void) const
50     return _invisibleFaceCost;
53 inline 
54 Real32 RenderNode::getDrawPixelCost(void) const
56     return _drawPixelCost;
59 inline 
60 Real32 RenderNode::getReadPixelCost(void) const
62     return _readPixelCost;
65 inline 
66 Real32 RenderNode::getWritePixelCost(void) const
68     return _writePixelCost;
71 inline 
72 std::string RenderNode::getVendor(void) const
74     return _vendor;
77 inline 
78 std::string RenderNode::getRenderer(void) const
80     return _renderer;
83 inline 
84 void RenderNode::setVisibleFaceCost(Real32 value)
86     _visibleFaceCost=value;
89 inline 
90 void RenderNode::setInvisibleFaceCost(Real32 value)
92     _invisibleFaceCost=value;
95 inline 
96 void RenderNode::setDrawPixelCost(Real32 value)
98     _drawPixelCost=value;
101 inline 
102 void RenderNode::setReadPixelCost(Real32 value)
104     _readPixelCost=value;
107 inline 
108 void RenderNode::setWritePixelCost(Real32 value)
110     _writePixelCost=value;
113 /*! set vendor string of the graphics board
114  */
116 inline 
117 void RenderNode::setVendor(const std::string &value)
119     _vendor=value;
122 /*! set renderer string of the graphics board
123  */
125 inline 
126 void RenderNode::setRenderer(const std::string &value)
128     _renderer=value;
131 /*! Estimate rendering performance. Facesetup end rasterisation is done
132  *  in parallel on most hardware plattforms. So we use the maximum of 
133  *  face cost and rasterisation cost.
134  */
135 inline 
136 Real32 RenderNode::estimatePerformance(Real32 invisibleFaces,
137                                        Real32 visibleFaces,
138                                        Real32 pixel         ) const
140     return 
141         ( invisibleFaces * _invisibleFaceCost ) +
142         osgMax( ( visibleFaces   * _visibleFaceCost   ), 
143                 ( pixel          * _drawPixelCost     ) );
146 OSG_END_NAMESPACE