Visualization Library 2.1.0
A lightweight C++ OpenGL middleware for 2D/3D graphics
|
[Download] [Tutorials] [All Classes] [Grouped Classes] |
Generates a 3D plot with labels and isosurface. The isosurface is generated using the MarchingCubes algorithm. More...
#include <VolumePlot.hpp>
Classes | |
class | Function |
A function to be used with VolumePlot. More... | |
Public Member Functions | |
VolumePlot () | |
Constructor. More... | |
void | compute (const Function &func, float threshold) |
Computes the function and generates the plot. This method should be called after all the other methods. More... | |
const Actor * | isosurfaceActor () const |
The Actor representing the isosurface. More... | |
Actor * | isosurfaceActor () |
The Actor representing the isosurface. More... | |
const Geometry * | isosurfaceGeometry () const |
The Geometry representing the isosurface. More... | |
Geometry * | isosurfaceGeometry () |
The Geometry representing the isosurface. More... | |
const Effect * | isosurfaceEffect () const |
Used to get/set the rendering options (like color, material, transparency) etc. of the isosurface. More... | |
Effect * | isosurfaceEffect () |
Used to get/set the rendering options (like color, material, transparency) etc. of the isosurface. More... | |
const Effect * | boxEffect () const |
Used to get/set the rendering options (like color, material, transparency) etc. of the box. More... | |
Effect * | boxEffect () |
Used to get/set the rendering options (like color, material, transparency) etc. of the box. More... | |
const fvec3 & | minCorner () const |
Default value: fvec3(-1,-1,-1) More... | |
void | setMinCorner (const fvec3 &min_corner) |
Default value: fvec3(-1,-1,-1) More... | |
const fvec3 & | maxCorner () const |
Default value: fvec3(+1,+1,+1) More... | |
void | setMaxCorner (const fvec3 &max_corner) |
Default value: fvec3(+1,+1,+1) More... | |
const Transform * | plotTransform () const |
The transform associated to the whole plot. More... | |
Transform * | plotTransform () |
The transform associated to the whole plot. More... | |
void | setPlotTransform (Transform *tr) |
The transform associated to the whole plot. More... | |
const ivec3 & | samplingResolution () const |
Default value: ivec3(64,64,64) More... | |
void | setSamplingResolution (const ivec3 &size) |
Default value: ivec3(64,64,64) More... | |
const String & | labelFormat () const |
Sets the format of the labels. More... | |
void | setLabelFormat (const String &format) |
Sets the format of the label to be generated, es. "(%.2n %.2n %.2n)" or "<%.3n, %.3n, %.3n>". More... | |
const Font * | labelFont () const |
The Font to be used for the box labels. More... | |
Font * | labelFont () |
The Font to be used for the box labels. More... | |
void | setLabelFont (Font *font) |
The Font to be used for the box labels. More... | |
const Text * | textTemplate () const |
A Text used to initialize the plot labels. More... | |
Text * | textTemplate () |
A Text used to initialize the plot labels. More... | |
ActorTree * | actorTreeMulti () |
const ActorTree * | actorTreeMulti () const |
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 Member Functions | |
void | setupLabels (const String &format, const fvec3 &min_corner, const fvec3 &max_corner, Font *font, Transform *root_tr) |
void | evaluateFunction (float *scalar, const fvec3 &min_corner, const fvec3 &max_corner, const Function &func) |
Protected Member Functions inherited from vl::Object | |
virtual | ~Object () |
Protected Attributes | |
std::vector< ref< Actor > > | mActors |
ref< Transform > | mPlotTransform |
ivec3 | mSamplingResolution |
String | mLabelFormat |
ref< Font > | mLabelFont |
fvec3 | mMinCorner |
fvec3 | mMaxCorner |
ref< Geometry > | mIsosurfaceGeometry |
ref< Actor > | mIsosurfaceActor |
ref< Effect > | mIsosurfaceEffect |
ref< Effect > | mBoxEffect |
ref< Text > | mTextTemplate |
ref< ActorTree > | mActorTreeMulti |
Protected Attributes inherited from vl::Object | |
std::string | mObjectName |
IMutex * | mRefCountMutex |
int | mReferenceCount |
bool | mAutomaticDelete |
Generates a 3D plot with labels and isosurface. The isosurface is generated using the MarchingCubes algorithm.
Example:
Definition at line 50 of file VolumePlot.hpp.
VolumePlot::VolumePlot | ( | ) |
Constructor.
Definition at line 72 of file VolumePlot.cpp.
References vl::FontManager::acquireFont(), vl::defFontManager(), vl::EN_DEPTH_TEST, vl::EN_LIGHTING, mActorTreeMulti, mBoxEffect, mIsosurfaceActor, mIsosurfaceEffect, mIsosurfaceGeometry, mLabelFont, mLabelFormat, mMaxCorner, mMinCorner, mPlotTransform, mSamplingResolution, mTextTemplate, vl::PM_LINE, vl::Text::setColor(), and textTemplate().
|
inline |
Definition at line 128 of file VolumePlot.hpp.
Referenced by compute().
|
inline |
Definition at line 129 of file VolumePlot.hpp.
|
inline |
Used to get/set the rendering options (like color, material, transparency) etc. of the box.
Definition at line 85 of file VolumePlot.hpp.
|
inline |
Used to get/set the rendering options (like color, material, transparency) etc. of the box.
Definition at line 87 of file VolumePlot.hpp.
void VolumePlot::compute | ( | const Function & | func, |
float | threshold | ||
) |
Computes the function and generates the plot. This method should be called after all the other methods.
func | The function to be evaluated at each grid point. |
threshold | The isovalue of the isosurface passed to the MarcingCubes algorithm. |
Definition at line 107 of file VolumePlot.cpp.
References vl::ActorTreeAbstract::actors(), actorTreeMulti(), vl::Collection< T >::clear(), evaluateFunction(), vl::ref< T >::get(), labelFont(), labelFormat(), mActors, vl::makeBox(), maxCorner(), mBoxEffect, vl::MarchingCubes::mDrawElements, minCorner(), mIsosurfaceActor, mIsosurfaceEffect, mIsosurfaceGeometry, vl::MarchingCubes::mNormsArray, mPlotTransform, mSamplingResolution, vl::MarchingCubes::mVertsArray, NULL, vl::Collection< T >::push_back(), vl::MarchingCubes::run(), vl::Actor::setEffect(), vl::Actor::setLod(), vl::Actor::setTransform(), vl::Volume::setup(), setupLabels(), vl::Volume::values(), and vl::MarchingCubes::volumeInfo().
|
protected |
Definition at line 209 of file VolumePlot.cpp.
References mSamplingResolution, vl::Vector3< T_Scalar >::x(), vl::Vector3< T_Scalar >::y(), and vl::Vector3< T_Scalar >::z().
Referenced by compute().
|
inline |
The Actor representing the isosurface.
Definition at line 70 of file VolumePlot.hpp.
|
inline |
The Actor representing the isosurface.
Definition at line 72 of file VolumePlot.hpp.
|
inline |
Used to get/set the rendering options (like color, material, transparency) etc. of the isosurface.
Definition at line 80 of file VolumePlot.hpp.
|
inline |
Used to get/set the rendering options (like color, material, transparency) etc. of the isosurface.
Definition at line 82 of file VolumePlot.hpp.
|
inline |
The Geometry representing the isosurface.
Definition at line 75 of file VolumePlot.hpp.
|
inline |
The Geometry representing the isosurface.
Definition at line 77 of file VolumePlot.hpp.
|
inline |
The Font to be used for the box labels.
Definition at line 117 of file VolumePlot.hpp.
Referenced by compute().
|
inline |
The Font to be used for the box labels.
Definition at line 119 of file VolumePlot.hpp.
|
inline |
Sets the format of the labels.
Definition at line 112 of file VolumePlot.hpp.
Referenced by compute().
|
inline |
Default value: fvec3(+1,+1,+1)
Definition at line 95 of file VolumePlot.hpp.
Referenced by compute().
|
inline |
Default value: fvec3(-1,-1,-1)
Definition at line 90 of file VolumePlot.hpp.
Referenced by compute().
|
inline |
The transform associated to the whole plot.
Definition at line 100 of file VolumePlot.hpp.
|
inline |
The transform associated to the whole plot.
Definition at line 102 of file VolumePlot.hpp.
|
inline |
Default value: ivec3(64,64,64)
Definition at line 107 of file VolumePlot.hpp.
|
inline |
The Font to be used for the box labels.
Definition at line 121 of file VolumePlot.hpp.
|
inline |
Sets the format of the label to be generated, es. "(%.2n %.2n %.2n)" or "<%.3n, %.3n, %.3n>".
Definition at line 114 of file VolumePlot.hpp.
|
inline |
Default value: fvec3(+1,+1,+1)
Definition at line 97 of file VolumePlot.hpp.
|
inline |
Default value: fvec3(-1,-1,-1)
Definition at line 92 of file VolumePlot.hpp.
|
inline |
The transform associated to the whole plot.
Definition at line 104 of file VolumePlot.hpp.
|
inline |
Default value: ivec3(64,64,64)
Definition at line 109 of file VolumePlot.hpp.
|
protected |
Definition at line 147 of file VolumePlot.cpp.
References vl::Transform::addChild(), vl::AlignHCenter, vl::AlignVCenter, vl::Transform::computeWorldMatrix(), vl::EN_BLEND, vl::EN_DEPTH_TEST, vl::Shader::enable(), vl::ref< T >::get(), vl::Matrix4< float >::getTranslation(), mActors, vl::Text::setAlignment(), vl::Text::setBackgroundColor(), vl::Text::setBackgroundEnabled(), vl::Text::setBorderColor(), vl::Text::setBorderEnabled(), vl::Renderable::setBufferObjectEnabled(), vl::Text::setColor(), vl::Renderable::setDisplayListEnabled(), vl::Text::setFont(), vl::Transform::setLocalMatrix(), vl::Text::setMargin(), vl::Text::setMatrix(), vl::Text::setOutlineColor(), vl::Text::setOutlineEnabled(), vl::Text::setShadowColor(), vl::Text::setShadowEnabled(), vl::Text::setShadowVector(), vl::Text::setText(), vl::Effect::shader(), textTemplate(), vl::Actor::transform(), vl::Vector3< T_Scalar >::x(), vl::Vector3< T_Scalar >::y(), and vl::Vector3< T_Scalar >::z().
Referenced by compute().
|
inline |
A Text used to initialize the plot labels.
Definition at line 124 of file VolumePlot.hpp.
Referenced by setupLabels(), and VolumePlot().
|
inline |
A Text used to initialize the plot labels.
Definition at line 126 of file VolumePlot.hpp.
Definition at line 136 of file VolumePlot.hpp.
Referenced by compute(), and setupLabels().
Definition at line 148 of file VolumePlot.hpp.
Referenced by VolumePlot().
Definition at line 146 of file VolumePlot.hpp.
Referenced by compute(), and VolumePlot().
Definition at line 144 of file VolumePlot.hpp.
Referenced by compute(), and VolumePlot().
Definition at line 145 of file VolumePlot.hpp.
Referenced by compute(), and VolumePlot().
Definition at line 143 of file VolumePlot.hpp.
Referenced by compute(), and VolumePlot().
Definition at line 140 of file VolumePlot.hpp.
Referenced by VolumePlot().
|
protected |
Definition at line 139 of file VolumePlot.hpp.
Referenced by VolumePlot().
|
protected |
Definition at line 142 of file VolumePlot.hpp.
Referenced by VolumePlot().
|
protected |
Definition at line 141 of file VolumePlot.hpp.
Referenced by VolumePlot().
Definition at line 137 of file VolumePlot.hpp.
Referenced by compute(), and VolumePlot().
|
protected |
Definition at line 138 of file VolumePlot.hpp.
Referenced by compute(), evaluateFunction(), and VolumePlot().
Definition at line 147 of file VolumePlot.hpp.
Referenced by VolumePlot().
Visualization Library 2.1.0 Reference Documentation
Updated on Wed Mar 10 2021 16:02:55.
© Copyright Michele Bosi. All rights reserved.