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 _OSGSTATESORTTREEBUILDER_H_
40 #define _OSGSTATESORTTREEBUILDER_H_
45 //---------------------------------------------------------------------------
47 //---------------------------------------------------------------------------
51 #include "OSGHashSorter.h"
53 #include "OSGTreeBuilderBase.h"
57 //---------------------------------------------------------------------------
59 //---------------------------------------------------------------------------
61 //---------------------------------------------------------------------------
63 //---------------------------------------------------------------------------
65 //---------------------------------------------------------------------------
67 //---------------------------------------------------------------------------
70 /*! \brief StateSortTreeBuilder class
71 \ingroup GrpSystemRenderingBackendTreeBuild
72 \ingroup GrpLibOSGSystem
75 class OSG_SYSTEM_DLLMAPPING StateSortTreeBuilder
: public TreeBuilderBase
79 //-----------------------------------------------------------------------
81 //-----------------------------------------------------------------------
83 //-----------------------------------------------------------------------
85 //-----------------------------------------------------------------------
87 //-----------------------------------------------------------------------
89 //-----------------------------------------------------------------------
91 typedef TreeBuilderBase Inherited
;
93 //-----------------------------------------------------------------------
95 //-----------------------------------------------------------------------
97 //-----------------------------------------------------------------------
99 //-----------------------------------------------------------------------
101 //-----------------------------------------------------------------------
102 // instance functions
103 //-----------------------------------------------------------------------
105 StateSortTreeBuilder(void);
106 virtual ~StateSortTreeBuilder(void);
108 /*------------------------- your_category -------------------------------*/
110 /*------------------------- your_operators ------------------------------*/
112 /*------------------------- assignment ----------------------------------*/
114 virtual void setNodePool(RenderTreeNodePool
*pNodePool
);
116 /*------------------------- comparison ----------------------------------*/
118 virtual void reset(void);
120 /*------------------------- comparison ----------------------------------*/
122 virtual void add(RenderActionBase
*pAction
,
123 RenderPartitionBase
*pPart
,
124 DrawFunctor
&drawFunc
,
126 StateOverride
*pStateOverride
);
128 virtual void draw(DrawEnv
&denv
,
129 RenderPartitionBase
*part
);
131 /*-------------------------- comparison ---------------------------------*/
133 /*-------------------------- comparison ---------------------------------*/
137 //-----------------------------------------------------------------------
139 //-----------------------------------------------------------------------
141 //-----------------------------------------------------------------------
143 //-----------------------------------------------------------------------
145 typedef HashSorter Sorter
;
147 typedef std::map
<UInt32
, RenderTreeNode
*> MapSorter
;
148 typedef std::map
<UInt32
, RenderTreeNode
*>::iterator MapSorterIt
;
150 //-----------------------------------------------------------------------
152 //-----------------------------------------------------------------------
154 RenderTreeNode
*_pRoot
;
156 MapSorter _mFallbackSorter
;
158 //-----------------------------------------------------------------------
160 //-----------------------------------------------------------------------
162 //-----------------------------------------------------------------------
163 // instance variables
164 //-----------------------------------------------------------------------
166 //-----------------------------------------------------------------------
167 // instance functions
168 //-----------------------------------------------------------------------
172 //-----------------------------------------------------------------------
174 //-----------------------------------------------------------------------
176 //-----------------------------------------------------------------------
178 //-----------------------------------------------------------------------
180 //-----------------------------------------------------------------------
182 //-----------------------------------------------------------------------
184 //-----------------------------------------------------------------------
186 //-----------------------------------------------------------------------
188 //-----------------------------------------------------------------------
190 //-----------------------------------------------------------------------
192 //-----------------------------------------------------------------------
194 //-----------------------------------------------------------------------
196 //-----------------------------------------------------------------------
197 // instance variables
198 //-----------------------------------------------------------------------
200 //-----------------------------------------------------------------------
201 // instance functions
202 //-----------------------------------------------------------------------
204 /*!\brief prohibit default function (move to 'public' if needed) */
205 StateSortTreeBuilder(const StateSortTreeBuilder
&other
);
206 void operator =(const StateSortTreeBuilder
&source
);
209 //---------------------------------------------------------------------------
211 //---------------------------------------------------------------------------
215 #include "OSGStateSortTreeBuilder.inl"
217 #endif /* _OSGSTATESORTTREEBUILDER_H_ */