FAST  3.2.0
Framework for Heterogeneous Medical Image Computing and Visualization
LinePlotter.hpp
Go to the documentation of this file.
1 #pragma once
3 
4 namespace fast {
5 
6 FAST_SIMPLE_DATA_OBJECT(FloatScalar, float);
7 
8 // Input data objects: simple data object: float.., create one line per input connection
9 // Redraw whenever new data arrives
10 class FAST_EXPORT LinePlotter : public Plotter {
12  Q_OBJECT
13 public:
14  uint addInputConnection(DataChannel::pointer channel, std::string name = "");
15  //uint addInputConnection(DataChannel::pointer channel, std::string name, Color color);
16  void setBufferSize(int size);
17 public slots:
18  void processQueue();
19 protected:
20  LinePlotter();
21  void execute() override;
22  int m_bufferSize = 64;
23  std::map<uint, std::vector<double>> m_buffer;
24  std::mutex m_queueMutex;
25  std::deque<std::map<int, float>> m_queue;
26  std::vector<double> m_xAxis;
27  int m_currentIndex = 0;
28  std::map<uint, std::string> m_names;
29 };
30 
31 }
fast::LinePlotter::m_queue
std::deque< std::map< int, float > > m_queue
Definition: LinePlotter.hpp:25
fast
Definition: AffineTransformation.hpp:7
fast::LinePlotter::m_queueMutex
std::mutex m_queueMutex
Definition: LinePlotter.hpp:24
fast::LinePlotter::m_xAxis
std::vector< double > m_xAxis
Definition: LinePlotter.hpp:26
fast::Plotter
Definition: Plotter.hpp:16
FAST_OBJECT
#define FAST_OBJECT(className)
Definition: Object.hpp:9
fast::DataChannel::pointer
std::shared_ptr< DataChannel > pointer
Definition: DataChannel.hpp:12
Plotter.hpp
fast::FAST_SIMPLE_DATA_OBJECT
FAST_SIMPLE_DATA_OBJECT(FloatScalar, float)
fast::LinePlotter
Definition: LinePlotter.hpp:10
fast::LinePlotter::m_names
std::map< uint, std::string > m_names
Definition: LinePlotter.hpp:28
fast::LinePlotter::m_buffer
std::map< uint, std::vector< double > > m_buffer
Definition: LinePlotter.hpp:23
uint
unsigned int uint
Definition: DataTypes.hpp:16