Visualization Library 2.1.0
A lightweight C++ OpenGL middleware for 2D/3D graphics
|
[Download] [Tutorials] [All Classes] [Grouped Classes] |
Defines the volume data to be used with a MarchingCube object. More...
#include <MarchingCubes.hpp>
Public Member Functions | |
Volume () | |
void | setup (float *data, bool use_directly, bool copy_data, const fvec3 &bottom_left, const fvec3 &top_right, const ivec3 &slices) |
Setup the volume data with the specified memory management. More... | |
void | setup (const Volume &) |
ref< Volume > | downsample () const |
Returns a new volume which is half of the size of the original volume in each direction (thus requires up to 1/8th of the memory). More... | |
const float * | values () const |
float * | values () |
const float & | value (int i) const |
float & | value (int i) |
const float & | value (int x, int y, int z) const |
float & | value (int x, int y, int z) |
void | normalHQ (fvec3 &normal, const fvec3 &v, float dx, float dy, float dz) |
Computes a high quality normal (best rendering quality) More... | |
void | normalLQ (fvec3 &normal, const fvec3 &v, float dx, float dy, float dz) |
Computes a low quality normal (best performances) More... | |
float | sampleSmooth (float x, float y, float z) const |
Samples the volume using tri-linear interpolation sampling. More... | |
float | sampleNearest (float x, float y, float z) const |
Samples the volume using nearest point sampling. More... | |
fvec3 | coordinate (int x, int y, int z) const |
const fvec3 & | bottomLeft () const |
const fvec3 & | topRight () const |
const ivec3 & | slices () const |
fvec3 | size () const |
float | computeMinimum () const |
float | computeMaximum () const |
float | computeAverage () const |
float | minimum () const |
float | maximum () const |
float | average () const |
const Volume::Cube & | cube (int x, int y, int z) const |
const fvec3 & | cellSize () const |
Returns the x/y/z size of a cell. More... | |
bool | dataIsDirty () const |
Returns true if the internal data hasn't been updated since the last call to setDataDirty() or setup() More... | |
void | setDataDirty () |
Notifies that the data of a Volume has changed and that the internal acceleration structures should be recomputed. More... | |
void | setupInternalData () |
Public Member Functions inherited from vl::Object | |
Object () | |
Constructor. More... | |
Object (const Object &other) | |
Copy constructor: copies the name, ref count mutex and user data. More... | |
Object & | operator= (const Object &other) |
Copy operator: copies the object's name, ref count mutex and user data. More... | |
const std::string & | objectName () const |
The name of the object, by default set to the object's class name. More... | |
void | setObjectName (const char *name) |
The name of the object, by default set to the object's class name in debug builds. More... | |
void | setObjectName (const std::string &name) |
The name of the object, by default set to the object's class name in debug builds. More... | |
void | setRefCountMutex (IMutex *mutex) |
The mutex used to protect the reference counting of an Object across multiple threads. More... | |
IMutex * | refCountMutex () |
The mutex used to protect the reference counting of an Object across multiple threads. More... | |
const IMutex * | refCountMutex () const |
The mutex used to protect the reference counting of an Object across multiple threads. More... | |
int | referenceCount () const |
Returns the number of references of an object. More... | |
void | incReference () const |
Increments the reference count of an object. More... | |
void | decReference () |
Decrements the reference count of an object and deletes it if both automaticDelete() is true the count reaches 0. More... | |
void | setAutomaticDelete (bool autodel_on) |
If set to true the Object is deleted when its reference count reaches 0. More... | |
bool | automaticDelete () const |
If set to true the Object is deleted when its reference count reaches 0. More... | |
template<class T > | |
T * | as () |
Casts an Object to the specified class. More... | |
template<class T > | |
const T * | as () const |
Casts an Object to the specified class. More... | |
Protected Attributes | |
std::vector< float > | mInternalValues |
float * | mValues |
fvec3 | mBottomLeft |
fvec3 | mTopRight |
fvec3 | mSize |
ivec3 | mSlices |
fvec3 | mCellSize |
float | mMinimum |
float | mMaximum |
float | mAverage |
bool | mDataIsDirty |
std::vector< Cube > | mCubes |
Protected Attributes inherited from vl::Object | |
std::string | mObjectName |
IMutex * | mRefCountMutex |
int | mReferenceCount |
bool | mAutomaticDelete |
Additional Inherited Members | |
Protected Member Functions inherited from vl::Object | |
virtual | ~Object () |
Defines the volume data to be used with a MarchingCube object.
Definition at line 46 of file MarchingCubes.hpp.
Volume::Volume | ( | ) |
Definition at line 458 of file MarchingCubes.cpp.
References NULL.
|
inline |
Definition at line 120 of file MarchingCubes.hpp.
|
inline |
Definition at line 102 of file MarchingCubes.hpp.
|
inline |
Returns the x/y/z size of a cell.
Definition at line 131 of file MarchingCubes.hpp.
Referenced by vl::MarchingCubes::computeEdges().
float Volume::computeAverage | ( | ) | const |
Definition at line 685 of file MarchingCubes.cpp.
References vl::MarchingCubes::mCubeEdgeFlags, and vl::MarchingCubes::mTriangleConnectionTable.
float Volume::computeMaximum | ( | ) | const |
Definition at line 673 of file MarchingCubes.cpp.
float Volume::computeMinimum | ( | ) | const |
Definition at line 661 of file MarchingCubes.cpp.
|
inline |
Definition at line 100 of file MarchingCubes.hpp.
Referenced by vl::MarchingCubes::computeEdges().
|
inline |
Definition at line 122 of file MarchingCubes.hpp.
References VL_CHECK, vl::Vector3< T_Scalar >::x(), and vl::Vector3< T_Scalar >::y().
Referenced by vl::MarchingCubes::computeEdges().
|
inline |
Returns true if the internal data hasn't been updated since the last call to setDataDirty() or setup()
Definition at line 134 of file MarchingCubes.hpp.
Referenced by vl::MarchingCubes::run().
Returns a new volume which is half of the size of the original volume in each direction (thus requires up to 1/8th of the memory).
Use this function when the volume data to be processed is too big or produces too many polygons.
Definition at line 464 of file MarchingCubes.cpp.
|
inline |
Definition at line 118 of file MarchingCubes.hpp.
|
inline |
Definition at line 116 of file MarchingCubes.hpp.
Computes a high quality normal (best rendering quality)
Definition at line 639 of file MarchingCubes.cpp.
References vl::Vector3< T_Scalar >::normalize(), vl::Vector3< T_Scalar >::x(), vl::Vector3< T_Scalar >::y(), and vl::Vector3< T_Scalar >::z().
Referenced by vl::MarchingCubes::computeEdges().
Computes a low quality normal (best performances)
Definition at line 650 of file MarchingCubes.cpp.
References vl::Vector3< T_Scalar >::normalize(), vl::Vector3< T_Scalar >::x(), vl::Vector3< T_Scalar >::y(), and vl::Vector3< T_Scalar >::z().
float Volume::sampleNearest | ( | float | x, |
float | y, | ||
float | z | ||
) | const |
Samples the volume using nearest point sampling.
Definition at line 584 of file MarchingCubes.cpp.
float Volume::sampleSmooth | ( | float | x, |
float | y, | ||
float | z | ||
) | const |
Samples the volume using tri-linear interpolation sampling.
Definition at line 603 of file MarchingCubes.cpp.
|
inline |
Notifies that the data of a Volume has changed and that the internal acceleration structures should be recomputed.
Definition at line 137 of file MarchingCubes.hpp.
void Volume::setup | ( | float * | data, |
bool | use_directly, | ||
bool | copy_data, | ||
const fvec3 & | bottom_left, | ||
const fvec3 & | top_right, | ||
const ivec3 & | slices | ||
) |
Setup the volume data with the specified memory management.
data | The buffer containing the volume data. Can be NULL only if use_directly == false and copy_data == false . |
use_directly | If true the buffer will be used directly and no internal copy will be done. |
copy_data | If true the buffer pointed by data will be copied in the internal buffer used to store the volume data. The copy_data parameter is ignored if use_directly is set to true . |
Definition at line 541 of file MarchingCubes.cpp.
References VL_CHECK, vl::Vector3< T_Scalar >::x(), vl::Vector3< T_Scalar >::y(), and vl::Vector3< T_Scalar >::z().
Referenced by vl::VolumePlot::compute(), and downsample().
void Volume::setup | ( | const Volume & | volume | ) |
Definition at line 575 of file MarchingCubes.cpp.
void Volume::setupInternalData | ( | ) |
Definition at line 504 of file MarchingCubes.cpp.
Referenced by vl::MarchingCubes::run().
|
inline |
Definition at line 108 of file MarchingCubes.hpp.
|
inline |
Definition at line 106 of file MarchingCubes.hpp.
Referenced by vl::MarchingCubes::computeEdges(), and vl::MarchingCubes::processCube().
|
inline |
Definition at line 104 of file MarchingCubes.hpp.
|
inline |
Definition at line 80 of file MarchingCubes.hpp.
Referenced by vl::MarchingCubes::computeEdges(), downsample(), and vl::MarchingCubes::processCube().
|
inline |
Definition at line 82 of file MarchingCubes.hpp.
|
inline |
Definition at line 84 of file MarchingCubes.hpp.
|
inline |
Definition at line 86 of file MarchingCubes.hpp.
|
inline |
Definition at line 76 of file MarchingCubes.hpp.
Referenced by vl::VolumePlot::compute().
|
inline |
Definition at line 78 of file MarchingCubes.hpp.
|
protected |
Definition at line 151 of file MarchingCubes.hpp.
|
protected |
Definition at line 144 of file MarchingCubes.hpp.
|
protected |
Definition at line 148 of file MarchingCubes.hpp.
|
protected |
Definition at line 154 of file MarchingCubes.hpp.
|
protected |
Definition at line 152 of file MarchingCubes.hpp.
|
protected |
Definition at line 142 of file MarchingCubes.hpp.
|
protected |
Definition at line 150 of file MarchingCubes.hpp.
|
protected |
Definition at line 149 of file MarchingCubes.hpp.
|
protected |
Definition at line 146 of file MarchingCubes.hpp.
|
protected |
Definition at line 147 of file MarchingCubes.hpp.
|
protected |
Definition at line 145 of file MarchingCubes.hpp.
|
protected |
Definition at line 143 of file MarchingCubes.hpp.
Visualization Library 2.1.0 Reference Documentation
Updated on Wed Mar 10 2021 16:02:55.
© Copyright Michele Bosi. All rights reserved.