35 #include <QGridLayout>
40 #include <qtextstream.h>
41 #include <vtkRenderWindow.h>
42 #include <vtkRenderWindowInteractor.h>
43 #include <vtkImageData.h>
44 #include "vtkRenderer.h"
45 #include "vtkRenderWindow.h"
47 #include "boost/bind.hpp"
89 mGlobalObliqueOrientation(false)
105 const unsigned VIEW_GROUP_COUNT = 5;
107 for (
unsigned i = 0; i < VIEW_GROUP_COUNT; ++i)
194 bool optimizedViews =
settings()->
value(
"optimizedViews").toBool();
248 for (
unsigned j=0; j<group->getWrappers().size(); ++j)
249 group->getWrappers()[j]->updateView();
255 if (key ==
"smartRender")
259 if (key ==
"renderingInterval")
263 if (key ==
"renderSpeedLogging")
293 QString activeView =
mActiveView->value<QString>();
312 QDomElement slicePlanes3DNode = base.addElement(
"slicePlanes3D");
316 XMLNodeAdder viewGroupsNode(base.addElement(
"viewGroups"));
319 QDomElement viewGroupNode = viewGroupsNode.
addElement(
"viewGroup");
320 viewGroupNode.setAttribute(
"index", i);
333 QDomElement slicePlanes3DNode = base.
parseElement(
"slicePlanes3D");
337 QDomElement viewgroups = base.
parseElement(
"viewGroups");
338 QDomNode viewgroup = viewgroups.firstChild();
339 while (!viewgroup.isNull())
341 if (viewgroup.toElement().tagName() !=
"viewGroup")
343 viewgroup = viewgroup.nextSibling();
346 int index = viewgroup.toElement().attribute(
"index").toInt();
350 viewgroup = viewgroup.nextSibling();
356 viewgroup = viewgroup.nextSibling();
373 std::vector<ViewPtr> views =
mViewGroups[group]->getViews();
374 for (
unsigned i = 0; i < views.size(); ++i)
380 if (index == count++)
408 if (( groupIdx>=0 )&&( groupIdx <
mViewGroups.size() ))
435 report(QString(
"Layout %1 changed to %2").arg(widgetIndex).arg(layoutName));
461 bool foundSlice =
false;
462 std::vector<ViewWrapperPtr> wrappers =
mViewGroups[i]->getWrappers();
463 for (
unsigned j = 0; j < wrappers.size(); ++j)
466 foundSlice = foundSlice || wrappers[j]->getView()->getType() ==
View::VIEW_2D;
495 interactor->EnableRenderOff();
497 double rate =
settings()->
value(
"stillUpdateRate").value<
double>();
498 interactor->SetStillUpdateRate(rate);
501 interactor->SetDesiredUpdateRate(rate);
514 wrapper->initializePlane(viewData.
mPlane);
596 if (preferredGroup>=0)
598 return preferredGroup;
608 if (
settings()->value(
"Automation/autoShowNewData").toBool() && data)
619 foreach (
unsigned i, showInViewGroups)
620 this->
getViewGroups()[i]->getData()->addDataSorted(data->getUid());
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;
641 if(
settings()->value(
"Automation/autoResetCameraToSuperiorViewWhenAutoShowingNewData").toBool())
654 if(
settings()->value(
"Automation/autoCenterToImageCenterViewWhenAutoShowingNewData").toBool())
658 foreach (
unsigned i, showInViewGroups)
680 for(
int i = 0; i < actions.size(); ++i)
682 if (actions[i]->data().toString() ==
enum2string(style))
683 actions[i]->trigger();
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.
cxResource_EXPORT ProfilePtr profile()
SlicePlanesProxyPtr mSlicePlanesProxy
boost::shared_ptr< class ViewManager > ViewManagerPtr
boost::shared_ptr< class ViewGroupData > ViewGroupDataPtr
void setSlicePlanesProxyInViewsUpTo2DViewgroup()
void reportError(QString msg)
void activeViewChanged()
emitted when the active view changes
boost::shared_ptr< class LayoutRepository > LayoutRepositoryPtr
ViewDataContainer::iterator iterator
#define CX_ASSERT(statement)
void saveGlobalSettings()
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
LayoutRepositoryPtr getLayoutRepository()
QDomElement addElement(QString name)
boost::shared_ptr< class CameraStyle > CameraStylePtr
void setRenderingInterval(int interval)
vtkSmartPointer< class vtkRenderWindowInteractor > vtkRenderWindowInteractorPtr
boost::shared_ptr< class ViewWrapper > ViewWrapperPtr
ViewWrapperPtr createViewWrapper(ViewPtr view, LayoutViewData viewData)
QWidget * getLayoutWidget(int index)
CameraControlPtr mCameraControl
QVariant value(const QString &key, const QVariant &defaultValue=QVariant()) const
QList< unsigned > getViewGroupsToAutoShowIn()
boost::shared_ptr< class View > ViewPtr
void autoShowData(DataPtr data)
boost::shared_ptr< class Navigation > NavigationPtr
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
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.
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
boost::shared_ptr< class ViewGroup > ViewGroupPtr
QString parseTextFromElement(QString name)
static ViewManagerPtr create(VisServicesPtr backend)
void save()
save entire document.
bool renderingIsEnabled() const
NavigationPtr getNavigation(int group=0)
std::vector< ViewGroupPtr > mViewGroups
void layoutWidgetDestroyed(QObject *object)
virtual ViewGroupDataPtr getViewGroup(int groupIdx) const
void activeLayoutChanged()
emitted when the active layout changes
void autoResetCameraToSuperiorView()
RenderLoopPtr mRenderLoop
void setActiveView(QString viewUid)
QString enum2string(const ENUM &val)
void loadGlobalSettings()
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