VTK  9.7.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 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
23 
24 VTK_ABI_NAMESPACE_BEGIN
25 class vtkViewport;
26 
27 #define VTK_BACKGROUND_LOCATION 0
28 #define VTK_FOREGROUND_LOCATION 1
29 
30 class VTKRENDERINGCORE_EXPORT VTK_MARSHALAUTO vtkProperty2D : public vtkObject
31 {
32 public:
33  vtkTypeMacro(vtkProperty2D, vtkObject);
34  void PrintSelf(ostream& os, vtkIndent indent) override;
35 
40  static vtkProperty2D* New();
41 
45  void DeepCopy(vtkProperty2D* p);
46 
48 
51  vtkSetVector3Macro(Color, double);
52  vtkGetVector3Macro(Color, double);
54 
56 
59  vtkGetMacro(Opacity, double);
60  vtkSetMacro(Opacity, double);
62 
64 
68  vtkSetClampMacro(PointSize, float, 0, VTK_FLOAT_MAX);
69  vtkGetMacro(PointSize, float);
71 
73 
77  vtkSetClampMacro(LineWidth, float, 0, VTK_FLOAT_MAX);
78  vtkGetMacro(LineWidth, float);
80 
82 
87  vtkSetMacro(LineStipplePattern, int);
88  vtkGetMacro(LineStipplePattern, int);
90 
92 
97  vtkSetClampMacro(LineStippleRepeatFactor, int, 1, VTK_INT_MAX);
98  vtkGetMacro(LineStippleRepeatFactor, int);
100 
102 
111  vtkSetClampMacro(DisplayLocation, int, VTK_BACKGROUND_LOCATION, VTK_FOREGROUND_LOCATION);
112  vtkGetMacro(DisplayLocation, int);
113  void SetDisplayLocationToBackground() { this->DisplayLocation = VTK_BACKGROUND_LOCATION; }
114  void SetDisplayLocationToForeground() { this->DisplayLocation = VTK_FOREGROUND_LOCATION; }
116 
120  virtual void Render(vtkViewport* vtkNotUsed(viewport)) {}
121 
122 protected:
123  vtkProperty2D();
124  ~vtkProperty2D() override;
125 
126  double Color[3];
127  double Opacity;
128  float PointSize;
129  float LineWidth;
133 
134 private:
135  vtkProperty2D(const vtkProperty2D&) = delete;
136  void operator=(const vtkProperty2D&) = delete;
137 };
138 
139 VTK_ABI_NAMESPACE_END
140 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:52
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:28
abstract specification for Viewports
Definition: vtkViewport.h:46
#define VTK_INT_MAX
Definition: vtkType.h:192
virtual void Render(vtkViewport *viewport)
Have the device specific subclass render this property.
#define VTK_FLOAT_MAX
Definition: vtkType.h:200
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:30
#define VTK_MARSHALAUTO
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:27
void SetDisplayLocationToBackground()
The DisplayLocation is either background or foreground.