Version: 9.16.0
salomevtkPVAxesWidget.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ParaView
4 Module: $RCSfile$
5
6 Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc.
7 All rights reserved.
8
9 ParaView is a free software; you can redistribute it and/or modify it
10 under the terms of the ParaView license version 1.2.
11
12 See License_v1.2.txt for the full ParaView license.
13 A copy of this license can be obtained by contacting
14 Kitware Inc.
15 28 Corporate Drive
16 Clifton Park, NY 12065
17 USA
18
19THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
23CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
31=========================================================================*/
32// .NAME vtkPVAxesWidget - A widget to manipulate an axe
33//
34// .SECTION Description
35// This widget creates and manages its own vtkPVAxesActor.
36// VSR 03/12/2014: the original file vtkPVAxesWidget.h has been renamed to salomevtkPVAxesWidget.h
37// to avoid collisions with native VTK/ParaView classes
38
39
40#ifndef __salomevtkPVAxesWidget_h
41#define __salomevtkPVAxesWidget_h
42
43#include "SVTK.h" // added by SALOME
44#include "vtkInteractorObserver.h"
45
46class vtkActor2D;
47class vtkKWApplication;
48class vtkPolyData;
49class vtkRenderer;
50
51// VSR 03/12/2014: we put classes copied from VTK/ParaView to the specific namespace
52// to avoid collisions with native VTK/ParaView classes
53namespace salomevtk
54{
55
56class vtkPVAxesWidgetObserver;
57class vtkPVAxesActor;
58
60{
61public:
64 void PrintSelf(ostream& os, vtkIndent indent);
65
66 // Description:
67 // Set/get the axes actor to be displayed in this 3D widget.
68 void SetAxesActor(vtkPVAxesActor *actor);
69 vtkGetObjectMacro(AxesActor, vtkPVAxesActor);
70
71 // Description:
72 // Enable the 3D widget.
73 virtual void SetEnabled(int);
74
75 //BTX
76 // Description:
77 // Set the renderer this 3D widget will be contained in.
78 void SetParentRenderer(vtkRenderer *ren);
79 vtkRenderer* GetParentRenderer();
80 //ETX
81
82 // Description:
83 // Callback to keep the camera for the axes actor up to date with the
84 // camera in the parent renderer
85 void ExecuteEvent(vtkObject *o, unsigned long event, void *calldata);
86
87 // Description:
88 // Set/get whether to allow this 3D widget to be interactively moved/scaled.
89 void SetInteractive(int state);
90 vtkGetMacro(Interactive, int);
91 vtkBooleanMacro(Interactive, int);
92
93 // Description:
94 // Set/get the color of the outline of this widget. The outline is visible
95 // when (in interactive mode) the cursor is over this 3D widget.
96 void SetOutlineColor(double r, double g, double b);
97 double *GetOutlineColor();
98
99 // Description:
100 // Set/get the color of the axis labels of this widget.
101 void SetAxisLabelColor(double r, double g, double b);
102 double *GetAxisLabelColor();
103
104 // Description:
105 // Set/get the viewport to position/size this 3D widget.
106 void SetViewport(double minX, double minY, double maxX, double maxY);
107 double* GetViewport();
108
109protected:
112
113 vtkRenderer *Renderer;
114 vtkRenderer *ParentRenderer;
115
117 vtkPolyData *Outline;
118 vtkActor2D *OutlineActor;
119
120 static void ProcessEvents(vtkObject *object, unsigned long event,
121 void *clientdata, void *calldata);
122
123 vtkPVAxesWidgetObserver *Observer;
124 int StartTag;
125
126 int MouseCursorState;
127 int Moving;
128 int StartPosition[2];
129
130 int Interactive;
131
132 void UpdateCursorIcon();
133 void SetMouseCursor(int cursorState);
134
135//BTX
136 int State;
137
139 {
140 Outside = 0,
145 BottomRight
146 };
147//ETX
148
149 void OnButtonPress();
150 void OnMouseMove();
151 void OnButtonRelease();
152
153 void MoveWidget();
154 void ResizeTopLeft();
155 void ResizeTopRight();
156 void ResizeBottomLeft();
157 void ResizeBottomRight();
158
159 void SquareRenderer();
160
161 unsigned long StartEventObserverId;
162private:
163 vtkPVAxesWidget(const vtkPVAxesWidget&); // Not implemented
164 void operator=(const vtkPVAxesWidget&); // Not implemented
165};
166
167} // end of salomevtk namespace
168
169#endif
#define SVTK_EXPORT
Definition: SVTK.h:37
@ MoveWidget
move specified widget to the new area, other views stay in the previous area
Definition: SalomePyQt.h:154
Definition: salomevtkPVAxesActor.h:69
Definition: salomevtkPVAxesWidget.h:60
vtkTypeMacro(vtkPVAxesWidget, vtkInteractorObserver) void PrintSelf(ostream &os
unsigned long StartEventObserverId
Definition: salomevtkPVAxesWidget.h:161
AxesWidgetState
Definition: salomevtkPVAxesWidget.h:139
@ TopRight
Definition: salomevtkPVAxesWidget.h:143
@ TopLeft
Definition: salomevtkPVAxesWidget.h:142
@ Inside
Definition: salomevtkPVAxesWidget.h:141
@ BottomLeft
Definition: salomevtkPVAxesWidget.h:144
void operator=(const vtkPVAxesWidget &)
vtkPVAxesWidget(const vtkPVAxesWidget &)
static vtkPVAxesWidget * New()
Definition: salomevtkPVAxesActor.cxx:60
AxesActor
Definition: salomevtkPVAxesWidget.cxx:59