本文整理汇总了C++中VisWindow::GetView3D方法的典型用法代码示例。如果您正苦于以下问题:C++ VisWindow::GetView3D方法的具体用法?C++ VisWindow::GetView3D怎么用?C++ VisWindow::GetView3D使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VisWindow
的用法示例。
在下文中一共展示了VisWindow::GetView3D方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pow
void
Zoom3D::ZoomCamera(const int x, const int y)
{
if (OldY != y)
{
//
// Calculate the zoom factor.
//
double dyf = MotionFactor * (double)(y - OldY) /
(double)(Center[1]);
double zoomFactor = pow((double)1.1, dyf);
//
// Calculate the new parallel scale.
//
VisWindow *vw = proxy;
avtView3D newView3D = vw->GetView3D();
newView3D.imageZoom = newView3D.imageZoom * zoomFactor;
OldX = x;
OldY = y;
vw->SetView3D(newView3D);
}
}
示例2: fabs
void
Zoom3D::ZoomCamera(void)
{
vtkRenderWindowInteractor *rwi = Interactor;
if (!SufficientDistanceMoved())
{
//
// This is a point, line, or very, very small rectangle
//
return;
}
//
// Determine the size of the window.
//
int size[2];
rwi->GetSize(size);
//
// Get the current view information.
//
VisWindow *vw = proxy;
//
// Set the new image pan and image zoom.
//
double zoomFactor;
double pan[2];
avtView3D newView3D = vw->GetView3D();
if (!controlKeyDown) // zoom
{
pan[0] = (((double)(anchorX + lastX - size[0])) / (2.0 * (double)size[0]))
/ newView3D.imageZoom;
pan[1] = (((double)(anchorY + lastY - size[1])) / (2.0 * (double)size[1]))
/ newView3D.imageZoom;
zoomFactor = fabs((double)(anchorY - lastY)) / (double) size[1];
newView3D.imagePan[0] -= pan[0];
newView3D.imagePan[1] -= pan[1];
newView3D.imageZoom = newView3D.imageZoom / zoomFactor;
}
else // unzoom
{
zoomFactor = fabs((double)(anchorY - lastY)) / (double) size[1];
newView3D.imageZoom = newView3D.imageZoom * zoomFactor;
pan[0] = (((double)(anchorX + lastX - size[0])) / (2.0 * (double)size[0]))
/ newView3D.imageZoom;
pan[1] = (((double)(anchorY + lastY - size[1])) / (2.0 * (double)size[1]))
/ newView3D.imageZoom;
newView3D.imagePan[0] += pan[0];
newView3D.imagePan[1] += pan[1];
}
vw->SetView3D(newView3D);
}