Show
Ignore:
Timestamp:
03/21/12 18:36:20 (2 years ago)
Author:
robert
Message:

Ran script to remove trailing spaces and tabs

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/include/osg/PrimitiveSet

    r12912 r13041  
    1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield  
     1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 
    22 * 
    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 
    55 * (at your option) any later version.  The full license is in LICENSE file 
    66 * included with this distribution, and on the openscenegraph.org website. 
    7  *  
     7 * 
    88 * This library is distributed in the hope that it will be useful, 
    99 * 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 
    1111 * OpenSceneGraph Public License for more details. 
    1212*/ 
     
    152152{ 
    153153    public: 
    154      
     154 
    155155        enum Type 
    156156        { 
     
    175175            QUAD_STRIP = GL_QUAD_STRIP, 
    176176            POLYGON = GL_POLYGON, 
    177             LINES_ADJACENCY = GL_LINES_ADJACENCY_EXT,  
    178             LINE_STRIP_ADJACENCY = GL_LINE_STRIP_ADJACENCY_EXT,  
    179             TRIANGLES_ADJACENCY = GL_TRIANGLES_ADJACENCY_EXT,  
     177            LINES_ADJACENCY = GL_LINES_ADJACENCY_EXT, 
     178            LINE_STRIP_ADJACENCY = GL_LINE_STRIP_ADJACENCY_EXT, 
     179            TRIANGLES_ADJACENCY = GL_TRIANGLES_ADJACENCY_EXT, 
    180180            TRIANGLE_STRIP_ADJACENCY = GL_TRIANGLE_STRIP_ADJACENCY_EXT, 
    181181            PATCHES = GL_PATCHES 
     
    186186            _numInstances(numInstances), 
    187187            _mode(mode) {} 
    188      
     188 
    189189        PrimitiveSet(const PrimitiveSet& prim,const CopyOp& copyop=CopyOp::SHALLOW_COPY): 
    190190            BufferData(prim,copyop), 
     
    196196        virtual const char* libraryName() const { return "osg"; } 
    197197        virtual const char* className() const { return "PrimitiveSet"; } 
    198          
     198 
    199199        Type                    getType() const { return _primitiveType; } 
    200200 
     
    208208        virtual DrawElements* getDrawElements() { return 0; } 
    209209        virtual const DrawElements* getDrawElements() const { return 0; } 
    210              
     210 
    211211        void setNumInstances(int n) { _numInstances = n; } 
    212212        int getNumInstances() const { return _numInstances; } 
     
    216216 
    217217        virtual void draw(State& state, bool useVertexBufferObjects) const = 0; 
    218          
     218 
    219219        virtual void accept(PrimitiveFunctor& functor) const = 0; 
    220220        virtual void accept(PrimitiveIndexFunctor& functor) const = 0; 
    221          
     221 
    222222        virtual unsigned int index(unsigned int pos) const = 0; 
    223223        virtual unsigned int getNumIndices() const = 0; 
    224224        virtual void offsetIndices(int offset) = 0; 
    225225 
    226         virtual unsigned int getNumPrimitives() const;  
     226        virtual unsigned int getNumPrimitives() const; 
    227227 
    228228        virtual void computeRange() const {} 
     
    245245            _first(0), 
    246246            _count(0) {} 
    247      
     247 
    248248        DrawArrays(GLenum mode, GLint first, GLsizei count, int numInstances=0): 
    249249            PrimitiveSet(DrawArraysPrimitiveType, mode, numInstances), 
     
    257257 
    258258        virtual Object* cloneType() const { return new DrawArrays(); } 
    259         virtual Object* clone(const CopyOp& copyop) const { return new DrawArrays(*this,copyop); }         
     259        virtual Object* clone(const CopyOp& copyop) const { return new DrawArrays(*this,copyop); } 
    260260        virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const DrawArrays*>(obj)!=NULL; } 
    261261        virtual const char* libraryName() const { return "osg"; } 
    262262        virtual const char* className() const { return "DrawArrays"; } 
    263          
     263 
    264264 
    265265        void set(GLenum mode,GLint first, GLsizei count) 
     
    272272        void setFirst(GLint first) { _first = first; } 
    273273        GLint getFirst() const { return _first; } 
    274          
     274 
    275275        void setCount(GLsizei count) { _count = count; } 
    276276        GLsizei getCount() const { return _count; } 
    277277 
    278278        virtual void draw(State& state, bool useVertexBufferObjects) const; 
    279          
     279 
    280280        virtual void accept(PrimitiveFunctor& functor) const; 
    281281        virtual void accept(PrimitiveIndexFunctor& functor) const; 
    282          
     282 
    283283        virtual unsigned int getNumIndices() const { return static_cast<unsigned int>(_count); } 
    284284        virtual unsigned int index(unsigned int pos) const { return static_cast<unsigned int>(_first)+pos; } 
     
    302302            PrimitiveSet(DrawArrayLengthsPrimitiveType,mode), 
    303303            _first(0) {} 
    304      
     304 
    305305        DrawArrayLengths(const DrawArrayLengths& dal,const CopyOp& copyop=CopyOp::SHALLOW_COPY): 
    306306            PrimitiveSet(dal,copyop), 
     
    308308            _first(dal._first) {} 
    309309 
    310         DrawArrayLengths(GLenum mode, GLint first, unsigned int no, GLsizei* ptr) :  
     310        DrawArrayLengths(GLenum mode, GLint first, unsigned int no, GLsizei* ptr) : 
    311311            PrimitiveSet(DrawArrayLengthsPrimitiveType,mode), 
    312312            vector_type(ptr,ptr+no), 
    313313            _first(first) {} 
    314314 
    315         DrawArrayLengths(GLenum mode,GLint first, unsigned int no) :  
     315        DrawArrayLengths(GLenum mode,GLint first, unsigned int no) : 
    316316            PrimitiveSet(DrawArrayLengthsPrimitiveType,mode), 
    317317            vector_type(no), 
    318318            _first(first) {} 
    319319 
    320         DrawArrayLengths(GLenum mode,GLint first) :  
     320        DrawArrayLengths(GLenum mode,GLint first) : 
    321321            PrimitiveSet(DrawArrayLengthsPrimitiveType,mode), 
    322322            vector_type(), 
     
    325325 
    326326        virtual Object* cloneType() const { return new DrawArrayLengths(); } 
    327         virtual Object* clone(const CopyOp& copyop) const { return new DrawArrayLengths(*this,copyop); }         
     327        virtual Object* clone(const CopyOp& copyop) const { return new DrawArrayLengths(*this,copyop); } 
    328328        virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const DrawArrayLengths*>(obj)!=NULL; } 
    329329        virtual const char* libraryName() const { return "osg"; } 
    330330        virtual const char* className() const { return "DrawArrayLengths"; } 
    331          
     331 
    332332 
    333333        void setFirst(GLint first) { _first = first; } 
    334334        GLint getFirst() const { return _first; } 
    335          
     335 
    336336        virtual void draw(State& state, bool useVertexBufferObjects) const; 
    337          
     337 
    338338        virtual void accept(PrimitiveFunctor& functor) const; 
    339339        virtual void accept(PrimitiveIndexFunctor& functor) const; 
    340          
     340 
    341341        virtual unsigned int getNumIndices() const; 
    342342        virtual unsigned int index(unsigned int pos) const { return _first+pos; } 
     
    355355{ 
    356356    public: 
    357          
     357 
    358358        DrawElements(Type primType=PrimitiveType, GLenum mode=0, int numInstances=0): 
    359359            PrimitiveSet(primType,mode, numInstances) {} 
    360      
     360 
    361361        DrawElements(const DrawElements& copy,const CopyOp& copyop=CopyOp::SHALLOW_COPY): 
    362362            PrimitiveSet(copy,copyop) {} 
     
    388388{ 
    389389    public: 
    390      
     390 
    391391        typedef VectorGLubyte vector_type; 
    392392 
    393393        DrawElementsUByte(GLenum mode=0): 
    394394            DrawElements(DrawElementsUBytePrimitiveType,mode) {} 
    395      
     395 
    396396        DrawElementsUByte(const DrawElementsUByte& array, const CopyOp& copyop=CopyOp::SHALLOW_COPY): 
    397397            DrawElements(array,copyop), 
     
    401401         * \param no Number of intended elements. This will be the size of the underlying vector. 
    402402         */ 
    403         DrawElementsUByte(GLenum mode, unsigned int no, const GLubyte* ptr, int numInstances=0) :  
     403        DrawElementsUByte(GLenum mode, unsigned int no, const GLubyte* ptr, int numInstances=0) : 
    404404            DrawElements(DrawElementsUBytePrimitiveType,mode,numInstances), 
    405405            vector_type(ptr,ptr+no) {} 
     
    408408         * \param no Number of intended elements. This will be the size of the underlying vector. 
    409409         */ 
    410         DrawElementsUByte(GLenum mode, unsigned int no) :  
     410        DrawElementsUByte(GLenum mode, unsigned int no) : 
    411411            DrawElements(DrawElementsUBytePrimitiveType,mode), 
    412412            vector_type(no) {} 
    413413 
    414414        virtual Object* cloneType() const { return new DrawElementsUByte(); } 
    415         virtual Object* clone(const CopyOp& copyop) const { return new DrawElementsUByte(*this,copyop); }         
     415        virtual Object* clone(const CopyOp& copyop) const { return new DrawElementsUByte(*this,copyop); } 
    416416        virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const DrawElementsUByte*>(obj)!=NULL; } 
    417417        virtual const char* libraryName() const { return "osg"; } 
     
    423423 
    424424        virtual void draw(State& state, bool useVertexBufferObjects) const ; 
    425          
     425 
    426426        virtual void accept(PrimitiveFunctor& functor) const; 
    427427        virtual void accept(PrimitiveIndexFunctor& functor) const; 
     
    430430        virtual unsigned int index(unsigned int pos) const { return (*this)[pos]; } 
    431431        virtual void offsetIndices(int offset); 
    432          
     432 
    433433        virtual void reserveElements(unsigned int numIndices) { reserve(numIndices); } 
    434434        virtual void setElement(unsigned int i, unsigned int v)  { (*this)[i] = v; } 
    435         virtual unsigned int getElement(unsigned int i) { return (*this)[i]; }  
    436         virtual void addElement(unsigned int v) { push_back(GLubyte(v)); }  
     435        virtual unsigned int getElement(unsigned int i) { return (*this)[i]; } 
     436        virtual void addElement(unsigned int v) { push_back(GLubyte(v)); } 
    437437 
    438438    protected: 
     
    450450        DrawElementsUShort(GLenum mode=0): 
    451451            DrawElements(DrawElementsUShortPrimitiveType,mode) {} 
    452      
     452 
    453453        DrawElementsUShort(const DrawElementsUShort& array,const CopyOp& copyop=CopyOp::SHALLOW_COPY): 
    454454            DrawElements(array,copyop), 
     
    458458         * \param no Number of intended elements. This will be the size of the underlying vector. 
    459459         */ 
    460         DrawElementsUShort(GLenum mode, unsigned int no, const GLushort* ptr, int numInstances=0) :  
     460        DrawElementsUShort(GLenum mode, unsigned int no, const GLushort* ptr, int numInstances=0) : 
    461461            DrawElements(DrawElementsUShortPrimitiveType,mode,numInstances), 
    462462            vector_type(ptr,ptr+no) {} 
     
    465465         * \param no Number of intended elements. This will be the size of the underlying vector. 
    466466         */ 
    467         DrawElementsUShort(GLenum mode, unsigned int no) :  
     467        DrawElementsUShort(GLenum mode, unsigned int no) : 
    468468            DrawElements(DrawElementsUShortPrimitiveType,mode), 
    469469            vector_type(no) {} 
    470470 
    471471        template <class InputIterator> 
    472         DrawElementsUShort(GLenum mode, InputIterator first,InputIterator last) :  
     472        DrawElementsUShort(GLenum mode, InputIterator first,InputIterator last) : 
    473473            DrawElements(DrawElementsUShortPrimitiveType,mode), 
    474474            vector_type(first,last) {} 
    475475 
    476476        virtual Object* cloneType() const { return new DrawElementsUShort(); } 
    477         virtual Object* clone(const CopyOp& copyop) const { return new DrawElementsUShort(*this,copyop); }         
     477        virtual Object* clone(const CopyOp& copyop) const { return new DrawElementsUShort(*this,copyop); } 
    478478        virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const DrawElementsUShort*>(obj)!=NULL; } 
    479479        virtual const char* libraryName() const { return "osg"; } 
     
    485485 
    486486        virtual void draw(State& state, bool useVertexBufferObjects) const; 
    487          
     487 
    488488        virtual void accept(PrimitiveFunctor& functor) const; 
    489489        virtual void accept(PrimitiveIndexFunctor& functor) const; 
     
    511511        DrawElementsUInt(GLenum mode=0): 
    512512            DrawElements(DrawElementsUIntPrimitiveType,mode) {} 
    513      
     513 
    514514        DrawElementsUInt(const DrawElementsUInt& array,const CopyOp& copyop=CopyOp::SHALLOW_COPY): 
    515515            DrawElements(array,copyop), 
     
    520520         * \param no Number of intended elements. This will be the size of the underlying vector. 
    521521         */ 
    522         DrawElementsUInt(GLenum mode, unsigned int no, const GLuint* ptr, int numInstances=0) :  
     522        DrawElementsUInt(GLenum mode, unsigned int no, const GLuint* ptr, int numInstances=0) : 
    523523            DrawElements(DrawElementsUIntPrimitiveType,mode,numInstances), 
    524524            vector_type(ptr,ptr+no) {} 
     
    527527         * \param no Number of intended elements. This will be the size of the underlying vector. 
    528528         */ 
    529         DrawElementsUInt(GLenum mode, unsigned int no) :  
     529        DrawElementsUInt(GLenum mode, unsigned int no) : 
    530530            DrawElements(DrawElementsUIntPrimitiveType,mode), 
    531531            vector_type(no) {} 
    532532 
    533533        template <class InputIterator> 
    534         DrawElementsUInt(GLenum mode, InputIterator first,InputIterator last) :  
     534        DrawElementsUInt(GLenum mode, InputIterator first,InputIterator last) : 
    535535            DrawElements(DrawElementsUIntPrimitiveType,mode), 
    536536            vector_type(first,last) {} 
    537537 
    538538        virtual Object* cloneType() const { return new DrawElementsUInt(); } 
    539         virtual Object* clone(const CopyOp& copyop) const { return new DrawElementsUInt(*this,copyop); }         
     539        virtual Object* clone(const CopyOp& copyop) const { return new DrawElementsUInt(*this,copyop); } 
    540540        virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const DrawElementsUInt*>(obj)!=NULL; } 
    541541        virtual const char* libraryName() const { return "osg"; } 
     
    547547 
    548548        virtual void draw(State& state, bool useVertexBufferObjects) const; 
    549          
     549 
    550550        virtual void accept(PrimitiveFunctor& functor) const; 
    551551        virtual void accept(PrimitiveIndexFunctor& functor) const;