ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
CustomContextItem.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 // Local
11 #include <Utils/PCLCloud.h>
12 #include <vtkSmartPointer.h>
13 
14 #include "qPCL.h"
15 
16 // PCL
18 
19 namespace PclUtils {
20 namespace context_items {
22  vtkTypeMacro(Point, PCLContextItem) static Point *New();
23  virtual bool Paint(vtkContext2D *painter) override;
24  virtual void set(float _x, float _y);
25 };
26 
28  vtkTypeMacro(Line, PCLContextItem) static Line *New();
29  virtual bool Paint(vtkContext2D *painter) override;
30  virtual void set(float _x_1, float _y_1, float _x_2, float _y_2);
31 };
32 
34  vtkTypeMacro(Circle, PCLContextItem) static Circle *New();
35  virtual bool Paint(vtkContext2D *painter) override;
36  virtual void set(float _x, float _y, float _r);
37 };
38 
39 struct QPCL_ENGINE_LIB_API Disk : public Circle {
40  vtkTypeMacro(Disk, Circle) static Disk *New();
41  virtual bool Paint(vtkContext2D *painter) override;
42 };
43 
47  virtual bool Paint(vtkContext2D *painter) override;
48  virtual void set(float _x, float _y, float _w, float _h);
49 };
50 
53  virtual bool Paint(vtkContext2D *painter) override;
54 };
55 
57  vtkTypeMacro(Points, PCLContextItem) static Points *New();
58  virtual bool Paint(vtkContext2D *painter) override;
59  void set(const std::vector<float> &_xy) { params = _xy; }
60 };
61 
64  virtual bool Paint(vtkContext2D *painter) override;
65 };
66 
68  vtkTypeMacro(Text, PCLContextItem) static Text *New();
69  virtual bool Paint(vtkContext2D *painter) override;
70  virtual void set(float x, float y, const std::string &_text);
71  inline void setBold(bool state = false) { bold_ = state; }
72  inline void setFontSize(int fontSize = 10) { fontSize_ = fontSize; }
73  std::string text;
74  int fontSize_ = 10;
75  bool bold_ = false;
76 };
77 
80  virtual bool Paint(vtkContext2D *painter) override;
81  void setSize(float _size) { size = _size; }
82  void setPointColors(unsigned char r, unsigned char g, unsigned char b);
83  void setPointColors(unsigned char rgb[3]);
84  float size;
85  unsigned char point_colors[3];
86 };
87 } // namespace context_items
88 
89 } // namespace PclUtils
int size
normal_z y
normal_z rgb
normal_z x
#define QPCL_ENGINE_LIB_API
Definition: qPCL.h:15
vtkTypeMacro(Circle, PCLContextItem) static Circle *New()
vtkTypeMacro(Disk, Circle) static Disk *New()
vtkTypeMacro(FilledRectangle, Rectangle) static FilledRectangle *New()
vtkTypeMacro(Line, PCLContextItem) static Line *New()
vtkTypeMacro(Markers, Points) static Markers *New()
vtkTypeMacro(Point, PCLContextItem) static Point *New()
vtkTypeMacro(Points, PCLContextItem) static Points *New()
void set(const std::vector< float > &_xy)
vtkTypeMacro(Polygon, Points) static Polygon *New()
vtkTypeMacro(Rectangle, Point) static Rectangle *New()
void setFontSize(int fontSize=10)
void setBold(bool state=false)
vtkTypeMacro(Text, PCLContextItem) static Text *New()