00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054 #ifndef _OSGWINDOWBASE_H_
00055 #define _OSGWINDOWBASE_H_
00056 #ifdef __sgi
00057 #pragma once
00058 #endif
00059
00060
00061 #include <OSGConfig.h>
00062 #include <OSGSystemDef.h>
00063
00064 #include <OSGBaseTypes.h>
00065 #include <OSGRefPtr.h>
00066 #include <OSGCoredNodePtr.h>
00067
00068 #include <OSGAttachmentContainer.h>
00069
00070 #include <OSGUInt16Fields.h>
00071 #include <OSGUInt16Fields.h>
00072 #include <OSGViewportFields.h>
00073 #include <OSGBoolFields.h>
00074 #include <OSGUInt32Fields.h>
00075 #include <OSGUInt32Fields.h>
00076 #include <OSGUInt32Fields.h>
00077
00078 #include <OSGWindowFields.h>
00079
00080 OSG_BEGIN_NAMESPACE
00081
00082 class Window;
00083 class BinaryDataHandler;
00084
00086
00087 class OSG_SYSTEMLIB_DLLMAPPING WindowBase : public AttachmentContainer
00088 {
00089 private:
00090
00091 typedef AttachmentContainer Inherited;
00092
00093
00094 public:
00095
00096 typedef WindowPtr Ptr;
00097
00098 enum
00099 {
00100 WidthFieldId = Inherited::NextFieldId,
00101 HeightFieldId = WidthFieldId + 1,
00102 PortFieldId = HeightFieldId + 1,
00103 ResizePendingFieldId = PortFieldId + 1,
00104 GlObjectEventCounterFieldId = ResizePendingFieldId + 1,
00105 GlObjectLastRefreshFieldId = GlObjectEventCounterFieldId + 1,
00106 GlObjectLastReinitializeFieldId = GlObjectLastRefreshFieldId + 1,
00107 NextFieldId = GlObjectLastReinitializeFieldId + 1
00108 };
00109
00110 static const OSG::BitVector WidthFieldMask;
00111 static const OSG::BitVector HeightFieldMask;
00112 static const OSG::BitVector PortFieldMask;
00113 static const OSG::BitVector ResizePendingFieldMask;
00114 static const OSG::BitVector GlObjectEventCounterFieldMask;
00115 static const OSG::BitVector GlObjectLastRefreshFieldMask;
00116 static const OSG::BitVector GlObjectLastReinitializeFieldMask;
00117
00118
00119 static const OSG::BitVector MTInfluenceMask;
00120
00121
00125 static FieldContainerType &getClassType (void);
00126 static UInt32 getClassTypeId (void);
00127
00129
00133 virtual FieldContainerType &getType (void);
00134 virtual const FieldContainerType &getType (void) const;
00135
00136 virtual UInt32 getContainerSize(void) const;
00137
00139
00143 SFUInt16 *getSFWidth (void);
00144 SFUInt16 *getSFHeight (void);
00145 MFViewportPtr *getMFPort (void);
00146 SFBool *getSFResizePending (void);
00147
00148 UInt16 &getWidth (void);
00149 const UInt16 &getWidth (void) const;
00150 UInt16 &getHeight (void);
00151 const UInt16 &getHeight (void) const;
00152 bool &getResizePending (void);
00153 const bool &getResizePending (void) const;
00154 ViewportPtr &getPort (const UInt32 index);
00155 MFViewportPtr &getPort (void);
00156 const MFViewportPtr &getPort (void) const;
00157
00159
00163 void setWidth ( const UInt16 &value );
00164 void setHeight ( const UInt16 &value );
00165 void setResizePending ( const bool &value );
00166
00168
00173
00177 virtual UInt32 getBinSize (const BitVector &whichField);
00178 virtual void copyToBin ( BinaryDataHandler &pMem,
00179 const BitVector &whichField);
00180 virtual void copyFromBin( BinaryDataHandler &pMem,
00181 const BitVector &whichField);
00182
00183
00185
00186 protected:
00187
00188
00192 SFUInt16 _sfWidth;
00193 SFUInt16 _sfHeight;
00194 MFViewportPtr _mfPort;
00195 SFBool _sfResizePending;
00196 SFUInt32 _sfGlObjectEventCounter;
00197 MFUInt32 _mfGlObjectLastRefresh;
00198 MFUInt32 _mfGlObjectLastReinitialize;
00199
00201
00205 WindowBase(void);
00206 WindowBase(const WindowBase &source);
00207
00209
00213 virtual ~WindowBase(void);
00214
00216
00220 SFUInt32 *getSFGlObjectEventCounter(void);
00221 MFUInt32 *getMFGlObjectLastRefresh(void);
00222 MFUInt32 *getMFGlObjectLastReinitialize(void);
00223
00224 UInt32 &getGlObjectEventCounter(void);
00225 const UInt32 &getGlObjectEventCounter(void) const;
00226 UInt32 &getGlObjectLastRefresh(UInt32 index);
00227 MFUInt32 &getGlObjectLastRefresh(void);
00228 const MFUInt32 &getGlObjectLastRefresh(void) const;
00229 UInt32 &getGlObjectLastReinitialize(UInt32 index);
00230 MFUInt32 &getGlObjectLastReinitialize(void);
00231 const MFUInt32 &getGlObjectLastReinitialize(void) const;
00232
00234
00238 void setGlObjectEventCounter(const UInt32 &value);
00239
00241
00245 #if !defined(OSG_FIXED_MFIELDSYNC)
00246 void executeSyncImpl( WindowBase *pOther,
00247 const BitVector &whichField);
00248
00249 virtual void executeSync( FieldContainer &other,
00250 const BitVector &whichField);
00251 #else
00252 void executeSyncImpl( WindowBase *pOther,
00253 const BitVector &whichField,
00254 const SyncInfo &sInfo );
00255
00256 virtual void executeSync( FieldContainer &other,
00257 const BitVector &whichField,
00258 const SyncInfo &sInfo);
00259
00260 virtual void execBeginEdit (const BitVector &whichField,
00261 UInt32 uiAspect,
00262 UInt32 uiContainerSize);
00263
00264 void execBeginEditImpl (const BitVector &whichField,
00265 UInt32 uiAspect,
00266 UInt32 uiContainerSize);
00267
00268 virtual void onDestroyAspect(UInt32 uiId, UInt32 uiAspect);
00269 #endif
00270
00272
00273 private:
00274
00275 friend class FieldContainer;
00276
00277 static FieldDescription *_desc[];
00278 static FieldContainerType _type;
00279
00280
00281
00282 void operator =(const WindowBase &source);
00283 };
00284
00285
00286
00287
00288
00289
00290 typedef WindowBase *WindowBaseP;
00291
00292 typedef osgIF<WindowBase::isNodeCore,
00293 CoredNodePtr<Window>,
00294 FieldContainer::attempt_to_create_CoredNodePtr_on_non_NodeCore_FC
00295 >::_IRet WindowNodePtr;
00296
00297 typedef RefPtr<WindowPtr> WindowRefPtr;
00298
00299 OSG_END_NAMESPACE
00300
00301 #define OSGWINDOWBASE_HEADER_CVSID "@(#)$Id: FCBaseTemplate_h.h,v 1.38 2005/07/08 06:37:35 vossg Exp $"
00302
00303 #endif