VTK  9.2.6
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 =========================================================================*/
38 #ifndef vtkProperty2D_h
39 #define vtkProperty2D_h
40 
41 #include "vtkObject.h"
42 #include "vtkRenderingCoreModule.h" // For export macro
43 
44 class vtkViewport;
45 
46 #define VTK_BACKGROUND_LOCATION 0
47 #define VTK_FOREGROUND_LOCATION 1
48 
49 class VTKRENDERINGCORE_EXPORT vtkProperty2D : public vtkObject
50 {
51 public:
52  vtkTypeMacro(vtkProperty2D, vtkObject);
53  void PrintSelf(ostream& os, vtkIndent indent) override;
54 
59  static vtkProperty2D* New();
60 
65 
67 
70  vtkSetVector3Macro(Color, double);
71  vtkGetVector3Macro(Color, double);
73 
75 
78  vtkGetMacro(Opacity, double);
79  vtkSetMacro(Opacity, double);
81 
83 
87  vtkSetClampMacro(PointSize, float, 0, VTK_FLOAT_MAX);
88  vtkGetMacro(PointSize, float);
90 
92 
96  vtkSetClampMacro(LineWidth, float, 0, VTK_FLOAT_MAX);
97  vtkGetMacro(LineWidth, float);
99 
101 
106  vtkSetMacro(LineStipplePattern, int);
107  vtkGetMacro(LineStipplePattern, int);
109 
111 
116  vtkSetClampMacro(LineStippleRepeatFactor, int, 1, VTK_INT_MAX);
117  vtkGetMacro(LineStippleRepeatFactor, int);
119 
121 
130  vtkSetClampMacro(DisplayLocation, int, VTK_BACKGROUND_LOCATION, VTK_FOREGROUND_LOCATION);
131  vtkGetMacro(DisplayLocation, int);
132  void SetDisplayLocationToBackground() { this->DisplayLocation = VTK_BACKGROUND_LOCATION; }
133  void SetDisplayLocationToForeground() { this->DisplayLocation = VTK_FOREGROUND_LOCATION; }
135 
139  virtual void Render(vtkViewport* vtkNotUsed(viewport)) {}
140 
141 protected:
143  ~vtkProperty2D() override;
144 
145  double Color[3];
146  double Opacity;
147  float PointSize;
148  float LineWidth;
152 
153 private:
154  vtkProperty2D(const vtkProperty2D&) = delete;
155  void operator=(const vtkProperty2D&) = delete;
156 };
157 
158 #endif
a simple class to control print indentation
Definition: vtkIndent.h:49
abstract base class for most VTK objects
Definition: vtkObject.h:72
represent surface properties of a 2D image
Definition: vtkProperty2D.h:50
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:52
#define VTK_FOREGROUND_LOCATION
Definition: vtkProperty2D.h:47
#define VTK_BACKGROUND_LOCATION
Definition: vtkProperty2D.h:46
#define VTK_INT_MAX
Definition: vtkType.h:155
#define VTK_FLOAT_MAX
Definition: vtkType.h:163