9 #include "imstkAnalyticalGeometry.h" 10 #include "imstkMacros.h" 22 Cylinder(
const Vec3d& pos = Vec3d(0.0, 0.0, 0.0),
const double radius = 1.0,
const double length = 1.0,
23 const Quatd& orientation = Quatd::Identity()) :
38 void print()
const override;
51 void setRadius(
const double r);
58 void setLength(
const double r);
75 std::unique_ptr<Cylinder>
clone()
77 return std::unique_ptr<Cylinder>(cloneImplementation());
92 Cylinder* cloneImplementation()
const double m_radiusPostTransform
Radius of the cylinder oncee transform applied.
Base class for any analytical geometrical representation.
void computeBoundingBox(Vec3d &min, Vec3d &max, const double paddingPercent)
Get the min, max of the AABB around the cylinder.
Cylinder geometry, default configuration is at origin with length running up the y axes...
double m_radius
Radius of the cylinder.
void updatePostTransformData() const override
Update the Cylinder parameters applying the latest transform.
double m_length
Length of the cylinder.
void setPosition(const Vec3d p)
Set the local position.
void setOrientation(const Quatd r)
Set the local orientation.
double getLength(DataType type=DataType::PostTransform)
Get/Set the length of the cylinder.
double getRadius(DataType type=DataType::PostTransform)
Get/Set the radius of the cylinder.
double m_lengthPostTransform
Length of the cylinder onc transform applied.
void applyTransform(const Mat4d &m) override
Apply a user transform directly to (pre-transformed) parameters producing new parameters.
double getFunctionValue(const Vec3d &imstkNotUsed(pos)) const override
Returns the implicit function value, this could signed, unsigned distance, or some other scalar...
std::unique_ptr< Cylinder > clone()
Polymorphic clone, hides the declaration in superclass return own type.
void print() const override
Print the cylinder info.
DataType
Enumeration for the data to retrieve PreTransform for data where transform matrix is not applied Po...
double getVolume() override
Returns the volume of the cylinder.