iMSTK
Interactive Medical Simulation Toolkit
imstkGeometryMap.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 "imstkGeometryAlgorithm.h"
10 
11 namespace imstk
12 {
13 class Geometry;
14 
21 {
22 protected:
23  GeometryMap();
24 
25 public:
26  virtual ~GeometryMap() = default;
27 
32  virtual const std::string getTypeName() const = 0;
33 
37  virtual void compute() = 0;
38 
42  void setParentGeometry(std::shared_ptr<Geometry> parent) { setInput(parent, 0); }
43  std::shared_ptr<Geometry> getParentGeometry() const { return getInput(0); }
45 
49  void setChildGeometry(std::shared_ptr<Geometry> child) { setInput(child, 1); }
50  std::shared_ptr<Geometry> getChildGeometry() const { return getInput(1); }
52 };
53 } // namespace imstk
virtual const std::string getTypeName() const =0
Returns the string class name.
void setParentGeometry(std::shared_ptr< Geometry > parent)
Get/Set parent geometry.
std::shared_ptr< Geometry > getInput(size_t port=0) const
Returns input geometry given port, returns nullptr if doesn&#39;t exist.
Compound Geometry.
void setChildGeometry(std::shared_ptr< Geometry > child)
Get/Set child geometry.
void setInput(std::shared_ptr< Geometry > inputGeometry, size_t port=0)
Set the input at the port.
Abstract base class for geometry algorithms. GeometryAlgorithms take N input geometries and produce N...
Base class for any geometric map.
virtual void compute()=0
Compute the map, usually called once on startup.