Volume Renderer DoF
PolygonIntersection Namespace Reference

Classes

struct  Cube
 
struct  Edge
 

Functions

std::vector< QVector3D > calcPolygon (QVector4D normal, Cube &cube, int index)
 
bool inside (QVector3D vertex, QVector4D normal)
 
bool cross (QVector3D a, QVector3D b, QVector4D normal)
 
QVector3D intersect (QVector3D a, QVector3D b, QVector4D normal)
 
QVector3D interpolate (QVector3D a, QVector3D b, float t)
 

Function Documentation

◆ calcPolygon()

std::vector< QVector3D > PolygonIntersection::calcPolygon ( QVector4D  normal,
Cube cube,
int  index 
)

Calculates the intersection points between a cube and a plane

Parameters
normalplane equation
cubethe cube to intersect with
indexholds the index for which edge ordering should be used
Returns
a list of points ordered (counter-)clockwise

◆ cross()

bool PolygonIntersection::cross ( QVector3D  a,
QVector3D  b,
QVector4D  normal 
)

checks if a line segment intersects a plane

Parameters
afirst point of line segment
bsecond point of line segment
normalplane equation
Returns
true if line segment intersects the plane, false otherwise

◆ inside()

bool PolygonIntersection::inside ( QVector3D  vertex,
QVector4D  normal 
)

tests if a point lies infront or behind a plane

Parameters
vertexvertex to be tested
normalplane equation
Returns
true if vertex lies infront of plane, false otherwise

◆ interpolate()

QVector3D PolygonIntersection::interpolate ( QVector3D  a,
QVector3D  b,
float  t 
)

interpolates two vectors

Parameters
afirst vector
bsecond vector
tinterpolation value
Returns
interpolated vector

◆ intersect()

QVector3D PolygonIntersection::intersect ( QVector3D  a,
QVector3D  b,
QVector4D  normal 
)

calculates the intersection point of a line segment and a plane call this method only if cross(a, b, normal) returns true;

Parameters
afirst point of line segment
bsecond point of line segment
normalplane equation
Returns
intersection point