gVirtualXRay  2.0.10
VirtualX-RayImagingLibraryonGPU
Data Structures | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
gVirtualXRay::ImplicitSurface Class Reference

ImplicitSurface is a class to build 3D implicit surfaces. More...

#include <ImplicitSurface.h>

Collaboration diagram for gVirtualXRay::ImplicitSurface:
Collaboration graph

Data Structures

class  DensityFunctionParameterType
 Type of density function parameter. More...
 

Public Types

enum  DensityFunctionType { SPHERE, BLOBBY_MOLECULE, META_BALL, SOFT_OBJECT }
 Type of density function. More...
 

Public Member Functions

 ImplicitSurface ()
 Default constructor. More...
 
 ~ImplicitSurface ()
 Destructor. More...
 
RATIONAL_NUMBER evaluate (RATIONAL_NUMBER r, const DensityFunctionParameterType &aParameter) const
 Evaluate the density function for the distance r. More...
 
void resetControlPoints ()
 Remove all the control points. More...
 
void resetControlLines ()
 Remove all the control lines. More...
 
void addControlPoint (const DensityFunctionParameterType &aParameter, const VEC3 &aControlPoint)
 Add a control point. More...
 
void addControlLine (const DensityFunctionParameterType &aParameter, const VEC3 &aControlPoint1, const VEC3 &aControlPoint2)
 Add a control line. More...
 
unsigned int getNumberOfControlPoints () const
 Accessor on the number of control points. More...
 
unsigned int getNumberOfControlLineSegments () const
 Accessor on the number of control line segments. More...
 
void setControlPointParameters (unsigned int aPointID, DensityFunctionType aDentityFunction, float aParameter1, float aParameter2=0.0)
 
void setControlLineSegmentParameters (unsigned int aLineSegmentID, DensityFunctionType aDentityFunction, float aParameter1, float aParameter2=0.0)
 
const VEC3getControlPoint (unsigned int anIndex) const
 Accessor on a given control point. More...
 
VEC3getControlPoint (unsigned int anIndex)
 Accessor on a given control point. More...
 
const std::pair< VEC3, VEC3 > & getControlLine (unsigned int anIndex) const
 Accessor on a given control line. More...
 
std::pair< VEC3, VEC3 > & getControlLine (unsigned int anIndex)
 Accessor on a given control line. More...
 
void voxelise (const Vec3ui &aNumberOfVoxels, const VEC3 &aCenter, const VEC3 &aVoxelSize, unsigned char aVerboseLevel=0)
 Accessor on a given control line. More...
 
void voxelize (const Vec3ui &aNumberOfVoxels, const VEC3 &aCenter, const VEC3 &aVoxelSize, unsigned char aVerboseLevel=0)
 Accessor on a given control line. More...
 
void writeVoxelData (const char *aFileName) const
 Write the current voxel data into a file. More...
 
void writeVoxelData (const std::string &aFileName) const
 Write the current voxel data into a file. More...
 
void writePolygonMesh (const char *aFileName)
 Write the polygon data. More...
 
void writePolygonMesh (const std::string &aFileName)
 Write the polygon data. More...
 
void extractIsoSurface (const RATIONAL_NUMBER &aThreshold=0, unsigned char aVerboseLevel=0)
 
void extractIsoSurface (const RATIONAL_NUMBER &aLowerThreshold, const RATIONAL_NUMBER &anUpperThreshold, unsigned char aVerboseLevel=0)
 
PolygonMeshgetPolygonMesh ()
 Accessor on the polygon data. More...
 
const PolygonMeshgetPolygonMesh () const
 Accessor on the polygon data. More...
 
const Image< RATIONAL_NUMBER > & getVolume () const
 
Image< RATIONAL_NUMBER > & getVolume ()
 

Protected Member Functions

RATIONAL_NUMBER evaluateSphere (RATIONAL_NUMBER r) const
 
RATIONAL_NUMBER evaluateBlobbyMolecule (RATIONAL_NUMBER r, RATIONAL_NUMBER a, RATIONAL_NUMBER b) const
 
