VTK  9.3.0
vtkProperty2D.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
26 #ifndef vtkProperty2D_h
27 #define vtkProperty2D_h
28 
29 #include "vtkObject.h"
30 #include "vtkRenderingCoreModule.h" // For export macro
31 
32 VTK_ABI_NAMESPACE_BEGIN
33 class vtkViewport;
34 
35 #define VTK_BACKGROUND_LOCATION 0
36 #define VTK_FOREGROUND_LOCATION 1
37 
38 class VTKRENDERINGCORE_EXPORT vtkProperty2D : public vtkObject
39 {
40 public:
41  vtkTypeMacro(vtkProperty2D, vtkObject);
42  void PrintSelf(ostream& os, vtkIndent indent) override;
43 
48  static vtkProperty2D* New();
49 
54 
56 
59  vtkSetVector3Macro(Color, double);
60  vtkGetVector3Macro(Color, double);
62 
64 
67  vtkGetMacro(Opacity, double);
68  vtkSetMacro(Opacity, double);
70 
72 
76  vtkSetClampMacro(PointSize, float, 0, VTK_FLOAT_MAX);
77  vtkGetMacro(PointSize, float);
79 
81 
85  vtkSetClampMacro(LineWidth, float, 0, VTK_FLOAT_MAX);
86  vtkGetMacro(LineWidth, float);
88 
90 
95  vtkSetMacro(LineStipplePattern, int);
96  vtkGetMacro(LineStipplePattern, int);
98 
100 
105  vtkSetClampMacro(LineStippleRepeatFactor, int, 1, VTK_INT_MAX);
106  vtkGetMacro(LineStippleRepeatFactor, int);
108 
110 
119  vtkSetClampMacro(DisplayLocation, int, VTK_BACKGROUND_LOCATION, VTK_FOREGROUND_LOCATION);
120  vtkGetMacro(DisplayLocation, int);
121  void SetDisplayLocationToBackground() { this->DisplayLocation = VTK_BACKGROUND_LOCATION; }
122  void SetDisplayLocationToForeground() { this->DisplayLocation = VTK_FOREGROUND_LOCATION; }
124 
128  virtual void Render(vtkViewport* vtkNotUsed(viewport)) {}
129 
130 protected:
132  ~vtkProperty2D() override;
133 
134  double Color[3];
135  double Opacity;
136  float PointSize;
137  float LineWidth;
141 
142 private:
143  vtkProperty2D(const vtkProperty2D&) = delete;
144  void operator=(const vtkProperty2D&) = delete;
145 };
146 
147 VTK_ABI_NAMESPACE_END
148 #endif
a simple class to control print indentation
Definition: vtkIndent.h:38
abstract base class for most VTK objects
Definition: vtkObject.h:61
represent surface properties of a 2D image
Definition: vtkProperty2D.h:39
int LineStippleRepeatFactor
void DeepCopy(vtkProperty2D *p)
Assign one property to another.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetDisplayLocationToForeground()
The DisplayLocation is either background or foreground.
static vtkProperty2D * New()
Creates a vtkProperty2D with the following default values: Opacity 1, Color (1,1,1)
void SetDisplayLocationToBackground()
The DisplayLocation is either background or foreground.
~vtkProperty2D() override
virtual void Render(vtkViewport *vtkNotUsed(viewport))
Have the device specific subclass render this property.
abstract specification for Viewports
Definition: vtkViewport.h:54
@ Color
Definition: vtkX3D.h:46
#define VTK_FOREGROUND_LOCATION
Definition: vtkProperty2D.h:36
#define VTK_BACKGROUND_LOCATION
Definition: vtkProperty2D.h:35
#define VTK_INT_MAX
Definition: vtkType.h:144
#define VTK_FLOAT_MAX
Definition: vtkType.h:152