#include <mask4d.h>
Display a mesh for a mask. It is made of tiny small cubes showing where the boundary of the mask is.
This classes uses a binary mask of any type. Possible values of the masks are 0 and anything but 0.
For better results use the following OpenGL initialization:
glShadeModel(GL_SMOOTH); glEnable(GL_DEPTH_TEST); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
To use it, use:
unsigned char* mask [512*512*512 * 4]; // fill mask Display::Mask4D displayMask; displayMask.update(mask, 512,512,512,4); glColor3f(0.8,0,0); // color of the mask displayMask.display();
Public Member Functions | |
| Mask4D () | |
| ~Mask4D () | |
| template<typename DataType> | |
| void | update (const DataType *data, unsigned int width, unsigned int height, unsigned int depth, unsigned int nb_frames) |
| void | setFrame (unsigned int frame) |
| unsigned int | getFrame () const |
| unsigned int | getNbFrames () const |
| void | display () |
| template<typename DataType> | |
| void | display (const DataType *data, unsigned int width, unsigned int height, unsigned int depth) |
| void | clear () |
| Display::Mask4D::Mask4D | ( | ) |
| Display::Mask4D::~Mask4D | ( | ) |
| void Display::Mask4D::update | ( | const DataType * | data, | |
| unsigned int | width, | |||
| unsigned int | height, | |||
| unsigned int | depth, | |||
| unsigned int | nb_frames | |||
| ) | [inline] |
update the visualizer with a new mask internally creates or update the display list
References display().
| void Display::Mask4D::setFrame | ( | unsigned int | frame | ) |
set the frame number to display
| unsigned int Display::Mask4D::getFrame | ( | ) | const |
get the current frame number
| unsigned int Display::Mask4D::getNbFrames | ( | ) | const |
get the number of frames
| void Display::Mask4D::display | ( | ) |
display the display list
Referenced by update().
| void Display::Mask4D::display | ( | const DataType * | data, | |
| unsigned int | width, | |||
| unsigned int | height, | |||
| unsigned int | depth | |||
| ) | [inline] |
display directly the mask without using a display list this can be used when the mask is interactively updated
| void Display::Mask4D::clear | ( | ) |
clear the 4D mask, remove any display list
1.5.5