RATIONAL_NUMBER evaluateMetaBall (RATIONAL_NUMBER r, RATIONAL_NUMBER a, RATIONAL_NUMBER b) const
 
RATIONAL_NUMBER evaluateSoftObject (RATIONAL_NUMBER r, RATIONAL_NUMBER a, RATIONAL_NUMBER b) const
 

Protected Attributes

Image< RATIONAL_NUMBERm_volume
 
PolygonMesh m_mesh_data
 
VEC3 m_centre
 
std::vector< std::pair< DensityFunctionParameterType, VEC3 > > m_control_point_set
 
std::vector< std::pair< DensityFunctionParameterType, std::pair< VEC3, VEC3 > > > m_control_line_set
 

Detailed Description

ImplicitSurface is a class to build 3D implicit surfaces.

Definition at line 101 of file ImplicitSurface.h.

Member Enumeration Documentation

◆ DensityFunctionType

Type of density function.

Enumerator
SPHERE 

Sphere.

BLOBBY_MOLECULE 

Blobby molecule, first created by Jim Blinn and modelled after electron density fields

META_BALL 

Meta balls.

SOFT_OBJECT 

Soft Objects, first created by the Wyvill brothers

Definition at line 109 of file ImplicitSurface.h.

Constructor & Destructor Documentation

◆ ImplicitSurface()

gVirtualXRay::ImplicitSurface::ImplicitSurface ( )

Default constructor.

◆ ~ImplicitSurface()

gVirtualXRay::ImplicitSurface::~ImplicitSurface ( )

Destructor.

Member Function Documentation

◆ addControlLine()

void gVirtualXRay::ImplicitSurface::addControlLine ( const DensityFunctionParameterType aParameter,
const VEC3 aControlPoint1,
const VEC3 aControlPoint2 
)
inline

Add a control line.

Parameters
aParameterthe parameter of the density function
aControlPoint1the first point that defines the line segment
aControlPoint2the second point that defines the line segment

Definition at line 136 of file ImplicitSurface.inl.

◆ addControlPoint()

void gVirtualXRay::ImplicitSurface::addControlPoint ( const DensityFunctionParameterType aParameter,
const VEC3 aControlPoint 
)
inline

Add a control point.

Parameters
aParameterthe parameter of the density function
aControlPointthe control point to add

Definition at line 127 of file ImplicitSurface.inl.

◆ evaluate()

RATIONAL_NUMBER gVirtualXRay::ImplicitSurface::evaluate ( RATIONAL_NUMBER  r,
const DensityFunctionParameterType aParameter 
) const
inline

Evaluate the density function for the distance r.

Parameters
rthe distance
aParameterthe parameter of the density function
Returns
the density

Definition at line 86 of file ImplicitSurface.inl.

◆ evaluateBlobbyMolecule()

RATIONAL_NUMBER gVirtualXRay::ImplicitSurface::evaluateBlobbyMolecule ( RATIONAL_NUMBER  r,
RATIONAL_NUMBER  a,
RATIONAL_NUMBER  b 
) const
inlineprotected

Definition at line 341 of file ImplicitSurface.inl.

◆ evaluateMetaBall()

RATIONAL_NUMBER gVirtualXRay::ImplicitSurface::evaluateMetaBall ( RATIONAL_NUMBER  r,
RATIONAL_NUMBER  a,
RATIONAL_NUMBER  b 
) const
inlineprotected

Definition at line 358 of file ImplicitSurface.inl.

◆ evaluateSoftObject()

RATIONAL_NUMBER gVirtualXRay::ImplicitSurface::evaluateSoftObject ( RATIONAL_NUMBER  r,
RATIONAL_NUMBER  a,
RATIONAL_NUMBER  b 
) const
inlineprotected

Definition at line 379 of file ImplicitSurface.inl.

◆ evaluateSphere()

RATIONAL_NUMBER gVirtualXRay::ImplicitSurface::evaluateSphere ( RATIONAL_NUMBER  r) const
inlineprotected

