#include <marchingcubes.h>
|
bool | calculate_min_max_vals () |
| Calculate the min and max value trees Stores minimum and maximum cube neighborhood values in a tree structure. More...
|
|
void | clear_min_max_vals () |
| Clear the minimum and maximum value search trees Frees memory in the minvals and maxvals. More...
|
|
void | draw_cube (const int x, const int y, const int z, const int cur_level) |
| The main cube drawing function To start the process of generate triangles call with draw_cube(0,0,0,minvals.size()-1) Once cur_level becomes drawing_level marching_cube is called. More...
|
|
void | marching_cube (int fX, int fY, int fZ, const int cur_level) |
| Function for managing cases where a triangles can potentially be rendered Called by draw_cube. More...
|
|
void | calculate_surface () |
| Calculate and generate the entire set of vertices and normals using current states Calls draw_cube(0,0,0,minvals.size()-1) More...
|
|
float | get_offset (float fValue1, float fValue2, float fValueDesired) |
| Find the approximate point of intersection of the surface between two points with the values fValue1 and fValue2. More...
|
|
int | get_edge_num (int x, int y, int z, int edge) |
| Get edge num needs better commenting. More...
|
|
void | get_normal (Vector3 &normal, int fX, int fY, int fZ) |
| Find the gradient of the scalar field at a point. More...
|
|
Definition at line 271 of file marchingcubes.h.
◆ MarchingCubes() [1/2]
EMAN::MarchingCubes::MarchingCubes |
( |
| ) |
|
◆ MarchingCubes() [2/2]
EMAN::MarchingCubes::MarchingCubes |
( |
EMData * |
em | ) |
|
Most commonly used constructor calls set_data(em)
- Parameters
-
em | the EMData object to generate triangles and normals for |
◆ ~MarchingCubes()
virtual EMAN::MarchingCubes::~MarchingCubes |
( |
| ) |
|
|
virtual |
◆ calculate_min_max_vals()
bool EMAN::MarchingCubes::calculate_min_max_vals |
( |
| ) |
|
|
private |
Calculate the min and max value trees Stores minimum and maximum cube neighborhood values in a tree structure.
- Exceptions
-
NullPointerException | if _emdata is null... this should not happen but is left for clarity for programmers |
◆ calculate_surface()
void EMAN::MarchingCubes::calculate_surface |
( |
| ) |
|
|
private |
Calculate and generate the entire set of vertices and normals using current states Calls draw_cube(0,0,0,minvals.size()-1)
◆ clear_min_max_vals()
void EMAN::MarchingCubes::clear_min_max_vals |
( |
| ) |
|
|
private |
Clear the minimum and maximum value search trees Frees memory in the minvals and maxvals.
◆ color_vertices()
void EMAN::MarchingCubes::color_vertices |
( |
| ) |
|
◆ draw_cube()
void EMAN::MarchingCubes::draw_cube |
( |
const int |
x, |
|
|
const int |
y, |
|
|
const int |
z, |
|
|
const int |
cur_level |
|
) |
| |
|
private |
The main cube drawing function To start the process of generate triangles call with draw_cube(0,0,0,minvals.size()-1) Once cur_level becomes drawing_level marching_cube is called.
- Parameters
-
x | the current x value, relative to cur_level |
y | the current y value, relative to cur_level |
z | the current z value, relative to cur_level |
cur_level | the current tree traversal level |
◆ get_edge_num()
int EMAN::MarchingCubes::get_edge_num |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
z, |
|
|
int |
edge |
|
) |
| |
|
private |
Get edge num needs better commenting.
◆ get_isosurface()
Dict EMAN::MarchingCubes::get_isosurface |
( |
| ) |
|
|
virtual |
Get the isosurface as dictionary Traverses the tree and marches the cubes.
- Returns
- a dictionary object containing to float pointers (to vertex and normal data), and an int pointer (to face data)
Implements EMAN::Isosurface.
◆ get_normal()
void EMAN::MarchingCubes::get_normal |
( |
Vector3 & |
normal, |
|
|
int |
fX, |
|
|
int |
fY, |
|
|
int |
fZ |
|
) |
| |
|
private |
Find the gradient of the scalar field at a point.
This gradient can be used as a very accurate vertx normal for lighting calculations.
THIS FUNCTION IS NO LONGER CALLED - d.woolford but is retained because it may be useful, perhaps even for saving time
- Parameters
-
normal | where to store the normal |
fX | |
fY | |
fZ | |
◆ get_offset()
float EMAN::MarchingCubes::get_offset |
( |
float |
fValue1, |
|
|
float |
fValue2, |
|
|
float |
fValueDesired |
|
) |
| |
|
private |
Find the approximate point of intersection of the surface between two points with the values fValue1 and fValue2.
- Parameters
-
fValue1 | |
fValue2 | |
fValueDesired | |
- Returns
- offset
◆ get_sampling()
int EMAN::MarchingCubes::get_sampling |
( |
| ) |
const |
|
inlinevirtual |
◆ get_sampling_range()
int EMAN::MarchingCubes::get_sampling_range |
( |
| ) |
|
|
inlinevirtual |
◆ get_surface_value()
float EMAN::MarchingCubes::get_surface_value |
( |
| ) |
const |
|
inlinevirtual |
◆ getRGBmode()
int EMAN::MarchingCubes::getRGBmode |
( |
| ) |
|
|
inline |
◆ marching_cube()
void EMAN::MarchingCubes::marching_cube |
( |
int |
fX, |
|
|
int |
fY, |
|
|
int |
fZ, |
|
|
const int |
cur_level |
|
) |
| |
|
private |
Function for managing cases where a triangles can potentially be rendered Called by draw_cube.
Generates vertices, normals, and keeps track of common points
- Parameters
-
fX | the current x coordinate, relative to cur_level |
fY | the current y coordinate, relative to cur_level |
fZ | the current z coordinate, relative to cur_level |
cur_level | |
◆ set_data()
void EMAN::MarchingCubes::set_data |
( |
EMData * |
data | ) |
|
|
virtual |
Sets Voxel data for Isosurface implementation Calls calculate_min_max_vals which generates the tree of data.
- Parameters
-
data | the emdata object to be rendered in 3D |
- Exceptions
-
ImageDimensionException | if the image z dimension is 1 |
Reimplemented from EMAN::Isosurface.
◆ set_sampling()
void EMAN::MarchingCubes::set_sampling |
( |
const int |
rate | ) |
|
|
inlinevirtual |
Set sampling rates A smaller value means a finer sampling.
The finest sampling level is -1 Sampling values increment in steps of 1, and a single increment is interpreted as one step up or down the tree stored in minvals and maxvals
- Parameters
-
rate | the tree level to render |
Implements EMAN::Isosurface.
Definition at line 310 of file marchingcubes.h.
References drawing_level.
◆ set_surface_value()
void EMAN::MarchingCubes::set_surface_value |
( |
const float |
value | ) |
|
|
virtual |
◆ setCmapData()
void EMAN::MarchingCubes::setCmapData |
( |
EMData * |
data | ) |
|
|
inlinevirtual |
◆ setCmapMinMax()
void EMAN::MarchingCubes::setCmapMinMax |
( |
float |
min, |
|
|
float |
max |
|
) |
| |
|
inlinevirtual |
◆ setRGBmode()
void EMAN::MarchingCubes::setRGBmode |
( |
int |
mode | ) |
|
|
inlinevirtual |
◆ setRGBorigin()
void EMAN::MarchingCubes::setRGBorigin |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
z |
|
) |
| |
|
inlinevirtual |
◆ setRGBscale()
void EMAN::MarchingCubes::setRGBscale |
( |
float |
i, |
|
|
float |
o |
|
) |
| |
|
inlinevirtual |
◆ surface_face_z()
void EMAN::MarchingCubes::surface_face_z |
( |
| ) |
|
◆ GLUtil
◆ _isodl
unsigned long EMAN::MarchingCubes::_isodl |
|
private |
◆ buffer
GLuint EMAN::MarchingCubes::buffer[4] |
|
private |
◆ cc
◆ drawing_level
int EMAN::MarchingCubes::drawing_level |
|
private |
◆ ff
◆ maxvals
vector<EMData*> EMAN::MarchingCubes::maxvals |
|
private |
◆ minvals
vector<EMData*> EMAN::MarchingCubes::minvals |
|
private |
◆ needtobind
bool EMAN::MarchingCubes::needtobind |
|
private |
◆ nn
◆ point_map
map<int, int> EMAN::MarchingCubes::point_map |
|
private |
◆ pp
.Custom vectors for storing points, normals and faces
Definition at line 446 of file marchingcubes.h.
◆ rgbgenerator
◆ vv
The documentation for this class was generated from the following file: