Biomedical Image Analysis Library
The Biomedical Image Analysis Library is a poweful tool for developers, physicians, researchers, engineers, and so on.
|
#include <DrawShape.hpp>
Public Member Functions | |
TriangleMesh (const Transform3D *o2w, const Transform3D *w2o, bool ro, size_t nt, size_t nv, const size_t *vi, const Point3D *P, const Normal *N=NULL, const Vector3D *S=NULL, const float *uv=NULL) | |
TriangleMesh Constructor. More... | |
~TriangleMesh () | |
TriangleMesh Destructor. More... | |
virtual BBox | ObjectBound () const |
ObjectBound is the shape bounding box. More... | |
virtual BBox | WorldBound () const |
WorldBound is the Shape's Bounding box transformed by the ObjectToWorld transform matrix. More... | |
virtual bool | CanIntersect () const |
CanIntersect indicates that a shape can compute ray intersections, so only shapes that are nonintersectable need to override this method. More... | |
virtual void | Refine (Vector< std::shared_ptr< Shape > > &refined) const |
Refine is a method that splits the shape into a group of new shapes, some of which may be intersectable and some of which may need further refinement. More... | |
template<class O > | |
void | Print (O &os) const |
Print assings Shape information to stream. More... | |
void | ExportSTLA (std::string filename) const |
Exports the triange mesh to a ASCII STL file. More... | |
void | ExportSTLB (std::string filename) const |
Exports the triange mesh to a Brinary STL file. More... | |
size_t | getNtris () const |
size_t | getNverts () const |
size_t * | getVertexIndex () const |
Point3D * | getP () const |
Normal * | getN () const |
Vector3D * | getS () const |
float * | getUvs () const |
Public Member Functions inherited from Bial::Shape | |
Shape (const Transform3D *o2w, const Transform3D *w2o, bool ro) | |
Shape Constructor. More... | |
virtual bool | Intersect (const Ray &ray, float *tHit, float *rayEpsilon, DifferentialGeometry *dg) const |
Intersect returns geometric information about a single rayshape intersection corresponding to the first intersection, if any, in the [mint, maxt] parametric range along the ray. More... | |
virtual bool | IntersectP (const Ray &ray) const |
IntersectP is a predicate function that determines whether or not an intersection occurs, without returning any details about the intersection itself. More... | |
virtual void | GetShadingGeometry (const Transform3D &obj2world, const DifferentialGeometry &dg, DifferentialGeometry *dgShading) const |
GetShadingGeometry. More... | |
float | Area () const |
Area calculates the surface Area. More... | |
template<class O > | |
void | Print (O &os) const |
Print assings Shape information to stream. More... | |
Static Public Member Functions | |
static TriangleMesh * | ReadSTLB (std::string filename) |
Imports the triangle mesh from a Binary STL file. More... | |
Protected Attributes | |
size_t | ntris |
ntris More... | |
size_t | nverts |
nverts More... | |
size_t * | vertexIndex |
vertexIndex More... | |
Point3D * | p |
p More... | |
Normal * | n |
n More... | |
Vector3D * | s |
s More... | |
float * | uvs |
uvs More... | |
Friends | |
class | Triangle |
Additional Inherited Members | |
Public Attributes inherited from Bial::Shape | |
const Transform3D * | ObjectToWorld |
ObjectToWorld is the object's transformation matrix. More... | |
const Transform3D * | WorldToObject |
WorldToObject is the inverse object's transformation matrix. More... | |
const bool | ReverseOrientation |
ReverseOrientation indicates whether their surface normal directions should be reversed from the default. More... | |
const bool | TransformSwapsHandedness |
TransformSwapsHandedness stores the result of the Transform::SwapsHandedness() call for their objecttoworld transformation. More... | |
const uint32_t | shapeId |
shapeId is the Shape's unique id. More... | |
Static Public Attributes inherited from Bial::Shape | |
static uint32_t | nextShapeId |
nextShapeId is a static attribute that is incremented at each Shape Construction. More... | |
Definition at line 135 of file DrawShape.hpp.
Bial::TriangleMesh::TriangleMesh | ( | const Transform3D * | o2w, |
const Transform3D * | w2o, | ||
bool | ro, | ||
size_t | nt, | ||
size_t | nv, | ||
const size_t * | vi, | ||
const Point3D * | P, | ||
const Normal * | N = NULL , |
||
const Vector3D * | S = NULL , |
||
const float * | uv = NULL |
||
) |
TriangleMesh Constructor.
o2w | Object to World transform matrix. |
w2o | World to Object transform matrix. |
ro | indicates if the surface normal should be reversed. |
nt | is the number of triangles. |
nv | is the number of vertices. |
vi | is a pointer to an array of vertex indices. For the ith triangle, its three vertex positions are P[vi[3*i]],P[vi[3*i+1]], and P[vi[3*i+2]]; |
p | is an array of nv vertex positions. |
n | is an optional array of normal vectors, one per vertex in the mesh. If present, these are interpolated across triangle faces to compute shading differential geometry. |
s | is an optional array of tangent vectors, one per vertex in the mesh. These are also used to compute shading geometry. |
uv | is an optional array of parametric (u,v) values, one for each vetex. |
atex | is an optional Alpha Mask texture, which can be used to cut away part of the triangle's surface. |
Bial::TriangleMesh::~TriangleMesh | ( | ) |
TriangleMesh Destructor.
|
virtual |
CanIntersect indicates that a shape can compute ray intersections, so only shapes that are nonintersectable need to override this method.
Reimplemented from Bial::Shape.
void Bial::TriangleMesh::ExportSTLA | ( | std::string | filename | ) | const |
Exports the triange mesh to a ASCII STL file.
filename | Output stl file name. |
void Bial::TriangleMesh::ExportSTLB | ( | std::string | filename | ) | const |
Exports the triange mesh to a Brinary STL file.
filename | Output stl file name. |
Normal* Bial::TriangleMesh::getN | ( | ) | const |
size_t Bial::TriangleMesh::getNtris | ( | ) | const |
size_t Bial::TriangleMesh::getNverts | ( | ) | const |
Point3D* Bial::TriangleMesh::getP | ( | ) | const |
Vector3D* Bial::TriangleMesh::getS | ( | ) | const |
float* Bial::TriangleMesh::getUvs | ( | ) | const |
size_t* Bial::TriangleMesh::getVertexIndex | ( | ) | const |
|
virtual |
void Bial::TriangleMesh::Print | ( | O & | os | ) | const |
Print assings Shape information to stream.
os | an output stream. |
Definition at line 383 of file DrawShape.hpp.
|
static |
Imports the triangle mesh from a Binary STL file.
filename | Input stl file name. |
|
virtual |
Refine is a method that splits the shape into a group of new shapes, some of which may be intersectable and some of which may need further refinement.
refined |
Reimplemented from Bial::Shape.
|
virtual |
WorldBound is the Shape's Bounding box transformed by the ObjectToWorld transform matrix.
Reimplemented from Bial::Shape.
|
friend |
Definition at line 136 of file DrawShape.hpp.
|
protected |
n
Definition at line 157 of file DrawShape.hpp.
|
protected |
ntris
Definition at line 141 of file DrawShape.hpp.
|
protected |
nverts
Definition at line 145 of file DrawShape.hpp.
|
protected |
p
Definition at line 153 of file DrawShape.hpp.
|
protected |
s
Definition at line 161 of file DrawShape.hpp.
|
protected |
uvs
Definition at line 165 of file DrawShape.hpp.
|
protected |
vertexIndex
Definition at line 149 of file DrawShape.hpp.