#include <marchingcubes.h>
Inheritance diagram for EMAN::MarchingCubes:
Public Member Functions | |
MarchingCubes () | |
Default constructor. | |
MarchingCubes (EMData *em) | |
Most commonly used constructor calls set_data(em). | |
virtual | ~MarchingCubes () |
void | set_data (EMData *data) |
Sets Voxel data for Isosurface implementation Calls calculate_min_max_vals which generates the tree of data. | |
void | set_surface_value (const float value) |
Set Isosurface value. | |
float | get_surface_value () const |
Get the current isosurface value being used. | |
void | set_sampling (const int rate) |
Set sampling rates A smaller value means a finer sampling. | |
int | get_sampling () const |
Current the current sampling rate Finest sampling is -1. | |
int | get_sampling_range () |
Get the range of feasible sampling rates. | |
void | color_vertices () |
Color the vertices. | |
Dict | get_isosurface () |
Get the isosurface as dictionary Traverses the tree and marches the cubes. | |
void | surface_face_z () |
void | setRGBorigin (int x, int y, int z) |
Functions to control colroing mode. | |
void | setRGBscale (float i, float o) |
void | setRGBmode (int mode) |
int | getRGBmode () |
Return RGB mode. | |
void | setCmapData (EMData *data) |
Sets the colormap. | |
void | setCmapMinMax (float min, float max) |
Sets the colormap mix max range. | |
Private Member Functions | |
bool | calculate_min_max_vals () |
Calculate the min and max value trees Stores minimum and maximum cube neighborhood values in a tree structure. | |
void | clear_min_max_vals () |
Clear the minimum and maximum value search trees Frees memory in the minvals and maxvals. | |
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. | |
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. | |
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). | |
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. | |
int | get_edge_num (int x, int y, int z, int edge) |
Get edge num needs better commenting. | |
void | get_normal (Vector3 &normal, int fX, int fY, int fZ) |
Find the gradient of the scalar field at a point. | |
Private Attributes | |
map< int, int > | point_map |
unsigned long | _isodl |
GLuint | buffer [4] |
vector< EMData * > | minvals |
Vectors for storing the search trees. | |
vector< EMData * > | maxvals |
Vectors for storing the search trees. | |
int | drawing_level |
The "sampling rate". | |
CustomVector< float > | pp |
.Custom vectors for storing points, normals and faces | |
CustomVector< float > | cc |
CustomVector< int > | vv |
CustomVector< float > | nn |
CustomVector< unsigned int > | ff |
ColorRGBGenerator | rgbgenerator |
COlor by radius generator. | |
bool | needtobind |
Friends | |
class | GLUtil |
|
Default constructor.
|
|
Most commonly used constructor calls set_data(em).
|
|
|
|
Calculate the min and max value trees Stores minimum and maximum cube neighborhood values in a tree structure.
|
|
Calculate and generate the entire set of vertices and normals using current states Calls draw_cube(0,0,0,minvals.size()-1).
|
|
Clear the minimum and maximum value search trees Frees memory in the minvals and maxvals.
|
|
Color the vertices.
|
|
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.
|
|
Get edge num needs better commenting.
|
|
Get the isosurface as dictionary Traverses the tree and marches the cubes.
Implements EMAN::Isosurface. |
|
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
|
|
Find the approximate point of intersection of the surface between two points with the values fValue1 and fValue2.
|
|
Current the current sampling rate Finest sampling is -1.
Implements EMAN::Isosurface. Definition at line 319 of file marchingcubes.h. 00319 { return drawing_level; }
|
|
Get the range of feasible sampling rates.
Implements EMAN::Isosurface. Definition at line 323 of file marchingcubes.h. 00323 { return minvals.size()-1; }
|
|
Get the current isosurface value being used.
Implements EMAN::Isosurface. Definition at line 304 of file marchingcubes.h. 00304 { return _surf_value; }
|
|
Return RGB mode.
Definition at line 355 of file marchingcubes.h. 00356 { 00357 return rgbgenerator.getRGBmode(); 00358 }
|
|
Function for managing cases where a triangles can potentially be rendered Called by draw_cube. Generates vertices, normals, and keeps track of common points
|
|
Sets Voxel data for Isosurface implementation Calls calculate_min_max_vals which generates the tree of data.
Reimplemented from EMAN::Isosurface. |
|
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
Implements EMAN::Isosurface. Definition at line 314 of file marchingcubes.h. 00314 { drawing_level = rate; }
|
|
Set Isosurface value.
Implements EMAN::Isosurface. |
|
Sets the colormap.
Implements EMAN::Isosurface. Definition at line 361 of file marchingcubes.h. References data. 00362 { 00363 rgbgenerator.set_cmap_data(data); 00364 }
|
|
Sets the colormap mix max range.
Implements EMAN::Isosurface. Definition at line 367 of file marchingcubes.h. 00368 { 00369 rgbgenerator.setMinMax(min, max); 00370 }
|
|
Implements EMAN::Isosurface. Definition at line 349 of file marchingcubes.h. 00350 { 00351 rgbgenerator.setRGBmode(mode); 00352 }
|
|
Functions to control colroing mode.
Implements EMAN::Isosurface. Definition at line 339 of file marchingcubes.h. 00340 { 00341 rgbgenerator.setOrigin(x, y, z); 00342 }
|
|
Implements EMAN::Isosurface. Definition at line 344 of file marchingcubes.h. 00345 { 00346 rgbgenerator.setScale(i, o); 00347 }
|
|
|
|
Definition at line 276 of file marchingcubes.h. |
|
Definition at line 374 of file marchingcubes.h. |
|
Definition at line 375 of file marchingcubes.h. |
|
Definition at line 451 of file marchingcubes.h. |
|
The "sampling rate".
Definition at line 394 of file marchingcubes.h. |
|
Definition at line 454 of file marchingcubes.h. |
|
Vectors for storing the search trees.
Definition at line 391 of file marchingcubes.h. |
|
Vectors for storing the search trees.
Definition at line 391 of file marchingcubes.h. |
|
Definition at line 459 of file marchingcubes.h. |
|
Definition at line 453 of file marchingcubes.h. |
|
Definition at line 373 of file marchingcubes.h. |
|
.Custom vectors for storing points, normals and faces
Definition at line 450 of file marchingcubes.h. |
|
COlor by radius generator.
Definition at line 457 of file marchingcubes.h. |
|
Definition at line 452 of file marchingcubes.h. |