Fraxinus  18.10
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 "cxEnumConverter.h"
14 #include "cxDefinitionStrings.h"
15 
16 namespace cx
17 {
18 
20  mInteractiveClipper(clipper)
21 {
22  connect(mInteractiveClipper.get(), SIGNAL(changed()), this, SIGNAL(changed()));
23 }
24 
26 {
27  return "Slice Plane";
28 }
29 bool StringPropertyClipPlane::setValue(const QString& value)
30 {
31  PLANE_TYPE plane = string2enum<PLANE_TYPE> (value);
32  if (plane == mInteractiveClipper->getSlicePlane())
33  return false;
34  mInteractiveClipper->setSlicePlane(plane);
35  return true;
36 }
38 {
39  return qstring_cast(mInteractiveClipper->getSlicePlane());
40 }
42 {
43  return "Chose the slice plane to clip with.";
44 }
46 {
47  std::vector<PLANE_TYPE> planes = mInteractiveClipper->getAvailableSlicePlanes();
48  QStringList retval;
49  for (unsigned i = 0; i < planes.size(); ++i)
50  retval << qstring_cast(planes[i]);
51  return retval;
52 }
53 
55 {
56  mInteractiveClipper = clipper;
57 }
58 
59 }//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.