14 #include <QDomElement> 15 #include <QStringList> 22 SpaceProperty::SpaceProperty() : mIsReadOnly(false)
34 retval->mName = name.isEmpty() ? uid : name;
36 retval->mRange = range;
39 retval->mAllowOnlyValuesInRange =
true;
47 this->providerChangedSlot();
50 void SpaceProperty::providerChangedSlot()
52 std::map<QString, QString> names = mProvider->getDisplayNamesForCoordRefObjects();
53 this->setRefObjectDisplayNames(names);
55 std::vector<CoordinateSystem> spaces = mProvider->getSpacesToPresentInGUI();
56 this->setValueRange(spaces);
124 if (mDisplayNames.count(
internal))
125 return mDisplayNames[
internal];
131 mDisplayNames = names;
boost::shared_ptr< class SpaceProvider > SpaceProviderPtr
void setSpaceProvider(SpaceProviderPtr provider)
static SpacePropertyPtr initialize(const QString &uid, QString name, QString help, Space value=Space(), std::vector< Space > range=std::vector< Space >(), QDomNode root=QDomNode())
void spaceAddedOrRemoved()
boost::shared_ptr< class SpaceProperty > SpacePropertyPtr
virtual void setHelp(QString val)
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.
Helper class for storing one string value in an xml document.
virtual QString convertRefObjectInternal2Display(QString internal)
conversion from internal value to display value
Identification of a Coordinate system.
virtual Space getValue() const
get the data value.
void changed()
emit when the underlying data value is changed: The user interface will be updated.
void setReadOnly(bool val)
virtual std::vector< Space > getValueRange() const
virtual QString getUid() const
virtual void setRefObjectDisplayNames(std::map< QString, QString > names)
virtual void setValueRange(std::vector< Space > range)
range of value. Use if data is constrained to a set.
static CoordinateSystem fromString(QString text)
virtual bool setValue(const Space &value)
set the data value.
Namespace for all CustusX production code.