Commit 9b8bc06c authored by lassoan's avatar lassoan

ENH: Use widget for showing slice intersections

This allows slice intersection rotation and more flexible keyboard/mouse shortcut configuration in views. This commit only updates slice view.

Slice intersection translation/rotation shortcuts:
- Ctrl+Alt+LeftClick-and-drag rotates orthogonal slice views.
- Shift+Alt+LeftClick-and-drag moves slice intersection position (similar to Shift+MouseMove).

git-svn-id: http://svn.slicer.org/Slicer4/trunk@28010 3bd1e089-480b-0410-8dfb-8563597acbee
parent c6cfa1b6
......@@ -105,6 +105,12 @@ set(KIT_SRCS
vtkSliceViewInteractorStyle.cxx
vtkThreeDViewInteractorStyle.cxx
# Widgets
vtkMRMLAbstractWidget.cxx
vtkMRMLAbstractWidgetRepresentation.cxx
vtkSliceIntersectionWidget.cxx
vtkSliceIntersectionRepresentation2D.cxx
# Proxy classes
vtkMRMLLightBoxRendererManagerProxy.cxx
)
......
......@@ -108,6 +108,32 @@ void vtkMRMLAbstractSliceViewDisplayableManager::ConvertDeviceToXYZ(
xyz[2] = z;
}
//---------------------------------------------------------------------------
void vtkMRMLAbstractSliceViewDisplayableManager::ConvertDeviceToXYZ(
vtkRenderer * renderer, vtkMRMLSliceNode * sliceNode,
double x, double y, double xyz[3])
{
if (xyz == NULL || renderer == NULL || sliceNode == NULL)
{
return;
}
double windowWidth = renderer->GetRenderWindow()->GetSize()[0];
double windowHeight = renderer->GetRenderWindow()->GetSize()[1];
int numberOfColumns = sliceNode->GetLayoutGridColumns();
int numberOfRows = sliceNode->GetLayoutGridRows();
float tempX = x / windowWidth;
float tempY = (windowHeight - 1 - y) / windowHeight;
float z = floor(tempY*numberOfRows)*numberOfColumns + floor(tempX*numberOfColumns);
xyz[0] = x - renderer->GetOrigin()[0];
xyz[1] = y - renderer->GetOrigin()[1];
xyz[2] = z;
}
//---------------------------------------------------------------------------
void vtkMRMLAbstractSliceViewDisplayableManager::ConvertRASToXYZ(double ras[3], double xyz[3])
{
......
......@@ -57,6 +57,12 @@ public:
static void ConvertDeviceToXYZ(vtkRenderWindowInteractor * interactor,
vtkMRMLSliceNode * sliceNode, double x, double y, double xyz[3]);
/// Convenience function allowing to convert device coordinates (display) to XYZ coordinates (viewport).
/// Parameter \a xyz is double[3]
static void ConvertDeviceToXYZ(vtkRenderer * renderer,
vtkMRMLSliceNode * sliceNode, double x, double y, double xyz[3]);
/// Convert RAS to XYZ coordinates (viewport).
/// Parameters \a ras and \a xyz are double[3]. \a xyz[2] is the lightbox id.
/// \sa ConvertRASToXYZ(vtkMRMLSliceNode * sliceNode, double ras[3], double xyz[3])
......
This diff is collapsed.
/*=========================================================================
Copyright (c) ProxSim ltd., Kwun Tong, Hong Kong. All Rights Reserved.
See COPYRIGHT.txt
or http://www.slicer.org/copyright/copyright.txt for details.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
This file was originally developed by Davide Punzo, punzodavide@hotmail.it,
and development was supported by ProxSim ltd.
=========================================================================*/
/**
* @class vtkMRMLAbstractWidget
* @brief Process interaction events to update state of MRML widget nodes
*
* vtkMRMLAbstractWidget is the abstract class that handles interaction events
* received from the displayable manager. To decide which widget gets the chance
* to process an interaction event, this class does not use VTK picking manager,
* but interactor style class queries displayable managers about what events they can
* process, displayable manager queries its widgets, and based on the returned
* information, interactor style selects a displayable manager and the displayable
* manager selects a widget.
*
* vtkAbstractWidget uses vtkSlicerWidgetEventTranslator to translate VTK
* interaction events (defined in vtkCommand.h) into widget events (defined in
* vtkMRMLAbstractWidget.h and subclasses). This class allows modification
* of event bindings.
*
* @sa
* vtkSlicerWidgetRepresentation vtkSlicerWidgetEventTranslator
*
*/
#ifndef vtkMRMLAbstractWidget_h
#define vtkMRMLAbstractWidget_h
#include "vtkMRMLDisplayableManagerExport.h"
#include "vtkObject.h"
#include "vtkSmartPointer.h"
#include <vector>
class vtkMRMLAbstractViewNode;
class vtkMRMLApplicationLogic;
class vtkMRMLInteractionEventData;
class vtkMRMLInteractionNode;
class vtkMRMLNode;
class vtkMRMLAbstractWidgetRepresentation;
class vtkRenderer;
class vtkWidgetEventTranslator;
class VTK_MRML_DISPLAYABLEMANAGER_EXPORT vtkMRMLAbstractWidget : public vtkObject
{
public:
/// Standard methods for a VTK class.
vtkTypeMacro(vtkMRMLAbstractWidget, vtkObject);
virtual void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
virtual void SetMRMLApplicationLogic(vtkMRMLApplicationLogic* applicationLogic);
vtkMRMLApplicationLogic* GetMRMLApplicationLogic();
/// Set the representation.
/// The widget takes over the ownership of this actor.
virtual void SetRepresentation(vtkMRMLAbstractWidgetRepresentation *r);
/// Get the representation
virtual vtkMRMLAbstractWidgetRepresentation *GetRepresentation();
/// Build the actors of the representation with the info stored in the MRML scene
virtual void UpdateFromMRML(vtkMRMLNode* caller, unsigned long event, void *callData = NULL);
/// Convenient method to change what state the widget is in.
vtkSetMacro(WidgetState,int);
/// Convenient method to determine the state of the method
vtkGetMacro(WidgetState,int);
/// The state of the widget
enum
{
WidgetStateAny, // this state is used for referring to any widget state (for defining event translations)
WidgetStateIdle, // mouse pointer is outside the widget, click does not do anything
WidgetStateOnWidget, // mouse pointer is over the widget, clicking will add a point or manipulate the line
WidgetStateTranslate, // mouse move transforms the entire widget
WidgetStateRotate, // mouse move transforms the entire widget
WidgetStateScale, // mouse move transforms the entire widget
WidgetStateUser // this is a starting index that can be used for widget-specific states
};
/// Widget events
enum WidgetEvents
{
WidgetEventNone,
WidgetEventMouseMove,
WidgetEventTranslateStart,
WidgetEventTranslateEnd,
WidgetEventRotateStart,
WidgetEventRotateEnd,
WidgetEventScaleStart,
WidgetEventScaleEnd,
// MRML events
WidgetEventPick, // generates a MRML Pick event (e.g., on left click)
WidgetEventJumpCursor, // jumps cursor to the selected position
WidgetEventAction, // generates a MRML Action event (e.g., left double-click)
WidgetEventCustomAction1, // generates a MRML CustomAction1 event (allows modules to define custom widget actions and get notification via MRML node event)
WidgetEventCustomAction2, // generates a MRML CustomAction1 event
WidgetEventCustomAction3, // generates a MRML CustomAction1 event
WidgetEventSelect, // change MRML node Selected attribute
WidgetEventUnselect, // change MRML node Selected attribute
WidgetEventToggleSelect, // change MRML node Selected attribute
// Other actions
WidgetEventMenu, // show context menu
WidgetEventReset, // reset widget to initial state (clear all points)
WidgetEventUser // this is a starting index that can be used for widget-specific events
};
/// Return true if the widget can process the event.
/// Distance2 is the squared distance in display coordinates from the closest interaction position.
/// The displayable manager with the closest distance will get the chance to process the interaction event.
virtual bool CanProcessInteractionEvent(vtkMRMLInteractionEventData* eventData, double &distance2);
/// Allows injecting interaction events for processing, without directly observing window interactor events.
/// Return true if the widget processed the event.
virtual bool ProcessInteractionEvent(vtkMRMLInteractionEventData* eventData);
/// Define interaction event to widget event translation for mouse and other controller events
/// Used in the specified widget state only.
void SetEventTranslation(int widgetState, unsigned long interactionEvent, int modifiers, unsigned long widgetEvent);
void SetEventTranslationClickAndDrag(int widgetState, unsigned long startInteractionEvent, int modifiers,
int widgetStateDragging, unsigned long widgetStartEvent, unsigned long widgetEndEvent);
/// Define interaction event to widget event translation for mouse and other controller events.
/// Used in any widget state.
void SetEventTranslation(unsigned long interactionEvent, int modifiers, unsigned long widgetEvent);
/// Define interaction event to widget event translation for keyboard events.
/// Used in any widget state.
void SetKeyboardEventTranslation(int modifier, char keyCode, int repeatCount, const char* keySym, unsigned long widgetEvent);
/// Define interaction event to widget event translation for keyboard events.
/// Used in the specified widget state only.
void SetKeyboardEventTranslation(int widgetState, int modifier, char keyCode, int repeatCount, const char* keySym, unsigned long widgetEvent);
/// Get widget event from translation event
virtual unsigned long TranslateInteractionEventToWidgetEvent(vtkMRMLInteractionEventData* eventData);
/// Called when the the widget loses the focus.
virtual void Leave();
void SetRenderer(vtkRenderer* renderer);
vtkGetMacro(Renderer, vtkRenderer*);
vtkMRMLInteractionNode* GetInteractionNode();
// Allows the widget to request a cursor shape
virtual int GetCursor();
// Allows the widget to request grabbing of all events (even when the mouse pointer moves out of view)
virtual bool GetGrabFocus();
// Allows the widget to request interactive mode (faster updates)
virtual bool GetInteractive();
// Allows the widget to request render
virtual bool GetNeedToRender();
// Acknowledge rendering request (rendering completed)
virtual void NeedToRenderOff();
protected:
vtkMRMLAbstractWidget();
~vtkMRMLAbstractWidget() VTK_OVERRIDE;
/// Get ID of the node at the specified event position.
/// Returns nullptr if nothing can be found.
const char* GetAssociatedNodeID(vtkMRMLInteractionEventData* eventData);
/// Helper function that attempts to translate an event with a specific translator only.
unsigned long TranslateInteractionEventToWidgetEvent(
vtkWidgetEventTranslator* translator, vtkMRMLInteractionEventData* eventData);
vtkRenderer* Renderer;
vtkMRMLApplicationLogic* ApplicationLogic;
// Translates interaction event to widget event.
// In the future, a vector of event translators could be added
// (one for each state) to be able to define events
// that are only allowed in a specific state.
std::vector< vtkSmartPointer<vtkWidgetEventTranslator> > EventTranslators;
int WidgetState;
vtkSmartPointer<vtkMRMLAbstractWidgetRepresentation> WidgetRep;
private:
vtkMRMLAbstractWidget(const vtkMRMLAbstractWidget&) = delete;
void operator=(const vtkMRMLAbstractWidget&) = delete;
};
#endif
/*=========================================================================
Copyright (c) ProxSim ltd., Kwun Tong, Hong Kong. All Rights Reserved.
See COPYRIGHT.txt
or http://www.slicer.org/copyright/copyright.txt for details.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
This file was originally developed by Davide Punzo, punzodavide@hotmail.it,
and development was supported by ProxSim ltd.
=========================================================================*/
#include "vtkMRMLAbstractWidgetRepresentation.h"
#include "vtkCamera.h"
#include "vtkMapper.h"
#include "vtkRenderer.h"
#include "vtkRenderWindow.h"
//----------------------------------------------------------------------
vtkMRMLAbstractWidgetRepresentation::vtkMRMLAbstractWidgetRepresentation()
{
this->ViewScaleFactor = 1.0;
this->Tolerance = 2.0;
this->PixelTolerance = 1;
this->NeedToRender = false;
this->AlwaysOnTop = false;
}
//----------------------------------------------------------------------
vtkMRMLAbstractWidgetRepresentation::~vtkMRMLAbstractWidgetRepresentation()
{
}
//----------------------------------------------------------------------
void vtkMRMLAbstractWidgetRepresentation::UpdateViewScaleFactor()
{
if (!this->Renderer || !this->Renderer->GetActiveCamera())
{
this->ViewScaleFactor = 1.0;
}
double p1[4], p2[4];
this->Renderer->GetActiveCamera()->GetFocalPoint(p1);
p1[3] = 1.0;
this->Renderer->SetWorldPoint(p1);
this->Renderer->WorldToView();
this->Renderer->GetViewPoint(p1);
double depth = p1[2];
double aspect[2];
this->Renderer->ComputeAspect();
this->Renderer->GetAspect(aspect);
p1[0] = -aspect[0];
p1[1] = -aspect[1];
this->Renderer->SetViewPoint(p1);
this->Renderer->ViewToWorld();
this->Renderer->GetWorldPoint(p1);
p2[0] = aspect[0];
p2[1] = aspect[1];
p2[2] = depth;
p2[3] = 1.0;
this->Renderer->SetViewPoint(p2);
this->Renderer->ViewToWorld();
this->Renderer->GetWorldPoint(p2);
double distance = sqrt(vtkMath::Distance2BetweenPoints(p1, p2));
int *size = this->Renderer->GetRenderWindow()->GetSize();
double viewport[4];
this->Renderer->GetViewport(viewport);
double x, y, distance2;
x = size[0] * (viewport[2] - viewport[0]);
y = size[1] * (viewport[3] - viewport[1]);
distance2 = sqrt(x * x + y * y);
this->ViewScaleFactor = distance2 / distance;
}
//----------------------------------------------------------------------
void vtkMRMLAbstractWidgetRepresentation
::GetRendererComputedDisplayPositionFromWorldPosition(const double worldPos[3],
double displayPos[2])
{
double pos[4];
pos[0] = worldPos[0];
pos[1] = worldPos[1];
pos[2] = worldPos[2];
pos[3] = 1.0;
this->Renderer->SetWorldPoint(pos);
this->Renderer->WorldToDisplay();
this->Renderer->GetDisplayPoint(pos);
displayPos[0] = static_cast<int>(pos[0]);
displayPos[1] = static_cast<int>(pos[1]);
}
//-----------------------------------------------------------------------------
void vtkMRMLAbstractWidgetRepresentation::SetRenderer(vtkRenderer *ren)
{
if ( ren == this->Renderer )
{
return;
}
this->Renderer = ren;
this->Modified();
}
//-----------------------------------------------------------------------------
vtkRenderer* vtkMRMLAbstractWidgetRepresentation::GetRenderer()
{
return this->Renderer;
}
//-----------------------------------------------------------------------------
void vtkMRMLAbstractWidgetRepresentation::SetViewNode(vtkMRMLAbstractViewNode* viewNode)
{
if (viewNode == this->ViewNode)
{
return;
}
this->ViewNode = viewNode;
this->Modified();
}
//-----------------------------------------------------------------------------
vtkMRMLAbstractViewNode* vtkMRMLAbstractWidgetRepresentation::GetViewNode()
{
return this->ViewNode;
}
//-----------------------------------------------------------------------------
void vtkMRMLAbstractWidgetRepresentation::PrintSelf(ostream& os,
vtkIndent indent)
{
//Superclass typedef defined in vtkTypeMacro() found in vtkSetGet.h
this->Superclass::PrintSelf(os, indent);
os << indent << "Tolerance: " << this->Tolerance <<"\n";
os << indent << "Current Operation: ";
os << indent << "Always On Top: "
<< (this->AlwaysOnTop ? "On\n" : "Off\n");
}
//-----------------------------------------------------------------------------
void vtkMRMLAbstractWidgetRepresentation::AddActorsBounds(vtkBoundingBox& boundingBox,
const std::vector<vtkProp*> &actors, double* additionalBounds /*=nullptr*/)
{
for (auto actor : actors)
{
if (!actor->GetVisibility())
{
continue;
}
double* bounds = actor->GetBounds();
if (!bounds)
{
continue;
}
boundingBox.AddBounds(bounds);
}
if (additionalBounds)
{
boundingBox.AddBounds(additionalBounds);
}
}
//----------------------------------------------------------------------
void vtkMRMLAbstractWidgetRepresentation::UpdateFromMRML(
vtkMRMLNode* vtkNotUsed(caller), unsigned long event, void *vtkNotUsed(callData))
{
}
//-----------------------------------------------------------------------------
void vtkMRMLAbstractWidgetRepresentation::UpdateRelativeCoincidentTopologyOffsets(vtkMapper* mapper)
{
if (this->AlwaysOnTop)
{
// max value 65536 so we subtract 66000 to make sure we are
// zero or negative
mapper->SetRelativeCoincidentTopologyLineOffsetParameters(0, -66000);
mapper->SetRelativeCoincidentTopologyPolygonOffsetParameters(0, -66000);
mapper->SetRelativeCoincidentTopologyPointOffsetParameter(-66000);
}
else
{
mapper->SetRelativeCoincidentTopologyLineOffsetParameters(-1, -1);
mapper->SetRelativeCoincidentTopologyPolygonOffsetParameters(-1, -1);
mapper->SetRelativeCoincidentTopologyPointOffsetParameter(-1);
}
}
/*=========================================================================
Copyright (c) ProxSim ltd., Kwun Tong, Hong Kong. All Rights Reserved.
See COPYRIGHT.txt
or http://www.slicer.org/copyright/copyright.txt for details.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
This file was originally developed by Davide Punzo, punzodavide@hotmail.it,
and development was supported by ProxSim ltd.
=========================================================================*/
/**
* @class vtkMRMLAbstractWidgetRepresentation
* @brief Class for rendering a markups node
*
* This class can display a markups node in the scene.
* It plays a similar role to vtkWidgetRepresentation, but it is
* simplified and specialized for optimal use in Slicer.
* It state is stored in the associated MRML display node to
* avoid extra synchronization mechanisms.
* The representation only observes MRML node changes,
* it does not directly process any interaction events directly
* (interaction events are processed by vtkMRMLAbstractWidget,
* which then modifies MRML nodes).
*
* This class (and subclasses) are a type of
* vtkProp; meaning that they can be associated with a vtkRenderer end
* embedded in a scene like any other vtkActor.
*
* @sa
* vtkMRMLAbstractWidgetRepresentation vtkMRMLAbstractWidget
*/
#ifndef vtkMRMLAbstractRepresentation_h
#define vtkMRMLAbstractRepresentation_h
#include "vtkMRMLDisplayableManagerExport.h"
#include "vtkWidgetRepresentation.h"
#include "vtkMRMLAbstractViewNode.h"
#include <vector>
class vtkMapper;
#include "vtkBoundingBox.h"
class VTK_MRML_DISPLAYABLEMANAGER_EXPORT vtkMRMLAbstractWidgetRepresentation : public vtkProp
{
public:
/// Standard methods for instances of this class.
vtkTypeMacro(vtkMRMLAbstractWidgetRepresentation, vtkProp);
void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
//@{
/**
* Methods to make this class behave as a vtkProp. They are repeated here (from the
* vtkProp superclass) as a reminder to the widget implementor. Failure to implement
* these methods properly may result in the representation not appearing in the scene
* (i.e., not implementing the Render() methods properly) or leaking graphics resources
* (i.e., not implementing ReleaseGraphicsResources() properly).
*/
double *GetBounds() VTK_SIZEHINT(6) override { return nullptr; }
void GetActors(vtkPropCollection *) override {}
void GetActors2D(vtkPropCollection *) override {}
void GetVolumes(vtkPropCollection *) override {}
void ReleaseGraphicsResources(vtkWindow *) override {}
int RenderOverlay(vtkViewport *vtkNotUsed(viewport)) override { return 0; }
int RenderOpaqueGeometry(vtkViewport *vtkNotUsed(viewport)) override { return 0; }
int RenderTranslucentPolygonalGeometry(vtkViewport *vtkNotUsed(viewport)) override { return 0; }
int RenderVolumetricGeometry(vtkViewport *vtkNotUsed(viewport)) override { return 0; }
vtkTypeBool HasTranslucentPolygonalGeometry() override { return 0; }
//@}
//@{
/**
* Set the renderer in which the representations draws itself.
* Typically the renderer is set by the associated widget.
* Use the widget's SetCurrentRenderer() method in most cases;
* otherwise there is a risk of inconsistent behavior as events
* and drawing may be performed in different viewports.
* WARNING: The renderer is NOT reference counted by the representation,
* in order to avoid reference loops. Be sure that the representation
* lifetime does not extend beyond the renderer lifetime.
*/
virtual void SetRenderer(vtkRenderer *ren);
virtual vtkRenderer* GetRenderer();
//@}
//@{
/**
* Set the view node where this widget is displayed.
*/
virtual void SetViewNode(vtkMRMLAbstractViewNode* viewNode);
virtual vtkMRMLAbstractViewNode* GetViewNode();
//@}
/**
* UpdateFromMRML() - update the widget from its state stored in MRML.
* if event is non-zero then a specific update (faster, smaller scope) is performed instead
* of a full update.
*/
virtual void UpdateFromMRML(vtkMRMLNode* caller, unsigned long event, void *callData = NULL);
/// Specify tolerance for performing pick operations of points
/// (see ActivateNode).
/// Tolerance is defined in terms of percentage of the handle size.
/// Default value is 0.5
vtkSetMacro(Tolerance, double);
vtkGetMacro(Tolerance, double);
/// Controls whether the widget should always appear on top
/// of other actors in the scene. (In effect, this will disable OpenGL
/// Depth buffer tests while rendering the widget).
/// Default is to set it to false.
vtkSetMacro(AlwaysOnTop, bool);
vtkGetMacro(AlwaysOnTop, bool);
vtkBooleanMacro(AlwaysOnTop, bool);
//@{
/**
* The widget representation can set this data member to true to indicate that it needs to be re-rendered.
* If the rendering request is processed then the flag is cleared.
*/
vtkGetMacro(NeedToRender, bool);
vtkSetMacro(NeedToRender, bool);
vtkBooleanMacro(NeedToRender, bool);
//@}
protected:
vtkMRMLAbstractWidgetRepresentation();
~vtkMRMLAbstractWidgetRepresentation() VTK_OVERRIDE;
/// Helper function to add bounds of all listed actors to the supplied bounding box.
/// additionalBounds is for convenience only, it allows defining additional bounds.
void AddActorsBounds(vtkBoundingBox& bounds, const std::vector<vtkProp*> &actors, double* additionalBounds = nullptr);
// Given a world position and orientation, this computes the display position
// using the renderer of this class.
void GetRendererComputedDisplayPositionFromWorldPosition(const double worldPos[3], double displayPos[2]);
// Calculate view scale factor
void UpdateViewScaleFactor();
void UpdateRelativeCoincidentTopologyOffsets(vtkMapper* mapper);
// The renderer in which this widget is placed
vtkWeakPointer<vtkRenderer> Renderer;
bool NeedToRender;
// Selection tolerance for the picking of points
double Tolerance;
double PixelTolerance;
vtkWeakPointer<vtkMRMLAbstractViewNode> ViewNode;
bool AlwaysOnTop;
double ViewScaleFactor;
// Temporary variable to store GetBounds() result
double Bounds[6];
private:
vtkMRMLAbstractWidgetRepresentation(const vtkMRMLAbstractWidgetRepresentation&) = delete;
void operator=(const vtkMRMLAbstractWidgetRepresentation&) = delete;
};
#endif
......@@ -29,9 +29,9 @@
#include <vtkMRMLInteractionNode.h>
#include <vtkMRMLLightBoxRendererManagerProxy.h>
#include <vtkMRMLScene.h>
#include <vtkMRMLSliceCompositeNode.h>
#include <vtkMRMLSliceLogic.h>
#include <vtkMRMLSliceNode.h>
#include <vtkSliceIntersectionWidget.h>
// VTK includes
#include <vtkActor2D.h>
......@@ -40,6 +40,7 @@
#include <vtkMatrix4x4.h>
#include <vtkNew.h>
#include <vtkObjectFactory.h>
#include <vtkPickingManager.h>