本文整理汇总了C++中ViewWidget类的典型用法代码示例。如果您正苦于以下问题:C++ ViewWidget类的具体用法?C++ ViewWidget怎么用?C++ ViewWidget使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ViewWidget类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: merge
ViewPtr ViewCollectionWidgetMixed::addView(View::Type type, LayoutRegion region)
{
ViewPtr view;
mTotalRegion = merge(region, mTotalRegion);
if (type==View::VIEW_3D)
{
ViewWidget* overlay = this->mViewCacheOverlay->retrieveView();
overlay->getView()->setType(type);
overlay->show();
mOverlays.push_back(overlay);
view = overlay->getView();
this->addWidgetToLayout(mLayout, overlay, region);
}
else
{
mBaseRegion = merge(region, mBaseRegion);
view = mBaseLayout->addView(type, region);
// re-add the base widget with updated position in grid
this->addWidgetToLayout(mLayout, mBaseLayout, mBaseRegion);
}
view_utils::setStretchFactors(mLayout, mTotalRegion, 1);
return view;
}
示例2: showPrecision
void ModelExplorer::showPrecision(const bool showPrecision)
{
ViewWidget * widget = NULL;
widget = static_cast<ViewWidget *>(mStackedWidget->currentWidget());
if(widget){
widget->showPrecisionDlg(showPrecision);
}
}
示例3: showComments
void ModelExplorer::showComments(const bool showComments)
{
ViewWidget * widget = NULL;
widget = static_cast<ViewWidget *>(mStackedWidget->currentWidget());
if(widget){
widget->showComments(showComments);
}
}
示例4: copyObjects
void ModelExplorer::copyObjects()
{
ViewWidget * widget = nullptr;
widget = static_cast<ViewWidget *>(mStackedWidget->currentWidget());
if(widget){
widget->copyObjects();
}
}
示例5: pasteObjects
void ModelExplorer::pasteObjects()
{
ViewWidget * widget = NULL;
widget = static_cast<ViewWidget *>(mStackedWidget->currentWidget());
if(widget){
widget->pasteObjects();
}
}
示例6: setModified
void LayoutWidgetUsingViewWidgets::setModified()
{
for (unsigned i=0; i<mViews.size(); ++i)
{
ViewWidget* current = mViews[i];
current->setModified();
}
}
示例7: showAllFields
void ModelExplorer::showAllFields(bool state)
{
ViewWidget * widget = NULL;
widget = static_cast<ViewWidget *>(mStackedWidget->currentWidget());
if(widget){
widget->showAllFields(state);
}
}
示例8: createAllFields
void ModelExplorer::createAllFields()
{
ViewWidget * widget = NULL;
widget = static_cast<ViewWidget *>(mStackedWidget->currentWidget());
if(widget){
widget->createAllFields();
}
}
示例9: setRecursive
void ModelExplorer::setRecursive(bool state)
{
ViewWidget * widget = NULL;
widget = static_cast<ViewWidget *>(mStackedWidget->currentWidget());
if(widget){
widget->setRecursive(state);
}
}
示例10: addObjects
void ModelExplorer::addObjects(openstudio::IddObjectType type)
{
ViewWidget * widget = NULL;
widget = static_cast<ViewWidget *>(mStackedWidget->currentWidget());
if(widget){
widget->addObjects(type);
}
}
示例11: WidgetFromView
ViewWidget* LayoutWidgetUsingViewWidgets::WidgetFromView(ViewPtr view)
{
for (unsigned i=0; i<mViews.size(); ++i)
{
ViewWidget* current = mViews[i];
if (current->getView()==view)
return current;
}
return NULL;
}
示例12: render
void LayoutWidgetUsingViewWidgets::render()
{
for (unsigned i=0; i<mViews.size(); ++i)
{
ViewWidget* current = mViews[i];
current->render(); // render only changed scenegraph (shaky but smooth)
}
emit rendered();
}
示例13: getPosition
QPoint LayoutWidgetUsingViewWidgets::getPosition(ViewPtr view)
{
ViewWidget* widget = this->WidgetFromView(view);
if (!widget)
{
CX_LOG_ERROR() << "Did not find view in layout " << view->getUid();
return QPoint(0,0);
}
QPoint p = widget->mapToGlobal(QPoint(0,0));
p = this->mapFromGlobal(p);
return p;
}
示例14: addView
ViewPtr LayoutWidgetUsingViewWidgets::addView(View::Type type, LayoutRegion region)
{
ViewWidget* view = this->retrieveView(type);
view->getView()->setType(type);
mLayout->addWidget(view, region.pos.row, region.pos.col, region.span.row, region.span.col);
view_utils::setStretchFactors(mLayout, region, 1);
view->show();
mViews.push_back(view);
return view->getView();
}
示例15: setSelectedCamera
void QViewWidget::setSelectedCamera(int index)
{
if (!viewMap.contains(sceneSelection.currentText()) || (index > ISOMETRIC && index < PERSPECTIVE))
return;
ViewWidget * viewWidget = viewMap.value(sceneSelection.currentText());
osg::Vec3d cameraVector = viewWidget->getView()->getCameraManipulator()->getMatrix().getTrans();
double distance = pow((pow(cameraVector.x(),2) + pow(cameraVector.y(),2) + pow(cameraVector.z(),2)), 0.5);
osg::Vec3d *eye = 0, center(0,0,0), up(0,0,1);
switch (index)
{
case PERSPECTIVE:
case ISOMETRIC:
eye = new osg::Vec3d(0,distance,distance);
break;
case LEFT:
eye = new osg::Vec3d(-distance,0,0);
break;
case RIGHT:
eye = new osg::Vec3d(distance,0,0);
break;
case FRONT:
eye = new osg::Vec3d(0,distance,0);
break;
case BACK:
eye = new osg::Vec3d(0,-distance,0);
break;
case TOP:
eye = new osg::Vec3d(0,0,distance);
break;
case BOTTOM:
eye = new osg::Vec3d(0,0,-distance);
break;
}
// if the change concerned the eye position, apply it
if (eye)
{
viewWidget->getView()->getCameraManipulator()->setHomePosition(*eye,center,up);
viewWidget->getView()->home();
delete eye;
}
}