ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
vtkBoundingRectContextDevice2D.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 #include "qPCL.h"
11 #include "vtkContextDevice2D.h"
12 
13 class vtkAbstractContextItem;
14 
16  : public vtkContextDevice2D {
17 public:
19  vtkContextDevice2D) void PrintSelf(ostream& os,
20  vtkIndent indent) override;
22 
26  vtkSetObjectMacro(DelegateDevice, vtkContextDevice2D);
27  vtkGetObjectMacro(DelegateDevice, vtkContextDevice2D);
28 
32  void Reset();
33 
37  static vtkRectf GetBoundingRect(vtkAbstractContextItem* item,
38  vtkViewport* viewport);
39 
44  vtkRectf GetBoundingRect();
45 
49  void DrawString(float* point, const vtkStdString& string) override;
50 
54  void DrawMathTextString(float* point, const vtkStdString& string) override;
55 
59  void DrawImage(float p[2], float scale, vtkImageData* image) override;
60 
64  void DrawImage(const vtkRectf& pos, vtkImageData* image) override;
65 
71  void DrawPolyData(float vtkNotUsed(p)[2],
72  float vtkNotUsed(scale),
73  vtkPolyData* vtkNotUsed(polyData),
74  vtkUnsignedCharArray* vtkNotUsed(colors),
75  int vtkNotUsed(scalarMode)) override {}
76 
80  void SetColor4(unsigned char color[4]) override;
81 
85  void SetTexture(vtkImageData* image, int properties) override;
86 
90  void SetPointSize(float size) override;
91 
96  void SetLineWidth(float width) override;
97 
102  void SetLineType(int type) override;
103 
107  void SetMatrix(vtkMatrix3x3* m) override;
108 
112  void GetMatrix(vtkMatrix3x3* m) override;
113 
117  void MultiplyMatrix(vtkMatrix3x3* m) override;
118 
122  void PushMatrix() override;
123 
127  void PopMatrix() override;
128 
132  void EnableClipping(bool enable) override;
133 
137  void SetClipping(int* x) override;
138 
142  void ApplyPen(vtkPen* pen) override;
143 
147  vtkPen* GetPen() override;
148 
152  void ApplyBrush(vtkBrush* brush) override;
153 
157  vtkBrush* GetBrush() override;
158 
162  void ApplyTextProp(vtkTextProperty* prop) override;
163 
167  vtkTextProperty* GetTextProp() override;
168 
172  void DrawPoly(float* points,
173  int n,
174  unsigned char* colors = 0,
175  int nc_comps = 0) override;
176 
180  void DrawLines(float* f,
181  int n,
182  unsigned char* colors = 0,
183  int nc_comps = 0) override;
184 
188  void DrawPoints(float* points,
189  int n,
190  unsigned char* colors = 0,
191  int nc_comps = 0) override;
192 
196  void DrawPointSprites(vtkImageData* sprite,
197  float* points,
198  int n,
199  unsigned char* colors = 0,
200  int nc_comps = 0) override;
201 
205  void DrawMarkers(int shape,
206  bool highlight,
207  float* points,
208  int n,
209  unsigned char* colors = 0,
210  int nc_comps = 0) override;
211 
215  void DrawEllipseWedge(float x,
216  float y,
217  float outRx,
218  float outRy,
219  float inRx,
220  float inRy,
221  float startAngle,
222  float stopAngle) override;
223 
227  void DrawEllipticArc(float x,
228  float y,
229  float rX,
230  float rY,
231  float startAngle,
232  float stopAngle) override;
233 
237  void ComputeStringBounds(const vtkStdString& string,
238  float bounds[4]) override;
239 
243  void ComputeJustifiedStringBounds(const char* string,
244  float bounds[4]) override;
245 
249  void Begin(vtkViewport*) override;
250 
254  void End() override;
255 
259  bool GetBufferIdMode() const override;
260 
264  void BufferIdModeBegin(vtkAbstractContextBufferId* bufferId) override;
265 
269  void BufferIdModeEnd() override;
270 
271 protected:
273  ~vtkBoundingRectContextDevice2D() override;
274 
279 
284  vtkRectf BoundingRect;
285 
289  vtkContextDevice2D* DelegateDevice;
290 
294  void AddPoint(float x, float y);
295  void AddPoint(float point[2]);
296 
300  void AddRect(const vtkRectf& rect);
301 
302 private:
304  delete;
305  void operator=(const vtkBoundingRectContextDevice2D&) = delete;
306 };
std::shared_ptr< core::Tensor > image
int width
int size
int points
char type
math::float4 color
static vtkBoundingRectContextDevice2D * New()
vtkGetObjectMacro(DelegateDevice, vtkContextDevice2D)
vtkTypeMacro(vtkBoundingRectContextDevice2D, vtkContextDevice2D) void PrintSelf(ostream &os
vtkSetObjectMacro(DelegateDevice, vtkContextDevice2D)
void DrawPolyData(float vtkNotUsed(p)[2], float vtkNotUsed(scale), vtkPolyData *vtkNotUsed(polyData), vtkUnsignedCharArray *vtkNotUsed(colors), int vtkNotUsed(scalarMode)) override
void DrawImage(const vtkRectf &pos, vtkImageData *image) override
double colors[3]
normal_z y
normal_z x
#define QPCL_ENGINE_LIB_API
Definition: qPCL.h:15