iMSTK
Interactive Medical Simulation Toolkit
imstkChartVisualModel.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 "imstkVisualModel.h"
10 #include "imstkColor.h"
11 
12 namespace imstk
13 {
14 class AbstractDataArray;
15 } // namespace imstk
16 
17 using namespace imstk;
18 
19 struct Plot2d
20 {
21  public:
22  std::shared_ptr<AbstractDataArray> xVals;
23  std::shared_ptr<AbstractDataArray> yVals;
24 
25  Color lineColor = Color::Red;
26  double lineWidth = 1.0;
27 };
28 
35 {
36 public:
38  ~ChartVisualModel() override = default;
39 
40  void addPlot(Plot2d plot) { m_plots.push_back(std::make_shared<Plot2d>(plot)); }
41 
42  const std::vector<std::shared_ptr<Plot2d>>& getPlots() const { return m_plots; }
43 
44  void setViewBounds(const Vec4d& bounds) { m_viewBounds = bounds; }
45  Vec4d getViewBounds() const { return m_viewBounds; }
46 
47 protected:
48  std::vector<std::shared_ptr<Plot2d>> m_plots;
49  Vec4d m_viewBounds;
50 };
Compound Geometry.
This class serves as the base class of DataArray, for typeless use.
Color in RGB space.
Definition: imstkColor.h:24
Class for graphing 2d charts, only supports 2d data.
Contains geometric, material, and render information.