00001 /*---------------------------------------------------------------------------*\ 00002 * OpenSG * 00003 * * 00004 * * 00005 * Copyright (C) 2000-2002 by the OpenSG Forum * 00006 * * 00007 * www.opensg.org * 00008 * * 00009 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de * 00010 * * 00011 \*---------------------------------------------------------------------------*/ 00012 /*---------------------------------------------------------------------------*\ 00013 * License * 00014 * * 00015 * This library is free software; you can redistribute it and/or modify it * 00016 * under the terms of the GNU Library General Public License as published * 00017 * by the Free Software Foundation, version 2. * 00018 * * 00019 * This library is distributed in the hope that it will be useful, but * 00020 * WITHOUT ANY WARRANTY; without even the implied warranty of * 00021 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00022 * Library General Public License for more details. * 00023 * * 00024 * You should have received a copy of the GNU Library General Public * 00025 * License along with this library; if not, write to the Free Software * 00026 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * 00027 * * 00028 \*---------------------------------------------------------------------------*/ 00029 /*---------------------------------------------------------------------------*\ 00030 * Changes * 00031 * * 00032 * * 00033 * * 00034 * * 00035 * * 00036 * * 00037 \*---------------------------------------------------------------------------*/ 00038 00039 #ifndef _OSGCLUSTERWINDOW_H_ 00040 #define _OSGCLUSTERWINDOW_H_ 00041 #ifdef __sgi 00042 #pragma once 00043 #endif 00044 00045 #include <OSGConfig.h> 00046 #include <OSGClusterWindowBase.h> 00047 #include <OSGStatCollector.h> 00048 #include <OSGStatElemTypes.h> 00049 #include <OSGClusterNetwork.h> 00050 00051 OSG_BEGIN_NAMESPACE 00052 00053 class Connection; 00054 class ClusterServer; 00055 class RemoteAspect; 00056 00057 class OSG_SYSTEMLIB_DLLMAPPING ClusterWindow : public ClusterWindowBase 00058 { 00059 private: 00060 00061 typedef ClusterWindowBase Inherited; 00062 00063 /*========================== PUBLIC =================================*/ 00064 public: 00065 00066 /*---------------------------------------------------------------------*/ 00070 virtual void changed(BitVector whichField, 00071 UInt32 origin ); 00072 00074 /*---------------------------------------------------------------------*/ 00078 virtual void dump( UInt32 uiIndent = 0, 00079 const BitVector bvFlags = 0) const; 00080 00082 /*---------------------------------------------------------------------*/ 00086 virtual void (*getFunctionByName ( const Char8 *s ))(); 00087 00089 /*---------------------------------------------------------------------*/ 00093 virtual void activate (void ); 00094 virtual void deactivate (void ); 00095 virtual void swap (void ); 00096 virtual void init (void ); 00097 virtual void render (RenderActionBase *action = NULL); 00098 virtual void renderAllViewports(RenderActionBase *action = NULL); 00099 virtual void frameInit (void ); 00100 virtual void frameExit (void ); 00101 00103 /*---------------------------------------------------------------------*/ 00107 typedef bool (*connectioncbfp)(std::string server, Real32 progress); 00108 bool initAsync(connectioncbfp fp); 00109 void setConnectionCB(connectioncbfp fp); 00110 00112 /*---------------------------------------------------------------------*/ 00116 ClusterNetwork *getNetwork(void); 00117 00119 /*---------------------------------------------------------------------*/ 00123 StatCollector *getStatistics(void ) const; 00124 void setStatistics(StatCollector * stat ); 00125 00127 /*---------------------------------------------------------------------*/ 00131 bool loadCalibration(std::istream &in); 00132 bool saveCalibration(std::ostream &out); 00133 00135 /*---------------------------------------------------------------------*/ 00138 class AsyncCancel : public Exception 00139 { 00140 public: 00141 AsyncCancel(); 00142 }; 00145 /*========================= PROTECTED ===============================*/ 00146 protected: 00147 00148 /*---------------------------------------------------------------------*/ 00152 virtual void clientInit (void ); 00153 virtual void clientPreSync (void ); 00154 virtual void clientRender (RenderActionBase *action); 00155 virtual void clientSwap (void ); 00156 00158 /*---------------------------------------------------------------------*/ 00162 virtual void serverInit ( WindowPtr window,UInt32 id ); 00163 virtual void serverRender ( WindowPtr window,UInt32 id, 00164 RenderActionBase *action ); 00165 virtual void serverSwap ( WindowPtr window,UInt32 id ); 00166 00169 /*---------------------------------------------------------------------*/ 00173 ClusterWindow(void); 00174 ClusterWindow(const ClusterWindow &source); 00175 virtual ~ClusterWindow(void); 00176 00178 /*---------------------------------------------------------------------*/ 00182 bool _firstFrame; 00183 StatCollector *_statistics; 00184 00187 /*========================== PRIVATE ================================*/ 00188 private: 00189 /*---------------------------------------------------------------------*/ 00193 connectioncbfp _connectionFP; 00194 ClusterNetwork *_network; 00195 00197 /*---------------------------------------------------------------------*/ 00201 static void initMethod(void); 00202 00204 friend class FieldContainer; 00205 friend class ClusterWindowBase; 00206 friend class ClusterServer; 00207 friend class ClusterClient; 00208 00209 // prohibit default functions (move to 'public' if you need one) 00210 void operator =(const ClusterWindow &source); 00211 }; 00212 00213 typedef ClusterWindow *ClusterWindowP; 00214 00215 OSG_END_NAMESPACE 00216 00217 #include <OSGClusterWindow.inl> 00218 #include <OSGClusterWindowBase.inl> 00219 00220 #define OSGCLUSTERWINDOW_HEADER_CVSID "@(#)$Id: $" 00221 00222 #endif /* _OSGCLUSTERWINDOW_H_ */
1.4.3