fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / RenderingBackend / OSGStateSortTreeBuilder.h
bloba006d13d2294ca882bc6be76053f35020c77fb40
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-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 #ifndef _OSGSTATESORTTREEBUILDER_H_
40 #define _OSGSTATESORTTREEBUILDER_H_
41 #ifdef __sgi
42 #pragma once
43 #endif
45 //---------------------------------------------------------------------------
46 // Includes
47 //---------------------------------------------------------------------------
49 #include <map>
51 #include "OSGHashSorter.h"
53 #include "OSGTreeBuilderBase.h"
55 OSG_BEGIN_NAMESPACE
57 //---------------------------------------------------------------------------
58 // Forward References
59 //---------------------------------------------------------------------------
61 //---------------------------------------------------------------------------
62 // Types
63 //---------------------------------------------------------------------------
65 //---------------------------------------------------------------------------
66 // Class
67 //---------------------------------------------------------------------------
70 /*! \brief StateSortTreeBuilder class
71 \ingroup GrpSystemRenderingBackendTreeBuild
72 \ingroup GrpLibOSGSystem
75 class OSG_SYSTEM_DLLMAPPING StateSortTreeBuilder : public TreeBuilderBase
77 public:
79 //-----------------------------------------------------------------------
80 // constants
81 //-----------------------------------------------------------------------
83 //-----------------------------------------------------------------------
84 // enums
85 //-----------------------------------------------------------------------
87 //-----------------------------------------------------------------------
88 // types
89 //-----------------------------------------------------------------------
91 typedef TreeBuilderBase Inherited;
93 //-----------------------------------------------------------------------
94 // class functions
95 //-----------------------------------------------------------------------
97 //-----------------------------------------------------------------------
98 // class functions
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,
125 State *pState,
126 StateOverride *pStateOverride);
128 virtual void draw(DrawEnv &denv,
129 RenderPartitionBase *part);
131 /*-------------------------- comparison ---------------------------------*/
133 /*-------------------------- comparison ---------------------------------*/
135 protected:
137 //-----------------------------------------------------------------------
138 // enums
139 //-----------------------------------------------------------------------
141 //-----------------------------------------------------------------------
142 // types
143 //-----------------------------------------------------------------------
145 typedef HashSorter Sorter;
147 typedef std::map<UInt32 , RenderTreeNode *> MapSorter;
148 typedef std::map<UInt32 , RenderTreeNode *>::iterator MapSorterIt;
150 //-----------------------------------------------------------------------
151 // class variables
152 //-----------------------------------------------------------------------
154 RenderTreeNode *_pRoot;
155 Sorter _oSorter;
156 MapSorter _mFallbackSorter;
158 //-----------------------------------------------------------------------
159 // class functions
160 //-----------------------------------------------------------------------
162 //-----------------------------------------------------------------------
163 // instance variables
164 //-----------------------------------------------------------------------
166 //-----------------------------------------------------------------------
167 // instance functions
168 //-----------------------------------------------------------------------
170 private:
172 //-----------------------------------------------------------------------
173 // enums
174 //-----------------------------------------------------------------------
176 //-----------------------------------------------------------------------
177 // types
178 //-----------------------------------------------------------------------
180 //-----------------------------------------------------------------------
181 // friend classes
182 //-----------------------------------------------------------------------
184 //-----------------------------------------------------------------------
185 // friend functions
186 //-----------------------------------------------------------------------
188 //-----------------------------------------------------------------------
189 // class variables
190 //-----------------------------------------------------------------------
192 //-----------------------------------------------------------------------
193 // class functions
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 //---------------------------------------------------------------------------
210 // Exported Types
211 //---------------------------------------------------------------------------
213 OSG_END_NAMESPACE
215 #include "OSGStateSortTreeBuilder.inl"
217 #endif /* _OSGSTATESORTTREEBUILDER_H_ */