Slicer  5.1
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkMRMLAbstractWidgetRepresentation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Copyright (c) ProxSim ltd., Kwun Tong, Hong Kong. All Rights Reserved.
4 
5  See COPYRIGHT.txt
6  or http://www.slicer.org/copyright/copyright.txt for details.
7 
8  Unless required by applicable law or agreed to in writing, software
9  distributed under the License is distributed on an "AS IS" BASIS,
10  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11  See the License for the specific language governing permissions and
12  limitations under the License.
13 
14  This file was originally developed by Davide Punzo, punzodavide@hotmail.it,
15  and development was supported by ProxSim ltd.
16 
17 =========================================================================*/
18 
41 #ifndef vtkMRMLAbstractRepresentation_h
42 #define vtkMRMLAbstractRepresentation_h
43 
44 #include "vtkMRMLDisplayableManagerExport.h"
45 #include "vtkWidgetRepresentation.h"
46 
48 
49 #include <vector>
50 
51 class vtkMapper;
52 
53 #include "vtkBoundingBox.h"
54 
55 class VTK_MRML_DISPLAYABLEMANAGER_EXPORT vtkMRMLAbstractWidgetRepresentation : public vtkProp
56 {
57 public:
59  vtkTypeMacro(vtkMRMLAbstractWidgetRepresentation, vtkProp);
60  void PrintSelf(ostream& os, vtkIndent indent) override;
61 
63 
70  double *GetBounds() VTK_SIZEHINT(6) override { return nullptr; }
71  void GetActors(vtkPropCollection *) override {}
72  void GetActors2D(vtkPropCollection *) override {}
73  void GetVolumes(vtkPropCollection *) override {}
74  void ReleaseGraphicsResources(vtkWindow *) override {}
75  int RenderOverlay(vtkViewport *vtkNotUsed(viewport)) override { return 0; }
76  int RenderOpaqueGeometry(vtkViewport *vtkNotUsed(viewport)) override { return 0; }
77  int RenderTranslucentPolygonalGeometry(vtkViewport *vtkNotUsed(viewport)) override { return 0; }
78  int RenderVolumetricGeometry(vtkViewport *vtkNotUsed(viewport)) override { return 0; }
79  vtkTypeBool HasTranslucentPolygonalGeometry() override { return 0; }
81 
83 
93  virtual void SetRenderer(vtkRenderer *ren);
94  virtual vtkRenderer* GetRenderer();
96 
98 
101  virtual void SetViewNode(vtkMRMLAbstractViewNode* viewNode);
102  virtual vtkMRMLAbstractViewNode* GetViewNode();
104 
110  virtual void UpdateFromMRML(vtkMRMLNode* caller, unsigned long event, void *callData = nullptr);
111 
115  vtkSetMacro(PickingTolerance, double);
116  vtkGetMacro(PickingTolerance, double);
117 
122  vtkSetMacro(AlwaysOnTop, bool);
123  vtkGetMacro(AlwaysOnTop, bool);
124  vtkBooleanMacro(AlwaysOnTop, bool);
125 
127 
131  vtkGetMacro(NeedToRender, bool);
132  vtkSetMacro(NeedToRender, bool);
133  vtkBooleanMacro(NeedToRender, bool);
135 
136  protected:
139 
142  void AddActorsBounds(vtkBoundingBox& bounds, const std::vector<vtkProp*> &actors, double* additionalBounds = nullptr);
143 
146  void GetRendererComputedDisplayPositionFromWorldPosition(const double worldPos[3], double displayPos[2]);
147 
148  virtual void UpdateRelativeCoincidentTopologyOffsets(vtkMapper* mapper);
149 
151  vtkWeakPointer<vtkRenderer> Renderer;
152 
154 
159 
162 
163  vtkWeakPointer<vtkMRMLAbstractViewNode> ViewNode;
164 
166 
168  double Bounds[6];
169 
170 private:
172  void operator=(const vtkMRMLAbstractWidgetRepresentation&) = delete;
173 };
174 
175 #endif
int RenderOpaqueGeometry(vtkViewport *vtkNotUsed(viewport)) override
vtkWeakPointer< vtkRenderer > Renderer
The renderer in which this widget is placed.
int RenderOverlay(vtkViewport *vtkNotUsed(viewport)) override
int RenderVolumetricGeometry(vtkViewport *vtkNotUsed(viewport)) override
Abstract MRML node to represent a view. The class holds the properties common to any view type (3D...
vtkWeakPointer< vtkMRMLAbstractViewNode > ViewNode
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167
int RenderTranslucentPolygonalGeometry(vtkViewport *vtkNotUsed(viewport)) override
double ScreenScaleFactor
Allows global rescaling of all widgets (to compensate for larger or smaller physical screen size) ...