Sculptor class for manipulating elements, denoted voxels, in arrays three-dimensional digital.
More...
#include <Sculptor.h>
|
| Sculptor (int _nx, int _ny, int _nz) |
| Class constructor. More...
|
|
| ~Sculptor () |
| Class Destructor. More...
|
|
void | setColor (float r, float g, float b, float alpha) |
| Member function setColor. More...
|
|
void | putVoxel (int x, int y, int z) |
| Member function putVoxel. More...
|
|
void | cutVoxel (int x, int y, int z) |
| CutVoxel member function. More...
|
|
void | writeOFF (std::string filename) |
| Write OFF member function. More...
|
|
std::vector< std::vector< Voxel > > | readMx (int dimension=0, int plan=XY) |
| ReadMx member function. More...
|
|
void | clearAll () |
| clearAll member function. More...
|
|
Sculptor class for manipulating elements, denoted voxels, in arrays three-dimensional digital.
◆ Sculptor()
Sculptor::Sculptor |
( |
int |
_nx, |
|
|
int |
_ny, |
|
|
int |
_nz |
|
) |
| |
Class constructor.
This constructor will receive the dimensional parameters of the voxel array and will construct an instance of the Sculptor class.
- Parameters
-
_x | Integer digital scaler of the voxel matrix on the X axis; |
_y | Integer digital scaler of the voxel matrix on the Y axis; |
_z | Integer digital dimensioner of the voxel matrix on the Z axis. |
It will dynamically allocate, with the dimensions passed, the voxel array v and set the color elements (r, g, b and a) to their default values: 0.0.
◆ ~Sculptor()
Class Destructor.
When executed, it will free the dynamically allocated memory space for the three-dimensional array with the dimensions informed during the execution of the program.
◆ clearAll()
void Sculptor::clearAll |
( |
| ) |
|
clearAll member function.
returns the sculptor's data to its beginning.
◆ cutVoxel()
void Sculptor::cutVoxel |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
z |
|
) |
| |
CutVoxel member function.
This method will tell the system that a voxel should be deleted in the voxel array in the coordinates x, y and z that were passed as a parameter.
- Parameters
-
x | Represents a coordinate on the x axis of the 3D voxel matrix plane; |
y | Represents a coordinate on the y axis of the 3D voxel matrix plane; |
z | Represents a coordinate on the z axis of the 3D voxel matrix plane; |
- Returns
- void;
◆ putVoxel()
void Sculptor::putVoxel |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
z |
|
) |
| |
Member function putVoxel.
This method will tell the system that a voxel should be shown in the voxel array in the coordinates x, y and z that were passed as a parameter.
- Parameters
-
x | Represents a coordinate on the x axis of the 3D voxel matrix plane; |
y | Represents a coordinate on the y axis of the 3D voxel matrix plane; |
z | Represents a coordinate on the z axis of the 3D voxel matrix plane; |
- Returns
- void;
◆ readMx()
std::vector< std::vector< Voxel > > Sculptor::readMx |
( |
int |
dimension = 0 , |
|
|
int |
plan = XY |
|
) |
| |
ReadMx member function.
A function to aid interaction and vision in different 2D planes;
- Parameters
-
dimension | Represents the coordinate of the plane being viewed; |
plan | Represents plan that will be visualized; |
- Returns
- ***std::vector<std::vector<Voxel>> ***;
◆ setColor()
void Sculptor::setColor |
( |
float |
r, |
|
|
float |
g, |
|
|
float |
b, |
|
|
float |
alpha |
|
) |
| |
Member function setColor.
Will configure the private attributes r, g, b and a for the received values as a parameter of the function.
- Parameters
-
r | Represents the R (Red) component of color in the RGBA model in a range from 0.0 to 1.0; |
g | Represents the G (Green) component of color in the RGBA model in a range from 0.0 to 1.0; |
b | Represents the component B (Blue) of color in the RGBA model in a range from 0.0 to 1.0; |
alpha | Represents the A (Alpha - Transparency) component of color in the RGBA model in a range from 0.0 to 1.0. |
- Returns
- void;
◆ writeOFF()
void Sculptor::writeOFF |
( |
std::string |
filename | ) |
|
Write OFF member function.
This method will use all the data present in the sculptor class to assemble a simple text file in the structure of a named OFF (Object File Format) and in the directory passed as a parameter.
- Parameters
-
filename | name/path of the plain text file to be created/edited with the content generated by the class; |
- Returns
- void;
Color component A (Alpha) in RGBA format for voxels implementation
B (Blue) color component in RGBA format for voxel implementation
G (Green) color component in RGBA format for voxel implementation
◆ nx
Digital scaler of voxel matrix on the x-axis.
◆ ny
Digital scaler of voxel matrix on the y-axis.
◆ nz
Digital scaler of voxel matrix on the z-axis.
R (Red) color component in RGBA format for voxel implementation
Digital array of three-dimensional voxels
The documentation for this class was generated from the following files: