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
LVRLabelInteractorStyle::labelSelectedPoints
void labelSelectedPoints(QString label)
Definition: LVRLabelInteractor.cpp:180
LVRLabelInteractorStyle::m_pointLabels
std::vector< uint8_t > m_pointLabels
Definition: LVRLabelInteractor.hpp:65
LVRLabelInteractorStyle::m_points
vtkSmartPointer< vtkPolyData > m_points
Definition: LVRLabelInteractor.hpp:61
LVRLabelInteractorStyle::LVRLabelInteractorStyle
LVRLabelInteractorStyle()
Definition: LVRLabelInteractor.cpp:10
LVRLabelInteractorStyle::OnRightButtonDown
virtual void OnRightButtonDown()
Definition: LVRLabelInteractor.cpp:32
LVRLabelInteractorStyle::OnRightButtonUp
virtual void OnRightButtonUp()
Definition: LVRLabelInteractor.cpp:38
LVRLabelInteractorStyle::SelectedActor
vtkSmartPointer< vtkActor > SelectedActor
Definition: LVRLabelInteractor.hpp:66
LVRLabelInteractorStyle::OnKeyUp
virtual void OnKeyUp()
Definition: LVRLabelInteractor.cpp:199
LVRLabelInteractorStyle
Definition: LVRLabelInteractor.hpp:35
LVRLabelInteractorStyle::colors
std::vector< std::vector< uint8_t > > colors
Definition: LVRLabelInteractor.hpp:69
LVRLabelInteractorStyle::m_labelActors
std::vector< vtkSmartPointer< vtkActor > > m_labelActors
Definition: LVRLabelInteractor.hpp:64
LVRLabelInteractorStyle::extractLabel
void extractLabel()
Definition: LVRLabelInteractor.cpp:185
LVRLabelInteractorStyle::pointsSelected
void pointsSelected()
LVRLabelInteractorStyle::foo2
std::vector< std::vector< bool > > foo2
Definition: LVRLabelInteractor.hpp:63
LVRLabelInteractorStyle::vtkTypeMacro
vtkTypeMacro(LVRLabelInteractorStyle, LVRInteractorStylePolygonPick)
LVRLabelInteractorStyle::m_selectedIds
vtkSmartPointer< vtkIdTypeArray > m_selectedIds
Definition: LVRLabelInteractor.hpp:60
LVRLabelInteractorStyle::m_labelList
QStringList m_labelList
Definition: LVRLabelInteractor.hpp:68
LVRInteractorStylePolygonPick
Like TrackBallCamera, but this can pick props underneath a rubber band selection rectangle.
Definition: LVRInteractorStylePolygonPick.hpp:43
LVRLabelInteractorStyle::calculateSelection
void calculateSelection(bool select)
Definition: LVRLabelInteractor.cpp:67
LVRLabelInteractorStyle::New
static LVRLabelInteractorStyle * New()
LVRLabelInteractorStyle::OnLeftButtonUp
virtual void OnLeftButtonUp()
Definition: LVRLabelInteractor.cpp:42
LVRInteractorStylePolygonPick.hpp
LVRLabelInteractorStyle::SelectedMapper
vtkSmartPointer< vtkDataSetMapper > SelectedMapper
Definition: LVRLabelInteractor.hpp:67
LVRLabelInteractorStyle::m_SelectedPoints
std::vector< bool > m_SelectedPoints
Definition: LVRLabelInteractor.hpp:62
LVRLabelInteractorStyle::SetPoints
void SetPoints(vtkSmartPointer< vtkPolyData > points)
Definition: LVRLabelInteractor.hpp:48


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 Wed Mar 2 2022 00:37:24