changed: gcc8 base update
[opensg.git] / Source / System / Cluster / Window / SortLast / OSGSortLastWindow.h
blob007fb4159279c29d5b572103662b87c9477ab49b
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 _OSGSORTLASTWINDOW_H_
40 #define _OSGSORTLASTWINDOW_H_
41 #ifdef __sgi
42 #pragma once
43 #endif
45 #include <utility>
46 #include <vector>
47 #include <queue>
49 #include "OSGSortLastWindowBase.h"
51 OSG_BEGIN_NAMESPACE
53 /*! \ingroup GrpClusterWindowObj
54 \ingroup GrpLibOSGCluster
55 \includebasedoc
58 class OSG_CLUSTER_DLLMAPPING SortLastWindow : public SortLastWindowBase
60 private:
62 typedef SortLastWindowBase Inherited;
64 /*========================== PUBLIC =================================*/
66 public:
68 enum
70 BALANCE_GEOMETRY_STATIC =0,
71 BALANCE_GEOMETRY_VIEW_DEOENDENT =1,
72 BALANCE_PROXYGROUPS =2
75 /*---------------------------------------------------------------------*/
76 /*! \name Sync */
77 /*! \{ */
79 virtual void changed(ConstFieldMaskArg whichField,
80 UInt32 origin,
81 BitVector detail);
83 /*! \} */
84 /*---------------------------------------------------------------------*/
85 /*! \name Output */
86 /*! \{ */
88 virtual void dump( UInt32 uiIndent = 0,
89 const BitVector bvFlags = 0) const;
91 /*! \} */
92 /*---------------------------------------------------------------------*/
93 /*! \name static partition functions */
94 /*! \{ */
96 virtual void buildGroups(void);
98 /*! \} */
99 /*========================= PROTECTED ===============================*/
101 protected:
103 /*! \nohierarchy
106 struct DrawableInfo
108 Node *node;
109 Vec3f bMin;
110 Vec3f bMax;
111 Real32 load;
113 DrawableInfo();
114 DrawableInfo(const DrawableInfo &source);
116 const DrawableInfo &operator =(const DrawableInfo &source);
118 /*! \nohierarchy
121 struct MaxXOrder : public std::binary_function<const DrawableInfo &,
122 const DrawableInfo &,
123 bool >
125 bool operator() (const DrawableInfo &a, const DrawableInfo &b);
128 /*! \nohierarchy
131 struct MaxYOrder : public std::binary_function<const DrawableInfo &,
132 const DrawableInfo &,
133 bool >
135 bool operator() (const DrawableInfo &a, const DrawableInfo &b);
138 /*! \nohierarchy
141 struct MaxZOrder : public std::binary_function<const DrawableInfo &,
142 const DrawableInfo &,
143 bool >
145 bool operator() (const DrawableInfo &a, const DrawableInfo &b);
149 typedef std::vector<DrawableInfo> DrawableListT;
151 friend struct DrawableInfo;
153 /*---------------------------------------------------------------------*/
154 /*! \name protected types */
155 /*! \{ */
157 /*! \} */
158 /*---------------------------------------------------------------------*/
159 /*! \name client window funcitons */
160 /*! \{ */
162 virtual void clientInit (void );
163 virtual void clientPreSync(void );
164 #ifdef OSG_OLD_RENDER_ACTION
165 virtual void clientRender (DrawActionBase *action);
166 #endif
167 virtual void clientRender (RenderActionBase *action);
169 virtual void clientSwap (void );
171 /*! \} */
172 /*---------------------------------------------------------------------*/
173 /*! \name server window funcitons */
174 /*! \{ */
176 virtual void serverInit (Window *window,
177 UInt32 id );
178 #ifdef OSG_OLD_RENDER_ACTION
179 virtual void serverRender(WindowPtr window,
180 UInt32 id,
181 DrawActionBase *action);
182 #endif
184 virtual void serverRender(Window *window,
185 UInt32 id,
186 RenderActionBase *action);
188 virtual void serverSwap (Window *window,
189 UInt32 id );
191 /*! \} */
192 /*---------------------------------------------------------------------*/
193 /*! \name Constructors */
194 /*! \{ */
196 SortLastWindow(void);
197 SortLastWindow(const SortLastWindow &source);
199 /*! \} */
200 /*---------------------------------------------------------------------*/
201 /*! \name Destructors */
202 /*! \{ */
204 virtual ~SortLastWindow(void);
206 /*! \} */
207 /*---------------------------------------------------------------------*/
208 /*! \name load balancing */
209 /*! \{ */
211 void collectDrawables(Node * const node,
212 DrawableListT & drawables );
213 void splitDrawables (DrawableListT & src,
214 UInt32 groups,
215 bool cut = false);
216 void setupNodes (UInt32 groupId );
218 /*! \} */
219 /*---------------------------------------------------------------------*/
220 /*! \name Init */
221 /*! \{ */
223 static void initMethod(InitPhase ePhase);
225 /*! \} */
226 /*========================== PRIVATE ================================*/
228 private:
230 friend class FieldContainer;
231 friend class SortLastWindowBase;
233 // prohibit default functions (move to 'public' if you need one)
234 void operator =(const SortLastWindow &source);
237 typedef SortLastWindow *SortLastWindowP;
239 OSG_END_NAMESPACE
241 #include "OSGSortLastWindowBase.inl"
242 #include "OSGSortLastWindow.inl"
244 #endif /* _OSGSORTLASTWINDOW_H_ */