27 unsigned pos = this->indexOf(uid);
28 if (pos != mLayouts.size())
37 unsigned pos = this->indexOf(uid);
38 if (pos != mLayouts.size())
46 std::vector<QString> retval;
47 for (
unsigned i = 0; i < mLayouts.size(); ++i)
49 retval.push_back(mLayouts[i].getUid());
56 unsigned pos = this->indexOf(data.
getUid());
57 if (pos == mLayouts.size())
58 mLayouts.push_back(data);
68 for (LayoutDataVector::const_iterator iter = mLayouts.begin(); iter != mLayouts.end(); ++iter)
71 count = iter->getUid().toInt() + 1;
78 mLayouts.erase(mLayouts.begin() + indexOf(uid));
82 unsigned LayoutRepository::indexOf(
const QString uid)
const
84 for (
unsigned i = 0; i < mLayouts.size(); ++i)
86 if (mLayouts[i].getUid() == uid)
89 return mLayouts.size();
94 bool isLayout =
false;
95 for (
unsigned i = 0; i < mLayouts.size(); ++i)
97 if (uid == mLayouts[i].getUid())
104 bool isDefaultLayout = std::count(mDefaultLayouts.begin(), mDefaultLayouts.end(), uid);
107 if (isLayout && !isDefaultLayout)
118 this->blockSignals(
true);
120 QDomElement layouts = file.
getElement(
"layouts");
121 QDomNode layout = layouts.firstChild();
122 for (; !layout.isNull(); layout = layout.nextSibling())
124 if (layout.toElement().tagName() !=
"layout")
136 this->blockSignals(
false);
138 for (
unsigned i=0; i<custom.size(); ++i)
146 for (LayoutDataVector::iterator iter = mLayouts.begin(); iter != mLayouts.end(); ++iter)
148 if (!this->
isCustom(iter->getUid()))
151 QDomElement layoutNode = file.
getDocument().createElement(
"layout");
152 layoutsNode.
getElement().appendChild(layoutNode);
153 iter->addXml(layoutNode);
160 void LayoutRepository::addDefaults()
162 mDefaultLayouts.clear();
204 layout.setView(1,
ptAXIAL, LayoutRegion(0, 3));
205 layout.setView(1,
ptCORONAL, LayoutRegion(1, 3));
206 layout.setView(1,
ptSAGITTAL, LayoutRegion(2, 3));
212 layout.setView(1,
ptAXIAL, LayoutRegion(0, 0, 3, 3));
214 layout.setView(1,
ptCORONAL, LayoutRegion(1, 3));
215 layout.setView(1,
ptSAGITTAL, LayoutRegion(2, 3));
223 layout.setView(2,
ptAXIAL, LayoutRegion(1, 3, 1, 2));
224 layout.setView(2,
ptCORONAL, LayoutRegion(2, 3, 1, 2));
231 layout.setView(1,
ptANYPLANE, LayoutRegion(0, 3));
232 layout.setView(1,
ptSIDEPLANE, LayoutRegion(1, 3));
237 LayoutData layout =
LayoutData::create(
"LAYOUT_3D_ACS_SINGLE",
"3D ACS Connected", 3, 4);
239 layout.setView(0,
ptAXIAL, LayoutRegion(0, 3));
240 layout.setView(0,
ptCORONAL, LayoutRegion(1, 3));
241 layout.setView(0,
ptSAGITTAL, LayoutRegion(2, 3));
246 LayoutData layout =
LayoutData::create(
"LAYOUT_3D_AD_SINGLE",
"3D AnyDual Connected", 2, 4);
248 layout.setView(0,
ptANYPLANE, LayoutRegion(0, 3));
249 layout.setView(0,
ptSIDEPLANE, LayoutRegion(1, 3));
258 LayoutData layout =
LayoutData::create(
"LAYOUT_OBLIQUE_3DAnyDual_x1",
"3D Any Dual x1", 1, 3);
260 layout.setView(1,
ptANYPLANE, LayoutRegion(0, 1));
261 layout.setView(1,
ptSIDEPLANE, LayoutRegion(0, 2));
265 LayoutData layout =
LayoutData::create(
"LAYOUT_OBLIQUE_3DAnyDual_x2",
"3D Any Dual x2", 2, 3);
267 layout.setView(1,
ptANYPLANE, LayoutRegion(0, 1));
268 layout.setView(1,
ptSIDEPLANE, LayoutRegion(1, 1));
269 layout.setView(2,
ptANYPLANE, LayoutRegion(0, 2));
270 layout.setView(2,
ptSIDEPLANE, LayoutRegion(1, 2));
274 LayoutData layout =
LayoutData::create(
"LAYOUT_OBLIQUE_AnyDual_x3",
"Any Dual x3", 2, 3);
275 layout.setView(0,
ptANYPLANE, LayoutRegion(0, 0));
276 layout.setView(0,
ptSIDEPLANE, LayoutRegion(1, 0));
277 layout.setView(1,
ptANYPLANE, LayoutRegion(0, 1));
278 layout.setView(1,
ptSIDEPLANE, LayoutRegion(1, 1));
279 layout.setView(2,
ptANYPLANE, LayoutRegion(0, 2));
280 layout.setView(2,
ptSIDEPLANE, LayoutRegion(1, 2));
289 LayoutData layout =
LayoutData::create(
"LAYOUT_ORTHOGONAL_3DACS_x1",
"3D ACS x1", 2, 2);
291 layout.setView(1,
ptAXIAL, LayoutRegion(0, 1));
292 layout.setView(1,
ptCORONAL, LayoutRegion(1, 0));
293 layout.setView(1,
ptSAGITTAL, LayoutRegion(1, 1));
297 LayoutData layout =
LayoutData::create(
"LAYOUT_ORTHOGONAL_3DACS_x2",
"3D ACS x2", 3, 3);
299 layout.setView(1,
ptAXIAL, LayoutRegion(0, 1));
300 layout.setView(1,
ptCORONAL, LayoutRegion(1, 1));
301 layout.setView(1,
ptSAGITTAL, LayoutRegion(2, 1));
302 layout.setView(2,
ptAXIAL, LayoutRegion(0, 2));
303 layout.setView(2,
ptCORONAL, LayoutRegion(1, 2));
304 layout.setView(2,
ptSAGITTAL, LayoutRegion(2, 2));
309 layout.setView(0,
ptAXIAL, LayoutRegion(0, 0));
310 layout.setView(0,
ptCORONAL, LayoutRegion(1, 0));
311 layout.setView(0,
ptSAGITTAL, LayoutRegion(2, 0));
312 layout.setView(1,
ptAXIAL, LayoutRegion(0, 1));
313 layout.setView(1,
ptCORONAL, LayoutRegion(1, 1));
314 layout.setView(1,
ptSAGITTAL, LayoutRegion(2, 1));
315 layout.setView(2,
ptAXIAL, LayoutRegion(0, 2));
316 layout.setView(2,
ptCORONAL, LayoutRegion(1, 2));
317 layout.setView(2,
ptSAGITTAL, LayoutRegion(2, 2));
331 LayoutData layout =
LayoutData::create(
"LAYOUT_US_Acquisition",
"US Acquisition", 2, 3);
332 layout.setView(0,
ptANYPLANE, LayoutRegion(1, 2, 1, 1));
341 mDefaultLayouts.push_back(data.
getUid());
342 mLayouts.push_back(data);