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",
57 "Zoom in all 2D views are synchronized", contextMenu);
58 this->addConnectivityAction(
"group",
"Group 2D Zoom",
59 "Zoom for all 2D views in a view group with this option set\n"
60 "will be synchronized. ", contextMenu);
61 this->addConnectivityAction(
"local",
"Disconnected 2D Zoom",
62 "2D zoom in this view will be decoupled from other 2D views", contextMenu);
63 contextMenu->addSeparator();
66 void Zoom2DHandler::addConnectivityAction(QString type, QString text, QString toolTip, QMenu* contextMenu)
68 QAction* action =
new QAction(text, contextMenu);
69 action->setCheckable(
true);
70 action->setData(type);
71 action->setChecked(this->getConnectivityType()==type);
72 action->setToolTip(toolTip);
73 connect(action, SIGNAL(triggered()),
this, SLOT(zoom2DActionSlot()));
74 contextMenu->addAction(action);
80 void Zoom2DHandler::zoom2DActionSlot()
82 QAction* theAction =
static_cast<QAction*
>(sender());
86 QString action = theAction->data().toString();
87 this->setConnectivityFromType(action);
90 QString Zoom2DHandler::getConnectivityType()
94 if (mGroupData->getGroup2DZoom() == mZoom2D)
96 if (mGroupData->getGlobal2DZoom() == mZoom2D)
101 void Zoom2DHandler::setConnectivityFromType(QString type)
108 this->set(mGroupData->getGlobal2DZoom());
110 else if (type==
"group")
112 this->set(mGroupData->getGroup2DZoom());
114 else if (type==
"local")
120 reportWarning(QString(
"No zoom connectivity found for type [%1].").arg(type));