Changeset 13041 for OpenSceneGraph/trunk/include/osg/Array
- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
-
OpenSceneGraph/trunk/include/osg/Array (modified) (19 diffs)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osg/Array
r12912 r13041 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 2 2 * 3 * This library is open source and may be redistributed and/or modified under 4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 3 * This library is open source and may be redistributed and/or modified under 4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 5 5 * (at your option) any later version. The full license is in LICENSE file 6 6 * included with this distribution, and on the openscenegraph.org website. 7 * 7 * 8 8 * This library is distributed in the hope that it will be useful, 9 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 11 * OpenSceneGraph Public License for more details. 12 12 */ … … 49 49 50 50 public: 51 51 52 52 enum Type 53 53 { … … 74 74 Vec3dArrayType = 20, 75 75 Vec4dArrayType = 21, 76 MatrixArrayType = 22 76 MatrixArrayType = 22 77 77 }; 78 78 … … 145 145 MixinVector<T>(ta) {} 146 146 147 TemplateArray(unsigned int no) : 147 TemplateArray(unsigned int no) : 148 148 Array(ARRAYTYPE,DataSize,DataType), 149 149 MixinVector<T>(no) {} 150 150 151 TemplateArray(unsigned int no,const T* ptr) : 151 TemplateArray(unsigned int no,const T* ptr) : 152 152 Array(ARRAYTYPE,DataSize,DataType), 153 153 MixinVector<T>(ptr,ptr+no) {} 154 154 155 155 template <class InputIterator> 156 TemplateArray(InputIterator first,InputIterator last) : 156 TemplateArray(InputIterator first,InputIterator last) : 157 157 Array(ARRAYTYPE,DataSize,DataType), 158 MixinVector<T>(first,last) {} 158 MixinVector<T>(first,last) {} 159 159 160 160 TemplateArray& operator = (const TemplateArray& array) … … 163 163 this->assign(array.begin(),array.end()); 164 164 return *this; 165 } 165 } 166 166 167 167 virtual Object* cloneType() const { return new TemplateArray(); } 168 virtual Object* clone(const CopyOp& copyop) const { return new TemplateArray(*this,copyop); } 168 virtual Object* clone(const CopyOp& copyop) const { return new TemplateArray(*this,copyop); } 169 169 170 170 inline virtual void accept(ArrayVisitor& av); … … 196 196 197 197 protected: 198 198 199 199 virtual ~TemplateArray() {} 200 200 }; … … 231 231 MixinVector<T>(ta) {} 232 232 233 TemplateIndexArray(unsigned int no) : 233 TemplateIndexArray(unsigned int no) : 234 234 IndexArray(ARRAYTYPE,DataSize,DataType), 235 235 MixinVector<T>(no) {} 236 236 237 TemplateIndexArray(unsigned int no,T* ptr) : 237 TemplateIndexArray(unsigned int no,T* ptr) : 238 238 IndexArray(ARRAYTYPE,DataSize,DataType), 239 239 MixinVector<T>(ptr,ptr+no) {} 240 240 241 241 template <class InputIterator> 242 TemplateIndexArray(InputIterator first,InputIterator last) : 242 TemplateIndexArray(InputIterator first,InputIterator last) : 243 243 IndexArray(ARRAYTYPE,DataSize,DataType), 244 MixinVector<T>(first,last) {} 244 MixinVector<T>(first,last) {} 245 245 246 246 TemplateIndexArray& operator = (const TemplateIndexArray& array) … … 249 249 this->assign(array.begin(),array.end()); 250 250 return *this; 251 } 251 } 252 252 253 253 virtual Object* cloneType() const { return new TemplateIndexArray(); } 254 virtual Object* clone(const CopyOp& copyop) const { return new TemplateIndexArray(*this,copyop); } 254 virtual Object* clone(const CopyOp& copyop) const { return new TemplateIndexArray(*this,copyop); } 255 255 256 256 inline virtual void accept(ArrayVisitor& av); … … 324 324 ArrayVisitor() {} 325 325 virtual ~ArrayVisitor() {} 326 326 327 327 virtual void apply(Array&) {} 328 328 virtual void apply(ByteArray&) {} … … 338 338 virtual void apply(Vec3Array&) {} 339 339 virtual void apply(Vec4Array&) {} 340 340 341 341 virtual void apply(Vec4ubArray&) {} 342 342 343 virtual void apply(Vec2bArray&) {} 344 virtual void apply(Vec3bArray&) {} 345 virtual void apply(Vec4bArray&) {} 343 virtual void apply(Vec2bArray&) {} 344 virtual void apply(Vec3bArray&) {} 345 virtual void apply(Vec4bArray&) {} 346 346 347 347 virtual void apply(Vec2sArray&) {} … … 352 352 virtual void apply(Vec3dArray&) {} 353 353 virtual void apply(Vec4dArray&) {} 354 354 355 355 virtual void apply(MatrixfArray&) {} 356 356 }; … … 361 361 ConstArrayVisitor() {} 362 362 virtual ~ConstArrayVisitor() {} 363 363 364 364 virtual void apply(const Array&) {} 365 365 virtual void apply(const ByteArray&) {} … … 378 378 virtual void apply(const Vec4ubArray&) {} 379 379 380 virtual void apply(const Vec2bArray&) {} 381 virtual void apply(const Vec3bArray&) {} 382 virtual void apply(const Vec4bArray&) {} 380 virtual void apply(const Vec2bArray&) {} 381 virtual void apply(const Vec3bArray&) {} 382 virtual void apply(const Vec4bArray&) {} 383 383 384 384 virtual void apply(const Vec2sArray&) {} … … 389 389 virtual void apply(const Vec3dArray&) {} 390 390 virtual void apply(const Vec4dArray&) {} 391 391 392 392 virtual void apply(const MatrixfArray&) {} 393 393 }; … … 399 399 ValueVisitor() {} 400 400 virtual ~ValueVisitor() {} 401 401 402 402 virtual void apply(GLbyte&) {} 403 403 virtual void apply(GLshort&) {} … … 408 408 virtual void apply(GLfloat&) {} 409 409 virtual void apply(GLdouble&) {} 410 411 410 411 412 412 virtual void apply(Vec2&) {} 413 413 virtual void apply(Vec3&) {} 414 414 virtual void apply(Vec4&) {} 415 415 416 416 virtual void apply(Vec4ub&) {} 417 417 418 virtual void apply(Vec2b&) {} 419 virtual void apply(Vec3b&) {} 420 virtual void apply(Vec4b&) {} 418 virtual void apply(Vec2b&) {} 419 virtual void apply(Vec3b&) {} 420 virtual void apply(Vec4b&) {} 421 421 422 422 virtual void apply(Vec2s&) {} … … 427 427 virtual void apply(Vec3d&) {} 428 428 virtual void apply(Vec4d&) {} 429 429 430 430 virtual void apply(Matrixf&) {} 431 431 }; … … 436 436 ConstValueVisitor() {} 437 437 virtual ~ConstValueVisitor() {} 438 438 439 439 virtual void apply(const GLbyte&) {} 440 440 virtual void apply(const GLshort&) {} … … 454 454 virtual void apply(const Vec2b&) {} 455 455 virtual void apply(const Vec3b&) {} 456 virtual void apply(const Vec4b&) {} 457 456 virtual void apply(const Vec4b&) {} 457 458 458 virtual void apply(const Vec2s&) {} 459 459 virtual void apply(const Vec3s&) {} 460 460 virtual void apply(const Vec4s&) {} 461 461 462 462 virtual void apply(const Vec2d&) {} 463 463 virtual void apply(const Vec3d&) {} 464 464 virtual void apply(const Vec4d&) {} 465 465 466 466 virtual void apply(const Matrixf&) {} 467 467 };
