本文整理汇总了C++中Viewpoint::setZoom方法的典型用法代码示例。如果您正苦于以下问题:C++ Viewpoint::setZoom方法的具体用法?C++ Viewpoint::setZoom怎么用?C++ Viewpoint::setZoom使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Viewpoint
的用法示例。
在下文中一共展示了Viewpoint::setZoom方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: adjustZoomUpdate
void RGLView::adjustZoomUpdate(int mouseX, int mouseY)
{
Viewpoint* viewpoint = scene->getViewpoint();
int dy = mouseY - zoomBaseY;
float zoom = clamp ( viewpoint->getZoom() * exp(-dy*ZOOM_PIXELLOGSTEP), ZOOM_MIN, ZOOM_MAX);
viewpoint->setZoom(zoom);
View::update();
zoomBaseY = mouseY;
}
示例2: rgl_setZoom
void rgl_setZoom(int* successptr, double* zoom)
{
int success = RGL_FAIL;
Device* device = deviceManager->getAnyDevice();
if ( device ) {
RGLView* rglview = device->getRGLView();
Scene* scene = rglview->getScene();
Viewpoint* viewpoint = scene->getViewpoint();
viewpoint->setZoom((*zoom - 1.0f)/((float)(VIEWPOINT_MAX_ZOOM-1)));
rglview->update();
success = RGL_SUCCESS;
}
*successptr = success;
}
示例3: rgl_setZoom
void rgl_setZoom(int* successptr, double* zoom)
{
int success = RGL_FAIL;
Device* device;
if (deviceManager && (device = deviceManager->getAnyDevice())) {
RGLView* rglview = device->getRGLView();
Scene* scene = rglview->getScene();
Viewpoint* viewpoint = scene->getViewpoint();
viewpoint->setZoom( *zoom );
rglview->update();
success = RGL_SUCCESS;
}
*successptr = success;
}
示例4: wheelRotate
void RGLView::wheelRotate(int dir)
{
Viewpoint* viewpoint = scene->getViewpoint();
float zoom = viewpoint->getZoom();
#define ZOOM_STEP 1.05f
#define ZOOM_PIXELLOGSTEP 0.02f
switch(dir)
{
case GUI_WheelForward:
zoom *= ZOOM_STEP;
break;
case GUI_WheelBackward:
zoom /= ZOOM_STEP;
break;
}
zoom = clamp( zoom , ZOOM_MIN, ZOOM_MAX);
viewpoint->setZoom(zoom);
View::update();
}