本文整理汇总了C++中ViewWidget类的典型用法代码示例。如果您正苦于以下问题:C++ ViewWidget类的具体用法?C++ ViewWidget怎么用?C++ ViewWidget使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ViewWidget类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:c0ns0le,项目名称:CustusX,代码行数:25,代码来源:cxViewCollectionWidgetMixed.cpp
示例2: showPrecision
void ModelExplorer::showPrecision(const bool showPrecision)
{
ViewWidget * widget = NULL;
widget = static_cast<ViewWidget *>(mStackedWidget->currentWidget());
if(widget){
widget->showPrecisionDlg(showPrecision);
}
}
开发者ID:CUEBoxer,项目名称:OpenStudio,代码行数:8,代码来源:ModelExplorer.cpp
示例3: showComments
void ModelExplorer::showComments(const bool showComments)
{
ViewWidget * widget = NULL;
widget = static_cast<ViewWidget *>(mStackedWidget->currentWidget());
if(widget){
widget->showComments(showComments);
}
}
开发者ID:CUEBoxer,项目名称:OpenStudio,代码行数:8,代码来源:ModelExplorer.cpp
示例4: copyObjects
void ModelExplorer::copyObjects()
{
ViewWidget * widget = nullptr;
widget = static_cast<ViewWidget *>(mStackedWidget->currentWidget());
if(widget){
widget->copyObjects();
}
}
开发者ID:MatthewSteen,项目名称:OpenStudio,代码行数:8,代码来源:ModelExplorer.cpp
示例5: pasteObjects
void ModelExplorer::pasteObjects()
{
ViewWidget * widget = NULL;
widget = static_cast<ViewWidget *>(mStackedWidget->currentWidget());
if(widget){
widget->pasteObjects();
}
}
开发者ID:CUEBoxer,项目名称:OpenStudio,代码行数:8,代码来源:ModelExplorer.cpp
示例6: setModified
void LayoutWidgetUsingViewWidgets::setModified()
{
for (unsigned i=0; i<mViews.size(); ++i)
{
ViewWidget* current = mViews[i];
current->setModified();
}
}
开发者ID:c0ns0le,项目名称:CustusX,代码行数:8,代码来源:cxViewCollectionWidgetUsingViewWidgets.cpp
示例7: showAllFields
void ModelExplorer::showAllFields(bool state)
{
ViewWidget * widget = NULL;
widget = static_cast<ViewWidget *>(mStackedWidget->currentWidget());
if(widget){
widget->showAllFields(state);
}
}
开发者ID:CUEBoxer,项目名称:OpenStudio,代码行数:8,代码来源:ModelExplorer.cpp
示例8: createAllFields
void ModelExplorer::createAllFields()
{
ViewWidget * widget = NULL;
widget = static_cast<ViewWidget *>(mStackedWidget->currentWidget());
if(widget){
widget->createAllFields();
}
}
开发者ID:CUEBoxer,项目名称:OpenStudio,代码行数:8,代码来源:ModelExplorer.cpp
示例9: setRecursive
void ModelExplorer::setRecursive(bool state)
{
ViewWidget * widget = NULL;
widget = static_cast<ViewWidget *>(mStackedWidget->currentWidget());
if(widget){
widget->setRecursive(state);
}
}
开发者ID:CUEBoxer,项目名称:OpenStudio,代码行数:8,代码来源:ModelExplorer.cpp
示例10: addObjects
void ModelExplorer::addObjects(openstudio::IddObjectType type)
{
ViewWidget * widget = NULL;
widget = static_cast<ViewWidget *>(mStackedWidget->currentWidget());
if(widget){
widget->addObjects(type);
}
}
开发者ID:CUEBoxer,项目名称:OpenStudio,代码行数:8,代码来源:ModelExplorer.cpp
示例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;
}
开发者ID:c0ns0le,项目名称:CustusX,代码行数:10,代码来源:cxViewCollectionWidgetUsingViewWidgets.cpp
示例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();
}
开发者ID:c0ns0le,项目名称:CustusX,代码行数:10,代码来源:cxViewCollectionWidgetUsingViewWidgets.cpp
示例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;
}
开发者ID:c0ns0le,项目名称:CustusX,代码行数:13,代码来源:cxViewCollectionWidgetUsingViewWidgets.cpp
示例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();
}
开发者ID:c0ns0le,项目名称:CustusX,代码行数:13,代码来源:cxViewCollectionWidgetUsingViewWidgets.cpp
示例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;
}
}
开发者ID:banduladh,项目名称:levelfour,代码行数:44,代码来源:QViewWidget.cpp
示例16: setSelectedDisplay
void QViewWidget::setSelectedDisplay(int index)
{
if (!viewMap.contains(sceneSelection.currentText()) || (index > ISOMETRIC && index < PERSPECTIVE))
return;
ViewWidget * viewWidget = viewMap.value(sceneSelection.currentText());
osg::StateSet * state = viewWidget->getRoot()->getOrCreateStateSet();
osg::CullFace* cf;
osg::PolygonMode *polyModeObj;
osg::ShadeModel* sm;
switch (index)
{
case WIREFRAME:
polyModeObj = dynamic_cast<osg::PolygonMode*>(state->getAttribute(osg::StateAttribute::POLYGONMODE));
if (!polyModeObj)
{
polyModeObj = new osg::PolygonMode;
state->setAttributeAndModes(polyModeObj,
osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE);
}
polyModeObj->setMode(osg::PolygonMode::FRONT_AND_BACK, osg::PolygonMode::LINE);
break;
case POLYMODE_FILL:
polyModeObj = dynamic_cast<osg::PolygonMode*>(state->getAttribute(osg::StateAttribute::POLYGONMODE));
if (polyModeObj)
polyModeObj->setMode(osg::PolygonMode::FRONT_AND_BACK, osg::PolygonMode::FILL);
break;
case BACK_CULL:
cf = dynamic_cast<osg::CullFace*>(state->getAttribute(osg::StateAttribute::CULLFACE));
if (!cf)
cf = new osg::CullFace;
state->setAttributeAndModes(cf, osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE);
break;
case SHADING:
sm = new osg::ShadeModel;
sm->setMode(osg::ShadeModel::FLAT);
state->setAttributeAndModes(sm, osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE);
break;
}
}
开发者ID:banduladh,项目名称:levelfour,代码行数:41,代码来源:QViewWidget.cpp
示例17: main
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
ViewWidget vWidget;
if (argc > 1)
{
vWidget.loadModel(argv[1]);
}
else
{
vWidget.loadModel("");
}
vWidget.resize(800, 600);
w.setCentralWidget(&vWidget);
w.resize(800, 600);
w.show();
return a.exec();
}
开发者ID:czlowiekimadlo,项目名称:Mag,代码行数:22,代码来源:main.cpp
示例18: addViewWidget
void QViewWidget::addScene(osg::Group * sceneRoot, QString name)
{
bool showGrid = true;
bool showAxes = true;
if (name.toStdString() == "dummy")
showGrid = showAxes = false;
ViewWidget * viewWidget = splitter->
addViewWidget(splitter->createCamera(0,0,100,100), sceneRoot, showGrid, showAxes);
if (viewWidget)
{
if (name.toStdString() != "dummy")
sceneSelection.addItem(name);
sceneStack->addWidget(viewWidget->getWidget());
if (viewMap.count() == 1)
sceneStack->setCurrentWidget(viewWidget->getWidget());
viewMap.insert(name, viewWidget);
}
}
开发者ID:banduladh,项目名称:levelfour,代码行数:22,代码来源:QViewWidget.cpp
示例19: setSelectedScene
void QViewWidget::setSelectedScene(int index)
{
ViewWidget * viewWidget = viewMap.value(sceneSelection.itemText(index));
sceneStack->setCurrentWidget(viewWidget->getWidget());
viewWidget->getView()->requestRedraw();
}
开发者ID:banduladh,项目名称:levelfour,代码行数:6,代码来源:QViewWidget.cpp
注:本文中的ViewWidget类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论