ImplicitSurface3.h
Go to the documentation of this file.
1 /*************************************************************************
2 > File Name: ImplicitSurface3.h
3 > Project Name: CubbyFlow
4 > Author: Dongmin Kim
5 > Purpose: Abstract base class for 3-D implicit surface.
6 > Created Time: 2017/04/18
7 > Copyright (c) 2018, Dongmin Kim
8 *************************************************************************/
9 #ifndef CUBBYFLOW_IMPLICIT_SURFACE3_H
10 #define CUBBYFLOW_IMPLICIT_SURFACE3_H
11 
12 #include <Core/Surface/Surface3.h>
13 
14 namespace CubbyFlow
15 {
17  class ImplicitSurface3 : public Surface3
18  {
19  public:
22  const Transform3& transform = Transform3(),
23  bool isNormalFlipped = false);
24 
26  ImplicitSurface3(const ImplicitSurface3& other);
27 
29  virtual ~ImplicitSurface3();
30 
32  double SignedDistance(const Vector3D& otherPoint) const;
33 
34  protected:
36  virtual double SignedDistanceLocal(const Vector3D& otherPoint) const = 0;
37 
38  private:
39  double ClosestDistanceLocal(const Vector3D& otherPoint) const override;
40  };
41 
43  using ImplicitSurface3Ptr = std::shared_ptr<ImplicitSurface3>;
44 }
45 
46 #endif
3-D vector class.
Definition: Vector3.h:26
virtual double SignedDistanceLocal(const Vector3D &otherPoint) const =0
Returns signed distance from the given point otherPoint in local space.
virtual ~ImplicitSurface3()
Default destructor.
std::shared_ptr< ImplicitSurface3 > ImplicitSurface3Ptr
Shared pointer type for the ImplicitSurface3.
Definition: ImplicitSurface3.h:43
double SignedDistance(const Vector3D &otherPoint) const
Returns signed distance from the given point otherPoint.
Definition: pybind11Utils.h:24
Abstract base class for 3-D surface.
Definition: Surface3.h:32
Transform3 transform
Local-to-world transform.
Definition: Surface3.h:36
Represents 3-D rigid body transform.
Definition: Transform3.h:22
bool isNormalFlipped
Flips normal when calling Surface3::closestNormal(...).
Definition: Surface3.h:39
Abstract base class for 3-D implicit surface.
Definition: ImplicitSurface3.h:17
ImplicitSurface3(const Transform3 &transform=Transform3(), bool isNormalFlipped=false)
Default constructor.