69 #include "vtkMatrixToLinearTransform.h"
70 #include "vtkObjectFactory.h"
71 #include "vtkMatrix4x4.h"
72 #include "vtkPoints.h"
74 #include "vtkAssemblyNode.h"
75 #include "vtkAssemblyPath.h"
76 #include "vtkCallbackCommand.h"
77 #include "vtkCamera.h"
78 #include "vtkCellArray.h"
79 #include "vtkCellPicker.h"
80 #include "vtkDoubleArray.h"
81 #include "vtkFloatArray.h"
83 #include "vtkObjectFactory.h"
84 #include "vtkPlanes.h"
85 #include "vtkPolyData.h"
86 #include "vtkPolyDataMapper.h"
87 #include "vtkProperty.h"
88 #include "vtkRenderWindowInteractor.h"
89 #include "vtkRenderer.h"
90 #include "vtkSphereSource.h"
91 #include "vtkTransform.h"
129 this->HexActor->SetUserMatrix (matrix);
130 this->HexFace->SetUserMatrix (matrix);
131 this->HexOutline->SetUserMatrix (matrix);
133 for (
unsigned int i = 0; i < 7; i++ )
135 this->Handle[i]->SetUserMatrix (matrix);
147 if ( this->State == vtkBoxWidget::Outside
148 || this->State == vtkBoxWidget::Start )
153 int X = this->Interactor->GetEventPosition()[0];
154 int Y = this->Interactor->GetEventPosition()[1];
158 double focalPoint[4], pickPoint[4], prevPickPoint[4];
161 vtkCamera *camera = this->CurrentRenderer->GetActiveCamera();
168 this->ComputeWorldToDisplay(this->LastPickPosition[0],
169 this->LastPickPosition[1],
170 this->LastPickPosition[2], focalPoint);
172 this->ComputeDisplayToWorld(
173 static_cast< double >( this->Interactor->GetLastEventPosition()[0] ),
174 static_cast< double >( this->Interactor->GetLastEventPosition()[1] ),
176 this->ComputeDisplayToWorld(static_cast< double >( X ), static_cast< double >( Y ),
185 if ( this->State == vtkBoxWidget::Moving )
188 if ( this->CurrentHandle )
190 if ( this->RotationEnabled && this->CurrentHandle == this->HexFace )
192 camera->GetViewPlaneNormal(vpn);
193 this->Rotate(X, Y, prevPickPoint, pickPoint, vpn);
195 else if ( this->TranslationEnabled
196 && this->CurrentHandle == this->Handle[6] )
198 this->Translate(prevPickPoint, pickPoint);
200 else if ( this->TranslationEnabled && this->ScalingEnabled )
202 if ( this->CurrentHandle == this->Handle[0] )
204 this->MoveMinusXFace(prevPickPoint, pickPoint);
206 else if ( this->CurrentHandle == this->Handle[1] )
208 this->MovePlusXFace(prevPickPoint, pickPoint);
210 else if ( this->CurrentHandle == this->Handle[2] )
212 this->MoveMinusYFace(prevPickPoint, pickPoint);
214 else if ( this->CurrentHandle == this->Handle[3] )
216 this->MovePlusYFace(prevPickPoint, pickPoint);
218 else if ( this->CurrentHandle == this->Handle[4] )
220 this->MoveMinusZFace(prevPickPoint, pickPoint);
222 else if ( this->CurrentHandle == this->Handle[5] )
224 this->MovePlusZFace(prevPickPoint, pickPoint);
229 else if ( this->ScalingEnabled && this->State == vtkBoxWidget::Scaling )
231 this->Scale(prevPickPoint, pickPoint, X, Y);
235 this->EventCallbackCommand->SetAbortFlag(1);
236 this->InvokeEvent(vtkCommand::InteractionEvent, NULL);
237 this->Interactor->Render();