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_COMPILELINECHUNKINST
00055
00056 #include <stdlib.h>
00057 #include <stdio.h>
00058
00059 #include <OSGConfig.h>
00060
00061 #include "OSGLineChunkBase.h"
00062 #include "OSGLineChunk.h"
00063
00064 #include <OSGGL.h>
00065
00066 OSG_USING_NAMESPACE
00067
00068 const OSG::BitVector LineChunkBase::WidthFieldMask =
00069 (TypeTraits<BitVector>::One << LineChunkBase::WidthFieldId);
00070
00071 const OSG::BitVector LineChunkBase::StippleRepeatFieldMask =
00072 (TypeTraits<BitVector>::One << LineChunkBase::StippleRepeatFieldId);
00073
00074 const OSG::BitVector LineChunkBase::StipplePatternFieldMask =
00075 (TypeTraits<BitVector>::One << LineChunkBase::StipplePatternFieldId);
00076
00077 const OSG::BitVector LineChunkBase::SmoothFieldMask =
00078 (TypeTraits<BitVector>::One << LineChunkBase::SmoothFieldId);
00079
00080 const OSG::BitVector LineChunkBase::MTInfluenceMask =
00081 (Inherited::MTInfluenceMask) |
00082 (static_cast<BitVector>(0x0) << Inherited::NextFieldId);
00083
00084
00085
00086
00100
00101
00102 FieldDescription *LineChunkBase::_desc[] =
00103 {
00104 new FieldDescription(SFReal32::getClassType(),
00105 "width",
00106 WidthFieldId, WidthFieldMask,
00107 false,
00108 (FieldAccessMethod) &LineChunkBase::getSFWidth),
00109 new FieldDescription(SFInt32::getClassType(),
00110 "stippleRepeat",
00111 StippleRepeatFieldId, StippleRepeatFieldMask,
00112 false,
00113 (FieldAccessMethod) &LineChunkBase::getSFStippleRepeat),
00114 new FieldDescription(SFUInt16::getClassType(),
00115 "stipplePattern",
00116 StipplePatternFieldId, StipplePatternFieldMask,
00117 false,
00118 (FieldAccessMethod) &LineChunkBase::getSFStipplePattern),
00119 new FieldDescription(SFBool::getClassType(),
00120 "smooth",
00121 SmoothFieldId, SmoothFieldMask,
00122 false,
00123 (FieldAccessMethod) &LineChunkBase::getSFSmooth)
00124 };
00125
00126
00127 FieldContainerType LineChunkBase::_type(
00128 "LineChunk",
00129 "StateChunk",
00130 NULL,
00131 (PrototypeCreateF) &LineChunkBase::createEmpty,
00132 LineChunk::initMethod,
00133 _desc,
00134 sizeof(_desc));
00135
00136
00137
00138
00139
00140 FieldContainerType &LineChunkBase::getType(void)
00141 {
00142 return _type;
00143 }
00144
00145 const FieldContainerType &LineChunkBase::getType(void) const
00146 {
00147 return _type;
00148 }
00149
00150
00151 FieldContainerPtr LineChunkBase::shallowCopy(void) const
00152 {
00153 LineChunkPtr returnValue;
00154
00155 newPtr(returnValue, dynamic_cast<const LineChunk *>(this));
00156
00157 return returnValue;
00158 }
00159
00160 UInt32 LineChunkBase::getContainerSize(void) const
00161 {
00162 return sizeof(LineChunk);
00163 }
00164
00165
00166 #if !defined(OSG_FIXED_MFIELDSYNC)
00167 void LineChunkBase::executeSync( FieldContainer &other,
00168 const BitVector &whichField)
00169 {
00170 this->executeSyncImpl((LineChunkBase *) &other, whichField);
00171 }
00172 #else
00173 void LineChunkBase::executeSync( FieldContainer &other,
00174 const BitVector &whichField, const SyncInfo &sInfo )
00175 {
00176 this->executeSyncImpl((LineChunkBase *) &other, whichField, sInfo);
00177 }
00178 void LineChunkBase::execBeginEdit(const BitVector &whichField,
00179 UInt32 uiAspect,
00180 UInt32 uiContainerSize)
00181 {
00182 this->execBeginEditImpl(whichField, uiAspect, uiContainerSize);
00183 }
00184
00185 void LineChunkBase::onDestroyAspect(UInt32 uiId, UInt32 uiAspect)
00186 {
00187 Inherited::onDestroyAspect(uiId, uiAspect);
00188
00189 }
00190 #endif
00191
00192
00193
00194 #ifdef OSG_WIN32_ICL
00195 #pragma warning (disable : 383)
00196 #endif
00197
00198 LineChunkBase::LineChunkBase(void) :
00199 _sfWidth (Real32(1)),
00200 _sfStippleRepeat (Int32(1)),
00201 _sfStipplePattern (UInt16(0xffff)),
00202 _sfSmooth (bool(GL_FALSE)),
00203 Inherited()
00204 {
00205 }
00206
00207 #ifdef OSG_WIN32_ICL
00208 #pragma warning (default : 383)
00209 #endif
00210
00211 LineChunkBase::LineChunkBase(const LineChunkBase &source) :
00212 _sfWidth (source._sfWidth ),
00213 _sfStippleRepeat (source._sfStippleRepeat ),
00214 _sfStipplePattern (source._sfStipplePattern ),
00215 _sfSmooth (source._sfSmooth ),
00216 Inherited (source)
00217 {
00218 }
00219
00220
00221
00222 LineChunkBase::~LineChunkBase(void)
00223 {
00224 }
00225
00226
00227
00228 UInt32 LineChunkBase::getBinSize(const BitVector &whichField)
00229 {
00230 UInt32 returnValue = Inherited::getBinSize(whichField);
00231
00232 if(FieldBits::NoField != (WidthFieldMask & whichField))
00233 {
00234 returnValue += _sfWidth.getBinSize();
00235 }
00236
00237 if(FieldBits::NoField != (StippleRepeatFieldMask & whichField))
00238 {
00239 returnValue += _sfStippleRepeat.getBinSize();
00240 }
00241
00242 if(FieldBits::NoField != (StipplePatternFieldMask & whichField))
00243 {
00244 returnValue += _sfStipplePattern.getBinSize();
00245 }
00246
00247 if(FieldBits::NoField != (SmoothFieldMask & whichField))
00248 {
00249 returnValue += _sfSmooth.getBinSize();
00250 }
00251
00252
00253 return returnValue;
00254 }
00255
00256 void LineChunkBase::copyToBin( BinaryDataHandler &pMem,
00257 const BitVector &whichField)
00258 {
00259 Inherited::copyToBin(pMem, whichField);
00260
00261 if(FieldBits::NoField != (WidthFieldMask & whichField))
00262 {
00263 _sfWidth.copyToBin(pMem);
00264 }
00265
00266 if(FieldBits::NoField != (StippleRepeatFieldMask & whichField))
00267 {
00268 _sfStippleRepeat.copyToBin(pMem);
00269 }
00270
00271 if(FieldBits::NoField != (StipplePatternFieldMask & whichField))
00272 {
00273 _sfStipplePattern.copyToBin(pMem);
00274 }
00275
00276 if(FieldBits::NoField != (SmoothFieldMask & whichField))
00277 {
00278 _sfSmooth.copyToBin(pMem);
00279 }
00280
00281
00282 }
00283
00284 void LineChunkBase::copyFromBin( BinaryDataHandler &pMem,
00285 const BitVector &whichField)
00286 {
00287 Inherited::copyFromBin(pMem, whichField);
00288
00289 if(FieldBits::NoField != (WidthFieldMask & whichField))
00290 {
00291 _sfWidth.copyFromBin(pMem);
00292 }
00293
00294 if(FieldBits::NoField != (StippleRepeatFieldMask & whichField))
00295 {
00296 _sfStippleRepeat.copyFromBin(pMem);
00297 }
00298
00299 if(FieldBits::NoField != (StipplePatternFieldMask & whichField))
00300 {
00301 _sfStipplePattern.copyFromBin(pMem);
00302 }
00303
00304 if(FieldBits::NoField != (SmoothFieldMask & whichField))
00305 {
00306 _sfSmooth.copyFromBin(pMem);
00307 }
00308
00309
00310 }
00311
00312 #if !defined(OSG_FIXED_MFIELDSYNC)
00313 void LineChunkBase::executeSyncImpl( LineChunkBase *pOther,
00314 const BitVector &whichField)
00315 {
00316
00317 Inherited::executeSyncImpl(pOther, whichField);
00318
00319 if(FieldBits::NoField != (WidthFieldMask & whichField))
00320 _sfWidth.syncWith(pOther->_sfWidth);
00321
00322 if(FieldBits::NoField != (StippleRepeatFieldMask & whichField))
00323 _sfStippleRepeat.syncWith(pOther->_sfStippleRepeat);
00324
00325 if(FieldBits::NoField != (StipplePatternFieldMask & whichField))
00326 _sfStipplePattern.syncWith(pOther->_sfStipplePattern);
00327
00328 if(FieldBits::NoField != (SmoothFieldMask & whichField))
00329 _sfSmooth.syncWith(pOther->_sfSmooth);
00330
00331
00332 }
00333 #else
00334 void LineChunkBase::executeSyncImpl( LineChunkBase *pOther,
00335 const BitVector &whichField,
00336 const SyncInfo &sInfo )
00337 {
00338
00339 Inherited::executeSyncImpl(pOther, whichField, sInfo);
00340
00341 if(FieldBits::NoField != (WidthFieldMask & whichField))
00342 _sfWidth.syncWith(pOther->_sfWidth);
00343
00344 if(FieldBits::NoField != (StippleRepeatFieldMask & whichField))
00345 _sfStippleRepeat.syncWith(pOther->_sfStippleRepeat);
00346
00347 if(FieldBits::NoField != (StipplePatternFieldMask & whichField))
00348 _sfStipplePattern.syncWith(pOther->_sfStipplePattern);
00349
00350 if(FieldBits::NoField != (SmoothFieldMask & whichField))
00351 _sfSmooth.syncWith(pOther->_sfSmooth);
00352
00353
00354
00355 }
00356
00357 void LineChunkBase::execBeginEditImpl (const BitVector &whichField,
00358 UInt32 uiAspect,
00359 UInt32 uiContainerSize)
00360 {
00361 Inherited::execBeginEditImpl(whichField, uiAspect, uiContainerSize);
00362
00363 }
00364 #endif
00365
00366
00367
00368 #include <OSGSFieldTypeDef.inl>
00369 #include <OSGMFieldTypeDef.inl>
00370
00371 OSG_BEGIN_NAMESPACE
00372
00373 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
00374 DataType FieldDataTraits<LineChunkPtr>::_type("LineChunkPtr", "StateChunkPtr");
00375 #endif
00376
00377 OSG_DLLEXPORT_SFIELD_DEF1(LineChunkPtr, OSG_SYSTEMLIB_DLLTMPLMAPPING);
00378 OSG_DLLEXPORT_MFIELD_DEF1(LineChunkPtr, OSG_SYSTEMLIB_DLLTMPLMAPPING);
00379
00380 OSG_END_NAMESPACE
00381
00382
00383
00384
00385
00386 #ifdef OSG_SGI_CC
00387 #pragma set woff 1174
00388 #endif
00389
00390 #ifdef OSG_LINUX_ICC
00391 #pragma warning( disable : 177 )
00392 #endif
00393
00394 namespace
00395 {
00396 static Char8 cvsid_cpp [] = "@(#)$Id: FCBaseTemplate_cpp.h,v 1.45 2005/07/20 00:10:14 vossg Exp $";
00397 static Char8 cvsid_hpp [] = OSGLINECHUNKBASE_HEADER_CVSID;
00398 static Char8 cvsid_inl [] = OSGLINECHUNKBASE_INLINE_CVSID;
00399
00400 static Char8 cvsid_fields_hpp[] = OSGLINECHUNKFIELDS_HEADER_CVSID;
00401 }
00402