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 _OSGSORTLASTWINDOW_H_
40 #define _OSGSORTLASTWINDOW_H_
49 #include "OSGSortLastWindowBase.h"
53 /*! \ingroup GrpClusterWindowObj
54 \ingroup GrpLibOSGCluster
58 class OSG_CLUSTER_DLLMAPPING SortLastWindow
: public SortLastWindowBase
62 typedef SortLastWindowBase Inherited
;
64 /*========================== PUBLIC =================================*/
70 BALANCE_GEOMETRY_STATIC
=0,
71 BALANCE_GEOMETRY_VIEW_DEOENDENT
=1,
72 BALANCE_PROXYGROUPS
=2
75 /*---------------------------------------------------------------------*/
79 virtual void changed(ConstFieldMaskArg whichField
,
84 /*---------------------------------------------------------------------*/
88 virtual void dump( UInt32 uiIndent
= 0,
89 const BitVector bvFlags
= 0) const;
92 /*---------------------------------------------------------------------*/
93 /*! \name static partition functions */
96 virtual void buildGroups(void);
99 /*========================= PROTECTED ===============================*/
114 DrawableInfo(const DrawableInfo
&source
);
116 const DrawableInfo
&operator =(const DrawableInfo
&source
);
121 struct MaxXOrder
: public std::binary_function
<const DrawableInfo
&,
122 const DrawableInfo
&,
125 bool operator() (const DrawableInfo
&a
, const DrawableInfo
&b
);
131 struct MaxYOrder
: public std::binary_function
<const DrawableInfo
&,
132 const DrawableInfo
&,
135 bool operator() (const DrawableInfo
&a
, const DrawableInfo
&b
);
141 struct MaxZOrder
: public std::binary_function
<const DrawableInfo
&,
142 const DrawableInfo
&,
145 bool operator() (const DrawableInfo
&a
, const DrawableInfo
&b
);
149 typedef std::vector
<DrawableInfo
> DrawableListT
;
151 friend struct DrawableInfo
;
153 /*---------------------------------------------------------------------*/
154 /*! \name protected types */
158 /*---------------------------------------------------------------------*/
159 /*! \name client window funcitons */
162 virtual void clientInit (void );
163 virtual void clientPreSync(void );
164 #ifdef OSG_OLD_RENDER_ACTION
165 virtual void clientRender (DrawActionBase
*action
);
167 virtual void clientRender (RenderActionBase
*action
);
169 virtual void clientSwap (void );
172 /*---------------------------------------------------------------------*/
173 /*! \name server window funcitons */
176 virtual void serverInit (Window
*window
,
178 #ifdef OSG_OLD_RENDER_ACTION
179 virtual void serverRender(WindowPtr window
,
181 DrawActionBase
*action
);
184 virtual void serverRender(Window
*window
,
186 RenderActionBase
*action
);
188 virtual void serverSwap (Window
*window
,
192 /*---------------------------------------------------------------------*/
193 /*! \name Constructors */
196 SortLastWindow(void);
197 SortLastWindow(const SortLastWindow
&source
);
200 /*---------------------------------------------------------------------*/
201 /*! \name Destructors */
204 virtual ~SortLastWindow(void);
207 /*---------------------------------------------------------------------*/
208 /*! \name load balancing */
211 void collectDrawables(Node
* const node
,
212 DrawableListT
& drawables
);
213 void splitDrawables (DrawableListT
& src
,
216 void setupNodes (UInt32 groupId
);
219 /*---------------------------------------------------------------------*/
223 static void initMethod(InitPhase ePhase
);
226 /*========================== 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
;
241 #include "OSGSortLastWindowBase.inl"
242 #include "OSGSortLastWindow.inl"
244 #endif /* _OSGSORTLASTWINDOW_H_ */