VTK
vtkContextClip.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkContextItem.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 =========================================================================*/
15 
25 #ifndef vtkContextClip_h
26 #define vtkContextClip_h
27 
28 #include "vtkRenderingContext2DModule.h" // For export macro
29 #include "vtkAbstractContextItem.h"
30 #include "vtkSmartPointer.h" // Needed for SP ivars.
31 
33 {
34 public:
36  virtual void PrintSelf(ostream &os, vtkIndent indent);
37 
39  static vtkContextClip *New();
40 
44  virtual void Update();
45 
47  virtual bool Paint(vtkContext2D *painter);
48 
51  virtual void SetClip(float x, float y, float width, float height);
52 
54 
55  virtual void GetRect(float rect[4]);
56  virtual float GetX() { return Dims[0]; }
57  virtual float GetY() { return Dims[1]; }
58  virtual float GetWidth() { return Dims[2]; }
59  virtual float GetHeight() { return Dims[3]; }
61 
62 //BTX
63 protected:
65  ~vtkContextClip();
66 
67  float Dims[4];
68 
69 private:
70  vtkContextClip(const vtkContextClip &); // Not implemented.
71  void operator=(const vtkContextClip &); // Not implemented.
72  //ETX
73 };
74 
75 inline void vtkContextClip::GetRect(float rect[4])
76 {
77  rect[0] = this->Dims[0];
78  rect[1] = this->Dims[1];
79  rect[2] = this->Dims[2];
80  rect[3] = this->Dims[3];
81 }
82 
83 #endif //vtkContextClip_h
virtual float GetWidth()
virtual void GetRect(float rect[4])
virtual float GetY()
virtual bool Paint(vtkContext2D *painter)
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:56
#define VTKRENDERINGCONTEXT2D_EXPORT
a simple class to control print indentation
Definition: vtkIndent.h:38
virtual float GetX()
base class for items that are part of a vtkContextScene.
static vtkObject * New()
virtual float GetHeight()
all children of this item are clipped by the specified area.
virtual void Update()
virtual void PrintSelf(ostream &os, vtkIndent indent)