iMSTK
Interactive Medical Simulation Toolkit
imstkIsometricMap.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 "imstkGeometryMap.h"
10 #include "imstkMacros.h"
11 #include "imstkMath.h"
12 
13 namespace imstk
14 {
20 class IsometricMap : public GeometryMap
21 {
22 public:
23  IsometricMap() = default;
24  IsometricMap(std::shared_ptr<Geometry> parent,
25  std::shared_ptr<Geometry> child)
26  {
27  this->setParentGeometry(parent);
28  this->setChildGeometry(child);
29  }
30 
31  ~IsometricMap() override = default;
32 
33  IMSTK_TYPE_NAME(IsometricMap)
34 
35 
36  void compute() override { }
39 
43  const Vec3d& getLocalOffset() const { return m_localOffset; }
44  void setLocalOffset(const Vec3d& offset)
45  {
46  m_localOffset = offset;
47  m_useOffset = true;
48  }
49 
51 
52 protected:
56  void requestUpdate() override;
57 
58  bool m_useOffset = false;
59  Vec3d m_localOffset = Vec3d::Zero();
60 };
61 } // namespace imstk
void requestUpdate() override
Apply the map.
void setParentGeometry(std::shared_ptr< Geometry > parent)
Get/Set parent geometry.
Compound Geometry.
const Vec3d & getLocalOffset() const
Get/Set an offset for the child that transforms locally with the parent.
void setChildGeometry(std::shared_ptr< Geometry > child)
Get/Set child geometry.
A maps that lets the child follow the parent transform.
Base class for any geometric map.
void compute() override
Compute the map.