48 connect(
mSlicePlaneClipper.get(), SIGNAL(slicePlaneChanged()),
this, SLOT(changedSlot()));
49 connect(
this, SIGNAL(
changed()),
this, SLOT(changedSlot()));
50 connect(
mServices->tracking().get(), SIGNAL(activeToolChanged(
const QString&)),
this, SLOT(activeToolChangedSlot()));
52 this->activeToolChangedSlot();
58 QDomElement elem = dataNode.toElement();
60 QString plane = enum2string<PLANE_TYPE>(this->
getSlicePlane());
62 elem.setAttribute(
"plane", plane);
64 elem.setAttribute(
"uids", this->getDataUids());
69 QDomElement elem = dataNode.toElement();
71 QString existingPlane = enum2string<PLANE_TYPE>(this->
getSlicePlane());
72 PLANE_TYPE newPlane = string2enum<PLANE_TYPE>(elem.attribute(
"plane", existingPlane));
75 this->
invertPlane(elem.attribute(
"invert", QString::number(this->getInvertPlane())).toInt());
76 this->setDataUids(elem.attribute(
"uids", this->getDataUids()));
79 QString InteractiveClipper::getDataUids()
82 std::map<QString, DataPtr>::iterator iter =
mDatas.begin();
83 for (; iter !=
mDatas.end(); ++iter)
85 dataUids << iter->first;
87 return dataUids.join(
" ");
90 void InteractiveClipper::setDataUids(QString uids)
92 QStringList dataUids = uids.split(
" ");
93 for(
int i = 0; i < dataUids.size(); ++i)
123 mData->clearPersistentClipPlanes();
176 mDatas[data->getUid()] = data;
184 std::map<QString, DataPtr>::iterator iter =
mDatas.find(data->getUid());
197 return mDatas.count(data->getUid());
217 std::map<QString, DataPtr>::iterator iter =
mDatas.begin();
218 for(; iter !=
mDatas.end(); ++iter)
224 std::map<QString, DataPtr>::iterator iter =
mDatas.begin();
225 for(; iter !=
mDatas.end(); ++iter)
229 void InteractiveClipper::changedSlot()
240 if (!std::count(planes.begin(), planes.end(), currentPlane))
244 currentPlane = ptCOUNT;
248 currentPlane = planes.front();
265 std::vector<PLANE_TYPE> retval;
267 for (SlicePlanesProxy::DataMap::iterator iter = data.begin(); iter != data.end(); ++iter)
269 retval.push_back(iter->first);
274 void InteractiveClipper::activeToolChangedSlot()
285 for (SlicePlanesProxy::DataMap::iterator iter = data.begin(); iter != data.end(); ++iter)
287 iter->second.mSliceProxy->setTool(tool);