NorMIT-nav  16.5
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)));
95 
98  mCameraControl.reset(new CameraControl());
99 
100  mRenderLoop->setLogging(settings()->value("renderSpeedLogging").toBool());
101  mRenderLoop->setSmartRender(settings()->value("smartRender", true).toBool());
102  connect(settings(), SIGNAL(valueChangedFor(QString)), this, SLOT(settingsChangedSlot(QString)));
103 
104  const unsigned VIEW_GROUP_COUNT = 5; // set this to enough
105  // initialize view groups:
106  for (unsigned i = 0; i < VIEW_GROUP_COUNT; ++i)
107  {
108  ViewGroupPtr group(new ViewGroup(mBackend));
109  mViewGroups.push_back(group);
110  }
111 
112  // moved here from initialize() ... ensures object is fully callable after construction
114 
115  mActiveLayout = QStringList() << "" << "";
116  mLayoutWidgets.resize(mActiveLayout.size(), NULL);
117 
118  mInteractiveCropper.reset(new InteractiveCropper(mBackend->patient()->getActiveData()));
119  connect(mInteractiveCropper.get(), SIGNAL(changed()), mRenderLoop.get(), SLOT(requestPreRenderSignal()));
120  connect(this, SIGNAL(activeViewChanged()), this, SLOT(updateCameraStyleActions()));
121 
122  this->loadGlobalSettings();
123  // connect to layoutrepo after load of global
125  this->initializeGlobal2DZoom();
126  this->initializeActiveView();
127 
128  // set start layout
129  this->setActiveLayout("LAYOUT_3D_ACS_SINGLE", 0);
130 
131  mRenderLoop->setRenderingInterval(settings()->value("renderingInterval").toInt());
132  this->enableRender(true);
133 }
134 
136 {
137 }
138 
140 {
141  if (val)
142  mRenderLoop->start();
143  else
144  mRenderLoop->stop();
145 
147 }
148 
150 {
151  return mRenderLoop->isRunning();
152 }
153 
154 
156 {
158 
159  for (unsigned i = 0; i < mViewGroups.size(); ++i)
160  mViewGroups[i]->getData()->initializeGlobal2DZoom(mGlobal2DZoomVal);
161 }
162 
164 {
166  connect(mActiveView.get(), SIGNAL(changed()), this, SIGNAL(activeViewChanged()));
167 
168  for (unsigned i = 0; i < mViewGroups.size(); ++i)
170 }
171 
172 
174 {
175  mCameraControl->refreshView(this->get3DView(group));
177 }
178 
179 QWidget *ViewManager::getLayoutWidget(int index)
180 {
181  if (index >= mLayoutWidgets.size())
182  return NULL;
183  return mLayoutWidgets[index];
184 }
185 
186 QWidget *ViewManager::createLayoutWidget(QWidget* parent, int index)
187 {
188  if (index >= mLayoutWidgets.size())
189  return NULL;
190 // CX_ASSERT(index < mLayoutWidgets.size()); // removed: must be allowed to iterate until NULL
191  if (!mLayoutWidgets[index])
192  {
193  bool optimizedViews = settings()->value("optimizedViews").toBool();
194 
195  if (optimizedViews)
196  {
197 // report("creating optimized wiew layout");
199  }
200  else
201  {
202 // report("creating classic wiew layout");
204  }
205 
206  connect(mLayoutWidgets[index].data(), &QObject::destroyed, this, &ViewManager::layoutWidgetDestroyed);
207  mRenderLoop->addLayout(mLayoutWidgets[index]);
208 
209  this->rebuildLayouts();
210  }
211  return mLayoutWidgets[index];
212 }
213 
221 {
222 // ViewCollectionWidget* widget = dynamic_cast<ViewCollectionWidget*>(object);
223  for (unsigned i=0; i<mLayoutWidgets.size(); ++i)
224  {
225  if (mLayoutWidgets[i] == object)
226  mLayoutWidgets[i] = NULL;
227  }
228 
229  for (unsigned i = 0; i < mViewGroups.size(); ++i)
230  {
231  mViewGroups[i]->removeViews();
232  }
233 
234  this->setActiveView("");
235  mSlicePlanesProxy->clearViewports();
236 
237  QString uid = this->getActiveLayout();
238  mActiveLayout[0] = ""; // hack: force trigger a change
239  this->setActiveLayout(uid, 0);
240 }
241 
243 {
244  for(unsigned i=0; i<mViewGroups.size(); ++i)
245  {
246  ViewGroupPtr group = mViewGroups[i];
247  for (unsigned j=0; j<group->getWrappers().size(); ++j)
248  group->getWrappers()[j]->updateView();
249  }
250 }
251 
253 {
254  if (key == "smartRender")
255  {
256  mRenderLoop->setSmartRender(settings()->value("smartRender", true).toBool());
257  }
258  if (key == "renderingInterval")
259  {
260  mRenderLoop->setRenderingInterval(settings()->value("renderingInterval").toInt());
261  }
262  if (key == "renderSpeedLogging")
263  {
264  mRenderLoop->setLogging(settings()->value("renderSpeedLogging").toBool());
265  }
266 }
267 
269 {
270  return mInteractiveCropper;
271 }
272 
273 QString ViewManager::getActiveLayout(int widgetIndex) const
274 {
275  CX_ASSERT(mActiveLayout.size() > widgetIndex);
276  return mActiveLayout[widgetIndex];
277 }
278 
280 {
281  return mActiveView->get().value<QString>();
282 }
283 
284 void ViewManager::setActiveView(QString uid)
285 {
286  mActiveView->set(uid);
287 }
288 
290 {
291  int retval = -1;
292  QString activeView = mActiveView->value<QString>();
293 
294  for (unsigned i = 0; i < mViewGroups.size(); ++i)
295  {
296  ViewWrapperPtr viewWrapper = mViewGroups[i]->getViewWrapperFromViewUid(activeView);
297  if (viewWrapper)
298  retval = i;
299  }
300 
301  return retval;
302 }
303 
304 void ViewManager::addXml(QDomNode& parentNode)
305 {
306  XMLNodeAdder parent(parentNode);
307  XMLNodeAdder base(parent.addElement("viewManager"));
308 
309  base.addTextToElement("global2DZoom", qstring_cast(mGlobal2DZoomVal->get().toDouble()));
310 
311  QDomElement slicePlanes3DNode = base.addElement("slicePlanes3D");
312  slicePlanes3DNode.setAttribute("use", mSlicePlanesProxy->getVisible());
313  slicePlanes3DNode.setAttribute("opaque", mSlicePlanesProxy->getDrawPlanes());
314 
315  XMLNodeAdder viewGroupsNode(base.addElement("viewGroups"));
316  for (unsigned i = 0; i < mViewGroups.size(); ++i)
317  {
318  QDomElement viewGroupNode = viewGroupsNode.addElement("viewGroup");
319  viewGroupNode.setAttribute("index", i);
320  mViewGroups[i]->addXml(viewGroupNode);
321  }
322 }
323 
324 void ViewManager::parseXml(QDomNode viewmanagerNode)
325 {
326  XMLNodeParser base(viewmanagerNode);
327 
328  QString clippedImage = base.parseTextFromElement("clippedImage");
329 
330  base.parseDoubleFromElementWithDefault("global2DZoom", mGlobal2DZoomVal->get().toDouble());
331 
332  QDomElement slicePlanes3DNode = base.parseElement("slicePlanes3D");
333  mSlicePlanesProxy->setVisible(slicePlanes3DNode.attribute("use").toInt());
334  mSlicePlanesProxy->setDrawPlanes(slicePlanes3DNode.attribute("opaque").toInt());
335 
336  QDomElement viewgroups = base.parseElement("viewGroups");
337  QDomNode viewgroup = viewgroups.firstChild();
338  while (!viewgroup.isNull())
339  {
340  if (viewgroup.toElement().tagName() != "viewGroup")
341  {
342  viewgroup = viewgroup.nextSibling();
343  continue;
344  }
345  int index = viewgroup.toElement().attribute("index").toInt();
346 
347  if (index < 0 || index >= int(mViewGroups.size()))
348  {
349  viewgroup = viewgroup.nextSibling();
350  continue;
351  }
352 
353  mViewGroups[index]->parseXml(viewgroup);
354 
355  viewgroup = viewgroup.nextSibling();
356  }
357 }
358 
360 {
361  for (unsigned i = 0; i < mViewGroups.size(); ++i)
362  {
363  mViewGroups[i]->clearPatientData();
364  }
365 }
366 
369 ViewPtr ViewManager::get3DView(int group, int index)
370 {
371  int count = 0;
372  std::vector<ViewPtr> views = mViewGroups[group]->getViews();
373  for (unsigned i = 0; i < views.size(); ++i)
374  {
375  if(!views[i])
376  continue;
377  if (views[i]->getType()!=View::VIEW_3D)
378  continue;
379  if (index == count++)
380  return views[i];
381  }
382  return ViewPtr();
383 }
384 
385 
389 {
390  for (unsigned i=0; i<mLayoutWidgets.size(); ++i)
391  {
392  if (mLayoutWidgets[i])
393  mLayoutWidgets[i]->clearViews();
394  }
395 
396  for (unsigned i = 0; i < mViewGroups.size(); ++i)
397  {
398  mViewGroups[i]->removeViews();
399  }
400 
401  this->setActiveView("");
402  mSlicePlanesProxy->clearViewports();
403 }
404 
406 {
407  if (( groupIdx>=0 )&&( groupIdx < mViewGroups.size() ))
408  return mViewGroups[groupIdx]->getData();
409  return ViewGroupDataPtr();
410 }
411 
414 void ViewManager::setActiveLayout(const QString& layout, int widgetIndex)
415 {
416  if(!mLayoutRepository->exists(layout))
417  return;
418 
419  CX_ASSERT(mActiveLayout.size() > widgetIndex);
420 
421  if (mActiveLayout[widgetIndex] == layout)
422  return;
423 
424  mActiveLayout[widgetIndex] = layout;
425 
426  this->rebuildLayouts();
427 
428  if (!mViewGroups[0]->getViews().empty())
429  this->setActiveView(mViewGroups[0]->getViews()[0]->getUid());
430 
431  emit activeLayoutChanged();
432 
433  QString layoutName = mLayoutRepository->get(layout).getName();
434  report(QString("Layout %1 changed to %2").arg(widgetIndex).arg(layoutName));
435 }
436 
438 {
439  this->deactivateCurrentLayout();
440 
441  for (unsigned i=0; i<mLayoutWidgets.size(); ++i)
442  {
444  if (mLayoutWidgets[i] && !next.getUid().isEmpty())
445  this->activateViews(mLayoutWidgets[i], next);
446  }
447 
449 
450  mCameraControl->refreshView(this->get3DView());
451 }
452 
454 {
455  // Set the same proxy in all wrappers, but stop adding after the
456  // first group with 2D views are found.
457  // This works well _provided_ that the 3D view is in the first group.
458  for (unsigned i = 0; i < mViewGroups.size(); ++i)
459  {
460  bool foundSlice = false;
461  std::vector<ViewWrapperPtr> wrappers = mViewGroups[i]->getWrappers();
462  for (unsigned j = 0; j < wrappers.size(); ++j)
463  {
464  wrappers[j]->setSlicePlanesProxy(mSlicePlanesProxy);
465  foundSlice = foundSlice || wrappers[j]->getView()->getType() == View::VIEW_2D;
466  }
467  if (foundSlice)
468  break;
469  }
470 }
472 {
473  if (!widget)
474  return;
475 
476  for (LayoutData::iterator iter = next.begin(); iter != next.end(); ++iter)
477  this->activateView(widget, *iter);
478 }
479 
481 {
482  mRenderLoop->setRenderingInterval(interval);
483 }
484 
486 {
487  if (!viewData.isValid())
488  return;
489 
490  ViewPtr view = widget->addView(viewData.mType, viewData.mRegion);
491 
492  vtkRenderWindowInteractorPtr interactor = view->getRenderWindow()->GetInteractor();
493  //Turn off rendering in vtkRenderWindowInteractor
494  interactor->EnableRenderOff();
495  //Increase the StillUpdateRate in the vtkRenderWindowInteractor (default is 0.0001 images per second)
496  double rate = settings()->value("stillUpdateRate").value<double>();
497  interactor->SetStillUpdateRate(rate);
498  // Set the same value when moving (seems counterintuitive, but for us, moving isnt really special.
499  // The real challenge is updating while the tracking is active, and this uses the still update rate.
500  interactor->SetDesiredUpdateRate(rate);
501 
502 // mRenderLoop->addView(view);
503  ViewWrapperPtr wrapper = this->createViewWrapper(view, viewData);
504  mViewGroups[viewData.mGroup]->addView(wrapper);
505 // widget->showViews();
506 }
507 
509 {
510  if (viewData.mType == View::VIEW_2D)
511  {
512  ViewWrapper2DPtr wrapper(new ViewWrapper2D(view, mBackend));
513  wrapper->initializePlane(viewData.mPlane);
514  connect(wrapper.get(), &ViewWrapper2D::pointSampled, this, &ViewManager::pointSampled);
515  return wrapper;
516  }
517  else if (viewData.mType == View::VIEW_3D)
518  {
519 
520  ViewWrapper3DPtr wrapper(new ViewWrapper3D(viewData.mGroup + 1, view, mBackend));
521  if (viewData.mGroup == 0)
522  mInteractiveCropper->setView(view);
523  return wrapper;
524  }
525  else if (viewData.mType == View::VIEW_REAL_TIME)
526  {
527  ViewWrapperVideoPtr wrapper(new ViewWrapperVideo(view, mBackend));
528  return wrapper;
529  }
530  else
531  {
532  reportError(QString("Unknown view type %1").arg(qstring_cast(viewData.mType)));
533  }
534 
535  return ViewWrapperPtr();
536 }
537 
539 {
540  return mLayoutRepository;
541 }
542 
544 {
545  this->saveGlobalSettings();
546 
547  bool activeChange = mActiveLayout[0] == uid;
548  if (activeChange)
549  {
550  mActiveLayout[0] = ""; // hack: force trigger a change
551  this->setActiveLayout(uid, 0);
552  }
553 }
554 
556 {
557  XmlOptionFile file = profile()->getXmlSettings().descend("viewmanager");
558  mLayoutRepository->load(file);
559 }
560 
562 {
563  XmlOptionFile file = profile()->getXmlSettings().descend("viewmanager");
564  mLayoutRepository->save(file);
565  file.save();
566 }
567 
569 {
570  return mCameraStyleInteractor->getInteractorStyleActionGroup();
571 }
572 
574 {
575  int active = this->getActiveViewGroup();
576  int index = this->findGroupContaining3DViewGivenGuess(active);
577 
578  if (index<0)
579  {
580  mCameraStyleInteractor->connectCameraStyle(CameraStylePtr());
581  }
582  else
583  {
584  ViewGroupPtr group = this->getViewGroups()[index];
585  mCameraStyleInteractor->connectCameraStyle(group->getCameraStyle());
586  mCameraControl->setView(this->get3DView(index, 0));
587  }
588 
589 }
590 
594 {
595  if (preferredGroup>=0)
596  if (mViewGroups[preferredGroup]->contains3DView())
597  return preferredGroup;
598 
599  for (unsigned i=0; i<mViewGroups.size(); ++i)
600  if (mViewGroups[i]->contains3DView())
601  return i;
602  return -1;
603 }
604 
606 {
607  if (settings()->value("Automation/autoShowNewData").toBool() && data)
608  {
609  this->autoShowInViewGroups(data);
611  this->autoCenterToImageCenter();
612  }
613 }
614 
616 {
617  QList<unsigned> showInViewGroups = this->getViewGroupsToAutoShowIn();
618  foreach (unsigned i, showInViewGroups)
619  this->getViewGroups()[i]->getData()->addDataSorted(data->getUid());
620 }
621 
623 {
624  QList<unsigned> showInViewGroups;
625  if(settings()->value("Automation/autoShowNewDataInViewGroup0").toBool())
626  showInViewGroups << 0;
627  if(settings()->value("Automation/autoShowNewDataInViewGroup1").toBool())
628  showInViewGroups << 1;
629  if(settings()->value("Automation/autoShowNewDataInViewGroup2").toBool())
630  showInViewGroups << 2;
631  if(settings()->value("Automation/autoShowNewDataInViewGroup3").toBool())
632  showInViewGroups << 3;
633  if(settings()->value("Automation/autoShowNewDataInViewGroup4").toBool())
634  showInViewGroups << 4;
635  return showInViewGroups;
636 }
637 
639 {
640  if(settings()->value("Automation/autoResetCameraToSuperiorViewWhenAutoShowingNewData").toBool())
641  {
642  for (unsigned i=0; i<mViewGroups.size(); ++i)
643  if (mViewGroups[i]->contains3DView())
644  {
645  mCameraControl->setView(this->get3DView(i));
646  mCameraControl->setSuperiorView();
647  }
648  }
649 }
650 
652 {
653  if(settings()->value("Automation/autoCenterToImageCenterViewWhenAutoShowingNewData").toBool())
654  {
655  QList<unsigned> showInViewGroups = this->getViewGroupsToAutoShowIn();
656 
657  foreach (unsigned i, showInViewGroups)
659  }
660 }
661 
663 {
664  this->getNavigation(groupNr)->centerToDataInViewGroup(this->getViewGroup(groupNr));
665 }
666 
668 {
669  return mRenderLoop->getRenderTimer();
670 }
671 
672 void ViewManager::setCameraStyle(CAMERA_STYLE_TYPE style, int groupIdx)
673 {
674  //Set active view before changing camerastyle
675  if (!mViewGroups[groupIdx]->getViews().empty())
676  this->setActiveView(mViewGroups[groupIdx]->getViews()[0]->getUid());
677 
678  QList<QAction*> actions = this->getInteractorStyleActionGroup()->actions();
679  for(int i = 0; i < actions.size(); ++i)
680  {
681  if (actions[i]->data().toString() == enum2string(style))
682  actions[i]->trigger();
683  }
684 }
685 
687 {
688  mLayoutRepository->addDefault(layoutData);
689 }
690 
691 } //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
#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 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