Definition at line 326 of file ImplicitSurface.inl.

◆ extractIsoSurface() [1/2]

void gVirtualXRay::ImplicitSurface::extractIsoSurface ( const RATIONAL_NUMBER aThreshold = 0,
unsigned char  aVerboseLevel = 0 
)

Extract the surface from the voxel data corresponding to a given iso-value.

Parameters
aThresholdthe threshold value
aVerboseLevelthe level of statements in the standard output. For no output, use 0 (default value: 0)

◆ extractIsoSurface() [2/2]

void gVirtualXRay::ImplicitSurface::extractIsoSurface ( const RATIONAL_NUMBER aLowerThreshold,
const RATIONAL_NUMBER anUpperThreshold,
unsigned char  aVerboseLevel = 0 
)

Extract the surface from the voxel data corresponding to a given iso-value.

Parameters
aLowerThresholdthe lower threshold value
anUpperThresholdthe upper threshold value
aVerboseLevelthe level of statements in the standard output. For no output, use 0 (default value: 0)

◆ getControlLine() [1/2]

const std::pair< VEC3, VEC3 > & gVirtualXRay::ImplicitSurface::getControlLine ( unsigned int  anIndex) const
inline

Accessor on a given control line.

Parameters
anIndexthe index of the control point
Returns
the corresponding control line segment

Definition at line 224 of file ImplicitSurface.inl.

◆ getControlLine() [2/2]

std::pair< VEC3, VEC3 > & gVirtualXRay::ImplicitSurface::getControlLine ( unsigned int  anIndex)
inline

Accessor on a given control line.

Parameters
anIndexthe index of the control point
Returns
the corresponding control line segment

Definition at line 237 of file ImplicitSurface.inl.

◆ getControlPoint() [1/2]

const VEC3 & gVirtualXRay::ImplicitSurface::getControlPoint ( unsigned int  anIndex) const
inline

Accessor on a given control point.

Parameters
anIndexthe index of the control point
Returns
the corresponding control point

Definition at line 198 of file ImplicitSurface.inl.

◆ getControlPoint() [2/2]

VEC3 & gVirtualXRay::ImplicitSurface::getControlPoint ( unsigned int  anIndex)
inline

Accessor on a given control point.

Parameters
anIndexthe index of the control point
Returns
the corresponding control point

Definition at line 211 of file ImplicitSurface.inl.

◆ getNumberOfControlLineSegments()

unsigned int gVirtualXRay::ImplicitSurface::getNumberOfControlLineSegments ( ) const
inline

Accessor on the number of control line segments.

Returns
the number of control line segments

Definition at line 154 of file ImplicitSurface.inl.

◆ getNumberOfControlPoints()

unsigned int gVirtualXRay::ImplicitSurface::getNumberOfControlPoints ( ) const
inline

Accessor on the number of control points.

Returns
the number of control points

Definition at line 146 of file ImplicitSurface.inl.

◆ getPolygonMesh() [1/2]

PolygonMesh & gVirtualXRay::ImplicitSurface::getPolygonMesh ( )
inline

Accessor on the polygon data.

Returns
the polygon data

Definition at line 294 of file ImplicitSurface.inl.

◆ getPolygonMesh() [2/2]

const PolygonMesh & gVirtualXRay::ImplicitSurface::getPolygonMesh ( ) const
inline

Accessor on the polygon data.

Returns
the polygon data

Definition at line 302 of file ImplicitSurface.inl.

◆ getVolume() [1/2]

const Image< RATIONAL_NUMBER > & gVirtualXRay::ImplicitSurface::getVolume ( ) const
inline

Definition at line 310 of file ImplicitSurface.inl.

◆ getVolume() [2/2]

Image< RATIONAL_NUMBER > & gVirtualXRay::ImplicitSurface::getVolume ( )
inline

Definition at line 318 of file ImplicitSurface.inl.

◆ resetControlLines()

void gVirtualXRay::ImplicitSurface::resetControlLines ( )
inline

Remove all the control lines.

Definition at line 119 of file ImplicitSurface.inl.

