Initial commit for classes working with measurements tables.

--HG--
branch : feature
This commit is contained in:
dismine 2014-03-10 17:55:51 +02:00
parent d06bc59000
commit e3f412567e
11 changed files with 345 additions and 9 deletions

View File

@ -324,6 +324,150 @@
<xs:attribute name="ignore" type="xs:boolean"></xs:attribute> <xs:attribute name="ignore" type="xs:boolean"></xs:attribute>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name="front_neck_arc">
<xs:complexType>
<xs:attribute name="name" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="value" type="xs:double" use="required"></xs:attribute>
<xs:attribute name="gui_text" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="description" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="ignore" type="xs:boolean"></xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="back_neck_arc">
<xs:complexType>
<xs:attribute name="name" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="value" type="xs:double" use="required"></xs:attribute>
<xs:attribute name="gui_text" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="description" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="ignore" type="xs:boolean"></xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="front_upper-bust_arc">
<xs:complexType>
<xs:attribute name="name" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="value" type="xs:double" use="required"></xs:attribute>
<xs:attribute name="gui_text" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="description" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="ignore" type="xs:boolean"></xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="back_upper-bust_arc">
<xs:complexType>
<xs:attribute name="name" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="value" type="xs:double" use="required"></xs:attribute>
<xs:attribute name="gui_text" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="description" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="ignore" type="xs:boolean"></xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="front_waist_arc">
<xs:complexType>
<xs:attribute name="name" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="value" type="xs:double" use="required"></xs:attribute>
<xs:attribute name="gui_text" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="description" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="ignore" type="xs:boolean"></xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="back_waist_arc">
<xs:complexType>
<xs:attribute name="name" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="value" type="xs:double" use="required"></xs:attribute>
<xs:attribute name="gui_text" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="description" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="ignore" type="xs:boolean"></xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="front_upper-hip_arc">
<xs:complexType>
<xs:attribute name="name" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="value" type="xs:double" use="required"></xs:attribute>
<xs:attribute name="gui_text" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="description" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="ignore" type="xs:boolean"></xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="back_upper-hip_arc">
<xs:complexType>
<xs:attribute name="name" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="value" type="xs:double" use="required"></xs:attribute>
<xs:attribute name="gui_text" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="description" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="ignore" type="xs:boolean"></xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="front_hip_arc">
<xs:complexType>
<xs:attribute name="name" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="value" type="xs:double" use="required"></xs:attribute>
<xs:attribute name="gui_text" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="description" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="ignore" type="xs:boolean"></xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="back_hip_arc">
<xs:complexType>
<xs:attribute name="name" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="value" type="xs:double" use="required"></xs:attribute>
<xs:attribute name="gui_text" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="description" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="ignore" type="xs:boolean"></xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="chest_slope">
<xs:complexType>
<xs:attribute name="name" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="value" type="xs:double" use="required"></xs:attribute>
<xs:attribute name="gui_text" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="description" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="ignore" type="xs:boolean"></xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="back_slope">
<xs:complexType>
<xs:attribute name="name" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="value" type="xs:double" use="required"></xs:attribute>
<xs:attribute name="gui_text" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="description" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="ignore" type="xs:boolean"></xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="front_waist_slope">
<xs:complexType>
<xs:attribute name="name" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="value" type="xs:double" use="required"></xs:attribute>
<xs:attribute name="gui_text" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="description" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="ignore" type="xs:boolean"></xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="back_waist_slope">
<xs:complexType>
<xs:attribute name="name" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="value" type="xs:double" use="required"></xs:attribute>
<xs:attribute name="gui_text" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="description" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="ignore" type="xs:boolean"></xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="front-neck_to_upper-chest_height">
<xs:complexType>
<xs:attribute name="name" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="value" type="xs:double" use="required"></xs:attribute>
<xs:attribute name="gui_text" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="description" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="ignore" type="xs:boolean"></xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="front-neck_to_bust_height">
<xs:complexType>
<xs:attribute name="name" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="value" type="xs:double" use="required"></xs:attribute>
<xs:attribute name="gui_text" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="description" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="ignore" type="xs:boolean"></xs:attribute>
</xs:complexType>
</xs:element>
</xs:sequence> </xs:sequence>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>

View File

@ -58,6 +58,8 @@
<back_slope name="" value="0.0" gui_text="" description="" ignore="true"/> <back_slope name="" value="0.0" gui_text="" description="" ignore="true"/>
<front_waist_slope name="" value="0.0" gui_text="" description="" ignore="true"/> <front_waist_slope name="" value="0.0" gui_text="" description="" ignore="true"/>
<back_waist_slope name="" value="0.0" gui_text="" description="" ignore="true"/> <back_waist_slope name="" value="0.0" gui_text="" description="" ignore="true"/>
<front-neck_to_upper-chest_height name="" value="0.0" gui_text="" description="" ignore="true"/>
<front-neck_to_bust_height name="" value="0.0" gui_text="" description="" ignore="true"/>
</torso> </torso>
<arm> <arm>
<armscye_girth name="" value="0.0" gui_text="" description="" ignore="true"/> <armscye_girth name="" value="0.0" gui_text="" description="" ignore="true"/>

View File

@ -19,7 +19,7 @@
<item> <item>
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">
<property name="text"> <property name="text">
<string>Pattern peace name</string> <string>Pattern piece name</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -54,7 +54,9 @@
<string>...</string> <string>...</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset theme="document-open"/> <iconset theme="document-open">
<normaloff/>
</iconset>
</property> </property>
</widget> </widget>
</item> </item>
@ -88,7 +90,9 @@
<string>...</string> <string>...</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset theme="document-new"/> <iconset theme="document-new">
<normaloff/>
</iconset>
</property> </property>
</widget> </widget>
</item> </item>

