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 00134 bool loadFilter(std::istream &in); 00135 bool updateFilter(WindowPtr window, UInt32 id, RenderActionBase *action); 00136 00138 /*---------------------------------------------------------------------*/ 00141 class AsyncCancel : public Exception 00142 { 00143 public: 00144 AsyncCancel(); 00145 }; 00148 /*========================= PROTECTED ===============================*/ 00149 protected: 00150 00151 /*---------------------------------------------------------------------*/ 00155 virtual void clientInit (void ); 00156 virtual void clientPreSync (void ); 00157 virtual void clientRender (RenderActionBase *action); 00158 virtual void clientSwap (void ); 00159 00161 /*---------------------------------------------------------------------*/ 00165 virtual void serverInit ( WindowPtr window,UInt32 id ); 00166 virtual void serverRender ( WindowPtr window,UInt32 id, 00167 RenderActionBase *action ); 00168 virtual void serverSwap ( WindowPtr window,UInt32 id ); 00169 00172 /*---------------------------------------------------------------------*/ 00176 ClusterWindow(void); 00177 ClusterWindow(const ClusterWindow &source); 00178 virtual ~ClusterWindow(void); 00179 00181 /*---------------------------------------------------------------------*/ 00185 bool _firstFrame; 00186 StatCollector *_statistics; 00187 00190 /*========================== PRIVATE ================================*/ 00191 private: 00192 /*---------------------------------------------------------------------*/ 00196 connectioncbfp _connectionFP; 00197 ClusterNetwork *_network; 00198 00200 /*---------------------------------------------------------------------*/ 00204 static void initMethod(void); 00205 00207 friend class FieldContainer; 00208 friend class ClusterWindowBase; 00209 friend class ClusterServer; 00210 friend class ClusterClient; 00211 00212 // prohibit default functions (move to 'public' if you need one) 00213 void operator =(const ClusterWindow &source); 00214 }; 00215 00216 typedef ClusterWindow *ClusterWindowP; 00217 00218 OSG_END_NAMESPACE 00219 00220 #include <OSGClusterWindow.inl> 00221 #include <OSGClusterWindowBase.inl> 00222 00223 #define OSGCLUSTERWINDOW_HEADER_CVSID "@(#)$Id: $" 00224 00225 #endif /* _OSGCLUSTERWINDOW_H_ */
1.5.5