◆ resetControlPoints()

void gVirtualXRay::ImplicitSurface::resetControlPoints ( )
inline

Remove all the control points.

Definition at line 111 of file ImplicitSurface.inl.

◆ setControlLineSegmentParameters()

void gVirtualXRay::ImplicitSurface::setControlLineSegmentParameters ( unsigned int  aLineSegmentID,
DensityFunctionType  aDentityFunction,
float  aParameter1,
float  aParameter2 = 0.0 
)
inline

Definition at line 180 of file ImplicitSurface.inl.

◆ setControlPointParameters()

void gVirtualXRay::ImplicitSurface::setControlPointParameters ( unsigned int  aPointID,
DensityFunctionType  aDentityFunction,
float  aParameter1,
float  aParameter2 = 0.0 
)
inline

Definition at line 162 of file ImplicitSurface.inl.

◆ voxelise()

void gVirtualXRay::ImplicitSurface::voxelise ( const Vec3ui aNumberOfVoxels,
const VEC3 aCenter,
const VEC3 aVoxelSize,
unsigned char  aVerboseLevel = 0 
)

Accessor on a given control line.

Parameters
aNumberOfVoxelsthe number of voxels
aCenterthe 3D position of the centre of the dataset
aVoxelSizethe size of voxels
aVerboseLevelthe level of statements in the standard output. For no output, use 0 (default value: 0)

◆ voxelize()

void gVirtualXRay::ImplicitSurface::voxelize ( const Vec3ui aNumberOfVoxels,
const VEC3 aCenter,
const VEC3 aVoxelSize,
unsigned char  aVerboseLevel = 0 
)
inline

Accessor on a given control line.

Parameters
aNumberOfVoxelsthe number of voxels
aCenterthe 3D position of the centre of the dataset
aVoxelSizethe size of voxels
aVerboseLevelthe level of statements in the standard output. For no output, use 0 (default value: 0)

Definition at line 250 of file ImplicitSurface.inl.

◆ writePolygonMesh() [1/2]

void gVirtualXRay::ImplicitSurface::writePolygonMesh ( const char *  aFileName)

Write the polygon data.

Parameters
aFileNamethe name of the file where to save the polygon data

◆ writePolygonMesh() [2/2]

void gVirtualXRay::ImplicitSurface::writePolygonMesh ( const std::string &  aFileName)
inline

Write the polygon data.

Parameters
aFileNamethe name of the file where to save the polygon data

Definition at line 269 of file ImplicitSurface.inl.

◆ writeVoxelData() [1/2]

void gVirtualXRay::ImplicitSurface::writeVoxelData ( const char *  aFileName) const

Write the current voxel data into a file.

Parameters
aFileNamethe name of the file where to save the voxel data

◆ writeVoxelData() [2/2]

void gVirtualXRay::ImplicitSurface::writeVoxelData ( const std::string &  aFileName) const
inline

Write the current voxel data into a file.

Parameters
aFileNamethe name of the file where to save the voxel data

Definition at line 261 of file ImplicitSurface.inl.

Field Documentation

◆ m_centre

VEC3 gVirtualXRay::ImplicitSurface::m_centre
protected

Definition at line 440 of file ImplicitSurface.h.

◆ m_control_line_set

std::vector<std::pair<DensityFunctionParameterType, std::pair<VEC3, VEC3> > > gVirtualXRay::ImplicitSurface::m_control_line_set
protected

Definition at line 448 of file ImplicitSurface.h.

◆ m_control_point_set

std::vector<std::pair<DensityFunctionParameterType, VEC3> > gVirtualXRay::ImplicitSurface::m_control_point_set
protected

Definition at line 444 of file ImplicitSurface.h.

◆ m_mesh_data

PolygonMesh gVirtualXRay::ImplicitSurface::m_mesh_data
protected

Definition at line 437 of file ImplicitSurface.h.

◆ m_volume

Image<RATIONAL_NUMBER> gVirtualXRay::ImplicitSurface::m_volume
protected

Definition at line 434 of file ImplicitSurface.h.


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