29 this->
set(group->getGlobal2DZoom());
34 return mZoom2D->get().toDouble();
46 disconnect(mZoom2D.get(), SIGNAL(changed()),
this, SIGNAL(
zoomChanged()));
49 connect(mZoom2D.get(), SIGNAL(changed()),
this, SIGNAL(
zoomChanged()));
56 this->addConnectivityAction(
"global",
"Global 2D Zoom", contextMenu);
57 this->addConnectivityAction(
"group",
"Group 2D Zoom", contextMenu);
58 this->addConnectivityAction(
"local",
"Disconnected 2D Zoom", contextMenu);
59 contextMenu->addSeparator();
62 void Zoom2DHandler::addConnectivityAction(QString type, QString text, QMenu* contextMenu)
64 QAction* action =
new QAction(text, contextMenu);
65 action->setCheckable(
true);
66 action->setData(type);
67 action->setChecked(this->getConnectivityType()==type);
68 connect(action, SIGNAL(triggered()),
this, SLOT(zoom2DActionSlot()));
69 contextMenu->addAction(action);
75 void Zoom2DHandler::zoom2DActionSlot()
77 QAction* theAction =
static_cast<QAction*
>(sender());
81 QString action = theAction->data().toString();
82 this->setConnectivityFromType(action);
85 QString Zoom2DHandler::getConnectivityType()
89 if (mGroupData->getGroup2DZoom() == mZoom2D)
91 if (mGroupData->getGlobal2DZoom() == mZoom2D)
96 void Zoom2DHandler::setConnectivityFromType(QString type)
103 this->
set(mGroupData->getGlobal2DZoom());
105 else if (type==
"group")
107 this->
set(mGroupData->getGroup2DZoom());
109 else if (type==
"local")
115 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.