NorMIT-nav  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_cast
QString qstring_cast(const T &val)
Definition: cxTypeConversions.h:46
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cx::Property::changed
void changed()
emit when the underlying data value is changed: The user interface will be updated.
cx::StringPropertyClipPlane::getValue
virtual QString getValue() const
get the data value.
Definition: cxStringPropertyClipPlane.cpp:36
cx::StringPropertyClipPlane::getHelp
virtual QString getHelp() const
Definition: cxStringPropertyClipPlane.cpp:40
cx::StringPropertyClipPlane::setValue
virtual bool setValue(const QString &value)
set the data value.
Definition: cxStringPropertyClipPlane.cpp:28
cx::StringPropertyClipPlane::setClipper
void setClipper(InteractiveClipperPtr clipper)
Definition: cxStringPropertyClipPlane.cpp:53
cx::StringPropertyClipPlane::mInteractiveClipper
InteractiveClipperPtr mInteractiveClipper
Definition: cxStringPropertyClipPlane.h:49
cx::StringPropertyClipPlane::getValueRange
virtual QStringList getValueRange() const
Definition: cxStringPropertyClipPlane.cpp:44
cx::InteractiveClipperPtr
boost::shared_ptr< class InteractiveClipper > InteractiveClipperPtr
Definition: cxForwardDeclarations.h:157
cxStringPropertyClipPlane.h
cx::StringPropertyClipPlane::getDisplayName
virtual QString getDisplayName() const
name of data entity. Used for display to user.
Definition: cxStringPropertyClipPlane.cpp:24
cx::StringPropertyClipPlane::StringPropertyClipPlane
StringPropertyClipPlane(InteractiveClipperPtr clipper)
Definition: cxStringPropertyClipPlane.cpp:18
cxEnumConversion.h