VTK  9.3.20240418
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 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
132 
133 VTK_ABI_NAMESPACE_BEGIN
134 class vtkViewport;
135 
136 #define VTK_BACKGROUND_LOCATION 0
137 #define VTK_FOREGROUND_LOCATION 1
138 
139 class VTKRENDERINGCORE_EXPORT VTK_MARSHALAUTO vtkProperty2D : public vtkObject
140 {
141 public:
142  vtkTypeMacro(vtkProperty2D, vtkObject);
143  void PrintSelf(ostream& os, vtkIndent indent) override;
144 
149  static vtkProperty2D* New();
150 
155 
157 
160  vtkSetVector3Macro(Color, double);
161  vtkGetVector3Macro(Color, double);
163 
165 
168  vtkGetMacro(Opacity, double);
169  vtkSetMacro(Opacity, double);
171 
173 
177  vtkSetClampMacro(PointSize, float, 0, VTK_FLOAT_MAX);
178  vtkGetMacro(PointSize, float);
180 
182 
186  vtkSetClampMacro(LineWidth, float, 0, VTK_FLOAT_MAX);
187  vtkGetMacro(LineWidth, float);
189 
191 
196  vtkSetMacro(LineStipplePattern, int);
197  vtkGetMacro(LineStipplePattern, int);
199 
201 
206  vtkSetClampMacro(LineStippleRepeatFactor, int, 1, VTK_INT_MAX);
207  vtkGetMacro(LineStippleRepeatFactor, int);
209 
211 
220  vtkSetClampMacro(DisplayLocation, int, VTK_BACKGROUND_LOCATION, VTK_FOREGROUND_LOCATION);
221  vtkGetMacro(DisplayLocation, int);
222  void SetDisplayLocationToBackground() { this->DisplayLocation = VTK_BACKGROUND_LOCATION; }
223  void SetDisplayLocationToForeground() { this->DisplayLocation = VTK_FOREGROUND_LOCATION; }
225 
229  virtual void Render(vtkViewport* vtkNotUsed(viewport)) {}
230 
231 protected:
233  ~vtkProperty2D() override;
234 
235  double Color[3];
236  double Opacity;
237  float PointSize;
238  float LineWidth;
242 
243 private:
244  vtkProperty2D(const vtkProperty2D&) = delete;
245  void operator=(const vtkProperty2D&) = delete;
246 };
247 
248 VTK_ABI_NAMESPACE_END
249 #endif
a simple class to control print indentation
Definition: vtkIndent.h:108
abstract base class for most VTK objects
Definition: vtkObject.h:162
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:65
@ 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
#define VTK_MARSHALAUTO