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 #include <stdlib.h>
00043 #include <stdio.h>
00044
00045 #include "OSGConfig.h"
00046
00047 OSG_BEGIN_NAMESPACE
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057 inline
00058 void Geometry::invalidateDlistCache(void)
00059 {
00060 Window::refreshGLObject( getGLId() );
00061 }
00062
00063
00064
00065 inline
00066 void Geometry::setTypes(const GeoPTypesPtr &value)
00067 {
00068 GeometryPtr thisP = getPtr();
00069
00070 addRefCP(value);
00071
00072 if(_sfTypes.getValue() != NullFC)
00073 {
00074 beginEditCP(_sfTypes.getValue(), Attachment::ParentsFieldMask);
00075 {
00076 _sfTypes.getValue()->subParent(thisP);
00077 }
00078 endEditCP (_sfTypes.getValue(), Attachment::ParentsFieldMask);
00079
00080 subRefCP(_sfTypes.getValue());
00081 }
00082
00083 if(value != NullFC)
00084 {
00085 thisP.setParentFieldPos(TypesFieldId);
00086
00087 beginEditCP(value, Attachment::ParentsFieldMask);
00088 {
00089 value->addParent(thisP);
00090 }
00091 endEditCP (value, Attachment::ParentsFieldMask);
00092 }
00093
00094 _sfTypes.setValue(value);
00095 }
00096
00097 inline
00098 void Geometry::setLengths(const GeoPLengthsPtr &value)
00099 {
00100 GeometryPtr thisP = getPtr();
00101
00102 addRefCP(value);
00103
00104 if(_sfLengths.getValue() != NullFC)
00105 {
00106 beginEditCP(_sfLengths.getValue(), Attachment::ParentsFieldMask);
00107 {
00108 _sfLengths.getValue()->subParent(thisP);
00109 }
00110 endEditCP (_sfLengths.getValue(), Attachment::ParentsFieldMask);
00111
00112 subRefCP(_sfLengths.getValue());
00113 }
00114
00115 if(value != NullFC)
00116 {
00117 thisP.setParentFieldPos(LengthsFieldId);
00118
00119 beginEditCP(value, Attachment::ParentsFieldMask);
00120 {
00121 value->addParent(thisP);
00122 }
00123 endEditCP (value, Attachment::ParentsFieldMask);
00124 }
00125
00126 _sfLengths.setValue(value);
00127 }
00128
00129 inline
00130 void Geometry::setPositions(const GeoPositionsPtr &value)
00131 {
00132 GeometryPtr thisP = getPtr();
00133
00134 addRefCP(value);
00135
00136 if(_sfPositions.getValue() != NullFC)
00137 {
00138 beginEditCP(_sfPositions.getValue(), Attachment::ParentsFieldMask);
00139 {
00140 _sfPositions.getValue()->subParent(thisP);
00141 }
00142 endEditCP (_sfPositions.getValue(), Attachment::ParentsFieldMask);
00143
00144 subRefCP(_sfPositions.getValue());
00145 }
00146
00147 if(value != NullFC)
00148 {
00149 thisP.setParentFieldPos(PositionsFieldId);
00150
00151 beginEditCP(value, Attachment::ParentsFieldMask);
00152 {
00153 value->addParent(thisP);
00154 }
00155 endEditCP (value, Attachment::ParentsFieldMask);
00156 }
00157
00158 _sfPositions.setValue(value);
00159 }
00160
00161 inline
00162 void Geometry::setNormals(const GeoNormalsPtr &value)
00163 {
00164 GeometryPtr thisP = getPtr();
00165
00166 addRefCP(value);
00167
00168 if(_sfNormals.getValue() != NullFC)
00169 {
00170 beginEditCP(_sfNormals.getValue(), Attachment::ParentsFieldMask);
00171 {
00172 _sfNormals.getValue()->subParent(thisP);
00173 }
00174 endEditCP (_sfNormals.getValue(), Attachment::ParentsFieldMask);
00175
00176 subRefCP(_sfNormals.getValue());
00177 }
00178
00179 if(value != NullFC)
00180 {
00181 thisP.setParentFieldPos(NormalsFieldId);
00182
00183 beginEditCP(value, Attachment::ParentsFieldMask);
00184 {
00185 value->addParent(thisP);
00186 }
00187 endEditCP (value, Attachment::ParentsFieldMask);
00188 }
00189
00190 _sfNormals.setValue(value);
00191 }
00192
00193 inline
00194 void Geometry::setColors(const GeoColorsPtr &value)
00195 {
00196 GeometryPtr thisP = getPtr();
00197
00198 addRefCP(value);
00199
00200 if(_sfColors.getValue() != NullFC)
00201 {
00202 beginEditCP(_sfColors.getValue(), Attachment::ParentsFieldMask);
00203 {
00204 _sfColors.getValue()->subParent(thisP);
00205 }
00206 endEditCP (_sfColors.getValue(), Attachment::ParentsFieldMask);
00207
00208 subRefCP(_sfColors.getValue());
00209 }
00210
00211 if(value != NullFC)
00212 {
00213 thisP.setParentFieldPos(ColorsFieldId);
00214
00215 beginEditCP(value, Attachment::ParentsFieldMask);
00216 {
00217 value->addParent(thisP);
00218 }
00219 endEditCP (value, Attachment::ParentsFieldMask);
00220 }
00221
00222 _sfColors.setValue(value);
00223 }
00224
00225 inline
00226 void Geometry::setSecondaryColors(const GeoColorsPtr &value)
00227 {
00228 GeometryPtr thisP = getPtr();
00229
00230 addRefCP(value);
00231
00232 if(_sfSecondaryColors.getValue() != NullFC)
00233 {
00234 beginEditCP(_sfSecondaryColors.getValue(), Attachment::ParentsFieldMask);
00235 {
00236 _sfSecondaryColors.getValue()->subParent(thisP);
00237 }
00238 beginEditCP(_sfSecondaryColors.getValue(), Attachment::ParentsFieldMask);
00239
00240 subRefCP(_sfSecondaryColors.getValue());
00241 }
00242
00243 if(value != NullFC)
00244 {
00245 thisP.setParentFieldPos(SecondaryColorsFieldId);
00246
00247 beginEditCP(value, Attachment::ParentsFieldMask);
00248 {
00249 value->addParent(thisP);
00250 }
00251 beginEditCP(value, Attachment::ParentsFieldMask);
00252 }
00253
00254 _sfSecondaryColors.setValue(value);
00255 }
00256
00257 inline
00258 void Geometry::setTexCoords(const GeoTexCoordsPtr &value)
00259 {
00260 GeometryPtr thisP = getPtr();
00261
00262 addRefCP(value);
00263
00264 if(_sfTexCoords.getValue() != NullFC)
00265 {
00266 beginEditCP(_sfTexCoords.getValue(), Attachment::ParentsFieldMask);
00267 {
00268 _sfTexCoords.getValue()->subParent(thisP);
00269 }
00270 endEditCP (_sfTexCoords.getValue(), Attachment::ParentsFieldMask);
00271
00272 subRefCP(_sfTexCoords.getValue());
00273 }
00274
00275 if(value != NullFC)
00276 {
00277 thisP.setParentFieldPos(TexCoordsFieldId);
00278
00279 beginEditCP(value, Attachment::ParentsFieldMask);
00280 {
00281 value->addParent(thisP);
00282 }
00283 endEditCP (value, Attachment::ParentsFieldMask);
00284 }
00285
00286 _sfTexCoords.setValue(value);
00287 }
00288
00289 inline
00290 void Geometry::setTexCoords1(const GeoTexCoordsPtr &value)
00291 {
00292 GeometryPtr thisP = getPtr();
00293
00294 addRefCP(value);
00295
00296 if(_sfTexCoords1.getValue() != NullFC)
00297 {
00298 beginEditCP(_sfTexCoords1.getValue(), Attachment::ParentsFieldMask);
00299 {
00300 _sfTexCoords1.getValue()->subParent(thisP);
00301 }
00302 beginEditCP(_sfTexCoords1.getValue(), Attachment::ParentsFieldMask);
00303
00304 subRefCP(_sfTexCoords1.getValue());
00305 }
00306
00307 if(value != NullFC)
00308 {
00309 thisP.setParentFieldPos(TexCoords1FieldId);
00310
00311 beginEditCP(value, Attachment::ParentsFieldMask);
00312 {
00313 value->addParent(thisP);
00314 }
00315 beginEditCP(value, Attachment::ParentsFieldMask);
00316 }
00317
00318 _sfTexCoords1.setValue(value);
00319 }
00320
00321 inline
00322 void Geometry::setTexCoords2(const GeoTexCoordsPtr &value)
00323 {
00324 GeometryPtr thisP = getPtr();
00325
00326 addRefCP(value);
00327
00328 if(_sfTexCoords2.getValue() != NullFC)
00329 {
00330 beginEditCP(_sfTexCoords2.getValue(), Attachment::ParentsFieldMask);
00331 {
00332 _sfTexCoords2.getValue()->subParent(thisP);
00333 }
00334 beginEditCP(_sfTexCoords2.getValue(), Attachment::ParentsFieldMask);
00335
00336 subRefCP(_sfTexCoords2.getValue());
00337 }
00338
00339 if(value != NullFC)
00340 {
00341 thisP.setParentFieldPos(TexCoords2FieldId);
00342
00343 beginEditCP(value, Attachment::ParentsFieldMask);
00344 {
00345 value->addParent(thisP);
00346 }
00347 beginEditCP(value, Attachment::ParentsFieldMask);
00348 }
00349
00350 _sfTexCoords2.setValue(value);
00351 }
00352
00353 inline
00354 void Geometry::setTexCoords3(const GeoTexCoordsPtr &value)
00355 {
00356 GeometryPtr thisP = getPtr();
00357
00358 addRefCP(value);
00359
00360 if(_sfTexCoords3.getValue() != NullFC)
00361 {
00362 beginEditCP(_sfTexCoords3.getValue(), Attachment::ParentsFieldMask);
00363 {
00364 _sfTexCoords3.getValue()->subParent(thisP);
00365 }
00366 beginEditCP(_sfTexCoords3.getValue(), Attachment::ParentsFieldMask);
00367
00368 subRefCP(_sfTexCoords3.getValue());
00369 }
00370
00371 if(value != NullFC)
00372 {
00373 thisP.setParentFieldPos(TexCoords3FieldId);
00374
00375 beginEditCP(value, Attachment::ParentsFieldMask);
00376 {
00377 value->addParent(thisP);
00378 }
00379 beginEditCP(value, Attachment::ParentsFieldMask);
00380 }
00381
00382 _sfTexCoords3.setValue(value);
00383 }
00384
00385 inline
00386 void Geometry::setTexCoords4(const GeoTexCoordsPtr &value)
00387 {
00388 GeometryPtr thisP = getPtr();
00389
00390 addRefCP(value);
00391
00392 if(_sfTexCoords4.getValue() != NullFC)
00393 {
00394 beginEditCP(_sfTexCoords4.getValue(), Attachment::ParentsFieldMask);
00395 {
00396 _sfTexCoords4.getValue()->subParent(thisP);
00397 }
00398 beginEditCP(_sfTexCoords4.getValue(), Attachment::ParentsFieldMask);
00399
00400 subRefCP(_sfTexCoords4.getValue());
00401 }
00402
00403 if(value != NullFC)
00404 {
00405 thisP.setParentFieldPos(TexCoords4FieldId);
00406
00407 beginEditCP(value, Attachment::ParentsFieldMask);
00408 {
00409 value->addParent(thisP);
00410 }
00411 beginEditCP(value, Attachment::ParentsFieldMask);
00412 }
00413
00414 _sfTexCoords4.setValue(value);
00415 }
00416
00417 inline
00418 void Geometry::setTexCoords5(const GeoTexCoordsPtr &value)
00419 {
00420 GeometryPtr thisP = getPtr();
00421
00422 addRefCP(value);
00423
00424 if(_sfTexCoords5.getValue() != NullFC)
00425 {
00426 beginEditCP(_sfTexCoords5.getValue(), Attachment::ParentsFieldMask);
00427 {
00428 _sfTexCoords5.getValue()->subParent(thisP);
00429 }
00430 beginEditCP(_sfTexCoords5.getValue(), Attachment::ParentsFieldMask);
00431
00432 subRefCP(_sfTexCoords5.getValue());
00433 }
00434
00435 if(value != NullFC)
00436 {
00437 thisP.setParentFieldPos(TexCoords5FieldId);
00438
00439 beginEditCP(value, Attachment::ParentsFieldMask);
00440 {
00441 value->addParent(thisP);
00442 }
00443 beginEditCP(value, Attachment::ParentsFieldMask);
00444 }
00445
00446 _sfTexCoords5.setValue(value);
00447 }
00448
00449 inline
00450 void Geometry::setTexCoords6(const GeoTexCoordsPtr &value)
00451 {
00452 GeometryPtr thisP = getPtr();
00453
00454 addRefCP(value);
00455
00456 if(_sfTexCoords6.getValue() != NullFC)
00457 {
00458 beginEditCP(_sfTexCoords6.getValue(), Attachment::ParentsFieldMask);
00459 {
00460 _sfTexCoords6.getValue()->subParent(thisP);
00461 }
00462 beginEditCP(_sfTexCoords6.getValue(), Attachment::ParentsFieldMask);
00463
00464 subRefCP(_sfTexCoords6.getValue());
00465 }
00466
00467 if(value != NullFC)
00468 {
00469 thisP.setParentFieldPos(TexCoords6FieldId);
00470
00471 beginEditCP(value, Attachment::ParentsFieldMask);
00472 {
00473 value->addParent(thisP);
00474 }
00475 beginEditCP(value, Attachment::ParentsFieldMask);
00476 }
00477
00478 _sfTexCoords6.setValue(value);
00479 }
00480
00481 inline
00482 void Geometry::setTexCoords7(const GeoTexCoordsPtr &value)
00483 {
00484 GeometryPtr thisP = getPtr();
00485
00486 addRefCP(value);
00487
00488 if(_sfTexCoords7.getValue() != NullFC)
00489 {
00490 beginEditCP(_sfTexCoords7.getValue(), Attachment::ParentsFieldMask);
00491 {
00492 _sfTexCoords7.getValue()->subParent(thisP);
00493 }
00494 beginEditCP(_sfTexCoords7.getValue(), Attachment::ParentsFieldMask);
00495
00496 subRefCP(_sfTexCoords7.getValue());
00497 }
00498
00499 if(value != NullFC)
00500 {
00501 thisP.setParentFieldPos(TexCoords7FieldId);
00502
00503 beginEditCP(value, Attachment::ParentsFieldMask);
00504 {
00505 value->addParent(thisP);
00506 }
00507 beginEditCP(value, Attachment::ParentsFieldMask);
00508 }
00509
00510 _sfTexCoords7.setValue(value);
00511 }
00512
00513 inline
00514 void Geometry::setIndices(const GeoIndicesPtr &value)
00515 {
00516 GeometryPtr thisP = getPtr();
00517
00518 addRefCP(value);
00519
00520 if(_sfIndices.getValue() != NullFC)
00521 {
00522 beginEditCP(_sfIndices.getValue(), Attachment::ParentsFieldMask);
00523 {
00524 _sfIndices.getValue()->subParent(thisP);
00525 }
00526 endEditCP (_sfIndices.getValue(), Attachment::ParentsFieldMask);
00527
00528 subRefCP(_sfIndices.getValue());
00529 }
00530
00531 if(value != NullFC)
00532 {
00533 thisP.setParentFieldPos(IndicesFieldId);
00534
00535 beginEditCP(value, Attachment::ParentsFieldMask);
00536 {
00537 value->addParent(thisP);
00538 }
00539 endEditCP (value, Attachment::ParentsFieldMask);
00540 }
00541
00542 _sfIndices.setValue(value);
00543 }
00544
00545 inline
00546 void Geometry::setMaterial(const MaterialPtr &value)
00547 {
00548 setRefdCP(_sfMaterial.getValue(), value);
00549 }
00550
00551
00552 OSG_END_NAMESPACE
00553
00554 #define OSGGEOMETRY_INLINE_CVSID "@(#)$Id: $"
00555