Commit 0007d31c authored by Ken Martin's avatar Ken Martin Committed by Kitware Robot

Merge topic 'add_vr_support'

a38815b8 Add support for OpenVR and Oculus to VTK
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Reviewed-by: David E. DeMarle's avatarDavid E DeMarle <dave.demarle@kitware.com>
Merge-request: !1789
parents 3edd29cc a38815b8
Pipeline #24412 running with stage
in 182 minutes and 49 seconds
# - try to find the Oculus SDK - currently designed for the version 1.6
#
# Cache Variables: (probably not for direct use in your scripts)
# OCULUS_ROOT
#
# Non-cache variables you might use in your CMakeLists.txt:
# OCULUS_FOUND
# OCULUS_INCLUDE_DIRS
# OCULUS_LIBS
# OCULUS_PLATFORM - something like Win32, x64, etc.
#
# Requires these CMake modules:
# FindPackageHandleStandardArgs (known included with CMake >=2.6.2)
#
set(OCULUS_ROOT_DIR
"${OCULUS_ROOT_DIR}"
CACHE
PATH
"Directory to search for Oculus SDK")
set(_root_dirs)
if(OCULUS_ROOT_DIR)
set(_root_dirs "${OCULUS_ROOT_DIR}")
endif()
# todo fails for universal builds
set(_dll_suffix)
if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
set(_bitness 64)
if(WIN32)
set(_dll_suffix _x64)
endif()
else()
set(_bitness 32)
endif()
# Test platform
set(_platform)
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(_platform_base osx)
set(OCULUS_PLATFORM osx32)
else()
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(_platform_base linux)
set(OCULUS_PLATFORM ${_platform_base})
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(_platform_base Windows)
if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
set(OCULUS_PLATFORM ${_platform_base}/x64)
else ()
set(OCULUS_PLATFORM ${_platform_base}/Win32)
endif()
set(_vs_version VS2012)
if (NOT ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 17.0)
set(_vs_version VS2012)
endif()
if (NOT ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 18.0)
set(_vs_version VS2013)
endif()
if (NOT ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 19.0)
set(_vs_version VS2015)
endif()
endif()
set(_libpath Lib/${OCULUS_PLATFORM})
endif()
find_path(OCULUS_INCLUDE_DIR
NAMES
OVR_Version.h
HINTS
PATHS
${_root_dirs}
PATH_SUFFIXES
LibOVR
LibOVR/Include)
FIND_LIBRARY(OCULUS_LIBRARY
NAMES LibOVR.lib
HINTS
PATH_SUFFIXES
${_libpath}
${_libpath}/Release/${_vs_version}
PATHS
${OCULUS_ROOT_DIR}/LibOVR
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(OCULUS
DEFAULT_MSG
OCULUS_INCLUDE_DIR OCULUS_LIBRARY)
if(OCULUS_FOUND)
set (OCULUS_LIBRARIES ${OCULUS_LIBRARY})
list(APPEND OCULUS_INCLUDE_DIRS ${OCULUS_INCLUDE_DIR})
endif()
mark_as_advanced(OCULUS_LIBRARY OCULUS_INCLUDE_DIR)
\ No newline at end of file
# - try to find the OpenVR SDK - currently designed for the version on GitHub.
#
# Cache Variables: (probably not for direct use in your scripts)
# OPENVR_INCLUDE_DIR
#
# Non-cache variables you might use in your CMakeLists.txt:
# OPENVR_FOUND
# OPENVR_INCLUDE_DIRS
# OPENVR_PLATFORM - something like Win32, Win64, etc.
#
# Requires these CMake modules:
# FindPackageHandleStandardArgs (known included with CMake >=2.6.2)
#
# Original Author:
# 2015 Ryan A. Pavlik <ryan@sensics.com>
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
set(OPENVR_ROOT_DIR
"${OPENVR_ROOT_DIR}"
CACHE
PATH
"Directory to search for OpenVR SDK")
set(OPENVR_HEADERS_ROOT_DIR
"${OPENVR_HEADERS_ROOT_DIR}"
CACHE
PATH
"Directory to search for private OpenVR headers")
set(_root_dirs)
if(OPENVR_ROOT_DIR)
set(_root_dirs "${OPENVR_ROOT_DIR}" "${OPENVR_HEADERS_ROOT_DIR}" "${OPENVR_ROOT_DIR}/public")
endif()
# todo fails for universal builds
set(_dll_suffix)
if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
set(_bitness 64)
if(WIN32)
set(_dll_suffix _x64)
endif()
else()
set(_bitness 32)
endif()
# Test platform
set(_platform)
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(_platform_base osx)
# SteamVR only supports 32-bit on OS X
set(OPENVR_PLATFORM osx32)
else()
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(_platform_base linux)
# TODO Massive hack!
add_definitions(-DGNUC -DPOSIX -DCOMPILER_GCC -D_LINUX -DLINUX -DPOSIX -D_POSIX)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(_platform_base win)
endif()
set(OPENVR_PLATFORM ${_platform_base}${_bitness})
set(_libpath lib/${OPENVR_PLATFORM})
endif()
find_path(OPENVR_INCLUDE_DIR
NAMES
openvr_driver.h
HINTS
"${_libdir}"
"${_libdir}/.."
"${_libdir}/../.."
PATHS
${_root_dirs}
PATH_SUFFIXES
headers
public/headers
steam
public/steam)
FIND_LIBRARY(OPENVR_LIBRARY_TEMP
NAMES openvr_api
HINTS
PATH_SUFFIXES ${_libpath}
PATHS ${OPENVR_ROOT_DIR}
)
IF (OPENVR_LIBRARY_TEMP)
# Set the final string here so the GUI reflects the final state.
SET(OPENVR_LIBRARY ${OPENVR_LIBRARY_TEMP} CACHE STRING "Where the openvr Library can be found")
# Set the temp variable to INTERNAL so it is not seen in the CMake GUI
SET(OPENVR_LIBRARY_TEMP "${OPENVR_LIBRARY_TEMP}" CACHE INTERNAL "")
ENDIF(OPENVR_LIBRARY_TEMP)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(OpenVR
DEFAULT_MSG
OPENVR_INCLUDE_DIR OPENVR_LIBRARY)
if(OPENVR_FOUND)
list(APPEND OPENVR_INCLUDE_DIRS ${OPENVR_INCLUDE_DIR})
mark_as_advanced(OPENVR_ROOT_DIR)
endif()
mark_as_advanced(OPENVR_INCLUDE_DIR)
\ No newline at end of file
# This module defines
# SDL2_LIBRARY, the name of the library to link against
# SDL2_FOUND, if false, do not try to link to SDL2
# SDL2_INCLUDE_DIR, where to find SDL.h
#
# This module responds to the the flag:
# SDL2_BUILDING_LIBRARY
# If this is defined, then no SDL2main will be linked in because
# only applications need main().
# Otherwise, it is assumed you are building an application and this
# module will attempt to locate and set the the proper link flags
# as part of the returned SDL2_LIBRARY variable.
#
# Don't forget to include SDLmain.h and SDLmain.m your project for the
# OS X framework based version. (Other versions link to -lSDL2main which
# this module will try to find on your behalf.) Also for OS X, this
# module will automatically add the -framework Cocoa on your behalf.
#
#
# Additional Note: If you see an empty SDL2_LIBRARY_TEMP in your configuration
# and no SDL2_LIBRARY, it means CMake did not find your SDL2 library
# (SDL2.dll, libsdl2.so, SDL2.framework, etc).
# Set SDL2_LIBRARY_TEMP to point to your SDL2 library, and configure again.
# Similarly, if you see an empty SDL2MAIN_LIBRARY, you should set this value
# as appropriate. These values are used to generate the final SDL2_LIBRARY
# variable, but when these values are unset, SDL2_LIBRARY does not get created.
#
#
# $SDL2DIR is an environment variable that would
# correspond to the ./configure --prefix=$SDL2DIR
# used in building SDL2.
# l.e.galup 9-20-02
#
# Modified by Eric Wing.
# Added code to assist with automated building by using environmental variables
# and providing a more controlled/consistent search behavior.
# Added new modifications to recognize OS X frameworks and
# additional Unix paths (FreeBSD, etc).
# Also corrected the header search path to follow "proper" SDL guidelines.
# Added a search for SDL2main which is needed by some platforms.
# Added a search for threads which is needed by some platforms.
# Added needed compile switches for MinGW.
#
# On OSX, this will prefer the Framework version (if found) over others.
# People will have to manually change the cache values of
# SDL2_LIBRARY to override this selection or set the CMake environment
# CMAKE_INCLUDE_PATH to modify the search paths.
#
# Note that the header path has changed from SDL2/SDL.h to just SDL.h
# This needed to change because "proper" SDL convention
# is #include "SDL.h", not <SDL2/SDL.h>. This is done for portability
# reasons because not all systems place things in SDL2/ (see FreeBSD).
#=============================================================================
# Copyright 2003-2009 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
SET(SDL2_SEARCH_PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt
${SDL2_PATH}
)
FIND_PATH(SDL2_INCLUDE_DIR SDL.h
HINTS
$ENV{SDL2DIR}
PATH_SUFFIXES include/SDL2 include
PATHS ${SDL2_SEARCH_PATHS} ${SDL2_LIBRARY_TEMP}/../..
)
FIND_LIBRARY(SDL2_LIBRARY_TEMP
NAMES SDL2
HINTS
$ENV{SDL2DIR}
PATH_SUFFIXES lib64 lib
PATHS ${SDL2_SEARCH_PATHS} ${SDL2_INCLUDE_DIR}/../..
)
IF(NOT SDL2_BUILDING_LIBRARY)
IF(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework")
# Non-OS X framework versions expect you to also dynamically link to
# SDL2main. This is mainly for Windows and OS X. Other (Unix) platforms
# seem to provide SDL2main for compatibility even though they don't
# necessarily need it.
FIND_LIBRARY(SDL2MAIN_LIBRARY
NAMES SDL2main
HINTS
$ENV{SDL2DIR}
PATH_SUFFIXES lib64 lib
PATHS ${SDL2_SEARCH_PATHS}
)
ENDIF(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework")
ENDIF(NOT SDL2_BUILDING_LIBRARY)
# SDL2 may require threads on your system.
# The Apple build may not need an explicit flag because one of the
# frameworks may already provide it.
# But for non-OSX systems, I will use the CMake Threads package.
IF(NOT APPLE)
FIND_PACKAGE(Threads)
ENDIF(NOT APPLE)
# MinGW needs an additional library, mwindows
# It's total link flags should look like -lmingw32 -lSDL2main -lSDL2 -lmwindows
# (Actually on second look, I think it only needs one of the m* libraries.)
IF(MINGW)
SET(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW")
ENDIF(MINGW)
IF(SDL2_LIBRARY_TEMP)
# For SDL2main
IF(NOT SDL2_BUILDING_LIBRARY)
IF(SDL2MAIN_LIBRARY)
SET(SDL2_LIBRARY_TEMP ${SDL2MAIN_LIBRARY} ${SDL2_LIBRARY_TEMP})
ENDIF(SDL2MAIN_LIBRARY)
ENDIF(NOT SDL2_BUILDING_LIBRARY)
# For OS X, SDL2 uses Cocoa as a backend so it must link to Cocoa.
# CMake doesn't display the -framework Cocoa string in the UI even
# though it actually is there if I modify a pre-used variable.
# I think it has something to do with the CACHE STRING.
# So I use a temporary variable until the end so I can set the
# "real" variable in one-shot.
IF(APPLE)
SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} "-framework Cocoa")
ENDIF(APPLE)
# For threads, as mentioned Apple doesn't need this.
# In fact, there seems to be a problem if I used the Threads package
# and try using this line, so I'm just skipping it entirely for OS X.
IF(NOT APPLE)
SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} ${CMAKE_THREAD_LIBS_INIT})
ENDIF(NOT APPLE)
# For MinGW library
IF(MINGW)
SET(SDL2_LIBRARY_TEMP ${MINGW32_LIBRARY} ${SDL2_LIBRARY_TEMP})
ENDIF(MINGW)
# Set the final string here so the GUI reflects the final state.
SET(SDL2_LIBRARY ${SDL2_LIBRARY_TEMP} CACHE STRING "Where the SDL2 Library can be found")
# Set the temp variable to INTERNAL so it is not seen in the CMake GUI
SET(SDL2_LIBRARY_TEMP "${SDL2_LIBRARY_TEMP}" CACHE INTERNAL "")
ENDIF(SDL2_LIBRARY_TEMP)
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2 REQUIRED_VARS SDL2_LIBRARY SDL2_INCLUDE_DIR)
......@@ -62,6 +62,7 @@ set(Module_SRCS
vtkProp3DFollower.cxx
vtkPropAssembly.cxx
vtkPropCollection.cxx
vtkPropPicker3D.cxx
vtkProp.cxx
vtkProperty2D.cxx
vtkProperty.cxx
......@@ -74,6 +75,7 @@ set(Module_SRCS
vtkRenderWindowCollection.cxx
vtkRenderWindow.cxx
vtkRenderWindowInteractor.cxx
vtkRenderWindowInteractor3D.cxx
vtkSelectVisiblePoints.cxx
vtkShaderDeviceAdapter2.cxx
vtkTextActor.cxx
......@@ -113,6 +115,7 @@ set(Module_SRCS
# Needed by vtkRenderWindowInteractor, for the default interactor.
vtkInteractorStyle.cxx
vtkInteractorStyleSwitchBase.cxx
vtkInteractorStyle3D.cxx
# vtkTDx stuff dragged in by vtkInteractorStyle
vtkTDxInteractorStyle.cxx
vtkTDxInteractorStyleCamera.cxx
......
This diff is collapsed.
/*=========================================================================
Program: Visualization Toolkit
Module: vtkInteractorStyle3D.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkInteractorStyle3D - extends interaction to support 3D input
// .SECTION Description
// vtkInteractorStyle3D allows the user to interact with (rotate,
// pan, etc.) objects in the scene indendent of each other. It is designed
// to use 3d positions and orientations instead of 2D.
//
// The following interactions are specified by default.
//
// A click and hold in 3D within the bounding box of a prop
// will pick up that prop allowing you to translate and
// orient that prop as desired with the 3D controller.
//
// Click/dragging two controllers and pulling them apart or
// pushing them together will initial a scale gesture
// that will scale the world larger or smaller.
//
// Click/dragging two controllers and translating them in the same
// direction will translate the camera/world
// pushing them together will initial a scale gesture
// that will scale the world larger or smaller.
//
// If a controller is right clicked (push touchpad on Vive)
// then it starts a fly motion where the camer moves in the
// direction the controller is pointing. It moves at a speed
// scaled by the position of your thumb on the trackpad.
// Higher moves faster forward. Lower moves faster backwards.
//
// For the Vive left click is mapped to the trigger and right
// click is mapped to pushing the trackpad down.
//
// .SECTION See Also
// vtkRenderWindowInteractor3D
#ifndef vtkInteractorStyle3D_h
#define vtkInteractorStyle3D_h
#include "vtkRenderingCoreModule.h" // For export macro
#include "vtkInteractorStyle.h"
class vtkPropPicker3D;
class vtkProp3D;
class vtkMatrix3x3;
class vtkMatrix4x4;
class vtkTransform;
class VTKRENDERINGCORE_EXPORT vtkInteractorStyle3D : public vtkInteractorStyle
{
public:
static vtkInteractorStyle3D *New();
vtkTypeMacro(vtkInteractorStyle3D,vtkInteractorStyle);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Event bindings controlling the effects of pressing mouse buttons
// or moving the mouse.
virtual void OnMouseMove();
virtual void OnLeftButtonDown();
virtual void OnLeftButtonUp();
virtual void OnRightButtonDown();
virtual void OnRightButtonUp();
// Description:
// Event bindings for gestures
virtual void OnPinch();
virtual void OnPan();
// This method handles updating the prop based on changes in the devices
// pose. We use rotate as the state to mean adjusting-the-actor-pose
virtual void Rotate();
// This method handles updating the camera based on changes in the devices
// pose. We use Dolly as the state to mean moving the camera forward
virtual void Dolly();
protected:
vtkInteractorStyle3D();
~vtkInteractorStyle3D();
void FindPickedActor(double x, double y, double z);
void Prop3DTransform(vtkProp3D *prop3D,
double *boxCenter,
int NumRotation,
double **rotate,
double *scale);
vtkPropPicker3D *InteractionPicker;
vtkProp3D *InteractionProp;
vtkMatrix3x3 *TempMatrix3;
vtkMatrix4x4 *TempMatrix4;
vtkTransform *TempTransform;
double AppliedTranslation[3];
private:
vtkInteractorStyle3D(const vtkInteractorStyle3D&) VTK_DELETE_FUNCTION; // Not implemented.
void operator=(const vtkInteractorStyle3D&) VTK_DELETE_FUNCTION; // Not implemented.
};
#endif
/*=========================================================================
Program: Visualization Toolkit
Module: vtkPropPicker3D.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "vtkPropPicker3D.h"
#include "vtkAssemblyNode.h"
#include "vtkAssemblyPath.h"
#include "vtkCommand.h"
#include "vtkObjectFactory.h"
#include "vtkRenderer.h"
#include "vtkWorldPointPicker.h"
vtkStandardNewMacro(vtkPropPicker3D);
vtkPropPicker3D::vtkPropPicker3D()
{
this->PickFromProps = NULL;
}
vtkPropPicker3D::~vtkPropPicker3D()
{
}
// set up for a pick
void vtkPropPicker3D::Initialize()
{
this->vtkAbstractPropPicker::Initialize();
}
// Pick from the given collection
int vtkPropPicker3D::Pick(double selectionX, double selectionY,
double selectionZ, vtkRenderer *renderer)
{
if ( this->PickFromList )
{
return this->PickProp(selectionX, selectionY, selectionZ, renderer, this->PickList);
}
else
{
return this->PickProp(selectionX, selectionY, selectionZ, renderer);
}
}
// Pick from the given collection
int vtkPropPicker3D::PickProp(
double selectionX, double selectionY, double selectionZ,
vtkRenderer *renderer, vtkPropCollection* pickfrom)
{
this->PickFromProps = pickfrom;
int ret = this->PickProp(selectionX, selectionY, selectionZ, renderer);
this->PickFromProps = NULL;
return ret;
}
// Perform pick operation with selection point provided.
int vtkPropPicker3D::PickProp(
double selectionX, double selectionY, double selectionZ,
vtkRenderer *renderer)
{
// Initialize picking process
this->Initialize();
this->Renderer = renderer;
this->PickPosition[0] = selectionX;
this->PickPosition[1] = selectionY;
this->PickPosition[2] = selectionZ;
// Invoke start pick method if defined
this->InvokeEvent(vtkCommand::StartPickEvent,NULL);
// for each prop, that is packable
// find the prop whose bounds
// contain the pick points and whole center is closest to the
// selection point
// TODO need to handle AssemblyPaths
vtkPropCollection *props = renderer->GetViewProps();
vtkAssemblyPath *result = NULL;
vtkCollectionSimpleIterator pit;
props->InitTraversal(pit);
vtkProp *prop = NULL;
while ( (prop = props->GetNextProp(pit)) )
{
if (prop->GetPickable())
{
double *bnds = prop->GetBounds();
if (bnds)
{
if (selectionX >= bnds[0] && selectionX <= bnds[1] &&
selectionY >= bnds[2] && selectionY <= bnds[3] &&
selectionZ >= bnds[4] && selectionZ <= bnds[5])
{
prop->InitPathTraversal();
result = prop->GetNextPath();
}
}
}
}
if (result)
{
result->GetFirstNode()->GetViewProp()->Pick();
this->InvokeEvent(vtkCommand::PickEvent,NULL);
}
this->SetPath(result);
this->InvokeEvent(vtkCommand::EndPickEvent,NULL);
// Call Pick on the Prop that was picked, and return 1 for success
if ( result )
{
return 1;
}
else
{
return 0;
}
}
void vtkPropPicker3D::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os, indent);
if (this->PickFromProps)
{
os << indent << "PickFrom List: " << this->PickFromProps << endl;
}
else
{
os << indent << "PickFrom List: (none)" << endl;
}
}
/*=========================================================================
Program: Visualization Toolkit
Module: vtkPropPicker3D.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkPropPicker3D - pick an actor/prop given XYZ coordinates
// .SECTION Description
// vtkPropPicker3D is used to pick an actor/prop given a selection
// point in world coordinates.
// This class determines the actor/prop and pick position in world
// coordinates; point and cell ids are not determined.
// This is useful for VRE devices that provide 3D positions
// directly via the vtkRenderWindowInteractor3D. It is the default
// picker for the vtkInteractorStyle3D
// .SECTION See Also
// vtkPicker vtkRenderWindowInteractor3D vtkInteractorStyle3D
#ifndef vtkPropPicker3D_h
#define vtkPropPicker3D_h
#include "vtkRenderingCoreModule.h" // For export macro
#include "vtkAbstractPropPicker.h"
class vtkProp;
class VTKRENDERINGCORE_EXPORT vtkPropPicker3D : public vtkAbstractPropPicker
{
public:
static vtkPropPicker3D *New();
vtkTypeMacro(vtkPropPicker3D, vtkAbstractPropPicker);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Perform the pick and set the PickedProp ivar. If something is picked, a
// 1 is returned, otherwise 0 is returned. Use the GetViewProp() method
// to get the instance of vtkProp that was picked. Props are picked from
// the renderers list of pickable Props.
int PickProp(double selectionX, double selectionY,
double selectionZ, vtkRenderer *renderer);
// Description:
// Perform a pick from the user-provided list of vtkProps and not from the
// list of vtkProps that the render maintains.
int PickProp(double selectionX, double selectionY,
double selectionZ, vtkRenderer *renderer,
vtkPropCollection* pickfrom);
// Description:
// Overide superclasses' Pick() method.
int Pick(double selectionX, double selectionY, double selectionZ,
vtkRenderer *renderer);
int Pick(double selectionPt[3], vtkRenderer *renderer)
{ return this->Pick( selectionPt[0],
selectionPt[1], selectionPt[2], renderer); }
protected:
vtkPropPicker3D();
~vtkPropPicker3D();
void Initialize();
vtkPropCollection* PickFromProps;
private:
vtkPropPicker3D(const vtkPropPicker3D&) VTK_DELETE_FUNCTION; // Not implemented.
void operator=(const vtkPropPicker3D&) VTK_DELETE_FUNCTION; // Not implemented.
};
#endif