Changeset 4904 for nanovis/branches/1.1/Volume.h
- Timestamp:
- Dec 22, 2014, 4:18:59 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
nanovis/branches/1.1/Volume.h
r4889 r4904 21 21 namespace nv { 22 22 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) : 23 class CutPlane { 24 public: 25 enum Axis { 26 X_AXIS = 1, 27 Y_AXIS = 2, 28 Z_AXIS = 3 29 }; 30 31 CutPlane(Axis _orient, float _offset) : 30 32 orient(_orient), 31 33 offset(_offset), … … 33 35 { 34 36 } 37 38 Axis orient; 39 float offset; ///< normalized offset [0,1] in the volume 40 bool enabled; 35 41 }; 36 42 … … 98 104 } 99 105 100 void location(const vrmath::Vector3f& loc)101 {102 _location = loc;103 }104 105 vrmath::Vector3f location() const106 {107 return _location;108 }109 110 106 int isosurface() const 111 107 { … … 155 151 // methods related to cutplanes 156 152 /// add a plane and returns its index 157 int addCutplane( intorientation, float location);153 int addCutplane(CutPlane::Axis orientation, float location); 158 154 159 155 void enableCutplane(int index); … … 171 167 } 172 168 173 void moveCutplane(int index, float location);169 void setCutplanePosition(int index, float location); 174 170 175 171 CutPlane *getCutplane(int index); … … 292 288 293 289 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 } 294 300 295 301 vrmath::Vector3f getPhysicalScaling() const … … 300 306 scale.z = zAxis.length() / xAxis.length(); 301 307 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; 302 318 } 303 319 … … 380 396 /** 381 397 * 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. 384 399 */ 385 400 float _opacityScale; … … 398 413 Texture3D *_tex; ///< OpenGL texture storing the volume 399 414 400 vrmath::Vector3f _location; 415 vrmath::Vector3f _position; 416 vrmath::Vector3f _scale; 401 417 402 418 /** … … 414 430 415 431 inline int 416 Volume::addCutplane( intorientation, float location)432 Volume::addCutplane(CutPlane::Axis orientation, float location) 417 433 { 418 434 _plane.push_back(CutPlane(orientation, location)); … … 435 451 436 452 inline void 437 Volume:: moveCutplane(int index, float location)453 Volume::setCutplanePosition(int index, float position) 438 454 { 439 455 //assert(index < plane.size()); 440 _plane[index].offset = location;456 _plane[index].offset = position; 441 457 } 442 458
Note: See TracChangeset
for help on using the changeset viewer.