iMSTK
Interactive Medical Simulation Toolkit
imstkCellPicker.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 "imstkPickingAlgorithm.h"
10 
11 namespace imstk
12 {
13 class CollisionDetectionAlgorithm;
14 
22 {
23 public:
24  CellPicker();
25  ~CellPicker() override = default;
26 
27  void requestUpdate() override;
28 
29  void setPickingGeometry(std::shared_ptr<Geometry> pickGeometry) { m_pickGeometry = pickGeometry; }
30  std::shared_ptr<Geometry> getPickGeometry() const { return m_pickGeometry; }
31 
32  void setCollisionDetection(std::shared_ptr<CollisionDetectionAlgorithm> colDetect) { m_colDetect = colDetect; }
33  std::shared_ptr<CollisionDetectionAlgorithm> getCollisionDetection() const { return m_colDetect; }
34 
35 protected:
36  std::shared_ptr<Geometry> m_pickGeometry = nullptr;
37  std::shared_ptr<CollisionDetectionAlgorithm> m_colDetect = nullptr;
38 };
39 } // namespace imstk
Abstract functor for picking/selecting of geometry. Differs from collision in that the picking criter...
void requestUpdate() override
Users can implement this for the logic to be run.
Compound Geometry.
Picks cells of geomToPick via those that that are intersecting pickingGeom.