Commit 699a706c authored by Joachim Pouderoux's avatar Joachim Pouderoux Committed by Kitware Robot
Browse files

Merge topic 'IntroduceFinitePlaneWidget'

ce36c050

 Introduce vtkFinitePlaneWidget and its representation.
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Mathieu Westphal's avatarMathieu Westphal <mathieu.westphal@kitware.com>
Reviewed-by: Cory Quammen's avatarCory Quammen <cory.quammen@kitware.com>
Merge-request: !1219
parents 7416f8dc ce36c050
......@@ -50,6 +50,8 @@ set(Module_SRCS
vtkDistanceWidget.cxx
vtkEllipsoidTensorProbeRepresentation.cxx
vtkEvent.cxx
vtkFinitePlaneRepresentation.cxx
vtkFinitePlaneWidget.cxx
vtkFixedSizeHandleRepresentation3D.cxx
vtkFocalPlaneContourRepresentation.cxx
vtkFocalPlanePointPlacer.cxx
......
......@@ -22,6 +22,7 @@ vtk_add_test_cxx(${vtk-module}CxxTests tests
TestDijkstraImageGeodesicPath.cxx
TestDistanceWidget3D.cxx
TestDistanceWidget.cxx
TestFinitePlaneWidget.cxx
TestFixedSizeHandleRepresentation3D.cxx
TestFocalPlaneContour.cxx
TestHandleWidget2D.cxx
......
/*=========================================================================
Program: Visualization Toolkit
Module: TestFinitePlaneWidget.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.
=========================================================================*/
//
// This example tests the vtkFinitePlaneWidget
#include <vtkActor.h>
#include <vtkCamera.h>
#include <vtkFinitePlaneRepresentation.h>
#include <vtkFinitePlaneWidget.h>
#include <vtkInteractorEventRecorder.h>
#include <vtkInteractorStyleTrackballCamera.h>
#include <vtkNew.h>
#include <vtkRenderer.h>
#include <vtkRenderWindow.h>
#include <vtkRenderWindowInteractor.h>
const char eventLog[] =
"EnterEvent 273 40 0 0 0 0 0\n"
"MouseMoveEvent 273 40 0 0 0 0 0\n"
"RenderEvent 273 40 0 0 0 0 0\n"
"RenderEvent 273 40 0 0 0 0 0\n"
"MouseMoveEvent 200 69 0 0 0 0 0\n"
"RenderEvent 200 69 0 0 0 0 0\n"
"RenderEvent 200 69 0 0 0 0 0\n"
"MouseMoveEvent 124 113 0 0 0 0 0\n"
"RenderEvent 124 113 0 0 0 0 0\n"
"RenderEvent 124 113 0 0 0 0 0\n"
"MouseMoveEvent 88 137 0 0 0 0 0\n"
"RenderEvent 88 137 0 0 0 0 0\n"
"RenderEvent 88 137 0 0 0 0 0\n"
"MouseMoveEvent 63 146 0 0 0 0 0\n"
"RenderEvent 63 146 0 0 0 0 0\n"
"RenderEvent 63 146 0 0 0 0 0\n"
"MouseMoveEvent 59 148 0 0 0 0 0\n"
"RenderEvent 59 148 0 0 0 0 0\n"
"RenderEvent 59 148 0 0 0 0 0\n"
"MouseMoveEvent 59 149 0 0 0 0 0\n"
"RenderEvent 59 149 0 0 0 0 0\n"
"RenderEvent 59 149 0 0 0 0 0\n"
"MouseMoveEvent 60 150 0 0 0 0 0\n"
"RenderEvent 60 150 0 0 0 0 0\n"
"RenderEvent 60 150 0 0 0 0 0\n"
"MouseMoveEvent 68 151 0 0 0 0 0\n"
"RenderEvent 68 151 0 0 0 0 0\n"
"RenderEvent 68 151 0 0 0 0 0\n"
"MouseMoveEvent 88 153 0 0 0 0 0\n"
"RenderEvent 88 153 0 0 0 0 0\n"
"RenderEvent 88 153 0 0 0 0 0\n"
"MouseMoveEvent 100 153 0 0 0 0 0\n"
"RenderEvent 100 153 0 0 0 0 0\n"
"RenderEvent 100 153 0 0 0 0 0\n"
"MouseMoveEvent 108 152 0 0 0 0 0\n"
"RenderEvent 108 152 0 0 0 0 0\n"
"RenderEvent 108 152 0 0 0 0 0\n"
"MouseMoveEvent 114 150 0 0 0 0 0\n"
"RenderEvent 114 150 0 0 0 0 0\n"
"RenderEvent 114 150 0 0 0 0 0\n"
"MouseMoveEvent 121 148 0 0 0 0 0\n"
"RenderEvent 121 148 0 0 0 0 0\n"
"RenderEvent 121 148 0 0 0 0 0\n"
"MouseMoveEvent 127 148 0 0 0 0 0\n"
"RenderEvent 127 148 0 0 0 0 0\n"
"RenderEvent 127 148 0 0 0 0 0\n"
"MouseMoveEvent 135 148 0 0 0 0 0\n"
"RenderEvent 135 148 0 0 0 0 0\n"
"RenderEvent 135 148 0 0 0 0 0\n"
"MouseMoveEvent 138 148 0 0 0 0 0\n"
"RenderEvent 138 148 0 0 0 0 0\n"
"RenderEvent 138 148 0 0 0 0 0\n"
"LeftButtonPressEvent 138 148 0 0 0 0 0\n"
"RenderEvent 138 148 0 0 0 0 0\n"
"MouseMoveEvent 137 148 0 0 0 0 0\n"
"RenderEvent 137 148 0 0 0 0 0\n"
"MouseMoveEvent 136 149 0 0 0 0 0\n"
"RenderEvent 136 149 0 0 0 0 0\n"
"MouseMoveEvent 134 149 0 0 0 0 0\n"
"RenderEvent 134 149 0 0 0 0 0\n"
"MouseMoveEvent 133 149 0 0 0 0 0\n"
"RenderEvent 133 149 0 0 0 0 0\n"
"MouseMoveEvent 132 149 0 0 0 0 0\n"
"RenderEvent 132 149 0 0 0 0 0\n"
"MouseMoveEvent 130 149 0 0 0 0 0\n"
"RenderEvent 130 149 0 0 0 0 0\n"
"MouseMoveEvent 129 149 0 0 0 0 0\n"
"RenderEvent 129 149 0 0 0 0 0\n"
"MouseMoveEvent 128 149 0 0 0 0 0\n"
"RenderEvent 128 149 0 0 0 0 0\n"
"MouseMoveEvent 125 149 0 0 0 0 0\n"
"RenderEvent 125 149 0 0 0 0 0\n"
"MouseMoveEvent 123 149 0 0 0 0 0\n"
"RenderEvent 123 149 0 0 0 0 0\n"
"MouseMoveEvent 121 149 0 0 0 0 0\n"
"RenderEvent 121 149 0 0 0 0 0\n"
"MouseMoveEvent 119 149 0 0 0 0 0\n"
"RenderEvent 119 149 0 0 0 0 0\n"
"MouseMoveEvent 118 149 0 0 0 0 0\n"
"RenderEvent 118 149 0 0 0 0 0\n"
"MouseMoveEvent 116 149 0 0 0 0 0\n"
"RenderEvent 116 149 0 0 0 0 0\n"
"LeftButtonReleaseEvent 116 149 0 0 0 0 0\n"
"RenderEvent 116 149 0 0 0 0 0\n"
"MouseMoveEvent 114 149 0 0 0 0 0\n"
"RenderEvent 114 149 0 0 0 0 0\n"
"MouseMoveEvent 112 152 0 0 0 0 0\n"
"RenderEvent 112 152 0 0 0 0 0\n"
"RenderEvent 112 152 0 0 0 0 0\n"
"MouseMoveEvent 105 162 0 0 0 0 0\n"
"RenderEvent 105 162 0 0 0 0 0\n"
"RenderEvent 105 162 0 0 0 0 0\n"
"MouseMoveEvent 99 173 0 0 0 0 0\n"
"RenderEvent 99 173 0 0 0 0 0\n"
"RenderEvent 99 173 0 0 0 0 0\n"
"MouseMoveEvent 96 179 0 0 0 0 0\n"
"RenderEvent 96 179 0 0 0 0 0\n"
"RenderEvent 96 179 0 0 0 0 0\n"
"MouseMoveEvent 94 184 0 0 0 0 0\n"
"RenderEvent 94 184 0 0 0 0 0\n"
"RenderEvent 94 184 0 0 0 0 0\n"
"MouseMoveEvent 93 187 0 0 0 0 0\n"
"RenderEvent 93 187 0 0 0 0 0\n"
"RenderEvent 93 187 0 0 0 0 0\n"
"MouseMoveEvent 92 189 0 0 0 0 0\n"
"RenderEvent 92 189 0 0 0 0 0\n"
"RenderEvent 92 189 0 0 0 0 0\n"
"MouseMoveEvent 91 190 0 0 0 0 0\n"
"RenderEvent 91 190 0 0 0 0 0\n"
"RenderEvent 91 190 0 0 0 0 0\n"
"MouseMoveEvent 89 192 0 0 0 0 0\n"
"RenderEvent 89 192 0 0 0 0 0\n"
"RenderEvent 89 192 0 0 0 0 0\n"
"MouseMoveEvent 87 196 0 0 0 0 0\n"
"RenderEvent 87 196 0 0 0 0 0\n"
"RenderEvent 87 196 0 0 0 0 0\n"
"MouseMoveEvent 86 196 0 0 0 0 0\n"
"RenderEvent 86 196 0 0 0 0 0\n"
"RenderEvent 86 196 0 0 0 0 0\n"
"MouseMoveEvent 85 198 0 0 0 0 0\n"
"RenderEvent 85 198 0 0 0 0 0\n"
"RenderEvent 85 198 0 0 0 0 0\n"
"MouseMoveEvent 84 199 0 0 0 0 0\n"
"RenderEvent 84 199 0 0 0 0 0\n"
"RenderEvent 84 199 0 0 0 0 0\n"
"MouseMoveEvent 83 200 0 0 0 0 0\n"
"RenderEvent 83 200 0 0 0 0 0\n"
"RenderEvent 83 200 0 0 0 0 0\n"
"MouseMoveEvent 83 201 0 0 0 0 0\n"
"RenderEvent 83 201 0 0 0 0 0\n"
"RenderEvent 83 201 0 0 0 0 0\n"
"MouseMoveEvent 83 202 0 0 0 0 0\n"
"RenderEvent 83 202 0 0 0 0 0\n"
"RenderEvent 83 202 0 0 0 0 0\n"
"MouseMoveEvent 83 203 0 0 0 0 0\n"
"RenderEvent 83 203 0 0 0 0 0\n"
"RenderEvent 83 203 0 0 0 0 0\n"
"MouseMoveEvent 82 204 0 0 0 0 0\n"
"RenderEvent 82 204 0 0 0 0 0\n"
"RenderEvent 82 204 0 0 0 0 0\n"
"MouseMoveEvent 82 205 0 0 0 0 0\n"
"RenderEvent 82 205 0 0 0 0 0\n"
"RenderEvent 82 205 0 0 0 0 0\n"
"LeftButtonPressEvent 82 205 0 0 0 0 0\n"
"RenderEvent 82 205 0 0 0 0 0\n"
"MouseMoveEvent 82 204 0 0 0 0 0\n"
"RenderEvent 82 204 0 0 0 0 0\n"
"MouseMoveEvent 83 203 0 0 0 0 0\n"
"RenderEvent 83 203 0 0 0 0 0\n"
"MouseMoveEvent 83 202 0 0 0 0 0\n"
"RenderEvent 83 202 0 0 0 0 0\n"
"MouseMoveEvent 83 201 0 0 0 0 0\n"
"RenderEvent 83 201 0 0 0 0 0\n"
"MouseMoveEvent 83 200 0 0 0 0 0\n"
"RenderEvent 83 200 0 0 0 0 0\n"
"MouseMoveEvent 83 199 0 0 0 0 0\n"
"RenderEvent 83 199 0 0 0 0 0\n"
"MouseMoveEvent 83 198 0 0 0 0 0\n"
"RenderEvent 83 198 0 0 0 0 0\n"
"MouseMoveEvent 83 197 0 0 0 0 0\n"
"RenderEvent 83 197 0 0 0 0 0\n"
"MouseMoveEvent 83 196 0 0 0 0 0\n"
"RenderEvent 83 196 0 0 0 0 0\n"
"MouseMoveEvent 83 195 0 0 0 0 0\n"
"RenderEvent 83 195 0 0 0 0 0\n"
"MouseMoveEvent 83 193 0 0 0 0 0\n"
"RenderEvent 83 193 0 0 0 0 0\n"
"MouseMoveEvent 83 192 0 0 0 0 0\n"
"RenderEvent 83 192 0 0 0 0 0\n"
"MouseMoveEvent 83 191 0 0 0 0 0\n"
"RenderEvent 83 191 0 0 0 0 0\n"
"MouseMoveEvent 83 190 0 0 0 0 0\n"
"RenderEvent 83 190 0 0 0 0 0\n"
"MouseMoveEvent 83 189 0 0 0 0 0\n"
"RenderEvent 83 189 0 0 0 0 0\n"
"MouseMoveEvent 83 188 0 0 0 0 0\n"
"RenderEvent 83 188 0 0 0 0 0\n"
"MouseMoveEvent 83 187 0 0 0 0 0\n"
"RenderEvent 83 187 0 0 0 0 0\n"
"MouseMoveEvent 83 186 0 0 0 0 0\n"
"RenderEvent 83 186 0 0 0 0 0\n"
"MouseMoveEvent 83 184 0 0 0 0 0\n"
"RenderEvent 83 184 0 0 0 0 0\n"
"MouseMoveEvent 82 182 0 0 0 0 0\n"
"RenderEvent 82 182 0 0 0 0 0\n"
"MouseMoveEvent 82 180 0 0 0 0 0\n"
"RenderEvent 82 180 0 0 0 0 0\n"
"MouseMoveEvent 82 178 0 0 0 0 0\n"
"RenderEvent 82 178 0 0 0 0 0\n"
"MouseMoveEvent 82 177 0 0 0 0 0\n"
"RenderEvent 82 177 0 0 0 0 0\n"
"MouseMoveEvent 82 176 0 0 0 0 0\n"
"RenderEvent 82 176 0 0 0 0 0\n"
"MouseMoveEvent 82 175 0 0 0 0 0\n"
"RenderEvent 82 175 0 0 0 0 0\n"
"MouseMoveEvent 82 174 0 0 0 0 0\n"
"RenderEvent 82 174 0 0 0 0 0\n"
"MouseMoveEvent 82 173 0 0 0 0 0\n"
"RenderEvent 82 173 0 0 0 0 0\n"
"LeftButtonReleaseEvent 82 173 0 0 0 0 0\n"
"RenderEvent 82 173 0 0 0 0 0\n"
"MouseMoveEvent 83 171 0 0 0 0 0\n"
"RenderEvent 83 171 0 0 0 0 0\n"
"MouseMoveEvent 85 168 0 0 0 0 0\n"
"RenderEvent 85 168 0 0 0 0 0\n"
"RenderEvent 85 168 0 0 0 0 0\n"
"MouseMoveEvent 98 145 0 0 0 0 0\n"
"RenderEvent 98 145 0 0 0 0 0\n"
"RenderEvent 98 145 0 0 0 0 0\n"
"MouseMoveEvent 125 104 0 0 0 0 0\n"
"RenderEvent 125 104 0 0 0 0 0\n"
"RenderEvent 125 104 0 0 0 0 0\n"
"MouseMoveEvent 155 63 0 0 0 0 0\n"
"RenderEvent 155 63 0 0 0 0 0\n"
"RenderEvent 155 63 0 0 0 0 0\n"
"MouseMoveEvent 179 33 0 0 0 0 0\n"
"RenderEvent 179 33 0 0 0 0 0\n"
"RenderEvent 179 33 0 0 0 0 0\n"
"MouseMoveEvent 193 18 0 0 0 0 0\n"
"RenderEvent 193 18 0 0 0 0 0\n"
"RenderEvent 193 18 0 0 0 0 0\n"
"MouseMoveEvent 195 13 0 0 0 0 0\n"
"RenderEvent 195 13 0 0 0 0 0\n"
"RenderEvent 195 13 0 0 0 0 0\n"
"MouseMoveEvent 194 15 0 0 0 0 0\n"
"RenderEvent 194 15 0 0 0 0 0\n"
"RenderEvent 194 15 0 0 0 0 0\n"
"MouseMoveEvent 191 19 0 0 0 0 0\n"
"RenderEvent 191 19 0 0 0 0 0\n"
"RenderEvent 191 19 0 0 0 0 0\n"
"MouseMoveEvent 187 27 0 0 0 0 0\n"
"RenderEvent 187 27 0 0 0 0 0\n"
"RenderEvent 187 27 0 0 0 0 0\n"
"MouseMoveEvent 185 29 0 0 0 0 0\n"
"RenderEvent 185 29 0 0 0 0 0\n"
"RenderEvent 185 29 0 0 0 0 0\n"
"MouseMoveEvent 183 32 0 0 0 0 0\n"
"RenderEvent 183 32 0 0 0 0 0\n"
"RenderEvent 183 32 0 0 0 0 0\n"
"MouseMoveEvent 183 33 0 0 0 0 0\n"
"RenderEvent 183 33 0 0 0 0 0\n"
"RenderEvent 183 33 0 0 0 0 0\n"
"MouseMoveEvent 182 33 0 0 0 0 0\n"
"RenderEvent 182 33 0 0 0 0 0\n"
"RenderEvent 182 33 0 0 0 0 0\n"
"MouseMoveEvent 181 36 0 0 0 0 0\n"
"RenderEvent 181 36 0 0 0 0 0\n"
"RenderEvent 181 36 0 0 0 0 0\n"
"LeftButtonPressEvent 181 35 0 0 0 0 0\n"
"StartInteractionEvent 181 35 0 0 0 0 0\n"
"MouseMoveEvent 179 43 0 0 0 0 0\n"
"RenderEvent 179 43 0 0 0 0 0\n"
"MouseMoveEvent 177 47 0 0 0 0 0\n"
"RenderEvent 177 47 0 0 0 0 0\n"
"MouseMoveEvent 176 51 0 0 0 0 0\n"
"RenderEvent 176 51 0 0 0 0 0\n"
"MouseMoveEvent 174 55 0 0 0 0 0\n"
"RenderEvent 174 55 0 0 0 0 0\n"
"MouseMoveEvent 174 57 0 0 0 0 0\n"
"RenderEvent 174 57 0 0 0 0 0\n"
"MouseMoveEvent 172 59 0 0 0 0 0\n"
"RenderEvent 172 59 0 0 0 0 0\n"
"MouseMoveEvent 171 61 0 0 0 0 0\n"
"RenderEvent 171 61 0 0 0 0 0\n"
"MouseMoveEvent 170 64 0 0 0 0 0\n"
"RenderEvent 170 64 0 0 0 0 0\n"
"MouseMoveEvent 169 68 0 0 0 0 0\n"
"RenderEvent 169 68 0 0 0 0 0\n"
"MouseMoveEvent 168 70 0 0 0 0 0\n"
"RenderEvent 168 70 0 0 0 0 0\n"
"MouseMoveEvent 168 72 0 0 0 0 0\n"
"RenderEvent 168 72 0 0 0 0 0\n"
"MouseMoveEvent 167 74 0 0 0 0 0\n"
"RenderEvent 167 74 0 0 0 0 0\n"
"MouseMoveEvent 167 77 0 0 0 0 0\n"
"RenderEvent 167 77 0 0 0 0 0\n"
"MouseMoveEvent 167 79 0 0 0 0 0\n"
"RenderEvent 167 79 0 0 0 0 0\n"
"MouseMoveEvent 166 82 0 0 0 0 0\n"
"RenderEvent 166 82 0 0 0 0 0\n"
"MouseMoveEvent 165 85 0 0 0 0 0\n"
"RenderEvent 165 85 0 0 0 0 0\n"
"MouseMoveEvent 164 89 0 0 0 0 0\n"
"RenderEvent 164 89 0 0 0 0 0\n"
"MouseMoveEvent 163 91 0 0 0 0 0\n"
"RenderEvent 163 91 0 0 0 0 0\n"
"MouseMoveEvent 163 93 0 0 0 0 0\n"
"RenderEvent 163 93 0 0 0 0 0\n"
"MouseMoveEvent 163 96 0 0 0 0 0\n"
"RenderEvent 163 96 0 0 0 0 0\n"
"MouseMoveEvent 163 98 0 0 0 0 0\n"
"RenderEvent 163 98 0 0 0 0 0\n"
"MouseMoveEvent 162 100 0 0 0 0 0\n"
"RenderEvent 162 100 0 0 0 0 0\n"
"MouseMoveEvent 161 102 0 0 0 0 0\n"
"RenderEvent 161 102 0 0 0 0 0\n"
"MouseMoveEvent 161 104 0 0 0 0 0\n"
"RenderEvent 161 104 0 0 0 0 0\n"
"MouseMoveEvent 162 107 0 0 0 0 0\n"
"RenderEvent 162 107 0 0 0 0 0\n"
"MouseMoveEvent 162 108 0 0 0 0 0\n"
"RenderEvent 162 108 0 0 0 0 0\n"
"MouseMoveEvent 162 109 0 0 0 0 0\n"
"RenderEvent 162 109 0 0 0 0 0\n"
"MouseMoveEvent 162 110 0 0 0 0 0\n"
"RenderEvent 162 110 0 0 0 0 0\n"
"MouseMoveEvent 162 110 0 0 0 0 0\n"
"RenderEvent 162 110 0 0 0 0 0\n"
"MouseMoveEvent 163 110 0 0 0 0 0\n"
"RenderEvent 163 110 0 0 0 0 0\n"
"MouseMoveEvent 164 110 0 0 0 0 0\n"
"RenderEvent 164 110 0 0 0 0 0\n"
"MouseMoveEvent 165 110 0 0 0 0 0\n"
"RenderEvent 165 110 0 0 0 0 0\n"
"MouseMoveEvent 166 110 0 0 0 0 0\n"
"RenderEvent 166 110 0 0 0 0 0\n"
"MouseMoveEvent 167 109 0 0 0 0 0\n"
"RenderEvent 167 109 0 0 0 0 0\n"
"MouseMoveEvent 168 108 0 0 0 0 0\n"
"RenderEvent 168 108 0 0 0 0 0\n"
"MouseMoveEvent 169 107 0 0 0 0 0\n"
"RenderEvent 169 107 0 0 0 0 0\n"
"MouseMoveEvent 169 106 0 0 0 0 0\n"
"RenderEvent 169 106 0 0 0 0 0\n"
"LeftButtonReleaseEvent 169 106 0 0 0 0 0\n"
"EndInteractionEvent 169 106 0 0 0 0 0\n"
"RenderEvent 169 106 0 0 0 0 0\n"
"MouseMoveEvent 170 106 0 0 0 0 0\n"
"MouseMoveEvent 172 106 0 0 0 0 0\n"
"MouseMoveEvent 175 105 0 0 0 0 0\n"
"MouseMoveEvent 180 104 0 0 0 0 0\n"
"MouseMoveEvent 187 102 0 0 0 0 0\n"
"MouseMoveEvent 196 100 0 0 0 0 0\n"
"MouseMoveEvent 202 100 0 0 0 0 0\n"
"MouseMoveEvent 207 100 0 0 0 0 0\n"
"MouseMoveEvent 213 102 0 0 0 0 0\n"
"MouseMoveEvent 217 102 0 0 0 0 0\n"
"MouseMoveEvent 220 102 0 0 0 0 0\n"
"MouseMoveEvent 221 102 0 0 0 0 0\n"
"MouseMoveEvent 222 102 0 0 0 0 0\n"
"MouseMoveEvent 223 102 0 0 0 0 0\n"
"MouseMoveEvent 224 102 0 0 0 0 0\n"
"MouseMoveEvent 225 101 0 0 0 0 0\n"
"MouseMoveEvent 227 101 0 0 0 0 0\n"
"MouseMoveEvent 228 101 0 0 0 0 0\n"
"MouseMoveEvent 229 101 0 0 0 0 0\n";
int TestFinitePlaneWidget(int, char *[])
{
// Create a renderer, render window and interactor
vtkNew<vtkRenderer> ren;
ren->SetBackground(0.1, 0.2, 0.4);
vtkNew<vtkRenderWindow> renWin;
renWin->SetSize(300, 300);
renWin->AddRenderer(ren.Get());
vtkNew<vtkRenderWindowInteractor> iren;
iren->SetRenderWindow(renWin.Get());
vtkNew<vtkFinitePlaneRepresentation> fpr;
fpr->SetTubing(true);
fpr->SetDrawPlane(true);
fpr->SetHandles(true);
double bounds[6] = { 0, 1, 0, 1, 0, 1 };
fpr->PlaceWidget(bounds);
vtkNew<vtkFinitePlaneWidget> finitePlaneWidget;
finitePlaneWidget->SetInteractor(iren.Get());
finitePlaneWidget->SetRepresentation(fpr.Get());
finitePlaneWidget->On();
vtkNew<vtkFinitePlaneRepresentation> fpr2;
fpr2->SetTubing(false);
fpr2->SetDrawPlane(false);
fpr2->SetHandles(false);
double bounds2[6] = { 1.2, 2.2, 0, 1, 0, 1 };
fpr2->PlaceWidget(bounds2);
vtkNew<vtkFinitePlaneWidget> finitePlaneWidget2;
finitePlaneWidget2->SetInteractor(iren.Get());
finitePlaneWidget2->SetRepresentation(fpr2.Get());
finitePlaneWidget2->On();
renWin->SetMultiSamples(0);
renWin->Render();
ren->ResetCamera();
renWin->Render();
vtkNew<vtkInteractorStyleTrackballCamera> style;
iren->Initialize();
iren->SetInteractorStyle(style.Get());
vtkNew<vtkInteractorEventRecorder> recorder;
recorder->SetInteractor(iren.Get());
#if 0
recorder->SetFileName("./record.log");
recorder->Record();
recorder->On();
#else
recorder->ReadFromInputStringOn();
recorder->SetInputString(eventLog);
recorder->Play();
#endif
iren->Start();
recorder->Stop();
return EXIT_SUCCESS;
}
This diff is collapsed.
/*=========================================================================
Program: Visualization Toolkit
Module: vtkFinitePlaneRepresentation.h
Copyright (c)
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 vtkFinitePlaneRepresentation - represent the vtkFinitePlaneWidget.
// .SECTION Description
// This class is a concrete representation for the vtkFinitePlaneWidget. It
// represents a plane with three handles: one on two faces, plus a
// center handle. Through interaction with the widget, the plane
// representation can be arbitrarily positioned and modified in the 3D space.
//
// To use this representation, you normally use the PlaceWidget() method
// to position the widget at a specified region in space.
//
// .SECTION See Also
// vtkFinitePlaneWidget vtkImplicitPlaneWidget2
#ifndef vtkFinitePlaneRepresentation_h
#define vtkFinitePlaneRepresentation_h
#include "vtkInteractionWidgetsModule.h" // For export macro
#include "vtkWidgetRepresentation.h"
class vtkActor;
class vtkBox;
class vtkCellPicker;
class vtkConeSource;
class vtkFeatureEdges;
class vtkLineSource;
class vtkPolyData;
class vtkPolyDataMapper;
class vtkProperty;
class vtkSphereSource;
class vtkTransform;
class vtkTubeFilter;
class VTKINTERACTIONWIDGETS_EXPORT vtkFinitePlaneRepresentation : public vtkWidgetRepresentation
{
public:
// Description:
// Instantiate the class.
static vtkFinitePlaneRepresentation *New();
// Description:
// Standard vtkObject methods
vtkTypeMacro(vtkFinitePlaneRepresentation, vtkWidgetRepresentation);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Grab the polydata that defines the plane. The polydata contains a single
// polygon.
void GetPolyData(vtkPolyData *pd);
// Description:
// Get the handle properties (the little balls are the handles). The
// properties of the handles, when selected or normal, can be
// specified.
vtkGetObjectMacro(V1HandleProperty, vtkProperty);
vtkGetObjectMacro(V2HandleProperty, vtkProperty);
vtkGetObjectMacro(SelectedHandleProperty, vtkProperty);
// Description:
// Get the plane properties. The
// properties of the plane when selected and normal can be
// set.
vtkGetObjectMacro(PlaneProperty, vtkProperty);
vtkGetObjectMacro(SelectedPlaneProperty, vtkProperty);
// Description:
// Turn on/off tubing of the wire outline of the plane. The tube thickens
// the line by wrapping with a vtkTubeFilter.
vtkSetMacro(Tubing, bool);
vtkGetMacro(Tubing, bool);
vtkBooleanMacro(Tubing, bool);
// Description:
// Enable/disable the drawing of the plane. In some cases the plane
// interferes with the object that it is operating on (i.e., the
// plane interferes with the cut surface it produces producing
// z-buffer artifacts.)
void SetDrawPlane(bool plane);
vtkGetMacro(DrawPlane, bool);
vtkBooleanMacro(DrawPlane, bool);
// Description:
// Switches handles (the spheres) on or off by manipulating the underlying
// actor visibility.
void SetHandles(bool handles);
virtual void HandlesOn();
virtual void HandlesOff();
// Description:
// These are methods that satisfy vtkWidgetRepresentation's API.
virtual void PlaceWidget(double bounds[6]);
virtual void BuildRepresentation();
virtual int ComputeInteractionState(int X, int Y, int modify=0);
virtual void StartWidgetInteraction(double e[2]);
virtual void WidgetInteraction(double e[2]);
virtual double *GetBounds();
// Description:
// Methods supporting, and required by, the rendering process.
virtual void ReleaseGraphicsResources(vtkWindow*);
virtual int RenderOpaqueGeometry(vtkViewport*);
virtual int RenderTranslucentPolygonalGeometry(vtkViewport*);
virtual int HasTranslucentPolygonalGeometry();
vtkSetClampMacro(InteractionState, int, Outside, Pushing);
// Description:
// Set/Get the origin of the plane.
void SetOrigin(double x, double y, double z);
void SetOrigin(double x[3]);
vtkGetVector3Macro(Origin, double);
// Description:
// Set/Get the normal to the plane.
void SetNormal(double x, double y, double z);
void SetNormal(double x[3]);
vtkGetVector3Macro(Normal, double);
// Description:
// Set/Get the v1 vector of the plane.
void SetV1(double x, double y);
void SetV1(double x[2]);