Slicer  5.3
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 
49 
50 #include <vector>
51 
52 class vtkMapper;
53 
54 #include "vtkBoundingBox.h"
55 
56 class VTK_MRML_DISPLAYABLEMANAGER_EXPORT vtkMRMLAbstractWidgetRepresentation : public vtkProp
57 {
58 public:
60  vtkTypeMacro(vtkMRMLAbstractWidgetRepresentation, vtkProp);
61  void PrintSelf(ostream& os, vtkIndent indent) override;
62 
64 
71  double *GetBounds() VTK_SIZEHINT(6) override { return nullptr; }
72  void GetActors(vtkPropCollection *) override {}
73  void GetActors2D(vtkPropCollection *) override {}
74  void GetVolumes(vtkPropCollection *) override {}
75  void ReleaseGraphicsResources(vtkWindow *) override {}
76  int RenderOverlay(vtkViewport *vtkNotUsed(viewport)) override { return 0; }
77  int RenderOpaqueGeometry(vtkViewport *vtkNotUsed(viewport)) override { return 0; }
78  int RenderTranslucentPolygonalGeometry(vtkViewport *vtkNotUsed(viewport)) override { return 0; }
79  int RenderVolumetricGeometry(vtkViewport *vtkNotUsed(viewport)) override { return 0; }
80  vtkTypeBool HasTranslucentPolygonalGeometry() override { return 0; }
82 
84 
94  virtual void SetRenderer(vtkRenderer *ren);
95  virtual vtkRenderer* GetRenderer();
97 
99 
102  virtual void SetApplicationLogic(vtkMRMLApplicationLogic* appLogic);
103  virtual vtkMRMLApplicationLogic* GetApplicationLogic();
105 
107 
110  virtual void SetViewNode(vtkMRMLAbstractViewNode* viewNode);
111  virtual vtkMRMLAbstractViewNode* GetViewNode();
113 
119  virtual void UpdateFromMRML(vtkMRMLNode* caller, unsigned long event, void *callData = nullptr);
120 
124  vtkSetMacro(PickingTolerance, double);
125  vtkGetMacro(PickingTolerance, double);
126 
131  vtkSetMacro(AlwaysOnTop, bool);
132  vtkGetMacro(AlwaysOnTop, bool);
133  vtkBooleanMacro(AlwaysOnTop, bool);
134 
136 
140  vtkGetMacro(NeedToRender, bool);
141  vtkSetMacro(NeedToRender, bool);
142  vtkBooleanMacro(NeedToRender, bool);
144 
145  protected:
148 
151  void AddActorsBounds(vtkBoundingBox& bounds, const std::vector<vtkProp*> &actors, double* additionalBounds = nullptr);
152 
155  void GetRendererComputedDisplayPositionFromWorldPosition(const double worldPos[3], double displayPos[2]);
156 
157  virtual void UpdateRelativeCoincidentTopologyOffsets(vtkMapper* mapper);
158 
160  vtkWeakPointer<vtkRenderer> Renderer;
161 
162  vtkWeakPointer<vtkMRMLApplicationLogic> ApplicationLogic;
163 
165 
170 
173 
174  vtkWeakPointer<vtkMRMLAbstractViewNode> ViewNode;
175 
177 
179  double Bounds[6];
180 
181 private:
183  void operator=(const vtkMRMLAbstractWidgetRepresentation&) = delete;
184 };
185 
186 #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
vtkWeakPointer< vtkMRMLApplicationLogic > ApplicationLogic
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) ...