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
00386 inline
00387 void Geometry::setIndices(const GeoIndicesPtr &value)
00388 {
00389 GeometryPtr thisP = getPtr();
00390
00391 addRefCP(value);
00392
00393 if(_sfIndices.getValue() != NullFC)
00394 {
00395 beginEditCP(_sfIndices.getValue(), Attachment::ParentsFieldMask);
00396 {
00397 _sfIndices.getValue()->subParent(thisP);
00398 }
00399 endEditCP (_sfIndices.getValue(), Attachment::ParentsFieldMask);
00400
00401 subRefCP(_sfIndices.getValue());
00402 }
00403
00404 if(value != NullFC)
00405 {
00406 thisP.setParentFieldPos(IndicesFieldId);
00407
00408 beginEditCP(value, Attachment::ParentsFieldMask);
00409 {
00410 value->addParent(thisP);
00411 }
00412 endEditCP (value, Attachment::ParentsFieldMask);
00413 }
00414
00415 _sfIndices.setValue(value);
00416 }
00417
00418 inline
00419 void Geometry::setMaterial(const MaterialPtr &value)
00420 {
00421 setRefdCP(_sfMaterial.getValue(), value);
00422 }
00423
00424
00425 OSG_END_NAMESPACE
00426
00427 #define OSGGEOMETRY_INLINE_CVSID "@(#)$Id: $"
00428