9 #include "imstkAnalyticalGeometry.h" 10 #include "imstkMacros.h" 22 Plane(
const Vec3d& pos = Vec3d(0.0, 0.0, 0.0),
const Vec3d& normal = Vec3d(0.0, 1.0, 0.0)) :
26 setNormal(normal.normalized());
30 ~
Plane()
override =
default;
32 IMSTK_TYPE_NAME(
Plane)
38 void setNormal(
const Vec3d n);
39 void setNormal(
const double x,
const double y,
const double z);
46 void setWidth(
const double w);
57 void computeBoundingBox(Vec3d& min, Vec3d& max,
const double paddingPercent = 0.0)
override;
70 return std::unique_ptr<Plane>(cloneImplementation());
77 mutable Vec3d m_normalPostTransform;
81 Plane* cloneImplementation()
const 83 return new Plane(*
this);
Base class for any analytical geometrical representation.
Represents and infinite plane, width can be used for visual purposes.
double getFunctionValue(const Vec3d &pos) const override
Returns signed distance to surface at pos.
std::unique_ptr< Plane > clone()
Polymorphic clone, hides the declaration in superclass return own type.
Vec3d getNormal(DataType type=DataType::PostTransform)
Get/Set the normal to the plane.
void applyTransform(const Mat4d &m) override
Apply a user transform directly to (pre-transformed) parameters producing new parameters.
double m_width
Width of plane, only used for visual purposes.
void computeBoundingBox(Vec3d &min, Vec3d &max, const double paddingPercent=0.0) override
Get the min, max of the AABB around the plane.
void setPosition(const Vec3d p)
Set the local position.
void updatePostTransformData() const override
Update the Plane parameters applying the latest transform.
double getWidth()
Get/Set the width of the plane, only used for visual purposes.
Vec3d m_positionPostTransform
position once transform applied
DataType
Enumeration for the data to retrieve PreTransform for data where transform matrix is not applied Po...