10 #include <vtkBoxWidget2.h>
11 #include <vtkDoubleArray.h>
13 #include <vtkPoints.h>
14 #include <vtkRenderWindowInteractor.h>
15 #include <vtkRenderer.h>
16 #include <vtkTransform.h>
28 if (!m_translateX && !m_translateY && !m_translateZ) {
32 double *pts =
static_cast<vtkDoubleArray *
>(this->
Points->GetData())
36 v[0] = m_translateX ? p2[0] - p1[0] : 0;
37 v[1] = m_translateY ? p2[1] - p1[1] : 0;
38 v[2] = m_translateZ ? p2[2] - p1[2] : 0;
41 for (
int i = 0; i < 8; i++) {
46 this->PositionHandles();
60 double *pts =
static_cast<vtkDoubleArray *
>(this->
Points->GetData())
62 double *center =
static_cast<vtkDoubleArray *
>(this->
Points->GetData())
66 if (Y > this->Interactor->GetLastEventPosition()[1]) {
73 for (
int i = 0; i < 8; i++, pts += 3) {
74 pts[0] = sf * (pts[0] - center[0]) + center[0];
75 pts[1] = sf * (pts[1] - center[1]) + center[1];
76 pts[2] = sf * (pts[2] - center[2]) + center[2];
78 this->PositionHandles();
91 int X,
int Y,
double *p1,
double *p2,
double *vpn) {
92 if (!m_rotateX && !m_rotateY && !m_rotateZ) {
96 double *pts =
static_cast<vtkDoubleArray *
>(this->
Points->GetData())
98 double *center =
static_cast<vtkDoubleArray *
>(this->
Points->GetData())
105 v[0] = m_rotateX ? p2[0] - p1[0] : 0;
106 v[1] = m_rotateY ? p2[1] - p1[1] : 0;
107 v[2] = m_rotateZ ? p2[2] - p1[2] : 0;
111 if (vtkMath::Normalize(axis) == 0.0) {
114 int *
size = this->CurrentRenderer->GetSize();
115 double l2 = (
X - this->Interactor->GetLastEventPosition()[0]) *
116 (
X - this->Interactor->GetLastEventPosition()[0]) +
117 (Y - this->Interactor->GetLastEventPosition()[1]) *
118 (Y - this->Interactor->GetLastEventPosition()[1]);
123 this->
Transform->Translate(center[0], center[1], center[2]);
124 this->
Transform->RotateWXYZ(theta, axis);
125 this->
Transform->Translate(-center[0], -center[1], -center[2]);
128 vtkPoints *newPts = vtkPoints::New(VTK_DOUBLE);
131 for (i = 0; i < 8; i++, pts += 3) {
132 this->
Points->SetPoint(i, newPts->GetPoint(i));
136 this->PositionHandles();
CLOUDVIEWER_HOST_DEVICE float Cross(const Point &a, const Point &b)
void Transform(benchmark::State &state, const core::Device &device)
std::vector< Eigen::Vector3f > Points