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:
18  vtkTypeMacro(vtkBoundingRectContextDevice2D,
19  vtkContextDevice2D) void PrintSelf(ostream& os,
20  vtkIndent indent) override;
21  static vtkBoundingRectContextDevice2D* New();
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 };
vtkBoundingRectContextDevice2D::DrawPolyData
void DrawPolyData(float vtkNotUsed(p)[2], float vtkNotUsed(scale), vtkPolyData *vtkNotUsed(polyData), vtkUnsignedCharArray *vtkNotUsed(colors), int vtkNotUsed(scalarMode)) override
Definition: vtkBoundingRectContextDevice2D.h:71
colors
double colors[3]
Definition: TriangleMeshIO.cpp:53
vtkBoundingRectContextDevice2D::End
void End() override
Definition: vtkBoundingRectContextDevice2D.cpp:391
vtkBoundingRectContextDevice2D::PushMatrix
void PushMatrix() override
Definition: vtkBoundingRectContextDevice2D.cpp:178
vtkBoundingRectContextDevice2D::DrawEllipticArc
void DrawEllipticArc(float x, float y, float rX, float rY, float startAngle, float stopAngle) override
Definition: vtkBoundingRectContextDevice2D.cpp:353
vtkBoundingRectContextDevice2D::DrawMarkers
void DrawMarkers(int shape, bool highlight, float *points, int n, unsigned char *colors=0, int nc_comps=0) override
Definition: vtkBoundingRectContextDevice2D.cpp:316
vtkBoundingRectContextDevice2D::ApplyTextProp
void ApplyTextProp(vtkTextProperty *prop) override
Definition: vtkBoundingRectContextDevice2D.cpp:238
vtkBoundingRectContextDevice2D::DrawString
void DrawString(float *point, const vtkStdString &string) override
Definition: vtkBoundingRectContextDevice2D.cpp:72
vtkBoundingRectContextDevice2D::EnableClipping
void EnableClipping(bool enable) override
Definition: vtkBoundingRectContextDevice2D.cpp:192
x
normal_z x
Definition: my_point_types.h:165
vtkBoundingRectContextDevice2D::GetBrush
vtkBrush * GetBrush() override
Definition: vtkBoundingRectContextDevice2D.cpp:229
vtkBoundingRectContextDevice2D::DrawLines
void DrawLines(float *f, int n, unsigned char *colors=0, int nc_comps=0) override
Definition: vtkBoundingRectContextDevice2D.cpp:262
vtkBoundingRectContextDevice2D.h
vtkBoundingRectContextDevice2D::DelegateDevice
vtkContextDevice2D * DelegateDevice
Definition: vtkBoundingRectContextDevice2D.h:289
vtkBoundingRectContextDevice2D::ApplyPen
void ApplyPen(vtkPen *pen) override
Definition: vtkBoundingRectContextDevice2D.cpp:206
vtkBoundingRectContextDevice2D::SetLineWidth
void SetLineWidth(float width) override
Definition: vtkBoundingRectContextDevice2D.cpp:143
NULL
#define NULL
Definition: UVUnwrapping.cpp:40
vtkBoundingRectContextDevice2D::Initialized
bool Initialized
Definition: vtkBoundingRectContextDevice2D.h:278
vtkBoundingRectContextDevice2D::ComputeJustifiedStringBounds
void ComputeJustifiedStringBounds(const char *string, float bounds[4]) override
Definition: vtkBoundingRectContextDevice2D.cpp:376
vtkBoundingRectContextDevice2D::DrawPointSprites
void DrawPointSprites(vtkImageData *sprite, float *points, int n, unsigned char *colors=0, int nc_comps=0) override
Definition: vtkBoundingRectContextDevice2D.cpp:292
vtkBoundingRectContextDevice2D::SetPointSize
void SetPointSize(float size) override
Definition: vtkBoundingRectContextDevice2D.cpp:136
vtkBoundingRectContextDevice2D::SetLineType
void SetLineType(int type) override
Definition: vtkBoundingRectContextDevice2D.cpp:150
vtkBoundingRectContextDevice2D::DrawEllipseWedge
void DrawEllipseWedge(float x, float y, float outRx, float outRy, float inRx, float inRy, float startAngle, float stopAngle) override
Definition: vtkBoundingRectContextDevice2D.cpp:330
vtkBoundingRectContextDevice2D::Reset
void Reset()
Definition: vtkBoundingRectContextDevice2D.cpp:41
color
math::float4 color
Definition: LineSetBuffers.cpp:46
vtkBoundingRectContextDevice2D::DrawImage
void DrawImage(float p[2], float scale, vtkImageData *image) override
Definition: vtkBoundingRectContextDevice2D.cpp:105
vtkBoundingRectContextDevice2D::vtkBoundingRectContextDevice2D
vtkBoundingRectContextDevice2D()
vtkBoundingRectContextDevice2D::GetBufferIdMode
bool GetBufferIdMode() const override
Definition: vtkBoundingRectContextDevice2D.cpp:398
width
int width
Definition: FileIOFactory.cpp:142
context
ImGuiContext * context
Definition: Window.cpp:76
qPCL.h
size
int size
Definition: FileIOFactory.cpp:130
y
normal_z y
Definition: my_point_types.h:168
vtkBoundingRectContextDevice2D::DrawPoly
void DrawPoly(float *points, int n, unsigned char *colors=0, int nc_comps=0) override
Definition: vtkBoundingRectContextDevice2D.cpp:254
vtkBoundingRectContextDevice2D::DrawPoints
void DrawPoints(float *points, int n, unsigned char *colors=0, int nc_comps=0) override
Definition: vtkBoundingRectContextDevice2D.cpp:277
vtkBoundingRectContextDevice2D::GetBoundingRect
vtkRectf GetBoundingRect()
Definition: vtkBoundingRectContextDevice2D.cpp:67
vtkBoundingRectContextDevice2D::Begin
void Begin(vtkViewport *) override
Definition: vtkBoundingRectContextDevice2D.cpp:384
vtkBoundingRectContextDevice2D::AddPoint
void AddPoint(float x, float y)
Definition: vtkBoundingRectContextDevice2D.cpp:421
vtkBoundingRectContextDevice2D::~vtkBoundingRectContextDevice2D
~vtkBoundingRectContextDevice2D() override
Definition: vtkBoundingRectContextDevice2D.cpp:28
vtkBoundingRectContextDevice2D::BufferIdModeEnd
void BufferIdModeEnd() override
Definition: vtkBoundingRectContextDevice2D.cpp:414
a
a[190]
Definition: essential_matrix_poly.h:19
vtkBoundingRectContextDevice2D::GetTextProp
vtkTextProperty * GetTextProp() override
Definition: vtkBoundingRectContextDevice2D.cpp:245
image
std::shared_ptr< core::Tensor > image
Definition: FilamentRenderer.cpp:184
vtkBoundingRectContextDevice2D::AddRect
void AddRect(const vtkRectf &rect)
Definition: vtkBoundingRectContextDevice2D.cpp:437
points
int points
Definition: FileIOFactory.cpp:144
vtkBoundingRectContextDevice2D::BufferIdModeBegin
void BufferIdModeBegin(vtkAbstractContextBufferId *bufferId) override
Definition: vtkBoundingRectContextDevice2D.cpp:406
vtkBoundingRectContextDevice2D::DrawMathTextString
void DrawMathTextString(float *point, const vtkStdString &string) override
Definition: vtkBoundingRectContextDevice2D.cpp:88
vtkBoundingRectContextDevice2D::GetMatrix
void GetMatrix(vtkMatrix3x3 *m) override
Definition: vtkBoundingRectContextDevice2D.cpp:164
vtkBoundingRectContextDevice2D::ComputeStringBounds
void ComputeStringBounds(const vtkStdString &string, float bounds[4]) override
Definition: vtkBoundingRectContextDevice2D.cpp:368
vtkBoundingRectContextDevice2D
Definition: vtkBoundingRectContextDevice2D.h:15
vtkBoundingRectContextDevice2D::GetPen
vtkPen * GetPen() override
Definition: vtkBoundingRectContextDevice2D.cpp:213
QPCL_ENGINE_LIB_API
#define QPCL_ENGINE_LIB_API
Definition: qPCL.h:15
vtkBoundingRectContextDevice2D::SetClipping
void SetClipping(int *x) override
Definition: vtkBoundingRectContextDevice2D.cpp:199
vtkBoundingRectContextDevice2D::BoundingRect
vtkRectf BoundingRect
Definition: vtkBoundingRectContextDevice2D.h:284
vtkBoundingRectContextDevice2D::SetTexture
void SetTexture(vtkImageData *image, int properties) override
Definition: vtkBoundingRectContextDevice2D.cpp:128
vtkBoundingRectContextDevice2D::PopMatrix
void PopMatrix() override
Definition: vtkBoundingRectContextDevice2D.cpp:185
vtkBoundingRectContextDevice2D::MultiplyMatrix
void MultiplyMatrix(vtkMatrix3x3 *m) override
Definition: vtkBoundingRectContextDevice2D.cpp:171
vtkStandardNewMacro
vtkStandardNewMacro(vtkBoundingRectContextDevice2D) vtkBoundingRectContextDevice2D
Definition: vtkBoundingRectContextDevice2D.cpp:19
vtkBoundingRectContextDevice2D::ApplyBrush
void ApplyBrush(vtkBrush *brush) override
Definition: vtkBoundingRectContextDevice2D.cpp:222
vtkBoundingRectContextDevice2D::SetColor4
void SetColor4(unsigned char color[4]) override
Definition: vtkBoundingRectContextDevice2D.cpp:121
type
char type
Definition: FileIOFactory.cpp:131
vtkBoundingRectContextDevice2D::SetMatrix
void SetMatrix(vtkMatrix3x3 *m) override
Definition: vtkBoundingRectContextDevice2D.cpp:157