34 #include <QGridLayout>
38 #include "vtkRenderWindow.h"
48 mLayout =
new QGridLayout(
this);
49 this->setLayout(mLayout);
52 this->initBaseLayout();
59 void ViewCollectionWidgetMixed::initBaseLayout()
62 this->addWidgetToLayout(mLayout, mBaseLayout,
LayoutRegion(0,0));
73 mTotalRegion =
merge(region, mTotalRegion);
77 ViewWidget* overlay = this->mViewCacheOverlay->retrieveView();
78 overlay->
getView()->setType(type);
80 mOverlays.push_back(overlay);
81 mOverlayRegions.push_back(region);
83 this->addWidgetToLayout(mLayout, overlay, region);
87 mBaseRegion =
merge(region, mBaseRegion);
88 view = mBaseLayout->
addView(type, region);
90 this->addWidgetToLayout(mLayout, mBaseLayout, mBaseRegion);
97 void ViewCollectionWidgetMixed::addWidgetToLayout(QGridLayout* layout, QWidget* widget,
LayoutRegion region)
99 layout->addWidget(widget,
106 mViewCacheOverlay->clearUsedViews();
108 for (
unsigned i=0; i<mOverlays.size(); ++i)
110 mOverlays[i]->hide();
111 mLayout->removeWidget(mOverlays[i]);
116 mLayout->removeWidget(mBaseLayout);
120 this->addWidgetToLayout(mLayout, mBaseLayout,
LayoutRegion(0,0));
128 for (
unsigned i=0; i<mOverlays.size(); ++i)
137 for (
unsigned i=0; i<mOverlays.size(); ++i)
139 mOverlays[i]->render();
146 mLayout->setSpacing(val);
153 mLayout->setMargin(val);
cstring_cast_Placeholder cstring_cast(const T &val)
LayoutPosition span
size of region
boost::shared_ptr< class View > ViewPtr
#define report_gl_error_text(text)
void setStretchFactors(QGridLayout *layout, LayoutRegion region, int stretchFactor)
LayoutPosition pos
start position of region
LayoutRegion merge(LayoutRegion a, LayoutRegion b)