VTK  9.1.0
vtkProperty2D.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkProperty2D.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
135 #ifndef vtkProperty2D_h
136 #define vtkProperty2D_h
137 
138 #include "vtkObject.h"
139 #include "vtkRenderingCoreModule.h" // For export macro
140 
141 class vtkViewport;
142 
143 #define VTK_BACKGROUND_LOCATION 0
144 #define VTK_FOREGROUND_LOCATION 1
145 
146 class VTKRENDERINGCORE_EXPORT vtkProperty2D : public vtkObject
147 {
148 public:
149  vtkTypeMacro(vtkProperty2D, vtkObject);
150  void PrintSelf(ostream& os, vtkIndent indent) override;
151 
156  static vtkProperty2D* New();
157 
162 
164 
167  vtkSetVector3Macro(Color, double);
168  vtkGetVector3Macro(Color, double);
170 
172 
175  vtkGetMacro(Opacity, double);
176  vtkSetMacro(Opacity, double);
178 
180 
184  vtkSetClampMacro(PointSize, float, 0, VTK_FLOAT_MAX);
185  vtkGetMacro(PointSize, float);
187 
189 
193  vtkSetClampMacro(LineWidth, float, 0, VTK_FLOAT_MAX);
194  vtkGetMacro(LineWidth, float);
196 
198 
203  vtkSetMacro(LineStipplePattern, int);
204  vtkGetMacro(LineStipplePattern, int);
206 
208 
213  vtkSetClampMacro(LineStippleRepeatFactor, int, 1, VTK_INT_MAX);
214  vtkGetMacro(LineStippleRepeatFactor, int);
216 
218 
227  vtkSetClampMacro(DisplayLocation, int, VTK_BACKGROUND_LOCATION, VTK_FOREGROUND_LOCATION);
228  vtkGetMacro(DisplayLocation, int);
229  void SetDisplayLocationToBackground() { this->DisplayLocation = VTK_BACKGROUND_LOCATION; }
230  void SetDisplayLocationToForeground() { this->DisplayLocation = VTK_FOREGROUND_LOCATION; }
232 
236  virtual void Render(vtkViewport* vtkNotUsed(viewport)) {}
237 
238 protected:
240  ~vtkProperty2D() override;
241 
242  double Color[3];
243  double Opacity;
244  float PointSize;
245  float LineWidth;
249 
250 private:
251  vtkProperty2D(const vtkProperty2D&) = delete;
252  void operator=(const vtkProperty2D&) = delete;
253 };
254 
255 #endif
a simple class to control print indentation
Definition: vtkIndent.h:113
abstract base class for most VTK objects
Definition: vtkObject.h:73
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:47
@ Color
Definition: vtkX3D.h:52
#define VTK_FOREGROUND_LOCATION
#define VTK_BACKGROUND_LOCATION
#define VTK_INT_MAX
Definition: vtkType.h:155
#define VTK_FLOAT_MAX
Definition: vtkType.h:163