QtSculptor  v1.0.0
Sculptor Class Reference

Sculptor class for manipulating elements, denoted voxels, in arrays three-dimensional digital. More...

#include <Sculptor.h>

Public Member Functions

 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...
 

Protected Attributes

Voxel *** v
 
int nx
 
int ny
 
int nz
 
float r
 
float g
 
float b
 
float a
 

Detailed Description

Sculptor class for manipulating elements, denoted voxels, in arrays three-dimensional digital.

Constructor & Destructor Documentation

◆ 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
_xInteger digital scaler of the voxel matrix on the X axis;
_yInteger digital scaler of the voxel matrix on the Y axis;
_zInteger 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()

Sculptor::~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.

Member Function Documentation

◆ 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
xRepresents a coordinate on the x axis of the 3D voxel matrix plane;
yRepresents a coordinate on the y axis of the 3D voxel matrix plane;
zRepresents 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
xRepresents a coordinate on the x axis of the 3D voxel matrix plane;
yRepresents a coordinate on the y axis of the 3D voxel matrix plane;
zRepresents 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
dimensionRepresents the coordinate of the plane being viewed;
planRepresents 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
rRepresents the R (Red) component of color in the RGBA model in a range from 0.0 to 1.0;
gRepresents the G (Green) component of color in the RGBA model in a range from 0.0 to 1.0;
bRepresents the component B (Blue) of color in the RGBA model in a range from 0.0 to 1.0;
alphaRepresents 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
filenamename/path of the plain text file to be created/edited with the content generated by the class;
Returns
void;

Member Data Documentation

◆ a

float Sculptor::a
protected

Color component A (Alpha) in RGBA format for voxels implementation

◆ b

float Sculptor::b
protected

B (Blue) color component in RGBA format for voxel implementation

◆ g

float Sculptor::g
protected

G (Green) color component in RGBA format for voxel implementation

◆ nx

int Sculptor::nx
protected

Digital scaler of voxel matrix on the x-axis.

◆ ny

int Sculptor::ny
protected

Digital scaler of voxel matrix on the y-axis.

◆ nz

int Sculptor::nz
protected

Digital scaler of voxel matrix on the z-axis.

◆ r

float Sculptor::r
protected

R (Red) color component in RGBA format for voxel implementation

◆ v

Voxel*** Sculptor::v
protected

Digital array of three-dimensional voxels


The documentation for this class was generated from the following files: