CubbyFlow::Surface< N > Class Template Referenceabstract

Abstract base class for N-D surface. More...

#include <Core/Geometry/Surface.hpp>

Inheritance diagram for CubbyFlow::Surface< N >:
CubbyFlow::Box< N > CubbyFlow::Cylinder3 CubbyFlow::ImplicitSurface< N > CubbyFlow::Plane< N > CubbyFlow::Sphere< N > CubbyFlow::SurfaceSet< N > CubbyFlow::Triangle3 CubbyFlow::TriangleMesh3

Public Member Functions

 Surface (const Transform< N > &transform=Transform< N >(), bool isNormalFlipped=false)
 Constructs a surface with normal direction. More...
 
virtual ~Surface ()=default
 Default virtual destructor. More...
 
 Surface (const Surface &other)
 Copy constructor. More...
 
 Surface (Surface &&other) noexcept
 Move constructor. More...
 
Surfaceoperator= (const Surface &other)
 Copy assignment operator. More...
 
Surfaceoperator= (Surface &&other) noexcept
 Move assignment operator. More...
 
Vector< double, N > ClosestPoint (const Vector< double, N > &otherPoint) const
 
BoundingBox< double, N > GetBoundingBox () const
 Returns the bounding box of this surface object. More...
 
bool Intersects (const Ray< double, N > &ray) const
 Returns true if the given ray intersects with this surface object. More...
 
double ClosestDistance (const Vector< double, N > &otherPoint) const
 
SurfaceRayIntersection< N > ClosestIntersection (const Ray< double, N > &ray) const
 Returns the closest intersection point for given ray. More...
 
Vector< double, N > ClosestNormal (const Vector< double, N > &otherPoint) const
 
virtual void UpdateQueryEngine ()
 Updates internal spatial query engine. More...
 
virtual bool IsBounded () const
 Returns true if bounding box can be defined. More...
 
virtual bool IsValidGeometry () const
 Returns true if the surface is a valid geometry. More...
 
bool IsInside (const Vector< double, N > &otherPoint) const
 

Public Attributes

Transform< N > transform
 Local-to-world transform. More...
 
bool isNormalFlipped = false
 Flips normal. More...
 

Protected Member Functions

virtual Vector< double, N > ClosestPointLocal (const Vector< double, N > &otherPoint) const =0
 
virtual BoundingBox< double, N > BoundingBoxLocal () const =0
 Returns the bounding box of this surface object in local frame. More...
 
virtual SurfaceRayIntersection< N > ClosestIntersectionLocal (const Ray< double, N > &ray) const =0
 Returns the closest intersection point for given ray in local frame. More...
 
virtual Vector< double, N > ClosestNormalLocal (const Vector< double, N > &otherPoint) const =0
 
virtual bool IntersectsLocal (const Ray< double, N > &ray) const
 
virtual double ClosestDistanceLocal (const Vector< double, N > &otherPoint) const
 
virtual bool IsInsideLocal (const Vector< double, N > &otherPoint) const
 

Detailed Description

template<size_t N>
class CubbyFlow::Surface< N >

Abstract base class for N-D surface.

Constructor & Destructor Documentation

◆ Surface() [1/3]

template<size_t N>
CubbyFlow::Surface< N >::Surface ( const Transform< N > &  transform = Transform< N >(),
bool  isNormalFlipped = false 
)

Constructs a surface with normal direction.

◆ ~Surface()

template<size_t N>
virtual CubbyFlow::Surface< N >::~Surface ( )
virtualdefault

Default virtual destructor.

◆ Surface() [2/3]

template<size_t N>
CubbyFlow::Surface< N >::Surface ( const Surface< N > &  other)

Copy constructor.

◆ Surface() [3/3]

template<size_t N>
CubbyFlow::Surface< N >::Surface ( Surface< N > &&  other)
noexcept

Move constructor.

Member Function Documentation

◆ BoundingBoxLocal()

template<size_t N>
virtual BoundingBox<double, N> CubbyFlow::Surface< N >::BoundingBoxLocal ( ) const
protectedpure virtual

Returns the bounding box of this surface object in local frame.

Implemented in CubbyFlow::TriangleMesh3, CubbyFlow::Triangle3, CubbyFlow::SurfaceToImplicit< N >, CubbyFlow::Box< N >, and CubbyFlow::Cylinder3.

◆ ClosestDistance()

template<size_t N>
double CubbyFlow::Surface< N >::ClosestDistance ( const Vector< double, N > &  otherPoint) const

Returns the closest distance from the given point otherPoint to the point on the surface.

◆ ClosestDistanceLocal()

