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 #define OSG_COMPILEQTWINDOWINST
00055
00056 #include <stdlib.h>
00057 #include <stdio.h>
00058
00059 #include <OSGConfig.h>
00060
00061 #include "OSGQTWindowBase.h"
00062 #include "OSGQTWindow.h"
00063
00064
00065 OSG_USING_NAMESPACE
00066
00067 #ifdef __sgi
00068 #pragma set woff 1174
00069 #endif
00070
00071 namespace
00072 {
00073 static Char8 cvsid_cpp [] = "@(#)$Id: $";
00074 static Char8 cvsid_hpp [] = OSGQTWINDOWBASE_HEADER_CVSID;
00075 static Char8 cvsid_inl [] = OSGQTWINDOWBASE_INLINE_CVSID;
00076
00077 static Char8 cvsid_fields_hpp[] = OSGQTWINDOWFIELDS_HEADER_CVSID;
00078 }
00079
00080 #ifdef __sgi
00081 #pragma reset woff 1174
00082 #endif
00083
00084 const OSG::BitVector QTWindowBase::GlWidgetFieldMask =
00085 (1 << QTWindowBase::GlWidgetFieldId);
00086
00087
00088
00089
00090
00094
00095
00096 FieldDescription *QTWindowBase::_desc[] =
00097 {
00098 new FieldDescription(SFOSGQGLWidgetP::getClassType(),
00099 "GlWidget",
00100 GlWidgetFieldId, GlWidgetFieldMask,
00101 true,
00102 (FieldAccessMethod) &QTWindowBase::getSFGlWidget)
00103 };
00104
00106
00107 FieldContainerType QTWindowBase::_type(
00108 "QTWindow",
00109 #ifdef WIN32
00110 "WIN32Window",
00111 #else
00112 "XWindow",
00113 #endif
00114 NULL,
00115 (PrototypeCreateF) &QTWindowBase::createEmpty,
00116 QTWindow::initMethod,
00117 _desc,
00118 sizeof(_desc));
00119
00120
00121
00122
00123
00124 FieldContainerType &QTWindowBase::getType(void)
00125 {
00126 return _type;
00127 }
00128
00129 const FieldContainerType &QTWindowBase::getType(void) const
00130 {
00131 return _type;
00132 }
00133
00134
00135 FieldContainerPtr QTWindowBase::shallowCopy(void) const
00136 {
00137 QTWindowPtr returnValue;
00138
00139 newPtr(returnValue, dynamic_cast<const QTWindow *>(this));
00140
00141 return returnValue;
00142 }
00143
00144 UInt32 QTWindowBase::getContainerSize(void) const
00145 {
00146 return sizeof(QTWindowBase);
00147 }
00148
00149
00150 #if !defined(OSG_FIXED_MFIELDSYNC)
00151 void QTWindowBase::executeSync( FieldContainer &other,
00152 const BitVector &whichField)
00153 {
00154 this->executeSyncImpl((QTWindowBase *) &other, whichField);
00155 }
00156 #else
00157 void QTWindowBase::executeSync( FieldContainer &other,
00158 const BitVector &whichField, const SyncInfo &sInfo )
00159 {
00160 this->executeSyncImpl((QTWindowBase *) &other, whichField, sInfo);
00161 }
00162 void QTWindowBase::execBeginEdit(const BitVector &whichField,
00163 UInt32 uiAspect,
00164 UInt32 uiContainerSize)
00165 {
00166 this->execBeginEditImpl(whichField, uiAspect, uiContainerSize);
00167 }
00168
00169 void QTWindowBase::onDestroyAspect(UInt32 uiId, UInt32 uiAspect)
00170 {
00171 Inherited::onDestroyAspect(uiId, uiAspect);
00172
00173 }
00174 #endif
00175
00176
00177
00179
00180 #ifdef OSG_WIN32_ICL
00181 #pragma warning (disable : 383)
00182 #endif
00183
00184 QTWindowBase::QTWindowBase(void) :
00185 _sfGlWidget (OSGQGLWidgetP(NULL)),
00186 Inherited()
00187 {
00188 }
00189
00190 #ifdef OSG_WIN32_ICL
00191 #pragma warning (default : 383)
00192 #endif
00193
00195
00196 QTWindowBase::QTWindowBase(const QTWindowBase &source) :
00197 _sfGlWidget (source._sfGlWidget ),
00198 Inherited (source)
00199 {
00200 }
00201
00202
00203
00205
00206 QTWindowBase::~QTWindowBase(void)
00207 {
00208 }
00209
00210
00211
00212 UInt32 QTWindowBase::getBinSize(const BitVector &whichField)
00213 {
00214 UInt32 returnValue = Inherited::getBinSize(whichField);
00215
00216 if(FieldBits::NoField != (GlWidgetFieldMask & whichField))
00217 {
00218 returnValue += _sfGlWidget.getBinSize();
00219 }
00220
00221
00222 return returnValue;
00223 }
00224
00225 void QTWindowBase::copyToBin( BinaryDataHandler &pMem,
00226 const BitVector &whichField)
00227 {
00228 Inherited::copyToBin(pMem, whichField);
00229
00230 if(FieldBits::NoField != (GlWidgetFieldMask & whichField))
00231 {
00232 _sfGlWidget.copyToBin(pMem);
00233 }
00234
00235
00236 }
00237
00238 void QTWindowBase::copyFromBin( BinaryDataHandler &pMem,
00239 const BitVector &whichField)
00240 {
00241 Inherited::copyFromBin(pMem, whichField);
00242
00243 if(FieldBits::NoField != (GlWidgetFieldMask & whichField))
00244 {
00245 _sfGlWidget.copyFromBin(pMem);
00246 }
00247
00248
00249 }
00250
00251 #if !defined(OSG_FIXED_MFIELDSYNC)
00252 void QTWindowBase::executeSyncImpl( QTWindowBase *pOther,
00253 const BitVector &whichField)
00254 {
00255
00256 Inherited::executeSyncImpl(pOther, whichField);
00257
00258 if(FieldBits::NoField != (GlWidgetFieldMask & whichField))
00259 _sfGlWidget.syncWith(pOther->_sfGlWidget);
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273 }
00274 #else
00275 void QTWindowBase::executeSyncImpl( QTWindowBase *pOther,
00276 const BitVector &whichField,
00277 const SyncInfo &sInfo )
00278 {
00279
00280 Inherited::executeSyncImpl(pOther, whichField, sInfo);
00281
00282 if(FieldBits::NoField != (GlWidgetFieldMask & whichField))
00283 _sfGlWidget.syncWith(pOther->_sfGlWidget);
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295 }
00296
00297 void QTWindowBase::execBeginEditImpl (const BitVector &whichField,
00298 UInt32 uiAspect,
00299 UInt32 uiContainerSize)
00300 {
00301 Inherited::execBeginEditImpl(whichField, uiAspect, uiContainerSize);
00302
00303 }
00304 #endif
00305
00306
00307 #include <OSGMFieldTypeDef.inl>
00308 #include <OSGSFieldTypeDef.inl>
00309
00310 OSG_BEGIN_NAMESPACE
00311
00312 DataType FieldDataTraits<QTWindowPtr>::_type("QTWindowPtr", "WindowPtr");
00313
00314 OSG_DLLEXPORT_SFIELD_DEF1(QTWindowPtr, OSG_WINDOWQTLIB_DLLTMPLMAPPING);
00315 OSG_DLLEXPORT_MFIELD_DEF1(QTWindowPtr, OSG_WINDOWQTLIB_DLLTMPLMAPPING);
00316
00317 OSG_END_NAMESPACE