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 =========================================================================*/
29 #ifndef vtkProperty2D_h
30 #define vtkProperty2D_h
31 
32 #include "vtkObject.h"
33 #include "vtkRenderingCoreModule.h" // For export macro
34 
35 class vtkViewport;
36 
37 #define VTK_BACKGROUND_LOCATION 0
38 #define VTK_FOREGROUND_LOCATION 1
39 
40 class VTKRENDERINGCORE_EXPORT vtkProperty2D : public vtkObject
41 {
42 public:
43  vtkTypeMacro(vtkProperty2D, vtkObject);
44  void PrintSelf(ostream& os, vtkIndent indent) override;
45 
50  static vtkProperty2D* New();
51 
55  void DeepCopy(vtkProperty2D* p);
56 
58 
61  vtkSetVector3Macro(Color, double);
62  vtkGetVector3Macro(Color, double);
64 
66 
69  vtkGetMacro(Opacity, double);
70  vtkSetMacro(Opacity, double);
72 
74 
78  vtkSetClampMacro(PointSize, float, 0, VTK_FLOAT_MAX);
79  vtkGetMacro(PointSize, float);
81 
83 
87  vtkSetClampMacro(LineWidth, float, 0, VTK_FLOAT_MAX);
88  vtkGetMacro(LineWidth, float);
90 
92 
97  vtkSetMacro(LineStipplePattern, int);
98  vtkGetMacro(LineStipplePattern, int);
100 
102 
107  vtkSetClampMacro(LineStippleRepeatFactor, int, 1, VTK_INT_MAX);
108  vtkGetMacro(LineStippleRepeatFactor, int);
110 
112 
121  vtkSetClampMacro(DisplayLocation, int, VTK_BACKGROUND_LOCATION, VTK_FOREGROUND_LOCATION);
122  vtkGetMacro(DisplayLocation, int);
123  void SetDisplayLocationToBackground() { this->DisplayLocation = VTK_BACKGROUND_LOCATION; }
124  void SetDisplayLocationToForeground() { this->DisplayLocation = VTK_FOREGROUND_LOCATION; }
126 
130  virtual void Render(vtkViewport* vtkNotUsed(viewport)) {}
131 
132 protected:
133  vtkProperty2D();
134  ~vtkProperty2D() override;
135 
136  double Color[3];
137  double Opacity;
138  float PointSize;
139  float LineWidth;
143 
144 private:
145  vtkProperty2D(const vtkProperty2D&) = delete;
146  void operator=(const vtkProperty2D&) = delete;
147 };
148 
149 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:62
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:38
virtual void Render(vtkViewport *vtkNotUsed(viewport))
Have the device specific subclass render this property.
abstract specification for Viewports
Definition: vtkViewport.h:55
#define VTK_INT_MAX
Definition: vtkType.h:155
#define VTK_FLOAT_MAX
Definition: vtkType.h:163
int LineStippleRepeatFactor
a simple class to control print indentation
Definition: vtkIndent.h:39
void SetDisplayLocationToForeground()
The DisplayLocation is either background or foreground.
represent surface properties of a 2D image
Definition: vtkProperty2D.h:40
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:37
void SetDisplayLocationToBackground()
The DisplayLocation is either background or foreground.