68 connect(
mSlicePlaneClipper.get(), SIGNAL(slicePlaneChanged()),
this, SLOT(changedSlot()));
69 connect(
this, SIGNAL(
changed()),
this, SLOT(changedSlot()));
70 connect(
mServices->tracking().get(), SIGNAL(activeToolChanged(
const QString&)),
this, SLOT(activeToolChangedSlot()));
72 this->activeToolChangedSlot();
78 QDomElement elem = dataNode.toElement();
80 QString plane = enum2string<PLANE_TYPE>(this->
getSlicePlane());
82 elem.setAttribute(
"plane", plane);
84 elem.setAttribute(
"uids", this->getDataUids());
89 QDomElement elem = dataNode.toElement();
91 QString existingPlane = enum2string<PLANE_TYPE>(this->
getSlicePlane());
92 PLANE_TYPE newPlane = string2enum<PLANE_TYPE>(elem.attribute(
"plane", existingPlane));
95 this->
invertPlane(elem.attribute(
"invert", QString::number(this->getInvertPlane())).toInt());
96 this->setDataUids(elem.attribute(
"uids", this->getDataUids()));
99 QString InteractiveClipper::getDataUids()
101 QStringList dataUids;
102 std::map<QString, DataPtr>::iterator iter =
mDatas.begin();
103 for (; iter !=
mDatas.end(); ++iter)
105 dataUids << iter->first;
107 return dataUids.join(
" ");
110 void InteractiveClipper::setDataUids(QString uids)
112 QStringList dataUids = uids.split(
" ");
113 for(
int i = 0; i < dataUids.size(); ++i)
143 mData->clearPersistentClipPlanes();
196 mDatas[data->getUid()] = data;
204 std::map<QString, DataPtr>::iterator iter =
mDatas.find(data->getUid());
217 return mDatas.count(data->getUid());
237 std::map<QString, DataPtr>::iterator iter =
mDatas.begin();
238 for(; iter !=
mDatas.end(); ++iter)
244 std::map<QString, DataPtr>::iterator iter =
mDatas.begin();
245 for(; iter !=
mDatas.end(); ++iter)
249 void InteractiveClipper::changedSlot()
260 if (!std::count(planes.begin(), planes.end(), currentPlane))
264 currentPlane = ptCOUNT;
268 currentPlane = planes.front();
285 std::vector<PLANE_TYPE> retval;
287 for (SlicePlanesProxy::DataMap::iterator iter = data.begin(); iter != data.end(); ++iter)
289 retval.push_back(iter->first);
294 void InteractiveClipper::activeToolChangedSlot()
305 for (SlicePlanesProxy::DataMap::iterator iter = data.begin(); iter != data.end(); ++iter)
307 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)
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)
boost::shared_ptr< class Tool > ToolPtr