View File

@ -25,7 +25,7 @@
</sizepolicy> </sizepolicy>
</property> </property>
<property name="text"> <property name="text">
<string>Pattern peace name</string> <string>Pattern piece name</string>
</property> </property>
<property name="margin"> <property name="margin">
<number>0</number> <number>0</number>

View File

@ -54,5 +54,8 @@
#include "app/dialogincrements.h" #include "app/dialogincrements.h"
#include "app/configdialog.h" #include "app/configdialog.h"
#include "app/dialogpatternproperties.h" #include "app/dialogpatternproperties.h"
#include "app/dialogmeasurements.h"
#include "app/dialogindividualmeasurements.h"
#include "app/dialogstandardmeasurements.h"
#endif // DIALOGS_H #endif // DIALOGS_H

View File

@ -114,11 +114,44 @@ MainWindow::MainWindow(QWidget *parent)
void MainWindow::ActionNewDraw() void MainWindow::ActionNewDraw()
{ {
const QString nameDraw = PatternPieceName(QString(tr("Pattern piece %1")).arg(comboBoxDraws->count()+1)); QString nameDraw;
if (comboBoxDraws->count() == 0)
{
DialogMeasurements measurements(this);
measurements.exec();
if (measurements.type() == Measurements::Standard)
{
DialogStandardMeasurements stMeasurements(this);
if (stMeasurements.exec() == QDialog::Accepted)
{
nameDraw = stMeasurements.name();
}
else
{
return;
}
}
else
{
DialogIndividualMeasurements indMeasurements(this);
if (indMeasurements.exec() == QDialog::Accepted)
{
nameDraw = indMeasurements.name();
}
else
{
return;
}
}
}
else
{
nameDraw = PatternPieceName(QString(tr("Pattern piece %1")).arg(comboBoxDraws->count()+1));
if (nameDraw.isEmpty()) if (nameDraw.isEmpty())
{ {
return; return;
} }
}
if (doc->appendDraw(nameDraw) == false) if (doc->appendDraw(nameDraw) == false)
{ {
qWarning()<<tr("Error creating pattern with the name ")<<nameDraw<<"."; qWarning()<<tr("Error creating pattern with the name ")<<nameDraw<<".";

View File

@ -0,0 +1,33 @@
/************************************************************************
**
** @file vindividualmeasurements.cpp
** @author Roman Telezhinsky <dismine@gmail.com>
** @date 8 3, 2014
**
** @brief
** @copyright
** This source code is part of the Valentine project, a pattern making
** program, whose allow create and modeling patterns of clothing.
** Copyright (C) 2013 Valentina project
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
**
** Valentina is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** Valentina is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
**
*************************************************************************/
#include "vindividualmeasurements.h"
VIndividualMeasurements::VIndividualMeasurements(VContainer *data):VDomDocument(data)
{
}

View File

@ -0,0 +1,40 @@
/************************************************************************
**
** @file vindividualmeasurements.h
** @author Roman Telezhinsky <dismine@gmail.com>
** @date 8 3, 2014
**
** @brief
** @copyright
** This source code is part of the Valentine project, a pattern making
** program, whose allow create and modeling patterns of clothing.
** Copyright (C) 2013 Valentina project
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
**
** Valentina is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** Valentina is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
**
*************************************************************************/
#ifndef VINDIVIDUALMEASUREMENTS_H
#define VINDIVIDUALMEASUREMENTS_H
#include "vdomdocument.h"
class VIndividualMeasurements:public VDomDocument
{
public:
VIndividualMeasurements(VContainer *data);
};
#endif // VINDIVIDUALMEASUREMENTS_H

View File

@ -0,0 +1,33 @@
/************************************************************************
**
** @file vstandardmeasurements.cpp
** @author Roman Telezhinsky <dismine@gmail.com>
** @date 8 3, 2014
**
** @brief
** @copyright
** This source code is part of the Valentine project, a pattern making
** program, whose allow create and modeling patterns of clothing.
** Copyright (C) 2013 Valentina project
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
**
** Valentina is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** Valentina is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
**
*************************************************************************/
#include "vstandardmeasurements.h"
VStandardMeasurements::VStandardMeasurements(VContainer *data):VDomDocument(data)
{
}

View File

@ -0,0 +1,40 @@
/************************************************************************
**
** @file vstandardmeasurements.h
** @author Roman Telezhinsky <dismine@gmail.com>
** @date 8 3, 2014
**
** @brief
** @copyright
** This source code is part of the Valentine project, a pattern making
** program, whose allow create and modeling patterns of clothing.
** Copyright (C) 2013 Valentina project
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
**
** Valentina is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** Valentina is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
**
*************************************************************************/
#ifndef VSTANDARDMEASUREMENTS_H
#define VSTANDARDMEASUREMENTS_H
#include "vdomdocument.h"
class VStandardMeasurements:public VDomDocument
{
public:
VStandardMeasurements(VContainer *data);
};
#endif // VSTANDARDMEASUREMENTS_H

View File

@ -1,9 +1,13 @@
HEADERS += \ HEADERS += \
src/xml/vtoolrecord.h \ src/xml/vtoolrecord.h \
src/xml/vdomdocument.h \ src/xml/vdomdocument.h \
src/xml/vpattern.h src/xml/vpattern.h \
src/xml/vstandardmeasurements.h \
src/xml/vindividualmeasurements.h
SOURCES += \ SOURCES += \
src/xml/vtoolrecord.cpp \ src/xml/vtoolrecord.cpp \
src/xml/vdomdocument.cpp \ src/xml/vdomdocument.cpp \
src/xml/vpattern.cpp src/xml/vpattern.cpp \
src/xml/vstandardmeasurements.cpp \
src/xml/vindividualmeasurements.cpp