Ignore:
Timestamp:
Dec 22, 2014, 4:18:59 AM (10 years ago)
Author:
ldelgass
Message:

Merge serveral changes from trunk. Does not include threading, world space
changes, etc.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nanovis/branches/1.1/Volume.h

    r4889 r4904  
    2121namespace nv {
    2222
    23 struct CutPlane {
    24     /// orientation - 1: xy slice, 2: yz slice, 3: xz slice
    25     int orient;
    26     float offset;       ///< normalized offset [0,1] in the volume
    27     bool enabled;
    28 
    29     CutPlane(int _orient, float _offset) :
     23class CutPlane {
     24public:
     25    enum Axis {
     26        X_AXIS = 1,
     27        Y_AXIS = 2,
     28        Z_AXIS = 3
     29    };
     30
     31    CutPlane(Axis _orient, float _offset) :
    3032        orient(_orient),
    3133        offset(_offset),
     
    3335    {
    3436    }
     37
     38    Axis orient;
     39    float offset;       ///< normalized offset [0,1] in the volume
     40    bool enabled;
    3541};
    3642
     
    98104    }
    99105
    100     void location(const vrmath::Vector3f& loc)
    101     {
    102         _location = loc;
    103     }
    104 
    105     vrmath::Vector3f location() const
    106     {
    107         return _location;
    108     }
    109 
    110106    int isosurface() const
    111107    {
     
    155151    // methods related to cutplanes
    156152    /// add a plane and returns its index
    157     int addCutplane(int orientation, float location);
     153    int addCutplane(CutPlane::Axis orientation, float location);
    158154
    159155    void enableCutplane(int index);
     
    171167    }
    172168
    173     void moveCutplane(int index, float location);
     169    void setCutplanePosition(int index, float location);
    174170
    175171    CutPlane *getCutplane(int index);
     
    292288
    293289    void getOutlineColor(float *rgb);
     290
     291    void setPosition(const vrmath::Vector3f& pos)
     292    {
     293        _position = pos;
     294    }
     295
     296    const vrmath::Vector3f& getPosition() const
     297    {
     298        return _position;
     299    }
    294300
    295301    vrmath::Vector3f getPhysicalScaling() const
     
    300306        scale.z = zAxis.length() / xAxis.length();
    301307        return scale;
     308    }
     309
     310    void setScale(const vrmath::Vector3f& scale)
     311    {
     312        _scale = scale;
     313    }
     314
     315    const vrmath::Vector3f& getScale() const
     316    {
     317        return _scale;
    302318    }
    303319
     
    380396    /**
    381397     * The scale multiplied to the opacity assigned by the
    382      * transfer function. Rule of thumb: higher opacity_scale
    383      * the object is to appear like plastic
     398     * transfer function.
    384399     */
    385400    float _opacityScale;
     
    398413    Texture3D *_tex;            ///< OpenGL texture storing the volume
    399414
    400     vrmath::Vector3f _location;
     415    vrmath::Vector3f _position;
     416    vrmath::Vector3f _scale;
    401417
    402418    /**
     
    414430
    415431inline int
    416 Volume::addCutplane(int orientation, float location)
     432Volume::addCutplane(CutPlane::Axis orientation, float location)
    417433{
    418434    _plane.push_back(CutPlane(orientation, location));
     
    435451
    436452inline void
    437 Volume::moveCutplane(int index, float location)
     453Volume::setCutplanePosition(int index, float position)
    438454{
    439455    //assert(index < plane.size());
    440     _plane[index].offset = location;
     456    _plane[index].offset = position;
    441457}
    442458
Note: See TracChangeset for help on using the changeset viewer.