Visualization Library 2.0.0
A lightweight C++ OpenGL middleware for 2D/3D graphics
|
[Download] [Tutorials] [All Classes] [Grouped Classes] |
An efficient implementation of the Marching Cubes algorithm. More...
#include <MarchingCubes.hpp>
Public Member Functions | |
MarchingCubes () | |
void | run (bool generate_colors) |
void | reset () |
const Collection< VolumeInfo > * | volumeInfo () const |
Collection< VolumeInfo > * | volumeInfo () |
void | updateColor (const fvec3 &color, int volume_index) |
void | updateColor (const fvec4 &color, int volume_index) |
void | updateAlpha (float alpha, int volume_index) |
void | setHighQualityNormals (bool hq) |
Select hight quality normals for best rendering quality, select low quality normals for best performances. More... | |
bool | highQualityNormals () const |
Select hight quality normals for best rendering quality, select low quality normals for best performances. More... | |
Public Attributes | |
ref< ArrayFloat3 > | mVertsArray |
ref< ArrayFloat3 > | mNormsArray |
ref< ArrayFloat4 > | mColorArray |
ref< DrawElementsUShort > | mDrawElements |
Protected Member Functions | |
void | computeEdges (Volume *, float threshold) |
void | processCube (int x, int y, int z, Volume *vol, float threshold) |
Static Protected Attributes | |
static const int | mTriangleConnectionTable [256][16] |
static const int | mCubeEdgeFlags [256] |
An efficient implementation of the Marching Cubes algorithm.
Pictures from the Marching Cubes tutorial.
Definition at line 223 of file MarchingCubes.hpp.
MarchingCubes::MarchingCubes | ( | ) |
Definition at line 60 of file MarchingCubes.cpp.
References mColorArray, mDrawElements, mNormsArray, mVertsArray, and vl::PT_TRIANGLES.
|
protected |
Definition at line 78 of file MarchingCubes.cpp.
References vl::Volume::cellSize(), vl::Volume::coordinate(), vl::Volume::cube(), vl::Volume::normalHQ(), vl::Volume::slices(), vl::Volume::value(), VL_CHECK, vl::Vector3< T_Scalar >::x(), vl::Vector3< T_Scalar >::y(), and vl::Vector3< T_Scalar >::z().
Referenced by run().
|
inline |
Select hight quality normals for best rendering quality, select low quality normals for best performances.
Definition at line 242 of file MarchingCubes.hpp.
|
protected |
Definition at line 201 of file MarchingCubes.cpp.
References vl::cross(), vl::Vector3< T_Scalar >::isNull(), mCubeEdgeFlags, mTriangleConnectionTable, vl::Volume::slices(), vl::Volume::value(), vl::Vector3< T_Scalar >::x(), and vl::Vector3< T_Scalar >::y().
Referenced by run().
void MarchingCubes::reset | ( | ) |
Definition at line 297 of file MarchingCubes.cpp.
References mColorArray, mDrawElements, mNormsArray, and mVertsArray.
void MarchingCubes::run | ( | bool | generate_colors | ) |
Definition at line 312 of file MarchingCubes.cpp.
References computeEdges(), vl::Geometry::computeNormals(), vl::Volume::dataIsDirty(), vl::Geometry::drawCalls(), mColorArray, mDrawElements, mNormsArray, mVertsArray, vl::Geometry::normalArray(), processCube(), vl::ArrayAbstract::ptr(), vl::Volume::setupInternalData(), vl::Geometry::setVertexArray(), and vl::ArrayAbstract::size().
Referenced by vl::VolumePlot::compute().
|
inline |
Select hight quality normals for best rendering quality, select low quality normals for best performances.
Definition at line 240 of file MarchingCubes.hpp.
void MarchingCubes::updateAlpha | ( | float | alpha, |
int | volume_index | ||
) |
Definition at line 438 of file MarchingCubes.cpp.
References vl::Log::error(), and mColorArray.
void MarchingCubes::updateColor | ( | const fvec3 & | color, |
int | volume_index | ||
) |
Definition at line 398 of file MarchingCubes.cpp.
References vl::Vector3< T_Scalar >::b(), vl::Log::error(), vl::Vector3< T_Scalar >::g(), mColorArray, and vl::Vector3< T_Scalar >::r().
void MarchingCubes::updateColor | ( | const fvec4 & | color, |
int | volume_index | ||
) |
Definition at line 420 of file MarchingCubes.cpp.
References vl::Log::error(), and mColorArray.
|
inline |
Definition at line 232 of file MarchingCubes.hpp.
Referenced by vl::VolumePlot::compute().
|
inline |
Definition at line 233 of file MarchingCubes.hpp.
ref<ArrayFloat4> vl::MarchingCubes::mColorArray |
Definition at line 247 of file MarchingCubes.hpp.
Referenced by MarchingCubes(), reset(), run(), updateAlpha(), and updateColor().
|
staticprotected |
Definition at line 284 of file MarchingCubes.hpp.
Referenced by vl::Volume::computeAverage(), and processCube().
ref<DrawElementsUShort> vl::MarchingCubes::mDrawElements |
Definition at line 253 of file MarchingCubes.hpp.
Referenced by vl::VolumePlot::compute(), MarchingCubes(), reset(), and run().
ref<ArrayFloat3> vl::MarchingCubes::mNormsArray |
Definition at line 246 of file MarchingCubes.hpp.
Referenced by vl::VolumePlot::compute(), MarchingCubes(), reset(), and run().
|
staticprotected |
Definition at line 283 of file MarchingCubes.hpp.
Referenced by vl::Volume::computeAverage(), and processCube().
ref<ArrayFloat3> vl::MarchingCubes::mVertsArray |
Definition at line 245 of file MarchingCubes.hpp.
Referenced by vl::VolumePlot::compute(), MarchingCubes(), reset(), and run().
Visualization Library 2.0.0 Reference Documentation
Updated on Wed Dec 23 2020 12:44:09.
© Copyright Michele Bosi. All rights reserved.