41 : mPatientModelService(patientModelService)
42 , mCylinderText(
"Cylinder")
44 , mSphereText(
"Sphere")
51 for (
unsigned i=0; i<mProperties.size(); ++i)
53 XmlOptionItem item(mProperties[i]->getUid(), dataNode.toElement());
60 for (
unsigned i=0; i<mProperties.size(); ++i)
62 XmlOptionItem item(mProperties[i]->getUid(), dataNode.toElement());
63 QVariant orgval = mProperties[i]->getValueAsVariant();
64 mProperties[i]->setValueFromVariant(item.readVariant(orgval));
68 void MeshTextureData::addProperty(
PropertyPtr property)
70 mProperties.push_back(property);
74 void MeshTextureData::initialize()
77 mTextureImage->setValueName(
"Texture image");
78 mTextureImage->setHelp(
"Select an imported 2D image to use as texture.");
79 mTextureImage->setOnly2DImagesFilter(
true);
80 this->addProperty(mTextureImage);
83 "The texture is applied in predefined geometric shapes. Select the shape which gives the best fit to your mesh.",
89 this->addProperty(mTextureShape);
91 mScaleX =
DoubleProperty::initialize(
"texture_scale_X",
"Scale X",
"How many times to draw the image along the X axis.", 1, DoubleRange(1,100000,1), 0);
92 this->addProperty(mScaleX);
94 mScaleY =
DoubleProperty::initialize(
"texture_scale_Y",
"Scale Y",
"How many times to draw the image along the Y axis.", 1, DoubleRange(1,100000,1), 0);
95 this->addProperty(mScaleY);
97 mPositionX =
DoubleProperty::initialize(
"texture_position_X",
"Position X",
"Where to start drawing the image along the X axis.", 0, DoubleRange(-100000,100000,0.01), 2);
98 this->addProperty(mPositionX);
100 mPositionY =
DoubleProperty::initialize(
"texture_position_Y",
"Position Y",
"Where to start drawing the image along the Y axis.", 0, DoubleRange(-100000,100000,0.01), 2);
101 this->addProperty(mPositionY);
104 this->addProperty(mRepeat);
119 return mCylinderText;
154 return mTextureImage;
159 return mTextureShape;
static BoolPropertyPtr initialize(const QString &uid, QString name, QString help, bool value, QDomNode root=QDomNode())
void writeVariant(const QVariant &val)
void parseXml(QDomNode &dataNode)
DoublePropertyPtr getPositionY() const
QString getPlaneText() const
DoublePropertyPtr getScaleX() const
StringPropertySelectImagePtr getTextureImage() const
Helper class for storing one string value in an xml document.
DoublePropertyPtr getPositionX() const
boost::shared_ptr< class StringProperty > StringPropertyPtr
QString getSphereText() const
boost::shared_ptr< class Property > PropertyPtr
BoolPropertyPtr getRepeat() const
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
boost::shared_ptr< class StringPropertySelectImage > StringPropertySelectImagePtr
void changed()
emit when the underlying data value is changed: The user interface will be updated.
static StringPropertyPtr initialize(const QString &uid, QString name, QString help, QString value, QStringList range, QDomNode root=QDomNode())
boost::shared_ptr< class DoubleProperty > DoublePropertyPtr
MeshTextureData(PatientModelServicePtr patientModelService)
std::vector< PropertyPtr > getProperties() const
DoublePropertyPtr getScaleY() const
QString getCylinderText() const
void addXml(QDomNode &dataNode)
static DoublePropertyPtr initialize(const QString &uid, QString name, QString help, double value, DoubleRange range, int decimals, QDomNode root=QDomNode())
static StringPropertySelectImagePtr New(PatientModelServicePtr patientModelService)
boost::shared_ptr< class BoolProperty > BoolPropertyPtr
StringPropertyPtr getTextureShape() const