Fraxinus  16.5.0-fx-rc9
An IGT application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cxViewManager.cpp
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) 2008-2014, SINTEF Department of Medical Technology
5 All rights reserved.
6 
7 Redistribution and use in source and binary forms, with or without
8 modification, are permitted provided that the following conditions are met:
9 
10 1. Redistributions of source code must retain the above copyright notice,
11  this list of conditions and the following disclaimer.
12 
13 2. Redistributions in binary form must reproduce the above copyright notice,
14  this list of conditions and the following disclaimer in the documentation
15  and/or other materials provided with the distribution.
16 
17 3. Neither the name of the copyright holder nor the names of its contributors
18  may be used to endorse or promote products derived from this software
19  without specific prior written permission.
20 
21 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 =========================================================================*/
32 
33 #include "cxViewManager.h"
34 
35 #include <QGridLayout>
36 #include <QWidget>
37 #include <QTime>
38 #include <QAction>
39 #include <QtCore>
40 #include <qtextstream.h>
41 #include <vtkRenderWindow.h>
42 #include <vtkRenderWindowInteractor.h>
43 #include <vtkImageData.h>
44 #include "vtkRenderer.h"
45 #include "vtkRenderWindow.h"
46 #include "cxLayoutData.h"
47 #include "boost/bind.hpp"
48 
49 #include "cxVolumetricRep.h"
50 #include "cxLogger.h"
51 #include "cxXmlOptionItem.h"
52 #include "cxTrackingService.h"
53 #include "cxSlicePlanes3DRep.h"
54 #include "cxSliceProxy.h"
55 #include "cxViewGroup.h"
56 #include "cxViewWrapper.h"
57 #include "cxViewWrapper2D.h"
58 #include "cxViewWrapper3D.h"
59 #include "cxViewWrapperVideo.h"
60 #include "cxSettings.h"
61 #include "cxProfile.h"
62 #include "cxInteractiveCropper.h"
63 #include "vtkForwardDeclarations.h"
64 #include "cxInteractiveClipper.h"
65 #include "cxImage.h"
66 #include "cxCameraStyle.h"
67 #include "cxCyclicActionLogger.h"
68 #include "cxViewCollectionWidget.h"
69 #include "cxRenderLoop.h"
70 #include "cxLayoutRepository.h"
71 
72 #include "cxVisServices.h"
73 #include "cxXMLNodeWrapper.h"
74 #include "cxCameraControl.h"
75 #include "cxNavigation.h"
76 #include "cxPatientModelService.h"
77 
78 namespace cx
79 {
80 
82 {
83  ViewManagerPtr retval;
84  retval.reset(new ViewManager(backend));
85  return retval;
86 }
87 
89  mGlobalObliqueOrientation(false)
90 {
91  mBackend = backend;
92  mRenderLoop.reset(new RenderLoop());
93  connect(mRenderLoop.get(), SIGNAL(preRender()), this, SLOT(updateViews()));
94  connect(mRenderLoop.get(), SIGNAL(fps(int)), this, SIGNAL(fps(int)));
96 
99  mCameraControl.reset(new CameraControl());
100 
101  mRenderLoop->setLogging(settings()->value("renderSpeedLogging").toBool());
102  mRenderLoop->setSmartRender(settings()->value("smartRender", true).toBool());
103  connect(settings(), SIGNAL(valueChangedFor(QString)), this, SLOT(settingsChangedSlot(QString)));
104 
105  const unsigned VIEW_GROUP_COUNT = 5; // set this to enough
106  // initialize view groups:
107  for (unsigned i = 0; i < VIEW_GROUP_COUNT; ++i)
108  {
109  ViewGroupPtr group(new ViewGroup(mBackend));
110  mViewGroups.push_back(group);
111  }
112 
113  // moved here from initialize() ... ensures object is fully callable after construction
115 
116  mActiveLayout = QStringList() << "" << "";
117  mLayoutWidgets.resize(mActiveLayout.size(), NULL);
118 
119  mInteractiveCropper.reset(new InteractiveCropper(mBackend->patient()->getActiveData()));
120  connect(mInteractiveCropper.get(), SIGNAL(changed()), mRenderLoop.get(), SLOT(requestPreRenderSignal()));
121  connect(this, SIGNAL(activeViewChanged()), this, SLOT(updateCameraStyleActions()));
122 
123  this->loadGlobalSettings();
124  // connect to layoutrepo after load of global
126  this->initializeGlobal2DZoom();
127  this->initializeActiveView();
128 
129  // set start layout
130  this->setActiveLayout("LAYOUT_3D_ACS_SINGLE", 0);
131 
132  mRenderLoop->setRenderingInterval(settings()->value("renderingInterval").toInt());
133  this->enableRender(true);
134 }
135 
137 {
138 }
139 
141 {
142  if (val)
143  mRenderLoop->start();
144  else
145  mRenderLoop->stop();
146 
148 }
149 
151 {
152  return mRenderLoop->isRunning();
153 }
154 
155 
157 {
159 
160  for (unsigned i = 0; i < mViewGroups.size(); ++i)
161  mViewGroups[i]->getData()->initializeGlobal2DZoom(mGlobal2DZoomVal);
162 }
163 
165 {
167  connect(mActiveView.get(), SIGNAL(changed()), this, SIGNAL(activeViewChanged()));
168 
169  for (unsigned i = 0; i < mViewGroups.size(); ++i)
171 }
172 
173 
175 {
176  mCameraControl->refreshView(this->get3DView(group));
178 }
179 
180 QWidget *ViewManager::getLayoutWidget(int index)
181 {
182  if (index >= mLayoutWidgets.size())
183  return NULL;
184  return mLayoutWidgets[index];
185 }
186 
187 QWidget *ViewManager::createLayoutWidget(QWidget* parent, int index)
188 {
189  if (index >= mLayoutWidgets.size())
190  return NULL;
191 // CX_ASSERT(index < mLayoutWidgets.size()); // removed: must be allowed to iterate until NULL
192  if (!mLayoutWidgets[index])
193  {
194  bool optimizedViews = settings()->value("optimizedViews").toBool();
195 
196  if (optimizedViews)
197  {
198 // report("creating optimized wiew layout");
200  }
201  else
202  {
203 // report("creating classic wiew layout");
205  }
206 
207  connect(mLayoutWidgets[index].data(), &QObject::destroyed, this, &ViewManager::layoutWidgetDestroyed);
208  mRenderLoop->addLayout(mLayoutWidgets[index]);
209 
210  this->rebuildLayouts();
211  }
212  return mLayoutWidgets[index];
213 }
214 
222 {
223 // ViewCollectionWidget* widget = dynamic_cast<ViewCollectionWidget*>(object);
224  for (unsigned i=0; i<mLayoutWidgets.size(); ++i)
225  {
226  if (mLayoutWidgets[i] == object)
227  mLayoutWidgets[i] = NULL;
228  }
229 
230  for (unsigned i = 0; i < mViewGroups.size(); ++i)
231  {
232  mViewGroups[i]->removeViews();
233  }
234 
235  this->setActiveView("");
236  mSlicePlanesProxy->clearViewports();
237 
238  QString uid = this->getActiveLayout();
239  mActiveLayout[0] = ""; // hack: force trigger a change
240  this->setActiveLayout(uid, 0);
241 }
242 
244 {
245  for(unsigned i=0; i<mViewGroups.size(); ++i)
246  {
247  ViewGroupPtr group = mViewGroups[i];
248  for (unsigned j=0; j<group->getWrappers().size(); ++j)
249  group->getWrappers()[j]->updateView();
250  }
251 }
252 
254 {
255  if (key == "smartRender")
256  {
257  mRenderLoop->setSmartRender(settings()->value("smartRender", true).toBool());
258  }
259  if (key == "renderingInterval")
260  {
261  mRenderLoop->setRenderingInterval(settings()->value("renderingInterval").toInt());
262  }
263  if (key == "renderSpeedLogging")
264  {
265  mRenderLoop->setLogging(settings()->value("renderSpeedLogging").toBool());
266  }
267 }
268 
270 {
271  return mInteractiveCropper;
272 }
273 
274 QString ViewManager::getActiveLayout(int widgetIndex) const
275 {
276  CX_ASSERT(mActiveLayout.size() > widgetIndex);
277  return mActiveLayout[widgetIndex];
278 }
279 
281 {
282  return mActiveView->get().value<QString>();
283 }
284 
285 void ViewManager::setActiveView(QString uid)
286 {
287  mActiveView->set(uid);
288 }
289 
291 {
292  int retval = -1;
293  QString activeView = mActiveView->value<QString>();
294 
295  for (unsigned i = 0; i < mViewGroups.size(); ++i)
296  {
297  ViewWrapperPtr viewWrapper = mViewGroups[i]->getViewWrapperFromViewUid(activeView);
298  if (viewWrapper)
299  retval = i;
300  }
301 
302  return retval;
303 }
304 
305 void ViewManager::addXml(QDomNode& parentNode)
306 {
307  XMLNodeAdder parent(parentNode);
308  XMLNodeAdder base(parent.addElement("viewManager"));
309 
310  base.addTextToElement("global2DZoom", qstring_cast(mGlobal2DZoomVal->get().toDouble()));
311 
312  QDomElement slicePlanes3DNode = base.addElement("slicePlanes3D");
313  slicePlanes3DNode.setAttribute("use", mSlicePlanesProxy->getVisible());
314  slicePlanes3DNode.setAttribute("opaque", mSlicePlanesProxy->getDrawPlanes());
315 
316  XMLNodeAdder viewGroupsNode(base.addElement("viewGroups"));
317  for (unsigned i = 0; i < mViewGroups.size(); ++i)
318  {
319  QDomElement viewGroupNode = viewGroupsNode.addElement("viewGroup");
320  viewGroupNode.setAttribute("index", i);
321  mViewGroups[i]->addXml(viewGroupNode);
322  }
323 }
324 
325 void ViewManager::parseXml(QDomNode viewmanagerNode)
326 {
327  XMLNodeParser base(viewmanagerNode);
328 
329  QString clippedImage = base.parseTextFromElement("clippedImage");
330 
331  base.parseDoubleFromElementWithDefault("global2DZoom", mGlobal2DZoomVal->get().toDouble());
332 
333  QDomElement slicePlanes3DNode = base.parseElement("slicePlanes3D");
334  mSlicePlanesProxy->setVisible(slicePlanes3DNode.attribute("use").toInt());
335  mSlicePlanesProxy->setDrawPlanes(slicePlanes3DNode.attribute("opaque").toInt());
336 
337  QDomElement viewgroups = base.parseElement("viewGroups");
338  QDomNode viewgroup = viewgroups.firstChild();
339  while (!viewgroup.isNull())
340  {
341  if (viewgroup.toElement().tagName() != "viewGroup")
342  {
343  viewgroup = viewgroup.nextSibling();
344  continue;
345  }
346  int index = viewgroup.toElement().attribute("index").toInt();
347 
348  if (index < 0 || index >= int(mViewGroups.size()))
349  {
350  viewgroup = viewgroup.nextSibling();
351  continue;
352  }
353 
354  mViewGroups[index]->parseXml(viewgroup);
355 
356  viewgroup = viewgroup.nextSibling();
357  }
358 }
359 
361 {
362  for (unsigned i = 0; i < mViewGroups.size(); ++i)
363  {
364  mViewGroups[i]->clearPatientData();
365  }
366 }
367 
370 ViewPtr ViewManager::get3DView(int group, int index)
371 {
372  int count = 0;
373  std::vector<ViewPtr> views = mViewGroups[group]->getViews();
374  for (unsigned i = 0; i < views.size(); ++i)
375  {
376  if(!views[i])
377  continue;
378  if (views[i]->getType()!=View::VIEW_3D)
379  continue;
380  if (index == count++)
381  return views[i];
382  }
383  return ViewPtr();
384 }
385 
386 
390 {
391  for (unsigned i=0; i<mLayoutWidgets.size(); ++i)
392  {
393  if (mLayoutWidgets[i])
394  mLayoutWidgets[i]->clearViews();
395  }
396 
397  for (unsigned i = 0; i < mViewGroups.size(); ++i)
398  {
399  mViewGroups[i]->removeViews();
400  }
401 
402  this->setActiveView("");
403  mSlicePlanesProxy->clearViewports();
404 }
405 
407 {
408  if (( groupIdx>=0 )&&( groupIdx < mViewGroups.size() ))
409  return mViewGroups[groupIdx]->getData();
410  return ViewGroupDataPtr();
411 }
412 
415 void ViewManager::setActiveLayout(const QString& layout, int widgetIndex)
416 {
417  if(!mLayoutRepository->exists(layout))
418  return;
419 
420  CX_ASSERT(mActiveLayout.size() > widgetIndex);
421 
422  if (mActiveLayout[widgetIndex] == layout)
423  return;
424 
425  mActiveLayout[widgetIndex] = layout;
426 
427  this->rebuildLayouts();
428 
429  if (!mViewGroups[0]->getViews().empty())
430  this->setActiveView(mViewGroups[0]->getViews()[0]->getUid());
431 
432  emit activeLayoutChanged();
433 
434  QString layoutName = mLayoutRepository->get(layout).getName();
435  report(QString("Layout %1 changed to %2").arg(widgetIndex).arg(layoutName));
436 }
437 
439 {
440  this->deactivateCurrentLayout();
441 
442  for (unsigned i=0; i<mLayoutWidgets.size(); ++i)
443  {
445  if (mLayoutWidgets[i] && !next.getUid().isEmpty())
446  this->activateViews(mLayoutWidgets[i], next);
447  }
448 
450 
451  mCameraControl->refreshView(this->get3DView());
452 }
453 
455 {
456  // Set the same proxy in all wrappers, but stop adding after the
457  // first group with 2D views are found.
458  // This works well _provided_ that the 3D view is in the first group.
459  for (unsigned i = 0; i < mViewGroups.size(); ++i)
460  {
461  bool foundSlice = false;
462  std::vector<ViewWrapperPtr> wrappers = mViewGroups[i]->getWrappers();
463  for (unsigned j = 0; j < wrappers.size(); ++j)
464  {
465  wrappers[j]->setSlicePlanesProxy(mSlicePlanesProxy);
466  foundSlice = foundSlice || wrappers[j]->getView()->getType() == View::VIEW_2D;
467  }
468  if (foundSlice)
469  break;
470  }
471 }
473 {
474  if (!widget)
475  return;
476 
477  for (LayoutData::iterator iter = next.begin(); iter != next.end(); ++iter)
478  this->activateView(widget, *iter);
479 }
480 
482 {
483  mRenderLoop->setRenderingInterval(interval);
484 }
485 
487 {
488  if (!viewData.isValid())
489  return;
490 
491  ViewPtr view = widget->addView(viewData.mType, viewData.mRegion);
492 
493  vtkRenderWindowInteractorPtr interactor = view->getRenderWindow()->GetInteractor();
494  //Turn off rendering in vtkRenderWindowInteractor
495  interactor->EnableRenderOff();
496  //Increase the StillUpdateRate in the vtkRenderWindowInteractor (default is 0.0001 images per second)
497  double rate = settings()->value("stillUpdateRate").value<double>();
498  interactor->SetStillUpdateRate(rate);
499  // Set the same value when moving (seems counterintuitive, but for us, moving isnt really special.
500  // The real challenge is updating while the tracking is active, and this uses the still update rate.
501  interactor->SetDesiredUpdateRate(rate);
502 
503 // mRenderLoop->addView(view);
504  ViewWrapperPtr wrapper = this->createViewWrapper(view, viewData);
505  mViewGroups[viewData.mGroup]->addView(wrapper);
506 // widget->showViews();
507 }
508 
510 {
511  if (viewData.mType == View::VIEW_2D)
512  {
513  ViewWrapper2DPtr wrapper(new ViewWrapper2D(view, mBackend));
514  wrapper->initializePlane(viewData.mPlane);
515  connect(wrapper.get(), &ViewWrapper2D::pointSampled, this, &ViewManager::pointSampled);
516  return wrapper;
517  }
518  else if (viewData.mType == View::VIEW_3D)
519  {
520 
521  ViewWrapper3DPtr wrapper(new ViewWrapper3D(viewData.mGroup + 1, view, mBackend));
522  if (viewData.mGroup == 0)
523  mInteractiveCropper->setView(view);
524  return wrapper;
525  }
526  else if (viewData.mType == View::VIEW_REAL_TIME)
527  {
528  ViewWrapperVideoPtr wrapper(new ViewWrapperVideo(view, mBackend));
529  return wrapper;
530  }
531  else
532  {
533  reportError(QString("Unknown view type %1").arg(qstring_cast(viewData.mType)));
534  }
535 
536  return ViewWrapperPtr();
537 }
538 
540 {
541  return mLayoutRepository;
542 }
543 
545 {
546  this->saveGlobalSettings();
547 
548  bool activeChange = mActiveLayout[0] == uid;
549  if (activeChange)
550  {
551  mActiveLayout[0] = ""; // hack: force trigger a change
552  this->setActiveLayout(uid, 0);
553  }
554 }
555 
557 {
558  XmlOptionFile file = profile()->getXmlSettings().descend("viewmanager");
559  mLayoutRepository->load(file);
560 }
561 
563 {
564  XmlOptionFile file = profile()->getXmlSettings().descend("viewmanager");
565  mLayoutRepository->save(file);
566  file.save();
567 }
568 
570 {
571  return mCameraStyleInteractor->getInteractorStyleActionGroup();
572 }
573 
575 {
576  int active = this->getActiveViewGroup();
577  int index = this->findGroupContaining3DViewGivenGuess(active);
578 
579  if (index<0)
580  {
581  mCameraStyleInteractor->connectCameraStyle(CameraStylePtr());
582  }
583  else
584  {
585  ViewGroupPtr group = this->getViewGroups()[index];
586  mCameraStyleInteractor->connectCameraStyle(group->getCameraStyle());
587  mCameraControl->setView(this->get3DView(index, 0));
588  }
589 
590 }
591 
595 {
596  if (preferredGroup>=0)
597  if (mViewGroups[preferredGroup]->contains3DView())
598  return preferredGroup;
599 
600  for (unsigned i=0; i<mViewGroups.size(); ++i)
601  if (mViewGroups[i]->contains3DView())
602  return i;
603  return -1;
604 }
605 
607 {
608  if (settings()->value("Automation/autoShowNewData").toBool() && data)
609  {
610  this->autoShowInViewGroups(data);
612  this->autoCenterToImageCenter();
613  }
614 }
615 
617 {
618  QList<unsigned> showInViewGroups = this->getViewGroupsToAutoShowIn();
619  foreach (unsigned i, showInViewGroups)
620  this->getViewGroups()[i]->getData()->addDataSorted(data->getUid());
621 }
622 
624 {
625  QList<unsigned> showInViewGroups;
626  if(settings()->value("Automation/autoShowNewDataInViewGroup0").toBool())
627  showInViewGroups << 0;
628  if(settings()->value("Automation/autoShowNewDataInViewGroup1").toBool())
629  showInViewGroups << 1;
630  if(settings()->value("Automation/autoShowNewDataInViewGroup2").toBool())
631  showInViewGroups << 2;
632  if(settings()->value("Automation/autoShowNewDataInViewGroup3").toBool())
633  showInViewGroups << 3;
634  if(settings()->value("Automation/autoShowNewDataInViewGroup4").toBool())
635  showInViewGroups << 4;
636  return showInViewGroups;
637 }
638 
640 {
641  if(settings()->value("Automation/autoResetCameraToSuperiorViewWhenAutoShowingNewData").toBool())
642  {
643  for (unsigned i=0; i<mViewGroups.size(); ++i)
644  if (mViewGroups[i]->contains3DView())
645  {
646  mCameraControl->setView(this->get3DView(i));
647  mCameraControl->setSuperiorView();
648  }
649  }
650 }
651 
653 {
654  if(settings()->value("Automation/autoCenterToImageCenterViewWhenAutoShowingNewData").toBool())
655  {
656  QList<unsigned> showInViewGroups = this->getViewGroupsToAutoShowIn();
657 
658  foreach (unsigned i, showInViewGroups)
660  }
661 }
662 
664 {
665  this->getNavigation(groupNr)->centerToDataInViewGroup(this->getViewGroup(groupNr));
666 }
667 
669 {
670  return mRenderLoop->getRenderTimer();
671 }
672 
673 void ViewManager::setCameraStyle(CAMERA_STYLE_TYPE style, int groupIdx)
674 {
675  //Set active view before changing camerastyle
676  if (!mViewGroups[groupIdx]->getViews().empty())
677  this->setActiveView(mViewGroups[groupIdx]->getViews()[0]->getUid());
678 
679  QList<QAction*> actions = this->getInteractorStyleActionGroup()->actions();
680  for(int i = 0; i < actions.size(); ++i)
681  {
682  if (actions[i]->data().toString() == enum2string(style))
683  actions[i]->trigger();
684  }
685 }
686 
688 {
689  mLayoutRepository->addDefault(layoutData);
690 }
691 
692 } //namespace cx
static QPointer< ViewCollectionWidget > createViewWidgetLayout(QWidget *parent=NULL)
std::vector< ViewGroupPtr > getViewGroups()
QString qstring_cast(const T &val)
double parseDoubleFromElementWithDefault(QString name, double defaultValue)
QActionGroup * getInteractorStyleActionGroup()
std::vector< QPointer< ViewCollectionWidget > > mLayoutWidgets
int mGroup
what group to connect to. -1 means not set.
Definition: cxLayoutData.h:84
cxResource_EXPORT ProfilePtr profile()
Definition: cxProfile.cpp:176
SlicePlanesProxyPtr mSlicePlanesProxy
boost::shared_ptr< class ViewManager > ViewManagerPtr
boost::shared_ptr< class ViewGroupData > ViewGroupDataPtr
Definition: cxViewGroup.h:50
void setSlicePlanesProxyInViewsUpTo2DViewgroup()
void reportError(QString msg)
Definition: cxLogger.cpp:92
void activeViewChanged()
emitted when the active view changes
boost::shared_ptr< class LayoutRepository > LayoutRepositoryPtr
ViewDataContainer::iterator iterator
Definition: cxLayoutData.h:101
void renderFinished()
#define CX_ASSERT(statement)
Definition: cxLogger.h:131
void fps(int number)
Emits number of frames per second.
void deactivateCurrentLayout()
deactivate the current layout, leaving an empty layout
boost::shared_ptr< class VisServices > VisServicesPtr
Definition: cxMainWindow.h:62
LayoutRepositoryPtr getLayoutRepository()
QDomElement addElement(QString name)
boost::shared_ptr< class CameraStyle > CameraStylePtr
Definition: cxCameraStyle.h:57
void renderFinished()
void setRenderingInterval(int interval)
vtkSmartPointer< class vtkRenderWindowInteractor > vtkRenderWindowInteractorPtr
boost::shared_ptr< class ViewWrapper > ViewWrapperPtr
ViewWrapperPtr createViewWrapper(ViewPtr view, LayoutViewData viewData)
virtual ~ViewManager()
QWidget * getLayoutWidget(int index)
CameraControlPtr mCameraControl
QVariant value(const QString &key, const QVariant &defaultValue=QVariant()) const
Definition: cxSettings.cpp:87
QList< unsigned > getViewGroupsToAutoShowIn()
QString getUid() const
Definition: cxLayoutData.h:108
boost::shared_ptr< class View > ViewPtr
void autoShowData(DataPtr data)
boost::shared_ptr< class Navigation > NavigationPtr
Definition: cxViewGroup.h:54
iterator begin()
Definition: cxLayoutData.h:115
bool isValid() const
Definition: cxLayoutData.h:91
void settingsChangedSlot(QString key)
void initializeActiveView()
void activateViews(ViewCollectionWidget *widget, LayoutData next)
void setCameraStyle(CAMERA_STYLE_TYPE style, int groupIdx)
QString getActiveView() const
returns the active view
boost::shared_ptr< ViewWrapper2D > ViewWrapper2DPtr
SyncedValuePtr mGlobal2DZoomVal
void updateCameraStyleActions()
void onLayoutRepositoryChanged(QString uid)
void addXml(QDomNode &parentNode)
void initializeGlobal2DZoom()
boost::shared_ptr< class Data > DataPtr
void parseXml(QDomNode viewmanagerNode)
PLANE_TYPE mPlane
ptNOPLANE means 3D
Definition: cxLayoutData.h:85
LayoutRegion mRegion
Definition: cxLayoutData.h:87
SyncedValuePtr mActiveView
void pointSampled(Vector3D p_r)
void activateView(ViewCollectionWidget *widget, LayoutViewData viewData)
static SyncedValuePtr create(QVariant val=QVariant())
void layoutChanged(QString uid)
boost::shared_ptr< class CyclicActionLogger > CyclicActionLoggerPtr
QDomElement addTextToElement(QString name, QString text)
QWidget * createLayoutWidget(QWidget *parent, int index)
void autoCenterToImageCenter()
boost::shared_ptr< class InteractiveCropper > InteractiveCropperPtr
InteractiveCropperPtr getCropper()
Settings * settings()
Shortcut for accessing the settings instance.
Definition: cxSettings.cpp:42
void setActiveLayout(const QString &uid, int widgetIndex=0)
change the layout
Helper class for managing a set of slice planes.
virtual int getActiveViewGroup() const
boost::shared_ptr< ViewWrapperVideo > ViewWrapperVideoPtr
int findGroupContaining3DViewGivenGuess(int preferredGroup)
CameraStyleInteractorPtr mCameraStyleInteractor
ViewManager(VisServicesPtr backend)
void enableRender(bool val)
CyclicActionLoggerPtr getRenderTimer()
QStringList mActiveLayout
the active layout (type)
LayoutRepositoryPtr mLayoutRepository
boost::shared_ptr< ViewWrapper3D > ViewWrapper3DPtr
void report(QString msg)
Definition: cxLogger.cpp:90
boost::shared_ptr< class ViewGroup > ViewGroupPtr
QString parseTextFromElement(QString name)
static ViewManagerPtr create(VisServicesPtr backend)
virtual ViewPtr addView(View::Type type, LayoutRegion region)=0
void save()
save entire document.
bool renderingIsEnabled() const
NavigationPtr getNavigation(int group=0)
iterator end()
Definition: cxLayoutData.h:116
std::vector< ViewGroupPtr > mViewGroups
View::Type mType
Definition: cxLayoutData.h:86
void layoutWidgetDestroyed(QObject *object)
virtual ViewGroupDataPtr getViewGroup(int groupIdx) const
VisServicesPtr mBackend
static QPointer< ViewCollectionWidget > createOptimizedLayout(QWidget *parent=NULL)
void activeLayoutChanged()
emitted when the active layout changes
void autoResetCameraToSuperiorView()
RenderLoopPtr mRenderLoop
void setActiveView(QString viewUid)
QString enum2string(const ENUM &val)
Helper class for xml files used to store ssc/cx data.
void centerToImageCenterInViewGroup(unsigned groupNr)
InteractiveCropperPtr mInteractiveCropper
void pointSampled(Vector3D p_r)
QDomElement parseElement(QString name)
void autoShowInViewGroups(DataPtr data)
ViewPtr get3DView(int group=0, int index=0)
void addDefaultLayout(LayoutData layoutData)
void renderingEnabledChanged()
emitted then rendering is enabled/disabled
QString getActiveLayout(int widgetIndex=0) const
returns the active layout