50 this->
set(group->getGlobal2DZoom());
55 return mZoom2D->get().toDouble();
67 disconnect(mZoom2D.get(), SIGNAL(changed()),
this, SIGNAL(
zoomChanged()));
70 connect(mZoom2D.get(), SIGNAL(changed()),
this, SIGNAL(
zoomChanged()));
77 this->addConnectivityAction(
"global",
"Global 2D Zoom", contextMenu);
78 this->addConnectivityAction(
"group",
"Group 2D Zoom", contextMenu);
79 this->addConnectivityAction(
"local",
"Disconnected 2D Zoom", contextMenu);
80 contextMenu->addSeparator();
83 void Zoom2DHandler::addConnectivityAction(QString type, QString text, QMenu* contextMenu)
85 QAction* action =
new QAction(text, contextMenu);
86 action->setCheckable(
true);
87 action->setData(type);
88 action->setChecked(this->getConnectivityType()==type);
89 connect(action, SIGNAL(triggered()),
this, SLOT(zoom2DActionSlot()));
90 contextMenu->addAction(action);
96 void Zoom2DHandler::zoom2DActionSlot()
98 QAction* theAction =
static_cast<QAction*
>(sender());
102 QString action = theAction->data().toString();
103 this->setConnectivityFromType(action);
106 QString Zoom2DHandler::getConnectivityType()
110 if (mGroupData->getGroup2DZoom() == mZoom2D)
112 if (mGroupData->getGlobal2DZoom() == mZoom2D)
117 void Zoom2DHandler::setConnectivityFromType(QString type)
124 this->
set(mGroupData->getGlobal2DZoom());
126 else if (type==
"group")
128 this->
set(mGroupData->getGroup2DZoom());
130 else if (type==
"local")
136 reportWarning(QString(
"No zoom connectivity found for type [%1].").arg(type));
boost::shared_ptr< class ViewGroupData > ViewGroupDataPtr
void setFactor(double factor)
void addActionsToMenu(QMenu *contextMenu)
void reportWarning(QString msg)
double constrainValue(double val, double min, double max)
static SyncedValuePtr create(QVariant val=QVariant())
void setGroupData(ViewGroupDataPtr group)
boost::shared_ptr< class SyncedValue > SyncedValuePtr
Namespace for all CustusX production code.