iMSTK
Interactive Medical Simulation Toolkit
imstkAnalyticalGeometry.h
1 /*
2 ** This file is part of the Interactive Medical Simulation Toolkit (iMSTK)
3 ** iMSTK is distributed under the Apache License, Version 2.0.
4 ** See accompanying NOTICE for details.
5 */
6 
7 #pragma once
8 
9 #include "imstkImplicitGeometry.h"
10 
11 namespace imstk
12 {
19 {
20 public:
21  ~AnalyticalGeometry() override = default;
22 
26  void print() const override;
27 
28  // Accessors
32  Vec3d getPosition(DataType type = DataType::PostTransform);
33 
37  void setPosition(const Vec3d p);
38  void setPosition(const double x, const double y, const double z);
40 
44  Quatd getOrientation(DataType type = DataType::PostTransform);
45 
49  void setOrientation(const Quatd r);
50 
57  double getFunctionValue(const Vec3d& imstkNotUsed(pos)) const override { return 0.0; }
58 
63  void updatePostTransformData() const override;
64 
65 protected:
67 
72  void applyTransform(const Mat4d& m) override;
73 
74  Vec3d m_position;
75  mutable Vec3d m_positionPostTransform;
76  Quatd m_orientation;
78 };
79 } // namespace imstk
Base class for any analytical geometrical representation.
Quatd getOrientation(DataType type=DataType::PostTransform)
Get the local or global orientation (post transformed)
void updatePostTransformData() const override
Apply the global transform to the local parameters producing post transformed parameters.
Vec3d getPosition(DataType type=DataType::PostTransform)
Get the local or global position (post transformed)
Compound Geometry.
void print() const override
Print.
void setPosition(const Vec3d p)
Set the local position.
void setOrientation(const Quatd r)
Set the local orientation.
Quatd m_orientationPostTransform
orientation once transform is applied
void applyTransform(const Mat4d &m) override
Apply a user transform directly to (pre-transformed) parameters producing new parameters.
Vec3d m_positionPostTransform
position once transform applied
Class that can represent the geometry of multiple implicit geometries as boolean functions One may su...
double getFunctionValue(const Vec3d &imstkNotUsed(pos)) const override
Returns the implicit function value, this could signed, unsigned distance, or some other scalar...
DataType
Enumeration for the data to retrieve PreTransform for data where transform matrix is not applied Po...
Definition: imstkGeometry.h:41