AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
axom::primal::Cone< T, NDIMS > Class Template Reference

Represents a cone defined by a base radius, a top radius, the length, the orientation and the location of the base center. More...

#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/main/src/axom/primal/geometry/Cone.hpp>

Inheritance diagram for axom::primal::Cone< T, NDIMS >:

Public Types

using PointType = Point< T, NDIMS >
 
using VectorType = Vector< T, NDIMS >
 

Public Member Functions

AXOM_HOST_DEVICE Cone ()
 Default constructor constructs a cone with lengh 1, base radius 1 and top radius 0, at the origin, oriented along the first spatial direction. More...
 
AXOM_HOST_DEVICE Cone (T baseRadius, T topRadius, T length)
 Construct a cone with a base center at the origin, oriented along the first axis. More...
 
AXOM_HOST_DEVICE Cone (T baseRadius, T topRadius, T length, const VectorType &direction, const PointType &baseCenter)
 Construct a cone at an arbitrary position and orientation. More...
 
AXOM_HOST_DEVICEgetBaseRadius () const
 Return the radius at the base. More...
 
AXOM_HOST_DEVICEgetTopRadius () const
 Return the radius at the top. More...
 
AXOM_HOST_DEVICEgetLength () const
 Return the length from base to top. More...
 
AXOM_HOST_DEVICE const PointTypegetBaseCenter () const
 Return the coordinates of the base center. More...
 
AXOM_HOST_DEVICE const VectorTypegetDirection () const
 Return the axis direction. More...
 
AXOM_HOST_DEVICE double getRadiusAt (double z) const
 Return the interpolated/extrapolated radius at a given distance from the base in the direction of getDirection(). More...
 
std::ostream & print (std::ostream &os) const
 Simple formatted print of a cone instance. More...
 
template<int TDIM = NDIMS>
AXOM_HOST_DEVICE std::enable_if< TDIM==3, T >::type volume () const
 Returns the signed volume of the cone, which is negative if the length is negative. More...
 

Detailed Description

template<typename T, int NDIMS>
class axom::primal::Cone< T, NDIMS >

Represents a cone defined by a base radius, a top radius, the length, the orientation and the location of the base center.

Template Parameters
Tthe coordinate type, e.g., double, float, etc.
NDIMSthe number of spatial dimensions

Negative length is allowed and leads to negative volume. Radii must be non-negative.

A cylinder can be represented using equal base and top radii.

Member Typedef Documentation

◆ PointType

template<typename T , int NDIMS>
using axom::primal::Cone< T, NDIMS >::PointType = Point<T, NDIMS>

◆ VectorType

template<typename T , int NDIMS>
using axom::primal::Cone< T, NDIMS >::VectorType = Vector<T, NDIMS>

Constructor & Destructor Documentation

◆ Cone() [1/3]

template<typename T , int NDIMS>
AXOM_HOST_DEVICE axom::primal::Cone< T, NDIMS >::Cone ( )
inline

Default constructor constructs a cone with lengh 1, base radius 1 and top radius 0, at the origin, oriented along the first spatial direction.

◆ Cone() [2/3]

template<typename T , int NDIMS>
AXOM_HOST_DEVICE axom::primal::Cone< T, NDIMS >::Cone ( baseRadius,
topRadius,
length 
)
inline

Construct a cone with a base center at the origin, oriented along the first axis.

Parameters
[in]baseRadiusbase radius
[in]topRadiustop radius
[in]lengthNegative value is allowed and leads to negative volume.

◆ Cone() [3/3]

template<typename T , int NDIMS>
AXOM_HOST_DEVICE axom::primal::Cone< T, NDIMS >::Cone ( baseRadius,
topRadius,
length,
const VectorType direction,
const PointType baseCenter 
)
inline

Construct a cone at an arbitrary position and orientation.

Parameters
[in]baseRadiusbase radius
[in]topRadiustop radius
[in]lengthlength
[in]directionDirection of axis, from base to top.
[in]baseCenterCoordinates of the base center.

Member Function Documentation

◆ getBaseRadius()

template<typename T , int NDIMS>
AXOM_HOST_DEVICE T axom::primal::Cone< T, NDIMS >::getBaseRadius ( ) const
inline

Return the radius at the base.

◆ getTopRadius()

template<typename T , int NDIMS>
AXOM_HOST_DEVICE T axom::primal::Cone< T, NDIMS >::getTopRadius ( ) const
inline

Return the radius at the top.

◆ getLength()

template<typename T , int NDIMS>
AXOM_HOST_DEVICE T axom::primal::Cone< T, NDIMS >::getLength ( ) const
inline

Return the length from base to top.

◆ getBaseCenter()

template<typename T , int NDIMS>
AXOM_HOST_DEVICE const PointType& axom::primal::Cone< T, NDIMS >::getBaseCenter ( ) const
inline

Return the coordinates of the base center.

◆ getDirection()

template<typename T , int NDIMS>
AXOM_HOST_DEVICE const VectorType& axom::primal::Cone< T, NDIMS >::getDirection ( ) const
inline

Return the axis direction.

◆ getRadiusAt()

template<typename T , int NDIMS>
AXOM_HOST_DEVICE double axom::primal::Cone< T, NDIMS >::getRadiusAt ( double  z) const
inline

Return the interpolated/extrapolated radius at a given distance from the base in the direction of getDirection().

References axom::abs().

◆ print()

template<typename T , int NDIMS>
std::ostream& axom::primal::Cone< T, NDIMS >::print ( std::ostream &  os) const
inline

Simple formatted print of a cone instance.

Parameters
osThe output stream to write to
Returns
A reference to the modified ostream

◆ volume()

template<typename T , int NDIMS>
template<int TDIM = NDIMS>
AXOM_HOST_DEVICE std::enable_if<TDIM == 3, T>::type axom::primal::Cone< T, NDIMS >::volume ( ) const
inline

Returns the signed volume of the cone, which is negative if the length is negative.

Volume is only defined when NDIMS == 3.


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