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

Ran script to remove trailing spaces and tabs

Files:
1 modified

Legend:

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

    r12139 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*/ 
     
    2424 
    2525/** TransferFunction is a class that provide a 1D,2D or 3D colour look up table 
    26   * that can be used on the GPU as a 1D, 2D or 3D texture.   
    27   * Typically uses include mapping heights to colours when contouring terrain,  
     26  * that can be used on the GPU as a 1D, 2D or 3D texture. 
     27  * Typically uses include mapping heights to colours when contouring terrain, 
    2828  * or mapping intensities to colours when volume rendering. 
    2929*/ 
     
    3131{ 
    3232    public : 
    33      
     33 
    3434        TransferFunction(); 
    3535 
     
    4444        /** Get the const image that is used for passing the transfer function data to the GPU.*/ 
    4545        const osg::Image* getImage() const { return _image.get(); } 
    46          
     46 
    4747    protected: 
    48      
     48 
    4949        virtual ~TransferFunction(); 
    5050 
     
    5656{ 
    5757    public: 
    58      
     58 
    5959        TransferFunction1D(); 
    60      
     60 
    6161       /** Copy constructor using CopyOp to manage deep vs shallow copy.*/ 
    6262        TransferFunction1D(const TransferFunction1D& tf, const CopyOp& copyop=CopyOp::SHALLOW_COPY); 
    6363 
    6464        META_Object(osg, TransferFunction1D) 
    65          
     65 
    6666        /** Get the minimum transfer function value.*/ 
    6767        float getMinimum() const { return _colorMap.empty() ? 0.0f : _colorMap.begin()->first; } 
    68          
     68 
    6969        /** Get the maximum transfer function value.*/ 
    7070        float getMaximum() const { return _colorMap.empty() ? 0.0f : _colorMap.rbegin()->first; } 
     
    7676        /** Clear the whole range to just represent a single color.*/ 
    7777        void clear(const osg::Vec4& color = osg::Vec4(1.0f,1.0f,1.0f,1.0f)); 
    78          
     78 
    7979        /** Get pixel value from the image. */ 
    8080        osg::Vec4 getPixelValue(unsigned int i) const 
    8181        { 
    8282            if (_image.valid() && i<static_cast<unsigned int>(_image->s())) 
    83             {    
     83            { 
    8484                return *reinterpret_cast<osg::Vec4*>(_image->data(i)); 
    8585            } 
     
    9797          * tracks the color map.  Pass in false as the updateImage parameter if you are setting up many values 
    9898          * at once to avoid recomputation of the image data, then once all setColor calls are made explictly call 
    99           * updateImage() to bring the osg::Image back into sync with the color map. */  
     99          * updateImage() to bring the osg::Image back into sync with the color map. */ 
    100100        void setColor(float v, const osg::Vec4& color, bool updateImage=true); 
    101          
     101 
    102102        /** Get the color for a specified transfer function value, interpolating the value if no exact match is found.*/ 
    103103        osg::Vec4 getColor(float v) const; 
    104          
     104 
    105105        typedef std::map<float, osg::Vec4> ColorMap; 
    106          
     106 
    107107        /** Get the color map that stores the mapping between the the transfer function value and the colour it maps to.*/ 
    108108        ColorMap& getColorMap() { return _colorMap; } 
    109          
     109 
    110110        /** Get the const color map that stores the mapping between the the transfer function value and the colour it maps to.*/ 
    111111        const ColorMap& getColorMap() const { return _colorMap; } 
     
    113113        /** Assign a color map and automatically update the image to make sure they are in sync.*/ 
    114114        void assign(const ColorMap& vcm); 
    115          
     115 
    116116        /** Manually update the associate osg::Image to represent the colors assigned in the color map.*/ 
    117117        void updateImage(); 
    118118 
    119119    protected: 
    120      
     120 
    121121        ColorMap _colorMap; 
    122          
     122 
    123123        void assignToImage(float lower_v, const osg::Vec4& lower_c, float upper_v, const osg::Vec4& upper_c); 
    124124};