Jet  v1.3.3
surface_to_implicit3.h
Go to the documentation of this file.
1 // Copyright (c) 2019 Doyub Kim
2 //
3 // I am making my contributions/submissions to this project solely in my
4 // personal capacity and am not conveying any rights to any intellectual
5 // property of any third parties.
6 
7 #ifndef INCLUDE_JET_SURFACE_TO_IMPLICIT3_H_
8 #define INCLUDE_JET_SURFACE_TO_IMPLICIT3_H_
9 
10 #include <jet/implicit_surface3.h>
11 #include <memory>
12 
13 namespace jet {
14 
26 class SurfaceToImplicit3 final : public ImplicitSurface3 {
27  public:
28  class Builder;
29 
32  const Transform3& transform = Transform3(),
33  bool isNormalFlipped = false);
34 
37 
39  void updateQueryEngine() override;
40 
42  bool isBounded() const override;
43 
45  bool isValidGeometry() const override;
46 
49 
51  static Builder builder();
52 
53  protected:
54  Vector3D closestPointLocal(const Vector3D& otherPoint) const override;
55 
56  double closestDistanceLocal(const Vector3D& otherPoint) const override;
57 
58  bool intersectsLocal(const Ray3D& ray) const override;
59 
60  BoundingBox3D boundingBoxLocal() const override;
61 
62  Vector3D closestNormalLocal(const Vector3D& otherPoint) const override;
63 
64  double signedDistanceLocal(const Vector3D& otherPoint) const override;
65 
67  const Ray3D& ray) const override;
68 
69  bool isInsideLocal(const Vector3D& otherPoint) const override;
70 
71  private:
72  Surface3Ptr _surface;
73 };
74 
76 typedef std::shared_ptr<SurfaceToImplicit3> SurfaceToImplicit3Ptr;
77 
82  : public SurfaceBuilderBase3<SurfaceToImplicit3::Builder> {
83  public:
86 
89 
92 
93  private:
94  Surface3Ptr _surface;
95 };
96 
97 } // namespace jet
98 
99 #endif // INCLUDE_JET_SURFACE_TO_IMPLICIT3_H_
jet::SurfaceToImplicit3::surface
Surface3Ptr surface() const
Returns the raw surface instance.
jet::SurfaceToImplicit3Ptr
std::shared_ptr< SurfaceToImplicit3 > SurfaceToImplicit3Ptr
Shared pointer for the SurfaceToImplicit3 type.
Definition: surface_to_implicit3.h:76
jet::SurfaceToImplicit3::closestNormalLocal
Vector3D closestNormalLocal(const Vector3D &otherPoint) const override
jet::SurfaceToImplicit3::builder
static Builder builder()
Returns builder fox SurfaceToImplicit3.
jet::BoundingBox< T, 3 >
3-D axis-aligned bounding box class.
Definition: bounding_box3.h:41
jet::SurfaceToImplicit3
3-D implicit surface wrapper for generic Surface3 instance.
Definition: surface_to_implicit3.h:26
jet::ImplicitSurface3
Abstract base class for 3-D implicit surface.
Definition: implicit_surface3.h:15
jet::SurfaceBuilderBase3
Base class for 3-D surface builder.
Definition: surface3.h:115
jet::Surface3::isNormalFlipped
bool isNormalFlipped
Flips normal when calling Surface3::closestNormal(...).
Definition: surface3.h:33
jet::Surface3Ptr
std::shared_ptr< Surface3 > Surface3Ptr
Shared pointer for the Surface3 type.
Definition: surface3.h:109
jet::SurfaceToImplicit3::Builder::build
SurfaceToImplicit3 build() const
Builds SurfaceToImplicit3.
jet
Definition: advection_solver2.h:18
jet::SurfaceToImplicit3::signedDistanceLocal
double signedDistanceLocal(const Vector3D &otherPoint) const override
jet::SurfaceToImplicit3::closestDistanceLocal
double closestDistanceLocal(const Vector3D &otherPoint) const override
jet::SurfaceToImplicit3::isValidGeometry
bool isValidGeometry() const override
Returns true if the surface is a valid geometry.
jet::SurfaceToImplicit3::Builder
Front-end to create SurfaceToImplicit3 objects step by step.
Definition: surface_to_implicit3.h:82
jet::SurfaceToImplicit3::SurfaceToImplicit3
SurfaceToImplicit3(const SurfaceToImplicit3 &other)
Copy constructor.
jet::Surface3::transform
Transform3 transform
Local-to-world transform.
Definition: surface3.h:30
jet::Ray< T, 3 >
Class for 2-D ray.
Definition: ray3.h:21
jet::SurfaceToImplicit3::Builder::makeShared
SurfaceToImplicit3Ptr makeShared() const
Builds shared pointer of SurfaceToImplicit3 instance.
jet::SurfaceRayIntersection3
Struct that represents ray-surface intersection point.
Definition: surface3.h:19
jet::SurfaceToImplicit3::closestIntersectionLocal
SurfaceRayIntersection3 closestIntersectionLocal(const Ray3D &ray) const override
Returns the closest intersection point for given ray in local frame.
implicit_surface3.h
jet::SurfaceToImplicit3::closestPointLocal
Vector3D closestPointLocal(const Vector3D &otherPoint) const override
jet::Vector< T, 3 >
3-D vector class.
Definition: vector3.h:25
jet::SurfaceToImplicit3::isBounded
bool isBounded() const override
Returns true if bounding box can be defined.
jet::SurfaceToImplicit3::intersectsLocal
bool intersectsLocal(const Ray3D &ray) const override
jet::SurfaceToImplicit3::SurfaceToImplicit3
SurfaceToImplicit3(const Surface3Ptr &surface, const Transform3 &transform=Transform3(), bool isNormalFlipped=false)
Constructs an instance with generic Surface3 instance.
jet::SurfaceToImplicit3::boundingBoxLocal
BoundingBox3D boundingBoxLocal() const override
Returns the bounding box of this surface object in local frame.
jet::Transform3
Represents 3-D rigid body transform.
Definition: transform3.h:20
jet::SurfaceToImplicit3::updateQueryEngine
void updateQueryEngine() override
Updates internal spatial query engine.
jet::SurfaceToImplicit3::isInsideLocal
bool isInsideLocal(const Vector3D &otherPoint) const override
jet::SurfaceToImplicit3::Builder::withSurface
Builder & withSurface(const Surface3Ptr &surface)
Returns builder with surface.