VTK  9.3.20240226
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
126 #ifndef vtkProperty2D_h
127 #define vtkProperty2D_h
128 
129 #include "vtkObject.h"
130 #include "vtkRenderingCoreModule.h" // For export macro
131 
132 VTK_ABI_NAMESPACE_BEGIN
133 class vtkViewport;
134 
135 #define VTK_BACKGROUND_LOCATION 0
136 #define VTK_FOREGROUND_LOCATION 1
137 
138 class VTKRENDERINGCORE_EXPORT vtkProperty2D : public vtkObject
139 {
140 public:
141  vtkTypeMacro(vtkProperty2D, vtkObject);
142  void PrintSelf(ostream& os, vtkIndent indent) override;
143 
148  static vtkProperty2D* New();
149 
154 
156 
159  vtkSetVector3Macro(Color, double);
160  vtkGetVector3Macro(Color, double);
162 
164 
167  vtkGetMacro(Opacity, double);
168  vtkSetMacro(Opacity, double);
170 
172 
176  vtkSetClampMacro(PointSize, float, 0, VTK_FLOAT_MAX);
177  vtkGetMacro(PointSize, float);
179 
181 
185  vtkSetClampMacro(LineWidth, float, 0, VTK_FLOAT_MAX);
186  vtkGetMacro(LineWidth, float);
188 
190 
195  vtkSetMacro(LineStipplePattern, int);
196  vtkGetMacro(LineStipplePattern, int);
198 
200 
205  vtkSetClampMacro(LineStippleRepeatFactor, int, 1, VTK_INT_MAX);
206  vtkGetMacro(LineStippleRepeatFactor, int);
208 
210 
219  vtkSetClampMacro(DisplayLocation, int, VTK_BACKGROUND_LOCATION, VTK_FOREGROUND_LOCATION);
220  vtkGetMacro(DisplayLocation, int);
221  void SetDisplayLocationToBackground() { this->DisplayLocation = VTK_BACKGROUND_LOCATION; }
222  void SetDisplayLocationToForeground() { this->DisplayLocation = VTK_FOREGROUND_LOCATION; }
224 
228  virtual void Render(vtkViewport* vtkNotUsed(viewport)) {}
229 
230 protected:
232  ~vtkProperty2D() override;
233 
234  double Color[3];
235  double Opacity;
236  float PointSize;
237  float LineWidth;
241 
242 private:
243  vtkProperty2D(const vtkProperty2D&) = delete;
244  void operator=(const vtkProperty2D&) = delete;
245 };
246 
247 VTK_ABI_NAMESPACE_END
248 #endif
a simple class to control print indentation
Definition: vtkIndent.h:108
abstract base class for most VTK objects
Definition: vtkObject.h:161
represent surface properties of a 2D image
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:64
@ Color
Definition: vtkX3D.h:46
#define VTK_FOREGROUND_LOCATION
#define VTK_BACKGROUND_LOCATION
#define VTK_INT_MAX
Definition: vtkType.h:144
#define VTK_FLOAT_MAX
Definition: vtkType.h:152