37 #include "vtkRenderWindow.h" 47 mOffScreenRendering =
false;
49 mLayout =
new QGridLayout;
51 mLayout->setSpacing(2);
52 mLayout->setMargin(4);
54 this->setLayout(mLayout);
63 ViewWidget* view = mViewCache->retrieveView(
this, type, mOffScreenRendering);
78 mOffScreenRendering = on;
83 return mOffScreenRendering;
88 mViewCache->clearViews();
90 for (
unsigned i=0; i<
mViews.size(); ++i)
93 mLayout->removeWidget(
mViews[i]);
102 for (
unsigned i=0; i<
mViews.size(); ++i)
111 for (
unsigned i=0; i<
mViews.size(); ++i)
122 ViewWidget* widget = this->WidgetFromView(view);
125 CX_LOG_ERROR() <<
"Did not find view in layout " << view->getUid();
129 QPoint p = widget->mapToGlobal(QPoint(0,0));
130 p = this->mapFromGlobal(p);
136 Qt::ContextMenuPolicy policy = enable ? Qt::CustomContextMenu : Qt::PreventContextMenu;
137 for (
unsigned i=0; i<
mViews.size(); ++i)
139 mViews[i]->setContextMenuPolicy(policy);
145 for (
unsigned i=0; i<
mViews.size(); ++i)
156 mLayout->setSpacing(val);
161 mLayout->setMargin(val);
166 return mLayout->spacing();
171 return mLayout->margin();
176 std::vector<ViewPtr> retval;
177 for (
unsigned i=0; i<
mViews.size(); ++i)
178 retval.push_back(
mViews[i]->getView());
LayoutPosition span
size of region
boost::shared_ptr< class View > ViewPtr
void setStretchFactors(QGridLayout *layout, LayoutRegion region, int stretchFactor)
static MultiViewCachePtr create(RenderWindowFactoryPtr factory)
static const int MaxGridSize
LayoutPosition pos
start position of region
boost::shared_ptr< class RenderWindowFactory > RenderWindowFactoryPtr
Namespace for all CustusX production code.