libimgdoc2
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
imgdoc2::CuboidT< t > Struct Template Reference

#include <types.h>

Public Member Functions

 CuboidT ()
 Default constructor. All properties are set to zero.
 
 CuboidT (t x, t y, t z, t w, t h, t d)
 
bool IsPointInside (const Point3dT< t > &p) const
 
Point3dT< t > CenterPoint () const
 
bool DoesIntersectWith (const imgdoc2::Plane_NormalAndDist< t > &plane) const
 

Static Public Member Functions

static bool DoIntersect (const imgdoc2::CuboidT< t > &aabb, const imgdoc2::Plane_NormalAndDist< t > &plane)
 

Public Attributes

x
 The x-coordinate of the edge point of the cuboid.
 
y
 The y-coordinate of the edge point of the cuboid.
 
z
 The z-coordinate of the edge point of the cuboid.
 
w
 The width of the cuboid (i.e. the extent in x-direction).
 
h
 The height of the cuboid (i.e. the extent in y-direction).
 
d
 The depth of the cuboid (i.e. the extent in z-direction).
 

Detailed Description

template<typename t>
struct imgdoc2::CuboidT< t >

Structure defining an axis-aligned cuboid in three dimensions.

Template Parameters
tGeneric type parameter.

Constructor & Destructor Documentation

◆ CuboidT()

template<typename t >
imgdoc2::CuboidT< t >::CuboidT ( x,
y,
z,
w,
h,
d 
)
inline

Constructor.

Exceptions
std::invalid_argumentThrown when an invalid argument error condition occurs.
Parameters
xThe x-coordinate of the edge point of the cuboid.
yThe y-coordinate of the edge point of the cuboid.
zThe z-coordinate of the edge point of the cuboid.
wThe width of the cuboid (i.e. the extent in x-direction).
hThe height of the cuboid (i.e. the extent in y-direction).
dThe depth of the cuboid (i.e. the extent in z-direction).

Member Function Documentation

◆ CenterPoint()

template<typename t >
Point3dT< t > imgdoc2::CuboidT< t >::CenterPoint ( ) const
inline

Calculate the center point of the cuboid.

Returns
The center point of the cuboid.

◆ DoesIntersectWith()

template<typename t >
bool imgdoc2::CuboidT< t >::DoesIntersectWith ( const imgdoc2::Plane_NormalAndDist< t > &  plane) const
inline

Test whether the specified plane is intersecting with the cuboid instance.

Parameters
planeThe plane (given in plane-and-normal representation).
Returns
True if the two objects intersect; false otherwise.

◆ DoIntersect()

template<typename t >
bool imgdoc2::CuboidT< t >::DoIntersect ( const imgdoc2::CuboidT< t > &  aabb,
const imgdoc2::Plane_NormalAndDist< t > &  plane 
)
inlinestatic

Test whether the specified cuboid is intersecting with the specified plane.

Parameters
aabbThe axis-aligned cuboid.
planeThe plane (given in plane-and-normal representation).
Returns
True if the two objects intersect; false otherwise.

◆ IsPointInside()

template<typename t >
bool imgdoc2::CuboidT< t >::IsPointInside ( const Point3dT< t > &  p) const
inline

Query if the specified point 'p' is inside the cubiod.

Parameters
pThe point to test.
Returns
True if point inside, false if not.

The documentation for this struct was generated from the following file: