VTK  9.3.1
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
17 #ifndef vtkProperty2D_h
18 #define vtkProperty2D_h
19 
20 #include "vtkObject.h"
21 #include "vtkRenderingCoreModule.h" // For export macro
22 
23 VTK_ABI_NAMESPACE_BEGIN
24 class vtkViewport;
25 
26 #define VTK_BACKGROUND_LOCATION 0
27 #define VTK_FOREGROUND_LOCATION 1
28 
29 class VTKRENDERINGCORE_EXPORT vtkProperty2D : public vtkObject
30 {
31 public:
32  vtkTypeMacro(vtkProperty2D, vtkObject);
33  void PrintSelf(ostream& os, vtkIndent indent) override;
34 
39  static vtkProperty2D* New();
40 
44  void DeepCopy(vtkProperty2D* p);
45 
47 
50  vtkSetVector3Macro(Color, double);
51  vtkGetVector3Macro(Color, double);
53 
55 
58  vtkGetMacro(Opacity, double);
59  vtkSetMacro(Opacity, double);
61 
63 
67  vtkSetClampMacro(PointSize, float, 0, VTK_FLOAT_MAX);
68  vtkGetMacro(PointSize, float);
70 
72 
76  vtkSetClampMacro(LineWidth, float, 0, VTK_FLOAT_MAX);
77  vtkGetMacro(LineWidth, float);
79 
81 
86  vtkSetMacro(LineStipplePattern, int);
87  vtkGetMacro(LineStipplePattern, int);
89 
91 
96  vtkSetClampMacro(LineStippleRepeatFactor, int, 1, VTK_INT_MAX);
97  vtkGetMacro(LineStippleRepeatFactor, int);
99 
101 
110  vtkSetClampMacro(DisplayLocation, int, VTK_BACKGROUND_LOCATION, VTK_FOREGROUND_LOCATION);
111  vtkGetMacro(DisplayLocation, int);
112  void SetDisplayLocationToBackground() { this->DisplayLocation = VTK_BACKGROUND_LOCATION; }
113  void SetDisplayLocationToForeground() { this->DisplayLocation = VTK_FOREGROUND_LOCATION; }
115 
119  virtual void Render(vtkViewport* vtkNotUsed(viewport)) {}
120 
121 protected:
122  vtkProperty2D();
123  ~vtkProperty2D() override;
124 
125  double Color[3];
126  double Opacity;
127  float PointSize;
128  float LineWidth;
132 
133 private:
134  vtkProperty2D(const vtkProperty2D&) = delete;
135  void operator=(const vtkProperty2D&) = delete;
136 };
137 
138 VTK_ABI_NAMESPACE_END
139 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:51
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
#define VTK_FOREGROUND_LOCATION
Definition: vtkProperty2D.h:27
virtual void Render(vtkViewport *vtkNotUsed(viewport))
Have the device specific subclass render this property.
abstract specification for Viewports
Definition: vtkViewport.h:44
#define VTK_INT_MAX
Definition: vtkType.h:144
#define VTK_FLOAT_MAX
Definition: vtkType.h:152
int LineStippleRepeatFactor
a simple class to control print indentation
Definition: vtkIndent.h:28
void SetDisplayLocationToForeground()
The DisplayLocation is either background or foreground.
represent surface properties of a 2D image
Definition: vtkProperty2D.h:29
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
#define VTK_BACKGROUND_LOCATION
Definition: vtkProperty2D.h:26
void SetDisplayLocationToBackground()
The DisplayLocation is either background or foreground.