changed: gcc8 base update
[opensg.git] / Source / System / Cluster / Window / SortLast / OSGParallelComposer.h
blobb71852a37458773eb65a9687209ed14a34b656fa
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 _OSGPARALLELCOMPOSER_H_
40 #define _OSGPARALLELCOMPOSER_H_
41 #ifdef __sgi
42 #pragma once
43 #endif
45 #include "OSGParallelComposerBase.h"
48 #ifdef OSG_WITH_PARALLEL
49 #include <cei_pc.h>
50 #endif
52 #ifndef WIN32
53 #include <unistd.h>
54 #else
55 #include <windows.h>
56 #endif
58 OSG_BEGIN_NAMESPACE
60 /*! \brief ParallelComposer class. See \ref
61 PageSystemParallelComposer for a description.
63 \ingroup GrpClusterWindowComposer
64 \ingroup GrpLibOSGCluster
65 \includebasedoc
68 class OSG_CLUSTER_DLLMAPPING ParallelComposer : public ParallelComposerBase
70 private:
72 typedef ParallelComposerBase Inherited;
74 /*========================== PUBLIC =================================*/
76 public:
78 /*---------------------------------------------------------------------*/
79 /*! \name Sync */
80 /*! \{ */
82 virtual void changed(ConstFieldMaskArg whichField,
83 UInt32 origin,
84 BitVector detail);
86 /*! \} */
87 /*---------------------------------------------------------------------*/
88 /*! \name Output */
89 /*! \{ */
91 virtual void dump( UInt32 uiIndent = 0,
92 const BitVector bvFlags = 0) const;
93 /*! \} */
94 /*---------------------------------------------------------------------*/
95 /*! \name features */
96 /*! \{ */
98 virtual bool clientRendering (void);
100 /*! \} */
101 /*---------------------------------------------------------------------*/
102 /*! \name composition */
103 /*! \{ */
105 virtual void open ( );
106 virtual void composeViewport(Viewport *port );
107 virtual void close (void );
109 /*! \} */
110 /*---------------------------------------------------------------------*/
111 /*! \name features */
112 /*! \{ */
114 virtual bool getClientRendering(void);
115 virtual UInt32 getUsableServers (void);
117 /*! \} */
118 /*========================= PROTECTED ===============================*/
120 protected:
122 UInt32 _usableServers;
123 UInt32 _wWidth;
124 UInt32 _wHeight;
125 Real64 _fRenderRequest[6];
126 char** _serverList;
127 char _serviceAddr[256];
128 UInt8* _bufColor;
129 UInt8* _bufDepth;
130 UInt8* _bufRet;
131 bool _createContext;
132 #ifdef OSG_WITH_PARALLEL
133 PCint _rowPixels;
134 PCcontext _context;
135 #endif
137 /*---------------------------------------------------------------------*/
138 /*! \name Constructors */
139 /*! \{ */
141 ParallelComposer(void);
142 ParallelComposer(const ParallelComposer &source);
144 /*! \} */
145 /*---------------------------------------------------------------------*/
146 /*! \name Destructors */
147 /*! \{ */
149 virtual ~ParallelComposer(void);
151 /*! \} */
152 /*---------------------------------------------------------------------*/
153 /*! \name compose */
154 /*! \{ */
156 void writeBuffer();
157 void readBuffer();
159 /*! \} */
160 /*---------------------------------------------------------------------*/
161 /*! \name Init */
162 /*! \{ */
164 static void initMethod(InitPhase ePhase);
166 /*! \} */
167 /*========================== PRIVATE ================================*/
169 private:
171 // helper functions
172 void createCtx (Viewport *port);
173 void endFrame (UInt32 id );
174 UInt32 beginFrame(void );
175 void drawFrame (void );
176 void renderRead(void );
178 friend class FieldContainer;
179 friend class ParallelComposerBase;
182 // prohibit default functions (move to 'public' if you need one)
183 void operator =(const ParallelComposer &source);
187 typedef ParallelComposer *ParallelComposerP;
189 OSG_END_NAMESPACE
191 #include "OSGParallelComposerBase.inl"
192 #include "OSGParallelComposer.inl"
194 #endif /* _OSGPARALLELCOMPOSER_H_ */