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_COMPILEMATRIXCAMERADECORATORINST
00055
00056 #include <stdlib.h>
00057 #include <stdio.h>
00058
00059 #include <OSGConfig.h>
00060
00061 #include "OSGMatrixCameraDecoratorBase.h"
00062 #include "OSGMatrixCameraDecorator.h"
00063
00064
00065 OSG_USING_NAMESPACE
00066
00067 const OSG::BitVector MatrixCameraDecoratorBase::PreViewingFieldMask =
00068 (TypeTraits<BitVector>::One << MatrixCameraDecoratorBase::PreViewingFieldId);
00069
00070 const OSG::BitVector MatrixCameraDecoratorBase::PostViewingFieldMask =
00071 (TypeTraits<BitVector>::One << MatrixCameraDecoratorBase::PostViewingFieldId);
00072
00073 const OSG::BitVector MatrixCameraDecoratorBase::PreProjectionTranslationFieldMask =
00074 (TypeTraits<BitVector>::One << MatrixCameraDecoratorBase::PreProjectionTranslationFieldId);
00075
00076 const OSG::BitVector MatrixCameraDecoratorBase::PostProjectionTranslationFieldMask =
00077 (TypeTraits<BitVector>::One << MatrixCameraDecoratorBase::PostProjectionTranslationFieldId);
00078
00079 const OSG::BitVector MatrixCameraDecoratorBase::PreProjectionFieldMask =
00080 (TypeTraits<BitVector>::One << MatrixCameraDecoratorBase::PreProjectionFieldId);
00081
00082 const OSG::BitVector MatrixCameraDecoratorBase::PostProjectionFieldMask =
00083 (TypeTraits<BitVector>::One << MatrixCameraDecoratorBase::PostProjectionFieldId);
00084
00085 const OSG::BitVector MatrixCameraDecoratorBase::MTInfluenceMask =
00086 (Inherited::MTInfluenceMask) |
00087 (static_cast<BitVector>(0x0) << Inherited::NextFieldId);
00088
00089
00090
00091
00111
00112
00113 FieldDescription *MatrixCameraDecoratorBase::_desc[] =
00114 {
00115 new FieldDescription(SFMatrix::getClassType(),
00116 "preViewing",
00117 PreViewingFieldId, PreViewingFieldMask,
00118 false,
00119 (FieldAccessMethod) &MatrixCameraDecoratorBase::getSFPreViewing),
00120 new FieldDescription(SFMatrix::getClassType(),
00121 "postViewing",
00122 PostViewingFieldId, PostViewingFieldMask,
00123 false,
00124 (FieldAccessMethod) &MatrixCameraDecoratorBase::getSFPostViewing),
00125 new FieldDescription(SFMatrix::getClassType(),
00126 "preProjectionTranslation",
00127 PreProjectionTranslationFieldId, PreProjectionTranslationFieldMask,
00128 false,
00129 (FieldAccessMethod) &MatrixCameraDecoratorBase::getSFPreProjectionTranslation),
00130 new FieldDescription(SFMatrix::getClassType(),
00131 "postProjectionTranslation",
00132 PostProjectionTranslationFieldId, PostProjectionTranslationFieldMask,
00133 false,
00134 (FieldAccessMethod) &MatrixCameraDecoratorBase::getSFPostProjectionTranslation),
00135 new FieldDescription(SFMatrix::getClassType(),
00136 "preProjection",
00137 PreProjectionFieldId, PreProjectionFieldMask,
00138 false,
00139 (FieldAccessMethod) &MatrixCameraDecoratorBase::getSFPreProjection),
00140 new FieldDescription(SFMatrix::getClassType(),
00141 "postProjection",
00142 PostProjectionFieldId, PostProjectionFieldMask,
00143 false,
00144 (FieldAccessMethod) &MatrixCameraDecoratorBase::getSFPostProjection)
00145 };
00146
00147
00148 FieldContainerType MatrixCameraDecoratorBase::_type(
00149 "MatrixCameraDecorator",
00150 "CameraDecorator",
00151 NULL,
00152 (PrototypeCreateF) &MatrixCameraDecoratorBase::createEmpty,
00153 MatrixCameraDecorator::initMethod,
00154 _desc,
00155 sizeof(_desc));
00156
00157
00158
00159
00160
00161 FieldContainerType &MatrixCameraDecoratorBase::getType(void)
00162 {
00163 return _type;
00164 }
00165
00166 const FieldContainerType &MatrixCameraDecoratorBase::getType(void) const
00167 {
00168 return _type;
00169 }
00170
00171
00172 FieldContainerPtr MatrixCameraDecoratorBase::shallowCopy(void) const
00173 {
00174 MatrixCameraDecoratorPtr returnValue;
00175
00176 newPtr(returnValue, dynamic_cast<const MatrixCameraDecorator *>(this));
00177
00178 return returnValue;
00179 }
00180
00181 UInt32 MatrixCameraDecoratorBase::getContainerSize(void) const
00182 {
00183 return sizeof(MatrixCameraDecorator);
00184 }
00185
00186
00187 #if !defined(OSG_FIXED_MFIELDSYNC)
00188 void MatrixCameraDecoratorBase::executeSync( FieldContainer &other,
00189 const BitVector &whichField)
00190 {
00191 this->executeSyncImpl((MatrixCameraDecoratorBase *) &other, whichField);
00192 }
00193 #else
00194 void MatrixCameraDecoratorBase::executeSync( FieldContainer &other,
00195 const BitVector &whichField, const SyncInfo &sInfo )
00196 {
00197 this->executeSyncImpl((MatrixCameraDecoratorBase *) &other, whichField, sInfo);
00198 }
00199 void MatrixCameraDecoratorBase::execBeginEdit(const BitVector &whichField,
00200 UInt32 uiAspect,
00201 UInt32 uiContainerSize)
00202 {
00203 this->execBeginEditImpl(whichField, uiAspect, uiContainerSize);
00204 }
00205
00206 void MatrixCameraDecoratorBase::onDestroyAspect(UInt32 uiId, UInt32 uiAspect)
00207 {
00208 Inherited::onDestroyAspect(uiId, uiAspect);
00209
00210 }
00211 #endif
00212
00213
00214
00215 #ifdef OSG_WIN32_ICL
00216 #pragma warning (disable : 383)
00217 #endif
00218
00219 MatrixCameraDecoratorBase::MatrixCameraDecoratorBase(void) :
00220 _sfPreViewing (Matrix(1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1)),
00221 _sfPostViewing (Matrix(1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1)),
00222 _sfPreProjectionTranslation(Matrix(1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1)),
00223 _sfPostProjectionTranslation(Matrix(1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1)),
00224 _sfPreProjection (Matrix(1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1)),
00225 _sfPostProjection (Matrix(1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1)),
00226 Inherited()
00227 {
00228 }
00229
00230 #ifdef OSG_WIN32_ICL
00231 #pragma warning (default : 383)
00232 #endif
00233
00234 MatrixCameraDecoratorBase::MatrixCameraDecoratorBase(const MatrixCameraDecoratorBase &source) :
00235 _sfPreViewing (source._sfPreViewing ),
00236 _sfPostViewing (source._sfPostViewing ),
00237 _sfPreProjectionTranslation(source._sfPreProjectionTranslation),
00238 _sfPostProjectionTranslation(source._sfPostProjectionTranslation),
00239 _sfPreProjection (source._sfPreProjection ),
00240 _sfPostProjection (source._sfPostProjection ),
00241 Inherited (source)
00242 {
00243 }
00244
00245
00246
00247 MatrixCameraDecoratorBase::~MatrixCameraDecoratorBase(void)
00248 {
00249 }
00250
00251
00252
00253 UInt32 MatrixCameraDecoratorBase::getBinSize(const BitVector &whichField)
00254 {
00255 UInt32 returnValue = Inherited::getBinSize(whichField);
00256
00257 if(FieldBits::NoField != (PreViewingFieldMask & whichField))
00258 {
00259 returnValue += _sfPreViewing.getBinSize();
00260 }
00261
00262 if(FieldBits::NoField != (PostViewingFieldMask & whichField))
00263 {
00264 returnValue += _sfPostViewing.getBinSize();
00265 }
00266
00267 if(FieldBits::NoField != (PreProjectionTranslationFieldMask & whichField))
00268 {
00269 returnValue += _sfPreProjectionTranslation.getBinSize();
00270 }
00271
00272 if(FieldBits::NoField != (PostProjectionTranslationFieldMask & whichField))
00273 {
00274 returnValue += _sfPostProjectionTranslation.getBinSize();
00275 }
00276
00277 if(FieldBits::NoField != (PreProjectionFieldMask & whichField))
00278 {
00279 returnValue += _sfPreProjection.getBinSize();
00280 }
00281
00282 if(FieldBits::NoField != (PostProjectionFieldMask & whichField))
00283 {
00284 returnValue += _sfPostProjection.getBinSize();
00285 }
00286
00287
00288 return returnValue;
00289 }
00290
00291 void MatrixCameraDecoratorBase::copyToBin( BinaryDataHandler &pMem,
00292 const BitVector &whichField)
00293 {
00294 Inherited::copyToBin(pMem, whichField);
00295
00296 if(FieldBits::NoField != (PreViewingFieldMask & whichField))
00297 {
00298 _sfPreViewing.copyToBin(pMem);
00299 }
00300
00301 if(FieldBits::NoField != (PostViewingFieldMask & whichField))
00302 {
00303 _sfPostViewing.copyToBin(pMem);
00304 }
00305
00306 if(FieldBits::NoField != (PreProjectionTranslationFieldMask & whichField))
00307 {
00308 _sfPreProjectionTranslation.copyToBin(pMem);
00309 }
00310
00311 if(FieldBits::NoField != (PostProjectionTranslationFieldMask & whichField))
00312 {
00313 _sfPostProjectionTranslation.copyToBin(pMem);
00314 }
00315
00316 if(FieldBits::NoField != (PreProjectionFieldMask & whichField))
00317 {
00318 _sfPreProjection.copyToBin(pMem);
00319 }
00320
00321 if(FieldBits::NoField != (PostProjectionFieldMask & whichField))
00322 {
00323 _sfPostProjection.copyToBin(pMem);
00324 }
00325
00326
00327 }
00328
00329 void MatrixCameraDecoratorBase::copyFromBin( BinaryDataHandler &pMem,
00330 const BitVector &whichField)
00331 {
00332 Inherited::copyFromBin(pMem, whichField);
00333
00334 if(FieldBits::NoField != (PreViewingFieldMask & whichField))
00335 {
00336 _sfPreViewing.copyFromBin(pMem);
00337 }
00338
00339 if(FieldBits::NoField != (PostViewingFieldMask & whichField))
00340 {
00341 _sfPostViewing.copyFromBin(pMem);
00342 }
00343
00344 if(FieldBits::NoField != (PreProjectionTranslationFieldMask & whichField))
00345 {
00346 _sfPreProjectionTranslation.copyFromBin(pMem);
00347 }
00348
00349 if(FieldBits::NoField != (PostProjectionTranslationFieldMask & whichField))
00350 {
00351 _sfPostProjectionTranslation.copyFromBin(pMem);
00352 }
00353
00354 if(FieldBits::NoField != (PreProjectionFieldMask & whichField))
00355 {
00356 _sfPreProjection.copyFromBin(pMem);
00357 }
00358
00359 if(FieldBits::NoField != (PostProjectionFieldMask & whichField))
00360 {
00361 _sfPostProjection.copyFromBin(pMem);
00362 }
00363
00364
00365 }
00366
00367 #if !defined(OSG_FIXED_MFIELDSYNC)
00368 void MatrixCameraDecoratorBase::executeSyncImpl( MatrixCameraDecoratorBase *pOther,
00369 const BitVector &whichField)
00370 {
00371
00372 Inherited::executeSyncImpl(pOther, whichField);
00373
00374 if(FieldBits::NoField != (PreViewingFieldMask & whichField))
00375 _sfPreViewing.syncWith(pOther->_sfPreViewing);
00376
00377 if(FieldBits::NoField != (PostViewingFieldMask & whichField))
00378 _sfPostViewing.syncWith(pOther->_sfPostViewing);
00379
00380 if(FieldBits::NoField != (PreProjectionTranslationFieldMask & whichField))
00381 _sfPreProjectionTranslation.syncWith(pOther->_sfPreProjectionTranslation);
00382
00383 if(FieldBits::NoField != (PostProjectionTranslationFieldMask & whichField))
00384 _sfPostProjectionTranslation.syncWith(pOther->_sfPostProjectionTranslation);
00385
00386 if(FieldBits::NoField != (PreProjectionFieldMask & whichField))
00387 _sfPreProjection.syncWith(pOther->_sfPreProjection);
00388
00389 if(FieldBits::NoField != (PostProjectionFieldMask & whichField))
00390 _sfPostProjection.syncWith(pOther->_sfPostProjection);
00391
00392
00393 }
00394 #else
00395 void MatrixCameraDecoratorBase::executeSyncImpl( MatrixCameraDecoratorBase *pOther,
00396 const BitVector &whichField,
00397 const SyncInfo &sInfo )
00398 {
00399
00400 Inherited::executeSyncImpl(pOther, whichField, sInfo);
00401
00402 if(FieldBits::NoField != (PreViewingFieldMask & whichField))
00403 _sfPreViewing.syncWith(pOther->_sfPreViewing);
00404
00405 if(FieldBits::NoField != (PostViewingFieldMask & whichField))
00406 _sfPostViewing.syncWith(pOther->_sfPostViewing);
00407
00408 if(FieldBits::NoField != (PreProjectionTranslationFieldMask & whichField))
00409 _sfPreProjectionTranslation.syncWith(pOther->_sfPreProjectionTranslation);
00410
00411 if(FieldBits::NoField != (PostProjectionTranslationFieldMask & whichField))
00412 _sfPostProjectionTranslation.syncWith(pOther->_sfPostProjectionTranslation);
00413
00414 if(FieldBits::NoField != (PreProjectionFieldMask & whichField))
00415 _sfPreProjection.syncWith(pOther->_sfPreProjection);
00416
00417 if(FieldBits::NoField != (PostProjectionFieldMask & whichField))
00418 _sfPostProjection.syncWith(pOther->_sfPostProjection);
00419
00420
00421
00422 }
00423
00424 void MatrixCameraDecoratorBase::execBeginEditImpl (const BitVector &whichField,
00425 UInt32 uiAspect,
00426 UInt32 uiContainerSize)
00427 {
00428 Inherited::execBeginEditImpl(whichField, uiAspect, uiContainerSize);
00429
00430 }
00431 #endif
00432
00433
00434
00435 #include <OSGSFieldTypeDef.inl>
00436 #include <OSGMFieldTypeDef.inl>
00437
00438 OSG_BEGIN_NAMESPACE
00439
00440 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
00441 DataType FieldDataTraits<MatrixCameraDecoratorPtr>::_type("MatrixCameraDecoratorPtr", "CameraDecoratorPtr");
00442 #endif
00443
00444 OSG_DLLEXPORT_SFIELD_DEF1(MatrixCameraDecoratorPtr, OSG_SYSTEMLIB_DLLTMPLMAPPING);
00445 OSG_DLLEXPORT_MFIELD_DEF1(MatrixCameraDecoratorPtr, OSG_SYSTEMLIB_DLLTMPLMAPPING);
00446
00447 OSG_END_NAMESPACE
00448
00449
00450
00451
00452
00453 #ifdef OSG_SGI_CC
00454 #pragma set woff 1174
00455 #endif
00456
00457 #ifdef OSG_LINUX_ICC
00458 #pragma warning( disable : 177 )
00459 #endif
00460
00461 namespace
00462 {
00463 static Char8 cvsid_cpp [] = "@(#)$Id: FCBaseTemplate_cpp.h,v 1.45 2005/07/20 00:10:14 vossg Exp $";
00464 static Char8 cvsid_hpp [] = OSGMATRIXCAMERADECORATORBASE_HEADER_CVSID;
00465 static Char8 cvsid_inl [] = OSGMATRIXCAMERADECORATORBASE_INLINE_CVSID;
00466
00467 static Char8 cvsid_fields_hpp[] = OSGMATRIXCAMERADECORATORFIELDS_HEADER_CVSID;
00468 }
00469