iMSTK
Interactive Medical Simulation Toolkit
imstkStraightNeedle.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 "imstkNeedle.h"
10 
11 namespace imstk
12 {
13 class LineMesh;
14 
20 class StraightNeedle : public Needle
21 {
22 public:
23  StraightNeedle(const std::string& name = "StraightNeedle") : Needle(name) { }
24  ~StraightNeedle() override = default;
25 
26  void setNeedleGeometry(std::shared_ptr<LineMesh> straightNeedleGeom) { m_needleGeom = straightNeedleGeom; }
27  std::shared_ptr<LineMesh> getNeedleGeometry() const { return m_needleGeom; }
28 
32  Vec3d getNeedleDirection() const override;
33 
37  Vec3d getNeedleTip() const override { return getNeedleStart(); }
38 
39  const Vec3d& getNeedleStart() const;
40  const Vec3d& getNeedleEnd() const;
41 
42 protected:
43  std::shared_ptr<LineMesh> m_needleGeom;
44 };
45 } // namespace imstk
Vec3d getNeedleDirection() const override
Returns axes/direciton of the needle.
Vec3d getNeedleTip() const override
Returns tip of the needle.
Compound Geometry.
Definition of straight, single segment needle.
Base for all needles in imstk it supports global puncture state, per object puncture state...
Definition: imstkNeedle.h:20