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);
void removeData(DataPtr data)
ptCORONAL
a slice seen from the front of the patient
void useActiveTool(bool on)
SlicePlaneClipperPtr mSlicePlaneClipper
boost::shared_ptr< class SlicePlanesProxy > SlicePlanesProxyPtr
std::vector< PLANE_TYPE > getAvailableSlicePlanes() const
InteractiveClipper(CoreServicesPtr services)
bool getUseClipper() const
std::map< PLANE_TYPE, DataType > DataMap
void setTool(ToolPtr tool)
ptAXIAL
a slice seen from the top of the patient
void removeAllInterActiveClipPlanes()
std::map< QString, DataPtr > getDatas()
boost::shared_ptr< class Data > DataPtr
PLANE_TYPE getPlaneType()
void saveClipPlaneToVolume()
save the current clip to image
void setData(DataPtr data)
ptSAGITTAL
a slice seen from the side of the patient
void invertPlane(bool on)
ptTOOLSIDEPLANE
z-rotated 90* relative to anyplane like side plane, but always kept oriented like the plane defined b...
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
void parseXml(QDomNode dataNode)
bool getInvertPlane() const
std::map< QString, DataPtr > mDatas
void addAllInteractiveClipPlanes()
Helper class for managing a set of slice planes.
SlicePlanesProxyPtr mSlicePlanesProxy
ptRADIALPLANE
y-rotated 90* relative to anyplane (bird's view)
static SlicePlaneClipperPtr New()
CoreServicesPtr mServices
void updateClipPlanesInData()
boost::shared_ptr< class CoreServices > CoreServicesPtr
void setSlicePlane(PLANE_TYPE plane)
ptANYPLANE
a plane aligned with the tool base plane
vtkSmartPointer< class vtkPlane > vtkPlanePtr
PLANE_TYPE getSlicePlane()
bool exists(DataPtr data)
void addData(DataPtr data)
void clearClipPlanesInVolume()
clear all saved clips in the image.
ptSIDEPLANE
z-rotated 90* relative to anyplane (dual anyplane)
void addXml(QDomNode &dataNode)
Namespace for all CustusX production code.
boost::shared_ptr< class Tool > ToolPtr