CustusX  2023.01.05-dev+develop.0da12
An IGT application
cxStringPropertyClipPlane.cpp
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 
13 #include "cxEnumConversion.h"
14 
15 namespace cx
16 {
17 
19  mInteractiveClipper(clipper)
20 {
21  connect(mInteractiveClipper.get(), SIGNAL(changed()), this, SIGNAL(changed()));
22 }
23 
25 {
26  return "Slice Plane";
27 }
28 bool StringPropertyClipPlane::setValue(const QString& value)
29 {
30  PLANE_TYPE plane = string2enum<PLANE_TYPE> (value);
31  if (plane == mInteractiveClipper->getSlicePlane())
32  return false;
33  mInteractiveClipper->setSlicePlane(plane);
34  return true;
35 }
37 {
38  return qstring_cast(mInteractiveClipper->getSlicePlane());
39 }
41 {
42  return "Chose the slice plane to clip with.";
43 }
45 {
46  std::vector<PLANE_TYPE> planes = mInteractiveClipper->getAvailableSlicePlanes();
47  QStringList retval;
48  for (unsigned i = 0; i < planes.size(); ++i)
49  retval << qstring_cast(planes[i]);
50  return retval;
51 }
52 
54 {
55  mInteractiveClipper = clipper;
56 }
57 
58 }//cx
QString qstring_cast(const T &val)
void setClipper(InteractiveClipperPtr clipper)
virtual QString getValue() const
get the data value.
virtual QString getHelp() const
return a descriptive help string for the data, used for example as a tool tip.
virtual QString getDisplayName() const
name of data entity. Used for display to user.
virtual QStringList getValueRange() const
InteractiveClipperPtr mInteractiveClipper
StringPropertyClipPlane(InteractiveClipperPtr clipper)
void changed()
emit when the underlying data value is changed: The user interface will be updated.
boost::shared_ptr< class InteractiveClipper > InteractiveClipperPtr
virtual bool setValue(const QString &value)
set the data value.
Namespace for all CustusX production code.