template<size_t N>
virtual double CubbyFlow::Surface< N >::ClosestDistanceLocal ( const Vector< double, N > &  otherPoint) const
protectedvirtual

Returns the closest distance from the given point otherPoint to the point on the surface in local frame.

Reimplemented in CubbyFlow::SurfaceToImplicit< N >.

◆ ClosestIntersection()

template<size_t N>
SurfaceRayIntersection<N> CubbyFlow::Surface< N >::ClosestIntersection ( const Ray< double, N > &  ray) const

Returns the closest intersection point for given ray.

◆ ClosestIntersectionLocal()

template<size_t N>
virtual SurfaceRayIntersection<N> CubbyFlow::Surface< N >::ClosestIntersectionLocal ( const Ray< double, N > &  ray) const
protectedpure virtual

Returns the closest intersection point for given ray in local frame.

Implemented in CubbyFlow::SurfaceToImplicit< N >, and CubbyFlow::Box< N >.

◆ ClosestNormal()

template<size_t N>
Vector<double, N> CubbyFlow::Surface< N >::ClosestNormal ( const Vector< double, N > &  otherPoint) const

Returns the normal to the closest point on the surface from the given point otherPoint.

◆ ClosestNormalLocal()

template<size_t N>
virtual Vector<double, N> CubbyFlow::Surface< N >::ClosestNormalLocal ( const Vector< double, N > &  otherPoint) const
protectedpure virtual

Returns the normal to the closest point on the surface from the given point otherPoint in local frame.

Implemented in CubbyFlow::SurfaceToImplicit< N >, and CubbyFlow::Box< N >.

◆ ClosestPoint()

template<size_t N>
Vector<double, N> CubbyFlow::Surface< N >::ClosestPoint ( const Vector< double, N > &  otherPoint) const

Returns the closest point from the given point otherPoint to the surface.

◆ ClosestPointLocal()

template<size_t N>
virtual Vector<double, N> CubbyFlow::Surface< N >::ClosestPointLocal ( const Vector< double, N > &  otherPoint) const
protectedpure virtual

Returns the closest point from the given point otherPoint to the surface in local frame.

Implemented in CubbyFlow::SurfaceToImplicit< N >, and CubbyFlow::Box< N >.

◆ GetBoundingBox()

template<size_t N>
BoundingBox<double, N> CubbyFlow::Surface< N >::GetBoundingBox ( ) const

Returns the bounding box of this surface object.

◆ Intersects()

template<size_t N>
bool CubbyFlow::Surface< N >::Intersects ( const Ray< double, N > &  ray) const

Returns true if the given ray intersects with this surface object.

◆ IntersectsLocal()

template<size_t N>
virtual bool CubbyFlow::Surface< N >::IntersectsLocal ( const Ray< double, N > &  ray) const
protectedvirtual

Returns true if the given ray intersects with this surface object in local frame.

Reimplemented in CubbyFlow::SurfaceToImplicit< N >, and CubbyFlow::Box< N >.

◆ IsBounded()

template<size_t N>
virtual bool CubbyFlow::Surface< N >::IsBounded ( ) const
virtual

◆ IsInside()

template<size_t N>
bool CubbyFlow::Surface< N >::IsInside ( const Vector< double, N > &  otherPoint) const

Returns true if otherPoint is inside the volume defined by the surface.

◆ IsInsideLocal()

template<size_t N>
virtual bool CubbyFlow::Surface< N >::IsInsideLocal ( const Vector< double, N > &  otherPoint) const
protectedvirtual

Returns true if otherPoint is inside by given depth the volume defined by the surface in local frame.

◆ IsValidGeometry()

template<size_t N>
virtual bool CubbyFlow::Surface< N >::IsValidGeometry ( ) const
virtual

Returns true if the surface is a valid geometry.

Reimplemented in CubbyFlow::ImplicitSurfaceSet< N >, CubbyFlow::SurfaceToImplicit< N >, and CubbyFlow::SurfaceSet< N >.

◆ operator=() [1/2]

template<size_t N>
Surface& CubbyFlow::Surface< N >::operator= ( const Surface< N > &  other)

Copy assignment operator.

◆ operator=() [2/2]

template<size_t N>
Surface& CubbyFlow::Surface< N >::operator= ( Surface< N > &&  other)
noexcept

Move assignment operator.

◆ UpdateQueryEngine()

template<size_t N>
virtual void CubbyFlow::Surface< N >::UpdateQueryEngine ( )
virtual

Member Data Documentation

◆ isNormalFlipped

template<size_t N>
bool CubbyFlow::Surface< N >::isNormalFlipped = false

Flips normal.

◆ transform

template<size_t N>
Transform<N> CubbyFlow::Surface< N >::transform

Local-to-world transform.


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