merged and resolved conflicts

--HG--
branch : develop
This commit is contained in:
Sabine Schmaltz 2014-04-08 10:51:16 +02:00
commit 18914c3b5b
241 changed files with 12309 additions and 7511 deletions

View File

@ -19,9 +19,20 @@ syntax: glob
# Ignore this directory.
html/
latex/
bin/
moc/
obj/
uic/
rcc/
# Ignore file used QtCreator for user profile.
*.pro.user
# Ignore file Qt translation.
*.qm
# Ignore Mercurial .orig files
*.orig
# Ignore Makefile
Makefile

View File

@ -78,24 +78,24 @@ CONFIG(debug, debug|release){
-isystem "/usr/include/qt5/QtCore" -isystem "$${UI_DIR}" -isystem "$${MOC_DIR}" \
-isystem "$${RCC_DIR}" \
-O0 -Wall -Wextra -pedantic -Weffc++ -Woverloaded-virtual -Wctor-dtor-privacy \
-Wnon-virtual-dtor -Wold-style-cast -Wconversion -Winit-self \
-Wnon-virtual-dtor -Wold-style-cast -Wconversion -Winit-self -Wstack-protector \
-Wunreachable-code -Wcast-align -Wcast-qual -Wdisabled-optimization -Wfloat-equal \
-Wformat -Wformat=2 -Wformat-nonliteral -Wformat-security -Wformat-y2k \
-Wformat=2 -Wimport \
-Winvalid-pch -Wunsafe-loop-optimizations -Wlong-long -Wmissing-format-attribute \
-Wmissing-include-dirs -Wpacked -Wredundant-decls \
-Wswitch-default -Wswitch-enum -Wuninitialized -Wunused-parameter -Wvariadic-macros \
-Wlogical-op -Wnoexcept \
-Wmissing-include-dirs -Wpacked -Wredundant-decls -Winline \
-Wswitch-default -Wswitch-enum -Wuninitialized -Wvariadic-macros \
-Wlogical-op -Wnoexcept -Wmissing-noreturn -Wpointer-arith\
-Wstrict-null-sentinel -Wstrict-overflow=5 -Wundef -Wno-unused -gdwarf-3
}
} else {
*-g++{#Don't use additional GCC keys on Windows system.
QMAKE_CXXFLAGS += -Og -Wall -Wextra -pedantic
QMAKE_CXXFLAGS += -O0 -Wall -Wextra -pedantic
}
}
}else{
# Release
*-g++{
QMAKE_CXXFLAGS += -O1
QMAKE_CXXFLAGS += -O2
}
DEFINES += QT_NO_DEBUG_OUTPUT
@ -131,6 +131,10 @@ INSTALL_TRANSLATIONS += share/translations/valentina_ru.qm \
share/translations/valentina_he_IL.qm \
share/translations/valentina_fr.qm
INSTALL_STANDARD_MEASHUREMENTS += share/tables/standard/GOST_man_ru.vst
INSTALL_INDIVIDUAL_MEASHUREMENTS += share/tables/individual/indivindual_ru.vit
unix {
#VARIABLES
isEmpty(PREFIX) {
@ -147,10 +151,16 @@ pixmaps.path = $$DATADIR/pixmaps/
pixmaps.files += dist/$${TARGET}.png
translations.path = $$DATADIR/$${TARGET}/translations/
translations.files = $$INSTALL_TRANSLATIONS
standard.path = $$DATADIR/$${TARGET}/tables/standard/
standard.files = $$INSTALL_STANDARD_MEASHUREMENTS
individual.path = $$DATADIR/$${TARGET}/tables/individual/
individual.files = $$INSTALL_INDIVIDUAL_MEASHUREMENTS
INSTALLS += target \
desktop \
pixmaps \
translations
translations \
standard \
individual
}
!isEmpty(TRANSLATIONS): {
@ -187,3 +197,19 @@ for(DIR, INSTALL_TRANSLATIONS) {
}
copyToDestdir($$tr_path, $$shell_path($$OUT_PWD/$$DESTDIR/translations))
for(DIR, INSTALL_STANDARD_MEASHUREMENTS) {
#add these absolute paths to a variable which
#ends up as 'mkcommands = path1 path2 path3 ...'
st_path += $$PWD/$$DIR
}
copyToDestdir($$st_path, $$shell_path($$OUT_PWD/$$DESTDIR/tables/standard))
for(DIR, INSTALL_INDIVIDUAL_MEASHUREMENTS) {
#add these absolute paths to a variable which
#ends up as 'mkcommands = path1 path2 path3 ...'
ind_path += $$PWD/$$DIR
}
copyToDestdir($$ind_path, $$shell_path($$OUT_PWD/$$DESTDIR/tables/individual))

View File

@ -50,5 +50,7 @@
<file>icon/flags/he_IL.png</file>
<file>icon/flags/ru.png</file>
<file>icon/flags/uk.png</file>
<file>icon/Graduation.png</file>
<file>icon/individual.png</file>
</qresource>
</RCC>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -1,5 +1,7 @@
<RCC>
<qresource prefix="/">
<file>schema/pattern.xsd</file>
<file>schema/individual_measurements.xsd</file>
<file>schema/standard_measurements.xsd</file>
</qresource>
</RCC>

View File

@ -0,0 +1,893 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="vit">
<xs:complexType>
<xs:sequence>
<xs:element name="lang" type="xs:string"></xs:element>
<xs:element name="personal">
<xs:complexType>
<xs:sequence>
<xs:element name="family-name" type="xs:string"></xs:element>
<xs:element name="given-name" type="xs:string"></xs:element>
<xs:element name="birth-date" type="xs:date"></xs:element>
<xs:element name="sex" type="sex"></xs:element>
<xs:element name="email" type="emailAddress"></xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="body-measurements">
<xs:complexType>
<xs:sequence>
<xs:element name="unit" type="units"></xs:element>
<xs:element name="head_and_neck">
<xs:complexType>
<xs:sequence>
<xs:element name="head_girth">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="mid_neck_girth">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="neck_base_girth">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="head_and_neck_length">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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:complexType>
</xs:element>
<xs:element name="torso">
<xs:complexType>
<xs:sequence>
<xs:element name="center_front_waist_length">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="center_back_waist_length">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="shoulder_length">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="side_waist_length">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="trunk_length">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="shoulder_girth">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="upper_chest_girth">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="bust__girth">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="under_bust_girth">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="waist_girth">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="high_hip_girth">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="hip_girth">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="upper_front_chest_width">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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_chest_width">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="across_front_shoulder_width">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="across_back_shoulder_width">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="upper_back_width">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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_width">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="bustpoint_to_bustpoint">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="halter_bustpoint_to_bustpoint">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="neck_to_bustpoint">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="crotch_length">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="rise_height">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="shoulder_drop">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="shoulder_slope_degrees">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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_shoulder_slope_length">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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_shoulder_slope_length">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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_shoulder_to_waist_length">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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_shoulder_to_waist_length">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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_arc">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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:complexType>
</xs:element>
<xs:element name="arm">
<xs:complexType>
<xs:sequence>
<xs:element name="armscye_girth">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="elbow_girth">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="upper-arm_girth">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="wrist_girth">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="scye_depth">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="shoulder_and_arm_length">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="underarm_length">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="cervicale_to_wrist_length">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="shoulder_to_elbow_length">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="arm_length">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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:complexType>
</xs:element>
<xs:element name="hand">
<xs:complexType>
<xs:sequence>
<xs:element name="hand_width">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="hand_length">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="hand_girth">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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:complexType>
</xs:element>
<xs:element name="leg">
<xs:complexType>
<xs:sequence>
<xs:element name="thigh_girth">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="mid_thigh_girth">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="knee_girth">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="calf_girth">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="ankle_girth">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="knee_height">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="ankle_height">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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:complexType>
</xs:element>
<xs:element name="foot">
<xs:complexType>
<xs:sequence>
<xs:element name="foot_width">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="foot_length">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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:complexType>
</xs:element>
<xs:element name="heights">
<xs:complexType>
<xs:sequence>
<xs:element name="height">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="cervicale_height">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="cervicale_to_knee_height">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="waist_height">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="high_hip_height">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="hip_height">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="waist_to_hip_height">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="waist_to_knee_height">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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="crotch_height">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="m_number" type="shortMeasurementName" 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:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:simpleType name="emailAddress">
<xs:restriction base="xs:string">
<xs:pattern value="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="shortMeasurementName">
<xs:restriction base="xs:string">
<xs:pattern value="^([^0-9-*/^+=\s\(\)%:;!]){1,1}([^-*/^+=\s\(\)%:;!]){0,}$"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="units">
<xs:restriction base="xs:string">
<xs:enumeration value="mm"/>
<xs:enumeration value="cm"/>
<xs:enumeration value="inch"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="sex">
<xs:restriction base="xs:string">
<xs:enumeration value="male"/>
<xs:enumeration value="female"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>

View File

@ -4,19 +4,26 @@
<xs:element name="pattern">
<xs:complexType>
<xs:sequence minOccurs="1" maxOccurs="unbounded">
<xs:element name="author" type="xs:string" minOccurs="0" maxOccurs="1"></xs:element>
<xs:element name="description" type="xs:string" minOccurs="0" maxOccurs="1"></xs:element>
<xs:element name="notes" type="xs:string" minOccurs="0" maxOccurs="1"></xs:element>
<xs:element name="author" type="xs:string" minOccurs="0" maxOccurs="1"></xs:element>
<xs:element name="description" type="xs:string" minOccurs="0" maxOccurs="1"></xs:element>
<xs:element name="notes" type="xs:string" minOccurs="0" maxOccurs="1"></xs:element>
<xs:element name="measurements" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="type" type="measurementsTypes" use="required"></xs:attribute>
<xs:attribute name="path" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="unit" type="units" use="required"></xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="increments" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="increment" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="ksize" type="xs:double" use="required"></xs:attribute>
<xs:attribute name="id" type="xs:long" use="required"></xs:attribute>
<xs:attribute name="id" type="xs:unsignedInt" use="required"></xs:attribute>
<xs:attribute name="description" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="kgrowth" type="xs:double" use="required"></xs:attribute>
<xs:attribute name="name" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="name" type="shortName" use="required"></xs:attribute>
<xs:attribute name="base" type="xs:double" use="required"></xs:attribute>
</xs:complexType>
</xs:element>
@ -32,51 +39,51 @@
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="point" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="id" type="xs:long" use="required"></xs:attribute>
<xs:attribute name="id" type="xs:unsignedInt" use="required"></xs:attribute>
<xs:attribute name="x" type="xs:double"></xs:attribute>
<xs:attribute name="y" type="xs:double"></xs:attribute>
<xs:attribute name="mx" type="xs:double"></xs:attribute>
<xs:attribute name="my" type="xs:double"></xs:attribute>
<xs:attribute name="type" type="xs:string"></xs:attribute>
<xs:attribute name="name" type="xs:string"></xs:attribute>
<xs:attribute name="firstPoint" type="xs:long"></xs:attribute>
<xs:attribute name="secondPoint" type="xs:long"></xs:attribute>
<xs:attribute name="thirdPoint" type="xs:long"></xs:attribute>
<xs:attribute name="basePoint" type="xs:long"></xs:attribute>
<xs:attribute name="pShoulder" type="xs:long"></xs:attribute>
<xs:attribute name="p1Line" type="xs:long"></xs:attribute>
<xs:attribute name="p2Line" type="xs:long"></xs:attribute>
<xs:attribute name="firstPoint" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="secondPoint" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="thirdPoint" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="basePoint" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="pShoulder" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="p1Line" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="p2Line" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="length" type="xs:string"></xs:attribute>
<xs:attribute name="angle" type="xs:double"></xs:attribute>
<xs:attribute name="typeLine" type="xs:string"></xs:attribute>
<xs:attribute name="splinePath" type="xs:long"></xs:attribute>
<xs:attribute name="spline" type="xs:long"></xs:attribute>
<xs:attribute name="p1Line1" type="xs:long"></xs:attribute>
<xs:attribute name="p1Line2" type="xs:long"></xs:attribute>
<xs:attribute name="p2Line1" type="xs:long"></xs:attribute>
<xs:attribute name="p2Line2" type="xs:long"></xs:attribute>
<xs:attribute name="center" type="xs:long"></xs:attribute>
<xs:attribute name="splinePath" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="spline" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="p1Line1" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="p1Line2" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="p2Line1" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="p2Line2" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="center" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="radius" type="xs:string"></xs:attribute>
<xs:attribute name="axisP1" type="xs:long"></xs:attribute>
<xs:attribute name="axisP2" type="xs:long"></xs:attribute>
<xs:attribute name="arc" type="xs:long"></xs:attribute>
<xs:attribute name="axisP1" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="axisP2" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="arc" type="xs:unsignedInt"></xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="line" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="id" type="xs:long" use="required"></xs:attribute>
<xs:attribute name="firstPoint" type="xs:long"></xs:attribute>
<xs:attribute name="secondPoint" type="xs:long"></xs:attribute>
<xs:attribute name="id" type="xs:unsignedInt" use="required"></xs:attribute>
<xs:attribute name="firstPoint" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="secondPoint" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="typeLine" type="xs:string"></xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="arc" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="angle1" type="xs:string"></xs:attribute>
<xs:attribute name="id" type="xs:long" use="required"></xs:attribute>
<xs:attribute name="id" type="xs:unsignedInt" use="required"></xs:attribute>
<xs:attribute name="angle2" type="xs:string"></xs:attribute>
<xs:attribute name="radius" type="xs:string"></xs:attribute>
<xs:attribute name="center" type="xs:long"></xs:attribute>
<xs:attribute name="center" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="type" type="xs:string"></xs:attribute>
</xs:complexType>
</xs:element>
@ -86,21 +93,21 @@
<xs:element name="pathPoint" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="kAsm2" type="xs:string"></xs:attribute>
<xs:attribute name="pSpline" type="xs:long"></xs:attribute>
<xs:attribute name="pSpline" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="angle" type="xs:string"></xs:attribute>
<xs:attribute name="kAsm1" type="xs:string"></xs:attribute>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="id" type="xs:long" use="required"></xs:attribute>
<xs:attribute name="id" type="xs:unsignedInt" use="required"></xs:attribute>
<xs:attribute name="kCurve" type="xs:double"></xs:attribute>
<xs:attribute name="type" type="xs:string"></xs:attribute>
<xs:attribute name="kAsm1" type="xs:double"></xs:attribute>
<xs:attribute name="kAsm2" type="xs:double"></xs:attribute>
<xs:attribute name="angle1" type="xs:double"></xs:attribute>
<xs:attribute name="angle2" type="xs:double"></xs:attribute>
<xs:attribute name="point1" type="xs:long"></xs:attribute>
<xs:attribute name="point4" type="xs:long"></xs:attribute>
<xs:attribute name="point1" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="point4" type="xs:unsignedInt"></xs:attribute>
</xs:complexType>
</xs:element>
</xs:choice>
@ -113,31 +120,31 @@
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="point" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="id" type="xs:long" use="required"></xs:attribute>
<xs:attribute name="idObject" type="xs:long"></xs:attribute>
<xs:attribute name="mx" type="xs:string"></xs:attribute>
<xs:attribute name="id" type="xs:unsignedInt" use="required"></xs:attribute>
<xs:attribute name="idObject" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="mx" type="xs:double"></xs:attribute>
<xs:attribute name="typeObject" type="xs:string"></xs:attribute>
<xs:attribute name="my" type="xs:string"></xs:attribute>
<xs:attribute name="my" type="xs:double"></xs:attribute>
<xs:attribute name="type" type="xs:string"></xs:attribute>
<xs:attribute name="idTool" type="xs:long"></xs:attribute>
<xs:attribute name="idTool" type="xs:unsignedInt"></xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="arc" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="id" type="xs:long" use="required"></xs:attribute>
<xs:attribute name="idObject" type="xs:long"></xs:attribute>
<xs:attribute name="id" type="xs:unsignedInt" use="required"></xs:attribute>
<xs:attribute name="idObject" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="typeObject" type="xs:string"></xs:attribute>
<xs:attribute name="type" type="xs:string"></xs:attribute>
<xs:attribute name="idTool" type="xs:long"></xs:attribute>
<xs:attribute name="idTool" type="xs:unsignedInt"></xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="spline" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="id" type="xs:long" use="required"></xs:attribute>
<xs:attribute name="idObject" type="xs:long"></xs:attribute>
<xs:attribute name="id" type="xs:unsignedInt" use="required"></xs:attribute>
<xs:attribute name="idObject" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="typeObject" type="xs:string"></xs:attribute>
<xs:attribute name="type" type="xs:string"></xs:attribute>
<xs:attribute name="idTool" type="xs:long"></xs:attribute>
<xs:attribute name="idTool" type="xs:unsignedInt"></xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="tools" minOccurs="0" maxOccurs="unbounded">
@ -149,9 +156,9 @@
<xs:element name="node" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="nodeType" type="xs:string"></xs:attribute>
<xs:attribute name="idObject" type="xs:long"></xs:attribute>
<xs:attribute name="mx" type="xs:long"></xs:attribute>
<xs:attribute name="my" type="xs:long"></xs:attribute>
<xs:attribute name="idObject" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="mx" type="xs:double"></xs:attribute>
<xs:attribute name="my" type="xs:double"></xs:attribute>
<xs:attribute name="type" type="xs:string"></xs:attribute>
</xs:complexType>
</xs:element>
@ -159,10 +166,10 @@
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="id" type="xs:long" use="required"></xs:attribute>
<xs:attribute name="id" type="xs:unsignedInt" use="required"></xs:attribute>
<xs:attribute name="type" type="xs:string"></xs:attribute>
<xs:attribute name="indexD1" type="xs:long"></xs:attribute>
<xs:attribute name="indexD2" type="xs:long"></xs:attribute>
<xs:attribute name="indexD1" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="indexD2" type="xs:unsignedInt"></xs:attribute>
</xs:complexType>
</xs:element>
</xs:choice>
@ -178,20 +185,20 @@
<xs:element name="node" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="nodeType" type="xs:string"></xs:attribute>
<xs:attribute name="idObject" type="xs:long"></xs:attribute>
<xs:attribute name="mx" type="xs:long"></xs:attribute>
<xs:attribute name="my" type="xs:long"></xs:attribute>
<xs:attribute name="idObject" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="mx" type="xs:double"></xs:attribute>
<xs:attribute name="my" type="xs:double"></xs:attribute>
<xs:attribute name="type" type="xs:string"></xs:attribute>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="id" type="xs:long" use="required"></xs:attribute>
<xs:attribute name="supplement" type="xs:long"></xs:attribute>
<xs:attribute name="id" type="xs:unsignedInt" use="required"></xs:attribute>
<xs:attribute name="supplement" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="mx" type="xs:double"></xs:attribute>
<xs:attribute name="my" type="xs:double"></xs:attribute>
<xs:attribute name="width" type="xs:long"></xs:attribute>
<xs:attribute name="width" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="name" type="xs:string"></xs:attribute>
<xs:attribute name="closed" type="xs:long"></xs:attribute>
<xs:attribute name="closed" type="xs:unsignedInt"></xs:attribute>
</xs:complexType>
</xs:element>
</xs:sequence>
@ -204,4 +211,22 @@
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:simpleType name="shortName">
<xs:restriction base="xs:string">
<xs:pattern value="^([^0-9-*/^+=\s\(\)%:;!]){1,1}([^-*/^+=\s\(\)%:;!]){0,}$"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="units">
<xs:restriction base="xs:string">
<xs:enumeration value="mm"/>
<xs:enumeration value="cm"/>
<xs:enumeration value="inch"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="measurementsTypes">
<xs:restriction base="xs:string">
<xs:enumeration value="standard"/>
<xs:enumeration value="individual"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>

View File

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="vst">
<xs:complexType>
<xs:sequence>
<xs:element name="description" type="xs:string"></xs:element>
<xs:element name="unit" type="units"></xs:element>
<xs:element name="size">
<xs:complexType>
<xs:attribute name="base" type="xs:double"></xs:attribute>
<xs:attribute name="name" type="xs:string"></xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="height">
<xs:complexType>
<xs:attribute name="base" type="xs:double"></xs:attribute>
<xs:attribute name="name" type="xs:string"></xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="measurements">
<xs:complexType>
<xs:sequence>
<xs:element name="measurement" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="name" type="shortMeasurementName" use="required"></xs:attribute>
<xs:attribute name="gui_text" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="base" type="xs:double" use="required"></xs:attribute>
<xs:attribute name="height_increase" type="xs:double" use="required"></xs:attribute>
<xs:attribute name="size_increace" type="xs:double" use="required"></xs:attribute>
<xs:attribute name="number" type="xs:string" use="required"></xs:attribute>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:simpleType name="shortMeasurementName">
<xs:restriction base="xs:string">
<xs:pattern value="^([^0-9-*/^+=\s\(\)%:;!]){1,1}([^-*/^+=\s\(\)%:;!]){0,}$"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="units">
<xs:restriction base="xs:string">
<xs:enumeration value="mm"/>
<xs:enumeration value="cm"/>
<xs:enumeration value="inch"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>

View File

@ -0,0 +1,108 @@
<?xml version="1.0" encoding="UTF-8"?>
<vit>
<lang>ru</lang>
<personal>
<family-name/>
<given-name/>
<birth-date>1900-01-01</birth-date>
<sex>male</sex>
<email>username@example.com</email>
</personal>
<body-measurements>
<unit>mm</unit>
<head_and_neck>
<head_girth name="Огол" m_number="M1" value="0.0" gui_text="Обхват головы" description="Номер размерного признака 48"/>
<mid_neck_girth name="name" m_number="M2" value="0.0" gui_text="" description="" ignore="true"/>
<neck_base_girth name="Ош" m_number="M3" value="0.0" gui_text="Обхват шеи" description="Номер размерного признака 13"/>
<head_and_neck_length name="name" m_number="M4" value="0.0" gui_text="" description="" ignore="true"/>
</head_and_neck>
<torso>
<center_front_waist_length name="name" m_number="M5" value="0.0" gui_text="" description="" ignore="true"/>
<center_back_waist_length name="Дтс" m_number="M6" value="0.0" gui_text="Длина спины до талии с учетом выступа лопаток" description="Номер размерного признака 40"/>
<shoulder_length name="Шп" m_number="M7" value="0.0" gui_text="Длина плечевого ската" description="Номер размерного признака 31"/>
<side_waist_length name="Дб" m_number="M8" value="0.0" gui_text="Длина боковой части" description="Разница между меркой 11 и 7"/>
<trunk_length name="name" m_number="M9" value="0.0" gui_text="" description="" ignore="true"/>
<shoulder_girth name="name" m_number="M10" value="0.0" gui_text="" description="" ignore="true"/>
<upper_chest_girth name="ОгI" m_number="M11" value="0.0" gui_text="Обхват груди первый" description="Номер размерного признака 14"/>
<bust__girth name="ОгII" m_number="M12" value="0.0" gui_text="Обхват груди второй" description="Номер размерного признака 15"/>
<under_bust_girth name="ОгIII" m_number="M13" value="0.0" gui_text="Обхват груди третий" description="Номер размерного признака 16"/>
<waist_girth name="От" m_number="M14" value="0.0" gui_text="Обхват талии" description="Номер размерного признака 18"/>
<high_hip_girth name="name" m_number="M15" value="0.0" gui_text="" description="" ignore="true"/>
<hip_girth name="Об" m_number="M16" value="0.0" gui_text="Обхват бедер с учетом выступания живота" description="Номер размерного признака 19"/>
<upper_front_chest_width name="Шг1" m_number="M17" value="0.0" gui_text="Ширина груди первая" description="Номер размерного признака 45"/>
<front_chest_width name="Шг2" m_number="M18" value="0.0" gui_text="Ширина груди вторая" description="Номер размерного признака 45"/>
<across_front_shoulder_width name="dпл" m_number="M19" value="0.0" gui_text="Плечевой диаметр" description="Номер размерного признака 53"/>
<across_back_shoulder_width name="name" m_number="M20" value="0.0" gui_text="" description="" ignore="true"/>
<upper_back_width name="name" m_number="M21" value="0.0" gui_text="" description="" ignore="true"/>
<back_width name="Шс" m_number="M22" value="0.0" gui_text="Ширина спины" description="Номер размерного признака 47"/>
<bustpoint_to_bustpoint name="Цг" m_number="M23" value="0.0" gui_text="Расстояние между сосковыми точками" description="Номер размерного признака 46"/>
<halter_bustpoint_to_bustpoint name="name" m_number="M24" value="0.0" gui_text="" description="" ignore="true"/>
<neck_to_bustpoint name="Вг" m_number="M25" value="0.0" gui_text="Расстояние от точки основания шеи сбоку до сосковой точки (высота груди)" description="Номер размерного признака 35а"/>
<crotch_length name="name" m_number="M26" value="0.0" gui_text="" description="" ignore="true"/>
<rise_height name="Дпс" m_number="M27" value="0.0" gui_text="Расстояние от линии талии до подъягодичной складки" description="Номер размерного признака 104"/>
<shoulder_drop name="name" m_number="M28" value="0.0" gui_text="" description="" ignore="true"/>
<shoulder_slope_degrees name="name" m_number="M29" value="0.0" gui_text="" description="" ignore="true"/>
<front_shoulder_slope_length name="name" m_number="M30" value="0.0" gui_text="" description="" ignore="true"/>
<back_shoulder_slope_length name="name" m_number="M31" value="0.0" gui_text="" description="" ignore="true"/>
<front_shoulder_to_waist_length name="name" m_number="M32" value="0.0" gui_text="" description="" ignore="true"/>
<back_shoulder_to_waist_length name="name" m_number="M33" value="0.0" gui_text="" description="" ignore="true"/>
<front_neck_arc name="name" m_number="M34" value="0.0" gui_text="" description="" ignore="true"/>
<back_neck_arc name="name" m_number="M35" value="0.0" gui_text="" description="" ignore="true"/>
<front_upper-bust_arc name="name" m_number="M36" value="0.0" gui_text="" description="" ignore="true"/>
<back_upper-bust_arc name="name" m_number="M37" value="0.0" gui_text="" description="" ignore="true"/>
<front_waist_arc name="name" m_number="M38" value="0.0" gui_text="" description="" ignore="true"/>
<back_waist_arc name="name" m_number="M39" value="0.0" gui_text="" description="" ignore="true"/>
<front_upper-hip_arc name="name" m_number="M40" value="0.0" gui_text="" description="" ignore="true"/>
<back_upper-hip_arc name="name" m_number="M41" value="0.0" gui_text="" description="" ignore="true"/>
<front_hip_arc name="name" m_number="M42" value="0.0" gui_text="" description="" ignore="true"/>
<back_hip_arc name="name" m_number="M43" value="0.0" gui_text="" description="" ignore="true"/>
<chest_slope name="name" m_number="M44" value="0.0" gui_text="" description="" ignore="true"/>
<back_slope name="name" m_number="M45" value="0.0" gui_text="" description="" ignore="true"/>
<front_waist_slope name="name" m_number="M46" value="0.0" gui_text="" description="" ignore="true"/>
<back_waist_slope name="name" m_number="M47" value="0.0" gui_text="" description="" ignore="true"/>
<front-neck_to_upper-chest_height name="name" m_number="M48" value="0.0" gui_text="" description="" ignore="true"/>
<front-neck_to_bust_height name="name" m_number="M49" value="0.0" gui_text="" description="" ignore="true"/>
</torso>
<arm>
<armscye_girth name="name" m_number="M50" value="0.0" gui_text="" description="" ignore="true"/>
<elbow_girth name="Олк" m_number="M51" value="0.0" gui_text="Обхват локтя" description="Номер размерного признака "/>
<upper-arm_girth name="Оп" m_number="M52" value="0.0" gui_text="Обхват плеча" description="Номер размерного признака 28"/>
<wrist_girth name="Озап" m_number="M53" value="0.0" gui_text="Обхват запястья" description="Номер размерного признака 105"/>
<scye_depth name="name" m_number="M54" value="0.0" gui_text="" description="" ignore="true"/>
<shoulder_and_arm_length name="Дзап" m_number="M55" value="0.0" gui_text="Расстояние от точки основания шеи сбоку до линии обхвата запястья" description="Номер размерного признака 33"/>
<underarm_length name="name" m_number="M56" value="0.0" gui_text="" description="" ignore="true"/>
<cervicale_to_wrist_length name="name" m_number="M57" value="0.0" gui_text="" description="" ignore="true"/>
<shoulder_to_elbow_length name="Дрлок" m_number="M58" value="0.0" gui_text="Длина руки до локтя" description="Номер размерного признака 62"/>
<arm_length name="Дрзап" m_number="M59" value="0.0" gui_text="Длина руки до запястья" description="Номер размерного признака 68"/>
</arm>
<hand>
<hand_width name="name" m_number="M60" value="0.0" gui_text="" description="" ignore="true"/>
<hand_length name="name" m_number="M61" value="0.0" gui_text="" description="" ignore="true"/>
<hand_girth name="name" m_number="M62" value="0.0" gui_text="" description="" ignore="true"/>
</hand>
<leg>
<thigh_girth name="Обед" m_number="M63" value="0.0" gui_text="Обхват бедра" description="Номер размерного признака 21"/>
<mid_thigh_girth name="name" m_number="M64" value="0.0" gui_text="" description="" ignore="true"/>
<knee_girth name="Ок" m_number="M65" value="0.0" gui_text="Обхват колена" description="Номер размерного признака 22"/>
<calf_girth name="Ои" m_number="M66" value="0.0" gui_text="Обхват икры" description="Номер размерного признака 23"/>
<ankle_girth name="Ощ" m_number="M67" value="0.0" gui_text="Обхват щиколотки" description="Номер размерного признака 24"/>
<knee_height name="Вк" m_number="M68" value="0.0" gui_text="Высота коленной точки" description="Номер размерного признака 9"/>
<ankle_height name="name" m_number="M69" value="0.0" gui_text="" description="" ignore="true"/>
</leg>
<foot>
<foot_width name="name" m_number="M70" value="0.0" gui_text="" description="" ignore="true"/>
<foot_length name="name" m_number="M71" value="0.0" gui_text="" description="" ignore="true"/>
</foot>
<heights>
<height name="Р" m_number="M72" value="0.0" gui_text="Рост" description="Номер размерного признака 1"/>
<cervicale_height name="Вшт" m_number="M73" value="0.0" gui_text="Высота точки основания шеи сзади" description="Номер размерного признака 10"/>
<cervicale_to_knee_height name="name" m_number="M74" value="0.0" gui_text="" description="" ignore="true"/>
<waist_height name="Влт" m_number="M75" value="0.0" gui_text="Высота линии талии" description="Номер размерного признака 7"/>
<high_hip_height name="name" m_number="M76" value="0.0" gui_text="" description="" ignore="true"/>
<hip_height name="name" m_number="M77" value="0.0" gui_text="" description="" ignore="true"/>
<waist_to_hip_height name="name" m_number="M78" value="0.0" gui_text="" description="" ignore="true"/>
<waist_to_knee_height name="name" m_number="M79" value="0.0" gui_text="" description="" ignore="true"/>
<crotch_height name="Дн" m_number="M80" value="0.0" gui_text="Длина ноги по внутренней поверхности" description="Номер размерного признака 27"/>
</heights>
</body-measurements>
</vit>

View File

@ -0,0 +1,87 @@
<?xml version="1.0" encoding="UTF-8"?>
<vst>
<description>Типовые фигуры мужчин 1-й полнотной группы, обхват груди 100 см</description>
<unit>mm</unit>
<size base="500" name="Сг"/>
<height base="1760" name="Р"/>
<measurements>
<measurement name="Втос" gui_text="Высота точки основания шеи спереди" base="1450" size_increace="2" height_increase ="51" number="98"/>
<measurement name="Втош" gui_text="Высота точки основания шеи сбоку" base="1506" size_increace="2" height_increase ="54" number="4"/>
<measurement name="Впт" gui_text="Высота плечевой точки" base="1438" size_increace="3" height_increase ="52" number="5"/>
<measurement name="Вст" gui_text="Высота сосковой точки" base="1257" size_increace="-1" height_increase ="49" number="6"/>
<measurement name="Влт" gui_text="Высота линии талии" base="1102" size_increace="0" height_increase ="43" number="7"/>
<measurement name="Вк" gui_text="Высота коленной точки" base="503" size_increace="0" height_increase ="22" number="9"/>
<measurement name="Вшт" gui_text="Высота точки основания шеи сзади" base="1522" size_increace="2" height_increase ="54" number="10"/>
<measurement name="Взу" gui_text="Высота заднего угла подмышечной впадины" base="1328" size_increace="0" height_increase ="49" number="11"/>
<measurement name="Влоп" gui_text="Высота лопаточной точки" base="1320" size_increace="0" height_increase ="49" number="87"/>
<measurement name="Впс" gui_text="Высота подъягодичной складки" base="811" size_increace="-1" height_increase ="36" number="12"/>
<measurement name="Ош" gui_text="Обхват шеи" base="404" size_increace="8" height_increase ="2" number="13"/>
<measurement name="ОгI" gui_text="Обхват груди первый" base="1034" size_increace="36" height_increase ="4" number="14"/>
<measurement name="ОгII" gui_text="Обхват груди второй" base="1044" size_increace="38" height_increase ="2" number="15"/>
<measurement name="ОгIII" gui_text="Обхват груди третий" base="1000" size_increace="40" height_increase ="0" number="16"/>
<measurement name="От" gui_text="Обхват талии" base="780" size_increace="40" height_increase ="0" number="18"/>
<measurement name="Об" gui_text="Обхват бедер с учетом выступания живота" base="984" size_increace="30" height_increase ="10" number="19"/>
<measurement name="ОбI" gui_text="Обхват бедер без учета выступания живота" base="964" size_increace="24" height_increase ="12" number="20"/>
<measurement name="Обед" gui_text="Обхват бедра" base="566" size_increace="18" height_increase ="6" number="21"/>
<measurement name="Ок" gui_text="Обхват колена" base="386" size_increace="8" height_increase ="8" number="22"/>
<measurement name="Ои" gui_text="Обхват икры" base="380" size_increace="8" height_increase ="6" number="23"/>
<measurement name="Ощ" gui_text="Обхват щиколотки" base="234" size_increace="4" height_increase ="4" number="24"/>
<measurement name="Ос" gui_text="Обхват подъема стопы" base="350" size_increace="2" height_increase ="8" number="51"/>
<measurement name="Дсб" gui_text="Расстояние от линии талии до пола сбоку" base="1120" size_increace="0" height_increase ="44" number="25"/>
<measurement name="Дсп" gui_text="Расстояние от линии талии до пола спереди" base="1110" size_increace="0" height_increase ="43" number="26"/>
<measurement name="Дн" gui_text="Длина ноги по внутренней поверхности" base="826" size_increace="-3" height_increase ="37" number="27"/>
<measurement name="Дпс" gui_text="Расстояние от линии талии до подъягодичной складки" base="316" size_increace="4" height_increase ="7" number="104"/>
<measurement name="Дпоб" gui_text="Дуга через паховую область" base="783" size_increace="14" height_increase ="15" number="77"/>
<measurement name="Дс" gui_text="Расстояние от линии талии до плоскости сидения" base="260" size_increace="1" height_increase ="6" number="49"/>
<measurement name="Оп" gui_text="Обхват плеча" base="316" size_increace="12" height_increase ="0" number="28"/>
<measurement name="Озап" gui_text="Обхват запястья" base="180" size_increace="4" height_increase ="0" number="29"/>
<measurement name="Пкис" gui_text="Обхват кисти" base="250" size_increace="4" height_increase ="0" number="30"/>
<measurement name="Шп" gui_text="Длина плечевого ската" base="160" size_increace="1" height_increase ="4" number="31"/>
<measurement name="Длуч" gui_text="Расстояние от точки основания шеи сбоку до лучевой точки" base="500" size_increace="2" height_increase ="15" number="32"/>
<measurement name="Дзап" gui_text="Расстояние от точки основания шеи сбоку до линии обхвата запястья" base="768" size_increace="2" height_increase ="24" number="33"/>
<measurement name="ДIIIп" gui_text="Расстояние от точки основания шеи сбоку до конца третьего пальца" base="970" size_increace="2" height_increase ="29" number="90"/>
<measurement name="Впрп" gui_text="Расстояние от точки основания шеи сбоку до линии обхвата груди первого спереди" base="214" size_increace="3" height_increase ="3" number="34а"/>
<measurement name="Вг" gui_text="Расстояние от точки основания шеи сбоку до сосковой точки (высота груди)" base="262" size_increace="8" height_increase ="3" number="35а"/>
<measurement name="Дтп" gui_text="Расстояние от точки основания шеи сбоку до линии талии спереди (длани талии спереди)" base="460" size_increace="7" height_increase ="9" number="36а"/>
<measurement name="Дп" gui_text="Дуга через высшую точку плечевого сустава" base="355" size_increace="5" height_increase ="5" number="38"/>
<measurement name="Впрз" gui_text="Расстояние от точки основания шеи сзади до линии обхватов груди первого и второго с учетом выступа лопаток" base="208" size_increace="3" height_increase ="5" number="39"/>
<measurement name="Дтс" gui_text="Длина спины до талии с учетом выступа лопаток" base="438" size_increace="2" height_increase ="10" number="40"/>
<measurement name="ДтсI" gui_text="Расстояние от линии талии сзади до точки основания шеи сбоку" base="469" size_increace="2" height_increase ="10" number="43"/>
<measurement name="Двчт" gui_text="Длина дуги верхней части туловища через точку основания шеи сбоку" base="929" size_increace="9" height_increase ="19" number="44"/>
<measurement name="Шг" gui_text="Ширина груди" base="370" size_increace="14" height_increase ="4" number="45"/>
<measurement name="Цг" gui_text="Расстояние между сосковыми точками" base="224" size_increace="6" height_increase ="0" number="46"/>
<measurement name="Шс" gui_text="Ширина спины" base="416" size_increace="10" height_increase ="2" number="47"/>
<measurement name="dпзр" gui_text="Передне-задний диаметр руки" base="121" size_increace="6" height_increase ="0" number="57"/>
<measurement name="Огол" gui_text="Обхват головы" base="576" size_increace="4" height_increase ="4" number="48"/>
<!--Конец основной таблицы. Дальше идет другая таблица. Параметры взятые с нее дополняют предедущую.-->
<measurement name="Вкт" gui_text="Высота ключичной точки" base="1454" size_increace="2" height_increase ="52" number="3"/>
<measurement name="Окис" gui_text="Обхват кисти" base="263" size_increace="3" height_increase ="3" number="30"/>
<measurement name="Впрк" gui_text="Расстояние от шейной точки до уровня заднего угла подмышечной впадины спереди (высота проймы косая)" base="324" size_increace="7" height_increase ="2" number="37"/>
<measurement name="Впк" gui_text="Высота плеча косая" base="495" size_increace="5" height_increase ="7" number="41"/>
<measurement name="Сш" gui_text="Полуобхват шеи" base="202" size_increace="4" height_increase ="2" number="13"/>
<measurement name="Сш1" gui_text="Полуобхват шеи для сорочек" base="205" size_increace="5" height_increase ="0" number="13а"/>
<measurement name="СгI" gui_text="Полуобхват груди первый" base="517" size_increace="18" height_increase ="2" number="14"/>
<measurement name="СгII" gui_text="Полуобхват груди второй" base="522" size_increace="19" height_increase ="1" number="15"/>
<measurement name="СгIII" gui_text="Полуобхват груди третий" base="500" size_increace="20" height_increase ="0" number="16"/>
<measurement name="Ст" gui_text="Полуобхват талии" base="390" size_increace="20" height_increase ="0" number="18"/>
<measurement name="Сб" gui_text="Полуобхват бедер с учетом выступания живота" base="492" size_increace="15" height_increase ="5" number="19"/>
<measurement name="СбI" gui_text="Полуобхват бедер без учета выступания живота" base="482" size_increace="12" height_increase ="6" number="20"/>
<measurement name="Окс" gui_text="Обхват колена в согнутом положении ноги" base="399" size_increace="9" height_increase ="8" number="50"/>
<measurement name="dпл" gui_text="Плечевой диаметр" base="412" size_increace="5" height_increase ="8" number="53"/>
<measurement name="dш" gui_text="Поперечный диаметр шеи" base="130" size_increace="2" height_increase ="2" number="54"/>
<measurement name="Впкп" gui_text="Высота плеча косая спереди" base="453" size_increace="7" height_increase ="8" number="42"/>
<measurement name="Дтн1" gui_text="Расстояние от точки основания шеи до линии талии спереди" base="449" size_increace="6" height_increase ="8" number="61"/>
<measurement name="Дрлок" gui_text="Длина руки до локтя" base="338" size_increace="2" height_increase ="12" number="62"/>
<measurement name="Дрзап" gui_text="Длина рукава до линии обхвата запястья" base="594" size_increace="3" height_increase ="19" number="68"/>
<measurement name="dвр" gui_text="Вертикальный диаметр руки" base="128" size_increace="2" height_increase ="2" number="69"/>
<measurement name="Дшк" gui_text="Расстояние от шейной точки до колена" base="1019" size_increace="0" height_increase ="34" number="70"/>
<measurement name="Дтк" gui_text="Расстояние от линии талии до колена" base="603" size_increace="-2" height_increase ="24" number="71"/>
<measurement name="Вп" gui_text="Высота плеча" base="67" size_increace="0" height_increase ="2" number="72"/>
<measurement name="Вгол" gui_text="Высота головы" base="246" size_increace="-2" height_increase ="6" number="73"/>
<measurement name="Пкор" gui_text="Положение корпуса" base="84" size_increace="0" height_increase ="3" number="74"/>
<measurement name="Дпз" gui_text="Дуга плечевого пояса сзади" base="535" size_increace="7" height_increase ="7" number="75"/>
<measurement name="Дшош" gui_text="Расстояние от шейной точки до точки основания шеи сбоку по линии измерения обхвата шеи" base="109" size_increace="1" height_increase ="0" number="76"/>
<measurement name="Гт1" gui_text="Глубина талии первая" base="64" size_increace="-1" height_increase ="0" number="78"/>
<measurement name="ГтII" gui_text="Глубина талии вторая" base="37" size_increace="0" height_increase ="0" number="79"/>
</measurements>
</vst>

View File

@ -42,8 +42,8 @@ public:
* @brief Calculator class constructor.
* @param data pointer to a variable container.
*/
explicit Calculator(const VContainer *data):errorMsg(0), token(QString()), tok(0), token_type(0), prog(QString()),
index(0), data(data), debugFormula(QString()){}
explicit Calculator(const VContainer *data):errorMsg(nullptr), token(QString()), tok(0), token_type(0),
prog(QString()), index(0), data(data), debugFormula(QString()){}
/**
* @brief eval calculate formula.
* @param prog string of formula.

View File

@ -1,11 +1,11 @@
SOURCES += \
src/container/vincrementtablerow.cpp \
src/container/vcontainer.cpp \
src/container/calculator.cpp \
src/container/vstandardtablerow.cpp
src/container/vmeasurement.cpp \
src/container/vincrement.cpp
HEADERS += \
src/container/vincrementtablerow.h \
src/container/vcontainer.h \
src/container/calculator.h \
src/container/vstandardtablerow.h
src/container/vmeasurement.h \
src/container/vincrement.h

View File

@ -30,18 +30,16 @@
#include <QDebug>
#include <QtAlgorithms>
#include "../widgets/vapplication.h"
qint64 VContainer::_id = 0;
quint32 VContainer::_id = 0;
VContainer::VContainer()
:base(QHash<QString, qint32>()), gObjects(QHash<qint64, VGObject *>()),
standardTable(QHash<QString, VStandardTableRow>()), incrementTable(QHash<QString, VIncrementTableRow>()),
:_size(50), sizeName("Сг"), _height(176), heightName("P"), gObjects(QHash<quint32, VGObject *>()),
measurements(QHash<QString, VMeasurement>()), increments(QHash<QString, VIncrement>()),
lengthLines(QHash<QString, qreal>()), lineAngles(QHash<QString, qreal>()), lengthSplines(QHash<QString, qreal>()),
lengthArcs(QHash<QString, qreal>()), details(QHash<qint64, VDetail>())
lengthArcs(QHash<QString, qreal>()), details(QHash<quint32, VDetail>())
{
SetSize(500);
SetGrowth(1760);
CreateManTableIGroup ();
}
VContainer &VContainer::operator =(const VContainer &data)
@ -51,10 +49,10 @@ VContainer &VContainer::operator =(const VContainer &data)
}
VContainer::VContainer(const VContainer &data)
:base(QHash<QString, qint32>()), gObjects(QHash<qint64, VGObject *>()),
standardTable(QHash<QString, VStandardTableRow>()), incrementTable(QHash<QString, VIncrementTableRow>()),
:_size(50), sizeName("Сг"), _height(176), heightName("P"), gObjects(QHash<quint32, VGObject *>()),
measurements(QHash<QString, VMeasurement>()), increments(QHash<QString, VIncrement>()),
lengthLines(QHash<QString, qreal>()), lineAngles(QHash<QString, qreal>()), lengthSplines(QHash<QString, qreal>()),
lengthArcs(QHash<QString, qreal>()), details(QHash<qint64, VDetail>())
lengthArcs(QHash<QString, qreal>()), details(QHash<quint32, VDetail>())
{
setData(data);
}
@ -67,44 +65,40 @@ VContainer::~VContainer()
void VContainer::setData(const VContainer &data)
{
base = *data.DataBase();
_size = data.size();
sizeName = data.SizeName();
_height = data.height();
heightName = data.HeightName();
qDeleteAll(gObjects);
gObjects.clear();
const QHash<qint64, VGObject*> *obj = data.DataGObjects();
const QHash<quint32, VGObject*> *obj = data.DataGObjects();
Q_CHECK_PTR(obj);
QHashIterator<qint64, VGObject*> i(*obj);
QHashIterator<quint32, VGObject*> i(*obj);
while (i.hasNext())
{
i.next();
switch (i.value()->getType())
{
case (GObject::Arc):
{
CopyGObject<VArc>(data, i.key());
break;
}
case (GObject::Point):
{
CopyGObject<VPointF>(data, i.key());
break;
}
case (GObject::Spline):
{
CopyGObject<VSpline>(data, i.key());
break;
}
case (GObject::SplinePath):
{
CopyGObject<VSplinePath>(data, i.key());
break;
}
default:
qWarning()<<"Don't know how copy this type.";
qDebug()<<"Don't know how copy this type.";
break;
}
}
standardTable = *data.DataStandardTable();
incrementTable = *data.DataIncrementTable();
measurements = *data.DataMeasurements();
increments = *data.DataIncrements();
lengthLines = *data.DataLengthLines();
lineAngles = *data.DataLineAngles();
lengthSplines = *data.DataLengthSplines();
@ -112,7 +106,7 @@ void VContainer::setData(const VContainer &data)
details = *data.DataDetails();
}
const VGObject *VContainer::GetGObject(qint64 id)const
const VGObject *VContainer::GetGObject(quint32 id)const
{
return GetObject(gObjects, id);
}
@ -143,16 +137,16 @@ val VContainer::GetVariable(const QHash<key, val> &obj, key id) const
}
}
const VStandardTableRow VContainer::GetStandardTableCell(const QString &name) const
const VMeasurement VContainer::GetMeasurement(const QString &name) const
{
Q_ASSERT(name.isEmpty()==false);
return GetVariable(standardTable, name);
return GetVariable(measurements, name);
}
const VIncrementTableRow VContainer::GetIncrementTableRow(const QString& name) const
const VIncrement VContainer::GetIncrement(const QString& name) const
{
Q_ASSERT(name.isEmpty()==false);
return GetVariable(incrementTable, name);
return GetVariable(increments, name);
}
qreal VContainer::GetLine(const QString &name) const
@ -179,35 +173,35 @@ qreal VContainer::GetLineAngle(const QString &name) const
return GetVariable(lineAngles, name);
}
const VDetail VContainer::GetDetail(qint64 id) const
const VDetail VContainer::GetDetail(quint32 id) const
{
return GetVariable(details, id);
}
qint64 VContainer::AddGObject(VGObject *obj)
quint32 VContainer::AddGObject(VGObject *obj)
{
return AddObject(gObjects, obj);
}
qint64 VContainer::AddDetail(VDetail detail)
quint32 VContainer::AddDetail(VDetail detail)
{
qint64 id = getNextId();
quint32 id = getNextId();
details[id] = detail;
return id;
}
void VContainer::AddIncrementTableRow(const QString &name, VIncrementTableRow row)
void VContainer::AddIncrement(const QString &name, VIncrement incr)
{
incrementTable[name] = row;
increments[name] = incr;
}
qint64 VContainer::getNextId()
quint32 VContainer::getNextId()
{
_id++;
return _id;
}
void VContainer::UpdateId(qint64 newId)
void VContainer::UpdateId(quint32 newId)
{
if (newId > _id)
{
@ -216,7 +210,7 @@ void VContainer::UpdateId(qint64 newId)
}
template <typename val>
void VContainer::UpdateObject(QHash<qint64, val> &obj, const qint64 &id, val point)
void VContainer::UpdateObject(QHash<quint32, val> &obj, const quint32 &id, val point)
{
Q_ASSERT_X(id > 0, Q_FUNC_INFO, "id <= 0");
Q_CHECK_PTR(point);
@ -236,10 +230,10 @@ void VContainer::AddLengthSpline(const QString &name, const qreal &value)
lengthSplines[name] = value;
}
void VContainer::AddLengthArc(const qint64 &id)
void VContainer::AddLengthArc(const quint32 &id)
{
const VArc * arc = GeometricObject<const VArc *>(id);
lengthArcs[arc->name()] = toMM(arc->GetLength());
lengthArcs[arc->name()] = qApp->fromPixel(arc->GetLength());
}
void VContainer::AddLineAngle(const QString &name, const qreal &value)
@ -248,33 +242,42 @@ void VContainer::AddLineAngle(const QString &name, const qreal &value)
lineAngles[name] = value;
}
qreal VContainer::GetValueStandardTableCell(const QString& name) const
qreal VContainer::GetValueStandardTableRow(const QString& name) const
{
VStandardTableRow cell = GetStandardTableCell(name);
qreal k_size = ( static_cast<qreal> (size()/10.0) - 50.0 ) / 2.0;
qreal k_growth = ( static_cast<qreal> (growth()/10.0) - 176.0 ) / 6.0;
qreal value = cell.GetBase() + k_size*cell.GetKsize() + k_growth*cell.GetKgrowth();
return value;
const VMeasurement m = GetMeasurement(name);
if (qApp->patternType() == Pattern::Individual)
{
return m.GetValue();
}
else
{
return m.GetValue(size(), height());
}
}
qreal VContainer::GetValueIncrementTableRow(const QString& name) const
{
VIncrementTableRow cell = GetIncrementTableRow(name);
qreal k_size = ( static_cast<qreal> (size()/10.0) - 50.0 ) / 2.0;
qreal k_growth = ( static_cast<qreal> (growth()/10.0) - 176.0 ) / 6.0;
qreal value = cell.getBase() + k_size*cell.getKsize() + k_growth*cell.getKgrowth();
return value;
const VIncrement icr = GetIncrement(name);
if (qApp->patternType() == Pattern::Individual)
{
return icr.GetValue();
}
else
{
return icr.GetValue(size(), height());
}
}
void VContainer::Clear()
{
_id = 0;
standardTable.clear();
incrementTable.clear();
measurements.clear();
increments.clear();
lengthLines.clear();
lengthArcs.clear();
lineAngles.clear();
details.clear();
lengthSplines.clear();
ClearGObjects();
}
@ -291,11 +294,11 @@ void VContainer::ClearCalculationGObjects()
{
if (gObjects.size()>0)
{
QHashIterator<qint64, VGObject*> i(gObjects);
QHashIterator<quint32, VGObject*> i(gObjects);
while (i.hasNext())
{
i.next();
if (i.value()->getMode() == Draw::Calculation)
if (i.value()->getMode() == Valentina::Calculation)
{
delete i.value();
gObjects.remove(i.key());
@ -306,18 +309,22 @@ void VContainer::ClearCalculationGObjects()
qreal VContainer::FindVar(const QString &name, bool *ok)const
{
if (base.contains(name))
if (sizeName == name)
{
*ok = true;
return base.value(name);
return _size;
}
if (standardTable.contains(name))
if (heightName == name)
{
*ok = true;
return GetValueStandardTableCell(name);
return _height;
}
if (incrementTable.contains(name))
if (measurements.contains(name))
{
*ok = true;
return GetValueStandardTableRow(name);
}
if (increments.contains(name))
{
*ok = true;
return GetValueIncrementTableRow(name);
@ -346,27 +353,27 @@ qreal VContainer::FindVar(const QString &name, bool *ok)const
return 0;
}
void VContainer::AddLine(const qint64 &firstPointId, const qint64 &secondPointId)
void VContainer::AddLine(const quint32 &firstPointId, const quint32 &secondPointId)
{
QString nameLine = GetNameLine(firstPointId, secondPointId);
const VPointF *first = GeometricObject<const VPointF *>(firstPointId);
const VPointF *second = GeometricObject<const VPointF *>(secondPointId);
AddLengthLine(nameLine, toMM(QLineF(first->toQPointF(), second->toQPointF()).length()));
AddLengthLine(nameLine, qApp->fromPixel(QLineF(first->toQPointF(), second->toQPointF()).length()));
nameLine = GetNameLineAngle(firstPointId, secondPointId);
AddLineAngle(nameLine, QLineF(first->toQPointF(), second->toQPointF()).angle());
}
template <typename key, typename val>
qint64 VContainer::AddObject(QHash<key, val> &obj, val value)
quint32 VContainer::AddObject(QHash<key, val> &obj, val value)
{
Q_CHECK_PTR(value);
qint64 id = getNextId();
quint32 id = getNextId();
value->setId(id);
obj[id] = value;
return id;
}
QString VContainer::GetNameLine(const qint64 &firstPoint, const qint64 &secondPoint) const
QString VContainer::GetNameLine(const quint32 &firstPoint, const quint32 &secondPoint) const
{
const VPointF *first = GeometricObject<const VPointF *>(firstPoint);
const VPointF *second = GeometricObject<const VPointF *>(secondPoint);
@ -374,7 +381,7 @@ QString VContainer::GetNameLine(const qint64 &firstPoint, const qint64 &secondPo
return QString("Line_%1_%2").arg(first->name(), second->name());
}
QString VContainer::GetNameLineAngle(const qint64 &firstPoint, const qint64 &secondPoint) const
QString VContainer::GetNameLineAngle(const quint32 &firstPoint, const quint32 &secondPoint) const
{
const VPointF *first = GeometricObject<const VPointF *>(firstPoint);
const VPointF *second = GeometricObject<const VPointF *>(secondPoint);
@ -382,12 +389,12 @@ QString VContainer::GetNameLineAngle(const qint64 &firstPoint, const qint64 &sec
return QString("AngleLine_%1_%2").arg(first->name(), second->name());
}
void VContainer::UpdateGObject(qint64 id, VGObject* obj)
void VContainer::UpdateGObject(quint32 id, VGObject* obj)
{
UpdateObject(gObjects, id, obj);
}
void VContainer::UpdateDetail(qint64 id, const VDetail &detail)
void VContainer::UpdateDetail(quint32 id, const VDetail &detail)
{
Q_ASSERT_X(id > 0, Q_FUNC_INFO, "id <= 0");
details[id] = detail;
@ -399,65 +406,3 @@ void VContainer::AddLengthLine(const QString &name, const qreal &value)
Q_ASSERT(name.isEmpty() == false);
lengthLines[name] = value;
}
void VContainer::CreateManTableIGroup ()
{
AddStandardTableCell("Pkor", VStandardTableRow(84, 0, 3));
AddStandardTableCell("Vtos", VStandardTableRow(1450, 2, 51));
AddStandardTableCell("Vtosh", VStandardTableRow(1506, 2, 54));
AddStandardTableCell("Vpt", VStandardTableRow(1438, 3, 52));
AddStandardTableCell("Vst", VStandardTableRow(1257, -1, 49));
AddStandardTableCell("Vlt", VStandardTableRow(1102, 0, 43));
AddStandardTableCell("Vk", VStandardTableRow(503, 0, 22));
AddStandardTableCell("Vsht", VStandardTableRow(1522, 2, 54));
AddStandardTableCell("Vzy", VStandardTableRow(1328, 0, 49));
AddStandardTableCell("Vlop", VStandardTableRow(1320, 0, 49));
AddStandardTableCell("Vps", VStandardTableRow(811, -1, 36));
AddStandardTableCell("Ssh", VStandardTableRow(202, 4, 1));
AddStandardTableCell("SgI", VStandardTableRow(517, 18, 2));
AddStandardTableCell("SgII", VStandardTableRow(522, 19, 1));
AddStandardTableCell("SgIII", VStandardTableRow(500, 20, 0));
AddStandardTableCell("SbI", VStandardTableRow(482, 12, 6));
AddStandardTableCell("Obed", VStandardTableRow(566, 18, 6));
AddStandardTableCell("Ok", VStandardTableRow(386, 8, 8));
AddStandardTableCell("Oi", VStandardTableRow(380, 8, 6));
AddStandardTableCell("Osch", VStandardTableRow(234, 4, 4));
AddStandardTableCell("Dsb", VStandardTableRow(1120, 0, 44));
AddStandardTableCell("Dsp", VStandardTableRow(1110, 0, 43));
AddStandardTableCell("Dn", VStandardTableRow(826, -3, 37));
AddStandardTableCell("Dps", VStandardTableRow(316, 4, 7));
AddStandardTableCell("Dpob", VStandardTableRow(783, 14, 15));
AddStandardTableCell("Ds", VStandardTableRow(260, 1, 6));
AddStandardTableCell("Op", VStandardTableRow(316, 12, 0));
AddStandardTableCell("Ozap", VStandardTableRow(180, 4, 0));
AddStandardTableCell("Pkis", VStandardTableRow(250, 4, 0));
AddStandardTableCell("SHp", VStandardTableRow(160, 1, 4));
AddStandardTableCell("Dlych", VStandardTableRow(500, 2, 15));
AddStandardTableCell("Dzap", VStandardTableRow(768, 2, 24));
AddStandardTableCell("DIIIp", VStandardTableRow(970, 2, 29));
AddStandardTableCell("Vprp", VStandardTableRow(214, 3, 3));
AddStandardTableCell("Vg", VStandardTableRow(262, 8, 3));
AddStandardTableCell("Dtp", VStandardTableRow(460, 7, 9));
AddStandardTableCell("Dp", VStandardTableRow(355, 5, 5));
AddStandardTableCell("Vprz", VStandardTableRow(208, 3, 5));
AddStandardTableCell("Dts", VStandardTableRow(438, 2, 10));
AddStandardTableCell("DtsI", VStandardTableRow(469, 2, 10));
AddStandardTableCell("Dvcht", VStandardTableRow(929, 9, 19));
AddStandardTableCell("SHg", VStandardTableRow(370, 14, 4));
AddStandardTableCell("Cg", VStandardTableRow(224, 6, 0));
AddStandardTableCell("SHs", VStandardTableRow(416, 10, 2));
AddStandardTableCell("dpzr", VStandardTableRow(121, 6, 0));
AddStandardTableCell("Ogol", VStandardTableRow(576, 4, 4));
AddStandardTableCell("Ssh1", VStandardTableRow(205, 5, 0));
//TODO Posible duplicate. Need check.
//AddStandardTableCell("St", VStandardTableRow(410, 20, 0));
AddStandardTableCell("St", VStandardTableRow(390, 20, 0));
AddStandardTableCell("Drzap", VStandardTableRow(594, 3, 19));
AddStandardTableCell("DbII", VStandardTableRow(1020, 0, 44));
//TODO Posible duplicate. Need check.
//AddStandardTableCell("Sb", VStandardTableRow(504, 15, 4));
AddStandardTableCell("Sb", VStandardTableRow(492, 15, 5));
}

View File

@ -29,8 +29,8 @@
#ifndef VCONTAINER_H
#define VCONTAINER_H
#include "vstandardtablerow.h"
#include "vincrementtablerow.h"
#include "vmeasurement.h"
#include "vincrement.h"
#include "../geometry/varc.h"
#include "../geometry/vsplinepath.h"
#include "../geometry/vdetail.h"
@ -62,10 +62,9 @@ public:
VContainer(const VContainer &data);
~VContainer();
template <typename T>
void CopyGObject(const VContainer &data, const qint64 &id)
void CopyGObject(const VContainer &data, const quint32 &id)
{
T *obj = new T(*data.GeometricObject<const T *>(id));
Q_CHECK_PTR(obj);
UpdateGObject(id, obj);
}
/**
@ -74,9 +73,9 @@ public:
*/
void setData(const VContainer &data);
template <typename T>
const T GeometricObject(qint64 id) const
const T GeometricObject(const quint32 &id) const
{
VGObject *gObj = 0;
VGObject *gObj = nullptr;
if (gObjects.contains(id))
{
gObj = gObjects.value(id);
@ -84,10 +83,21 @@ public:
else
{
throw VExceptionBadId(tr("Can't find object"), id);
return nullptr;
}
T obj = dynamic_cast<T>(gObj);
Q_CHECK_PTR(obj);
return obj;
try
{
T obj = dynamic_cast<T>(gObj);
Q_CHECK_PTR(obj);
return obj;
}
catch (const std::bad_alloc &)
{
throw VExceptionBadId(tr("Can't cast object"), id);
return nullptr;
}
return nullptr;
}
/**
@ -95,19 +105,19 @@ public:
* @param id id of point
* @return point
*/
const VGObject *GetGObject(qint64 id) const;
const VGObject *GetGObject(quint32 id) const;
/**
* @brief GetStandardTableCell return standard table row by name
* @param name name of standard table row
* @return row of standard table
* @brief GetMeasurement return measurement by name
* @param name short measurement name
* @return measurement
*/
const VStandardTableRow GetStandardTableCell(const QString& name) const;
const VMeasurement GetMeasurement(const QString& name) const;
/**
* @brief GetIncrementTableRow return increment table row by name
* @brief GetIncrement return increment table row by name
* @param name name of increment table row
* @return row of increment table
* @return increment
*/
const VIncrementTableRow GetIncrementTableRow(const QString& name) const;
const VIncrement GetIncrement(const QString& name) const;
/**
* @brief GetLine return length of line by name
* @param name name of line
@ -137,37 +147,36 @@ public:
* @param id id of detail
* @return detail
*/
const VDetail GetDetail(qint64 id) const;
const VDetail GetDetail(quint32 id) const;
/**
* @brief getId return current id
* @return current id
*/
static qint64 getId() {return _id;}
static quint32 getId() {return _id;}
/**
* @brief AddPoint add new point to container
* @param point new point
* @return return id of new point in container
*/
qint64 AddGObject(VGObject *obj);
quint32 AddGObject(VGObject *obj);
/**
* @brief AddDetail add new detail to container
* @param detail new detail
* @return return id of new detail in container
*/
qint64 AddDetail(VDetail detail);
quint32 AddDetail(VDetail detail);
/**
* @brief AddStandardTableCell add new row of standard table
* @param name name of row of standard table
* @param cell row of standard table
* @brief AddMeasurement add new measurement
* @param name short measurement name
* @param row measurement
*/
inline void AddStandardTableCell(const QString& name, const VStandardTableRow &cell)
{standardTable[name] = cell;}
void AddMeasurement(const QString& name, const VMeasurement &m);
/**
* @brief AddIncrementTableRow add new row of increment table
* @brief AddIncrement add new row of increment table
* @param name name of new row of increment table
* @param row new row of increment table
*/
void AddIncrementTableRow(const QString& name, VIncrementTableRow row);
void AddIncrement(const QString& name, VIncrement incr);
/**
* @brief AddLengthLine add length of line to container
* @param name name of line
@ -184,7 +193,7 @@ public:
* @brief AddLengthArc add length of arc to container
* @param id id of arc
*/
void AddLengthArc(const qint64 &id);
void AddLengthArc(const quint32 &id);
/**
* @brief AddLineAngle add angle of line to container
* @param name name of line angle
@ -197,7 +206,7 @@ public:
* @param secondPointId id of second point of line
* @param mode mode of line
*/
void AddLine(const qint64 &firstPointId, const qint64 &secondPointId);
void AddLine(const quint32 &firstPointId, const quint32 &secondPointId);
/**
* @brief GetNameLine return name of line
* @param firstPoint id of first point of line
@ -205,7 +214,7 @@ public:
* @return name of line
*/
// cppcheck-suppress functionStatic
QString GetNameLine(const qint64 &firstPoint, const qint64 &secondPoint) const;
QString GetNameLine(const quint32 &firstPoint, const quint32 &secondPoint) const;
/**
* @brief GetNameLineAngle return name of line angle
* @param firstPoint id of first point of line
@ -213,39 +222,37 @@ public:
* @return name of angle of line
*/
// cppcheck-suppress functionStatic
QString GetNameLineAngle(const qint64 &firstPoint, const qint64 &secondPoint) const;
QString GetNameLineAngle(const quint32 &firstPoint, const quint32 &secondPoint) const;
/**
* @brief UpdatePoint update point by id
* @param id id of existing point
* @param point point
*/
void UpdateGObject(qint64 id, VGObject* obj);
void UpdateGObject(quint32 id, VGObject* obj);
/**
* @brief UpdateDetail update detail by id
* @param id id of existing detail
* @param detail detail
*/
void UpdateDetail(qint64 id, const VDetail &detail);
void UpdateDetail(quint32 id, const VDetail &detail);
/**
* @brief UpdateStandardTableCell update standard table row by name
* @param name name of row
* @param cell row of standard table
* @brief UpdateMeasurement update measurement by name
* @param name short measurement name
* @param m measurement
*/
inline void UpdateStandardTableCell(const QString& name, VStandardTableRow cell)
{standardTable[name] = cell;}
void UpdateMeasurement(const QString& name, VMeasurement m);
/**
* @brief UpdateIncrementTableRow update increment table row by name
* @brief UpdateIncrement update increment table row by name
* @param name name of row
* @param row row
*/
inline void UpdateIncrementTableRow(const QString& name, VIncrementTableRow row)
{incrementTable[name] = row;}
void UpdateIncrement(const QString& name, VIncrement incr);
/**
* @brief GetValueStandardTableCell return value of standard table row by name
* @param name name of row
* @return value in mm
* @brief GetValueStandardTableRow return value of measurement by name
* @param name name of measurement
* @return value in measurement units
*/
qreal GetValueStandardTableCell(const QString& name) const;
qreal GetValueStandardTableRow(const QString& name) const;
/**
* @brief GetValueIncrementTableRow return value of increment table row by name
* @param name name of row
@ -264,44 +271,49 @@ public:
/**
* @brief ClearIncrementTable clear increment table
*/
inline void ClearIncrementTable() {incrementTable.clear();}
void ClearIncrementTable();
void ClearMeasurements();
/**
* @brief ClearLengthLines clear length lines
*/
inline void ClearLengthLines() {lengthLines.clear();}
void ClearLengthLines();
/**
* @brief ClearLengthSplines clear length splines
*/
inline void ClearLengthSplines() {lengthSplines.clear();}
void ClearLengthSplines();
/**
* @brief ClearLengthArcs clear length arcs
*/
inline void ClearLengthArcs() {lengthArcs.clear();}
void ClearLengthArcs();
/**
* @brief ClearLineAngles clear angles of lines
*/
inline void ClearLineAngles() {lineAngles.clear();}
inline void ClearDetails() {details.clear();}
void ClearLineAngles();
void ClearDetails();
/**
* @brief SetSize set value of size
* @param size value of size in mm
* @param size value of size
*/
inline void SetSize(qint32 size) {base["Сг"] = size;}
void SetSize(qreal size);
void SetSizeName(const QString &name);
/**
* @brief SetGrowth set value of growth
* @param growth value of growth in mm
* @param growth value of growth
*/
inline void SetGrowth(qint32 growth) {base["Р"] = growth;}
void SetHeight(qreal height);
void SetHeightName(const QString &name);
/**
* @brief size return size
* @return size in mm
*/
inline qint32 size() const {return base.value("Сг");}
qreal size() const;
QString SizeName()const;
/**
* @brief growth return growth
* @return growth in mm
* @brief height return height
* @return height in pattern units
*/
inline qint32 growth() const {return base.value("Р");}
qreal height() const;
QString HeightName()const;
/**
* @brief FindVar return value of variable by name
* @param name name of variable
@ -314,92 +326,83 @@ public:
* @param name name of row
* @return true if contains
*/
inline bool IncrementTableContains(const QString& name) {return incrementTable.contains(name);}
bool IncrementTableContains(const QString& name);
/**
* @brief getNextId generate next unique id
* @return next unique id
*/
static qint64 getNextId();
static quint32 getNextId();
/**
* @brief RemoveIncrementTableRow remove row by name from increment table
* @param name name of existing row
*/
inline void RemoveIncrementTableRow(const QString& name) {incrementTable.remove(name);}
void RemoveIncrementTableRow(const QString& name);
/**
* @brief data container with datagObjects return container of gObjects
* @return pointer on container of gObjects
*/
inline const QHash<qint64, VGObject*> *DataGObjects() const {return &gObjects;}
const QHash<quint32, VGObject*> *DataGObjects() const;
/**
* @brief data container with dataBase return container of data
* @return pointer on container of base data
* @brief DataMeasurements container with measurements.
* @return pointer to measurements.
*/
inline const QHash<QString, qint32> *DataBase() const {return &base;}
const QHash<QString, VMeasurement> *DataMeasurements() const;
/**
* @brief data container with dataStandardTable return container of standard table
* @return pointer on container of standard table
*/
inline const QHash<QString, VStandardTableRow> *DataStandardTable() const {return &standardTable;}
/**
* @brief data container with dataIncrementTable return container of increment table
* @brief data container with dataIncrements return container of increment table
* @return pointer on container of increment table
*/
inline const QHash<QString, VIncrementTableRow> *DataIncrementTable() const {return &incrementTable;}
const QHash<QString, VIncrement> *DataIncrements() const;
/**
* @brief data container with dataLengthLines return container of lines lengths
* @return pointer on container of lines lengths
*/
inline const QHash<QString, qreal> *DataLengthLines() const {return &lengthLines;}
const QHash<QString, qreal> *DataLengthLines() const;
/**
* @brief data container with dataLengthSplines return container of splines lengths
* @return pointer on container of splines lengths
*/
inline const QHash<QString, qreal> *DataLengthSplines() const {return &lengthSplines;}
const QHash<QString, qreal> *DataLengthSplines() const;
/**
* @brief data container with dataLengthArcs return container of arcs length
* @return pointer on container of arcs length
*/
inline const QHash<QString, qreal> *DataLengthArcs() const {return &lengthArcs;}
const QHash<QString, qreal> *DataLengthArcs() const;
/**
* @brief data container with dataLineAngles return container of angles of line
* @return pointer on container of angles of line
*/
inline const QHash<QString, qreal> *DataLineAngles() const {return &lineAngles;}
const QHash<QString, qreal> *DataLineAngles() const;
/**
* @brief data container with dataDetails return container of details
* @return pointer on container of details
*/
inline const QHash<qint64, VDetail> *DataDetails() const {return &details;}
const QHash<quint32, VDetail> *DataDetails() const;
/**
* @brief UpdateId update id. If new id bigger when current save new like current.
* @param newId id
*/
static void UpdateId(qint64 newId);
/**
* @brief CreateManTableIGroup generate man standard table of measurements
*/
void CreateManTableIGroup ();
static void UpdateId(quint32 newId);
private:
/**
* @brief _id current id. New object will have value +1. For empty class equal 0.
*/
static qint64 _id;
/**
* @brief base container of base data (size and growth)
*/
QHash<QString, qint32> base;
static quint32 _id;
qreal _size;
QString sizeName;
qreal _height;
QString heightName;
/**
* @brief gObjects graphicals objects of pattern.
*/
QHash<qint64, VGObject*> gObjects;
QHash<quint32, VGObject*> gObjects;
/**
* @brief standardTable container of standard table rows
* @brief measurements container of measurements.
*/
QHash<QString, VStandardTableRow> standardTable;
QHash<QString, VMeasurement> measurements;
/**
* @brief incrementTable
* @brief increments
*/
QHash<QString, VIncrementTableRow> incrementTable;
QHash<QString, VIncrement> increments;
/**
* @brief lengthLines container of lines lengths
*/
@ -419,7 +422,7 @@ private:
/**
* @brief details container of details
*/
QHash<qint64, VDetail> details;
QHash<quint32, VDetail> details;
template <typename key, typename val>
/**
* @brief GetObject return object from container
@ -445,7 +448,7 @@ private:
* @param id id of existing object
* @param point object
*/
void UpdateObject(QHash<qint64, val > &obj, const qint64 &id, val point);
void UpdateObject(QHash<quint32, val > &obj, const quint32 &id, val point);
template <typename key, typename val>
/**
* @brief AddObject add object to container
@ -453,7 +456,147 @@ private:
* @param value object
* @return id of object in container
*/
static qint64 AddObject(QHash<key, val> &obj, val value);
static quint32 AddObject(QHash<key, val> &obj, val value);
};
inline void VContainer::AddMeasurement(const QString &name, const VMeasurement &m)
{
measurements[name] = m;
}
inline void VContainer::UpdateMeasurement(const QString &name, VMeasurement m)
{
measurements[name] = m;
}
inline void VContainer::UpdateIncrement(const QString &name, VIncrement incr)
{
increments[name] = incr;
}
inline void VContainer::ClearIncrementTable()
{
increments.clear();
}
inline void VContainer::ClearMeasurements()
{
measurements.clear();
}
inline void VContainer::ClearLengthLines()
{
lengthLines.clear();
}
inline void VContainer::ClearLengthSplines()
{
lengthSplines.clear();
}
inline void VContainer::ClearLengthArcs()
{
lengthArcs.clear();
}
inline void VContainer::ClearLineAngles()
{
lineAngles.clear();
}
inline void VContainer::ClearDetails()
{
details.clear();
}
inline void VContainer::SetSize(qreal size)
{
_size = size;
}
inline void VContainer::SetSizeName(const QString &name)
{
sizeName = name;
}
inline void VContainer::SetHeight(qreal height)
{
_height = height;
}
inline void VContainer::SetHeightName(const QString &name)
{
heightName = name;
}
inline qreal VContainer::size() const
{
return _size;
}
inline QString VContainer::SizeName() const
{
return sizeName;
}
inline qreal VContainer::height() const
{
return _height;
}
inline QString VContainer::HeightName() const
{
return heightName;
}
inline bool VContainer::IncrementTableContains(const QString &name)
{
return increments.contains(name);
}
inline void VContainer::RemoveIncrementTableRow(const QString &name)
{
increments.remove(name);
}
inline const QHash<quint32, VGObject *> *VContainer::DataGObjects() const
{
return &gObjects;
}
inline const QHash<QString, VMeasurement> *VContainer::DataMeasurements() const
{
return &measurements;
}
inline const QHash<QString, VIncrement> *VContainer::DataIncrements() const
{
return &increments;
}
inline const QHash<QString, qreal> *VContainer::DataLengthLines() const
{
return &lengthLines;
}
inline const QHash<QString, qreal> *VContainer::DataLengthSplines() const
{
return &lengthSplines;
}
inline const QHash<QString, qreal> *VContainer::DataLengthArcs() const
{
return &lengthArcs;
}
inline const QHash<QString, qreal> *VContainer::DataLineAngles() const
{
return &lineAngles;
}
inline const QHash<quint32, VDetail> *VContainer::DataDetails() const
{
return &details;
}
#endif // VCONTAINER_H

View File

@ -26,10 +26,22 @@
**
*************************************************************************/
#include "vincrementtablerow.h"
#include "vincrement.h"
VIncrementTableRow::VIncrementTableRow()
:id(0), base(0), ksize(0), kgrowth(0), description(QString()){}
VIncrement::VIncrement()
:id(0), base(0), ksize(50.0), kheight(176.0), description(QString()){}
VIncrementTableRow::VIncrementTableRow(qint64 id, qreal base, qreal ksize, qreal kgrowth, QString description)
:id(id), base(base), ksize(ksize), kgrowth(kgrowth), description(description){}
VIncrement::VIncrement(quint32 id, qreal base, qreal ksize, qreal kheight, QString description)
:id(id), base(base), ksize(ksize), kheight(kheight), description(description){}
qreal VIncrement::GetValue() const
{
return base;
}
qreal VIncrement::GetValue(const qreal &size, const qreal &height) const
{
const qreal k_size = ( size - 50.0 ) / 2.0;
const qreal k_height = ( height - 176.0 ) / 6.0;
return base + k_size * ksize + k_height * kheight;
}

View File

@ -32,15 +32,15 @@
#include <QString>
/**
* @brief The VIncrementTableRow class keep data row of increment table
* @brief The VIncrement class keep data row of increment table
*/
class VIncrementTableRow
class VIncrement
{
public:
/**
* @brief VIncrementTableRow create enpty row
*/
VIncrementTableRow();
VIncrement();
/**
* @brief VIncrementTableRow create row
* @param id id
@ -49,63 +49,64 @@ public:
* @param kgrowth increment in growths
* @param description description of increment
*/
VIncrementTableRow(qint64 id, qreal base, qreal ksize, qreal kgrowth,
QString description = QString());
VIncrement(quint32 id, qreal base, qreal ksize, qreal kheight, QString description = QString());
/**
* @brief getId return id of row
* @return id
*/
inline qint64 getId() const {return id;}
quint32 getId() const;
/**
* @brief setId set id of row
* @param value id
*/
inline void setId(const qint64 &value) {id = value;}
void setId(const quint32 &value);
/**
* @brief getBase return value in base size and growth
* @return value
*/
inline qreal getBase() const {return base;}
qreal getBase() const;
/**
* @brief setBase set value in base size and growth
* @param value base value
*/
inline void setBase(const qreal &value) {base = value;}
void setBase(const qreal &value);
/**
* @brief getKsize return increment in sizes
* @return increment
*/
inline qreal getKsize() const {return ksize;}
qreal getKsize() const;
/**
* @brief setKsize set increment in sizes
* @param value value of increment
*/
inline void setKsize(const qreal &value) {ksize = value;}
void setKsize(const qreal &value);
/**
* @brief getKgrowth return increment in growths
* @brief getKheight return increment in growths
* @return increment
*/
inline qreal getKgrowth() const {return kgrowth;}
qreal getKheight() const;
/**
* @brief setKgrowth set increment in growths
* @brief setKheight set increment in growths
* @param value value of increment
*/
inline void setKgrowth(const qreal &value) {kgrowth = value;}
void setKheight(const qreal &value);
/**
* @brief getDescription return description
* @return description
*/
inline QString getDescription() const {return description;}
QString getDescription() const;
/**
* @brief setDescription set description for row
* @param value description
*/
inline void setDescription(const QString &value) {description = value;}
void setDescription(const QString &value);
qreal GetValue() const;
qreal GetValue(const qreal &size, const qreal &height) const;
private:
/**
* @brief id identificator
*/
qint64 id;
quint32 id;
/**
* @brief base value in base size and growth
*/
@ -117,11 +118,61 @@ private:
/**
* @brief kgrowth increment in growths
*/
qreal kgrowth;
qreal kheight;
/**
* @brief description description of increment
*/
QString description;
};
inline quint32 VIncrement::getId() const
{
return id;
}
inline void VIncrement::setId(const quint32 &value)
{
id = value;
}
inline qreal VIncrement::getBase() const
{
return base;
}
inline void VIncrement::setBase(const qreal &value)
{
base = value;
}
inline qreal VIncrement::getKsize() const
{
return ksize;
}
inline void VIncrement::setKsize(const qreal &value)
{
ksize = value;
}
inline qreal VIncrement::getKheight() const
{
return kheight;
}
inline void VIncrement::setKheight(const qreal &value)
{
kheight = value;
}
inline QString VIncrement::getDescription() const
{
return description;
}
inline void VIncrement::setDescription(const QString &value)
{
description = value;
}
#endif // VINCREMENTTABLEROW_H

View File

@ -0,0 +1,67 @@
/************************************************************************
**
** @file vstandardtablecell.cpp
** @author Roman Telezhinsky <dismine@gmail.com>
** @date November 15, 2013
**
** @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 "vmeasurement.h"
VMeasurement::VMeasurement()
:base(0), ksize(50.0), kheight(176.0), gui_text(QString()), number(QString()), virtualM(false),
_tagName(QString())
{
}
VMeasurement::VMeasurement(const qreal &base, const qreal &ksize, const qreal &kgrowth,
const QString &gui_text, const QString &number, const QString &tagName)
:base(base), ksize(ksize), kheight(kgrowth), gui_text(gui_text), number(number), virtualM(false),
_tagName(tagName)
{
}
VMeasurement::VMeasurement(const qreal &base, const QString &gui_text, const QString &number, const QString &tagName)
:base(base), ksize(50.0), kheight(176.0), gui_text(gui_text), number(number), virtualM(false),
_tagName(tagName)
{
}
qreal VMeasurement::GetValue() const
{
return base;
}
qreal VMeasurement::GetValue(const qreal &size, const qreal &height) const
{
const qreal k_size = ( size - 50.0 ) / 2.0;
const qreal k_height = ( height - 176.0 ) / 6.0;
return base + k_size * ksize + k_height * kheight;
}

View File

@ -32,15 +32,15 @@
#include <QString>
/**
* @brief The VStandardTableRow class keep data row of standard table
* @brief The VMeasurement class keep data row of standard table
*/
class VStandardTableRow
class VMeasurement
{
public:
/**
* @brief VStandardTableRow create empty row
*/
VStandardTableRow();
VMeasurement();
/**
* @brief VStandardTableRow create row
* @param base value in base size and growth
@ -48,34 +48,45 @@ public:
* @param kgrowth increment in growths
* @param description description of increment
*/
VStandardTableRow(const qint32 &base, const qreal &ksize, const qreal &kgrowth,
const QString &description = QString());
~VStandardTableRow(){}
VMeasurement(const qreal &base, const qreal &ksize, const qreal &kheight,
const QString &gui_text = QString(), const QString &number = QString(),
const QString &TagName = QString());
VMeasurement(const qreal &base, const QString &gui_text = QString(),
const QString &number = QString(), const QString &TagName = QString());
~VMeasurement(){}
/**
* @brief GetBase return value in base size and growth
* @return value
*/
inline qint32 GetBase() const {return base;}
qreal GetBase() const;
void setBase(const qreal &value);
/**
* @brief GetKsize return increment in sizes
* @return increment
*/
inline qreal GetKsize() const {return ksize;}
qreal GetKsize() const;
/**
* @brief GetKgrowth return increment in growths
* @return increment
*/
inline qreal GetKgrowth() const {return kgrowth;}
qreal GetKheight() const;
/**
* @brief GetDescription return description
* @return description
*/
inline QString GetDescription() const {return description;}
QString GetDescription() const;
QString GetNumber() const;
qreal GetValue() const;
qreal GetValue(const qreal &size, const qreal &height) const;
QString TagName() const;
void setTagName(const QString &TagName);
bool Virtual() const;
void setVirtual(bool value);
private:
/**
* @brief base value in base size and growth
*/
qint32 base;
qreal base;
/**
* @brief ksize increment in sizes
*/
@ -83,11 +94,64 @@ private:
/**
* @brief kgrowth increment in growths
*/
qreal kgrowth;
qreal kheight;
/**
* @brief description description measurement
*/
QString description;
QString gui_text;
QString number;
bool virtualM;
QString _tagName;
};
inline qreal VMeasurement::GetBase() const
{
return base;
}
inline void VMeasurement::setBase(const qreal &value)
{
base = value;
}
inline qreal VMeasurement::GetKsize() const
{
return ksize;
}
inline qreal VMeasurement::GetKheight() const
{
return kheight;
}
inline QString VMeasurement::GetDescription() const
{
return gui_text;
}
inline QString VMeasurement::GetNumber() const
{
return number;
}
inline QString VMeasurement::TagName() const
{
return _tagName;
}
inline void VMeasurement::setTagName(const QString &tagName)
{
_tagName = tagName;
}
inline bool VMeasurement::Virtual() const
{
return virtualM;
}
inline void VMeasurement::setVirtual(bool value)
{
virtualM = value;
}
#endif // VSTANDARDTABLEROW_H

View File

@ -29,10 +29,9 @@
#include "configdialog.h"
ConfigDialog::ConfigDialog(QWidget *parent) :
QDialog(parent), contentsWidget(0), pagesWidget(0), configurationPage(0), patternPage(0)
QDialog(parent), contentsWidget(nullptr), pagesWidget(nullptr), configurationPage(nullptr), patternPage(nullptr)
{
contentsWidget = new QListWidget;
Q_CHECK_PTR(contentsWidget);
contentsWidget->setViewMode(QListView::IconMode);
contentsWidget->setIconSize(QSize(96, 84));
contentsWidget->setMovement(QListView::Static);
@ -41,20 +40,14 @@ ConfigDialog::ConfigDialog(QWidget *parent) :
contentsWidget->setSpacing(12);
pagesWidget = new QStackedWidget;
Q_CHECK_PTR(pagesWidget);
configurationPage = new ConfigurationPage();
Q_CHECK_PTR(configurationPage);
pagesWidget->addWidget(configurationPage);
patternPage = new PatternPage();
Q_CHECK_PTR(patternPage);
pagesWidget->addWidget(patternPage);
QPushButton *applyButton = new QPushButton(tr("Apply"));
Q_CHECK_PTR(applyButton);
QPushButton *canselButton = new QPushButton(tr("&Cancel"));
Q_CHECK_PTR(canselButton);
QPushButton *okButton = new QPushButton(tr("&Ok"));
Q_CHECK_PTR(okButton);
createIcons();
contentsWidget->setCurrentRow(0);
@ -64,19 +57,16 @@ ConfigDialog::ConfigDialog(QWidget *parent) :
connect(okButton, &QPushButton::clicked, this, &ConfigDialog::Ok);
QHBoxLayout *horizontalLayout = new QHBoxLayout;
Q_CHECK_PTR(horizontalLayout);
horizontalLayout->addWidget(contentsWidget);
horizontalLayout->addWidget(pagesWidget, 1);
QHBoxLayout *buttonsLayout = new QHBoxLayout;
Q_CHECK_PTR(buttonsLayout);
buttonsLayout->addStretch(1);
buttonsLayout->addWidget(applyButton);
buttonsLayout->addWidget(canselButton);
buttonsLayout->addWidget(okButton);
QVBoxLayout *mainLayout = new QVBoxLayout;
Q_CHECK_PTR(mainLayout);
mainLayout->addLayout(horizontalLayout);
mainLayout->addStretch(1);
mainLayout->addSpacing(12);
@ -107,14 +97,12 @@ void ConfigDialog::closeEvent(QCloseEvent *event)
void ConfigDialog::createIcons()
{
QListWidgetItem *configButton = new QListWidgetItem(contentsWidget);
Q_CHECK_PTR(configButton);
configButton->setIcon(QIcon("://icon/config.png"));
configButton->setText(tr("Configuration"));
configButton->setTextAlignment(Qt::AlignHCenter);
configButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
QListWidgetItem *patternButton = new QListWidgetItem(contentsWidget);
Q_CHECK_PTR(patternButton);
patternButton->setIcon(QIcon("://icon/pattern_config.png"));
patternButton->setText(tr("Pattern"));
patternButton->setTextAlignment(Qt::AlignHCenter);
@ -125,12 +113,12 @@ void ConfigDialog::createIcons()
void ConfigDialog::Apply()
{
switch(contentsWidget->currentRow())
switch (contentsWidget->currentRow())
{
case(0):
case (0):
configurationPage->Apply();
break;
case(1):
case (1):
patternPage->Apply();
break;
default:

View File

@ -40,7 +40,7 @@ class ConfigDialog : public QDialog
{
Q_OBJECT
public:
explicit ConfigDialog(QWidget *parent = 0);
explicit ConfigDialog(QWidget *parent = nullptr);
public slots:
void changePage(QListWidgetItem *current, QListWidgetItem *previous);
protected:

View File

@ -0,0 +1,437 @@
/************************************************************************
**
** @file dialoghistory.cpp
** @author Roman Telezhinsky <dismine@gmail.com>
** @date November 15, 2013
**
** @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 "dialoghistory.h"
#include "ui_dialoghistory.h"
#include "../../geometry/varc.h"
#include "../../geometry/vspline.h"
#include "../../geometry/vsplinepath.h"
#include "../../tools/vabstracttool.h"
#include "../../tools/drawTools/vtoolcutspline.h"
#include "../../tools/drawTools/vtoolcutsplinepath.h"
#include "../../tools/drawTools/vtoolcutarc.h"
#include <QDebug>
#include <QPushButton>
DialogHistory::DialogHistory(VContainer *data, VPattern *doc, QWidget *parent)
:DialogTool(data, parent), ui(new Ui::DialogHistory), doc(doc), cursorRow(0),
cursorToolRecordRow(0)
{
ui->setupUi(this);
bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
connect(bOk, &QPushButton::clicked, this, &DialogHistory::DialogAccepted);
FillTable();
InitialTable();
connect(ui->tableWidget, &QTableWidget::cellClicked, this, &DialogHistory::cellClicked);
connect(this, &DialogHistory::ShowHistoryTool, doc, &VPattern::ShowHistoryTool);
connect(doc, &VPattern::ChangedCursor, this, &DialogHistory::ChangedCursor);
connect(doc, &VPattern::patternChanged, this, &DialogHistory::UpdateHistory);
connect(doc, &VPattern::ChangedActivDraw, this, &DialogHistory::UpdateHistory);
ShowPoint();
}
DialogHistory::~DialogHistory()
{
delete ui;
}
void DialogHistory::DialogAccepted()
{
QTableWidgetItem *item = ui->tableWidget->item(cursorToolRecordRow, 0);
quint32 id = qvariant_cast<quint32>(item->data(Qt::UserRole));
emit ShowHistoryTool(id, Qt::green, false);
emit DialogClosed(QDialog::Accepted);
}
void DialogHistory::cellClicked(int row, int column)
{
if (column == 0)
{
QTableWidgetItem *item = ui->tableWidget->item(cursorRow, 0);
item->setIcon(QIcon());
item = ui->tableWidget->item(row, 0);
cursorRow = row;
item->setIcon(QIcon("://icon/32x32/put_after.png"));
quint32 id = qvariant_cast<quint32>(item->data(Qt::UserRole));
disconnect(doc, &VPattern::ChangedCursor, this, &DialogHistory::ChangedCursor);
doc->setCursor(id);
connect(doc, &VPattern::ChangedCursor, this, &DialogHistory::ChangedCursor);
}
else
{
QTableWidgetItem *item = ui->tableWidget->item(cursorToolRecordRow, 0);
quint32 id = qvariant_cast<quint32>(item->data(Qt::UserRole));
emit ShowHistoryTool(id, Qt::green, false);
cursorToolRecordRow = row;
item = ui->tableWidget->item(cursorToolRecordRow, 0);
id = qvariant_cast<quint32>(item->data(Qt::UserRole));
emit ShowHistoryTool(id, Qt::green, true);
}
}
void DialogHistory::ChangedCursor(quint32 id)
{
for (qint32 i = 0; i< ui->tableWidget->rowCount(); ++i)
{
QTableWidgetItem *item = ui->tableWidget->item(i, 0);
quint32 rId = qvariant_cast<quint32>(item->data(Qt::UserRole));
if (rId == id)
{
QTableWidgetItem *oldCursorItem = ui->tableWidget->item(cursorRow, 0);
oldCursorItem->setIcon(QIcon());
cursorRow = i;
item->setIcon(QIcon("://icon/32x32/put_after.png"));
}
}
}
void DialogHistory::UpdateHistory()
{
FillTable();
InitialTable();
}
void DialogHistory::FillTable()
{
ui->tableWidget->clear();
const QVector<VToolRecord> *history = doc->getHistory();
Q_CHECK_PTR(history);
qint32 currentRow = -1;
qint32 count = 0;
ui->tableWidget->setRowCount(history->size());
for (qint32 i = 0; i< history->size(); ++i)
{
const VToolRecord tool = history->at(i);
if (tool.getNameDraw() != doc->GetNameActivDraw())
{
continue;
}
const QString historyRecord = Record(tool);
if (historyRecord.isEmpty() ==false)
{
currentRow++;
{
QTableWidgetItem *item = new QTableWidgetItem(QString());
item->setTextAlignment(Qt::AlignHCenter);
item->setData(Qt::UserRole, tool.getId());
ui->tableWidget->setItem(currentRow, 0, item);
}
QTableWidgetItem *item = new QTableWidgetItem(historyRecord);
item->setFont(QFont("Times", 12, QFont::Bold));
item->setFlags(item->flags() ^ Qt::ItemIsEditable);
ui->tableWidget->setItem(currentRow, 1, item);
++count;
}
}
ui->tableWidget->setRowCount(count);
if (history->size()>0)
{
cursorRow = currentRow;
QTableWidgetItem *item = ui->tableWidget->item(cursorRow, 0);
Q_CHECK_PTR(item);
item->setIcon(QIcon("://icon/32x32/put_after.png"));
}
ui->tableWidget->resizeColumnsToContents();
ui->tableWidget->resizeRowsToContents();
ui->tableWidget->verticalHeader()->setDefaultSectionSize(20);
}
QString DialogHistory::Record(const VToolRecord &tool)
{
const QDomElement domElement = doc->elementById(QString().setNum(tool.getId()));
if (domElement.isElement() == false)
{
qDebug()<<"Can't find element by id"<<Q_FUNC_INFO;
return QString(tr("Can't create record."));
}
try
{
switch ( tool.getTypeTool() )
{
case Valentina::ArrowTool:
Q_UNREACHABLE();
break;
case Valentina::SinglePointTool:
{
const QString name = data->GeometricObject<const VPointF *>(tool.getId())->name();
return QString(tr("%1 - Base point")).arg(name);
}
case Valentina::EndLineTool:
{
const quint32 basePointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrBasePoint, "0");
const QString basePointIdName = data->GeometricObject<const VPointF *>(basePointId)->name();
const QString toolIdName = data->GeometricObject<const VPointF *>(tool.getId())->name();
return QString(tr("%1_%2 - Line from point %1 to point %2")).arg(basePointIdName, toolIdName);
}
case Valentina::LineTool:
{
const quint32 firstPointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, "0");
const quint32 secondPointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, "0");
const QString firstPointIdName = data->GeometricObject<const VPointF *>(firstPointId)->name();
const QString secondPointIdName = data->GeometricObject<const VPointF *>(secondPointId)->name();
return QString(tr("%1_%2 - Line from point %1 to point %2")).arg(firstPointIdName, secondPointIdName);
}
case Valentina::AlongLineTool:
{
const quint32 basePointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, "0");
const quint32 secondPointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, "0");
const QString basePointIdName = data->GeometricObject<const VPointF *>(basePointId)->name();
const QString secondPointIdName = data->GeometricObject<const VPointF *>(secondPointId)->name();
const QString toolIdName = data->GeometricObject<const VPointF *>(tool.getId())->name();
return QString(tr("%3 - Point along line %1_%2")).arg(basePointIdName, secondPointIdName, toolIdName);
}
case Valentina::ShoulderPointTool:
{
const QString name = data->GeometricObject<const VPointF *>(tool.getId())->name();
return QString(tr("%1 - Point of shoulder")).arg(name);
}
case Valentina::NormalTool:
{
const quint32 basePointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, "0");
const quint32 secondPointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, "0");
const QString basePointIdName = data->GeometricObject<const VPointF *>(basePointId)->name();
const QString secondPointIdName = data->GeometricObject<const VPointF *>(secondPointId)->name();
const QString toolIdName = data->GeometricObject<const VPointF *>(tool.getId())->name();
return QString(tr("%3 - normal to line %1_%2")).arg(basePointIdName, secondPointIdName, toolIdName);
}
case Valentina::BisectorTool:
{
const quint32 firstPointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, "0");
const quint32 secondPointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, "0");
const quint32 thirdPointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrThirdPoint, "0");
const QString firstPointIdName = data->GeometricObject<const VPointF *>(firstPointId)->name();
const QString secondPointIdName = data->GeometricObject<const VPointF *>(secondPointId)->name();
const QString thirdPointIdName = data->GeometricObject<const VPointF *>(thirdPointId)->name();
const QString toolIdName = data->GeometricObject<const VPointF *>(tool.getId())->name();
return QString(tr("%4 - bisector of angle %1_%2_%3")).arg(firstPointIdName, secondPointIdName,
thirdPointIdName, toolIdName);
}
case Valentina::LineIntersectTool:
{
const quint32 p1Line1 = doc->GetParametrUInt(domElement, VAbstractTool::AttrP1Line1, "0");
const quint32 p2Line1 = doc->GetParametrUInt(domElement, VAbstractTool::AttrP2Line1, "0");
const quint32 p1Line2 = doc->GetParametrUInt(domElement, VAbstractTool::AttrP1Line2, "0");
const quint32 p2Line2 = doc->GetParametrUInt(domElement, VAbstractTool::AttrP2Line2, "0");
const QString p1Line1Name = data->GeometricObject<const VPointF *>(p1Line1)->name();
const QString p2Line1Name = data->GeometricObject<const VPointF *>(p2Line1)->name();
const QString p1Line2Name = data->GeometricObject<const VPointF *>(p1Line2)->name();
const QString p2Line2Name = data->GeometricObject<const VPointF *>(p2Line2)->name();
const QString toolIdName = data->GeometricObject<const VPointF *>(tool.getId())->name();
return QString(tr("%5 - intersection of lines %1_%2 and %3_%4")).arg(p1Line1Name, p2Line1Name,
p1Line2Name, p2Line2Name,
toolIdName);
}
case Valentina::SplineTool:
{
const VSpline *spl = data->GeometricObject<const VSpline *>(tool.getId());
Q_CHECK_PTR(spl);
const QString splP1Name = data->GeometricObject<const VPointF *>(spl->GetP1().id())->name();
const QString splP4Name = data->GeometricObject<const VPointF *>(spl->GetP4().id())->name();
return QString(tr("Curve %1_%2")).arg(splP1Name, splP4Name);
}
case Valentina::ArcTool:
{
const VArc *arc = data->GeometricObject<const VArc *>(tool.getId());
Q_CHECK_PTR(arc);
const QString arcCenterName = data->GeometricObject<const VArc *>(arc->GetCenter().id())->name();
return QString(tr("Arc with center in point %1")).arg(arcCenterName);
}
case Valentina::SplinePathTool:
{
const VSplinePath *splPath = data->GeometricObject<const VSplinePath *>(tool.getId());
Q_CHECK_PTR(splPath);
const QVector<VSplinePoint> points = splPath->GetSplinePath();
QString record;
if (points.size() != 0 )
{
const QString pName = data->GeometricObject<const VPointF *>(points.at(0).P().id())->name();
record = QString(tr("Curve point %1")).arg(pName);
if (points.size() > 1)
{
const QString pName = data->GeometricObject<const VPointF *>(points.last().P().id())->name();
record.append(QString("_%1").arg(pName));
}
}
else
{
qDebug()<<"Not enough points in splinepath"<<Q_FUNC_INFO;
return QString(tr("Can't create record."));
}
return record;
}
case Valentina::PointOfContact:
{
const quint32 center = doc->GetParametrUInt(domElement, VAbstractTool::AttrCenter, "0");
const quint32 firstPointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, "0");
const quint32 secondPointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, "0");
const QString firstPointIdName = data->GeometricObject<const VPointF *>(firstPointId)->name();
const QString centerName = data->GeometricObject<const VPointF *>(center)->name();
const QString secondPointIdName = data->GeometricObject<const VPointF *>(secondPointId)->name();
const QString toolIdName = data->GeometricObject<const VPointF *>(tool.getId())->name();
return QString(tr("%4 - point of contact of arc with the center in point %1 and line %2_%3")).arg(
centerName, firstPointIdName, secondPointIdName, toolIdName);
}
case Valentina::Height:
{
const quint32 basePointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrBasePoint, "0");
const quint32 p1LineId = doc->GetParametrUInt(domElement, VAbstractTool::AttrP1Line, "0");
const quint32 p2LineId = doc->GetParametrUInt(domElement, VAbstractTool::AttrP2Line, "0");
const QString basePointIdName = data->GeometricObject<const VPointF *>(basePointId)->name();
const QString p1LineIdName = data->GeometricObject<const VPointF *>(p1LineId)->name();
const QString p2LineIdName = data->GeometricObject<const VPointF *>(p2LineId)->name();
return QString(tr("Point of perpendicular from point %1 to line %2_%3")).arg(basePointIdName,
p1LineIdName,
p2LineIdName);
}
case Valentina::Triangle:
{
const quint32 axisP1Id = doc->GetParametrUInt(domElement, VAbstractTool::AttrAxisP1, "0");
const quint32 axisP2Id = doc->GetParametrUInt(domElement, VAbstractTool::AttrAxisP2, "0");
const quint32 firstPointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, "0");
const quint32 secondPointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, "0");
const QString axisP1IdName = data->GeometricObject<const VPointF *>(axisP1Id)->name();
const QString axisP2IdName = data->GeometricObject<const VPointF *>(axisP2Id)->name();
const QString firstPointIdName = data->GeometricObject<const VPointF *>(firstPointId)->name();
const QString secondPointIdName = data->GeometricObject<const VPointF *>(secondPointId)->name();
return QString(tr("Triangle: axis %1_%2, points %3 and %4")).arg(axisP1IdName, axisP2IdName,
firstPointIdName, secondPointIdName);
}
case Valentina::PointOfIntersection:
{
const quint32 firstPointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, "0");
const quint32 secondPointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, "0");
const QString firstPointIdName = data->GeometricObject<const VPointF *>(firstPointId)->name();
const QString secondPointIdName = data->GeometricObject<const VPointF *>(secondPointId)->name();
const QString toolIdName = data->GeometricObject<const VPointF *>(tool.getId())->name();
return QString(tr("%1 - point of intersection %2 and %3")).arg(toolIdName, firstPointIdName,
secondPointIdName);
}
case Valentina::CutArcTool:
{
const quint32 arcId = doc->GetParametrUInt(domElement, VToolCutArc::AttrArc, "0");
const VArc *arc = data->GeometricObject<const VArc *>(arcId);
Q_CHECK_PTR(arc);
const QString arcCenterName = data->GeometricObject<const VArc *>(arc->GetCenter().id())->name();
const QString toolIdName = data->GeometricObject<const VPointF *>(tool.getId())->name();
return QString(tr("%1 - cut arc with center %2")).arg(toolIdName, arcCenterName);
}
case Valentina::CutSplineTool:
{
const quint32 splineId = doc->GetParametrUInt(domElement, VToolCutSpline::AttrSpline, "0");
const VSpline *spl = data->GeometricObject<const VSpline *>(splineId);
Q_CHECK_PTR(spl);
const QString toolIdName = data->GeometricObject<const VPointF *>(tool.getId())->name();
const QString splP1Name = data->GeometricObject<const VPointF *>(spl->GetP1().id())->name();
const QString splP4Name = data->GeometricObject<const VPointF *>(spl->GetP4().id())->name();
return QString(tr("%1 - cut curve %2_%3")).arg(toolIdName, splP1Name, splP4Name);
}
case Valentina::CutSplinePathTool:
{
const quint32 splinePathId = doc->GetParametrUInt(domElement, VToolCutSplinePath::AttrSplinePath, "0");
const VSplinePath *splPath = data->GeometricObject<const VSplinePath *>(splinePathId);
Q_CHECK_PTR(splPath);
const QVector<VSplinePoint> points = splPath->GetSplinePath();
QString record;
if (points.size() != 0 )
{
const QString toolIdName = data->GeometricObject<const VPointF *>(tool.getId())->name();
const QString pName = data->GeometricObject<const VPointF *>(points.at(0).P().id())->name();
record = QString(tr("%1 - cut curve path %2")).arg(toolIdName, pName);
if (points.size() > 1)
{
const QString pName = data->GeometricObject<const VPointF *>(points.last().P().id())->name();
const QString name = QString("_%1").arg(pName);
record.append(name);
}
}
else
{
qDebug()<<"Not enough points in splinepath"<<Q_FUNC_INFO;
return QString(tr("Can't create record."));
}
return record;
}
//Because "history" not only show history of pattern, but help restore current data for each pattern's
//piece, we need add record about details and nodes, but don't show them.
case Valentina::DetailTool:
break;
case Valentina::UnionDetails:
break;
case Valentina::NodeArc:
break;
case Valentina::NodePoint:
break;
case Valentina::NodeSpline:
break;
case Valentina::NodeSplinePath:
break;
default:
qDebug()<<"Got wrong tool type. Ignore.";
break;
}
}
catch (const VExceptionBadId &e)
{
qDebug()<<e.ErrorMessage()<<Q_FUNC_INFO;
return QString(tr("Can't create record."));
}
return QString();
}
void DialogHistory::InitialTable()
{
ui->tableWidget->setSortingEnabled(false);
ui->tableWidget->setHorizontalHeaderItem(0, new QTableWidgetItem(" "));
ui->tableWidget->setHorizontalHeaderItem(1, new QTableWidgetItem(tr("Tool")));
}
void DialogHistory::ShowPoint()
{
QVector<VToolRecord> *history = doc->getHistory();
if (history->size()>0)
{
QTableWidgetItem *item = ui->tableWidget->item(0, 1);
item->setSelected(true);
cursorToolRecordRow = 0;
item = ui->tableWidget->item(0, 0);
quint32 id = qvariant_cast<quint32>(item->data(Qt::UserRole));
emit ShowHistoryTool(id, Qt::green, true);
}
}
void DialogHistory::closeEvent(QCloseEvent *event)
{
QTableWidgetItem *item = ui->tableWidget->item(cursorToolRecordRow, 0);
quint32 id = qvariant_cast<quint32>(item->data(Qt::UserRole));
emit ShowHistoryTool(id, Qt::green, false);
DialogTool::closeEvent(event);
}

View File

@ -29,8 +29,8 @@
#ifndef DIALOGHISTORY_H
#define DIALOGHISTORY_H
#include "dialogtool.h"
#include "../xml/vdomdocument.h"
#include "../tools/dialogtool.h"
#include "../../xml/vpattern.h"
namespace Ui
{
@ -50,7 +50,7 @@ public:
* @param doc dom document container
* @param parent parent widget
*/
DialogHistory(VContainer *data, VDomDocument *doc, QWidget *parent = 0);
DialogHistory(VContainer *data, VPattern *doc, QWidget *parent = nullptr);
virtual ~DialogHistory();
public slots:
/**
@ -67,7 +67,7 @@ public slots:
* @brief ChangedCursor changed cursor of input. Cursor show after what record we will insert new object
* @param id id of object
*/
void ChangedCursor(qint64 id);
void ChangedCursor(quint32 id);
/**
* @brief UpdateHistory update history table
*/
@ -79,7 +79,7 @@ signals:
* @param color new color of tool
* @param enable true enable selection, false disable selection
*/
void ShowHistoryTool(qint64 id, Qt::GlobalColor color, bool enable);
void ShowHistoryTool(quint32 id, Qt::GlobalColor color, bool enable);
protected:
/**
* @brief closeEvent handle when windows is closing
@ -95,7 +95,7 @@ private:
/**
* @brief doc dom document container
*/
VDomDocument *doc;
VPattern *doc;
/**
* @brief cursorRow save number of row where is cursor
*/

View File

@ -0,0 +1,749 @@
/************************************************************************
**
** @file dialogincrements.cpp
** @author Roman Telezhinsky <dismine@gmail.com>
** @date November 15, 2013
**
** @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 "dialogincrements.h"
#include "ui_dialogincrements.h"
#include "../../widgets/doubledelegate.h"
#include "../../widgets/textdelegate.h"
#include "../../exception/vexception.h"
#include "../../xml/vstandardmeasurements.h"
#include <QPushButton>
#include <QFile>
DialogIncrements::DialogIncrements(VContainer *data, VPattern *doc, QWidget *parent)
:DialogTool(data, parent), ui(new Ui::DialogIncrements), data(data), doc(doc), row(0), column(0), m(nullptr)
{
ui->setupUi(this);
if (qApp->patternType() == Pattern::Individual)
{
const QString filePath = doc->MPath();
try
{
VDomDocument::ValidateXML("://schema/individual_measurements.xsd", filePath);
m = new VIndividualMeasurements(data);
m->setContent(filePath);
}
catch(VException &e)
{
e.CriticalMessageBox(tr("File error."), this);
emit DialogClosed(QDialog::Rejected);
return;
}
}
//Same regex in each shema files. Don't forget synchronize.
TextDelegate *textDelegate = new TextDelegate("^([^0-9-*/^+=\\s\\(\\)%:;!]){1,1}([^-*/^+=\\s\\(\\)%:;!]){0,}$",
ui->tableWidgetIncrement);
ui->tableWidgetIncrement->setItemDelegateForColumn(0, textDelegate);// name
DoubleSpinBoxDelegate *doubleDelegate = new DoubleSpinBoxDelegate(ui->tableWidgetIncrement);
ui->tableWidgetIncrement->setItemDelegateForColumn(2, doubleDelegate);// base value
ui->tableWidgetIncrement->setItemDelegateForColumn(3, doubleDelegate);// in sizes
ui->tableWidgetIncrement->setItemDelegateForColumn(4, doubleDelegate);// in heights
FillMeasurements();
FillIncrements();
FillLengthLines();
FillLengthSplines();
FillLengthArcs();
if (qApp->patternType() == Pattern::Standard)
{
ui->pagePersonalInformation->setVisible(false);
}
else
{
QRegExpValidator *reg = new QRegExpValidator(QRegExp("\\w+([-+.']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*"));
ui->lineEditMail->setValidator(reg);
ui->tableWidgetMeasurements->setColumnHidden( 1, true );// calculated value
ui->tableWidgetMeasurements->setColumnHidden( 3, true );// in sizes
ui->tableWidgetMeasurements->setColumnHidden( 4, true );// in heights
ui->tableWidgetIncrement->setColumnHidden( 1, true );// calculated value
ui->tableWidgetIncrement->setColumnHidden( 3, true );// in sizes
ui->tableWidgetIncrement->setColumnHidden( 4, true );// in heights
ui->tableWidgetMeasurements->setItemDelegateForColumn(2, doubleDelegate);// base value
connect(ui->tableWidgetMeasurements, &QTableWidget::cellChanged, this, &DialogIncrements::MeasurementChanged);
ui->lineEditGivenName->setText(m->GivenName());
ui->lineEditFamilyName->setText(m->FamilyName());
ui->comboBoxSex->addItem(tr("male"),QVariant(m->GenderToStr(VIndividualMeasurements::Male)));
ui->comboBoxSex->addItem(tr("female"),QVariant(m->GenderToStr(VIndividualMeasurements::Female)));
qint32 index = ui->comboBoxSex->findData(m->GenderToStr(m->Sex()));
if (index != -1)
{
ui->comboBoxSex->setCurrentIndex(index);
}
ui->dateEditBirthDate->setDate(m->BirthDate());
ui->lineEditMail->setText(m->Mail());
connect(ui->lineEditGivenName, &QLineEdit::editingFinished, this, &DialogIncrements::SaveGivenName);
connect(ui->lineEditFamilyName, &QLineEdit::editingFinished, this, &DialogIncrements::SaveFamilyName);
connect(ui->lineEditMail, &QLineEdit::editingFinished, this, &DialogIncrements::SaveEmail);
connect(ui->comboBoxSex, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
&DialogIncrements::SaveSex);
connect(ui->dateEditBirthDate, &QDateEdit::dateChanged, this, &DialogIncrements::SaveBirthDate);
}
ui->toolBoxMeasurements->setCurrentIndex(1);
connect(ui->tableWidgetIncrement, &QTableWidget::cellChanged, this, &DialogIncrements::IncrementChanged);
connect(ui->toolButtonAdd, &QPushButton::clicked, this, &DialogIncrements::clickedToolButtonAdd);
connect(ui->toolButtonRemove, &QPushButton::clicked, this, &DialogIncrements::clickedToolButtonRemove);
connect(this, &DialogIncrements::FullUpdateTree, this->doc, &VPattern::FullUpdateTree);
connect(this, &DialogIncrements::haveLiteChange, this->doc, &VPattern::haveLiteChange);
connect(this->doc, &VPattern::FullUpdateFromFile, this, &DialogIncrements::FullUpdateFromFile);
ui->tabWidget->setCurrentIndex(0);
connect(ui->toolButtonOpenMeasurements, &QToolButton::clicked, this, &DialogIncrements::OpenTable);
}
void DialogIncrements::FillMeasurements()
{
const QHash<QString, VMeasurement> *table = data->DataMeasurements();
QHashIterator<QString, VMeasurement> i(*table);
QMap<QString, VMeasurement> map;
//Sorting QHash by id
while (i.hasNext())
{
i.next();
map.insert(i.key(), i.value());
}
qint32 currentRow = -1;
QMapIterator<QString, VMeasurement> iMap(map);
ui->tableWidgetMeasurements->setRowCount ( table->size() );
while (iMap.hasNext())
{
iMap.next();
VMeasurement m = iMap.value();
currentRow++;
QTableWidgetItem *item = new QTableWidgetItem(QString(iMap.key()));
item->setTextAlignment(Qt::AlignHCenter);
item->setFont(QFont("Times", 12, QFont::Bold));
item->setToolTip(m.GetDescription());
// set the item non-editable (view only), and non-selectable
Qt::ItemFlags flags = item->flags();
flags &= ~(Qt::ItemIsSelectable | Qt::ItemIsEditable); // reset/clear the flag
item->setFlags(flags);
ui->tableWidgetMeasurements->setItem(currentRow, 0, item);
if (qApp->patternType() == Pattern::Standard)
{
QTableWidgetItem *item = new QTableWidgetItem(QString().setNum(data->GetValueStandardTableRow(iMap.key())));
item->setTextAlignment(Qt::AlignHCenter);
// set the item non-editable (view only), and non-selectable
Qt::ItemFlags flags = item->flags();
flags &= ~(Qt::ItemIsSelectable | Qt::ItemIsEditable); // reset/clear the flag
item->setFlags(flags);
ui->tableWidgetMeasurements->setItem(currentRow, 1, item);
}
item = new QTableWidgetItem(QString().setNum(m.GetBase()));
item->setTextAlignment(Qt::AlignHCenter);
ui->tableWidgetMeasurements->setItem(currentRow, 2, item);
if (qApp->patternType() == Pattern::Standard)
{
QTableWidgetItem *item = new QTableWidgetItem(QString().setNum(m.GetKsize()));
item->setTextAlignment(Qt::AlignHCenter);
// set the item non-editable (view only), and non-selectable
Qt::ItemFlags flags = item->flags();
flags &= ~(Qt::ItemIsSelectable | Qt::ItemIsEditable); // reset/clear the flag
item->setFlags(flags);
ui->tableWidgetMeasurements->setItem(currentRow, 3, item);
item = new QTableWidgetItem(QString().setNum(m.GetKheight()));
item->setTextAlignment(Qt::AlignHCenter);
// set the item non-editable (view only), and non-selectable
flags = item->flags();
flags &= ~(Qt::ItemIsSelectable | Qt::ItemIsEditable); // reset/clear the flag
item->setFlags(flags);
ui->tableWidgetMeasurements->setItem(currentRow, 4, item);
}
item = new QTableWidgetItem(m.GetNumber());
item->setTextAlignment(Qt::AlignHCenter);
// set the item non-editable (view only), and non-selectable
flags = item->flags();
flags &= ~(Qt::ItemIsSelectable | Qt::ItemIsEditable); // reset/clear the flag
item->setFlags(flags);
ui->tableWidgetMeasurements->setItem(currentRow, 5, item);
}
ui->tableWidgetMeasurements->verticalHeader()->setDefaultSectionSize(20);
ui->tableWidgetMeasurements->resizeColumnsToContents();
ui->tableWidgetMeasurements->resizeRowsToContents();
}
void DialogIncrements::FillIncrements()
{
const QHash<QString, VIncrement> *increments = data->DataIncrements();
QHashIterator<QString, VIncrement> i(*increments);
QMap<quint32, QString> map;
//Sorting QHash by id
while (i.hasNext())
{
i.next();
VIncrement incr = i.value();
map.insert(incr.getId(), i.key());
}
qint32 currentRow = -1;
QMapIterator<quint32, QString> iMap(map);
while (iMap.hasNext())
{
iMap.next();
VIncrement incr = increments->value(iMap.value());
currentRow++;
ui->tableWidgetIncrement->setRowCount ( increments->size() );
QTableWidgetItem *item = new QTableWidgetItem(iMap.value());
item->setTextAlignment(Qt::AlignHCenter);
item->setFont(QFont("Times", 12, QFont::Bold));
item->setData(Qt::UserRole, incr.getId());
ui->tableWidgetIncrement->setItem(currentRow, 0, item);
if (qApp->patternType() == Pattern::Standard)
{
item = new QTableWidgetItem(QString().setNum(data->GetValueIncrementTableRow(iMap.value())));
item->setTextAlignment(Qt::AlignHCenter);
// set the item non-editable (view only), and non-selectable
Qt::ItemFlags flags = item->flags();
flags &= ~(Qt::ItemIsSelectable | Qt::ItemIsEditable); // reset/clear the flag
item->setFlags(flags);
ui->tableWidgetIncrement->setItem(currentRow, 1, item);
}
item = new QTableWidgetItem(QString().setNum(incr.getBase()));
item->setTextAlignment(Qt::AlignHCenter);
ui->tableWidgetIncrement->setItem(currentRow, 2, item);
if (qApp->patternType() == Pattern::Standard)
{
item = new QTableWidgetItem(QString().setNum(incr.getKsize()));
item->setTextAlignment(Qt::AlignHCenter);
ui->tableWidgetIncrement->setItem(currentRow, 3, item);
item = new QTableWidgetItem(QString().setNum(incr.getKheight()));
item->setTextAlignment(Qt::AlignHCenter);
ui->tableWidgetIncrement->setItem(currentRow, 4, item);
}
item = new QTableWidgetItem(incr.getDescription());
item->setTextAlignment(Qt::AlignLeft);
ui->tableWidgetIncrement->setItem(currentRow, 5, item);
}
if (ui->tableWidgetIncrement->rowCount()>0)
{
ui->toolButtonRemove->setEnabled(true);
}
ui->tableWidgetIncrement->resizeColumnsToContents();
ui->tableWidgetIncrement->resizeRowsToContents();
ui->tableWidgetIncrement->setCurrentCell( row, column );
}
void DialogIncrements::FillLengthLines()
{
const QHash<QString, qreal> *linesTable = data->DataLengthLines();
QHashIterator<QString, qreal> iHash(*linesTable);
QMap<QString, qreal> map;
//Sorting QHash by name
while (iHash.hasNext())
{
iHash.next();
map.insert(iHash.key(), iHash.value());
}
qint32 currentRow = -1;
QMapIterator<QString, qreal> i(map);
while (i.hasNext())
{
i.next();
qreal length = i.value();
currentRow++;
ui->tableWidgetLines->setRowCount ( linesTable->size() );
QTableWidgetItem *item = new QTableWidgetItem(QString(i.key()));
item->setTextAlignment(Qt::AlignHCenter);
item->setFont(QFont("Times", 12, QFont::Bold));
ui->tableWidgetLines->setItem(currentRow, 0, item);
item = new QTableWidgetItem(QString().setNum(length));
item->setTextAlignment(Qt::AlignHCenter);
ui->tableWidgetLines->setItem(currentRow, 1, item);
}
ui->tableWidgetLines->resizeColumnsToContents();
ui->tableWidgetLines->resizeRowsToContents();
ui->tableWidgetLines->verticalHeader()->setDefaultSectionSize(20);
}
void DialogIncrements::FillLengthSplines()
{
const QHash<QString, qreal> *splinesTable = data->DataLengthSplines();
QHashIterator<QString, qreal> iHash(*splinesTable);
QMap<QString, qreal> map;
//Sorting QHash by name
while (iHash.hasNext())
{
iHash.next();
map.insert(iHash.key(), iHash.value());
}
qint32 currentRow = -1;
QMapIterator<QString, qreal> i(map);
while (i.hasNext())
{
i.next();
qreal length = i.value();
currentRow++;
ui->tableWidgetSplines->setRowCount ( splinesTable->size() );
QTableWidgetItem *item = new QTableWidgetItem(QString(i.key()));
item->setTextAlignment(Qt::AlignLeft);
item->setFont(QFont("Times", 12, QFont::Bold));
ui->tableWidgetSplines->setItem(currentRow, 0, item);
item = new QTableWidgetItem(QString().setNum(length));
item->setTextAlignment(Qt::AlignHCenter);
ui->tableWidgetSplines->setItem(currentRow, 1, item);
}
ui->tableWidgetSplines->resizeColumnsToContents();
ui->tableWidgetSplines->resizeRowsToContents();
ui->tableWidgetSplines->verticalHeader()->setDefaultSectionSize(20);
}
void DialogIncrements::FillLengthArcs()
{
const QHash<QString, qreal> *arcsTable = data->DataLengthArcs();
QHashIterator<QString, qreal> iHash(*arcsTable);
QMap<QString, qreal> map;
//Sorting QHash by name
while (iHash.hasNext())
{
iHash.next();
map.insert(iHash.key(), iHash.value());
}
qint32 currentRow = -1;
QMapIterator<QString, qreal> i(map);
while (i.hasNext())
{
i.next();
qreal length = i.value();
currentRow++;
ui->tableWidgetArcs->setRowCount ( arcsTable->size() );
QTableWidgetItem *item = new QTableWidgetItem(QString(i.key()));
item->setTextAlignment(Qt::AlignHCenter);
item->setFont(QFont("Times", 12, QFont::Bold));
ui->tableWidgetArcs->setItem(currentRow, 0, item);
item = new QTableWidgetItem(QString().setNum(length));
item->setTextAlignment(Qt::AlignHCenter);
ui->tableWidgetArcs->setItem(currentRow, 1, item);
}
ui->tableWidgetArcs->verticalHeader()->setDefaultSectionSize(20);
ui->tableWidgetArcs->resizeColumnsToContents();
ui->tableWidgetArcs->resizeRowsToContents();
}
void DialogIncrements::FullUpdateFromFile()
{
disconnect(ui->tableWidgetMeasurements, &QTableWidget::cellChanged, this, &DialogIncrements::MeasurementChanged);
ui->tableWidgetMeasurements->clearContents();
FillMeasurements();
connect(ui->tableWidgetMeasurements, &QTableWidget::cellChanged, this, &DialogIncrements::MeasurementChanged);
disconnect(ui->tableWidgetIncrement, &QTableWidget::cellChanged, this, &DialogIncrements::IncrementChanged);
ui->tableWidgetIncrement->clearContents();
FillIncrements();
connect(ui->tableWidgetIncrement, &QTableWidget::cellChanged, this, &DialogIncrements::IncrementChanged);
ui->tableWidgetLines->clearContents();
FillLengthLines();
ui->tableWidgetSplines->clearContents();
FillLengthSplines();
ui->tableWidgetArcs->clearContents();
FillLengthArcs();
}
void DialogIncrements::SaveGivenName()
{
m->setGivenName(ui->lineEditGivenName->text());
if (m->SaveDocument(doc->MPath()) == false)
{
qDebug()<<"Can't save GivenName";
}
}
void DialogIncrements::SaveFamilyName()
{
m->setFamilyName(ui->lineEditFamilyName->text());
if (m->SaveDocument(doc->MPath()) == false)
{
qDebug()<<"Can't save FamilyName";
}
}
void DialogIncrements::SaveEmail()
{
m->setMail(ui->lineEditMail->text());
if (m->SaveDocument(doc->MPath()) == false)
{
qDebug()<<"Can't save Email";
}
}
void DialogIncrements::SaveSex(int index)
{
m->setSex(m->StrToGender(ui->comboBoxSex->itemData(index).toString()));
if (m->SaveDocument(doc->MPath()) == false)
{
qDebug()<<"Can't save Sex";
}
}
void DialogIncrements::SaveBirthDate(const QDate & date)
{
m->setBirthDate(date);
if (m->SaveDocument(doc->MPath()) == false)
{
qDebug()<<"Can't save BirthDate";
}
}
void DialogIncrements::OpenTable()
{
QString text = tr("Measurements use different units than pattern. This pattern required measurements in %1")
.arg(doc->UnitsToStr(qApp->patternUnit()));
if (qApp->patternType() == Pattern::Individual)
{
const QString filter(tr("Individual measurements (*.vit)"));
const QString filePath = QFileDialog::getOpenFileName(this, tr("Open file"), QDir::homePath(), filter);
if (filePath.isEmpty())
{
return;
}
VIndividualMeasurements *m1 = nullptr;
try
{
VDomDocument::ValidateXML("://schema/individual_measurements.xsd", filePath);
m1 = new VIndividualMeasurements(data);
m1->setContent(filePath);
}
catch(VException &e)
{
e.CriticalMessageBox(tr("File error."), this);
delete m1;
emit DialogClosed(QDialog::Rejected);
return;
}
Valentina::Units mUnit = m1->Unit();
if (qApp->patternUnit() != mUnit)
{
QMessageBox::critical(this, tr("Wrong units."), text);
delete m1;
return;
}
delete m;
m = m1;
data->ClearMeasurements();
m->Measurements();
emit FullUpdateTree();
doc->SetPath(filePath);
emit haveLiteChange();
}
else
{
const QString filter(tr("Standard measurements (*.vst)"));
const QString filePath = QFileDialog::getOpenFileName(this, tr("Open file"), QDir::homePath(), filter);
if (filePath.isEmpty())
{
return;
}
VStandardMeasurements *m1 = nullptr;
try
{
VDomDocument::ValidateXML("://schema/standard_measurements.xsd", filePath);
m1 = new VStandardMeasurements(data);
m1->setContent(filePath);
Valentina::Units mUnit = m1->Unit();
if (qApp->patternUnit() != mUnit)
{
QMessageBox::critical(this, tr("Wrong units."), text);
delete m1;
return;
}
m1->SetSize();
m1->SetHeight();
data->ClearMeasurements();
m1->Measurements();
delete m1;
emit FullUpdateTree();
doc->SetPath(filePath);
emit haveLiteChange();
}
catch(VException &e)
{
e.CriticalMessageBox(tr("File error."), this);
delete m1;
emit DialogClosed(QDialog::Rejected);
return;
}
}
}
void DialogIncrements::clickedToolButtonAdd()
{
ui->tableWidgetIncrement->setFocus(Qt::OtherFocusReason);
disconnect(ui->tableWidgetIncrement, &QTableWidget::cellChanged, this,
&DialogIncrements::IncrementChanged);
qint32 currentRow = ui->tableWidgetIncrement->rowCount();
ui->tableWidgetIncrement->insertRow( currentRow );
qint32 num = 1;
QString name;
do
{
name = QString(tr("Name_%1")).arg(num);
num++;
} while (data->IncrementTableContains(name));
const quint32 id = data->getNextId();
const QString description(tr("Description"));
VIncrement incr = VIncrement(id, 0, 0, 0, description);
data->AddIncrement(name, incr);
AddIncrementToFile(id, name, 0, 0, 0, description);
QTableWidgetItem *item = new QTableWidgetItem(name);
item->setTextAlignment(Qt::AlignHCenter);
item->setFont(QFont("Times", 12, QFont::Bold));
item->setData(Qt::UserRole, id);
ui->tableWidgetIncrement->setItem(currentRow, 0, item);
ui->tableWidgetIncrement->setCurrentCell(currentRow, 0, QItemSelectionModel::ClearAndSelect);
item = new QTableWidgetItem("0");// calculated value
item->setTextAlignment(Qt::AlignHCenter);
// set the item non-editable (view only), and non-selectable
Qt::ItemFlags flags = item->flags();
flags &= ~(Qt::ItemIsSelectable | Qt::ItemIsEditable); // reset/clear the flag
item->setFlags(flags);
ui->tableWidgetIncrement->setItem(currentRow, 1, item);
item = new QTableWidgetItem("0");// base value
item->setTextAlignment(Qt::AlignHCenter);
ui->tableWidgetIncrement->setItem(currentRow, 2, item);
item = new QTableWidgetItem("0");// in sizes
item->setTextAlignment(Qt::AlignHCenter);
ui->tableWidgetIncrement->setItem(currentRow, 3, item);
item = new QTableWidgetItem("0"); // in heights
item->setTextAlignment(Qt::AlignHCenter);
ui->tableWidgetIncrement->setItem(currentRow, 4, item);
item = new QTableWidgetItem(description);
item->setTextAlignment(Qt::AlignHCenter);
ui->tableWidgetIncrement->setItem(currentRow, 5, item);
ui->toolButtonRemove->setEnabled(true);
connect(ui->tableWidgetIncrement, &QTableWidget::cellChanged, this,
&DialogIncrements::IncrementChanged);
emit haveLiteChange();
}
void DialogIncrements::clickedToolButtonRemove()
{
disconnect(ui->tableWidgetIncrement, &QTableWidget::cellChanged, this,
&DialogIncrements::IncrementChanged);
QTableWidgetItem *item = ui->tableWidgetIncrement->currentItem();
qint32 row = item->row();
QTableWidgetItem *itemName = ui->tableWidgetIncrement->item(row, 0);
data->RemoveIncrementTableRow(itemName->text());
quint32 id = qvariant_cast<quint32>(item->data(Qt::UserRole));
QDomElement domElement = doc->elementById(QString().setNum(id));
if (domElement.isElement())
{
QDomNodeList list = doc->elementsByTagName(VPattern::TagIncrements);
list.at(0).removeChild(domElement);
}
ui->tableWidgetIncrement->removeRow(row);
if (ui->tableWidgetIncrement->rowCount() == 0)
{
ui->toolButtonRemove->setEnabled(false);
}
connect(ui->tableWidgetIncrement, &QTableWidget::cellChanged, this,
&DialogIncrements::IncrementChanged);
emit haveLiteChange();
}
void DialogIncrements::AddIncrementToFile(const quint32 &id, const QString &name, const qreal &base, const qreal &ksize,
const qreal &kheight, const QString &description)
{
QDomElement element = doc->createElement(VPattern::TagIncrement);
doc->SetAttribute(element, VDomDocument::AttrId, id);
doc->SetAttribute(element, VPattern::IncrementName, name);
doc->SetAttribute(element, VPattern::IncrementBase, base);
doc->SetAttribute(element, VPattern::IncrementKsize, ksize);
doc->SetAttribute(element, VPattern::IncrementKgrowth, kheight);
doc->SetAttribute(element, VPattern::IncrementDescription, description);
QDomNodeList list = doc->elementsByTagName(VPattern::TagIncrements);
list.at(0).appendChild(element);
}
void DialogIncrements::IncrementChanged ( qint32 row, qint32 column )
{
const QTableWidgetItem *itemName = ui->tableWidgetIncrement->item(row, 0);
const QTableWidgetItem *item = ui->tableWidgetIncrement->item(row, column);
const quint32 id = qvariant_cast<quint32>(itemName->data(Qt::UserRole));
QDomElement domElement = doc->elementById(QString().setNum(id));
if (domElement.isElement() == false)
{
qDebug()<<"Cant't find increment with id = "<<id<<Q_FUNC_INFO;
return;
}
this->row = row;
switch (column)
{
case 0: // VPattern::IncrementName
doc->SetAttribute(domElement, VPattern::IncrementName, item->text());
data->ClearIncrementTable();
this->column = 2;
emit FullUpdateTree();
break;
case 2: // VPattern::IncrementBase
doc->SetAttribute(domElement, VPattern::IncrementBase, item->text());
this->column = 3;
emit FullUpdateTree();
break;
case 3: // VPattern::IncrementKsize
doc->SetAttribute(domElement, VPattern::IncrementKsize, item->text());
this->column = 4;
emit FullUpdateTree();
break;
case 4: // VPattern::IncrementKgrowth
doc->SetAttribute(domElement, VPattern::IncrementKgrowth, item->text());
this->column = 5;
emit FullUpdateTree();
break;
case 5: // VPattern::IncrementDescription
{
doc->SetAttribute(domElement, VPattern::IncrementDescription, item->text());
VIncrement incr = data->GetIncrement(itemName->text());
incr.setDescription(item->text());
data->UpdateIncrement(itemName->text(), incr);
ui->tableWidgetIncrement->resizeColumnsToContents();
ui->tableWidgetIncrement->resizeRowsToContents();
this->column = 0;
ui->tableWidgetIncrement->setCurrentCell( row, this->column );
break;
}
default:
break;
}
emit haveLiteChange();
}
void DialogIncrements::MeasurementChanged(qint32 row, qint32 column)
{
switch (column)
{
case 2:// value column
{
const QTableWidgetItem *itemName = ui->tableWidgetMeasurements->item(row, 0);
QTableWidgetItem *item = ui->tableWidgetMeasurements->item(row, 2);
VMeasurement measur = data->GetMeasurement(itemName->text());
const QString tag = measur.TagName();
QDomNodeList list = m->elementsByTagName(tag);
QDomElement domElement = list.at(0).toElement();
if (domElement.isElement() == false)
{
qDebug()<<"Cant't find measurement "<<tag<<Q_FUNC_INFO;
return;
}
m->SetAttribute(domElement, VIndividualMeasurements::AttrValue, item->text());
if (m->SaveDocument(doc->MPath()) == false)
{
qDebug()<<"Can't save measurement";
}
bool ok = false;
const qreal base = item->text().replace(",", ".").toDouble(&ok);
if (ok == false)
{
measur.setBase(0);
item->setText("0");
qDebug()<<"Can't convert toDouble measurement value"<<Q_FUNC_INFO;
}
else
{
measur.setBase(base);
}
data->ClearMeasurements();
m->Measurements();
emit FullUpdateTree();
break;
}
default:
break;
}
}
void DialogIncrements::closeEvent(QCloseEvent *event)
{
emit DialogClosed(QDialog::Accepted);
event->accept();
}
DialogIncrements::~DialogIncrements()
{
delete ui;
delete m;
}

View File

@ -29,8 +29,9 @@
#ifndef DIALOGINCREMENTS_H
#define DIALOGINCREMENTS_H
#include "dialogtool.h"
#include "../xml/vdomdocument.h"
#include "../tools/dialogtool.h"
#include "../../xml/vpattern.h"
#include "../../xml/vindividualmeasurements.h"
namespace Ui
{
@ -50,7 +51,7 @@ public:
* @param doc dom document container
* @param parent parent widget
*/
DialogIncrements(VContainer *data, VDomDocument *doc, QWidget *parent = 0);
DialogIncrements(VContainer *data, VPattern *doc, QWidget *parent = nullptr);
~DialogIncrements();
public slots:
/**
@ -66,11 +67,18 @@ public slots:
* @param row number of row
* @param column number of column
*/
void cellChanged ( qint32 row, qint32 column );
void IncrementChanged ( qint32 row, qint32 column );
void MeasurementChanged ( qint32 row, qint32 column );
/**
* @brief FullUpdateFromFile update information in tables form file
*/
void FullUpdateFromFile();
void SaveGivenName();
void SaveFamilyName();
void SaveEmail();
void SaveSex(int index);
void SaveBirthDate(const QDate & date);
void OpenTable();
signals:
/**
* @brief FullUpdateTree signal update data for dom document
@ -95,7 +103,7 @@ private:
/**
* @brief doc dom document container
*/
VDomDocument *doc;
VPattern *doc;
/**
* @brief row save number of row current selected cell
*/
@ -104,14 +112,15 @@ private:
* @brief column save number of column current selected cell
*/
qint32 column;
VIndividualMeasurements *m;
/**
* @brief FillStandardTable fill data for standard table
* @brief FillMeasurements load measurements data
*/
void FillStandardTable();
void FillMeasurements();
/**
* @brief FillIncrementTable fill data for increment table
*/
void FillIncrementTable();
void FillIncrements();
/**
* @brief FillLengthLines fill data for table of lines lengths
*/
@ -130,11 +139,11 @@ private:
* @param name name
* @param base base value
* @param ksize increment in sizes
* @param kgrowth increment in growths
* @param kheight increment in heights
* @param description description of increment
*/
void AddIncrementToFile(qint64 id, QString name, qreal base, qreal ksize, qreal kgrowth,
QString description);
void AddIncrementToFile(const quint32 &id, const QString &name, const qreal &base,
const qreal &ksize, const qreal &kheight, const QString &description);
};
#endif // DIALOGINCREMENTS_H

View File

@ -0,0 +1,605 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DialogIncrements</class>
<widget class="QDialog" name="DialogIncrements">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>979</width>
<height>574</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>800</width>
<height>0</height>
</size>
</property>
<property name="windowTitle">
<string>Increments</string>
</property>
<property name="windowIcon">
<iconset resource="../../../share/resources/icon.qrc">
<normaloff>:/icon/64x64/icon64x64.png</normaloff>:/icon/64x64/icon64x64.png</iconset>
</property>
<property name="locale">
<locale language="English" country="UnitedStates"/>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="tabPosition">
<enum>QTabWidget::North</enum>
</property>
<property name="currentIndex">
<number>1</number>
</property>
<widget class="QWidget" name="tabStandard">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<attribute name="title">
<string>Measurements</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>6</number>
</property>
<item alignment="Qt::AlignTop">
<widget class="QLabel" name="label_5">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Load another measurements table</string>
</property>
</widget>
</item>
<item alignment="Qt::AlignTop">
<widget class="QToolButton" name="toolButtonOpenMeasurements">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset theme="document-open">
<normaloff/>
</iconset>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QToolBox" name="toolBoxMeasurements">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>1</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="currentIndex">
<number>1</number>
</property>
<widget class="QWidget" name="pagePersonalInformation">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>939</width>
<height>411</height>
</rect>
</property>
<attribute name="label">
<string>Personal information</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="labelGivenName">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>84</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Given name</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEditGivenName"/>
</item>
</layout>
</item>
<item row="0" column="2">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>6</number>
</property>
<property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<item>
<widget class="QLabel" name="labelFamilyName">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Family name</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEditFamilyName"/>
</item>
</layout>
</item>
<item row="1" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLabel" name="labelBirthDate">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>84</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Birth date</string>
</property>
</widget>
</item>
<item>
<widget class="QDateEdit" name="dateEditBirthDate">
<property name="displayFormat">
<string>yyyy-MM-dd</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QLabel" name="labelSex">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>84</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Sex</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBoxSex">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="2">
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QLabel" name="labelMail">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>84</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Mail</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEditMail"/>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QWidget" name="pageMeasurements">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>939</width>
<height>411</height>
</rect>
</property>
<attribute name="label">
<string>Measurements</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QTableWidget" name="tableWidgetMeasurements">
<property name="enabled">
<bool>true</bool>
</property>
<property name="editTriggers">
<set>QAbstractItemView::AnyKeyPressed|QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed</set>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::SingleSelection</enum>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<attribute name="horizontalHeaderCascadingSectionResizes">
<bool>false</bool>
</attribute>
<attribute name="horizontalHeaderDefaultSectionSize">
<number>95</number>
</attribute>
<attribute name="horizontalHeaderMinimumSectionSize">
<number>25</number>
</attribute>
<attribute name="horizontalHeaderShowSortIndicator" stdset="0">
<bool>false</bool>
</attribute>
<attribute name="horizontalHeaderStretchLastSection">
<bool>true</bool>
</attribute>
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>
<attribute name="verticalHeaderDefaultSectionSize">
<number>45</number>
</attribute>
<attribute name="verticalHeaderMinimumSectionSize">
<number>8</number>
</attribute>
<column>
<property name="text">
<string>Name</string>
</property>
</column>
<column>
<property name="text">
<string>The calculated value</string>
</property>
</column>
<column>
<property name="text">
<string>Base value</string>
</property>
</column>
<column>
<property name="text">
<string>In sizes</string>
</property>
</column>
<column>
<property name="text">
<string>In heights</string>
</property>
</column>
<column>
<property name="text">
<string>Description</string>
</property>
</column>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tabIncrements">
<attribute name="title">
<string>Increments</string>
</attribute>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="3">
<widget class="QTableWidget" name="tableWidgetIncrement">
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::SingleSelection</enum>
</property>
<property name="sortingEnabled">
<bool>false</bool>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<attribute name="horizontalHeaderCascadingSectionResizes">
<bool>false</bool>
</attribute>
<attribute name="horizontalHeaderDefaultSectionSize">
<number>95</number>
</attribute>
<attribute name="horizontalHeaderMinimumSectionSize">
<number>17</number>
</attribute>
<attribute name="horizontalHeaderShowSortIndicator" stdset="0">
<bool>false</bool>
</attribute>
<attribute name="horizontalHeaderStretchLastSection">
<bool>true</bool>
</attribute>
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>
<attribute name="verticalHeaderCascadingSectionResizes">
<bool>false</bool>
</attribute>
<attribute name="verticalHeaderDefaultSectionSize">
<number>20</number>
</attribute>
<attribute name="verticalHeaderStretchLastSection">
<bool>false</bool>
</attribute>
<column>
<property name="text">
<string>Name</string>
</property>
</column>
<column>
<property name="text">
<string>The calculated value</string>
</property>
</column>
<column>
<property name="text">
<string>Base value</string>
</property>
</column>
<column>
<property name="text">
<string>In sizes</string>
</property>
</column>
<column>
<property name="text">
<string>In heights</string>
</property>
</column>
<column>
<property name="text">
<string>Description</string>
</property>
</column>
</widget>
</item>
<item row="1" column="0">
<widget class="QToolButton" name="toolButtonAdd">
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset theme="list-add">
<normaloff/>
</iconset>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QToolButton" name="toolButtonRemove">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset theme="list-remove">
<normaloff/>
</iconset>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_3">
<attribute name="title">
<string>Lines</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QTableWidget" name="tableWidgetLines">
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<attribute name="horizontalHeaderCascadingSectionResizes">
<bool>false</bool>
</attribute>
<attribute name="horizontalHeaderDefaultSectionSize">
<number>137</number>
</attribute>
<attribute name="horizontalHeaderStretchLastSection">
<bool>false</bool>
</attribute>
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>
<column>
<property name="text">
<string>Line</string>
</property>
</column>
<column>
<property name="text">
<string>Length</string>
</property>
</column>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_4">
<attribute name="title">
<string>Curves</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0">
<widget class="QTableWidget" name="tableWidgetSplines">
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<attribute name="horizontalHeaderCascadingSectionResizes">
<bool>false</bool>
</attribute>
<attribute name="horizontalHeaderDefaultSectionSize">
<number>137</number>
</attribute>
<attribute name="horizontalHeaderStretchLastSection">
<bool>false</bool>
</attribute>
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>
<column>
<property name="text">
<string>Curve</string>
</property>
</column>
<column>
<property name="text">
<string>Length</string>
</property>
</column>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_5">
<attribute name="title">
<string>Arcs</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_5">
<item row="0" column="0">
<widget class="QTableWidget" name="tableWidgetArcs">
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<attribute name="horizontalHeaderCascadingSectionResizes">
<bool>false</bool>
</attribute>
<attribute name="horizontalHeaderDefaultSectionSize">
<number>137</number>
</attribute>
<attribute name="horizontalHeaderStretchLastSection">
<bool>false</bool>
</attribute>
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>
<column>
<property name="text">
<string>Arc</string>
</property>
</column>
<column>
<property name="text">
<string>Length</string>
</property>
</column>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<tabstops>
<tabstop>tableWidgetMeasurements</tabstop>
<tabstop>tableWidgetIncrement</tabstop>
<tabstop>toolButtonAdd</tabstop>
<tabstop>toolButtonRemove</tabstop>
<tabstop>tableWidgetLines</tabstop>
<tabstop>tableWidgetSplines</tabstop>
<tabstop>tableWidgetArcs</tabstop>
</tabstops>
<resources>
<include location="../../../share/resources/icon.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -0,0 +1,287 @@
/************************************************************************
**
** @file dialogindividualmeasurements.cpp
** @author Roman Telezhinsky <dismine@gmail.com>
** @date 22 2, 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 "dialogindividualmeasurements.h"
#include "ui_dialogindividualmeasurements.h"
#include <QButtonGroup>
#include "../../xml/vindividualmeasurements.h"
#include <QSettings>
#include <QFileDialog>
#include <QMessageBox>
#include "../../widgets/vapplication.h"
DialogIndividualMeasurements::DialogIndividualMeasurements(VContainer *data, const QString &patternPieceName,
QWidget *parent) :
QDialog(parent), ui(new Ui::DialogIndividualMeasurements), _name(patternPieceName), _tablePath(QString()),
data(data)
{
ui->setupUi(this);
{
const QPushButton *bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
Q_CHECK_PTR(bOk);
connect(bOk, &QPushButton::clicked, this, &DialogIndividualMeasurements::DialogAccepted);
}
{
const QPushButton *bCansel = ui->buttonBox->button(QDialogButtonBox::Cancel);
Q_CHECK_PTR(bCansel);
connect(bCansel, &QPushButton::clicked, this, &DialogIndividualMeasurements::DialogRejected);
}
ui->lineEditName->setText(_name);
LoadIndividualTables();
InitUnits();
CheckState();
connect(ui->lineEditName, &QLineEdit::textChanged, this, &DialogIndividualMeasurements::CheckState);
connect(ui->buttonGroupPath, static_cast<void (QButtonGroup::*)(int)>(&QButtonGroup::buttonClicked), this,
&DialogIndividualMeasurements::CheckState);
connect(ui->toolButtonOpenExist, &QToolButton::clicked, this, &DialogIndividualMeasurements::OpenTable);
connect(ui->toolButtonOpenNew, &QToolButton::clicked, this, &DialogIndividualMeasurements::NewTable);
}
DialogIndividualMeasurements::~DialogIndividualMeasurements()
{
delete ui;
}
void DialogIndividualMeasurements::DialogAccepted()
{
_name = ui->lineEditName->text();
if (ui->radioButtonExistM->isChecked())
{
_tablePath = ui->lineEditPathExistM->text();
}
else
{
_tablePath = ui->lineEditPathNewM->text();
QFile table(_tablePath);
if (table.exists())
{
table.remove();
}
const qint32 index = ui->comboBoxLang->currentIndex();
QString path = ui->comboBoxLang->itemData(index).toString();
QFile iMeasur(path);
if ( iMeasur.copy(_tablePath) == false )
{
QMessageBox::warning(this, tr("Could not create measurements file"), tr("Please try again or change file"));
DialogRejected();
}
}
try
{
VDomDocument::ValidateXML("://schema/individual_measurements.xsd", _tablePath);
VIndividualMeasurements m(data);
m.setContent(_tablePath);
const qint32 index = ui->comboBoxUnits->currentIndex();
Valentina::Units unit = VDomDocument::StrToUnits(ui->comboBoxUnits->itemData(index).toString());
m.setUnit(unit);
qApp->setPatternUnit( m.Unit());
QFile iMeasur(_tablePath);
if (iMeasur.open(QIODevice::WriteOnly| QIODevice::Truncate))
{
const int indent = 4;
QTextStream out(&iMeasur);
out.setCodec("UTF-8");
m.save(out, indent);
iMeasur.close();
}
}
catch(VException &e)
{
e.CriticalMessageBox(tr("File error."), this);
qDebug()<<"File error."<<e.ErrorMessage()<<e.DetailedInformation()<<Q_FUNC_INFO;
DialogRejected();
}
accept();
}
void DialogIndividualMeasurements::DialogRejected()
{
_name.clear();
_tablePath.clear();
reject();
}
void DialogIndividualMeasurements::CheckState()
{
bool flagName = false;
if (ui->lineEditName->text().isEmpty() == false)
{
flagName = true;
}
bool flagPath = false;
if (ui->radioButtonExistM->isChecked())
{
ui->lineEditPathExistM->setEnabled(true);
ui->toolButtonOpenExist->setEnabled(true);
ui->lineEditPathNewM->setEnabled(false);
ui->toolButtonOpenNew->setEnabled(false);
ui->comboBoxLang->setEnabled(false);
ui->comboBoxUnits->setEnabled(false);
if (ui->lineEditPathExistM->text().isEmpty() == false)
{
flagPath = true;
}
}
else
{
ui->lineEditPathNewM->setEnabled(true);
ui->toolButtonOpenNew->setEnabled(true);
ui->comboBoxLang->setEnabled(true);
ui->comboBoxUnits->setEnabled(true);
ui->toolButtonOpenExist->setEnabled(false);
ui->lineEditPathExistM->setEnabled(false);
if (ui->lineEditPathNewM->text().isEmpty() == false)
{
flagPath = true;
}
}
bool flagLang = false;
{
const QComboBox *box = ui->comboBoxLang;
Q_CHECK_PTR(box);
if (box->count() > 0 && box->currentIndex() != -1)
{
flagLang = true;
}
}
QPushButton *bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
Q_CHECK_PTR(bOk);
bOk->setEnabled(flagName && flagPath && flagLang);
}
void DialogIndividualMeasurements::LoadIndividualTables()
{
QStringList filters;
filters << "*.vit";
QDir tablesDir(qApp->pathToTables());
tablesDir.setNameFilters(filters);
tablesDir.setCurrent(qApp->pathToTables());
const QStringList allFiles = tablesDir.entryList(QDir::NoDotAndDotDot | QDir::Files);
if (allFiles.isEmpty() == true)
{
ui->comboBoxLang->clear();
CheckState();
return;
}
for (int i = 0; i < allFiles.size(); ++i)
{
QFileInfo fi(allFiles.at(i));
try
{
VDomDocument::ValidateXML("://schema/individual_measurements.xsd", fi.absoluteFilePath());
VIndividualMeasurements m(data);
m.setContent(fi.absoluteFilePath());
const QString lang = QLocale(m.Language()).nativeLanguageName();
ui->comboBoxLang->addItem(lang, QVariant(fi.absoluteFilePath()));
}
catch(VException &e)
{
qDebug()<<"File error."<<e.ErrorMessage()<<e.DetailedInformation()<<Q_FUNC_INFO;
continue;
}
}
QSettings settings(QSettings::IniFormat, QSettings::UserScope, QApplication::organizationName(),
QApplication::applicationName());
QString defaultLocale = QLocale::system().name(); // e.g. "de_DE"
defaultLocale.truncate(defaultLocale.lastIndexOf('_')); // e.g. "de"
QString checkedLocale = settings.value("configuration/locale", defaultLocale).toString();
//TODO make sure this part work.
// set default translators and language checked
qint32 index = ui->comboBoxLang->findData(checkedLocale);
if (index != -1)
{
ui->comboBoxLang->setCurrentIndex(index);
}
}
void DialogIndividualMeasurements::OpenTable()
{
const QString filter(tr("Individual measurements (*.vit)"));
QString fileName = QFileDialog::getOpenFileName(this, tr("Open file"), QDir::homePath(), filter);
if (fileName.isEmpty())
{
return;
}
try
{
VDomDocument::ValidateXML("://schema/individual_measurements.xsd", fileName);
}
catch(VException &e)
{
e.CriticalMessageBox(tr("File error."), this);
fileName.clear();
}
ui->lineEditPathExistM->setText(fileName);
ui->lineEditPathExistM->setToolTip(fileName);
CheckState();
}
void DialogIndividualMeasurements::NewTable()
{
QString dir = QDir::homePath()+"/measurements.vit";
QString name = QFileDialog::getSaveFileName(this, tr("Where save measurements?"), dir,
tr("Individual measurements (*.vit)"));
if (name.isEmpty())
{
return;
}
// what if the users did not specify a suffix...?
QFileInfo f( name );
if (f.suffix().isEmpty() && f.suffix() != "vit")
{
name += ".vit";
}
ui->lineEditPathNewM->setText(name);
ui->lineEditPathNewM->setToolTip(name);
CheckState();
}
void DialogIndividualMeasurements::InitUnits()
{
ui->comboBoxUnits->addItem(tr("centimeter"), QVariant(VDomDocument::UnitsToStr(Valentina::Cm)));
ui->comboBoxUnits->addItem(tr("inch"), QVariant(VDomDocument::UnitsToStr(Valentina::Inch)));
}

View File

@ -0,0 +1,74 @@
/************************************************************************
**
** @file dialogindividualmeasurements.h
** @author Roman Telezhinsky <dismine@gmail.com>
** @date 22 2, 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 DIALOGINDIVIDUALMEASUREMENTS_H
#define DIALOGINDIVIDUALMEASUREMENTS_H
#include <QDialog>
#include "../../container/vcontainer.h"
namespace Ui
{
class DialogIndividualMeasurements;
}
class DialogIndividualMeasurements : public QDialog
{
Q_OBJECT
public:
DialogIndividualMeasurements(VContainer *data, const QString &patternPieceName, QWidget *parent = nullptr);
~DialogIndividualMeasurements();
QString name() const;
QString tablePath() const;
public slots:
void OpenTable();
void NewTable();
void CheckState();
void DialogAccepted();
void DialogRejected();
private:
Q_DISABLE_COPY(DialogIndividualMeasurements)
Ui::DialogIndividualMeasurements *ui;
QString _name;
QString _tablePath;
VContainer *data;
void LoadIndividualTables();
void InitUnits();
};
inline QString DialogIndividualMeasurements::name() const
{
return _name;
}
inline QString DialogIndividualMeasurements::tablePath() const
{
return _tablePath;
}
#endif // DIALOGINDIVIDUALMEASUREMENTS_H

View File

@ -0,0 +1,216 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DialogIndividualMeasurements</class>
<widget class="QDialog" name="DialogIndividualMeasurements">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>397</width>
<height>280</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Pattern piece name</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEditName"/>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QRadioButton" name="radioButtonExistM">
<property name="text">
<string>Exist measurements</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
<attribute name="buttonGroup">
<string notr="true">buttonGroupPath</string>
</attribute>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>Path:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEditPathExistM">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButtonOpenExist">
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset theme="document-open">
<normaloff/>
</iconset>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QRadioButton" name="radioButtonNewM">
<property name="text">
<string>New measurements</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<attribute name="buttonGroup">
<string notr="true">buttonGroupPath</string>
</attribute>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Language:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBoxLang">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QLabel" name="label_5">
<property name="text">
<string>Units:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBoxUnits"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Path:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEditPathNewM">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButtonOpenNew">
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset theme="document-new">
<normaloff/>
</iconset>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>DialogIndividualMeasurements</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>DialogIndividualMeasurements</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
<buttongroups>
<buttongroup name="buttonGroupPath"/>
</buttongroups>
</ui>

View File

@ -0,0 +1,60 @@
/************************************************************************
**
** @file dialogpatterntype.cpp
** @author Roman Telezhinsky <dismine@gmail.com>
** @date 21 2, 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 "dialogmeasurements.h"
#include "ui_dialogmeasurements.h"
DialogMeasurements::DialogMeasurements(QWidget *parent) :
QDialog(parent), ui(new Ui::DialogMeasurements), result(Measurements::Individual)
{
ui->setupUi(this);
connect(ui->toolButtonStandard, &QToolButton::clicked, this, &DialogMeasurements::StandardMeasurements);
connect(ui->toolButtonIndividual, &QToolButton::clicked, this, &DialogMeasurements::IndividualMeasurements);
}
DialogMeasurements::~DialogMeasurements()
{
delete ui;
}
Measurements::Type DialogMeasurements::type() const
{
return result;
}
void DialogMeasurements::StandardMeasurements()
{
result = Measurements::Standard;
accept();
}
void DialogMeasurements::IndividualMeasurements()
{
result = Measurements::Individual;
accept();
}

View File

@ -1,8 +1,8 @@
/************************************************************************
**
** @file vexceptionuniqueid.cpp
** @file dialogpatterntype.h
** @author Roman Telezhinsky <dismine@gmail.com>
** @date November 15, 2013
** @date 21 2, 2014
**
** @brief
** @copyright
@ -26,28 +26,39 @@
**
*************************************************************************/
#include "vexceptionuniqueid.h"
#ifndef DIALOGMEASUREMENTS_H
#define DIALOGMEASUREMENTS_H
#include <QtWidgets>
#include <QDialog>
VExceptionUniqueId::VExceptionUniqueId(const QString &what, const QDomElement &domElement)
:VException(what), tagText(QString()), tagName(QString()), lineNumber(-1)
namespace Ui
{
Q_ASSERT_X(domElement.isNull() == false, Q_FUNC_INFO, "domElement is null");
QTextStream stream(&tagText);
domElement.save(stream, 4);
tagName = domElement.tagName();
lineNumber = domElement.lineNumber();
class DialogMeasurements;
}
QString VExceptionUniqueId::ErrorMessage() const
namespace Measurements
{
QString error = QString("ExceptionUniqueId: %1").arg(what);
return error;
/**
* @brief The Type enum pattern measurements.
*/
enum Type { Standard, Individual };
Q_DECLARE_FLAGS(Types, Type)
}
Q_DECLARE_OPERATORS_FOR_FLAGS( Measurements::Types )
QString VExceptionUniqueId::DetailedInformation() const
class DialogMeasurements : public QDialog
{
QString detail = QString("tag: %1 in line %2\nFull tag:\n%3").arg(tagName).arg(lineNumber).arg(tagText);
return detail;
}
Q_OBJECT
public:
explicit DialogMeasurements(QWidget *parent = nullptr);
~DialogMeasurements();
Measurements::Type type() const;
private:
Q_DISABLE_COPY(DialogMeasurements)
Ui::DialogMeasurements *ui;
Measurements::Type result;
void StandardMeasurements();
void IndividualMeasurements();
};
#endif // DIALOGMEASUREMENTS_H

View File

@ -0,0 +1,139 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DialogMeasurements</class>
<widget class="QDialog" name="DialogMeasurements">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>385</width>
<height>244</height>
</rect>
</property>
<property name="windowTitle">
<string>Measurements</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:18pt;&quot;&gt;Please, choose pattern type.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>13</number>
</property>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="leftMargin">
<number>5</number>
</property>
<property name="topMargin">
<number>5</number>
</property>
<property name="rightMargin">
<number>5</number>
</property>
<property name="bottomMargin">
<number>5</number>
</property>
<item>
<widget class="QToolButton" name="toolButtonStandard">
<property name="text">
<string>Graduation</string>
</property>
<property name="icon">
<iconset resource="../../../share/resources/icon.qrc">
<normaloff>:/icon/Graduation.png</normaloff>:/icon/Graduation.png</iconset>
</property>
<property name="iconSize">
<size>
<width>160</width>
<height>120</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Use for creation pattern standard measurement table</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing">
<number>6</number>
</property>
<property name="leftMargin">
<number>5</number>
</property>
<property name="topMargin">
<number>5</number>
</property>
<property name="rightMargin">
<number>5</number>
</property>
<property name="bottomMargin">
<number>5</number>
</property>
<item>
<widget class="QToolButton" name="toolButtonIndividual">
<property name="text">
<string>Individual</string>
</property>
<property name="icon">
<iconset resource="../../../share/resources/icon.qrc">
<normaloff>:/icon/individual.png</normaloff>:/icon/individual.png</iconset>
</property>
<property name="iconSize">
<size>
<width>160</width>
<height>120</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Use for creation pattern individual measurements</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
<tabstops>
<tabstop>toolButtonIndividual</tabstop>
<tabstop>toolButtonStandard</tabstop>
</tabstops>
<resources>
<include location="../../../share/resources/icon.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -30,7 +30,7 @@
#include "ui_dialogpatternproperties.h"
#include <QSettings>
DialogPatternProperties::DialogPatternProperties(VDomDocument *doc, QWidget *parent) :
DialogPatternProperties::DialogPatternProperties(VPattern *doc, QWidget *parent) :
QDialog(parent), ui(new Ui::DialogPatternProperties), doc(doc)
{
ui->setupUi(this);
@ -39,7 +39,7 @@ DialogPatternProperties::DialogPatternProperties(VDomDocument *doc, QWidget *par
QSettings settings(QSettings::IniFormat, QSettings::UserScope, QApplication::organizationName(),
QApplication::applicationName());
#ifdef Q_OS_WIN32
#ifdef Q_OS_WIN
QString user = settings.value("pattern/user", QString::fromLocal8Bit(qgetenv("USERNAME").constData())).toString();
#else
QString user = settings.value("pattern/user", QString::fromLocal8Bit(qgetenv("USER").constData())).toString();
@ -57,7 +57,7 @@ DialogPatternProperties::DialogPatternProperties(VDomDocument *doc, QWidget *par
Q_CHECK_PTR(bCansel);
connect(bCansel, &QPushButton::clicked, this, &DialogPatternProperties::close);
connect(this, &DialogPatternProperties::haveChange, this->doc, &VDomDocument::haveLiteChange);
connect(this, &DialogPatternProperties::haveChange, this->doc, &VPattern::haveLiteChange);
}
DialogPatternProperties::~DialogPatternProperties()

View File

@ -30,17 +30,18 @@
#define DIALOGPATTERNPROPERTIES_H
#include <QDialog>
#include "../xml/vdomdocument.h"
#include "../../xml/vpattern.h"
namespace Ui {
class DialogPatternProperties;
namespace Ui
{
class DialogPatternProperties;
}
class DialogPatternProperties : public QDialog
{
Q_OBJECT
public:
DialogPatternProperties(VDomDocument *doc, QWidget *parent = 0);
DialogPatternProperties(VPattern *doc, QWidget *parent = nullptr);
virtual ~DialogPatternProperties();
signals:
void haveChange();
@ -49,7 +50,7 @@ public slots:
private:
Q_DISABLE_COPY(DialogPatternProperties)
Ui::DialogPatternProperties *ui;
VDomDocument *doc;
VPattern *doc;
void Write(const QString &tagName, const QString &text) const;
};

View File

@ -0,0 +1,160 @@
/************************************************************************
**
** @file dialogstandardmeasurements.cpp
** @author Roman Telezhinsky <dismine@gmail.com>
** @date 21 2, 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 "dialogstandardmeasurements.h"
#include "ui_dialogstandardmeasurements.h"
#include <QDir>
#include "../../xml/vstandardmeasurements.h"
#include "../../widgets/vapplication.h"
DialogStandardMeasurements::DialogStandardMeasurements(VContainer *data, const QString &patternPieceName,
QWidget *parent) :
QDialog(parent), ui(new Ui::DialogStandardMeasurements), data(data), _name(patternPieceName), _tablePath(QString())
{
ui->setupUi(this);
{
const QPushButton *bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
Q_CHECK_PTR(bOk);
connect(bOk, &QPushButton::clicked, this, &DialogStandardMeasurements::DialogAccepted);
}
{
const QPushButton *bCansel = ui->buttonBox->button(QDialogButtonBox::Cancel);
Q_CHECK_PTR(bCansel);
connect(bCansel, &QPushButton::clicked, this, &DialogStandardMeasurements::DialogRejected);
}
ui->lineEditName->setText(_name);
LoadStandardTables();
CheckState();
connect(ui->lineEditName, &QLineEdit::textChanged, this, &DialogStandardMeasurements::CheckState);
}
DialogStandardMeasurements::~DialogStandardMeasurements()
{
delete ui;
}
QString DialogStandardMeasurements::name() const
{
return _name;
}
QString DialogStandardMeasurements::tablePath() const
{
return _tablePath;
}
void DialogStandardMeasurements::DialogAccepted()
{
_name = ui->lineEditName->text();
const qint32 index = ui->comboBoxTables->currentIndex();
_tablePath = ui->comboBoxTables->itemData(index).toString();
try
{
VDomDocument::ValidateXML("://schema/standard_measurements.xsd", _tablePath);
VStandardMeasurements m(data);
m.setContent(_tablePath);
qApp->setPatternUnit(m.Unit());
}
catch(VException &e)
{
e.CriticalMessageBox(tr("File error."), this);
qDebug()<<"File error."<<e.ErrorMessage()<<e.DetailedInformation()<<Q_FUNC_INFO;
return;
}
accept();
}
void DialogStandardMeasurements::DialogRejected()
{
_name.clear();
_tablePath.clear();
reject();
}
void DialogStandardMeasurements::CheckState()
{
bool flagName = false;
if (ui->lineEditName->text().isEmpty() == false)
{
flagName = true;
}
bool flagTable = false;
{
const QComboBox *box = ui->comboBoxTables;
Q_CHECK_PTR(box);
if (box->count() > 0 && box->currentIndex() != -1)
{
flagTable = true;
}
}
QPushButton *bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
Q_CHECK_PTR(bOk);
bOk->setEnabled(flagTable && flagName);
}
void DialogStandardMeasurements::LoadStandardTables()
{
QStringList filters;
filters << "*.vst";
QDir tablesDir(qApp->pathToTables());
tablesDir.setNameFilters(filters);
tablesDir.setCurrent(qApp->pathToTables());
const QStringList allFiles = tablesDir.entryList(QDir::NoDotAndDotDot | QDir::Files);
if (allFiles.isEmpty() == true)
{
ui->comboBoxTables->clear();
CheckState();
return;
}
for (int i = 0; i < allFiles.size(); ++i)
{
QFileInfo fi(allFiles.at(i));
try
{
VDomDocument::ValidateXML("://schema/standard_measurements.xsd", fi.absoluteFilePath());
VStandardMeasurements m(data);
m.setContent(fi.absoluteFilePath());
ui->comboBoxTables->addItem(m.Description(), QVariant(fi.absoluteFilePath()));
}
catch(VException &e)
{
qDebug()<<"File error."<<e.ErrorMessage()<<e.DetailedInformation()<<Q_FUNC_INFO;
continue;
}
}
}

View File

@ -0,0 +1,61 @@
/************************************************************************
**
** @file dialogstandardmeasurements.h
** @author Roman Telezhinsky <dismine@gmail.com>
** @date 21 2, 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 DIALOGSTANDARDMEASUREMENTS_H
#define DIALOGSTANDARDMEASUREMENTS_H
#include <QDialog>
#include "../../container/vcontainer.h"
namespace Ui
{
class DialogStandardMeasurements;
}
class DialogStandardMeasurements : public QDialog
{
Q_OBJECT
public:
DialogStandardMeasurements(VContainer *data, const QString &patternPieceName, QWidget *parent = nullptr);
~DialogStandardMeasurements();
QString name() const;
QString tablePath() const;
public slots:
void DialogAccepted();
void DialogRejected();
void CheckState();
private:
Q_DISABLE_COPY(DialogStandardMeasurements)
Ui::DialogStandardMeasurements *ui;
VContainer *data;
QString _name;
QString _tablePath;
void LoadStandardTables();
};
#endif // DIALOGSTANDARDMEASUREMENTS_H

View File

@ -0,0 +1,127 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DialogStandardMeasurements</class>
<widget class="QDialog" name="DialogStandardMeasurements">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>452</width>
<height>115</height>
</rect>
</property>
<property name="windowTitle">
<string>Standard table</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>206</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Pattern piece name</string>
</property>
<property name="margin">
<number>0</number>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEditName">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Standard measurements table</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBoxTables">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>DialogStandardMeasurements</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>DialogStandardMeasurements</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@ -27,7 +27,8 @@
*************************************************************************/
#include "pages.h"
#include "../options.h"
#include "../../options.h"
#include "../../widgets/vapplication.h"
ConfigurationPage::ConfigurationPage(QWidget *parent):
QWidget(parent), autoSaveCheck(0), autoTime(0), langCombo(0), osOptionCheck(0), langChanged(false)
@ -71,18 +72,14 @@ QGroupBox *ConfigurationPage::SaveGroup()
QApplication::applicationName());
QGroupBox *saveGroup = new QGroupBox(tr("Save"));
Q_CHECK_PTR(saveGroup);
autoSaveCheck = new QCheckBox(tr("Auto-save modified pattern"));
Q_CHECK_PTR(autoSaveCheck);
bool autoSaveValue = settings.value("configuration/autosave/state", 1).toBool();
autoSaveCheck->setChecked(autoSaveValue);
QLabel *intervalLabel = new QLabel(tr("Interval:"));
Q_CHECK_PTR(intervalLabel);
autoTime = new QSpinBox();
Q_CHECK_PTR(autoTime);
bool ok = true;
qint32 autoTimeValue = settings.value("configuration/autosave/time", 5).toInt(&ok);
if (ok == false)
@ -94,13 +91,11 @@ QGroupBox *ConfigurationPage::SaveGroup()
autoTime->setSuffix(tr("min"));
QHBoxLayout *autosaveLayout = new QHBoxLayout;
Q_CHECK_PTR(autosaveLayout);
autosaveLayout->addWidget(autoSaveCheck);
autosaveLayout->addWidget(intervalLabel);
autosaveLayout->addWidget(autoTime);
QVBoxLayout *saveLayout = new QVBoxLayout;
Q_CHECK_PTR(saveLayout);
saveLayout->addLayout(autosaveLayout);
saveGroup->setLayout(saveLayout);
return saveGroup;
@ -112,21 +107,15 @@ QGroupBox *ConfigurationPage::LangGroup()
QApplication::applicationName());
QGroupBox *langGroup = new QGroupBox(tr("Language"));
Q_CHECK_PTR(langGroup);
QLabel *guiLabel = new QLabel(tr("GUI language"));
Q_CHECK_PTR(guiLabel);
langCombo = new QComboBox;
Q_CHECK_PTR(langCombo);
// format systems language
QString defaultLocale = QLocale::system().name(); // e.g. "de_DE"
defaultLocale.truncate(defaultLocale.lastIndexOf('_')); // e.g. "de"
QString checkedLocale = settings.value("configuration/locale", defaultLocale).toString();
QString m_langPath = QApplication::applicationDirPath();
m_langPath.append(translationsPath);
QString m_langPath = qApp->translationsPath();
QDir dir(m_langPath);
QStringList fileNames = dir.entryList(QStringList("valentina_*.qm"));
@ -158,26 +147,21 @@ QGroupBox *ConfigurationPage::LangGroup()
&ConfigurationPage::LangChenged);
QHBoxLayout *guiLangLayout = new QHBoxLayout;
Q_CHECK_PTR(guiLangLayout);
guiLangLayout->addWidget(guiLabel);
guiLangLayout->addWidget(langCombo);
QLabel *separatorLabel = new QLabel(tr("Decimal separator parts"));
Q_CHECK_PTR(separatorLabel);
osOptionCheck = new QCheckBox(tr("With OS options (.)"));
Q_CHECK_PTR(osOptionCheck);
//bool osOptionValue = settings.value("configuration/osSeparator", 1).toBool();
//osOptionCheck->setChecked(osOptionValue);
osOptionCheck->setEnabled(false);
QHBoxLayout *separatorLayout = new QHBoxLayout;
Q_CHECK_PTR(separatorLayout);
separatorLayout->addWidget(separatorLabel);
separatorLayout->addWidget(osOptionCheck);
QVBoxLayout *langLayout = new QVBoxLayout;
Q_CHECK_PTR(langLayout);
langLayout->addLayout(guiLangLayout);
langLayout->addLayout(separatorLayout);
langGroup->setLayout(langLayout);
@ -215,14 +199,10 @@ QGroupBox *PatternPage::UserGroup()
QApplication::applicationName());
QGroupBox *userGroup = new QGroupBox(tr("User"));
Q_CHECK_PTR(userGroup);
QLabel *nameLabel = new QLabel(tr("User name"));
Q_CHECK_PTR(nameLabel);
userName = new QLineEdit;
Q_CHECK_PTR(userName);
#ifdef Q_OS_WIN32
#ifdef Q_OS_WIN
QString user = settings.value("pattern/user", QString::fromLocal8Bit(qgetenv("USERNAME").constData())).toString();
#else
QString user = settings.value("pattern/user", QString::fromLocal8Bit(qgetenv("USER").constData())).toString();
@ -230,12 +210,10 @@ QGroupBox *PatternPage::UserGroup()
userName->setText(user);
QHBoxLayout *nameLayout = new QHBoxLayout;
Q_CHECK_PTR(nameLayout);
nameLayout->addWidget(nameLabel);
nameLayout->addWidget(userName);
QVBoxLayout *userLayout = new QVBoxLayout;
Q_CHECK_PTR(userLayout);
userLayout->addLayout(nameLayout);
userGroup->setLayout(userLayout);
return userGroup;
@ -247,20 +225,16 @@ QGroupBox *PatternPage::GraphOutputGroup()
// QApplication::applicationName());
QGroupBox *graphOutputGroup = new QGroupBox(tr("Graphical output"));
Q_CHECK_PTR(graphOutputGroup);
graphOutputCheck = new QCheckBox(tr("Use antialiasing"));
Q_CHECK_PTR(graphOutputCheck);
//bool graphOutputValue = settings.value("pattern/graphicalOutput", 1).toBool();
//graphOutputCheck->setChecked(graphOutputValue);
graphOutputCheck->setEnabled(false);
QHBoxLayout *graphLayout = new QHBoxLayout;
Q_CHECK_PTR(graphLayout);
graphLayout->addWidget(graphOutputCheck);
QVBoxLayout *graphOutputLayout = new QVBoxLayout;
Q_CHECK_PTR(graphOutputLayout);
graphOutputLayout->addLayout(graphLayout);
graphOutputGroup->setLayout(graphOutputLayout);
return graphOutputGroup;
@ -272,13 +246,8 @@ QGroupBox *PatternPage::UndoneGroup()
// QApplication::applicationName());
QGroupBox *undoneGroup = new QGroupBox(tr("Undone"));
Q_CHECK_PTR(undoneGroup);
QLabel *undoneLabel = new QLabel(tr("Count steps"));
Q_CHECK_PTR(undoneLabel);
undoneCount = new QSpinBox;
Q_CHECK_PTR(undoneCount);
// bool ok = true;
// qint32 count = settings.value("pattern/undone", 100).toInt(&ok);
// if (ok == false)
@ -289,12 +258,10 @@ QGroupBox *PatternPage::UndoneGroup()
undoneCount->setEnabled(false);
QHBoxLayout *countLayout = new QHBoxLayout;
Q_CHECK_PTR(countLayout);
countLayout->addWidget(undoneLabel);
countLayout->addWidget(undoneCount);
QVBoxLayout *undoneLayout = new QVBoxLayout;
Q_CHECK_PTR(undoneLayout);
undoneLayout->addLayout(countLayout);
undoneGroup->setLayout(undoneLayout);
return undoneGroup;

View File

@ -35,7 +35,7 @@ class ConfigurationPage : public QWidget
{
Q_OBJECT
public:
ConfigurationPage(QWidget *parent = 0);
ConfigurationPage(QWidget *parent = nullptr);
void Apply();
public slots:
void LangChenged();
@ -54,7 +54,7 @@ class PatternPage : public QWidget
{
Q_OBJECT
public:
PatternPage(QWidget *parent = 0);
PatternPage(QWidget *parent = nullptr);
void Apply();
private:
Q_DISABLE_COPY(PatternPage)

View File

@ -1,483 +0,0 @@
/************************************************************************
**
** @file dialoghistory.cpp
** @author Roman Telezhinsky <dismine@gmail.com>
** @date November 15, 2013
**
** @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 "dialoghistory.h"
#include "ui_dialoghistory.h"
#include "../geometry/varc.h"
#include "../geometry/vspline.h"
#include "../geometry/vsplinepath.h"
#include "../tools/vabstracttool.h"
#include "../tools/drawTools/vtoolcutspline.h"
#include "../tools/drawTools/vtoolcutsplinepath.h"
#include "../tools/drawTools/vtoolcutarc.h"
#include <QDebug>
#include <QPushButton>
DialogHistory::DialogHistory(VContainer *data, VDomDocument *doc, QWidget *parent)
:DialogTool(data, parent), ui(new Ui::DialogHistory), doc(doc), cursorRow(0),
cursorToolRecordRow(0)
{
ui->setupUi(this);
bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
connect(bOk, &QPushButton::clicked, this, &DialogHistory::DialogAccepted);
FillTable();
InitialTable();
connect(ui->tableWidget, &QTableWidget::cellClicked, this, &DialogHistory::cellClicked);
connect(this, &DialogHistory::ShowHistoryTool, doc, &VDomDocument::ShowHistoryTool);
connect(doc, &VDomDocument::ChangedCursor, this, &DialogHistory::ChangedCursor);
connect(doc, &VDomDocument::patternChanged, this, &DialogHistory::UpdateHistory);
connect(doc, &VDomDocument::ChangedActivDraw, this, &DialogHistory::UpdateHistory);
ShowPoint();
}
DialogHistory::~DialogHistory()
{
delete ui;
}
void DialogHistory::DialogAccepted()
{
QTableWidgetItem *item = ui->tableWidget->item(cursorToolRecordRow, 0);
qint64 id = qvariant_cast<qint64>(item->data(Qt::UserRole));
emit ShowHistoryTool(id, Qt::green, false);
emit DialogClosed(QDialog::Accepted);
}
void DialogHistory::cellClicked(int row, int column)
{
if (column == 0)
{
QTableWidgetItem *item = ui->tableWidget->item(cursorRow, 0);
item->setIcon(QIcon());
item = ui->tableWidget->item(row, 0);
cursorRow = row;
item->setIcon(QIcon("://icon/32x32/put_after.png"));
qint64 id = qvariant_cast<qint64>(item->data(Qt::UserRole));
disconnect(doc, &VDomDocument::ChangedCursor, this, &DialogHistory::ChangedCursor);
doc->setCursor(id);
connect(doc, &VDomDocument::ChangedCursor, this, &DialogHistory::ChangedCursor);
}
else
{
QTableWidgetItem *item = ui->tableWidget->item(cursorToolRecordRow, 0);
qint64 id = qvariant_cast<qint64>(item->data(Qt::UserRole));
emit ShowHistoryTool(id, Qt::green, false);
cursorToolRecordRow = row;
item = ui->tableWidget->item(cursorToolRecordRow, 0);
id = qvariant_cast<qint64>(item->data(Qt::UserRole));
emit ShowHistoryTool(id, Qt::green, true);
}
}
void DialogHistory::ChangedCursor(qint64 id)
{
for (qint32 i = 0; i< ui->tableWidget->rowCount(); ++i)
{
QTableWidgetItem *item = ui->tableWidget->item(i, 0);
qint64 rId = qvariant_cast<qint64>(item->data(Qt::UserRole));
if (rId == id)
{
QTableWidgetItem *oldCursorItem = ui->tableWidget->item(cursorRow, 0);
oldCursorItem->setIcon(QIcon());
cursorRow = i;
item->setIcon(QIcon("://icon/32x32/put_after.png"));
}
}
}
void DialogHistory::UpdateHistory()
{
FillTable();
InitialTable();
}
void DialogHistory::FillTable()
{
ui->tableWidget->clear();
QVector<VToolRecord> *history = doc->getHistory();
qint32 currentRow = -1;
qint32 count = 0;
ui->tableWidget->setRowCount(history->size());
for (qint32 i = 0; i< history->size(); ++i)
{
VToolRecord tool = history->at(i);
if (tool.getNameDraw() != doc->GetNameActivDraw())
{
continue;
}
currentRow++;
QTableWidgetItem *item = new QTableWidgetItem(QString());
item->setTextAlignment(Qt::AlignHCenter);
item->setData(Qt::UserRole, tool.getId());
ui->tableWidget->setItem(currentRow, 0, item);
QString historyRecord = Record(tool);
item = new QTableWidgetItem(historyRecord);
item->setFont(QFont("Times", 12, QFont::Bold));
item->setFlags(item->flags() ^ Qt::ItemIsEditable);
ui->tableWidget->setItem(currentRow, 1, item);
++count;
}
ui->tableWidget->setRowCount(count);
if (history->size()>0)
{
cursorRow = currentRow;
QTableWidgetItem *item = ui->tableWidget->item(cursorRow, 0);
item->setIcon(QIcon("://icon/32x32/put_after.png"));
}
ui->tableWidget->resizeColumnsToContents();
ui->tableWidget->resizeRowsToContents();
ui->tableWidget->verticalHeader()->setDefaultSectionSize(20);
}
QString DialogHistory::Record(const VToolRecord &tool)
{
QString record = QString();
qint64 basePointId = 0;
qint64 secondPointId = 0;
qint64 firstPointId = 0;
qint64 thirdPointId = 0;
qint64 p1Line1 = 0;
qint64 p2Line1 = 0;
qint64 p1Line2 = 0;
qint64 p2Line2 = 0;
qint64 center = 0;
QDomElement domElement;
switch ( tool.getTypeTool() )
{
case Tool::ArrowTool:
break;
case Tool::SinglePointTool:
{
QString name = data->GeometricObject<const VPointF *>(tool.getId())->name();
record = QString(tr("%1 - Base point")).arg(name);
break;
}
case Tool::EndLineTool:
{
domElement = doc->elementById(QString().setNum(tool.getId()));
if (domElement.isElement())
{
basePointId = doc->GetParametrLongLong(domElement, VAbstractTool::AttrBasePoint, "0");
}
QString basePointIdName = data->GeometricObject<const VPointF *>(basePointId)->name();
QString toolIdName = data->GeometricObject<const VPointF *>(tool.getId())->name();
record = QString(tr("%1_%2 - Line from point %1 to point %2")).arg(basePointIdName, toolIdName);
break;
}
case Tool::LineTool:
{
domElement = doc->elementById(QString().setNum(tool.getId()));
if (domElement.isElement())
{
firstPointId = doc->GetParametrLongLong(domElement, VAbstractTool::AttrFirstPoint, "0");
secondPointId = doc->GetParametrLongLong(domElement, VAbstractTool::AttrSecondPoint, "0");
}
QString firstPointIdName = data->GeometricObject<const VPointF *>(firstPointId)->name();
QString secondPointIdName = data->GeometricObject<const VPointF *>(secondPointId)->name();
record = QString(tr("%1_%2 - Line from point %1 to point %2")).arg(firstPointIdName, secondPointIdName);
break;
}
case Tool::AlongLineTool:
{
domElement = doc->elementById(QString().setNum(tool.getId()));
if (domElement.isElement())
{
basePointId = doc->GetParametrLongLong(domElement, VAbstractTool::AttrFirstPoint, "0");
secondPointId = doc->GetParametrLongLong(domElement, VAbstractTool::AttrSecondPoint, "0");
}
QString basePointIdName = data->GeometricObject<const VPointF *>(basePointId)->name();
QString secondPointIdName = data->GeometricObject<const VPointF *>(secondPointId)->name();
QString toolIdName = data->GeometricObject<const VPointF *>(tool.getId())->name();
record = QString(tr("%3 - Point along line %1_%2")).arg(basePointIdName, secondPointIdName, toolIdName);
break;
}
case Tool::ShoulderPointTool:
{
QString name = data->GeometricObject<const VPointF *>(tool.getId())->name();
record = QString(tr("%1 - Point of shoulder")).arg(name);
break;
}
case Tool::NormalTool:
{
domElement = doc->elementById(QString().setNum(tool.getId()));
if (domElement.isElement())
{
basePointId = doc->GetParametrLongLong(domElement, VAbstractTool::AttrFirstPoint, "0");
secondPointId = doc->GetParametrLongLong(domElement, VAbstractTool::AttrSecondPoint, "0");
}
QString basePointIdName = data->GeometricObject<const VPointF *>(basePointId)->name();
QString secondPointIdName = data->GeometricObject<const VPointF *>(secondPointId)->name();
QString toolIdName = data->GeometricObject<const VPointF *>(tool.getId())->name();
record = QString(tr("%3 - normal to line %1_%2")).arg(basePointIdName, secondPointIdName, toolIdName);
break;
}
case Tool::BisectorTool:
{
domElement = doc->elementById(QString().setNum(tool.getId()));
if (domElement.isElement())
{
firstPointId = doc->GetParametrLongLong(domElement, VAbstractTool::AttrFirstPoint, "0");
secondPointId = doc->GetParametrLongLong(domElement, VAbstractTool::AttrSecondPoint, "0");
thirdPointId = doc->GetParametrLongLong(domElement, VAbstractTool::AttrThirdPoint, "0");
}
QString firstPointIdName = data->GeometricObject<const VPointF *>(firstPointId)->name();
QString basePointIdName = data->GeometricObject<const VPointF *>(basePointId)->name();
QString thirdPointIdName = data->GeometricObject<const VPointF *>(thirdPointId)->name();
QString toolIdName = data->GeometricObject<const VPointF *>(tool.getId())->name();
record = QString(tr("%4 - bisector of angle %1_%2_%3")).arg(firstPointIdName, basePointIdName,
thirdPointIdName, toolIdName);
break;
}
case Tool::LineIntersectTool:
{
domElement = doc->elementById(QString().setNum(tool.getId()));
if (domElement.isElement())
{
p1Line1 = doc->GetParametrLongLong(domElement, VAbstractTool::AttrP1Line1, "0");
p2Line1 = doc->GetParametrLongLong(domElement, VAbstractTool::AttrP2Line1, "0");
p1Line2 = doc->GetParametrLongLong(domElement, VAbstractTool::AttrP1Line2, "0");
p2Line2 = doc->GetParametrLongLong(domElement, VAbstractTool::AttrP2Line2, "0");
}
QString p1Line1Name = data->GeometricObject<const VPointF *>(p1Line1)->name();
QString p2Line1Name = data->GeometricObject<const VPointF *>(p2Line1)->name();
QString p1Line2Name = data->GeometricObject<const VPointF *>(p1Line2)->name();
QString p2Line2Name = data->GeometricObject<const VPointF *>(p2Line2)->name();
QString toolIdName = data->GeometricObject<const VPointF *>(tool.getId())->name();
record = QString(tr("%5 - intersection of lines %1_%2 and %3_%4")).arg(p1Line1Name, p2Line1Name,
p1Line2Name, p2Line2Name,
toolIdName);
break;
}
case Tool::SplineTool:
{
const VSpline *spl = data->GeometricObject<const VSpline *>(tool.getId());
QString splP1Name = data->GeometricObject<const VSpline *>(spl->GetP1().id())->name();
QString splP4Name = data->GeometricObject<const VSpline *>(spl->GetP4().id())->name();
record = QString(tr("Curve %1_%2")).arg(splP1Name, splP4Name);
}
break;
case Tool::ArcTool:
{
const VArc *arc = data->GeometricObject<const VArc *>(tool.getId());
QString arcCenterName = data->GeometricObject<const VArc *>(arc->GetCenter().id())->name();
record = QString(tr("Arc with center in point %1")).arg(arcCenterName);
}
break;
case Tool::SplinePathTool:
{
const VSplinePath *splPath = data->GeometricObject<const VSplinePath *>(tool.getId());
QVector<VSplinePoint> points = splPath->GetSplinePath();
if (points.size() != 0 )
{
QString pName = data->GeometricObject<const VPointF *>(points[0].P().id())->name();
record = QString(tr("Curve point %1")).arg(pName);
for (qint32 i = 1; i< points.size(); ++i)
{
pName = data->GeometricObject<const VPointF *>(points[i].P().id())->name();
QString name = QString("_%1").arg(pName);
record.append(name);
}
}
}
break;
case Tool::PointOfContact:
{
domElement = doc->elementById(QString().setNum(tool.getId()));
if (domElement.isElement())
{
center = doc->GetParametrLongLong(domElement, VAbstractTool::AttrCenter, "0");
firstPointId = doc->GetParametrLongLong(domElement, VAbstractTool::AttrFirstPoint, "0");
secondPointId = doc->GetParametrLongLong(domElement, VAbstractTool::AttrSecondPoint, "0");
}
QString firstPointIdName = data->GeometricObject<const VPointF *>(firstPointId)->name();
QString centerName = data->GeometricObject<const VPointF *>(center)->name();
QString secondPointIdName = data->GeometricObject<const VPointF *>(secondPointId)->name();
QString toolIdName = data->GeometricObject<const VPointF *>(tool.getId())->name();
record = QString(tr("%4 - point of contact of arc with the center in point %1 and line %2_%3")).arg(
centerName, firstPointIdName, secondPointIdName, toolIdName);
break;
}
case Tool::Height:
{
qint64 p1LineId = 0;
qint64 p2LineId = 0;
domElement = doc->elementById(QString().setNum(tool.getId()));
if (domElement.isElement())
{
basePointId = doc->GetParametrLongLong(domElement, VAbstractTool::AttrBasePoint, "0");
p1LineId = doc->GetParametrLongLong(domElement, VAbstractTool::AttrP1Line, "0");
p2LineId = doc->GetParametrLongLong(domElement, VAbstractTool::AttrP2Line, "0");
}
QString basePointIdName = data->GeometricObject<const VPointF *>(basePointId)->name();
QString p1LineIdName = data->GeometricObject<const VPointF *>(p1LineId)->name();
QString p2LineIdName = data->GeometricObject<const VPointF *>(p2LineId)->name();
record = QString(tr("Point of perpendicular from point %1 to line %2_%3")).arg( basePointIdName,
p1LineIdName, p2LineIdName);
break;
}
case Tool::Triangle:
{
qint64 axisP1Id = 0;
qint64 axisP2Id = 0;
domElement = doc->elementById(QString().setNum(tool.getId()));
if (domElement.isElement())
{
axisP1Id = doc->GetParametrLongLong(domElement, VAbstractTool::AttrAxisP1, "0");
axisP2Id = doc->GetParametrLongLong(domElement, VAbstractTool::AttrAxisP2, "0");
firstPointId = doc->GetParametrLongLong(domElement, VAbstractTool::AttrFirstPoint, "0");
secondPointId = doc->GetParametrLongLong(domElement, VAbstractTool::AttrSecondPoint, "0");
}
QString axisP1IdName = data->GeometricObject<const VPointF *>(axisP1Id)->name();
QString axisP2IdName = data->GeometricObject<const VPointF *>(axisP2Id)->name();
QString firstPointIdName = data->GeometricObject<const VPointF *>(firstPointId)->name();
QString secondPointIdName = data->GeometricObject<const VPointF *>(secondPointId)->name();
record = QString(tr("Triangle: axis %1_%2, points %3 and %4")).arg( axisP1IdName, axisP2IdName,
firstPointIdName, secondPointIdName);
break;
}
case Tool::PointOfIntersection:
{
domElement = doc->elementById(QString().setNum(tool.getId()));
if (domElement.isElement())
{
firstPointId = doc->GetParametrLongLong(domElement, VAbstractTool::AttrFirstPoint, "0");
secondPointId = doc->GetParametrLongLong(domElement, VAbstractTool::AttrSecondPoint, "0");
}
QString firstPointIdName = data->GeometricObject<const VPointF *>(firstPointId)->name();
QString secondPointIdName = data->GeometricObject<const VPointF *>(secondPointId)->name();
QString toolIdName = data->GeometricObject<const VPointF *>(tool.getId())->name();
record = QString(tr("%1 - point of intersection %2 and %3")).arg(toolIdName, firstPointIdName,
secondPointIdName);
}
break;
case Tool::CutArcTool:
{
qint64 arcId = 0;
domElement = doc->elementById(QString().setNum(tool.getId()));
if (domElement.isElement())
{
arcId = doc->GetParametrLongLong(domElement, VToolCutArc::AttrArc, "0");
}
const VArc *arc = data->GeometricObject<const VArc *>(arcId);
QString arcCenterName = data->GeometricObject<const VArc *>(arc->GetCenter().id())->name();
QString toolIdName = data->GeometricObject<const VPointF *>(tool.getId())->name();
record = QString(tr("%1 - cut arc with center %2")).arg(toolIdName, arcCenterName);
}
break;
case Tool::CutSplineTool:
{
qint64 splineId = 0;
domElement = doc->elementById(QString().setNum(tool.getId()));
if (domElement.isElement())
{
splineId = doc->GetParametrLongLong(domElement, VToolCutSpline::AttrSpline, "0");
}
const VSpline *spl = data->GeometricObject<const VSpline *>(splineId);
QString toolIdName = data->GeometricObject<const VPointF *>(tool.getId())->name();
QString splP1Name = data->GeometricObject<const VPointF *>(spl->GetP1().id())->name();
QString splP4Name = data->GeometricObject<const VPointF *>(spl->GetP4().id())->name();
record = QString(tr("%1 - cut curve %2_%3")).arg(toolIdName, splP1Name, splP4Name);
}
break;
case Tool::CutSplinePathTool:
{
qint64 splinePathId = 0;
domElement = doc->elementById(QString().setNum(tool.getId()));
if (domElement.isElement())
{
splinePathId = doc->GetParametrLongLong(domElement, VToolCutSplinePath::AttrSplinePath, "0");
}
const VSplinePath *splPath = data->GeometricObject<const VSplinePath *>(splinePathId);
QVector<VSplinePoint> points = splPath->GetSplinePath();
if (points.size() != 0 )
{
QString toolIdName = data->GeometricObject<const VPointF *>(tool.getId())->name();
QString pName = data->GeometricObject<const VPointF *>(points[0].P().id())->name();
record = QString(tr("%1 - cut curve path %2")).arg(toolIdName, pName);
for (qint32 i = 1; i< points.size(); ++i)
{
pName = data->GeometricObject<const VPointF *>(points[i].P().id())->name();
QString name = QString("_%1").arg(pName);
record.append(name);
}
}
}
break;
//Because "history" not only show history of pattern, but help restore current data for each pattern's piece, we
//need add record about details and nodes, but don't show them.
case Tool::Detail:
break;
case Tool::UnionDetails:
break;
case Tool::NodeArc:
break;
case Tool::NodePoint:
break;
case Tool::NodeSpline:
break;
case Tool::NodeSplinePath:
break;
default:
qWarning()<<tr("Got wrong tool type. Ignore.");
break;
}
return record;
}
void DialogHistory::InitialTable()
{
ui->tableWidget->setSortingEnabled(false);
ui->tableWidget->setHorizontalHeaderItem(0, new QTableWidgetItem(" "));
ui->tableWidget->setHorizontalHeaderItem(1, new QTableWidgetItem(tr("Tool")));
}
void DialogHistory::ShowPoint()
{
QVector<VToolRecord> *history = doc->getHistory();
if (history->size()>0)
{
QTableWidgetItem *item = ui->tableWidget->item(0, 1);
item->setSelected(true);
cursorToolRecordRow = 0;
item = ui->tableWidget->item(0, 0);
qint64 id = qvariant_cast<qint64>(item->data(Qt::UserRole));
emit ShowHistoryTool(id, Qt::green, true);
}
}
void DialogHistory::closeEvent(QCloseEvent *event)
{
QTableWidgetItem *item = ui->tableWidget->item(cursorToolRecordRow, 0);
qint64 id = qvariant_cast<qint64>(item->data(Qt::UserRole));
emit ShowHistoryTool(id, Qt::green, false);
DialogTool::closeEvent(event);
}

View File

@ -1,521 +0,0 @@
/************************************************************************
**
** @file dialogincrements.cpp
** @author Roman Telezhinsky <dismine@gmail.com>
** @date November 15, 2013
**
** @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 "dialogincrements.h"
#include "ui_dialogincrements.h"
#include "../widgets/doubledelegate.h"
#include "../widgets/textdelegate.h"
#include "../exception/vexception.h"
#include <QPushButton>
DialogIncrements::DialogIncrements(VContainer *data, VDomDocument *doc, QWidget *parent)
:DialogTool(data, parent), ui(new Ui::DialogIncrements), data(data), doc(doc), row(0), column(0)
{
ui->setupUi(this);
TextDelegate *textDelegate = new TextDelegate(ui->tableWidgetIncrement);
Q_CHECK_PTR(textDelegate);
ui->tableWidgetIncrement->setItemDelegateForColumn(0, textDelegate);
DoubleSpinBoxDelegate *doubleDelegate = new DoubleSpinBoxDelegate(ui->tableWidgetIncrement);
Q_CHECK_PTR(doubleDelegate);
ui->tableWidgetIncrement->setItemDelegateForColumn(2, doubleDelegate);
ui->tableWidgetIncrement->setItemDelegateForColumn(3, doubleDelegate);
ui->tableWidgetIncrement->setItemDelegateForColumn(4, doubleDelegate);
FillStandardTable();
FillIncrementTable();
FillLengthLines();
FillLengthSplines();
FillLengthArcs();
connect(ui->tableWidgetIncrement, &QTableWidget::cellChanged, this, &DialogIncrements::cellChanged);
connect(ui->toolButtonAdd, &QPushButton::clicked, this, &DialogIncrements::clickedToolButtonAdd);
connect(ui->toolButtonRemove, &QPushButton::clicked, this, &DialogIncrements::clickedToolButtonRemove);
connect(this, &DialogIncrements::FullUpdateTree, this->doc, &VDomDocument::FullUpdateTree);
connect(this, &DialogIncrements::haveLiteChange, this->doc, &VDomDocument::haveLiteChange);
connect(this->doc, &VDomDocument::FullUpdateFromFile, this, &DialogIncrements::FullUpdateFromFile);
ui->tabWidget->setCurrentIndex(0);
}
void DialogIncrements::FillStandardTable()
{
const QHash<QString, VStandardTableRow> *standardTable = data->DataStandardTable();
qint32 currentRow = -1;
QHashIterator<QString, VStandardTableRow> i(*standardTable);
ui->tableWidgetStandard->setRowCount ( standardTable->size() );
while (i.hasNext())
{
i.next();
VStandardTableRow cell = i.value();
currentRow++;
QTableWidgetItem *item = new QTableWidgetItem(QString(i.key()));
item->setTextAlignment(Qt::AlignHCenter);
item->setFont(QFont("Times", 12, QFont::Bold));
ui->tableWidgetStandard->setItem(currentRow, 0, item);
item = new QTableWidgetItem(QString().setNum(data->GetValueStandardTableCell(i.key())));
item->setTextAlignment(Qt::AlignHCenter);
ui->tableWidgetStandard->setItem(currentRow, 1, item);
item = new QTableWidgetItem(QString().setNum(cell.GetBase()));
item->setTextAlignment(Qt::AlignHCenter);
ui->tableWidgetStandard->setItem(currentRow, 2, item);
item = new QTableWidgetItem(QString().setNum(cell.GetKsize()));
item->setTextAlignment(Qt::AlignHCenter);
ui->tableWidgetStandard->setItem(currentRow, 3, item);
item = new QTableWidgetItem(QString().setNum(cell.GetKgrowth()));
item->setTextAlignment(Qt::AlignHCenter);
ui->tableWidgetStandard->setItem(currentRow, 4, item);
item = new QTableWidgetItem(cell.GetDescription());
item->setTextAlignment(Qt::AlignHCenter);
ui->tableWidgetStandard->setItem(currentRow, 5, item);
}
ui->tableWidgetStandard->resizeColumnsToContents();
ui->tableWidgetStandard->resizeRowsToContents();
ui->tableWidgetStandard->verticalHeader()->setDefaultSectionSize(20);
}
void DialogIncrements::FillIncrementTable()
{
const QHash<QString, VIncrementTableRow> *incrementTable = data->DataIncrementTable();
QHashIterator<QString, VIncrementTableRow> i(*incrementTable);
QMap<qint64, QString> map;
//Sorting QHash by id
while (i.hasNext())
{
i.next();
VIncrementTableRow cell = i.value();
map.insert(cell.getId(), i.key());
}
qint32 currentRow = -1;
QMapIterator<qint64, QString> iMap(map);
while (iMap.hasNext())
{
iMap.next();
VIncrementTableRow cell = incrementTable->value(iMap.value());
currentRow++;
ui->tableWidgetIncrement->setRowCount ( incrementTable->size() );
QTableWidgetItem *item = new QTableWidgetItem(iMap.value());
item->setTextAlignment(Qt::AlignHCenter);
item->setFont(QFont("Times", 12, QFont::Bold));
item->setData(Qt::UserRole, cell.getId());
ui->tableWidgetIncrement->setItem(currentRow, 0, item);
item = new QTableWidgetItem(QString().setNum(data->GetValueIncrementTableRow(iMap.value())));
item->setTextAlignment(Qt::AlignHCenter);
// set the item non-editable (view only), and non-selectable
Qt::ItemFlags flags = item->flags();
flags &= ~(Qt::ItemIsSelectable | Qt::ItemIsEditable); // reset/clear the flag
item->setFlags(flags);
ui->tableWidgetIncrement->setItem(currentRow, 1, item);
item = new QTableWidgetItem(QString().setNum(cell.getBase()));
item->setTextAlignment(Qt::AlignHCenter);
ui->tableWidgetIncrement->setItem(currentRow, 2, item);
item = new QTableWidgetItem(QString().setNum(cell.getKsize()));
item->setTextAlignment(Qt::AlignHCenter);
ui->tableWidgetIncrement->setItem(currentRow, 3, item);
item = new QTableWidgetItem(QString().setNum(cell.getKgrowth()));
item->setTextAlignment(Qt::AlignHCenter);
ui->tableWidgetIncrement->setItem(currentRow, 4, item);
item = new QTableWidgetItem(cell.getDescription());
item->setTextAlignment(Qt::AlignLeft);
ui->tableWidgetIncrement->setItem(currentRow, 5, item);
}
if (ui->tableWidgetIncrement->rowCount()>0)
{
ui->toolButtonRemove->setEnabled(true);
}
ui->tableWidgetIncrement->resizeColumnsToContents();
ui->tableWidgetIncrement->resizeRowsToContents();
ui->tableWidgetIncrement->setCurrentCell( row, column );
}
void DialogIncrements::FillLengthLines()
{
const QHash<QString, qreal> *linesTable = data->DataLengthLines();
QHashIterator<QString, qreal> iHash(*linesTable);
QMap<QString, qreal> map;
//Sorting QHash by name
while (iHash.hasNext())
{
iHash.next();
map.insert(iHash.key(), iHash.value());
}
qint32 currentRow = -1;
QMapIterator<QString, qreal> i(map);
while (i.hasNext())
{
i.next();
qreal length = i.value();
currentRow++;
ui->tableWidgetLines->setRowCount ( linesTable->size() );
QTableWidgetItem *item = new QTableWidgetItem(QString(i.key()));
item->setTextAlignment(Qt::AlignHCenter);
item->setFont(QFont("Times", 12, QFont::Bold));
ui->tableWidgetLines->setItem(currentRow, 0, item);
item = new QTableWidgetItem(QString().setNum(length));
item->setTextAlignment(Qt::AlignHCenter);
ui->tableWidgetLines->setItem(currentRow, 1, item);
}
ui->tableWidgetLines->resizeColumnsToContents();
ui->tableWidgetLines->resizeRowsToContents();
ui->tableWidgetLines->verticalHeader()->setDefaultSectionSize(20);
}
void DialogIncrements::FillLengthSplines()
{
const QHash<QString, qreal> *splinesTable = data->DataLengthSplines();
QHashIterator<QString, qreal> iHash(*splinesTable);
QMap<QString, qreal> map;
//Sorting QHash by name
while (iHash.hasNext())
{
iHash.next();
map.insert(iHash.key(), iHash.value());
}
qint32 currentRow = -1;
QMapIterator<QString, qreal> i(map);
while (i.hasNext())
{
i.next();
qreal length = i.value();
currentRow++;
ui->tableWidgetSplines->setRowCount ( splinesTable->size() );
QTableWidgetItem *item = new QTableWidgetItem(QString(i.key()));
item->setTextAlignment(Qt::AlignLeft);
item->setFont(QFont("Times", 12, QFont::Bold));
ui->tableWidgetSplines->setItem(currentRow, 0, item);
item = new QTableWidgetItem(QString().setNum(length));
item->setTextAlignment(Qt::AlignHCenter);
ui->tableWidgetSplines->setItem(currentRow, 1, item);
}
ui->tableWidgetSplines->resizeColumnsToContents();
ui->tableWidgetSplines->resizeRowsToContents();
ui->tableWidgetSplines->verticalHeader()->setDefaultSectionSize(20);
}
void DialogIncrements::FillLengthArcs()
{
const QHash<QString, qreal> *arcsTable = data->DataLengthArcs();
QHashIterator<QString, qreal> iHash(*arcsTable);
QMap<QString, qreal> map;
//Sorting QHash by name
while (iHash.hasNext())
{
iHash.next();
map.insert(iHash.key(), iHash.value());
}
qint32 currentRow = -1;
QMapIterator<QString, qreal> i(map);
while (i.hasNext())
{
i.next();
qreal length = i.value();
currentRow++;
ui->tableWidgetArcs->setRowCount ( arcsTable->size() );
QTableWidgetItem *item = new QTableWidgetItem(QString(i.key()));
item->setTextAlignment(Qt::AlignHCenter);
item->setFont(QFont("Times", 12, QFont::Bold));
ui->tableWidgetArcs->setItem(currentRow, 0, item);
item = new QTableWidgetItem(QString().setNum(length));
item->setTextAlignment(Qt::AlignHCenter);
ui->tableWidgetArcs->setItem(currentRow, 1, item);
}
ui->tableWidgetArcs->resizeColumnsToContents();
ui->tableWidgetArcs->resizeRowsToContents();
ui->tableWidgetArcs->verticalHeader()->setDefaultSectionSize(20);
}
void DialogIncrements::FullUpdateFromFile()
{
disconnect(ui->tableWidgetIncrement, &QTableWidget::cellChanged, this,
&DialogIncrements::cellChanged);
ui->tableWidgetStandard->clearContents();
FillStandardTable();
ui->tableWidgetIncrement->clearContents();
FillIncrementTable();
ui->tableWidgetLines->clearContents();
FillLengthLines();
ui->tableWidgetSplines->clearContents();
FillLengthSplines();
ui->tableWidgetArcs->clearContents();
FillLengthArcs();
connect(ui->tableWidgetIncrement, &QTableWidget::cellChanged, this,
&DialogIncrements::cellChanged);
}
void DialogIncrements::clickedToolButtonAdd()
{
ui->tableWidgetIncrement->setFocus(Qt::OtherFocusReason);
disconnect(ui->tableWidgetIncrement, &QTableWidget::cellChanged, this,
&DialogIncrements::cellChanged);
qint32 currentRow = ui->tableWidgetIncrement->rowCount();
ui->tableWidgetIncrement->insertRow( currentRow );
qint32 num = 1;
QString name;
do
{
name = QString(tr("Name_%1")).arg(num);
num++;
} while (data->IncrementTableContains(name));
qint64 id = data->getNextId();
qreal base = 0;
qreal ksize = 0;
qreal kgrowth = 0;
QString description = QString(tr("Description"));
VIncrementTableRow incrementRow = VIncrementTableRow(id, base, ksize, kgrowth, description);
data->AddIncrementTableRow(name, incrementRow);
AddIncrementToFile(id, name, base, ksize, kgrowth, description);
QTableWidgetItem *item = new QTableWidgetItem(name);
item->setTextAlignment(Qt::AlignHCenter);
item->setFont(QFont("Times", 12, QFont::Bold));
item->setData(Qt::UserRole, id);
ui->tableWidgetIncrement->setItem(currentRow, 0, item);
ui->tableWidgetIncrement->setCurrentCell(currentRow, 0, QItemSelectionModel::ClearAndSelect);
item = new QTableWidgetItem("0");
item->setTextAlignment(Qt::AlignHCenter);
// set the item non-editable (view only), and non-selectable
Qt::ItemFlags flags = item->flags();
flags &= ~(Qt::ItemIsSelectable | Qt::ItemIsEditable); // reset/clear the flag
item->setFlags(flags);
ui->tableWidgetIncrement->setItem(currentRow, 1, item);
item = new QTableWidgetItem("0");
item->setTextAlignment(Qt::AlignHCenter);
ui->tableWidgetIncrement->setItem(currentRow, 2, item);
item = new QTableWidgetItem("0");
item->setTextAlignment(Qt::AlignHCenter);
ui->tableWidgetIncrement->setItem(currentRow, 3, item);
item = new QTableWidgetItem("0");
item->setTextAlignment(Qt::AlignHCenter);
ui->tableWidgetIncrement->setItem(currentRow, 4, item);
item = new QTableWidgetItem(tr("Description"));
item->setTextAlignment(Qt::AlignHCenter);
ui->tableWidgetIncrement->setItem(currentRow, 5, item);
ui->toolButtonRemove->setEnabled(true);
connect(ui->tableWidgetIncrement, &QTableWidget::cellChanged, this,
&DialogIncrements::cellChanged);
emit haveLiteChange();
}
void DialogIncrements::clickedToolButtonRemove()
{
disconnect(ui->tableWidgetIncrement, &QTableWidget::cellChanged, this,
&DialogIncrements::cellChanged);
QTableWidgetItem *item = ui->tableWidgetIncrement->currentItem();
qint32 row = item->row();
QTableWidgetItem *itemName = ui->tableWidgetIncrement->item(row, 0);
data->RemoveIncrementTableRow(itemName->text());
qint64 id = qvariant_cast<qint64>(item->data(Qt::UserRole));
QDomElement domElement = doc->elementById(QString().setNum(id));
if (domElement.isElement())
{
QDomNodeList list = doc->elementsByTagName("increments");
list.at(0).removeChild(domElement);
}
ui->tableWidgetIncrement->removeRow(row);
if (ui->tableWidgetIncrement->rowCount() == 0)
{
ui->toolButtonRemove->setEnabled(false);
}
connect(ui->tableWidgetIncrement, &QTableWidget::cellChanged, this,
&DialogIncrements::cellChanged);
emit haveLiteChange();
}
void DialogIncrements::AddIncrementToFile(qint64 id, QString name, qreal base, qreal ksize, qreal kgrowth,
QString description)
{
QDomNodeList list = doc->elementsByTagName("increments");
QDomElement element = doc->createElement("increment");
QDomAttr drawAttr = doc->createAttribute("id");
drawAttr.setValue(QString().setNum(id));
element.setAttributeNode(drawAttr);
drawAttr = doc->createAttribute("name");
drawAttr.setValue(name);
element.setAttributeNode(drawAttr);
drawAttr = doc->createAttribute("base");
drawAttr.setValue(QString().setNum(base));
element.setAttributeNode(drawAttr);
drawAttr = doc->createAttribute("ksize");
drawAttr.setValue(QString().setNum(ksize));
element.setAttributeNode(drawAttr);
drawAttr = doc->createAttribute("kgrowth");
drawAttr.setValue(QString().setNum(kgrowth));
element.setAttributeNode(drawAttr);
drawAttr = doc->createAttribute("description");
drawAttr.setValue(description);
element.setAttributeNode(drawAttr);
list.at(0).appendChild(element);
}
void DialogIncrements::cellChanged ( qint32 row, qint32 column )
{
QTableWidgetItem *item = 0;
QTableWidgetItem *itemName = 0;
qint64 id;
QDomElement domElement;
this->row = row;
switch (column)
{
case 0:
item = ui->tableWidgetIncrement->item(row, 0);
id = qvariant_cast<qint64>(item->data(Qt::UserRole));
domElement = doc->elementById(QString().setNum(id));
if (domElement.isElement())
{
domElement.setAttribute("name", item->text());
data->ClearIncrementTable();
this->column = 2;
emit FullUpdateTree();
emit haveLiteChange();
}
break;
case 2:
itemName = ui->tableWidgetIncrement->item(row, 0);
item = ui->tableWidgetIncrement->item(row, column);
id = qvariant_cast<qint64>(itemName->data(Qt::UserRole));
domElement = doc->elementById(QString().setNum(id));
if (domElement.isElement())
{
bool ok = false;
qreal value = item->text().replace(",", ".").toDouble(&ok);
if (ok)
{
domElement.setAttribute("base", value);
this->column = 3;
emit FullUpdateTree();
emit haveLiteChange();
}
else
{
throw VException(tr("Can't convert toDouble value."));
}
}
break;
case 3:
itemName = ui->tableWidgetIncrement->item(row, 0);
item = ui->tableWidgetIncrement->item(row, column);
id = qvariant_cast<qint64>(itemName->data(Qt::UserRole));
domElement = doc->elementById(QString().setNum(id));
if (domElement.isElement())
{
domElement.setAttribute("ksize", item->text().replace(",", ".").toDouble());
this->column = 4;
emit FullUpdateTree();
emit haveLiteChange();
}
break;
case 4:
itemName = ui->tableWidgetIncrement->item(row, 0);
item = ui->tableWidgetIncrement->item(row, column);
id = qvariant_cast<qint64>(itemName->data(Qt::UserRole));
domElement = doc->elementById(QString().setNum(id));
if (domElement.isElement())
{
domElement.setAttribute("kgrowth", item->text().replace(",", ".").toDouble());
this->column = 5;
emit FullUpdateTree();
emit haveLiteChange();
}
break;
case 5:
itemName = ui->tableWidgetIncrement->item(row, 0);
item = ui->tableWidgetIncrement->item(row, column);
id = qvariant_cast<qint64>(itemName->data(Qt::UserRole));
domElement = doc->elementById(QString().setNum(id));
if (domElement.isElement())
{
domElement.setAttribute("description", item->text());
VIncrementTableRow incr = data->GetIncrementTableRow(itemName->text());
incr.setDescription(item->text());
data->UpdateIncrementTableRow(itemName->text(), incr);
ui->tableWidgetIncrement->resizeColumnsToContents();
ui->tableWidgetIncrement->resizeRowsToContents();
ui->tableWidgetIncrement->setCurrentCell( row, 0 );
emit haveLiteChange();
}
break;
default:
break;
}
}
void DialogIncrements::closeEvent(QCloseEvent *event)
{
emit DialogClosed(QDialog::Accepted);
event->accept();
}
DialogIncrements::~DialogIncrements()
{
delete ui;
}

View File

@ -1,369 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DialogIncrements</class>
<widget class="QDialog" name="DialogIncrements">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>897</width>
<height>422</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>800</width>
<height>0</height>
</size>
</property>
<property name="windowTitle">
<string>Increments</string>
</property>
<property name="windowIcon">
<iconset resource="../../share/resources/icon.qrc">
<normaloff>:/icon/64x64/icon64x64.png</normaloff>:/icon/64x64/icon64x64.png</iconset>
</property>
<property name="locale">
<locale language="English" country="UnitedStates"/>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="tabPosition">
<enum>QTabWidget::North</enum>
</property>
<property name="currentIndex">
<number>1</number>
</property>
<widget class="QWidget" name="tabStandard">
<attribute name="title">
<string>Sizes table</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QTableWidget" name="tableWidgetStandard">
<property name="enabled">
<bool>true</bool>
</property>
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::SingleSelection</enum>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<attribute name="horizontalHeaderCascadingSectionResizes">
<bool>false</bool>
</attribute>
<attribute name="horizontalHeaderDefaultSectionSize">
<number>95</number>
</attribute>
<attribute name="horizontalHeaderMinimumSectionSize">
<number>25</number>
</attribute>
<attribute name="horizontalHeaderShowSortIndicator" stdset="0">
<bool>false</bool>
</attribute>
<attribute name="horizontalHeaderStretchLastSection">
<bool>true</bool>
</attribute>
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>
<attribute name="verticalHeaderDefaultSectionSize">
<number>45</number>
</attribute>
<attribute name="verticalHeaderMinimumSectionSize">
<number>8</number>
</attribute>
<column>
<property name="text">
<string>Name</string>
</property>
</column>
<column>
<property name="text">
<string>The calculated value</string>
</property>
</column>
<column>
<property name="text">
<string>Base value</string>
</property>
</column>
<column>
<property name="text">
<string>In sizes</string>
</property>
</column>
<column>
<property name="text">
<string>In growths</string>
</property>
</column>
<column>
<property name="text">
<string>Description</string>
</property>
</column>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tabIncrements">
<attribute name="title">
<string>Increments</string>
</attribute>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="3">
<widget class="QTableWidget" name="tableWidgetIncrement">
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::SingleSelection</enum>
</property>
<property name="sortingEnabled">
<bool>false</bool>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<attribute name="horizontalHeaderCascadingSectionResizes">
<bool>false</bool>
</attribute>
<attribute name="horizontalHeaderDefaultSectionSize">
<number>95</number>
</attribute>
<attribute name="horizontalHeaderMinimumSectionSize">
<number>17</number>
</attribute>
<attribute name="horizontalHeaderShowSortIndicator" stdset="0">
<bool>false</bool>
</attribute>
<attribute name="horizontalHeaderStretchLastSection">
<bool>true</bool>
</attribute>
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>
<attribute name="verticalHeaderCascadingSectionResizes">
<bool>false</bool>
</attribute>
<attribute name="verticalHeaderDefaultSectionSize">
<number>20</number>
</attribute>
<attribute name="verticalHeaderStretchLastSection">
<bool>false</bool>
</attribute>
<column>
<property name="text">
<string>Name</string>
</property>
</column>
<column>
<property name="text">
<string>The calculated value</string>
</property>
</column>
<column>
<property name="text">
<string>Base value</string>
</property>
</column>
<column>
<property name="text">
<string>In sizes</string>
</property>
</column>
<column>
<property name="text">
<string>In growths</string>
</property>
</column>
<column>
<property name="text">
<string>Description</string>
</property>
</column>
</widget>
</item>
<item row="1" column="0">
<widget class="QToolButton" name="toolButtonAdd">
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset theme="list-add">
<normaloff/>
</iconset>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QToolButton" name="toolButtonRemove">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset theme="list-remove">
<normaloff/>
</iconset>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_3">
<attribute name="title">
<string>Lines</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QTableWidget" name="tableWidgetLines">
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<attribute name="horizontalHeaderCascadingSectionResizes">
<bool>false</bool>
</attribute>
<attribute name="horizontalHeaderDefaultSectionSize">
<number>137</number>
</attribute>
<attribute name="horizontalHeaderStretchLastSection">
<bool>false</bool>
</attribute>
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>
<column>
<property name="text">
<string>Line</string>
</property>
</column>
<column>
<property name="text">
<string>Length</string>
</property>
</column>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_4">
<attribute name="title">
<string>Curves</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0">
<widget class="QTableWidget" name="tableWidgetSplines">
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<attribute name="horizontalHeaderCascadingSectionResizes">
<bool>false</bool>
</attribute>
<attribute name="horizontalHeaderDefaultSectionSize">
<number>137</number>
</attribute>
<attribute name="horizontalHeaderStretchLastSection">
<bool>false</bool>
</attribute>
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>
<column>
<property name="text">
<string>Curve</string>
</property>
</column>
<column>
<property name="text">
<string>Length</string>
</property>
</column>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_5">
<attribute name="title">
<string>Arcs</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_5">
<item row="0" column="0">
<widget class="QTableWidget" name="tableWidgetArcs">
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<attribute name="horizontalHeaderCascadingSectionResizes">
<bool>false</bool>
</attribute>
<attribute name="horizontalHeaderDefaultSectionSize">
<number>137</number>
</attribute>
<attribute name="horizontalHeaderStretchLastSection">
<bool>false</bool>
</attribute>
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>
<column>
<property name="text">
<string>Arc</string>
</property>
</column>
<column>
<property name="text">
<string>Length</string>
</property>
</column>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<tabstops>
<tabstop>tabWidget</tabstop>
<tabstop>tableWidgetStandard</tabstop>
<tabstop>tableWidgetIncrement</tabstop>
<tabstop>toolButtonAdd</tabstop>
<tabstop>toolButtonRemove</tabstop>
<tabstop>tableWidgetLines</tabstop>
<tabstop>tableWidgetSplines</tabstop>
<tabstop>tableWidgetArcs</tabstop>
</tabstops>
<resources>
<include location="../../share/resources/icon.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -29,29 +29,33 @@
#ifndef DIALOGS_H
#define DIALOGS_H
#include "dialogalongline.h"
#include "dialogarc.h"
#include "dialogbisector.h"
#include "dialogdetail.h"
#include "dialogendline.h"
#include "dialoghistory.h"
#include "dialogincrements.h"
#include "dialogline.h"
#include "dialoglineintersect.h"
#include "dialognormal.h"
#include "dialogpointofcontact.h"
#include "dialogshoulderpoint.h"
#include "dialogsinglepoint.h"
#include "dialogspline.h"
#include "dialogsplinepath.h"
#include "dialogheight.h"
#include "dialogcutarc.h"
#include "dialogcutspline.h"
#include "dialogcutsplinepath.h"
#include "dialoguniondetails.h"
#include "dialogtriangle.h"
#include "dialogpointofintersection.h"
#include "configdialog.h"
#include "dialogpatternproperties.h"
#include "tools/dialogalongline.h"
#include "tools/dialogarc.h"
#include "tools/dialogbisector.h"
#include "tools/dialogdetail.h"
#include "tools/dialogendline.h"
#include "tools/dialogline.h"
#include "tools/dialoglineintersect.h"
#include "tools/dialognormal.h"
#include "tools/dialogpointofcontact.h"
#include "tools/dialogshoulderpoint.h"
#include "tools/dialogsinglepoint.h"
#include "tools/dialogspline.h"
#include "tools/dialogsplinepath.h"
#include "tools/dialogheight.h"
#include "tools/dialogcutarc.h"
#include "tools/dialogcutspline.h"
#include "tools/dialogcutsplinepath.h"
#include "tools/dialoguniondetails.h"
#include "tools/dialogtriangle.h"
#include "tools/dialogpointofintersection.h"
#include "app/dialoghistory.h"
#include "app/dialogincrements.h"
#include "app/configdialog.h"
#include "app/dialogpatternproperties.h"
#include "app/dialogmeasurements.h"
#include "app/dialogindividualmeasurements.h"
#include "app/dialogstandardmeasurements.h"
#endif // DIALOGS_H

View File

@ -1,81 +1,90 @@
HEADERS += \
src/dialogs/dialogtriangle.h \
src/dialogs/dialogtool.h \
src/dialogs/dialogsplinepath.h \
src/dialogs/dialogspline.h \
src/dialogs/dialogsinglepoint.h \
src/dialogs/dialogshoulderpoint.h \
src/dialogs/dialogs.h \
src/dialogs/dialogpointofintersection.h \
src/dialogs/dialogpointofcontact.h \
src/dialogs/dialognormal.h \
src/dialogs/dialoglineintersect.h \
src/dialogs/dialogline.h \
src/dialogs/dialogincrements.h \
src/dialogs/dialoghistory.h \
src/dialogs/dialogheight.h \
src/dialogs/dialogendline.h \
src/dialogs/dialogdetail.h \
src/dialogs/dialogbisector.h \
src/dialogs/dialogarc.h \
src/dialogs/dialogalongline.h \
src/dialogs/dialogcutspline.h \
src/dialogs/dialogcutsplinepath.h \
src/dialogs/dialoguniondetails.h \
src/dialogs/dialogcutarc.h \
src/dialogs/configdialog.h \
src/dialogs/pages.h \
src/dialogs/dialogpatternproperties.h
src/dialogs/tools/dialogtriangle.h \
src/dialogs/tools/dialogtool.h \
src/dialogs/tools/dialogsplinepath.h \
src/dialogs/tools/dialogspline.h \
src/dialogs/tools/dialogsinglepoint.h \
src/dialogs/tools/dialogshoulderpoint.h \
src/dialogs/tools/dialogpointofintersection.h \
src/dialogs/tools/dialogpointofcontact.h \
src/dialogs/tools/dialognormal.h \
src/dialogs/tools/dialoglineintersect.h \
src/dialogs/tools/dialogline.h \
src/dialogs/tools/dialogheight.h \
src/dialogs/tools/dialogendline.h \
src/dialogs/tools/dialogdetail.h \
src/dialogs/tools/dialogbisector.h \
src/dialogs/tools/dialogarc.h \
src/dialogs/tools/dialogalongline.h \
src/dialogs/tools/dialogcutspline.h \
src/dialogs/tools/dialogcutsplinepath.h \
src/dialogs/tools/dialoguniondetails.h \
src/dialogs/tools/dialogcutarc.h \
src/dialogs/app/dialogincrements.h \
src/dialogs/app/dialoghistory.h \
src/dialogs/app/configdialog.h \
src/dialogs/app/pages.h \
src/dialogs/app/dialogpatternproperties.h \
src/dialogs/app/dialogmeasurements.h \
src/dialogs/app/dialogstandardmeasurements.h \
src/dialogs/app/dialogindividualmeasurements.h
SOURCES += \
src/dialogs/dialogtriangle.cpp \
src/dialogs/dialogtool.cpp \
src/dialogs/dialogsplinepath.cpp \
src/dialogs/dialogspline.cpp \
src/dialogs/dialogsinglepoint.cpp \
src/dialogs/dialogshoulderpoint.cpp \
src/dialogs/dialogpointofintersection.cpp \
src/dialogs/dialogpointofcontact.cpp \
src/dialogs/dialognormal.cpp \
src/dialogs/dialoglineintersect.cpp \
src/dialogs/dialogline.cpp \
src/dialogs/dialogincrements.cpp \
src/dialogs/dialoghistory.cpp \
src/dialogs/dialogheight.cpp \
src/dialogs/dialogendline.cpp \
src/dialogs/dialogdetail.cpp \
src/dialogs/dialogbisector.cpp \
src/dialogs/dialogarc.cpp \
src/dialogs/dialogalongline.cpp \
src/dialogs/dialogcutspline.cpp \
src/dialogs/dialogcutsplinepath.cpp \
src/dialogs/dialoguniondetails.cpp \
src/dialogs/dialogcutarc.cpp \
src/dialogs/configdialog.cpp \
src/dialogs/pages.cpp \
src/dialogs/dialogpatternproperties.cpp
src/dialogs/tools/dialogtriangle.cpp \
src/dialogs/tools/dialogtool.cpp \
src/dialogs/tools/dialogsplinepath.cpp \
src/dialogs/tools/dialogspline.cpp \
src/dialogs/tools/dialogsinglepoint.cpp \
src/dialogs/tools/dialogshoulderpoint.cpp \
src/dialogs/tools/dialogpointofintersection.cpp \
src/dialogs/tools/dialogpointofcontact.cpp \
src/dialogs/tools/dialognormal.cpp \
src/dialogs/tools/dialoglineintersect.cpp \
src/dialogs/tools/dialogline.cpp \
src/dialogs/tools/dialogheight.cpp \
src/dialogs/tools/dialogendline.cpp \
src/dialogs/tools/dialogdetail.cpp \
src/dialogs/tools/dialogbisector.cpp \
src/dialogs/tools/dialogarc.cpp \
src/dialogs/tools/dialogalongline.cpp \
src/dialogs/tools/dialogcutspline.cpp \
src/dialogs/tools/dialogcutsplinepath.cpp \
src/dialogs/tools/dialoguniondetails.cpp \
src/dialogs/tools/dialogcutarc.cpp \
src/dialogs/app/dialogincrements.cpp \
src/dialogs/app/dialoghistory.cpp \
src/dialogs/app/configdialog.cpp \
src/dialogs/app/pages.cpp \
src/dialogs/app/dialogpatternproperties.cpp \
src/dialogs/app/dialogmeasurements.cpp \
src/dialogs/app/dialogstandardmeasurements.cpp \
src/dialogs/app/dialogindividualmeasurements.cpp
FORMS += \
src/dialogs/dialogtriangle.ui \
src/dialogs/dialogsplinepath.ui \
src/dialogs/dialogspline.ui \
src/dialogs/dialogsinglepoint.ui \
src/dialogs/dialogshoulderpoint.ui \
src/dialogs/dialogpointofintersection.ui \
src/dialogs/dialogpointofcontact.ui \
src/dialogs/dialognormal.ui \
src/dialogs/dialoglineintersect.ui \
src/dialogs/dialogline.ui \
src/dialogs/dialogincrements.ui \
src/dialogs/dialoghistory.ui \
src/dialogs/dialogheight.ui \
src/dialogs/dialogendline.ui \
src/dialogs/dialogdetail.ui \
src/dialogs/dialogbisector.ui \
src/dialogs/dialogarc.ui \
src/dialogs/dialogalongline.ui \
src/dialogs/dialogcutspline.ui \
src/dialogs/dialogcutsplinepath.ui \
src/dialogs/dialoguniondetails.ui \
src/dialogs/dialogcutarc.ui \
src/dialogs/dialogpatternproperties.ui
src/dialogs/tools/dialogtriangle.ui \
src/dialogs/tools/dialogsplinepath.ui \
src/dialogs/tools/dialogspline.ui \
src/dialogs/tools/dialogsinglepoint.ui \
src/dialogs/tools/dialogshoulderpoint.ui \
src/dialogs/tools/dialogpointofintersection.ui \
src/dialogs/tools/dialogpointofcontact.ui \
src/dialogs/tools/dialognormal.ui \
src/dialogs/tools/dialoglineintersect.ui \
src/dialogs/tools/dialogline.ui \
src/dialogs/tools/dialogheight.ui \
src/dialogs/tools/dialogendline.ui \
src/dialogs/tools/dialogdetail.ui \
src/dialogs/tools/dialogbisector.ui \
src/dialogs/tools/dialogarc.ui \
src/dialogs/tools/dialogalongline.ui \
src/dialogs/tools/dialogcutspline.ui \
src/dialogs/tools/dialogcutsplinepath.ui \
src/dialogs/tools/dialoguniondetails.ui \
src/dialogs/tools/dialogcutarc.ui \
src/dialogs/app/dialogincrements.ui \
src/dialogs/app/dialoghistory.ui \
src/dialogs/app/dialogpatternproperties.ui \
src/dialogs/app/dialogmeasurements.ui \
src/dialogs/app/dialogstandardmeasurements.ui \
src/dialogs/app/dialogindividualmeasurements.ui

View File

@ -36,44 +36,27 @@ DialogAlongLine::DialogAlongLine(const VContainer *data, QWidget *parent)
typeLine(QString()), formula(QString()), firstPointId(0), secondPointId(0)
{
ui->setupUi(this);
listWidget = ui->listWidget;
labelResultCalculation = ui->labelResultCalculation;
labelDescription = ui->labelDescription;
radioButtonSizeGrowth = ui->radioButtonSizeGrowth;
radioButtonStandardTable = ui->radioButtonStandardTable;
radioButtonIncrements = ui->radioButtonIncrements;
radioButtonLengthLine = ui->radioButtonLengthLine;
radioButtonLengthArc = ui->radioButtonLengthArc;
radioButtonLengthCurve = ui->radioButtonLengthSpline;
lineEditFormula = ui->lineEditFormula;
labelEditFormula = ui->labelEditFormula;
labelEditNamePoint = ui->labelEditNamePoint;
flagFormula = false;
bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
connect(bOk, &QPushButton::clicked, this, &DialogAlongLine::DialogAccepted);
flagName = false;
InitOkCansel(ui);
CheckState();
QPushButton *bCansel = ui->buttonBox->button(QDialogButtonBox::Cancel);
connect(bCansel, &QPushButton::clicked, this, &DialogAlongLine::DialogRejected);
FillComboBoxTypeLine(ui->comboBoxLineType);
ui->comboBoxLineType->setCurrentIndex(0);
FillComboBoxPoints(ui->comboBoxFirstPoint);
FillComboBoxPoints(ui->comboBoxSecondPoint);
labelEditNamePoint = ui->labelEditNamePoint;
connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogAlongLine::PutHere);
connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogAlongLine::PutVal);
connect(ui->listWidget, &QListWidget::currentRowChanged, this, &DialogAlongLine::ValChenged);
ShowVariable(data->DataBase());
connect(ui->radioButtonSizeGrowth, &QRadioButton::clicked, this, &DialogAlongLine::SizeGrowth);
connect(ui->radioButtonStandardTable, &QRadioButton::clicked, this, &DialogAlongLine::StandardTable);
connect(ui->radioButtonIncrements, &QRadioButton::clicked, this, &DialogAlongLine::Increments);
connect(ui->radioButtonLengthLine, &QRadioButton::clicked, this, &DialogAlongLine::LengthLines);
connect(ui->radioButtonLengthArc, &QRadioButton::clicked, this, &DialogAlongLine::LengthArcs);
connect(ui->radioButtonLengthSpline, &QRadioButton::clicked, this, &DialogAlongLine::LengthCurves);
connect(ui->toolButtonEqual, &QPushButton::clicked, this, &DialogAlongLine::EvalFormula);
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogAlongLine::NamePointChanged);
connect(ui->toolButtonEqual, &QPushButton::clicked, this, &DialogAlongLine::EvalFormula);
connect(ui->lineEditFormula, &QLineEdit::textChanged, this, &DialogAlongLine::FormulaChanged);
InitVariables(ui);
connect(listWidget, &QListWidget::itemDoubleClicked, this, &DialogTool::PutVal);
}
DialogAlongLine::~DialogAlongLine()
@ -81,34 +64,27 @@ DialogAlongLine::~DialogAlongLine()
delete ui;
}
void DialogAlongLine::ChoosedObject(qint64 id, const Scene::Scenes &type)
void DialogAlongLine::ChoosedObject(quint32 id, const Valentina::Scenes &type)
{
if (type == Scene::Point)
if (type == Valentina::Point)
{
const VPointF *point = data->GeometricObject<const VPointF *>(id);
if (number == 0)
{
qint32 index = ui->comboBoxFirstPoint->findText(point->name());
if ( index != -1 )
{ // -1 for not found
ui->comboBoxFirstPoint->setCurrentIndex(index);
if (ChoosedPoint(id, ui->comboBoxFirstPoint, tr("Select second point of line")))
{
number++;
emit ToolTip(tr("Select second point of line"));
return;
}
}
if (number == 1)
{
qint32 index = ui->comboBoxSecondPoint->findText(point->name());
if ( index != -1 )
{ // -1 for not found
ui->comboBoxSecondPoint->setCurrentIndex(index);
number = 0;
emit ToolTip("");
}
if (isInitialized == false)
if (ChoosedPoint(id, ui->comboBoxSecondPoint, ""))
{
this->show();
number = 0;
if (isInitialized == false)
{
this->show();
}
}
}
}
@ -124,12 +100,12 @@ void DialogAlongLine::DialogAccepted()
emit DialogClosed(QDialog::Accepted);
}
void DialogAlongLine::setSecondPointId(const qint64 &value, const qint64 &id)
void DialogAlongLine::setSecondPointId(const quint32 &value, const quint32 &id)
{
setCurrentPointId(ui->comboBoxSecondPoint, secondPointId, value, id);
}
void DialogAlongLine::setFirstPointId(const qint64 &value, const qint64 &id)
void DialogAlongLine::setFirstPointId(const quint32 &value, const quint32 &id)
{
setCurrentPointId(ui->comboBoxFirstPoint, firstPointId, value, id);
}

View File

@ -43,18 +43,18 @@ class DialogAlongLine : public DialogTool
{
Q_OBJECT
public:
/**
* @brief DialogAlongLine create dialog
* @param data container with data
* @param parent parent widget
*/
DialogAlongLine(const VContainer *data, QWidget *parent = 0);
~DialogAlongLine();
/**
* @brief DialogAlongLine create dialog
* @param data container with data
* @param parent parent widget
*/
DialogAlongLine(const VContainer *data, QWidget *parent = nullptr);
~DialogAlongLine();
/**
* @brief getPointName return name of point
* @return name
*/
inline QString getPointName() const {return pointName;}
QString getPointName() const;
/**
* @brief setPointName set name of point
* @param value name
@ -64,7 +64,7 @@ public:
* @brief getTypeLine return type of line
* @return type
*/
inline QString getTypeLine() const {return typeLine;}
QString getTypeLine() const;
/**
* @brief setTypeLine set type of line
* @param value type
@ -74,7 +74,7 @@ public:
* @brief getFormula return string of formula
* @return formula
*/
inline QString getFormula() const {return formula;}
QString getFormula() const;
/**
* @brief setFormula set string of formula
* @param value formula
@ -84,31 +84,31 @@ public:
* @brief getFirstPointId return id first point of line
* @return id
*/
inline qint64 getFirstPointId() const {return firstPointId;}
quint32 getFirstPointId() const;
/**
* @brief setFirstPointId set id first point of line
* @param value id
* @param id id of current point
*/
void setFirstPointId(const qint64 &value, const qint64 &id);
void setFirstPointId(const quint32 &value, const quint32 &id);
/**
* @brief getSecondPointId return id second point of line
* @return id
*/
inline qint64 getSecondPointId() const {return secondPointId;}
quint32 getSecondPointId() const;
/**
* @brief setSecondPointId set id second point of line
* @param value id
* @param id id of current point
*/
void setSecondPointId(const qint64 &value, const qint64 &id);
void setSecondPointId(const quint32 &value, const quint32 &id);
public slots:
/**
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
* @param id id of point or detail
* @param type type of object
*/
virtual void ChoosedObject(qint64 id, const Scene::Scenes &type);
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
/**
* @brief DialogAccepted save data and emit signal about closed dialog.
*/
@ -138,11 +138,36 @@ private:
/**
* @brief firstPointId id first point of line
*/
qint64 firstPointId;
quint32 firstPointId;
/**
* @brief secondPointId id second point of line
*/
qint64 secondPointId;
quint32 secondPointId;
};
inline QString DialogAlongLine::getPointName() const
{
return pointName;
}
inline QString DialogAlongLine::getTypeLine() const
{
return typeLine;
}
inline QString DialogAlongLine::getFormula() const
{
return formula;
}
inline quint32 DialogAlongLine::getFirstPointId() const
{
return firstPointId;
}
inline quint32 DialogAlongLine::getSecondPointId() const
{
return secondPointId;
}
#endif // DIALOGALONGLINE_H

View File

@ -34,7 +34,7 @@
DialogArc::DialogArc(const VContainer *data, QWidget *parent)
:DialogTool(data, parent), ui(new Ui::DialogArc), flagRadius(false), flagF1(false), flagF2(false),
timerRadius(0), timerF1(0), timerF2(0), center(0), radius(QString()), f1(QString()), f2(QString())
timerRadius(nullptr), timerF1(nullptr), timerF2(nullptr), center(0), radius(QString()), f1(QString()), f2(QString())
{
ui->setupUi(this);
@ -47,38 +47,17 @@ DialogArc::DialogArc(const VContainer *data, QWidget *parent)
timerF2 = new QTimer(this);
connect(timerF2, &QTimer::timeout, this, &DialogArc::EvalF2);
bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
connect(bOk, &QPushButton::clicked, this, &DialogArc::DialogAccepted);
QPushButton *bCansel = ui->buttonBox->button(QDialogButtonBox::Cancel);
connect(bCansel, &QPushButton::clicked, this, &DialogArc::DialogRejected);
InitOkCansel(ui);
FillComboBoxPoints(ui->comboBoxBasePoint);
CheckState();
listWidget = ui->listWidget;
labelDescription = ui->labelDescription;
radioButtonSizeGrowth = ui->radioButtonSizeGrowth;
radioButtonStandardTable = ui->radioButtonStandardTable;
radioButtonIncrements = ui->radioButtonIncrements;
radioButtonLengthLine = ui->radioButtonLengthLine;
radioButtonLengthArc = ui->radioButtonLengthArc;
radioButtonLengthCurve = ui->radioButtonLengthSpline;
InitVariables(ui);
connect(ui->toolButtonPutHereRadius, &QPushButton::clicked, this, &DialogArc::PutRadius);
connect(ui->toolButtonPutHereF1, &QPushButton::clicked, this, &DialogArc::PutF1);
connect(ui->toolButtonPutHereF2, &QPushButton::clicked, this, &DialogArc::PutF2);
connect(ui->listWidget, &QListWidget::currentRowChanged, this, &DialogArc::ValChenged);
ShowVariable(data->DataBase());
connect(ui->radioButtonSizeGrowth, &QRadioButton::clicked, this, &DialogArc::SizeGrowth);
connect(ui->radioButtonStandardTable, &QRadioButton::clicked, this, &DialogArc::StandardTable);
connect(ui->radioButtonIncrements, &QRadioButton::clicked, this, &DialogArc::Increments);
connect(ui->radioButtonLengthLine, &QRadioButton::clicked, this, &DialogArc::LengthLines);
connect(ui->radioButtonLineAngles, &QRadioButton::clicked, this, &DialogArc::LineAngles);
connect(ui->radioButtonLengthArc, &QRadioButton::clicked, this, &DialogArc::LengthArcs);
connect(ui->radioButtonLengthSpline, &QRadioButton::clicked, this, &DialogArc::LengthCurves);
connect(ui->toolButtonEqualRadius, &QPushButton::clicked, this, &DialogArc::EvalRadius);
connect(ui->toolButtonEqualF1, &QPushButton::clicked, this, &DialogArc::EvalF1);
@ -94,7 +73,7 @@ DialogArc::~DialogArc()
delete ui;
}
void DialogArc::SetCenter(const qint64 &value)
void DialogArc::SetCenter(const quint32 &value)
{
center = value;
ChangeCurrentData(ui->comboBoxBasePoint, center);
@ -118,9 +97,9 @@ void DialogArc::SetRadius(const QString &value)
ui->lineEditRadius->setText(radius);
}
void DialogArc::ChoosedObject(qint64 id, const Scene::Scenes &type)
void DialogArc::ChoosedObject(quint32 id, const Valentina::Scenes &type)
{
if (type == Scene::Point)
if (type == Valentina::Point)
{
const VPointF *point = data->GeometricObject<const VPointF *>(id);

View File

@ -43,164 +43,184 @@ class DialogArc : public DialogTool
{
Q_OBJECT
public:
/**
* @brief DialogArc create dialog
* @param data container with data
* @param parent parent widget
*/
DialogArc(const VContainer *data, QWidget *parent = 0);
~DialogArc();
/**
* @brief DialogArc create dialog
* @param data container with data
* @param parent parent widget
*/
DialogArc(const VContainer *data, QWidget *parent = nullptr);
~DialogArc();
/**
* @brief GetCenter return id of center point
* @return id id
*/
inline qint64 GetCenter() const {return center;}
quint32 GetCenter() const;
/**
* @brief SetCenter set id of center point
* @param value id
*/
void SetCenter(const qint64 &value);
void SetCenter(const quint32 &value);
/**
* @brief GetRadius return formula of radius
* @return formula
*/
inline QString GetRadius() const {return radius;}
QString GetRadius() const;
/**
* @brief SetRadius set formula of radius
* @param value formula
*/
void SetRadius(const QString &value);
void SetRadius(const QString &value);
/**
* @brief GetF1 return formula first angle of arc
* @return formula
*/
inline QString GetF1() const {return f1;}
QString GetF1() const;
/**
* @brief SetF1 set formula first angle of arc
* @param value formula
*/
void SetF1(const QString &value);
void SetF1(const QString &value);
/**
* @brief GetF2 return formula second angle of arc
* @return formula
*/
inline QString GetF2() const {return f2;}
QString GetF2() const;
/**
* @brief SetF2 set formula second angle of arc
* @param value formula
*/
void SetF2(const QString &value);
void SetF2(const QString &value);
public slots:
/**
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
* @param id id of point or detail
* @param type type of object
*/
virtual void ChoosedObject(qint64 id, const Scene::Scenes &type);
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
/**
* @brief DialogAccepted save data and emit signal about closed dialog.
*/
virtual void DialogAccepted();
virtual void DialogAccepted();
/**
* @brief ValChenged show description angles of lines
* @param row number of row
*/
virtual void ValChenged(int row);
virtual void ValChenged(int row);
/**
* @brief PutRadius put variable into formula of radius
*/
void PutRadius();
void PutRadius();
/**
* @brief PutF1 put variable into formula of first angle
*/
void PutF1();
void PutF1();
/**
* @brief PutF2 put variable into formula of second angle
*/
void PutF2();
void PutF2();
/**
* @brief LineAngles show variable angles of lines
*/
void LineAngles();
void LineAngles();
/**
* @brief RadiusChanged after change formula of radius calculate value and show result
*/
void RadiusChanged();
void RadiusChanged();
/**
* @brief F1Changed after change formula of first angle calculate value and show result
*/
void F1Changed();
void F1Changed();
/**
* @brief F2Changed after change formula of second angle calculate value and show result
*/
void F2Changed();
void F2Changed();
protected:
/**
* @brief CheckState if all is right enable button ok
*/
virtual void CheckState();
virtual void CheckState();
private:
Q_DISABLE_COPY(DialogArc)
/**
* @brief ui keeps information about user interface
*/
Ui::DialogArc *ui;
Ui::DialogArc *ui;
/**
* @brief flagRadius true if value of radius is correct
*/
bool flagRadius;
bool flagRadius;
/**
* @brief flagF1 true if value of first angle is correct
*/
bool flagF1;
bool flagF1;
/**
* @brief flagF2 true if value of second angle is correct
*/
bool flagF2;
bool flagF2;
/**
* @brief timerRadius timer of check formula of radius
*/
QTimer *timerRadius;
QTimer *timerRadius;
/**
* @brief timerF1 timer of check formula of first angle
*/
QTimer *timerF1;
QTimer *timerF1;
/**
* @brief timerF2 timer of check formula of second angle
*/
QTimer *timerF2;
QTimer *timerF2;
/**
* @brief center id of center point
*/
qint64 center;
quint32 center;
/**
* @brief radius formula of radius
*/
QString radius;
QString radius;
/**
* @brief f1 formula of first angle
*/
QString f1;
QString f1;
/**
* @brief f2 formula of second angle
*/
QString f2;
QString f2;
/**
* @brief EvalRadius calculate value of radius
*/
void EvalRadius();
void EvalRadius();
/**
* @brief EvalF1 calculate value of first angle
*/
void EvalF1();
void EvalF1();
/**
* @brief EvalF2 calculate value of second angle
*/
void EvalF2();
void EvalF2();
/**
* @brief ShowLineAngles show varibles angles of lines
*/
void ShowLineAngles();
void ShowLineAngles();
};
inline quint32 DialogArc::GetCenter() const
{
return center;
}
inline QString DialogArc::GetRadius() const
{
return radius;
}
inline QString DialogArc::GetF1() const
{
return f1;
}
inline QString DialogArc::GetF2() const
{
return f2;
}
#endif // DIALOGARC_H

View File

@ -36,25 +36,15 @@ DialogBisector::DialogBisector(const VContainer *data, QWidget *parent)
typeLine(QString()), formula(QString()), firstPointId(0), secondPointId(0), thirdPointId(0)
{
ui->setupUi(this);
listWidget = ui->listWidget;
InitVariables(ui);
labelResultCalculation = ui->labelResultCalculation;
labelDescription = ui->labelDescription;
radioButtonSizeGrowth = ui->radioButtonSizeGrowth;
radioButtonStandardTable = ui->radioButtonStandardTable;
radioButtonIncrements = ui->radioButtonIncrements;
radioButtonLengthLine = ui->radioButtonLengthLine;
radioButtonLengthArc = ui->radioButtonLengthArc;
radioButtonLengthCurve = ui->radioButtonLengthSpline;
lineEditFormula = ui->lineEditFormula;
labelEditFormula = ui->labelEditFormula;
labelEditNamePoint = ui->labelEditNamePoint;
InitOkCansel(ui);
flagFormula = false;
bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
connect(bOk, &QPushButton::clicked, this, &DialogBisector::DialogAccepted);
flagName = false;
CheckState();
QPushButton *bCansel = ui->buttonBox->button(QDialogButtonBox::Cancel);
connect(bCansel, &QPushButton::clicked, this, &DialogBisector::DialogRejected);
FillComboBoxPoints(ui->comboBoxFirstPoint);
FillComboBoxPoints(ui->comboBoxSecondPoint);
@ -62,16 +52,8 @@ DialogBisector::DialogBisector(const VContainer *data, QWidget *parent)
FillComboBoxTypeLine(ui->comboBoxLineType);
connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogBisector::PutHere);
connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogBisector::PutVal);
connect(ui->listWidget, &QListWidget::currentRowChanged, this, &DialogBisector::ValChenged);
connect(listWidget, &QListWidget::itemDoubleClicked, this, &DialogBisector::PutVal);
ShowVariable(data->DataBase());
connect(ui->radioButtonSizeGrowth, &QRadioButton::clicked, this, &DialogBisector::SizeGrowth);
connect(ui->radioButtonStandardTable, &QRadioButton::clicked, this, &DialogBisector::StandardTable);
connect(ui->radioButtonIncrements, &QRadioButton::clicked, this, &DialogBisector::Increments);
connect(ui->radioButtonLengthLine, &QRadioButton::clicked, this, &DialogBisector::LengthLines);
connect(ui->radioButtonLengthArc, &QRadioButton::clicked, this, &DialogBisector::LengthArcs);
connect(ui->radioButtonLengthSpline, &QRadioButton::clicked, this, &DialogBisector::LengthCurves);
connect(ui->toolButtonEqual, &QPushButton::clicked, this, &DialogBisector::EvalFormula);
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogBisector::NamePointChanged);
connect(ui->lineEditFormula, &QLineEdit::textChanged, this, &DialogBisector::FormulaChanged);
@ -82,9 +64,9 @@ DialogBisector::~DialogBisector()
delete ui;
}
void DialogBisector::ChoosedObject(qint64 id, const Scene::Scenes &type)
void DialogBisector::ChoosedObject(quint32 id, const Valentina::Scenes &type)
{
if (type == Scene::Point)
if (type == Valentina::Point)
{
const VPointF *point = data->GeometricObject<const VPointF *>(id);
if (number == 0)
@ -144,17 +126,17 @@ void DialogBisector::setFormula(const QString &value)
ui->lineEditFormula->setText(formula);
}
void DialogBisector::setFirstPointId(const qint64 &value, const qint64 &id)
void DialogBisector::setFirstPointId(const quint32 &value, const quint32 &id)
{
setCurrentPointId(ui->comboBoxFirstPoint, firstPointId, value, id);
}
void DialogBisector::setSecondPointId(const qint64 &value, const qint64 &id)
void DialogBisector::setSecondPointId(const quint32 &value, const quint32 &id)
{
setCurrentPointId(ui->comboBoxSecondPoint, secondPointId, value, id);
}
void DialogBisector::setThirdPointId(const qint64 &value, const qint64 &id)
void DialogBisector::setThirdPointId(const quint32 &value, const quint32 &id)
{
setCurrentPointId(ui->comboBoxThirdPoint, thirdPointId, value, id);
}

View File

@ -43,87 +43,87 @@ class DialogBisector : public DialogTool
{
Q_OBJECT
public:
/**
* @brief DialogBisector create dialog
* @param data container with data
* @param parent parent widget
*/
DialogBisector(const VContainer *data, QWidget *parent = 0);
~DialogBisector();
/**
* @brief DialogBisector create dialog
* @param data container with data
* @param parent parent widget
*/
DialogBisector(const VContainer *data, QWidget *parent = nullptr);
~DialogBisector();
/**
* @brief getPointName return name of point
* @return name
*/
QString getPointName() const {return pointName;}
QString getPointName() const {return pointName;}
/**
* @brief setPointName set name of point
* @param value name
*/
void setPointName(const QString &value);
void setPointName(const QString &value);
/**
* @brief getTypeLine return type of line
* @return type
*/
inline QString getTypeLine() const {return typeLine;}
QString getTypeLine() const;
/**
* @brief setTypeLine set type of line
* @param value type
*/
void setTypeLine(const QString &value);
void setTypeLine(const QString &value);
/**
* @brief getFormula return string of formula
* @return formula
*/
inline QString getFormula() const {return formula;}
QString getFormula() const;
/**
* @brief setFormula set string of formula
* @param value formula
*/
void setFormula(const QString &value);
void setFormula(const QString &value);
/**
* @brief getFirstPointId return id of first point
* @return id
*/
inline qint64 getFirstPointId() const {return firstPointId;}
quint32 getFirstPointId() const;
/**
* @brief setFirstPointId set id of first point
* @param value id
* @param id don't show this id in list
*/
void setFirstPointId(const qint64 &value, const qint64 &id);
void setFirstPointId(const quint32 &value, const quint32 &id);
/**
* @brief getSecondPointId return id of second point
* @return id
*/
inline qint64 getSecondPointId() const {return secondPointId;}
quint32 getSecondPointId() const;
/**
* @brief setSecondPointId set id of second point
* @param value id
* @param id don't show this id in list
*/
void setSecondPointId(const qint64 &value, const qint64 &id);
void setSecondPointId(const quint32 &value, const quint32 &id);
/**
* @brief getThirdPointId return id of third point
* @return id
*/
inline qint64 getThirdPointId() const {return thirdPointId;}
quint32 getThirdPointId() const;
/**
* @brief setThirdPointId set id of third point
* @param value id
* @param id don't show this id in list
*/
void setThirdPointId(const qint64 &value, const qint64 &id);
void setThirdPointId(const quint32 &value, const quint32 &id);
public slots:
/**
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
* @param id id of point or detail
* @param type type of object
*/
virtual void ChoosedObject(qint64 id, const Scene::Scenes &type);
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
/**
* @brief DialogAccepted save data and emit signal about closed dialog.
*/
virtual void DialogAccepted();
virtual void DialogAccepted();
private:
Q_DISABLE_COPY(DialogBisector)
/**
@ -149,15 +149,40 @@ private:
/**
* @brief firstPointId id of first point
*/
qint64 firstPointId;
quint32 firstPointId;
/**
* @brief secondPointId id of second point
*/
qint64 secondPointId;
quint32 secondPointId;
/**
* @brief thirdPointId id of third point
*/
qint64 thirdPointId;
quint32 thirdPointId;
};
inline QString DialogBisector::getTypeLine() const
{
return typeLine;
}
inline QString DialogBisector::getFormula() const
{
return formula;
}
inline quint32 DialogBisector::getFirstPointId() const
{
return firstPointId;
}
inline quint32 DialogBisector::getSecondPointId() const
{
return secondPointId;
}
inline quint32 DialogBisector::getThirdPointId() const
{
return thirdPointId;
}
#endif // DIALOGBISECTOR_H

View File

@ -33,39 +33,22 @@ DialogCutArc::DialogCutArc(const VContainer *data, QWidget *parent) :
DialogTool(data, parent), ui(new Ui::DialogCutArc), pointName(QString()), formula(QString()), arcId(0)
{
ui->setupUi(this);
listWidget = ui->listWidget;
InitVariables(ui);
labelResultCalculation = ui->labelResultCalculation;
labelDescription = ui->labelDescription;
radioButtonSizeGrowth = ui->radioButtonSizeGrowth;
radioButtonStandardTable = ui->radioButtonStandardTable;
radioButtonIncrements = ui->radioButtonIncrements;
radioButtonLengthLine = ui->radioButtonLengthLine;
radioButtonLengthArc = ui->radioButtonLengthArc;
radioButtonLengthCurve = ui->radioButtonLengthSpline;
lineEditFormula = ui->lineEditFormula;
labelEditFormula = ui->labelEditFormula;
labelEditNamePoint = ui->labelEditNamePoint;
InitOkCansel(ui);
flagFormula = false;
bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
connect(bOk, &QPushButton::clicked, this, &DialogCutArc::DialogAccepted);
flagName = false;
CheckState();
QPushButton *bCansel = ui->buttonBox->button(QDialogButtonBox::Cancel);
connect(bCansel, &QPushButton::clicked, this, &DialogCutArc::DialogRejected);
FillComboBoxArcs(ui->comboBoxArc);
connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogCutArc::PutHere);
connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogCutArc::PutVal);
connect(ui->listWidget, &QListWidget::currentRowChanged, this, &DialogCutArc::ValChenged);
ShowVariable(data->DataBase());
connect(ui->radioButtonSizeGrowth, &QRadioButton::clicked, this, &DialogCutArc::SizeGrowth);
connect(ui->radioButtonStandardTable, &QRadioButton::clicked, this, &DialogCutArc::StandardTable);
connect(ui->radioButtonIncrements, &QRadioButton::clicked, this, &DialogCutArc::Increments);
connect(ui->radioButtonLengthLine, &QRadioButton::clicked, this, &DialogCutArc::LengthLines);
connect(ui->radioButtonLengthArc, &QRadioButton::clicked, this, &DialogCutArc::LengthArcs);
connect(ui->radioButtonLengthSpline, &QRadioButton::clicked, this, &DialogCutArc::LengthCurves);
connect(ui->toolButtonEqual, &QPushButton::clicked, this, &DialogCutArc::EvalFormula);
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogCutArc::NamePointChanged);
connect(ui->lineEditFormula, &QLineEdit::textChanged, this, &DialogCutArc::FormulaChanged);
@ -76,9 +59,9 @@ DialogCutArc::~DialogCutArc()
delete ui;
}
void DialogCutArc::ChoosedObject(qint64 id, const Scene::Scenes &type)
void DialogCutArc::ChoosedObject(quint32 id, const Valentina::Scenes &type)
{
if (type == Scene::Arc)
if (type == Valentina::Arc)
{
const VArc *arc = data->GeometricObject<const VArc *>(id);
ChangeCurrentText(ui->comboBoxArc, arc->name());
@ -95,7 +78,7 @@ void DialogCutArc::DialogAccepted()
emit DialogClosed(QDialog::Accepted);
}
void DialogCutArc::setArcId(const qint64 &value, const qint64 &id)
void DialogCutArc::setArcId(const quint32 &value, const quint32 &id)
{
setCurrentArcId(ui->comboBoxArc, arcId, value, id, ComboMode::CutArc);
}

View File

@ -48,7 +48,7 @@ public:
* @param data container with data
* @param parent parent widget
*/
DialogCutArc(const VContainer *data, QWidget *parent = 0);
DialogCutArc(const VContainer *data, QWidget *parent = nullptr);
~DialogCutArc();
/**
* @brief getPointName return name point on arc
@ -74,20 +74,20 @@ public:
* @brief getArcId return id of arc
* @return id
*/
qint64 getArcId() const {return arcId;}
quint32 getArcId() const {return arcId;}
/**
* @brief setArcId set id of arc
* @param value id
* @param id don't show this id in list
*/
void setArcId(const qint64 &value, const qint64 &id);
void setArcId(const quint32 &value, const quint32 &id);
public slots:
/**
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
* @param id id of point or detail
* @param type type of object
*/
virtual void ChoosedObject(qint64 id, const Scene::Scenes &type);
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
/**
* @brief DialogAccepted save data and emit signal about closed dialog.
*/
@ -109,7 +109,7 @@ private:
/**
* @brief arcId keep id of arc
*/
qint64 arcId;
quint32 arcId;
};
#endif // DIALOGCUTARC_H

View File

@ -33,39 +33,21 @@ DialogCutSpline::DialogCutSpline(const VContainer *data, QWidget *parent)
:DialogTool(data, parent), ui(new Ui::DialogCutSpline), pointName(QString()), formula(QString()), splineId(0)
{
ui->setupUi(this);
listWidget = ui->listWidget;
InitVariables(ui);
labelResultCalculation = ui->labelResultCalculation;
labelDescription = ui->labelDescription;
radioButtonSizeGrowth = ui->radioButtonSizeGrowth;
radioButtonStandardTable = ui->radioButtonStandardTable;
radioButtonIncrements = ui->radioButtonIncrements;
radioButtonLengthLine = ui->radioButtonLengthLine;
radioButtonLengthArc = ui->radioButtonLengthArc;
radioButtonLengthCurve = ui->radioButtonLengthSpline;
lineEditFormula = ui->lineEditFormula;
labelEditFormula = ui->labelEditFormula;
labelEditNamePoint = ui->labelEditNamePoint;
InitOkCansel(ui);
flagFormula = false;
bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
connect(bOk, &QPushButton::clicked, this, &DialogCutSpline::DialogAccepted);
flagName = false;
CheckState();
QPushButton *bCansel = ui->buttonBox->button(QDialogButtonBox::Cancel);
connect(bCansel, &QPushButton::clicked, this, &DialogCutSpline::DialogRejected);
FillComboBoxSplines(ui->comboBoxSpline);
connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogCutSpline::PutHere);
connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogCutSpline::PutVal);
connect(ui->listWidget, &QListWidget::currentRowChanged, this, &DialogCutSpline::ValChenged);
ShowVariable(data->DataBase());
connect(ui->radioButtonSizeGrowth, &QRadioButton::clicked, this, &DialogCutSpline::SizeGrowth);
connect(ui->radioButtonStandardTable, &QRadioButton::clicked, this, &DialogCutSpline::StandardTable);
connect(ui->radioButtonIncrements, &QRadioButton::clicked, this, &DialogCutSpline::Increments);
connect(ui->radioButtonLengthLine, &QRadioButton::clicked, this, &DialogCutSpline::LengthLines);
connect(ui->radioButtonLengthArc, &QRadioButton::clicked, this, &DialogCutSpline::LengthArcs);
connect(ui->radioButtonLengthSpline, &QRadioButton::clicked, this, &DialogCutSpline::LengthCurves);
connect(ui->toolButtonEqual, &QPushButton::clicked, this, &DialogCutSpline::EvalFormula);
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogCutSpline::NamePointChanged);
connect(ui->lineEditFormula, &QLineEdit::textChanged, this, &DialogCutSpline::FormulaChanged);
@ -88,14 +70,14 @@ void DialogCutSpline::setFormula(const QString &value)
ui->lineEditFormula->setText(formula);
}
void DialogCutSpline::setSplineId(const qint64 &value, const qint64 &id)
void DialogCutSpline::setSplineId(const quint32 &value, const quint32 &id)
{
setCurrentSplineId(ui->comboBoxSpline, splineId, value, id, ComboMode::CutSpline);
}
void DialogCutSpline::ChoosedObject(qint64 id, const Scene::Scenes &type)
void DialogCutSpline::ChoosedObject(quint32 id, const Valentina::Scenes &type)
{
if (type == Scene::Spline)
if (type == Valentina::Spline)
{
const VSpline *spl = data->GeometricObject<const VSpline *>(id);
ChangeCurrentText(ui->comboBoxSpline, spl->name());

View File

@ -48,50 +48,50 @@ public:
* @param data container with data
* @param parent parent widget
*/
DialogCutSpline(const VContainer *data, QWidget *parent = 0);
DialogCutSpline(const VContainer *data, QWidget *parent = nullptr);
~DialogCutSpline();
/**
* @brief getPointName return name of point
* @return name
*/
inline QString getPointName() const {return pointName;}
QString getPointName() const;
/**
* @brief setPointName set name of point
* @param value name
*/
void setPointName(const QString &value);
void setPointName(const QString &value);
/**
* @brief getFormula return string of formula
* @return formula
*/
inline QString getFormula() const {return formula;}
QString getFormula() const;
/**
* @brief setFormula set string of formula
* @param value formula
*/
void setFormula(const QString &value);
void setFormula(const QString &value);
/**
* @brief getSplineId return id base point of line
* @return id
*/
inline qint64 getSplineId() const {return splineId;}
quint32 getSplineId() const;
/**
* @brief setSplineId set id spline
* @param value id
* @param id don't show this id in list
*/
void setSplineId(const qint64 &value, const qint64 &id);
void setSplineId(const quint32 &value, const quint32 &id);
public slots:
/**
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
* @param id id of point or detail
* @param type type of object
*/
virtual void ChoosedObject(qint64 id, const Scene::Scenes &type);
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
/**
* @brief DialogAccepted save data and emit signal about closed dialog.
*/
virtual void DialogAccepted();
virtual void DialogAccepted();
private:
Q_DISABLE_COPY(DialogCutSpline)
/**
@ -101,15 +101,30 @@ private:
/**
* @brief pointName name of created point
*/
QString pointName;
QString pointName;
/**
* @brief formula string with formula
*/
QString formula;
QString formula;
/**
* @brief splineId keep id of spline
*/
qint64 splineId;
quint32 splineId;
};
inline QString DialogCutSpline::getPointName() const
{
return pointName;
}
inline QString DialogCutSpline::getFormula() const
{
return formula;
}
inline quint32 DialogCutSpline::getSplineId() const
{
return splineId;
}
#endif // DIALOGCUTSPLINE_H

View File

@ -34,39 +34,21 @@ DialogCutSplinePath::DialogCutSplinePath(const VContainer *data, QWidget *parent
splinePathId(0)
{
ui->setupUi(this);
listWidget = ui->listWidget;
InitVariables(ui);
labelResultCalculation = ui->labelResultCalculation;
labelDescription = ui->labelDescription;
radioButtonSizeGrowth = ui->radioButtonSizeGrowth;
radioButtonStandardTable = ui->radioButtonStandardTable;
radioButtonIncrements = ui->radioButtonIncrements;
radioButtonLengthLine = ui->radioButtonLengthLine;
radioButtonLengthArc = ui->radioButtonLengthArc;
radioButtonLengthCurve = ui->radioButtonLengthSpline;
lineEditFormula = ui->lineEditFormula;
labelEditFormula = ui->labelEditFormula;
labelEditNamePoint = ui->labelEditNamePoint;
InitOkCansel(ui);
flagFormula = false;
bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
connect(bOk, &QPushButton::clicked, this, &DialogCutSplinePath::DialogAccepted);
flagName = false;
CheckState();
QPushButton *bCansel = ui->buttonBox->button(QDialogButtonBox::Cancel);
connect(bCansel, &QPushButton::clicked, this, &DialogCutSplinePath::DialogRejected);
FillComboBoxSplinesPath(ui->comboBoxSplinePath);
connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogCutSplinePath::PutHere);
connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogCutSplinePath::PutVal);
connect(ui->listWidget, &QListWidget::currentRowChanged, this, &DialogCutSplinePath::ValChenged);
ShowVariable(data->DataBase());
connect(ui->radioButtonSizeGrowth, &QRadioButton::clicked, this, &DialogCutSplinePath::SizeGrowth);
connect(ui->radioButtonStandardTable, &QRadioButton::clicked, this, &DialogCutSplinePath::StandardTable);
connect(ui->radioButtonIncrements, &QRadioButton::clicked, this, &DialogCutSplinePath::Increments);
connect(ui->radioButtonLengthLine, &QRadioButton::clicked, this, &DialogCutSplinePath::LengthLines);
connect(ui->radioButtonLengthArc, &QRadioButton::clicked, this, &DialogCutSplinePath::LengthArcs);
connect(ui->radioButtonLengthSpline, &QRadioButton::clicked, this, &DialogCutSplinePath::LengthCurves);
connect(ui->toolButtonEqual, &QPushButton::clicked, this, &DialogCutSplinePath::EvalFormula);
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogCutSplinePath::NamePointChanged);
connect(ui->lineEditFormula, &QLineEdit::textChanged, this, &DialogCutSplinePath::FormulaChanged);
@ -89,14 +71,14 @@ void DialogCutSplinePath::setFormula(const QString &value)
ui->lineEditFormula->setText(formula);
}
void DialogCutSplinePath::setSplinePathId(const qint64 &value, const qint64 &id)
void DialogCutSplinePath::setSplinePathId(const quint32 &value, const quint32 &id)
{
setCurrentSplinePathId(ui->comboBoxSplinePath, splinePathId, value, id, ComboMode::CutSpline);
}
void DialogCutSplinePath::ChoosedObject(qint64 id, const Scene::Scenes &type)
void DialogCutSplinePath::ChoosedObject(quint32 id, const Valentina::Scenes &type)
{
if (type == Scene::SplinePath)
if (type == Valentina::SplinePath)
{
const VSplinePath *splPath = data->GeometricObject<const VSplinePath *>(id);
ChangeCurrentText(ui->comboBoxSplinePath, splPath->name());

View File

@ -48,50 +48,50 @@ public:
* @param data container with data
* @param parent parent widget
*/
DialogCutSplinePath(const VContainer *data, QWidget *parent = 0);
DialogCutSplinePath(const VContainer *data, QWidget *parent = nullptr);
~DialogCutSplinePath();
/**
* @brief getPointName return name of point
* @return name
*/
inline QString getPointName() const {return pointName;}
QString getPointName() const;
/**
* @brief setPointName set name of point
* @param value name
*/
void setPointName(const QString &value);
void setPointName(const QString &value);
/**
* @brief getFormula return string of formula
* @return formula
*/
inline QString getFormula() const {return formula;}
QString getFormula() const;
/**
* @brief setFormula set string of formula
* @param value formula
*/
void setFormula(const QString &value);
void setFormula(const QString &value);
/**
* @brief getSplineId return id base point of line
* @return id
*/
inline qint64 getSplinePathId() const {return splinePathId;}
quint32 getSplinePathId() const;
/**
* @brief setSplineId set id spline
* @param value id
* @param id don't show this id in list
*/
void setSplinePathId(const qint64 &value, const qint64 &id);
void setSplinePathId(const quint32 &value, const quint32 &id);
public slots:
/**
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
* @param id id of point or detail
* @param type type of object
*/
virtual void ChoosedObject(qint64 id, const Scene::Scenes &type);
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
/**
* @brief DialogAccepted save data and emit signal about closed dialog.
*/
virtual void DialogAccepted();
virtual void DialogAccepted();
private:
Q_DISABLE_COPY(DialogCutSplinePath)
/**
@ -101,15 +101,30 @@ private:
/**
* @brief pointName name of created point
*/
QString pointName;
QString pointName;
/**
* @brief formula string with formula
*/
QString formula;
QString formula;
/**
* @brief splinePathId keep id of splinePath
*/
qint64 splinePathId;
quint32 splinePathId;
};
inline QString DialogCutSplinePath::getPointName() const
{
return pointName;
}
inline QString DialogCutSplinePath::getFormula() const
{
return formula;
}
inline quint32 DialogCutSplinePath::getSplinePathId() const
{
return splinePathId;
}
#endif // DIALOGCUTSPLINEPATH_H

View File

@ -36,8 +36,13 @@ DialogDetail::DialogDetail(const VContainer *data, QWidget *parent)
{
ui.setupUi(this);
labelEditNamePoint = ui.labelEditNameDetail;
bOk = ui.buttonBox->button(QDialogButtonBox::Ok);
connect(bOk, &QPushButton::clicked, this, &DialogDetail::DialogAccepted);
Q_CHECK_PTR(bOk);
connect(bOk, &QPushButton::clicked, this, &DialogTool::DialogAccepted);
QPushButton *bCansel = ui.buttonBox->button(QDialogButtonBox::Cancel);
Q_CHECK_PTR(bCansel);
connect(bCansel, &QPushButton::clicked, this, &DialogTool::DialogRejected);
flagName = true;//We have default name of detail.
QPalette palette = labelEditNamePoint->palette();
@ -45,9 +50,6 @@ DialogDetail::DialogDetail(const VContainer *data, QWidget *parent)
labelEditNamePoint->setPalette(palette);
CheckState();
QPushButton *bCansel = ui.buttonBox->button(QDialogButtonBox::Cancel);
connect(bCansel, &QPushButton::clicked, this, &DialogDetail::DialogRejected);
connect(ui.listWidget, &QListWidget::currentRowChanged, this, &DialogDetail::ObjectChanged);
connect(ui.spinBoxBiasX, static_cast<void (QSpinBox::*)(qint32)>(&QSpinBox::valueChanged),
this, &DialogDetail::BiasXChanged);
@ -60,26 +62,26 @@ DialogDetail::DialogDetail(const VContainer *data, QWidget *parent)
connect(ui.toolButtonDelete, &QToolButton::clicked, this, &DialogDetail::DeleteItem);
}
void DialogDetail::ChoosedObject(qint64 id, const Scene::Scenes &type)
void DialogDetail::ChoosedObject(quint32 id, const Valentina::Scenes &type)
{
if (type != Scene::Line && type != Scene::Detail)
if (type != Valentina::Line && type != Valentina::Detail)
{
switch (type)
{
case (Scene::Arc):
NewItem(id, Tool::NodeArc, NodeDetail::Contour);
case (Valentina::Arc):
NewItem(id, Valentina::NodeArc, NodeDetail::Contour);
break;
case (Scene::Point):
NewItem(id, Tool::NodePoint, NodeDetail::Contour);
case (Valentina::Point):
NewItem(id, Valentina::NodePoint, NodeDetail::Contour);
break;
case (Scene::Spline):
NewItem(id, Tool::NodeSpline, NodeDetail::Contour);
case (Valentina::Spline):
NewItem(id, Valentina::NodeSpline, NodeDetail::Contour);
break;
case (Scene::SplinePath):
NewItem(id, Tool::NodeSplinePath, NodeDetail::Contour);
case (Valentina::SplinePath):
NewItem(id, Valentina::NodeSplinePath, NodeDetail::Contour);
break;
default:
qWarning()<<tr("Got wrong scene object. Ignore.");
qDebug()<<tr("Got wrong scene object. Ignore.");
break;
}
ui.toolButtonDelete->setEnabled(true);
@ -103,38 +105,38 @@ void DialogDetail::DialogAccepted()
emit DialogClosed(QDialog::Accepted);
}
void DialogDetail::NewItem(qint64 id, const Tool::Tools &typeTool, const NodeDetail::NodeDetails &typeNode, qreal mx,
void DialogDetail::NewItem(quint32 id, const Valentina::Tools &typeTool, const NodeDetail::NodeDetails &typeNode, qreal mx,
qreal my)
{
QString name;
switch (typeTool)
{
case (Tool::NodePoint):
case (Valentina::NodePoint):
{
const VPointF *point = data->GeometricObject<const VPointF *>(id);
name = point->name();
break;
}
case (Tool::NodeArc):
case (Valentina::NodeArc):
{
const VArc *arc = data->GeometricObject<const VArc *>(id);
name = arc->name();
break;
}
case (Tool::NodeSpline):
case (Valentina::NodeSpline):
{
const VSpline *spl = data->GeometricObject<const VSpline *>(id);
name = spl->name();
break;
}
case (Tool::NodeSplinePath):
case (Valentina::NodeSplinePath):
{
const VSplinePath *splPath = data->GeometricObject<const VSplinePath *>(id);
name = splPath->name();
break;
}
default:
qWarning()<<tr("Got wrong tools. Ignore.");
qDebug()<<"Got wrong tools. Ignore.";
break;
}
@ -148,8 +150,8 @@ void DialogDetail::NewItem(qint64 id, const Tool::Tools &typeTool, const NodeDet
this, &DialogDetail::BiasXChanged);
disconnect(ui.spinBoxBiasY, static_cast<void (QSpinBox::*)(qint32)>(&QSpinBox::valueChanged),
this, &DialogDetail::BiasYChanged);
ui.spinBoxBiasX->setValue(static_cast<qint32>(toMM(node.getMx())));
ui.spinBoxBiasY->setValue(static_cast<qint32>(toMM(node.getMy())));
ui.spinBoxBiasX->setValue(static_cast<qint32>(qApp->fromPixel(node.getMx())));
ui.spinBoxBiasY->setValue(static_cast<qint32>(qApp->fromPixel(node.getMy())));
connect(ui.spinBoxBiasX, static_cast<void (QSpinBox::*)(qint32)>(&QSpinBox::valueChanged),
this, &DialogDetail::BiasXChanged);
connect(ui.spinBoxBiasY, static_cast<void (QSpinBox::*)(qint32)>(&QSpinBox::valueChanged),
@ -182,7 +184,7 @@ void DialogDetail::BiasXChanged(qreal d)
QListWidgetItem *item = ui.listWidget->item( row );
Q_CHECK_PTR(item);
VNodeDetail node = qvariant_cast<VNodeDetail>(item->data(Qt::UserRole));
node.setMx(toPixel(d));
node.setMx(qApp->toPixel(d));
item->setData(Qt::UserRole, QVariant::fromValue(node));
}
@ -192,7 +194,7 @@ void DialogDetail::BiasYChanged(qreal d)
QListWidgetItem *item = ui.listWidget->item( row );
Q_CHECK_PTR(item);
VNodeDetail node = qvariant_cast<VNodeDetail>(item->data(Qt::UserRole));
node.setMy(toPixel(d));
node.setMy(qApp->toPixel(d));
item->setData(Qt::UserRole, QVariant::fromValue(node));
}
@ -216,8 +218,8 @@ void DialogDetail::ObjectChanged(int row)
}
QListWidgetItem *item = ui.listWidget->item( row );
VNodeDetail node = qvariant_cast<VNodeDetail>(item->data(Qt::UserRole));
ui.spinBoxBiasX->setValue(static_cast<qint32>(toMM(node.getMx())));
ui.spinBoxBiasY->setValue(static_cast<qint32>(toMM(node.getMy())));
ui.spinBoxBiasX->setValue(static_cast<qint32>(qApp->fromPixel(node.getMx())));
ui.spinBoxBiasY->setValue(static_cast<qint32>(qApp->fromPixel(node.getMy())));
}
void DialogDetail::DeleteItem()

View File

@ -44,12 +44,12 @@ public:
* @param data container with data
* @param parent parent widget
*/
DialogDetail(const VContainer *data, QWidget *parent = 0);
DialogDetail(const VContainer *data, QWidget *parent = nullptr);
/**
* @brief getDetails return detail
* @return detail
*/
inline VDetail getDetails() const {return details;}
VDetail getDetails() const;
/**
* @brief setDetails set detail
* @param value detail
@ -61,7 +61,7 @@ public slots:
* @param id id of objects (points, arcs, splines, spline paths)
* @param type type of object
*/
virtual void ChoosedObject(qint64 id, const Scene::Scenes &type);
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
/**
* @brief DialogAccepted save data and emit signal about closed dialog.
*/
@ -121,8 +121,13 @@ private:
* @param mx offset respect to x
* @param my offset respect to y
*/
void NewItem(qint64 id, const Tool::Tools &typeTool, const NodeDetail::NodeDetails &typeNode,
void NewItem(quint32 id, const Valentina::Tools &typeTool, const NodeDetail::NodeDetails &typeNode,
qreal mx = 0, qreal my = 0);
};
inline VDetail DialogDetail::getDetails() const
{
return details;
}
#endif // DIALOGDETAIL_H

View File

@ -36,66 +36,32 @@ DialogEndLine::DialogEndLine(const VContainer *data, QWidget *parent)
formula(QString()), angle(0), basePointId(0)
{
ui->setupUi(this);
spinBoxAngle = ui->doubleSpinBoxAngle;
listWidget = ui->listWidget;
InitVariables(ui);
labelResultCalculation = ui->labelResultCalculation;
labelDescription = ui->labelDescription;
radioButtonSizeGrowth = ui->radioButtonSizeGrowth;
radioButtonStandardTable = ui->radioButtonStandardTable;
radioButtonIncrements = ui->radioButtonIncrements;
radioButtonLengthLine = ui->radioButtonLengthLine;
radioButtonLengthArc = ui->radioButtonLengthArc;
radioButtonLengthCurve = ui->radioButtonLengthSpline;
lineEditFormula = ui->lineEditFormula;
labelEditFormula = ui->labelEditFormula;
labelEditNamePoint = ui->labelEditNamePoint;
InitOkCansel(ui);
flagFormula = false;
bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
connect(bOk, &QPushButton::clicked, this, &DialogEndLine::DialogAccepted);
flagName = false;
CheckState();
QPushButton *bCansel = ui->buttonBox->button(QDialogButtonBox::Cancel);
connect(bCansel, &QPushButton::clicked, this, &DialogEndLine::DialogRejected);
FillComboBoxPoints(ui->comboBoxBasePoint);
FillComboBoxTypeLine(ui->comboBoxLineType);
connect(ui->toolButtonArrowDown, &QPushButton::clicked, this,
&DialogEndLine::ArrowDown);
connect(ui->toolButtonArrowUp, &QPushButton::clicked, this,
&DialogEndLine::ArrowUp);
connect(ui->toolButtonArrowLeft, &QPushButton::clicked, this,
&DialogEndLine::ArrowLeft);
connect(ui->toolButtonArrowRight, &QPushButton::clicked, this,
&DialogEndLine::ArrowRight);
connect(ui->toolButtonArrowLeftUp, &QPushButton::clicked, this,
&DialogEndLine::ArrowLeftUp);
connect(ui->toolButtonArrowLeftDown, &QPushButton::clicked, this,
&DialogEndLine::ArrowLeftDown);
connect(ui->toolButtonArrowRightUp, &QPushButton::clicked, this,
&DialogEndLine::ArrowRightUp);
connect(ui->toolButtonArrowRightDown, &QPushButton::clicked, this,
&DialogEndLine::ArrowRightDown);
InitArrow(ui);
connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogEndLine::PutHere);
connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogEndLine::PutVal);
connect(ui->listWidget, &QListWidget::currentRowChanged, this, &DialogEndLine::ValChenged);
ShowVariable(data->DataBase());
connect(ui->radioButtonSizeGrowth, &QRadioButton::clicked, this, &DialogEndLine::SizeGrowth);
connect(ui->radioButtonStandardTable, &QRadioButton::clicked, this, &DialogEndLine::StandardTable);
connect(ui->radioButtonIncrements, &QRadioButton::clicked, this, &DialogEndLine::Increments);
connect(ui->radioButtonLengthLine, &QRadioButton::clicked, this, &DialogEndLine::LengthLines);
connect(ui->radioButtonLengthArc, &QRadioButton::clicked, this, &DialogEndLine::LengthArcs);
connect(ui->radioButtonLengthSpline, &QRadioButton::clicked, this, &DialogEndLine::LengthCurves);
connect(ui->toolButtonEqual, &QPushButton::clicked, this, &DialogEndLine::EvalFormula);
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogEndLine::NamePointChanged);
connect(ui->lineEditFormula, &QLineEdit::textChanged, this, &DialogEndLine::FormulaChanged);
}
void DialogEndLine::ChoosedObject(qint64 id, const Scene::Scenes &type)
void DialogEndLine::ChoosedObject(quint32 id, const Valentina::Scenes &type)
{
if (type == Scene::Point)
if (type == Valentina::Point)
{
const VPointF *point = data->GeometricObject<const VPointF *>(id);
ChangeCurrentText(ui->comboBoxBasePoint, point->name());
@ -128,7 +94,7 @@ void DialogEndLine::setAngle(const qreal &value)
ui->doubleSpinBoxAngle->setValue(angle);
}
void DialogEndLine::setBasePointId(const qint64 &value, const qint64 &id)
void DialogEndLine::setBasePointId(const quint32 &value, const quint32 &id)
{
setCurrentPointId(ui->comboBoxBasePoint, basePointId, value, id);
}

View File

@ -43,18 +43,18 @@ class DialogEndLine : public DialogTool
{
Q_OBJECT
public:
/**
* @brief DialogEndLine create dialog
* @param data container with data
* @param parent parent widget
*/
DialogEndLine(const VContainer *data, QWidget *parent = 0);
~DialogEndLine();
/**
* @brief DialogEndLine create dialog
* @param data container with data
* @param parent parent widget
*/
DialogEndLine(const VContainer *data, QWidget *parent = nullptr);
~DialogEndLine();
/**
* @brief getPointName return name of point
* @return name
*/
inline QString getPointName() const {return pointName;}
QString getPointName() const;
/**
* @brief setPointName set name of point
* @param value name
@ -64,7 +64,7 @@ public:
* @brief getTypeLine return type of line
* @return type
*/
inline QString getTypeLine() const {return typeLine;}
QString getTypeLine() const;
/**
* @brief setTypeLine set type of line
* @param value type
@ -74,7 +74,7 @@ public:
* @brief getFormula return string of formula
* @return formula
*/
inline QString getFormula() const {return formula;}
QString getFormula() const;
/**
* @brief setFormula set string of formula
* @param value formula
@ -84,7 +84,7 @@ public:
* @brief getAngle return angle of line
* @return angle in degree
*/
inline qreal getAngle() const {return angle;}
qreal getAngle() const;
/**
* @brief setAngle set angle of line
* @param value angle in degree
@ -94,20 +94,20 @@ public:
* @brief getBasePointId return id base point of line
* @return id
*/
inline qint64 getBasePointId() const {return basePointId;}
quint32 getBasePointId() const;
/**
* @brief setBasePointId set id base point of line
* @param value id
* @param id don't show this id in list
*/
void setBasePointId(const qint64 &value, const qint64 &id);
void setBasePointId(const quint32 &value, const quint32 &id);
public slots:
/**
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
* @param id id of point or detail
* @param type type of object
*/
virtual void ChoosedObject(qint64 id, const Scene::Scenes &type);
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
/**
* @brief DialogAccepted save data and emit signal about closed dialog.
*/
@ -137,7 +137,32 @@ private:
/**
* @brief basePointId id base point of line
*/
qint64 basePointId;
quint32 basePointId;
};
inline QString DialogEndLine::getPointName() const
{
return pointName;
}
inline QString DialogEndLine::getTypeLine() const
{
return typeLine;
}
inline QString DialogEndLine::getFormula() const
{
return formula;
}
inline qreal DialogEndLine::getAngle() const
{
return angle;
}
inline quint32 DialogEndLine::getBasePointId() const
{
return basePointId;
}
#endif // DIALOGENDLINE_H

View File

@ -37,12 +37,9 @@ DialogHeight::DialogHeight(const VContainer *data, QWidget *parent)
{
ui->setupUi(this);
labelEditNamePoint = ui->labelEditNamePoint;
bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
connect(bOk, &QPushButton::clicked, this, &DialogHeight::DialogAccepted);
InitOkCansel(ui);
flagName = false;
CheckState();
QPushButton *bCansel = ui->buttonBox->button(QDialogButtonBox::Cancel);
connect(bCansel, &QPushButton::clicked, this, &DialogHeight::DialogRejected);
FillComboBoxPoints(ui->comboBoxBasePoint);
FillComboBoxPoints(ui->comboBoxP1Line);
@ -68,27 +65,27 @@ void DialogHeight::setTypeLine(const QString &value)
SetupTypeLine(ui->comboBoxLineType, value);
}
void DialogHeight::setBasePointId(const qint64 &value, const qint64 &id)
void DialogHeight::setBasePointId(const quint32 &value, const quint32 &id)
{
basePointId = value;
setCurrentPointId(ui->comboBoxBasePoint, basePointId, value, id);
}
void DialogHeight::setP1LineId(const qint64 &value, const qint64 &id)
void DialogHeight::setP1LineId(const quint32 &value, const quint32 &id)
{
p1LineId = value;
setCurrentPointId(ui->comboBoxP1Line, p1LineId, value, id);
}
void DialogHeight::setP2LineId(const qint64 &value, const qint64 &id)
void DialogHeight::setP2LineId(const quint32 &value, const quint32 &id)
{
p2LineId = value;
setCurrentPointId(ui->comboBoxP2Line, p2LineId, value, id);
}
void DialogHeight::ChoosedObject(qint64 id, const Scene::Scenes &type)
void DialogHeight::ChoosedObject(quint32 id, const Valentina::Scenes &type)
{
if (type == Scene::Point)
if (type == Valentina::Point)
{
const VPointF *point = data->GeometricObject<const VPointF *>(id);
switch (number)

View File

@ -43,18 +43,18 @@ class DialogHeight : public DialogTool
{
Q_OBJECT
public:
/**
* @brief DialogHeight create dialog
* @param data container with data
* @param parent parent widget
*/
DialogHeight(const VContainer *data, QWidget *parent = 0);
~DialogHeight();
/**
* @brief DialogHeight create dialog
* @param data container with data
* @param parent parent widget
*/
DialogHeight(const VContainer *data, QWidget *parent = nullptr);
~DialogHeight();
/**
* @brief getPointName return name of point
* @return name
*/
inline QString getPointName() const {return pointName;}
QString getPointName() const;
/**
* @brief setPointName set name of point
* @param value name
@ -64,7 +64,7 @@ public:
* @brief getTypeLine return type of line
* @return type
*/
inline QString getTypeLine() const {return typeLine;}
QString getTypeLine() const;
/**
* @brief setTypeLine set type of line
* @param value type
@ -74,42 +74,42 @@ public:
* @brief getBasePointId return id base point of height
* @return id
*/
inline qint64 getBasePointId() const {return basePointId;}
quint32 getBasePointId() const;
/**
* @brief setBasePointId set id base point of height
* @param value id
* @param id don't show this id in list
*/
void setBasePointId(const qint64 &value, const qint64 &id);
void setBasePointId(const quint32 &value, const quint32 &id);
/**
* @brief getP1LineId return id first point of line
* @return id id
*/
inline qint64 getP1LineId() const {return p1LineId;}
quint32 getP1LineId() const;
/**
* @brief setP1LineId set id first point of line
* @param value id
* @param id don't show this id in list
*/
void setP1LineId(const qint64 &value, const qint64 &id);
void setP1LineId(const quint32 &value, const quint32 &id);
/**
* @brief getP2LineId return id second point of line
* @return id
*/
inline qint64 getP2LineId() const{return p2LineId;}
quint32 getP2LineId() const;
/**
* @brief setP2LineId set id second point of line
* @param value id
* @param id don't show this id in list
*/
void setP2LineId(const qint64 &value, const qint64 &id);
void setP2LineId(const quint32 &value, const quint32 &id);
public slots:
/**
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
* @param id id of point or detail
* @param type type of object
*/
virtual void ChoosedObject(qint64 id, const Scene::Scenes &type);
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
/**
* @brief DialogAccepted save data and emit signal about closed dialog.
*/
@ -135,15 +135,40 @@ private:
/**
* @brief basePointId id base point of height
*/
qint64 basePointId;
quint32 basePointId;
/**
* @brief p1LineId id first point of line
*/
qint64 p1LineId;
quint32 p1LineId;
/**
* @brief p2LineId id second point of line
*/
qint64 p2LineId;
quint32 p2LineId;
};
inline QString DialogHeight::getPointName() const
{
return pointName;
}
inline QString DialogHeight::getTypeLine() const
{
return typeLine;
}
inline quint32 DialogHeight::getBasePointId() const
{
return basePointId;
}
inline quint32 DialogHeight::getP1LineId() const
{
return p1LineId;
}
inline quint32 DialogHeight::getP2LineId() const
{
return p2LineId;
}
#endif // DIALOGHEIGHT_H

View File

@ -35,10 +35,7 @@ DialogLine::DialogLine(const VContainer *data, QWidget *parent)
:DialogTool(data, parent), ui(new Ui::DialogLine), number(0), firstPoint(0), secondPoint(0), typeLine(QString())
{
ui->setupUi(this);
bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
connect(bOk, &QPushButton::clicked, this, &DialogLine::DialogAccepted);
QPushButton *bCansel = ui->buttonBox->button(QDialogButtonBox::Cancel);
connect(bCansel, &QPushButton::clicked, this, &DialogLine::DialogRejected);
InitOkCansel(ui);
FillComboBoxPoints(ui->comboBoxFirstPoint);
FillComboBoxPoints(ui->comboBoxSecondPoint);
@ -52,7 +49,7 @@ DialogLine::~DialogLine()
delete ui;
}
void DialogLine::setSecondPoint(const qint64 &value)
void DialogLine::setSecondPoint(const quint32 &value)
{
secondPoint = value;
const VPointF *point = data->GeometricObject<const VPointF *>(value);
@ -69,7 +66,7 @@ void DialogLine::setTypeLine(const QString &value)
SetupTypeLine(ui->comboBoxLineType, value);
}
void DialogLine::setFirstPoint(const qint64 &value)
void DialogLine::setFirstPoint(const quint32 &value)
{
firstPoint = value;
const VPointF *point = data->GeometricObject<const VPointF *>(value);
@ -84,16 +81,16 @@ void DialogLine::setFirstPoint(const qint64 &value)
void DialogLine::DialogAccepted()
{
qint32 index = ui->comboBoxFirstPoint->currentIndex();
firstPoint = qvariant_cast<qint64>(ui->comboBoxFirstPoint->itemData(index));
firstPoint = qvariant_cast<quint32>(ui->comboBoxFirstPoint->itemData(index));
index = ui->comboBoxSecondPoint->currentIndex();
secondPoint = qvariant_cast<qint64>(ui->comboBoxSecondPoint->itemData(index));
secondPoint = qvariant_cast<quint32>(ui->comboBoxSecondPoint->itemData(index));
typeLine = GetTypeLine(ui->comboBoxLineType);
DialogClosed(QDialog::Accepted);
}
void DialogLine::ChoosedObject(qint64 id, const Scene::Scenes &type)
void DialogLine::ChoosedObject(quint32 id, const Valentina::Scenes &type)
{
if (type == Scene::Point)
if (type == Valentina::Point)
{
const VPointF *point = data->GeometricObject<const VPointF *>(id);
if (number == 0)

View File

@ -43,76 +43,91 @@ class DialogLine : public DialogTool
{
Q_OBJECT
public:
/**
* @brief DialogLine create dialog
* @param data container with data
* @param parent parent widget
*/
DialogLine(const VContainer *data, QWidget *parent = 0);
~DialogLine();
/**
* @brief DialogLine create dialog
* @param data container with data
* @param parent parent widget
*/
DialogLine(const VContainer *data, QWidget *parent = nullptr);
~DialogLine();
/**
* @brief getFirstPoint return id first point
* @return id
*/
inline qint64 getFirstPoint() const {return firstPoint;}
quint32 getFirstPoint() const;
/**
* @brief setFirstPoint set id first point
* @param value id
*/
void setFirstPoint(const qint64 &value);
void setFirstPoint(const quint32 &value);
/**
* @brief getSecondPoint return id second point
* @return id
*/
inline qint64 getSecondPoint() const {return secondPoint;}
quint32 getSecondPoint() const;
/**
* @brief setSecondPoint set id second point
* @param value id
*/
void setSecondPoint(const qint64 &value);
void setSecondPoint(const quint32 &value);
/**
* @brief getTypeLine return type of line
* @return type
*/
inline QString getTypeLine() const {return typeLine;}
QString getTypeLine() const;
/**
* @brief setTypeLine set type of line
* @param value type
*/
void setTypeLine(const QString &value);
void setTypeLine(const QString &value);
public slots:
/**
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
* @param id id of point or detail
* @param type type of object
*/
virtual void ChoosedObject(qint64 id, const Scene::Scenes &type);
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
/**
* @brief DialogAccepted save data and emit signal about closed dialog.
*/
virtual void DialogAccepted();
virtual void DialogAccepted();
private:
Q_DISABLE_COPY(DialogLine)
/**
* @brief ui keeps information about user interface
*/
Ui::DialogLine *ui;
Ui::DialogLine *ui;
/**
* @brief number number of handled objects
*/
qint32 number;
qint32 number;
/**
* @brief firstPoint id first point
*/
qint64 firstPoint;
quint32 firstPoint;
/**
* @brief secondPoint id second point
*/
qint64 secondPoint;
quint32 secondPoint;
/**
* @brief typeLine type of line
*/
QString typeLine;
QString typeLine;
};
inline quint32 DialogLine::getFirstPoint() const
{
return firstPoint;
}
inline quint32 DialogLine::getSecondPoint() const
{
return secondPoint;
}
inline QString DialogLine::getTypeLine() const
{
return typeLine;
}
#endif // DIALOGLINE_H

View File

@ -37,12 +37,9 @@ DialogLineIntersect::DialogLineIntersect(const VContainer *data, QWidget *parent
{
ui->setupUi(this);
number = 0;
bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
connect(bOk, &QPushButton::clicked, this, &DialogLineIntersect::DialogAccepted);
InitOkCansel(ui);
labelEditNamePoint = ui->labelEditNamePoint;
flagName = false;
QPushButton *bCansel = ui->buttonBox->button(QDialogButtonBox::Cancel);
connect(bCansel, &QPushButton::clicked, this, &DialogLineIntersect::DialogRejected);
FillComboBoxPoints(ui->comboBoxP1Line1);
FillComboBoxPoints(ui->comboBoxP2Line1);
@ -57,9 +54,9 @@ DialogLineIntersect::~DialogLineIntersect()
delete ui;
}
void DialogLineIntersect::ChoosedObject(qint64 id, const Scene::Scenes &type)
void DialogLineIntersect::ChoosedObject(quint32 id, const Valentina::Scenes &type)
{
if (type == Scene::Point)
if (type == Valentina::Point)
{
const VPointF *point = data->GeometricObject<const VPointF *>(id);
if (number == 0)
@ -142,28 +139,28 @@ void DialogLineIntersect::DialogAccepted()
void DialogLineIntersect::P1Line1Changed( int index)
{
p1Line1 = qvariant_cast<qint64>(ui->comboBoxP1Line1->itemData(index));
p1Line1 = qvariant_cast<quint32>(ui->comboBoxP1Line1->itemData(index));
flagPoint = CheckIntersecion();
CheckState();
}
void DialogLineIntersect::P2Line1Changed(int index)
{
p2Line1 = qvariant_cast<qint64>(ui->comboBoxP2Line1->itemData(index));
p2Line1 = qvariant_cast<quint32>(ui->comboBoxP2Line1->itemData(index));
flagPoint = CheckIntersecion();
CheckState();
}
void DialogLineIntersect::P1Line2Changed(int index)
{
p1Line2 = qvariant_cast<qint64>(ui->comboBoxP1Line2->itemData(index));
p1Line2 = qvariant_cast<quint32>(ui->comboBoxP1Line2->itemData(index));
flagPoint = CheckIntersecion();
CheckState();
}
void DialogLineIntersect::P2Line2Changed(int index)
{
p2Line2 = qvariant_cast<qint64>(ui->comboBoxP2Line2->itemData(index));
p2Line2 = qvariant_cast<quint32>(ui->comboBoxP2Line2->itemData(index));
flagPoint = CheckIntersecion();
CheckState();
}
@ -195,25 +192,25 @@ bool DialogLineIntersect::CheckIntersecion()
}
}
void DialogLineIntersect::setP2Line2(const qint64 &value)
void DialogLineIntersect::setP2Line2(const quint32 &value)
{
p2Line2 = value;
ChangeCurrentData(ui->comboBoxP2Line2, value);
}
void DialogLineIntersect::setP1Line2(const qint64 &value)
void DialogLineIntersect::setP1Line2(const quint32 &value)
{
p1Line2 = value;
ChangeCurrentData(ui->comboBoxP1Line2, value);
}
void DialogLineIntersect::setP2Line1(const qint64 &value)
void DialogLineIntersect::setP2Line1(const quint32 &value)
{
p2Line1 = value;
ChangeCurrentData(ui->comboBoxP2Line1, value);
}
void DialogLineIntersect::setP1Line1(const qint64 &value)
void DialogLineIntersect::setP1Line1(const quint32 &value)
{
p1Line1 = value;
ChangeCurrentData(ui->comboBoxP1Line1, value);

View File

@ -43,58 +43,58 @@ class DialogLineIntersect : public DialogTool
{
Q_OBJECT
public:
/**
* @brief DialogLineIntersect create dialog
* @param data container with data
* @param parent parent widget
*/
DialogLineIntersect(const VContainer *data, QWidget *parent = 0);
~DialogLineIntersect();
/**
* @brief DialogLineIntersect create dialog
* @param data container with data
* @param parent parent widget
*/
DialogLineIntersect(const VContainer *data, QWidget *parent = nullptr);
~DialogLineIntersect();
/**
* @brief getP1Line1 return id first point of first line
* @return id
*/
inline qint64 getP1Line1() const {return p1Line1;}
quint32 getP1Line1() const;
/**
* @brief setP1Line1 set id first point of first line
* @param value id
*/
void setP1Line1(const qint64 &value);
void setP1Line1(const quint32 &value);
/**
* @brief getP2Line1 return id second point of first line
* @return id
*/
inline qint64 getP2Line1() const {return p2Line1;}
quint32 getP2Line1() const;
/**
* @brief setP2Line1 set id second point of first line
* @param value id
*/
void setP2Line1(const qint64 &value);
void setP2Line1(const quint32 &value);
/**
* @brief getP1Line2 return id first point of second line
* @return id
*/
inline qint64 getP1Line2() const {return p1Line2;}
quint32 getP1Line2() const;
/**
* @brief setP1Line2 set id first point of second line
* @param value id
*/
void setP1Line2(const qint64 &value);
void setP1Line2(const quint32 &value);
/**
* @brief getP2Line2 return id second point of second line
* @return id
*/
inline qint64 getP2Line2() const {return p2Line2;}
quint32 getP2Line2() const;
/**
* @brief setP2Line2 set id second point of second line
* @param value id
*/
void setP2Line2(const qint64 &value);
void setP2Line2(const quint32 &value);
/**
* @brief getPointName return name of point
* @return
*/
inline QString getPointName() const {return pointName;}
QString getPointName() const;
/**
* @brief setPointName set name of point
* @param value
@ -106,7 +106,7 @@ public slots:
* @param id id of point or detail
* @param type type of object
*/
virtual void ChoosedObject(qint64 id, const Scene::Scenes &type);
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
/**
* @brief DialogAccepted save data and emit signal about closed dialog.
*/
@ -148,19 +148,19 @@ private:
/**
* @brief p1Line1 id first point of first line
*/
qint64 p1Line1;
quint32 p1Line1;
/**
* @brief p2Line1 id second point of first line
*/
qint64 p2Line1;
quint32 p2Line1;
/**
* @brief p1Line2 id first point of second line
*/
qint64 p1Line2;
quint32 p1Line2;
/**
* @brief p2Line2 id second point of second line
*/
qint64 p2Line2;
quint32 p2Line2;
/**
* @brief flagPoint keep state of point
*/
@ -176,4 +176,29 @@ private:
bool CheckIntersecion();
};
inline quint32 DialogLineIntersect::getP1Line1() const
{
return p1Line1;
}
inline quint32 DialogLineIntersect::getP2Line1() const
{
return p2Line1;
}
inline quint32 DialogLineIntersect::getP1Line2() const
{
return p1Line2;
}
inline quint32 DialogLineIntersect::getP2Line2() const
{
return p2Line2;
}
inline QString DialogLineIntersect::getPointName() const
{
return pointName;
}
#endif // DIALOGLINEINTERSECT_H

View File

@ -36,58 +36,25 @@ DialogNormal::DialogNormal(const VContainer *data, QWidget *parent)
typeLine(QString()), formula(QString()), angle(0), firstPointId(0), secondPointId(0)
{
ui->setupUi(this);
spinBoxAngle = ui->doubleSpinBoxAngle;
listWidget = ui->listWidget;
InitVariables(ui);
labelResultCalculation = ui->labelResultCalculation;
labelDescription = ui->labelDescription;
radioButtonSizeGrowth = ui->radioButtonSizeGrowth;
radioButtonStandardTable = ui->radioButtonStandardTable;
radioButtonIncrements = ui->radioButtonIncrements;
radioButtonLengthLine = ui->radioButtonLengthLine;
radioButtonLengthArc = ui->radioButtonLengthArc;
radioButtonLengthCurve = ui->radioButtonLengthSpline;
lineEditFormula = ui->lineEditFormula;
labelEditFormula = ui->labelEditFormula;
labelEditNamePoint = ui->labelEditNamePoint;
InitOkCansel(ui);
flagFormula = false;
bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
connect(bOk, &QPushButton::clicked, this, &DialogNormal::DialogAccepted);
flagName = false;
CheckState();
QPushButton *bCansel = ui->buttonBox->button(QDialogButtonBox::Cancel);
connect(bCansel, &QPushButton::clicked, this, &DialogNormal::DialogRejected);
FillComboBoxPoints(ui->comboBoxFirstPoint);
FillComboBoxPoints(ui->comboBoxSecondPoint);
FillComboBoxTypeLine(ui->comboBoxLineType);
connect(ui->toolButtonArrowDown, &QPushButton::clicked, this,
&DialogNormal::ArrowDown);
connect(ui->toolButtonArrowUp, &QPushButton::clicked, this,
&DialogNormal::ArrowUp);
connect(ui->toolButtonArrowLeft, &QPushButton::clicked, this,
&DialogNormal::ArrowLeft);
connect(ui->toolButtonArrowRight, &QPushButton::clicked, this,
&DialogNormal::ArrowRight);
connect(ui->toolButtonArrowLeftUp, &QPushButton::clicked, this,
&DialogNormal::ArrowLeftUp);
connect(ui->toolButtonArrowLeftDown, &QPushButton::clicked, this,
&DialogNormal::ArrowLeftDown);
connect(ui->toolButtonArrowRightUp, &QPushButton::clicked, this,
&DialogNormal::ArrowRightUp);
connect(ui->toolButtonArrowRightDown, &QPushButton::clicked, this,
&DialogNormal::ArrowRightDown);
InitArrow(ui);
connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogNormal::PutHere);
connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogNormal::PutVal);
connect(ui->listWidget, &QListWidget::currentRowChanged, this, &DialogNormal::ValChenged);
ShowVariable(data->DataBase());
connect(ui->radioButtonSizeGrowth, &QRadioButton::clicked, this, &DialogNormal::SizeGrowth);
connect(ui->radioButtonStandardTable, &QRadioButton::clicked, this, &DialogNormal::StandardTable);
connect(ui->radioButtonIncrements, &QRadioButton::clicked, this, &DialogNormal::Increments);
connect(ui->radioButtonLengthLine, &QRadioButton::clicked, this, &DialogNormal::LengthLines);
connect(ui->radioButtonLengthArc, &QRadioButton::clicked, this, &DialogNormal::LengthArcs);
connect(ui->radioButtonLengthSpline, &QRadioButton::clicked, this, &DialogNormal::LengthCurves);
connect(ui->toolButtonEqual, &QPushButton::clicked, this, &DialogNormal::EvalFormula);
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogNormal::NamePointChanged);
connect(ui->lineEditFormula, &QLineEdit::textChanged, this, &DialogNormal::FormulaChanged);
@ -98,34 +65,27 @@ DialogNormal::~DialogNormal()
delete ui;
}
void DialogNormal::ChoosedObject(qint64 id, const Scene::Scenes &type)
void DialogNormal::ChoosedObject(quint32 id, const Valentina::Scenes &type)
{
if (type == Scene::Point)
if (type == Valentina::Point)
{
const VPointF *point = data->GeometricObject<const VPointF *>(id);
if (number == 0)
{
qint32 index = ui->comboBoxFirstPoint->findText(point->name());
if ( index != -1 )
{ // -1 for not found
ui->comboBoxFirstPoint->setCurrentIndex(index);
if (ChoosedPoint(id, ui->comboBoxFirstPoint, tr("Select second point of line")))
{
number++;
emit ToolTip(tr("Select second point of line"));
return;
}
}
if (number == 1)
{
qint32 index = ui->comboBoxSecondPoint->findText(point->name());
if ( index != -1 )
{ // -1 for not found
ui->comboBoxSecondPoint->setCurrentIndex(index);
number = 0;
emit ToolTip("");
}
if (isInitialized == false)
if (ChoosedPoint(id, ui->comboBoxSecondPoint, ""))
{
this->show();
number = 0;
if (isInitialized == false)
{
this->show();
}
}
}
}
@ -142,12 +102,12 @@ void DialogNormal::DialogAccepted()
emit DialogClosed(QDialog::Accepted);
}
void DialogNormal::setSecondPointId(const qint64 &value, const qint64 &id)
void DialogNormal::setSecondPointId(const quint32 &value, const quint32 &id)
{
setCurrentPointId(ui->comboBoxSecondPoint, secondPointId, value, id);
}
void DialogNormal::setFirstPointId(const qint64 &value, const qint64 &id)
void DialogNormal::setFirstPointId(const quint32 &value, const quint32 &id)
{
setCurrentPointId(ui->comboBoxFirstPoint, firstPointId, value, id);
}

View File

@ -43,18 +43,18 @@ class DialogNormal : public DialogTool
{
Q_OBJECT
public:
/**
* @brief DialogNormal create dialog
* @param data container with data
* @param parent parent widget
*/
DialogNormal(const VContainer *data, QWidget *parent = 0);
~DialogNormal();
/**
* @brief DialogNormal create dialog
* @param data container with data
* @param parent parent widget
*/
DialogNormal(const VContainer *data, QWidget *parent = nullptr);
~DialogNormal();
/**
* @brief getPointName return name of point
* @return name
*/
inline QString getPointName() const{return pointName;}
QString getPointName() const;
/**
* @brief setPointName set name of point
* @param value name
@ -64,7 +64,7 @@ public:
* @brief getTypeLine return type of line
* @return type
*/
inline QString getTypeLine() const {return typeLine;}
QString getTypeLine() const;
/**
* @brief setTypeLine set type of line
* @param value type
@ -74,7 +74,7 @@ public:
* @brief getFormula return string of formula
* @return formula
*/
inline QString getFormula() const {return formula;}
QString getFormula() const;
/**
* @brief setFormula set string of formula
* @param value formula
@ -84,7 +84,7 @@ public:
* @brief getAngle return aditional angle of normal
* @return angle in degree
*/
inline qreal getAngle() const {return angle;}
qreal getAngle() const;
/**
* @brief setAngle set aditional angle of normal
* @param value angle in degree
@ -94,31 +94,31 @@ public:
* @brief getFirstPointId return id of first point
* @return id
*/
inline qint64 getFirstPointId() const {return firstPointId;}
quint32 getFirstPointId() const;
/**
* @brief setFirstPointId set id of first point
* @param value id
* @param id don't show this id in list
*/
void setFirstPointId(const qint64 &value, const qint64 &id);
void setFirstPointId(const quint32 &value, const quint32 &id);
/**
* @brief getSecondPointId return id of second point
* @return id
*/
inline qint64 getSecondPointId() const {return secondPointId;}
quint32 getSecondPointId() const;
/**
* @brief setSecondPointId set id of second point
* @param value id
* @param id don't show this id in list
*/
void setSecondPointId(const qint64 &value, const qint64 &id);
void setSecondPointId(const quint32 &value, const quint32 &id);
public slots:
/**
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
* @param id id of point or detail
* @param type type of object
*/
virtual void ChoosedObject(qint64 id, const Scene::Scenes &type);
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
/**
* @brief DialogAccepted save data and emit signal about closed dialog.
*/
@ -152,11 +152,41 @@ private:
/**
* @brief firstPointId id first point of line
*/
qint64 firstPointId;
quint32 firstPointId;
/**
* @brief secondPointId id second point of line
*/
qint64 secondPointId;
quint32 secondPointId;
};
inline QString DialogNormal::getPointName() const
{
return pointName;
}
inline QString DialogNormal::getTypeLine() const
{
return typeLine;
}
inline QString DialogNormal::getFormula() const
{
return formula;
}
inline qreal DialogNormal::getAngle() const
{
return angle;
}
inline quint32 DialogNormal::getFirstPointId() const
{
return firstPointId;
}
inline quint32 DialogNormal::getSecondPointId() const
{
return secondPointId;
}
#endif // DIALOGNORMAL_H

View File

@ -47,13 +47,17 @@ DialogPointOfContact::DialogPointOfContact(const VContainer *data, QWidget *pare
lineEditFormula = ui.lineEditFormula;
labelEditFormula = ui.labelEditFormula;
labelEditNamePoint = ui.labelEditNamePoint;
flagFormula = false;
bOk = ui.buttonBox->button(QDialogButtonBox::Ok);
connect(bOk, &QPushButton::clicked, this, &DialogPointOfContact::DialogAccepted);
Q_CHECK_PTR(bOk);
connect(bOk, &QPushButton::clicked, this, &DialogTool::DialogAccepted);
QPushButton *bCansel = ui.buttonBox->button(QDialogButtonBox::Cancel);
Q_CHECK_PTR(bCansel);
connect(bCansel, &QPushButton::clicked, this, &DialogTool::DialogRejected);
flagFormula = false;
flagName = false;
CheckState();
QPushButton *bCansel = ui.buttonBox->button(QDialogButtonBox::Cancel);
connect(bCansel, &QPushButton::clicked, this, &DialogPointOfContact::DialogRejected);
FillComboBoxPoints(ui.comboBoxCenter);
FillComboBoxPoints(ui.comboBoxFirstPoint);
@ -63,9 +67,17 @@ DialogPointOfContact::DialogPointOfContact(const VContainer *data, QWidget *pare
connect(ui.listWidget, &QListWidget::itemDoubleClicked, this, &DialogPointOfContact::PutVal);
connect(ui.listWidget, &QListWidget::currentRowChanged, this, &DialogPointOfContact::ValChenged);
ShowVariable(data->DataBase());
connect(ui.radioButtonSizeGrowth, &QRadioButton::clicked, this, &DialogPointOfContact::SizeGrowth);
connect(ui.radioButtonStandardTable, &QRadioButton::clicked, this, &DialogPointOfContact::StandardTable);
if (qApp->patternType() == Pattern::Standard)
{
SizeHeight();
connect(ui.radioButtonSizeGrowth, &QRadioButton::clicked, this, &DialogTool::SizeHeight);
}
else
{
radioButtonSizeGrowth->setVisible(false);
Measurements();
}
connect(ui.radioButtonStandardTable, &QRadioButton::clicked, this, &DialogPointOfContact::Measurements);
connect(ui.radioButtonIncrements, &QRadioButton::clicked, this, &DialogPointOfContact::Increments);
connect(ui.radioButtonLengthLine, &QRadioButton::clicked, this, &DialogPointOfContact::LengthLines);
connect(ui.radioButtonLengthArc, &QRadioButton::clicked, this, &DialogPointOfContact::LengthArcs);
@ -75,9 +87,9 @@ DialogPointOfContact::DialogPointOfContact(const VContainer *data, QWidget *pare
connect(ui.lineEditFormula, &QLineEdit::textChanged, this, &DialogPointOfContact::FormulaChanged);
}
void DialogPointOfContact::ChoosedObject(qint64 id, const Scene::Scenes &type)
void DialogPointOfContact::ChoosedObject(quint32 id, const Valentina::Scenes &type)
{
if (type == Scene::Point)
if (type == Valentina::Point)
{
const VPointF *point = data->GeometricObject<const VPointF *>(id);
if (number == 0)
@ -129,17 +141,17 @@ void DialogPointOfContact::DialogAccepted()
emit DialogClosed(QDialog::Accepted);
}
void DialogPointOfContact::setSecondPoint(const qint64 &value, const qint64 &id)
void DialogPointOfContact::setSecondPoint(const quint32 &value, const quint32 &id)
{
setCurrentPointId(ui.comboBoxSecondPoint, secondPoint, value, id);
}
void DialogPointOfContact::setFirstPoint(const qint64 &value, const qint64 &id)
void DialogPointOfContact::setFirstPoint(const quint32 &value, const quint32 &id)
{
setCurrentPointId(ui.comboBoxFirstPoint, firstPoint, value, id);
}
void DialogPointOfContact::setCenter(const qint64 &value, const qint64 &id)
void DialogPointOfContact::setCenter(const quint32 &value, const quint32 &id)
{
setCurrentPointId(ui.comboBoxCenter, center, value, id);
center = value;

View File

@ -39,17 +39,17 @@ class DialogPointOfContact : public DialogTool
{
Q_OBJECT
public:
/**
* @brief DialogPointOfContact create dialog
* @param data container with data
* @param parent parent widget
*/
DialogPointOfContact(const VContainer *data, QWidget *parent = 0);
/**
* @brief DialogPointOfContact create dialog
* @param data container with data
* @param parent parent widget
*/
DialogPointOfContact(const VContainer *data, QWidget *parent = nullptr);
/**
* @brief getPointName return name of point
* @return name
*/
inline QString getPointName() const {return pointName;}
QString getPointName() const;
/**
* @brief setPointName set name of point
* @param value name
@ -59,7 +59,7 @@ public:
* @brief getRadius return formula radius of arc
* @return formula
*/
inline QString getRadius() const {return radius;}
QString getRadius() const;
/**
* @brief setRadius set formula radius of arc
* @param value formula
@ -69,42 +69,42 @@ public:
* @brief GetCenter return id of center point
* @return id
*/
inline qint64 getCenter() const {return center;}
quint32 getCenter() const;
/**
* @brief SetCenter set id of center point
* @param value id
* @param id don't show this id in list.
*/
void setCenter(const qint64 &value, const qint64 &id);
void setCenter(const quint32 &value, const quint32 &id);
/**
* @brief getFirstPoint return id first point
* @return id
*/
inline qint64 getFirstPoint() const {return firstPoint;}
quint32 getFirstPoint() const;
/**
* @brief setFirstPoint set id first point
* @param value id
* @param id don't show this id in list.
*/
void setFirstPoint(const qint64 &value, const qint64 &id);
void setFirstPoint(const quint32 &value, const quint32 &id);
/**
* @brief getSecondPoint return id second point
* @return id
*/
inline qint64 getSecondPoint() const {return secondPoint;}
quint32 getSecondPoint() const;
/**
* @brief setSecondPoint set id second point
* @param value id
* @param id don't show this id in list.
*/
void setSecondPoint(const qint64 &value, const qint64 &id);
void setSecondPoint(const quint32 &value, const quint32 &id);
public slots:
/**
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
* @param id id of point or detail
* @param type type of object
*/
virtual void ChoosedObject(qint64 id, const Scene::Scenes &type);
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
/**
* @brief DialogAccepted save data and emit signal about closed dialog.
*/
@ -130,15 +130,40 @@ private:
/**
* @brief center id center point of arc
*/
qint64 center;
quint32 center;
/**
* @brief firstPoint id first point of line
*/
qint64 firstPoint;
quint32 firstPoint;
/**
* @brief secondPoint id second point of line
*/
qint64 secondPoint;
quint32 secondPoint;
};
inline QString DialogPointOfContact::getPointName() const
{
return pointName;
}
inline QString DialogPointOfContact::getRadius() const
{
return radius;
}
inline quint32 DialogPointOfContact::getCenter() const
{
return center;
}
inline quint32 DialogPointOfContact::getFirstPoint() const
{
return firstPoint;
}
inline quint32 DialogPointOfContact::getSecondPoint() const
{
return secondPoint;
}
#endif // DIALOGPOINTOFCONTACT_H

View File

@ -37,12 +37,9 @@ DialogPointOfIntersection::DialogPointOfIntersection(const VContainer *data, QWi
{
ui->setupUi(this);
labelEditNamePoint = ui->labelEditNamePoint;
bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
connect(bOk, &QPushButton::clicked, this, &DialogPointOfIntersection::DialogAccepted);
InitOkCansel(ui);
flagName = false;
CheckState();
QPushButton *bCansel = ui->buttonBox->button(QDialogButtonBox::Cancel);
connect(bCansel, &QPushButton::clicked, this, &DialogPointOfIntersection::DialogRejected);
FillComboBoxPoints(ui->comboBoxFirstPoint);
FillComboBoxPoints(ui->comboBoxSecondPoint);
@ -55,15 +52,15 @@ DialogPointOfIntersection::~DialogPointOfIntersection()
delete ui;
}
void DialogPointOfIntersection::setSecondPointId(const qint64 &value, const qint64 &id)
void DialogPointOfIntersection::setSecondPointId(const quint32 &value, const quint32 &id)
{
secondPointId = value;
setCurrentPointId(ui->comboBoxSecondPoint, secondPointId, value, id);
}
void DialogPointOfIntersection::ChoosedObject(qint64 id, const Scene::Scenes &type)
void DialogPointOfIntersection::ChoosedObject(quint32 id, const Valentina::Scenes &type)
{
if (type == Scene::Point)
if (type == Valentina::Point)
{
const VPointF *point = data->GeometricObject<const VPointF *>(id);
if (number == 0)
@ -102,7 +99,7 @@ void DialogPointOfIntersection::DialogAccepted()
emit DialogClosed(QDialog::Accepted);
}
void DialogPointOfIntersection::setFirstPointId(const qint64 &value, const qint64 &id)
void DialogPointOfIntersection::setFirstPointId(const quint32 &value, const quint32 &id)
{
firstPointId = value;
setCurrentPointId(ui->comboBoxFirstPoint, firstPointId, value, id);

View File

@ -43,18 +43,18 @@ class DialogPointOfIntersection : public DialogTool
{
Q_OBJECT
public:
/**
* @brief DialogPointOfIntersection create dialog
* @param data container with data
* @param parent parent widget
*/
DialogPointOfIntersection(const VContainer *data, QWidget *parent = 0);
~DialogPointOfIntersection();
/**
* @brief DialogPointOfIntersection create dialog
* @param data container with data
* @param parent parent widget
*/
DialogPointOfIntersection(const VContainer *data, QWidget *parent = nullptr);
~DialogPointOfIntersection();
/**
* @brief getPointName return name of point
* @return name
*/
inline QString getPointName() const {return pointName;}
QString getPointName() const;
/**
* @brief setPointName set name of point
* @param value name
@ -64,31 +64,31 @@ public:
* @brief getFirstPointId return id of first point
* @return id
*/
inline qint64 getFirstPointId() const {return firstPointId;}
quint32 getFirstPointId() const;
/**
* @brief setFirstPointId set id of first point
* @param value id
* @param id don't show this id in list.
*/
void setFirstPointId(const qint64 &value, const qint64 &id);
void setFirstPointId(const quint32 &value, const quint32 &id);
/**
* @brief getSecondPointId return id of second point
* @return id
*/
inline qint64 getSecondPointId() const {return secondPointId;}
quint32 getSecondPointId() const;
/**
* @brief setSecondPointId set id of second point
* @param value id
* @param id don't show this id in list.
*/
void setSecondPointId(const qint64 &value, const qint64 &id);
void setSecondPointId(const quint32 &value, const quint32 &id);
public slots:
/**
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
* @param id id of point or detail
* @param type type of object
*/
virtual void ChoosedObject(qint64 id, const Scene::Scenes &type);
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
/**
* @brief DialogAccepted save data and emit signal about closed dialog.
*/
@ -110,11 +110,26 @@ private:
/**
* @brief firstPointId id first point of line
*/
qint64 firstPointId;
quint32 firstPointId;
/**
* @brief secondPointId id second point of line
*/
qint64 secondPointId;
quint32 secondPointId;
};
inline QString DialogPointOfIntersection::getPointName() const
{
return pointName;
}
inline quint32 DialogPointOfIntersection::getFirstPointId() const
{
return firstPointId;
}
inline quint32 DialogPointOfIntersection::getSecondPointId() const
{
return secondPointId;
}
#endif // DIALOGPOINTOFINTERSECTION_H

View File

@ -37,42 +37,24 @@ DialogShoulderPoint::DialogShoulderPoint(const VContainer *data, QWidget *parent
{
ui->setupUi(this);
number = 0;
listWidget = ui->listWidget;
InitVariables(ui);
labelResultCalculation = ui->labelResultCalculation;
labelDescription = ui->labelDescription;
radioButtonSizeGrowth = ui->radioButtonSizeGrowth;
radioButtonStandardTable = ui->radioButtonStandardTable;
radioButtonIncrements = ui->radioButtonIncrements;
radioButtonLengthLine = ui->radioButtonLengthLine;
radioButtonLengthArc = ui->radioButtonLengthArc;
radioButtonLengthCurve = ui->radioButtonLengthSpline;
lineEditFormula = ui->lineEditFormula;
labelEditFormula = ui->labelEditFormula;
labelEditNamePoint = ui->labelEditNamePoint;
InitOkCansel(ui);
flagFormula = false;
bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
connect(bOk, &QPushButton::clicked, this, &DialogShoulderPoint::DialogAccepted);
flagName = false;
CheckState();
QPushButton *bCansel = ui->buttonBox->button(QDialogButtonBox::Cancel);
connect(bCansel, &QPushButton::clicked, this, &DialogShoulderPoint::DialogRejected);
FillComboBoxTypeLine(ui->comboBoxLineType);
FillComboBoxTypeLine(ui->comboBoxLineType);
FillComboBoxPoints(ui->comboBoxP1Line);
FillComboBoxPoints(ui->comboBoxP2Line);
FillComboBoxPoints(ui->comboBoxPShoulder);
connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogShoulderPoint::PutHere);
connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogShoulderPoint::PutVal);
connect(ui->listWidget, &QListWidget::currentRowChanged, this, &DialogShoulderPoint::ValChenged);
ShowVariable(data->DataBase());
connect(ui->radioButtonSizeGrowth, &QRadioButton::clicked, this, &DialogShoulderPoint::SizeGrowth);
connect(ui->radioButtonStandardTable, &QRadioButton::clicked, this, &DialogShoulderPoint::StandardTable);
connect(ui->radioButtonIncrements, &QRadioButton::clicked, this, &DialogShoulderPoint::Increments);
connect(ui->radioButtonLengthLine, &QRadioButton::clicked, this, &DialogShoulderPoint::LengthLines);
connect(ui->radioButtonLengthArc, &QRadioButton::clicked, this, &DialogShoulderPoint::LengthArcs);
connect(ui->radioButtonLengthSpline, &QRadioButton::clicked, this, &DialogShoulderPoint::LengthCurves);
connect(ui->toolButtonEqual, &QPushButton::clicked, this, &DialogShoulderPoint::EvalFormula);
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogShoulderPoint::NamePointChanged);
connect(ui->lineEditFormula, &QLineEdit::textChanged, this, &DialogShoulderPoint::FormulaChanged);
@ -83,9 +65,9 @@ DialogShoulderPoint::~DialogShoulderPoint()
delete ui;
}
void DialogShoulderPoint::ChoosedObject(qint64 id, const Scene::Scenes &type)
void DialogShoulderPoint::ChoosedObject(quint32 id, const Valentina::Scenes &type)
{
if (type == Scene::Point)
if (type == Valentina::Point)
{
const VPointF *point = data->GeometricObject<const VPointF *>(id);
if (number == 0)
@ -138,17 +120,17 @@ void DialogShoulderPoint::DialogAccepted()
emit DialogClosed(QDialog::Accepted);
}
void DialogShoulderPoint::setPShoulder(const qint64 &value, const qint64 &id)
void DialogShoulderPoint::setPShoulder(const quint32 &value, const quint32 &id)
{
setCurrentPointId(ui->comboBoxPShoulder, pShoulder, value, id);
}
void DialogShoulderPoint::setP2Line(const qint64 &value, const qint64 &id)
void DialogShoulderPoint::setP2Line(const quint32 &value, const quint32 &id)
{
setCurrentPointId(ui->comboBoxP2Line, p2Line, value, id);
}
void DialogShoulderPoint::setP1Line(const qint64 &value, const qint64 &id)
void DialogShoulderPoint::setP1Line(const quint32 &value, const quint32 &id)
{
setCurrentPointId(ui->comboBoxP1Line, p1Line, value, id);
}

View File

@ -43,18 +43,18 @@ class DialogShoulderPoint : public DialogTool
{
Q_OBJECT
public:
/**
* @brief DialogShoulderPoint create dialog
* @param data container with data
* @param parent parent widget
*/
DialogShoulderPoint(const VContainer *data, QWidget *parent = 0);
~DialogShoulderPoint();
/**
* @brief DialogShoulderPoint create dialog
* @param data container with data
* @param parent parent widget
*/
DialogShoulderPoint(const VContainer *data, QWidget *parent = nullptr);
~DialogShoulderPoint();
/**
* @brief getPointName return name of point
* @return name
*/
inline QString getPointName() const {return pointName;}
QString getPointName() const;
/**
* @brief setPointName set name of point
* @param value name
@ -64,7 +64,7 @@ public:
* @brief getTypeLine return type of line
* @return type
*/
inline QString getTypeLine() const {return typeLine;}
QString getTypeLine() const;
/**
* @brief setTypeLine set type of line
* @param value type
@ -74,7 +74,7 @@ public:
* @brief getFormula return string of formula
* @return formula
*/
inline QString getFormula() const {return formula;}
QString getFormula() const;
/**
* @brief setFormula set string of formula
* @param value formula
@ -84,42 +84,42 @@ public:
* @brief getP1Line return id first point of line
* @return id
*/
inline qint64 getP1Line() const {return p1Line;}
quint32 getP1Line() const;
/**
* @brief setP1Line set id first point of line
* @param value id
* @param id don't show this id in list
*/
void setP1Line(const qint64 &value, const qint64 &id);
void setP1Line(const quint32 &value, const quint32 &id);
/**
* @brief getP2Line return id second point of line
* @return id
*/
inline qint64 getP2Line() const {return p2Line;}
quint32 getP2Line() const;
/**
* @brief setP2Line set id second point of line
* @param value id
* @param id don't show this id in list
*/
void setP2Line(const qint64 &value, const qint64 &id);
void setP2Line(const quint32 &value, const quint32 &id);
/**
* @brief getPShoulder return id shoulder point
* @return id
*/
inline qint64 getPShoulder() const {return pShoulder;}
quint32 getPShoulder() const;
/**
* @brief setPShoulder set id shoulder point
* @param value id
* @param id don't show this id in list
*/
void setPShoulder(const qint64 &value, const qint64 &id);
void setPShoulder(const quint32 &value, const quint32 &id);
public slots:
/**
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
* @param id id of point or detail
* @param type type of object
*/
virtual void ChoosedObject(qint64 id, const Scene::Scenes &type);
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
/**
* @brief DialogAccepted save data and emit signal about closed dialog.
*/
@ -149,15 +149,45 @@ private:
/**
* @brief p1Line id first point of line
*/
qint64 p1Line;
quint32 p1Line;
/**
* @brief p2Line id second point of line
*/
qint64 p2Line;
quint32 p2Line;
/**
* @brief pShoulder id shoulder point
*/
qint64 pShoulder;
quint32 pShoulder;
};
inline QString DialogShoulderPoint::getPointName() const
{
return pointName;
}
inline QString DialogShoulderPoint::getTypeLine() const
{
return typeLine;
}
inline QString DialogShoulderPoint::getFormula() const
{
return formula;
}
inline quint32 DialogShoulderPoint::getP1Line() const
{
return p1Line;
}
inline quint32 DialogShoulderPoint::getP2Line() const
{
return p2Line;
}
inline quint32 DialogShoulderPoint::getPShoulder() const
{
return pShoulder;
}
#endif // DIALOGSHOULDERPOINT_H

View File

@ -36,15 +36,14 @@ DialogSinglePoint::DialogSinglePoint(const VContainer *data, QWidget *parent)
point(QPointF())
{
ui->setupUi(this);
ui->doubleSpinBoxX->setRange(0, toMM(SceneSize));
ui->doubleSpinBoxY->setRange(0, toMM(SceneSize));
bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
ui->doubleSpinBoxX->setRange(0, qApp->fromPixel(SceneSize));
ui->doubleSpinBoxY->setRange(0, qApp->fromPixel(SceneSize));
labelEditNamePoint = ui->labelEditName;
InitOkCansel(ui);
flagName = false;
CheckState();
connect(bOk, &QPushButton::clicked, this, &DialogSinglePoint::DialogAccepted);
QPushButton *bCansel = ui->buttonBox->button(QDialogButtonBox::Cancel);
connect(bCansel, &QPushButton::clicked, this, &DialogSinglePoint::DialogRejected);
connect(ui->lineEditName, &QLineEdit::textChanged, this, &DialogSinglePoint::NamePointChanged);
}
@ -52,20 +51,20 @@ void DialogSinglePoint::mousePress(const QPointF &scenePos)
{
if (isInitialized == false)
{
ui->doubleSpinBoxX->setValue(toMM(scenePos.x()));
ui->doubleSpinBoxY->setValue(toMM(scenePos.y()));
ui->doubleSpinBoxX->setValue(qApp->fromPixel(scenePos.x()));
ui->doubleSpinBoxY->setValue(qApp->fromPixel(scenePos.y()));
this->show();
}
else
{
ui->doubleSpinBoxX->setValue(toMM(scenePos.x()));
ui->doubleSpinBoxY->setValue(toMM(scenePos.y()));
ui->doubleSpinBoxX->setValue(qApp->fromPixel(scenePos.x()));
ui->doubleSpinBoxY->setValue(qApp->fromPixel(scenePos.y()));
}
}
void DialogSinglePoint::DialogAccepted()
{
point = QPointF(toPixel(ui->doubleSpinBoxX->value()), toPixel(ui->doubleSpinBoxY->value()));
point = QPointF(qApp->toPixel(ui->doubleSpinBoxX->value()), qApp->toPixel(ui->doubleSpinBoxY->value()));
name = ui->lineEditName->text();
emit DialogClosed(QDialog::Accepted);
}
@ -76,8 +75,8 @@ void DialogSinglePoint::setData(const QString &name, const QPointF &point)
this->point = point;
isInitialized = true;
ui->lineEditName->setText(name);
ui->doubleSpinBoxX->setValue(toMM(point.x()));
ui->doubleSpinBoxY->setValue(toMM(point.y()));
ui->doubleSpinBoxX->setValue(qApp->fromPixel(point.x()));
ui->doubleSpinBoxY->setValue(qApp->fromPixel(point.y()));
}
DialogSinglePoint::~DialogSinglePoint()

View File

@ -43,12 +43,13 @@ class DialogSinglePoint : public DialogTool
{
Q_OBJECT
public:
/**
* @brief DialogSinglePoint create dialog
* @param data container with data
* @param parent parent widget
*/
DialogSinglePoint(const VContainer *data, QWidget *parent = 0);
/**
* @brief DialogSinglePoint create dialog
* @param data container with data
* @param parent parent widget
*/
DialogSinglePoint(const VContainer *data, QWidget *parent = nullptr);
~DialogSinglePoint();
/**
* @brief setData set name and point
* @param name name of point
@ -59,13 +60,12 @@ public:
* @brief getName return name
* @return name
*/
inline QString getName()const {return name;}
QString getName()const;
/**
* @brief getPoint return point
* @return point
*/
inline QPointF getPoint()const {return point;}
~DialogSinglePoint();
QPointF getPoint()const;
public slots:
/**
* @brief mousePress get mouse position
@ -92,4 +92,14 @@ private:
QPointF point;
};
inline QString DialogSinglePoint::getName() const
{
return name;
}
inline QPointF DialogSinglePoint::getPoint() const
{
return point;
}
#endif // DIALOGSINGLEPOINT_H

View File

@ -36,11 +36,7 @@ DialogSpline::DialogSpline(const VContainer *data, QWidget *parent)
kAsm1(1), kAsm2(1), kCurve(1)
{
ui->setupUi(this);
bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
connect(bOk, &QPushButton::clicked, this, &DialogSpline::DialogAccepted);
QPushButton *bCansel = ui->buttonBox->button(QDialogButtonBox::Cancel);
connect(bCansel, &QPushButton::clicked, this, &DialogSpline::DialogRejected);
InitOkCansel(ui);
FillComboBoxPoints(ui->comboBoxP1);
FillComboBoxPoints(ui->comboBoxP4);
@ -51,14 +47,14 @@ DialogSpline::~DialogSpline()
delete ui;
}
qint64 DialogSpline::getP1() const
quint32 DialogSpline::getP1() const
{
return p1;
}
void DialogSpline::ChoosedObject(qint64 id, const Scene::Scenes &type)
void DialogSpline::ChoosedObject(quint32 id, const Valentina::Scenes &type)
{
if (type == Scene::Point)
if (type == Valentina::Point)
{
const VPointF *point = data->GeometricObject<const VPointF *>(id);
if (number == 0)
@ -81,7 +77,7 @@ void DialogSpline::ChoosedObject(qint64 id, const Scene::Scenes &type)
number = 0;
emit ToolTip("");
index = ui->comboBoxP1->currentIndex();
qint64 p1Id = qvariant_cast<qint64>(ui->comboBoxP1->itemData(index));
quint32 p1Id = qvariant_cast<quint32>(ui->comboBoxP1->itemData(index));
QPointF p1 = data->GeometricObject<const VPointF *>(p1Id)->toQPointF();
QPointF p4 = data->GeometricObject<const VPointF *>(id)->toQPointF();
@ -139,19 +135,19 @@ void DialogSpline::setAngle1(const qreal &value)
ui->spinBoxAngle1->setValue(static_cast<qint32>(value));
}
void DialogSpline::setP4(const qint64 &value)
void DialogSpline::setP4(const quint32 &value)
{
p4 = value;
ChangeCurrentData(ui->comboBoxP4, value);
}
void DialogSpline::setP1(const qint64 &value)
void DialogSpline::setP1(const quint32 &value)
{
p1 = value;
ChangeCurrentData(ui->comboBoxP1, value);
}
qint64 DialogSpline::getP4() const
quint32 DialogSpline::getP4() const
{
return p4;
}

View File

@ -43,38 +43,38 @@ class DialogSpline : public DialogTool
{
Q_OBJECT
public:
/**
* @brief DialogSpline create dialog
* @param data container with data
* @param parent parent widget
*/
DialogSpline(const VContainer *data, QWidget *parent = 0);
~DialogSpline();
/**
* @brief DialogSpline create dialog
* @param data container with data
* @param parent parent widget
*/
DialogSpline(const VContainer *data, QWidget *parent = nullptr);
~DialogSpline();
/**
* @brief getP1 return id first point of spline
* @return id
*/
qint64 getP1() const;
quint32 getP1() const;
/**
* @brief setP1 set id first point of spline
* @param value id
*/
void setP1(const qint64 &value);
void setP1(const quint32 &value);
/**
* @brief getP4 return id fourth point of spline
* @return id
*/
qint64 getP4() const;
quint32 getP4() const;
/**
* @brief setP4 set id fourth point of spline
* @param value id
*/
void setP4(const qint64 &value);
void setP4(const quint32 &value);
/**
* @brief getAngle1 return first angle of spline
* @return angle in degree
*/
inline qreal getAngle1() const {return angle1;}
qreal getAngle1() const;
/**
* @brief setAngle1 set first angle of spline
* @param value angle in degree
@ -84,7 +84,7 @@ public:
* @brief getAngle2 return second angle of spline
* @return angle in degree
*/
inline qreal getAngle2() const {return angle2;}
qreal getAngle2() const;
/**
* @brief setAngle2 set second angle of spline
* @param value angle in degree
@ -94,7 +94,7 @@ public:
* @brief getKAsm1 return first coefficient asymmetry
* @return value. Can be >= 0.
*/
inline qreal getKAsm1() const {return kAsm1;}
qreal getKAsm1() const;
/**
* @brief setKAsm1 set first coefficient asymmetry
* @param value value. Can be >= 0.
@ -104,7 +104,7 @@ public:
* @brief getKAsm2 return second coefficient asymmetry
* @return value. Can be >= 0.
*/
inline qreal getKAsm2() const {return kAsm2;}
qreal getKAsm2() const;
/**
* @brief setKAsm2 set second coefficient asymmetry
* @param value value. Can be >= 0.
@ -114,7 +114,7 @@ public:
* @brief getKCurve return coefficient curve
* @return value. Can be >= 0.
*/
inline qreal getKCurve() const {return kCurve;}
qreal getKCurve() const;
/**
* @brief setKCurve set coefficient curve
* @param value value. Can be >= 0.
@ -126,7 +126,7 @@ public slots:
* @param id id of point or detail
* @param type type of object
*/
virtual void ChoosedObject(qint64 id, const Scene::Scenes &type);
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
/**
* @brief DialogAccepted save data and emit signal about closed dialog.
*/
@ -144,11 +144,11 @@ private:
/**
* @brief p1 id first point of spline
*/
qint64 p1;
quint32 p1;
/**
* @brief p4 id fourth point of spline
*/
qint64 p4;
quint32 p4;
/**
* @brief angle1 first angle of spline in degree
*/
@ -171,4 +171,29 @@ private:
qreal kCurve;
};
inline qreal DialogSpline::getAngle1() const
{
return angle1;
}
inline qreal DialogSpline::getAngle2() const
{
return angle2;
}
inline qreal DialogSpline::getKAsm1() const
{
return kAsm1;
}
inline qreal DialogSpline::getKAsm2() const
{
return kAsm2;
}
inline qreal DialogSpline::getKCurve() const
{
return kCurve;
}
#endif // DIALOGSPLINE_H

View File

@ -28,7 +28,7 @@
#include "dialogsplinepath.h"
#include "ui_dialogsplinepath.h"
#include "../geometry/vsplinepoint.h"
#include "../../geometry/vsplinepoint.h"
#include <QPushButton>
@ -36,13 +36,9 @@ DialogSplinePath::DialogSplinePath(const VContainer *data, QWidget *parent)
:DialogTool(data, parent), ui(new Ui::DialogSplinePath), path(VSplinePath())
{
ui->setupUi(this);
bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
connect(bOk, &QPushButton::clicked, this, &DialogSplinePath::DialogAccepted);
InitOkCansel(ui);
bOk->setEnabled(false);
QPushButton *bCansel = ui->buttonBox->button(QDialogButtonBox::Cancel);
connect(bCansel, &QPushButton::clicked, this, &DialogSplinePath::DialogRejected);
FillComboBoxPoints(ui->comboBoxPoint);
connect(ui->listWidget, &QListWidget::currentRowChanged, this, &DialogSplinePath::PointChanged);
@ -76,9 +72,9 @@ void DialogSplinePath::SetPath(const VSplinePath &value)
}
void DialogSplinePath::ChoosedObject(qint64 id, const Scene::Scenes &type)
void DialogSplinePath::ChoosedObject(quint32 id, const Valentina::Scenes &type)
{
if (type == Scene::Point)
if (type == Valentina::Point)
{
NewItem(id, 1, 0, 1, 180);
emit ToolTip(tr("Select point of curve path"));
@ -113,7 +109,7 @@ void DialogSplinePath::PointChanged(int row)
void DialogSplinePath::currentPointChanged(int index)
{
qint64 id = qvariant_cast<qint64>(ui->comboBoxPoint->itemData(index));
quint32 id = qvariant_cast<quint32>(ui->comboBoxPoint->itemData(index));
qint32 row = ui->listWidget->currentRow();
QListWidgetItem *item = ui->listWidget->item( row );
VSplinePoint p = qvariant_cast<VSplinePoint>(item->data(Qt::UserRole));
@ -164,7 +160,7 @@ void DialogSplinePath::KAsm2Changed(qreal d)
item->setData(Qt::UserRole, QVariant::fromValue(p));
}
void DialogSplinePath::NewItem(qint64 id, qreal kAsm1, qreal angle1, qreal kAsm2, qreal angle2)
void DialogSplinePath::NewItem(quint32 id, qreal kAsm1, qreal angle1, qreal kAsm2, qreal angle2)
{
const VPointF *point = data->GeometricObject<const VPointF *>(id);
QListWidgetItem *item = new QListWidgetItem(point->name());
@ -182,7 +178,7 @@ void DialogSplinePath::NewItem(qint64 id, qreal kAsm1, qreal angle1, qreal kAsm2
EnableFields();
}
void DialogSplinePath::DataPoint(qint64 id, qreal kAsm1, qreal angle1, qreal kAsm2, qreal angle2)
void DialogSplinePath::DataPoint(quint32 id, qreal kAsm1, qreal angle1, qreal kAsm2, qreal angle2)
{
disconnect(ui->comboBoxPoint, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
this, &DialogSplinePath::currentPointChanged);

View File

@ -30,7 +30,7 @@
#define DIALOGSPLINEPATH_H
#include "dialogtool.h"
#include "../geometry/vsplinepath.h"
#include "../../geometry/vsplinepath.h"
namespace Ui
{
@ -44,18 +44,18 @@ class DialogSplinePath : public DialogTool
{
Q_OBJECT
public:
/**
* @brief DialogSplinePath create dialog
* @param data container with data
* @param parent parent widget
*/
DialogSplinePath(const VContainer *data, QWidget *parent = 0);
~DialogSplinePath();
/**
* @brief DialogSplinePath create dialog
* @param data container with data
* @param parent parent widget
*/
DialogSplinePath(const VContainer *data, QWidget *parent = nullptr);
~DialogSplinePath();
/**
* @brief GetPath return spline path
* @return path
*/
inline VSplinePath GetPath() const {return path;}
VSplinePath GetPath() const;
/**
* @brief SetPath set spline path
* @param value path
@ -67,7 +67,7 @@ public slots:
* @param id id of point or detail
* @param type don't show this id in list
*/
virtual void ChoosedObject(qint64 id, const Scene::Scenes &type);
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
/**
* @brief DialogAccepted save data and emit signal about closed dialog.
*/
@ -120,7 +120,7 @@ private:
* @param kAsm2 second coefficient asymmetry
* @param angle2 second angle in degree
*/
void NewItem(qint64 id, qreal kAsm1, qreal angle1, qreal kAsm2, qreal angle2);
void NewItem(quint32 id, qreal kAsm1, qreal angle1, qreal kAsm2, qreal angle2);
/**
* @brief dataPoint show data of point in fields
* @param id id
@ -129,11 +129,16 @@ private:
* @param kAsm2 second coefficient asymmetry
* @param angle2 second angle of spline
*/
void DataPoint(qint64 id, qreal kAsm1, qreal angle1, qreal kAsm2, qreal angle2);
void DataPoint(quint32 id, qreal kAsm1, qreal angle1, qreal kAsm2, qreal angle2);
/**
* @brief EnableFields enable or disable fields
*/
void EnableFields();
};
inline VSplinePath DialogSplinePath::GetPath() const
{
return path;
}
#endif // DIALOGSPLINEPATH_H

Some files were not shown because too many files have changed in this diff Show More