Commit dcf32040 authored by Emmanuel Promayon's avatar Emmanuel Promayon
Browse files

FIXED QVector4D printing

Default action can now print QVector4D parameter
parent 6ca13636
......@@ -2,16 +2,20 @@
<!-- Manual test from build dir $CAMITK_BUILD_DIR and sources in $CAMITK_SOURCE_DIR
export CAMITK_BUILD_DIR=~/Dev/CamiTK/build/camitk
export CAMITK_SOURCE_DIR=~/Dev/CamiTK/src/camitk
workingDir=$(mktemp --tmpdir -d camitk-test-tmp.XXXXXXXXXX)
workingDir=$(mktemp \-\-tmpdir -d camitk-test-tmp.XXXXXXXXXX)
cd ~/Dev/CamiTK/build/camitk/
bin/camitk-cepgenerator -f $CAMITK_SOURCE_DIR/sdk/libraries/cepcoreschema/testdata/autogenerated.xml -d $workingDir
bin/camitk-cepgenerator -f $CAMITK_SOURCE_DIR/sdk/libraries/cepcoreschema/testdata/complete-test-1.xml -d $workingDir
cp $CAMITK_SOURCE_DIR/sdk/libraries/cepcoreschema/testdata/TestLib.* $workingDir/completetestcep1/libraries/testlib
cd $workingDir
CAMITK_DIR=$CAMITK_BUILD_DIR cmake -DCMAKE_MODULE_PATH:PATH="$CAMITK_SOURCE_DIR/sdk/cmake/modules;$CAMITK_SOURCE_DIR/sdk/cmake/modules/macros" ../str1234
mkdir build
cd build
CAMITK_DIR=$CAMITK_BUILD_DIR cmake -DCMAKE_MODULE_PATH:PATH="$CAMITK_SOURCE_DIR/sdk/cmake/modules;$CAMITK_SOURCE_DIR/sdk/cmake/modules/macros" ../completetestcep1
make
cd
rm -rf $workingDir
-->
<cep xmlns="http://camitk.imag.fr/cepcoreschema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://camitk.imag.fr/cepcoreschema Cep.xsd">
<name>Complete test CEP #1</name>
<name>Complete test CEP 1</name>
<contact>
<email>timc-camitk@univ-grenoble-alpes.fr</email>
</contact>
......@@ -34,11 +38,11 @@ $USERDEF_LICENCE_END$
]]></copyright>
<actionExtensions>
<actionExtension>
<name>Test Action Extension #1</name>
<name>Test Action Extension 1</name>
<description>Test the first action extension</description>
<actions>
<action>
<name>Test Action #1</name>
<name>Test Action 1</name>
<description>Test a first action, for image component, with a lot of parameters</description>
<component>ImageComponent</component>
<classification>
......@@ -53,17 +57,18 @@ $USERDEF_LICENCE_END$
<parameter name="p2" type="bool" description="This is p2" unit="unit 2" defaultValue="true" editable="true" />
<parameter name="p3" type="double" description="This is p3" unit="unit 3" defaultValue="42.42" editable="true" />
<parameter name="p4" type="QString" description="This is p4" unit="unit 4" defaultValue="Default value" editable="true" />
<parameter name="p5" type="QTime" description="This is p5" unit="unit 5" defaultValue="23:58" editable="true" />
<parameter name="p6" type="QColor" description="This is p6" unit="unit 6" defaultValue="#FF0000" editable="true" />
<parameter name="p7" type="QPoint" description="This is p7" unit="unit 7" defaultValue="42,84" editable="true" />
<parameter name="p8" type="QPointF" description="This is p8" unit="unit 8" defaultValue="42.42,84.84" editable="true" />
<parameter name="p9" type="QVector3D" description="This is p9" unit="unit 9" defaultValue="(42.0,0.0,-1.0)" editable="true" />
<parameter name="p10" type="QVector4D" description="This is p10" unit="unit 10" defaultValue="42.0,0.0,-1.0,84.42)" editable="true" />
<parameter name="p5" type="QDate" description="This is p5" unit="unit 5" defaultValue="QDate(28,12,1969)" editable="true" />
<parameter name="p6" type="QColor" description="This is p6" unit="unit 6" defaultValue="QVariant().value&lt;QColor>()" editable="true" />
<parameter name="p7" type="QPoint" description="This is p7" unit="unit 7" defaultValue="QPoint(42,84)" editable="true" />
<parameter name="p8" type="QPointF" description="This is p8" unit="unit 8" defaultValue="QPointF(42.42,84.84)" editable="true" />
<parameter name="p9" type="QVector3D" description="This is p9" unit="unit 9" defaultValue="QVariant().value&lt;QVector3D>()" editable="true" />
<parameter name="p10" type="QVector4D" description="This is p10" unit="unit 10" defaultValue="QVariant().value&lt;QVector4D>()" editable="true" />
<parameter name="p11" type="QTime" description="This is p11" unit="unit 11" defaultValue="QTime(23,58)" editable="true" />
</parameters>
<properties modal="false" embedded="true" delayed="false" />
</action>
<action>
<name>Test Action #2</name>
<name>Test Action 2</name>
<description>Test a second action, with no tag, no component, and with just one non editable parameters</description>
<component></component>
<classification>
......@@ -76,8 +81,8 @@ $USERDEF_LICENCE_END$
<properties modal="true" embedded="false" delayed="false" />
</action>
<action>
<name>Test Action #3</name>
<description>Test a third action, with non existing "Mesh Component", and with lots of parameters and defautl editable</description>
<name>Test Action 3</name>
<description>Test a third action, with non existing \"Mesh Component\", and with lots of parameters and defautl editable</description>
<component></component>
<classification>
<family>Complete Test Actions #1</family>
......@@ -88,55 +93,90 @@ $USERDEF_LICENCE_END$
<parameter name="p2" type="bool" description="This is p2" unit="unit 2" defaultValue="true"/>
<parameter name="p3" type="double" description="This is p3" unit="unit 3" defaultValue="42.42"/>
<parameter name="p4" type="QString" description="This is p4" unit="unit 4" defaultValue="Default value"/>
<parameter name="p5" type="QTime" description="This is p5" unit="unit 5" defaultValue="23:58"/>
<parameter name="p6" type="QColor" description="This is p6" unit="unit 6" defaultValue="#FF0000"/>
<parameter name="p7" type="QPoint" description="This is p7" unit="unit 7" defaultValue="42,84"/>
<parameter name="p8" type="QPointF" description="This is p8" unit="unit 8" defaultValue="42.42,84.84"/>
<parameter name="p9" type="QVector3D" description="This is p9" unit="unit 9" defaultValue="(42.0,0.0,-1.0)"/>
<parameter name="p10" type="QVector4D" description="This is p10" unit="unit 10" defaultValue="42.0,0.0,-1.0,84.42)"/>
<parameter name="p5" type="QDate" description="This is p5" unit="unit 5" defaultValue="QDate(28,12,1969)"/>
<parameter name="p6" type="QColor" description="This is p6" unit="unit 6" defaultValue="QVariant().value&lt;QColor>()"/>
<parameter name="p7" type="QPoint" description="This is p7" unit="unit 7" defaultValue="QPoint(42,84)"/>
<parameter name="p8" type="QPointF" description="This is p8" unit="unit 8" defaultValue="QPointF(42.42,84.84)"/>
<parameter name="p9" type="QVector3D" description="This is p9" unit="unit 9" defaultValue="QVariant().value&lt;QVector3D>()"/>
<parameter name="p10" type="QVector4D" description="This is p10" unit="unit 10" defaultValue="QVariant().value&lt;QVector4D>()"/>
<parameter name="p11" type="QTime" description="This is p11" unit="unit 11" defaultValue="QTime(23,58)" editable="true" />
</parameters>
<properties modal="true" embedded="false" delayed="false" />
</action>
</actions>
<dependencies>
<dependency type="library" name="str1234" additional="qtpropertybrowser" />
<dependency type="library" name="itk"/>
</dependencies>
</actionExtension>
<actionExtension>
<name>Test Action Extension 2</name>
<description>Test the second action extension</description>
<actions>
<action>
<name>Test Action 1</name>
<description>This action use the Test Component 1</description>
<component>TestComponent1</component>
<classification>
<family>Complete Test Actions #2</family>
<tag>Test</tag>
<tag>Action #2</tag>
<tag>Test Component 1</tag>
</classification>
<parameters>
<parameter name="message" type="QString" description="This is a message parameter" unit="none" defaultValue="hello!" editable="true" />
</parameters>
<properties modal="false" embedded="true" delayed="false" />
</action>
</actions>
<dependencies>
<dependency type="library" name="str1234" additional="qtpropertybrowser" />
</dependencies>
</actionExtension>
</actionExtensions>
<applications>
<application>
<name>str1234</name>
<description>str1234</description>
<directoryName>str1234</directoryName>
<name>testapp</name>
<description>Test application</description>
<directoryName>testappdir</directoryName>
</application>
</applications>
<componentExtensions>
<componentExtension>
<name>str1234</name>
<description>str1234</description>
<name>Test Component Extension 1</name>
<description>Test the first component extension</description>
<components>
<component>
<name>str1234</name>
<description>str1234</description>
<name>Test Component 1</name>
<description>Test a first action with an image representation</description>
<representation>Image</representation>
<properties>
<parameter name="str1234" type="int" description="str1234" unit="str1234" defaultValue="str1234" editable="true" />
<parameter name="p1" type="int" description="This is p1" unit="unit 1" defaultValue="42" editable="true" />
<parameter name="p2" type="bool" description="This is p2" unit="unit 2" defaultValue="true" editable="true" />
<parameter name="p3" type="double" description="This is p3" unit="unit 3" defaultValue="42.42" editable="true" />
<parameter name="p4" type="QString" description="This is p4" unit="unit 4" defaultValue="Default value" editable="true" />
<parameter name="p5" type="QDate" description="This is p5" unit="unit 5" defaultValue="QDate(28,12,1969)" editable="true" />
<parameter name="p6" type="QColor" description="This is p6" unit="unit 6" defaultValue="QVariant().value&lt;QColor>()" editable="true" />
<parameter name="p7" type="QPoint" description="This is p7" unit="unit 7" defaultValue="QPoint(42,84)" editable="true" />
<parameter name="p8" type="QPointF" description="This is p8" unit="unit 8" defaultValue="QPointF(42.42,84.84)" editable="true" />
<parameter name="p9" type="QVector3D" description="This is p9" unit="unit 9" defaultValue="QVariant().value&lt;QVector3D>()" editable="true" />
<parameter name="p10" type="QVector4D" description="This is p10" unit="unit 10" defaultValue="QVariant().value&lt;QVector4D>()" editable="true" />
<parameter name="p11" type="QTime" description="This is p11" unit="unit 11" defaultValue="QTime(23,58)" editable="true" />
</properties>
<fileSuffix>str1234</fileSuffix>
<fileSuffix>test</fileSuffix>
</component>
</components>
<dependencies>
<!-- <dependency type="library" name="str1234" additional="str1234" /> -->
<dependency type="library" name="testlib" />
</dependencies>
</componentExtension>
</componentExtensions>
<libraries>
<library static="true">
<name>str1234</name>
<description>str1234</description>
<name>testlib</name>
<description>A simple test lib. This lib will not compile unless some minimal C++ code is present in the generated source. Copy TestLib.h and TestLib.cpp to the library directory before configuration time.</description>
<dependencies>
<dependency type="library" name="str1234" additional="str1234" />
<dependency type="library" name="XSD"/>
<dependency type="library" name="ITK"/>
</dependencies>
</library>
</libraries>
......
......@@ -217,6 +217,9 @@ QString ParameterGenerator::getToString() const {
case QVECTOR3D:
toString = "\"(\" + QString::number(" + cppName + ".x()) + \",\" + QString::number(" + cppName + ".y()) + \",\" + QString::number(" + cppName + ".z()) + \")\"";
break;
case QVECTOR4D:
toString = "\"(\" + QString::number(" + cppName + ".w()) + \",\" + QString::number(" + cppName + ".x()) + \",\" + QString::number(" + cppName + ".y()) + \",\" + QString::number(" + cppName + ".z()) + \")\"";
break;
case QCOLOR:
toString = cppName + ".name()";
break;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment