LVRLabelInteractor.hpp
Go to the documentation of this file.
1 #ifndef LVRLABELINTERACTOR_STLYE_H
2 #define LVRLABELINTERACTOR_STLYE_H
3 #include <vtkVersion.h>
4 #include <vtkSmartPointer.h>
5 #include <vtkPointData.h>
6 #include <vtkIdTypeArray.h>
7 #include <vtkDataSetSurfaceFilter.h>
8 #include <vtkRendererCollection.h>
9 #include <vtkProperty.h>
10 #include <vtkPlanes.h>
11 #include <vtkObjectFactory.h>
12 #include <vtkPolyDataMapper.h>
13 #include <vtkActor.h>
14 #include <vtkRenderWindow.h>
15 #include <vtkRenderer.h>
16 #include <vtkRenderWindowInteractor.h>
17 #include <vtkPolyData.h>
18 #include <vtkPointSource.h>
20 #include <vtkInteractorStyleDrawPolygon.h>
21 #include <vtkAreaPicker.h>
22 #include <vtkExtractGeometry.h>
23 #include <vtkDataSetMapper.h>
24 #include <vtkUnstructuredGrid.h>
25 #include <vtkVertexGlyphFilter.h>
26 #include <vtkIdFilter.h>
27 #include <QObject>
28 #include <vector>
29 #include <QStringList>
30 #include <memory>
31 #include <fstream>
32 
33 // Define interaction style
34 //class LVRLabelInteractorStyle : public QObject, public vtkInteractorStyleDrawPolygon
36 {
37  Q_OBJECT
38  public:
39  static LVRLabelInteractorStyle* New();
41 
43 
44  virtual void OnKeyUp();
45  virtual void OnRightButtonDown();
46  virtual void OnRightButtonUp();
47  virtual void OnLeftButtonUp();
48  inline void SetPoints(vtkSmartPointer<vtkPolyData> points) {m_points = points;
49  m_SelectedPoints = std::vector<bool>(m_points->GetNumberOfPoints(), false);
50  m_pointLabels = std::vector<uint8_t>(m_points->GetNumberOfPoints(), 0);
51  }
52 
53 public Q_SLOTS:
54  void labelSelectedPoints(QString label);
55  void extractLabel();
56 Q_SIGNALS:
57  void pointsSelected();
58  private:
59  void calculateSelection(bool select);
60  vtkSmartPointer<vtkIdTypeArray> m_selectedIds;
61  vtkSmartPointer<vtkPolyData> m_points;
62  std::vector<bool> m_SelectedPoints;
63  std::vector<std::vector<bool>> foo2;
64  std::vector<vtkSmartPointer<vtkActor>> m_labelActors;
65  std::vector<uint8_t> m_pointLabels;
66  vtkSmartPointer<vtkActor> SelectedActor;
67  vtkSmartPointer<vtkDataSetMapper> SelectedMapper;
68  QStringList m_labelList;
69  std::vector<std::vector<uint8_t>> colors;
70 
71 };
72 #endif // LVRLABELINTERACTOR_STLYE_H
std::vector< bool > m_SelectedPoints
void SetPoints(vtkSmartPointer< vtkPolyData > points)
std::vector< std::vector< uint8_t > > colors
vtkSmartPointer< vtkIdTypeArray > m_selectedIds
void calculateSelection(bool select)
std::vector< vtkSmartPointer< vtkActor > > m_labelActors
Like TrackBallCamera, but this can pick props underneath a rubber band selection rectangle.
vtkSmartPointer< vtkDataSetMapper > SelectedMapper
vtkTypeMacro(LVRLabelInteractorStyle, LVRInteractorStylePolygonPick)
std::vector< std::vector< bool > > foo2
void labelSelectedPoints(QString label)
std::vector< uint8_t > m_pointLabels
vtkSmartPointer< vtkActor > SelectedActor
vtkSmartPointer< vtkPolyData > m_points
static LVRLabelInteractorStyle * New()


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Mon Feb 28 2022 22:46:08