diff --git a/.hgignore b/.hgignore index 305d6889b..8222b4881 100644 --- a/.hgignore +++ b/.hgignore @@ -13,8 +13,9 @@ syntax: glob # Temporary files used by the vim editor. .*.swp -# A hidden file created by the Mac OS X Finder. +# A hidden files created by the Mac OS X Finder. .DS_Store +._.DS_Store # Ignore this directory. html/ diff --git a/AUTHORS.txt b/AUTHORS.txt index f3123fad8..b245f676b 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -1,14 +1,29 @@ -Our Team: +This file contains a list of people who have made contributions +to the Valentina project. - (*) Roman Telezhynskyi - Maintainer and founder of the project. - - (*) Christine Neupert - Testing, translation. - - (*) Patrick Proy - Developing. - - (*) Lindsay Williams - Design logo. +Maintainer and founder of the project: + Roman Telezhynskyi + +Community manager, web site: + Susan Spencer + +Patch contributors: + Patrick Proy + * Developing. + Christine Neupert + * Testing. + * Translation. + Lindsay Williams + * Design logo. + Sabine Schmaltz + * Developing. + * Documantation. + Felix Ulber + * Developing. + * Translation. + Mischa Krempel + * Developing. + * Mac OS package. + Peter Gsellmann + * Testing diff --git a/README.txt b/README.txt index 33c10eee0..db0b3993e 100644 --- a/README.txt +++ b/README.txt @@ -1,5 +1,6 @@ Pattern making program -Copyright (C) 2013-2014 Roman Telezhynskyi +Author Roman Telezhynskyi +Copyright (C) 2013-2015 Valentina project Valentina Web page: http://www.valentina-project.org/ Valentina user manual https://bitbucket.org/dismine/valentina/wiki/manual/Content Valentina main repository: https://bitbucket.org/dismine/valentina/overview @@ -19,16 +20,19 @@ Supported Platforms =================== The standalone binary packages support the following platforms: -Windows XP SP2 or later -Ubuntu Linux 14.04 (32-bit) or later +Windows XP SP2 (32-bit) or later +Ubuntu Linux 14.04 (32-bit/64-bit) or later +OpenSUSE 13.02 (32-bit/64-bit) or later +Fedora 20 (32-bit/64-bit) or later +Mac OS X 10.7 (64-bit) or later -Building the sources requires Qt 5.2.1 or later. +Building the sources requires Qt 5.2.0 or later. Compiling Valentina ==================== Prerequisites: - * Qt 5.2.1 or later (On Unix development packages needed) - * mercurial + * Qt 5.2.0 or later (On Unix development packages needed) + * mercurial (only for working with repository) * On Unix: - ccache - g++ (at least GCC 4.6 is needed and GCC 4.8 is recommended) or @@ -65,9 +69,13 @@ Unix systems: Default prefix for command "make install" is /usr. For using another prefix build with qmake command: -qmake PREFIX=/usr/local Valentina.pro -r +qmake PREFIX=/usr/local PREFIX_LIB=/usr/lib/i386-linux-gnu Valentina.pro -r -where /usr/local is a new prefix for installation. +where /usr/local is a new prefix for installation binary files and /usr/lib/i386-linux-gnu is new prefix for install libraries. + +More about creation installers read in articles: +* How create Windows installer - https://bitbucket.org/dismine/valentina/wiki/developers/Creation_Windows_installer +* How create debian package - https://bitbucket.org/dismine/valentina/wiki/developers/Creation_deb_package LICENSING ========== @@ -81,4 +89,8 @@ 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. -See LICENSE file for further information +See LICENSE_GPL.txt file for further information + +Other components released under: +* QMuParser - BSD license +* VPropertyExplorer - LGPLv2.1 license \ No newline at end of file diff --git a/Valentina.pri b/Valentina.pri index ae716f1e0..e215a09fc 100644 --- a/Valentina.pri +++ b/Valentina.pri @@ -529,7 +529,6 @@ GCC_DEBUG_CXXFLAGS += \ -O0 \ -Wall \ -Wextra \ - -pedantic \ -fno-omit-frame-pointer # Need for exchndl.dll CLANG_DEBUG_CXXFLAGS += \ diff --git a/dist/debian/changelog b/dist/debian/changelog index c5c709e33..e32aca73a 100644 --- a/dist/debian/changelog +++ b/dist/debian/changelog @@ -1,4 +1,4 @@ -valentina (0.2.8-alpha) trusty; urgency=low +valentina (0.2.9) trusty; urgency=low * Auto build. diff --git a/dist/nsis/valentina.nsi b/dist/nsis/valentina.nsi index 09b811912..83c88332c 100644 --- a/dist/nsis/valentina.nsi +++ b/dist/nsis/valentina.nsi @@ -14,7 +14,7 @@ SetCompressor /FINAL /SOLID lzma !define MUI_FILE "valentina" !insertmacro GetPEVersionLocal "c:\pack\valentina\valentina.exe" ver -!define MUI_VERSION "${ver_1}.${ver_2}.${ver_3}-alpha" +!define MUI_VERSION "${ver_1}.${ver_2}.${ver_3}" !define MUI_BRANDINGTEXT "Valentina ${MUI_VERSION}" !define WEBSITE_LINK "http://www.valentina-project.org/" diff --git a/dist/rpm/valentina.spec b/dist/rpm/valentina.spec index 633415889..c092a06fa 100644 --- a/dist/rpm/valentina.spec +++ b/dist/rpm/valentina.spec @@ -25,7 +25,7 @@ BuildRequires: ccache BuildRequires: update-desktop-files %endif -Version: 0.2.8 +Version: 0.2.9 Release: 0 URL: https://bitbucket.org/dismine/valentina License: GPL-3.0+ diff --git a/share/translations.pro b/share/translations.pro index 108b2a8e3..a8bf3a546 100644 --- a/share/translations.pro +++ b/share/translations.pro @@ -12,13 +12,15 @@ DEPENDPATH += \ ../src/libs/qmuparser \ ../src/libs/vpropertyexplorer \ ../src/libs/ifc \ - ../src/libs/vobj + ../src/libs/vobj \ + ../src/libs/vlayout include(../src/app/app.pri) include(../src/libs/qmuparser/qmuparser.pri) include(../src/libs/vpropertyexplorer/vpropertyexplorer.pri) include(../src/libs/ifc/ifc.pri) include(../src/libs/vobj/vobj.pri) +include(../src/libs/vlayout/vlayout.pri) # Add here path to new translation file with name "valentina_*_*.ts" if you want to add new language. # Same paths in variable INSTALL_TRANSLATIONS (app.pro). @@ -35,4 +37,5 @@ TRANSLATIONS += translations/valentina.ts \ translations/valentina_fr_FR.ts \ translations/valentina_it_IT.ts \ translations/valentina_nl_NL.ts \ - translations/valentina_id_ID.ts + translations/valentina_id_ID.ts \ + translations/valentina_es_ES.ts diff --git a/share/translations/valentina.ts b/share/translations/valentina.ts index 7389c3bf9..9beac07b2 100644 --- a/share/translations/valentina.ts +++ b/share/translations/valentina.ts @@ -252,10 +252,6 @@ DialogAlongLine - - Point along line - - Length @@ -264,10 +260,6 @@ Insert variable into the formula - - Calculate value - - Value of length @@ -348,6 +340,14 @@ Select second point of line + + Point at distance along line + + + + Line color + + DialogArc @@ -363,10 +363,6 @@ Insert variable into the formula - - Calculate value - - Value of radius @@ -447,10 +443,6 @@ Variables - - Value of angle of line. - - Error @@ -463,13 +455,13 @@ Angles equal + + Color + + DialogBisector - - Bisector - - Length @@ -478,10 +470,6 @@ Insert marked variable into the formula - - Calculate value - - Value of length @@ -574,21 +562,21 @@ Select third point of angle + + Point along bisector + + + + Line color + + DialogCurveIntersectAxis - - Curve intersect axis - - Angle - - Calculate value - - Value of angle @@ -601,10 +589,6 @@ Axis point - - First point of line - - Curve @@ -665,21 +649,25 @@ Select axis point + + Point intersect curve and axis + + + + Axis Point + + + + Line color + + DialogCutArc - - Cut arc - - Length - - Calculate value - - Value of length @@ -696,10 +684,6 @@ Arc - - Selected curve - - Point label @@ -744,21 +728,25 @@ Variables - Click twice to insert into formula + + Segment an arc + + + + Selected arc + + + + Color + + DialogCutSpline - - Cut curve - - Length - - Calculate value - - Value of length @@ -823,21 +811,21 @@ Variables - Click twice to insert into formula + + Segmenting a simple curve + + + + Color + + DialogCutSplinePath - - Cut curve path - - Length - - Calculate value - - Value of length @@ -902,6 +890,14 @@ Variables - Click twice to insert into formula + + Segment a curved path + + + + Color + + DialogDetail @@ -953,6 +949,10 @@ Reverse + + Seam allowance tool + + DialogEditWrongFormula @@ -968,10 +968,6 @@ Insert variable into formula - - Calculate value - - Value of first angle @@ -1027,18 +1023,10 @@ DialogEndLine - - Point in the end of a line - - Length - - Calculate value - - Value of length @@ -1115,13 +1103,17 @@ Variables + + Point at distance and angle + + + + Line color + + DialogHeight - - Height - - Point label @@ -1154,6 +1146,18 @@ Select second point of line + + Perpendicular point along line + + + + Base Point + + + + Line color + + DialogHistory @@ -1400,6 +1404,22 @@ Can't save measurement + + Tables of Variables + + + + Base size: %1 %3; Base height: %2 %3 + + + + Description: "%1" + + + + Data successfully saved. + + DialogIndividualMeasurements @@ -1473,11 +1493,113 @@ - DialogLine + DialogLayoutProgress - Line + Creation a layout + + <html><head/><body><p>Finding best position for worpieces. Please, waite.</p></body></html> + + + + Couldn't prepare data for creation layout + + + + Critical error + + + + Wrong paper size + + + + Several workpieces left not arranged, but none of them match for paper + + + + + DialogLayoutSettings + + Creation a layout + + + + Paper size + + + + Templates: + + + + Width: + + + + Height: + + + + Rotate workpiece + + + + Rotate by + + + + degree + + + + Creation options + + + + Layout width: + + + + Shift length: + + + + Principle of choosing the next workpiece + + + + Three groups: big, middle, small + + + + Two groups: big, small + + + + Descending area + + + + Millimiters + + + + Centimeters + + + + Inches + + + + Pixels + + + + + DialogLine First point @@ -1498,13 +1620,17 @@ Select second point + + Line between points + + + + Line color + + DialogLineIntersect - - Intersection of lines - - Point label @@ -1537,21 +1663,17 @@ Select second point of second line + + Point at line intersection + + DialogLineIntersectAxis - - Line intersect axis - - Angle - - Calculate value - - Value of angle @@ -1636,6 +1758,22 @@ Select axis point + + Point intersect line and axis + + + + Axis Point + + + + Second point of line + + + + Line color + + DialogMeasurements @@ -1666,10 +1804,6 @@ DialogNormal - - Normal - - Length @@ -1678,10 +1812,6 @@ Insert variable into formula - - Calculate value - - Value of length @@ -1758,6 +1888,22 @@ Select second point of line + + Point along perpendicular + + + + First point of line + + + + Second point of line + + + + Line color + + DialogPatternProperties @@ -1931,10 +2077,6 @@ DialogPointOfContact - - Point of contact - - Radius @@ -1943,10 +2085,6 @@ Insert variable into formula - - Calculate value - - Value of radius @@ -2019,44 +2157,44 @@ Select second point of line + + Point at intersection of arc and line + + DialogPointOfIntersection - - Point of intersection - - Point label - - vertical point - - First point of angle - - horizontal point - - Second point of angle - Select point horizontally + Point from X and Y of two other points + + + + X: vertical point + + + + Y: horizontal point + + + + Select point for Y value (horizontal) DialogShoulderPoint - - Point of shoulder - - Length @@ -2065,10 +2203,6 @@ Insert variable into formula - - Calculate value - - Value of length @@ -2149,6 +2283,14 @@ Select second point of line + + Special point on shoulder + + + + Line color + + DialogSinglePoint @@ -2179,10 +2321,6 @@ DialogSpline - - Curve - - First point @@ -2215,6 +2353,14 @@ Select last point of curve + + Simple curve + + + + Color + + DialogSplinePath @@ -2254,6 +2400,10 @@ Select point of curve path + + Color + + DialogStandardMeasurements @@ -2316,13 +2466,13 @@ Parser error: %1 + + Line Angle + + DialogTriangle - - Triangle - - Point label @@ -2359,6 +2509,22 @@ Select second point + + Triangle tool + + + + First point of the axis + + + + Second point of the axis + + + + Second point of line + + DialogUndo @@ -2385,10 +2551,6 @@ DialogUnionDetails - - Union details - - <html><head/><body><p>Do you really want union details?</p></body></html> @@ -2409,6 +2571,10 @@ Select detail + + Union tool + + Functions @@ -2563,14 +2729,6 @@ Point along perpendicular - - Special point on shoulder. - - - - Tool triangle. - - Perpendicular point along line @@ -2579,14 +2737,6 @@ Point along bisector - - Point at intersection of arc and line. - - - - Tool to make point from x & y of two other points. - - Point at distance and angle @@ -2595,10 +2745,6 @@ Point at distance along line - - Point of intersection line and axis - - ... @@ -2627,22 +2773,6 @@ Curve - - Curve tool. - - - - Tool for path curve. - - - - Tool for segmenting a curve. - - - - Tool segment a pathed curve. - - Tools for creating arcs. @@ -2651,14 +2781,6 @@ Arc - - Arc tool. - - - - Cut arc tool. - - Tools for creating details. @@ -2667,14 +2789,6 @@ Detail - - Tool new detail. - - - - Tool for union two details. - - &File @@ -3004,10 +3118,6 @@ For opening pattern need keep both files: pattern and measurements. Do you want Select first point of axis - - Select point vertically - - Select detail @@ -3165,6 +3275,82 @@ Do you want to save your changes? Individual measurements (*.vit) + + Special point on shoulder + + + + Triangle tool + + + + Point at intersection of arc and line + + + + Point from X and Y of two other points + + + + Point intersect line and axis + + + + Simple curve + + + + Curved path + + + + Segmenting a simple curve + + + + Segment a curved path + + + + Point intersect curve and axis + + + + Segment an arc + + + + Point intersect arc and axis + + + + Seam allowance tool + + + + Union tool + + + + toolBar + + + + Last Tool + + + + Activate last used tool again + + + + L + + + + Select point for X value (vertical) + + Measurements @@ -5232,6 +5418,14 @@ Do you want to save your changes? Patterns + + Standard measurements + + + + Layout + + PatternPage @@ -5321,6 +5515,10 @@ Do you want to save your changes? The text that appears in the second column header + + px + + QmuParserErrorMsg @@ -5552,22 +5750,6 @@ Do you want to save your changes? Save layout - - Next - - - - Next detail - - - - Turn - - - - Turn the detail 90 degrees - - Stop @@ -5576,26 +5758,6 @@ Do you want to save your changes? Stop laying - - Enlarge letter - - - - Enlarge the length of the sheet - - - - Reduce sheet - - - - Reduce the length of the sheet - - - - Mirroring - - Zoom In @@ -5604,18 +5766,6 @@ Do you want to save your changes? Zoom Out - - 0 details left. - - - - Collisions not found. - - - - %1 details left. - - untitled @@ -5640,10 +5790,6 @@ Do you want to save your changes? EPS files (*.eps) - - Collisions found. - - Creating file '%1' failed! %2 @@ -5656,6 +5802,14 @@ Do you want to save your changes? Wavefront OBJ (*.obj) + + Layout pages + + + + Layout + + VAbstractConverter @@ -5706,6 +5860,34 @@ Do you want to save your changes? Do you really want delete? + + black + + + + green + + + + blue + + + + dark red + + + + dark green + + + + dark blue + + + + yellow + + VApplication @@ -6181,6 +6363,18 @@ Do you want to save your changes? Point intersection line and axis + + Line color + + + + Color + + + + Point intersection curve and axis + + Variables diff --git a/share/translations/valentina_cs_CZ.ts b/share/translations/valentina_cs_CZ.ts index b3cc1b8d6..dbf22b21e 100644 --- a/share/translations/valentina_cs_CZ.ts +++ b/share/translations/valentina_cs_CZ.ts @@ -41,7 +41,7 @@ Secure connection - Bezpečné připojení + Zabezpečené připojení Proxy settings @@ -57,7 +57,7 @@ Proxy port - Přípojka proxy + Port proxy Proxy user @@ -112,7 +112,7 @@ Community - Společenství + Komunita Paths @@ -123,11 +123,11 @@ ConfigurationPage Setup user interface language updated and will be used the next time start - + Nastavení uživatelského rozhraní bylo změněno a bude použito při příštím spuštění Default unit updated and will be used the next pattern creation - + Výchozí jednotka byla změněna a bude použita při vytvoření dalšího střihu Save @@ -179,7 +179,7 @@ Label language - + Jazyk štítků Send crash reports @@ -191,7 +191,7 @@ After each crash Valentina collect information that may help us fix a problem. We do not collect any personal information. Find more about what <a href="https://bitbucket.org/dismine/valentina/wiki/manual/Crash_reports">kind of information</a> we collect. - + Po každém pádu Valentina sbírá informace, které nám mohou pomoci problém opravit. Nesbíráme žádné osobní údaje. Podívejte se, jaký <a href="https://bitbucket.org/dismine/valentina/wiki/manual/Crash_reports">typ informací</a> sbíráme. @@ -223,16 +223,12 @@ Valentina version - Verze Valentiny + Verze programu Valentina Contributors Přispěvatelé - - Based on Qt %2 (32 bit) - Založeno na Qt %2 (32 bit) - Built on %3 at %4 Sestaveno %3 v %4 @@ -251,14 +247,14 @@ Build revision: - + Revize sestavení: DialogAlongLine Point along line - Bod podél čáry + Bod podél čáry Length @@ -270,7 +266,7 @@ Calculate value - Vypočítat hodnotu + Vypočítat hodnotu Value of length @@ -282,7 +278,7 @@ Point label - Označení bodu + Štítek bodu First point @@ -352,6 +348,14 @@ Select second point of line Vybrat druhý bod čáry + + Point at distance along line + Bod ve vzdálenosti podél čáry + + + Line color + + DialogArc @@ -369,7 +373,7 @@ Calculate value - Vypočítat hodnotu + Vypočítat hodnotu Value of radius @@ -405,7 +409,7 @@ Center point - Bod ve středu + Středový bod Select point of center of arc @@ -453,18 +457,22 @@ Value of angle of line. - Hodnota úhlu čáry. + Hodnota úhlu čáry. Error - Chyba + Chyba Radius can't be negative - + Poloměr nemůže být záporný Angles equal + Úhly jsou si rovny + + + Color @@ -472,7 +480,7 @@ DialogBisector Bisector - Osa souměrnosti úhlu + Osa souměrnosti úhlu Length @@ -484,7 +492,7 @@ Calculate value - Vypočítat hodnotu + Vypočítat hodnotu Value of length @@ -496,7 +504,7 @@ Point label - Označení bodu + Štítek bodu First point @@ -578,12 +586,20 @@ Select third point of angle Vybrat třetí bod úhlu + + Point along bisector + Bod podél osy úhlu + + + Line color + + DialogCurveIntersectAxis Curve intersect axis - Osa průsečíku křivky + Osa průsečíku křivky Angle @@ -591,7 +607,7 @@ Calculate value - Vypočítat hodnotu + Vypočítat hodnotu Value of angle @@ -599,7 +615,7 @@ <html><head/><body><p>Show full calculation in message box</p></body></html> - <html><head/><body><p>Ukázat celý výpočet v okně se zprávami</p></body></html> + <html><head/><body><p>Ukázat celý výpočet v okně se zprávami</p></body></html> Axis point @@ -607,7 +623,7 @@ First point of line - První bod čáry + První bod čáry Curve @@ -615,7 +631,7 @@ Point label - Označení bodu + Štítek bodu Type of line @@ -669,12 +685,24 @@ Select axis point Vybrat bod osy + + Point intersect curve and axis + + + + Axis Point + + + + Line color + + DialogCutArc Cut arc - Vyjmout oblouk + Vyjmout oblouk Length @@ -682,7 +710,7 @@ Calculate value - Vypočítat hodnotu + Vypočítat hodnotu Value of length @@ -702,11 +730,11 @@ Selected curve - Vybraná křivka + Vybraná křivka Point label - Označení bodu + Štítek bodu Input data @@ -748,12 +776,24 @@ Variables - Click twice to insert into formula Proměnné - Klepněte dvakrát pro vložení do vzorce + + Segment an arc + + + + Selected arc + + + + Color + + DialogCutSpline Cut curve - Vyjmout úhel + Vyjmout úhel Length @@ -761,7 +801,7 @@ Calculate value - Vypočítat hodnotu + Vypočítat hodnotu Value of length @@ -785,7 +825,7 @@ Point label - Označení bodu + Štítek bodu Input data @@ -827,12 +867,20 @@ Variables - Click twice to insert into formula Proměnné - Klepněte dvakrát pro vložení do vzorce + + Segmenting a simple curve + + + + Color + + DialogCutSplinePath Cut curve path - Vyjmout cestu křivky + Vyjmout cestu křivky Length @@ -840,7 +888,7 @@ Calculate value - Vypočítat hodnotu + Vypočítat hodnotu Value of length @@ -864,7 +912,7 @@ Point label - Označení bodu + Štítek bodu Input data @@ -906,6 +954,14 @@ Variables - Click twice to insert into formula Proměnné - Klepněte dvakrát pro vložení do vzorce + + Segment a curved path + + + + Color + + DialogDetail @@ -955,6 +1011,10 @@ Reverse + Převrátit + + + Seam allowance tool @@ -974,7 +1034,7 @@ Calculate value - Vypočítat hodnotu + Vypočítat hodnotu Value of first angle @@ -1033,7 +1093,7 @@ DialogEndLine Point in the end of a line - Bod na konci čáry + Bod na konci čáry Length @@ -1041,7 +1101,7 @@ Calculate value - Vypočítat hodnotu + Vypočítat hodnotu Value of length @@ -1069,7 +1129,7 @@ Point label - Označení bodu + Štítek bodu Type of line @@ -1119,16 +1179,24 @@ Variables Proměnné + + Point at distance and angle + Bod ve vzdálenosti a úhlu + + + Line color + + DialogHeight Height - Výška + Výška Point label - Označení bodu + Štítek bodu Base point @@ -1158,6 +1226,18 @@ Select second point of line Vybrat druhý bod čáry + + Perpendicular point along line + Bod v pravém úhlu podél čáry + + + Base Point + + + + Line color + + DialogHistory @@ -1191,15 +1271,15 @@ %3 - normal to line %1_%2 - %3 - Kolmice k čáře %1_%2 + %3 - kolmice k čáře %1_%2 %4 - bisector of angle %1_%2_%3 - %4 - Osa úhlu %1_%2_%3 + %4 - osa úhlu %1_%2_%3 %5 - intersection of lines %1_%2 and %3_%4 - %5 - Průsečík čar %1_%2 a %3_%4 + %5 - průsečík čar %1_%2 a %3_%4 Curve %1_%2 @@ -1215,11 +1295,11 @@ %4 - point of contact of arc with the center in point %1 and line %2_%3 - + %4 - bod doteku oblouku se středem v bodě %1 a čáry %2_%3 Point of perpendicular from point %1 to line %2_%3 - + Bod pravého úhlu z bodu %1 k čáře %2_%3 Triangle: axis %1_%2, points %3 and %4 @@ -1227,27 +1307,27 @@ %1 - point of intersection %2 and %3 - %1 - Bod průsečíku %2 a %3 + %1 - bod průsečíku %2 a %3 %1 - cut arc with center %2 - %1 - Vyjmout oblouk se středem %2 + %1 - vyjmout oblouk se středem %2 %1 - cut curve %2_%3 - %1 - Vyjmout křivku %2_%3 + %1 - vyjmout křivku %2_%3 %1 - cut curve path %2 - %1 - Vyjmout cestu křivky %2 + %1 - vyjmout cestu křivky %2 %1 - point of intersection line %2_%3 and axis through point %4 - + %1 - bod průsečíku čáry %2_%3 a osy procházející bodem %4 %1 - point of intersection curve and axis through point %2 - + %1 - bod průsečíku křivky a osy procházející bodem %2 @@ -1310,7 +1390,7 @@ In heights - O výškách + Ve výškách Description @@ -1350,11 +1430,11 @@ male - Muž + muž female - Žena + žena Could not save GivenName @@ -1378,11 +1458,11 @@ Measurements use different units than pattern. This pattern required measurements in %1 - Míry používají odlišné jednotky než střihy. Tento střih vyžaduje míry v %1 + Míry používají odlišné jednotky než střih. Tento střih vyžaduje míry v %1 Individual measurements (*.vit) - Osobité míry (*.vit) + Individuální míry (*.vit) Open file @@ -1402,14 +1482,30 @@ Can't save measurement - Nelze uložit míry + Nelze uložit míru + + + Tables of Variables + + + + Base size: %1 %3; Base height: %2 %3 + + + + Description: "%1" + + + + Data successfully saved. + DialogIndividualMeasurements Individual measurements - Osobité míry + Individuální míry Pattern piece name @@ -1453,7 +1549,7 @@ Individual measurements (*.vit) - Osobité míry (*.vit) + Individuální míry (*.vit) Open file @@ -1461,7 +1557,7 @@ Where save measurements? - Kam míry uložit? + Kam uložit míry? Centimeters @@ -1469,18 +1565,128 @@ Millimiters - Milimitry + Milimetry Inches Palce + + DialogLayoutProgress + + Creation a layout + + + + <html><head/><body><p>Finding best position for worpieces. Please, waite.</p></body></html> + + + + Couldn't prepare data for creation layout + + + + Critical error + + + + Wrong paper size + + + + Several workpieces left not arranged, but none of them match for paper + + + + + DialogLayoutSettings + + Creation a layout + + + + Paper size + + + + Templates: + + + + Width: + + + + Height: + + + + ... + ... + + + Rotate workpiece + + + + Rotate by + + + + degree + + + + Creation options + + + + Layout width: + + + + Shift length: + + + + Principle of choosing the next workpiece + + + + Three groups: big, middle, small + + + + Two groups: big, small + + + + Descending area + + + + Millimiters + Milimetry + + + Centimeters + Centimetry + + + Inches + Palce + + + Pixels + + + DialogLine Line - Čára + Čára First point @@ -1502,16 +1708,24 @@ Select second point Vybrat druhý bod + + Line between points + Čára mezi body + + + Line color + + DialogLineIntersect Intersection of lines - Průsečík čar + Průsečík čar Point label - Označení bodu + Štítek bodu First line @@ -1541,12 +1755,16 @@ Select second point of second line Vybrat druhý bod druhé čáry + + Point at line intersection + Bod na průsečíku čar + DialogLineIntersectAxis Line intersect axis - Osa průsečíku čáry + Osa průsečíku čáry Angle @@ -1554,7 +1772,7 @@ Calculate value - Vypočítat hodnotu + Vypočítat hodnotu Value of angle @@ -1582,7 +1800,7 @@ Point label - Označení bodu + Štítek bodu Type of line @@ -1640,6 +1858,22 @@ Select axis point Vybrat bod osy + + Point intersect line and axis + + + + Axis Point + + + + Second point of line + Druhý bod čáry + + + Line color + + DialogMeasurements @@ -1661,18 +1895,18 @@ Individual - Osobité + Individuální Use for creation pattern individual measurements - Pro vytvoření střihu použít osobité míry + Pro vytvoření střihu použít Individuální míry DialogNormal Normal - Kolmice + Kolmice Length @@ -1684,7 +1918,7 @@ Calculate value - Vypočítat hodnotu + Vypočítat hodnotu Value of length @@ -1696,7 +1930,7 @@ Point label - Označení bodu + Štítek bodu First point @@ -1708,7 +1942,7 @@ Additional angle degrees - Dodatečné úhlové stupně + Dodatečné stupně úhlu Type of line @@ -1762,12 +1996,28 @@ Select second point of line Vybrat druhý bod čáry + + Point along perpendicular + + + + First point of line + První bod čáry + + + Second point of line + Druhý bod čáry + + + Line color + + DialogPatternProperties Pattern properties - Vlastnosti střihu + Vlastnosti střihu Description @@ -1818,7 +2068,7 @@ Type : - Typ: + Typ: Add attribute @@ -1870,7 +2120,7 @@ Cannot delete previously created node - Nelze smazat předtím vytvořený uzel + Nelze smazat naposledy vytvořený uzel No changes left @@ -1882,7 +2132,7 @@ <no value> - <Žádná hodnota> + <žádná hodnota> Unchanged @@ -1890,7 +2140,7 @@ Cannot delete previously created attribute - Nelze smazat předtím vytvořenou vlastnost + Nelze smazat naposledy vytvořenou vlastnost Node Name @@ -1937,7 +2187,7 @@ DialogPointOfContact Point of contact - Bod dotyku + Bod dotyku Radius @@ -1949,7 +2199,7 @@ Calculate value - Vypočítat hodnotu + Vypočítat hodnotu Value of radius @@ -1961,7 +2211,7 @@ Point label - Označení bodu + Štítek bodu Center of arc @@ -1973,7 +2223,7 @@ Top of the line - Začátek čáry + Vrchol čáry End of the line @@ -2023,20 +2273,24 @@ Select second point of line Vybrat druhý bod čáry + + Point at intersection of arc and line + Bod v průsečíku oblouku a čáry + DialogPointOfIntersection Point of intersection - Bod průsečíku + Bod průsečíku Point label - Označení bodu + Štítek bodu vertical point - Svislý bod + svislý bod First point of angle @@ -2044,7 +2298,7 @@ horizontal point - Vodorovný bod + vodorovný bod Second point of angle @@ -2052,14 +2306,30 @@ Select point horizontally - Vybrat bod vodorovně + Vybrat bod vodorovně + + + Point from X and Y of two other points + + + + X: vertical point + + + + Y: horizontal point + + + + Select point for Y value (horizontal) + DialogShoulderPoint Point of shoulder - Bod ramene + Bod ramene Length @@ -2071,7 +2341,7 @@ Calculate value - Vypočítat hodnotu + Vypočítat hodnotu Value of length @@ -2083,7 +2353,7 @@ Point label - Označení bodu + Štítek bodu First point @@ -2153,6 +2423,14 @@ Select second point of line Vybrat druhý bod čáry + + Special point on shoulder + Zvláštní bod na rameni + + + Line color + + DialogSinglePoint @@ -2178,14 +2456,14 @@ Point label - Označení bodu + Štítek bodu DialogSpline Curve - Křivka + Křivka First point @@ -2219,6 +2497,14 @@ Select last point of curve Vybrat poslední bod čáry + + Simple curve + + + + Color + + DialogSplinePath @@ -2258,6 +2544,10 @@ Select point of curve path Vybrat bod cesty křivky + + Color + + DialogStandardMeasurements @@ -2318,6 +2608,10 @@ Parser error: %1 + Chyba zpracování: %1 + + + Line Angle @@ -2325,11 +2619,11 @@ DialogTriangle Triangle - Trojúhelník + Trojúhelník Point label - Označení bodu + Štítek bodu First point of axis @@ -2363,6 +2657,22 @@ Select second point Vybrat druhý bod + + Triangle tool + + + + First point of the axis + + + + Second point of the axis + + + + Second point of line + Druhý bod čáry + DialogUndo @@ -2391,7 +2701,7 @@ DialogUnionDetails Union details - Sjednotit detaily + Sjednotit detaily <html><head/><body><p>Do you really want union details?</p></body></html> @@ -2413,6 +2723,10 @@ Select detail Vybrat detail + + Union tool + + Functions @@ -2546,7 +2860,7 @@ InternalStrings The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - + Program je poskytován TAK JAK JE bez JAKÉKOLIV ZÁRUKY JAKÉHOKOLIV DRUHU, VČETNĚ ZÁRUKY VZHLEDU, PRODEJNOSTI A VHODNOSTI PRO DANÝ ÚČEL. @@ -2565,15 +2879,15 @@ Point along perpendicular - Bod podél v pravém úhlu + Bod podél pravého úhlu Special point on shoulder. - Zvláštní bod na rameni. + Zvláštní bod na rameni. Tool triangle. - Nástroj trojúhelník. + Nástroj trojúhelník. Perpendicular point along line @@ -2585,11 +2899,11 @@ Point at intersection of arc and line. - Bod v průsečíku oblouku a čáry. + Bod v průsečíku oblouku a čáry. Tool to make point from x & y of two other points. - Nástroj na udělání bodu z x a y dvou jiných bodů. + Nástroj na vytvoření bodu z x a y dvou jiných bodů. Point at distance and angle @@ -2601,7 +2915,7 @@ Point of intersection line and axis - Bod průsečíku čáry a úhlu + Bod průsečíku čáry a úhlu ... @@ -2633,19 +2947,19 @@ Curve tool. - Nástroj na křivku. + Nástroj křivky. Tool for path curve. - Nástroj pro křivku cesty. + Nástroj pro křivku cesty. Tool for segmenting a curve. - Nástroj pro rozdělení křivky. + Nástroj pro rozdělení křivky. Tool segment a pathed curve. - Nástroj pro rozdělení cesty křivky. + Nástroj pro rozdělení cesty křivky. Tools for creating arcs. @@ -2657,15 +2971,15 @@ Arc tool. - Nástroj na oblouk. + Nástroj oblouku. Cut arc tool. - Nástroj na vyjmutí oblouku. + Nástroj pro vyjmutí oblouku. Tools for creating details. - Nástroje na vytváření detailů. + Nástroje pro vytváření detailů. Detail @@ -2673,11 +2987,11 @@ Tool new detail. - Nástroj pro nový detail. + Nástroj pro nový detail. Tool for union two details. - Nástroj na spojení dvou detailů. + Nástroj pro spojení dvou detailů. &File @@ -2773,7 +3087,7 @@ Save not yet saved pattern - Uložit ještě neuložený vzor + Uložit dosud neuložený vzor Ctrl+Shift+S @@ -2821,7 +3135,7 @@ Change the label of pattern piece - Změnit označení dílu střihu + Změnit štítek dílu střihu Table of variables @@ -2889,7 +3203,7 @@ zoom in - Přiblížit + přiblížit Zoom out @@ -2901,11 +3215,11 @@ Original zoom - Původní zvětšení + Původní přiblížení Original Zoom - Původní zvětšení + Původní přiblížení Zoom fit best @@ -2937,11 +3251,11 @@ Online help - + Nápověda na internetu Show online help - + Zobrazit nápovědu na internetu Pattern piece %1 @@ -2949,12 +3263,13 @@ Individual measurements is under development - Osobité míry se vyvíjejí + Individuální míry jsou ve vývoji There is no way create individual measurements file independent on the pattern file. For opening pattern need keep both files: pattern and measurements. Do you want continue? - + Není možné vytvářet soubor s individuálními mírami nezávisle na souboru se střihem. +Pro otevření souboru je nutné zachovat oba soubory: střih a míry. Chcete pokračovat? Select point @@ -3010,7 +3325,7 @@ For opening pattern need keep both files: pattern and measurements. Do you want Select point vertically - Vybrat bod svisle + Vybrat bod svisle Select detail @@ -3030,7 +3345,7 @@ For opening pattern need keep both files: pattern and measurements. Do you want Height: - Výška: + Výška: Size: @@ -3078,11 +3393,11 @@ For opening pattern need keep both files: pattern and measurements. Do you want Error wrong id. - Chyba. Špatné ID. + Chyba. Špatný identifikátor. Critical error! - Zásadní chyba! + Vážná chyba! Error parsing file (std::bad_alloc). @@ -3090,7 +3405,7 @@ For opening pattern need keep both files: pattern and measurements. Do you want Bad id. - Špatné ID. + Špatný identifikátor. File saved @@ -3124,11 +3439,11 @@ Chcete uložit své změny? Enter a new label for the pattern piece. - Zadejte nové označení dílu střihu. + Zadejte nový štítek dílu střihu. This file already opened in another window. - + Tento soubor je již otevřen v jiném okně. Wrong units. @@ -3148,11 +3463,11 @@ Chcete uložit své změny? Valentina didn't shut down correctly. Do you want reopen files (%1) you had open? - Valentina se nevypla správně. Chcete otevřít soubory (%1), které jste měl otevřeny, znovu? + Valentina nebyla vypnuta správně. Chcete znovu otevřít soubory (%1), které jste měli otevřeny? Reopen files. - Otevřít soubor znovu + Znovu otevřít soubory The measurements file <br/><br/> <b>%1</b> <br/><br/> %3 @@ -3160,7 +3475,7 @@ Chcete uložit své změny? could not be found. Do you want to update the file location - se nepodařilo nalézt. Chcete aktualizovat umístění souboru + se nepodařilo nalézt. Chcete aktualizovat umístění souboru? Standard measurements (*.vst) @@ -3168,7 +3483,83 @@ Chcete uložit své změny? Individual measurements (*.vit) - Osobité míry (*.vit) + Individuální míry (*.vit) + + + Special point on shoulder + Zvláštní bod na rameni + + + Triangle tool + + + + Point at intersection of arc and line + Bod v průsečíku oblouku a čáry + + + Point from X and Y of two other points + + + + Point intersect line and axis + + + + Simple curve + + + + Curved path + Cesta křivky + + + Segmenting a simple curve + + + + Segment a curved path + + + + Point intersect curve and axis + + + + Segment an arc + + + + Point intersect arc and axis + + + + Seam allowance tool + + + + Union tool + + + + toolBar + Nástrojový pruh + + + Last Tool + + + + Activate last used tool again + + + + L + + + + Select point for X value (vertical) + @@ -3176,117 +3567,117 @@ Chcete uložit své změny? head_girth Short measurement name. Don't use math symbols in name!!!! - + obvod_hlavy mid_neck_girth Short measurement name. Don't use math symbols in name!!!! - + střední_obvod_krku neck_base_girth Short measurement name. Don't use math symbols in name!!!! - + dolní_obvod_krku head_and_neck_length Short measurement name. Don't use math symbols in name!!!! - + délka_hlavy_a_krku center_front_waist_length Short measurement name. Don't use math symbols in name!!!! - + střední_horní_délka_pasu center_back_waist_length Short measurement name. Don't use math symbols in name!!!! - + střední_zadní_délka_pasu shoulder_length Short measurement name. Don't use math symbols in name!!!! - + délka_ramene side_waist_length Short measurement name. Don't use math symbols in name!!!! - + boční_délka_pasu trunk_length Short measurement name. Don't use math symbols in name!!!! - + délka_trupu shoulder_girth Short measurement name. Don't use math symbols in name!!!! - + obvod_ramene upper_chest_girth Short measurement name. Don't use math symbols in name!!!! - + horní_obvod_hrudi bust_girth Short measurement name. Don't use math symbols in name!!!! - + obvod_přes_prsa under_bust_girth Short measurement name. Don't use math symbols in name!!!! - + obvod_pod_prsy waist_girth Short measurement name. Don't use math symbols in name!!!! - + obvod_pasu high_hip_girth Short measurement name. Don't use math symbols in name!!!! - + horní_obvod_boků hip_girth Short measurement name. Don't use math symbols in name!!!! - + obvod_boků upper_front_chest_width Short measurement name. Don't use math symbols in name!!!! - + horní_přední_šířka_hrudi front_chest_width Short measurement name. Don't use math symbols in name!!!! - + přední_šířka_hrudi across_front_shoulder_width Short measurement name. Don't use math symbols in name!!!! - + přední_šířka_ramen across_back_shoulder_width Short measurement name. Don't use math symbols in name!!!! - + zadní_šířka_ramen upper_back_width Short measurement name. Don't use math symbols in name!!!! - + horní_šířka_zad back_width Short measurement name. Don't use math symbols in name!!!! - + šířka_zad bustpoint_to_bustpoint Short measurement name. Don't use math symbols in name!!!! - + od_bradavky_k_bradavce halter_bustpoint_to_bustpoint @@ -3296,12 +3687,12 @@ Chcete uložit své změny? neck_to_bustpoint Short measurement name. Don't use math symbols in name!!!! - + od_krku_k_bradavce crotch_length Short measurement name. Don't use math symbols in name!!!! - + délka_rozkroku rise_height @@ -3311,167 +3702,167 @@ Chcete uložit své změny? shoulder_drop Short measurement name. Don't use math symbols in name!!!! - + pokles_ramena shoulder_slope_degrees Short measurement name. Don't use math symbols in name!!!! - + stupně_sklonu_ramen front_shoulder_slope_length Short measurement name. Don't use math symbols in name!!!! - + délka_předního_sklonu_ramen back_shoulder_slope_length Short measurement name. Don't use math symbols in name!!!! - + délka_zadního_sklonu_ramen front_shoulder_to_waist_length Short measurement name. Don't use math symbols in name!!!! - + přední_délka_od_ramene_k_pasu back_shoulder_to_waist_length Short measurement name. Don't use math symbols in name!!!! - + zadní_délka_od_ramene_k_pasu front_neck_arc Short measurement name. Don't use math symbols in name!!!! - + přední_oblouk_krku back_neck_arc Short measurement name. Don't use math symbols in name!!!! - + zadní_oblouk_krku front_upper_chest_arc Short measurement name. Don't use math symbols in name!!!! - + přední_horní_oblouk_hrudi back_upper_chest_arc Short measurement name. Don't use math symbols in name!!!! - + zadní_horní_oblouk_hrudi front_waist_arc Short measurement name. Don't use math symbols in name!!!! - + přední_oblouk_pasu back_waist_arc Short measurement name. Don't use math symbols in name!!!! - + zadní_oblouk_pasu front_upper_hip_arc Short measurement name. Don't use math symbols in name!!!! - + přední_horní_oblouk_boků back_upper_hip_arc Short measurement name. Don't use math symbols in name!!!! - + zadní_horní_oblouk_boků front_hip_arc Short measurement name. Don't use math symbols in name!!!! - + přední_oblouk_boků back_hip_arc Short measurement name. Don't use math symbols in name!!!! - + zadní_oblouk_boků chest_slope Short measurement name. Don't use math symbols in name!!!! - + sklon_hrudi back_slope Short measurement name. Don't use math symbols in name!!!! - + sklon_zad front_waist_slope Short measurement name. Don't use math symbols in name!!!! - + přední_sklon_pasu back_waist_slope Short measurement name. Don't use math symbols in name!!!! - + zadní_sklon_pasu front_neck_to_upper_chest_height Short measurement name. Don't use math symbols in name!!!! - + přední_výška_od_krku_k_horní_hrudi front_neck_to_bust_height Short measurement name. Don't use math symbols in name!!!! - + přední_výška_od_krku_k_prsům front_waist_to_upper_chest Short measurement name. Don't use math symbols in name!!!! - + přední_od_pasu_k_horní_hrudi front_waist_to_lower_breast Short measurement name. Don't use math symbols in name!!!! - + přední_od_pasu_ke_spodku_prsou back_waist_to_upper_chest Short measurement name. Don't use math symbols in name!!!! - + od_zadního_pasu_k_horní_hrudi strap_length Short measurement name. Don't use math symbols in name!!!! - + délka_řemínku armscye_girth Short measurement name. Don't use math symbols in name!!!! - + obvod_průramku elbow_girth Short measurement name. Don't use math symbols in name!!!! - + obvod_lokte upper_arm_girth Short measurement name. Don't use math symbols in name!!!! - + obvod_paže wrist_girth Short measurement name. Don't use math symbols in name!!!! - + obvod_zápěstí scye_depth Short measurement name. Don't use math symbols in name!!!! - + hloubka_průramku shoulder_and_arm_length Short measurement name. Don't use math symbols in name!!!! - + délka_ramene_a_paže underarm_length Short measurement name. Don't use math symbols in name!!!! - + délka_podpaží cervicale_to_wrist_length @@ -3481,77 +3872,77 @@ Chcete uložit své změny? shoulder_to_elbow_length Short measurement name. Don't use math symbols in name!!!! - + délka_od_ramene_k_lokti arm_length Short measurement name. Don't use math symbols in name!!!! - + délka_paže hand_width Short measurement name. Don't use math symbols in name!!!! - + šířka_ruky hand_length Short measurement name. Don't use math symbols in name!!!! - + délka_ruky hand_girth Short measurement name. Don't use math symbols in name!!!! - + obvod_ruky thigh_girth Short measurement name. Don't use math symbols in name!!!! - + obvod_stehna mid_thigh_girth Short measurement name. Don't use math symbols in name!!!! - + střední_obvod_stehna knee_girth Short measurement name. Don't use math symbols in name!!!! - + obvod_kolene calf_girth Short measurement name. Don't use math symbols in name!!!! - + obvod_lýtka ankle_girth Short measurement name. Don't use math symbols in name!!!! - + obvod_kotníku knee_height Short measurement name. Don't use math symbols in name!!!! - + výška_kolene ankle_height Short measurement name. Don't use math symbols in name!!!! - + výška_kotníku foot_width Short measurement name. Don't use math symbols in name!!!! - + šířka_chodidla foot_length Short measurement name. Don't use math symbols in name!!!! - + délka_chodidla height Short measurement name. Don't use math symbols in name!!!! - + výška cervicale_height @@ -3566,57 +3957,57 @@ Chcete uložit své změny? waist_height Short measurement name. Don't use math symbols in name!!!! - + výška_pasu high_hip_height Short measurement name. Don't use math symbols in name!!!! - + horní_výška_boků hip_height Short measurement name. Don't use math symbols in name!!!! - + výška_boků waist_to_hip_height Short measurement name. Don't use math symbols in name!!!! - + výška_od_pasu_k_bokům waist_to_knee_height Short measurement name. Don't use math symbols in name!!!! - + výška_od_pasu_ke_kolenům crotch_height Short measurement name. Don't use math symbols in name!!!! - + výška_rozkroku size Short measurement name. Don't use math symbols in name!!!! - + velikost height_front_neck_base_point Short measurement name. Don't use math symbols in name!!!! - + výška_předního_základního_bodu_krku height_base_neck_side_point Short measurement name. Don't use math symbols in name!!!! - + výška_bočního_základního_bodu_krku height_shoulder_point Short measurement name. Don't use math symbols in name!!!! - + výška_ramenního_bodu height_nipple_point Short measurement name. Don't use math symbols in name!!!! - + výška_bodu_bradavky height_back_angle_axilla @@ -3626,97 +4017,97 @@ Chcete uložit své změny? height_scapular_point Short measurement name. Don't use math symbols in name!!!! - + výška_skapulárního_bodu height_under_buttock_folds Short measurement name. Don't use math symbols in name!!!! - + výška_pod_hýždní_záhyb hips_excluding_protruding_abdomen Short measurement name. Don't use math symbols in name!!!! - + body_bez_vyčnívajícího_břicha girth_foot_instep Short measurement name. Don't use math symbols in name!!!! - + obvod_nártu side_waist_to_floor Short measurement name. Don't use math symbols in name!!!! - + zboku_od_pasu_k_podlaze front_waist_to_floor Short measurement name. Don't use math symbols in name!!!! - + zepředu_od_pasu_k_podlaze arc_through_groin_area Short measurement name. Don't use math symbols in name!!!! - + oblouk_skrz_třísla waist_to_plane_seat Short measurement name. Don't use math symbols in name!!!! - + od_pasu_k_rovině_sezení neck_to_radial_point Short measurement name. Don't use math symbols in name!!!! - + od_krku_k_radiálnímu_bodu neck_to_third_finger Short measurement name. Don't use math symbols in name!!!! - + od_krku_k_prostředníčku neck_to_first_line_chest_circumference Short measurement name. Don't use math symbols in name!!!! - + od_krku_k_první_linii_obvodu_hrudi front_waist_length Short measurement name. Don't use math symbols in name!!!! - + přední_délka_pasu arc_through_shoulder_joint Short measurement name. Don't use math symbols in name!!!! - + oblouk_skrz_kloub_ramene neck_to_back_line_chest_circumference Short measurement name. Don't use math symbols in name!!!! - + od_krku_k_zadní_linii_obvodu_hrudi waist_to_neck_side Short measurement name. Don't use math symbols in name!!!! - + boční_od_pasu_ke_krku arc_length_upper_body Short measurement name. Don't use math symbols in name!!!! - + délka_oblouku_horní_části_těla chest_width Short measurement name. Don't use math symbols in name!!!! - + šířka_hrudi anteroposterior_diameter_hands Short measurement name. Don't use math symbols in name!!!! - + předozadní_průměr_rukou height_clavicular_point Short measurement name. Don't use math symbols in name!!!! - + výška_klíčního_bodu height_armhole_slash @@ -3731,52 +4122,52 @@ Chcete uložit své změny? half_girth_neck Short measurement name. Don't use math symbols in name!!!! - + půlobvod_krku half_girth_neck_for_shirts Short measurement name. Don't use math symbols in name!!!! - + půlobvod_krku_pro_trička half_girth_chest_first Short measurement name. Don't use math symbols in name!!!! - + půlobvod_hrudi_první half_girth_chest_second Short measurement name. Don't use math symbols in name!!!! - + půlobvod_hrudi_druhý half_girth_chest_third Short measurement name. Don't use math symbols in name!!!! - + půlobvod_hrudi_třetí half_girth_waist Short measurement name. Don't use math symbols in name!!!! - + půlobvod_pasu half_girth_hips_considering_protruding_abdomen Short measurement name. Don't use math symbols in name!!!! - + půlobvod_boků_včetně_vyčnívajícího_bricha half_girth_hips_excluding_protruding_abdomen Short measurement name. Don't use math symbols in name!!!! - + půlobvod_boků_bez_vyčnívajícího_břicha girth_knee_flexed_feet Short measurement name. Don't use math symbols in name!!!! - + obvod_kolene_natažené_nohy neck_transverse_diameter Short measurement name. Don't use math symbols in name!!!! - + příčný_průměr_krku front_slash_shoulder_height @@ -3786,57 +4177,57 @@ Chcete uložit své změny? neck_to_front_waist_line Short measurement name. Don't use math symbols in name!!!! - + od_krku_k_přední_linii_pasu hand_vertical_diameter Short measurement name. Don't use math symbols in name!!!! - + svislý_průměr_ruky neck_to_knee_point Short measurement name. Don't use math symbols in name!!!! - + od_krku_k_bodu_kolene waist_to_knee Short measurement name. Don't use math symbols in name!!!! - + od_pasu_ke_koleni shoulder_height Short measurement name. Don't use math symbols in name!!!! - + výška_ramen head_height Short measurement name. Don't use math symbols in name!!!! - + výška_hlavy body_position Short measurement name. Don't use math symbols in name!!!! - + poloha_těla arc_behind_shoulder_girdle Short measurement name. Don't use math symbols in name!!!! - + oblouk_za_ramenním_pletencem neck_to_neck_base Short measurement name. Don't use math symbols in name!!!! - + základna_od_krku_ke_krku depth_waist_first Short measurement name. Don't use math symbols in name!!!! - + hloubka_pasu_první depth_waist_second Short measurement name. Don't use math symbols in name!!!! - + hloubka_pasu_druhá @@ -3844,87 +4235,87 @@ Chcete uložit své změny? Around fullest part of Head Full measurement description - + Okolo nejplnější části hlavy Around middle part of Neck Full measurement description - + Okolo střední části krku Around Neck at base Full measurement description - + Okolo krku v jeho základně Vertical Distance from Crown to Nape Full measurement description - + Svislá vzdálenost od koruny k šíji Front Neck Center over tape at Bustline to Front Waist Center Full measurement description - + Přední střed krku přes pásku na úrovni prsou po přední střed pasu Back Neck Center to Back Waist Center Full measurement description - + Od zadního středu krku k zadnímu středu pasu NeckPoint to ShoulderTip Full measurement description - + Z bodu krku na vrchol ramene Armpit to Waist side Full measurement description - + Z podpaží k pasu na boku Around Body from middle of Shoulder length to BustPoint to Crotch up back to beginning point Full measurement description - + Kolem těla ze středu délky ramene přes poprsí a rozkrok zpět nahoru do počátečního bodu Around Arms and Torso, at bicep level parallel to floor, with arms hanging at the sides Full measurement description - + Kolem paží a těla, v úrovni bicepsu rovnoběžně s podlahou, s rukama visícíma podél těla Around Chest at Armfold level, will be parallel to floor across back, will not be parallel to floor across front chest Full measurement description - + Kolem hrudi ve výšce založených rukou, bude rovnoběžné s podlahou přes záda, nebude rovnoběžné s podlahou přes přední část hrudi Around fullest part of Bust, parallel to floor Full measurement description - + Přes nejplnější část poprsí, rovnoběžně s podlahou Around Chest below the Bust, parallel to floor Full measurement description - + Přes hruď pod prsy, rovnoběžně s podlahou Tie a string around smallest part of waist, keep string tied while taking meaasurements. Not usually parallel to floor for front waist or back waist. Full measurement description - + Uvažte provázek kolem nejužší části pasu, při měření mějte provázek napnutý. Obvykle není rovnoběžný s podlahou pro přední a zadní části pasu. Around HighHip, parallel to floor Full measurement description - + Kolem horní části boků, rovnoběžně s podlahou Around Hip, parallel to floor Full measurement description - + Kolem boků, rovnoběžně s podlahou Across Front UpperChest, smallest width from armscye to armscye Full measurement description - + Přes přední horní hruď, nejmenší šířka od průramku k průramku Across Front Chest, from armfold to armfold @@ -3944,7 +4335,7 @@ Chcete uložit své změny? Across Back UpperChest, smallest width from armscye to armscye Full measurement description - + Přes horní část zad, nejmenší šířka od průramku k průramku Across Back Chest, from armfold to armfold @@ -3969,52 +4360,52 @@ Chcete uložit své změny? From Front Waist Center, down to crotch, up to Back Waist Center Full measurement description - + Zepředu ze středu pasu, dolů do rozkroku, a nahoru dozadu do středu pasu. Sit on hard chair, measure from side waist straight down to chair bottom Full measurement description - + Sedněte si na židli, měřte ze strany pasu přímo dolů ke spodní části židle Vertical Distance from NeckPoint level to ShoulderTip level Full measurement description - + Svislá vzdálenost z úrovně krčního bodu na úroveň vrcholku ramena Degrees of angle from NeckPoint to ShoulderTip – requires goniometer Full measurement description - + Úhlové stupně od krčního bodu k vrcholu ramene - vyžaduje goniometr ShoulderTip to Front Waist Center Full measurement description - + Od vrcholku ramene ke středu pasu vepředu ShoulderTip to Back Waist Center Full measurement description - + Od vrcholku ramene ke středu pasu vzadu NeckPoint straight down front chest to Waistline Full measurement description - + Od krčního bodu přímo dolů přes hrudník na úroveň pasu Back NeckPoint straight down back chest to Waistline Full measurement description - + Od krčního bodu přímo dolů přes záda na úroveň pasu NeckPoint to NeckPoint through Front Neck Center Full measurement description - + Z krčního bodu do krčního bodu skrz přední střed krku NeckPoint to NeckPoint across Nape Full measurement description - + Z krčního bodu do krčního bodu přes šíji Front upper-bust arc @@ -4484,7 +4875,7 @@ Chcete uložit své změny? Body position Full measurement description - Poloha těla + Poloha těla Arc behind the shoulder girdle @@ -5231,12 +5622,20 @@ Chcete uložit své změny? Individual measurements - Osobité míry + Individuální míry Patterns Střihy + + Standard measurements + + + + Layout + + PatternPage @@ -5287,7 +5686,7 @@ Chcete uložit své změny? QCoreApplication Based on Qt %1 (%2, %3 bit) - + Postaveno na Qt %1 (%2, %3 bit) @@ -5319,12 +5718,16 @@ Chcete uložit své změny? Property The text that appears in the first column header - + Vlastnost Value The text that appears in the second column header - Hodnota + Hodnota + + + px + @@ -5332,182 +5735,182 @@ Chcete uložit své změny? Unexpected token "$TOK$" found at position $POS$. Math parser error messages. Left untouched "$TOK$" and $POS$ - + Nalezen neočekávaný řetězec "$TOK$" na pozici $POS$. Internal error Math parser error messages. - + Vnitřní chyba Invalid function-, variable- or constant name: "$TOK$". Math parser error messages. Left untouched "$TOK$" - + Neplatný název funkce, proměnné nebo konstanty: "$TOK$". Invalid binary operator identifier: "$TOK$". Math parser error messages. Left untouched "$TOK$" - + Neplatný identifikátor binárního operátoru: "$TOK$". Invalid infix operator identifier: "$TOK$". Math parser error messages. Left untouched "$TOK$" - + Neplatný identifikátor zaváděcího operátoru: "$TOK$". Invalid postfix operator identifier: "$TOK$". Math parser error messages. Left untouched "$TOK$" - + Neplatný identifikátor ukončujícího operátoru: "$TOK$". Invalid pointer to callback function. Math parser error messages. - + Neplatný ukazatel na funkci zpětného volání. Expression is empty. Math parser error messages. - + Výraz je prázdný. Invalid pointer to variable. Math parser error messages. - + Neplatný ukazatel na proměnnou. Unexpected operator "$TOK$" found at position $POS$ Math parser error messages. Left untouched "$TOK$" and $POS$ - + Nalezen neočekávaný operátor "$TOK$" na pozici $POS$ Unexpected end of expression at position $POS$ Math parser error messages. Left untouched $POS$ - + Neočekávaný konec výrazu v poloze $POS$ Unexpected argument separator at position $POS$ Math parser error messages. Left untouched $POS$ - + Neočekávaný oddělovač argumentů v poloze $POS$ Unexpected parenthesis "$TOK$" at position $POS$ Math parser error messages. Left untouched "$TOK$" and $POS$ - + Neočekávaná závorka "$TOK$" v poloze $POS$ Unexpected function "$TOK$" at position $POS$ Math parser error messages. Left untouched "$TOK$" and $POS$ - + Neočekávaná funkce "$TOK$" v poloze $POS$ Unexpected value "$TOK$" found at position $POS$ Math parser error messages. Left untouched "$TOK$" and $POS$ - + Nalezena neočekávaná hodnota "$TOK$" v poloze $POS$ Unexpected variable "$TOK$" found at position $POS$ Math parser error messages. Left untouched "$TOK$" and $POS$ - + Nalezena neočekávaná proměnná "$TOK$" v poloze $POS$ Function arguments used without a function (position: $POS$) Math parser error messages. Left untouched $POS$ - + Argumenty funkce použity bez funkce (pozice: $POS$) Missing parenthesis Math parser error messages. - + Chybějící závorka Too many parameters for function "$TOK$" at expression position $POS$ Math parser error messages. Left untouched "$TOK$" and $POS$ - + Příliš mnoho parametrů funkce "$TOK$" ve výrazu v poloze $POS$ Too few parameters for function "$TOK$" at expression position $POS$ Math parser error messages. Left untouched "$TOK$" and $POS$ - + Příliš málo parametrů funkce "$TOK$" ve výrazu v poloze $POS$ Divide by zero Math parser error messages. - + Dělení nulou Domain error Math parser error messages. - + Chyba domény Name conflict Math parser error messages. - + Střet názvu Invalid value for operator priority (must be greater or equal to zero). Math parser error messages. - + Neplatná hodnota pro prioritu operátoru (musí být větší nebo rovný nule). user defined binary operator "$TOK$" conflicts with a built in operator. Math parser error messages. Left untouched "$TOK$" - + uživatelem stanovený binární operátor "$TOK$" je ve střetu s vestavěným operátorem. Unexpected string token found at position $POS$. Math parser error messages. Left untouched $POS$ - + Neočekávaný řetězec textu nalezen v poloze $POS$. Unterminated string starting at position $POS$. Math parser error messages. Left untouched $POS$ - + Neukončený řetězec začínající v poloze $POS$. String function called with a non string type of argument. Math parser error messages. - + Řetězcová funkce volána s argumentem, který není řetězec. String value used where a numerical argument is expected. Math parser error messages. - + Řetězcová hodnota použita tam, kde je očekávaný číselný argument. No suitable overload for operator "$TOK$" at position $POS$. Math parser error messages. Left untouched "$TOK$" and $POS$ - + Žádné vhodné přetížení pro operátor "$TOK$" v poloze $POS$. Function result is a string. Math parser error messages. - + Výsledek funkce je řetězec. Parser error. Math parser error messages. - + Chyba při zpracování. Decimal separator is identic to function argument separator. Math parser error messages. - + Desetinný oddělovač je shodný s oddělovačem argumentů funkcí. If-then-else operator is missing an else clause Math parser error messages. Do not translate operator name. - + V operátoru if-then-else chybí část else Misplaced colon at position $POS$ Math parser error messages. Left untouched $POS$ - + Chybně umístěná dvojtečka v poloze $POS$ The "$TOK$" operator must be preceeded by a closing bracket. Math parser error messages. Left untouched "$TOK$" - + Operátoru "$TOK$" musí předcházet ukončující závorka. @@ -5522,21 +5925,21 @@ Chcete uložit své změny? Standard figures of men 1st group, chest 100 cm Standard table description - + Obvyklá čísla mužů první skupiny, hruď 100 cm SaveDetailOptions Save detail option - Uložit volbu pro detail + Uložit volbu detailu SaveToolOptions Save tool option - Uložit volbu pro nástroj + Uložit volbu nástroje @@ -5559,19 +5962,19 @@ Chcete uložit své změny? Next - Další + Další Next detail - Další detail + Další detail Turn - Otočit + Otočit Turn the detail 90 degrees - Otočit detail o 90 stupňů + Otočit detail o 90 stupňů Stop @@ -5583,23 +5986,23 @@ Chcete uložit své změny? Enlarge letter - Zvětšit list + Zvětšit list Enlarge the length of the sheet - Zvětšit délku listu + Zvětšit délku listu Reduce sheet - Zmenšit list + Zmenšit list Reduce the length of the sheet - Zmenšit velikost listu + Zmenšit délku listu Mirroring - Zrcadlení + Zrcadlení Zoom In @@ -5611,15 +6014,15 @@ Chcete uložit své změny? 0 details left. - Zbylo 0 detailů. + Zbylo 0 detailů. Collisions not found. - Střety nenalezeny. + Kolize nenalezeny. %1 details left. - Zbylo %1 detailů. + Zbylo %1 detailů. untitled @@ -5647,7 +6050,7 @@ Chcete uložit své změny? Collisions found. - Střety nalezeny. + Kolize nalezeny. Creating file '%1' failed! %2 @@ -5655,10 +6058,18 @@ Chcete uložit své změny? Critical error! - Zásadní chyba! + Vážná chyba! Wavefront OBJ (*.obj) + Wavefront OBJ (*.obj) + + + Layout pages + + + + Layout @@ -5666,51 +6077,79 @@ Chcete uložit své změny? VAbstractConverter Error creation backup file: %1. - + Chyba při vytváření záložního souboru: %1. Couldn't get version information. - + Nebylo možné získat informace o verzi. Too many tags <%1> in file. - + Příliš mnoho značek <%1> v souboru. Version "%1" invalid. - + Verze "%1" neplatná. Version "0.0.0" invalid. - + Verze "0.0.0" neplatná. Invalid version. Minimum supported version is %1 - + Neplatná verze. Nejnižší podporovaná verze je %1 Invalid version. Maximum supported version is %1 - + Neplatná verze. Nejvyšší podporovaná verze je %1 Error no unique id. - Chyba. Není jedinečné ID. + Chyba. Žádný jedinečný identifikátor. Could not change version. - + Nebylo možné změnit verzi. VAbstractTool Confirm the deletion. - Potvrdit smazání. + Potvrďte smazání. Do you really want delete? Opravdu chcete smazat? + + black + + + + green + + + + blue + + + + dark red + + + + dark green + + + + dark blue + + + + yellow + + VApplication @@ -5738,14 +6177,6 @@ Chcete uložit své změny? Something's wrong!! Něco je špatně! - - Could not copy temp file to document file - Nepodařilo se zkopírovat dočasný soubor do souboru s dokumentem - - - Could not remove document file - Nepodařilo se odstranit soubor s dokumentem - VContainer @@ -5794,7 +6225,7 @@ Chcete uložit své změny? Could not load schema file. - + Nelze načíst soubor se schématem. Validation error file %3 in line %1 column %2 @@ -5802,7 +6233,7 @@ Chcete uložit své změny? Parsing error file %3 in line %1 column %2 - Chyba při zpracování souboru%3 na řádku %1, ve sloupci %2 + Chyba při zpracování souboru %3 na řádku %1, ve sloupci %2 Couldn't get node @@ -5810,19 +6241,19 @@ Chcete uložit své změny? Got wrong parameter id. Need only id > 0. - Obdrženo špatné ID parametru. Je potřeba jen ID > 0. + Obdržen chybný identifikátor parametru. Vyžaduje pouze identifikátor > 0. This id is not unique. - Toto ID není jedinečné. + Tento identifikátor není jedinečný. Could not copy temp file to document file - Nepodařilo se zkopírovat dočasný soubor do souboru s dokumentem + Nelze kopírovat dočasný soubor do souboru dokumentu. Could not remove document file - Nepodařilo se odstranit soubor s dokumentem + Nelze odstranit soubor dokumentu. @@ -5844,7 +6275,7 @@ Chcete uložit své změny? VException Critical error! - Zásadní chyba! + Vážná chyba! @@ -5869,22 +6300,22 @@ Chcete uložit své změny? VPE::VBoolProperty True - + Pravda False - + Nepravda VPE::VFileEditWidget Directory - + Adresář Open File - + Otevřít soubor @@ -5895,7 +6326,7 @@ Chcete uložit své změny? Error no unique id. - Chyba. Není jedinečné ID. + Chyba. Není jedinečný identifikátor. Error parsing file. @@ -5911,11 +6342,11 @@ Chcete uložit své změny? Error wrong id. - Chyba. Špatné ID. + Chyba. Špatný identifikátor. Critical error! - Zásadní chyba! + Vážná chyba! Error parsing file (std::bad_alloc). @@ -5927,7 +6358,7 @@ Chcete uložit své změny? Error creating or updating single point - Chyba při vytváření nebo aktualizaci základního bodu + Chyba při vytváření nebo aktualizaci jediného bodu Error creating or updating point of end line @@ -5959,7 +6390,7 @@ Chcete uložit své změny? Error creating or updating modeling point - Chyba při vytváření nebo aktualizaci bodu + Chyba při vytváření nebo aktualizaci modelovacího bodu Error creating or updating height @@ -5987,7 +6418,7 @@ Chcete uložit své změny? Error creating or updating point of intersection line and axis - Chyba při vytváření nebo aktualizaci bodu průsečíku křivky a osy + Chyba při vytváření nebo aktualizaci bodu průsečíku křivky a osy Error creating or updating point of intersection curve and axis @@ -5999,7 +6430,7 @@ Chcete uložit své změny? Error creating or updating simple curve - Chyba při vytváření nebo aktualizaci křivky + Chyba při vytváření nebo aktualizaci jednoduché křivky Error creating or updating curve path @@ -6007,32 +6438,24 @@ Chcete uložit své změny? Error creating or updating modeling simple curve - Chyba při vytváření nebo aktualizaci modelové křivky + Chyba při vytváření nebo aktualizaci modelovací jednoduché křivky Error creating or updating modeling curve path - Chyba při vytváření nebo aktualizaci cesty modelové křivky + Chyba při vytváření nebo aktualizaci cesty modelovací křivky Error creating or updating simple arc - Chyba při vytváření nebo aktualizaci oblouku + Chyba při vytváření nebo aktualizaci jednoduchého oblouku Error creating or updating modeling arc - Chyba při vytváření nebo aktualizaci modelového oblouku + Chyba při vytváření nebo aktualizaci modelovacího oblouku Error creating or updating union details Chyba při vytváření nebo aktualizaci detailu spojení - - Got wrong parameter id. Need only id > 0. - Obdrženo špatné ID parametru. Je potřeba jen ID > 0. - - - This id is not unique. - Toto ID není jedinečné. - File error. Chyba souboru. @@ -6042,11 +6465,11 @@ Chcete uložit své změny? VPatternConverter Unexpected version "%1". - + Neočekávaná verze "%1". Error restoring backup file: %1. - + Chyba při obnově záložního souboru: %1. @@ -6068,11 +6491,11 @@ Chcete uložit své změny? VTableGraphicsView can't find detail - Nelze najít detail + nelze najít detail detail found - Detail nalezen + detail nalezen @@ -6094,7 +6517,7 @@ Chcete uložit své změny? Point label - Označení bodu + Štítek bodu Position @@ -6174,11 +6597,11 @@ Chcete uložit své změny? Point at intersection of arc and line - Bod v průsečíku oblouku a čáry. + Bod v průsečíku oblouku a čáry Tool to make point from x & y of two other points - Nástroj na udělání bodu z x a y dvou jiných bodů + Nástroj na vytvoření bodu z x a y dvou jiných bodů Special point on shoulder @@ -6186,7 +6609,7 @@ Chcete uložit své změny? Curve tool - Nástroj na křivku + Nástroj křivky Curve factor @@ -6194,16 +6617,28 @@ Chcete uložit své změny? Tool for path curve - Nástroj pro křivku cesty + Nástroj křivky cesty Tool triangle - Nástroj na trojúhelník + Nástroj trojúhelníku Point intersection line and axis Bod průsečíku oblouku a čáry + + Line color + + + + Color + + + + Point intersection curve and axis + + Variables @@ -6230,39 +6665,39 @@ Chcete uložit své změny? SplPath Do not add symbol _ to the end of name - + Cesta křivky VisToolCurveIntersectAxis <b>Intersection curve and axis</b>: angle = %1°; <b>Shift</b> - sticking angle, <b>Enter</b> - finish creation - + <b>Průnik křivky a osy</b>: úhel = %1°; <b>Shift</b> - přilnutí úhlů, <b>Enter</b> - dokončit vytváření VisToolEndLine <b>Point at distance and angle</b>: angle = %1°; <b>Shift</b> - sticking angle, <b>Enter</b> - finish creation - + <b>Bod ve vzdálenosti a úhlu</b>: úhel = %1°; <b>Shift</b> - přilnutí úhlů, <b>Enter</b> - dokončit vytváření VisToolLineIntersectAxis <b>Intersection line and axis</b>: angle = %1°; <b>Shift</b> - sticking angle, <b>Enter</b> - finish creation - + <b>Průnik čáry a osy</b>: úhel = %1°; <b>Shift</b> - přilnutí úhlů, <b>Enter</b> - dokončit vytváření VisToolSplinePath <b>Curved path</b>: select three or more points - + <b>Cesta křivky</b>: vyberte tři nebo více bodů <b>Curved path</b>: select three or more points, <b>Enter</b> - finish creation - + <b>Cesta křivky</b>: vyberte tři nebo více bodů, <b>Enter</b> - dokončit vytváření @@ -6273,7 +6708,7 @@ Chcete uložit své změny? Pattern file. - Soubor se střihem + Soubor se střihem. diff --git a/share/translations/valentina_de_DE.ts b/share/translations/valentina_de_DE.ts index 509ba8fdb..70df5acd9 100644 --- a/share/translations/valentina_de_DE.ts +++ b/share/translations/valentina_de_DE.ts @@ -41,7 +41,7 @@ Secure connection - sichere Verbindung + Sichere Verbindung Proxy settings @@ -65,7 +65,7 @@ Proxy pass - + Proxy Passwort User settings @@ -73,7 +73,7 @@ User Name - Nutzername + Benutzername Save password @@ -100,42 +100,42 @@ Config Dialog - + Einstellungen Configuration - + Allgemein Pattern - + Schnittmuster Community - + Community Paths - + Verzeichnisse ConfigurationPage Setup user interface language updated and will be used the next time start - + Die Änderung der Spracheinstellung wird erst beim nächsten Programmstart wirksam. Default unit updated and will be used the next pattern creation - + Die Änderung der Standardmaßeinheit wird erst für neu angelegte Schnittmuster-Dateien wirksam Save - Speichern + Speichern Auto-save modified pattern - + Automatisches Speichern min @@ -143,7 +143,7 @@ Interval: - + Interval: Language @@ -155,15 +155,15 @@ Decimal separator parts - + Dezimaltrennzeichen With OS options (%1) - + Nach Sprache des Betriebssystemss (%1) Default unit - + Standard-Maßeinheit Centimeters @@ -171,7 +171,7 @@ Millimiters - + Millimeter Inches @@ -179,33 +179,33 @@ Label language - + Sprache für Label Send crash reports - + Absturzberichte senden Send crash reports (recommended) - + Absturzberichte senden (empfohlen) After each crash Valentina collect information that may help us fix a problem. We do not collect any personal information. Find more about what <a href="https://bitbucket.org/dismine/valentina/wiki/manual/Crash_reports">kind of information</a> we collect. - + Nach jedem Absturz stellt Valentina Informationen zusammen, die helfen können, das Problem zu beheben. Es werden keine persönlichen Daten übertragen. Finde mehr darüber heraus, <a href="https://bitbucket.org/dismine/valentina/wiki/manual/Crash_reports">welche Information</a> übertragen werden. DelTool Delete tool - + Werkzeug löschen DeleteDetail Delete tool - + Werkzeug löschen @@ -229,10 +229,6 @@ Contributors Mitwirkende - - Based on Qt %2 (32 bit) - Basiert auf Qt %2 (32 bit) - Built on %3 at %4 Gebaut auf %3 um %4 @@ -247,18 +243,18 @@ Cannot open your default browser - + Konnte den Standard-Browser nicht starten Build revision: - + Build revision: DialogAlongLine Point along line - Punkt auf einer Linie + Punkt auf einer Linie Length @@ -270,15 +266,15 @@ Calculate value - Wert berechnen + Wert berechnen Value of length - Wert der Länge + Berechnete Länge <html><head/><body><p>Show full calculation in message box</p></body></html> - + <html><head/><body><p>Ganze Berechnungsformel anzeigen</p></body></html> Point label @@ -310,7 +306,7 @@ Input data - Eingabedaten + Eingangsgrößen Size and height @@ -318,7 +314,7 @@ Measurements - Maße + Maße Increments @@ -338,11 +334,11 @@ Angle of lines - + Winkel einer Linie Hide empty measurements - + Unbestückte Größen ausblenden Variables - Click twice to insert into formula @@ -352,6 +348,14 @@ Select second point of line Zweiten Punkt der Linie auswählen + + Point at distance along line + + + + Line color + + DialogArc @@ -369,7 +373,7 @@ Calculate value - Wert berechnen + Wert berechnen Value of radius @@ -377,11 +381,11 @@ <html><head/><body><p>Show full calculation in message box</p></body></html> - + <html><head/><body><p>Ganze Berechnungsformel anzeigen</p></body></html> First angle - + Erster Winkel Insert variable into formula @@ -393,7 +397,7 @@ Second angle - + Zweiter Winkel Insert marked variable into formula @@ -413,7 +417,7 @@ Input data - Eingabedaten + Eingangsgrößen Size and height @@ -421,7 +425,7 @@ Measurements - Maße + Maße Increments @@ -441,11 +445,11 @@ Angle of lines - Linenwinkel + Winkel einer Linie Hide empty measurements - + Unbestückte Größen ausblenden Variables @@ -453,18 +457,22 @@ Value of angle of line. - Wert des Linenwinkels. + Wert des Linenwinkels. Error - Fehler + Fehler Radius can't be negative - + Radius kann nicht negativ sein Angles equal + Beide Winkel sind identisch + + + Color @@ -472,7 +480,7 @@ DialogBisector Bisector - Winkelhalbierende + Winkelhalbierende Length @@ -484,7 +492,7 @@ Calculate value - Wert berechnen + Wert berechnen Value of length @@ -492,7 +500,7 @@ <html><head/><body><p>Show full calculation in message box</p></body></html> - + <html><head/><body><p>Ganze Berechnungsformel anzeigen</p></body></html> Point label @@ -532,7 +540,7 @@ Input data - Eingabedaten + Eingangsgrößen Size and height @@ -540,7 +548,7 @@ Measurements - Maße + Maße Increments @@ -560,11 +568,11 @@ Angle of lines - + Winkel einer Linie Hide empty measurements - + Unbestückte Größen ausblenden Variables - Click twice to insert into formula @@ -576,141 +584,62 @@ Select third point of angle - zweiten Punkt auf dem zweiten Schenkel wählen + Zweiten Punkt auf dem zweiten Schenkel wählen + + + Point along bisector + Punkt entlang einer Winkelhalbierenden + + + Line color + DialogCurveIntersectAxis Curve intersect axis - + Laufender Schnittpunkt auf Kurve Angle - + Winkel Calculate value - Wert berechnen + Wert berechnen Value of angle - + Berecheter Winkel <html><head/><body><p>Show full calculation in message box</p></body></html> - + <html><head/><body><p>Ganze Berechnungsformel anzeigen</p></body></html> Axis point - - - - First point of line - Erster Punkt der Linie + Punkt der Schnittachse Curve - Kurve - - - Point label - Bezeichnung des Punktes - - - Type of line - Linientyp - - - Show line from first point to this point - Linie vom ersten zu diesem Punkt zeigen - - - Input data - Eingabedaten - - - Size and height - Konfektion und Größe - - - Measurements - Maße - - - Increments - weitere Maße - - - Length of lines - - - - Length of arcs - - - - Length of curves - - - - Angle of lines - - - - Hide empty measurements - - - - Variables - Variablen - - - Select axis point - - - - - DialogCutArc - - Cut arc - - - - Length - Länge - - - Calculate value - Wert berechnen - - - Value of length - Wert der Länge - - - _ - - - - <html><head/><body><p>Show full calculation in message box</p></body></html> - - - - Arc - Bogen - - - Selected curve - Ausgewählte Kurve + Kurve Point label Bezeichnung des Punktes + + Type of line + Linientyp + + + Show line from first point to this point + Verbindungslinie bis zum Schnittpunkt wird mit angegebenem Stil gezeichnet + Input data - Eingabedaten + Eingangsgrößen Size and height @@ -718,7 +647,102 @@ Measurements - Maße + Maße + + + Increments + Weitere Maße + + + Length of lines + Linienlängen + + + Length of arcs + Bogenlängen + + + Length of curves + Kurvenlängen + + + Angle of lines + Winkel einer Linie + + + Hide empty measurements + Unbestückte Größen ausblenden + + + Variables + Variablen + + + Select axis point + Ausgangspunkt für Schnittachse auswählen + + + Point intersect curve and axis + + + + Axis Point + + + + Line color + + + + + DialogCutArc + + Cut arc + Kreisbogen + + + Length + Länge + + + Calculate value + Wert berechnen + + + Value of length + Wert der Länge + + + _ + _ + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + <html><head/><body><p>Ganze Berechnungsformel anzeigen</p></body></html> + + + Arc + Bogen + + + Selected curve + Ausgewählte Kurve + + + Point label + Bezeichnung des Punktes + + + Input data + Eingangsgrößen + + + Size and height + Konfektion und Größe + + + Measurements + Maße Increments @@ -738,22 +762,34 @@ Angle of lines - + Winkel einer Linie Hide empty measurements - + Unbestückte Größen ausblenden Variables - Click twice to insert into formula Variablen - Doppelklick fügt die Variable in die Formel ein + + Segment an arc + + + + Selected arc + + + + Color + + DialogCutSpline Cut curve - + Kurvensegment Length @@ -761,19 +797,19 @@ Calculate value - Wert berechnen + Wert berechnen Value of length - Wert der Länge + Berechnete Länge _ - + _ <html><head/><body><p>Show full calculation in message box</p></body></html> - + <html><head/><body><p>Ganze Berechnungsformel anzeigen</p></body></html> Curve @@ -789,7 +825,7 @@ Input data - Eingabedaten + Eingangsgrößen Size and height @@ -797,7 +833,7 @@ Measurements - Maße + Maße Increments @@ -817,22 +853,30 @@ Angle of lines - + Winkel einer Linie Hide empty measurements - + Unbestückte Größen ausblenden Variables - Click twice to insert into formula Variablen - Doppelklick fügt die Variable in die Formel ein + + Segmenting a simple curve + + + + Color + + DialogCutSplinePath Cut curve path - + Pfadsegment Length @@ -840,7 +884,7 @@ Calculate value - Wert berechnen + Wert berechnen Value of length @@ -848,11 +892,11 @@ _ - + _ <html><head/><body><p>Show full calculation in message box</p></body></html> - + <html><head/><body><p>Ganze Berechnungsformel anzeigen</p></body></html> Curve @@ -868,7 +912,7 @@ Input data - Eingabedaten + Eingangsgrößen Size and height @@ -876,7 +920,7 @@ Measurements - Maße + Maße Increments @@ -896,16 +940,24 @@ Angle of lines - + Winkel einer Linie Hide empty measurements - + Unbestückte Größen ausblenden Variables - Click twice to insert into formula Variablen - Doppelklick fügt die Variable in die Formel ein + + Segment a curved path + + + + Color + + DialogDetail @@ -919,7 +971,7 @@ cm - cm + cm Bias Y @@ -931,7 +983,7 @@ Name of detail - Name des Deails + Name des Details Seam allowance @@ -955,6 +1007,10 @@ Reverse + Umkehren + + + Seam allowance tool @@ -962,11 +1018,11 @@ DialogEditWrongFormula Edit formula - + Formel bearbeiten Formula - + Formel Insert variable into formula @@ -974,7 +1030,7 @@ Calculate value - Wert berechnen + Wert berechnen Value of first angle @@ -982,7 +1038,7 @@ _ - + _ <html><head/><body><p>Show full calculation in message box</p></body></html> @@ -990,7 +1046,7 @@ Input data - Eingabedaten + Eingangsgrößen Size and height @@ -998,31 +1054,31 @@ Measurements - Maße + Maße Increments - weitere Maße + Weitere Maße Length of lines - Linienlänge + Linienlängen Length of arcs - Bogenlänge + Bogenlängen Length of curves - Kurvenlänge + Kurvenlängen Angle of lines - Winkel der Linien + Winkel einer Linie Hide empty measurements - + Unbestückte Größen ausblenden Variables @@ -1033,7 +1089,7 @@ DialogEndLine Point in the end of a line - Punkt am Ende einer Linie + Punkt mit Abstand und Winkel Length @@ -1041,7 +1097,7 @@ Calculate value - Wert berechnen + Wert berechnen Value of length @@ -1049,15 +1105,15 @@ <html><head/><body><p>Show full calculation in message box</p></body></html> - + <html><head/><body><p>Ganze Berechnungsformel anzeigen</p></body></html> Angle - + Winkel Value of angle - + Berechneter Winkel Base point @@ -1081,7 +1137,7 @@ Input data - Eingabedaten + Eingangsgrößen Size and height @@ -1089,7 +1145,7 @@ Measurements - Maße + Maße Increments @@ -1109,23 +1165,27 @@ Angle of lines - + Winkel einer Linie Hide empty measurements - + Unbestückte Größen ausblenden Variables - Variablen + Variablen + + + Point at distance and angle + Punkt mit Abstand und Winkel + + + Line color + DialogHeight - - Height - Größe - Point label Bezeichnung des Punktes @@ -1148,7 +1208,7 @@ Show line from first point to our point - Zeige linie vom ersten punkt zu diesem Punkt + Verbindungslinie bis zum Schnittpunkt wird mit angegebenem Stil gezeichnet Select first point of line @@ -1158,6 +1218,18 @@ Select second point of line Zweiten Punkt der Linie auswählen + + Perpendicular point along line + + + + Base Point + + + + Line color + + DialogHistory @@ -1171,7 +1243,7 @@ Can't create record. - + Konnte Eintrag nicht anlegen. %1 - Base point @@ -1215,7 +1287,7 @@ %4 - point of contact of arc with the center in point %1 and line %2_%3 - %4 - Kontaktpunkt von Bogen und dem Mittelpunkt von Punkt %1 und Linie %2_%3 + %4 - Schmittpunkt von Bogen mit Mittelpunkt %1 und Linie %2_%3 Point of perpendicular from point %1 to line %2_%3 @@ -1231,23 +1303,23 @@ %1 - cut arc with center %2 - %1 - Bogen mit Zentrum %2 schneiden + %1 - Kreisbogen mit Zentrum %2 %1 - cut curve %2_%3 - %1 - schneide Kurve %2_%3 + %1 - Kurvensegment %2_%3 %1 - cut curve path %2 - + %1 - Pfadsegment %2 %1 - point of intersection line %2_%3 and axis through point %4 - + %1 - Laufender Punkt auf Linie %2_%3 ausgehend von Punkt %4 %1 - point of intersection curve and axis through point %2 - + %1 - Laufender Punkt auf Kurve ausgehend von Punkt %2 @@ -1258,39 +1330,39 @@ Measurements - Maße + Maße Load another measurements table - + Eine andere Maßtabelle laden Personal information - + Persönliche Informationen Given name - + Vorname Family name - + Nachname Birth date - + Geburtsdatum Sex - + Geschlecht Email - + Email Hide empty measurements - + Unbestückte Größen ausblenden Name @@ -1358,23 +1430,23 @@ Could not save GivenName - + Vorname konnte nicht gespeichert werden Could not save FamilyName - + Nachname konnte nicht gespeichert werden Could not save Email - + Emailadresse konnte nicht gespeichert werden Could not save Sex - + Geschlecht konnte nicht gespeichert werden Could not save BirthDate - + Geburtsdatum konnte nicht gespeichert werden Measurements use different units than pattern. This pattern required measurements in %1 @@ -1402,6 +1474,22 @@ Can't save measurement + Maß kann nicht gespeichert werden + + + Tables of Variables + + + + Base size: %1 %3; Base height: %2 %3 + + + + Description: "%1" + + + + Data successfully saved. @@ -1413,11 +1501,11 @@ Pattern piece name - Schnittteilname + Name des Schnittteils Exist measurements - + Vorhandene Maßtabelle Path: @@ -1449,7 +1537,7 @@ File error. - Datei Fehler. + Dateifehler. Individual measurements (*.vit) @@ -1461,26 +1549,136 @@ Where save measurements? - + Verzeichnis auswählen Centimeters - Zentimeter + Zentimeter Millimiters - + Millimeter Inches Zoll + + DialogLayoutProgress + + Creation a layout + + + + <html><head/><body><p>Finding best position for worpieces. Please, waite.</p></body></html> + + + + Couldn't prepare data for creation layout + + + + Critical error + + + + Wrong paper size + + + + Several workpieces left not arranged, but none of them match for paper + + + + + DialogLayoutSettings + + Creation a layout + + + + Paper size + + + + Templates: + + + + Width: + + + + Height: + + + + ... + ... + + + Rotate workpiece + + + + Rotate by + + + + degree + + + + Creation options + + + + Layout width: + + + + Shift length: + + + + Principle of choosing the next workpiece + + + + Three groups: big, middle, small + + + + Two groups: big, small + + + + Descending area + + + + Millimiters + Millimeter + + + Centimeters + Zentimeter + + + Inches + Zoll + + + Pixels + + + DialogLine Line - Linie + Linie First point @@ -1502,12 +1700,20 @@ Select second point Wähle zweiten Punkt + + Line between points + Verbindungslinie zwischen zwei Punkten + + + Line color + + DialogLineIntersect Intersection of lines - Schnittpunkt von Linien + Schnittpunkt von Linien Point label @@ -1541,103 +1747,123 @@ Select second point of second line Zweiten Punkt der zweiten Linie auswählen + + Point at line intersection + + DialogLineIntersectAxis Line intersect axis - + Laufender Schnittpunkt auf Linie Angle - + Winkel Calculate value - Wert berechnen + Wert berechnen Value of angle - + Berechneter Winkel <html><head/><body><p>Show full calculation in message box</p></body></html> - + <html><head/><body><p>Ganze Berechnungsformel anzeigen</p></body></html> Axis point - + Punkt der Schnittachse First point of line - Erster Punkt der Linie + Erster Punkt der Linie First line point - + Punkt 1 der Linie Second line point - + Punkt 2 der Linie Point label - Bezeichnung des Punktes + Bezeichnung des Punktes Type of line - Linientyp + Linientyp Show line from first point to this point - Linie vom ersten zu diesem Punkt zeigen + Verbindungslinie bis zum Schnittpunkt wird mit angegebenem Stil gezeichnet Input data - Eingabedaten + Eingangsgrößen Size and height - Konfektion und Größe + Konfektion und Größe Measurements - Maße + Maße Increments - weitere Maße + Weitere Maße Length of lines - + Linienlängen Length of arcs - + Bogenlängen Length of curves - + Kurvenlängen Angle of lines - + Winkel einer Linie Hide empty measurements - + Unbestückte Größen ausblenden Variables - Variablen + Variablen Select second point of line - Zweiten Punkt der Linie auswählen + Zweiten Punkt der Linie auswählen Select axis point + Ausgangspunkt für Schnittachse auswählen + + + Point intersect line and axis + + + + Axis Point + + + + Second point of line + Zweiter Punkt der Linie + + + Line color @@ -1672,7 +1898,7 @@ DialogNormal Normal - Normale + Normale Length @@ -1684,7 +1910,7 @@ Calculate value - Wert berechnen + Wert berechnen Value of length @@ -1720,7 +1946,7 @@ Input data - Eingabedaten + Eingangsgrößen Size and height @@ -1728,7 +1954,7 @@ Measurements - Maße + Maße Increments @@ -1748,11 +1974,11 @@ Angle of lines - + Winkel einer Linie Hide empty measurements - + Unbestückte Größen ausblenden Variables - Click twice to insert into formula @@ -1762,6 +1988,22 @@ Select second point of line Zweiten Punkt der Linie auswählen + + Point along perpendicular + Punkt auf einer Normalen + + + First point of line + Erster Punkt der Linie + + + Second point of line + Zweiter Punkt der Linie + + + Line color + + DialogPatternProperties @@ -1771,7 +2013,7 @@ Description - Beschreibung + Beschreibung Author name @@ -1830,7 +2072,7 @@ Remove attribute - + Attribut entfernen Remove node @@ -1937,7 +2179,7 @@ DialogPointOfContact Point of contact - Kontaktpunkt + Kontaktpunkt Radius @@ -1949,7 +2191,7 @@ Calculate value - Wert berechnen + Wert berechnen Value of radius @@ -1981,7 +2223,7 @@ Input data - Eingabedaten + Eingangsgrößen Size and height @@ -1989,7 +2231,7 @@ Measurements - Maße + Maße Increments @@ -2009,11 +2251,11 @@ Angle of lines - + Winkel einer Linie Hide empty measurements - + Unbestückte Größen ausblenden Variables - Click twice to insert into formula. @@ -2023,12 +2265,16 @@ Select second point of line Zweiten Punkt der Linie auswählen + + Point at intersection of arc and line + Laufender Schnittpunkt auf Kreisbogen + DialogPointOfIntersection Point of intersection - + Punkt aus Koordinaten Point label @@ -2036,7 +2282,7 @@ vertical point - vertikaler Punkt + vertikaler Punkt First point of angle @@ -2044,7 +2290,7 @@ horizontal point - horizontaler Punkt + horizontaler Punkt Second point of angle @@ -2052,14 +2298,30 @@ Select point horizontally - Wähle Punkt horizontal + Wähle Punkt horizontal + + + Point from X and Y of two other points + + + + X: vertical point + + + + Y: horizontal point + + + + Select point for Y value (horizontal) + DialogShoulderPoint Point of shoulder - Schulterpunkt + Spezieller Punkt an der Schulter Length @@ -2071,7 +2333,7 @@ Calculate value - Wert berechnen + Wert berechnen Value of length @@ -2079,7 +2341,7 @@ <html><head/><body><p>Show full calculation in message box</p></body></html> - + <html><head/><body><p>Ganze Berechnungsformel anzeigen</p></body></html> Point label @@ -2095,7 +2357,7 @@ Third point - Punkt der zweiten Scheitelgeraden + Dritter Punkt Type of line @@ -2107,7 +2369,7 @@ Input data - Eingabedaten + Eingangsgrößen Size and height @@ -2115,7 +2377,7 @@ Measurements - Maße + Maße Increments @@ -2127,7 +2389,7 @@ Length of arcs - + Bogenlängen Length of curves @@ -2135,11 +2397,11 @@ Angle of lines - + Winkel einer Linie Hide empty measurements - + Unbestückte Größen ausblenden Variables - Click twice to insert into formula @@ -2147,12 +2409,20 @@ Select first point of line - Ersten Punkt der Linie auswählen + Ersten Punkt der Linie auswählen Select second point of line Zweiten Punkt der Linie auswählen + + Special point on shoulder + Spezieller Punkt an der Schulter + + + Line color + + DialogSinglePoint @@ -2185,7 +2455,7 @@ DialogSpline Curve - Kurve + Kurve First point @@ -2219,12 +2489,20 @@ Select last point of curve Letzten Punkt auf der Kurve auswählen + + Simple curve + + + + Color + + DialogSplinePath Curved path - + Pfad Point of curve @@ -2258,6 +2536,10 @@ Select point of curve path Punkt für den Kurvenpfad auswählen + + Color + + DialogStandardMeasurements @@ -2267,7 +2549,7 @@ Pattern piece name - Schnittteilname + Name des Schnittteils Standard measurements table @@ -2275,7 +2557,7 @@ File error. - + Dateifehler. @@ -2286,15 +2568,15 @@ Empty field - + Leeres Eingabefeld Value can't be 0 - + Wert kann nicht 0 sein Value - + Berechneter Wert Height @@ -2318,6 +2600,10 @@ Parser error: %1 + Auswertungsfehler: %1 + + + Line Angle @@ -2325,7 +2611,7 @@ DialogTriangle Triangle - + Dreieck Point label @@ -2363,35 +2649,51 @@ Select second point Zweiten Punkt wählen + + Triangle tool + + + + First point of the axis + + + + Second point of the axis + + + + Second point of line + Zweiter Punkt der Linie + DialogUndo Broken formula - + Ungültige Formel Error while calculation formula. You can try undo last operation or fix broken formula. - + Fehler beim Berechnen der Formel. Machen sie den letzten Schritt rückgängig oder korrigieren sie die Formel. &Undo - + &Rückgängig &Fix formula - + &Formel korrigieren &Cancel - &Abbrechen + &Abbrechen DialogUnionDetails Union details - Details vereinigen + Details vereinigen <html><head/><body><p>Do you really want union details?</p></body></html> @@ -2413,133 +2715,137 @@ Select detail Detail auswählen + + Union tool + + Functions sin sine function - + sin cos cosine function - + cos tan tangens function - + tan asin arcus sine function - + asin acos arcus cosine function - + acos atan arcus tangens function - + atan sinh hyperbolic sine function - + sinh cosh hyperbolic cosine - + cosh tanh hyperbolic tangens function - + tanh asinh hyperbolic arcus sine function - + asinh acosh hyperbolic arcus tangens function - + acosh atanh hyperbolic arcur tangens function - + atanh log2 logarithm to the base 2 - + log2 log10 logarithm to the base 10 - + log10 log logarithm to the base 10 - + log ln logarithm to base e (2.71828...) - + ln exp e raised to the power of x - + exp sqrt square root of a value - + sqrt sign sign function -1 if x<0; 1 if x>0 - + sign rint round to nearest integer - + rint abs absolute value - + abs min min of all arguments - min + min max max of all arguments - + max sum sum of all arguments - + sum avg mean value of all arguments - + avg @@ -2569,11 +2875,11 @@ Special point on shoulder. - Spezieller Punkt an einer Schulter + Spezieller Punkt an der Schulter. Tool triangle. - Werkzeug Dreieck. + Werkzeug Dreieck. Perpendicular point along line @@ -2581,19 +2887,19 @@ Point along bisector - Punkt auf einer Winkelhalbierenden + Punkt entlang einer Winkelhalbierenden Point at intersection of arc and line. - Schnittpunkt eines Bogens und einer Linie + Schnittpunkt eines Bogens und einer Linie. Tool to make point from x & y of two other points. - Werkzeug zum Erstellen eines Punktes aus den x- und y-Koordinaten zweier anderer Punkte. + Werkzeug zum Erstellen eines Punktes aus den x- und y-Koordinaten zweier anderer Punkte. Point at distance and angle - Punkt in einer Distanz und mit einem Winkel + Punkt mit Abstand und Winkel Point at distance along line @@ -2601,11 +2907,11 @@ Point of intersection line and axis - + Laufender Schnittpunkt auf Linie ... - + ... Tools for creating lines. @@ -2617,7 +2923,7 @@ Line between points - Linie zwischen Punkten + Verbindungslinie zwischen zwei Punkten Point at line intersection @@ -2633,23 +2939,23 @@ Curve tool. - Kurvenverkzeug. + Kurvenverkzeug. Tool for path curve. - Werkzeug zur Definition einer Kurve. + Pfad-Werkzeug. Tool for segmenting a curve. - Werkzeug zur Kurvensegmentierung. + Werkzeug zur Kurvensegmentierung. Tool segment a pathed curve. - Werkzeug zum Segmentieren einer definierten Kurve + Werkzeug zur Pfadsegmentierung. Tools for creating arcs. - Werkzeuge zur Kurvenerzeugung. + Werkzeuge zur Bogenerzeugung. Arc @@ -2657,11 +2963,11 @@ Arc tool. - Bogenwerkzeug. + Bogenwerkzeug. Cut arc tool. - + Kreisbogenwerkzeug. Tools for creating details. @@ -2673,55 +2979,55 @@ Tool new detail. - Werkzeug neues Detail. + Werkzeug neues Detail. Tool for union two details. - + Werkzeug zum zusammenfügen zweier Details. &File - + &Datei &Help - + &Hilfe &Pattern piece - + &Schnittteil Measurements - Maße + Maße Window - + Fenster Toolbar files - + Toolbar Datei ToolBar modes - + Toolbar Modus Toolbar pattern - + ToolbarSchnittmuster Toolbar options - + Toolbar Optionen Toolbar tools - + Toolbar Werkzeuge Tool options - + Werkzeugeinstellungen New @@ -2769,7 +3075,7 @@ Save &As... - + Speichern &unter... Save not yet saved pattern @@ -2821,7 +3127,7 @@ Change the label of pattern piece - Das Label eines Schnittteils ändern + Label des Schnittteils ändern Table of variables @@ -2845,7 +3151,7 @@ Export pattern (layout) - + Schnittmuster-Layout exportieren... Create layout @@ -2857,7 +3163,7 @@ About &Qt - + Über &Qt &About Valentina @@ -2865,11 +3171,11 @@ E&xit - + Valentina &beenden Exit the application - + Programm beenden Ctrl+Q @@ -2877,7 +3183,7 @@ Preferences - + Einstellungen Pattern properties @@ -2885,63 +3191,63 @@ Zoom in - + Vergrößern zoom in - + Vergrößern Zoom out - + Verkleinern Edit pattern XML code - + XML-Darstellung des Schnittmusters bearbeiten Original zoom - + Originialgröße Original Zoom - + Originialgröße Zoom fit best - + In Ansicht einpassen Ctrl+= - + Ctrl+= Stop - Stop + Stop Stop using tool - + Aktives Werkzeug beenden Repot Bug... - + Programmfehler melden... Report bug - + Programmfehler melden Close window - + Fenster schließen Online help - + Onlinehilfe Show online help - + Onlinehilfe anzeigen Pattern piece %1 @@ -2949,12 +3255,12 @@ Individual measurements is under development - + Individuelle Maße befindet sich noch in Entwicklung There is no way create individual measurements file independent on the pattern file. For opening pattern need keep both files: pattern and measurements. Do you want continue? - + Es gibt aktuell noch keine Möglichkeit, individuelle Körpermaße mit in der Schnittmusterdatei abzuspeichern. Um das Schnittmuster später erfolgreich wieder laden zu können muss zusätzlich die Datei mit den individuellen Maßen bereitgehalten werden. Fortfahren? Select point @@ -3008,21 +3314,17 @@ For opening pattern need keep both files: pattern and measurements. Do you want Select first point of axis Ersten Punkt der Achse auswählen - - Select point vertically - - Select detail Detail auswählen Select arc - + Bogen auswählen Select curve - + Kurve auswählen About Qt @@ -3058,7 +3360,7 @@ For opening pattern need keep both files: pattern and measurements. Do you want Could not save file - + Datei konnte nicht gespeichert werden Open file @@ -3082,15 +3384,15 @@ For opening pattern need keep both files: pattern and measurements. Do you want Critical error! - + Schwerwiegender Fehler! Error parsing file (std::bad_alloc). - + Fehler beim Auswerten der Datei (std::bad_alloc). Bad id. - + Ungültige ID. File saved @@ -3112,7 +3414,7 @@ Sollen die Änderungen gespeichert werden? &Undo - + &Rückgängig &Redo @@ -3124,11 +3426,11 @@ Sollen die Änderungen gespeichert werden? Enter a new label for the pattern piece. - Es muss ein neues Label für das Schnittteil eingegeben werden. + Neues Label für das Schnittteil eingeben. This file already opened in another window. - + Diese Datei ist bereits geöffnet. Wrong units. @@ -3136,7 +3438,7 @@ Sollen die Änderungen gespeichert werden? Application doesn't support standard table with inches. - + Die Anwendung unterstützt keine Standard-Maßtabellen mit Größen in Zoll. File error. @@ -3144,31 +3446,107 @@ Sollen die Änderungen gespeichert werden? File loaded - + Datei geladen Valentina didn't shut down correctly. Do you want reopen files (%1) you had open? - + Valentina wurde nicht korrekt beendet. Zuletzt geöffnete Dateien (%1) laden? Reopen files. - + Zuletzt geöffnete Dateien laden? The measurements file <br/><br/> <b>%1</b> <br/><br/> %3 - + Die Maßangaben-Datei <br/><br/> <b>%1</b> <br/><br/> %3 could not be found. Do you want to update the file location - + konnte nicht gefunden werden. Soll der Dateipfad aktualisiert werden? Standard measurements (*.vst) - Standardmaße (*.vst) + Standardmaße (*.vst) Individual measurements (*.vit) - Individuelle Maße (*.vit) + Individuelle Maße (*.vit) + + + Special point on shoulder + Spezieller Punkt an der Schulter + + + Triangle tool + + + + Point at intersection of arc and line + Laufender Schnittpunkt auf Kreisbogen + + + Point from X and Y of two other points + + + + Point intersect line and axis + + + + Simple curve + + + + Curved path + Pfad + + + Segmenting a simple curve + + + + Segment a curved path + + + + Point intersect curve and axis + + + + Segment an arc + + + + Point intersect arc and axis + + + + Seam allowance tool + + + + Union tool + + + + toolBar + Werkzeugleiste + + + Last Tool + + + + Activate last used tool again + + + + L + + + + Select point for X value (vertical) + @@ -3176,7 +3554,7 @@ Sollen die Änderungen gespeichert werden? head_girth Short measurement name. Don't use math symbols in name!!!! - + kopf_umfang mid_neck_girth @@ -3186,7 +3564,7 @@ Sollen die Änderungen gespeichert werden? neck_base_girth Short measurement name. Don't use math symbols in name!!!! - + hals_umfang head_and_neck_length @@ -3231,7 +3609,7 @@ Sollen die Änderungen gespeichert werden? bust_girth Short measurement name. Don't use math symbols in name!!!! - + brust_umfang under_bust_girth @@ -3241,7 +3619,7 @@ Sollen die Änderungen gespeichert werden? waist_girth Short measurement name. Don't use math symbols in name!!!! - + taillen_umfang high_hip_girth @@ -3251,7 +3629,7 @@ Sollen die Änderungen gespeichert werden? hip_girth Short measurement name. Don't use math symbols in name!!!! - + hüft_umfang upper_front_chest_width @@ -3281,7 +3659,7 @@ Sollen die Änderungen gespeichert werden? back_width Short measurement name. Don't use math symbols in name!!!! - + ruecken_breite bustpoint_to_bustpoint @@ -3301,12 +3679,12 @@ Sollen die Änderungen gespeichert werden? crotch_length Short measurement name. Don't use math symbols in name!!!! - + taille_schritt_taille rise_height Short measurement name. Don't use math symbols in name!!!! - + leib_höhe shoulder_drop @@ -3451,12 +3829,12 @@ Sollen die Änderungen gespeichert werden? upper_arm_girth Short measurement name. Don't use math symbols in name!!!! - + oberarm_umfang wrist_girth Short measurement name. Don't use math symbols in name!!!! - + handgelenk_umfang scye_depth @@ -3486,7 +3864,7 @@ Sollen die Änderungen gespeichert werden? arm_length Short measurement name. Don't use math symbols in name!!!! - + arm_länge hand_width @@ -3501,12 +3879,12 @@ Sollen die Änderungen gespeichert werden? hand_girth Short measurement name. Don't use math symbols in name!!!! - + hand_umfang thigh_girth Short measurement name. Don't use math symbols in name!!!! - + oberschenkel_umfang mid_thigh_girth @@ -3516,17 +3894,17 @@ Sollen die Änderungen gespeichert werden? knee_girth Short measurement name. Don't use math symbols in name!!!! - + knie_umfang calf_girth Short measurement name. Don't use math symbols in name!!!! - + waden_umfang ankle_girth Short measurement name. Don't use math symbols in name!!!! - + knöchel_umfang knee_height @@ -3576,7 +3954,7 @@ Sollen die Änderungen gespeichert werden? hip_height Short measurement name. Don't use math symbols in name!!!! - + hüft_höhe waist_to_hip_height @@ -3591,7 +3969,7 @@ Sollen die Änderungen gespeichert werden? crotch_height Short measurement name. Don't use math symbols in name!!!! - + schritt_laenge size @@ -3681,7 +4059,7 @@ Sollen die Änderungen gespeichert werden? front_waist_length Short measurement name. Don't use math symbols in name!!!! - + vordere_taillen_laenge arc_through_shoulder_joint @@ -3854,7 +4232,7 @@ Sollen die Änderungen gespeichert werden? Around Neck at base Full measurement description - + Halsumfang am Halsansatz gemessen Vertical Distance from Crown to Nape @@ -3899,7 +4277,7 @@ Sollen die Änderungen gespeichert werden? Around fullest part of Bust, parallel to floor Full measurement description - + Auch: Oberweite. Um die stärkste Brustpartie gemessen, parallel zum Boden. Around Chest below the Bust, parallel to floor @@ -3919,7 +4297,7 @@ Sollen die Änderungen gespeichert werden? Around Hip, parallel to floor Full measurement description - + Die kräftigste Hüftpartie, parallel zum Boden gemessen Across Front UpperChest, smallest width from armscye to armscye @@ -3949,7 +4327,7 @@ Sollen die Änderungen gespeichert werden? Across Back Chest, from armfold to armfold Full measurement description - + Waagerecht von Armansatz zu Armansatz messen. Wichtig: eine lockere, aufrechte Haltung. Distance between BustPoints, across Chest @@ -3969,12 +4347,12 @@ Sollen die Änderungen gespeichert werden? From Front Waist Center, down to crotch, up to Back Waist Center Full measurement description - + Von vorne ab der unteren Kante des fixierten Taillenbandes bis hinten zur unteren Kante des Taillenbandesge messen. Dabei das Maßband zwischen den Beinen durchführen und eng am Körper messen Sit on hard chair, measure from side waist straight down to chair bottom Full measurement description - + Auf einem harten Untergrund sitzend seitlich von Taille senkrecht abwärts zum Sitzhöcker gemessen. Vertical Distance from NeckPoint level to ShoulderTip level @@ -4119,7 +4497,7 @@ Sollen die Änderungen gespeichert werden? Around UpperArm Full measurement description - + Um die stärkste Partie des Oberarms gemessen. Den stärkeren Arm angeben. Around Wrist @@ -4154,7 +4532,7 @@ Sollen die Änderungen gespeichert werden? ShoulderTip to Wrist, with elbow bent and hand on hip Full measurement description - + Vom Schulteransatz bis zum Handgelenk, Ellenbogen angewinkelt und Hand auf der Hüfte Hand side to side @@ -4174,7 +4552,7 @@ Sollen die Änderungen gespeichert werden? Around Thigh Full measurement description - + Um die kräftigeste Oberschenkelpartie gemessen Around MidThigh @@ -4189,7 +4567,7 @@ Sollen die Änderungen gespeichert werden? Around Calf Full measurement description - + Um die kräftigste Wadenpartie gemessen Around Ankle @@ -4259,7 +4637,7 @@ Sollen die Änderungen gespeichert werden? Crotch to Floor along inside leg Full measurement description - + Vom Schritt innen bis zum Boden gemessen Size @@ -4349,7 +4727,7 @@ Sollen die Änderungen gespeichert werden? The distance from the base of the neck to the waist side front (waist length in the front) Full measurement description - + Gemessen vom seitlichen Halsansatz über die Brustspitze bis zur Unterkante des Taillenbandes Arc through the highest point of the shoulder joint @@ -4512,7 +4890,7 @@ Sollen die Änderungen gespeichert werden? Head girth Full measurement name - + Kopfumfang Mid-neck girth @@ -4567,7 +4945,7 @@ Sollen die Änderungen gespeichert werden? Bust girth Full measurement name - + Brustumfang Under Bust girth @@ -4577,7 +4955,7 @@ Sollen die Änderungen gespeichert werden? Waist girth Full measurement name - + Taillenunfang HighHip girth @@ -4587,7 +4965,7 @@ Sollen die Änderungen gespeichert werden? Hip girth Full measurement name - + Hüftumfang Front Upper Chest width @@ -4617,7 +4995,7 @@ Sollen die Änderungen gespeichert werden? Back Chest width Full measurement name - + Rückenbreite BustPoint to BustPoint @@ -4637,12 +5015,12 @@ Sollen die Änderungen gespeichert werden? Crotch length Full measurement name - + Taille-Schritt-Taille Rise height Full measurement name - + Leibhöhe Shoulder Drop @@ -4787,12 +5165,12 @@ Sollen die Änderungen gespeichert werden? Upperarm Girth Full measurement name - + Oberarmumfang Wrist girth Full measurement name - + Handgelenkumfang Armscye depth @@ -4822,7 +5200,7 @@ Sollen die Änderungen gespeichert werden? Arm length Full measurement name - + Armlänge Hand width @@ -4837,12 +5215,12 @@ Sollen die Änderungen gespeichert werden? Hand girth Full measurement name - + Handumfang Thigh girth Full measurement name - + Oberschenkelumfang Midthigh girth @@ -4852,17 +5230,17 @@ Sollen die Änderungen gespeichert werden? Knee girth Full measurement name - + Knieumfang Calf girth Full measurement name - + Wadenumfang Ankle girth Full measurement name - + Knöchelumfang Knee height @@ -4912,7 +5290,7 @@ Sollen die Änderungen gespeichert werden? Hip height Full measurement name - + Hüfthöhe Waist to Hip height @@ -4927,7 +5305,7 @@ Sollen die Änderungen gespeichert werden? Crotch height/Inseam Full measurement name - + Schrittlänge Size @@ -5017,7 +5395,7 @@ Sollen die Änderungen gespeichert werden? Front waist length Full measurement name - + Vordere Taillenlänge Arc through shoulder joint @@ -5179,64 +5557,72 @@ Sollen die Änderungen gespeichert werden? MoveLabel Move point label - + Punkt-Bezeichner verschieben MoveSPoint Move single point - + Punkt verschieben MoveSpline Move spline - + Kurve bearbeiten MoveSplinePath Move spline path - + Pfad bearbeiten PathPage Open Directory - + Verzeichnis öffnen Path that use Valentina - + Verwendete Verzeichnisse Default - + Standard Edit - + Auswählen... Type - + Typ Path - + Verzeichnis Individual measurements - individuelle Maße + Individuelle Maße Patterns Schnittmuster + + Standard measurements + + + + Layout + + PatternPage @@ -5246,7 +5632,7 @@ Sollen die Änderungen gespeichert werden? User name - Nutzername + Benutzername Graphical output @@ -5254,7 +5640,7 @@ Sollen die Änderungen gespeichert werden? Use antialiasing - + Antialiasing verwenden Undo @@ -5262,7 +5648,7 @@ Sollen die Änderungen gespeichert werden? Count steps (0 - no limit) - + Schritte (0 - unbegrenzt) @@ -5287,7 +5673,7 @@ Sollen die Änderungen gespeichert werden? QCoreApplication Based on Qt %1 (%2, %3 bit) - + Basierend auf Qt %1 (%2, %3 Bit) @@ -5314,16 +5700,20 @@ Sollen die Änderungen gespeichert werden? inch - + Zoll Property The text that appears in the first column header - + Eigenschaft Value The text that appears in the second column header + Wert + + + px @@ -5337,7 +5727,7 @@ Sollen die Änderungen gespeichert werden? Internal error Math parser error messages. - + Interner Fehler Invalid function-, variable- or constant name: "$TOK$". @@ -5367,7 +5757,7 @@ Sollen die Änderungen gespeichert werden? Expression is empty. Math parser error messages. - + Leerer Ausdruck. Invalid pointer to variable. @@ -5417,7 +5807,7 @@ Sollen die Änderungen gespeichert werden? Missing parenthesis Math parser error messages. - + Fehlende Klammer Too many parameters for function "$TOK$" at expression position $POS$ @@ -5432,7 +5822,7 @@ Sollen die Änderungen gespeichert werden? Divide by zero Math parser error messages. - + Division durch Null Domain error @@ -5442,7 +5832,7 @@ Sollen die Änderungen gespeichert werden? Name conflict Math parser error messages. - + Namenskonflikt Invalid value for operator priority (must be greater or equal to zero). @@ -5457,7 +5847,7 @@ Sollen die Änderungen gespeichert werden? Unexpected string token found at position $POS$. Math parser error messages. Left untouched $POS$ - + Unerwartetes String-Segment an Position $POS$ gefunden. Unterminated string starting at position $POS$. @@ -5547,7 +5937,7 @@ Sollen die Änderungen gespeichert werden? toolBar - toolBar + Werkzeugleiste Save @@ -5559,19 +5949,19 @@ Sollen die Änderungen gespeichert werden? Next - Weiter + Weiter Next detail - Nächstes Detail + Nächstes Detail Turn - Drehen + Drehen Turn the detail 90 degrees - Detail um 90° drehen + Detail um 90° drehen Stop @@ -5583,23 +5973,23 @@ Sollen die Änderungen gespeichert werden? Enlarge letter - Buchstaben vergrößern + Buchstaben vergrößern Enlarge the length of the sheet - Länge des Blattes verlängern + Länge des Blattes verlängern Reduce sheet - Seite verkleinern + Seite verkleinern Reduce the length of the sheet - Die Länge der Seite verkleinern + Die Länge der Seite verkleinern Mirroring - Spiegeln + Spiegeln Zoom In @@ -5611,54 +6001,62 @@ Sollen die Änderungen gespeichert werden? 0 details left. - 0 Details übrig. + 0 Details übrig. Collisions not found. - Kollisionen nicht gefunden. + Kollisionen nicht gefunden. %1 details left. - %1 Details übrig. + %1 Details übrig. untitled - + unbenannt Svg files (*.svg) - + Svg Dateien (*.svg) PDF files (*.pdf) - + PDF Dateien (*.pdf) Images (*.png) - + Bilddateien (*.png) PS files (*.ps) - + PS-Dateien (*.ps) EPS files (*.eps) - + EPS Dateien (*.eps) Collisions found. - Kollisionen gefunden. + Kollisionen gefunden. Creating file '%1' failed! %2 - + Fehler beim anlegen von Datei '%1'! "%2' Critical error! - + Schwerwiegender Fehler! Wavefront OBJ (*.obj) + Wavefront OBJ (*.obj) + + + Layout pages + + + + Layout @@ -5666,49 +6064,77 @@ Sollen die Änderungen gespeichert werden? VAbstractConverter Error creation backup file: %1. - + Konnte Sicherungsdatei nicht anlegen: %1. Couldn't get version information. - + Versionsinformation konnte nicht gelesen werden. Too many tags <%1> in file. - + Zu viele Tags <%1> in der Datei. Version "%1" invalid. - + Versionsnummer "%1" ist ungültig. Version "0.0.0" invalid. - + Versionsnummer 0.0.0 ist ungültig. Invalid version. Minimum supported version is %1 - + Ungültige Version. Mindestens Version %1 erforderlich Invalid version. Maximum supported version is %1 - + Ungültige Version. Höchstens Version %1 unterztützt Error no unique id. - + Fehler: mehrdeutige ID. Could not change version. - + Konnte Versionsnummer nicht ändern. VAbstractTool Confirm the deletion. - + Löschen bestätigen. Do you really want delete? + Wirklich löschen? + + + black + + + + green + + + + blue + + + + dark red + + + + dark green + + + + dark blue + + + + yellow @@ -5736,7 +6162,7 @@ Sollen die Änderungen gespeichert werden? Something's wrong!! - + Etwas ist schiefgegangen! @@ -5747,22 +6173,22 @@ Sollen die Änderungen gespeichert werden? Can't cast object - + Objekt kann nicht gelesen werden Can't find object. Type mismatch. - + Objekt kann nicht gefunden werden. Falscher Typ. VDomDocument Can't convert toUInt parameter - + Konnte nicht in Parameter vom Typ 'Integer' umwandeln Can't convert toBool parameter - + Konnte nicht in Parameter vom Typ 'Boolean' umwandeln Got empty parameter @@ -5775,51 +6201,52 @@ Sollen die Änderungen gespeichert werden? Can't open file %1: %2. - + Konnte Datei %1 nicht öffnen: %2. Can't open schema file %1: %2. - + Konnte Schema-Datei %1 nicht öffnen: +%2. Could not load schema file. - + Konnte Schema-Datei nicht öffnen. Validation error file %3 in line %1 column %2 - + Fehler bei der Gültigkeitsprüfung in Datei %3, Zeile %1, Spalte %2 Parsing error file %3 in line %1 column %2 - + Auswertungsfehler in Datei %3, Zeile %1, Spalte %2 Couldn't get node - + Konnte Knoten nicht lesen Got wrong parameter id. Need only id > 0. - + Falsche Parameter-ID. Wert > 0 erforderlich. This id is not unique. - + Diese ID ist nicht eindeutig. Could not copy temp file to document file - + Konnte temporäre Datei nicht umkopieren Could not remove document file - + Konnte Dokument nicht entfernen VDrawTool Edit wrong formula - + Formel korrigieren Options @@ -5834,25 +6261,25 @@ Sollen die Änderungen gespeichert werden? VException Critical error! - + Schwerwiegender Fehler! VFormula Error - Fehler + Fehler VFormulaProperty Value - + Wert Formula - + Formel @@ -5870,165 +6297,165 @@ Sollen die Änderungen gespeichert werden? VPE::VFileEditWidget Directory - + Verzeichnis Open File - + Datei öffnen VPattern Can't find tool in table. - + Konnte Werkzeug nicht in der List finden. Error no unique id. - + Fehler: uneindeutige ID. Error parsing file. - Fehler beim Parsen der Datei. + Fehler beim Auswerten der Datei. Error can't convert value. - Fehler Wert kann nicht konvertiert werden. + Fehler: Wert kann nicht konvertiert werden. Error empty parameter. - Fehler leerer parameter. + Fehler: leerer Parameter. Error wrong id. - Fehler falsche Id. + Fehler: falsche ID. Critical error! - + Schwerwiegender Fehler! Error parsing file (std::bad_alloc). - + Fehler beim Auswerten der Datei (std::bad_alloc). Error creating or updating detail - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Detail" Error creating or updating single point - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Punkt" Error creating or updating point of end line - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Punkt mit Abstand und Winkel" Error creating or updating point along line - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Punkt auf einer Linie" Error creating or updating point of shoulder - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Spezieller Punkt an der Schulter" Error creating or updating point of normal - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Punkt auf einer Senkrechten" Error creating or updating point of bisector - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Winkelhalbierende" Error creating or updating point of lineintersection - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Schnittpunkt zweier Linien" Error creating or updating point of contact - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Schmittpukt Kreis und Gerade" Error creating or updating modeling point - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Punkt" Error creating or updating height - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Lotfußpunkt" Error creating or updating triangle - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Dreieck" Error creating or updating point of intersection - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Laufender Schnittpunkt" Error creating or updating cut spline point - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Kurvensegment" Error creating or updating cut spline path point - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Pfadsegment" Error creating or updating cut arc point - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Kreisbogen" Error creating or updating point of intersection line and axis - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Laufender Schnittpunkt auf Linie" Error creating or updating point of intersection curve and axis - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Laufender Schnittpunkt auf Kurve" Error creating or updating line - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Linie" Error creating or updating simple curve - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Kurve" Error creating or updating curve path - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Pfad" Error creating or updating modeling simple curve - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Kurve Detail" Error creating or updating modeling curve path - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Pfad Detail" Error creating or updating simple arc - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Bogen" Error creating or updating modeling arc - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Bogen Detail" Error creating or updating union details - + Fehler beim Anlegen oder Aktualisieren des Eintrags vom Typ "Details vereinigen" File error. - + Dateifehler. VPatternConverter Unexpected version "%1". - + Unerwartete Version "%1". Error restoring backup file: %1. - + Fehler beim wiederherstellen aus Backupdatei %1. @@ -6072,118 +6499,130 @@ Sollen die Änderungen gespeichert werden? VToolOptionsPropertyBrowser Base point - Startpunkt + Ausgangspunkt Point label - Bezeichnung des Punktes + Bezeichnung des Punktes Position - + Koordinaten Point at distance and angle - Punkt in einer Distanz und mit einem Winkel + Punkt mit Abstand und Winkel Line type - + Linientyp Length - Länge + Länge Angle - + Winkel Point at distance along line - Punkt in einer Distanz auf einer Linie + Punkt auf einer Linie Arc - Bogen + Bogen Radius - Radius + Radius First angle - + Erster Winkel Second angle - + Zweiter Winkel Point along bisector - Punkt auf einer Winkelhalbierenden + Punkt entlang einer Winkelhalbierenden Cut arc tool - + Kreisbogen-Werkzeug Tool for segmenting a curve - + Werkzeug Kurvensegment Tool segment a pathed curve - + Werkzeug Pfadsegment Perpendicular point along line - Lotfußpunkt auf einer Linie + Loftfußpunkt auf einer Linie Line between points - Linie zwischen Punkten + Verbindungslinie zwischen zwei Punkten Point at line intersection - Linienschnittpunkt + Schnittpunkt zweier Linien Point along perpendicular - Punkt auf einer Normalen + Punkt auf einer Normalen Additional angle degrees - Zusätzlicher Winkel + Zusätzlicher Winkel Point at intersection of arc and line - + Laufender Schnittpunkt auf Kreisbogen Tool to make point from x & y of two other points - + Punkt aus Koordinaten Special point on shoulder - + Spezieller Punkt an der Schulter Curve tool - + Kurven-Werkzeug Curve factor - + Koeffizient für die Krümmung der Kurve Tool for path curve - + Pfadwerkzeug Tool triangle - + Dreieck-Werkzeug Point intersection line and axis + Laufender Schnittpunkt auf Linie + + + Line color + + + + Color + + + + Point intersection curve and axis @@ -6219,43 +6658,43 @@ Sollen die Änderungen gespeichert werden? VisToolCurveIntersectAxis <b>Intersection curve and axis</b>: angle = %1°; <b>Shift</b> - sticking angle, <b>Enter</b> - finish creation - + <b>Laufender Schnittpunkt auf Kurve</b>: Winkel = %1°; <b>Shift</b> - Winkel einrasten, <b>Enter</b> - fertigstellen VisToolEndLine <b>Point at distance and angle</b>: angle = %1°; <b>Shift</b> - sticking angle, <b>Enter</b> - finish creation - + <b>Punkt mit Abstand und Winkel</b>: Winkel = %1°; <b>Shift</b> - Winkel einrasten, <b>Enter</b> - fertigstellen VisToolLineIntersectAxis <b>Intersection line and axis</b>: angle = %1°; <b>Shift</b> - sticking angle, <b>Enter</b> - finish creation - + <b>Laufender Schnittpunkt auf Linie</b>: Winkel = %1°; <b>Shift</b> - Winkel einrasten, <b>Enter</b> - fertigstellen VisToolSplinePath <b>Curved path</b>: select three or more points - + <b>Pfad</b>: drei oder mehr Punket auswählen <b>Curved path</b>: select three or more points, <b>Enter</b> - finish creation - + <b>Pfad</b>: drei oder mehr Punket auswählen, <b>Enter</b> - fertigstellen main Pattern making program. - Programm zum Schnittmuster erstellen. + Programm zur Schnittmusterkonstruktion. Pattern file. - Schnittmusterdatei + Schnittmusterdatei. diff --git a/share/translations/valentina_es_ES.ts b/share/translations/valentina_es_ES.ts new file mode 100644 index 000000000..20ba7a1cb --- /dev/null +++ b/share/translations/valentina_es_ES.ts @@ -0,0 +1,6639 @@ + + + + + AddDet + + Add detail + Añadir detalle + + + + AddPatternPiece + + Add pattern piece %1 + Añadir pieza de patrón %1 + + + + AddToCalc + + Add object + Añadir objeto + + + + AddUnionDetails + + Add union details + Añadir detalle de unión + + + + CommunityPage + + Server + Servidor + + + Server name/IP + Nombre del servidor/IP + + + Secure connection + Conexión segura + + + Proxy settings + Configuración del proxy + + + Use Proxy + Usar Proxy + + + Proxy address + Dirección del Proxy + + + Proxy port + Puerto del Proxy + + + Proxy user + Usuario del Proxy + + + Proxy pass + Contraseña del Proxy + + + User settings + Configuración del usuario + + + User Name + Nombre del usuario + + + Save password + Guardar contraseña + + + Password + Contraseña + + + + ConfigDialog + + Apply + Aplicar + + + &Cancel + &Cancelar + + + &Ok + &Ok + + + Config Dialog + Preferencias + + + Configuration + Configuración + + + Pattern + Patrón + + + Community + Comunidad + + + Paths + Carpetas + + + + ConfigurationPage + + Setup user interface language updated and will be used the next time start + El lenguaje del interfaz se actualizara la próxima vez que inicie el programa + + + Default unit updated and will be used the next pattern creation + Las unidades por defecto se actualizaran cuando cree el próximo patrón + + + Save + Guardar + + + Auto-save modified pattern + Auto guardado en patrón modificado + + + min + min + + + Interval: + Intervalo + + + Language + Idioma + + + GUI language + Idioma de interfaz gráfica de usuario + + + Decimal separator parts + Partes separador decimal + + + With OS options (%1) + Con las opciones del SO (%1) + + + Default unit + Unidades por defecto + + + Centimeters + Centímetros + + + Millimiters + Milímetros + + + Inches + pulgadas + + + Label language + Idioma de Etiquetas + + + Send crash reports + Enviar informe de errores + + + Send crash reports (recommended) + Enviar informe de errores (recomendado) + + + After each crash Valentina collect information that may help us fix a problem. We do not collect any personal information. Find more about what <a href="https://bitbucket.org/dismine/valentina/wiki/manual/Crash_reports">kind of information</a> we collect. + + + + + DelTool + + Delete tool + Herramienta borrar + + + + DeleteDetail + + Delete tool + Herramienta borrar + + + + DeletePatternPiece + + Delete pattern piece %1 + Borrar pieza de patrón %1 + + + + DialogAboutApp + + About Valentina + Sobre Valentina + + + Valentina version + Versión de Valentina + + + Contributors + Colaboradores + + + Built on %3 at %4 + + + + Web site : %1 + Sitio web: %1 + + + Warning + Atención + + + Cannot open your default browser + No se puede abrir su navegador por defecto + + + Build revision: + + + + + DialogAlongLine + + Length + Longitud + + + Insert variable into the formula + Insertar variable en la fórmula + + + Calculate value + Calcular valor + + + Value of length + Valor de la longitud + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + <html><head/><body><p>Mostrar cálculo total en una caja de mensajes</p></body></html> + + + Point label + Etiqueta de punto + + + First point + Primer punto + + + First point of line + Primer punto de línea + + + Second point + Segundo punto + + + Second point of line + Segundo punto de línea + + + Type of line + Tipo de línea + + + Show line from first point to this point + Mostrar línea desde primer punto a este punto + + + Input data + Introducir datos + + + Size and height + Alto y ancho + + + Measurements + Medidas + + + Increments + Incrementos + + + Length of lines + Longitud de las líneas + + + Length of arcs + Longitud del arco + + + Length of curves + Longitud de las curvas + + + Angle of lines + Ángulo de las líneas + + + Hide empty measurements + Ocultar medidas vacías + + + Variables - Click twice to insert into formula + Variables - Haga clic dos veces para insertar en la fórmula + + + Select second point of line + Selección segundo punto de línea + + + Point at distance along line + + + + Line color + + + + + DialogArc + + Arc + Arco + + + Radius + Radios + + + Insert variable into the formula + Insertar variable en la fórmula + + + Calculate value + Calcular valor + + + Value of radius + Valor de los radios + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + <html><head/><body><p>Mostrar cálculo total en una caja de mensajes</p></body></html> + + + First angle + Primer ángulo + + + Insert variable into formula + Introducir variable en la fórmula + + + Value of first angle + Valor del primer ángulo + + + Second angle + Segundo ángulo + + + Insert marked variable into formula + Insertar variable marcada en la fórmula + + + Value of second angle + Valor del segundo ángulo + + + Center point + Punto central + + + Select point of center of arc + Seleccionar punto del centro del arco + + + Input data + Introducir datos + + + Size and height + Alto y ancho + + + Measurements + Medidas + + + Increments + Incrementos + + + Length of lines + Longitud de las líneas + + + Length of arcs + Longitud de los arcos + + + Length of curves + Longitud de las curvas + + + Angle of lines + Ángulo de las líneas + + + Hide empty measurements + Ocultar medidas vacías + + + Variables + Variables + + + Value of angle of line. + Valor del ángulo de la línea + + + Error + Error + + + Radius can't be negative + Radio no puede ser negativo + + + Angles equal + Ángulos iguales + + + Color + + + + + DialogBisector + + Bisector + Bisectriz + + + Length + Longitud + + + Insert marked variable into the formula + Insertar variable marcada en la fórmula + + + Calculate value + Calcular valor + + + Value of length + Valor de la longitud + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + <html><head/><body><p>Mostrar cálculo total en una caja de mensajes</p></body></html> + + + Point label + Etiqueta de punto + + + First point + Primer punto + + + First point of angle + Primer punto del ángulo + + + Second point + Segundo punto + + + Second point of angle + Segundo punto del ángulo + + + Third point + Tercer punto + + + Third point of angle + Tercer punto del ángulo + + + Type of line + Tipo de línea + + + Show line from second point to this point + Mostrar línea desde segundo punto hasta este punto + + + Input data + Introducir datos + + + Size and height + Alto y ancho + + + Measurements + Medidas + + + Increments + Incrementos + + + Length of lines + Longitud de las líneas + + + Length of arcs + Longitud de los arcos + + + Length of curves + Longitud de las curvas + + + Angle of lines + Ángulos de las líneas + + + Hide empty measurements + Ocultar medidas vacías + + + Variables - Click twice to insert into formula + Variables - Doble click para insertar en la fórmula + + + Select second point of angle + Selección segundo punto de ángulo + + + Select third point of angle + Selección tercer punto de ángulo + + + Point along bisector + + + + Line color + + + + + DialogCurveIntersectAxis + + Curve intersect axis + Cruzar curva con eje + + + Angle + Ángulo + + + Calculate value + Calcular valor + + + Value of angle + Valor del ángulo + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + <html><head/><body><p>Mostrar cálculo total en una caja de mensajes</p></body></html> + + + Axis point + Punto del eje + + + First point of line + Primer punto de línea + + + Curve + Curva + + + Point label + Etiqueta de punto + + + Type of line + Tipo de línea + + + Show line from first point to this point + Mostrar línea desde el primer punto hasta este punto + + + Input data + Introducir datos + + + Size and height + Alto y ancho + + + Measurements + Medidas + + + Increments + Incrementos + + + Length of lines + Longitud de las líneas + + + Length of arcs + Longitud de los arcos + + + Length of curves + Longitud de las curvas + + + Angle of lines + Ángulo de las líneas + + + Hide empty measurements + Ocultar medidas vacías + + + Variables + Variables + + + Select axis point + Selección punto del eje + + + Point intersect curve and axis + + + + Axis Point + + + + Line color + + + + + DialogCutArc + + Cut arc + Cortar arco + + + Length + Longitud + + + Calculate value + Calcular valor + + + Value of length + Valor de la longitud + + + _ + _ + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + <html><head/><body><p>Mostrar cálculo total en una caja de mensajes</p></body></html> + + + Arc + Arco + + + Selected curve + Curva seleccionada + + + Point label + Etiqueta de punto + + + Input data + Introducir datos + + + Size and height + Alto y ancho + + + Measurements + Medidas + + + Increments + Incrementos + + + Length of lines + Longitud de las líneas + + + Length of arcs + Longitud de los arcos + + + Length of curves + Longitud de las curvas + + + Angle of lines + Ángulo de las líneas + + + Hide empty measurements + Ocultar medidas vacías + + + Variables - Click twice to insert into formula + Variables - Doble click para insertar en la fórmula + + + Segment an arc + + + + Selected arc + + + + Color + + + + + DialogCutSpline + + Cut curve + Cortar curva + + + Length + Longitud + + + Calculate value + Calcular valor + + + Value of length + Valor de la longitud + + + _ + _ + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + <html><head/><body><p>Mostrar cálculo total en una caja de mensajes</p></body></html> + + + Curve + Curva + + + Selected curve + Curva seleccionada + + + Point label + Etiqueta de punto + + + Input data + Introducir datos + + + Size and height + Alto y ancho + + + Measurements + Medidas + + + Increments + Incrementos + + + Length of lines + Longitud de las líneas + + + Length of arcs + Longitud del arco + + + Length of curves + Longitud de las curvas + + + Angle of lines + Ángulo de las líneas + + + Hide empty measurements + Ocultar medidas vacías + + + Variables - Click twice to insert into formula + Variables - Doble click para insertar en la fórmula + + + Segmenting a simple curve + + + + Color + + + + + DialogCutSplinePath + + Cut curve path + Cortar trazado curvo + + + Length + Longitud + + + Calculate value + Calcular valor + + + Value of length + Valor de la longitud + + + _ + _ + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + <html><head/><body><p>Mostrar cálculo total en una caja de mensajes</p></body></html> + + + Curve + Curva + + + Selected curve path + Trazado curvo seleccionado + + + Point label + Etiqueta de punto + + + Input data + Introducir datos + + + Size and height + Alto y ancho + + + Measurements + Medidas + + + Increments + Incrementos + + + Length of lines + Longitud de las líneas + + + Length of arcs + Longitud del arco + + + Length of curves + Longitud de las curvas + + + Angle of lines + Ángulo de las líneas + + + Hide empty measurements + Ocultar medidas vacías + + + Variables - Click twice to insert into formula + Variables - Doble click para insertar en la fórmula + + + Segment a curved path + + + + Color + + + + + DialogDetail + + Detail + Detalle + + + Bias X + + + + cm + cm + + + Bias Y + + + + Options + Opciones + + + Name of detail + Nombre del detalle + + + Seam allowance + + + + Width + Ancho + + + Closed + Cerrado + + + Delete + Borrar + + + Got wrong scene object. Ignore. + + + + Reverse + Revés + + + Seam allowance tool + + + + + DialogEditWrongFormula + + Edit formula + Editar fórmula + + + Formula + Fórmula + + + Insert variable into formula + Introducir variable en la fórmula + + + Calculate value + Calcular valor + + + Value of first angle + Valor del primer ángulo + + + _ + _ + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + <html><head/><body><p>Mostrar cálculo total en una caja de mensajes</p></body></html> + + + Input data + Introducir datos + + + Size and height + Alto y ancho + + + Measurements + Medidas + + + Increments + Incrementos + + + Length of lines + Longitud de las líneas + + + Length of arcs + Longitud del arco + + + Length of curves + Longitud de las curvas + + + Angle of lines + Ángulo de las líneas + + + Hide empty measurements + Ocultar medidas vacías + + + Variables + Variables + + + + DialogEndLine + + Point in the end of a line + Punto en el final de una línea + + + Length + Longitud + + + Calculate value + Calcular valor + + + Value of length + Valor de la longitud + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + <html><head/><body><p>Mostrar cálculo total en una caja de mensajes</p></body></html> + + + Angle + Ángulo + + + Value of angle + Valor del ángulo + + + Base point + Punto base + + + First point of line + Primer punto de línea + + + Point label + Etiqueta de punto + + + Type of line + Tipo de línea + + + Show line from first point to this point + Mostrar línea desde primer punto hasta este punto + + + Input data + Introducir datos + + + Size and height + Alto y ancho + + + Measurements + Medidas + + + Increments + Incrementos + + + Length of lines + Longitud de las líneas + + + Length of arcs + Longitud del arco + + + Length of curves + Longitud de las curvas + + + Angle of lines + Ángulo de las líneas + + + Hide empty measurements + Ocultar medidas vacías + + + Variables + Variables + + + Point at distance and angle + + + + Line color + + + + + DialogHeight + + Height + Altura + + + Point label + Etiqueta de punto + + + Base point + Punto base + + + First point of line + Primer punto de línea + + + Second point of line + Segundo punto de línea + + + Type of line + Tipo de línea + + + Show line from first point to our point + + + + Select first point of line + Selección primer punto de línea + + + Select second point of line + Selección segundo punto de línea + + + Perpendicular point along line + + + + Base Point + + + + Line color + + + + + DialogHistory + + History + Historia + + + Tool + Herramienta + + + Can't create record. + + + + %1 - Base point + %1 - Punto base + + + %1_%2 - Line from point %1 to point %2 + %1_%2 - Línea desde punto %1 hasta punto %2 + + + %3 - Point along line %1_%2 + + + + %1 - Point of shoulder + + + + %3 - normal to line %1_%2 + + + + %4 - bisector of angle %1_%2_%3 + + + + %5 - intersection of lines %1_%2 and %3_%4 + %5 - intersección de líneas %1_%2 y %3_%4 + + + Curve %1_%2 + Curva %1_%2 + + + Arc with center in point %1 + + + + Curve point %1 + + + + %4 - point of contact of arc with the center in point %1 and line %2_%3 + + + + Point of perpendicular from point %1 to line %2_%3 + + + + Triangle: axis %1_%2, points %3 and %4 + + + + %1 - point of intersection %2 and %3 + %1 - punto de intersección %2 y %3 + + + %1 - cut arc with center %2 + + + + %1 - cut curve %2_%3 + + + + %1 - cut curve path %2 + + + + %1 - point of intersection line %2_%3 and axis through point %4 + + + + %1 - point of intersection curve and axis through point %2 + + + + + DialogIncrements + + Increments + Incrementos + + + Measurements + Medidas + + + Load another measurements table + Cargar otra tabla de medidas + + + Personal information + Información personal + + + Given name + Nombre + + + Family name + Apellidos + + + Birth date + Fecha de nacimiento + + + Sex + Sexo + + + Email + Correo electrónico + + + Hide empty measurements + Ocultar medidas vacías + + + Name + Nombre + + + The calculated value + El valor calculado + + + Base value + Valor base + + + In sizes + En tamaños + + + In heights + En alturas + + + Description + Descripción + + + Lines + Líneas + + + Line + Línea + + + Length + Longitud + + + Curves + Curvas + + + Curve + Curva + + + Arcs + Arcos + + + Arc + Arco + + + File error. + Error en archivo + + + male + hombre + + + female + mujer + + + Could not save GivenName + No se pudo guardar Nombre + + + Could not save FamilyName + No se pudo guardar Apellidos + + + Could not save Email + No se pudo guardar correo electrónico + + + Could not save Sex + No se pudo guardar Sexo + + + Could not save BirthDate + No se pudo guardar fecha de nacimiento + + + Measurements use different units than pattern. This pattern required measurements in %1 + + + + Individual measurements (*.vit) + Medidas individuales (*.vit) + + + Open file + Abrir archivo + + + Wrong units. + Unidades erróneas. + + + Standard measurements (*.vst) + Medidas estándar (*.vst) + + + Name_%1 + Nombre_%1 + + + Can't save measurement + No se pudo guardar medidas + + + Tables of Variables + + + + Base size: %1 %3; Base height: %2 %3 + + + + Description: "%1" + + + + Data successfully saved. + + + + + DialogIndividualMeasurements + + Individual measurements + Medidas individuales + + + Pattern piece name + Nombre de la pieza del patrón + + + Exist measurements + Medidas existentes + + + Path: + Ruta: + + + Given name: + Nombre: + + + Family name: + Apellidos: + + + New measurements + Nuevas medidas + + + Units: + Unidades: + + + Could not create measurements file + No se pudo crear el archivo de medidas + + + Please try again or change file + Por favor, inténtelo de nuevo o cambie el archivo + + + File error. + Error en archivo. + + + Individual measurements (*.vit) + Medidas individuales (*.vit) + + + Open file + Abrir archivo + + + Where save measurements? + Donde desea guardar las medidas? + + + Centimeters + Centímetros + + + Millimiters + Milímetros + + + Inches + Pulgadas + + + + DialogLayoutProgress + + Creation a layout + + + + <html><head/><body><p>Finding best position for worpieces. Please, waite.</p></body></html> + + + + Couldn't prepare data for creation layout + + + + Critical error + + + + Wrong paper size + + + + Several workpieces left not arranged, but none of them match for paper + + + + + DialogLayoutSettings + + Creation a layout + + + + Paper size + + + + Templates: + + + + Width: + + + + Height: + + + + ... + ... + + + Rotate workpiece + + + + Rotate by + + + + degree + + + + Creation options + + + + Layout width: + + + + Shift length: + + + + Principle of choosing the next workpiece + + + + Three groups: big, middle, small + + + + Two groups: big, small + + + + Descending area + + + + Millimiters + Milímetros + + + Centimeters + Centímetros + + + Inches + + + + Pixels + + + + + DialogLine + + Line + Línea + + + First point + Primer punto + + + Second point + Segundo punto + + + Type of line + Tipo de línea + + + Show line from first point to this point + Mostrar línea desde primer punto hasta este punto + + + Select second point + Selección segundo punto de línea + + + Line between points + + + + Line color + + + + + DialogLineIntersect + + Intersection of lines + Intersección de líneas + + + Point label + Etiqueta de punto + + + First line + Primera línea + + + First point + Primer punto + + + Second point + Segundo punto + + + Second line + Segunda línea + + + Select second point of first line + Selección segundo punto de la primera línea + + + Select first point of second line + Selección primer punto de la segunda línea + + + Select second point of second line + Selección segundo punto de la segunda línea + + + Point at line intersection + + + + + DialogLineIntersectAxis + + Line intersect axis + Línea de intersección del eje + + + Angle + Ángulo + + + Calculate value + Calcular valor + + + Value of angle + Valor del ángulo + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + <html><head/><body><p>Mostrar cálculo total en una caja de mensajes</p></body></html> + + + Axis point + Punto del eje + + + First point of line + Primer punto de línea + + + First line point + Primer punto de línea + + + Second line point + Segundo punto de línea + + + Point label + Etiqueta de punto + + + Type of line + Tipo de línea + + + Show line from first point to this point + Mostrar línea desde primer punto hasta este punto + + + Input data + Introducir datos + + + Size and height + Alto y ancho + + + Measurements + Medidas + + + Increments + Incrementos + + + Length of lines + Longitud de las líneas + + + Length of arcs + Longitud de los arcos + + + Length of curves + Longitud de las curvas + + + Angle of lines + Ángulo de las líneas + + + Hide empty measurements + Ocultar medidas vacías + + + Variables + Variables + + + Select second point of line + Selección segundo punto de línea + + + Select axis point + Selección punto del eje + + + Point intersect line and axis + + + + Axis Point + + + + Second point of line + Segundo punto de línea + + + Line color + + + + + DialogMeasurements + + Measurements + Medidas + + + <html><head/><body><p><span style=" font-size:18pt;">Please, choose pattern type.</span></p></body></html> + <html><head/><body><p><span style=" font-size:18pt;">Por favor, escoja el tipo de patrón.</span></p></body></html> + + + Graduation + Graduación + + + Use for creation pattern standard measurement table + Usar para la creación de patrón estándar la tabla de medidas + + + Individual + Individual + + + Use for creation pattern individual measurements + Usar para la creación de patrón medidas individuales + + + + DialogNormal + + Normal + Normal + + + Length + Longitud + + + Insert variable into formula + Introducir variable en la fórmula + + + Calculate value + Calcular valor + + + Value of length + Valor de la longitud + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + <html><head/><body><p>Mostrar cálculo total en una caja de mensajes</p></body></html> + + + Point label + Etiqueta de patrón + + + First point + Primer punto + + + Second point + Segundo punto + + + Additional angle degrees + Grados adicionales de ángulo + + + Type of line + Tipo de línea + + + Show line from first point to this point + Mostrar línea desde primer punto hasta este punto + + + Input data + Introducir datos + + + Size and height + Alto y ancho + + + Measurements + Medidas + + + Increments + Incrementos + + + Length of lines + Longitud de las líneas + + + Length of arcs + Longitud de los arcos + + + Length of curves + Longitud de las curvas + + + Angle of lines + Ángulo de las líneas + + + Hide empty measurements + Ocultar medidas vacías + + + Variables - Click twice to insert into formula + Variables - Doble click para insertar en la fórmula + + + Select second point of line + Selección segundo punto de línea + + + Point along perpendicular + + + + First point of line + + + + Second point of line + Segundo punto de línea + + + Line color + + + + + DialogPatternProperties + + Pattern properties + Propiedades de patrón + + + Description + Descripción + + + Author name + Nombre del autor + + + Pattern description + Descripción del patrón + + + For technical notes. + Para notas técnicas. + + + Heights and Sizes + Alturas y tamaños + + + All heights (cm) + Todas las alturas (cm) + + + All sizes (cm) + Todos los tamaños (cm) + + + + DialogPatternXmlEdit + + XML Editor + Editor XML + + + Value : + Valor: + + + Name : + Nombre: + + + <No selection> + <Sin selección> + + + Type : + Tipo : + + + Add attribute + Añadir atributo + + + Add son + Añadir hijo + + + Remove attribute + Quitar atributo + + + Remove node + Quitar nodo + + + Set + + + + Cancel + Cancelar + + + Apply changes + Aplicar cambios + + + Undo last + Deshacer último + + + Immediate apply + Aplicar inmediatamente + + + Base selection + Selección de la base + + + All pattern pieces + Todas las piezas del patrón + + + No changes + Sin cambios + + + Cannot delete previously created node + No se puede borrar el nodo previamente creado + + + No changes left + Sin cambios + + + Cannot undo change + No se pueden deshacer los cambios + + + <no value> + <sin valor> + + + Unchanged + Sin cambios + + + Cannot delete previously created attribute + No se puede borrar atributo creado previamente + + + Node Name + Nombre del nodo + + + Name: + Nombre: + + + Node Value (may be empty) + Valor del Nodo (no puede estar vacío) + + + Value: + Valor: + + + Attribute Name + Nombre de atributo + + + Attribute Value + Valor de atributo + + + No selection + Sin selección + + + Root node + Nodo raíz + + + Node + Nodo + + + Attribute + Atributo + + + + DialogPointOfContact + + Point of contact + Punto de contacto + + + Radius + Radios + + + Insert variable into formula + Introducir variable en la fórmula + + + Calculate value + Calcular valor + + + Value of radius + Valor del radio + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + <html><head/><body><p>Mostrar cálculo total en una caja de mensajes</p></body></html> + + + Point label + Etiqueta de punto + + + Center of arc + Centro del arco + + + Select point of center of arc + Seleccionar punto del centro del arco + + + Top of the line + Principio de la línea + + + End of the line + Final de la línea + + + Input data + Introducir datos + + + Size and height + Alto y ancho + + + Measurements + Medidas + + + Increments + Incrementos + + + Length of lines + Longitud de las líneas + + + Length of arcs + Longitud de los arcos + + + Length of curves + Longitud de las curvas + + + Angle of lines + Ángulo de las líneas + + + Hide empty measurements + Ocultar medidas vacías + + + Variables - Click twice to insert into formula. + Variables - Doble click para insertar en la fórmula + + + Select second point of line + Selección segundo punto de línea + + + Point at intersection of arc and line + + + + + DialogPointOfIntersection + + Point of intersection + Punto de intersección + + + Point label + Etiqueta de punto + + + vertical point + punto vertical + + + First point of angle + Primer punto del ángulo + + + horizontal point + punto horizontal + + + Second point of angle + Segundo punto del ángulo + + + Select point horizontally + Selecciona punto horizontal + + + Point from X and Y of two other points + + + + X: vertical point + + + + Y: horizontal point + + + + Select point for Y value (horizontal) + + + + + DialogShoulderPoint + + Length + Longitud + + + Insert variable into formula + Introducir variable en la fórmula + + + Calculate value + Calcular valor + + + Value of length + Valor de la longitud + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + <html><head/><body><p>Mostrar cálculo total en una caja de mensajes</p></body></html> + + + Point label + Etiqueta de punto + + + First point + Primer punto + + + Second point + Segundo punto + + + Third point + Tercer punto + + + Type of line + Tipo de línea + + + Show line from first point to our point + + + + Input data + Introducir datos + + + Size and height + Alto y ancho + + + Measurements + Medidas + + + Increments + Incrementos + + + Length of lines + Longitud de las líneas + + + Length of arcs + Longitud de los arcos + + + Length of curves + Longitud de las curvas + + + Angle of lines + Ángulo de las líneas + + + Hide empty measurements + Ocultar medidas vacías + + + Variables - Click twice to insert into formula + Variables - Doble click para insertar en la fórmula + + + Select first point of line + Selección primer punto de línea + + + Select second point of line + Selección segundo punto de línea + + + Special point on shoulder + + + + Line color + + + + + DialogSinglePoint + + Single point + Punto simple + + + Coordinates on the sheet + Coordenadas en la hoja + + + Coordinates + Coordenadas + + + Y coordinate + coordenada Y + + + X coordinate + coordenada X + + + Point label + Etiqueta de punto + + + + DialogSpline + + Curve + Curva + + + First point + Primer punto + + + Length ratio of the first control point + + + + The angle of the first control point + + + + Second point + Segundo punto + + + Length ratio of the second control point + + + + The angle of the second control point + + + + Coefficient of curvature of the curve + Coeficiente de curvatura de la curva + + + Select last point of curve + Selección último punto de curva + + + Simple curve + + + + Color + + + + + DialogSplinePath + + Curved path + Trazado curvado + + + Point of curve + Punto de curva + + + Length ratio of the first control point + + + + The angle of the first control point + + + + Length ratio of the second control point + + + + The angle of the second control point + + + + List of points + Lista de puntos + + + Coefficient of curvature of the curve + Coeficiente de curvatura de la curva + + + Select point of curve path + + + + Color + + + + + DialogStandardMeasurements + + Standard table + Tabla estándar + + + Pattern piece name + Nombre de la pieza del patrón + + + Standard measurements table + Tabla de medidas estándar + + + File error. + Error en archivo. + + + + DialogTool + + Error + Error + + + Empty field + Campo vacío + + + Value can't be 0 + El valor no puede ser 0 + + + Value + Valor + + + Height + Altura + + + Size + Tamaño + + + Line length + Longitud de línea + + + Arc length + Longitud de arco + + + Curve length + Longitud de curva + + + Parser error: %1 + + + + Line Angle + + + + + DialogTriangle + + Triangle + Triángulo + + + Point label + Etiqueta de punto + + + First point of axis + Primer punto del eje + + + First point of line + Primer punto de la línea + + + Second point of axis + Segundo punto del eje + + + First point + Primer punto + + + Second point + Segundo punto + + + Select second point of axis + Selección segundo punto del eje + + + Select first point + Selección primer punto + + + Select second point + Selección segundo punto + + + Triangle tool + + + + First point of the axis + + + + Second point of the axis + + + + Second point of line + Segundo punto de línea + + + + DialogUndo + + Broken formula + + + + Error while calculation formula. You can try undo last operation or fix broken formula. + + + + &Undo + &Deshacer + + + &Fix formula + &Reparar fórmula + + + &Cancel + &Cancelar + + + + DialogUnionDetails + + Union details + Detalles de unión + + + <html><head/><body><p>Do you really want union details?</p></body></html> + + + + Select first point + Selección primer punto + + + Select second point + Selección segundo punto + + + Select another second point + Selección otro segundo punto + + + Select detail + Selección de detalle + + + Union tool + + + + + Functions + + sin + sine function + sin + + + cos + cosine function + cos + + + tan + tangens function + tan + + + asin + arcus sine function + asin + + + acos + arcus cosine function + acos + + + atan + arcus tangens function + atan + + + sinh + hyperbolic sine function + sinh + + + cosh + hyperbolic cosine + cosh + + + tanh + hyperbolic tangens function + tanh + + + asinh + hyperbolic arcus sine function + asinh + + + acosh + hyperbolic arcus tangens function + acosh + + + atanh + hyperbolic arcur tangens function + atanh + + + log2 + logarithm to the base 2 + log2 + + + log10 + logarithm to the base 10 + log10 + + + log + logarithm to the base 10 + log + + + ln + logarithm to base e (2.71828...) + in + + + exp + e raised to the power of x + exp + + + sqrt + square root of a value + sqrt + + + sign + sign function -1 if x<0; 1 if x>0 + sign + + + rint + round to nearest integer + rint + + + abs + absolute value + abs + + + min + min of all arguments + min + + + max + max of all arguments + max + + + sum + sum of all arguments + sum + + + avg + mean value of all arguments + avg + + + + InternalStrings + + The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + + + + + MainWindow + + Valentina + Valentina + + + Tools for creating points. + Herramientas para la creación de puntos. + + + Point + Punto + + + Point along perpendicular + + + + Tool triangle. + Herramienta triángulo + + + Perpendicular point along line + + + + Point along bisector + + + + Point at distance and angle + + + + Point at distance along line + + + + Point of intersection line and axis + Punto de intersección de línea y eje + + + ... + ... + + + Tools for creating lines. + Herramientas para crear líneas. + + + Line + Línea + + + Line between points + + + + Point at line intersection + + + + Tools for creating curves. + Herramientas para crear curvas. + + + Curve + Curva + + + Curve tool. + Herramienta curva. + + + Tool for path curve. + Herramienta para trazado curvo. + + + Tools for creating arcs. + Herramientas para crear arcos. + + + Arc + Arco + + + Arc tool. + Herramienta arco. + + + Cut arc tool. + Herramienta cortar arco. + + + Tools for creating details. + Herramientas para crear detalles. + + + Detail + Detalle + + + Tool new detail. + Herramienta nuevo detalle. + + + Tool for union two details. + Herramienta para unir dos detalles. + + + &File + &Archivo + + + &Help + &Ayuda + + + &Pattern piece + &Pieza de patrón + + + Measurements + Medidas + + + Window + Ventana + + + Toolbar files + + + + ToolBar modes + + + + Toolbar pattern + + + + Toolbar options + + + + Toolbar tools + + + + Tool options + Opciones de herramienta + + + New + Nuevo + + + &New + &Nuevo + + + Create a new pattern + Crear un nuevo patrón + + + Ctrl+N + Ctrl+N + + + Open + Abrir + + + &Open + &Abrir + + + Open file with pattern + Abrir archivo con patrón + + + Save + Guardar + + + &Save + &Guardar + + + Save pattern + Guardar patrón + + + Ctrl+S + Ctrl+S + + + Save &As... + + + + Save not yet saved pattern + + + + Ctrl+Shift+S + Ctrl+Shift+S + + + Draw + Dibujar + + + Draw mode + Modo de dibujo + + + Ctrl+W + Ctrl+W + + + Details + Detalles + + + Details mode + Modo de detalles + + + Ctrl+E + Ctrl+E + + + Pointer tools + Herramientas de puntero + + + New pattern piece + Nueva pieza de patrón + + + Add new pattern piece + Añadir nueva pieza de patrón + + + Ctrl+Shift+N + Ctrl+Shift+N + + + Change the label of pattern piece + Cambiar etiqueta de pieza de patrón + + + Table of variables + Tabla de variables + + + Tables of variables + Tablas de variables + + + Ctrl+T + Ctrl+T + + + History + Historia + + + Ctrl+H + Ctrl+H + + + Export pattern (layout) + Exportar patrón (plantilla) + + + Create layout + Crear plantilla + + + Ctrl+L + Ctrl+L + + + About &Qt + Sobre &Qt + + + &About Valentina + &Sobre Valentina + + + E&xit + &Salida + + + Exit the application + Salir de la aplicación + + + Ctrl+Q + Ctrl+Q + + + Preferences + Preferencias + + + Pattern properties + Propiedades de patrón + + + Zoom in + + + + zoom in + + + + Zoom out + + + + Edit pattern XML code + Editar código XML de patrón + + + Original zoom + Zoom original + + + Original Zoom + Zoom Original + + + Zoom fit best + + + + Ctrl+= + Ctrl+= + + + Stop + Parar + + + Stop using tool + Parar de usar herramienta + + + Repot Bug... + Informar de un error... + + + Report bug + Informar de un error + + + Close window + Cerrar ventana + + + Online help + Ayuda en línea + + + Show online help + Mostrar ayuda en línea + + + Pattern piece %1 + Pieza de patrón %1 + + + Individual measurements is under development + Medidas individuales está en desarrollando + + + There is no way create individual measurements file independent on the pattern file. +For opening pattern need keep both files: pattern and measurements. Do you want continue? + + + + Select point + Seleccionar punto + + + Select first point + Selección primer punto + + + Select first point of line + Selección primer punto de línea + + + Select first point of angle + + + + Select first point of first line + + + + Select first point curve + + + + Select simple curve + + + + Select point of center of arc + Seleccionar punto del centro del arco + + + Select point of curve path + + + + Select curve path + + + + Select points, arcs, curves clockwise. + + + + Select base point + + + + Select first point of axis + + + + Select point vertically + Selecciona punto horizontal + + + Select detail + Seleccionar detalle + + + Select arc + Seleccionar arco + + + Select curve + Seleccionar curva + + + About Qt + Sobre Qt + + + Height: + Altura: + + + Size: + Tamaño: + + + Pattern Piece: + Pieza de Patrón: + + + Pattern files (*.val) + Archivos de patrón (*.val) + + + pattern + patrón + + + /pattern.val + + + + Save as + Guardar como + + + Could not save file + No se ha guardado archivo + + + Open file + Abrir archivo + + + Error parsing file. + + + + Error can't convert value. + Error no se puede convertir valor. + + + Error empty parameter. + Error parámetro vacío. + + + Error wrong id. + + + + Critical error! + Error crítico!! + + + Error parsing file (std::bad_alloc). + + + + Bad id. + + + + File saved + Archivo guardado + + + untitled.val + Sin título.val + + + Unsaved change + + + + The pattern has been modified. +Do you want to save your changes? + El patrón ha sido modificado. +Quiere guardar los cambios? + + + &Undo + &Deshacer + + + &Redo + &Rehacer + + + Pattern piece: + Pieza de patrón: + + + Enter a new label for the pattern piece. + Introduzca nueva etiqueta para la pieza de patrón. + + + This file already opened in another window. + Este archivo ha sido abierto en otra ventana. + + + Wrong units. + Unidades no válidas. + + + Application doesn't support standard table with inches. + La aplicación no soporta la tabla estándar en pulgadas. + + + File error. + Error en archivo. + + + File loaded + Archivo cargado + + + Valentina didn't shut down correctly. Do you want reopen files (%1) you had open? + + + + Reopen files. + Reabrir archivos. + + + The measurements file <br/><br/> <b>%1</b> <br/><br/> %3 + El archivo de medidas <br/><br/> <b>%1</b> <br/><br/> %3 + + + could not be found. Do you want to update the file location + No se ha podido encontrar. Quiere actualizar la localización del archivo + + + Standard measurements (*.vst) + Medidas estándar (*.vst) + + + Individual measurements (*.vit) + Medidas individuales (*.vit) + + + Special point on shoulder + + + + Triangle tool + + + + Point at intersection of arc and line + + + + Point from X and Y of two other points + + + + Point intersect line and axis + + + + Simple curve + + + + Curved path + Trazado curvado + + + Segmenting a simple curve + + + + Segment a curved path + + + + Point intersect curve and axis + + + + Segment an arc + + + + Point intersect arc and axis + + + + Seam allowance tool + + + + Union tool + + + + toolBar + Barra de herramientas + + + Last Tool + + + + Activate last used tool again + + + + L + + + + Select point for X value (vertical) + + + + + Measurements + + head_girth + Short measurement name. Don't use math symbols in name!!!! + circunferencia_cabeza + + + mid_neck_girth + Short measurement name. Don't use math symbols in name!!!! + circunferencia_medio_cuello + + + neck_base_girth + Short measurement name. Don't use math symbols in name!!!! + + + + head_and_neck_length + Short measurement name. Don't use math symbols in name!!!! + + + + center_front_waist_length + Short measurement name. Don't use math symbols in name!!!! + + + + center_back_waist_length + Short measurement name. Don't use math symbols in name!!!! + + + + shoulder_length + Short measurement name. Don't use math symbols in name!!!! + + + + side_waist_length + Short measurement name. Don't use math symbols in name!!!! + + + + trunk_length + Short measurement name. Don't use math symbols in name!!!! + + + + shoulder_girth + Short measurement name. Don't use math symbols in name!!!! + + + + upper_chest_girth + Short measurement name. Don't use math symbols in name!!!! + + + + bust_girth + Short measurement name. Don't use math symbols in name!!!! + + + + under_bust_girth + Short measurement name. Don't use math symbols in name!!!! + + + + waist_girth + Short measurement name. Don't use math symbols in name!!!! + + + + high_hip_girth + Short measurement name. Don't use math symbols in name!!!! + + + + hip_girth + Short measurement name. Don't use math symbols in name!!!! + + + + upper_front_chest_width + Short measurement name. Don't use math symbols in name!!!! + + + + front_chest_width + Short measurement name. Don't use math symbols in name!!!! + + + + across_front_shoulder_width + Short measurement name. Don't use math symbols in name!!!! + + + + across_back_shoulder_width + Short measurement name. Don't use math symbols in name!!!! + + + + upper_back_width + Short measurement name. Don't use math symbols in name!!!! + + + + back_width + Short measurement name. Don't use math symbols in name!!!! + + + + bustpoint_to_bustpoint + Short measurement name. Don't use math symbols in name!!!! + + + + halter_bustpoint_to_bustpoint + Short measurement name. Don't use math symbols in name!!!! + + + + neck_to_bustpoint + Short measurement name. Don't use math symbols in name!!!! + + + + crotch_length + Short measurement name. Don't use math symbols in name!!!! + + + + rise_height + Short measurement name. Don't use math symbols in name!!!! + + + + shoulder_drop + Short measurement name. Don't use math symbols in name!!!! + + + + shoulder_slope_degrees + Short measurement name. Don't use math symbols in name!!!! + + + + front_shoulder_slope_length + Short measurement name. Don't use math symbols in name!!!! + + + + back_shoulder_slope_length + Short measurement name. Don't use math symbols in name!!!! + + + + front_shoulder_to_waist_length + Short measurement name. Don't use math symbols in name!!!! + + + + back_shoulder_to_waist_length + Short measurement name. Don't use math symbols in name!!!! + + + + front_neck_arc + Short measurement name. Don't use math symbols in name!!!! + + + + back_neck_arc + Short measurement name. Don't use math symbols in name!!!! + + + + front_upper_chest_arc + Short measurement name. Don't use math symbols in name!!!! + + + + back_upper_chest_arc + Short measurement name. Don't use math symbols in name!!!! + + + + front_waist_arc + Short measurement name. Don't use math symbols in name!!!! + + + + back_waist_arc + Short measurement name. Don't use math symbols in name!!!! + + + + front_upper_hip_arc + Short measurement name. Don't use math symbols in name!!!! + + + + back_upper_hip_arc + Short measurement name. Don't use math symbols in name!!!! + + + + front_hip_arc + Short measurement name. Don't use math symbols in name!!!! + + + + back_hip_arc + Short measurement name. Don't use math symbols in name!!!! + + + + chest_slope + Short measurement name. Don't use math symbols in name!!!! + + + + back_slope + Short measurement name. Don't use math symbols in name!!!! + + + + front_waist_slope + Short measurement name. Don't use math symbols in name!!!! + + + + back_waist_slope + Short measurement name. Don't use math symbols in name!!!! + + + + front_neck_to_upper_chest_height + Short measurement name. Don't use math symbols in name!!!! + + + + front_neck_to_bust_height + Short measurement name. Don't use math symbols in name!!!! + + + + front_waist_to_upper_chest + Short measurement name. Don't use math symbols in name!!!! + + + + front_waist_to_lower_breast + Short measurement name. Don't use math symbols in name!!!! + + + + back_waist_to_upper_chest + Short measurement name. Don't use math symbols in name!!!! + + + + strap_length + Short measurement name. Don't use math symbols in name!!!! + + + + armscye_girth + Short measurement name. Don't use math symbols in name!!!! + + + + elbow_girth + Short measurement name. Don't use math symbols in name!!!! + + + + upper_arm_girth + Short measurement name. Don't use math symbols in name!!!! + + + + wrist_girth + Short measurement name. Don't use math symbols in name!!!! + + + + scye_depth + Short measurement name. Don't use math symbols in name!!!! + + + + shoulder_and_arm_length + Short measurement name. Don't use math symbols in name!!!! + + + + underarm_length + Short measurement name. Don't use math symbols in name!!!! + + + + cervicale_to_wrist_length + Short measurement name. Don't use math symbols in name!!!! + + + + shoulder_to_elbow_length + Short measurement name. Don't use math symbols in name!!!! + + + + arm_length + Short measurement name. Don't use math symbols in name!!!! + + + + hand_width + Short measurement name. Don't use math symbols in name!!!! + + + + hand_length + Short measurement name. Don't use math symbols in name!!!! + + + + hand_girth + Short measurement name. Don't use math symbols in name!!!! + + + + thigh_girth + Short measurement name. Don't use math symbols in name!!!! + + + + mid_thigh_girth + Short measurement name. Don't use math symbols in name!!!! + + + + knee_girth + Short measurement name. Don't use math symbols in name!!!! + + + + calf_girth + Short measurement name. Don't use math symbols in name!!!! + + + + ankle_girth + Short measurement name. Don't use math symbols in name!!!! + + + + knee_height + Short measurement name. Don't use math symbols in name!!!! + + + + ankle_height + Short measurement name. Don't use math symbols in name!!!! + + + + foot_width + Short measurement name. Don't use math symbols in name!!!! + + + + foot_length + Short measurement name. Don't use math symbols in name!!!! + + + + height + Short measurement name. Don't use math symbols in name!!!! + + + + cervicale_height + Short measurement name. Don't use math symbols in name!!!! + + + + cervicale_to_knee_height + Short measurement name. Don't use math symbols in name!!!! + + + + waist_height + Short measurement name. Don't use math symbols in name!!!! + + + + high_hip_height + Short measurement name. Don't use math symbols in name!!!! + + + + hip_height + Short measurement name. Don't use math symbols in name!!!! + + + + waist_to_hip_height + Short measurement name. Don't use math symbols in name!!!! + + + + waist_to_knee_height + Short measurement name. Don't use math symbols in name!!!! + + + + crotch_height + Short measurement name. Don't use math symbols in name!!!! + + + + size + Short measurement name. Don't use math symbols in name!!!! + + + + height_front_neck_base_point + Short measurement name. Don't use math symbols in name!!!! + + + + height_base_neck_side_point + Short measurement name. Don't use math symbols in name!!!! + + + + height_shoulder_point + Short measurement name. Don't use math symbols in name!!!! + + + + height_nipple_point + Short measurement name. Don't use math symbols in name!!!! + + + + height_back_angle_axilla + Short measurement name. Don't use math symbols in name!!!! + + + + height_scapular_point + Short measurement name. Don't use math symbols in name!!!! + + + + height_under_buttock_folds + Short measurement name. Don't use math symbols in name!!!! + + + + hips_excluding_protruding_abdomen + Short measurement name. Don't use math symbols in name!!!! + + + + girth_foot_instep + Short measurement name. Don't use math symbols in name!!!! + + + + side_waist_to_floor + Short measurement name. Don't use math symbols in name!!!! + + + + front_waist_to_floor + Short measurement name. Don't use math symbols in name!!!! + + + + arc_through_groin_area + Short measurement name. Don't use math symbols in name!!!! + + + + waist_to_plane_seat + Short measurement name. Don't use math symbols in name!!!! + + + + neck_to_radial_point + Short measurement name. Don't use math symbols in name!!!! + + + + neck_to_third_finger + Short measurement name. Don't use math symbols in name!!!! + + + + neck_to_first_line_chest_circumference + Short measurement name. Don't use math symbols in name!!!! + + + + front_waist_length + Short measurement name. Don't use math symbols in name!!!! + + + + arc_through_shoulder_joint + Short measurement name. Don't use math symbols in name!!!! + + + + neck_to_back_line_chest_circumference + Short measurement name. Don't use math symbols in name!!!! + + + + waist_to_neck_side + Short measurement name. Don't use math symbols in name!!!! + + + + arc_length_upper_body + Short measurement name. Don't use math symbols in name!!!! + + + + chest_width + Short measurement name. Don't use math symbols in name!!!! + + + + anteroposterior_diameter_hands + Short measurement name. Don't use math symbols in name!!!! + + + + height_clavicular_point + Short measurement name. Don't use math symbols in name!!!! + + + + height_armhole_slash + Short measurement name. Don't use math symbols in name!!!! + + + + slash_shoulder_height + Short measurement name. Don't use math symbols in name!!!! + + + + half_girth_neck + Short measurement name. Don't use math symbols in name!!!! + + + + half_girth_neck_for_shirts + Short measurement name. Don't use math symbols in name!!!! + + + + half_girth_chest_first + Short measurement name. Don't use math symbols in name!!!! + + + + half_girth_chest_second + Short measurement name. Don't use math symbols in name!!!! + + + + half_girth_chest_third + Short measurement name. Don't use math symbols in name!!!! + + + + half_girth_waist + Short measurement name. Don't use math symbols in name!!!! + + + + half_girth_hips_considering_protruding_abdomen + Short measurement name. Don't use math symbols in name!!!! + + + + half_girth_hips_excluding_protruding_abdomen + Short measurement name. Don't use math symbols in name!!!! + + + + girth_knee_flexed_feet + Short measurement name. Don't use math symbols in name!!!! + + + + neck_transverse_diameter + Short measurement name. Don't use math symbols in name!!!! + + + + front_slash_shoulder_height + Short measurement name. Don't use math symbols in name!!!! + + + + neck_to_front_waist_line + Short measurement name. Don't use math symbols in name!!!! + + + + hand_vertical_diameter + Short measurement name. Don't use math symbols in name!!!! + + + + neck_to_knee_point + Short measurement name. Don't use math symbols in name!!!! + + + + waist_to_knee + Short measurement name. Don't use math symbols in name!!!! + + + + shoulder_height + Short measurement name. Don't use math symbols in name!!!! + + + + head_height + Short measurement name. Don't use math symbols in name!!!! + + + + body_position + Short measurement name. Don't use math symbols in name!!!! + + + + arc_behind_shoulder_girdle + Short measurement name. Don't use math symbols in name!!!! + + + + neck_to_neck_base + Short measurement name. Don't use math symbols in name!!!! + + + + depth_waist_first + Short measurement name. Don't use math symbols in name!!!! + + + + depth_waist_second + Short measurement name. Don't use math symbols in name!!!! + + + + + MeasurementsDescriptions + + Around fullest part of Head + Full measurement description + + + + Around middle part of Neck + Full measurement description + + + + Around Neck at base + Full measurement description + + + + Vertical Distance from Crown to Nape + Full measurement description + + + + Front Neck Center over tape at Bustline to Front Waist Center + Full measurement description + + + + Back Neck Center to Back Waist Center + Full measurement description + + + + NeckPoint to ShoulderTip + Full measurement description + + + + Armpit to Waist side + Full measurement description + + + + Around Body from middle of Shoulder length to BustPoint to Crotch up back to beginning point + Full measurement description + + + + Around Arms and Torso, at bicep level parallel to floor, with arms hanging at the sides + Full measurement description + + + + Around Chest at Armfold level, will be parallel to floor across back, will not be parallel to floor across front chest + Full measurement description + + + + Around fullest part of Bust, parallel to floor + Full measurement description + + + + Around Chest below the Bust, parallel to floor + Full measurement description + + + + Tie a string around smallest part of waist, keep string tied while taking meaasurements. Not usually parallel to floor for front waist or back waist. + Full measurement description + + + + Around HighHip, parallel to floor + Full measurement description + + + + Around Hip, parallel to floor + Full measurement description + + + + Across Front UpperChest, smallest width from armscye to armscye + Full measurement description + + + + Across Front Chest, from armfold to armfold + Full measurement description + + + + From ShoulderTip to ShoulderTip, across Front + Full measurement description + + + + From ShoulderTip to ShoulderTip, across Back + Full measurement description + + + + Across Back UpperChest, smallest width from armscye to armscye + Full measurement description + + + + Across Back Chest, from armfold to armfold + Full measurement description + + + + Distance between BustPoints, across Chest + Full measurement description + + + + Distance from Bustpoint, behind neck, down to Bustpoint + Full measurement description + + + + From NeckPoint to BustPoint + Full measurement description + + + + From Front Waist Center, down to crotch, up to Back Waist Center + Full measurement description + + + + Sit on hard chair, measure from side waist straight down to chair bottom + Full measurement description + + + + Vertical Distance from NeckPoint level to ShoulderTip level + Full measurement description + + + + Degrees of angle from NeckPoint to ShoulderTip – requires goniometer + Full measurement description + + + + ShoulderTip to Front Waist Center + Full measurement description + + + + ShoulderTip to Back Waist Center + Full measurement description + + + + NeckPoint straight down front chest to Waistline + Full measurement description + + + + Back NeckPoint straight down back chest to Waistline + Full measurement description + + + + NeckPoint to NeckPoint through Front Neck Center + Full measurement description + + + + NeckPoint to NeckPoint across Nape + Full measurement description + + + + Front upper-bust arc + Full measurement description + + + + Back UpperBust side to side + Full measurement description + + + + Front Waist side to side + Full measurement description + + + + Back Waist side to side + Full measurement description + + + + Front UpperHip side to side + Full measurement description + + + + Back UpperHip side to side + Full measurement description + + + + Front Hip side to side + Full measurement description + + + + Back Hip side to side + Full measurement description + + + + NeckPoint to Front ArmfoldPoint + Full measurement description + + + + NeckPoint to Back ArmfoldPoint + Full measurement description + + + + NeckPoint across Front Chest to Waist side + Full measurement description + + + + NeckPoint across Back Chest to Waist side + Full measurement description + + + + Front Neck Center straight down to UpperChest line + Full measurement description + + + + Front Neck Center straight down to Bust line + Full measurement description + + + + Front Upper chest waist + Full measurement description + + + + Front waist to lower breast + Full measurement description + + + + Back waist to upper chest + Full measurement description + + + + Strap length + Full measurement description + + + + Around Armscye + Full measurement description + + + + Around Elbow with elbow bent + Full measurement description + + + + Around UpperArm + Full measurement description + + + + Around Wrist + Full measurement description + + + + Nape straight down to UnderBust line (same as Back UpperBust height) + Full measurement description + + + + NeckPoint to ShoulderTip to Wrist, with elbow bent and hand on hip + Full measurement description + + + + Armpit to Wrist, with arm straight and hanging at side + Full measurement description + + + + Nape to Wrist, with elbow bent and hand on hip + Full measurement description + + + + ShoulderTip to Elbow, with elbow bent and hand on hip + Full measurement description + + + + ShoulderTip to Wrist, with elbow bent and hand on hip + Full measurement description + + + + Hand side to side + Full measurement description + + + + Hand Middle Finger tip to wrist + Full measurement description + + + + Around Hand + Full measurement description + + + + Around Thigh + Full measurement description + + + + Around MidThigh + Full measurement description + + + + Around Knee + Full measurement description + + + + Around Calf + Full measurement description + + + + Around Ankle + Full measurement description + + + + Knee to Floor + Full measurement description + + + + Ankle to Floor + Full measurement description + + + + Widest part of Foot side to side + Full measurement description + + + + Tip of Longest Toe straight to back of heel + Full measurement description + + + + Top of head to floor + Full measurement description + + + + Nape to Floor + Full measurement description + + + + Nape to Knee + Full measurement description + + + + Waist side to floor + Full measurement description + + + + HighHip side to Floor + Full measurement description + + + + Hip side to Floor + Full measurement description + + + + Waist side to Hip + Full measurement description + + + + Waist side to Knee + Full measurement description + + + + Crotch to Floor along inside leg + Full measurement description + + + + Size + Full measurement description + Tamaño + + + Height of the point base of the neck in front + Full measurement description + + + + Height of the base of the neck side point + Full measurement description + + + + The height of the shoulder point + Full measurement description + + + + Height nipple point + Full measurement description + + + + Height back angle axilla + Full measurement description + + + + Height scapular point + Full measurement description + + + + Height under buttock folds + Full measurement description + + + + Hips excluding protruding abdomen + Full measurement description + + + + Girth foot instep + Full measurement description + + + + The distance from the side waist to floor + Full measurement description + + + + The distance from the front waist to floor + Full measurement description + + + + Arc through groin area + Full measurement description + + + + The distance from the waist to the plane seat + Full measurement description + + + + The distance from the base of the neck to the side of the radial point + Full measurement description + + + + Distance from the base of the neck side point to the end of the third finger + Full measurement description + + + + The distance from the base of the neck to the side of the first line in front of chest circumference + Full measurement description + + + + The distance from the base of the neck to the waist side front (waist length in the front) + Full measurement description + + + + Arc through the highest point of the shoulder joint + Full measurement description + + + + The distance from the base of the neck to the back line of chest circumference of the first and the second based on ledge vanes + Full measurement description + + + + The distance from the waist to the back base of the neck side point + Full measurement description + + + + Arc length of the upper body through the base of the neck side point + Full measurement description + + + + Chest width + Full measurement description + + + + Anteroposterior diameter of the hands + Full measurement description + + + + Height clavicular point + Full measurement description + + + + The distance from the point to the cervical level of the posterior angle of the front armpit (underarm height oblique) + Full measurement description + + + + Slash shoulder height + Full measurement description + + + + Half girth neck + Full measurement description + + + + Half girth neck for shirts + Full measurement description + + + + Half girth chest first + Full measurement description + + + + Half girth chest second + Full measurement description + + + + Half girth chest third + Full measurement description + + + + Half girth waist + Full measurement description + + + + Half girth hips considering protruding abdomen + Full measurement description + + + + Half girth hips excluding protruding abdomen + Full measurement description + + + + Girth knee flexed feet + Full measurement description + + + + Neck transverse diameter + Full measurement description + + + + Front slash shoulder height + Full measurement description + + + + The distance from the base of the neck to the waist line front + Full measurement description + + + + Hand vertical diameter + Full measurement description + + + + Distance from neck to knee point + Full measurement description + + + + The distance from the waist to the knee + Full measurement description + + + + Shoulder height + Full measurement description + + + + Head height + Full measurement description + + + + Body position + Full measurement description + + + + Arc behind the shoulder girdle + Full measurement description + + + + Distance from neck point to point on the base of the neck side neck girth measurement line + Full measurement description + + + + Depth waist first + Full measurement description + + + + Depth waist second + Full measurement description + + + + + MeasurementsFullNames + + Head girth + Full measurement name + + + + Mid-neck girth + Full measurement name + + + + Neck Base girth + Full measurement name + + + + Head and Neck length + Full measurement name + + + + Front Center length + Full measurement name + + + + Back Center length + Full measurement name + + + + Shoulder length + Full measurement name + + + + Side Waist length + Full measurement name + + + + Trunk length + Full measurement name + + + + Shoulder girth + Full measurement name + + + + Upper Chest girth + Full measurement name + + + + Bust girth + Full measurement name + + + + Under Bust girth + Full measurement name + + + + Waist girth + Full measurement name + + + + HighHip girth + Full measurement name + + + + Hip girth + Full measurement name + + + + Front Upper Chest width + Full measurement name + + + + Front Chest width + Full measurement name + + + + Front Across Shoulder width + Full measurement name + + + + Back Across Shoulder width + Full measurement name + + + + Back Upper Chest width + Full measurement name + + + + Back Chest width + Full measurement name + + + + BustPoint to BustPoint + Full measurement name + + + + Halter Bustpoint to Bustpoint + Full measurement name + + + + NeckPoint to BustPoint + Full measurement name + + + + Crotch length + Full measurement name + + + + Rise height + Full measurement name + + + + Shoulder Drop + Full measurement name + + + + Shoulder Slope degrees + Full measurement name + + + + Front Shoulder Balance + Full measurement name + + + + Back Shoulder Balance + Full measurement name + + + + Front Full Length + Full measurement name + + + + Back Full Length + Full measurement name + + + + Front Neck arc + Full measurement name + + + + Back Neck arc + Full measurement name + + + + Front upper-bust arc + Full measurement name + + + + Back UpperBust arc + Full measurement name + + + + Front Waist arc + Full measurement name + + + + Back Waist arc + Full measurement name + + + + Front UpperHip arc + Full measurement name + + + + Back UpperHip arc + Full measurement name + + + + Front Hip arc + Full measurement name + + + + Back Hip arc + Full measurement name + + + + Chest Balance + Full measurement name + + + + Back Balance + Full measurement name + + + + Front Waist Balance + Full measurement name + + + + Back Waist Balance + Full measurement name + + + + Front UpperChest height + Full measurement name + + + + Bust height + Full measurement name + + + + Front Upper chest waist + Full measurement name + + + + Front waist to lower breast + Full measurement name + + + + Back waist to upper chest + Full measurement name + + + + Strap length + Full measurement name + + + + Armscye Girth + Full measurement name + + + + Elbow Girth + Full measurement name + + + + Upperarm Girth + Full measurement name + + + + Wrist girth + Full measurement name + + + + Armscye depth + Full measurement name + + + + Shoulder and Arm length + Full measurement name + + + + Underarm length + Full measurement name + + + + Nape to wrist length + Full measurement name + + + + Elbow length + Full measurement name + + + + Arm length + Full measurement name + + + + Hand width + Full measurement name + + + + Hand length + Full measurement name + + + + Hand girth + Full measurement name + + + + Thigh girth + Full measurement name + + + + Midthigh girth + Full measurement name + + + + Knee girth + Full measurement name + + + + Calf girth + Full measurement name + + + + Ankle girth + Full measurement name + + + + Knee height + Full measurement name + + + + Ankle height + Full measurement name + + + + Foot width + Full measurement name + + + + Foot length + Full measurement name + + + + Total Height + Full measurement name + + + + Nape height + Full measurement name + + + + Nape to knee height + Full measurement name + + + + Waist height + Full measurement name + + + + HighHip height + Full measurement name + + + + Hip height + Full measurement name + + + + Waist to Hip height + Full measurement name + + + + Waist to Knee height + Full measurement name + + + + Crotch height/Inseam + Full measurement name + + + + Size + Full measurement name + Tamaño + + + Height front neck base point + Full measurement name + + + + Height base neck side point + Full measurement name + + + + Height shoulder point + Full measurement name + + + + Height nipple point + Full measurement name + + + + Height back angle axilla + Full measurement name + + + + Height scapular point + Full measurement name + + + + Height under buttock folds + Full measurement name + + + + Hips excluding protruding abdomen + Full measurement name + + + + Girth foot instep + Full measurement name + + + + Side waist to floor + Full measurement name + + + + Front waist to floor + Full measurement name + + + + Arc through groin area + Full measurement name + + + + Waist to plane seat + Full measurement name + + + + Neck to radial point + Full measurement name + + + + Neck to third finger + Full measurement name + + + + Neck to first line chest circumference + Full measurement name + + + + Front waist length + Full measurement name + + + + Arc through shoulder joint + Full measurement name + + + + Neck to back line chest circumference + Full measurement name + + + + Waist to neck side + Full measurement name + + + + Arc length upper body + Full measurement name + + + + Chest width + Full measurement name + + + + Anteroposterior diameter hands + Full measurement name + + + + Height clavicular point + Full measurement name + + + + Height armhole slash + Full measurement name + + + + Slash shoulder height + Full measurement name + + + + Half girth neck + Full measurement name + + + + Half girth neck for shirts + Full measurement name + + + + Half girth chest first + Full measurement name + + + + Half girth chest second + Full measurement name + + + + Half girth chest third + Full measurement name + + + + Half girth waist + Full measurement name + + + + Half girth hips considering protruding abdomen + Full measurement name + + + + Half girth hips excluding protruding abdomen + Full measurement name + + + + Girth knee flexed feet + Full measurement name + + + + Neck transverse diameter + Full measurement name + + + + Front slash shoulder height + Full measurement name + + + + Neck to front waist line + Full measurement name + + + + Hand vertical diameter + Full measurement name + + + + Neck to knee point + Full measurement name + + + + Waist to knee + Full measurement name + + + + Shoulder height + Full measurement name + + + + Head height + Full measurement name + + + + Body position + Full measurement name + + + + Arc behind shoulder girdle + Full measurement name + + + + Neck to neck base + Full measurement name + + + + Depth waist first + Full measurement name + + + + Depth waist second + Full measurement name + + + + + MoveLabel + + Move point label + + + + + MoveSPoint + + Move single point + + + + + MoveSpline + + Move spline + + + + + MoveSplinePath + + Move spline path + + + + + PathPage + + Open Directory + Abrir Directorio + + + Path that use Valentina + + + + Default + + + + Edit + Editar + + + Type + Tipo + + + Path + + + + Individual measurements + Medidas individuales + + + Patterns + Patrones + + + Standard measurements + + + + Layout + + + + + PatternPage + + User + Usuario + + + User name + Nombre de usuario + + + Graphical output + Salida gráfica + + + Use antialiasing + Usar antialiasing + + + Undo + Deshacer + + + Count steps (0 - no limit) + + + + + PostfixOperators + + cm + centimeter + cm + + + mm + millimeter + mm + + + in + inch + + + + + QCoreApplication + + Based on Qt %1 (%2, %3 bit) + + + + + QObject + + Create new pattern piece to start working. + Crear nueva pieza de patrón para comenzar a trabajar. + + + Add node + Añadir nodo + + + Move detail + Mover detalle + + + mm + mm + + + cm + cm + + + inch + pulgadas + + + Property + The text that appears in the first column header + Propiedad + + + Value + The text that appears in the second column header + Valor + + + px + + + + + QmuParserErrorMsg + + Unexpected token "$TOK$" found at position $POS$. + Math parser error messages. Left untouched "$TOK$" and $POS$ + + + + Internal error + Math parser error messages. + Error interno + + + Invalid function-, variable- or constant name: "$TOK$". + Math parser error messages. Left untouched "$TOK$" + + + + Invalid binary operator identifier: "$TOK$". + Math parser error messages. Left untouched "$TOK$" + + + + Invalid infix operator identifier: "$TOK$". + Math parser error messages. Left untouched "$TOK$" + + + + Invalid postfix operator identifier: "$TOK$". + Math parser error messages. Left untouched "$TOK$" + + + + Invalid pointer to callback function. + Math parser error messages. + + + + Expression is empty. + Math parser error messages. + La expresión está vacía. + + + Invalid pointer to variable. + Math parser error messages. + + + + Unexpected operator "$TOK$" found at position $POS$ + Math parser error messages. Left untouched "$TOK$" and $POS$ + + + + Unexpected end of expression at position $POS$ + Math parser error messages. Left untouched $POS$ + + + + Unexpected argument separator at position $POS$ + Math parser error messages. Left untouched $POS$ + + + + Unexpected parenthesis "$TOK$" at position $POS$ + Math parser error messages. Left untouched "$TOK$" and $POS$ + + + + Unexpected function "$TOK$" at position $POS$ + Math parser error messages. Left untouched "$TOK$" and $POS$ + + + + Unexpected value "$TOK$" found at position $POS$ + Math parser error messages. Left untouched "$TOK$" and $POS$ + + + + Unexpected variable "$TOK$" found at position $POS$ + Math parser error messages. Left untouched "$TOK$" and $POS$ + + + + Function arguments used without a function (position: $POS$) + Math parser error messages. Left untouched $POS$ + + + + Missing parenthesis + Math parser error messages. + Faltan paréntesis + + + Too many parameters for function "$TOK$" at expression position $POS$ + Math parser error messages. Left untouched "$TOK$" and $POS$ + + + + Too few parameters for function "$TOK$" at expression position $POS$ + Math parser error messages. Left untouched "$TOK$" and $POS$ + + + + Divide by zero + Math parser error messages. + División por cero + + + Domain error + Math parser error messages. + Error de dominio + + + Name conflict + Math parser error messages. + Conflicto en nombre + + + Invalid value for operator priority (must be greater or equal to zero). + Math parser error messages. + + + + user defined binary operator "$TOK$" conflicts with a built in operator. + Math parser error messages. Left untouched "$TOK$" + + + + Unexpected string token found at position $POS$. + Math parser error messages. Left untouched $POS$ + + + + Unterminated string starting at position $POS$. + Math parser error messages. Left untouched $POS$ + + + + String function called with a non string type of argument. + Math parser error messages. + + + + String value used where a numerical argument is expected. + Math parser error messages. + + + + No suitable overload for operator "$TOK$" at position $POS$. + Math parser error messages. Left untouched "$TOK$" and $POS$ + + + + Function result is a string. + Math parser error messages. + El resultado de la función es una cadena. + + + Parser error. + Math parser error messages. + + + + Decimal separator is identic to function argument separator. + Math parser error messages. + + + + If-then-else operator is missing an else clause + Math parser error messages. Do not translate operator name. + + + + Misplaced colon at position $POS$ + Math parser error messages. Left untouched $POS$ + + + + The "$TOK$" operator must be preceeded by a closing bracket. + Math parser error messages. Left untouched "$TOK$" + + + + + RenamePP + + Rename pattern piece + Renombrar pieza de patrón + + + + STDescriptions + + Standard figures of men 1st group, chest 100 cm + Standard table description + + + + + SaveDetailOptions + + Save detail option + + + + + SaveToolOptions + + Save tool option + Herramienta para opción de guardado + + + + TableWindow + + Create a layout + Crear una plantilla + + + toolBar + Barra de herramientas + + + Save + Guardar + + + Save layout + Guardar plantilla + + + Next + Siguiente + + + Next detail + Detalle siguiente + + + Stop + Parar + + + Stop laying + + + + Zoom In + + + + Zoom Out + + + + untitled + Sin título + + + Svg files (*.svg) + + + + PDF files (*.pdf) + + + + Images (*.png) + + + + PS files (*.ps) + + + + EPS files (*.eps) + + + + Creating file '%1' failed! %2 + + + + Critical error! + Error crítico!! + + + Wavefront OBJ (*.obj) + + + + Layout pages + + + + Layout + + + + + VAbstractConverter + + Error creation backup file: %1. + Error creando archivo de copia de seguridad: %1 + + + Couldn't get version information. + No se encuentra información de la versión. + + + Too many tags <%1> in file. + + + + Version "%1" invalid. + Versión "%1" no válida. + + + Version "0.0.0" invalid. + Versión "0.0.0" no válida. + + + Invalid version. Minimum supported version is %1 + Versión no válida. Versión mínima soportada es %1 + + + Invalid version. Maximum supported version is %1 + Versión no válida. Versión máxima soportada es %1 + + + Error no unique id. + + + + Could not change version. + + + + + VAbstractTool + + Confirm the deletion. + Confirmar borrado + + + Do you really want delete? + Realmente quiere borrarlo? + + + black + + + + green + + + + blue + + + + dark red + + + + dark green + + + + dark blue + + + + yellow + + + + + VApplication + + Error parsing file. Program will be terminated. + + + + Error bad id. Program will be terminated. + + + + Error can't convert value. Program will be terminated. + + + + Error empty parameter. Program will be terminated. + + + + Error wrong id. Program will be terminated. + + + + Something's wrong!! + + + + + VContainer + + Can't find object + No se encuentra objeto + + + Can't cast object + + + + Can't find object. Type mismatch. + No se encuentra objeto. Diferente tipo. + + + + VDomDocument + + Can't convert toUInt parameter + + + + Can't convert toBool parameter + + + + Got empty parameter + + + + Can't convert toDouble parameter + + + + Can't open file %1: +%2. + + + + Can't open schema file %1: +%2. + + + + Could not load schema file. + + + + Validation error file %3 in line %1 column %2 + + + + Parsing error file %3 in line %1 column %2 + + + + Couldn't get node + + + + Got wrong parameter id. Need only id > 0. + + + + This id is not unique. + + + + Could not copy temp file to document file + + + + Could not remove document file + + + + + VDrawTool + + Edit wrong formula + + + + Options + Opciones + + + Delete + Borrar + + + + VException + + Critical error! + Error crítico!! + + + + VFormula + + Error + Error + + + + VFormulaProperty + + Value + Valor + + + Formula + Fórmula + + + + VPE::VBoolProperty + + True + Verdadero + + + False + Falso + + + + VPE::VFileEditWidget + + Directory + Directorio + + + Open File + Abrir archivo + + + + VPattern + + Can't find tool in table. + + + + Error no unique id. + + + + Error parsing file. + + + + Error can't convert value. + Error no se puede convertir valor. + + + Error empty parameter. + Error parámetro vacío. + + + Error wrong id. + + + + Critical error! + Error crítico!! + + + Error parsing file (std::bad_alloc). + + + + Error creating or updating detail + Error creando o actualizando detalle + + + Error creating or updating single point + Error creando o actualizando punto sencillo + + + Error creating or updating point of end line + Error creando o actualizando punto de final de línea + + + Error creating or updating point along line + + + + Error creating or updating point of shoulder + + + + Error creating or updating point of normal + + + + Error creating or updating point of bisector + + + + Error creating or updating point of lineintersection + + + + Error creating or updating point of contact + Error creando o actualizando punto de contacto + + + Error creating or updating modeling point + + + + Error creating or updating height + + + + Error creating or updating triangle + Error creando o actualizando triángulo + + + Error creating or updating point of intersection + + + + Error creating or updating cut spline point + + + + Error creating or updating cut spline path point + + + + Error creating or updating cut arc point + + + + Error creating or updating point of intersection line and axis + + + + Error creating or updating point of intersection curve and axis + + + + Error creating or updating line + Error creando o actualizando línea + + + Error creating or updating simple curve + Error creando o actualizando curva simple + + + Error creating or updating curve path + Error creando o actualizando trazado curvo + + + Error creating or updating modeling simple curve + + + + Error creating or updating modeling curve path + + + + Error creating or updating simple arc + Error creando o actualizando arco simple + + + Error creating or updating modeling arc + + + + Error creating or updating union details + + + + File error. + Error en archivo. + + + + VPatternConverter + + Unexpected version "%1". + + + + Error restoring backup file: %1. + + + + + VSplinePath + + Not enough points to create the spline. + + + + This spline does not exist. + + + + Can't cut spline path with one point + + + + + VTableGraphicsView + + can't find detail + No se encuentra detalle + + + detail found + + + + + VToolDetail + + Options + Opciones + + + Delete + Borrar + + + + VToolOptionsPropertyBrowser + + Base point + Punto base + + + Point label + Etiqueta de punto + + + Position + Posición + + + Point at distance and angle + + + + Line type + + + + Length + Longitud + + + Angle + Ángulo + + + Point at distance along line + + + + Arc + Arco + + + Radius + Radios + + + First angle + Primer ángulo + + + Second angle + Segundo ángulo + + + Point along bisector + + + + Cut arc tool + Herramienta cortar arco. + + + Tool for segmenting a curve + + + + Tool segment a pathed curve + + + + Perpendicular point along line + + + + Line between points + + + + Point at line intersection + + + + Point along perpendicular + + + + Additional angle degrees + Grados adicionales de ángulo + + + Point at intersection of arc and line + + + + Tool to make point from x & y of two other points + + + + Special point on shoulder + + + + Curve tool + Herramienta curva + + + Curve factor + + + + Tool for path curve + Herramienta para trazado curvo + + + Tool triangle + Herramienta triángulo + + + Point intersection line and axis + + + + Line color + + + + Color + + + + Point intersection curve and axis + + + + + Variables + + Line_ + Left symbol _ in name + Línea_ + + + AngleLine_ + Left symbol _ in name + + + + Arc_ + Left symbol _ in name + + + + Spl_ + Left symbol _ in name + + + + SplPath + Do not add symbol _ to the end of name + + + + + VisToolCurveIntersectAxis + + <b>Intersection curve and axis</b>: angle = %1°; <b>Shift</b> - sticking angle, <b>Enter</b> - finish creation + + + + + VisToolEndLine + + <b>Point at distance and angle</b>: angle = %1°; <b>Shift</b> - sticking angle, <b>Enter</b> - finish creation + + + + + VisToolLineIntersectAxis + + <b>Intersection line and axis</b>: angle = %1°; <b>Shift</b> - sticking angle, <b>Enter</b> - finish creation + + + + + VisToolSplinePath + + <b>Curved path</b>: select three or more points + + + + <b>Curved path</b>: select three or more points, <b>Enter</b> - finish creation + + + + + main + + Pattern making program. + + + + Pattern file. + Archivo de patrón. + + + diff --git a/share/translations/valentina_fr_FR.ts b/share/translations/valentina_fr_FR.ts index 0bdb6ad8b..2aa41c31b 100644 --- a/share/translations/valentina_fr_FR.ts +++ b/share/translations/valentina_fr_FR.ts @@ -229,10 +229,6 @@ Contributors Contributeurs - - Based on Qt %2 (32 bit) - Fonctionne avec Qt %2 (32 bit) - Built on %3 at %4 Compilé le %3 à %4 @@ -258,7 +254,7 @@ DialogAlongLine Point along line - Point le long d'une ligne + Point le long d'une ligne Length @@ -270,7 +266,7 @@ Calculate value - Calculer valeur + Calculer valeur Value of length @@ -352,6 +348,14 @@ Select second point of line Choisir le deuxième point d'une ligne + + Point at distance along line + Point à distance le long d'un ligne + + + Line color + + DialogArc @@ -369,7 +373,7 @@ Calculate value - Calculer la valeur + Calculer la valeur Value of radius @@ -453,7 +457,7 @@ Value of angle of line. - valeur de l'Angle de la ligne. + valeur de l'Angle de la ligne. Error @@ -467,12 +471,16 @@ Angles equal + + Color + + DialogBisector Bisector - Bissectrice + Bissectrice Length @@ -484,7 +492,7 @@ Calculate value - Calculer valeur + Calculer valeur Value of length @@ -578,12 +586,20 @@ Select third point of angle Choisir le troisième point de l'angle + + Point along bisector + point le long d'une bissectrice + + + Line color + + DialogCurveIntersectAxis Curve intersect axis - Intersection courbe, axe + Intersection courbe, axe Angle @@ -591,7 +607,7 @@ Calculate value - Calculer la valeur + Calculer la valeur Value of angle @@ -607,7 +623,7 @@ First point of line - Premier point de la ligne + Premier point de la ligne Curve @@ -669,12 +685,24 @@ Select axis point Choisir un point d'axe + + Point intersect curve and axis + + + + Axis Point + + + + Line color + + DialogCutArc Cut arc - Couper l'arc + Couper l'arc Length @@ -682,7 +710,7 @@ Calculate value - Calculer valeur + Calculer valeur Value of length @@ -702,7 +730,7 @@ Selected curve - Courbe selectionnée + Courbe selectionnée Point label @@ -748,12 +776,24 @@ Variables - Click twice to insert into formula Variables - Double-cliquer pour ajouter à une formule + + Segment an arc + + + + Selected arc + + + + Color + + DialogCutSpline Cut curve - Couper la courbe + Couper la courbe Length @@ -761,7 +801,7 @@ Calculate value - Calculer valeur + Calculer valeur Value of length @@ -827,12 +867,20 @@ Variables - Click twice to insert into formula Variables - Double-cliquer pour ajouter à une formule + + Segmenting a simple curve + + + + Color + + DialogCutSplinePath Cut curve path - Couper le chemin de la courbe + Couper le chemin de la courbe Length @@ -840,7 +888,7 @@ Calculate value - Calculer valeur + Calculer valeur Value of length @@ -906,6 +954,14 @@ Variables - Click twice to insert into formula Variables - Double-cliquer pour ajouter à une formule + + Segment a curved path + + + + Color + + DialogDetail @@ -957,6 +1013,10 @@ Reverse + + Seam allowance tool + + DialogEditWrongFormula @@ -974,7 +1034,7 @@ Calculate value - Valeur calculée + Valeur calculée Value of first angle @@ -1033,7 +1093,7 @@ DialogEndLine Point in the end of a line - Point en fin de ligne + Point en fin de ligne Length @@ -1041,7 +1101,7 @@ Calculate value - Valeur calculée + Valeur calculée Value of length @@ -1119,12 +1179,20 @@ Variables Variables + + Point at distance and angle + Point à distance et angle + + + Line color + + DialogHeight Height - Stature + Stature Point label @@ -1158,6 +1226,18 @@ Select second point of line Choisir le deuxième point de la ligne + + Perpendicular point along line + Point perpendiculaire le long d'une ligne + + + Base Point + + + + Line color + + DialogHistory @@ -1404,6 +1484,22 @@ Can't save measurement Les mesures ne peuvent être enregistrées + + Tables of Variables + + + + Base size: %1 %3; Base height: %2 %3 + + + + Description: "%1" + + + + Data successfully saved. + + DialogIndividualMeasurements @@ -1476,11 +1572,121 @@ Pouces + + DialogLayoutProgress + + Creation a layout + + + + <html><head/><body><p>Finding best position for worpieces. Please, waite.</p></body></html> + + + + Couldn't prepare data for creation layout + + + + Critical error + + + + Wrong paper size + + + + Several workpieces left not arranged, but none of them match for paper + + + + + DialogLayoutSettings + + Creation a layout + + + + Paper size + + + + Templates: + + + + Width: + + + + Height: + + + + ... + ... + + + Rotate workpiece + + + + Rotate by + + + + degree + + + + Creation options + + + + Layout width: + + + + Shift length: + + + + Principle of choosing the next workpiece + + + + Three groups: big, middle, small + + + + Two groups: big, small + + + + Descending area + + + + Millimiters + Millimètres + + + Centimeters + Centimètres + + + Inches + Pouces + + + Pixels + + + DialogLine Line - Ligne + Ligne First point @@ -1502,12 +1708,20 @@ Select second point Choisir le deuxième point + + Line between points + Ligne entre plusieurs points + + + Line color + + DialogLineIntersect Intersection of lines - Intersection des lignes + Intersection des lignes Point label @@ -1541,12 +1755,16 @@ Select second point of second line Choisir le deuxième point de la deuxième ligne + + Point at line intersection + + DialogLineIntersectAxis Line intersect axis - Intersection ligne, axe + Intersection ligne, axe Angle @@ -1554,7 +1772,7 @@ Calculate value - Calcule la valeur + Calcule la valeur Value of angle @@ -1640,6 +1858,22 @@ Select axis point Choisir un point d'axe + + Point intersect line and axis + + + + Axis Point + + + + Second point of line + Deuxième point de la ligne + + + Line color + + DialogMeasurements @@ -1672,7 +1906,7 @@ DialogNormal Normal - Normal + Normal Length @@ -1684,7 +1918,7 @@ Calculate value - Calculer la valeur + Calculer la valeur Value of length @@ -1762,6 +1996,22 @@ Select second point of line Choisir le second point d'une ligne + + Point along perpendicular + Point le long d'une perpendiculaire + + + First point of line + Premier point de la ligne + + + Second point of line + Deuxième point de la ligne + + + Line color + + DialogPatternProperties @@ -1937,7 +2187,7 @@ DialogPointOfContact Point of contact - Point de contact + Point de contact Radius @@ -1949,7 +2199,7 @@ Calculate value - Calculer valeur + Calculer valeur Value of radius @@ -2023,12 +2273,16 @@ Select second point of line Choisir le second point d'une ligne + + Point at intersection of arc and line + Point à l'intersection d'un arc et d'une ligne + DialogPointOfIntersection Point of intersection - Point d'intersection + Point d'intersection Point label @@ -2036,7 +2290,7 @@ vertical point - Point vertical + Point vertical First point of angle @@ -2044,7 +2298,7 @@ horizontal point - point horizontal + point horizontal Second point of angle @@ -2052,14 +2306,30 @@ Select point horizontally - Choisir le point horizontalement + Choisir le point horizontalement + + + Point from X and Y of two other points + + + + X: vertical point + + + + Y: horizontal point + + + + Select point for Y value (horizontal) + DialogShoulderPoint Point of shoulder - Point d'épaule + Point d'épaule Length @@ -2071,7 +2341,7 @@ Calculate value - Calculer valeur + Calculer valeur Value of length @@ -2153,6 +2423,14 @@ Select second point of line Choisir le second point d'une ligne + + Special point on shoulder + Point spécial d'épaule + + + Line color + + DialogSinglePoint @@ -2185,7 +2463,7 @@ DialogSpline Curve - Courbe + Courbe First point @@ -2219,6 +2497,14 @@ Select last point of curve Choisir le dernier point de la courbe + + Simple curve + + + + Color + + DialogSplinePath @@ -2258,6 +2544,10 @@ Select point of curve path Choisir un point sur la courbe + + Color + + DialogStandardMeasurements @@ -2320,12 +2610,16 @@ Parser error: %1 + + Line Angle + + DialogTriangle Triangle - Triangle + Triangle Point label @@ -2363,6 +2657,22 @@ Select second point Choisir le deuxième point + + Triangle tool + + + + First point of the axis + + + + Second point of the axis + + + + Second point of line + Deuxième point de la ligne + DialogUndo @@ -2391,7 +2701,7 @@ DialogUnionDetails Union details - Détail d'union + Détail d'union <html><head/><body><p>Do you really want union details?</p></body></html> @@ -2413,6 +2723,10 @@ Select detail Choisir les détails + + Union tool + + Functions @@ -2570,11 +2884,11 @@ Special point on shoulder. - Point spécial d'épaule. + Point spécial d'épaule. Tool triangle. - Outil triangle. + Outil triangle. Perpendicular point along line @@ -2586,11 +2900,11 @@ Point at intersection of arc and line. - Point à l'intersection d'un arc et d'une ligne. + Point à l'intersection d'un arc et d'une ligne. Tool to make point from x & y of two other points. - Créer un nouveau point à partir des coordonnées x & y de deux points différents. + Créer un nouveau point à partir des coordonnées x & y de deux points différents. Point at distance and angle @@ -2602,7 +2916,7 @@ Point of intersection line and axis - Point à l'intersection d'un axe et d'une ligne + Point à l'intersection d'un axe et d'une ligne ... @@ -2635,19 +2949,19 @@ Curve tool. - Outils courbe. + Outils courbe. Tool for path curve. - Outil pour chemin de courbe. + Outil pour chemin de courbe. Tool for segmenting a curve. - Outil pour segmenter une courbe. + Outil pour segmenter une courbe. Tool segment a pathed curve. - Outil segment d'une courbe le long d'un chemin. + Outil segment d'une courbe le long d'un chemin. Tools for creating arcs. @@ -2659,11 +2973,11 @@ Arc tool. - Outil arc. + Outil arc. Cut arc tool. - Outil Coupe Arc. + Outil Coupe Arc. Tools for creating details. @@ -2675,11 +2989,11 @@ Tool new detail. - Outil nouveau détail. + Outil nouveau détail. Tool for union two details. - outil d'union de deux détails. + outil d'union de deux détails. &File @@ -3013,7 +3327,7 @@ Pour ouvrir un patron vous devez garder les deux fichiers: patron et mesures. Vo Select point vertically - Choisir le point verticallement + Choisir le point verticallement Select detail @@ -3173,6 +3487,82 @@ Voulez-vous sauvegarder les changements ? Individual measurements (*.vit) Mesures individuelles (*.vit) + + Special point on shoulder + Point spécial d'épaule + + + Triangle tool + + + + Point at intersection of arc and line + Point à l'intersection d'un arc et d'une ligne + + + Point from X and Y of two other points + + + + Point intersect line and axis + + + + Simple curve + + + + Curved path + Chemin de courbe + + + Segmenting a simple curve + + + + Segment a curved path + + + + Point intersect curve and axis + + + + Segment an arc + + + + Point intersect arc and axis + + + + Seam allowance tool + + + + Union tool + + + + toolBar + toolBar + + + Last Tool + + + + Activate last used tool again + + + + L + + + + Select point for X value (vertical) + + Measurements @@ -5240,6 +5630,14 @@ Voulez-vous sauvegarder les changements ? Patterns Patrons + + Standard measurements + + + + Layout + + PatternPage @@ -5329,6 +5727,10 @@ Voulez-vous sauvegarder les changements ? The text that appears in the second column header Valeur + + px + + QmuParserErrorMsg @@ -5562,19 +5964,19 @@ Voulez-vous sauvegarder les changements ? Next - Suivant + Suivant Next detail - Détail suivant + Détail suivant Turn - Tourner + Tourner Turn the detail 90 degrees - Tourne le détail de 90 degrés + Tourne le détail de 90 degrés Stop @@ -5586,23 +5988,23 @@ Voulez-vous sauvegarder les changements ? Enlarge letter - Grossier la lettre + Grossier la lettre Enlarge the length of the sheet - Augmenter la longueur de la feuille + Augmenter la longueur de la feuille Reduce sheet - Réduire la feuille + Réduire la feuille Reduce the length of the sheet - Réduire la longueur de la feuille + Réduire la longueur de la feuille Mirroring - Mise en miroir + Mise en miroir Zoom In @@ -5614,15 +6016,15 @@ Voulez-vous sauvegarder les changements ? 0 details left. - 0 détails restant. + 0 détails restant. Collisions not found. - Collisions non trouvées. + Collisions non trouvées. %1 details left. - %1 détails restant(s). + %1 détails restant(s). untitled @@ -5650,7 +6052,7 @@ Voulez-vous sauvegarder les changements ? Collisions found. - Collisions trouvées. + Collisions trouvées. Creating file '%1' failed! %2 @@ -5664,6 +6066,14 @@ Voulez-vous sauvegarder les changements ? Wavefront OBJ (*.obj) + + Layout pages + + + + Layout + + VAbstractConverter @@ -5714,6 +6124,34 @@ Voulez-vous sauvegarder les changements ? Do you really want delete? Voulez vous vraiment supprimer ? + + black + + + + green + + + + blue + + + + dark red + + + + dark green + + + + dark blue + + + + yellow + + VApplication @@ -5741,10 +6179,6 @@ Voulez-vous sauvegarder les changements ? Something's wrong!! Quel que chose ne va pas!! - - Could not remove document file - le fichier n'a pas pu etre supprimé - VContainer @@ -5808,11 +6242,11 @@ Voulez-vous sauvegarder les changements ? Got wrong parameter id. Need only id > 0. - Mauvais id . Seul les id > 0 sont autorisés. + This id is not unique. - Cet idientifiant n'est pas unique. + Could not copy temp file to document file @@ -5820,7 +6254,7 @@ Voulez-vous sauvegarder les changements ? Could not remove document file - le fichier n'a pas pu etre supprimé + @@ -6023,14 +6457,6 @@ Voulez-vous sauvegarder les changements ? Error creating or updating union details Erreur : Création ou mise à jour d'un union de détails - - Got wrong parameter id. Need only id > 0. - Mauvais id . Seul les id > 0 sont autorisés. - - - This id is not unique. - Cet idientifiant n'est pas unique. - File error. Erreur de fichier. @@ -6203,6 +6629,18 @@ Voulez-vous sauvegarder les changements ? Point intersection line and axis Point à l'intersection d'un axe et d'une ligne + + Line color + + + + Color + + + + Point intersection curve and axis + + Variables diff --git a/share/translations/valentina_he_IL.ts b/share/translations/valentina_he_IL.ts index c404d266f..2d2847b9d 100644 --- a/share/translations/valentina_he_IL.ts +++ b/share/translations/valentina_he_IL.ts @@ -252,10 +252,6 @@ DialogAlongLine - - Point along line - - Length אורך @@ -266,7 +262,7 @@ Calculate value - לחשב ערך + לחשב ערך Value of length @@ -348,6 +344,14 @@ Select second point of line + + Point at distance along line + + + + Line color + + DialogArc @@ -365,7 +369,7 @@ Calculate value - לחשב ערך + לחשב ערך Value of radius @@ -447,10 +451,6 @@ Variables - - Value of angle of line. - - Error @@ -463,13 +463,13 @@ Angles equal + + Color + + DialogBisector - - Bisector - - Length אורך @@ -480,7 +480,7 @@ Calculate value - לחשב ערך + לחשב ערך Value of length @@ -574,21 +574,21 @@ Select third point of angle + + Point along bisector + + + + Line color + + DialogCurveIntersectAxis - - Curve intersect axis - - Angle - - Calculate value - לחשב ערך - Value of angle @@ -601,10 +601,6 @@ Axis point - - First point of line - - Curve עקומה @@ -665,20 +661,28 @@ Select axis point + + Point intersect curve and axis + + + + Axis Point + + + + Line color + + DialogCutArc - - Cut arc - - Length אורך Calculate value - לחשב ערך + לחשב ערך Value of length @@ -696,10 +700,6 @@ Arc - - Selected curve - - Point label תווית הנקודה @@ -744,20 +744,28 @@ Variables - Click twice to insert into formula + + Segment an arc + + + + Selected arc + + + + Color + + DialogCutSpline - - Cut curve - - Length אורך Calculate value - לחשב ערך + לחשב ערך Value of length @@ -823,20 +831,24 @@ Variables - Click twice to insert into formula + + Segmenting a simple curve + + + + Color + + DialogCutSplinePath - - Cut curve path - - Length אורך Calculate value - לחשב ערך + לחשב ערך Value of length @@ -902,6 +914,14 @@ Variables - Click twice to insert into formula + + Segment a curved path + + + + Color + + DialogDetail @@ -953,6 +973,10 @@ Reverse + + Seam allowance tool + + DialogEditWrongFormula @@ -968,10 +992,6 @@ Insert variable into formula - - Calculate value - לחשב ערך - Value of first angle @@ -1027,17 +1047,13 @@ DialogEndLine - - Point in the end of a line - - Length אורך Calculate value - לחשב ערך + לחשב ערך Value of length @@ -1115,13 +1131,17 @@ Variables + + Point at distance and angle + + + + Line color + + DialogHeight - - Height - - Point label תווית הנקודה @@ -1154,6 +1174,18 @@ Select second point of line + + Perpendicular point along line + + + + Base Point + + + + Line color + + DialogHistory @@ -1400,6 +1432,22 @@ Can't save measurement + + Tables of Variables + + + + Base size: %1 %3; Base height: %2 %3 + + + + Description: "%1" + + + + Data successfully saved. + + DialogIndividualMeasurements @@ -1472,11 +1520,117 @@ + + DialogLayoutProgress + + Creation a layout + + + + <html><head/><body><p>Finding best position for worpieces. Please, waite.</p></body></html> + + + + Couldn't prepare data for creation layout + + + + Critical error + + + + Wrong paper size + + + + Several workpieces left not arranged, but none of them match for paper + + + + + DialogLayoutSettings + + Creation a layout + + + + Paper size + + + + Templates: + + + + Width: + + + + Height: + + + + Rotate workpiece + + + + Rotate by + + + + degree + + + + Creation options + + + + Layout width: + + + + Shift length: + + + + Principle of choosing the next workpiece + + + + Three groups: big, middle, small + + + + Two groups: big, small + + + + Descending area + + + + Millimiters + + + + Centimeters + + + + Inches + + + + Pixels + + + DialogLine Line - קו + קו First point @@ -1498,12 +1652,20 @@ Select second point לבחור נקודה שנייה + + Line between points + + + + Line color + + DialogLineIntersect Intersection of lines - הצטלבות של קווים + הצטלבות של קווים Point label @@ -1537,21 +1699,17 @@ Select second point of second line + + Point at line intersection + + DialogLineIntersectAxis - - Line intersect axis - - Angle - - Calculate value - לחשב ערך - Value of angle @@ -1636,6 +1794,22 @@ Select axis point + + Point intersect line and axis + + + + Axis Point + + + + Second point of line + + + + Line color + + DialogMeasurements @@ -1666,10 +1840,6 @@ DialogNormal - - Normal - - Length אורך @@ -1680,7 +1850,7 @@ Calculate value - לחשב ערך + לחשב ערך Value of length @@ -1758,6 +1928,22 @@ Select second point of line + + Point along perpendicular + + + + First point of line + + + + Second point of line + + + + Line color + + DialogPatternProperties @@ -1931,10 +2117,6 @@ DialogPointOfContact - - Point of contact - - Radius רדיוס @@ -1945,7 +2127,7 @@ Calculate value - לחשב ערך + לחשב ערך Value of radius @@ -2019,44 +2201,44 @@ Select second point of line + + Point at intersection of arc and line + + DialogPointOfIntersection - - Point of intersection - - Point label תווית הנקודה - - vertical point - - First point of angle - - horizontal point - - Second point of angle - Select point horizontally + Point from X and Y of two other points + + + + X: vertical point + + + + Y: horizontal point + + + + Select point for Y value (horizontal) DialogShoulderPoint - - Point of shoulder - - Length אורך @@ -2067,7 +2249,7 @@ Calculate value - לחשב ערך + לחשב ערך Value of length @@ -2149,6 +2331,14 @@ Select second point of line + + Special point on shoulder + + + + Line color + + DialogSinglePoint @@ -2181,7 +2371,7 @@ DialogSpline Curve - עקומה + עקומה First point @@ -2215,6 +2405,14 @@ Select last point of curve + + Simple curve + + + + Color + + DialogSplinePath @@ -2254,6 +2452,10 @@ Select point of curve path + + Color + + DialogStandardMeasurements @@ -2316,13 +2518,13 @@ Parser error: %1 + + Line Angle + + DialogTriangle - - Triangle - - Point label תווית הנקודה @@ -2359,6 +2561,22 @@ Select second point לבחור נקודה שנייה + + Triangle tool + + + + First point of the axis + + + + Second point of the axis + + + + Second point of line + + DialogUndo @@ -2385,10 +2603,6 @@ DialogUnionDetails - - Union details - - <html><head/><body><p>Do you really want union details?</p></body></html> @@ -2409,6 +2623,10 @@ Select detail + + Union tool + + Functions @@ -2563,14 +2781,6 @@ Point along perpendicular - - Special point on shoulder. - - - - Tool triangle. - - Perpendicular point along line @@ -2579,14 +2789,6 @@ Point along bisector - - Point at intersection of arc and line. - - - - Tool to make point from x & y of two other points. - - Point at distance and angle @@ -2595,10 +2797,6 @@ Point at distance along line - - Point of intersection line and axis - - ... @@ -2627,22 +2825,6 @@ Curve עקומה - - Curve tool. - - - - Tool for path curve. - - - - Tool for segmenting a curve. - - - - Tool segment a pathed curve. - - Tools for creating arcs. @@ -2651,14 +2833,6 @@ Arc - - Arc tool. - - - - Cut arc tool. - - Tools for creating details. @@ -2667,14 +2841,6 @@ Detail - - Tool new detail. - - - - Tool for union two details. - - &File @@ -3004,10 +3170,6 @@ For opening pattern need keep both files: pattern and measurements. Do you want Select first point of axis - - Select point vertically - - Select detail @@ -3165,6 +3327,82 @@ Do you want to save your changes? Individual measurements (*.vit) + + Special point on shoulder + + + + Triangle tool + + + + Point at intersection of arc and line + + + + Point from X and Y of two other points + + + + Point intersect line and axis + + + + Simple curve + + + + Curved path + + + + Segmenting a simple curve + + + + Segment a curved path + + + + Point intersect curve and axis + + + + Segment an arc + + + + Point intersect arc and axis + + + + Seam allowance tool + + + + Union tool + + + + toolBar + + + + Last Tool + + + + Activate last used tool again + + + + L + + + + Select point for X value (vertical) + + Measurements @@ -5232,6 +5470,14 @@ Do you want to save your changes? Patterns + + Standard measurements + + + + Layout + + PatternPage @@ -5321,6 +5567,10 @@ Do you want to save your changes? The text that appears in the second column header + + px + + QmuParserErrorMsg @@ -5552,22 +5802,6 @@ Do you want to save your changes? Save layout - - Next - - - - Next detail - - - - Turn - - - - Turn the detail 90 degrees - - Stop @@ -5576,26 +5810,6 @@ Do you want to save your changes? Stop laying - - Enlarge letter - - - - Enlarge the length of the sheet - - - - Reduce sheet - - - - Reduce the length of the sheet - - - - Mirroring - - Zoom In @@ -5604,18 +5818,6 @@ Do you want to save your changes? Zoom Out - - 0 details left. - - - - Collisions not found. - - - - %1 details left. - - untitled @@ -5640,10 +5842,6 @@ Do you want to save your changes? EPS files (*.eps) - - Collisions found. - - Creating file '%1' failed! %2 @@ -5656,6 +5854,14 @@ Do you want to save your changes? Wavefront OBJ (*.obj) + + Layout pages + + + + Layout + + VAbstractConverter @@ -5706,6 +5912,34 @@ Do you want to save your changes? Do you really want delete? + + black + + + + green + + + + blue + + + + dark red + + + + dark green + + + + dark blue + + + + yellow + + VApplication @@ -6181,6 +6415,18 @@ Do you want to save your changes? Point intersection line and axis + + Line color + + + + Color + + + + Point intersection curve and axis + + Variables diff --git a/share/translations/valentina_id_ID.ts b/share/translations/valentina_id_ID.ts index 44fd724af..b87094384 100644 --- a/share/translations/valentina_id_ID.ts +++ b/share/translations/valentina_id_ID.ts @@ -4,7 +4,6 @@ AddDet - Add detail tambahkan detail @@ -12,7 +11,6 @@ AddPatternPiece - Add pattern piece %1 Tambahkan Potongan Pola %1 @@ -20,7 +18,6 @@ AddToCalc - Add object tambahkan obyek @@ -28,7 +25,6 @@ AddUnionDetails - Add union details Tambah rincian himpunan @@ -36,67 +32,54 @@ CommunityPage - Server Server - Server name/IP Nama Server/IP - Secure connection Sambungan Aman - Proxy settings Setingan Proxy - Use Proxy Gunakan Proxy - Proxy address Alamat Proxy - Proxy port Saluran Proxy - Proxy user Pengguna Proxy - Proxy pass - User settings Pengaturan Pengguna - User Name Nama Pengguna - Save password Simpan sandi - Password Sandi @@ -104,42 +87,34 @@ ConfigDialog - Apply Terapkan - &Cancel &Batalkan - &Ok &Ok - Config Dialog Dialog konfigurasi - Configuration Konfigurasi - Pattern Pola - Community Komunitas - Paths @@ -147,92 +122,74 @@ ConfigurationPage - Setup user interface language updated and will be used the next time start Pengaturan bahasa antarmuka pengguna diperbarui dan akan digunakan waktu mulai berikutnya - Default unit updated and will be used the next pattern creation Unit standar diperbarui dan akan digunakan pada pembuatan pola berikutnya - Save Simpan - Auto-save modified pattern Simpan otomatis Pola yang telah dimodifikasi - - Interval: - selang waktu - - - min minimal - + Interval: + selang waktu + + Language Bahasa - GUI language Bahasa GUI - Decimal separator parts komponen pemisah desimal - With OS options (%1) dengan pilihan OS (%1) - Default unit Unit Standar - Centimeters Centimeter - Millimiters Milimeter - Inches Inchi - Label language label bahasa - Send crash reports Kirim laporan kerusakan - Send crash reports (recommended) Kirim laporan kerusakan (disarankan) - After each crash Valentina collect information that may help us fix a problem. We do not collect any personal information. Find more about what <a href="https://bitbucket.org/dismine/valentina/wiki/manual/Crash_reports">kind of information</a> we collect. Setelah setiap kerusakan Valentina mengumpulkan informasi yang dapat membantu kami memperbaiki suatu masalah. Kami tidak mengumpulkan informasi pribadi apapun. Temukan lebih lanjut tentang apa <a href="https://bitbucket.org/dismine/valentina/wiki/manual/Crash_reports"> jenis informasi </a> kami kumpulkan. @@ -240,7 +197,6 @@ DelTool - Delete tool Hapus alat bantu @@ -248,7 +204,6 @@ DeleteDetail - Delete tool Hapus alat bantu @@ -256,7 +211,6 @@ DeletePatternPiece - Delete pattern piece %1 Hapus bagian pola % 1 @@ -264,1020 +218,870 @@ DialogAboutApp - About Valentina Mengenai Valentina - Valentina version Versi Valentina - - Build revision: - - - - Contributors para kontributor - Based on Qt %2 (32 bit) - Berdasarkan pada Qt %2 (32 bit) - - - Built on %3 at %4 Dibuat pada %3 at %4 - Web site : %1 Situs web : % 1 - Warning peringatan - Cannot open your default browser Tidak dapat membuka peramban bawaan Anda + + Build revision: + + DialogAlongLine - Point along line - Titik di sepanjang garis + Titik di sepanjang garis - Length panjang - Insert variable into the formula Masukkan variabel ke dalam rumus - Calculate value - Hitung nilai + Hitung nilai - Value of length Nilai panjang - <html><head/><body><p>Show full calculation in message box</p></body></html> <html><head/><body><p>Tampilkan penuh perhitungan dalam kotak pesan</p></body></html> - Point label label titik - First point Titik pertama - First point of line Titik pertama dari baris - Second point titik kedua - Second point of line titik kedua dari baris - Type of line Jenis baris - Show line from first point to this point Tampilkan garis dari titik pertama ke titik ini - Input data masukkan data - Size and height Ukuran dan tinggi - Measurements pengukuran - Increments penambahan - Length of lines Panjang garis - Length of arcs Panjang busur - Length of curves Panjang kurva - Angle of lines Sudut garis - Hide empty measurements Sembunyikan pengukuran kosong - Variables - Click twice to insert into formula Variabel - Klik dua kali untuk menyisipkan ke dalam rumus - Select second point of line Pilih titik kedua dari garis + + Point at distance along line + + + + Line color + + DialogArc - Arc busur - Radius radius - Insert variable into the formula sisipkan variabel ke dalam formula - - - Calculate value - hitung nilai + hitung nilai - Value of radius nilai radius - - - <html><head/><body><p>Show full calculation in message box</p></body></html> <html><head/><body><p>Tampilkan perhitungan penuh dalam kotak pesa</p></body></html> - - Insert variable into formula - sisipkan variabel ke dalam formula - - - - Value of first angle - nilai dari sudut pertama - - - - Measurements - pengukuran - - - First angle sudut pertama - + Insert variable into formula + sisipkan variabel ke dalam formula + + + Value of first angle + nilai dari sudut pertama + + Second angle sudut kedua - Insert marked variable into formula sisipkan variabel yang ditandai ke dalam formula - Value of second angle nilai dari sudut kedua - Center point titik tengah - Select point of center of arc pilih titik tengah dari busur - Input data masukkan data - Size and height ukuran dan tinggi - + Measurements + pengukuran + + Increments tambahan - Length of lines panjang garis - Length of arcs panjang busur - Length of curves panjang kurva - Angle of lines sudut garis - Hide empty measurements sembunyikan pengukuran yang kosong - Variables variabel - Value of angle of line. - nilai sudut garis + nilai sudut garis - - - Error - Radius can't be negative - - Angles equal + + Color + + DialogBisector - - Bisector - - - - Length panjang - Insert marked variable into the formula sisipkan variabel yang ditandai ke dalam rumus - Calculate value - hitung nilai + hitung nilai - Value of length nilai panjang - <html><head/><body><p>Show full calculation in message box</p></body></html> <html><head/><body><p>Tampilkan penuh perhitungan dalam kotak pesan</p></body></html> - Point label label titik - First point Titik pertama - First point of angle Titik pertama dari sudut - Second point titik kedua - Second point of angle titik kedua dari sudut - Third point titik ketiga - Third point of angle titik ketiga dari sudut - Type of line Jenis baris - Show line from second point to this point Tampilkan garis dari titik kedua ke titik ini - Input data masukan data - Size and height ukuran dan panjang - Measurements pengukuran - Increments tambahan - Length of lines Panjang garis - Length of arcs Panjang busur - Length of curves Panjang kurva - Angle of lines Sudut garis - Hide empty measurements Sembunyikan pengukuran kosong - Variables - Click twice to insert into formula Variabel - Klik dua kali untuk menyisipkan ke dalam rumus - Select second point of angle Pilih titik kedua dari sudut - Select third point of angle Pilih titik ketiga dari garis + + Point along bisector + + + + Line color + + DialogCurveIntersectAxis - Curve intersect axis - sumbu perpotongan kurva + sumbu perpotongan kurva - Angle sudut - Calculate value - Hitung nilai + Hitung nilai - Value of angle nilai dari sudut - <html><head/><body><p>Show full calculation in message box</p></body></html> <html><head/><body><p>Tampilkan penuh perhitungan dalam kotak pesan</p></body></html> - Axis point titik sumbu - - First point of line - Titik pertama dari baris + Titik pertama dari baris - Curve kurva - Point label label titik - Type of line Jenis baris - Show line from first point to this point Tampilkan garis dari titik pertama ke titik ini - Input data masukan data - Size and height ukuran dan panjang - Measurements pengukuran - Increments tambahan - Length of lines panjang garis - Length of arcs panjang busur - Length of curves Panjang kurva - Angle of lines Sudut garis - Hide empty measurements Sembunyikan pengukuran kosong - Variables variabel - Select axis point pilih titik sumbu + + Point intersect curve and axis + + + + Axis Point + + + + Line color + + DialogCutArc - + Cut arc + potong busur + + Length panjang - - Cut arc - potong busur - - - Calculate value - Hitung nilai + Hitung nilai - Value of length Nilai panjang - _ - - <html><head/><body><p>Show full calculation in message box</p></body></html> <html><head/><body><p>Tampilkan perhitungan penuh dalam kotak pesan</p></body></html> - Arc busur - Selected curve - kurva yang telah dipilih + kurva yang telah dipilih - Point label label titik - Input data masukan data - Size and height ukuran dan panjang - Measurements pengukuran - Increments tambahan - Length of lines panjang garis - Length of arcs panjang busur - Length of curves Panjang kurva - Angle of lines Sudut garis - Hide empty measurements Sembunyikan pengukuran kosong - Variables - Click twice to insert into formula Variabel - Klik dua kali untuk menyisipkan ke dalam rumus + + Segment an arc + + + + Selected arc + + + + Color + + DialogCutSpline - + Cut curve + potong kurva + + Length panjang - - Cut curve - potong kurva - - - Calculate value - Hitung nilai + Hitung nilai - Value of length Nilai panjang - _ _ - <html><head/><body><p>Show full calculation in message box</p></body></html> <html><head/><body><p>Tampilkan perhitungan penuh dalam kotak pesan</p></body></html> - Curve kurva - Selected curve kurva yang telah dipilih - Point label label titik - Input data masukan data - Size and height ukuran dan panjang - Measurements pengukuran - Increments tambahan - Length of lines panjang garis - Length of arcs panjang busur - Length of curves Panjang kurva - Angle of lines Sudut garis - Hide empty measurements Sembunyikan pengukuran kosong - Variables - Click twice to insert into formula Variabel - Klik dua kali untuk menyisipkan ke dalam rumus + + Segmenting a simple curve + + + + Color + + DialogCutSplinePath - + Cut curve path + potong jalur curva + + Length panjang - - Cut curve path - potong jalur curva - - - Calculate value - Hitung nilai + Hitung nilai - Value of length Nilai panjang - _ _ - <html><head/><body><p>Show full calculation in message box</p></body></html> <html><head/><body><p>Tampilkan perhitungan penuh dalam kotak pesan</p></body></html> - Curve kurva - Selected curve path jalur kurva yang telah dipilih - Point label label titik - Input data masukan data - Size and height ukuran dan panjang - Measurements pengukuran - Increments tambahan - Length of lines panjang garis - Length of arcs panjang busur - Length of curves Panjang kurva - Angle of lines Sudut garis - Hide empty measurements Sembunyikan pengukuran kosong - Variables - Click twice to insert into formula Variabel - Klik dua kali untuk menyisipkan ke dalam rumus + + Segment a curved path + + + + Color + + DialogDetail - - Detail rincial - Bias X - - - cm cm - Bias Y - - Reverse - - - - Options pilihan - Name of detail nama rincian - Seam allowance kampuh - Width lebar - Closed tertutup - Delete hapus - Got wrong scene object. Ignore. + + Reverse + + + + Seam allowance tool + + DialogEditWrongFormula - Edit formula edit rumus - Formula rumus - Insert variable into formula sisipkan variabel ke dalam rumus - Calculate value - Hitung nilai + Hitung nilai - Value of first angle nilai dari sudut pertama - _ _ - <html><head/><body><p>Show full calculation in message box</p></body></html> <html><head/><body><p>Tampilkan perhitungan penuh dalam kotak pesan</p></body></html> - Input data masukan data - Size and height ukuran dan panjang - Measurements pengukuran - Increments tambahan - Length of lines panjang garis - Length of arcs panjang busur - Length of curves Panjang kurva - Angle of lines Sudut garis - Hide empty measurements Sembunyikan pengukuran kosong - Variables variabel @@ -1285,284 +1089,228 @@ DialogEndLine - - Point in the end of a line - - - - Length panjang - - - Calculate value - - - - Value of length - - <html><head/><body><p>Show full calculation in message box</p></body></html> - Angle sudut - Value of angle nilai dari sudut - Base point - First point of line Titik pertama dari baris - Point label label titik - Type of line Jenis baris - Show line from first point to this point Tampilkan garis dari titik pertama ke titik ini - Input data - Size and height - Measurements pengukuran - Increments - Length of lines - Length of arcs - Length of curves - Angle of lines - Hide empty measurements - Variables variabel + + Point at distance and angle + + + + Line color + + DialogHeight - - Height - - - - Point label label titik - Base point - - - - First point of line Titik pertama dari baris - Second point of line titik kedua dari baris - Type of line Jenis baris - Show line from first point to our point - Select first point of line - Select second point of line Pilih titik kedua dari garis + + Perpendicular point along line + + + + Base Point + + + + Line color + + DialogHistory - History - - Tool - - - - - Can't create record. - %1 - Base point - - %1_%2 - Line from point %1 to point %2 - %3 - Point along line %1_%2 - %1 - Point of shoulder - %3 - normal to line %1_%2 - %4 - bisector of angle %1_%2_%3 - %5 - intersection of lines %1_%2 and %3_%4 - Curve %1_%2 - Arc with center in point %1 - Curve point %1 - %4 - point of contact of arc with the center in point %1 and line %2_%3 - Point of perpendicular from point %1 to line %2_%3 - Triangle: axis %1_%2, points %3 and %4 - %1 - point of intersection %2 and %3 - %1 - cut arc with center %2 - %1 - cut curve %2_%3 - %1 - cut curve path %2 - %1 - point of intersection line %2_%3 and axis through point %4 - %1 - point of intersection curve and axis through point %2 @@ -1570,539 +1318,551 @@ DialogIncrements - - Increments - - Email - Surel - - - - - Name - Nama - - - - - The calculated value - - - - - - Base value - - - - - - In sizes - - - - - - - Description - - - - - Measurements pengukuran - Load another measurements table - Personal information - Given name - Family name - Birth date - Sex - + Email + Surel + + Hide empty measurements - - + Name + Nama + + + The calculated value + + + + Base value + + + + In sizes + + + In heights - + Description + + + Lines - Line - - - Length panjang - Curves - Curve kurva - Arcs - Arc busur - - - File error. - male - female - Could not save GivenName - Could not save FamilyName - Could not save Email - Could not save Sex - Could not save BirthDate - Measurements use different units than pattern. This pattern required measurements in %1 - Individual measurements (*.vit) - - Open file Buka file - - Wrong units. - Standard measurements (*.vst) - Name_%1 - Can't save measurement + + Tables of Variables + + + + Base size: %1 %3; Base height: %2 %3 + + + + Description: "%1" + + + + Data successfully saved. + + DialogIndividualMeasurements - Individual measurements - Pattern piece name Nama potongan pola - Exist measurements - - Path: - Given name: - Family name: - New measurements - Units: - Could not create measurements file - Please try again or change file - - File error. - - Individual measurements (*.vit) - Open file - Where save measurements? - Centimeters Centimeter - Millimiters Milimeter - Inches Inchi - DialogLine + DialogLayoutProgress - - Line + Creation a layout - + <html><head/><body><p>Finding best position for worpieces. Please, waite.</p></body></html> + + + + Couldn't prepare data for creation layout + + + + Critical error + + + + Wrong paper size + + + + Several workpieces left not arranged, but none of them match for paper + + + + + DialogLayoutSettings + + Creation a layout + + + + Paper size + + + + Templates: + + + + Width: + + + + Height: + + + + Rotate workpiece + + + + Rotate by + + + + degree + + + + Creation options + + + + Layout width: + + + + Shift length: + + + + Principle of choosing the next workpiece + + + + Three groups: big, middle, small + + + + Two groups: big, small + + + + Descending area + + + + Millimiters + Milimeter + + + Centimeters + Centimeter + + + Inches + Inchi + + + Pixels + + + + + DialogLine + First point Titik pertama - Second point titik kedua - Type of line Jenis baris - Show line from first point to this point Tampilkan garis dari titik pertama ke titik ini - Select second point + + Line between points + + + + Line color + + DialogLineIntersect - - Intersection of lines - - - - Point label label titik - First line - - First point Titik pertama - - Second point titik kedua - Second line - Select second point of first line - Select first point of second line - Select second point of second line + + Point at line intersection + + DialogLineIntersectAxis - - Line intersect axis - - - - Angle sudut - - Calculate value - - - - Value of angle nilai dari sudut - <html><head/><body><p>Show full calculation in message box</p></body></html> - Axis point titik sumbu - - - First point of line Titik pertama dari baris - First line point - Second line point - Point label label titik - Type of line Jenis baris - Show line from first point to this point Tampilkan garis dari titik pertama ke titik ini - Input data - Size and height - Measurements pengukuran - Increments - Length of lines - Length of arcs - Length of curves - Angle of lines - Hide empty measurements - Variables variabel - Select second point of line Pilih titik kedua dari garis - Select axis point pilih titik sumbu + + Point intersect line and axis + + + + Axis Point + + + + Second point of line + titik kedua dari baris + + + Line color + + DialogMeasurements - Measurements pengukuran - <html><head/><body><p><span style=" font-size:18pt;">Please, choose pattern type.</span></p></body></html> - Graduation - Use for creation pattern standard measurement table - Individual - Use for creation pattern individual measurements @@ -2110,160 +1870,137 @@ DialogNormal - - Normal - - - - Length panjang - Insert variable into formula - - Calculate value - - - - Value of length - <html><head/><body><p>Show full calculation in message box</p></body></html> - Point label label titik - First point Titik pertama - Second point titik kedua - Additional angle degrees - Type of line Jenis baris - Show line from first point to this point Tampilkan garis dari titik pertama ke titik ini - Input data - Size and height - Measurements pengukuran - Increments - Length of lines - Length of arcs - Length of curves - Angle of lines - Hide empty measurements - Variables - Click twice to insert into formula Variabel - Klik dua kali untuk menyisipkan ke dalam rumus - Select second point of line Pilih titik kedua dari garis + + Point along perpendicular + + + + First point of line + Titik pertama dari baris + + + Second point of line + titik kedua dari baris + + + Line color + + DialogPatternProperties - Pattern properties - Description - Author name Nama Pembuat - Pattern description Keterangan Pola - For technical notes. Untuk catatan teknis - Heights and Sizes - All heights (cm) - All sizes (cm) @@ -2271,174 +2008,134 @@ DialogPatternXmlEdit - XML Editor - Value : - Name : - <No selection> - Type : - Add attribute - Add son - Remove attribute - Remove node - Set - Cancel - Apply changes - Undo last - Immediate apply - Base selection - All pattern pieces - - - - No changes - Cannot delete previously created node - No changes left - Cannot undo change - - <no value> - - Unchanged - Cannot delete previously created attribute - Node Name - - Name: - Node Value (may be empty) - - Value: - Attribute Name - Attribute Value - No selection - Root node - Node - Attribute @@ -2446,308 +2143,244 @@ DialogPointOfContact - - Point of contact - - - - Radius radius - Insert variable into formula - - Calculate value - - - - Value of radius nilai radius - <html><head/><body><p>Show full calculation in message box</p></body></html> - Point label label titik - Center of arc - - Select point of center of arc pilih titik tengah dari busur - Top of the line - End of the line - Input data - Size and height - Measurements pengukuran - Increments - Length of lines - Length of arcs - Length of curves - Angle of lines - Hide empty measurements - Variables - Click twice to insert into formula. - Select second point of line Pilih titik kedua dari garis + + Point at intersection of arc and line + + DialogPointOfIntersection - - Point of intersection - - - - Point label label titik - - vertical point - - - - First point of angle Titik pertama dari sudut - - horizontal point - - - - Second point of angle titik kedua dari sudut - - Select point horizontally + Point from X and Y of two other points + + + + X: vertical point + + + + Y: horizontal point + + + + Select point for Y value (horizontal) DialogShoulderPoint - - Point of shoulder - - - - Length panjang - Insert variable into formula - - Calculate value - - - - Value of length - <html><head/><body><p>Show full calculation in message box</p></body></html> - Point label label titik - First point Titik pertama - Second point titik kedua - Third point titik ketiga - Type of line Jenis baris - Show line from first point to our point - Input data - Size and height - Measurements pengukuran - Increments - Length of lines - Length of arcs - Length of curves - Angle of lines - Hide empty measurements - Variables - Click twice to insert into formula Variabel - Klik dua kali untuk menyisipkan ke dalam rumus - Select first point of line - Select second point of line Pilih titik kedua dari garis + + Special point on shoulder + + + + Line color + + DialogSinglePoint - Single point - Coordinates on the sheet - Coordinates - Y coordinate - X coordinate - Point label label titik @@ -2755,118 +2388,104 @@ DialogSpline - - Curve - kurva - - - First point Titik pertama - Length ratio of the first control point - The angle of the first control point - Second point titik kedua - Length ratio of the second control point - The angle of the second control point - Coefficient of curvature of the curve - Select last point of curve + + Simple curve + + + + Color + + DialogSplinePath - Curved path - Point of curve - Length ratio of the first control point - The angle of the first control point - Length ratio of the second control point - The angle of the second control point - List of points - Coefficient of curvature of the curve - Select point of curve path + + Color + + DialogStandardMeasurements - Standard table - Pattern piece name Nama potongan pola - Standard measurements table - File error. @@ -2874,143 +2493,124 @@ DialogTool - - - - - Error - - - Empty field - Value can't be 0 - Value - - - Parser error: %1 - - - - Height - Size - Line length - Arc length - Curve length + + Parser error: %1 + + + + Line Angle + + DialogTriangle - - Triangle - - - - Point label label titik - First point of axis - - - - First point of line Titik pertama dari baris - Second point of axis - First point Titik pertama - Second point titik kedua - Select second point of axis - Select first point - Select second point + + Triangle tool + + + + First point of the axis + + + + Second point of the axis + + + + Second point of line + titik kedua dari baris + DialogUndo - Broken formula - Error while calculation formula. You can try undo last operation or fix broken formula. - &Undo - &Fix formula - &Cancel &Batalkan @@ -3018,185 +2618,153 @@ DialogUnionDetails - + <html><head/><body><p>Do you really want union details?</p></body></html> + + + Select first point - Select second point - - Select another second point - Select detail - - Union details - - - - - <html><head/><body><p>Do you really want union details?</p></body></html> + Union tool Functions - sin sine function - cos cosine function - tan tangens function - asin arcus sine function - acos arcus cosine function - atan arcus tangens function - sinh hyperbolic sine function - cosh hyperbolic cosine - tanh hyperbolic tangens function - asinh hyperbolic arcus sine function - acosh hyperbolic arcus tangens function - atanh hyperbolic arcur tangens function - log2 logarithm to the base 2 - log10 logarithm to the base 10 - log logarithm to the base 10 - ln logarithm to base e (2.71828...) - exp e raised to the power of x - sqrt square root of a value - sign sign function -1 if x<0; 1 if x>0 - rint round to nearest integer - abs absolute value - min min of all arguments minimal - max max of all arguments - sum sum of all arguments - avg mean value of all arguments @@ -3205,7 +2773,6 @@ InternalStrings - The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -3213,1589 +2780,1308 @@ MainWindow - Valentina - Tools for creating points. - Point - - Point at distance and angle - - - - - Special point on shoulder. - - - - - Point at intersection of arc and line. - - - - - Point along bisector - - - - Point along perpendicular - - Point at distance along line - - - - Perpendicular point along line - - Tool triangle. + Point along bisector - - Tool to make point from x & y of two other points. + Point at distance and angle - - Tools for creating lines. + Point at distance along line - - Line - - - - - Line between points - - - - - Point at line intersection - - - - - Tools for creating curves. - - - - - Curve - kurva - - - - Curve tool. - - - - - Tool for path curve. - - - - - Tool segment a pathed curve. - - - - - Tool for segmenting a curve. - - - - - Point of intersection line and axis - - - - - - ... - + Tools for creating lines. + + + + Line + + + + Line between points + + + + Point at line intersection + + + + Tools for creating curves. + + + + Curve + kurva + + Tools for creating arcs. - Arc busur - - Arc tool. - - - - - Cut arc tool. - - - - Tools for creating details. - Detail rincial - - Tool new detail. - - - - - Tool for union two details. - - - - &File - &Help - &Pattern piece - Measurements pengukuran - Window - Toolbar files - ToolBar modes - Toolbar pattern - Toolbar options - Toolbar tools - Tool options - - Save &As... - - - - - Export pattern (layout) - - - - - About &Qt - - - - - &About Valentina - - - - - E&xit - - - - - Exit the application - - - - - Preferences - - - - - Zoom in - - - - - Original zoom - - - - - Original Zoom - - - - - Zoom fit best - - - - - Ctrl+= - - - - - Stop - - - - - Stop using tool - - - - - Repot Bug... - - - - - Report bug - - - - - Close window - - - - - Online help - - - - - Show online help - - - - - zoom in - - - - - - Zoom out - - - - - Edit pattern XML code - - - - - Pattern properties - - - - New - &New - Create a new pattern - Ctrl+N - Open - &Open - Open file with pattern - Save Simpan - &Save - Save pattern - Ctrl+S - - Save as + Save &As... - Save not yet saved pattern - Ctrl+Shift+S - Draw - Draw mode - Ctrl+W - Details - Details mode - Ctrl+E - - Pointer tools - New pattern piece - Add new pattern piece - Ctrl+Shift+N - - Change the label of pattern piece - Table of variables - Tables of variables - Ctrl+T - History - Ctrl+H - + Export pattern (layout) + + + Create layout - Ctrl+L - - About Qt + About &Qt + + + + &About Valentina + + + + E&xit + + + + Exit the application - Ctrl+Q - + Preferences + + + + Pattern properties + + + + Zoom in + + + + zoom in + + + + Zoom out + + + + Edit pattern XML code + + + + Original zoom + + + + Original Zoom + + + + Zoom fit best + + + + Ctrl+= + + + + Stop + + + + Stop using tool + + + + Repot Bug... + + + + Report bug + + + + Close window + + + + Online help + + + + Show online help + + + Pattern piece %1 - - Pattern piece: - - - - - Enter a new label for the pattern piece. - - - - - - - Select point - - - - Individual measurements is under development - There is no way create individual measurements file independent on the pattern file. For opening pattern need keep both files: pattern and measurements. Do you want continue? - + Select point + + + Select first point - - - Select first point of line - Select first point of angle - Select first point of first line - Select first point curve - Select simple curve - Select point of center of arc pilih titik tengah dari busur - Select point of curve path - Select curve path - Select points, arcs, curves clockwise. - Select base point - Select first point of axis - - Select point vertically - - - - Select detail - Select arc - Select curve - - Size: + About Qt - - pattern - - - - - Critical error! - - - - - Error parsing file (std::bad_alloc). - - - - - Bad id. - - - - - - Could not save file - - - - - &Undo - - - - - &Redo - - - - - This file already opened in another window. - - - - - Wrong units. - - - - - Application doesn't support standard table with inches. - - - - - File error. - - - - - Valentina didn't shut down correctly. Do you want reopen files (%1) you had open? - - - - - Reopen files. - - - - - The measurements file <br/><br/> <b>%1</b> <br/><br/> %3 - - - - - could not be found. Do you want to update the file location - - - - - Standard measurements (*.vst) - - - - - Individual measurements (*.vit) - - - - - File loaded - - - - Height: - + Size: + + + Pattern Piece: - - Pattern files (*.val) - + pattern + + + /pattern.val /Pola.val - + Save as + + + + Could not save file + + + + Open file + Buka File + + + Error parsing file. + + + + Error can't convert value. + + + + Error empty parameter. + + + + Error wrong id. + + + + Critical error! + + + + Error parsing file (std::bad_alloc). + + + + Bad id. + + + File saved File telah disimpan - untitled.val tanpajudul.val - Unsaved change Perubahan belum disimpan - The pattern has been modified. Do you want to save your changes? Pola telah dimodiikasi Apakah anda ingin menyimpan perubahan anda? - - - Open file - Buka File - - - - - Error parsing file. + &Undo - - Error can't convert value. + &Redo - - - Error empty parameter. + Pattern piece: - - Error wrong id. + Enter a new label for the pattern piece. + + + + This file already opened in another window. + + + + Wrong units. + + + + Application doesn't support standard table with inches. + + + + File error. + + + + File loaded + + + + Valentina didn't shut down correctly. Do you want reopen files (%1) you had open? + + + + Reopen files. + + + + The measurements file <br/><br/> <b>%1</b> <br/><br/> %3 + + + + could not be found. Do you want to update the file location + + + + Standard measurements (*.vst) + + + + Individual measurements (*.vit) + + + + Special point on shoulder + + + + Triangle tool + + + + Point at intersection of arc and line + + + + Point from X and Y of two other points + + + + Point intersect line and axis + + + + Simple curve + + + + Curved path + + + + Segmenting a simple curve + + + + Segment a curved path + + + + Point intersect curve and axis + + + + Segment an arc + + + + Point intersect arc and axis + + + + Seam allowance tool + + + + Union tool + + + + toolBar + + + + Last Tool + + + + Activate last used tool again + + + + L + + + + Select point for X value (vertical) Measurements - head_girth Short measurement name. Don't use math symbols in name!!!! Lingkar Kepala - mid_neck_girth Short measurement name. Don't use math symbols in name!!!! Setengah Lingkar Leher - neck_base_girth Short measurement name. Don't use math symbols in name!!!! Lingkar Leher Bawah - head_and_neck_length Short measurement name. Don't use math symbols in name!!!! Panjang Leher dan Kepala - center_front_waist_length Short measurement name. Don't use math symbols in name!!!! - center_back_waist_length Short measurement name. Don't use math symbols in name!!!! - shoulder_length Short measurement name. Don't use math symbols in name!!!! Panjang Bahu - side_waist_length Short measurement name. Don't use math symbols in name!!!! Panjang Sisi Pinggang - trunk_length Short measurement name. Don't use math symbols in name!!!! Panjang Badan - shoulder_girth Short measurement name. Don't use math symbols in name!!!! Lingkar Bahu - upper_chest_girth Short measurement name. Don't use math symbols in name!!!! Lingkar data atas - bust_girth Short measurement name. Don't use math symbols in name!!!! Lingkar dada/payudara - under_bust_girth Short measurement name. Don't use math symbols in name!!!! lingkar bawah payudara - waist_girth Short measurement name. Don't use math symbols in name!!!! Lingkar Pinggang - high_hip_girth Short measurement name. Don't use math symbols in name!!!! Tinggi Lingkar Pinggul - hip_girth Short measurement name. Don't use math symbols in name!!!! Lingkar Pinggul - upper_front_chest_width Short measurement name. Don't use math symbols in name!!!! Lebar dada depan atas - front_chest_width Short measurement name. Don't use math symbols in name!!!! Lebar dada depan - across_front_shoulder_width Short measurement name. Don't use math symbols in name!!!! - across_back_shoulder_width Short measurement name. Don't use math symbols in name!!!! - upper_back_width Short measurement name. Don't use math symbols in name!!!! - back_width Short measurement name. Don't use math symbols in name!!!! - bustpoint_to_bustpoint Short measurement name. Don't use math symbols in name!!!! - halter_bustpoint_to_bustpoint Short measurement name. Don't use math symbols in name!!!! - neck_to_bustpoint Short measurement name. Don't use math symbols in name!!!! - crotch_length Short measurement name. Don't use math symbols in name!!!! - rise_height Short measurement name. Don't use math symbols in name!!!! - shoulder_drop Short measurement name. Don't use math symbols in name!!!! - shoulder_slope_degrees Short measurement name. Don't use math symbols in name!!!! - front_shoulder_slope_length Short measurement name. Don't use math symbols in name!!!! - back_shoulder_slope_length Short measurement name. Don't use math symbols in name!!!! - front_shoulder_to_waist_length Short measurement name. Don't use math symbols in name!!!! - back_shoulder_to_waist_length Short measurement name. Don't use math symbols in name!!!! - front_neck_arc Short measurement name. Don't use math symbols in name!!!! - back_neck_arc Short measurement name. Don't use math symbols in name!!!! - front_upper_chest_arc Short measurement name. Don't use math symbols in name!!!! - back_upper_chest_arc Short measurement name. Don't use math symbols in name!!!! - front_waist_arc Short measurement name. Don't use math symbols in name!!!! - back_waist_arc Short measurement name. Don't use math symbols in name!!!! - front_upper_hip_arc Short measurement name. Don't use math symbols in name!!!! - back_upper_hip_arc Short measurement name. Don't use math symbols in name!!!! - front_hip_arc Short measurement name. Don't use math symbols in name!!!! - back_hip_arc Short measurement name. Don't use math symbols in name!!!! - chest_slope Short measurement name. Don't use math symbols in name!!!! - back_slope Short measurement name. Don't use math symbols in name!!!! - front_waist_slope Short measurement name. Don't use math symbols in name!!!! - back_waist_slope Short measurement name. Don't use math symbols in name!!!! - front_neck_to_upper_chest_height Short measurement name. Don't use math symbols in name!!!! - front_neck_to_bust_height Short measurement name. Don't use math symbols in name!!!! - front_waist_to_upper_chest Short measurement name. Don't use math symbols in name!!!! - front_waist_to_lower_breast Short measurement name. Don't use math symbols in name!!!! - back_waist_to_upper_chest Short measurement name. Don't use math symbols in name!!!! - strap_length Short measurement name. Don't use math symbols in name!!!! - armscye_girth Short measurement name. Don't use math symbols in name!!!! - elbow_girth Short measurement name. Don't use math symbols in name!!!! - upper_arm_girth Short measurement name. Don't use math symbols in name!!!! - wrist_girth Short measurement name. Don't use math symbols in name!!!! - scye_depth Short measurement name. Don't use math symbols in name!!!! - shoulder_and_arm_length Short measurement name. Don't use math symbols in name!!!! - underarm_length Short measurement name. Don't use math symbols in name!!!! - cervicale_to_wrist_length Short measurement name. Don't use math symbols in name!!!! - shoulder_to_elbow_length Short measurement name. Don't use math symbols in name!!!! - arm_length Short measurement name. Don't use math symbols in name!!!! - hand_width Short measurement name. Don't use math symbols in name!!!! - hand_length Short measurement name. Don't use math symbols in name!!!! - hand_girth Short measurement name. Don't use math symbols in name!!!! - thigh_girth Short measurement name. Don't use math symbols in name!!!! - mid_thigh_girth Short measurement name. Don't use math symbols in name!!!! - knee_girth Short measurement name. Don't use math symbols in name!!!! - calf_girth Short measurement name. Don't use math symbols in name!!!! - ankle_girth Short measurement name. Don't use math symbols in name!!!! - knee_height Short measurement name. Don't use math symbols in name!!!! - ankle_height Short measurement name. Don't use math symbols in name!!!! - foot_width Short measurement name. Don't use math symbols in name!!!! - foot_length Short measurement name. Don't use math symbols in name!!!! - height Short measurement name. Don't use math symbols in name!!!! - cervicale_height Short measurement name. Don't use math symbols in name!!!! - cervicale_to_knee_height Short measurement name. Don't use math symbols in name!!!! - waist_height Short measurement name. Don't use math symbols in name!!!! - high_hip_height Short measurement name. Don't use math symbols in name!!!! - hip_height Short measurement name. Don't use math symbols in name!!!! - waist_to_hip_height Short measurement name. Don't use math symbols in name!!!! - waist_to_knee_height Short measurement name. Don't use math symbols in name!!!! - crotch_height Short measurement name. Don't use math symbols in name!!!! - size Short measurement name. Don't use math symbols in name!!!! - height_front_neck_base_point Short measurement name. Don't use math symbols in name!!!! - height_base_neck_side_point Short measurement name. Don't use math symbols in name!!!! - height_shoulder_point Short measurement name. Don't use math symbols in name!!!! - height_nipple_point Short measurement name. Don't use math symbols in name!!!! - height_back_angle_axilla Short measurement name. Don't use math symbols in name!!!! - height_scapular_point Short measurement name. Don't use math symbols in name!!!! - height_under_buttock_folds Short measurement name. Don't use math symbols in name!!!! - hips_excluding_protruding_abdomen Short measurement name. Don't use math symbols in name!!!! - girth_foot_instep Short measurement name. Don't use math symbols in name!!!! - side_waist_to_floor Short measurement name. Don't use math symbols in name!!!! - front_waist_to_floor Short measurement name. Don't use math symbols in name!!!! - arc_through_groin_area Short measurement name. Don't use math symbols in name!!!! - waist_to_plane_seat Short measurement name. Don't use math symbols in name!!!! - neck_to_radial_point Short measurement name. Don't use math symbols in name!!!! - neck_to_third_finger Short measurement name. Don't use math symbols in name!!!! - neck_to_first_line_chest_circumference Short measurement name. Don't use math symbols in name!!!! - front_waist_length Short measurement name. Don't use math symbols in name!!!! - arc_through_shoulder_joint Short measurement name. Don't use math symbols in name!!!! - neck_to_back_line_chest_circumference Short measurement name. Don't use math symbols in name!!!! - waist_to_neck_side Short measurement name. Don't use math symbols in name!!!! - arc_length_upper_body Short measurement name. Don't use math symbols in name!!!! - chest_width Short measurement name. Don't use math symbols in name!!!! - anteroposterior_diameter_hands Short measurement name. Don't use math symbols in name!!!! - height_clavicular_point Short measurement name. Don't use math symbols in name!!!! - height_armhole_slash Short measurement name. Don't use math symbols in name!!!! - slash_shoulder_height Short measurement name. Don't use math symbols in name!!!! - half_girth_neck Short measurement name. Don't use math symbols in name!!!! - half_girth_neck_for_shirts Short measurement name. Don't use math symbols in name!!!! - half_girth_chest_first Short measurement name. Don't use math symbols in name!!!! - half_girth_chest_second Short measurement name. Don't use math symbols in name!!!! - half_girth_chest_third Short measurement name. Don't use math symbols in name!!!! - half_girth_waist Short measurement name. Don't use math symbols in name!!!! - half_girth_hips_considering_protruding_abdomen Short measurement name. Don't use math symbols in name!!!! - half_girth_hips_excluding_protruding_abdomen Short measurement name. Don't use math symbols in name!!!! - girth_knee_flexed_feet Short measurement name. Don't use math symbols in name!!!! - neck_transverse_diameter Short measurement name. Don't use math symbols in name!!!! - front_slash_shoulder_height Short measurement name. Don't use math symbols in name!!!! - neck_to_front_waist_line Short measurement name. Don't use math symbols in name!!!! - hand_vertical_diameter Short measurement name. Don't use math symbols in name!!!! - neck_to_knee_point Short measurement name. Don't use math symbols in name!!!! - waist_to_knee Short measurement name. Don't use math symbols in name!!!! - shoulder_height Short measurement name. Don't use math symbols in name!!!! - head_height Short measurement name. Don't use math symbols in name!!!! - body_position Short measurement name. Don't use math symbols in name!!!! - arc_behind_shoulder_girdle Short measurement name. Don't use math symbols in name!!!! - neck_to_neck_base Short measurement name. Don't use math symbols in name!!!! - depth_waist_first Short measurement name. Don't use math symbols in name!!!! - depth_waist_second Short measurement name. Don't use math symbols in name!!!! @@ -4804,799 +4090,666 @@ Apakah anda ingin menyimpan perubahan anda? MeasurementsDescriptions - Around fullest part of Head Full measurement description - Around middle part of Neck Full measurement description - Around Neck at base Full measurement description - Vertical Distance from Crown to Nape Full measurement description - Front Neck Center over tape at Bustline to Front Waist Center Full measurement description - Back Neck Center to Back Waist Center Full measurement description - NeckPoint to ShoulderTip Full measurement description - Armpit to Waist side Full measurement description - Around Body from middle of Shoulder length to BustPoint to Crotch up back to beginning point Full measurement description - Around Arms and Torso, at bicep level parallel to floor, with arms hanging at the sides Full measurement description - Around Chest at Armfold level, will be parallel to floor across back, will not be parallel to floor across front chest Full measurement description - Around fullest part of Bust, parallel to floor Full measurement description - Around Chest below the Bust, parallel to floor Full measurement description - Tie a string around smallest part of waist, keep string tied while taking meaasurements. Not usually parallel to floor for front waist or back waist. Full measurement description - Around HighHip, parallel to floor Full measurement description - Around Hip, parallel to floor Full measurement description - Across Front UpperChest, smallest width from armscye to armscye Full measurement description - Across Front Chest, from armfold to armfold Full measurement description - From ShoulderTip to ShoulderTip, across Front Full measurement description - From ShoulderTip to ShoulderTip, across Back Full measurement description - Across Back UpperChest, smallest width from armscye to armscye Full measurement description - Across Back Chest, from armfold to armfold Full measurement description - Distance between BustPoints, across Chest Full measurement description - Distance from Bustpoint, behind neck, down to Bustpoint Full measurement description - From NeckPoint to BustPoint Full measurement description - From Front Waist Center, down to crotch, up to Back Waist Center Full measurement description - Sit on hard chair, measure from side waist straight down to chair bottom Full measurement description - Vertical Distance from NeckPoint level to ShoulderTip level Full measurement description - Degrees of angle from NeckPoint to ShoulderTip – requires goniometer Full measurement description - ShoulderTip to Front Waist Center Full measurement description - ShoulderTip to Back Waist Center Full measurement description - NeckPoint straight down front chest to Waistline Full measurement description - Back NeckPoint straight down back chest to Waistline Full measurement description - NeckPoint to NeckPoint through Front Neck Center Full measurement description - NeckPoint to NeckPoint across Nape Full measurement description - Front upper-bust arc Full measurement description - Back UpperBust side to side Full measurement description - Front Waist side to side Full measurement description - Back Waist side to side Full measurement description - Front UpperHip side to side Full measurement description - Back UpperHip side to side Full measurement description - Front Hip side to side Full measurement description - Back Hip side to side Full measurement description - NeckPoint to Front ArmfoldPoint Full measurement description - NeckPoint to Back ArmfoldPoint Full measurement description - NeckPoint across Front Chest to Waist side Full measurement description - NeckPoint across Back Chest to Waist side Full measurement description - Front Neck Center straight down to UpperChest line Full measurement description - Front Neck Center straight down to Bust line Full measurement description - Front Upper chest waist Full measurement description - Front waist to lower breast Full measurement description - Back waist to upper chest Full measurement description - Strap length Full measurement description - Around Armscye Full measurement description - Around Elbow with elbow bent Full measurement description - Around UpperArm Full measurement description - Around Wrist Full measurement description - Nape straight down to UnderBust line (same as Back UpperBust height) Full measurement description - NeckPoint to ShoulderTip to Wrist, with elbow bent and hand on hip Full measurement description - Armpit to Wrist, with arm straight and hanging at side Full measurement description - Nape to Wrist, with elbow bent and hand on hip Full measurement description - ShoulderTip to Elbow, with elbow bent and hand on hip Full measurement description - ShoulderTip to Wrist, with elbow bent and hand on hip Full measurement description - Hand side to side Full measurement description - Hand Middle Finger tip to wrist Full measurement description - Around Hand Full measurement description - Around Thigh Full measurement description - Around MidThigh Full measurement description - Around Knee Full measurement description - Around Calf Full measurement description - Around Ankle Full measurement description - Knee to Floor Full measurement description - Ankle to Floor Full measurement description - Widest part of Foot side to side Full measurement description - Tip of Longest Toe straight to back of heel Full measurement description - Top of head to floor Full measurement description - Nape to Floor Full measurement description - Nape to Knee Full measurement description - Waist side to floor Full measurement description - HighHip side to Floor Full measurement description - Hip side to Floor Full measurement description - Waist side to Hip Full measurement description - Waist side to Knee Full measurement description - Crotch to Floor along inside leg Full measurement description - Size Full measurement description - Height of the point base of the neck in front Full measurement description - Height of the base of the neck side point Full measurement description - The height of the shoulder point Full measurement description - Height nipple point Full measurement description - Height back angle axilla Full measurement description - Height scapular point Full measurement description - Height under buttock folds Full measurement description - Hips excluding protruding abdomen Full measurement description - Girth foot instep Full measurement description - The distance from the side waist to floor Full measurement description - The distance from the front waist to floor Full measurement description - Arc through groin area Full measurement description - The distance from the waist to the plane seat Full measurement description - The distance from the base of the neck to the side of the radial point Full measurement description - Distance from the base of the neck side point to the end of the third finger Full measurement description - The distance from the base of the neck to the side of the first line in front of chest circumference Full measurement description - The distance from the base of the neck to the waist side front (waist length in the front) Full measurement description - Arc through the highest point of the shoulder joint Full measurement description - The distance from the base of the neck to the back line of chest circumference of the first and the second based on ledge vanes Full measurement description - The distance from the waist to the back base of the neck side point Full measurement description - Arc length of the upper body through the base of the neck side point Full measurement description - Chest width Full measurement description - Anteroposterior diameter of the hands Full measurement description - Height clavicular point Full measurement description - The distance from the point to the cervical level of the posterior angle of the front armpit (underarm height oblique) Full measurement description - Slash shoulder height Full measurement description - Half girth neck Full measurement description - Half girth neck for shirts Full measurement description - Half girth chest first Full measurement description - Half girth chest second Full measurement description - Half girth chest third Full measurement description - Half girth waist Full measurement description - Half girth hips considering protruding abdomen Full measurement description - Half girth hips excluding protruding abdomen Full measurement description - Girth knee flexed feet Full measurement description - Neck transverse diameter Full measurement description - Front slash shoulder height Full measurement description - The distance from the base of the neck to the waist line front Full measurement description - Hand vertical diameter Full measurement description - Distance from neck to knee point Full measurement description - The distance from the waist to the knee Full measurement description - Shoulder height Full measurement description - Head height Full measurement description - Body position Full measurement description - Arc behind the shoulder girdle Full measurement description - Distance from neck point to point on the base of the neck side neck girth measurement line Full measurement description - Depth waist first Full measurement description - Depth waist second Full measurement description @@ -5605,799 +4758,666 @@ Apakah anda ingin menyimpan perubahan anda? MeasurementsFullNames - Head girth Full measurement name - Mid-neck girth Full measurement name - Neck Base girth Full measurement name - Head and Neck length Full measurement name - Front Center length Full measurement name - Back Center length Full measurement name - Shoulder length Full measurement name - Side Waist length Full measurement name - Trunk length Full measurement name - Shoulder girth Full measurement name - Upper Chest girth Full measurement name - Bust girth Full measurement name - Under Bust girth Full measurement name - Waist girth Full measurement name - HighHip girth Full measurement name - Hip girth Full measurement name - Front Upper Chest width Full measurement name - Front Chest width Full measurement name - Front Across Shoulder width Full measurement name - Back Across Shoulder width Full measurement name - Back Upper Chest width Full measurement name - Back Chest width Full measurement name - BustPoint to BustPoint Full measurement name - Halter Bustpoint to Bustpoint Full measurement name - NeckPoint to BustPoint Full measurement name - Crotch length Full measurement name - Rise height Full measurement name - Shoulder Drop Full measurement name - Shoulder Slope degrees Full measurement name - Front Shoulder Balance Full measurement name - Back Shoulder Balance Full measurement name - Front Full Length Full measurement name - Back Full Length Full measurement name - Front Neck arc Full measurement name - Back Neck arc Full measurement name - Front upper-bust arc Full measurement name - Back UpperBust arc Full measurement name - Front Waist arc Full measurement name - Back Waist arc Full measurement name - Front UpperHip arc Full measurement name - Back UpperHip arc Full measurement name - Front Hip arc Full measurement name - Back Hip arc Full measurement name - Chest Balance Full measurement name - Back Balance Full measurement name - Front Waist Balance Full measurement name - Back Waist Balance Full measurement name - Front UpperChest height Full measurement name - Bust height Full measurement name - Front Upper chest waist Full measurement name - Front waist to lower breast Full measurement name - Back waist to upper chest Full measurement name - Strap length Full measurement name - Armscye Girth Full measurement name - Elbow Girth Full measurement name - Upperarm Girth Full measurement name - Wrist girth Full measurement name - Armscye depth Full measurement name - Shoulder and Arm length Full measurement name - Underarm length Full measurement name - Nape to wrist length Full measurement name - Elbow length Full measurement name - Arm length Full measurement name - Hand width Full measurement name - Hand length Full measurement name - Hand girth Full measurement name - Thigh girth Full measurement name - Midthigh girth Full measurement name - Knee girth Full measurement name - Calf girth Full measurement name - Ankle girth Full measurement name - Knee height Full measurement name - Ankle height Full measurement name - Foot width Full measurement name - Foot length Full measurement name - Total Height Full measurement name - Nape height Full measurement name - Nape to knee height Full measurement name - Waist height Full measurement name - HighHip height Full measurement name - Hip height Full measurement name - Waist to Hip height Full measurement name - Waist to Knee height Full measurement name - Crotch height/Inseam Full measurement name - Size Full measurement name - Height front neck base point Full measurement name - Height base neck side point Full measurement name - Height shoulder point Full measurement name - Height nipple point Full measurement name - Height back angle axilla Full measurement name - Height scapular point Full measurement name - Height under buttock folds Full measurement name - Hips excluding protruding abdomen Full measurement name - Girth foot instep Full measurement name - Side waist to floor Full measurement name - Front waist to floor Full measurement name - Arc through groin area Full measurement name - Waist to plane seat Full measurement name - Neck to radial point Full measurement name - Neck to third finger Full measurement name - Neck to first line chest circumference Full measurement name - Front waist length Full measurement name - Arc through shoulder joint Full measurement name - Neck to back line chest circumference Full measurement name - Waist to neck side Full measurement name - Arc length upper body Full measurement name - Chest width Full measurement name - Anteroposterior diameter hands Full measurement name - Height clavicular point Full measurement name - Height armhole slash Full measurement name - Slash shoulder height Full measurement name - Half girth neck Full measurement name - Half girth neck for shirts Full measurement name - Half girth chest first Full measurement name - Half girth chest second Full measurement name - Half girth chest third Full measurement name - Half girth waist Full measurement name - Half girth hips considering protruding abdomen Full measurement name - Half girth hips excluding protruding abdomen Full measurement name - Girth knee flexed feet Full measurement name - Neck transverse diameter Full measurement name - Front slash shoulder height Full measurement name - Neck to front waist line Full measurement name - Hand vertical diameter Full measurement name - Neck to knee point Full measurement name - Waist to knee Full measurement name - Shoulder height Full measurement name - Head height Full measurement name - Body position Full measurement name - Arc behind shoulder girdle Full measurement name - Neck to neck base Full measurement name - Depth waist first Full measurement name - Depth waist second Full measurement name @@ -6406,7 +5426,6 @@ Apakah anda ingin menyimpan perubahan anda? MoveLabel - Move point label @@ -6414,7 +5433,6 @@ Apakah anda ingin menyimpan perubahan anda? MoveSPoint - Move single point @@ -6422,7 +5440,6 @@ Apakah anda ingin menyimpan perubahan anda? MoveSpline - Move spline @@ -6430,7 +5447,6 @@ Apakah anda ingin menyimpan perubahan anda? MoveSplinePath - Move spline path @@ -6438,75 +5454,69 @@ Apakah anda ingin menyimpan perubahan anda? PathPage - Open Directory - Path that use Valentina - Default - Edit - Type - Path - Individual measurements - Patterns + + Standard measurements + + + + Layout + + PatternPage - User - User name - Graphical output - Use antialiasing - Undo - Count steps (0 - no limit) @@ -6514,19 +5524,16 @@ Apakah anda ingin menyimpan perubahan anda? PostfixOperators - cm centimeter cm - mm millimeter - in inch @@ -6535,7 +5542,6 @@ Apakah anda ingin menyimpan perubahan anda? QCoreApplication - Based on Qt %1 (%2, %3 bit) @@ -6543,272 +5549,230 @@ Apakah anda ingin menyimpan perubahan anda? QObject - Create new pattern piece to start working. - Add node - Move detail - mm - - cm cm - inch - Property The text that appears in the first column header - Value The text that appears in the second column header + + px + + QmuParserErrorMsg - Unexpected token "$TOK$" found at position $POS$. Math parser error messages. Left untouched "$TOK$" and $POS$ - Internal error Math parser error messages. - Invalid function-, variable- or constant name: "$TOK$". Math parser error messages. Left untouched "$TOK$" - Invalid binary operator identifier: "$TOK$". Math parser error messages. Left untouched "$TOK$" - Invalid infix operator identifier: "$TOK$". Math parser error messages. Left untouched "$TOK$" - Invalid postfix operator identifier: "$TOK$". Math parser error messages. Left untouched "$TOK$" - Invalid pointer to callback function. Math parser error messages. - Expression is empty. Math parser error messages. - Invalid pointer to variable. Math parser error messages. - Unexpected operator "$TOK$" found at position $POS$ Math parser error messages. Left untouched "$TOK$" and $POS$ - Unexpected end of expression at position $POS$ Math parser error messages. Left untouched $POS$ - Unexpected argument separator at position $POS$ Math parser error messages. Left untouched $POS$ - Unexpected parenthesis "$TOK$" at position $POS$ Math parser error messages. Left untouched "$TOK$" and $POS$ - Unexpected function "$TOK$" at position $POS$ Math parser error messages. Left untouched "$TOK$" and $POS$ - Unexpected value "$TOK$" found at position $POS$ Math parser error messages. Left untouched "$TOK$" and $POS$ - Unexpected variable "$TOK$" found at position $POS$ Math parser error messages. Left untouched "$TOK$" and $POS$ - Function arguments used without a function (position: $POS$) Math parser error messages. Left untouched $POS$ - Missing parenthesis Math parser error messages. - Too many parameters for function "$TOK$" at expression position $POS$ Math parser error messages. Left untouched "$TOK$" and $POS$ - Too few parameters for function "$TOK$" at expression position $POS$ Math parser error messages. Left untouched "$TOK$" and $POS$ - Divide by zero Math parser error messages. - Domain error Math parser error messages. - Name conflict Math parser error messages. - Invalid value for operator priority (must be greater or equal to zero). Math parser error messages. - user defined binary operator "$TOK$" conflicts with a built in operator. Math parser error messages. Left untouched "$TOK$" - Unexpected string token found at position $POS$. Math parser error messages. Left untouched $POS$ - Unterminated string starting at position $POS$. Math parser error messages. Left untouched $POS$ - String function called with a non string type of argument. Math parser error messages. - String value used where a numerical argument is expected. Math parser error messages. - No suitable overload for operator "$TOK$" at position $POS$. Math parser error messages. Left untouched "$TOK$" and $POS$ - Function result is a string. Math parser error messages. - Parser error. Math parser error messages. - Decimal separator is identic to function argument separator. Math parser error messages. - - The "$TOK$" operator must be preceeded by a closing bracket. - Math parser error messages. Left untouched "$TOK$" - - - - If-then-else operator is missing an else clause Math parser error messages. Do not translate operator name. - Misplaced colon at position $POS$ Math parser error messages. Left untouched $POS$ + + The "$TOK$" operator must be preceeded by a closing bracket. + Math parser error messages. Left untouched "$TOK$" + + RenamePP - Rename pattern piece @@ -6816,7 +5780,6 @@ Apakah anda ingin menyimpan perubahan anda? STDescriptions - Standard figures of men 1st group, chest 100 cm Standard table description @@ -6825,7 +5788,6 @@ Apakah anda ingin menyimpan perubahan anda? SaveDetailOptions - Save detail option @@ -6833,7 +5795,6 @@ Apakah anda ingin menyimpan perubahan anda? SaveToolOptions - Save tool option @@ -6841,205 +5802,117 @@ Apakah anda ingin menyimpan perubahan anda? TableWindow - Create a layout - toolBar - Save Simpan - - Save layout - - Next - - - - - Next detail - - - - - Turn - - - - - Turn the detail 90 degrees - - - - Stop - Stop laying - - Enlarge letter - - - - - Enlarge the length of the sheet - - - - - Reduce sheet - - - - - Reduce the length of the sheet - - - - - - Mirroring - - - - - Zoom In - - Zoom Out - - 0 details left. - - - - - - Collisions not found. - - - - - %1 details left. - - - - untitled - Svg files (*.svg) - PDF files (*.pdf) - Images (*.png) - - Wavefront OBJ (*.obj) - - - - PS files (*.ps) - EPS files (*.eps) - - Collisions found. - - - - Creating file '%1' failed! %2 - Critical error! + + Wavefront OBJ (*.obj) + + + + Layout pages + + + + Layout + + VAbstractConverter - Error creation backup file: %1. - Couldn't get version information. - Too many tags <%1> in file. - Version "%1" invalid. - Version "0.0.0" invalid. - Invalid version. Minimum supported version is %1 - Invalid version. Maximum supported version is %1 - Error no unique id. - Could not change version. @@ -7047,45 +5920,65 @@ Apakah anda ingin menyimpan perubahan anda? VAbstractTool - Confirm the deletion. - Do you really want delete? + + black + + + + green + + + + blue + + + + dark red + + + + dark green + + + + dark blue + + + + yellow + + VApplication - Error parsing file. Program will be terminated. - Error bad id. Program will be terminated. - Error can't convert value. Program will be terminated. - Error empty parameter. Program will be terminated. - Error wrong id. Program will be terminated. - Something's wrong!! @@ -7093,21 +5986,14 @@ Apakah anda ingin menyimpan perubahan anda? VContainer - - - - Can't find object - - Can't cast object - Can't find object. Type mismatch. @@ -7115,75 +6001,60 @@ Apakah anda ingin menyimpan perubahan anda? VDomDocument - Can't convert toUInt parameter - Can't convert toBool parameter - Got empty parameter - Can't convert toDouble parameter - - Got wrong parameter id. Need only id > 0. - - - - - This id is not unique. - - - - - Can't open file %1: %2. - Can't open schema file %1: %2. - Could not load schema file. - Validation error file %3 in line %1 column %2 - Parsing error file %3 in line %1 column %2 - Couldn't get node - + Got wrong parameter id. Need only id > 0. + + + + This id is not unique. + + + Could not copy temp file to document file - Could not remove document file @@ -7191,25 +6062,21 @@ Apakah anda ingin menyimpan perubahan anda? VDrawTool - + Edit wrong formula + + + Options pilihan - Delete hapus - - - Edit wrong formula - - VException - Critical error! @@ -7217,10 +6084,6 @@ Apakah anda ingin menyimpan perubahan anda? VFormula - - - - Error @@ -7228,12 +6091,10 @@ Apakah anda ingin menyimpan perubahan anda? VFormulaProperty - Value - Formula rumus @@ -7241,12 +6102,10 @@ Apakah anda ingin menyimpan perubahan anda? VPE::VBoolProperty - True - False @@ -7254,12 +6113,10 @@ Apakah anda ingin menyimpan perubahan anda? VPE::VFileEditWidget - Directory - Open File @@ -7267,190 +6124,142 @@ Apakah anda ingin menyimpan perubahan anda? VPattern - Can't find tool in table. - Error no unique id. - - Error parsing file. - Error can't convert value. - Error empty parameter. - Error wrong id. - Critical error! - Error parsing file (std::bad_alloc). - Error creating or updating detail - Error creating or updating single point - - Error creating or updating point of end line - - Error creating or updating point along line - - Error creating or updating point of shoulder - - Error creating or updating point of normal - - Error creating or updating point of bisector - Error creating or updating point of lineintersection - - Error creating or updating point of contact - Error creating or updating modeling point - Error creating or updating height - Error creating or updating triangle - Error creating or updating point of intersection - - Error creating or updating cut spline point - - Error creating or updating cut spline path point - - Error creating or updating cut arc point - - Error creating or updating point of intersection line and axis - - Error creating or updating point of intersection curve and axis - Error creating or updating line - Error creating or updating simple curve - Error creating or updating curve path - Error creating or updating modeling simple curve - Error creating or updating modeling curve path - - Error creating or updating simple arc - Error creating or updating modeling arc - Error creating or updating union details - File error. @@ -7458,12 +6267,10 @@ Apakah anda ingin menyimpan perubahan anda? VPatternConverter - Unexpected version "%1". - Error restoring backup file: %1. @@ -7471,19 +6278,14 @@ Apakah anda ingin menyimpan perubahan anda? VSplinePath - Not enough points to create the spline. - - - This spline does not exist. - Can't cut spline path with one point @@ -7491,12 +6293,10 @@ Apakah anda ingin menyimpan perubahan anda? VTableGraphicsView - can't find detail - detail found @@ -7504,12 +6304,10 @@ Apakah anda ingin menyimpan perubahan anda? VToolDetail - Options pilihan - Delete hapus @@ -7517,215 +6315,158 @@ Apakah anda ingin menyimpan perubahan anda? VToolOptionsPropertyBrowser - Base point - - - - - - - - - - - - - - - - Point label label titik - Position - Point at distance and angle - - - - - - - - - Line type - - - - - - - - Length panjang - - - Angle sudut - Point at distance along line - Arc busur - - Radius radius - First angle sudut pertama - Second angle sudut kedua - Point along bisector - Cut arc tool - Tool for segmenting a curve - Tool segment a pathed curve - Perpendicular point along line - Line between points - Point at line intersection - Point along perpendicular - Additional angle degrees - Point at intersection of arc and line - Tool to make point from x & y of two other points - Special point on shoulder - Curve tool - - Curve factor - Tool for path curve - Tool triangle - - Point intersection line and axis + + Line color + + + + Color + + + + Point intersection curve and axis + + Variables - Line_ Left symbol _ in name - AngleLine_ Left symbol _ in name - Arc_ Left symbol _ in name - Spl_ Left symbol _ in name - SplPath Do not add symbol _ to the end of name @@ -7734,7 +6475,6 @@ Apakah anda ingin menyimpan perubahan anda? VisToolCurveIntersectAxis - <b>Intersection curve and axis</b>: angle = %1°; <b>Shift</b> - sticking angle, <b>Enter</b> - finish creation @@ -7742,7 +6482,6 @@ Apakah anda ingin menyimpan perubahan anda? VisToolEndLine - <b>Point at distance and angle</b>: angle = %1°; <b>Shift</b> - sticking angle, <b>Enter</b> - finish creation @@ -7750,7 +6489,6 @@ Apakah anda ingin menyimpan perubahan anda? VisToolLineIntersectAxis - <b>Intersection line and axis</b>: angle = %1°; <b>Shift</b> - sticking angle, <b>Enter</b> - finish creation @@ -7758,12 +6496,10 @@ Apakah anda ingin menyimpan perubahan anda? VisToolSplinePath - <b>Curved path</b>: select three or more points - <b>Curved path</b>: select three or more points, <b>Enter</b> - finish creation @@ -7771,12 +6507,10 @@ Apakah anda ingin menyimpan perubahan anda? main - Pattern making program. program pembuat pola - Pattern file. Berkas pola. diff --git a/share/translations/valentina_it_IT.ts b/share/translations/valentina_it_IT.ts index 51ae471d1..0027abea1 100644 --- a/share/translations/valentina_it_IT.ts +++ b/share/translations/valentina_it_IT.ts @@ -260,10 +260,6 @@ _ _ - - Point along line - - Length @@ -272,10 +268,6 @@ Insert variable into the formula - - Calculate value - - Value of length @@ -356,6 +348,14 @@ Select second point of line + + Point at distance along line + + + + Line color + + DialogArc @@ -379,10 +379,6 @@ Insert variable into the formula - - Calculate value - - Value of radius @@ -463,10 +459,6 @@ Variables - - Value of angle of line. - - Error @@ -479,6 +471,10 @@ Angles equal + + Color + + DialogBisector @@ -490,10 +486,6 @@ _ _ - - Bisector - - Length @@ -502,10 +494,6 @@ Insert marked variable into the formula - - Calculate value - - Value of length @@ -598,21 +586,21 @@ Select third point of angle + + Point along bisector + + + + Line color + + DialogCurveIntersectAxis - - Curve intersect axis - - Angle - - Calculate value - - Value of angle @@ -625,10 +613,6 @@ Axis point - - First point of line - - Curve @@ -689,6 +673,18 @@ Select axis point + + Point intersect curve and axis + + + + Axis Point + + + + Line color + + DialogCutArc @@ -700,18 +696,10 @@ _ _ - - Cut arc - - Length - - Calculate value - - Value of length @@ -724,10 +712,6 @@ Arc - - Selected curve - - Point label @@ -772,6 +756,18 @@ Variables - Click twice to insert into formula + + Segment an arc + + + + Selected arc + + + + Color + + DialogCutSpline @@ -783,18 +779,10 @@ _ _ - - Cut curve - - Length - - Calculate value - - Value of length @@ -855,6 +843,14 @@ Variables - Click twice to insert into formula + + Segmenting a simple curve + + + + Color + + DialogCutSplinePath @@ -866,18 +862,10 @@ _ _ - - Cut curve path - - Length - - Calculate value - - Value of length @@ -938,6 +926,14 @@ Variables - Click twice to insert into formula + + Segment a curved path + + + + Color + + DialogDetail @@ -989,6 +985,10 @@ Reverse + + Seam allowance tool + + DialogEditWrongFormula @@ -1012,10 +1012,6 @@ Insert variable into formula - - Calculate value - - Value of first angle @@ -1075,18 +1071,10 @@ _ _ - - Point in the end of a line - - Length - - Calculate value - - Value of length @@ -1163,13 +1151,17 @@ Variables + + Point at distance and angle + + + + Line color + + DialogHeight - - Height - - Point label @@ -1202,6 +1194,18 @@ Select second point of line + + Perpendicular point along line + + + + Base Point + + + + Line color + + DialogHistory @@ -1452,6 +1456,22 @@ Can't save measurement + + Tables of Variables + + + + Base size: %1 %3; Base height: %2 %3 + + + + Description: "%1" + + + + Data successfully saved. + + DialogIndividualMeasurements @@ -1529,11 +1549,117 @@ - DialogLine + DialogLayoutProgress - Line + Creation a layout + + <html><head/><body><p>Finding best position for worpieces. Please, waite.</p></body></html> + + + + Couldn't prepare data for creation layout + + + + Critical error + + + + Wrong paper size + + + + Several workpieces left not arranged, but none of them match for paper + + + + + DialogLayoutSettings + + Creation a layout + + + + Paper size + + + + Templates: + + + + Width: + + + + Height: + + + + ... + ... + + + Rotate workpiece + + + + Rotate by + + + + degree + + + + Creation options + + + + Layout width: + + + + Shift length: + + + + Principle of choosing the next workpiece + + + + Three groups: big, middle, small + + + + Two groups: big, small + + + + Descending area + + + + Millimiters + + + + Centimeters + + + + Inches + + + + Pixels + + + + + DialogLine First point @@ -1554,13 +1680,17 @@ Select second point + + Line between points + + + + Line color + + DialogLineIntersect - - Intersection of lines - - Point label @@ -1593,21 +1723,17 @@ Select second point of second line + + Point at line intersection + + DialogLineIntersectAxis - - Line intersect axis - - Angle - - Calculate value - - Value of angle @@ -1692,6 +1818,22 @@ Select axis point + + Point intersect line and axis + + + + Axis Point + + + + Second point of line + + + + Line color + + DialogMeasurements @@ -1730,10 +1872,6 @@ _ _ - - Normal - - Length @@ -1742,10 +1880,6 @@ Insert variable into formula - - Calculate value - - Value of length @@ -1822,6 +1956,22 @@ Select second point of line + + Point along perpendicular + + + + First point of line + + + + Second point of line + + + + Line color + + DialogPatternProperties @@ -2003,10 +2153,6 @@ _ _ - - Point of contact - - Radius @@ -2015,10 +2161,6 @@ Insert variable into formula - - Calculate value - - Value of radius @@ -2091,35 +2233,39 @@ Select second point of line + + Point at intersection of arc and line + + DialogPointOfIntersection - - Point of intersection - - Point label - - vertical point - - First point of angle - - horizontal point - - Second point of angle - Select point horizontally + Point from X and Y of two other points + + + + X: vertical point + + + + Y: horizontal point + + + + Select point for Y value (horizontal) @@ -2133,10 +2279,6 @@ _ _ - - Point of shoulder - - Length @@ -2145,10 +2287,6 @@ Insert variable into formula - - Calculate value - - Value of length @@ -2229,6 +2367,14 @@ Select second point of line + + Special point on shoulder + + + + Line color + + DialogSinglePoint @@ -2259,10 +2405,6 @@ DialogSpline - - Curve - - First point @@ -2295,6 +2437,14 @@ Select last point of curve + + Simple curve + + + + Color + + DialogSplinePath @@ -2334,6 +2484,10 @@ Select point of curve path + + Color + + DialogStandardMeasurements @@ -2396,13 +2550,13 @@ Parser error: %1 + + Line Angle + + DialogTriangle - - Triangle - - Point label @@ -2439,6 +2593,22 @@ Select second point + + Triangle tool + + + + First point of the axis + + + + Second point of the axis + + + + Second point of line + + DialogUndo @@ -2465,10 +2635,6 @@ DialogUnionDetails - - Union details - - <html><head/><body><p>Do you really want union details?</p></body></html> @@ -2489,6 +2655,10 @@ Select detail + + Union tool + + Functions @@ -2675,14 +2845,6 @@ Point along perpendicular - - Special point on shoulder. - - - - Tool triangle. - - Perpendicular point along line @@ -2691,14 +2853,6 @@ Point along bisector - - Point at intersection of arc and line. - - - - Tool to make point from x & y of two other points. - - Point at distance and angle @@ -2707,10 +2861,6 @@ Point at distance along line - - Point of intersection line and axis - - Tools for creating lines. @@ -2735,22 +2885,6 @@ Curve - - Curve tool. - - - - Tool for path curve. - - - - Tool for segmenting a curve. - - - - Tool segment a pathed curve. - - Tools for creating arcs. @@ -2759,14 +2893,6 @@ Arc - - Arc tool. - - - - Cut arc tool. - - Tools for creating details. @@ -2775,14 +2901,6 @@ Detail - - Tool new detail. - - - - Tool for union two details. - - &File @@ -3088,10 +3206,6 @@ For opening pattern need keep both files: pattern and measurements. Do you want Select first point of axis - - Select point vertically - - Select detail @@ -3249,6 +3363,82 @@ Do you want to save your changes? Individual measurements (*.vit) + + Special point on shoulder + + + + Triangle tool + + + + Point at intersection of arc and line + + + + Point from X and Y of two other points + + + + Point intersect line and axis + + + + Simple curve + + + + Curved path + + + + Segmenting a simple curve + + + + Segment a curved path + + + + Point intersect curve and axis + + + + Segment an arc + + + + Point intersect arc and axis + + + + Seam allowance tool + + + + Union tool + + + + toolBar + + + + Last Tool + + + + Activate last used tool again + + + + L + + + + Select point for X value (vertical) + + Measurements @@ -5316,6 +5506,14 @@ Do you want to save your changes? Patterns + + Standard measurements + + + + Layout + + PatternPage @@ -5405,6 +5603,10 @@ Do you want to save your changes? The text that appears in the second column header + + px + + QmuParserErrorMsg @@ -5636,22 +5838,6 @@ Do you want to save your changes? Save layout - - Next - - - - Next detail - - - - Turn - - - - Turn the detail 90 degrees - - Stop @@ -5660,26 +5846,6 @@ Do you want to save your changes? Stop laying - - Enlarge letter - - - - Enlarge the length of the sheet - - - - Reduce sheet - - - - Reduce the length of the sheet - - - - Mirroring - - Zoom In @@ -5688,18 +5854,6 @@ Do you want to save your changes? Zoom Out - - 0 details left. - - - - Collisions not found. - - - - %1 details left. - - untitled @@ -5724,10 +5878,6 @@ Do you want to save your changes? EPS files (*.eps) - - Collisions found. - - Creating file '%1' failed! %2 @@ -5740,6 +5890,14 @@ Do you want to save your changes? Wavefront OBJ (*.obj) + + Layout pages + + + + Layout + + VAbstractConverter @@ -5790,6 +5948,34 @@ Do you want to save your changes? Do you really want delete? + + black + + + + green + + + + blue + + + + dark red + + + + dark green + + + + dark blue + + + + yellow + + VApplication @@ -6283,6 +6469,18 @@ Do you want to save your changes? Point intersection line and axis + + Line color + + + + Color + + + + Point intersection curve and axis + + Variables diff --git a/share/translations/valentina_nl_NL.ts b/share/translations/valentina_nl_NL.ts index 3abffcb12..3c823f6b4 100644 --- a/share/translations/valentina_nl_NL.ts +++ b/share/translations/valentina_nl_NL.ts @@ -229,10 +229,6 @@ Contributors Bijdragers - - Based on Qt %2 (32 bit) - Gebaseerd op Qt %2 (32 bit) - Built on %3 at %4 Gebouwd op %3 op %4 @@ -251,14 +247,14 @@ Build revision: - + Herziene uitgave gebouwd DialogAlongLine Point along line - Punt langs de lijn + Punt langs de lijn Length @@ -270,7 +266,7 @@ Calculate value - Bereken waarde + Bereken waarde Value of length @@ -352,6 +348,14 @@ Select second point of line Selecteer tweede punt van lijn + + Point at distance along line + Punt op afstand langs lijn + + + Line color + + DialogArc @@ -369,7 +373,7 @@ Calculate value - Bereken waarde + Bereken waarde Value of radius @@ -453,7 +457,7 @@ Value of angle of line. - Waarde van hoek van de lijn + Waarde van hoek van de lijn Error @@ -467,12 +471,16 @@ Angles equal Gelijke zijden + + Color + + DialogBisector Bisector - Bisector + Bisector Length @@ -484,7 +492,7 @@ Calculate value - Bereken waarde + Bereken waarde Value of length @@ -578,12 +586,20 @@ Select third point of angle Selecteer derde punt van lijn + + Point along bisector + Punt langs bisector + + + Line color + + DialogCurveIntersectAxis Curve intersect axis - Kromming doorkruist as + Kromming doorkruist as Angle @@ -591,7 +607,7 @@ Calculate value - Bereken waarde + Bereken waarde Value of angle @@ -607,7 +623,7 @@ First point of line - Eerste punt van de lijn + Eerste punt van de lijn Curve @@ -669,12 +685,24 @@ Select axis point Selecteer as punt + + Point intersect curve and axis + + + + Axis Point + + + + Line color + + DialogCutArc Cut arc - Knip boog + Knip boog Length @@ -682,7 +710,7 @@ Calculate value - Bereken waarde + Bereken waarde Value of length @@ -702,7 +730,7 @@ Selected curve - Geselecteerde kromming + Geselecteerde kromming Point label @@ -748,12 +776,24 @@ Variables - Click twice to insert into formula Variabelen - Klik 2 keer om formule in te voeren + + Segment an arc + + + + Selected arc + + + + Color + + DialogCutSpline Cut curve - Knip kromming + Knip kromming Length @@ -761,7 +801,7 @@ Calculate value - Bereken waarde + Bereken waarde Value of length @@ -827,12 +867,20 @@ Variables - Click twice to insert into formula Variabelen - Klik 2 keer om formule in te voeren + + Segmenting a simple curve + + + + Color + + DialogCutSplinePath Cut curve path - Knip kromming + Knip kromming Length @@ -840,7 +888,7 @@ Calculate value - Bereken waarde + Bereken waarde Value of length @@ -906,6 +954,14 @@ Variables - Click twice to insert into formula Variabelen - Klik 2 keer om formule in te voeren + + Segment a curved path + + + + Color + + DialogDetail @@ -955,6 +1011,10 @@ Reverse + Omgekeerde + + + Seam allowance tool @@ -974,7 +1034,7 @@ Calculate value - Bereken waarde + Bereken waarde Value of first angle @@ -1033,7 +1093,7 @@ DialogEndLine Point in the end of a line - Punt aan het einde van een lijn + Punt aan het einde van een lijn Length @@ -1041,7 +1101,7 @@ Calculate value - Bereken waarde + Bereken waarde Value of length @@ -1119,12 +1179,20 @@ Variables Variabelen + + Point at distance and angle + + + + Line color + + DialogHeight Height - Hoogte + Hoogte Point label @@ -1158,6 +1226,18 @@ Select second point of line Selecteer tweede punt van lijn + + Perpendicular point along line + Haakse hoek punt langs lijn + + + Base Point + + + + Line color + + DialogHistory @@ -1195,7 +1275,7 @@ %4 - bisector of angle %1_%2_%3 - + %4 - bisector of angle %1_%2_%3 %5 - intersection of lines %1_%2 and %3_%4 @@ -1404,6 +1484,22 @@ Can't save measurement Kan maten niet opslaan + + Tables of Variables + + + + Base size: %1 %3; Base height: %2 %3 + + + + Description: "%1" + + + + Data successfully saved. + + DialogIndividualMeasurements @@ -1476,11 +1572,121 @@ Inches + + DialogLayoutProgress + + Creation a layout + + + + <html><head/><body><p>Finding best position for worpieces. Please, waite.</p></body></html> + + + + Couldn't prepare data for creation layout + + + + Critical error + + + + Wrong paper size + + + + Several workpieces left not arranged, but none of them match for paper + + + + + DialogLayoutSettings + + Creation a layout + + + + Paper size + + + + Templates: + + + + Width: + + + + Height: + + + + ... + ... + + + Rotate workpiece + + + + Rotate by + + + + degree + + + + Creation options + + + + Layout width: + + + + Shift length: + + + + Principle of choosing the next workpiece + + + + Three groups: big, middle, small + + + + Two groups: big, small + + + + Descending area + + + + Millimiters + Millimiters + + + Centimeters + Centimeters + + + Inches + Inches + + + Pixels + + + DialogLine Line - Lijn + Lijn First point @@ -1502,12 +1708,20 @@ Select second point Selecteer tweede punt + + Line between points + Lijn tussen punten + + + Line color + + DialogLineIntersect Intersection of lines - Kruispunt van lijnen + Kruispunt van lijnen Point label @@ -1541,12 +1755,16 @@ Select second point of second line Selecteer tweede punt van tweede lijn + + Point at line intersection + Punt op lijnkruising + DialogLineIntersectAxis Line intersect axis - Lijn kruist de as + Lijn kruist de as Angle @@ -1554,7 +1772,7 @@ Calculate value - Bereken waarde + Bereken waarde Value of angle @@ -1640,6 +1858,22 @@ Select axis point Selecteer as punt + + Point intersect line and axis + + + + Axis Point + + + + Second point of line + Tweede punt van de lijn + + + Line color + + DialogMeasurements @@ -1672,7 +1906,7 @@ DialogNormal Normal - Normaal + Normaal Length @@ -1684,7 +1918,7 @@ Calculate value - Bereken waarde + Bereken waarde Value of length @@ -1762,6 +1996,22 @@ Select second point of line Selecteer tweede punt van lijn + + Point along perpendicular + + + + First point of line + Eerste punt van de lijn + + + Second point of line + Tweede punt van de lijn + + + Line color + + DialogPatternProperties @@ -1937,7 +2187,7 @@ DialogPointOfContact Point of contact - Contactpunt + Contactpunt Radius @@ -1949,7 +2199,7 @@ Calculate value - Bereken waarde + Bereken waarde Value of radius @@ -2023,12 +2273,16 @@ Select second point of line Selecteer tweede punt van lijn + + Point at intersection of arc and line + Kruispunt van boog en lijn + DialogPointOfIntersection Point of intersection - Kruispunt + Kruispunt Point label @@ -2036,7 +2290,7 @@ vertical point - Verticaal punt + Verticaal punt First point of angle @@ -2044,7 +2298,7 @@ horizontal point - Horizontaal punt + Horizontaal punt Second point of angle @@ -2052,14 +2306,30 @@ Select point horizontally - Selecteer punt horzontaal + Selecteer punt horzontaal + + + Point from X and Y of two other points + + + + X: vertical point + + + + Y: horizontal point + + + + Select point for Y value (horizontal) + DialogShoulderPoint Point of shoulder - Schouderpunt + Schouderpunt Length @@ -2071,7 +2341,7 @@ Calculate value - Bereken waarde + Bereken waarde Value of length @@ -2153,6 +2423,14 @@ Select second point of line Selecteer tweede punt van lijn + + Special point on shoulder + Speciaal punt op schouder + + + Line color + + DialogSinglePoint @@ -2185,7 +2463,7 @@ DialogSpline Curve - Kromming + Kromming First point @@ -2219,6 +2497,14 @@ Select last point of curve Selecteer laatste punt van de krommming + + Simple curve + + + + Color + + DialogSplinePath @@ -2258,6 +2544,10 @@ Select point of curve path Selecteer punt van krommingspad + + Color + + DialogStandardMeasurements @@ -2320,12 +2610,16 @@ Parser error: %1 Fout bij uitpakken: %1 + + Line Angle + + DialogTriangle Triangle - Driehoek + Driehoek Point label @@ -2363,6 +2657,22 @@ Select second point Selecteer tweede punt + + Triangle tool + + + + First point of the axis + + + + Second point of the axis + + + + Second point of line + Tweede punt van de lijn + DialogUndo @@ -2391,7 +2701,7 @@ DialogUnionDetails Union details - Gezamenlijke details + Gezamenlijke details <html><head/><body><p>Do you really want union details?</p></body></html> @@ -2413,6 +2723,10 @@ Select detail Selecteer een detail + + Union tool + + Functions @@ -2546,7 +2860,7 @@ InternalStrings The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - + The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -2569,11 +2883,11 @@ Special point on shoulder. - Speciaal punt op schouder + Speciaal punt op schouder Tool triangle. - Driehoek gereedschap + Driehoek gereedschap Perpendicular point along line @@ -2585,11 +2899,11 @@ Point at intersection of arc and line. - Kruispunt van boog en lijn + Kruispunt van boog en lijn Tool to make point from x & y of two other points. - Gereedschap om een punt te maken van X & Y van twee andere punten + Gereedschap om een punt te maken van X & Y van twee andere punten Point at distance and angle @@ -2601,7 +2915,7 @@ Point of intersection line and axis - Kruispunt tussen lijn en as + Kruispunt tussen lijn en as ... @@ -2633,19 +2947,19 @@ Curve tool. - Krommingsgereedschap + Krommingsgereedschap Tool for path curve. - Gereedschap voorkrommingspad + Gereedschap voorkrommingspad Tool for segmenting a curve. - Gereedschap om een kromming in segmenten te delen + Gereedschap om een kromming in segmenten te delen Tool segment a pathed curve. - Gereedschap segmenteerd een krommingspad + Gereedschap segmenteerd een krommingspad Tools for creating arcs. @@ -2657,11 +2971,11 @@ Arc tool. - Boog gereedschap + Boog gereedschap Cut arc tool. - Knip een boog gereedschap + Knip een boog gereedschap Tools for creating details. @@ -2673,11 +2987,11 @@ Tool new detail. - Gereedschap nieuw detail + Gereedschap nieuw detail Tool for union two details. - Gereedschap om twee details te verenigen. + Gereedschap om twee details te verenigen. &File @@ -3010,7 +3324,7 @@ For opening pattern need keep both files: pattern and measurements. Do you want Select point vertically - Selecteer punt verticaal + Selecteer punt verticaal Select detail @@ -3169,6 +3483,82 @@ Do you want to save your changes? Individual measurements (*.vit) Individuele maten(*.vit) + + Special point on shoulder + Speciaal punt op schouder + + + Triangle tool + + + + Point at intersection of arc and line + Kruispunt van boog en lijn + + + Point from X and Y of two other points + + + + Point intersect line and axis + + + + Simple curve + + + + Curved path + Krommingspad + + + Segmenting a simple curve + + + + Segment a curved path + + + + Point intersect curve and axis + + + + Segment an arc + + + + Point intersect arc and axis + + + + Seam allowance tool + + + + Union tool + + + + toolBar + Werkbalk + + + Last Tool + + + + Activate last used tool again + + + + L + + + + Select point for X value (vertical) + + Measurements @@ -5178,7 +5568,7 @@ Do you want to save your changes? MoveLabel Move point label - + Verplaats punt merk @@ -5236,6 +5626,14 @@ Do you want to save your changes? Patterns Patronen + + Standard measurements + + + + Layout + + PatternPage @@ -5286,7 +5684,7 @@ Do you want to save your changes? QCoreApplication Based on Qt %1 (%2, %3 bit) - + Gebaseerd op Qt %1 (%2, %3 bit) @@ -5325,6 +5723,10 @@ Do you want to save your changes? The text that appears in the second column header Waarde + + px + + QmuParserErrorMsg @@ -5558,19 +5960,19 @@ Do you want to save your changes? Next - Volgende + Volgende Next detail - Volgend detail + Volgend detail Turn - Omdraaien + Omdraaien Turn the detail 90 degrees - Draai het detail 90 graden + Draai het detail 90 graden Stop @@ -5582,23 +5984,23 @@ Do you want to save your changes? Enlarge letter - Vergroot letter + Vergroot letter Enlarge the length of the sheet - Vergroot de lengte van het werkblad + Vergroot de lengte van het werkblad Reduce sheet - Verklein werkblad + Verklein werkblad Reduce the length of the sheet - Verklein de lengte van het werkblad + Verklein de lengte van het werkblad Mirroring - Spiegelen + Spiegelen Zoom In @@ -5610,15 +6012,15 @@ Do you want to save your changes? 0 details left. - 0 details over. + 0 details over. Collisions not found. - Conflicten niet gevonden + Conflicten niet gevonden %1 details left. - %1 details over + %1 details over untitled @@ -5646,7 +6048,7 @@ Do you want to save your changes? Collisions found. - Conflicten gevonden + Conflicten gevonden Creating file '%1' failed! %2 @@ -5658,6 +6060,14 @@ Do you want to save your changes? Wavefront OBJ (*.obj) + Wavefront OBJ (*.obj) + + + Layout pages + + + + Layout @@ -5665,39 +6075,39 @@ Do you want to save your changes? VAbstractConverter Error creation backup file: %1. - + Fout bij het maken van reserve bestand: %1. Couldn't get version information. - + Kon geen versie informatie krijgen. Too many tags <%1> in file. - + Te veel etiketten <%1> in bestand. Version "%1" invalid. - + Versie "%1" ongeldig. Version "0.0.0" invalid. - + Versie "0.0.0" ongeldig. Invalid version. Minimum supported version is %1 - + Ongeldige versie. Minimale ondersteunde versie is %1 Invalid version. Maximum supported version is %1 - + Ongeldige versie. Maximale ondersteunde versie is %1 Error no unique id. - Fout geen unieke ID. + Fout geen unieke ID. Could not change version. - + kon de versie niet veranderen. @@ -5710,6 +6120,34 @@ Do you want to save your changes? Do you really want delete? Wil je echt verwijderen? + + black + + + + green + + + + blue + + + + dark red + + + + dark green + + + + dark blue + + + + yellow + + VApplication @@ -5737,14 +6175,6 @@ Do you want to save your changes? Something's wrong!! Er gaat iets verkeerd! - - Could not copy temp file to document file - Kon temp bestand niet kopiren naar document bestand - - - Could not remove document file - Kon document bestand niet verwijderen - VContainer @@ -5809,19 +6239,19 @@ Do you want to save your changes? Got wrong parameter id. Need only id > 0. - Heeft verkeerde parameter ID. Heeft alleen nodig ID > 0 + Krijg de verkeerde parameter ID. Gebruik alleen ID > 0. This id is not unique. - Deze ID is niet uniek. + Deze ID is niet uniek. Could not copy temp file to document file - Kon temp bestand niet kopiren naar document bestand + Kon temp bestand niet kopieëren naar document bestand Could not remove document file - Kon document bestand niet verwijderen + Kon document bestand niet verwijderen @@ -6024,14 +6454,6 @@ Do you want to save your changes? Error creating or updating union details Fout bij het maken of bijwerken van gezamelijke details - - Got wrong parameter id. Need only id > 0. - Heeft verkeerde parameter ID. Heeft alleen nodig ID > 0 - - - This id is not unique. - Deze ID is niet uniek. - File error. Bestandsfout @@ -6041,11 +6463,11 @@ Do you want to save your changes? VPatternConverter Unexpected version "%1". - + Onverwachte versie "%1". Error restoring backup file: %1. - + Fout met het heropslaan van reserve bestand: %1. @@ -6203,6 +6625,18 @@ Do you want to save your changes? Point intersection line and axis Kruispunt tussen lijn en as + + Line color + + + + Color + + + + Point intersection curve and axis + + Variables @@ -6236,32 +6670,32 @@ Do you want to save your changes? VisToolCurveIntersectAxis <b>Intersection curve and axis</b>: angle = %1°; <b>Shift</b> - sticking angle, <b>Enter</b> - finish creation - + <b>Kruising tussen kromming en as</b>: hoek = %1°; <b>Shift</b> - klevende hoek, <b>Enter</b> - voltooi creatie VisToolEndLine <b>Point at distance and angle</b>: angle = %1°; <b>Shift</b> - sticking angle, <b>Enter</b> - finish creation - + <b>Punt op afstand en hoek</b>: hoek = %1°; <b>Shift</b> - klevende hoek, <b>Enter</b> - voltooi creatie VisToolLineIntersectAxis <b>Intersection line and axis</b>: angle = %1°; <b>Shift</b> - sticking angle, <b>Enter</b> - finish creation - + <b>Kruising tussen lijn en as</b>: hoek = %1°; <b>Shift</b> - klevende hoek, <b>Enter</b> - voltooi creatie VisToolSplinePath <b>Curved path</b>: select three or more points - + <b>Krommings pad</b>: selecteer drie of meer punten <b>Curved path</b>: select three or more points, <b>Enter</b> - finish creation - + <b>Krommings pad</b>: selecteer drie of meer punten, <b>Enter</b> - voltooi creatie diff --git a/share/translations/valentina_ru_RU.ts b/share/translations/valentina_ru_RU.ts index 88e81d194..200de19d5 100644 --- a/share/translations/valentina_ru_RU.ts +++ b/share/translations/valentina_ru_RU.ts @@ -266,7 +266,7 @@ DialogAlongLine Point along line - Точка вдоль линии + Точка вдоль линии Length @@ -290,7 +290,7 @@ Calculate value - Расчитать значение + Расчитать значение Point label @@ -380,6 +380,14 @@ Select second point of line Выберить вторую точку линии + + Point at distance along line + Точка вдоль линии + + + Line color + Цвет линии + DialogArc @@ -405,7 +413,7 @@ Calculate value - Расчитать значение + Расчитать значение Value of radius @@ -517,7 +525,7 @@ Value of angle of line. - Значение угла линии. + Значение угла линии. Error @@ -531,12 +539,16 @@ Angles equal Углы равны + + Color + Цвет + DialogBisector Bisector - Бисектриса + Бисектриса Length @@ -564,7 +576,7 @@ Calculate value - Расчитать значение + Расчитать значение <html><head/><body><p>Show full calculation in message box</p></body></html> @@ -662,12 +674,20 @@ Select third point of angle Выберить третью точку угла + + Point along bisector + Точка вдоль бисектрисы + + + Line color + Цвет линии + DialogCurveIntersectAxis Curve intersect axis - Пересичение кривой и оси + Пересичение кривой и оси Angle @@ -675,7 +695,7 @@ Calculate value - Расчитать значение + Расчитать значение Value of angle @@ -691,7 +711,7 @@ First point of line - Первая точка линии + Первая точка линии Curve @@ -753,6 +773,18 @@ Select axis point Выберить точку оси + + Point intersect curve and axis + Точка пересечения кривой и оси + + + Axis Point + Точка оси + + + Line color + Цвет линии + DialogCutArc @@ -770,7 +802,7 @@ Cut arc - Разрезать дугу + Разрезать дугу ... @@ -778,7 +810,7 @@ Calculate value - Расчитать значение + Расчитать значение Value of length @@ -798,7 +830,7 @@ Selected curve - Выбраная кривая + Выбраная кривая Point label @@ -848,6 +880,18 @@ Variables - Click twice to insert into formula Переменные - кликнете дважды для вставки в формулу + + Segment an arc + Разделить дугу + + + Selected arc + Выбраная дуга + + + Color + Цвет + DialogCutSpline @@ -865,7 +909,7 @@ Cut curve - Разрезать кривую + Разрезать кривую ... @@ -873,7 +917,7 @@ Calculate value - Расчитать значение + Расчитать значение Value of length @@ -943,6 +987,14 @@ Variables - Click twice to insert into formula Переменные - кликнете дважды для вставки в формулу + + Segmenting a simple curve + Разделение простой кривой + + + Color + Цвет + DialogCutSplinePath @@ -960,7 +1012,7 @@ Cut curve path - Разрезать сложную кривую + Разрезать сложную кривую ... @@ -968,7 +1020,7 @@ Calculate value - Расчитать значение + Расчитать значение Value of length @@ -1038,6 +1090,14 @@ Variables - Click twice to insert into formula Переменные - кликнете дважды для вставки в формулу + + Segment a curved path + Разделить сложною кривую + + + Color + Цвет + DialogDetail @@ -1093,6 +1153,10 @@ Reverse Изменить направление + + Seam allowance tool + Деталь + DialogEditWrongFormula @@ -1114,7 +1178,7 @@ Calculate value - Расчитать значение + Расчитать значение Value of first angle @@ -1181,7 +1245,7 @@ Point in the end of a line - Точка на конце отрезка + Точка на конце отрезка Formula for calculation of length of line @@ -1189,7 +1253,7 @@ Calculate value - Расчитать значение + Расчитать значение ... @@ -1295,6 +1359,14 @@ Length of curves Длина кривых + + Point at distance and angle + Точка на конце отрезка + + + Line color + Цвет линии + DialogHeight @@ -1304,7 +1376,7 @@ Height - Рост + Рост Point label @@ -1338,6 +1410,18 @@ Select second point of line Выберить вторую точку линии + + Perpendicular point along line + Перпендикулярная точка вдоль линии + + + Base Point + Базовая точка + + + Line color + Цвет линии + DialogHistory @@ -1636,6 +1720,22 @@ Length Длина + + Tables of Variables + Таблици переменных + + + Base size: %1 %3; Base height: %2 %3 + Базовый размер: %1 %3; Базовый рост: %2 %3 + + + Description: "%1" + Описание: "%1" + + + Data successfully saved. + Данные успешно сохранены. + DialogIndividualMeasurements @@ -1728,11 +1828,121 @@ дюймы + + DialogLayoutProgress + + Creation a layout + Создание раскладки + + + <html><head/><body><p>Finding best position for worpieces. Please, waite.</p></body></html> + <html><head/><body><p>Поиск лутшей позиции для детали. Пожайлуста, подождите.</p></body></html> + + + Couldn't prepare data for creation layout + Не удалось подготовить данные для создания лекала + + + Critical error + Критическая ошибка + + + Wrong paper size + Не правильный размер листа + + + Several workpieces left not arranged, but none of them match for paper + Несколько деталей остались не уложеными, но никто из них не подходит для листа + + + + DialogLayoutSettings + + Creation a layout + Создание раскладки + + + Paper size + Размер листа: + + + Templates: + Шаблоны: + + + Width: + Ширина: + + + Height: + Выстора: + + + ... + ... + + + Rotate workpiece + Поворачивать детали + + + Rotate by + Поворачивать на + + + degree + градусы + + + Creation options + Опции создания + + + Layout width: + Ширина раскладки: + + + Shift length: + Длина смещения: + + + Principle of choosing the next workpiece + Прицип выбора очередной детали + + + Three groups: big, middle, small + Три групы: большие, средние, малые + + + Two groups: big, small + Две группы: большие, малые + + + Descending area + По убыванию площади + + + Millimiters + Миллиметры + + + Centimeters + Сантиметры + + + Inches + Дюймы + + + Pixels + Пиксели + + DialogLine Line - Линия + Линия First point @@ -1754,6 +1964,14 @@ Select second point Выберить вторую точку + + Line between points + Линия между точками + + + Line color + Цвет линии + DialogLineIntersect @@ -1763,7 +1981,7 @@ Intersection of lines - Пересичение линий + Пересичение линий Point label @@ -1797,12 +2015,16 @@ Select second point of second line Выберить вторую точку второй линии + + Point at line intersection + Точка пересичения линий + DialogLineIntersectAxis Line intersect axis - Пересечение линии и оси + Пересечение линии и оси Angle @@ -1810,7 +2032,7 @@ Calculate value - Расчитать значение + Расчитать значение Value of angle @@ -1896,6 +2118,22 @@ Select axis point Выберить точку оси + + Point intersect line and axis + Точка пересечения линии и оси + + + Axis Point + Точка оси + + + Second point of line + Вторая точка линии + + + Line color + Цвет линии + DialogMeasurements @@ -1928,7 +2166,7 @@ DialogNormal Normal - Перпендикуляр + Перпендикуляр Length @@ -1972,7 +2210,7 @@ Calculate value - Расчитать значение + Расчитать значение Point label @@ -2038,6 +2276,22 @@ Select second point of line Выберить вторую точку линии + + Point along perpendicular + Инструмент точка перпендикуляра + + + First point of line + Первая точка линии + + + Second point of line + Вторая точка линии + + + Line color + Цвет линии + DialogPatternProperties @@ -2361,7 +2615,7 @@ DialogPointOfContact Point of contact - Точка касания + Точка касания Radius @@ -2393,7 +2647,7 @@ Calculate value - Расчитать значение + Расчитать значение Point label @@ -2467,6 +2721,10 @@ Select point of center of arc Выберите точку центра дуги + + Point at intersection of arc and line + Точка на пересечении дуги и линии + DialogPointOfIntersection @@ -2480,11 +2738,11 @@ vertical point - Точка вертикали + Точка вертикали horizontal point - Точка горизонтали + Точка горизонтали First point of angle @@ -2492,7 +2750,7 @@ Point of intersection - Точка пересечения + Точка пересечения Second point of angle @@ -2500,6 +2758,22 @@ Select point horizontally + Выберить точку по горозинтали + + + Point from X and Y of two other points + Точка из Х и Y координат двух других точек + + + X: vertical point + Х: вертикальная точка + + + Y: horizontal point + Y: горизонтальная точка + + + Select point for Y value (horizontal) Выберить точку по горозинтали @@ -2507,7 +2781,7 @@ DialogShoulderPoint Point of shoulder - Точка плеча + Точка плеча Length @@ -2531,7 +2805,7 @@ Calculate value - Расчитать значение + Расчитать значение Point label @@ -2625,6 +2899,14 @@ Select point of shoulder Выберить точку плеча + + Special point on shoulder + Специальная точка на плече + + + Line color + Цвет линии + DialogSinglePoint @@ -2657,7 +2939,7 @@ DialogSpline Curve - Кривая + Кривая First point @@ -2691,6 +2973,14 @@ Select last point of curve Выберить последнюю точку кривой + + Simple curve + Простая кривая + + + Color + Цвет + DialogSplinePath @@ -2734,6 +3024,10 @@ Select point of curve path Выберить точку сложной кривой + + Color + Цвет + DialogStandardMeasurements @@ -2836,6 +3130,10 @@ Parser error: %1 Ошибка синтаксического анализа: %1 + + Line Angle + Угол линии + DialogTriangle @@ -2845,7 +3143,7 @@ Triangle - Треугольник + Треугольник Point label @@ -2883,6 +3181,22 @@ Select second point Выберить вторую точку + + Triangle tool + Инструмент треугольник + + + First point of the axis + Первая точка оси + + + Second point of the axis + Вторая точка оси + + + Second point of line + Вторая точка линии + DialogUndo @@ -2935,12 +3249,16 @@ Union details - Объединение деталей + Объединение деталей <html><head/><body><p>Do you really want union details?</p></body></html> <html><head/><body><р>Показать полный расчет в окне сообщения</p></body></html> + + Union tool + Инструмент объединения деталей + Functions @@ -3101,7 +3419,7 @@ Special point on shoulder. - Инструмент точка плеча. + Инструмент точка плеча. Point at distance and angle @@ -3117,7 +3435,7 @@ Point at intersection of arc and line. - Инструмент точка касания. + Инструмент точка касания. Tool point of height. @@ -3125,7 +3443,7 @@ Tool triangle. - Инструмент угольник. + Инструмент угольник. Tools for creating lines. @@ -3181,7 +3499,7 @@ Tool new detail. - Инструмент новая деталь. + Инструмент новая деталь. File @@ -3217,7 +3535,7 @@ Tool to make point from x & y of two other points. - Инструмент, чтобы сделать точку от х и у двух других точек. + Инструмент, чтобы сделать точку от х и у двух других точек. Line between points @@ -3229,35 +3547,35 @@ Curve tool. - Инструмент кривая. + Инструмент кривая. Tool for path curve. - Инструмент сложная кривая. + Инструмент сложная кривая. Tool segment a pathed curve. - Инструмент разрезания сложной кривой. + Инструмент разрезания сложной кривой. Tool for segmenting a curve. - Инструмент разрезания кривой. + Инструмент разрезания кривой. Point of intersection line and axis - Точка пересечения линии и оси + Точка пересечения линии и оси Arc tool. - Инструмент дуга. + Инструмент дуга. Cut arc tool. - Инструмент разрезания дуги. + Инструмент разрезания дуги. Tool for union two details. - Инструмент объединения двух деталей. + Инструмент объединения двух деталей. &File @@ -3863,7 +4181,7 @@ Do you want to save your changes? Select point vertically - Выберить точку по вертикали + Выберить точку по вертикали Based on Qt %2 (32 bit) @@ -3941,6 +4259,82 @@ Do you want to save your changes? This file already opened in another window. Этот файл уже открыт в другом окне. + + Special point on shoulder + Специальная точка на плече + + + Triangle tool + Инструмент треугольник + + + Point at intersection of arc and line + Точка на пересечении дуги и линии + + + Point from X and Y of two other points + Точка из Х и Y координат двух других точек + + + Point intersect line and axis + Точка пересечения линии и оси + + + Simple curve + Простая кривая + + + Curved path + Сложная кривая + + + Segmenting a simple curve + Разделение простой кривой + + + Segment a curved path + Разделение сложной кривой + + + Point intersect curve and axis + Точка пересечения кривой и оси + + + Segment an arc + Разделить дугу + + + Point intersect arc and axis + Точка пересечения дуги и оси + + + Seam allowance tool + Деталь + + + Union tool + Инструмент объединения деталей + + + toolBar + Панель инструментов + + + Last Tool + Последний инструмент + + + Activate last used tool again + Активировать снова последний использованый инструмент + + + L + L + + + Select point for X value (vertical) + Выберить точку по вертикали + Measurements @@ -6828,6 +7222,14 @@ Do you want to save your changes? Patterns Лекала + + Standard measurements + Стандартная таблица мерок + + + Layout + Роскладка + PatternPage @@ -6973,6 +7375,10 @@ Do you want to save your changes? The text that appears in the second column header Значение + + px + px + QmuParserErrorMsg @@ -7206,19 +7612,19 @@ Do you want to save your changes? Next - Следующая + Следующая Next detail - Следующая деталь + Следующая деталь Turn - Перевернуть + Перевернуть Turn the detail 90 degrees - Перевернуть детальна на 90 градусов + Перевернуть детальна на 90 градусов Turn the detail 180 degrees @@ -7230,11 +7636,11 @@ Do you want to save your changes? Enlarge letter - Увеличить лист + Увеличить лист Enlarge the length of the sheet - Увеличить длину листа + Увеличить длину листа Enlarge the length of sheet @@ -7242,15 +7648,15 @@ Do you want to save your changes? Reduce sheet - Уменьшить лист + Уменьшить лист Reduce the length of the sheet - Уменьшить длину листа + Уменьшить длину листа Mirroring - Отражение + Отражение Zoom In @@ -7266,15 +7672,15 @@ Do you want to save your changes? 0 details left. - 0 деталей осталось. + 0 деталей осталось. Collisions not found. - Колизии не обнаружены. + Колизии не обнаружены. %1 details left. - %1 деталей осталось. + %1 деталей осталось. untitled @@ -7302,7 +7708,7 @@ Do you want to save your changes? Collisions found. - Найдены колизии. + Найдены колизии. Creating file '%1' failed! %2 @@ -7324,6 +7730,14 @@ Do you want to save your changes? Wavefront OBJ (*.obj) Wavefront OBJ (*.obj) + + Layout pages + Страницы роскладки + + + Layout + Роскладка + VAbstractConverter @@ -7381,6 +7795,34 @@ Do you want to save your changes? Do you really want delete? Вы точно хотите удалить? + + black + черный + + + green + зеленый + + + blue + синий + + + dark red + темно красный + + + dark green + темно зеленый + + + dark blue + темно синий + + + yellow + желтый + VApplication @@ -8057,6 +8499,18 @@ Do you want to save your changes? Point intersection line and axis Точка пересечения линии и оси + + Line color + Цвет линии + + + Color + Цвет + + + Point intersection curve and axis + Точка пересечения кривой и оси + VToolTriangle diff --git a/share/translations/valentina_uk_UA.ts b/share/translations/valentina_uk_UA.ts index c031dcfec..f5cb5fb7e 100644 --- a/share/translations/valentina_uk_UA.ts +++ b/share/translations/valentina_uk_UA.ts @@ -262,7 +262,7 @@ DialogAlongLine Point along line - Точка вздовж лінії + Точка вздовж лінії Length @@ -278,7 +278,7 @@ Calculate value - Розрахунок довжини + Розрахунок довжини Point label @@ -368,6 +368,14 @@ Select second point of line Виберіть другу точку лінії + + Point at distance along line + Точка вздовж лінії + + + Line color + Колір лінії + DialogArc @@ -389,7 +397,7 @@ Calculate value - Розрахувати значення + Розрахувати значення Value of radius @@ -497,7 +505,7 @@ Value of angle of line. - Значення кута лінії. + Значення кута лінії. Error @@ -511,12 +519,16 @@ Angles equal Кути однакові + + Color + Колір + DialogBisector Bisector - Бісектриса + Бісектриса Length @@ -536,7 +548,7 @@ Calculate value - Розрахувати значення + Розрахувати значення <html><head/><body><p>Show full calculation in message box</p></body></html> @@ -638,12 +650,20 @@ _ _ + + Point along bisector + Точка бісектриси кута + + + Line color + Колір лінії + DialogCurveIntersectAxis Curve intersect axis - Перетин кривої і осі + Перетин кривої і осі Angle @@ -651,7 +671,7 @@ Calculate value - Розрахувати значення + Розрахувати значення Value of angle @@ -667,7 +687,7 @@ First point of line - Перша точка лінії + Перша точка лінії Curve @@ -729,6 +749,18 @@ Select axis point Виберіть точку осі + + Point intersect curve and axis + Точка перениту кривої і вісі + + + Axis Point + Точка осі + + + Line color + Колір лінії + DialogCutArc @@ -746,7 +778,7 @@ Cut arc - Розрізати дугу + Розрізати дугу ... @@ -754,7 +786,7 @@ Calculate value - Розрахувати значення + Розрахувати значення Value of length @@ -774,7 +806,7 @@ Selected curve - Вибрана крива + Вибрана крива Point label @@ -824,6 +856,18 @@ Variables - Click twice to insert into formula Змінні - клікніть двічі для вставки в формулу + + Segment an arc + Сегмент дуги + + + Selected arc + Виберіть дугу + + + Color + Колір + DialogCutSpline @@ -841,7 +885,7 @@ Cut curve - Розрізат криву + Розрізат криву ... @@ -849,7 +893,7 @@ Calculate value - Розрахувати значення + Розрахувати значення Value of length @@ -919,6 +963,14 @@ Variables - Click twice to insert into formula Змінні - клікніть двічі для вставки в формулу + + Segmenting a simple curve + Сегментація простої кривої + + + Color + Колір + DialogCutSplinePath @@ -936,7 +988,7 @@ Cut curve path - Розрізати складну криву + Розрізати складну криву ... @@ -944,7 +996,7 @@ Calculate value - Розрахувати значення + Розрахувати значення Value of length @@ -1014,6 +1066,14 @@ Variables - Click twice to insert into formula Змінні - клікніть двічі для вставки в формулу + + Segment a curved path + Сегментація складної кривої + + + Color + Колір + DialogDetail @@ -1069,6 +1129,10 @@ Reverse Протилежний напрямок + + Seam allowance tool + Деталь + DialogEditWrongFormula @@ -1090,7 +1154,7 @@ Calculate value - Розрахувати значення + Розрахувати значення Value of first angle @@ -1157,7 +1221,7 @@ Point in the end of a line - Точка на кінці відрізку + Точка на кінці відрізку Formula for calculation of length of line @@ -1165,7 +1229,7 @@ Calculate value - Розрахувати значення + Розрахувати значення Value of length @@ -1263,6 +1327,14 @@ Length of curves Довжина кривих + + Point at distance and angle + Точка на кінці лінії + + + Line color + Колір лінії + DialogHeight @@ -1272,7 +1344,7 @@ Height - Зріст + Зріст Point label @@ -1306,6 +1378,18 @@ Select second point of line Виберіть другу точку лінії + + Perpendicular point along line + Перпендикулярна точка вздовж лінії + + + Base Point + Базова точка + + + Line color + Колір лінії + DialogHistory @@ -1600,6 +1684,22 @@ Length Довжина + + Tables of Variables + Таблиці змінних + + + Base size: %1 %3; Base height: %2 %3 + Базовий розмір: %1 %3; Базовий зріст: %2 %3 + + + Description: "%1" + Опис: "%1" + + + Data successfully saved. + Данні успішно збережені. + DialogIndividualMeasurements @@ -1680,11 +1780,121 @@ Дюйми + + DialogLayoutProgress + + Creation a layout + Створення розкладки + + + <html><head/><body><p>Finding best position for worpieces. Please, waite.</p></body></html> + <html><head/><body><p>Зачекайте, відбувається пошук найкращої позиції для деталі.</p></body></html> + + + Couldn't prepare data for creation layout + Не вдалося підготувати данні для створення розкладки + + + Critical error + Критична помилка + + + Wrong paper size + Не правильний розмір паперу + + + Several workpieces left not arranged, but none of them match for paper + Декілька деталей залишилися укладеними, але жодна з них не підійшла для листа + + + + DialogLayoutSettings + + Creation a layout + Створення розкладки + + + Paper size + Розмір паперу + + + Templates: + Шаблони: + + + Width: + Ширина: + + + Height: + Висота: + + + ... + ... + + + Rotate workpiece + Повертати деталі + + + Rotate by + Повертати на + + + degree + градуси + + + Creation options + Опції створення + + + Layout width: + Ширина розкладки: + + + Shift length: + Довжина зміщення: + + + Principle of choosing the next workpiece + Принцип вибору настпної деталі + + + Three groups: big, middle, small + Три групи: великі, середні, малі + + + Two groups: big, small + Дві групи: великі, малі + + + Descending area + За спаданням площі + + + Millimiters + Міліметри + + + Centimeters + Сантиметри + + + Inches + Дюйми + + + Pixels + Пікселі + + DialogLine Line - Лінія + Лінія First point @@ -1706,6 +1916,14 @@ Select second point Виберіть другу точку + + Line between points + Лінія між двома точками + + + Line color + Колір лінії + DialogLineIntersect @@ -1715,7 +1933,7 @@ Intersection of lines - Перетин ліній + Перетин ліній Point label @@ -1749,12 +1967,16 @@ Select second point of second line Виберіть другу точку другої лінії + + Point at line intersection + Точка перетину ліній + DialogLineIntersectAxis Line intersect axis - Перетин лінії і осі + Перетин лінії і осі Angle @@ -1762,7 +1984,7 @@ Calculate value - Розрахувати значення + Розрахувати значення Value of angle @@ -1848,6 +2070,22 @@ Select axis point Виберіть точку осі + + Point intersect line and axis + Точка на перетині лінії і осі + + + Axis Point + Точка осі + + + Second point of line + Друга точка лінії + + + Line color + Колір лінії + DialogMeasurements @@ -1880,7 +2118,7 @@ DialogNormal Normal - Перпендикуляр + Перпендикуляр Length @@ -1920,7 +2158,7 @@ Calculate value - Розрахувати значення + Розрахувати значення Point label @@ -1982,6 +2220,22 @@ Select second point of line Виберіть другу точку лінії + + Point along perpendicular + Інструмент точка перпендикуляра + + + First point of line + Перша точка лінії + + + Second point of line + Друга точка лінії + + + Line color + Колір лінії + DialogPatternProperties @@ -2157,7 +2411,7 @@ DialogPointOfContact Point of contact - Точка дотику + Точка дотику Radius @@ -2181,7 +2435,7 @@ Calculate value - Розрахувати значення + Розрахувати значення Point label @@ -2255,6 +2509,10 @@ Select point of center of arc Виберіть точку центру дуги + + Point at intersection of arc and line + Точка на перетині дуги та лінії + DialogPointOfIntersection @@ -2268,11 +2526,11 @@ vertical point - Точка по вертикалі + Точка по вертикалі horizontal point - Точка по горизонталі + Точка по горизонталі First point of angle @@ -2280,7 +2538,7 @@ Point of intersection - Точка перетину + Точка перетину Second point of angle @@ -2288,14 +2546,30 @@ Select point horizontally - Виберіть точку горизонталі + Виберіть точку горизонталі + + + Point from X and Y of two other points + Точка на перетині Х і Y коодринат двох інших точок + + + X: vertical point + Х: вертикальна точка + + + Y: horizontal point + Y: горизонтальна точка + + + Select point for Y value (horizontal) + Виберіть точку на горизонталі DialogShoulderPoint Point of shoulder - Точка плеча + Точка плеча Length @@ -2311,7 +2585,7 @@ Calculate value - Розрахувати значення + Розрахувати значення Point label @@ -2405,6 +2679,14 @@ Select point of shoulder Виберіть точку плеча + + Special point on shoulder + Спеціальна точка на плече + + + Line color + Колір лінії + DialogSinglePoint @@ -2437,7 +2719,7 @@ DialogSpline Curve - Крива + Крива First point @@ -2471,6 +2753,14 @@ Select last point of curve Виберість останню точку кривої + + Simple curve + Проста крива + + + Color + Колір + DialogSplinePath @@ -2514,6 +2804,10 @@ Select point of curve path Виберіть точку складної кривої + + Color + Колір + DialogStandardMeasurements @@ -2616,6 +2910,10 @@ Parser error: %1 Помилка синтаксичного аналізу: %1 + + Line Angle + Кут лінії + DialogTriangle @@ -2625,7 +2923,7 @@ Triangle - Трикутник + Трикутник Point label @@ -2663,6 +2961,22 @@ Select second point Виберіть другу точку + + Triangle tool + Інструмент трикутник + + + First point of the axis + Перша точка вісі + + + Second point of the axis + Друга точка вісі + + + Second point of line + Друга точка лінії + DialogUndo @@ -2715,12 +3029,16 @@ Union details - Обєднання деталей + Обєднання деталей <html><head/><body><p>Do you really want union details?</p></body></html> <html><head/><body><р>Показати повний розрахунок у вікні повідомлення</p></body</html> + + Union tool + Інструмент об'єднання + Functions @@ -2877,7 +3195,7 @@ Special point on shoulder. - Інструмент точка плеча. + Інструмент точка плеча. Point at distance and angle @@ -2893,7 +3211,7 @@ Point at intersection of arc and line. - Інструмент точка дотику. + Інструмент точка дотику. Tool point of height. @@ -2901,7 +3219,7 @@ Tool triangle. - Інструмент трикутник. + Інструмент трикутник. Tools for creating lines. @@ -2957,7 +3275,7 @@ Tool new detail. - Інструмент нова деталь. + Інструмент нова деталь. File @@ -2993,7 +3311,7 @@ Tool to make point from x & y of two other points. - Інструменд для створення точки з двух х и у координат двух інших точок. + Інструменд для створення точки з двух х и у координат двух інших точок. Line between points @@ -3005,23 +3323,23 @@ Curve tool. - Інструмент крива. + Інструмент крива. Tool for path curve. - Інструмент складна крива. + Інструмент складна крива. Tool segment a pathed curve. - Інструмент розрізання складної кривої. + Інструмент розрізання складної кривої. Tool for segmenting a curve. - Інструмент розрізання кривої. + Інструмент розрізання кривої. Point of intersection line and axis - Точка на перетині лінії і осі + Точка на перетині лінії і осі ... @@ -3029,15 +3347,15 @@ Arc tool. - Інструмент дуга. + Інструмент дуга. Cut arc tool. - Інструмент розрізання дуги. + Інструмент розрізання дуги. Tool for union two details. - Інструмент обєднання двух деталей. + Інструмент обєднання двух деталей. &File @@ -3583,7 +3901,7 @@ For opening pattern need keep both files: pattern and measurements. Do you want Select point vertically - Виберіть точку по вертикалі + Виберіть точку по вертикалі Select detail @@ -3711,6 +4029,82 @@ Do you want to save your changes? This file already opened in another window. Цей файл вже відкрито в іншому вікні. + + Special point on shoulder + Спеціальна точка на плечі + + + Triangle tool + Інструмент трикутник + + + Point at intersection of arc and line + Точка на перетині дуги та лінії + + + Point from X and Y of two other points + Точка на перетині Х і Y коодринат двох інших точок + + + Point intersect line and axis + Точка на перетині лінії і осі + + + Simple curve + Проста крива + + + Curved path + Складна крива + + + Segmenting a simple curve + Сегментація простої кривої + + + Segment a curved path + Сегментація складної кривої + + + Point intersect curve and axis + Точка перениту кривої і вісі + + + Segment an arc + Сегмент дуги + + + Point intersect arc and axis + Точка перетину дуги і вісі + + + Seam allowance tool + Деталь + + + Union tool + Інструмент об'єднання + + + toolBar + Панель інструментів + + + Last Tool + Останній інструмент + + + Activate last used tool again + Активувати останній використаний інструмент знову + + + L + L + + + Select point for X value (vertical) + Виберіть точку по вертикалі + Measurements @@ -5793,6 +6187,14 @@ Do you want to save your changes? Patterns Лекала + + Standard measurements + Стандартна таблиця мірок + + + Layout + Розкладка + PatternPage @@ -5933,6 +6335,10 @@ Do you want to save your changes? The text that appears in the second column header Значення + + px + піксел + QmuParserErrorMsg @@ -6167,19 +6573,19 @@ Do you want to save your changes? Next - Наступний + Наступний Next detail - Наступна деталь + Наступна деталь Turn - Повернути + Повернути Turn the detail 90 degrees - Повернути деталь на 90 градусів + Повернути деталь на 90 градусів Turn the detail 180 degrees @@ -6191,11 +6597,11 @@ Do you want to save your changes? Enlarge letter - Збільшити аркуш + Збільшити аркуш Enlarge the length of the sheet - Збільшити довжину аркушу + Збільшити довжину аркушу Enlarge the length of sheet @@ -6203,15 +6609,15 @@ Do you want to save your changes? Reduce sheet - Зменшити аркуш + Зменшити аркуш Reduce the length of the sheet - Зменшити довжину аркушу + Зменшити довжину аркушу Mirroring - Дзеркальне відображення + Дзеркальне відображення Zoom In @@ -6227,15 +6633,15 @@ Do you want to save your changes? 0 details left. - 0 деталей залишилось. + 0 деталей залишилось. Collisions not found. - Колізії не знайдено. + Колізії не знайдено. %1 details left. - %1 деталей залишилось. + %1 деталей залишилось. untitled @@ -6263,7 +6669,7 @@ Do you want to save your changes? Collisions found. - Знайдено колізії. + Знайдено колізії. Creating file '%1' failed! %2 @@ -6281,6 +6687,14 @@ Do you want to save your changes? Wavefront OBJ (*.obj) Wavefront OBJ (*.obj) + + Layout pages + Сторінки розкладки + + + Layout + Розкладка + VAbstractConverter @@ -6338,6 +6752,34 @@ Do you want to save your changes? Do you really want delete? Ви дійсно хочете видалити? + + black + чорний + + + green + зелений + + + blue + синій + + + dark red + темно червоний + + + dark green + темно зелений + + + dark blue + темно синій + + + yellow + жовтий + VApplication @@ -7006,6 +7448,18 @@ Do you want to save your changes? Point intersection line and axis Точка на перетині лінії і осі + + Line color + Колір лінії + + + Color + Колір + + + Point intersection curve and axis + Точка перениту кривої і вісі + VToolTriangle diff --git a/src/app/app.pro b/src/app/app.pro index 2f2885803..0d23a1ae2 100644 --- a/src/app/app.pro +++ b/src/app/app.pro @@ -109,7 +109,7 @@ CONFIG(debug, debug|release){ #Calculate latest tag distance and build revision only in release mode. Change number each time requare #recompilation precompiled headers file. DEFINES += "LATEST_TAG_DISTANCE=0" - DEFINES += "BUILD_REVISION=\\\"uknown\\\"" + DEFINES += "BUILD_REVISION=\\\"unknown\\\"" }else{ # Release mode DEFINES += V_NO_ASSERT @@ -126,7 +126,7 @@ CONFIG(debug, debug|release){ } #latest tag distance number for using in version - HG_DISTANCE=$$system(hg log -r tip --template '{latesttagdistance}') + HG_DISTANCE=$$system(hg log -r. --template '{latesttagdistance}') isEmpty(HG_DISTANCE){ HG_DISTANCE = 0 # if we can't find local revision left 0. } @@ -135,10 +135,10 @@ CONFIG(debug, debug|release){ #build revision number for using in version unix { - HG_HESH=$$system("hg log -r tip --template '{node|short}'") + HG_HESH=$$system("hg log -r. --template '{node|short}'") } else { # Use escape character before "|" on Windows - HG_HESH=$$system(hg log -r tip --template "{node^|short}") + HG_HESH=$$system(hg log -r. --template "{node^|short}") } isEmpty(HG_HESH){ HG_HESH = "unknown" # if we can't find build revision left unknown. @@ -181,7 +181,8 @@ INSTALL_TRANSLATIONS += \ $${TRANSLATIONS_PATH}/valentina_fr_FR.qm \ $${TRANSLATIONS_PATH}/valentina_it_IT.qm \ $${TRANSLATIONS_PATH}/valentina_nl_NL.qm \ - $${TRANSLATIONS_PATH}/valentina_id_ID.qm + $${TRANSLATIONS_PATH}/valentina_id_ID.qm \ + $${TRANSLATIONS_PATH}/valentina_es_ES.qm # Set "make install" command for Unix-like systems. unix{ @@ -306,11 +307,19 @@ unix{ QMAKE_BUNDLE_DATA += TRANSLATION_id_ID } - qmuparser.path = $$FRAMEWORKS_DIR - qmuparser.files = $${OUT_PWD}/../libs/qmuparser/$${DESTDIR}/ - qmuparser.files += $${OUT_PWD}/../libs/qmuparser/$${DESTDIR}/libqmuparser.2.dylib - vpropertyexplorer.path = $$FRAMEWORKS_DIR - vpropertyexplorer.files = $${OUT_PWD}/../libs/vpropertyexplorer/$${DESTDIR}/ + exists($${TRANSLATIONS_PATH}/valentina_es_ES.qm){ + TRANSLATION_es_ES.files += \ + $${TRANSLATIONS_PATH}/valentina_es_ES.qm \ + $${TRANSLATIONS_PATH}/Localizable.strings + TRANSLATION_es_ES.path = "$$RESOURCES_DIR/translations/es_ES.lproj" + QMAKE_BUNDLE_DATA += TRANSLATION_es_ES + } + + # Symlinks also good names for copying. Make will take origin file and copy them with using symlink name. + # For bundle this names more then enough. We don't need care much about libraries versions. + libraries.path = $$FRAMEWORKS_DIR + libraries.files += $${OUT_PWD}/../libs/qmuparser/$${DESTDIR}/libqmuparser.2.dylib + libraries.files += $${OUT_PWD}/../libs/vpropertyexplorer/$${DESTDIR}/libvpropertyexplorer.1.dylib # logo on macx. @@ -322,9 +331,7 @@ unix{ QMAKE_BUNDLE_DATA += \ standard \ - qmuparser \ - vpropertyexplorer - + libraries } } @@ -393,6 +400,15 @@ DEPENDPATH += $$PWD/../libs/vobj win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vobj/$${DESTDIR}/vobj.lib else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vobj/$${DESTDIR}/libvobj.a +# VLayout static library +unix|win32: LIBS += -L$$OUT_PWD/../libs/vlayout/$${DESTDIR}/ -lvlayout + +INCLUDEPATH += $$PWD/../libs/vlayout +DEPENDPATH += $$PWD/../libs/vlayout + +win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vlayout/$${DESTDIR}/vlayout.lib +else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vlayout/$${DESTDIR}/libvlayout.a + # Strip after you link all libaries. CONFIG(release, debug|release){ diff --git a/src/app/container/calculator.cpp b/src/app/container/calculator.cpp index 175ec14a3..0f065a546 100644 --- a/src/app/container/calculator.cpp +++ b/src/app/container/calculator.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -37,7 +37,7 @@ using namespace qmu; //--------------------------------------------------------------------------------------------------------------------- /** - * @brief Calculator class constructor. Make easy initialization math parser. + * @brief Calculator class wraper for QMuParser. Make easy initialization math parser. * * This constructor hide initialization variables, operators, character sets. * Use this constuctor for evaluation formula. All formulas must be converted to internal look. @@ -99,11 +99,17 @@ Calculator::~Calculator() //--------------------------------------------------------------------------------------------------------------------- /** * @brief eval calculate formula. + * + * First we try eval expression without adding variables. If it fail, we take tokens from expression and add variables + * to parser and try again. + * * @param formula string of formula. * @return value of formula. */ qreal Calculator::EvalFormula(const QString &formula) { + // Parser doesn't know any variable on this stage. So, we just use variable factory that for each unknown variable + // set value to 0. SetVarFactory(AddVariable, this); SetSepForEval();//Reset separators options @@ -119,20 +125,29 @@ qreal Calculator::EvalFormula(const QString &formula) if (tokens.isEmpty()) { - return result; + return result; // We have found only numbers in expression. } - // Add variables + // Add variables to parser because we have deal with expression with variables. InitVariables(data, tokens, formula); return Eval(); } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief Calculator::InitVariables add variables to parser. + * + * For optimization purpose we try don't add variables that we don't need. + * + * @param data pointer to a variable container. Hold all informations about variables. + * @param tokens all tokens (measurements names, variables with lengths) that parser have found in expression. + * @param formula expression, need for throwing better error message. + */ void Calculator::InitVariables(const VContainer *data, const QMap &tokens, const QString &formula) { if (qApp->patternType() == MeasurementsType::Standard) { - vVarVal = new qreal[2]; + vVarVal = new qreal[2]; //stabdard measurements table have two additional variables } SCASSERT(data != nullptr) @@ -173,7 +188,7 @@ void Calculator::InitVariables(const VContainer *data, const QMap } if (builInFunctions.contains(i.value())) - {// We found built-in function + {// We have found built-in function found = true; } @@ -186,6 +201,13 @@ void Calculator::InitVariables(const VContainer *data, const QMap } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief Calculator::InitCharacterSets init character set for parser. + * + * QMuParser require setting character set for legal characters. Because we try make our expresion language independent + * we set all posible unique characters from all alphabets. + * + */ void Calculator::InitCharacterSets() { //String with all unique symbols for supported alpabets. @@ -218,13 +240,21 @@ qreal* Calculator::AddVariable(const QString &a_szName, void *a_pUserData) } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief Calculator::SetSepForEval set separators for eval. Each expression eval in internal (C) locale. + */ void Calculator::SetSepForEval() { - SetArgSep(','); + SetArgSep(';'); + SetThousandsSep(','); SetDecSep('.'); } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief Calculator::SetSepForTr set separators for translation expression. + * @param fromUser true if expression come from user (from dialog). + */ void Calculator::SetSepForTr(bool fromUser) { if (fromUser) @@ -233,29 +263,30 @@ void Calculator::SetSepForTr(bool fromUser) if (osSeparatorValue) { - QLocale loc = QLocale::system(); + const QLocale loc = QLocale::system(); SetDecSep(loc.decimalPoint().toLatin1()); SetThousandsSep(loc.groupSeparator().toLatin1()); SetArgSep(';'); - } - else - { - SetArgSep(','); - SetDecSep('.'); + return; } } - else - { - SetArgSep(','); - SetDecSep('.'); - } + SetSepForEval();//Same separators (internal) as for eval. } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief Calculator::RemoveAll remove token from token list. + * + * Standard Qt class QMap doesn't have method RemoveAll. + * Example: remove "-" from tokens list if exist. If don't do that unary minus operation will broken. + * + * @param map map with tokens + * @param val token that need delete + */ void Calculator::RemoveAll(QMap &map, const QString &val) { - QList listKeys = map.keys(val); + const QList listKeys = map.keys(val);//Take all keys that contain token. if (listKeys.size() > 0) { for (int i = 0; i < listKeys.size(); ++i) diff --git a/src/app/container/calculator.h b/src/app/container/calculator.h index c00cb2360..f2491ed43 100644 --- a/src/app/container/calculator.h +++ b/src/app/container/calculator.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -40,10 +40,10 @@ class VContainer; * Note. If created to many parser for different purpes in the same time parser can work wrong. * Example: * DialogEditWrongFormula *dialog = new DialogEditWrongFormula(data); - * dialog->setFormula(formula); + * dialog->SetFormula(formula); * if (dialog->exec() == QDialog::Accepted) * { - * formula = dialog->getFormula(); + * formula = dialog->GetFormula(); * //Need delete dialog here because parser in dialog don't allow use correct separator for parsing here. * //Don't know why. * delete dialog; diff --git a/src/app/container/variables.h b/src/app/container/variables.h index b87530c5b..3c7daf4d3 100644 --- a/src/app/container/variables.h +++ b/src/app/container/variables.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/varclength.cpp b/src/app/container/variables/varclength.cpp index 2015f14c7..b094dc34f 100644 --- a/src/app/container/variables/varclength.cpp +++ b/src/app/container/variables/varclength.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/varclength.h b/src/app/container/variables/varclength.h index f56d7ddf3..a0e1e4ab2 100644 --- a/src/app/container/variables/varclength.h +++ b/src/app/container/variables/varclength.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/vcurvelength.cpp b/src/app/container/variables/vcurvelength.cpp index 9205e7452..43f4ac20d 100644 --- a/src/app/container/variables/vcurvelength.cpp +++ b/src/app/container/variables/vcurvelength.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/vcurvelength.h b/src/app/container/variables/vcurvelength.h index 15d45f672..47e566cc3 100644 --- a/src/app/container/variables/vcurvelength.h +++ b/src/app/container/variables/vcurvelength.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/vcurvelength_p.h b/src/app/container/variables/vcurvelength_p.h index d4759e4a5..4e3b182e0 100644 --- a/src/app/container/variables/vcurvelength_p.h +++ b/src/app/container/variables/vcurvelength_p.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/vincrement.cpp b/src/app/container/variables/vincrement.cpp index df9de9cfe..affaff44c 100644 --- a/src/app/container/variables/vincrement.cpp +++ b/src/app/container/variables/vincrement.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/vincrement.h b/src/app/container/variables/vincrement.h index e82806892..8877c2e2e 100644 --- a/src/app/container/variables/vincrement.h +++ b/src/app/container/variables/vincrement.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/vincrement_p.h b/src/app/container/variables/vincrement_p.h index 57eca4d99..270c779ba 100644 --- a/src/app/container/variables/vincrement_p.h +++ b/src/app/container/variables/vincrement_p.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/vinternalvariable.cpp b/src/app/container/variables/vinternalvariable.cpp index 92c4a06a9..fe7c7a28f 100644 --- a/src/app/container/variables/vinternalvariable.cpp +++ b/src/app/container/variables/vinternalvariable.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/vinternalvariable.h b/src/app/container/variables/vinternalvariable.h index 505d7b771..fc3653a7a 100644 --- a/src/app/container/variables/vinternalvariable.h +++ b/src/app/container/variables/vinternalvariable.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/vinternalvariable_p.h b/src/app/container/variables/vinternalvariable_p.h index eeb97d956..05140d138 100644 --- a/src/app/container/variables/vinternalvariable_p.h +++ b/src/app/container/variables/vinternalvariable_p.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/vlineangle.cpp b/src/app/container/variables/vlineangle.cpp index aceba1c51..9ed8195b1 100644 --- a/src/app/container/variables/vlineangle.cpp +++ b/src/app/container/variables/vlineangle.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/vlineangle.h b/src/app/container/variables/vlineangle.h index df93a48f6..d2ebde429 100644 --- a/src/app/container/variables/vlineangle.h +++ b/src/app/container/variables/vlineangle.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/vlineangle_p.h b/src/app/container/variables/vlineangle_p.h index d8c26ba96..fd3ca754c 100644 --- a/src/app/container/variables/vlineangle_p.h +++ b/src/app/container/variables/vlineangle_p.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/vlinelength.cpp b/src/app/container/variables/vlinelength.cpp index 7146b3f23..4f569af41 100644 --- a/src/app/container/variables/vlinelength.cpp +++ b/src/app/container/variables/vlinelength.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/vlinelength.h b/src/app/container/variables/vlinelength.h index 77311283c..bd52eae57 100644 --- a/src/app/container/variables/vlinelength.h +++ b/src/app/container/variables/vlinelength.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/vlinelength_p.h b/src/app/container/variables/vlinelength_p.h index ac37bd5f4..ac0de76c5 100644 --- a/src/app/container/variables/vlinelength_p.h +++ b/src/app/container/variables/vlinelength_p.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/vmeasurement.cpp b/src/app/container/variables/vmeasurement.cpp index f71921b4e..810d6e291 100644 --- a/src/app/container/variables/vmeasurement.cpp +++ b/src/app/container/variables/vmeasurement.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/vmeasurement.h b/src/app/container/variables/vmeasurement.h index 98ac75f08..e0b645aad 100644 --- a/src/app/container/variables/vmeasurement.h +++ b/src/app/container/variables/vmeasurement.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/vmeasurement_p.h b/src/app/container/variables/vmeasurement_p.h index dec94e809..bbe35215b 100644 --- a/src/app/container/variables/vmeasurement_p.h +++ b/src/app/container/variables/vmeasurement_p.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/vsplinelength.cpp b/src/app/container/variables/vsplinelength.cpp index 2cb194c7e..327e21466 100644 --- a/src/app/container/variables/vsplinelength.cpp +++ b/src/app/container/variables/vsplinelength.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/vsplinelength.h b/src/app/container/variables/vsplinelength.h index 10b6448d2..2f243915d 100644 --- a/src/app/container/variables/vsplinelength.h +++ b/src/app/container/variables/vsplinelength.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/vvariable.cpp b/src/app/container/variables/vvariable.cpp index 83589a89c..a2fe21deb 100644 --- a/src/app/container/variables/vvariable.cpp +++ b/src/app/container/variables/vvariable.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/vvariable.h b/src/app/container/variables/vvariable.h index 0d41d235c..e3472e99e 100644 --- a/src/app/container/variables/vvariable.h +++ b/src/app/container/variables/vvariable.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/variables/vvariable_p.h b/src/app/container/variables/vvariable_p.h index 57dbb3812..5b5b7f960 100644 --- a/src/app/container/variables/vvariable_p.h +++ b/src/app/container/variables/vvariable_p.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/vcontainer.cpp b/src/app/container/vcontainer.cpp index 4f3f755c9..51b4ac044 100644 --- a/src/app/container/vcontainer.cpp +++ b/src/app/container/vcontainer.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/vcontainer.h b/src/app/container/vcontainer.h index cb40925d9..37c043171 100644 --- a/src/app/container/vcontainer.h +++ b/src/app/container/vcontainer.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/container/vformula.cpp b/src/app/container/vformula.cpp index ed3659a20..232a70ac6 100644 --- a/src/app/container/vformula.cpp +++ b/src/app/container/vformula.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -56,7 +56,7 @@ VFormula &VFormula::operator=(const VFormula &formula) { return *this; } - this->formula = formula.getFormula(); + this->formula = formula.GetFormula(); this->value = formula.getStringValue(); this->checkZero = formula.getCheckZero(); this->data = formula.getData(); @@ -69,7 +69,7 @@ VFormula &VFormula::operator=(const VFormula &formula) //--------------------------------------------------------------------------------------------------------------------- VFormula::VFormula(const VFormula &formula) - :formula(formula.getFormula()), value(formula.getStringValue()), checkZero(formula.getCheckZero()), + :formula(formula.GetFormula()), value(formula.getStringValue()), checkZero(formula.getCheckZero()), data(formula.getData()), toolId(formula.getToolId()), postfix(formula.getPostfix()), _error(formula.error()), dValue(formula.getDoubleValue()) {} @@ -78,7 +78,7 @@ VFormula::VFormula(const VFormula &formula) bool VFormula::operator==(const VFormula &formula) const { bool isEqual = false; - if (this->formula == formula.getFormula() && this->value == formula.getStringValue() && + if (this->formula == formula.GetFormula() && this->value == formula.getStringValue() && this->checkZero == formula.getCheckZero() && this->data == formula.getData() && this->toolId == formula.getToolId() && this->postfix == formula.getPostfix() && this->_error == formula.error() && qFuzzyCompare(this->dValue, formula.getDoubleValue())) @@ -94,7 +94,7 @@ bool VFormula::operator!=(const VFormula &formula) const } //--------------------------------------------------------------------------------------------------------------------- -QString VFormula::getFormula(FormulaType type) const +QString VFormula::GetFormula(FormulaType type) const { if (type == FormulaType::ToUser) { @@ -107,17 +107,17 @@ QString VFormula::getFormula(FormulaType type) const } //--------------------------------------------------------------------------------------------------------------------- -void VFormula::setFormula(const QString &value, FormulaType type) +void VFormula::SetFormula(const QString &value, FormulaType type) { if (formula != value) { if (type == FormulaType::ToUser) { - formula = value; + formula = qApp->FormulaToUser(value); } else { - formula = qApp->FormulaToUser(value); + formula = value; } formula.replace("\n", " ");// Replace line return with spaces for calc if exist Eval(); @@ -239,17 +239,8 @@ void VFormula::Eval() } else { - QLocale loc; - if (qApp->getSettings()->GetOsSeparator()) - { - loc = QLocale::system(); - } - else - { - loc = QLocale(QLocale::C); - } dValue = result; - value = QString(loc.toString(result) + " " + postfix); + value = QString(qApp->LocaleToString(result) + " " + postfix); _error = false; } } diff --git a/src/app/container/vformula.h b/src/app/container/vformula.h index 222845442..fa0c42e79 100644 --- a/src/app/container/vformula.h +++ b/src/app/container/vformula.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -46,8 +46,8 @@ public: bool operator==(const VFormula &formula) const; bool operator!=(const VFormula &formula) const; - QString getFormula(FormulaType type = FormulaType::ToUser) const; - void setFormula(const QString &value, FormulaType type = FormulaType::ToUser); + QString GetFormula(FormulaType type = FormulaType::ToUser) const; + void SetFormula(const QString &value, FormulaType type = FormulaType::ToUser); QString getStringValue() const; qreal getDoubleValue() const; diff --git a/src/app/core/undoevent.cpp b/src/app/core/undoevent.cpp index bdbadd91c..7ea362f02 100644 --- a/src/app/core/undoevent.cpp +++ b/src/app/core/undoevent.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/core/undoevent.h b/src/app/core/undoevent.h index e3f1fc75c..e5c230b06 100644 --- a/src/app/core/undoevent.h +++ b/src/app/core/undoevent.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/core/vapplication.cpp b/src/app/core/vapplication.cpp index 1167308ee..72e78bae7 100644 --- a/src/app/core/vapplication.cpp +++ b/src/app/core/vapplication.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -35,7 +35,6 @@ #include "vmaingraphicsview.h" #include "../container/calculator.h" #include "../version.h" -#include "vsettings.h" #include #include @@ -292,22 +291,20 @@ bool VApplication::notify(QObject *receiver, QEvent *event) //--------------------------------------------------------------------------------------------------------------------- double VApplication::toPixel(double val, const Unit &unit) const { - double result = 0; switch (unit) { - case Unit::Mm: - result = (val / 25.4) * PrintDPI; - break; - case Unit::Cm: - result = ((val * 10.0) / 25.4) * PrintDPI; - break; - case Unit::Inch: - result = val * PrintDPI; - break; - default: - break; + case Unit::Mm: + return (val / 25.4) * PrintDPI; + case Unit::Cm: + return ((val * 10.0) / 25.4) * PrintDPI; + case Unit::Inch: + return val * PrintDPI; + case Unit::Px: + return val; + default: + break; } - return result; + return 0; } //--------------------------------------------------------------------------------------------------------------------- @@ -319,22 +316,20 @@ double VApplication::toPixel(double val) const //--------------------------------------------------------------------------------------------------------------------- double VApplication::fromPixel(double pix, const Unit &unit) const { - double result = 0; switch (unit) { - case Unit::Mm: - result = (pix / PrintDPI) * 25.4; - break; - case Unit::Cm: - result = ((pix / PrintDPI) * 25.4) / 10.0; - break; - case Unit::Inch: - result = pix / PrintDPI; - break; - default: - break; + case Unit::Mm: + return (pix / PrintDPI) * 25.4; + case Unit::Cm: + return ((pix / PrintDPI) * 25.4) / 10.0; + case Unit::Inch: + return pix / PrintDPI; + case Unit::Px: + return pix; + default: + break; } - return result; + return 0; } //--------------------------------------------------------------------------------------------------------------------- @@ -344,32 +339,39 @@ double VApplication::fromPixel(double pix) const } //--------------------------------------------------------------------------------------------------------------------- -QString VApplication::pathToTables() const +bool VApplication::TryLock(QLockFile *lock) { - if (_patternType == MeasurementsType::Individual) + if (lock == nullptr) { - return QStringLiteral("://tables/individual/individual.vit"); + return false; + } + + if (lock->tryLock()) + { + return true; } else { - const QString stPath = QStringLiteral("/tables/standard"); - #ifdef Q_OS_WIN - return QApplication::applicationDirPath() + stPath; - #else - #ifdef QT_DEBUG - return QApplication::applicationDirPath() + stPath; - #else - QDir dir(QApplication::applicationDirPath() + stPath); - if (dir.exists()) - { - return dir.absolutePath(); - } - else - { - return QStringLiteral("/usr/share/valentina/tables/standard"); - } - #endif - #endif + if (lock->error() == QLockFile::LockFailedError) + { + // This happens if a stale lock file exists and another process uses that PID. + // Try removing the stale file, which will fail if a real process is holding a + // file-level lock. A false error is more problematic than not locking properly + // on corner-case systems. + if (lock->removeStaleLockFile() == false || lock->tryLock() == false) + { + return false; + } + else + { + return true; + } + } + else + { + return false; + } + return false; } } @@ -465,7 +467,7 @@ void VApplication::BeginLogging() qInstallMessageHandler(noisyFailureMsgHandler); logLock = new QLockFile(LogPath()+".lock"); logLock->setStaleLockTime(0); - if (logLock->tryLock()) + if (TryLock(logLock)) { qCDebug(vApp) << "Log file"<tryLock()) + if (TryLock(lock)) { qCDebug(vApp) << "Locked file"<::const_iterator i = measurements.constBegin(); @@ -1519,6 +1529,14 @@ bool VApplication::MeasurementsFromUser(QString &newFormula, int position, const } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief VApplication::VariablesFromUser translate variable to internal look. + * @param newFormula [in|out] expression to translate + * @param position token position + * @param token token to translate + * @param bias hold change of length between translated and origin token string + * @return true if was found variable with same name. + */ bool VApplication::VariablesFromUser(QString &newFormula, int position, const QString &token, int &bias) const { QMap::const_iterator i = variables.constBegin(); @@ -1538,6 +1556,14 @@ bool VApplication::VariablesFromUser(QString &newFormula, int position, const QS } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief VApplication::PostfixOperatorsFromUser translate postfix operator to internal look. + * @param newFormula [in|out] expression to translate + * @param position token position + * @param token token to translate + * @param bias hold change of length between translated and origin token string + * @return true if was found postfix operator with same name. + */ bool VApplication::PostfixOperatorsFromUser(QString &newFormula, int position, const QString &token, int &bias) const { QMap::const_iterator i = postfixOperators.constBegin(); @@ -1555,6 +1581,14 @@ bool VApplication::PostfixOperatorsFromUser(QString &newFormula, int position, c } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief VApplication::FunctionsFromUser translate function name to internal look. + * @param newFormula [in|out] expression to translate + * @param position token position + * @param token token to translate + * @param bias hold change of length between translated and origin token string + * @return true if was found function with same name. + */ bool VApplication::FunctionsFromUser(QString &newFormula, int position, const QString &token, int &bias) const { QMap::const_iterator i = functions.constBegin(); @@ -1572,6 +1606,14 @@ bool VApplication::FunctionsFromUser(QString &newFormula, int position, const QS } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief VApplication::VariablesToUser translate variable name to user. + * @param newFormula [in|out] expression to translate + * @param position token position + * @param token token to translate + * @param bias hold change of length between translated and origin token string + * @return true if was found variable with same name. + */ bool VApplication::VariablesToUser(QString &newFormula, int position, const QString &token, int &bias) const { QMap::const_iterator i = variables.constBegin(); @@ -1591,18 +1633,37 @@ bool VApplication::VariablesToUser(QString &newFormula, int position, const QStr return false; } +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief VApplication::CorrectionsPositions correct position tokens in expression after token translation. + * + * Because translated string can have different length compare to original need make correction after each translation. + * If bias = 0 correction will not happens. + * + * @param position position currecnt token in expression + * @param bias difference between original token length and translated + * @param tokens all tokens + * @param numbers all numbers + */ void VApplication::CorrectionsPositions(int position, int bias, QMap &tokens, QMap &numbers) { if (bias == 0) { - return; + return;// Nothing to correct; } BiasTokens(position, bias, tokens); BiasTokens(position, bias, numbers); } +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief VApplication::BiasTokens change position for each token that have position more then "position". + * @param position token position + * @param bias difference between original token length and translated + * @param tokens all tokens + */ void VApplication::BiasTokens(int position, int bias, QMap &tokens) const { QMap newTokens; @@ -1610,7 +1671,7 @@ void VApplication::BiasTokens(int position, int bias, QMap &tokens while (i != tokens.constEnd()) { if (i.key()<= position) - { + { // Tokens before position "position" did not change his positions. newTokens.insert(i.key(), i.value()); } else @@ -1702,16 +1763,22 @@ QString VApplication::PostfixOperator(const QString &name) const } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief VApplication::FormulaFromUser replace all known tokens in formula to internal look. Also change decimal + * separator in numbers. + * @param formula expression that need translate + * @return translated expression + */ QString VApplication::FormulaFromUser(const QString &formula) { - QString newFormula = formula; + QString newFormula = formula;// Local copy for making changes - Calculator *cal = new Calculator(formula); - QMap tokens = cal->GetTokens(); - QMap numbers = cal->GetNumbers(); + Calculator *cal = new Calculator(formula);// Eval formula + QMap tokens = cal->GetTokens();// Tokens (variables, measurements) + QMap numbers = cal->GetNumbers();// All numbers in expression for changing decimal separator delete cal; - QList tKeys = tokens.keys(); + QList tKeys = tokens.keys();// Take all tokens positions QList tValues = tokens.values(); for (int i = 0; i < tKeys.size(); ++i) { @@ -1719,7 +1786,7 @@ QString VApplication::FormulaFromUser(const QString &formula) if (MeasurementsFromUser(newFormula, tKeys.at(i), tValues.at(i), bias)) { if (bias != 0) - { + {// Translated token has different length than original. Position next tokens need to be corrected. CorrectionsPositions(tKeys.at(i), bias, tokens, numbers); tKeys = tokens.keys(); tValues = tokens.values(); @@ -1730,7 +1797,7 @@ QString VApplication::FormulaFromUser(const QString &formula) if (VariablesFromUser(newFormula, tKeys.at(i), tValues.at(i), bias)) { if (bias != 0) - { + {// Translated token has different length than original. Position next tokens need to be corrected. CorrectionsPositions(tKeys.at(i), bias, tokens, numbers); tKeys = tokens.keys(); tValues = tokens.values(); @@ -1741,7 +1808,7 @@ QString VApplication::FormulaFromUser(const QString &formula) if (PostfixOperatorsFromUser(newFormula, tKeys.at(i), tValues.at(i), bias)) { if (bias != 0) - { + {// Translated token has different length than original. Position next tokens need to be corrected. CorrectionsPositions(tKeys.at(i), bias, tokens, numbers); tKeys = tokens.keys(); tValues = tokens.values(); @@ -1752,7 +1819,7 @@ QString VApplication::FormulaFromUser(const QString &formula) if (FunctionsFromUser(newFormula, tKeys.at(i), tValues.at(i), bias)) { if (bias != 0) - { + {// Translated token has different length than original. Position next tokens need to be corrected. CorrectionsPositions(tKeys.at(i), bias, tokens, numbers); tKeys = tokens.keys(); tValues = tokens.values(); @@ -1761,34 +1828,32 @@ QString VApplication::FormulaFromUser(const QString &formula) } } - QLocale loc = QLocale::system(); + QLocale loc = QLocale::system(); // User locale if (loc != QLocale(QLocale::C) && getSettings()->GetOsSeparator()) - { - QList nKeys = numbers.keys(); + {// User want use Os separator + QList nKeys = numbers.keys();// Positions for all numbers in expression QList nValues = numbers.values(); for (int i = 0; i < nKeys.size(); ++i) { + loc = QLocale::system();// From system locale bool ok = false; - qreal d = loc.toDouble(nValues.at(i), &ok); + const qreal d = loc.toDouble(nValues.at(i), &ok); if (ok == false) { qDebug()<<"Can't convert to double token"< tokens; QMap numbers; try { - Calculator *cal = new Calculator(formula, false); - tokens = cal->GetTokens(); - numbers = cal->GetNumbers(); + Calculator *cal = new Calculator(formula, false);// Eval formula + tokens = cal->GetTokens();// Tokens (variables, measurements) + numbers = cal->GetNumbers();// All numbers in expression for changing decimal separator delete cal; } catch (qmu::QmuParserError &e) @@ -1828,7 +1899,7 @@ QString VApplication::FormulaToUser(const QString &formula) newFormula.replace(tKeys.at(i), tValues.at(i).length(), measurements.value(tValues.at(i)).translate()); int bias = tValues.at(i).length() - measurements.value(tValues.at(i)).translate().length(); if (bias != 0) - { + {// Translated token has different length than original. Position next tokens need to be corrected. CorrectionsPositions(tKeys.at(i), bias, tokens, numbers); tKeys = tokens.keys(); tValues = tokens.values(); @@ -1841,7 +1912,7 @@ QString VApplication::FormulaToUser(const QString &formula) newFormula.replace(tKeys.at(i), tValues.at(i).length(), functions.value(tValues.at(i)).translate()); int bias = tValues.at(i).length() - functions.value(tValues.at(i)).translate().length(); if (bias != 0) - { + {// Translated token has different length than original. Position next tokens need to be corrected. CorrectionsPositions(tKeys.at(i), bias, tokens, numbers); tKeys = tokens.keys(); tValues = tokens.values(); @@ -1854,7 +1925,7 @@ QString VApplication::FormulaToUser(const QString &formula) newFormula.replace(tKeys.at(i), tValues.at(i).length(), postfixOperators.value(tValues.at(i)).translate()); int bias = tValues.at(i).length() - postfixOperators.value(tValues.at(i)).translate().length(); if (bias != 0) - { + {// Translated token has different length than original. Position next tokens need to be corrected. CorrectionsPositions(tKeys.at(i), bias, tokens, numbers); tKeys = tokens.keys(); tValues = tokens.values(); @@ -1866,7 +1937,7 @@ QString VApplication::FormulaToUser(const QString &formula) if (VariablesToUser(newFormula, tKeys.at(i), tValues.at(i), bias)) { if (bias != 0) - { + {// Translated token has different length than original. Position next tokens need to be corrected. CorrectionsPositions(tKeys.at(i), bias, tokens, numbers); tKeys = tokens.keys(); tValues = tokens.values(); @@ -1875,34 +1946,31 @@ QString VApplication::FormulaToUser(const QString &formula) } } - QLocale loc = QLocale::system(); + QLocale loc = QLocale::system();// User locale if (loc != QLocale::C && getSettings()->GetOsSeparator()) - { - QList nKeys = numbers.keys(); + {// User want use Os separator + QList nKeys = numbers.keys();// Positions for all numbers in expression QList nValues = numbers.values(); for (int i = 0; i < nKeys.size(); ++i) { - QLocale loc = QLocale(QLocale::C); + loc = QLocale(QLocale::C);// From pattern locale bool ok = false; - qreal d = loc.toDouble(nValues.at(i), &ok); + const qreal d = loc.toDouble(nValues.at(i), &ok); if (ok == false) { qDebug()<<"Can't convert to double token"<setStaleLockTime(0); - if (logLock->tryLock()) + if (TryLock(logLock)) { *out <<"--------------------------" << endl; QFile logFile(info.absoluteFilePath()); @@ -2248,8 +2316,10 @@ void VApplication::SendReport(const QString &reportName) const // Additional information content.append(QString("-------------------------------")+"\r\n"); content.append(QString("Version:%1").arg(APP_VERSION)+"\r\n"); + content.append(QString("Build revision:%1").arg(BUILD_REVISION)+"\r\n"); content.append(QString("Based on Qt %2 (32 bit)").arg(QT_VERSION_STR)+"\r\n"); content.append(QString("Built on %3 at %4").arg(__DATE__).arg(__TIME__)+"\r\n"); + content.append(QString("Web site:http://www.valentina-project.org/ ")+"\r\n"); content.append("\r\n"); // Creating json with report @@ -2317,13 +2387,17 @@ void VApplication::SendReport(const QString &reportName) const gistFile.write(saveRep.toJson()); gistFile.close(); - QFile curlFile("curl.exe"); + const QString curl = QString("%1/curl.exe").arg(qApp->applicationDirPath()); + QFile curlFile(curl); if (curlFile.exists()) {// Trying send report - // Change token 28df778e0ef75e3724f7b9622fb70b9c69187779 if need - QString arg = QString("curl.exe -k -H \"Authorization: bearer 28df778e0ef75e3724f7b9622fb70b9c69187779\" " - "-H \"Accept: application/json\" -H \"Content-type: application/json\" -X POST " - "--data @gist.json https://api.github.com/gists"); + // Change token if need + const QStringList token = QStringList()<<"3c"<<"6e"<<"91"<<"19"<<"96"<<"92"<<"dc"<<"50"<<"67"<<"8a"<<"2a"<<"89" + <<"a3"<<"55"<<"9e"<<"c7"<<"9d"<<"f8"<<"66"<<"a5"; + + const QString arg = QString("curl.exe -k -H \"Authorization: bearer ")+token.join("")+ + QString("\" -H \"Accept: application/json\" -H \"Content-type: application/json\" -X POST " + "--data @gist.json https://api.github.com/gists"); QProcess::startDetached(arg); reportFile.remove();// Clear after yourself } @@ -2331,6 +2405,7 @@ void VApplication::SendReport(const QString &reportName) const {// We can not send than just collect CollectReport(reportName); } + curlFile.close(); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/core/vapplication.h b/src/app/core/vapplication.h index 7122d424d..6d18aeb71 100644 --- a/src/app/core/vapplication.h +++ b/src/app/core/vapplication.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -33,6 +33,7 @@ #include "../options.h" #include "../widgets/vmaingraphicsview.h" #include "../../libs/qmuparser/qmutranslation.h" +#include "vsettings.h" class VApplication;// used in define class QUndoStack; @@ -40,7 +41,6 @@ class VMainGraphicsView; class VMainGraphicsScene; class VPattern; class QFile; -class VSettings; class QLockFile; #if defined(qApp) @@ -70,9 +70,10 @@ public: double fromPixel(double pix, const Unit &unit) const; double fromPixel(double pix) const; + static bool TryLock(QLockFile *lock); + static const qreal PrintDPI; QString translationsPath() const; - QString pathToTables() const; qreal widthMainLine() const; qreal widthHairLine() const; QString VarToUser(const QString &var) const; @@ -80,8 +81,18 @@ public: QString GuiText(const QString &measurement) const; QString Description(const QString &measurement) const; QString PostfixOperator(const QString &name) const; + QString FormulaFromUser(const QString &formula); QString FormulaToUser(const QString &formula); + + template + QString LocaleToString(const T &value) + { + QLocale loc; + qApp->getSettings()->GetOsSeparator() ? loc = QLocale::system() : loc = QLocale(QLocale::C); + return loc.toString(value); + } + QUndoStack *getUndoStack() const; VMainGraphicsView *getSceneView() const; void setSceneView(VMainGraphicsView *value); diff --git a/src/app/core/vsettings.cpp b/src/app/core/vsettings.cpp index 7f507a9e9..2f6fba5cb 100644 --- a/src/app/core/vsettings.cpp +++ b/src/app/core/vsettings.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -31,37 +31,41 @@ #include #include #include +#include -const QString VSettings::SettingConfigurationOsSeparator = QStringLiteral("configuration/osSeparator"); -const QString VSettings::SettingConfigurationAutosaveState = QStringLiteral("configuration/autosave/state"); -const QString VSettings::SettingConfigurationAutosaveTime = QStringLiteral("configuration/autosave/time"); -const QString VSettings::SettingConfigurationSendReportState = QStringLiteral("configuration/send_report/state"); -const QString VSettings::SettingConfigurationLocale = QStringLiteral("configuration/locale"); -const QString VSettings::SettingConfigurationUnit = QStringLiteral("configuration/unit"); -const QString VSettings::SettingConfigurationLabelLanguage = QStringLiteral("configuration/label_language"); +const QString VSettings::SettingConfigurationOsSeparator = QStringLiteral("configuration/osSeparator"); +const QString VSettings::SettingConfigurationAutosaveState = QStringLiteral("configuration/autosave/state"); +const QString VSettings::SettingConfigurationAutosaveTime = QStringLiteral("configuration/autosave/time"); +const QString VSettings::SettingConfigurationSendReportState = QStringLiteral("configuration/send_report/state"); +const QString VSettings::SettingConfigurationLocale = QStringLiteral("configuration/locale"); +const QString VSettings::SettingConfigurationUnit = QStringLiteral("configuration/unit"); +const QString VSettings::SettingConfigurationLabelLanguage = QStringLiteral("configuration/label_language"); +const QString VSettings::SettingConfigurationConfirmItemDeletion = QStringLiteral("configuration/confirm_item_deletion"); -const QString VSettings::SettingPathsIndividualMeasurements = QStringLiteral("paths/individual_measurements"); -const QString VSettings::SettingPathsPattern = QStringLiteral("paths/pattern"); +const QString VSettings::SettingPathsIndividualMeasurements = QStringLiteral("paths/individual_measurements"); +const QString VSettings::SettingPathsStandardMeasurements = QStringLiteral("paths/standard_measurements"); +const QString VSettings::SettingPathsPattern = QStringLiteral("paths/pattern"); +const QString VSettings::SettingPathsLayout = QStringLiteral("paths/layout"); -const QString VSettings::SettingPatternUser = QStringLiteral("pattern/user"); -const QString VSettings::SettingPatternGraphicalOutput = QStringLiteral("pattern/graphicalOutput"); -const QString VSettings::SettingPatternUndo = QStringLiteral("pattern/undo"); +const QString VSettings::SettingPatternUser = QStringLiteral("pattern/user"); +const QString VSettings::SettingPatternGraphicalOutput = QStringLiteral("pattern/graphicalOutput"); +const QString VSettings::SettingPatternUndo = QStringLiteral("pattern/undo"); -const QString VSettings::SettingGeneralRecentFileList = QStringLiteral("recentFileList"); -const QString VSettings::SettingGeneralRestoreFileList = QStringLiteral("restoreFileList"); -const QString VSettings::SettingGeneralGeometry = QStringLiteral("geometry"); -const QString VSettings::SettingGeneralWindowState = QStringLiteral("windowState"); +const QString VSettings::SettingGeneralRecentFileList = QStringLiteral("recentFileList"); +const QString VSettings::SettingGeneralRestoreFileList = QStringLiteral("restoreFileList"); +const QString VSettings::SettingGeneralGeometry = QStringLiteral("geometry"); +const QString VSettings::SettingGeneralWindowState = QStringLiteral("windowState"); -const QString VSettings::SettingCommunityServer = QStringLiteral("community/server"); -const QString VSettings::SettingCommunityServerSecure = QStringLiteral("community/serverSecure"); -const QString VSettings::SettingCommunityUseProxy = QStringLiteral("community/useProxy"); -const QString VSettings::SettingCommunityProxyAddress = QStringLiteral("community/proxyAddress"); -const QString VSettings::SettingCommunityProxyPort = QStringLiteral("community/proxyPort"); -const QString VSettings::SettingCommunityProxyUser = QStringLiteral("community/proxyUser"); -const QString VSettings::SettingCommunityProxyPass = QStringLiteral("community/proxyPass"); -const QString VSettings::SettingCommunityUsername = QStringLiteral("community/username"); -const QString VSettings::SettingCommunitySavePassword = QStringLiteral("community/savePassword"); -const QString VSettings::SettingCommunityUserPassword = QStringLiteral("community/userpassword"); +const QString VSettings::SettingCommunityServer = QStringLiteral("community/server"); +const QString VSettings::SettingCommunityServerSecure = QStringLiteral("community/serverSecure"); +const QString VSettings::SettingCommunityUseProxy = QStringLiteral("community/useProxy"); +const QString VSettings::SettingCommunityProxyAddress = QStringLiteral("community/proxyAddress"); +const QString VSettings::SettingCommunityProxyPort = QStringLiteral("community/proxyPort"); +const QString VSettings::SettingCommunityProxyUser = QStringLiteral("community/proxyUser"); +const QString VSettings::SettingCommunityProxyPass = QStringLiteral("community/proxyPass"); +const QString VSettings::SettingCommunityUsername = QStringLiteral("community/username"); +const QString VSettings::SettingCommunitySavePassword = QStringLiteral("community/savePassword"); +const QString VSettings::SettingCommunityUserPassword = QStringLiteral("community/userpassword"); //--------------------------------------------------------------------------------------------------------------------- VSettings::VSettings(Format format, Scope scope, const QString &organization, const QString &application, @@ -161,6 +165,18 @@ void VSettings::SetLabelLanguage(const QString &value) setValue(SettingConfigurationLabelLanguage, value); } +//--------------------------------------------------------------------------------------------------------------------- +bool VSettings::GetConfirmItemDelete() const +{ + return value(SettingConfigurationConfirmItemDeletion, 1).toBool(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VSettings::SetConfirmItemDelete(const bool &value) +{ + setValue(SettingConfigurationConfirmItemDeletion, value); +} + //--------------------------------------------------------------------------------------------------------------------- QString VSettings::GetPathIndividualMeasurements() const { @@ -173,6 +189,18 @@ void VSettings::SetPathIndividualMeasurements(const QString &value) setValue(SettingPathsIndividualMeasurements, value); } +//--------------------------------------------------------------------------------------------------------------------- +QString VSettings::GetPathStandardMeasurements() const +{ + return value(SettingPathsStandardMeasurements, StandardTablesPath()).toString(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VSettings::SetPathStandardMeasurements(const QString &value) +{ + setValue(SettingPathsStandardMeasurements, value); +} + //--------------------------------------------------------------------------------------------------------------------- QString VSettings::GetPathPattern() const { @@ -185,6 +213,18 @@ void VSettings::SetPathPattern(const QString &value) setValue(SettingPathsPattern, value); } +//--------------------------------------------------------------------------------------------------------------------- +QString VSettings::GetPathLayout() const +{ + return value(SettingPathsLayout, QDir::homePath()).toString(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VSettings::SetPathLayout(const QString &value) +{ + setValue(SettingPathsLayout, value); +} + //--------------------------------------------------------------------------------------------------------------------- QString VSettings::GetUser() const { @@ -402,3 +442,44 @@ void VSettings::SetUserPassword(const QString &value) { setValue(SettingCommunityUserPassword, value); } + +//--------------------------------------------------------------------------------------------------------------------- +QString VSettings::StandardTablesPath() +{ + const QString stPath = QStringLiteral("/tables/standard"); +#ifdef Q_OS_WIN + return QApplication::applicationDirPath() + stPath; +#elif defined(Q_OS_MAC) + QDir dirBundle(QApplication::applicationDirPath() + QStringLiteral("/../Resources") + stPath); + if (dirBundle.exists()) + { + return dirBundle.absolutePath(); + } + else + { + QDir dir(QApplication::applicationDirPath() + stPath); + if (dir.exists()) + { + return dir.absolutePath(); + } + else + { + return QStringLiteral("/usr/share/valentina/tables/standard"); + } + } +#else // Unix + #ifdef QT_DEBUG + return QApplication::applicationDirPath() + stPath; + #else + QDir dir(QApplication::applicationDirPath() + stPath); + if (dir.exists()) + { + return dir.absolutePath(); + } + else + { + return QStringLiteral("/usr/share/valentina/tables/standard"); + } + #endif +#endif +} diff --git a/src/app/core/vsettings.h b/src/app/core/vsettings.h index 7a21b56c6..23329014c 100644 --- a/src/app/core/vsettings.h +++ b/src/app/core/vsettings.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -38,6 +38,8 @@ public: VSettings(Format format, Scope scope, const QString &organization, const QString &application = QString(), QObject *parent = 0); + static QString StandardTablesPath(); + bool GetOsSeparator() const; void SetOsSeparator(const bool &value); @@ -59,12 +61,21 @@ public: QString GetLabelLanguage() const; void SetLabelLanguage(const QString &value); + bool GetConfirmItemDelete() const; + void SetConfirmItemDelete(const bool &value); + QString GetPathIndividualMeasurements() const; void SetPathIndividualMeasurements(const QString &value); + QString GetPathStandardMeasurements() const; + void SetPathStandardMeasurements(const QString &value); + QString GetPathPattern() const; void SetPathPattern(const QString &value); + QString GetPathLayout() const; + void SetPathLayout(const QString &value); + QString GetUser() const; void SetUser(const QString &value); @@ -125,9 +136,12 @@ private: static const QString SettingConfigurationLocale; static const QString SettingConfigurationUnit; static const QString SettingConfigurationLabelLanguage; + static const QString SettingConfigurationConfirmItemDeletion; static const QString SettingPathsIndividualMeasurements; + static const QString SettingPathsStandardMeasurements; static const QString SettingPathsPattern; + static const QString SettingPathsLayout; static const QString SettingPatternUser; static const QString SettingPatternGraphicalOutput; diff --git a/src/app/dialogs/app/configdialog.cpp b/src/app/dialogs/app/configdialog.cpp index 52bc5d5f0..e6642114f 100644 --- a/src/app/dialogs/app/configdialog.cpp +++ b/src/app/dialogs/app/configdialog.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -33,6 +33,7 @@ #include #include #include +#include "../core/vapplication.h" //--------------------------------------------------------------------------------------------------------------------- ConfigDialog::ConfigDialog(QWidget *parent) : @@ -93,6 +94,7 @@ ConfigDialog::ConfigDialog(QWidget *parent) : this->setFixedSize(QSize(750, 550)); this->setWindowFlags(Qt::Tool | Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::CustomizeWindowHint); + qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); } //--------------------------------------------------------------------------------------------------------------------- @@ -156,6 +158,8 @@ void ConfigDialog::Apply() default: break; } + qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); + emit UpdateProperties(); setResult(QDialog::Accepted); } diff --git a/src/app/dialogs/app/configdialog.h b/src/app/dialogs/app/configdialog.h index 8045a33d2..3eac9336f 100644 --- a/src/app/dialogs/app/configdialog.h +++ b/src/app/dialogs/app/configdialog.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -43,6 +43,8 @@ public: explicit ConfigDialog(QWidget *parent = nullptr); public slots: void changePage(QListWidgetItem *current, QListWidgetItem *previous); +signals: + void UpdateProperties(); protected: virtual void closeEvent(QCloseEvent *event); private: diff --git a/src/app/dialogs/app/configpages/communitypage.cpp b/src/app/dialogs/app/configpages/communitypage.cpp index e770424c0..ac27f05e5 100644 --- a/src/app/dialogs/app/configpages/communitypage.cpp +++ b/src/app/dialogs/app/configpages/communitypage.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/app/configpages/communitypage.h b/src/app/dialogs/app/configpages/communitypage.h index 6af2a1560..532b0e520 100644 --- a/src/app/dialogs/app/configpages/communitypage.h +++ b/src/app/dialogs/app/configpages/communitypage.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/app/configpages/configurationpage.cpp b/src/app/dialogs/app/configpages/configurationpage.cpp index 06e39023a..f566a4c7b 100644 --- a/src/app/dialogs/app/configpages/configurationpage.cpp +++ b/src/app/dialogs/app/configpages/configurationpage.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -51,11 +51,13 @@ ConfigurationPage::ConfigurationPage(QWidget *parent) QGroupBox *saveGroup = SaveGroup(); QGroupBox *langGroup = LangGroup(); QGroupBox *sendGroup = SendGroup(); + QGroupBox *drawGroup = DrawGroup(); QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout->addWidget(saveGroup); mainLayout->addWidget(langGroup); mainLayout->addWidget(sendGroup); + mainLayout->addWidget(drawGroup); mainLayout->addStretch(1); setLayout(mainLayout); } @@ -73,6 +75,7 @@ void ConfigurationPage::Apply() qApp->getSettings()->SetOsSeparator(osOptionCheck->isChecked()); qApp->getSettings()->SetSendReportState(sendReportCheck->isChecked()); + qApp->getSettings()->SetConfirmItemDelete(askPointDeletionCheck->isChecked()); if (langChanged) { @@ -271,6 +274,21 @@ QGroupBox *ConfigurationPage::SendGroup() return sendGroup; } +//--------------------------------------------------------------------------------------------------------------------- +QGroupBox *ConfigurationPage::DrawGroup() +{ + QGroupBox *drawGroup = new QGroupBox(tr("Pattern Editing")); + + askPointDeletionCheck = new QCheckBox(tr("Confirm item deletion")); + askPointDeletionCheck->setChecked(qApp->getSettings()->GetConfirmItemDelete()); + + QVBoxLayout *editLayout = new QVBoxLayout; + editLayout->addWidget(askPointDeletionCheck); + + drawGroup->setLayout(editLayout); + return drawGroup; +} + //--------------------------------------------------------------------------------------------------------------------- void ConfigurationPage::SetLabelComboBox(const QStringList &list) { diff --git a/src/app/dialogs/app/configpages/configurationpage.h b/src/app/dialogs/app/configpages/configurationpage.h index 3b83e2996..d4ebdcf3b 100644 --- a/src/app/dialogs/app/configpages/configurationpage.h +++ b/src/app/dialogs/app/configpages/configurationpage.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -59,10 +59,12 @@ private: bool unitChanged; bool labelLangChanged; QCheckBox *sendReportCheck; + QCheckBox *askPointDeletionCheck; QGroupBox *SaveGroup(); QGroupBox *LangGroup(); QGroupBox *SendGroup(); + QGroupBox *DrawGroup(); void SetLabelComboBox(const QStringList &list); }; diff --git a/src/app/dialogs/app/configpages/pages.h b/src/app/dialogs/app/configpages/pages.h index 271a48c3f..7df2cfb5b 100644 --- a/src/app/dialogs/app/configpages/pages.h +++ b/src/app/dialogs/app/configpages/pages.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/app/configpages/pathpage.cpp b/src/app/dialogs/app/configpages/pathpage.cpp index bf2a8e686..1421480f6 100644 --- a/src/app/dialogs/app/configpages/pathpage.cpp +++ b/src/app/dialogs/app/configpages/pathpage.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -63,7 +63,9 @@ PathPage::PathPage(QWidget *parent) void PathPage::Apply() { qApp->getSettings()->SetPathIndividualMeasurements(pathTable->item(0, 1)->text()); - qApp->getSettings()->SetPathPattern(pathTable->item(1, 1)->text()); + qApp->getSettings()->SetPathStandardMeasurements(pathTable->item(1, 1)->text()); + qApp->getSettings()->SetPathPattern(pathTable->item(2, 1)->text()); + qApp->getSettings()->SetPathLayout(pathTable->item(3, 1)->text()); } //--------------------------------------------------------------------------------------------------------------------- @@ -79,24 +81,62 @@ void PathPage::TableActivated() //--------------------------------------------------------------------------------------------------------------------- void PathPage::DefaultPath() { - QTableWidgetItem *item = pathTable->item(pathTable->currentRow(), 1); + const int row = pathTable->currentRow(); + QTableWidgetItem *item = pathTable->item(row, 1); SCASSERT(item != nullptr); - item->setText(QDir::homePath()); + + switch(row) + { + case 1: // standard measurements + item->setText(VSettings::StandardTablesPath()); + item->setToolTip(VSettings::StandardTablesPath()); + break; + case 0: // individual measurements + case 2: // pattern path + case 3: // layout path + item->setText(QDir::homePath()); + item->setToolTip(QDir::homePath()); + break; + default: + break; + } } //--------------------------------------------------------------------------------------------------------------------- void PathPage::EditPath() { - QTableWidgetItem *item = pathTable->item(pathTable->currentRow(), 1); + const int row = pathTable->currentRow(); + QTableWidgetItem *item = pathTable->item(row, 1); SCASSERT(item != nullptr); - QString dir = QFileDialog::getExistingDirectory(this, tr("Open Directory"), QDir::homePath(), + + QString path; + switch(row) + { + case 0: // individual measurements + path = qApp->getSettings()->GetPathIndividualMeasurements(); + break; + case 1: // standard measurements + path = qApp->getSettings()->GetPathStandardMeasurements(); + break; + case 2: // pattern path + path = qApp->getSettings()->GetPathPattern(); + break; + case 3: // layout path + path = qApp->getSettings()->GetPathLayout(); + break; + default: + break; + } + QString dir = QFileDialog::getExistingDirectory(this, tr("Open Directory"), path, QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); if (dir.isEmpty()) { - dir = QDir::homePath(); + DefaultPath(); + return; } item->setText(dir); + item->setToolTip(dir); } //--------------------------------------------------------------------------------------------------------------------- @@ -125,10 +165,11 @@ QGroupBox *PathPage::PathGroup() return pathGroup; } +//--------------------------------------------------------------------------------------------------------------------- void PathPage::InitTable() { pathTable = new QTableWidget(); - pathTable->setRowCount(2); + pathTable->setRowCount(4); pathTable->setColumnCount(2); pathTable->verticalHeader()->setVisible(false); pathTable->setEditTriggers(QAbstractItemView::NoEditTriggers); @@ -139,11 +180,33 @@ void PathPage::InitTable() QStringList tableHeader = QStringList() << tr("Type") << tr("Path"); pathTable->setHorizontalHeaderLabels(tableHeader); - pathTable->setItem(0, 0, new QTableWidgetItem(tr("Individual measurements"))); - pathTable->setItem(0, 1, new QTableWidgetItem(qApp->getSettings()->GetPathIndividualMeasurements())); + { + pathTable->setItem(0, 0, new QTableWidgetItem(tr("Individual measurements"))); + QTableWidgetItem *item = new QTableWidgetItem(qApp->getSettings()->GetPathIndividualMeasurements()); + item->setToolTip(qApp->getSettings()->GetPathIndividualMeasurements()); + pathTable->setItem(0, 1, item); + } - pathTable->setItem(1, 0, new QTableWidgetItem(tr("Patterns"))); - pathTable->setItem(1, 1, new QTableWidgetItem(qApp->getSettings()->GetPathPattern())); + { + pathTable->setItem(1, 0, new QTableWidgetItem(tr("Standard measurements"))); + QTableWidgetItem *item = new QTableWidgetItem(qApp->getSettings()->GetPathStandardMeasurements()); + item->setToolTip(qApp->getSettings()->GetPathStandardMeasurements()); + pathTable->setItem(1, 1, item); + } + + { + pathTable->setItem(2, 0, new QTableWidgetItem(tr("Patterns"))); + QTableWidgetItem *item = new QTableWidgetItem(qApp->getSettings()->GetPathPattern()); + item->setToolTip(qApp->getSettings()->GetPathPattern()); + pathTable->setItem(2, 1, item); + } + + { + pathTable->setItem(3, 0, new QTableWidgetItem(tr("Layout"))); + QTableWidgetItem *item = new QTableWidgetItem(qApp->getSettings()->GetPathLayout()); + item->setToolTip(qApp->getSettings()->GetPathLayout()); + pathTable->setItem(3, 1, item); + } pathTable->verticalHeader()->setDefaultSectionSize(20); pathTable->resizeColumnsToContents(); diff --git a/src/app/dialogs/app/configpages/pathpage.h b/src/app/dialogs/app/configpages/pathpage.h index f51b83da0..f81c14b36 100644 --- a/src/app/dialogs/app/configpages/pathpage.h +++ b/src/app/dialogs/app/configpages/pathpage.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/app/configpages/patternpage.cpp b/src/app/dialogs/app/configpages/patternpage.cpp index 5b0669e1d..e911bcd28 100644 --- a/src/app/dialogs/app/configpages/patternpage.cpp +++ b/src/app/dialogs/app/configpages/patternpage.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/app/configpages/patternpage.h b/src/app/dialogs/app/configpages/patternpage.h index 5040c7924..2a7743b09 100644 --- a/src/app/dialogs/app/configpages/patternpage.h +++ b/src/app/dialogs/app/configpages/patternpage.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/app/dialogaboutapp.cpp b/src/app/dialogs/app/dialogaboutapp.cpp index 1961177c9..1598bf34d 100644 --- a/src/app/dialogs/app/dialogaboutapp.cpp +++ b/src/app/dialogs/app/dialogaboutapp.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -33,6 +33,7 @@ #include #include #include "../../options.h" +#include "../core/vapplication.h" //--------------------------------------------------------------------------------------------------------------------- DialogAboutApp::DialogAboutApp(QWidget *parent) : @@ -41,6 +42,8 @@ DialogAboutApp::DialogAboutApp(QWidget *parent) : { ui->setupUi(this); + qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); + ui->label_Valentina_Version->setText(QString("Valentina %1").arg(APP_VERSION)); ui->labelBuildRevision->setText(QString("Build revision: %1").arg(BUILD_REVISION)); ui->label_QT_Version->setText(buildCompatibilityString()); diff --git a/src/app/dialogs/app/dialogaboutapp.h b/src/app/dialogs/app/dialogaboutapp.h index 97c07a104..684176d2d 100644 --- a/src/app/dialogs/app/dialogaboutapp.h +++ b/src/app/dialogs/app/dialogaboutapp.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/app/dialogaboutapp.ui b/src/app/dialogs/app/dialogaboutapp.ui index d17d84aa8..f901b50a8 100644 --- a/src/app/dialogs/app/dialogaboutapp.ui +++ b/src/app/dialogs/app/dialogaboutapp.ui @@ -10,7 +10,7 @@ 0 0 583 - 480 + 524 @@ -22,13 +22,13 @@ 573 - 480 + 524 583 - 480 + 524 @@ -201,7 +201,7 @@ - Qt::ScrollBarAlwaysOff + Qt::ScrollBarAsNeeded Qt::ScrollBarAlwaysOff @@ -217,7 +217,16 @@ Christine Neupert Sabine Schmaltz grumpi Steve Conklin -Patrick Proy +Lindsay Williams +Patrick Proy +Mischa Krempel +Matt Daw +Peter Gsellmann +Robert Martin +Michaela Orth +Rina Rivera +Fritz Rometsch +Felix Ulber diff --git a/src/app/dialogs/app/dialoghistory.cpp b/src/app/dialogs/app/dialoghistory.cpp index 78b7c6d96..adb6238d7 100644 --- a/src/app/dialogs/app/dialoghistory.cpp +++ b/src/app/dialogs/app/dialoghistory.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -49,6 +49,9 @@ DialogHistory::DialogHistory(VContainer *data, VPattern *doc, QWidget *parent) cursorToolRecordRow(0) { ui->setupUi(this); + + qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); + bOk = ui->buttonBox->button(QDialogButtonBox::Ok); connect(bOk, &QPushButton::clicked, this, &DialogHistory::DialogAccepted); FillTable(); @@ -74,7 +77,7 @@ void DialogHistory::DialogAccepted() { QTableWidgetItem *item = ui->tableWidget->item(cursorToolRecordRow, 0); quint32 id = qvariant_cast(item->data(Qt::UserRole)); - emit ShowHistoryTool(id, Qt::green, false); + emit ShowHistoryTool(id, false); emit DialogClosed(QDialog::Accepted); } @@ -103,12 +106,12 @@ void DialogHistory::cellClicked(int row, int column) { QTableWidgetItem *item = ui->tableWidget->item(cursorToolRecordRow, 0); quint32 id = qvariant_cast(item->data(Qt::UserRole)); - emit ShowHistoryTool(id, Qt::green, false); + emit ShowHistoryTool(id, false); cursorToolRecordRow = row; item = ui->tableWidget->item(cursorToolRecordRow, 0); id = qvariant_cast(item->data(Qt::UserRole)); - emit ShowHistoryTool(id, Qt::green, true); + emit ShowHistoryTool(id, true); } } @@ -197,7 +200,7 @@ void DialogHistory::FillTable() */ QString DialogHistory::Record(const VToolRecord &tool) { - const QDomElement domElem = doc->elementById(QString().setNum(tool.getId())); + const QDomElement domElem = doc->elementById(tool.getId()); if (domElem.isElement() == false) { qDebug()<<"Can't find element by id"<tableWidget->item(0, 0); quint32 id = qvariant_cast(item->data(Qt::UserRole)); - emit ShowHistoryTool(id, Qt::green, true); + emit ShowHistoryTool(id, true); } } @@ -466,6 +469,6 @@ void DialogHistory::closeEvent(QCloseEvent *event) { QTableWidgetItem *item = ui->tableWidget->item(cursorToolRecordRow, 0); quint32 id = qvariant_cast(item->data(Qt::UserRole)); - emit ShowHistoryTool(id, Qt::green, false); + emit ShowHistoryTool(id, false); DialogTool::closeEvent(event); } diff --git a/src/app/dialogs/app/dialoghistory.h b/src/app/dialogs/app/dialoghistory.h index 20b18e6b6..57f57f257 100644 --- a/src/app/dialogs/app/dialoghistory.h +++ b/src/app/dialogs/app/dialoghistory.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -63,10 +63,9 @@ signals: /** * @brief ShowHistoryTool signal change color of selected in records tool * @param id id of tool - * @param color new color of tool * @param enable true enable selection, false disable selection */ - void ShowHistoryTool(quint32 id, Qt::GlobalColor color, bool enable); + void ShowHistoryTool(quint32 id, bool enable); protected: virtual void closeEvent ( QCloseEvent * event ); private: diff --git a/src/app/dialogs/app/dialogincrements.cpp b/src/app/dialogs/app/dialogincrements.cpp index 055979b35..726147d78 100644 --- a/src/app/dialogs/app/dialogincrements.cpp +++ b/src/app/dialogs/app/dialogincrements.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -30,6 +30,7 @@ #include "ui_dialogincrements.h" #include "../../widgets/doubledelegate.h" #include "../../widgets/textdelegate.h" +#include "../../widgets/vwidgetpopup.h" #include "../../xml/vstandardmeasurements.h" #include "../../xml/vindividualmeasurements.h" #include "../../core/vsettings.h" @@ -55,6 +56,8 @@ DialogIncrements::DialogIncrements(VContainer *data, VPattern *doc, QWidget *par { ui->setupUi(this); + qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); + qCDebug(vDialog)<<"Showing variables."; if (qApp->patternType() == MeasurementsType::Individual) { @@ -97,6 +100,30 @@ DialogIncrements::DialogIncrements(VContainer *data, VPattern *doc, QWidget *par if (qApp->patternType() == MeasurementsType::Standard) { ui->toolBoxMeasurements->setItemEnabled(0, false); + + const QString filePath = doc->MPath(); + VStandardMeasurements *mSt = nullptr; + try + { + VDomDocument::ValidateXML("://schema/standard_measurements.xsd", filePath); + mSt = new VStandardMeasurements(data); + mSt->setXMLContent(filePath); + + ui->labelBaseValues->setText(tr("Base size: %1 %3; Base height: %2 %3").arg(mSt->Size()) + .arg(mSt->Height()).arg(VDomDocument::UnitsToStr(qApp->patternUnit()))); + ui->labelDescription->setText(tr("Description: \"%1\"").arg(mSt->TrDescription())); + delete mSt; + } + catch (VException &e) + { + e.CriticalMessageBox(tr("File error."), this); + if (mSt != nullptr) + { + delete mSt; + } + emit DialogClosed(QDialog::Rejected); + return; + } } else { @@ -130,6 +157,10 @@ DialogIncrements::DialogIncrements(VContainer *data, VPattern *doc, QWidget *par connect(ui->comboBoxSex, static_cast(&QComboBox::currentIndexChanged), this, &DialogIncrements::SaveSex); connect(ui->dateEditBirthDate, &QDateEdit::dateChanged, this, &DialogIncrements::SaveBirthDate); + + // hide fileds that don't exist in individual measurements + ui->labelBaseValues->setVisible(false); + ui->labelDescription->setVisible(false); } ui->toolBoxMeasurements->setCurrentIndex(1); @@ -177,14 +208,14 @@ void DialogIncrements::FillMeasurements() if (qApp->patternType() == MeasurementsType::Standard) { - QTableWidgetItem *item = new QTableWidgetItem(QString() - .setNum(data->GetTableValue(qApp->VarFromUser(iMap.key())))); + QTableWidgetItem *item = new QTableWidgetItem(qApp->LocaleToString( + data->GetTableValue(qApp->VarFromUser(iMap.key())))); item->setTextAlignment(Qt::AlignHCenter); SetItemViewOnly(item); ui->tableWidgetMeasurements->setItem(currentRow, 1, item);// calculated value } - item = new QTableWidgetItem(QString().setNum(m->GetBase())); + item = new QTableWidgetItem(qApp->LocaleToString(m->GetBase())); item->setTextAlignment(Qt::AlignHCenter); if (qApp->patternType() == MeasurementsType::Standard) { @@ -194,12 +225,12 @@ void DialogIncrements::FillMeasurements() if (qApp->patternType() == MeasurementsType::Standard) { - QTableWidgetItem *item = new QTableWidgetItem(QString().setNum(m->GetKsize())); + QTableWidgetItem *item = new QTableWidgetItem(qApp->LocaleToString(m->GetKsize())); item->setTextAlignment(Qt::AlignHCenter); SetItemViewOnly(item); ui->tableWidgetMeasurements->setItem(currentRow, 3, item);// in sizes - item = new QTableWidgetItem(QString().setNum(m->GetKheight())); + item = new QTableWidgetItem(qApp->LocaleToString(m->GetKheight())); item->setTextAlignment(Qt::AlignHCenter); SetItemViewOnly(item); ui->tableWidgetMeasurements->setItem(currentRow, 4, item);// in heights @@ -250,23 +281,23 @@ void DialogIncrements::FillIncrements() if (qApp->patternType() == MeasurementsType::Standard) { - item = new QTableWidgetItem(QString().setNum(data->GetTableValue(iMap.value()))); + item = new QTableWidgetItem(qApp->LocaleToString(data->GetTableValue(iMap.value()))); item->setTextAlignment(Qt::AlignHCenter); SetItemViewOnly(item); ui->tableWidgetIncrement->setItem(currentRow, 1, item); } - item = new QTableWidgetItem(QString().setNum(incr->GetBase())); + item = new QTableWidgetItem(qApp->LocaleToString(incr->GetBase())); item->setTextAlignment(Qt::AlignHCenter); ui->tableWidgetIncrement->setItem(currentRow, 2, item); if (qApp->patternType() == MeasurementsType::Standard) { - item = new QTableWidgetItem(QString().setNum(incr->GetKsize())); + item = new QTableWidgetItem(qApp->LocaleToString(incr->GetKsize())); item->setTextAlignment(Qt::AlignHCenter); ui->tableWidgetIncrement->setItem(currentRow, 3, item); - item = new QTableWidgetItem(QString().setNum(incr->GetKheight())); + item = new QTableWidgetItem(qApp->LocaleToString(incr->GetKheight())); item->setTextAlignment(Qt::AlignHCenter); ui->tableWidgetIncrement->setItem(currentRow, 4, item); } @@ -305,7 +336,7 @@ void DialogIncrements::FillTable(const QMap varTable, QTableWidget * item->setFont(QFont("Times", 12, QFont::Bold)); table->setItem(currentRow, 0, item); - item = new QTableWidgetItem(QString().setNum(length)); + item = new QTableWidgetItem(qApp->LocaleToString(length)); item->setTextAlignment(Qt::AlignHCenter); table->setItem(currentRow, 1, item); } @@ -377,6 +408,20 @@ void DialogIncrements::ShowHeaderUnits(QTableWidget *table, int column) table->horizontalHeaderItem(column)->setText(unitHeader); } +//--------------------------------------------------------------------------------------------------------------------- +void DialogIncrements::ShowSuccess() const +{ + VWidgetPopup *popup = new VWidgetPopup(); + QLabel *label = new QLabel(tr("Data successfully saved.")); + QFont f = label->font(); + f.setBold(true); + f.setPixelSize(16); + label->setFont(f); + popup->SetWidget(label); + popup->SetLifeTime(2000); + popup->Show(frameGeometry().center()); +} + //--------------------------------------------------------------------------------------------------------------------- void DialogIncrements::ShowMeasurements() { @@ -432,6 +477,10 @@ void DialogIncrements::SaveGivenName() messageBox.setStandardButtons(QMessageBox::Ok); messageBox.exec(); } + else + { + ShowSuccess(); + } } //--------------------------------------------------------------------------------------------------------------------- @@ -450,6 +499,10 @@ void DialogIncrements::SaveFamilyName() messageBox.setStandardButtons(QMessageBox::Ok); messageBox.exec(); } + else + { + ShowSuccess(); + } } //--------------------------------------------------------------------------------------------------------------------- @@ -467,6 +520,10 @@ void DialogIncrements::SaveEmail() messageBox.setStandardButtons(QMessageBox::Ok); messageBox.exec(); } + else + { + ShowSuccess(); + } } //--------------------------------------------------------------------------------------------------------------------- @@ -484,6 +541,10 @@ void DialogIncrements::SaveSex(int index) messageBox.setStandardButtons(QMessageBox::Ok); messageBox.exec(); } + else + { + ShowSuccess(); + } } //--------------------------------------------------------------------------------------------------------------------- @@ -501,12 +562,16 @@ void DialogIncrements::SaveBirthDate(const QDate & date) messageBox.setStandardButtons(QMessageBox::Ok); messageBox.exec(); } + else + { + ShowSuccess(); + } } //--------------------------------------------------------------------------------------------------------------------- void DialogIncrements::OpenTable() { - QString text = tr("Measurements use different units than pattern. This pattern required measurements in %1") + const QString text = tr("Measurements use different units than pattern. This pattern required measurements in %1") .arg(doc->UnitsToStr(qApp->patternUnit())); if (qApp->patternType() == MeasurementsType::Individual) { @@ -555,7 +620,9 @@ void DialogIncrements::OpenTable() else { const QString filter(tr("Standard measurements (*.vst)")); - const QString filePath = QFileDialog::getOpenFileName(this, tr("Open file"), qApp->pathToTables(), filter); + //Use standard path to standard measurements + const QString path = qApp->getSettings()->GetPathStandardMeasurements(); + const QString filePath = QFileDialog::getOpenFileName(this, tr("Open file"), path, filter); if (filePath.isEmpty()) { return; @@ -656,6 +723,7 @@ void DialogIncrements::clickedToolButtonAdd() ui->toolButtonRemove->setEnabled(true); ui->tableWidgetIncrement->blockSignals(false); emit haveLiteChange(); + ShowSuccess(); } //--------------------------------------------------------------------------------------------------------------------- @@ -674,7 +742,7 @@ void DialogIncrements::clickedToolButtonRemove() data->RemoveIncrement(itemName->text()); quint32 id = qvariant_cast(itemName->data(Qt::UserRole)); - QDomElement domElement = doc->elementById(QString().setNum(id)); + QDomElement domElement = doc->elementById(id); if (domElement.isElement()) { QDomNodeList list = doc->elementsByTagName(VPattern::TagIncrements); @@ -683,6 +751,7 @@ void DialogIncrements::clickedToolButtonRemove() else { qCDebug(vDialog)<<"Could not find object with id"<tableWidgetIncrement->removeRow(row); @@ -693,6 +762,7 @@ void DialogIncrements::clickedToolButtonRemove() ui->tableWidgetIncrement->blockSignals(false); emit haveLiteChange(); + ShowSuccess(); } //--------------------------------------------------------------------------------------------------------------------- @@ -746,7 +816,7 @@ 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(itemName->data(Qt::UserRole)); - QDomElement domElement = doc->elementById(QString().setNum(id)); + QDomElement domElement = doc->elementById(id); if (domElement.isElement() == false) { qCDebug(vDialog)<<"Cant't find increment with id = "<ClearVariables(); m->Measurements(); diff --git a/src/app/dialogs/app/dialogincrements.h b/src/app/dialogs/app/dialogincrements.h index 558ad65ff..e91df636f 100644 --- a/src/app/dialogs/app/dialogincrements.h +++ b/src/app/dialogs/app/dialogincrements.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -107,6 +107,7 @@ private: void SetItemViewOnly(QTableWidgetItem *item); void ShowUnits(); void ShowHeaderUnits(QTableWidget *table, int column); + void ShowSuccess() const; }; #endif // DIALOGINCREMENTS_H diff --git a/src/app/dialogs/app/dialogincrements.ui b/src/app/dialogs/app/dialogincrements.ui index d55672606..72dbd4d04 100644 --- a/src/app/dialogs/app/dialogincrements.ui +++ b/src/app/dialogs/app/dialogincrements.ui @@ -17,7 +17,7 @@ - Increments + Tables of Variables @@ -290,6 +290,23 @@ Measurements + + + + Base size: ; base height: + + + + + + + Description: + + + true + + + diff --git a/src/app/dialogs/app/dialogindividualmeasurements.cpp b/src/app/dialogs/app/dialogindividualmeasurements.cpp index 8adcc8649..893772ae3 100644 --- a/src/app/dialogs/app/dialogindividualmeasurements.cpp +++ b/src/app/dialogs/app/dialogindividualmeasurements.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -47,6 +47,8 @@ DialogIndividualMeasurements::DialogIndividualMeasurements(VContainer *data, con { ui->setupUi(this); + qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); + QRect position = this->frameGeometry(); position.moveCenter(QDesktopWidget().availableGeometry().center()); move(position.topLeft()); @@ -98,8 +100,9 @@ void DialogIndividualMeasurements::DialogAccepted() } //just in case - VDomDocument::ValidateXML("://schema/individual_measurements.xsd", qApp->pathToTables()); - QFile iMeasur(qApp->pathToTables()); + const QString path = QStringLiteral("://tables/individual/individual.vit"); + VDomDocument::ValidateXML("://schema/individual_measurements.xsd", path); + QFile iMeasur(path); //TODO maybe make copy save? if ( iMeasur.copy(_tablePath) == false ) { @@ -226,7 +229,7 @@ void DialogIndividualMeasurements::OpenTable() //--------------------------------------------------------------------------------------------------------------------- void DialogIndividualMeasurements::NewTable() { - QString dir = QDir::homePath()+"/measurements.vit"; + const QString dir = qApp->getSettings()->GetPathIndividualMeasurements()+"/measurements.vit"; QString name = QFileDialog::getSaveFileName(this, tr("Where save measurements?"), dir, tr("Individual measurements (*.vit)")); @@ -236,7 +239,7 @@ void DialogIndividualMeasurements::NewTable() } // what if the users did not specify a suffix...? - QFileInfo f( name ); + const QFileInfo f( name ); if (f.suffix().isEmpty() && f.suffix() != "vit") { name += ".vit"; diff --git a/src/app/dialogs/app/dialogindividualmeasurements.h b/src/app/dialogs/app/dialogindividualmeasurements.h index c133c4799..793bd2908 100644 --- a/src/app/dialogs/app/dialogindividualmeasurements.h +++ b/src/app/dialogs/app/dialogindividualmeasurements.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/app/dialoglayoutprogress.cpp b/src/app/dialogs/app/dialoglayoutprogress.cpp new file mode 100644 index 000000000..dc21d86c2 --- /dev/null +++ b/src/app/dialogs/app/dialoglayoutprogress.cpp @@ -0,0 +1,113 @@ +/************************************************************************ + ** + ** @file dialoglayoutprogress.cpp + ** @author Roman Telezhynskyi + ** @date 14 1, 2015 + ** + ** @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-2015 Valentina project + ** 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 . + ** + *************************************************************************/ + +#include "dialoglayoutprogress.h" +#include "ui_dialoglayoutprogress.h" +#include "../options.h" +#include "../core/vapplication.h" + +#include +#include + +//--------------------------------------------------------------------------------------------------------------------- +DialogLayoutProgress::DialogLayoutProgress(int count, QWidget *parent) + :QDialog(parent), ui(new Ui::DialogLayoutProgress) +{ + ui->setupUi(this); + + qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); + + ui->progressBar->setMaximum(count); + ui->progressBar->setValue(0); + + QPushButton *bCancel = ui->buttonBox->button(QDialogButtonBox::Cancel); + SCASSERT(bCancel != nullptr); + connect(bCancel, &QPushButton::clicked, this, &DialogLayoutProgress::StopWorking); + setModal(true); + + this->setWindowFlags(Qt::Dialog | Qt::WindowTitleHint | Qt::CustomizeWindowHint); +} + +//--------------------------------------------------------------------------------------------------------------------- +DialogLayoutProgress::~DialogLayoutProgress() +{ + delete ui; +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutProgress::Start() +{ + show(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutProgress::Arranged(int count) +{ + ui->progressBar->setValue(count); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutProgress::Error(const LayoutErrors &state) +{ + QString text; + switch(state) + { + case LayoutErrors::NoError: + return; + case LayoutErrors::PrepareLayoutError: + text = tr("Couldn't prepare data for creation layout"); + QMessageBox::critical(this, tr("Critical error"), text, QMessageBox::Ok, QMessageBox::Ok); + break; + case LayoutErrors::PaperSizeError: + text = tr("Wrong paper size"); + QMessageBox::critical(this, tr("Critical error"), text, QMessageBox::Ok, QMessageBox::Ok); + break; + case LayoutErrors::ProcessStoped: + break; + case LayoutErrors::EmptyPaperError: + text = tr("Several workpieces left not arranged, but none of them match for paper"); + QMessageBox::critical(this, tr("Critical error"), text, QMessageBox::Ok, QMessageBox::Ok); + break; + default: + break; + } + + done(QDialog::Rejected); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutProgress::Finished() +{ + done(QDialog::Accepted); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutProgress::StopWorking() +{ + emit Abort(); +} diff --git a/src/app/dialogs/app/dialoglayoutprogress.h b/src/app/dialogs/app/dialoglayoutprogress.h new file mode 100644 index 000000000..3d761c3d3 --- /dev/null +++ b/src/app/dialogs/app/dialoglayoutprogress.h @@ -0,0 +1,64 @@ +/************************************************************************ + ** + ** @file dialoglayoutprogress.h + ** @author Roman Telezhynskyi + ** @date 14 1, 2015 + ** + ** @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-2015 Valentina project + ** 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 . + ** + *************************************************************************/ + +#ifndef DIALOGLAYOUTPROGRESS_H +#define DIALOGLAYOUTPROGRESS_H + +#include + +#include "../../libs/vlayout/vlayoutdef.h" + +namespace Ui +{ + class DialogLayoutProgress; +} + +class DialogLayoutProgress : public QDialog +{ + Q_OBJECT + +public: + explicit DialogLayoutProgress(int count, QWidget *parent = 0); + ~DialogLayoutProgress(); + +signals: + void Abort(); + +public slots: + void Start(); + void Arranged(int count); + void Error(const LayoutErrors &state); + void Finished(); + void StopWorking(); + +private: + Q_DISABLE_COPY(DialogLayoutProgress) + Ui::DialogLayoutProgress *ui; +}; + +#endif // DIALOGLAYOUTPROGRESS_H diff --git a/src/app/dialogs/app/dialoglayoutprogress.ui b/src/app/dialogs/app/dialoglayoutprogress.ui new file mode 100644 index 000000000..edd14dddb --- /dev/null +++ b/src/app/dialogs/app/dialoglayoutprogress.ui @@ -0,0 +1,78 @@ + + + DialogLayoutProgress + + + Qt::ApplicationModal + + + + 0 + 0 + 566 + 119 + + + + + 566 + 119 + + + + + 566 + 119 + + + + Creation a layout + + + + :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png + + + true + + + + + + + 0 + 0 + + + + <html><head/><body><p>Finding best position for worpieces. Please, waite.</p></body></html> + + + + + + + + 0 + 0 + + + + 24 + + + + + + + QDialogButtonBox::Cancel + + + + + + + + + + diff --git a/src/app/dialogs/app/dialoglayoutsettings.cpp b/src/app/dialogs/app/dialoglayoutsettings.cpp new file mode 100644 index 000000000..b2bdd401d --- /dev/null +++ b/src/app/dialogs/app/dialoglayoutsettings.cpp @@ -0,0 +1,436 @@ +/************************************************************************ + ** + ** @file dialoglayoutsettings.cpp + ** @author Roman Telezhynskyi + ** @date 13 1, 2015 + ** + ** @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-2015 Valentina project + ** 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 . + ** + *************************************************************************/ + +#include "dialoglayoutsettings.h" +#include "ui_dialoglayoutsettings.h" +#include "../../core/vapplication.h" +#include "../../libs/ifc/xml/vdomdocument.h" +#include "../../core/vsettings.h" +#include "../../xml/vabstractmeasurements.h" + +#include + +enum class PaperSizeTemplate : char { A0, A1, A2, A3, A4 }; + +//--------------------------------------------------------------------------------------------------------------------- +DialogLayoutSettings::DialogLayoutSettings(QWidget *parent) + : QDialog(parent), ui(new Ui::DialogLayoutSettings), oldPaperUnit(Unit::Mm), oldLayoutUnit(Unit::Mm) +{ + ui->setupUi(this); + + qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); + + InitPaperUnits(); + InitLayoutUnits(); + InitTemplates(); + MinimumPaperSize(); + MinimumLayoutSize(); + + connect(ui->comboBoxTemplates, static_cast(&QComboBox::currentIndexChanged), + this, &DialogLayoutSettings::TemplateSelected); + connect(ui->comboBoxPaperSizeUnit, static_cast(&QComboBox::currentIndexChanged), + this, &DialogLayoutSettings::ConvertPaperSize); + connect(ui->doubleSpinBoxPaperWidth, static_cast(&QDoubleSpinBox::valueChanged), + this, &DialogLayoutSettings::PaperSizeChanged); + connect(ui->doubleSpinBoxPaperHeight, static_cast(&QDoubleSpinBox::valueChanged), + this, &DialogLayoutSettings::PaperSizeChanged); + connect(ui->toolButtonPortrate, &QToolButton::toggled, this, &DialogLayoutSettings::Swap); + connect(ui->toolButtonLandscape, &QToolButton::toggled, this, &DialogLayoutSettings::Swap); + connect(ui->comboBoxLayoutUnit, static_cast(&QComboBox::currentIndexChanged), + this, &DialogLayoutSettings::ConvertLayoutSize); +} + +//--------------------------------------------------------------------------------------------------------------------- +DialogLayoutSettings::~DialogLayoutSettings() +{ + delete ui; +} + +//--------------------------------------------------------------------------------------------------------------------- +int DialogLayoutSettings::GetPaperHeight() const +{ + return qFloor(VAbstractMeasurements::UnitConvertor(ui->doubleSpinBoxPaperHeight->value(), oldPaperUnit, Unit::Px)); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutSettings::SetPaperHeight(int value) +{ + ui->doubleSpinBoxPaperHeight->setValue(VAbstractMeasurements::UnitConvertor(value, Unit::Px, PaperUnit())); +} + +//--------------------------------------------------------------------------------------------------------------------- +int DialogLayoutSettings::GetPaperWidth() const +{ + return qFloor(VAbstractMeasurements::UnitConvertor(ui->doubleSpinBoxPaperWidth->value(), oldPaperUnit, Unit::Px)); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutSettings::SetPaperWidth(int value) +{ + ui->doubleSpinBoxPaperWidth->setValue(VAbstractMeasurements::UnitConvertor(value, Unit::Px, PaperUnit())); +} + +//--------------------------------------------------------------------------------------------------------------------- +unsigned int DialogLayoutSettings::GetShift() const +{ + return qFloor(VAbstractMeasurements::UnitConvertor(ui->doubleSpinBoxShift->value(), oldLayoutUnit, Unit::Px)); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutSettings::SetShift(unsigned int value) +{ + ui->doubleSpinBoxShift->setValue(VAbstractMeasurements::UnitConvertor(value, Unit::Px, LayoutUnit())); +} + +//--------------------------------------------------------------------------------------------------------------------- +unsigned int DialogLayoutSettings::GetLayoutWidth() const +{ + return qFloor(VAbstractMeasurements::UnitConvertor(ui->doubleSpinBoxLayoutWidth->value(), oldLayoutUnit, Unit::Px)); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutSettings::SetLayoutWidth(unsigned int value) +{ + ui->doubleSpinBoxLayoutWidth->setValue(VAbstractMeasurements::UnitConvertor(value, Unit::Px, LayoutUnit())); +} + +//--------------------------------------------------------------------------------------------------------------------- +Cases DialogLayoutSettings::GetGroup() const +{ + if (ui->radioButtonThreeGroups->isChecked()) + { + return Cases::CaseThreeGroup; + } + else if (ui->radioButtonTwoGroups->isChecked()) + { + return Cases::CaseTwoGroup; + } + else + { + return Cases::CaseDesc; + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutSettings::SetGroup(const Cases &value) +{ + switch (value) + { + case Cases::CaseThreeGroup: + ui->radioButtonThreeGroups->setChecked(true); + break; + case Cases::CaseTwoGroup: + ui->radioButtonTwoGroups->setChecked(true); + break; + case Cases::CaseDesc: + ui->radioButtonDescendingArea->setChecked(true); + break; + default: + ui->radioButtonDescendingArea->setChecked(true); + break; + } +} + +//--------------------------------------------------------------------------------------------------------------------- +bool DialogLayoutSettings::GetRotate() const +{ + return ui->groupBoxRotate->isChecked(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutSettings::SetRotate(bool state) +{ + ui->groupBoxRotate->setChecked(state); +} + +//--------------------------------------------------------------------------------------------------------------------- +int DialogLayoutSettings::GetIncrease() const +{ + return ui->comboBoxIncrease->currentText().toInt(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutSettings::SetIncrease(int increase) +{ + int index = ui->comboBoxIncrease->findText(QString::number(increase)); + + if (index == -1) + { + index = 21; + } + + ui->comboBoxIncrease->setCurrentIndex(index); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutSettings::TemplateSelected() +{ + const QSizeF size = Template(); + ui->doubleSpinBoxPaperWidth->setValue(size.width()); + ui->doubleSpinBoxPaperHeight->setValue(size.height()); + oldPaperUnit = PaperUnit(); + CorrectPaperDecimals(); + PaperSizeChanged(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutSettings::ConvertPaperSize() +{ + const Unit paperUnit = PaperUnit(); + const qreal width = ui->doubleSpinBoxPaperWidth->value(); + const qreal height = ui->doubleSpinBoxPaperHeight->value(); + ui->doubleSpinBoxPaperWidth->setValue(VAbstractMeasurements::UnitConvertor(width, oldPaperUnit, paperUnit)); + ui->doubleSpinBoxPaperHeight->setValue(VAbstractMeasurements::UnitConvertor(height, oldPaperUnit, paperUnit)); + oldPaperUnit = paperUnit; + CorrectPaperDecimals(); + MinimumPaperSize(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutSettings::ConvertLayoutSize() +{ + const Unit unit = LayoutUnit(); + const qreal layoutWidth = ui->doubleSpinBoxLayoutWidth->value(); + const qreal shift = ui->doubleSpinBoxShift->value(); + ui->doubleSpinBoxLayoutWidth->setValue(VAbstractMeasurements::UnitConvertor(layoutWidth, oldLayoutUnit, unit)); + ui->doubleSpinBoxShift->setValue(VAbstractMeasurements::UnitConvertor(shift, oldLayoutUnit, unit)); + oldLayoutUnit = unit; + CorrectLayoutDecimals(); + MinimumLayoutSize(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutSettings::PaperSizeChanged() +{ + if (ui->doubleSpinBoxPaperHeight->value() > ui->doubleSpinBoxPaperWidth->value()) + { + ui->toolButtonPortrate->blockSignals(true); + ui->toolButtonPortrate->setChecked(true); + ui->toolButtonPortrate->blockSignals(false); + } + else + { + ui->toolButtonLandscape->blockSignals(true); + ui->toolButtonLandscape->setChecked(true); + ui->toolButtonLandscape->blockSignals(false); + } + + Label(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutSettings::Swap(bool checked) +{ + if (checked) + { + const qreal width = ui->doubleSpinBoxPaperWidth->value(); + const qreal height = ui->doubleSpinBoxPaperHeight->value(); + + ui->doubleSpinBoxPaperWidth->blockSignals(true); + ui->doubleSpinBoxPaperWidth->setValue(height); + ui->doubleSpinBoxPaperWidth->blockSignals(false); + + ui->doubleSpinBoxPaperHeight->blockSignals(true); + ui->doubleSpinBoxPaperHeight->setValue(width); + ui->doubleSpinBoxPaperHeight->blockSignals(false); + + Label(); + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutSettings::InitPaperUnits() +{ + ui->comboBoxPaperSizeUnit->addItem(tr("Millimiters"), QVariant(VDomDocument::UnitsToStr(Unit::Mm))); + ui->comboBoxPaperSizeUnit->addItem(tr("Centimeters"), QVariant(VDomDocument::UnitsToStr(Unit::Cm))); + ui->comboBoxPaperSizeUnit->addItem(tr("Inches"), QVariant(VDomDocument::UnitsToStr(Unit::Inch))); + ui->comboBoxPaperSizeUnit->addItem(tr("Pixels"), QVariant(VDomDocument::UnitsToStr(Unit::Px))); + + // set default unit + oldPaperUnit = VDomDocument::StrToUnits(qApp->getSettings()->GetUnit()); + const qint32 indexUnit = ui->comboBoxPaperSizeUnit->findData(qApp->getSettings()->GetUnit()); + if (indexUnit != -1) + { + ui->comboBoxPaperSizeUnit->setCurrentIndex(indexUnit); + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutSettings::InitLayoutUnits() +{ + ui->comboBoxLayoutUnit->addItem(tr("Centimeters"), QVariant(VDomDocument::UnitsToStr(Unit::Cm))); + ui->comboBoxLayoutUnit->addItem(tr("Millimiters"), QVariant(VDomDocument::UnitsToStr(Unit::Mm))); + ui->comboBoxLayoutUnit->addItem(tr("Inches"), QVariant(VDomDocument::UnitsToStr(Unit::Inch))); + + // set default unit + oldLayoutUnit = VDomDocument::StrToUnits(qApp->getSettings()->GetUnit()); + const qint32 indexUnit = ui->comboBoxLayoutUnit->findData(qApp->getSettings()->GetUnit()); + if (indexUnit != -1) + { + ui->comboBoxLayoutUnit->setCurrentIndex(indexUnit); + } + + ui->doubleSpinBoxLayoutWidth->setValue(VAbstractMeasurements::UnitConvertor(2.5, Unit::Mm, oldLayoutUnit)); + ui->doubleSpinBoxShift->setValue(VAbstractMeasurements::UnitConvertor(50, Unit::Mm, oldLayoutUnit)); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutSettings::InitTemplates() +{ + const QIcon ico("://icon/16x16/template.png"); + const QString pdi = QString("(%1ppi)").arg(VApplication::PrintDPI); + + ui->comboBoxTemplates->addItem(ico, "A0 "+pdi, QVariant(static_cast(PaperSizeTemplate::A0))); + ui->comboBoxTemplates->addItem(ico, "A1 "+pdi, QVariant(static_cast(PaperSizeTemplate::A1))); + ui->comboBoxTemplates->addItem(ico, "A2 "+pdi, QVariant(static_cast(PaperSizeTemplate::A2))); + ui->comboBoxTemplates->addItem(ico, "A3 "+pdi, QVariant(static_cast(PaperSizeTemplate::A3))); + ui->comboBoxTemplates->addItem(ico, "A4 "+pdi, QVariant(static_cast(PaperSizeTemplate::A4))); + + TemplateSelected(); +} + +//--------------------------------------------------------------------------------------------------------------------- +QSizeF DialogLayoutSettings::Template() +{ + const PaperSizeTemplate temp = static_cast(ui->comboBoxTemplates->currentData().toInt()); + const Unit paperUnit = PaperUnit(); + + qreal width = 0; + qreal height = 0; + + switch(temp) + { + case PaperSizeTemplate::A0: + width = VAbstractMeasurements::UnitConvertor(841, Unit::Mm, paperUnit); + height = VAbstractMeasurements::UnitConvertor(1189, Unit::Mm, paperUnit); + return QSizeF(width, height); + case PaperSizeTemplate::A1: + width = VAbstractMeasurements::UnitConvertor(594, Unit::Mm, paperUnit); + height = VAbstractMeasurements::UnitConvertor(841, Unit::Mm, paperUnit); + return QSizeF(width, height); + case PaperSizeTemplate::A2: + width = VAbstractMeasurements::UnitConvertor(420, Unit::Mm, paperUnit); + height = VAbstractMeasurements::UnitConvertor(594, Unit::Mm, paperUnit); + return QSizeF(width, height); + case PaperSizeTemplate::A3: + width = VAbstractMeasurements::UnitConvertor(297, Unit::Mm, paperUnit); + height = VAbstractMeasurements::UnitConvertor(420, Unit::Mm, paperUnit); + return QSizeF(width, height); + case PaperSizeTemplate::A4: + width = VAbstractMeasurements::UnitConvertor(210, Unit::Mm, paperUnit); + height = VAbstractMeasurements::UnitConvertor(297, Unit::Mm, paperUnit); + return QSizeF(width, height); + default: + break; + } + return QSizeF(); +} + +//--------------------------------------------------------------------------------------------------------------------- +Unit DialogLayoutSettings::PaperUnit() const +{ + return VDomDocument::StrToUnits(ui->comboBoxPaperSizeUnit->currentData().toString()); +} + +//--------------------------------------------------------------------------------------------------------------------- +Unit DialogLayoutSettings::LayoutUnit() const +{ + return VDomDocument::StrToUnits(ui->comboBoxLayoutUnit->currentData().toString()); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutSettings::CorrectPaperDecimals() +{ + switch(oldPaperUnit) + { + case Unit::Cm: + case Unit::Mm: + ui->doubleSpinBoxPaperWidth->setDecimals(2); + ui->doubleSpinBoxPaperHeight->setDecimals(2); + break; + case Unit::Inch: + ui->doubleSpinBoxPaperWidth->setDecimals(5); + ui->doubleSpinBoxPaperHeight->setDecimals(5); + break; + case Unit::Px: + ui->doubleSpinBoxPaperWidth->setDecimals(0); + ui->doubleSpinBoxPaperHeight->setDecimals(0); + break; + default: + break; + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutSettings::CorrectLayoutDecimals() +{ + switch(oldLayoutUnit) + { + case Unit::Cm: + case Unit::Mm: + ui->doubleSpinBoxLayoutWidth->setDecimals(2); + ui->doubleSpinBoxShift->setDecimals(2); + break; + case Unit::Inch: + ui->doubleSpinBoxLayoutWidth->setDecimals(5); + ui->doubleSpinBoxShift->setDecimals(5); + break; + case Unit::Px: + ui->doubleSpinBoxLayoutWidth->setDecimals(0); + ui->doubleSpinBoxShift->setDecimals(0); + break; + default: + break; + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutSettings::Label() +{ + const int width = qFloor(VAbstractMeasurements::UnitConvertor(ui->doubleSpinBoxPaperWidth->value(), PaperUnit(), + Unit::Px)); + const int height = qFloor(VAbstractMeasurements::UnitConvertor(ui->doubleSpinBoxPaperHeight->value(), + PaperUnit(), Unit::Px)); + QString text = QString("%1 x %2 px, \n%3 ppi").arg(width).arg(height).arg(VApplication::PrintDPI); + ui->labelSizeDescription->setText(text); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutSettings::MinimumPaperSize() +{ + const qreal value = VAbstractMeasurements::UnitConvertor(1, Unit::Px, oldPaperUnit); + ui->doubleSpinBoxPaperWidth->setMinimum(value); + ui->doubleSpinBoxPaperHeight->setMinimum(value); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLayoutSettings::MinimumLayoutSize() +{ + const qreal value = VAbstractMeasurements::UnitConvertor(1, Unit::Px, oldLayoutUnit); + ui->doubleSpinBoxLayoutWidth->setMinimum(value); +} diff --git a/src/app/dialogs/app/dialoglayoutsettings.h b/src/app/dialogs/app/dialoglayoutsettings.h new file mode 100644 index 000000000..41d7dc940 --- /dev/null +++ b/src/app/dialogs/app/dialoglayoutsettings.h @@ -0,0 +1,100 @@ +/************************************************************************ + ** + ** @file dialoglayoutsettings.h + ** @author Roman Telezhynskyi + ** @date 13 1, 2015 + ** + ** @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-2015 Valentina project + ** 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 . + ** + *************************************************************************/ + +#ifndef DIALOGLAYOUTSETTINGS_H +#define DIALOGLAYOUTSETTINGS_H + +#include + +#include "../../libs/vlayout/vbank.h" +#include "../../libs/ifc/ifcdef.h" + +namespace Ui +{ + class DialogLayoutSettings; +} + +class DialogLayoutSettings : public QDialog +{ + Q_OBJECT +public: + explicit DialogLayoutSettings(QWidget *parent = 0); + ~DialogLayoutSettings(); + + int GetPaperHeight() const; + void SetPaperHeight(int value); + + int GetPaperWidth() const; + void SetPaperWidth(int value); + + unsigned int GetShift() const; + void SetShift(unsigned int value); + + unsigned int GetLayoutWidth() const; + void SetLayoutWidth(unsigned int value); + + Cases GetGroup() const; + void SetGroup(const Cases &value); + + bool GetRotate() const; + void SetRotate(bool state); + + int GetIncrease() const; + void SetIncrease(int increase); + +public slots: + void ConvertPaperSize(); + void ConvertLayoutSize(); + + void TemplateSelected(); + void PaperSizeChanged(); + void Swap(bool checked); + +private: + Q_DISABLE_COPY(DialogLayoutSettings) + Ui::DialogLayoutSettings *ui; + Unit oldPaperUnit; + Unit oldLayoutUnit; + + void InitPaperUnits(); + void InitLayoutUnits(); + void InitTemplates(); + QSizeF Template(); + + Unit PaperUnit() const; + Unit LayoutUnit() const; + + void CorrectPaperDecimals(); + void CorrectLayoutDecimals(); + void Label(); + + void MinimumPaperSize(); + void MinimumLayoutSize(); +}; + +#endif // DIALOGLAYOUTSETTINGS_H diff --git a/src/app/dialogs/app/dialoglayoutsettings.ui b/src/app/dialogs/app/dialoglayoutsettings.ui new file mode 100644 index 000000000..fd0f71ca6 --- /dev/null +++ b/src/app/dialogs/app/dialoglayoutsettings.ui @@ -0,0 +1,517 @@ + + + DialogLayoutSettings + + + + 0 + 0 + 661 + 289 + + + + Creation a layout + + + + + + + + + + Paper size + + + false + + + false + + + false + + + + + + 6 + + + + + + 0 + 0 + + + + Templates: + + + + + + + + + + + + + + + 0 + 0 + + + + + 124 + 0 + + + + + + + + + 0 + 0 + + + + Width: + + + + + + + + 0 + 0 + + + + Height: + + + + + + + + 94 + 0 + + + + 2 + + + 99999.000000000000000 + + + + + + + + 94 + 0 + + + + 2 + + + 99999.990000000005239 + + + + + + + TextLabel + + + + + + + + + ... + + + + :/icon/16x16/portrait.png:/icon/16x16/portrait.png + + + true + + + true + + + true + + + buttonGroup + + + + + + + ... + + + + :/icon/16x16/landscape.png:/icon/16x16/landscape.png + + + true + + + false + + + true + + + buttonGroup + + + + + + + + + + + + + + Rotate workpiece + + + true + + + + + + + 0 + 0 + + + + Rotate by + + + + + + + 21 + + + + 1 + + + + + 2 + + + + + 3 + + + + + 4 + + + + + 5 + + + + + 6 + + + + + 8 + + + + + 9 + + + + + 10 + + + + + 12 + + + + + 15 + + + + + 18 + + + + + 20 + + + + + 24 + + + + + 30 + + + + + 36 + + + + + 40 + + + + + 45 + + + + + 60 + + + + + 72 + + + + + 90 + + + + + 180 + + + + + + + + degree + + + + + + + + + + + + Creation options + + + + + + + + + 94 + 0 + + + + 0.000000000000000 + + + 99999.990000000005239 + + + 1.000000000000000 + + + + + + + Layout width: + + + + + + + Shift length: + + + + + + + + 94 + 0 + + + + 99999.990000000005239 + + + 10.000000000000000 + + + + + + + + + + + + Principle of choosing the next workpiece + + + + + + + + Three groups: big, middle, small + + + buttonGroupPrinciple + + + + + + + Two groups: big, small + + + false + + + buttonGroupPrinciple + + + + + + + Descending area + + + true + + + buttonGroupPrinciple + + + + + + + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + + + buttonBox + accepted() + DialogLayoutSettings + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + DialogLayoutSettings + reject() + + + 316 + 260 + + + 286 + 274 + + + + + + + + + diff --git a/src/app/dialogs/app/dialogmeasurements.cpp b/src/app/dialogs/app/dialogmeasurements.cpp index af84fc440..cfa386f55 100644 --- a/src/app/dialogs/app/dialogmeasurements.cpp +++ b/src/app/dialogs/app/dialogmeasurements.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -28,12 +28,16 @@ #include "dialogmeasurements.h" #include "ui_dialogmeasurements.h" +#include "../core/vapplication.h" //--------------------------------------------------------------------------------------------------------------------- DialogMeasurements::DialogMeasurements(QWidget *parent) : QDialog(parent), ui(new Ui::DialogMeasurements), result(MeasurementsType::Individual) { ui->setupUi(this); + + qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); + connect(ui->toolButtonStandard, &QToolButton::clicked, this, &DialogMeasurements::StandardMeasurements); connect(ui->toolButtonIndividual, &QToolButton::clicked, this, &DialogMeasurements::IndividualMeasurements); } diff --git a/src/app/dialogs/app/dialogmeasurements.h b/src/app/dialogs/app/dialogmeasurements.h index 6b4bc3941..b5396b7d2 100644 --- a/src/app/dialogs/app/dialogmeasurements.h +++ b/src/app/dialogs/app/dialogmeasurements.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/app/dialogpatternproperties.cpp b/src/app/dialogs/app/dialogpatternproperties.cpp index 51e68a418..0cea50d57 100644 --- a/src/app/dialogs/app/dialogpatternproperties.cpp +++ b/src/app/dialogs/app/dialogpatternproperties.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -45,6 +45,8 @@ DialogPatternProperties::DialogPatternProperties(VPattern *doc, QWidget *parent) SCASSERT(doc != nullptr); + qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); + ui->lineEditAuthor->setText(doc->GetAuthor()); connect(ui->lineEditAuthor, &QLineEdit::editingFinished, this, &DialogPatternProperties::DescEdited); diff --git a/src/app/dialogs/app/dialogpatternproperties.h b/src/app/dialogs/app/dialogpatternproperties.h index 8d09531a9..102b598cd 100644 --- a/src/app/dialogs/app/dialogpatternproperties.h +++ b/src/app/dialogs/app/dialogpatternproperties.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/app/dialogpatternxmledit.cpp b/src/app/dialogs/app/dialogpatternxmledit.cpp index 6339ff47c..b1782f23f 100644 --- a/src/app/dialogs/app/dialogpatternxmledit.cpp +++ b/src/app/dialogs/app/dialogpatternxmledit.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -28,6 +28,7 @@ #include "dialogpatternxmledit.h" #include "ui_dialogpatternxmledit.h" +#include "../core/vapplication.h" #include #include @@ -36,7 +37,6 @@ const short int DialogPatternXmlEdit::ChangeTypeDelete=1; const short int DialogPatternXmlEdit::ChangeTypeAdd=2; const short int DialogPatternXmlEdit::ChangeTypeModify=3; - //--------------------------------------------------------------------------------------------------------------------- DialogPatternXmlEdit::DialogPatternXmlEdit(QWidget *parent, VPattern *xmldoc) :QDialog(parent), treeChange(false), currentNodeEdited(nullptr), currentNodeEditedStatus(0), @@ -46,6 +46,8 @@ DialogPatternXmlEdit::DialogPatternXmlEdit(QWidget *parent, VPattern *xmldoc) { ui->setupUi(this); + qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); + this->xmlmodel = new VXMLTreeView(); this->doc=xmldoc; this->root = this->doc->documentElement(); diff --git a/src/app/dialogs/app/dialogpatternxmledit.h b/src/app/dialogs/app/dialogpatternxmledit.h index cbdf94a1a..5c6a8f4a4 100644 --- a/src/app/dialogs/app/dialogpatternxmledit.h +++ b/src/app/dialogs/app/dialogpatternxmledit.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/app/dialogsavelayout.cpp b/src/app/dialogs/app/dialogsavelayout.cpp new file mode 100644 index 000000000..7db82d8fb --- /dev/null +++ b/src/app/dialogs/app/dialogsavelayout.cpp @@ -0,0 +1,158 @@ +/************************************************************************ + ** + ** @file dialogsavelayout.cpp + ** @author Roman Telezhynskyi + ** @date 22 1, 2015 + ** + ** @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-2015 Valentina project + ** 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 . + ** + *************************************************************************/ + +#include "dialogsavelayout.h" +#include "ui_dialogsavelayout.h" +#include "../options.h" +#include "../../core/vapplication.h" +#include "../../core/vsettings.h" + +#include +#include +#include + +//--------------------------------------------------------------------------------------------------------------------- +DialogSaveLayout::DialogSaveLayout(const QMap &formates, int count, const QString &fileName, + QWidget *parent) + :QDialog(parent), ui(new Ui::DialogSaveLAyout), count(count) +{ + ui->setupUi(this); + + qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); + + QPushButton *bOk = ui->buttonBox->button(QDialogButtonBox::Ok); + SCASSERT(bOk != nullptr); + bOk->setEnabled(false); + + QRegExpValidator *validator = new QRegExpValidator(QRegExp("^[\\w\\-. ]+$"), this); + ui->lineEditFileName->setValidator(validator); + ui->lineEditFileName->setText(fileName); + + QMap::const_iterator i = formates.constBegin(); + while (i != formates.constEnd()) + { + ui->comboBoxFormat->addItem(i.key(), QVariant(i.value())); + ++i; + } + + connect(bOk, &QPushButton::clicked, this, &DialogSaveLayout::Save); + connect(ui->lineEditFileName, &QLineEdit::textChanged, this, &DialogSaveLayout::ShowExample); + connect(ui->comboBoxFormat, static_cast(&QComboBox::currentIndexChanged), this, + &DialogSaveLayout::ShowExample); + connect(ui->pushButtonBrowse, &QPushButton::clicked, this, &DialogSaveLayout::Browse); + connect(ui->lineEditPath, &QLineEdit::textChanged, this, &DialogSaveLayout::PathChanged); + + ui->comboBoxFormat->setCurrentIndex(4);//svg + ui->lineEditPath->setText(qApp->getSettings()->GetPathLayout()); +} + +//--------------------------------------------------------------------------------------------------------------------- +DialogSaveLayout::~DialogSaveLayout() +{ + delete ui; +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogSaveLayout::Path() const +{ + return ui->lineEditPath->text(); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogSaveLayout::FileName() const +{ + return ui->lineEditFileName->text(); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogSaveLayout::Formate() const +{ + return ui->comboBoxFormat->currentData().toString(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogSaveLayout::Save() +{ + for (int i=0; i < count; ++i) + { + const QString name = Path()+"/"+FileName()+QString::number(i+1)+Formate(); + if (QFile::exists(name)) + { + QMessageBox::StandardButton res = QMessageBox::question(this, tr("Name conflict"), + tr("Folder already contain file with name %1. Rewrite all conflict file names?") + .arg(name), QMessageBox::Yes|QMessageBox::No, QMessageBox::Yes); + if (res == QMessageBox::No) + { + return; + } + else + { + break; + } + } + } + accept(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogSaveLayout::ShowExample() +{ + ui->labelExample->setText(tr("Example:") + FileName() + "1" + Formate()); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogSaveLayout::Browse() +{ + const QString dir = QFileDialog::getExistingDirectory(this, tr("Select folder"), QDir::homePath(), + QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); + ui->lineEditPath->setText(dir); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogSaveLayout::PathChanged(const QString &text) +{ + QPushButton *bOk = ui->buttonBox->button(QDialogButtonBox::Ok); + SCASSERT(bOk != nullptr); + + QPalette palette = ui->lineEditPath->palette(); + + QDir dir(text); + dir.setPath(text); + if (dir.exists(text)) + { + bOk->setEnabled(true); + palette.setColor(ui->lineEditPath->foregroundRole(), Qt::black); + } + else + { + bOk->setEnabled(false); + palette.setColor(ui->lineEditPath->foregroundRole(), Qt::red); + } + + ui->lineEditPath->setPalette(palette); +} diff --git a/src/app/dialogs/app/dialogsavelayout.h b/src/app/dialogs/app/dialogsavelayout.h new file mode 100644 index 000000000..a2f694034 --- /dev/null +++ b/src/app/dialogs/app/dialogsavelayout.h @@ -0,0 +1,64 @@ +/************************************************************************ + ** + ** @file dialogsavelayout.h + ** @author Roman Telezhynskyi + ** @date 22 1, 2015 + ** + ** @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-2015 Valentina project + ** 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 . + ** + *************************************************************************/ + +#ifndef DIALOGSAVELAYOUT_H +#define DIALOGSAVELAYOUT_H + +#include + +namespace Ui +{ + class DialogSaveLAyout; +} + +class DialogSaveLayout : public QDialog +{ + Q_OBJECT + +public: + DialogSaveLayout(const QMap &formates, int count, const QString &fileName = QString(), + QWidget *parent = 0); + ~DialogSaveLayout(); + + QString Path() const; + QString FileName() const; + QString Formate() const; + +public slots: + void Save(); + void ShowExample(); + void Browse(); + void PathChanged(const QString &text); + +private: + Q_DISABLE_COPY(DialogSaveLayout) + Ui::DialogSaveLAyout *ui; + int count; +}; + +#endif // DIALOGSAVELAYOUT_H diff --git a/src/app/dialogs/app/dialogsavelayout.ui b/src/app/dialogs/app/dialogsavelayout.ui new file mode 100644 index 000000000..ea4082c46 --- /dev/null +++ b/src/app/dialogs/app/dialogsavelayout.ui @@ -0,0 +1,140 @@ + + + DialogSaveLAyout + + + + 0 + 0 + 692 + 179 + + + + + 692 + 179 + + + + Dialog + + + + + + 0 + + + + + File name: + + + + + + + Path: + + + + + + + File format: + + + + + + + + + + + 0 + 0 + + + + Browse... + + + + + + + + 0 + 0 + + + + + + + + + + + + 130 + 0 + + + + TextLabel + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + buttonBox + accepted() + DialogSaveLAyout + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + DialogSaveLAyout + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/src/app/dialogs/app/dialogstandardmeasurements.cpp b/src/app/dialogs/app/dialogstandardmeasurements.cpp index 356074ed7..4ad4c72f9 100644 --- a/src/app/dialogs/app/dialogstandardmeasurements.cpp +++ b/src/app/dialogs/app/dialogstandardmeasurements.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -33,6 +33,7 @@ #include #include "../../xml/vstandardmeasurements.h" #include "../../core/vapplication.h" +#include "../../core/vsettings.h" #include "../../container/vcontainer.h" #include @@ -45,6 +46,8 @@ DialogStandardMeasurements::DialogStandardMeasurements(VContainer *data, const Q { ui->setupUi(this); + qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); + QRect position = this->frameGeometry(); position.moveCenter(QDesktopWidget().availableGeometry().center()); move(position.topLeft()); @@ -149,14 +152,16 @@ void DialogStandardMeasurements::LoadStandardTables() { qCDebug(vStMeasur)<<"Loading standard table."; QStringList filters{"*.vst"}; - QDir tablesDir(qApp->pathToTables()); + //Use standard path to standard measurements + const QString path = qApp->getSettings()->GetPathStandardMeasurements(); + QDir tablesDir(path); tablesDir.setNameFilters(filters); - tablesDir.setCurrent(qApp->pathToTables()); + tablesDir.setCurrent(path); const QStringList allFiles = tablesDir.entryList(QDir::NoDotAndDotDot | QDir::Files); if (allFiles.isEmpty() == true) { - qCDebug(vStMeasur)<<"Can't find standard measurements in path"<pathToTables(); + qCDebug(vStMeasur)<<"Can't find standard measurements in path"<comboBoxTables->clear(); CheckState(); return; @@ -178,16 +183,11 @@ void DialogStandardMeasurements::LoadStandardTables() } else { - const QString trDesc = qApp->STDescription(m.Id()); - if (trDesc.isEmpty() == false) + const QString desc = m.TrDescription(); + if (desc.isEmpty() == false) { - qCDebug(vStMeasur)<<"Adding user table from"<comboBoxTables->addItem(trDesc, QVariant(fi.absoluteFilePath())); - } - else if (m.Description().isEmpty() == false) - { - qCDebug(vStMeasur)<<"Adding table with id"<comboBoxTables->addItem(m.Description(), QVariant(fi.absoluteFilePath())); + qCDebug(vStMeasur)<<"Adding table from"<comboBoxTables->addItem(desc, QVariant(fi.absoluteFilePath())); } } } diff --git a/src/app/dialogs/app/dialogstandardmeasurements.h b/src/app/dialogs/app/dialogstandardmeasurements.h index 59d8c33e2..cc1785367 100644 --- a/src/app/dialogs/app/dialogstandardmeasurements.h +++ b/src/app/dialogs/app/dialogstandardmeasurements.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/app/dialogundo.cpp b/src/app/dialogs/app/dialogundo.cpp index 705adee55..4c396efa8 100644 --- a/src/app/dialogs/app/dialogundo.cpp +++ b/src/app/dialogs/app/dialogundo.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -39,6 +39,8 @@ DialogUndo::DialogUndo(QWidget *parent) { ui->setupUi(this); + qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); + bool opening = qApp->getOpeningPattern(); if (opening) { diff --git a/src/app/dialogs/app/dialogundo.h b/src/app/dialogs/app/dialogundo.h index d391e7696..93def2525 100644 --- a/src/app/dialogs/app/dialogundo.h +++ b/src/app/dialogs/app/dialogundo.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/dialogs.h b/src/app/dialogs/dialogs.h index e83eedc77..27195b696 100644 --- a/src/app/dialogs/dialogs.h +++ b/src/app/dialogs/dialogs.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/dialogs.pri b/src/app/dialogs/dialogs.pri index 8201e7386..0e684e367 100644 --- a/src/app/dialogs/dialogs.pri +++ b/src/app/dialogs/dialogs.pri @@ -41,7 +41,10 @@ HEADERS += \ $$PWD/app/configpages/communitypage.h \ $$PWD/app/configpages/pathpage.h \ $$PWD/app/dialogundo.h \ - $$PWD/tools/dialogcurveintersectaxis.h + $$PWD/tools/dialogcurveintersectaxis.h \ + $$PWD/app/dialoglayoutsettings.h \ + $$PWD/app/dialoglayoutprogress.h \ + dialogs/app/dialogsavelayout.h SOURCES += \ $$PWD/tools/dialogtriangle.cpp \ @@ -81,7 +84,10 @@ SOURCES += \ $$PWD/app/configpages/communitypage.cpp \ $$PWD/app/configpages/pathpage.cpp \ $$PWD/app/dialogundo.cpp \ - $$PWD/tools/dialogcurveintersectaxis.cpp + $$PWD/tools/dialogcurveintersectaxis.cpp \ + $$PWD/app/dialoglayoutsettings.cpp \ + $$PWD/app/dialoglayoutprogress.cpp \ + dialogs/app/dialogsavelayout.cpp FORMS += \ $$PWD/tools/dialogtriangle.ui \ @@ -115,4 +121,7 @@ FORMS += \ $$PWD/app/dialogaboutapp.ui \ $$PWD/app/dialogpatternxmledit.ui \ $$PWD/app/dialogundo.ui \ - $$PWD/tools/dialogcurveintersectaxis.ui + $$PWD/tools/dialogcurveintersectaxis.ui \ + $$PWD/app/dialoglayoutsettings.ui \ + $$PWD/app/dialoglayoutprogress.ui \ + dialogs/app/dialogsavelayout.ui diff --git a/src/app/dialogs/tools/dialogalongline.cpp b/src/app/dialogs/tools/dialogalongline.cpp index b818b2744..54a8dd1dc 100644 --- a/src/app/dialogs/tools/dialogalongline.cpp +++ b/src/app/dialogs/tools/dialogalongline.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -41,9 +41,8 @@ * @param parent parent widget */ DialogAlongLine::DialogAlongLine(const VContainer *data, const quint32 &toolId, QWidget *parent) - :DialogTool(data, toolId, parent), ui(new Ui::DialogAlongLine), number(0), - typeLine(QString()), formula(QString()), firstPointId(NULL_ID), secondPointId(NULL_ID), formulaBaseHeight(0), - line(nullptr) + :DialogTool(data, toolId, parent), ui(new Ui::DialogAlongLine), + formula(QString()), formulaBaseHeight(0), line(nullptr) { ui->setupUi(this); InitVariables(ui); @@ -60,12 +59,11 @@ DialogAlongLine::DialogAlongLine(const VContainer *data, const quint32 &toolId, FillComboBoxPoints(ui->comboBoxFirstPoint); FillComboBoxPoints(ui->comboBoxSecondPoint); - FillComboBoxTypeLine(ui->comboBoxLineType); - ui->comboBoxLineType->setCurrentIndex(0); + FillComboBoxTypeLine(ui->comboBoxLineType, VAbstractTool::LineStylesPics()); + FillComboBoxLineColors(ui->comboBoxLineColor); connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogAlongLine::PutHere); connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogAlongLine::NamePointChanged); - connect(ui->toolButtonEqual, &QPushButton::clicked, this, &DialogAlongLine::EvalFormula); connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogAlongLine::FormulaTextChanged); connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogAlongLine::DeployFormulaTextEdit); connect(listWidget, &QListWidget::itemDoubleClicked, this, &DialogTool::PutVal); @@ -180,16 +178,14 @@ void DialogAlongLine::ChosenObject(quint32 id, const SceneObject &type) void DialogAlongLine::SaveData() { pointName = ui->lineEditNamePoint->text(); - typeLine = GetTypeLine(ui->comboBoxLineType); + formula = ui->plainTextEditFormula->toPlainText(); formula.replace("\n", " "); - firstPointId = getCurrentObjectId(ui->comboBoxFirstPoint); - secondPointId = getCurrentObjectId(ui->comboBoxSecondPoint); - line->setPoint1Id(firstPointId); - line->setPoint2Id(secondPointId); + line->setPoint1Id(GetFirstPointId()); + line->setPoint2Id(GetSecondPointId()); line->setLength(formula); - line->setLineStyle(VAbstractTool::LineStyle(typeLine)); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(GetTypeLine())); line->RefreshGeometry(); } @@ -202,32 +198,32 @@ void DialogAlongLine::closeEvent(QCloseEvent *event) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setSecondPointId set id second point of line + * @brief SetSecondPointId set id second point of line * @param value id */ -void DialogAlongLine::setSecondPointId(const quint32 &value) +void DialogAlongLine::SetSecondPointId(const quint32 &value) { - setCurrentPointId(ui->comboBoxSecondPoint, secondPointId, value); + setCurrentPointId(ui->comboBoxSecondPoint, value); line->setPoint2Id(value); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setFirstPointId set id first point of line + * @brief SetFirstPointId set id first point of line * @param value id */ -void DialogAlongLine::setFirstPointId(const quint32 &value) +void DialogAlongLine::SetFirstPointId(const quint32 &value) { - setCurrentPointId(ui->comboBoxFirstPoint, firstPointId, value); + setCurrentPointId(ui->comboBoxFirstPoint, value); line->setPoint1Id(value); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setFormula set string of formula + * @brief SetFormula set string of formula * @param value formula */ -void DialogAlongLine::setFormula(const QString &value) +void DialogAlongLine::SetFormula(const QString &value) { formula = qApp->FormulaToUser(value); // increase height if needed. @@ -242,23 +238,74 @@ void DialogAlongLine::setFormula(const QString &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setTypeLine set type of line + * @brief SetTypeLine set type of line * @param value type */ -void DialogAlongLine::setTypeLine(const QString &value) +void DialogAlongLine::SetTypeLine(const QString &value) { - typeLine = value; - SetupTypeLine(ui->comboBoxLineType, value); - line->setLineStyle(VAbstractTool::LineStyle(typeLine)); + ChangeCurrentData(ui->comboBoxLineType, value); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(value)); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogAlongLine::GetLineColor() const +{ + return GetComboBoxCurrentData(ui->comboBoxLineColor); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogAlongLine::SetLineColor(const QString &value) +{ + ChangeCurrentData(ui->comboBoxLineColor, value); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setPointName set name of point + * @brief SetPointName set name of point * @param value name */ -void DialogAlongLine::setPointName(const QString &value) +void DialogAlongLine::SetPointName(const QString &value) { pointName = value; ui->lineEditNamePoint->setText(pointName); } + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetTypeLine return type of line + * @return type + */ +QString DialogAlongLine::GetTypeLine() const +{ + return GetComboBoxCurrentData(ui->comboBoxLineType); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetFormula return string of formula + * @return formula + */ +QString DialogAlongLine::GetFormula() const +{ + return qApp->FormulaFromUser(formula); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetFirstPointId return id first point of line + * @return id + */ +quint32 DialogAlongLine::GetFirstPointId() const +{ + return getCurrentObjectId(ui->comboBoxFirstPoint); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetSecondPointId return id second point of line + * @return id + */ +quint32 DialogAlongLine::GetSecondPointId() const +{ + return getCurrentObjectId(ui->comboBoxSecondPoint); +} diff --git a/src/app/dialogs/tools/dialogalongline.h b/src/app/dialogs/tools/dialogalongline.h index 01dd498a5..b82f23350 100644 --- a/src/app/dialogs/tools/dialogalongline.h +++ b/src/app/dialogs/tools/dialogalongline.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -47,20 +47,23 @@ class DialogAlongLine : public DialogTool public: DialogAlongLine(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogAlongLine(); - QString getPointName() const; - void setPointName(const QString &value); - QString getTypeLine() const; - void setTypeLine(const QString &value); + void SetPointName(const QString &value); - QString getFormula() const; - void setFormula(const QString &value); + QString GetTypeLine() const; + void SetTypeLine(const QString &value); - quint32 getFirstPointId() const; - void setFirstPointId(const quint32 &value); + QString GetLineColor() const; + void SetLineColor(const QString &value); - quint32 getSecondPointId() const; - void setSecondPointId(const quint32 &value); + QString GetFormula() const; + void SetFormula(const QString &value); + + quint32 GetFirstPointId() const; + void SetFirstPointId(const quint32 &value); + + quint32 GetSecondPointId() const; + void SetSecondPointId(const quint32 &value); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); /** @@ -85,74 +88,12 @@ private: /** @brief ui keeps information about user interface */ Ui::DialogAlongLine *ui; - /** @brief number number of handled objects */ - qint32 number; - - /** @brief typeLine type of line */ - QString typeLine; - /** @brief formula formula */ QString formula; - /** @brief firstPointId id first point of line */ - quint32 firstPointId; - - /** @brief secondPointId id second point of line */ - quint32 secondPointId; - /** @brief formulaBaseHeight base height defined by dialogui */ int formulaBaseHeight; VisToolAlongLine *line; }; -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getPointName return name of point - * @return name - */ -inline QString DialogAlongLine::getPointName() const -{ - return pointName; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getTypeLine return type of line - * @return type - */ -inline QString DialogAlongLine::getTypeLine() const -{ - return typeLine; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getFormula return string of formula - * @return formula - */ -inline QString DialogAlongLine::getFormula() const -{ - return qApp->FormulaFromUser(formula); -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getFirstPointId return id first point of line - * @return id - */ -inline quint32 DialogAlongLine::getFirstPointId() const -{ - return firstPointId; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getSecondPointId return id second point of line - * @return id - */ -inline quint32 DialogAlongLine::getSecondPointId() const -{ - return secondPointId; -} - #endif // DIALOGALONGLINE_H diff --git a/src/app/dialogs/tools/dialogalongline.ui b/src/app/dialogs/tools/dialogalongline.ui index ccefaa068..ee68fb65e 100644 --- a/src/app/dialogs/tools/dialogalongline.ui +++ b/src/app/dialogs/tools/dialogalongline.ui @@ -7,11 +7,11 @@ 0 0 428 - 499 + 532 - Point along line + Point at distance along line @@ -107,22 +107,12 @@ - - - Calculate value - + - ... + - - - :/icon/24x24/equal.png:/icon/24x24/equal.png - - - - 24 - 24 - + + :/icon/24x24/equal.png @@ -223,6 +213,9 @@ + + QFormLayout::AllNonFixedFieldsGrow + @@ -230,9 +223,6 @@ - - - @@ -276,11 +266,42 @@ 0 + + + 80 + 0 + + + + + 110 + 16777215 + + Show line from first point to this point + + + 80 + 14 + + + + + + Line color + + + + + + + + + @@ -445,7 +466,6 @@ plainTextEditFormula toolButtonPutHere - toolButtonEqual pushButtonGrowLength lineEditNamePoint comboBoxFirstPoint diff --git a/src/app/dialogs/tools/dialogarc.cpp b/src/app/dialogs/tools/dialogarc.cpp index 045f0c2be..9c5873356 100644 --- a/src/app/dialogs/tools/dialogarc.cpp +++ b/src/app/dialogs/tools/dialogarc.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -45,9 +45,9 @@ */ DialogArc::DialogArc(const VContainer *data, const quint32 &toolId, QWidget *parent) :DialogTool(data, toolId, parent), ui(new Ui::DialogArc), flagRadius(false), flagF1(false), flagF2(false), - timerRadius(nullptr), timerF1(nullptr), timerF2(nullptr), center(NULL_ID), radius(QString()), - f1(QString()), f2(QString()), formulaBaseHeight(0), formulaBaseHeightF1(0), formulaBaseHeightF2(0), path(nullptr), - angleF1(INT_MIN), angleF2(INT_MIN) + timerRadius(nullptr), timerF1(nullptr), timerF2(nullptr), radius(QString()), f1(QString()), f2(QString()), + formulaBaseHeight(0), formulaBaseHeightF1(0), formulaBaseHeightF2(0), path(nullptr), angleF1(INT_MIN), + angleF2(INT_MIN) { ui->setupUi(this); @@ -74,6 +74,7 @@ DialogArc::DialogArc(const VContainer *data, const quint32 &toolId, QWidget *par InitOkCancelApply(ui); FillComboBoxPoints(ui->comboBoxBasePoint); + FillComboBoxLineColors(ui->comboBoxColor); CheckState(); @@ -81,10 +82,6 @@ DialogArc::DialogArc(const VContainer *data, const quint32 &toolId, QWidget *par connect(ui->toolButtonPutHereF1, &QPushButton::clicked, this, &DialogArc::PutF1); connect(ui->toolButtonPutHereF2, &QPushButton::clicked, this, &DialogArc::PutF2); - connect(ui->toolButtonEqualRadius, &QPushButton::clicked, this, &DialogArc::EvalRadius); - connect(ui->toolButtonEqualF1, &QPushButton::clicked, this, &DialogArc::EvalF); - connect(ui->toolButtonEqualF2, &QPushButton::clicked, this, &DialogArc::EvalF); - connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogArc::RadiusChanged); connect(ui->plainTextEditF1, &QPlainTextEdit::textChanged, this, &DialogArc::F1Changed); connect(ui->plainTextEditF2, &QPlainTextEdit::textChanged, this, &DialogArc::F2Changed); @@ -131,9 +128,8 @@ DialogArc::~DialogArc() */ void DialogArc::SetCenter(const quint32 &value) { - center = value; - ChangeCurrentData(ui->comboBoxBasePoint, center); - path->setPoint1Id(center); + ChangeCurrentData(ui->comboBoxBasePoint, value); + path->setPoint1Id(value); } //--------------------------------------------------------------------------------------------------------------------- @@ -154,6 +150,18 @@ void DialogArc::SetF2(const QString &value) MoveCursorToEnd(ui->plainTextEditF2); } +//--------------------------------------------------------------------------------------------------------------------- +QString DialogArc::GetColor() const +{ + return GetComboBoxCurrentData(ui->comboBoxColor); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogArc::SetColor(const QString &value) +{ + ChangeCurrentData(ui->comboBoxColor, value); +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief SetF1 set formula first angle of arc @@ -179,7 +187,7 @@ void DialogArc::SetF1(const QString &value) */ void DialogArc::SetRadius(const QString &value) { - radius = value; + radius = qApp->FormulaToUser(value); // increase height if needed. if (radius.length() > 80) { @@ -234,9 +242,8 @@ void DialogArc::SaveData() f1.replace("\n", " "); f2 = ui->plainTextEditF2->toPlainText(); f2.replace("\n", " "); - center = getCurrentObjectId(ui->comboBoxBasePoint); - path->setPoint1Id(center); + path->setPoint1Id(GetCenter()); path->setRadius(radius); path->setF1(f1); path->setF2(f2); @@ -252,28 +259,6 @@ void DialogArc::closeEvent(QCloseEvent *event) DialogTool::closeEvent(event); } -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief ValChenged show description angles of lines - * @param row number of row - */ -void DialogArc::ValChenged(int row) -{ - if (ui->listWidget->count() == 0) - { - return; - } - QListWidgetItem *item = ui->listWidget->item( row ); - if (ui->radioButtonAngleLine->isChecked()) - { - qreal angle = *data->GetVariable(item->text())->GetValue(); - QString desc = QString("%1(%2) - %3").arg(item->text()).arg(angle).arg(tr("Value of angle of line.")); - ui->labelDescription->setText(desc); - return; - } - DialogTool::ValChenged(row); -} - //--------------------------------------------------------------------------------------------------------------------- /** * @brief PutRadius put variable into formula of radius @@ -436,3 +421,43 @@ void DialogArc::CheckAngles() DialogArc::CheckState(); } + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetCenter return id of center point + * @return id id + */ +quint32 DialogArc::GetCenter() const +{ + return getCurrentObjectId(ui->comboBoxBasePoint); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetRadius return formula of radius + * @return formula + */ +QString DialogArc::GetRadius() const +{ + return qApp->FormulaFromUser(radius); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetF1 return formula first angle of arc + * @return formula + */ +QString DialogArc::GetF1() const +{ + return qApp->FormulaFromUser(f1); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetF2 return formula second angle of arc + * @return formula + */ +QString DialogArc::GetF2() const +{ + return qApp->FormulaFromUser(f2); +} diff --git a/src/app/dialogs/tools/dialogarc.h b/src/app/dialogs/tools/dialogarc.h index 189e86abe..25143bcfd 100644 --- a/src/app/dialogs/tools/dialogarc.h +++ b/src/app/dialogs/tools/dialogarc.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -59,6 +59,9 @@ public: QString GetF2() const; void SetF2(const QString &value); + + QString GetColor() const; + void SetColor(const QString &value); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); /** @@ -67,7 +70,6 @@ public slots: void DeployFormulaTextEdit(); void DeployF1TextEdit(); void DeployF2TextEdit(); - virtual void ValChenged(int row); void PutRadius(); void PutF1(); void PutF2(); @@ -108,9 +110,6 @@ private: /** @brief timerF2 timer of check formula of second angle */ QTimer *timerF2; - /** @brief center id of center point */ - quint32 center; - /** @brief radius formula of radius */ QString radius; @@ -136,44 +135,4 @@ private: void CheckAngles(); }; -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief GetCenter return id of center point - * @return id id - */ -inline quint32 DialogArc::GetCenter() const -{ - return center; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief GetRadius return formula of radius - * @return formula - */ -inline QString DialogArc::GetRadius() const -{ - return radius; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief GetF1 return formula first angle of arc - * @return formula - */ -inline QString DialogArc::GetF1() const -{ - return f1; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief GetF2 return formula second angle of arc - * @return formula - */ -inline QString DialogArc::GetF2() const -{ - return f2; -} - #endif // DIALOGARC_H diff --git a/src/app/dialogs/tools/dialogarc.ui b/src/app/dialogs/tools/dialogarc.ui index 4bf89a0cc..74bb663a3 100644 --- a/src/app/dialogs/tools/dialogarc.ui +++ b/src/app/dialogs/tools/dialogarc.ui @@ -6,8 +6,8 @@ 0 0 - 423 - 544 + 425 + 577 @@ -107,22 +107,12 @@ - - - Calculate value - + - ... + - - - :/icon/24x24/equal.png:/icon/24x24/equal.png - - - - 24 - 24 - + + :/icon/24x24/equal.png @@ -295,22 +285,12 @@ - - - Calculate value - + - ... + - - - :/icon/24x24/equal.png:/icon/24x24/equal.png - - - - 24 - 24 - + + :/icon/24x24/equal.png @@ -354,6 +334,9 @@ 24 + + true + @@ -480,22 +463,12 @@ - - - Calculate value - + - ... + - - - :/icon/24x24/equal.png:/icon/24x24/equal.png - - - - 24 - 24 - + + :/icon/24x24/equal.png @@ -539,6 +512,9 @@ 24 + + true + @@ -583,32 +559,42 @@ - - - - - - - 0 - 0 - - - - Center point - - - - - - - Select point of center of arc - - - - - + + + + + + + 0 + 0 + + + + Center point + + + + + + + Select point of center of arc + + + + + + + + + + Color + + + + + @@ -774,15 +760,13 @@ plainTextEditFormula toolButtonPutHereRadius - toolButtonEqualRadius pushButtonGrowLength plainTextEditF1 toolButtonPutHereF1 - toolButtonEqualF1 pushButtonGrowLengthF1 + plainTextEditF2 toolButtonPutHereF2 - toolButtonEqualF2 - comboBoxBasePoint + pushButtonGrowLengthF2 radioButtonSizeGrowth radioButtonStandardTable radioButtonIncrements @@ -792,7 +776,8 @@ radioButtonAngleLine checkBoxHideEmpty listWidget - buttonBox + comboBoxBasePoint + comboBoxColor @@ -805,8 +790,8 @@ accept() - 248 - 254 + 257 + 567 157 @@ -821,8 +806,8 @@ reject() - 316 - 260 + 325 + 567 286 diff --git a/src/app/dialogs/tools/dialogbisector.cpp b/src/app/dialogs/tools/dialogbisector.cpp index 791ca123c..3320e63ba 100644 --- a/src/app/dialogs/tools/dialogbisector.cpp +++ b/src/app/dialogs/tools/dialogbisector.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -42,8 +42,7 @@ * @param parent parent widget */ DialogBisector::DialogBisector(const VContainer *data, const quint32 &toolId, QWidget *parent) - :DialogTool(data, toolId, parent), ui(new Ui::DialogBisector), number(0), typeLine(QString()), - formula(QString()), firstPointId(NULL_ID), secondPointId(NULL_ID), thirdPointId(NULL_ID), formulaBaseHeight(0), + :DialogTool(data, toolId, parent), ui(new Ui::DialogBisector), formula(QString()), formulaBaseHeight(0), line(nullptr) { ui->setupUi(this); @@ -60,13 +59,13 @@ DialogBisector::DialogBisector(const VContainer *data, const quint32 &toolId, QW FillComboBoxPoints(ui->comboBoxFirstPoint); FillComboBoxPoints(ui->comboBoxSecondPoint); - FillComboBoxTypeLine(ui->comboBoxLineType); + FillComboBoxTypeLine(ui->comboBoxLineType, VAbstractTool::LineStylesPics()); FillComboBoxPoints(ui->comboBoxThirdPoint); + FillComboBoxLineColors(ui->comboBoxLineColor); connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogBisector::PutHere); connect(listWidget, &QListWidget::itemDoubleClicked, this, &DialogBisector::PutVal); - connect(ui->toolButtonEqual, &QPushButton::clicked, this, &DialogBisector::EvalFormula); connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogBisector::NamePointChanged); connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogBisector::FormulaTextChanged); connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogBisector::DeployFormulaTextEdit); @@ -200,10 +199,10 @@ void DialogBisector::ChosenObject(quint32 id, const SceneObject &type) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setPointName set name of point + * @brief SetPointName set name of point * @param value name */ -void DialogBisector::setPointName(const QString &value) +void DialogBisector::SetPointName(const QString &value) { pointName = value; ui->lineEditNamePoint->setText(pointName); @@ -211,22 +210,21 @@ void DialogBisector::setPointName(const QString &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setTypeLine set type of line + * @brief SetTypeLine set type of line * @param value type */ -void DialogBisector::setTypeLine(const QString &value) +void DialogBisector::SetTypeLine(const QString &value) { - typeLine = value; - SetupTypeLine(ui->comboBoxLineType, value); - line->setLineStyle(VAbstractTool::LineStyle(typeLine)); + ChangeCurrentData(ui->comboBoxLineType, value); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(value)); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setFormula set string of formula + * @brief SetFormula set string of formula * @param value formula */ -void DialogBisector::setFormula(const QString &value) +void DialogBisector::SetFormula(const QString &value) { formula = qApp->FormulaToUser(value); // increase height if needed. @@ -241,53 +239,62 @@ void DialogBisector::setFormula(const QString &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setFirstPointId set id of first point + * @brief SetFirstPointId set id of first point * @param value id */ -void DialogBisector::setFirstPointId(const quint32 &value) +void DialogBisector::SetFirstPointId(const quint32 &value) { - setPointId(ui->comboBoxFirstPoint, firstPointId, value); - line->setPoint1Id(firstPointId); + setCurrentPointId(ui->comboBoxFirstPoint, value); + line->setPoint1Id(value); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setSecondPointId set id of second point + * @brief SetSecondPointId set id of second point * @param value id */ -void DialogBisector::setSecondPointId(const quint32 &value) +void DialogBisector::SetSecondPointId(const quint32 &value) { - setPointId(ui->comboBoxSecondPoint, secondPointId, value); - line->setPoint2Id(secondPointId); + setCurrentPointId(ui->comboBoxSecondPoint, value); + line->setPoint2Id(value); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setThirdPointId set id of third point + * @brief SetThirdPointId set id of third point * @param value id */ -void DialogBisector::setThirdPointId(const quint32 &value) +void DialogBisector::SetThirdPointId(const quint32 &value) { - setPointId(ui->comboBoxThirdPoint, thirdPointId, value); - line->setPoint3Id(thirdPointId); + setCurrentPointId(ui->comboBoxThirdPoint, value); + line->setPoint3Id(value); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogBisector::GetLineColor() const +{ + return GetComboBoxCurrentData(ui->comboBoxLineColor); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogBisector::SetLineColor(const QString &value) +{ + ChangeCurrentData(ui->comboBoxLineColor, value); } //--------------------------------------------------------------------------------------------------------------------- void DialogBisector::SaveData() { pointName = ui->lineEditNamePoint->text(); - typeLine = GetTypeLine(ui->comboBoxLineType); + formula = ui->plainTextEditFormula->toPlainText(); formula.replace("\n", " "); - firstPointId = getCurrentObjectId(ui->comboBoxFirstPoint); - secondPointId = getCurrentObjectId(ui->comboBoxSecondPoint); - thirdPointId = getCurrentObjectId(ui->comboBoxThirdPoint); - line->setPoint1Id(firstPointId); - line->setPoint2Id(secondPointId); - line->setPoint3Id(thirdPointId); + line->setPoint1Id(GetFirstPointId()); + line->setPoint2Id(GetSecondPointId()); + line->setPoint3Id(GetThirdPointId()); line->setLength(formula); - line->setLineStyle(VAbstractTool::LineStyle(typeLine)); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(GetTypeLine())); line->RefreshGeometry(); } @@ -297,3 +304,53 @@ void DialogBisector::closeEvent(QCloseEvent *event) ui->plainTextEditFormula->blockSignals(true); DialogTool::closeEvent(event); } + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetTypeLine return type of line + * @return type + */ +QString DialogBisector::GetTypeLine() const +{ + return GetComboBoxCurrentData(ui->comboBoxLineType); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetFormula return string of formula + * @return formula + */ +QString DialogBisector::GetFormula() const +{ + return qApp->FormulaFromUser(formula); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetFirstPointId return id of first point + * @return id + */ +quint32 DialogBisector::GetFirstPointId() const +{ + return getCurrentObjectId(ui->comboBoxFirstPoint); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetSecondPointId return id of second point + * @return id + */ +quint32 DialogBisector::GetSecondPointId() const +{ + return getCurrentObjectId(ui->comboBoxSecondPoint); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetThirdPointId return id of third point + * @return id + */ +quint32 DialogBisector::GetThirdPointId() const +{ + return getCurrentObjectId(ui->comboBoxThirdPoint); +} diff --git a/src/app/dialogs/tools/dialogbisector.h b/src/app/dialogs/tools/dialogbisector.h index 2cc69c2ca..b1a2d2316 100644 --- a/src/app/dialogs/tools/dialogbisector.h +++ b/src/app/dialogs/tools/dialogbisector.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -49,23 +49,25 @@ public: DialogBisector(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogBisector(); - QString getPointName() const; - void setPointName(const QString &value); + void SetPointName(const QString &value); - QString getTypeLine() const; - void setTypeLine(const QString &value); + QString GetTypeLine() const; + void SetTypeLine(const QString &value); - QString getFormula() const; - void setFormula(const QString &value); + QString GetFormula() const; + void SetFormula(const QString &value); - quint32 getFirstPointId() const; - void setFirstPointId(const quint32 &value); + quint32 GetFirstPointId() const; + void SetFirstPointId(const quint32 &value); - quint32 getSecondPointId() const; - void setSecondPointId(const quint32 &value); + quint32 GetSecondPointId() const; + void SetSecondPointId(const quint32 &value); - quint32 getThirdPointId() const; - void setThirdPointId(const quint32 &value); + quint32 GetThirdPointId() const; + void SetThirdPointId(const quint32 &value); + + QString GetLineColor() const; + void SetLineColor(const QString &value); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); /** @@ -90,88 +92,13 @@ private: /** @brief ui keeps information about user interface */ Ui::DialogBisector *ui; - /** @brief number number of handled objects */ - qint32 number; - - /** @brief typeLine type of line */ - QString typeLine; - /** @brief formula formula */ QString formula; - /** @brief firstPointId id of first point */ - quint32 firstPointId; - - /** @brief secondPointId id of second point */ - quint32 secondPointId; - - /** @brief thirdPointId id of third point */ - quint32 thirdPointId; - /** @brief formulaBaseHeight base height defined by dialogui */ int formulaBaseHeight; VisToolBisector *line; }; -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getPointName return name of point - * @return name - */ -inline QString DialogBisector::getPointName() const -{ - return pointName; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getTypeLine return type of line - * @return type - */ -inline QString DialogBisector::getTypeLine() const -{ - return typeLine; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getFormula return string of formula - * @return formula - */ -inline QString DialogBisector::getFormula() const -{ - return qApp->FormulaFromUser(formula); -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getFirstPointId return id of first point - * @return id - */ -inline quint32 DialogBisector::getFirstPointId() const -{ - return firstPointId; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getSecondPointId return id of second point - * @return id - */ -inline quint32 DialogBisector::getSecondPointId() const -{ - return secondPointId; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getThirdPointId return id of third point - * @return id - */ -inline quint32 DialogBisector::getThirdPointId() const -{ - return thirdPointId; -} - #endif // DIALOGBISECTOR_H diff --git a/src/app/dialogs/tools/dialogbisector.ui b/src/app/dialogs/tools/dialogbisector.ui index 3f81fc51f..ad16c980b 100644 --- a/src/app/dialogs/tools/dialogbisector.ui +++ b/src/app/dialogs/tools/dialogbisector.ui @@ -7,11 +7,11 @@ 0 0 428 - 532 + 565 - Bisector + Point along bisector @@ -104,22 +104,12 @@ - - - Calculate value - + - ... + - - - :/icon/24x24/equal.png:/icon/24x24/equal.png - - - - 24 - 24 - + + :/icon/24x24/equal.png @@ -302,11 +292,39 @@ + + + 80 + 0 + + + + + 110 + 16777215 + + Show line from second point to this point + + + 80 + 14 + + + + + + Line color + + + + + + @@ -477,7 +495,6 @@ plainTextEditFormula toolButtonPutHere - toolButtonEqual pushButtonGrowLength lineEditNamePoint comboBoxFirstPoint diff --git a/src/app/dialogs/tools/dialogcurveintersectaxis.cpp b/src/app/dialogs/tools/dialogcurveintersectaxis.cpp index 17c5f87bd..350815bda 100644 --- a/src/app/dialogs/tools/dialogcurveintersectaxis.cpp +++ b/src/app/dialogs/tools/dialogcurveintersectaxis.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -38,8 +38,8 @@ //--------------------------------------------------------------------------------------------------------------------- DialogCurveIntersectAxis::DialogCurveIntersectAxis(const VContainer *data, const quint32 &toolId, QWidget *parent) - :DialogTool(data, toolId, parent), ui(new Ui::DialogCurveIntersectAxis), number(0), typeLine(QString()), - formulaAngle(QString()), basePointId(NULL_ID), curveId(NULL_ID), formulaBaseHeightAngle(0), line(nullptr) + :DialogTool(data, toolId, parent), ui(new Ui::DialogCurveIntersectAxis), + formulaAngle(QString()), formulaBaseHeightAngle(0), line(nullptr) { ui->setupUi(this); @@ -56,11 +56,11 @@ DialogCurveIntersectAxis::DialogCurveIntersectAxis(const VContainer *data, const FillComboBoxPoints(ui->comboBoxAxisPoint); FillComboBoxCurves(ui->comboBoxCurve); - FillComboBoxTypeLine(ui->comboBoxLineType); + FillComboBoxTypeLine(ui->comboBoxLineType, VAbstractTool::LineStylesPics()); + FillComboBoxLineColors(ui->comboBoxLineColor); connect(ui->toolButtonPutHereAngle, &QPushButton::clicked, this, &DialogCurveIntersectAxis::PutAngle); connect(listWidget, &QListWidget::itemDoubleClicked, this, &DialogCurveIntersectAxis::PutVal); - connect(ui->toolButtonEqualAngle, &QPushButton::clicked, this, &DialogCurveIntersectAxis::EvalAngle); connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogCurveIntersectAxis::NamePointChanged); connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogCurveIntersectAxis::AngleTextChanged); connect(ui->pushButtonGrowLengthAngle, &QPushButton::clicked, this, &DialogCurveIntersectAxis::DeployAngleTextEdit); @@ -80,40 +80,33 @@ DialogCurveIntersectAxis::~DialogCurveIntersectAxis() } //--------------------------------------------------------------------------------------------------------------------- -QString DialogCurveIntersectAxis::getPointName() const -{ - return pointName; -} - -//--------------------------------------------------------------------------------------------------------------------- -void DialogCurveIntersectAxis::setPointName(const QString &value) +void DialogCurveIntersectAxis::SetPointName(const QString &value) { pointName = value; ui->lineEditNamePoint->setText(pointName); } //--------------------------------------------------------------------------------------------------------------------- -QString DialogCurveIntersectAxis::getTypeLine() const +QString DialogCurveIntersectAxis::GetTypeLine() const { - return typeLine; + return GetComboBoxCurrentData(ui->comboBoxLineType); } //--------------------------------------------------------------------------------------------------------------------- -void DialogCurveIntersectAxis::setTypeLine(const QString &value) +void DialogCurveIntersectAxis::SetTypeLine(const QString &value) { - typeLine = value; - SetupTypeLine(ui->comboBoxLineType, value); - line->setLineStyle(VAbstractTool::LineStyle(typeLine)); + ChangeCurrentData(ui->comboBoxLineType, value); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(value)); } //--------------------------------------------------------------------------------------------------------------------- -QString DialogCurveIntersectAxis::getAngle() const +QString DialogCurveIntersectAxis::GetAngle() const { return qApp->FormulaFromUser(formulaAngle); } //--------------------------------------------------------------------------------------------------------------------- -void DialogCurveIntersectAxis::setAngle(const QString &value) +void DialogCurveIntersectAxis::SetAngle(const QString &value) { formulaAngle = qApp->FormulaToUser(value); // increase height if needed. TODO : see if I can get the max number of caracters in one line @@ -123,36 +116,48 @@ void DialogCurveIntersectAxis::setAngle(const QString &value) this->DeployAngleTextEdit(); } ui->plainTextEditFormula->setPlainText(formulaAngle); - line->setAngle(formulaAngle); + line->SetAngle(formulaAngle); MoveCursorToEnd(ui->plainTextEditFormula); } //--------------------------------------------------------------------------------------------------------------------- -quint32 DialogCurveIntersectAxis::getBasePointId() const +quint32 DialogCurveIntersectAxis::GetBasePointId() const { - return basePointId; + return getCurrentObjectId(ui->comboBoxAxisPoint); } //--------------------------------------------------------------------------------------------------------------------- -void DialogCurveIntersectAxis::setBasePointId(const quint32 &value) +void DialogCurveIntersectAxis::SetBasePointId(const quint32 &value) { - setCurrentPointId(ui->comboBoxAxisPoint, basePointId, value); + setCurrentPointId(ui->comboBoxAxisPoint, value); line->setAxisPointId(value); } //--------------------------------------------------------------------------------------------------------------------- quint32 DialogCurveIntersectAxis::getCurveId() const { - return curveId; + return getCurrentObjectId(ui->comboBoxCurve); } //--------------------------------------------------------------------------------------------------------------------- void DialogCurveIntersectAxis::setCurveId(const quint32 &value) { - setCurrentCurveId(ui->comboBoxCurve, curveId, value); + setCurrentCurveId(ui->comboBoxCurve, value); line->setPoint1Id(value); } +//--------------------------------------------------------------------------------------------------------------------- +QString DialogCurveIntersectAxis::GetLineColor() const +{ + return GetComboBoxCurrentData(ui->comboBoxLineColor); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogCurveIntersectAxis::SetLineColor(const QString &value) +{ + ChangeCurrentData(ui->comboBoxLineColor, value); +} + //--------------------------------------------------------------------------------------------------------------------- void DialogCurveIntersectAxis::ShowDialog(bool click) { @@ -163,7 +168,7 @@ void DialogCurveIntersectAxis::ShowDialog(bool click) /*We will ignore click if poinet is in point circle*/ VMainGraphicsScene *scene = qApp->getCurrentScene(); SCASSERT(scene != nullptr); - const QSharedPointer point = data->GeometricObject(basePointId); + const QSharedPointer point = data->GeometricObject(GetBasePointId()); QLineF line = QLineF(point->toQPointF(), scene->getScenePos()); //Radius of point circle, but little bigger. Need handle with hover sizes. @@ -174,7 +179,7 @@ void DialogCurveIntersectAxis::ShowDialog(bool click) } } this->setModal(true); - this->setAngle(line->Angle());//Show in dialog angle what user choose + this->SetAngle(line->Angle());//Show in dialog angle what user choose emit ToolTip(""); timerFormula->start(); this->show(); @@ -204,7 +209,6 @@ void DialogCurveIntersectAxis::ChosenObject(quint32 id, const SceneObject &type) { if (SetObject(id, ui->comboBoxAxisPoint, "")) { - basePointId = id; line->setAxisPointId(id); line->RefreshGeometry(); prepare = true; @@ -258,18 +262,14 @@ void DialogCurveIntersectAxis::ShowVisualization() void DialogCurveIntersectAxis::SaveData() { pointName = ui->lineEditNamePoint->text(); - typeLine = GetTypeLine(ui->comboBoxLineType); formulaAngle = ui->plainTextEditFormula->toPlainText(); formulaAngle.replace("\n", " "); - basePointId = getCurrentObjectId(ui->comboBoxAxisPoint); - curveId = getCurrentObjectId(ui->comboBoxCurve); - - line->setPoint1Id(curveId); - line->setAxisPointId(basePointId); - line->setAngle(formulaAngle); - line->setLineStyle(VAbstractTool::LineStyle(typeLine)); + line->setPoint1Id(getCurveId()); + line->setAxisPointId(GetBasePointId()); + line->SetAngle(formulaAngle); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(GetTypeLine())); line->RefreshGeometry(); } diff --git a/src/app/dialogs/tools/dialogcurveintersectaxis.h b/src/app/dialogs/tools/dialogcurveintersectaxis.h index 9ab667062..7b9164229 100644 --- a/src/app/dialogs/tools/dialogcurveintersectaxis.h +++ b/src/app/dialogs/tools/dialogcurveintersectaxis.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -45,21 +45,23 @@ public: DialogCurveIntersectAxis(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogCurveIntersectAxis(); - QString getPointName() const; - void setPointName(const QString &value); + void SetPointName(const QString &value); - QString getTypeLine() const; - void setTypeLine(const QString &value); + QString GetTypeLine() const; + void SetTypeLine(const QString &value); - QString getAngle() const; - void setAngle(const QString &value); + QString GetAngle() const; + void SetAngle(const QString &value); - quint32 getBasePointId() const; - void setBasePointId(const quint32 &value); + quint32 GetBasePointId() const; + void SetBasePointId(const quint32 &value); quint32 getCurveId() const; void setCurveId(const quint32 &value); + QString GetLineColor() const; + void SetLineColor(const QString &value); + virtual void ShowDialog(bool click); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); @@ -78,15 +80,7 @@ private: Q_DISABLE_COPY(DialogCurveIntersectAxis) Ui::DialogCurveIntersectAxis *ui; - /** @brief number number of handled objects */ - qint32 number; - - /** @brief typeLine type of line */ - QString typeLine; - QString formulaAngle; - quint32 basePointId; - quint32 curveId; int formulaBaseHeightAngle; VisToolCurveIntersectAxis *line; diff --git a/src/app/dialogs/tools/dialogcurveintersectaxis.ui b/src/app/dialogs/tools/dialogcurveintersectaxis.ui index 4fe305a4f..f8fb02023 100644 --- a/src/app/dialogs/tools/dialogcurveintersectaxis.ui +++ b/src/app/dialogs/tools/dialogcurveintersectaxis.ui @@ -7,11 +7,11 @@ 0 0 419 - 499 + 532 - Curve intersect axis + Point intersect curve and axis @@ -97,22 +97,12 @@ - - - Calculate value - + - ... + - - - :/icon/24x24/equal.png:/icon/24x24/equal.png - - - - 24 - 24 - + + :/icon/24x24/equal.png @@ -229,7 +219,7 @@ - First point of line + Axis Point @@ -249,7 +239,7 @@ - First point of line + Curve @@ -285,11 +275,39 @@ + + + 80 + 0 + + + + + 110 + 16777215 + + Show line from first point to this point + + + 80 + 14 + + + + + + Line color + + + + + + @@ -463,7 +481,6 @@ plainTextEditFormula toolButtonPutHereAngle - toolButtonEqualAngle pushButtonGrowLengthAngle comboBoxAxisPoint comboBoxCurve diff --git a/src/app/dialogs/tools/dialogcutarc.cpp b/src/app/dialogs/tools/dialogcutarc.cpp index 247e02dd2..42ebb92f0 100644 --- a/src/app/dialogs/tools/dialogcutarc.cpp +++ b/src/app/dialogs/tools/dialogcutarc.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -42,8 +42,8 @@ * @param parent parent widget */ DialogCutArc::DialogCutArc(const VContainer *data, const quint32 &toolId, QWidget *parent) - : DialogTool(data, toolId, parent), ui(new Ui::DialogCutArc), formula(QString()), - arcId(NULL_ID), formulaBaseHeight(0), path(nullptr) + : DialogTool(data, toolId, parent), ui(new Ui::DialogCutArc), formula(QString()), formulaBaseHeight(0), + path(nullptr) { ui->setupUi(this); InitVariables(ui); @@ -58,11 +58,11 @@ DialogCutArc::DialogCutArc(const VContainer *data, const quint32 &toolId, QWidge CheckState(); FillComboBoxArcs(ui->comboBoxArc); + FillComboBoxLineColors(ui->comboBoxColor); connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogCutArc::PutHere); connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogCutArc::PutVal); - connect(ui->toolButtonEqual, &QPushButton::clicked, this, &DialogCutArc::EvalFormula); connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogCutArc::NamePointChanged); connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogCutArc::FormulaTextChanged); connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogCutArc::DeployFormulaTextEdit); @@ -133,9 +133,8 @@ void DialogCutArc::SaveData() pointName = ui->lineEditNamePoint->text(); formula = ui->plainTextEditFormula->toPlainText(); formula.replace("\n", " "); - arcId = getCurrentObjectId(ui->comboBoxArc); - path->setPoint1Id(arcId); + path->setPoint1Id(getArcId()); path->setLength(formula); path->RefreshGeometry(); } @@ -154,16 +153,28 @@ void DialogCutArc::closeEvent(QCloseEvent *event) */ void DialogCutArc::setArcId(const quint32 &value) { - setCurrentArcId(ui->comboBoxArc, arcId, value, ComboBoxCutArc::CutArc); - path->setPoint1Id(arcId); + setCurrentArcId(ui->comboBoxArc, value, ComboBoxCutArc::CutArc); + path->setPoint1Id(value); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogCutArc::GetColor() const +{ + return GetComboBoxCurrentData(ui->comboBoxColor); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogCutArc::SetColor(const QString &value) +{ + ChangeCurrentData(ui->comboBoxColor, value); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setFormula set string with formula length + * @brief SetFormula set string with formula length * @param value string with formula */ -void DialogCutArc::setFormula(const QString &value) +void DialogCutArc::SetFormula(const QString &value) { formula = qApp->FormulaToUser(value); // increase height if needed. @@ -178,10 +189,10 @@ void DialogCutArc::setFormula(const QString &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setPointName set name point on arc + * @brief SetPointName set name point on arc * @param value name */ -void DialogCutArc::setPointName(const QString &value) +void DialogCutArc::SetPointName(const QString &value) { pointName = value; ui->lineEditNamePoint->setText(pointName); @@ -189,10 +200,20 @@ void DialogCutArc::setPointName(const QString &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getFormula return string with formula length + * @brief GetFormula return string with formula length * @return formula */ -QString DialogCutArc::getFormula() const +QString DialogCutArc::GetFormula() const { return qApp->FormulaFromUser(formula); } + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getArcId return id of arc + * @return id + */ +quint32 DialogCutArc::getArcId() const +{ + return getCurrentObjectId(ui->comboBoxArc); +} diff --git a/src/app/dialogs/tools/dialogcutarc.h b/src/app/dialogs/tools/dialogcutarc.h index d2cf2f288..68df14c06 100644 --- a/src/app/dialogs/tools/dialogcutarc.h +++ b/src/app/dialogs/tools/dialogcutarc.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -49,14 +49,16 @@ public: DialogCutArc(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogCutArc(); - QString getPointName() const; - void setPointName(const QString &value); + void SetPointName(const QString &value); - QString getFormula() const; - void setFormula(const QString &value); + QString GetFormula() const; + void SetFormula(const QString &value); quint32 getArcId() const; void setArcId(const quint32 &value); + + QString GetColor() const; + void SetColor(const QString &value); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); /** @@ -82,33 +84,10 @@ private: /** @brief formula string with formula */ QString formula; - /** @brief arcId keep id of arc */ - quint32 arcId; - /** @brief formulaBaseHeight base height defined by dialogui */ int formulaBaseHeight; VisToolCutArc *path; }; -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getPointName return name point on arc - * @return name - */ -inline QString DialogCutArc::getPointName() const -{ - return pointName; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getArcId return id of arc - * @return id - */ -inline quint32 DialogCutArc::getArcId() const -{ - return arcId; -} - #endif // DIALOGCUTARC_H diff --git a/src/app/dialogs/tools/dialogcutarc.ui b/src/app/dialogs/tools/dialogcutarc.ui index 8313e5784..16732646b 100644 --- a/src/app/dialogs/tools/dialogcutarc.ui +++ b/src/app/dialogs/tools/dialogcutarc.ui @@ -7,11 +7,11 @@ 0 0 412 - 433 + 466 - Cut arc + Segment an arc @@ -101,22 +101,12 @@ - - - Calculate value - + - ... + - - - :/icon/24x24/equal.png:/icon/24x24/equal.png - - - - 24 - 24 - + + :/icon/24x24/equal.png @@ -230,7 +220,7 @@ - Selected curve + Selected arc @@ -250,6 +240,16 @@ + + + + Color + + + + + + @@ -417,7 +417,6 @@ plainTextEditFormula toolButtonPutHere - toolButtonEqual pushButtonGrowLength comboBoxArc lineEditNamePoint diff --git a/src/app/dialogs/tools/dialogcutspline.cpp b/src/app/dialogs/tools/dialogcutspline.cpp index 7ed289dcc..e1bb786a1 100644 --- a/src/app/dialogs/tools/dialogcutspline.cpp +++ b/src/app/dialogs/tools/dialogcutspline.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -41,8 +41,8 @@ * @param parent parent widget */ DialogCutSpline::DialogCutSpline(const VContainer *data, const quint32 &toolId, QWidget *parent) - :DialogTool(data, toolId, parent), ui(new Ui::DialogCutSpline), formula(QString()), - splineId(NULL_ID), formulaBaseHeight(0), path(nullptr) + :DialogTool(data, toolId, parent), ui(new Ui::DialogCutSpline), formula(QString()), formulaBaseHeight(0), + path(nullptr) { ui->setupUi(this); InitVariables(ui); @@ -57,10 +57,10 @@ DialogCutSpline::DialogCutSpline(const VContainer *data, const quint32 &toolId, CheckState(); FillComboBoxSplines(ui->comboBoxSpline); + FillComboBoxLineColors(ui->comboBoxColor); connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogCutSpline::PutHere); connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogCutSpline::PutVal); - connect(ui->toolButtonEqual, &QPushButton::clicked, this, &DialogCutSpline::EvalFormula); connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogCutSpline::NamePointChanged); connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogCutSpline::FormulaChanged); connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogCutSpline::DeployFormulaTextEdit); @@ -80,10 +80,10 @@ DialogCutSpline::~DialogCutSpline() //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setPointName set name of point + * @brief SetPointName set name of point * @param value name */ -void DialogCutSpline::setPointName(const QString &value) +void DialogCutSpline::SetPointName(const QString &value) { pointName = value; ui->lineEditNamePoint->setText(pointName); @@ -91,10 +91,10 @@ void DialogCutSpline::setPointName(const QString &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setFormula set string of formula + * @brief SetFormula set string of formula * @param value formula */ -void DialogCutSpline::setFormula(const QString &value) +void DialogCutSpline::SetFormula(const QString &value) { formula = qApp->FormulaToUser(value); // increase height if needed. TODO : see if I can get the max number of caracters in one line @@ -115,8 +115,20 @@ void DialogCutSpline::setFormula(const QString &value) */ void DialogCutSpline::setSplineId(const quint32 &value) { - setCurrentSplineId(ui->comboBoxSpline, splineId, value, ComboBoxCutSpline::CutSpline); - path->setPoint1Id(splineId); + setCurrentSplineId(ui->comboBoxSpline, value, ComboBoxCutSpline::CutSpline); + path->setPoint1Id(value); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogCutSpline::GetColor() const +{ + return GetComboBoxCurrentData(ui->comboBoxColor); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogCutSpline::SetColor(const QString &value) +{ + ChangeCurrentData(ui->comboBoxColor, value); } //--------------------------------------------------------------------------------------------------------------------- @@ -148,9 +160,8 @@ void DialogCutSpline::SaveData() pointName = ui->lineEditNamePoint->text(); formula = ui->plainTextEditFormula->toPlainText(); formula.replace("\n", " "); - splineId = getCurrentObjectId(ui->comboBoxSpline); - path->setPoint1Id(splineId); + path->setPoint1Id(getSplineId()); path->setLength(formula); path->RefreshGeometry(); } @@ -179,3 +190,23 @@ void DialogCutSpline::ShowVisualization() path->RefreshGeometry(); } } + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetFormula return string of formula + * @return formula + */ +QString DialogCutSpline::GetFormula() const +{ + return qApp->FormulaFromUser(formula); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getSplineId return id base point of line + * @return id + */ +quint32 DialogCutSpline::getSplineId() const +{ + return getCurrentObjectId(ui->comboBoxSpline); +} diff --git a/src/app/dialogs/tools/dialogcutspline.h b/src/app/dialogs/tools/dialogcutspline.h index 163d703c0..590788d14 100644 --- a/src/app/dialogs/tools/dialogcutspline.h +++ b/src/app/dialogs/tools/dialogcutspline.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -48,14 +48,16 @@ public: DialogCutSpline(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogCutSpline(); - QString getPointName() const; - void setPointName(const QString &value); + void SetPointName(const QString &value); - QString getFormula() const; - void setFormula(const QString &value); + QString GetFormula() const; + void SetFormula(const QString &value); quint32 getSplineId() const; void setSplineId(const quint32 &value); + + QString GetColor() const; + void SetColor(const QString &value); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); /** @@ -78,43 +80,10 @@ private: /** @brief formula string with formula */ QString formula; - /** @brief splineId keep id of spline */ - quint32 splineId; - /** @brief formulaBaseHeight base height defined by dialogui */ int formulaBaseHeight; VisToolCutSpline *path; }; -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getPointName return name of point - * @return name - */ -inline QString DialogCutSpline::getPointName() const -{ - return pointName; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getFormula return string of formula - * @return formula - */ -inline QString DialogCutSpline::getFormula() const -{ - return qApp->FormulaFromUser(formula); -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getSplineId return id base point of line - * @return id - */ -inline quint32 DialogCutSpline::getSplineId() const -{ - return splineId; -} - #endif // DIALOGCUTSPLINE_H diff --git a/src/app/dialogs/tools/dialogcutspline.ui b/src/app/dialogs/tools/dialogcutspline.ui index 3107db846..04eb98776 100644 --- a/src/app/dialogs/tools/dialogcutspline.ui +++ b/src/app/dialogs/tools/dialogcutspline.ui @@ -7,11 +7,11 @@ 0 0 412 - 433 + 466 - Cut curve + Segmenting a simple curve @@ -101,22 +101,12 @@ - - - Calculate value - + - ... + - - - :/icon/24x24/equal.png:/icon/24x24/equal.png - - - - 24 - 24 - + + :/icon/24x24/equal.png @@ -217,7 +207,7 @@ - + 0 0 @@ -237,7 +227,7 @@ - + 0 0 @@ -250,6 +240,16 @@ + + + + Color + + + + + + @@ -417,7 +417,6 @@ plainTextEditFormula toolButtonPutHere - toolButtonEqual pushButtonGrowLength comboBoxSpline lineEditNamePoint diff --git a/src/app/dialogs/tools/dialogcutsplinepath.cpp b/src/app/dialogs/tools/dialogcutsplinepath.cpp index 6367feae9..0626b3252 100644 --- a/src/app/dialogs/tools/dialogcutsplinepath.cpp +++ b/src/app/dialogs/tools/dialogcutsplinepath.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -41,8 +41,8 @@ * @param parent parent widget */ DialogCutSplinePath::DialogCutSplinePath(const VContainer *data, const quint32 &toolId, QWidget *parent) - :DialogTool(data, toolId, parent), ui(new Ui::DialogCutSplinePath), formula(QString()), - splinePathId(NULL_ID), formulaBaseHeight(0), path(nullptr) + :DialogTool(data, toolId, parent), ui(new Ui::DialogCutSplinePath), formula(QString()), formulaBaseHeight(0), + path(nullptr) { ui->setupUi(this); InitVariables(ui); @@ -57,10 +57,10 @@ DialogCutSplinePath::DialogCutSplinePath(const VContainer *data, const quint32 & CheckState(); FillComboBoxSplinesPath(ui->comboBoxSplinePath); + FillComboBoxLineColors(ui->comboBoxColor); connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogCutSplinePath::PutHere); connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogCutSplinePath::PutVal); - connect(ui->toolButtonEqual, &QPushButton::clicked, this, &DialogCutSplinePath::EvalFormula); connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogCutSplinePath::NamePointChanged); connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogCutSplinePath::FormulaChanged); connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogCutSplinePath::DeployFormulaTextEdit); @@ -80,10 +80,10 @@ DialogCutSplinePath::~DialogCutSplinePath() //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setPointName set name of point + * @brief SetPointName set name of point * @param value name */ -void DialogCutSplinePath::setPointName(const QString &value) +void DialogCutSplinePath::SetPointName(const QString &value) { pointName = value; ui->lineEditNamePoint->setText(pointName); @@ -91,10 +91,10 @@ void DialogCutSplinePath::setPointName(const QString &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setFormula set string of formula + * @brief SetFormula set string of formula * @param value formula */ -void DialogCutSplinePath::setFormula(const QString &value) +void DialogCutSplinePath::SetFormula(const QString &value) { formula = qApp->FormulaToUser(value); // increase height if needed. TODO : see if I can get the max number of caracters in one line @@ -115,8 +115,20 @@ void DialogCutSplinePath::setFormula(const QString &value) */ void DialogCutSplinePath::setSplinePathId(const quint32 &value) { - setCurrentSplinePathId(ui->comboBoxSplinePath, splinePathId, value, ComboBoxCutSpline::CutSpline); - path->setPoint1Id(splinePathId); + setCurrentSplinePathId(ui->comboBoxSplinePath, value, ComboBoxCutSpline::CutSpline); + path->setPoint1Id(value); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogCutSplinePath::GetColor() const +{ + return GetComboBoxCurrentData(ui->comboBoxColor); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogCutSplinePath::SetColor(const QString &value) +{ + ChangeCurrentData(ui->comboBoxColor, value); } //--------------------------------------------------------------------------------------------------------------------- @@ -148,9 +160,8 @@ void DialogCutSplinePath::SaveData() pointName = ui->lineEditNamePoint->text(); formula = ui->plainTextEditFormula->toPlainText(); formula.replace("\n", " "); - splinePathId = getCurrentObjectId(ui->comboBoxSplinePath); - path->setPoint1Id(splinePathId); + path->setPoint1Id(getSplinePathId()); path->setLength(formula); path->RefreshGeometry(); } @@ -179,3 +190,23 @@ void DialogCutSplinePath::ShowVisualization() path->RefreshGeometry(); } } + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetFormula return string of formula + * @return formula + */ +QString DialogCutSplinePath::GetFormula() const +{ + return qApp->FormulaFromUser(formula); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getSplineId return id base point of line + * @return id + */ +quint32 DialogCutSplinePath::getSplinePathId() const +{ + return getCurrentObjectId(ui->comboBoxSplinePath); +} diff --git a/src/app/dialogs/tools/dialogcutsplinepath.h b/src/app/dialogs/tools/dialogcutsplinepath.h index 063cd316b..396dc73db 100644 --- a/src/app/dialogs/tools/dialogcutsplinepath.h +++ b/src/app/dialogs/tools/dialogcutsplinepath.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -48,14 +48,16 @@ public: DialogCutSplinePath(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogCutSplinePath(); - QString getPointName() const; - void setPointName(const QString &value); + void SetPointName(const QString &value); - QString getFormula() const; - void setFormula(const QString &value); + QString GetFormula() const; + void SetFormula(const QString &value); quint32 getSplinePathId() const; void setSplinePathId(const quint32 &value); + + QString GetColor() const; + void SetColor(const QString &value); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); /** @@ -78,43 +80,10 @@ private: /** @brief formula string with formula */ QString formula; - /** @brief splinePathId keep id of splinePath */ - quint32 splinePathId; - /** @brief formulaBaseHeight base height defined by dialogui */ int formulaBaseHeight; VisToolCutSplinePath *path; }; -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getPointName return name of point - * @return name - */ -inline QString DialogCutSplinePath::getPointName() const -{ - return pointName; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getFormula return string of formula - * @return formula - */ -inline QString DialogCutSplinePath::getFormula() const -{ - return qApp->FormulaFromUser(formula); -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getSplineId return id base point of line - * @return id - */ -inline quint32 DialogCutSplinePath::getSplinePathId() const -{ - return splinePathId; -} - #endif // DIALOGCUTSPLINEPATH_H diff --git a/src/app/dialogs/tools/dialogcutsplinepath.ui b/src/app/dialogs/tools/dialogcutsplinepath.ui index f5d497074..9638d9f63 100644 --- a/src/app/dialogs/tools/dialogcutsplinepath.ui +++ b/src/app/dialogs/tools/dialogcutsplinepath.ui @@ -7,11 +7,11 @@ 0 0 412 - 433 + 466 - Cut curve path + Segment a curved path @@ -101,22 +101,12 @@ - - - Calculate value - + - ... + - - - :/icon/24x24/equal.png:/icon/24x24/equal.png - - - - 24 - 24 - + + :/icon/24x24/equal.png @@ -217,7 +207,7 @@ - + 0 0 @@ -237,7 +227,7 @@ - + 0 0 @@ -250,6 +240,22 @@ + + + + + 0 + 0 + + + + Color + + + + + + @@ -417,7 +423,6 @@ plainTextEditFormula toolButtonPutHere - toolButtonEqual pushButtonGrowLength comboBoxSplinePath lineEditNamePoint diff --git a/src/app/dialogs/tools/dialogdetail.cpp b/src/app/dialogs/tools/dialogdetail.cpp index 4605084a4..4a0dd4a27 100644 --- a/src/app/dialogs/tools/dialogdetail.cpp +++ b/src/app/dialogs/tools/dialogdetail.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -35,6 +35,7 @@ #include "../../geometry/vsplinepath.h" #include "../../container/vcontainer.h" #include "../../libs/ifc/xml/vdomdocument.h" +#include "../../xml/vabstractmeasurements.h" //--------------------------------------------------------------------------------------------------------------------- /** @@ -43,7 +44,7 @@ * @param parent parent widget */ DialogDetail::DialogDetail(const VContainer *data, const quint32 &toolId, QWidget *parent) - :DialogTool(data, toolId, parent), ui(), details(VDetail()), supplement(true), closed(true) + :DialogTool(data, toolId, parent), ui(), detail(VDetail()), supplement(true), closed(true) { ui.setupUi(this); labelEditNamePoint = ui.labelEditNameDetail; @@ -51,6 +52,9 @@ DialogDetail::DialogDetail(const VContainer *data, const quint32 &toolId, QWidge ui.labelUnitX->setText(VDomDocument::UnitsToStr(qApp->patternUnit(), true)); ui.labelUnitY->setText(VDomDocument::UnitsToStr(qApp->patternUnit(), true)); + // Default value for seam allowence is 1 cm. But pattern have different units, so just set 1 in dialog not enough. + ui.doubleSpinBoxSeams->setValue(VAbstractMeasurements::UnitConvertor(1, Unit::Cm, qApp->patternUnit())); + bOk = ui.buttonBox->button(QDialogButtonBox::Ok); SCASSERT(bOk != nullptr); connect(bOk, &QPushButton::clicked, this, &DialogTool::DialogAccepted); @@ -106,7 +110,22 @@ void DialogDetail::ChosenObject(quint32 id, const SceneObject &type) qDebug()<setEnabled(true); + + if (ui.listWidget->count() > 0) + { + EnableObjectGUI(true); + } + + if (CreateDetail().ContourPoints(data).size() < 3) + { + ValidObjects(false); + } + else + { + ValidObjects(true); + + } + this->show(); } } @@ -114,16 +133,8 @@ void DialogDetail::ChosenObject(quint32 id, const SceneObject &type) //--------------------------------------------------------------------------------------------------------------------- void DialogDetail::SaveData() { - details.Clear(); - for (qint32 i = 0; i < ui.listWidget->count(); ++i) - { - QListWidgetItem *item = ui.listWidget->item(i); - details.append( qvariant_cast(item->data(Qt::UserRole))); - } - details.setWidth(ui.doubleSpinBoxSeams->value()); - details.setName(ui.lineEditNameDetail->text()); - details.setSeamAllowance(supplement); - details.setClosed(closed); + detail.Clear(); + detail = CreateDetail(); } //--------------------------------------------------------------------------------------------------------------------- @@ -198,26 +209,62 @@ void DialogDetail::NewItem(quint32 id, const Tool &typeTool, const NodeDetail &t ui.doubleSpinBoxBiasY->blockSignals(false); } +//--------------------------------------------------------------------------------------------------------------------- +VDetail DialogDetail::CreateDetail() const +{ + VDetail detail; + for (qint32 i = 0; i < ui.listWidget->count(); ++i) + { + QListWidgetItem *item = ui.listWidget->item(i); + detail.append( qvariant_cast(item->data(Qt::UserRole))); + } + detail.setWidth(ui.doubleSpinBoxSeams->value()); + detail.setName(ui.lineEditNameDetail->text()); + detail.setSeamAllowance(supplement); + detail.setClosed(closed); + return detail; +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogDetail::ValidObjects(bool value) +{ + flagError = value; + CheckState(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogDetail::EnableObjectGUI(bool value) +{ + ui.toolButtonDelete->setEnabled(value); + ui.doubleSpinBoxBiasX->setEnabled(value); + ui.doubleSpinBoxBiasY->setEnabled(value); + + if (value == false) + { + ui.checkBoxReverse->setEnabled(value); + } +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief setDetails set detail * @param value detail */ -void DialogDetail::setDetails(const VDetail &value) +void DialogDetail::setDetail(const VDetail &value) { - details = value; + detail = value; ui.listWidget->clear(); - for (int i = 0; i < details.CountNode(); ++i) + for (int i = 0; i < detail.CountNode(); ++i) { - NewItem(details.at(i).getId(), details.at(i).getTypeTool(), details.at(i).getTypeNode(), details.at(i).getMx(), - details.at(i).getMy(), details.at(i).getReverse()); + NewItem(detail.at(i).getId(), detail.at(i).getTypeTool(), detail.at(i).getTypeNode(), detail.at(i).getMx(), + detail.at(i).getMy(), detail.at(i).getReverse()); } - ui.lineEditNameDetail->setText(details.getName()); - ui.checkBoxSeams->setChecked(details.getSeamAllowance()); - ui.checkBoxClosed->setChecked(details.getClosed()); - ClickedClosed(details.getClosed()); - ClickedSeams(details.getSeamAllowance()); - ui.doubleSpinBoxSeams->setValue(details.getWidth()); + ui.lineEditNameDetail->setText(detail.getName()); + ui.checkBoxSeams->setChecked(detail.getSeamAllowance()); + ui.checkBoxClosed->setChecked(detail.getClosed()); + ClickedClosed(detail.getClosed()); + ClickedSeams(detail.getSeamAllowance()); + ui.doubleSpinBoxSeams->setValue(detail.getWidth()); ui.listWidget->setCurrentRow(0); ui.listWidget->setFocus(Qt::OtherFocusReason); ui.toolButtonDelete->setEnabled(true); @@ -293,11 +340,12 @@ void DialogDetail::ClickedReverse(bool checked) */ void DialogDetail::ObjectChanged(int row) { - if (ui.listWidget->count() == 0) + if (ui.listWidget->count() == 0 || row == -1 || row >= ui.listWidget->count()) { return; } const QListWidgetItem *item = ui.listWidget->item( row ); + SCASSERT(item != nullptr); const VNodeDetail node = qvariant_cast(item->data(Qt::UserRole)); ui.doubleSpinBoxBiasX->setValue(qApp->fromPixel(node.getMx())); ui.doubleSpinBoxBiasY->setValue(qApp->fromPixel(node.getMy())); @@ -319,8 +367,16 @@ void DialogDetail::ObjectChanged(int row) */ void DialogDetail::DeleteItem() { - qint32 row = ui.listWidget->currentRow(); - delete ui.listWidget->item( row ); + if (ui.listWidget->count() == 1) + { + EnableObjectGUI(false); + } + + delete ui.listWidget->item( ui.listWidget->currentRow() ); + if (CreateDetail().ContourPoints(data).size() < 3 ) + { + ValidObjects(false); + } } diff --git a/src/app/dialogs/tools/dialogdetail.h b/src/app/dialogs/tools/dialogdetail.h index 8f8efe965..71eeafe6c 100644 --- a/src/app/dialogs/tools/dialogdetail.h +++ b/src/app/dialogs/tools/dialogdetail.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -42,8 +42,8 @@ class DialogDetail : public DialogTool public: DialogDetail(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); - VDetail getDetails() const; - void setDetails(const VDetail &value); + VDetail getDetail() const; + void setDetail(const VDetail &value); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); void BiasXChanged(qreal d); @@ -64,8 +64,8 @@ private: /** @brief ui keeps information about user interface */ Ui::DialogDetail ui; - /** @brief details detail */ - VDetail details; + /** @brief detail detail */ + VDetail detail; /** @brief supplement keep option supplement of seams */ bool supplement; @@ -75,6 +75,9 @@ private: void NewItem(quint32 id, const Tool &typeTool, const NodeDetail &typeNode, qreal mx = 0, qreal my = 0, bool reverse = false); + VDetail CreateDetail() const; + void ValidObjects(bool value); + void EnableObjectGUI(bool value); }; //--------------------------------------------------------------------------------------------------------------------- @@ -82,9 +85,9 @@ private: * @brief getDetails return detail * @return detail */ -inline VDetail DialogDetail::getDetails() const +inline VDetail DialogDetail::getDetail() const { - return details; + return detail; } #endif // DIALOGDETAIL_H diff --git a/src/app/dialogs/tools/dialogdetail.ui b/src/app/dialogs/tools/dialogdetail.ui index 212625aef..b64e0807c 100644 --- a/src/app/dialogs/tools/dialogdetail.ui +++ b/src/app/dialogs/tools/dialogdetail.ui @@ -11,7 +11,7 @@ - Detail + Seam allowance tool diff --git a/src/app/dialogs/tools/dialogeditwrongformula.cpp b/src/app/dialogs/tools/dialogeditwrongformula.cpp index 3987b12a7..63bc747a0 100644 --- a/src/app/dialogs/tools/dialogeditwrongformula.cpp +++ b/src/app/dialogs/tools/dialogeditwrongformula.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -47,7 +47,6 @@ DialogEditWrongFormula::DialogEditWrongFormula(const VContainer *data, const qui connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogEditWrongFormula::PutHere); connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogEditWrongFormula::PutVal); - connect(ui->toolButtonEqual, &QPushButton::clicked, this, &DialogEditWrongFormula::EvalFormula); connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogEditWrongFormula::FormulaChanged); connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogEditWrongFormula::DeployFormulaTextEdit); @@ -121,7 +120,7 @@ void DialogEditWrongFormula::closeEvent(QCloseEvent *event) } //--------------------------------------------------------------------------------------------------------------------- -void DialogEditWrongFormula::setFormula(const QString &value) +void DialogEditWrongFormula::SetFormula(const QString &value) { formula = qApp->FormulaToUser(value); // increase height if needed. TODO : see if I can get the max number of caracters in one line @@ -147,7 +146,7 @@ void DialogEditWrongFormula::setPostfix(const QString &value) } //--------------------------------------------------------------------------------------------------------------------- -QString DialogEditWrongFormula::getFormula() const +QString DialogEditWrongFormula::GetFormula() const { return qApp->FormulaFromUser(formula); } diff --git a/src/app/dialogs/tools/dialogeditwrongformula.h b/src/app/dialogs/tools/dialogeditwrongformula.h index a2d389baf..faaa436ae 100644 --- a/src/app/dialogs/tools/dialogeditwrongformula.h +++ b/src/app/dialogs/tools/dialogeditwrongformula.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -51,8 +51,8 @@ public: explicit DialogEditWrongFormula(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogEditWrongFormula(); - QString getFormula() const; - void setFormula(const QString &value); + QString GetFormula() const; + void SetFormula(const QString &value); void setCheckZero(bool value); void setPostfix(const QString &value); public slots: diff --git a/src/app/dialogs/tools/dialogeditwrongformula.ui b/src/app/dialogs/tools/dialogeditwrongformula.ui index 47d43dd6a..0c84e4d32 100644 --- a/src/app/dialogs/tools/dialogeditwrongformula.ui +++ b/src/app/dialogs/tools/dialogeditwrongformula.ui @@ -110,22 +110,12 @@ - - - Calculate value - + - ... + - - - :/icon/24x24/equal.png:/icon/24x24/equal.png - - - - 24 - 24 - + + :/icon/24x24/equal.png @@ -392,7 +382,6 @@ plainTextEditFormula toolButtonPutHere - toolButtonEqual pushButtonGrowLength radioButtonSizeGrowth radioButtonStandardTable diff --git a/src/app/dialogs/tools/dialogendline.cpp b/src/app/dialogs/tools/dialogendline.cpp index 8da548990..0b04561b4 100644 --- a/src/app/dialogs/tools/dialogendline.cpp +++ b/src/app/dialogs/tools/dialogendline.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -43,9 +43,8 @@ * @param parent parent widget */ DialogEndLine::DialogEndLine(const VContainer *data, const quint32 &toolId, QWidget *parent) - :DialogTool(data, toolId, parent), ui(new Ui::DialogEndLine), typeLine(QString()), - formulaLength(QString()), formulaAngle(QString()), basePointId(NULL_ID), formulaBaseHeight(0), - formulaBaseHeightAngle(0), line(nullptr) + :DialogTool(data, toolId, parent), ui(new Ui::DialogEndLine), + formulaLength(QString()), formulaAngle(QString()), formulaBaseHeight(0), formulaBaseHeightAngle(0), line(nullptr) { ui->setupUi(this); InitVariables(ui); @@ -63,14 +62,12 @@ DialogEndLine::DialogEndLine(const VContainer *data, const quint32 &toolId, QWid CheckState(); FillComboBoxPoints(ui->comboBoxBasePoint); - FillComboBoxTypeLine(ui->comboBoxLineType); + FillComboBoxTypeLine(ui->comboBoxLineType, VAbstractTool::LineStylesPics()); + FillComboBoxLineColors(ui->comboBoxLineColor); connect(ui->toolButtonPutHereLength, &QPushButton::clicked, this, &DialogEndLine::PutHere); connect(ui->toolButtonPutHereAngle, &QPushButton::clicked, this, &DialogEndLine::PutAngle); - connect(ui->toolButtonEqualLength, &QPushButton::clicked, this, &DialogEndLine::EvalFormula); - connect(ui->toolButtonEqualAngle, &QPushButton::clicked, this, &DialogEndLine::EvalAngle); - connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogEndLine::NamePointChanged); connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogEndLine::FormulaTextChanged); @@ -144,7 +141,6 @@ void DialogEndLine::ChosenObject(quint32 id, const SceneObject &type) { if (SetObject(id, ui->comboBoxBasePoint, "")) { - basePointId = id; line->VisualMode(id); connect(line, &VisToolEndLine::ToolTip, this, &DialogTool::ShowVisToolTip); prepare = true; @@ -155,10 +151,10 @@ void DialogEndLine::ChosenObject(quint32 id, const SceneObject &type) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setPointName set name of point + * @brief SetPointName set name of point * @param value name */ -void DialogEndLine::setPointName(const QString &value) +void DialogEndLine::SetPointName(const QString &value) { pointName = value; ui->lineEditNamePoint->setText(pointName); @@ -166,22 +162,21 @@ void DialogEndLine::setPointName(const QString &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setTypeLine set type of line + * @brief SetTypeLine set type of line * @param value type */ -void DialogEndLine::setTypeLine(const QString &value) +void DialogEndLine::SetTypeLine(const QString &value) { - typeLine = value; - SetupTypeLine(ui->comboBoxLineType, value); - line->setLineStyle(VAbstractTool::LineStyle(typeLine)); + ChangeCurrentData(ui->comboBoxLineType, value); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(value)); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setFormula set string of formula + * @brief SetFormula set string of formula * @param value formula */ -void DialogEndLine::setFormula(const QString &value) +void DialogEndLine::SetFormula(const QString &value) { formulaLength = qApp->FormulaToUser(value); // increase height if needed. TODO : see if I can get the max number of caracters in one line @@ -197,10 +192,10 @@ void DialogEndLine::setFormula(const QString &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setAngle set angle of line + * @brief SetAngle set angle of line * @param value angle in degree */ -void DialogEndLine::setAngle(const QString &value) +void DialogEndLine::SetAngle(const QString &value) { formulaAngle = qApp->FormulaToUser(value); // increase height if needed. TODO : see if I can get the max number of caracters in one line @@ -210,21 +205,33 @@ void DialogEndLine::setAngle(const QString &value) this->DeployAngleTextEdit(); } ui->plainTextEditAngle->setPlainText(formulaAngle); - line->setAngle(formulaAngle); + line->SetAngle(formulaAngle); MoveCursorToEnd(ui->plainTextEditAngle); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setBasePointId set id base point of line + * @brief SetBasePointId set id base point of line * @param value id */ -void DialogEndLine::setBasePointId(const quint32 &value) +void DialogEndLine::SetBasePointId(const quint32 &value) { - setCurrentPointId(ui->comboBoxBasePoint, basePointId, value); + setCurrentPointId(ui->comboBoxBasePoint, value); line->setPoint1Id(value); } +//--------------------------------------------------------------------------------------------------------------------- +QString DialogEndLine::GetLineColor() const +{ + return GetComboBoxCurrentData(ui->comboBoxLineColor); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogEndLine::SetLineColor(const QString &value) +{ + ChangeCurrentData(ui->comboBoxLineColor, value); +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief DialogEndLine::ShowDialog show dialog after finish working with visual part @@ -239,7 +246,7 @@ void DialogEndLine::ShowDialog(bool click) /*We will ignore click if poinet is in point circle*/ VMainGraphicsScene *scene = qApp->getCurrentScene(); SCASSERT(scene != nullptr); - const QSharedPointer point = data->GeometricObject(basePointId); + const QSharedPointer point = data->GeometricObject(GetBasePointId()); QLineF line = QLineF(point->toQPointF(), scene->getScenePos()); //Radius of point circle, but little bigger. Need handle with hover sizes. @@ -250,7 +257,7 @@ void DialogEndLine::ShowDialog(bool click) } } this->setModal(true); - this->setAngle(line->Angle());//Show in dialog angle what user choose + this->SetAngle(line->Angle());//Show in dialog angle what user choose emit ToolTip(""); timerFormula->start(); this->show(); @@ -274,7 +281,6 @@ void DialogEndLine::ShowVisualization() void DialogEndLine::SaveData() { pointName = ui->lineEditNamePoint->text(); - typeLine = GetTypeLine(ui->comboBoxLineType); formulaLength = ui->plainTextEditFormula->toPlainText(); formulaLength.replace("\n", " "); @@ -282,12 +288,10 @@ void DialogEndLine::SaveData() formulaAngle = ui->plainTextEditAngle->toPlainText(); formulaAngle.replace("\n", " "); - basePointId = getCurrentObjectId(ui->comboBoxBasePoint); - - line->setPoint1Id(basePointId); + line->setPoint1Id(GetBasePointId()); line->setLength(formulaLength); - line->setAngle(formulaAngle); - line->setLineStyle(VAbstractTool::LineStyle(typeLine)); + line->SetAngle(formulaAngle); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(GetTypeLine())); line->RefreshGeometry(); } @@ -308,3 +312,43 @@ DialogEndLine::~DialogEndLine() } delete ui; } + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetTypeLine return type of line + * @return type + */ +QString DialogEndLine::GetTypeLine() const +{ + return GetComboBoxCurrentData(ui->comboBoxLineType); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetFormula return string of formula + * @return formula + */ +QString DialogEndLine::GetFormula() const +{ + return qApp->FormulaFromUser(formulaLength); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetAngle return formula angle of line + * @return angle formula + */ +QString DialogEndLine::GetAngle() const +{ + return qApp->FormulaFromUser(formulaAngle); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetBasePointId return id base point of line + * @return id + */ +quint32 DialogEndLine::GetBasePointId() const +{ + return getCurrentObjectId(ui->comboBoxBasePoint); +} diff --git a/src/app/dialogs/tools/dialogendline.h b/src/app/dialogs/tools/dialogendline.h index 0747f4b65..d12a86e23 100644 --- a/src/app/dialogs/tools/dialogendline.h +++ b/src/app/dialogs/tools/dialogendline.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -48,20 +48,23 @@ public: DialogEndLine(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogEndLine(); - QString getPointName() const; - void setPointName(const QString &value); + void SetPointName(const QString &value); - QString getTypeLine() const; - void setTypeLine(const QString &value); + QString GetTypeLine() const; + void SetTypeLine(const QString &value); - QString getFormula() const; - void setFormula(const QString &value); + QString GetFormula() const; + void SetFormula(const QString &value); - QString getAngle() const; - void setAngle(const QString &value); + QString GetAngle() const; + void SetAngle(const QString &value); + + quint32 GetBasePointId() const; + void SetBasePointId(const quint32 &value); + + QString GetLineColor() const; + void SetLineColor(const QString &value); - quint32 getBasePointId() const; - void setBasePointId(const quint32 &value); virtual void ShowDialog(bool click); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); @@ -90,75 +93,17 @@ private: /** @brief ui keeps information about user interface */ Ui::DialogEndLine *ui; - /** @brief typeLine type of line */ - QString typeLine; - /** @brief formula formula */ QString formulaLength; /** @brief angle angle of line */ QString formulaAngle; - /** @brief basePointId id base point of line */ - quint32 basePointId; - /** @brief formulaBaseHeight base height defined by dialogui */ int formulaBaseHeight; int formulaBaseHeightAngle; VisToolEndLine *line; - - }; -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getPointName return name of point - * @return name - */ -inline QString DialogEndLine::getPointName() const -{ - return pointName; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getTypeLine return type of line - * @return type - */ -inline QString DialogEndLine::getTypeLine() const -{ - return typeLine; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getFormula return string of formula - * @return formula - */ -inline QString DialogEndLine::getFormula() const -{ - return qApp->FormulaFromUser(formulaLength); -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getAngle return formula angle of line - * @return angle formula - */ -inline QString DialogEndLine::getAngle() const -{ - return qApp->FormulaFromUser(formulaAngle); -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getBasePointId return id base point of line - * @return id - */ -inline quint32 DialogEndLine::getBasePointId() const -{ - return basePointId; -} - #endif // DIALOGENDLINE_H diff --git a/src/app/dialogs/tools/dialogendline.ui b/src/app/dialogs/tools/dialogendline.ui index a34de47cc..0b67d0a75 100644 --- a/src/app/dialogs/tools/dialogendline.ui +++ b/src/app/dialogs/tools/dialogendline.ui @@ -7,7 +7,7 @@ 0 0 417 - 538 + 571 @@ -17,7 +17,7 @@ - Point in the end of a line + Point at distance and angle @@ -110,22 +110,12 @@ - - - Calculate value - + - ... + - - - :/icon/24x24/equal.png:/icon/24x24/equal.png - - - - 24 - 24 - + + :/icon/24x24/equal.png @@ -298,22 +288,12 @@ - - - Calculate value - + - ... + - - - :/icon/24x24/equal.png:/icon/24x24/equal.png - - - - 24 - 24 - + + :/icon/24x24/equal.png @@ -409,6 +389,9 @@ + + QFormLayout::AllNonFixedFieldsGrow + @@ -454,11 +437,39 @@ + + + 80 + 0 + + + + + 110 + 16777215 + + Show line from first point to this point + + + 80 + 14 + + + + + + Line color + + + + + + @@ -634,11 +645,9 @@ plainTextEditFormula toolButtonPutHereLength - toolButtonEqualLength pushButtonGrowLength plainTextEditAngle toolButtonPutHereAngle - toolButtonEqualAngle pushButtonGrowLengthAngle comboBoxBasePoint lineEditNamePoint diff --git a/src/app/dialogs/tools/dialogheight.cpp b/src/app/dialogs/tools/dialogheight.cpp index 573906e79..fd704c880 100644 --- a/src/app/dialogs/tools/dialogheight.cpp +++ b/src/app/dialogs/tools/dialogheight.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -42,8 +42,7 @@ * @param parent parent widget */ DialogHeight::DialogHeight(const VContainer *data, const quint32 &toolId, QWidget *parent) - :DialogTool(data, toolId, parent), ui(new Ui::DialogHeight), number(0), - typeLine(QString()), basePointId(NULL_ID), p1LineId(NULL_ID), p2LineId(NULL_ID), line(nullptr) + :DialogTool(data, toolId, parent), ui(new Ui::DialogHeight), line(nullptr) { ui->setupUi(this); ui->lineEditNamePoint->setText(qApp->getCurrentDocument()->GenerateLabel(LabelType::NewLabel)); @@ -54,7 +53,9 @@ DialogHeight::DialogHeight(const VContainer *data, const quint32 &toolId, QWidge FillComboBoxPoints(ui->comboBoxBasePoint); FillComboBoxPoints(ui->comboBoxP1Line); FillComboBoxPoints(ui->comboBoxP2Line); - FillComboBoxTypeLine(ui->comboBoxLineType); + FillComboBoxTypeLine(ui->comboBoxLineType, VAbstractTool::LineStylesPics()); + FillComboBoxLineColors(ui->comboBoxLineColor); + connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogHeight::NamePointChanged); connect(ui->comboBoxBasePoint, static_cast(&QComboBox::currentIndexChanged), this, &DialogHeight::PointNameChanged); @@ -78,10 +79,10 @@ DialogHeight::~DialogHeight() //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setPointName set name of point + * @brief SetPointName set name of point * @param value name */ -void DialogHeight::setPointName(const QString &value) +void DialogHeight::SetPointName(const QString &value) { pointName = value; ui->lineEditNamePoint->setText(pointName); @@ -89,47 +90,58 @@ void DialogHeight::setPointName(const QString &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setTypeLine set type of line + * @brief SetTypeLine set type of line * @param value type */ -void DialogHeight::setTypeLine(const QString &value) +void DialogHeight::SetTypeLine(const QString &value) { - typeLine = value; - SetupTypeLine(ui->comboBoxLineType, value); - line->setLineStyle(VAbstractTool::LineStyle(typeLine)); + ChangeCurrentData(ui->comboBoxLineType, value); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(value)); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setBasePointId set id base point of height + * @brief SetBasePointId set id base point of height * @param value id */ -void DialogHeight::setBasePointId(const quint32 &value) +void DialogHeight::SetBasePointId(const quint32 &value) { - setPointId(ui->comboBoxBasePoint, basePointId, value); - line->setPoint1Id(basePointId); + setCurrentPointId(ui->comboBoxBasePoint, value); + line->setPoint1Id(value); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setP1LineId set id first point of line + * @brief SetP1LineId set id first point of line * @param value id */ -void DialogHeight::setP1LineId(const quint32 &value) +void DialogHeight::SetP1LineId(const quint32 &value) { - setPointId(ui->comboBoxP1Line, p1LineId, value); - line->setLineP1Id(p1LineId); + setCurrentPointId(ui->comboBoxP1Line, value); + line->setLineP1Id(value); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setP2LineId set id second point of line + * @brief SetP2LineId set id second point of line * @param value id */ -void DialogHeight::setP2LineId(const quint32 &value) +void DialogHeight::SetP2LineId(const quint32 &value) { - setPointId(ui->comboBoxP2Line, p2LineId, value); - line->setLineP2Id(p2LineId); + setCurrentPointId(ui->comboBoxP2Line, value); + line->setLineP2Id(value); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogHeight::GetLineColor() const +{ + return GetComboBoxCurrentData(ui->comboBoxLineColor); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogHeight::SetLineColor(const QString &value) +{ + ChangeCurrentData(ui->comboBoxLineColor, value); } //--------------------------------------------------------------------------------------------------------------------- @@ -195,15 +207,11 @@ void DialogHeight::ChosenObject(quint32 id, const SceneObject &type) void DialogHeight::SaveData() { pointName = ui->lineEditNamePoint->text(); - typeLine = GetTypeLine(ui->comboBoxLineType); - basePointId = getCurrentObjectId(ui->comboBoxBasePoint); - p1LineId = getCurrentObjectId(ui->comboBoxP1Line); - p2LineId = getCurrentObjectId(ui->comboBoxP2Line); - line->setPoint1Id(basePointId); - line->setLineP1Id(p1LineId); - line->setLineP2Id(p2LineId); - line->setLineStyle(VAbstractTool::LineStyle(typeLine)); + line->setPoint1Id(GetBasePointId()); + line->setLineP1Id(GetP1LineId()); + line->setLineP2Id(GetP2LineId()); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(GetTypeLine())); line->RefreshGeometry(); } @@ -261,3 +269,43 @@ void DialogHeight::ShowVisualization() line->RefreshGeometry(); } } + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetTypeLine return type of line + * @return type + */ +QString DialogHeight::GetTypeLine() const +{ + return GetComboBoxCurrentData(ui->comboBoxLineType); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetBasePointId return id base point of height + * @return id + */ +quint32 DialogHeight::GetBasePointId() const +{ + return getCurrentObjectId(ui->comboBoxBasePoint); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetP1LineId return id first point of line + * @return id id + */ +quint32 DialogHeight::GetP1LineId() const +{ + return getCurrentObjectId(ui->comboBoxP1Line); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetP2LineId return id second point of line + * @return id + */ +quint32 DialogHeight::GetP2LineId() const +{ + return getCurrentObjectId(ui->comboBoxP2Line); +} diff --git a/src/app/dialogs/tools/dialogheight.h b/src/app/dialogs/tools/dialogheight.h index 8c384b145..da12d38b1 100644 --- a/src/app/dialogs/tools/dialogheight.h +++ b/src/app/dialogs/tools/dialogheight.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -48,20 +48,22 @@ public: DialogHeight(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogHeight(); - QString getPointName() const; - void setPointName(const QString &value); + void SetPointName(const QString &value); - QString getTypeLine() const; - void setTypeLine(const QString &value); + QString GetTypeLine() const; + void SetTypeLine(const QString &value); - quint32 getBasePointId() const; - void setBasePointId(const quint32 &value); + quint32 GetBasePointId() const; + void SetBasePointId(const quint32 &value); - quint32 getP1LineId() const; - void setP1LineId(const quint32 &value); + quint32 GetP1LineId() const; + void SetP1LineId(const quint32 &value); - quint32 getP2LineId() const; - void setP2LineId(const quint32 &value); + quint32 GetP2LineId() const; + void SetP2LineId(const quint32 &value); + + QString GetLineColor() const; + void SetLineColor(const QString &value); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); virtual void PointNameChanged(); @@ -78,71 +80,7 @@ private: /** @brief ui keeps information about user interface */ Ui::DialogHeight *ui; - /** @brief number number of handled objects */ - qint32 number; - - /** @brief typeLine type of line */ - QString typeLine; - - /** @brief basePointId id base point of height */ - quint32 basePointId; - - /** @brief p1LineId id first point of line */ - quint32 p1LineId; - - /** @brief p2LineId id second point of line */ - quint32 p2LineId; VisToolHeight *line; }; -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getPointName return name of point - * @return name - */ -inline QString DialogHeight::getPointName() const -{ - return pointName; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getTypeLine return type of line - * @return type - */ -inline QString DialogHeight::getTypeLine() const -{ - return typeLine; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getBasePointId return id base point of height - * @return id - */ -inline quint32 DialogHeight::getBasePointId() const -{ - return basePointId; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getP1LineId return id first point of line - * @return id id - */ -inline quint32 DialogHeight::getP1LineId() const -{ - return p1LineId; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getP2LineId return id second point of line - * @return id - */ -inline quint32 DialogHeight::getP2LineId() const -{ - return p2LineId; -} - #endif // DIALOGHEIGHT_H diff --git a/src/app/dialogs/tools/dialogheight.ui b/src/app/dialogs/tools/dialogheight.ui index be8edb8cf..45541665a 100644 --- a/src/app/dialogs/tools/dialogheight.ui +++ b/src/app/dialogs/tools/dialogheight.ui @@ -7,11 +7,11 @@ 0 0 285 - 212 + 245 - Height + Perpendicular point along line @@ -58,7 +58,7 @@ - First point of line + Base Point @@ -98,7 +98,7 @@ - First point of line + Second point of line @@ -111,11 +111,39 @@ + + + 80 + 0 + + + + + 110 + 16777215 + + Show line from first point to our point + + + 80 + 14 + + + + + + Line color + + + + + + diff --git a/src/app/dialogs/tools/dialogline.cpp b/src/app/dialogs/tools/dialogline.cpp index 287055246..8d5ba671f 100644 --- a/src/app/dialogs/tools/dialogline.cpp +++ b/src/app/dialogs/tools/dialogline.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -43,15 +43,18 @@ * @param parent parent widget */ DialogLine::DialogLine(const VContainer *data, const quint32 &toolId, QWidget *parent) - :DialogTool(data, toolId, parent), ui(new Ui::DialogLine), number(0), firstPoint(NULL_ID), secondPoint(NULL_ID), - typeLine(QString()), line(nullptr) + :DialogTool(data, toolId, parent), ui(new Ui::DialogLine), line(nullptr) { ui->setupUi(this); InitOkCancelApply(ui); FillComboBoxPoints(ui->comboBoxFirstPoint); FillComboBoxPoints(ui->comboBoxSecondPoint); - FillComboBoxTypeLine(ui->comboBoxLineType); + FillComboBoxLineColors(ui->comboBoxLineColor); + + QMap stylesPics = VAbstractTool::LineStylesPics(); + stylesPics.remove(VAbstractTool::TypeLineNone);// Prevent hiding line + FillComboBoxTypeLine(ui->comboBoxLineType, stylesPics); number = 0; @@ -75,35 +78,46 @@ DialogLine::~DialogLine() //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setSecondPoint set id second point + * @brief SetSecondPoint set id second point * @param value id */ -void DialogLine::setSecondPoint(const quint32 &value) +void DialogLine::SetSecondPoint(const quint32 &value) { - setPointId(ui->comboBoxSecondPoint, secondPoint, value); + setCurrentPointId(ui->comboBoxSecondPoint, value); line->setPoint2Id(value); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setTypeLine set type of line + * @brief SetTypeLine set type of line * @param value type */ -void DialogLine::setTypeLine(const QString &value) +void DialogLine::SetTypeLine(const QString &value) { - typeLine = value; - SetupTypeLine(ui->comboBoxLineType, value); - line->setLineStyle(VAbstractTool::LineStyle(typeLine)); + ChangeCurrentData(ui->comboBoxLineType, value); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(value)); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogLine::GetLineColor() const +{ + return GetComboBoxCurrentData(ui->comboBoxLineColor); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLine::SetLineColor(const QString &value) +{ + ChangeCurrentData(ui->comboBoxLineColor, value); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setFirstPoint set id first point + * @brief SetFirstPoint set id first point * @param value id */ -void DialogLine::setFirstPoint(const quint32 &value) +void DialogLine::SetFirstPoint(const quint32 &value) { - setPointId(ui->comboBoxFirstPoint, firstPoint, value); + setCurrentPointId(ui->comboBoxFirstPoint, value); line->setPoint1Id(value); } @@ -150,15 +164,9 @@ void DialogLine::ShowVisualization() //--------------------------------------------------------------------------------------------------------------------- void DialogLine::SaveData() { - qint32 index = ui->comboBoxFirstPoint->currentIndex(); - firstPoint = qvariant_cast(ui->comboBoxFirstPoint->itemData(index)); - index = ui->comboBoxSecondPoint->currentIndex(); - secondPoint = qvariant_cast(ui->comboBoxSecondPoint->itemData(index)); - typeLine = GetTypeLine(ui->comboBoxLineType); - - line->setPoint1Id(firstPoint); - line->setPoint2Id(secondPoint); - line->setLineStyle(VAbstractTool::LineStyle(typeLine)); + line->setPoint1Id(GetFirstPoint()); + line->setPoint2Id(GetSecondPoint()); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(GetTypeLine())); line->RefreshGeometry(); } @@ -200,3 +208,33 @@ void DialogLine::ChosenObject(quint32 id, const SceneObject &type) } } } + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetFirstPoint return id first point + * @return id + */ +quint32 DialogLine::GetFirstPoint() const +{ + return qvariant_cast(ui->comboBoxFirstPoint->currentData()); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetSecondPoint return id second point + * @return id + */ +quint32 DialogLine::GetSecondPoint() const +{ + return qvariant_cast(ui->comboBoxSecondPoint->currentData()); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetTypeLine return type of line + * @return type + */ +QString DialogLine::GetTypeLine() const +{ + return GetComboBoxCurrentData(ui->comboBoxLineType); +} diff --git a/src/app/dialogs/tools/dialogline.h b/src/app/dialogs/tools/dialogline.h index c08d061b0..7922fdec8 100644 --- a/src/app/dialogs/tools/dialogline.h +++ b/src/app/dialogs/tools/dialogline.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -48,14 +48,17 @@ public: DialogLine(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogLine(); - quint32 getFirstPoint() const; - void setFirstPoint(const quint32 &value); + quint32 GetFirstPoint() const; + void SetFirstPoint(const quint32 &value); - quint32 getSecondPoint() const; - void setSecondPoint(const quint32 &value); + quint32 GetSecondPoint() const; + void SetSecondPoint(const quint32 &value); - QString getTypeLine() const; - void setTypeLine(const QString &value); + QString GetTypeLine() const; + void SetTypeLine(const QString &value); + + QString GetLineColor() const; + void SetLineColor(const QString &value); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); virtual void PointNameChanged(); @@ -72,49 +75,8 @@ private: /** @brief ui keeps information about user interface */ Ui::DialogLine *ui; - /** @brief number number of handled objects */ - qint32 number; - - /** @brief firstPoint id first point */ - quint32 firstPoint; - - /** @brief secondPoint id second point */ - quint32 secondPoint; - - /** @brief typeLine type of line */ - QString typeLine; VisToolLine *line; }; -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getFirstPoint return id first point - * @return id - */ -inline quint32 DialogLine::getFirstPoint() const -{ - return firstPoint; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getSecondPoint return id second point - * @return id - */ -inline quint32 DialogLine::getSecondPoint() const -{ - return secondPoint; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getTypeLine return type of line - * @return type - */ -inline QString DialogLine::getTypeLine() const -{ - return typeLine; -} - #endif // DIALOGLINE_H diff --git a/src/app/dialogs/tools/dialogline.ui b/src/app/dialogs/tools/dialogline.ui index b02ea2911..755c770b2 100644 --- a/src/app/dialogs/tools/dialogline.ui +++ b/src/app/dialogs/tools/dialogline.ui @@ -10,23 +10,23 @@ 0 0 286 - 151 + 179 286 - 151 + 179 286 - 151 + 179 - Line + Line between points @@ -122,15 +122,37 @@ - 0 + 80 0 + + + 110 + 16777215 + + Show line from first point to this point + + + 80 + 14 + + + + + + Line color + + + + + + diff --git a/src/app/dialogs/tools/dialoglineintersect.cpp b/src/app/dialogs/tools/dialoglineintersect.cpp index ae45b1589..403342115 100644 --- a/src/app/dialogs/tools/dialoglineintersect.cpp +++ b/src/app/dialogs/tools/dialoglineintersect.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -42,8 +42,7 @@ * @param parent parent widget */ DialogLineIntersect::DialogLineIntersect(const VContainer *data, const quint32 &toolId, QWidget *parent) - :DialogTool(data, toolId, parent), ui(new Ui::DialogLineIntersect), number(0), - p1Line1(NULL_ID), p2Line1(NULL_ID), p1Line2(NULL_ID), p2Line2(NULL_ID), flagPoint(true), line(nullptr) + :DialogTool(data, toolId, parent), ui(new Ui::DialogLineIntersect), flagPoint(true), line(nullptr) { ui->setupUi(this); number = 0; @@ -97,7 +96,6 @@ void DialogLineIntersect::ChosenObject(quint32 id, const SceneObject &type) if (SetObject(id, ui->comboBoxP1Line1, tr("Select second point of first line"))) { number++; - p1Line1 = id; line->VisualMode(id); } break; @@ -107,7 +105,6 @@ void DialogLineIntersect::ChosenObject(quint32 id, const SceneObject &type) if (SetObject(id, ui->comboBoxP2Line1, tr("Select first point of second line"))) { number++; - p2Line1 = id; line->setLine1P2Id(id); line->RefreshGeometry(); } @@ -117,7 +114,6 @@ void DialogLineIntersect::ChosenObject(quint32 id, const SceneObject &type) if (SetObject(id, ui->comboBoxP1Line2, tr("Select second point of second line"))) { number++; - p1Line2 = id; line->setLine2P1Id(id); line->RefreshGeometry(); } @@ -134,7 +130,6 @@ void DialogLineIntersect::ChosenObject(quint32 id, const SceneObject &type) { if (SetObject(id, ui->comboBoxP2Line2, "")) { - p2Line2 = id; line->setLine2P2Id(id); line->RefreshGeometry(); prepare = true; @@ -144,16 +139,16 @@ void DialogLineIntersect::ChosenObject(quint32 id, const SceneObject &type) this->show(); connect(ui->comboBoxP1Line1, static_cast(&QComboBox::currentIndexChanged), this, - &DialogLineIntersect::P1Line1Changed); + &DialogLineIntersect::PointChanged); connect(ui->comboBoxP2Line1, static_cast(&QComboBox::currentIndexChanged), this, - &DialogLineIntersect::P2Line1Changed); + &DialogLineIntersect::PointChanged); connect(ui->comboBoxP1Line2, static_cast(&QComboBox::currentIndexChanged), this, - &DialogLineIntersect::P1Line2Changed); + &DialogLineIntersect::PointChanged); connect(ui->comboBoxP2Line2, static_cast(&QComboBox::currentIndexChanged), this, - &DialogLineIntersect::P2Line2Changed); + &DialogLineIntersect::PointChanged); } } } @@ -169,15 +164,11 @@ void DialogLineIntersect::ChosenObject(quint32 id, const SceneObject &type) void DialogLineIntersect::SaveData() { pointName = ui->lineEditNamePoint->text(); - p1Line1 = getCurrentObjectId(ui->comboBoxP1Line1); - p2Line1 = getCurrentObjectId(ui->comboBoxP2Line1); - p1Line2 = getCurrentObjectId(ui->comboBoxP1Line2); - p2Line2 = getCurrentObjectId(ui->comboBoxP2Line2); - line->setPoint1Id(p1Line1); - line->setLine1P2Id(p2Line1); - line->setLine2P1Id(p1Line2); - line->setLine2P2Id(p2Line2); + line->setPoint1Id(GetP1Line1()); + line->setLine1P2Id(GetP2Line1()); + line->setLine2P1Id(GetP1Line2()); + line->setLine2P2Id(GetP2Line2()); line->RefreshGeometry(); } @@ -186,55 +177,10 @@ void DialogLineIntersect::SaveData() * @brief P1Line1Changed changed first point of first line * @param index index in list */ -void DialogLineIntersect::P1Line1Changed( int index) +void DialogLineIntersect::PointChanged() { - p1Line1 = qvariant_cast(ui->comboBoxP1Line1->itemData(index)); flagPoint = CheckIntersecion(); CheckState(); - - line->setPoint1Id(p1Line1); -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief P2Line1Changed changed second point of first line - * @param index index in list - */ -void DialogLineIntersect::P2Line1Changed(int index) -{ - p2Line1 = qvariant_cast(ui->comboBoxP2Line1->itemData(index)); - flagPoint = CheckIntersecion(); - CheckState(); - - line->setLine1P2Id(p2Line1); -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief P1Line2Changed changed first point of second line - * @param index index in list - */ -void DialogLineIntersect::P1Line2Changed(int index) -{ - p1Line2 = qvariant_cast(ui->comboBoxP1Line2->itemData(index)); - flagPoint = CheckIntersecion(); - CheckState(); - - line->setLine2P1Id(p1Line2); -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief P2Line2Changed changed second point of second line - * @param index index in list - */ -void DialogLineIntersect::P2Line2Changed(int index) -{ - p2Line2 = qvariant_cast(ui->comboBoxP2Line2->itemData(index)); - flagPoint = CheckIntersecion(); - CheckState(); - - line->setLine2P2Id(p2Line2); } //--------------------------------------------------------------------------------------------------------------------- @@ -317,10 +263,10 @@ void DialogLineIntersect::CheckState() */ bool DialogLineIntersect::CheckIntersecion() { - const QSharedPointer p1L1 = data->GeometricObject(p1Line1); - const QSharedPointer p2L1 = data->GeometricObject(p2Line1); - const QSharedPointer p1L2 = data->GeometricObject(p1Line2); - const QSharedPointer p2L2 = data->GeometricObject(p2Line2); + const QSharedPointer p1L1 = data->GeometricObject(GetP1Line1()); + const QSharedPointer p2L1 = data->GeometricObject(GetP2Line1()); + const QSharedPointer p1L2 = data->GeometricObject(GetP1Line2()); + const QSharedPointer p2L2 = data->GeometricObject(GetP2Line2()); QLineF line1(p1L1->toQPointF(), p2L1->toQPointF()); QLineF line2(p1L2->toQPointF(), p2L2->toQPointF()); @@ -338,55 +284,95 @@ bool DialogLineIntersect::CheckIntersecion() //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setP2Line2 set id second point of second line + * @brief SetP2Line2 set id second point of second line * @param value id */ -void DialogLineIntersect::setP2Line2(const quint32 &value) +void DialogLineIntersect::SetP2Line2(const quint32 &value) { - setPointId(ui->comboBoxP2Line2, p2Line2, value); - line->setLine2P2Id(p2Line2); + setCurrentPointId(ui->comboBoxP2Line2, value); + line->setLine2P2Id(value); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setP1Line2 set id first point of second line + * @brief SetP1Line2 set id first point of second line * @param value id */ -void DialogLineIntersect::setP1Line2(const quint32 &value) +void DialogLineIntersect::SetP1Line2(const quint32 &value) { - setPointId(ui->comboBoxP1Line2, p1Line2, value); - line->setLine2P1Id(p1Line2); + setCurrentPointId(ui->comboBoxP1Line2, value); + line->setLine2P1Id(value); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setP2Line1 set id second point of first line + * @brief SetP2Line1 set id second point of first line * @param value id */ -void DialogLineIntersect::setP2Line1(const quint32 &value) +void DialogLineIntersect::SetP2Line1(const quint32 &value) { - setPointId(ui->comboBoxP2Line1, p2Line1, value); - line->setLine1P2Id(p2Line1); + setCurrentPointId(ui->comboBoxP2Line1, value); + line->setLine1P2Id(value); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setP1Line1 set id first point of first line + * @brief SetP1Line1 set id first point of first line * @param value id */ -void DialogLineIntersect::setP1Line1(const quint32 &value) +void DialogLineIntersect::SetP1Line1(const quint32 &value) { - setPointId(ui->comboBoxP1Line1, p1Line1, value); - line->setPoint1Id(p1Line1); + setCurrentPointId(ui->comboBoxP1Line1, value); + line->setPoint1Id(value); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setPointName set name of point + * @brief SetPointName set name of point * @param value name of point */ -void DialogLineIntersect::setPointName(const QString &value) +void DialogLineIntersect::SetPointName(const QString &value) { pointName = value; ui->lineEditNamePoint->setText(pointName); } + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetP1Line1 return id first point of first line + * @return id + */ +quint32 DialogLineIntersect::GetP1Line1() const +{ + return getCurrentObjectId(ui->comboBoxP1Line1); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetP2Line1 return id second point of first line + * @return id + */ +quint32 DialogLineIntersect::GetP2Line1() const +{ + return getCurrentObjectId(ui->comboBoxP2Line1); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetP1Line2 return id first point of second line + * @return id + */ +quint32 DialogLineIntersect::GetP1Line2() const +{ + return getCurrentObjectId(ui->comboBoxP1Line2); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetP2Line2 return id second point of second line + * @return id + */ +quint32 DialogLineIntersect::GetP2Line2() const +{ + return getCurrentObjectId(ui->comboBoxP2Line2); +} diff --git a/src/app/dialogs/tools/dialoglineintersect.h b/src/app/dialogs/tools/dialoglineintersect.h index 93f686f73..5777280cb 100644 --- a/src/app/dialogs/tools/dialoglineintersect.h +++ b/src/app/dialogs/tools/dialoglineintersect.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -48,26 +48,22 @@ public: DialogLineIntersect(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogLineIntersect(); - quint32 getP1Line1() const; - void setP1Line1(const quint32 &value); + quint32 GetP1Line1() const; + void SetP1Line1(const quint32 &value); - quint32 getP2Line1() const; - void setP2Line1(const quint32 &value); + quint32 GetP2Line1() const; + void SetP2Line1(const quint32 &value); - quint32 getP1Line2() const; - void setP1Line2(const quint32 &value); + quint32 GetP1Line2() const; + void SetP1Line2(const quint32 &value); - quint32 getP2Line2() const; - void setP2Line2(const quint32 &value); + quint32 GetP2Line2() const; + void SetP2Line2(const quint32 &value); - QString getPointName() const; - void setPointName(const QString &value); + void SetPointName(const QString &value); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); - void P1Line1Changed( int index); - void P2Line1Changed( int index); - void P1Line2Changed( int index); - void P2Line2Changed( int index); + void PointChanged(); virtual void PointNameChanged(); virtual void UpdateList(); protected: @@ -82,21 +78,6 @@ private: /** @brief ui keeps information about user interface */ Ui::DialogLineIntersect *ui; - /** @brief number number of handled objects */ - qint32 number; - - /** @brief p1Line1 id first point of first line */ - quint32 p1Line1; - - /** @brief p2Line1 id second point of first line */ - quint32 p2Line1; - - /** @brief p1Line2 id first point of second line */ - quint32 p1Line2; - - /** @brief p2Line2 id second point of second line */ - quint32 p2Line2; - /** @brief flagPoint keep state of point */ bool flagPoint; @@ -106,54 +87,4 @@ private: bool CheckIntersecion(); }; -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getP1Line1 return id first point of first line - * @return id - */ -inline quint32 DialogLineIntersect::getP1Line1() const -{ - return p1Line1; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getP2Line1 return id second point of first line - * @return id - */ -inline quint32 DialogLineIntersect::getP2Line1() const -{ - return p2Line1; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getP1Line2 return id first point of second line - * @return id - */ -inline quint32 DialogLineIntersect::getP1Line2() const -{ - return p1Line2; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getP2Line2 return id second point of second line - * @return id - */ -inline quint32 DialogLineIntersect::getP2Line2() const -{ - return p2Line2; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getPointName return name of point - * @return name of point - */ -inline QString DialogLineIntersect::getPointName() const -{ - return pointName; -} - #endif // DIALOGLINEINTERSECT_H diff --git a/src/app/dialogs/tools/dialoglineintersect.ui b/src/app/dialogs/tools/dialoglineintersect.ui index 53e5d3f89..6d2a44ffb 100644 --- a/src/app/dialogs/tools/dialoglineintersect.ui +++ b/src/app/dialogs/tools/dialoglineintersect.ui @@ -11,7 +11,7 @@ - Intersection of lines + Point at line intersection diff --git a/src/app/dialogs/tools/dialoglineintersectaxis.cpp b/src/app/dialogs/tools/dialoglineintersectaxis.cpp index 7264e2a31..60f5d5f4e 100644 --- a/src/app/dialogs/tools/dialoglineintersectaxis.cpp +++ b/src/app/dialogs/tools/dialoglineintersectaxis.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -38,8 +38,7 @@ //--------------------------------------------------------------------------------------------------------------------- DialogLineIntersectAxis::DialogLineIntersectAxis(const VContainer *data, const quint32 &toolId, QWidget *parent) - :DialogTool(data, toolId, parent), ui(new Ui::DialogLineIntersectAxis), number(0), typeLine(QString()), - formulaAngle(QString()), basePointId(NULL_ID), firstPointId(NULL_ID), secondPointId(NULL_ID), + :DialogTool(data, toolId, parent), ui(new Ui::DialogLineIntersectAxis), formulaAngle(QString()), formulaBaseHeightAngle(0), line(nullptr) { ui->setupUi(this); @@ -57,11 +56,11 @@ DialogLineIntersectAxis::DialogLineIntersectAxis(const VContainer *data, const q FillComboBoxPoints(ui->comboBoxAxisPoint); FillComboBoxPoints(ui->comboBoxFirstLinePoint); FillComboBoxPoints(ui->comboBoxSecondLinePoint); - FillComboBoxTypeLine(ui->comboBoxLineType); + FillComboBoxTypeLine(ui->comboBoxLineType, VAbstractTool::LineStylesPics()); + FillComboBoxLineColors(ui->comboBoxLineColor); connect(ui->toolButtonPutHereAngle, &QPushButton::clicked, this, &DialogLineIntersectAxis::PutAngle); connect(listWidget, &QListWidget::itemDoubleClicked, this, &DialogLineIntersectAxis::PutVal); - connect(ui->toolButtonEqualAngle, &QPushButton::clicked, this, &DialogLineIntersectAxis::EvalAngle); connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogLineIntersectAxis::NamePointChanged); connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogLineIntersectAxis::AngleTextChanged); connect(ui->pushButtonGrowLengthAngle, &QPushButton::clicked, this, &DialogLineIntersectAxis::DeployAngleTextEdit); @@ -89,40 +88,33 @@ DialogLineIntersectAxis::~DialogLineIntersectAxis() } //--------------------------------------------------------------------------------------------------------------------- -QString DialogLineIntersectAxis::getPointName() const -{ - return pointName; -} - -//--------------------------------------------------------------------------------------------------------------------- -void DialogLineIntersectAxis::setPointName(const QString &value) +void DialogLineIntersectAxis::SetPointName(const QString &value) { pointName = value; ui->lineEditNamePoint->setText(pointName); } //--------------------------------------------------------------------------------------------------------------------- -QString DialogLineIntersectAxis::getTypeLine() const +QString DialogLineIntersectAxis::GetTypeLine() const { - return typeLine; + return GetComboBoxCurrentData(ui->comboBoxLineType); } //--------------------------------------------------------------------------------------------------------------------- -void DialogLineIntersectAxis::setTypeLine(const QString &value) +void DialogLineIntersectAxis::SetTypeLine(const QString &value) { - typeLine = value; - SetupTypeLine(ui->comboBoxLineType, value); - line->setLineStyle(VAbstractTool::LineStyle(typeLine)); + ChangeCurrentData(ui->comboBoxLineType, value); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(value)); } //--------------------------------------------------------------------------------------------------------------------- -QString DialogLineIntersectAxis::getAngle() const +QString DialogLineIntersectAxis::GetAngle() const { return qApp->FormulaFromUser(formulaAngle); } //--------------------------------------------------------------------------------------------------------------------- -void DialogLineIntersectAxis::setAngle(const QString &value) +void DialogLineIntersectAxis::SetAngle(const QString &value) { formulaAngle = qApp->FormulaToUser(value); // increase height if needed. TODO : see if I can get the max number of caracters in one line @@ -132,49 +124,61 @@ void DialogLineIntersectAxis::setAngle(const QString &value) this->DeployAngleTextEdit(); } ui->plainTextEditFormula->setPlainText(formulaAngle); - line->setAngle(formulaAngle); + line->SetAngle(formulaAngle); MoveCursorToEnd(ui->plainTextEditFormula); } //--------------------------------------------------------------------------------------------------------------------- -quint32 DialogLineIntersectAxis::getBasePointId() const +quint32 DialogLineIntersectAxis::GetBasePointId() const { - return basePointId; + return getCurrentObjectId(ui->comboBoxAxisPoint); } //--------------------------------------------------------------------------------------------------------------------- -void DialogLineIntersectAxis::setBasePointId(const quint32 &value) +void DialogLineIntersectAxis::SetBasePointId(const quint32 &value) { - setCurrentPointId(ui->comboBoxAxisPoint, basePointId, value); + setCurrentPointId(ui->comboBoxAxisPoint, value); line->setAxisPointId(value); } //--------------------------------------------------------------------------------------------------------------------- -quint32 DialogLineIntersectAxis::getFirstPointId() const +quint32 DialogLineIntersectAxis::GetFirstPointId() const { - return firstPointId; + return getCurrentObjectId(ui->comboBoxFirstLinePoint); } //--------------------------------------------------------------------------------------------------------------------- -void DialogLineIntersectAxis::setFirstPointId(const quint32 &value) +void DialogLineIntersectAxis::SetFirstPointId(const quint32 &value) { - setCurrentPointId(ui->comboBoxFirstLinePoint, firstPointId, value); + setCurrentPointId(ui->comboBoxFirstLinePoint, value); line->setPoint1Id(value); } //--------------------------------------------------------------------------------------------------------------------- -quint32 DialogLineIntersectAxis::getSecondPointId() const +quint32 DialogLineIntersectAxis::GetSecondPointId() const { - return secondPointId; + return getCurrentObjectId(ui->comboBoxSecondLinePoint); } //--------------------------------------------------------------------------------------------------------------------- -void DialogLineIntersectAxis::setSecondPointId(const quint32 &value) +void DialogLineIntersectAxis::SetSecondPointId(const quint32 &value) { - setCurrentPointId(ui->comboBoxSecondLinePoint, secondPointId, value); + setCurrentPointId(ui->comboBoxSecondLinePoint, value); line->setPoint2Id(value); } +//--------------------------------------------------------------------------------------------------------------------- +QString DialogLineIntersectAxis::GetLineColor() const +{ + return GetComboBoxCurrentData(ui->comboBoxLineColor); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogLineIntersectAxis::SetLineColor(const QString &value) +{ + ChangeCurrentData(ui->comboBoxLineColor, value); +} + //--------------------------------------------------------------------------------------------------------------------- void DialogLineIntersectAxis::ShowDialog(bool click) { @@ -185,7 +189,7 @@ void DialogLineIntersectAxis::ShowDialog(bool click) /*We will ignore click if poinet is in point circle*/ VMainGraphicsScene *scene = qApp->getCurrentScene(); SCASSERT(scene != nullptr); - const QSharedPointer point = data->GeometricObject(basePointId); + const QSharedPointer point = data->GeometricObject(GetBasePointId()); QLineF line = QLineF(point->toQPointF(), scene->getScenePos()); //Radius of point circle, but little bigger. Need handle with hover sizes. @@ -196,7 +200,7 @@ void DialogLineIntersectAxis::ShowDialog(bool click) } } this->setModal(true); - this->setAngle(line->Angle());//Show in dialog angle what user choose + this->SetAngle(line->Angle());//Show in dialog angle what user choose emit ToolTip(""); timerFormula->start(); this->show(); @@ -242,7 +246,6 @@ void DialogLineIntersectAxis::ChosenObject(quint32 id, const SceneObject &type) { if (SetObject(id, ui->comboBoxAxisPoint, "")) { - basePointId = id; line->setAxisPointId(id); line->RefreshGeometry(); prepare = true; @@ -323,20 +326,15 @@ void DialogLineIntersectAxis::ShowVisualization() void DialogLineIntersectAxis::SaveData() { pointName = ui->lineEditNamePoint->text(); - typeLine = GetTypeLine(ui->comboBoxLineType); formulaAngle = ui->plainTextEditFormula->toPlainText(); formulaAngle.replace("\n", " "); - basePointId = getCurrentObjectId(ui->comboBoxAxisPoint); - firstPointId = getCurrentObjectId(ui->comboBoxFirstLinePoint); - secondPointId = getCurrentObjectId(ui->comboBoxSecondLinePoint); - - line->setPoint1Id(firstPointId); - line->setPoint2Id(secondPointId); - line->setAxisPointId(basePointId); - line->setAngle(formulaAngle); - line->setLineStyle(VAbstractTool::LineStyle(typeLine)); + line->setPoint1Id(GetFirstPointId()); + line->setPoint2Id(GetSecondPointId()); + line->setAxisPointId(GetBasePointId()); + line->SetAngle(formulaAngle); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(GetTypeLine())); line->RefreshGeometry(); } diff --git a/src/app/dialogs/tools/dialoglineintersectaxis.h b/src/app/dialogs/tools/dialoglineintersectaxis.h index 73115d278..89975afa8 100644 --- a/src/app/dialogs/tools/dialoglineintersectaxis.h +++ b/src/app/dialogs/tools/dialoglineintersectaxis.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -45,23 +45,25 @@ public: DialogLineIntersectAxis(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogLineIntersectAxis(); - QString getPointName() const; - void setPointName(const QString &value); + void SetPointName(const QString &value); - QString getTypeLine() const; - void setTypeLine(const QString &value); + QString GetTypeLine() const; + void SetTypeLine(const QString &value); - QString getAngle() const; - void setAngle(const QString &value); + QString GetAngle() const; + void SetAngle(const QString &value); - quint32 getBasePointId() const; - void setBasePointId(const quint32 &value); + quint32 GetBasePointId() const; + void SetBasePointId(const quint32 &value); - quint32 getFirstPointId() const; - void setFirstPointId(const quint32 &value); + quint32 GetFirstPointId() const; + void SetFirstPointId(const quint32 &value); - quint32 getSecondPointId() const; - void setSecondPointId(const quint32 &value); + quint32 GetSecondPointId() const; + void SetSecondPointId(const quint32 &value); + + QString GetLineColor() const; + void SetLineColor(const QString &value); virtual void ShowDialog(bool click); public slots: @@ -82,16 +84,7 @@ private: Q_DISABLE_COPY(DialogLineIntersectAxis) Ui::DialogLineIntersectAxis *ui; - /** @brief number number of handled objects */ - qint32 number; - - /** @brief typeLine type of line */ - QString typeLine; - QString formulaAngle; - quint32 basePointId; - quint32 firstPointId; - quint32 secondPointId; int formulaBaseHeightAngle; VisToolLineIntersectAxis *line; diff --git a/src/app/dialogs/tools/dialoglineintersectaxis.ui b/src/app/dialogs/tools/dialoglineintersectaxis.ui index 31909167f..1e4d9bc4a 100644 --- a/src/app/dialogs/tools/dialoglineintersectaxis.ui +++ b/src/app/dialogs/tools/dialoglineintersectaxis.ui @@ -7,11 +7,11 @@ 0 0 457 - 532 + 565 - Line intersect axis + Point intersect line and axis @@ -97,22 +97,12 @@ - - - Calculate value - + - ... + - - - :/icon/24x24/equal.png:/icon/24x24/equal.png - - - - 24 - 24 - + + :/icon/24x24/equal.png @@ -226,7 +216,7 @@ - First point of line + Axis Point @@ -266,7 +256,7 @@ - First point of line + Second point of line @@ -302,11 +292,39 @@ + + + 80 + 0 + + + + + 110 + 16777215 + + Show line from first point to this point + + + 80 + 14 + + + + + + Line color + + + + + + @@ -480,7 +498,6 @@ plainTextEditFormula toolButtonPutHereAngle - toolButtonEqualAngle pushButtonGrowLengthAngle comboBoxAxisPoint comboBoxFirstLinePoint diff --git a/src/app/dialogs/tools/dialognormal.cpp b/src/app/dialogs/tools/dialognormal.cpp index 2901361aa..f56b1e8c7 100644 --- a/src/app/dialogs/tools/dialognormal.cpp +++ b/src/app/dialogs/tools/dialognormal.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -39,8 +39,8 @@ * @param parent parent widget */ DialogNormal::DialogNormal(const VContainer *data, const quint32 &toolId, QWidget *parent) - :DialogTool(data, toolId, parent), ui(new Ui::DialogNormal), number(0), typeLine(QString()), - formula(QString()), angle(0), firstPointId(NULL_ID), secondPointId(NULL_ID), formulaBaseHeight(0), line(nullptr) + :DialogTool(data, toolId, parent), ui(new Ui::DialogNormal), formula(QString()), angle(0), formulaBaseHeight(0), + line(nullptr) { ui->setupUi(this); InitVariables(ui); @@ -56,13 +56,13 @@ DialogNormal::DialogNormal(const VContainer *data, const quint32 &toolId, QWidge FillComboBoxPoints(ui->comboBoxFirstPoint); FillComboBoxPoints(ui->comboBoxSecondPoint); - FillComboBoxTypeLine(ui->comboBoxLineType); + FillComboBoxTypeLine(ui->comboBoxLineType, VAbstractTool::LineStylesPics()); + FillComboBoxLineColors(ui->comboBoxLineColor); InitArrow(ui); connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogNormal::PutHere); connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogNormal::PutVal); - connect(ui->toolButtonEqual, &QPushButton::clicked, this, &DialogNormal::EvalFormula); connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogNormal::NamePointChanged); connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogNormal::FormulaTextChanged); connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogNormal::DeployFormulaTextEdit); @@ -172,18 +172,15 @@ void DialogNormal::ChosenObject(quint32 id, const SceneObject &type) void DialogNormal::SaveData() { pointName = ui->lineEditNamePoint->text(); - typeLine = GetTypeLine(ui->comboBoxLineType); formula = ui->plainTextEditFormula->toPlainText(); formula.replace("\n", " "); angle = ui->doubleSpinBoxAngle->value(); - firstPointId = getCurrentObjectId(ui->comboBoxFirstPoint); - secondPointId = getCurrentObjectId(ui->comboBoxSecondPoint); - line->setPoint1Id(firstPointId); - line->setPoint2Id(secondPointId); + line->setPoint1Id(GetFirstPointId()); + line->setPoint2Id(GetSecondPointId()); line->setLength(formula); - line->setAngle(angle); - line->setLineStyle(VAbstractTool::LineStyle(typeLine)); + line->SetAngle(angle); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(GetTypeLine())); line->RefreshGeometry(); } @@ -196,44 +193,56 @@ void DialogNormal::closeEvent(QCloseEvent *event) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setSecondPointId set id of second point + * @brief SetSecondPointId set id of second point * @param value id */ -void DialogNormal::setSecondPointId(const quint32 &value) +void DialogNormal::SetSecondPointId(const quint32 &value) { - setPointId(ui->comboBoxSecondPoint, secondPointId, value); + setCurrentPointId(ui->comboBoxSecondPoint, value); line->setPoint2Id(value); } +//--------------------------------------------------------------------------------------------------------------------- +QString DialogNormal::GetLineColor() const +{ + return GetComboBoxCurrentData(ui->comboBoxLineColor); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogNormal::SetLineColor(const QString &value) +{ + ChangeCurrentData(ui->comboBoxLineColor, value); +} + //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setFirstPointId set id of first point + * @brief SetFirstPointId set id of first point * @param value id */ -void DialogNormal::setFirstPointId(const quint32 &value) +void DialogNormal::SetFirstPointId(const quint32 &value) { - setPointId(ui->comboBoxFirstPoint, firstPointId, value); + setCurrentPointId(ui->comboBoxFirstPoint, value); line->setPoint1Id(value); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setAngle set aditional angle of normal + * @brief SetAngle set aditional angle of normal * @param value angle in degree */ -void DialogNormal::setAngle(const qreal &value) +void DialogNormal::SetAngle(const qreal &value) { angle = value; ui->doubleSpinBoxAngle->setValue(angle); - line->setAngle(angle); + line->SetAngle(angle); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setFormula set string of formula + * @brief SetFormula set string of formula * @param value formula */ -void DialogNormal::setFormula(const QString &value) +void DialogNormal::SetFormula(const QString &value) { formula = qApp->FormulaToUser(value); // increase height if needed. @@ -248,23 +257,72 @@ void DialogNormal::setFormula(const QString &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setTypeLine set type of line + * @brief SetTypeLine set type of line * @param value type */ -void DialogNormal::setTypeLine(const QString &value) +void DialogNormal::SetTypeLine(const QString &value) { - typeLine = value; - SetupTypeLine(ui->comboBoxLineType, value); - line->setLineStyle(VAbstractTool::LineStyle(typeLine)); + ChangeCurrentData(ui->comboBoxLineType, value); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(value)); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setPointName set name of point + * @brief SetPointName set name of point * @param value name */ -void DialogNormal::setPointName(const QString &value) +void DialogNormal::SetPointName(const QString &value) { pointName = value; ui->lineEditNamePoint->setText(pointName); } + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetTypeLine return type of line + * @return type + */ +QString DialogNormal::GetTypeLine() const +{ + return GetComboBoxCurrentData(ui->comboBoxLineType); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetFormula return string of formula + * @return formula + */ +QString DialogNormal::GetFormula() const +{ + return qApp->FormulaFromUser(formula); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetAngle return aditional angle of normal + * @return angle in degree + */ +qreal DialogNormal::GetAngle() const +{ + return angle; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetFirstPointId return id of first point + * @return id + */ +quint32 DialogNormal::GetFirstPointId() const +{ + return getCurrentObjectId(ui->comboBoxFirstPoint); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetSecondPointId return id of second point + * @return id + */ +quint32 DialogNormal::GetSecondPointId() const +{ + return getCurrentObjectId(ui->comboBoxSecondPoint); +} diff --git a/src/app/dialogs/tools/dialognormal.h b/src/app/dialogs/tools/dialognormal.h index 0b346d473..4cf31b9df 100644 --- a/src/app/dialogs/tools/dialognormal.h +++ b/src/app/dialogs/tools/dialognormal.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -48,23 +48,25 @@ public: DialogNormal(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogNormal(); - QString getPointName() const; - void setPointName(const QString &value); + void SetPointName(const QString &value); - QString getTypeLine() const; - void setTypeLine(const QString &value); + QString GetTypeLine() const; + void SetTypeLine(const QString &value); - QString getFormula() const; - void setFormula(const QString &value); + QString GetFormula() const; + void SetFormula(const QString &value); - qreal getAngle() const; - void setAngle(const qreal &value); + qreal GetAngle() const; + void SetAngle(const qreal &value); - quint32 getFirstPointId() const; - void setFirstPointId(const quint32 &value); + quint32 GetFirstPointId() const; + void SetFirstPointId(const quint32 &value); - quint32 getSecondPointId() const; - void setSecondPointId(const quint32 &value); + quint32 GetSecondPointId() const; + void SetSecondPointId(const quint32 &value); + + QString GetLineColor() const; + void SetLineColor(const QString &value); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); /** @@ -89,88 +91,16 @@ private: /** @brief ui keeps information about user interface */ Ui::DialogNormal *ui; - /** @brief number number of handled objects */ - qint32 number; - - /** @brief typeLine type of line */ - QString typeLine; - /** @brief formula formula */ QString formula; /** @brief angle aditional angle of normal */ qreal angle; - /** @brief firstPointId id first point of line */ - quint32 firstPointId; - - /** @brief secondPointId id second point of line */ - quint32 secondPointId; - /** @brief formulaBaseHeight base height defined by dialogui */ int formulaBaseHeight; VisToolNormal *line; }; -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getPointName return name of point - * @return name - */ -inline QString DialogNormal::getPointName() const -{ - return pointName; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getTypeLine return type of line - * @return type - */ -inline QString DialogNormal::getTypeLine() const -{ - return typeLine; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getFormula return string of formula - * @return formula - */ -inline QString DialogNormal::getFormula() const -{ - return qApp->FormulaFromUser(formula); -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getAngle return aditional angle of normal - * @return angle in degree - */ -inline qreal DialogNormal::getAngle() const -{ - return angle; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getFirstPointId return id of first point - * @return id - */ -inline quint32 DialogNormal::getFirstPointId() const -{ - return firstPointId; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getSecondPointId return id of second point - * @return id - */ -inline quint32 DialogNormal::getSecondPointId() const -{ - return secondPointId; -} - #endif // DIALOGNORMAL_H diff --git a/src/app/dialogs/tools/dialognormal.ui b/src/app/dialogs/tools/dialognormal.ui index 492531abe..42ae2e583 100644 --- a/src/app/dialogs/tools/dialognormal.ui +++ b/src/app/dialogs/tools/dialognormal.ui @@ -7,11 +7,11 @@ 0 0 517 - 645 + 678 - Normal + Point along perpendicular @@ -107,22 +107,12 @@ - - - Calculate value - + - ... + - - - :/icon/24x24/equal.png:/icon/24x24/equal.png - - - - 24 - 24 - + + :/icon/24x24/equal.png @@ -245,7 +235,11 @@ - + + + First point of line + + @@ -261,7 +255,11 @@ - + + + Second point of line + + @@ -472,26 +470,54 @@ - - - - - - Type of line - - - - - - - Show line from first point to this point - - - - - + + + + + + Type of line + + + + + + + + 80 + 0 + + + + + 110 + 16777215 + + + + Show line from first point to this point + + + + 80 + 14 + + + + + + + + + + + Line color + + + + + @@ -657,7 +683,6 @@ plainTextEditFormula toolButtonPutHere - toolButtonEqual pushButtonGrowLength lineEditNamePoint comboBoxFirstPoint @@ -671,7 +696,6 @@ toolButtonArrowLeftDown toolButtonArrowLeft toolButtonArrowLeftUp - comboBoxLineType radioButtonSizeGrowth radioButtonStandardTable radioButtonIncrements diff --git a/src/app/dialogs/tools/dialogpointofcontact.cpp b/src/app/dialogs/tools/dialogpointofcontact.cpp index 27e6e3ae3..8476ea8ec 100644 --- a/src/app/dialogs/tools/dialogpointofcontact.cpp +++ b/src/app/dialogs/tools/dialogpointofcontact.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -41,8 +41,8 @@ * @param parent parent widget */ DialogPointOfContact::DialogPointOfContact(const VContainer *data, const quint32 &toolId, QWidget *parent) - :DialogTool(data, toolId, parent), ui(new Ui::DialogPointOfContact), number(0), - radius(QString()), center(NULL_ID), firstPoint(NULL_ID), secondPoint(NULL_ID), formulaBaseHeight(0), line(nullptr) + :DialogTool(data, toolId, parent), ui(new Ui::DialogPointOfContact), + radius(QString()), formulaBaseHeight(0), line(nullptr) { ui->setupUi(this); InitVariables(ui); @@ -62,7 +62,6 @@ DialogPointOfContact::DialogPointOfContact(const VContainer *data, const quint32 connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogPointOfContact::PutHere); connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogPointOfContact::PutVal); - connect(ui->listWidget, &QListWidget::currentRowChanged, this, &DialogPointOfContact::ValChenged); if (qApp->patternType() == MeasurementsType::Standard) { @@ -79,7 +78,6 @@ DialogPointOfContact::DialogPointOfContact(const VContainer *data, const quint32 connect(ui->radioButtonLengthLine, &QRadioButton::clicked, this, &DialogPointOfContact::LengthLines); connect(ui->radioButtonLengthArc, &QRadioButton::clicked, this, &DialogPointOfContact::LengthArcs); connect(ui->radioButtonLengthSpline, &QRadioButton::clicked, this, &DialogPointOfContact::LengthCurves); - connect(ui->toolButtonEqual, &QPushButton::clicked, this, &DialogPointOfContact::EvalFormula); connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogPointOfContact::NamePointChanged); connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogPointOfContact::FormulaTextChanged); connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogPointOfContact::DeployFormulaTextEdit); @@ -217,13 +215,10 @@ void DialogPointOfContact::SaveData() pointName = ui->lineEditNamePoint->text(); radius = ui->plainTextEditFormula->toPlainText(); radius.replace("\n", " "); - center = getCurrentObjectId(ui->comboBoxCenter); - firstPoint = getCurrentObjectId(ui->comboBoxFirstPoint); - secondPoint = getCurrentObjectId(ui->comboBoxSecondPoint); - line->setPoint1Id(firstPoint); - line->setLineP2Id(secondPoint); - line->setRadiusId(center); + line->setPoint1Id(GetFirstPoint()); + line->setLineP2Id(GetSecondPoint()); + line->setRadiusId(getCenter()); line->setRadius(radius); line->RefreshGeometry(); } @@ -237,24 +232,24 @@ void DialogPointOfContact::closeEvent(QCloseEvent *event) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setSecondPoint set id second point + * @brief SetSecondPoint set id second point * @param value id */ -void DialogPointOfContact::setSecondPoint(const quint32 &value) +void DialogPointOfContact::SetSecondPoint(const quint32 &value) { - setPointId(ui->comboBoxSecondPoint, secondPoint, value); - line->setLineP2Id(secondPoint); + setCurrentPointId(ui->comboBoxSecondPoint, value); + line->setLineP2Id(value); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setFirstPoint set id first point + * @brief SetFirstPoint set id first point * @param value id */ -void DialogPointOfContact::setFirstPoint(const quint32 &value) +void DialogPointOfContact::SetFirstPoint(const quint32 &value) { - setPointId(ui->comboBoxFirstPoint, firstPoint, value); - line->setPoint1Id(firstPoint); + setCurrentPointId(ui->comboBoxFirstPoint, value); + line->setPoint1Id(value); } //--------------------------------------------------------------------------------------------------------------------- @@ -264,8 +259,8 @@ void DialogPointOfContact::setFirstPoint(const quint32 &value) */ void DialogPointOfContact::setCenter(const quint32 &value) { - setPointId(ui->comboBoxCenter, center, value); - line->setRadiusId(center); + setCurrentPointId(ui->comboBoxCenter, value); + line->setRadiusId(value); } //--------------------------------------------------------------------------------------------------------------------- @@ -275,7 +270,7 @@ void DialogPointOfContact::setCenter(const quint32 &value) */ void DialogPointOfContact::setRadius(const QString &value) { - radius = value; + radius = qApp->FormulaToUser(value); // increase height if needed. if (radius.length() > 80) { @@ -288,11 +283,51 @@ void DialogPointOfContact::setRadius(const QString &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setPointName set name of point + * @brief SetPointName set name of point * @param value name */ -void DialogPointOfContact::setPointName(const QString &value) +void DialogPointOfContact::SetPointName(const QString &value) { pointName = value; ui->lineEditNamePoint->setText(pointName); } + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getRadius return formula radius of arc + * @return formula + */ +QString DialogPointOfContact::getRadius() const +{ + return qApp->FormulaFromUser(radius); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetCenter return id of center point + * @return id + */ +quint32 DialogPointOfContact::getCenter() const +{ + return getCurrentObjectId(ui->comboBoxCenter); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetFirstPoint return id first point + * @return id + */ +quint32 DialogPointOfContact::GetFirstPoint() const +{ + return getCurrentObjectId(ui->comboBoxFirstPoint);; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetSecondPoint return id second point + * @return id + */ +quint32 DialogPointOfContact::GetSecondPoint() const +{ + return getCurrentObjectId(ui->comboBoxSecondPoint); +} diff --git a/src/app/dialogs/tools/dialogpointofcontact.h b/src/app/dialogs/tools/dialogpointofcontact.h index 2b7126f3e..54ec9fdcf 100644 --- a/src/app/dialogs/tools/dialogpointofcontact.h +++ b/src/app/dialogs/tools/dialogpointofcontact.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -49,8 +49,7 @@ public: DialogPointOfContact(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); virtual ~DialogPointOfContact(); - QString getPointName() const; - void setPointName(const QString &value); + void SetPointName(const QString &value); QString getRadius() const; void setRadius(const QString &value); @@ -58,11 +57,11 @@ public: quint32 getCenter() const; void setCenter(const quint32 &value); - quint32 getFirstPoint() const; - void setFirstPoint(const quint32 &value); + quint32 GetFirstPoint() const; + void SetFirstPoint(const quint32 &value); - quint32 getSecondPoint() const; - void setSecondPoint(const quint32 &value); + quint32 GetSecondPoint() const; + void SetSecondPoint(const quint32 &value); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); /** @@ -87,75 +86,13 @@ private: /** @brief ui keeps information about user interface */ Ui::DialogPointOfContact *ui; - /** @brief number number of handled objects */ - qint32 number; - /** @brief radius radius of arc */ QString radius; - /** @brief center id center point of arc */ - quint32 center; - - /** @brief firstPoint id first point of line */ - quint32 firstPoint; - - /** @brief secondPoint id second point of line */ - quint32 secondPoint; - /** @brief formulaBaseHeight base height defined by dialogui */ int formulaBaseHeight; VisToolPointOfContact *line; }; -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getPointName return name of point - * @return name - */ -inline QString DialogPointOfContact::getPointName() const -{ - return pointName; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getRadius return formula radius of arc - * @return formula - */ -inline QString DialogPointOfContact::getRadius() const -{ - return radius; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief GetCenter return id of center point - * @return id - */ -inline quint32 DialogPointOfContact::getCenter() const -{ - return center; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getFirstPoint return id first point - * @return id - */ -inline quint32 DialogPointOfContact::getFirstPoint() const -{ - return firstPoint; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getSecondPoint return id second point - * @return id - */ -inline quint32 DialogPointOfContact::getSecondPoint() const -{ - return secondPoint; -} - #endif // DIALOGPOINTOFCONTACT_H diff --git a/src/app/dialogs/tools/dialogpointofcontact.ui b/src/app/dialogs/tools/dialogpointofcontact.ui index e74fd80ca..8dee56fac 100644 --- a/src/app/dialogs/tools/dialogpointofcontact.ui +++ b/src/app/dialogs/tools/dialogpointofcontact.ui @@ -11,7 +11,7 @@ - Point of contact + Point at intersection of arc and line @@ -107,22 +107,12 @@ - - - Calculate value - + - ... + - - - :/icon/24x24/equal.png:/icon/24x24/equal.png - - - - 24 - 24 - + + :/icon/24x24/equal.png @@ -317,10 +307,22 @@ - 145 + 80 0 + + + 110 + 16777215 + + + + + 80 + 14 + + @@ -490,7 +492,6 @@ plainTextEditFormula toolButtonPutHere - toolButtonEqual pushButtonGrowLength lineEditNamePoint comboBoxCenter diff --git a/src/app/dialogs/tools/dialogpointofintersection.cpp b/src/app/dialogs/tools/dialogpointofintersection.cpp index 4474e067e..f45a41a2d 100644 --- a/src/app/dialogs/tools/dialogpointofintersection.cpp +++ b/src/app/dialogs/tools/dialogpointofintersection.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -42,8 +42,7 @@ * @param parent parent widget */ DialogPointOfIntersection::DialogPointOfIntersection(const VContainer *data, const quint32 &toolId, QWidget *parent) - :DialogTool(data, toolId, parent), ui(new Ui::DialogPointOfIntersection), number(0), - firstPointId(NULL_ID), secondPointId(NULL_ID), line(nullptr) + :DialogTool(data, toolId, parent), ui(new Ui::DialogPointOfIntersection), line(nullptr) { ui->setupUi(this); ui->lineEditNamePoint->setText(qApp->getCurrentDocument()->GenerateLabel(LabelType::NewLabel)); @@ -62,6 +61,7 @@ DialogPointOfIntersection::DialogPointOfIntersection(const VContainer *data, con this, &DialogPointOfIntersection::PointNameChanged); line = new VisToolPointOfIntersection(data); + line->VisualMode(NULL_ID); } //--------------------------------------------------------------------------------------------------------------------- @@ -76,13 +76,13 @@ DialogPointOfIntersection::~DialogPointOfIntersection() //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setSecondPointId set id of second point + * @brief SetSecondPointId set id of second point * @param value id */ -void DialogPointOfIntersection::setSecondPointId(const quint32 &value) +void DialogPointOfIntersection::SetSecondPointId(const quint32 &value) { - setPointId(ui->comboBoxSecondPoint, secondPointId, value); - line->setPoint2Id(secondPointId); + setCurrentPointId(ui->comboBoxSecondPoint, value); + line->setPoint2Id(value); } //--------------------------------------------------------------------------------------------------------------------- @@ -100,10 +100,11 @@ void DialogPointOfIntersection::ChosenObject(quint32 id, const SceneObject &type switch (number) { case 0: - if (SetObject(id, ui->comboBoxFirstPoint, tr("Select point horizontally"))) + if (SetObject(id, ui->comboBoxFirstPoint, tr("Select point for Y value (horizontal)"))) { number++; - line->VisualMode(id); + line->setPoint1Id(id); + line->RefreshGeometry(); } break; case 1: @@ -130,11 +131,9 @@ void DialogPointOfIntersection::ChosenObject(quint32 id, const SceneObject &type void DialogPointOfIntersection::SaveData() { pointName = ui->lineEditNamePoint->text(); - firstPointId = getCurrentObjectId(ui->comboBoxFirstPoint); - secondPointId = getCurrentObjectId(ui->comboBoxSecondPoint); - line->setPoint1Id(firstPointId); - line->setPoint2Id(secondPointId); + line->setPoint1Id(GetFirstPointId()); + line->setPoint2Id(GetSecondPointId()); line->RefreshGeometry(); } @@ -173,29 +172,48 @@ void DialogPointOfIntersection::ShowVisualization() { VMainGraphicsScene *scene = qApp->getCurrentScene(); connect(scene, &VMainGraphicsScene::NewFactor, line, &VisLine::SetFactor); - scene->addItem(line); line->RefreshGeometry(); } } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setFirstPointId set id of first point + * @brief SetFirstPointId set id of first point * @param value id */ -void DialogPointOfIntersection::setFirstPointId(const quint32 &value) +void DialogPointOfIntersection::SetFirstPointId(const quint32 &value) { - setPointId(ui->comboBoxFirstPoint, firstPointId, value); - line->setPoint1Id(firstPointId); + setCurrentPointId(ui->comboBoxFirstPoint, value); + line->setPoint1Id(value); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setPointName set name of point + * @brief SetPointName set name of point * @param value name */ -void DialogPointOfIntersection::setPointName(const QString &value) +void DialogPointOfIntersection::SetPointName(const QString &value) { pointName = value; ui->lineEditNamePoint->setText(pointName); } + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetFirstPointId return id of first point + * @return id + */ +quint32 DialogPointOfIntersection::GetFirstPointId() const +{ + return getCurrentObjectId(ui->comboBoxFirstPoint); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetSecondPointId return id of second point + * @return id + */ +quint32 DialogPointOfIntersection::GetSecondPointId() const +{ + return getCurrentObjectId(ui->comboBoxSecondPoint); +} diff --git a/src/app/dialogs/tools/dialogpointofintersection.h b/src/app/dialogs/tools/dialogpointofintersection.h index 00fb7648b..b9115c8cc 100644 --- a/src/app/dialogs/tools/dialogpointofintersection.h +++ b/src/app/dialogs/tools/dialogpointofintersection.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -48,14 +48,13 @@ public: DialogPointOfIntersection(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogPointOfIntersection(); - QString getPointName() const; - void setPointName(const QString &value); + void SetPointName(const QString &value); - quint32 getFirstPointId() const; - void setFirstPointId(const quint32 &value); + quint32 GetFirstPointId() const; + void SetFirstPointId(const quint32 &value); - quint32 getSecondPointId() const; - void setSecondPointId(const quint32 &value); + quint32 GetSecondPointId() const; + void SetSecondPointId(const quint32 &value); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); virtual void PointNameChanged(); @@ -72,45 +71,7 @@ private: /** @brief ui keeps information about user interface */ Ui::DialogPointOfIntersection *ui; - /** @brief number number of handled objects */ - qint32 number; - - /** @brief firstPointId id first point of line */ - quint32 firstPointId; - - /** @brief secondPointId id second point of line */ - quint32 secondPointId; VisToolPointOfIntersection *line; }; -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getPointName return name of point - * @return name - */ -inline QString DialogPointOfIntersection::getPointName() const -{ - return pointName; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getFirstPointId return id of first point - * @return id - */ -inline quint32 DialogPointOfIntersection::getFirstPointId() const -{ - return firstPointId; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getSecondPointId return id of second point - * @return id - */ -inline quint32 DialogPointOfIntersection::getSecondPointId() const -{ - return secondPointId; -} - #endif // DIALOGPOINTOFINTERSECTION_H diff --git a/src/app/dialogs/tools/dialogpointofintersection.ui b/src/app/dialogs/tools/dialogpointofintersection.ui index d79a9035a..26f11dbbf 100644 --- a/src/app/dialogs/tools/dialogpointofintersection.ui +++ b/src/app/dialogs/tools/dialogpointofintersection.ui @@ -11,7 +11,7 @@ - Point of intersection + Point from X and Y of two other points @@ -58,7 +58,7 @@ - vertical point + X: vertical point @@ -78,7 +78,7 @@ - horizontal point + Y: horizontal point diff --git a/src/app/dialogs/tools/dialogshoulderpoint.cpp b/src/app/dialogs/tools/dialogshoulderpoint.cpp index d2c5d4521..428aba82a 100644 --- a/src/app/dialogs/tools/dialogshoulderpoint.cpp +++ b/src/app/dialogs/tools/dialogshoulderpoint.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -42,9 +42,8 @@ * @param parent parent widget */ DialogShoulderPoint::DialogShoulderPoint(const VContainer *data, const quint32 &toolId, QWidget *parent) - :DialogTool(data, toolId, parent), ui(new Ui::DialogShoulderPoint), number(0), - typeLine(QString()), formula(QString()), p1Line(NULL_ID), p2Line(NULL_ID), pShoulder(NULL_ID), formulaBaseHeight(0), - line (nullptr) + :DialogTool(data, toolId, parent), ui(new Ui::DialogShoulderPoint), formula(QString()), + formulaBaseHeight(0), line (nullptr) { ui->setupUi(this); InitVariables(ui); @@ -58,14 +57,14 @@ DialogShoulderPoint::DialogShoulderPoint(const VContainer *data, const quint32 & flagFormula = false; CheckState(); - FillComboBoxTypeLine(ui->comboBoxLineType); + FillComboBoxTypeLine(ui->comboBoxLineType, VAbstractTool::LineStylesPics()); FillComboBoxPoints(ui->comboBoxP1Line); FillComboBoxPoints(ui->comboBoxP2Line); FillComboBoxPoints(ui->comboBoxP3); + FillComboBoxLineColors(ui->comboBoxLineColor); connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogShoulderPoint::PutHere); connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogShoulderPoint::PutVal); - connect(ui->toolButtonEqual, &QPushButton::clicked, this, &DialogShoulderPoint::EvalFormula); connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogShoulderPoint::NamePointChanged); connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogShoulderPoint::FormulaTextChanged); connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogShoulderPoint::DeployFormulaTextEdit); @@ -201,18 +200,14 @@ void DialogShoulderPoint::ChosenObject(quint32 id, const SceneObject &type) void DialogShoulderPoint::SaveData() { pointName = ui->lineEditNamePoint->text(); - typeLine = GetTypeLine(ui->comboBoxLineType); formula = ui->plainTextEditFormula->toPlainText(); formula.replace("\n", " "); - p1Line = getCurrentObjectId(ui->comboBoxP1Line); - p2Line = getCurrentObjectId(ui->comboBoxP2Line); - pShoulder = getCurrentObjectId(ui->comboBoxP3); - line->setPoint1Id(pShoulder); - line->setLineP1Id(p1Line); - line->setLineP2Id(p2Line); + line->setPoint1Id(GetP3()); + line->setLineP1Id(GetP1Line()); + line->setLineP2Id(GetP2Line()); line->setLength(formula); - line->setLineStyle(VAbstractTool::LineStyle(typeLine)); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(GetTypeLine())); line->RefreshGeometry(); } @@ -228,40 +223,52 @@ void DialogShoulderPoint::closeEvent(QCloseEvent *event) * @brief setPShoulder set id shoulder point * @param value id */ -void DialogShoulderPoint::setP3(const quint32 &value) +void DialogShoulderPoint::SetP3(const quint32 &value) { - setPointId(ui->comboBoxP3, pShoulder, value); - line->setPoint1Id(pShoulder); + setCurrentPointId(ui->comboBoxP3, value); + line->setPoint1Id(value); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogShoulderPoint::GetLineColor() const +{ + return GetComboBoxCurrentData(ui->comboBoxLineColor); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogShoulderPoint::SetLineColor(const QString &value) +{ + ChangeCurrentData(ui->comboBoxLineColor, value); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setP2Line set id second point of line + * @brief SetP2Line set id second point of line * @param value id */ -void DialogShoulderPoint::setP2Line(const quint32 &value) +void DialogShoulderPoint::SetP2Line(const quint32 &value) { - setPointId(ui->comboBoxP2Line, p2Line, value); - line->setLineP2Id(p2Line); + setCurrentPointId(ui->comboBoxP2Line, value); + line->setLineP2Id(value); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setP1Line set id first point of line + * @brief SetP1Line set id first point of line * @param value id */ -void DialogShoulderPoint::setP1Line(const quint32 &value) +void DialogShoulderPoint::SetP1Line(const quint32 &value) { - setPointId(ui->comboBoxP1Line, p1Line, value); - line->setLineP1Id(p1Line); + setCurrentPointId(ui->comboBoxP1Line, value); + line->setLineP1Id(value); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setFormula set string of formula + * @brief SetFormula set string of formula * @param value formula */ -void DialogShoulderPoint::setFormula(const QString &value) +void DialogShoulderPoint::SetFormula(const QString &value) { formula = qApp->FormulaToUser(value); // increase height if needed. @@ -276,23 +283,72 @@ void DialogShoulderPoint::setFormula(const QString &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setTypeLine set type of line + * @brief SetTypeLine set type of line * @param value type */ -void DialogShoulderPoint::setTypeLine(const QString &value) +void DialogShoulderPoint::SetTypeLine(const QString &value) { - typeLine = value; - SetupTypeLine(ui->comboBoxLineType, value); - line->setLineStyle(VAbstractTool::LineStyle(typeLine)); + ChangeCurrentData(ui->comboBoxLineType, value); + line->setLineStyle(VAbstractTool::LineStyleToPenStyle(value)); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setPointName set name of point + * @brief SetPointName set name of point * @param value name */ -void DialogShoulderPoint::setPointName(const QString &value) +void DialogShoulderPoint::SetPointName(const QString &value) { pointName = value; ui->lineEditNamePoint->setText(pointName); } + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetTypeLine return type of line + * @return type + */ +QString DialogShoulderPoint::GetTypeLine() const +{ + return GetComboBoxCurrentData(ui->comboBoxLineType); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetFormula return string of formula + * @return formula + */ +QString DialogShoulderPoint::GetFormula() const +{ + return qApp->FormulaFromUser(formula); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetP1Line return id first point of line + * @return id + */ +quint32 DialogShoulderPoint::GetP1Line() const +{ + return getCurrentObjectId(ui->comboBoxP1Line); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetP2Line return id second point of line + * @return id + */ +quint32 DialogShoulderPoint::GetP2Line() const +{ + return getCurrentObjectId(ui->comboBoxP2Line); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getPShoulder return id shoulder point + * @return id + */ +quint32 DialogShoulderPoint::GetP3() const +{ + return getCurrentObjectId(ui->comboBoxP3); +} diff --git a/src/app/dialogs/tools/dialogshoulderpoint.h b/src/app/dialogs/tools/dialogshoulderpoint.h index 47c1d489c..c2b2de437 100644 --- a/src/app/dialogs/tools/dialogshoulderpoint.h +++ b/src/app/dialogs/tools/dialogshoulderpoint.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -48,23 +48,25 @@ public: DialogShoulderPoint(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogShoulderPoint(); - QString getPointName() const; - void setPointName(const QString &value); + void SetPointName(const QString &value); - QString getTypeLine() const; - void setTypeLine(const QString &value); + QString GetTypeLine() const; + void SetTypeLine(const QString &value); - QString getFormula() const; - void setFormula(const QString &value); + QString GetFormula() const; + void SetFormula(const QString &value); - quint32 getP1Line() const; - void setP1Line(const quint32 &value); + quint32 GetP1Line() const; + void SetP1Line(const quint32 &value); - quint32 getP2Line() const; - void setP2Line(const quint32 &value); + quint32 GetP2Line() const; + void SetP2Line(const quint32 &value); - quint32 getP3() const; - void setP3(const quint32 &value); + quint32 GetP3() const; + void SetP3(const quint32 &value); + + QString GetLineColor() const; + void SetLineColor(const QString &value); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); /** @@ -89,87 +91,12 @@ private: /** @brief ui keeps information about user interface */ Ui::DialogShoulderPoint *ui; - /** @brief number number of handled objects */ - qint32 number; - - /** @brief typeLine type of line */ - QString typeLine; - /** @brief formula formula */ QString formula; - /** @brief p1Line id first point of line */ - quint32 p1Line; - - /** @brief p2Line id second point of line */ - quint32 p2Line; - - /** @brief pShoulder id shoulder point */ - quint32 pShoulder; - /** @brief formulaBaseHeight base height defined by dialogui */ int formulaBaseHeight; VisToolShoulderPoint *line; }; -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getPointName return name of point - * @return name - */ -inline QString DialogShoulderPoint::getPointName() const -{ - return pointName; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getTypeLine return type of line - * @return type - */ -inline QString DialogShoulderPoint::getTypeLine() const -{ - return typeLine; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getFormula return string of formula - * @return formula - */ -inline QString DialogShoulderPoint::getFormula() const -{ - return qApp->FormulaFromUser(formula); -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getP1Line return id first point of line - * @return id - */ -inline quint32 DialogShoulderPoint::getP1Line() const -{ - return p1Line; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getP2Line return id second point of line - * @return id - */ -inline quint32 DialogShoulderPoint::getP2Line() const -{ - return p2Line; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getPShoulder return id shoulder point - * @return id - */ -inline quint32 DialogShoulderPoint::getP3() const -{ - return pShoulder; -} - #endif // DIALOGSHOULDERPOINT_H diff --git a/src/app/dialogs/tools/dialogshoulderpoint.ui b/src/app/dialogs/tools/dialogshoulderpoint.ui index 996d5cbee..0bc344bb6 100644 --- a/src/app/dialogs/tools/dialogshoulderpoint.ui +++ b/src/app/dialogs/tools/dialogshoulderpoint.ui @@ -7,11 +7,11 @@ 0 0 488 - 532 + 565 - Point of shoulder + Special point on shoulder @@ -107,22 +107,12 @@ - - - Calculate value - + - ... + - - - :/icon/24x24/equal.png:/icon/24x24/equal.png - - - - 24 - 24 - + + :/icon/24x24/equal.png @@ -341,11 +331,39 @@ 0 + + + 80 + 0 + + + + + 110 + 16777215 + + Show line from first point to our point + + + 80 + 14 + + + + + + Line color + + + + + + @@ -513,7 +531,6 @@ plainTextEditFormula toolButtonPutHere - toolButtonEqual pushButtonGrowLength lineEditNamePoint comboBoxP1Line diff --git a/src/app/dialogs/tools/dialogsinglepoint.cpp b/src/app/dialogs/tools/dialogsinglepoint.cpp index 3c95d069c..f5fc1ca02 100644 --- a/src/app/dialogs/tools/dialogsinglepoint.cpp +++ b/src/app/dialogs/tools/dialogsinglepoint.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -92,7 +92,7 @@ void DialogSinglePoint::UpdateList() * @param name name of point * @param point data for point */ -void DialogSinglePoint::setData(const QString &name, const QPointF &point) +void DialogSinglePoint::SetData(const QString &name, const QPointF &point) { pointName = name; this->point = point; @@ -107,3 +107,13 @@ DialogSinglePoint::~DialogSinglePoint() { delete ui; } + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getPoint return point + * @return point + */ +QPointF DialogSinglePoint::GetPoint() const +{ + return point; +} diff --git a/src/app/dialogs/tools/dialogsinglepoint.h b/src/app/dialogs/tools/dialogsinglepoint.h index 86e489ab9..f4bfdb947 100644 --- a/src/app/dialogs/tools/dialogsinglepoint.h +++ b/src/app/dialogs/tools/dialogsinglepoint.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -45,9 +45,10 @@ class DialogSinglePoint : public DialogTool public: DialogSinglePoint(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogSinglePoint(); - void setData(const QString &name, const QPointF &point); - QString getName()const; - QPointF getPoint()const; + + void SetData(const QString &name, const QPointF &point); + QPointF GetPoint()const; + public slots: void mousePress(const QPointF &scenePos); virtual void UpdateList(); @@ -66,24 +67,4 @@ private: QPointF point; }; -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getName return name - * @return name - */ -inline QString DialogSinglePoint::getName() const -{ - return pointName; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getPoint return point - * @return point - */ -inline QPointF DialogSinglePoint::getPoint() const -{ - return point; -} - #endif // DIALOGSINGLEPOINT_H diff --git a/src/app/dialogs/tools/dialogspline.cpp b/src/app/dialogs/tools/dialogspline.cpp index d60ae5b9c..d5febb89e 100644 --- a/src/app/dialogs/tools/dialogspline.cpp +++ b/src/app/dialogs/tools/dialogspline.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -41,14 +41,16 @@ * @param parent parent widget */ DialogSpline::DialogSpline(const VContainer *data, const quint32 &toolId, QWidget *parent) - :DialogTool(data, toolId, parent), ui(new Ui::DialogSpline), number(0), p1(NULL_ID), p4(NULL_ID), angle1(0), - angle2(0), kAsm1(1), kAsm2(1), kCurve(1), path(nullptr) + :DialogTool(data, toolId, parent), ui(new Ui::DialogSpline), angle1(0), angle2(0), kAsm1(1), kAsm2(1), + kCurve(1), path(nullptr) { ui->setupUi(this); InitOkCancelApply(ui); FillComboBoxPoints(ui->comboBoxP1); FillComboBoxPoints(ui->comboBoxP4); + FillComboBoxLineColors(ui->comboBoxColor); + connect(ui->comboBoxP1, static_cast(&QComboBox::currentIndexChanged), this, &DialogSpline::PointNameChanged); connect(ui->comboBoxP4, static_cast(&QComboBox::currentIndexChanged), @@ -69,12 +71,12 @@ DialogSpline::~DialogSpline() //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getP1 return id first point of spline + * @brief GetP1 return id first point of spline * @return id */ -quint32 DialogSpline::getP1() const +quint32 DialogSpline::GetP1() const { - return p1; + return getCurrentObjectId(ui->comboBoxP1); } //--------------------------------------------------------------------------------------------------------------------- @@ -139,21 +141,19 @@ void DialogSpline::ChosenObject(quint32 id, const SceneObject &type) //--------------------------------------------------------------------------------------------------------------------- void DialogSpline::SaveData() { - p1 = getCurrentObjectId(ui->comboBoxP1); - p4 = getCurrentObjectId(ui->comboBoxP4); angle1 = ui->spinBoxAngle1->value(); angle2 = ui->spinBoxAngle2->value(); kAsm1 = ui->doubleSpinBoxKasm1->value(); kAsm2 = ui->doubleSpinBoxKasm2->value(); kCurve = ui->doubleSpinBoxKcurve->value(); - path->setPoint1Id(p1); - path->setPoint4Id(p4); - path->setAngle1(angle1); - path->setAngle2(angle2); - path->setKAsm1(kAsm1); - path->setKAsm2(kAsm2); - path->setKCurve(kCurve); + path->setPoint1Id(GetP1()); + path->setPoint4Id(GetP4()); + path->SetAngle1(angle1); + path->SetAngle2(angle2); + path->SetKAsm1(kAsm1); + path->SetKAsm2(kAsm2); + path->SetKCurve(kCurve); path->RefreshGeometry(); } @@ -203,92 +203,154 @@ void DialogSpline::ShowVisualization() //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setKCurve set coefficient curve + * @brief SetKCurve set coefficient curve * @param value value. Can be >= 0. */ -void DialogSpline::setKCurve(const qreal &value) +void DialogSpline::SetKCurve(const qreal &value) { kCurve = value; ui->doubleSpinBoxKcurve->setValue(value); - path->setKCurve(kCurve); + path->SetKCurve(kCurve); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogSpline::GetColor() const +{ + return GetComboBoxCurrentData(ui->comboBoxColor); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogSpline::SetColor(const QString &value) +{ + ChangeCurrentData(ui->comboBoxColor, value); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setKAsm2 set second coefficient asymmetry + * @brief SetKAsm2 set second coefficient asymmetry * @param value value. Can be >= 0. */ -void DialogSpline::setKAsm2(const qreal &value) +void DialogSpline::SetKAsm2(const qreal &value) { kAsm2 = value; ui->doubleSpinBoxKasm2->setValue(value); - path->setKAsm2(kAsm2); + path->SetKAsm2(kAsm2); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setKAsm1 set first coefficient asymmetry + * @brief SetKAsm1 set first coefficient asymmetry * @param value value. Can be >= 0. */ -void DialogSpline::setKAsm1(const qreal &value) +void DialogSpline::SetKAsm1(const qreal &value) { kAsm1 = value; ui->doubleSpinBoxKasm1->setValue(value); - path->setKAsm1(kAsm1); + path->SetKAsm1(kAsm1); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setAngle2 set second angle of spline + * @brief SetAngle2 set second angle of spline * @param value angle in degree */ -void DialogSpline::setAngle2(const qreal &value) +void DialogSpline::SetAngle2(const qreal &value) { angle2 = value; ui->spinBoxAngle2->setValue(static_cast(value)); - path->setAngle2(angle2); + path->SetAngle2(angle2); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setAngle1 set first angle of spline + * @brief SetAngle1 set first angle of spline * @param value angle in degree */ -void DialogSpline::setAngle1(const qreal &value) +void DialogSpline::SetAngle1(const qreal &value) { angle1 = value; ui->spinBoxAngle1->setValue(static_cast(value)); - path->setAngle1(angle1); + path->SetAngle1(angle1); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setP4 set id fourth point of spline + * @brief SetP4 set id fourth point of spline * @param value id */ -void DialogSpline::setP4(const quint32 &value) +void DialogSpline::SetP4(const quint32 &value) { - setPointId(ui->comboBoxP4, p4, value); - path->setPoint4Id(p4); + setCurrentPointId(ui->comboBoxP4, value); + path->setPoint4Id(value); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setP1 set id first point of spline + * @brief SetP1 set id first point of spline * @param value id */ -void DialogSpline::setP1(const quint32 &value) +void DialogSpline::SetP1(const quint32 &value) { - setPointId(ui->comboBoxP1, p1, value); - path->setPoint1Id(p1); + setCurrentPointId(ui->comboBoxP1, value); + path->setPoint1Id(value); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief getP4 return id fourth point of spline + * @brief GetP4 return id fourth point of spline * @return id */ -quint32 DialogSpline::getP4() const +quint32 DialogSpline::GetP4() const { - return p4; + return getCurrentObjectId(ui->comboBoxP4); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetAngle1 return first angle of spline + * @return angle in degree + */ +qreal DialogSpline::GetAngle1() const +{ + return angle1; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetAngle2 return second angle of spline + * @return angle in degree + */ +qreal DialogSpline::GetAngle2() const +{ + return angle2; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetKAsm1 return first coefficient asymmetry + * @return value. Can be >= 0. + */ +qreal DialogSpline::GetKAsm1() const +{ + return kAsm1; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetKAsm2 return second coefficient asymmetry + * @return value. Can be >= 0. + */ +qreal DialogSpline::GetKAsm2() const +{ + return kAsm2; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetKCurve return coefficient curve + * @return value. Can be >= 0. + */ +qreal DialogSpline::GetKCurve() const +{ + return kCurve; } diff --git a/src/app/dialogs/tools/dialogspline.h b/src/app/dialogs/tools/dialogspline.h index 20d97f396..da7e8b790 100644 --- a/src/app/dialogs/tools/dialogspline.h +++ b/src/app/dialogs/tools/dialogspline.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -48,26 +48,29 @@ public: DialogSpline(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogSpline(); - quint32 getP1() const; - void setP1(const quint32 &value); + quint32 GetP1() const; + void SetP1(const quint32 &value); - quint32 getP4() const; - void setP4(const quint32 &value); + quint32 GetP4() const; + void SetP4(const quint32 &value); - qreal getAngle1() const; - void setAngle1(const qreal &value); + qreal GetAngle1() const; + void SetAngle1(const qreal &value); - qreal getAngle2() const; - void setAngle2(const qreal &value); + qreal GetAngle2() const; + void SetAngle2(const qreal &value); - qreal getKAsm1() const; - void setKAsm1(const qreal &value); + qreal GetKAsm1() const; + void SetKAsm1(const qreal &value); - qreal getKAsm2() const; - void setKAsm2(const qreal &value); + qreal GetKAsm2() const; + void SetKAsm2(const qreal &value); - qreal getKCurve() const; - void setKCurve(const qreal &value); + qreal GetKCurve() const; + void SetKCurve(const qreal &value); + + QString GetColor() const; + void SetColor(const QString &value); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); virtual void PointNameChanged(); @@ -84,15 +87,6 @@ private: /** @brief ui keeps information about user interface */ Ui::DialogSpline *ui; - /** @brief number number of handled objects */ - qint32 number; - - /** @brief p1 id first point of spline */ - quint32 p1; - - /** @brief p4 id fourth point of spline */ - quint32 p4; - /** @brief angle1 first angle of spline in degree */ qreal angle1; @@ -111,54 +105,4 @@ private: VisToolSpline *path; }; -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getAngle1 return first angle of spline - * @return angle in degree - */ -inline qreal DialogSpline::getAngle1() const -{ - return angle1; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getAngle2 return second angle of spline - * @return angle in degree - */ -inline qreal DialogSpline::getAngle2() const -{ - return angle2; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getKAsm1 return first coefficient asymmetry - * @return value. Can be >= 0. - */ -inline qreal DialogSpline::getKAsm1() const -{ - return kAsm1; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getKAsm2 return second coefficient asymmetry - * @return value. Can be >= 0. - */ -inline qreal DialogSpline::getKAsm2() const -{ - return kAsm2; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getKCurve return coefficient curve - * @return value. Can be >= 0. - */ -inline qreal DialogSpline::getKCurve() const -{ - return kCurve; -} - #endif // DIALOGSPLINE_H diff --git a/src/app/dialogs/tools/dialogspline.ui b/src/app/dialogs/tools/dialogspline.ui index 580268256..8fabe0e2f 100644 --- a/src/app/dialogs/tools/dialogspline.ui +++ b/src/app/dialogs/tools/dialogspline.ui @@ -6,12 +6,12 @@ 0 0 - 524 - 254 + 540 + 233 - Curve + Simple curve @@ -152,8 +152,11 @@ - - + + + QFormLayout::AllNonFixedFieldsGrow + + @@ -172,7 +175,7 @@ - + @@ -194,6 +197,16 @@ + + + + Color + + + + + + @@ -215,7 +228,6 @@ comboBoxP4 doubleSpinBoxKasm2 spinBoxAngle2 - doubleSpinBoxKcurve buttonBox diff --git a/src/app/dialogs/tools/dialogsplinepath.cpp b/src/app/dialogs/tools/dialogsplinepath.cpp index 39daac404..6cf0c431a 100644 --- a/src/app/dialogs/tools/dialogsplinepath.cpp +++ b/src/app/dialogs/tools/dialogsplinepath.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -46,6 +46,7 @@ DialogSplinePath::DialogSplinePath(const VContainer *data, const quint32 &toolId bOk->setEnabled(false); FillComboBoxPoints(ui->comboBoxPoint); + FillComboBoxLineColors(ui->comboBoxColor); connect(ui->listWidget, &QListWidget::currentRowChanged, this, &DialogSplinePath::PointChanged); connect(ui->comboBoxPoint, static_cast(&QComboBox::currentIndexChanged), @@ -87,12 +88,24 @@ void DialogSplinePath::SetPath(const VSplinePath &value) NewItem(path.at(i).P().id(), path.at(i).KAsm1(), path.at(i).Angle1(), path.at(i).KAsm2(), path.at(i).Angle2()); } ui->listWidget->setFocus(Qt::OtherFocusReason); - ui->doubleSpinBoxKcurve->setValue(path.getKCurve()); + ui->doubleSpinBoxKcurve->setValue(path.GetKCurve()); visPath->setPath(path); ui->listWidget->blockSignals(false); } +//--------------------------------------------------------------------------------------------------------------------- +QString DialogSplinePath::GetColor() const +{ + return GetComboBoxCurrentData(ui->comboBoxColor); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogSplinePath::SetColor(const QString &value) +{ + ChangeCurrentData(ui->comboBoxColor, value); +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong. @@ -103,6 +116,11 @@ void DialogSplinePath::ChosenObject(quint32 id, const SceneObject &type) { if (type == SceneObject::Point) { + if (path.CountPoint() >= 2 && path.at(path.CountPoint()-1).P().id() == id) + { + return; + } + NewItem(id, 1, 0, 1, 180); emit ToolTip(tr("Select point of curve path")); @@ -357,5 +375,5 @@ void DialogSplinePath::SavePath() QListWidgetItem *item = ui->listWidget->item(i); path.append( qvariant_cast(item->data(Qt::UserRole))); } - path.setKCurve(ui->doubleSpinBoxKcurve->value()); + path.SetKCurve(ui->doubleSpinBoxKcurve->value()); } diff --git a/src/app/dialogs/tools/dialogsplinepath.h b/src/app/dialogs/tools/dialogsplinepath.h index 4316ddefd..8d0b7eebf 100644 --- a/src/app/dialogs/tools/dialogsplinepath.h +++ b/src/app/dialogs/tools/dialogsplinepath.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -51,6 +51,9 @@ public: VSplinePath GetPath() const; void SetPath(const VSplinePath &value); + + QString GetColor() const; + void SetColor(const QString &value); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); void PointChanged(int row); diff --git a/src/app/dialogs/tools/dialogsplinepath.ui b/src/app/dialogs/tools/dialogsplinepath.ui index 44c1b3459..7c00882f6 100644 --- a/src/app/dialogs/tools/dialogsplinepath.ui +++ b/src/app/dialogs/tools/dialogsplinepath.ui @@ -6,8 +6,8 @@ 0 0 - 524 - 321 + 528 + 322 @@ -141,8 +141,11 @@ - - + + + QFormLayout::AllNonFixedFieldsGrow + + @@ -161,7 +164,7 @@ - + @@ -183,6 +186,16 @@ + + + + Color + + + + + + @@ -204,7 +217,6 @@ doubleSpinBoxKasm2 doubleSpinBoxAngle2 listWidget - doubleSpinBoxKcurve buttonBox diff --git a/src/app/dialogs/tools/dialogtool.cpp b/src/app/dialogs/tools/dialogtool.cpp index 2a0c7ae72..99fc95b5a 100644 --- a/src/app/dialogs/tools/dialogtool.cpp +++ b/src/app/dialogs/tools/dialogtool.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -34,8 +34,6 @@ #include "../../geometry/vsplinepath.h" #include "../../tools/vabstracttool.h" #include "../../../libs/qmuparser/qmuparsererror.h" -#include "../../core/vapplication.h" -#include "../../core/vsettings.h" #include "../../libs/ifc/xml/vdomdocument.h" #include #include @@ -66,8 +64,8 @@ DialogTool::DialogTool(const VContainer *data, const quint32 &toolId, QWidget *p labelEditFormula(nullptr), radioButtonSizeGrowth(nullptr), radioButtonStandardTable(nullptr), radioButtonIncrements(nullptr), radioButtonLengthLine(nullptr), radioButtonLengthArc(nullptr), radioButtonLengthCurve(nullptr), radioButtonAngleLine(nullptr), checkBoxHideEmpty(nullptr), - lineStyles(VAbstractTool::Styles()), okColor(QColor(76, 76, 76)), errorColor(Qt::red), associatedTool(nullptr), - toolId(toolId), prepare(false), pointName(QString()) + okColor(QColor(76, 76, 76)), errorColor(Qt::red), associatedTool(nullptr), + toolId(toolId), prepare(false), pointName(QString()), number(0) { SCASSERT(data != nullptr); timerFormula = new QTimer(this); @@ -288,61 +286,45 @@ void DialogTool::FillComboBoxCurves(QComboBox *box) const * @brief FillComboBoxTypeLine fill comboBox list of type lines * @param box comboBox */ -void DialogTool::FillComboBoxTypeLine(QComboBox *box) const +void DialogTool::FillComboBoxTypeLine(QComboBox *box, const QMap &stylesPics) const { SCASSERT(box != nullptr); - box->addItems(lineStyles); - box->setCurrentIndex(1); + QMap::const_iterator i = stylesPics.constBegin(); + while (i != stylesPics.constEnd()) + { + box->addItem(i.value(), "", QVariant(i.key())); + ++i; + } + + box->setCurrentIndex(4); } //--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getTypeLine return type of line - * @param box combobox - * @return type - */ -QString DialogTool::GetTypeLine(const QComboBox *box) const +void DialogTool::FillComboBoxLineColors(QComboBox *box) const { - switch (lineStyles.indexOf(box->currentText())) + SCASSERT(box != nullptr); + + const QMap map = VAbstractTool::ColorsList(); + QMap::const_iterator i = map.constBegin(); + while (i != map.constEnd()) { - case 0: //No line - return VAbstractTool::TypeLineNone; - break; - case 1: //Line - return VAbstractTool::TypeLineLine; - break; - case 2: //Dash Line - return VAbstractTool::TypeLineDashLine; - break; - case 3: //Dot Line - return VAbstractTool::TypeLineDotLine; - break; - case 4: //Dash Dot Line - return VAbstractTool::TypeLineDashDotLine; - break; - case 5: //Dash Dot Dot Line - return VAbstractTool::TypeLineDashDotDotLine; - break; - default: - return VAbstractTool::TypeLineLine; - break; + QPixmap pix(16, 16); + pix.fill(QColor(i.key())); + box->addItem(QIcon(pix), i.value(), QVariant(i.key())); + ++i; } } //--------------------------------------------------------------------------------------------------------------------- -/** - * @brief SetupTypeLine setupe type of line - * @param box combobox - * @param value string from pattern file - */ -void DialogTool::SetupTypeLine(QComboBox *box, const QString &value) +QString DialogTool::GetComboBoxCurrentData(const QComboBox *box) const { - QStringList styles = VAbstractTool::Styles(); - qint32 index = box->findText(lineStyles.at(styles.indexOf(value))); - if (index != -1) + SCASSERT(box != nullptr) + QString value = box->currentData().toString(); + if (value.isEmpty()) { - box->setCurrentIndex(index); + value = VAbstractTool::TypeLineLine; } + return value; } //--------------------------------------------------------------------------------------------------------------------- @@ -351,9 +333,10 @@ void DialogTool::SetupTypeLine(QComboBox *box, const QString &value) * @param box combobox * @param value id of item */ -void DialogTool::ChangeCurrentData(QComboBox *box, const quint32 &value) const +void DialogTool::ChangeCurrentData(QComboBox *box, const QVariant &value) const { - qint32 index = box->findData(value); + SCASSERT(box != nullptr) + const qint32 index = box->findData(value); if (index != -1) { box->setCurrentIndex(index); @@ -475,8 +458,8 @@ void DialogTool::ValFormulaChanged(bool &flag, QPlainTextEdit *edit, QTimer *tim //--------------------------------------------------------------------------------------------------------------------- /** * @brief Eval evaluate formula and show result - * @param text formula - * @param flag flag state of formula + * @param text expresion that we parse + * @param flag flag state of eval formula * @param label label for signal error * @param postfix unit name * @param checkZero true - if formula can't be equal zero @@ -499,10 +482,10 @@ qreal DialogTool::Eval(const QString &text, bool &flag, QLabel *label, const QSt { try { - // Replace line return with spaces for calc if exist + // Replace line return character with spaces for calc if exist QString formula = text; formula.replace("\n", " "); - formula = qApp->FormulaFromUser(formula); + formula = qApp->FormulaFromUser(formula);// Translate to internal look. Calculator *cal = new Calculator(data); result = cal->EvalFormula(formula); delete cal; @@ -517,16 +500,7 @@ qreal DialogTool::Eval(const QString &text, bool &flag, QLabel *label, const QSt } else { - QLocale loc; - if (qApp->getSettings()->GetOsSeparator()) - { - loc = QLocale::system(); - } - else - { - loc = QLocale(QLocale::C); - } - label->setText(loc.toString(result) + postfix); + label->setText(qApp->LocaleToString(result) + " " +postfix); flag = true; ChangeColor(labelEditFormula, okColor); label->setToolTip(tr("Value")); @@ -547,33 +521,34 @@ qreal DialogTool::Eval(const QString &text, bool &flag, QLabel *label, const QSt << "--------------------------------------"; } } - CheckState(); + CheckState(); // Disable Ok and Apply buttons if something wrong. return result; } //--------------------------------------------------------------------------------------------------------------------- -void DialogTool::setCurrentPointId(QComboBox *box, quint32 &pointId, const quint32 &value) const +void DialogTool::setCurrentPointId(QComboBox *box, const quint32 &value) const { SCASSERT(box != nullptr); + + box->blockSignals(true); + FillComboBoxPoints(box); - pointId = value; ChangeCurrentData(box, value); + + box->blockSignals(false); } //--------------------------------------------------------------------------------------------------------------------- /** * @brief setCurrentSplineId set current spline id in combobox * @param box combobox - * @param splineId save current spline id * @param value spline id * @param cut if set to ComboMode::CutSpline don't show id+1 and id+2 */ -void DialogTool::setCurrentSplineId(QComboBox *box, quint32 &splineId, const quint32 &value, - ComboBoxCutSpline cut) const +void DialogTool::setCurrentSplineId(QComboBox *box, const quint32 &value, ComboBoxCutSpline cut) const { SCASSERT(box != nullptr); FillComboBoxSplines(box, cut); - splineId = value; ChangeCurrentData(box, value); } @@ -581,15 +556,13 @@ void DialogTool::setCurrentSplineId(QComboBox *box, quint32 &splineId, const qui /** * @brief setCurrentArcId * @param box combobox - * @param arcId save current arc id * @param value arc id * @param cut if set to ComboMode::CutArc don't show id+1 and id+2 */ -void DialogTool::setCurrentArcId(QComboBox *box, quint32 &arcId, const quint32 &value, ComboBoxCutArc cut) const +void DialogTool::setCurrentArcId(QComboBox *box, const quint32 &value, ComboBoxCutArc cut) const { SCASSERT(box != nullptr); FillComboBoxArcs(box, cut); - arcId = value; ChangeCurrentData(box, value); } @@ -597,25 +570,21 @@ void DialogTool::setCurrentArcId(QComboBox *box, quint32 &arcId, const quint32 & /** * @brief setCurrentSplinePathId set current splinePath id in combobox * @param box combobox - * @param splinePathId save current splinePath id * @param value splinePath id * @param cut if set to ComboMode::CutSpline don't show id+1 and id+2 */ -void DialogTool::setCurrentSplinePathId(QComboBox *box, quint32 &splinePathId, const quint32 &value, - ComboBoxCutSpline cut) const +void DialogTool::setCurrentSplinePathId(QComboBox *box, const quint32 &value, ComboBoxCutSpline cut) const { SCASSERT(box != nullptr); FillComboBoxSplinesPath(box, cut); - splinePathId = value; ChangeCurrentData(box, value); } //--------------------------------------------------------------------------------------------------------------------- -void DialogTool::setCurrentCurveId(QComboBox *box, quint32 &curveId, const quint32 &value) const +void DialogTool::setCurrentCurveId(QComboBox *box, const quint32 &value) const { SCASSERT(box != nullptr); FillComboBoxCurves(box); - curveId = value; ChangeCurrentData(box, value); } @@ -770,15 +739,6 @@ void DialogTool::ChangeColor(QWidget *widget, const QColor &color) widget->setPalette(palette); } -//--------------------------------------------------------------------------------------------------------------------- -void DialogTool::setPointId(QComboBox *box, quint32 &pointId, const quint32 &value) -{ - SCASSERT(box != nullptr); - box->blockSignals(true); - setCurrentPointId(box, pointId, value); - box->blockSignals(false); -} - //--------------------------------------------------------------------------------------------------------------------- /** * @brief DialogAccepted save data and emit signal about closed dialog. @@ -915,7 +875,7 @@ void DialogTool::EvalFormula() { SCASSERT(plainTextEditFormula != nullptr); SCASSERT(labelResultCalculation != nullptr); - const QString postfix = VDomDocument::UnitsToStr(qApp->patternUnit()); + const QString postfix = VDomDocument::UnitsToStr(qApp->patternUnit());//Show unit in dialog lable (cm, mm or inch) Eval(plainTextEditFormula->toPlainText(), flagFormula, labelResultCalculation, postfix, false); } @@ -925,6 +885,9 @@ void DialogTool::EvalFormula() */ void DialogTool::SizeHeight() { + SCASSERT(checkBoxHideEmpty != nullptr); + checkBoxHideEmpty->setEnabled(false); + SCASSERT(listWidget != nullptr); listWidget->blockSignals(true); listWidget->clear(); @@ -1046,6 +1009,7 @@ void DialogTool::ValChenged(int row) SCASSERT(radioButtonLengthCurve != nullptr); if (listWidget->count() == 0) { + labelDescription->setText(""); return; } QListWidgetItem *item = listWidget->item( row ); @@ -1104,6 +1068,14 @@ void DialogTool::ValChenged(int row) labelDescription->setText(desc); return; } + if (radioButtonAngleLine->isChecked()) + { + QString desc = QString("%1(%2) - %3").arg(item->text()) + .arg(*data->GetVariable(qApp->VarFromUser(item->text()))->GetValue()) + .arg(tr("Line Angle")); + labelDescription->setText(desc); + return; + } } //--------------------------------------------------------------------------------------------------------------------- @@ -1157,6 +1129,12 @@ void DialogTool::SetToolId(const quint32 &value) toolId = value; } +//--------------------------------------------------------------------------------------------------------------------- +QString DialogTool::getPointName() const +{ + return pointName; +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief ShowVariable show variables in list @@ -1169,6 +1147,7 @@ void DialogTool::ShowVariable(const QMap var) SCASSERT(checkBoxHideEmpty != nullptr); listWidget->blockSignals(true); listWidget->clear(); + labelDescription->setText(""); QMapIterator iMap(var); while (iMap.hasNext()) diff --git a/src/app/dialogs/tools/dialogtool.h b/src/app/dialogs/tools/dialogtool.h index 7bb48c2e3..0aec9afd9 100644 --- a/src/app/dialogs/tools/dialogtool.h +++ b/src/app/dialogs/tools/dialogtool.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -69,6 +69,8 @@ public: quint32 GetToolId() const; void SetToolId(const quint32 &value); + + QString getPointName() const; signals: /** * @brief DialogClosed signal dialog closed @@ -193,8 +195,6 @@ protected: QCheckBox *checkBoxHideEmpty; - /** @brief lineStyles list supported line styles. */ - QStringList lineStyles; const QColor okColor; const QColor errorColor; /** @@ -209,35 +209,40 @@ protected: /** @brief pointName name of point */ QString pointName; + /** @brief number number of handled objects */ + qint32 number; + virtual void closeEvent ( QCloseEvent * event ); virtual void showEvent( QShowEvent *event ); + void FillComboBoxPoints(QComboBox *box)const; void FillComboBoxArcs(QComboBox *box, ComboBoxCutArc cut = ComboBoxCutArc::NoCutArc)const; void FillComboBoxSplines(QComboBox *box, ComboBoxCutSpline cut = ComboBoxCutSpline::NoCutSpline)const; void FillComboBoxSplinesPath(QComboBox *box, ComboBoxCutSpline cut = ComboBoxCutSpline::NoCutSpline)const; void FillComboBoxCurves(QComboBox *box)const; - void FillComboBoxTypeLine(QComboBox *box) const; + void FillComboBoxTypeLine(QComboBox *box, const QMap &stylesPics) const; + void FillComboBoxLineColors(QComboBox *box)const; + virtual void CheckState(); - QString GetTypeLine(const QComboBox *box)const; + QString GetComboBoxCurrentData(const QComboBox *box)const; template void ShowVariable(const QMap var); - void SetupTypeLine(QComboBox *box, const QString &value); - void ChangeCurrentData(QComboBox *box, const quint32 &value) const; + void ChangeCurrentData(QComboBox *box, const QVariant &value) const; void PutValHere(QLineEdit *lineEdit, QListWidget *listWidget); void PutValHere(QPlainTextEdit *plainTextEdit, QListWidget *listWidget); void ValFormulaChanged(bool &flag, QLineEdit *edit, QTimer * timer); void ValFormulaChanged(bool &flag, QPlainTextEdit *edit, QTimer * timer); qreal Eval(const QString &text, bool &flag, QLabel *label, const QString &postfix, bool checkZero = true); - void setCurrentPointId(QComboBox *box, quint32 &pointId, const quint32 &value) const; - void setCurrentSplineId(QComboBox *box, quint32 &splineId, const quint32 &value, + void setCurrentPointId(QComboBox *box, const quint32 &value) const; + void setCurrentSplineId(QComboBox *box, const quint32 &value, ComboBoxCutSpline cut = ComboBoxCutSpline::NoCutSpline) const; - void setCurrentArcId(QComboBox *box, quint32 &arcId, const quint32 &value, + void setCurrentArcId(QComboBox *box, const quint32 &value, ComboBoxCutArc cut = ComboBoxCutArc::NoCutArc) const; - void setCurrentSplinePathId(QComboBox *box, quint32 &splinePathId, const quint32 &value, + void setCurrentSplinePathId(QComboBox *box, const quint32 &value, ComboBoxCutSpline cut = ComboBoxCutSpline::NoCutSpline) const; - void setCurrentCurveId(QComboBox *box, quint32 &curveId, const quint32 &value) const; + void setCurrentCurveId(QComboBox *box, const quint32 &value) const; quint32 getCurrentObjectId(QComboBox *box) const; bool SetObject(const quint32 &id, QComboBox *box, const QString &toolTip); void DeployFormula(QPlainTextEdit *formula, QPushButton *buttonGrowLength, int formulaBaseHeight); @@ -316,6 +321,8 @@ protected: QPushButton *bCancel = ui->buttonBox->button(QDialogButtonBox::Cancel); SCASSERT(bCancel != nullptr); connect(bCancel, &QPushButton::clicked, this, &DialogTool::DialogRejected); + + qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); } template /** @@ -330,7 +337,6 @@ protected: } void ChangeColor(QWidget *widget, const QColor &color); - void setPointId(QComboBox *box, quint32 &pointId, const quint32 &value); virtual void ShowVisualization(){} /** * @brief SaveData Put dialog data in local variables diff --git a/src/app/dialogs/tools/dialogtriangle.cpp b/src/app/dialogs/tools/dialogtriangle.cpp index a0a21e7a3..7caa7c885 100644 --- a/src/app/dialogs/tools/dialogtriangle.cpp +++ b/src/app/dialogs/tools/dialogtriangle.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -41,8 +41,7 @@ * @param parent parent widget */ DialogTriangle::DialogTriangle(const VContainer *data, const quint32 &toolId, QWidget *parent) - :DialogTool(data, toolId, parent), ui(new Ui::DialogTriangle), number(0), axisP1Id(NULL_ID), - axisP2Id(NULL_ID), firstPointId(NULL_ID), secondPointId(NULL_ID), line (nullptr) + :DialogTool(data, toolId, parent), ui(new Ui::DialogTriangle), line (nullptr) { ui->setupUi(this); ui->lineEditNamePoint->setText(qApp->getCurrentDocument()->GenerateLabel(LabelType::NewLabel)); @@ -161,15 +160,11 @@ void DialogTriangle::ChosenObject(quint32 id, const SceneObject &type) void DialogTriangle::SaveData() { pointName = ui->lineEditNamePoint->text(); - firstPointId = getCurrentObjectId(ui->comboBoxFirstPoint); - secondPointId = getCurrentObjectId(ui->comboBoxSecondPoint); - axisP1Id = getCurrentObjectId(ui->comboBoxAxisP1); - axisP2Id = getCurrentObjectId(ui->comboBoxAxisP2); - line->setPoint1Id(axisP1Id); - line->setPoint2Id(axisP2Id); - line->setHypotenuseP1Id(firstPointId); - line->setHypotenuseP2Id(secondPointId); + line->setPoint1Id(GetAxisP1Id()); + line->setPoint2Id(GetAxisP2Id()); + line->setHypotenuseP1Id(GetFirstPointId()); + line->setHypotenuseP2Id(GetSecondPointId()); line->RefreshGeometry(); } @@ -223,10 +218,10 @@ void DialogTriangle::ShowVisualization() //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setPointName set name of point + * @brief SetPointName set name of point * @param value name */ -void DialogTriangle::setPointName(const QString &value) +void DialogTriangle::SetPointName(const QString &value) { pointName = value; ui->lineEditNamePoint->setText(pointName); @@ -234,44 +229,84 @@ void DialogTriangle::setPointName(const QString &value) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setSecondPointId set id of second point + * @brief SetSecondPointId set id of second point * @param value id */ -void DialogTriangle::setSecondPointId(const quint32 &value) +void DialogTriangle::SetSecondPointId(const quint32 &value) { - setPointId(ui->comboBoxSecondPoint, secondPointId, value); - line->setHypotenuseP2Id(secondPointId); + setCurrentPointId(ui->comboBoxSecondPoint, value); + line->setHypotenuseP2Id(value); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setFirstPointId set id of first point + * @brief SetFirstPointId set id of first point * @param value id */ -void DialogTriangle::setFirstPointId(const quint32 &value) +void DialogTriangle::SetFirstPointId(const quint32 &value) { - setPointId(ui->comboBoxFirstPoint, firstPointId, value); - line->setHypotenuseP1Id(firstPointId); + setCurrentPointId(ui->comboBoxFirstPoint, value); + line->setHypotenuseP1Id(value); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setAxisP2Id set id second point of axis + * @brief SetAxisP2Id set id second point of axis * @param value id */ -void DialogTriangle::setAxisP2Id(const quint32 &value) +void DialogTriangle::SetAxisP2Id(const quint32 &value) { - setPointId(ui->comboBoxAxisP2, axisP2Id, value); - line->setPoint2Id(axisP2Id); + setCurrentPointId(ui->comboBoxAxisP2, value); + line->setPoint2Id(value); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setAxisP1Id set id first point of axis + * @brief SetAxisP1Id set id first point of axis * @param value id */ -void DialogTriangle::setAxisP1Id(const quint32 &value) +void DialogTriangle::SetAxisP1Id(const quint32 &value) { - setPointId(ui->comboBoxAxisP1, axisP1Id, value); - line->setPoint1Id(axisP1Id); + setCurrentPointId(ui->comboBoxAxisP1, value); + line->setPoint1Id(value); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetAxisP1Id return id first point of axis + * @return id + */ +quint32 DialogTriangle::GetAxisP1Id() const +{ + return getCurrentObjectId(ui->comboBoxAxisP1); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetAxisP2Id return id second point of axis + * @return id + */ +quint32 DialogTriangle::GetAxisP2Id() const +{ + return getCurrentObjectId(ui->comboBoxAxisP2); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetFirstPointId return id of first point + * @return id + */ +quint32 DialogTriangle::GetFirstPointId() const +{ + return getCurrentObjectId(ui->comboBoxFirstPoint); +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetSecondPointId return id of second point + * @return id + */ +quint32 DialogTriangle::GetSecondPointId() const +{ + return getCurrentObjectId(ui->comboBoxSecondPoint); } diff --git a/src/app/dialogs/tools/dialogtriangle.h b/src/app/dialogs/tools/dialogtriangle.h index 9ca29765c..fa541722d 100644 --- a/src/app/dialogs/tools/dialogtriangle.h +++ b/src/app/dialogs/tools/dialogtriangle.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -48,20 +48,19 @@ public: DialogTriangle(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr); ~DialogTriangle(); - quint32 getAxisP1Id() const; - void setAxisP1Id(const quint32 &value); + quint32 GetAxisP1Id() const; + void SetAxisP1Id(const quint32 &value); - quint32 getAxisP2Id() const; - void setAxisP2Id(const quint32 &value); + quint32 GetAxisP2Id() const; + void SetAxisP2Id(const quint32 &value); - quint32 getFirstPointId() const; - void setFirstPointId(const quint32 &value); + quint32 GetFirstPointId() const; + void SetFirstPointId(const quint32 &value); - quint32 getSecondPointId() const; - void setSecondPointId(const quint32 &value); + quint32 GetSecondPointId() const; + void SetSecondPointId(const quint32 &value); - QString getPointName() const; - void setPointName(const QString &value); + void SetPointName(const QString &value); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); virtual void PointNameChanged(); @@ -78,72 +77,7 @@ private: /** @brief ui keeps information about user interface */ Ui::DialogTriangle *ui; - /** @brief number number of handled objects */ - qint32 number; - - /** @brief axisP1Id id first point of axis */ - quint32 axisP1Id; - - /** @brief axisP2Id id second point of axis */ - quint32 axisP2Id; - - /** @brief firstPointId id first point of line */ - quint32 firstPointId; - - /** @brief secondPointId id second point of line */ - quint32 secondPointId; - VisToolTriangle *line; }; -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getAxisP1Id return id first point of axis - * @return id - */ -inline quint32 DialogTriangle::getAxisP1Id() const -{ - return axisP1Id; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getAxisP2Id return id second point of axis - * @return id - */ -inline quint32 DialogTriangle::getAxisP2Id() const -{ - return axisP2Id; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getFirstPointId return id of first point - * @return id - */ -inline quint32 DialogTriangle::getFirstPointId() const -{ - return firstPointId; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getSecondPointId return id of second point - * @return id - */ -inline quint32 DialogTriangle::getSecondPointId() const -{ - return secondPointId; -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief getPointName return name of point - * @return name - */ -inline QString DialogTriangle::getPointName() const -{ - return pointName; -} - #endif // DIALOGTRIANGLE_H diff --git a/src/app/dialogs/tools/dialogtriangle.ui b/src/app/dialogs/tools/dialogtriangle.ui index f56958fd4..533f33928 100644 --- a/src/app/dialogs/tools/dialogtriangle.ui +++ b/src/app/dialogs/tools/dialogtriangle.ui @@ -11,7 +11,7 @@ - Triangle + Triangle tool @@ -55,7 +55,7 @@ - First point of line + First point of the axis @@ -75,7 +75,7 @@ - First point of line + Second point of the axis @@ -115,7 +115,7 @@ - First point of line + Second point of line diff --git a/src/app/dialogs/tools/dialoguniondetails.cpp b/src/app/dialogs/tools/dialoguniondetails.cpp index 80b08877c..612be7d0a 100644 --- a/src/app/dialogs/tools/dialoguniondetails.cpp +++ b/src/app/dialogs/tools/dialoguniondetails.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialoguniondetails.h b/src/app/dialogs/tools/dialoguniondetails.h index 01aff8904..e7842a249 100644 --- a/src/app/dialogs/tools/dialoguniondetails.h +++ b/src/app/dialogs/tools/dialoguniondetails.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/dialogs/tools/dialoguniondetails.ui b/src/app/dialogs/tools/dialoguniondetails.ui index 4729a4b5a..efe54a7b2 100644 --- a/src/app/dialogs/tools/dialoguniondetails.ui +++ b/src/app/dialogs/tools/dialoguniondetails.ui @@ -26,7 +26,7 @@ - Union details + Union tool diff --git a/src/app/geometry/geometry.pri b/src/app/geometry/geometry.pri index 708385de8..9c8bf58c9 100644 --- a/src/app/geometry/geometry.pri +++ b/src/app/geometry/geometry.pri @@ -10,7 +10,6 @@ HEADERS += \ $$PWD/varc.h \ $$PWD/vgobject.h \ $$PWD/vpointf.h \ - $$PWD/vequidistant.h \ $$PWD/vabstractcurve.h \ $$PWD/vnodedetail_p.h \ $$PWD/vdetail_p.h \ @@ -30,5 +29,4 @@ SOURCES += \ $$PWD/varc.cpp \ $$PWD/vgobject.cpp \ $$PWD/vpointf.cpp \ - $$PWD/vequidistant.cpp \ $$PWD/vabstractcurve.cpp diff --git a/src/app/geometry/vabstractcurve.cpp b/src/app/geometry/vabstractcurve.cpp index 423aac8c2..1fe4e149a 100644 --- a/src/app/geometry/vabstractcurve.cpp +++ b/src/app/geometry/vabstractcurve.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/geometry/vabstractcurve.h b/src/app/geometry/vabstractcurve.h index 057424687..c89bbfd8d 100644 --- a/src/app/geometry/vabstractcurve.h +++ b/src/app/geometry/vabstractcurve.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/geometry/varc.cpp b/src/app/geometry/varc.cpp index 2f9c434b8..570eaa5d0 100644 --- a/src/app/geometry/varc.cpp +++ b/src/app/geometry/varc.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -255,7 +255,7 @@ QString VArc::GetFormulaF1() const //--------------------------------------------------------------------------------------------------------------------- void VArc::SetFormulaF1(const VFormula &value) { - d->formulaF1 = value.getFormula(FormulaType::FromUser); + d->formulaF1 = value.GetFormula(FormulaType::FromUser); d->f1 = value.getDoubleValue(); } @@ -282,7 +282,7 @@ QString VArc::GetFormulaF2() const //--------------------------------------------------------------------------------------------------------------------- void VArc::SetFormulaF2(const VFormula &value) { - d->formulaF2 = value.getFormula(FormulaType::FromUser); + d->formulaF2 = value.GetFormula(FormulaType::FromUser); d->f2 = value.getDoubleValue(); } @@ -309,7 +309,7 @@ QString VArc::GetFormulaRadius() const //--------------------------------------------------------------------------------------------------------------------- void VArc::SetFormulaRadius(const VFormula &value) { - d->formulaRadius = value.getFormula(FormulaType::FromUser); + d->formulaRadius = value.GetFormula(FormulaType::FromUser); d->radius = value.getDoubleValue(); } diff --git a/src/app/geometry/varc.h b/src/app/geometry/varc.h index 53003724f..6f017e7da 100644 --- a/src/app/geometry/varc.h +++ b/src/app/geometry/varc.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/geometry/varc_p.h b/src/app/geometry/varc_p.h index dd56deb94..887bef20b 100644 --- a/src/app/geometry/varc_p.h +++ b/src/app/geometry/varc_p.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/geometry/vdetail.cpp b/src/app/geometry/vdetail.cpp index d0322f4d3..7f58c3c9d 100644 --- a/src/app/geometry/vdetail.cpp +++ b/src/app/geometry/vdetail.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -28,31 +28,53 @@ #include "vdetail.h" #include "vdetail_p.h" +#include "../container/vcontainer.h" +#include "vpointf.h" +#include "../core/vapplication.h" + #include #include //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief VDetail default contructor. Create empty detail. + */ VDetail::VDetail() - :d(new VDetailData) + :VAbstractDetail(), d(new VDetailData) {} //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief VDetail constructor. + * @param name detail name. + * @param nodes list of nodes. + */ VDetail::VDetail(const QString &name, const QVector &nodes) - :d(new VDetailData(name, nodes)) + :VAbstractDetail(name), d(new VDetailData(nodes)) {} //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief VDetail copy constructor. + * @param detail detail. + */ VDetail::VDetail(const VDetail &detail) - :d (detail.d) + :VAbstractDetail(detail), d (detail.d) {} //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief operator = assignment operator. + * @param detail detail. + * @return new detail. + */ VDetail &VDetail::operator =(const VDetail &detail) { if ( &detail == this ) { return *this; } + VAbstractDetail::operator=(detail); d = detail.d; return *this; } @@ -62,24 +84,31 @@ VDetail::~VDetail() {} //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief Clear detail full clear. + */ void VDetail::Clear() { d->nodes.clear(); - d->name.clear(); d->mx = 0; d->my = 0; - d->seamAllowance = true; - d->closed = true; - d->width = 0; } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief ClearNodes clear list of nodes. + */ void VDetail::ClearNodes() { d->nodes.clear(); } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief Containes check if detail containe this id. + * @param id object id. + * @return true if containe. + */ bool VDetail::Containes(const quint32 &id) const { for (int i = 0; i < d->nodes.size(); ++i) @@ -94,36 +123,66 @@ bool VDetail::Containes(const quint32 &id) const } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief operator [] find node by index in list. + * @param indx index node in list. + * @return node + */ VNodeDetail &VDetail::operator [](int indx) { return d->nodes[indx]; } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief at find node by index in list. + * @param indx index node in list. + * @return const node. + */ const VNodeDetail &VDetail::at(int indx) const { return d->nodes.at(indx); } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief indexOfNode return index in list node using id object. + * @param id object (arc, point, spline, splinePath) id. + * @return index in list or -1 id can't find. + */ int VDetail::indexOfNode(const quint32 &id) const { return indexOfNode(d->nodes, id); } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief id return id detail in list data. + * @return id. + */ quint32 VDetail::id() const { return d->_id; } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief setId set id detail in list data. + * @param id detail id. + */ void VDetail::setId(const quint32 &id) { d->_id = id; } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief OnEdge checks if two poins located on the edge. Edge is line between two points. If between two points + * located arcs or splines ignore this. + * @param p1 id first point. + * @param p2 id second point. + * @return true - on edge, false - no. + */ bool VDetail::OnEdge(const quint32 &p1, const quint32 &p2) const { QVector list = listNodePoint(); @@ -162,6 +221,13 @@ bool VDetail::OnEdge(const quint32 &p1, const quint32 &p2) const } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief Edge return edge index in detail. Edge is line between two points. If between two points + * located arcs or splines ignore this. + * @param p1 id first point. + * @param p2 id second point. + * @return edge index or -1 if points don't located on edge + */ int VDetail::Edge(const quint32 &p1, const quint32 &p2) const { if (OnEdge(p1, p2) == false) @@ -187,6 +253,12 @@ int VDetail::Edge(const quint32 &p1, const quint32 &p2) const } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief NodeOnEdge return nodes located on edge with index. + * @param index index of edge. + * @param p1 first node. + * @param p2 second node. + */ void VDetail::NodeOnEdge(const quint32 &index, VNodeDetail &p1, VNodeDetail &p2) const { QVector list = listNodePoint(); @@ -207,6 +279,11 @@ void VDetail::NodeOnEdge(const quint32 &index, VNodeDetail &p1, VNodeDetail &p2) } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief RemoveEdge return detail without edge with index. + * @param index idex of edge. + * @return detail without edge with index. + */ VDetail VDetail::RemoveEdge(const quint32 &index) const { VDetail det(*this); @@ -250,6 +327,12 @@ VDetail VDetail::RemoveEdge(const quint32 &index) const } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief Missing find missing ids in detail. When we deleted object in detail and return this detail need + * understand, what nodes need make invisible. + * @param det changed detail. + * @return list with missing detail. + */ QList VDetail::Missing(const VDetail &det) const { if (d->nodes.size() == det.CountNode()) @@ -275,6 +358,133 @@ QList VDetail::Missing(const VDetail &det) const } //--------------------------------------------------------------------------------------------------------------------- +QVector VDetail::ContourPoints(const VContainer *data) const +{ + QVector points; + for (int i = 0; i< CountNode(); ++i) + { + switch (at(i).getTypeTool()) + { + case (Tool::NodePoint): + { + const QSharedPointer point = data->GeometricObject(at(i).getId()); + points.append(point->toQPointF()); + } + break; + case (Tool::NodeArc): + case (Tool::NodeSpline): + case (Tool::NodeSplinePath): + { + const QSharedPointer curve = data->GeometricObject(at(i).getId()); + + const QPointF begin = StartSegment(data, i); + const QPointF end = EndSegment(data, i); + + points << curve->GetSegmentPoints(begin, end, at(i).getReverse()); + } + break; + default: + qDebug()<<"Get wrong tool type. Ignore."<< static_cast(at(i).getTypeTool()); + break; + } + } + return points; +} + +//--------------------------------------------------------------------------------------------------------------------- +QVector VDetail::SeamAllowancePoints(const VContainer *data) const +{ + QVector pointsEkv; + for (int i = 0; i< CountNode(); ++i) + { + switch (at(i).getTypeTool()) + { + case (Tool::NodePoint): + { + const QSharedPointer point = data->GeometricObject(at(i).getId()); + if (getSeamAllowance() == true) + { + QPointF pEkv = point->toQPointF(); + pEkv.setX(pEkv.x()+at(i).getMx()); + pEkv.setY(pEkv.y()+at(i).getMy()); + pointsEkv.append(pEkv); + } + } + break; + case (Tool::NodeArc): + case (Tool::NodeSpline): + case (Tool::NodeSplinePath): + { + const QSharedPointer curve = data->GeometricObject(at(i).getId()); + + const QPointF begin = StartSegment(data, i); + const QPointF end = EndSegment(data, i); + + QVector nodePoints = curve->GetSegmentPoints(begin, end, at(i).getReverse()); + if (getSeamAllowance() == true) + { + pointsEkv << biasPoints(nodePoints, at(i).getMx(), at(i).getMy()); + } + } + break; + default: + qDebug()<<"Get wrong tool type. Ignore."<< static_cast(at(i).getTypeTool()); + break; + } + } + + if (getSeamAllowance() == true) + { + if (getClosed() == true) + { + pointsEkv = Equidistant(pointsEkv, EquidistantType::CloseEquidistant, qApp->toPixel(getWidth())); + } + else + { + pointsEkv = Equidistant(pointsEkv, EquidistantType::OpenEquidistant, qApp->toPixel(getWidth())); + } + } + return pointsEkv; +} + +//--------------------------------------------------------------------------------------------------------------------- +QPainterPath VDetail::ContourPath(const VContainer *data) const +{ + QVector points = ContourPoints(data); + QVector pointsEkv = SeamAllowancePoints(data); + + QPainterPath path; + + // contour + path.moveTo(points[0]); + for (qint32 i = 1; i < points.count(); ++i) + { + path.lineTo(points.at(i)); + } + path.lineTo(points.at(0)); + + // seam allowence + if (getSeamAllowance() == true) + { + QPainterPath ekv; + ekv.moveTo(pointsEkv.at(0)); + for (qint32 i = 1; i < pointsEkv.count(); ++i) + { + ekv.lineTo(pointsEkv.at(i)); + } + + path.addPath(ekv); + path.setFillRule(Qt::WindingFill); + } + + return path; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief listNodePoint return list nodes only with points. + * @return list points node. + */ QVector VDetail::listNodePoint() const { QVector list; @@ -289,6 +499,12 @@ QVector VDetail::listNodePoint() const } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief indexOfNode return index in list node using id object. + * @param list list nodes detail. + * @param id object (arc, point, spline, splinePath) id. + * @return index in list or -1 id can't find. + */ int VDetail::indexOfNode(const QVector &list, const quint32 &id) { for (int i = 0; i < list.size(); ++i) @@ -303,96 +519,149 @@ int VDetail::indexOfNode(const QVector &list, const quint32 &id) } //--------------------------------------------------------------------------------------------------------------------- +QPointF VDetail::StartSegment(const VContainer *data, const int &i) const +{ + QPointF begin; + if (CountNode() > 1) + { + if (i == 0) + { + if (at(CountNode()-1).getTypeTool() == Tool::NodePoint) + { + begin = data->GeometricObject(at(CountNode()-1).getId())->toQPointF(); + } + } + else + { + if (at(i-1).getTypeTool() == Tool::NodePoint) + { + begin = data->GeometricObject(at(i-1).getId())->toQPointF(); + } + } + } + return begin; +} + +//--------------------------------------------------------------------------------------------------------------------- +QPointF VDetail::EndSegment(const VContainer *data, const int &i) const +{ + QPointF end; + if (CountNode() > 2) + { + if (i == CountNode() - 1) + { + if (at(0).getTypeTool() == Tool::NodePoint) + { + end = data->GeometricObject(at(0).getId())->toQPointF(); + } + } + else + { + if (at(i+1).getTypeTool() == Tool::NodePoint) + { + end = data->GeometricObject(at(i+1).getId())->toQPointF(); + } + } + } + return end; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief biasPoints bias point. + * @param points vector of points. + * @param mx offset respect to x. + * @param my offset respect to y. + * @return new vector biased points. + */ +QVector VDetail::biasPoints(const QVector &points, const qreal &mx, const qreal &my) +{ + QVector p; + for (qint32 i = 0; i < points.size(); ++i) + { + QPointF point = points.at(i); + point.setX(point.x() + mx); + point.setY(point.y() + my); + p.append(point); + } + return p; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief append append in the end of list node. + * @param node new node. + */ void VDetail::append(const VNodeDetail &node) { d->nodes.append(node); } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief CountNode return count nodes. + * @return count. + */ qint32 VDetail::CountNode() const { return d->nodes.size(); } //--------------------------------------------------------------------------------------------------------------------- -QString VDetail::getName() const -{ - return d->name; -} - -//--------------------------------------------------------------------------------------------------------------------- -void VDetail::setName(const QString &value) -{ - d->name = value; -} - -//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getMx return bias for X axis. + * @return x bias. + */ qreal VDetail::getMx() const { return d->mx; } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief setMx set bias for X axis. + * @param value new x bias. + */ void VDetail::setMx(const qreal &value) { d->mx = value; } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getMy get bias for y axis. + * @return y axis. + */ qreal VDetail::getMy() const { return d->my; } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief setMy set bias for y axis. + * @param value new y bias. + */ void VDetail::setMy(const qreal &value) { d->my = value; } //--------------------------------------------------------------------------------------------------------------------- -bool VDetail::getSeamAllowance() const -{ - return d->seamAllowance; -} - -//--------------------------------------------------------------------------------------------------------------------- -void VDetail::setSeamAllowance(bool value) -{ - d->seamAllowance = value; -} - -//--------------------------------------------------------------------------------------------------------------------- -bool VDetail::getClosed() const -{ - return d->closed; -} - -//--------------------------------------------------------------------------------------------------------------------- -void VDetail::setClosed(bool value) -{ - d->closed = value; -} - -//--------------------------------------------------------------------------------------------------------------------- -qreal VDetail::getWidth() const -{ - return d->width; -} - -//--------------------------------------------------------------------------------------------------------------------- -void VDetail::setWidth(const qreal &value) -{ - d->width = value; -} - -//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getNodes return list of nodes. + * @return list of nodes. + */ QVector VDetail::getNodes() const { return d->nodes; } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief setNodes set list of nodes + * @param value list of nodes + */ void VDetail::setNodes(const QVector &value) { d->nodes = value; diff --git a/src/app/geometry/vdetail.h b/src/app/geometry/vdetail.h index 50a3ac12c..d273e8da1 100644 --- a/src/app/geometry/vdetail.h +++ b/src/app/geometry/vdetail.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -30,212 +30,68 @@ #define VDETAIL_H #include "vnodedetail.h" -#include #include -class QString; +#include "../libs/vlayout/vabstractdetail.h" + class VDetailData; +class VContainer; +class QPainterPath; /** * @brief The VDetail class for path of object (points, arcs, splines). */ -class VDetail +class VDetail :public VAbstractDetail { public: - /** - * @brief VDetail default contructor. Create empty detail. - */ VDetail(); - /** - * @brief VDetail constructor. - * @param name detail name. - * @param nodes list of nodes. - */ VDetail(const QString &name, const QVector &nodes); - /** - * @brief VDetail copy constructor. - * @param detail detail. - */ VDetail(const VDetail &detail); - /** - * @brief operator = assignment operator. - * @param detail detail. - * @return new detail. - */ VDetail &operator=(const VDetail &detail); - ~VDetail(); - /** - * @brief append append in the end of list node. - * @param node new node. - */ + virtual ~VDetail(); + void append(const VNodeDetail &node); - /** - * @brief Clear detail full clear. - */ void Clear(); - /** - * @brief ClearNodes clear list of nodes. - */ void ClearNodes(); - /** - * @brief CountNode return count nodes. - * @return count. - */ qint32 CountNode() const; - /** - * @brief Containes check if detail containe this id. - * @param id object id. - * @return true if containe. - */ bool Containes(const quint32 &id)const; - /** - * @brief operator [] find node by index in list. - * @param indx index node in list. - * @return node - */ VNodeDetail & operator[](int indx); - /** - * @brief at find node by index in list. - * @param indx index node in list. - * @return const node. - */ const VNodeDetail & at ( int indx ) const; - /** - * @brief getName return detail name. - * @return name. - */ - QString getName() const; - /** - * @brief setName set detail name. - * @param value new name. - */ - void setName(const QString &value); - /** - * @brief getMx return bias for X axis. - * @return x bias. - */ - qreal getMx() const; - /** - * @brief setMx set bias for X axis. - * @param value new x bias. - */ - void setMx(const qreal &value); - /** - * @brief getMy get bias for y axis. - * @return y axis. - */ - qreal getMy() const; - /** - * @brief setMy set bias for y axis. - * @param value new y bias. - */ - void setMy(const qreal &value); - /** - * @brief getSeamAllowance keep status for seam allowance detail. - * @return true - need seam allowance, false - no need seam allowance. - */ - bool getSeamAllowance() const; - /** - * @brief setSeamAllowance set status for seam allowance detail. - * @param value true - need seam allowance, false - no need seam allowance. - */ - void setSeamAllowance(bool value); - /** - * @brief getClosed keep close status for detail equdistant. - * @return true - close equdistant, false - don't close equdistant. - */ - bool getClosed() const; - /** - * @brief setClosed set close status for detail equdistant. - * @param value true - close equdistant, false - don't close equdistant. - */ - void setClosed(bool value); - /** - * @brief getWidth return value detail seam allowance. - * @return value in mm. - */ - qreal getWidth() const; - /** - * @brief setWidth set value detail seam allowance. - * @param value width in mm. - */ - void setWidth(const qreal &value); - /** - * @brief getNodes return list of nodes. - * @return list of nodes. - */ + + qreal getMx() const; + void setMx(const qreal &value); + + qreal getMy() const; + void setMy(const qreal &value); + + quint32 id() const; + void setId(const quint32 &id); + QVector getNodes() const; - /** - * @brief setNodes set list of nodes - * @param value list of nodes - */ - void setNodes(const QVector &value); - /** - * @brief indexOfNode return index in list node using id object. - * @param id object (arc, point, spline, splinePath) id. - * @return index in list or -1 id can't find. - */ - int indexOfNode(const quint32 &id) const; - /** - * @brief id return id detail in list data. - * @return id. - */ - quint32 id() const; - /** - * @brief setId set id detail in list data. - * @param id detail id. - */ - void setId(const quint32 &id); - /** - * @brief OnEdge checks if two poins located on the edge. Edge is line between two points. If between two points - * located arcs or splines ignore this. - * @param p1 id first point. - * @param p2 id second point. - * @return true - on edge, false - no. - */ - bool OnEdge(const quint32 &p1, const quint32 &p2)const; - /** - * @brief Edge return edge index in detail. Edge is line between two points. If between two points - * located arcs or splines ignore this. - * @param p1 id first point. - * @param p2 id second point. - * @return edge index or -1 if points don't located on edge - */ - int Edge(const quint32 &p1, const quint32 &p2)const; - /** - * @brief NodeOnEdge return nodes located on edge with index. - * @param index index of edge. - * @param p1 first node. - * @param p2 second node. - */ - void NodeOnEdge(const quint32 &index, VNodeDetail &p1, VNodeDetail &p2)const; - /** - * @brief RemoveEdge return detail without edge with index. - * @param index idex of edge. - * @return detail without edge with index. - */ - VDetail RemoveEdge(const quint32 &index) const; - /** - * @brief Missing find missing ids in detail. When we deleted object in detail and return this detail need - * understand, what nodes need make invisible. - * @param det changed detail. - * @return list with missing detail. - */ + void setNodes(const QVector &value); + + int indexOfNode(const quint32 &id) const; + bool OnEdge(const quint32 &p1, const quint32 &p2)const; + int Edge(const quint32 &p1, const quint32 &p2)const; + void NodeOnEdge(const quint32 &index, VNodeDetail &p1, VNodeDetail &p2)const; + VDetail RemoveEdge(const quint32 &index) const; + QList Missing(const VDetail &det) const; + + QVector ContourPoints(const VContainer *data) const; + QVector SeamAllowancePoints(const VContainer *data) const; + + QPainterPath ContourPath(const VContainer *data) const; private: QSharedDataPointer d; - /** - * @brief listNodePoint return list nodes only with points. - * @return list points node. - */ + QVector listNodePoint()const; - /** - * @brief indexOfNode return index in list node using id object. - * @param list list nodes detail. - * @param id object (arc, point, spline, splinePath) id. - * @return index in list or -1 id can't find. - */ - static int indexOfNode(const QVector &list, const quint32 &id); + static int indexOfNode(const QVector &list, const quint32 &id); + + QPointF StartSegment(const VContainer *data, const int &i) const; + QPointF EndSegment(const VContainer *data, const int &i) const; + + static QVector biasPoints(const QVector &points, const qreal &mx, const qreal &my); }; #endif // VDETAIL_H diff --git a/src/app/geometry/vdetail_p.h b/src/app/geometry/vdetail_p.h index cfb880992..a6f1ae49a 100644 --- a/src/app/geometry/vdetail_p.h +++ b/src/app/geometry/vdetail_p.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -42,53 +42,30 @@ class VDetailData : public QSharedData { public: VDetailData() - :_id(NULL_ID), nodes(QVector()), name(QString()), mx(0), my(0), seamAllowance(true), closed(true), - width(0) + :_id(NULL_ID), nodes(QVector()), mx(0), my(0) {} - VDetailData(const QString &name, const QVector &nodes) - :_id(NULL_ID), nodes(nodes), name(name), mx(0), my(0), seamAllowance(true), closed(true), width(0) + VDetailData(const QVector &nodes) + :_id(NULL_ID), nodes(nodes), mx(0), my(0) {} VDetailData(const VDetailData &detail) - :QSharedData(detail), _id(NULL_ID), nodes(detail.nodes), name(detail.name), mx(detail.mx), my(detail.my), - seamAllowance(detail.seamAllowance), closed(detail.closed), width(detail.width) + :QSharedData(detail), _id(NULL_ID), nodes(detail.nodes), mx(detail.mx), my(detail.my) {} ~VDetailData() {} - /** - * @brief _id id detail. - */ + /** @brief _id id detail. */ quint32 _id; - /** - * @brief nodes list detail nodes. - */ + + /** @brief nodes list detail nodes. */ QVector nodes; - /** - * @brief name detail name. - */ - QString name; - /** - * @brief mx bias x axis. - */ + + /** @brief mx bias x axis. */ qreal mx; - /** - * @brief my bias y axis. - */ + + /** @brief my bias y axis. */ qreal my; - /** - * @brief seamAllowance status seamAllowance detail. - */ - bool seamAllowance; - /** - * @brief closed status equdistant detail. - */ - bool closed; - /** - * @brief width value seamAllowance in mm. - */ - qreal width; }; #ifdef Q_CC_GNU diff --git a/src/app/geometry/vequidistant.h b/src/app/geometry/vequidistant.h deleted file mode 100644 index 9e19df5d5..000000000 --- a/src/app/geometry/vequidistant.h +++ /dev/null @@ -1,113 +0,0 @@ -/************************************************************************ - ** - ** @file vequidistant.h - ** @author Roman Telezhynskyi - ** @date 28 1, 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 - ** 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 . - ** - *************************************************************************/ - -#ifndef VEQUIDISTANT_H -#define VEQUIDISTANT_H - -#include "vdetail.h" - -class QPainterPath; -class VContainer; -class QPointF; -class QLineF; - -/** - * @brief The VEquidistant class calculate equidistant for detail. - */ -class VEquidistant -{ -public: - VEquidistant(const VContainer *data); - ~VEquidistant(){} - /** - * @brief ContourPath create painter path for detail. - * @param idDetail id of detail. - * @param data container with objects (points, arcs, splines). - * @return return painter path of contour detail. - */ - QPainterPath ContourPath(const quint32 &idDetail) const; -private: - Q_DISABLE_COPY(VEquidistant) - const VContainer *data; - /** - * @brief biasPoints bias point. - * @param points vector of points. - * @param mx offset respect to x. - * @param my offset respect to y. - * @return new vector biased points. - */ - static QVector biasPoints(const QVector &points, const qreal &mx, const qreal &my); - /** - * @brief CorrectEquidistantPoints clear equivalent points and remove point on line from equdistant. - * @param points list of points equdistant. - * @return corrected list. - */ - static QVector CorrectEquidistantPoints(const QVector &points); - /** - * @brief Equidistant create equidistant painter path for detail. - * @param points vector of points. - * @param eqv type of equidistant. - * @param width width of equidistant. - * @return return painter path of equidistant. - */ - static QPainterPath Equidistant(QVector points, const EquidistantType &eqv, const qreal &width); - /** - * @brief CheckLoops seek and delete loops in equidistant. - * @param points vector of points of equidistant. - * @return vector of points of equidistant. - */ - static QVector CheckLoops(const QVector &points); - /** - * @brief EkvPoint return vector of points of equidistant two lines. Last point of two lines must be equal. - * @param line1 first line. - * @param line2 second line. - * @param width width of equidistant. - * @return vector of points. - */ - static QVector EkvPoint(const QLineF &line1, const QLineF &line2, const qreal &width); - /** - * @brief ParallelLine create parallel line. - * @param line starting line. - * @param width width to parallel line. - * @return parallel line. - */ - static QLineF ParallelLine(const QLineF &line, qreal width ); - /** - * @brief SingleParallelPoint return point of parallel line. - * @param line starting line. - * @param angle angle in degree. - * @param width width to parallel line. - * @return point of parallel line. - */ - static QPointF SingleParallelPoint(const QLineF &line, const qreal &angle, const qreal &width); - - QPointF StartSegment(const VDetail &detail, const int &i) const; - QPointF EndSegment(const VDetail &detail, const int &i) const; -}; - -#endif // VEQUIDISTANT_H diff --git a/src/app/geometry/vgobject.cpp b/src/app/geometry/vgobject.cpp index a191354c3..467d1be37 100644 --- a/src/app/geometry/vgobject.cpp +++ b/src/app/geometry/vgobject.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/geometry/vgobject.h b/src/app/geometry/vgobject.h index e9a316a10..eff533f3d 100644 --- a/src/app/geometry/vgobject.h +++ b/src/app/geometry/vgobject.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/geometry/vgobject_p.h b/src/app/geometry/vgobject_p.h index b3dcac78a..525cdbdd6 100644 --- a/src/app/geometry/vgobject_p.h +++ b/src/app/geometry/vgobject_p.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/geometry/vnodedetail.cpp b/src/app/geometry/vnodedetail.cpp index 80b54c6fa..963b7a246 100644 --- a/src/app/geometry/vnodedetail.cpp +++ b/src/app/geometry/vnodedetail.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/geometry/vnodedetail.h b/src/app/geometry/vnodedetail.h index ab557f8bc..4b89e17a0 100644 --- a/src/app/geometry/vnodedetail.h +++ b/src/app/geometry/vnodedetail.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/geometry/vnodedetail_p.h b/src/app/geometry/vnodedetail_p.h index 3de2ea778..a99a289d0 100644 --- a/src/app/geometry/vnodedetail_p.h +++ b/src/app/geometry/vnodedetail_p.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/geometry/vpointf.cpp b/src/app/geometry/vpointf.cpp index 0a0088b46..b37f4e95e 100644 --- a/src/app/geometry/vpointf.cpp +++ b/src/app/geometry/vpointf.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/geometry/vpointf.h b/src/app/geometry/vpointf.h index 78b437310..ed3597b1d 100644 --- a/src/app/geometry/vpointf.h +++ b/src/app/geometry/vpointf.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/geometry/vpointf_p.h b/src/app/geometry/vpointf_p.h index cefc69de9..82979c7a6 100644 --- a/src/app/geometry/vpointf_p.h +++ b/src/app/geometry/vpointf_p.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/geometry/vspline.cpp b/src/app/geometry/vspline.cpp index e6d48a9d9..0e65f14b4 100644 --- a/src/app/geometry/vspline.cpp +++ b/src/app/geometry/vspline.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -294,6 +294,17 @@ void VSpline::PointBezier_r ( qreal x1, qreal y1, qreal x2, qreal y2, qreal x3, qreal y3, qreal x4, qreal y4, qint16 level, QVector &px, QVector &py) { + if (px.size() >= 2) + { + for (int i=1; i < px.size(); ++i) + { + if (QPointF(px.at(i-1), py.at(i-1)) == QPointF(px.at(i), py.at(i))) + { + qCritical("All neighbors points in path must be unique."); + } + } + } + const double curve_collinearity_epsilon = 1e-30; const double curve_angle_tolerance_epsilon = 0.01; const double m_angle_tolerance = 0.0; @@ -733,3 +744,134 @@ void VSpline::SetKcurve(qreal factor) d->kCurve = factor; } } + +//--------------------------------------------------------------------------------------------------------------------- +int VSpline::Sign(long double ld) const +{ + if(qAbs(ld)<0.00000000001) + { + return 0; + } + return (ld>0) ? 1 : -1; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief Cubic Cubic equation solution. Real coefficients case. + * + * This method use method Vieta-Cardano for eval cubic equations. + * Cubic equation write in form x3+a*x2+b*x+c=0. + * + * Output: + * 3 real roots -> then x is filled with them; + * 1 real + 2 complex -> x[0] is real, x[1] is real part of complex roots, x[2] - non-negative imaginary part. + * + * @param x solution array (size 3). + * @param a coefficient + * @param b coefficient + * @param c coefficient + * @return 3 - 3 real roots; + * 1 - 1 real root + 2 complex; + * 2 - 1 real root + complex roots imaginary part is zero (i.e. 2 real roots). + */ +qint32 VSpline::Cubic(QVector &x, qreal a, qreal b, qreal c) const +{ + //To find cubic equation roots in the case of real coefficients, calculated at the beginning + const qreal q = (pow(a, 2) - 3*b)/9.; + const qreal r = (2*pow(a, 3) - 9*a*b + 27.*c)/54.; + if (pow(r, 2) < pow(q, 3)) + { // equation has three real roots, use formula Vieta + const qreal t = acos(r/sqrt(pow(q, 3)))/3.; + x.insert(0, -2.*sqrt(q)*cos(t)-a/3); + x.insert(1, -2.*sqrt(q)*cos(t + (2*M_2PI/3.)) - a/3.); + x.insert(2, -2.*sqrt(q)*cos(t - (2*M_2PI/3.)) - a/3.); + return(3); + } + else + { // 1 real root + 2 complex + //Formula Cardano + const qreal aa = -Sign(r)*pow(fabs(r)+sqrt(pow(r, 2)-pow(q, 3)), 1./3.); + const qreal bb = Sign(aa) == 0 ? 0 : q/aa; + + x.insert(0, aa+bb-a/3.); // Real root + x.insert(1, (-0.5)*(aa+bb)-a/3.); //Complex root + x.insert(2, (sqrt(3.)*0.5)*fabs(aa-bb)); // Complex root + if (qFuzzyCompare(x.at(2) + 1, 0. + 1)) + { + return(2); + } + return(1); + } +} + +//--------------------------------------------------------------------------------------------------------------------- +QVector VSpline::CalcT (qreal curveCoord1, qreal curveCoord2, qreal curveCoord3, + qreal curveCoord4, qreal pointCoord) const +{ + const qreal a = -curveCoord1 + 3*curveCoord2 - 3*curveCoord3 + curveCoord4; + const qreal b = 3*curveCoord1 - 6*curveCoord2 + 3*curveCoord3; + const qreal c = -3*curveCoord1 + 3*curveCoord2; + const qreal d = -pointCoord + curveCoord1; + + QVector t = QVector(3, -1); + Cubic(t, b/a, c/a, d/a); + + QVector retT; + for (int i=0; i < t.size(); ++i) + { + if ( t.at(i) >= 0 && t.at(i) <= 1 ) + { + retT.append(t.at(i)); + } + } + + return retT; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief VSpline::ParamT calculate t coeffient that reprezent point on curve. + * + * Each point that belongs to Cubic Bézier curve can be shown by coefficient in interval [0; 1]. + * + * @param pBt point on curve + * @return t coeffient that reprezent this point on curve. Return -1 if point doesn't belongs to curve. + */ +qreal VSpline::ParamT (const QPointF &pBt) const +{ + QVector ts; + // Calculate t coefficient for each axis + ts += CalcT (GetP1().toQPointF().x(), d->p2.x(), d->p3.x(), GetP4().toQPointF().x(), pBt.x()); + ts += CalcT (GetP1().toQPointF().y(), d->p2.y(), d->p3.y(), GetP4().toQPointF().y(), pBt.y()); + + if(ts.isEmpty()) + { + return -1; // We don't have candidates + } + + qreal tx = -1; + qreal eps = 3; // Error calculation + + // In morst case we will have 6 result in interval [0; 1]. + // Here we try find closest to our point. + for (int i=0; i< ts.size(); ++i) + { + const qreal t = ts.at(i); + const QPointF p0 = GetP1().toQPointF(); + const QPointF p1 = d->p2; + const QPointF p2 = d->p3; + const QPointF p3 = GetP4().toQPointF(); + //The explicit form of the Cubic Bézier curve + const qreal pointX = pow(1-t, 3)*p0.x() + 3*pow(1-t, 2)*t*p1.x() + 3*(1-t)*pow(t, 2)*p2.x() + pow(t, 3)*p3.x(); + const qreal pointY = pow(1-t, 3)*p0.y() + 3*pow(1-t, 2)*t*p1.y() + 3*(1-t)*pow(t, 2)*p2.y() + pow(t, 3)*p3.y(); + + const QLineF line(pBt, QPointF(pointX, pointY)); + if (line.length() <= eps) + { + tx = t; + eps = line.length(); //Next point should be even closest + } + } + + return tx; +} diff --git a/src/app/geometry/vspline.h b/src/app/geometry/vspline.h index d363f8b0f..4e55b1d65 100644 --- a/src/app/geometry/vspline.h +++ b/src/app/geometry/vspline.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -71,6 +71,7 @@ public: // cppcheck-suppress unusedFunction static QVector SplinePoints(const QPointF &p1, const QPointF &p4, qreal angle1, qreal angle2, qreal kAsm1, qreal kAsm2, qreal kCurve); + qreal ParamT(const QPointF &pBt) const; protected: static QVector GetPoints (const QPointF &p1, const QPointF &p2, const QPointF &p3, const QPointF &p4 ); private: @@ -80,6 +81,10 @@ private: qint16 level, QVector &px, QVector &py); static qreal CalcSqDistance ( qreal x1, qreal y1, qreal x2, qreal y2); void CreateName(); + QVector CalcT(qreal curveCoord1, qreal curveCoord2, qreal curveCoord3, qreal curveCoord4, + qreal pointCoord) const; + qint32 Cubic(QVector &x, qreal a, qreal b, qreal c) const; + int Sign(long double ld) const; }; #endif // VSPLINE_H diff --git a/src/app/geometry/vspline_p.h b/src/app/geometry/vspline_p.h index 8ca4d8efd..f63470486 100644 --- a/src/app/geometry/vspline_p.h +++ b/src/app/geometry/vspline_p.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/geometry/vsplinepath.cpp b/src/app/geometry/vsplinepath.cpp index d2c49976b..63a5e68f2 100644 --- a/src/app/geometry/vsplinepath.cpp +++ b/src/app/geometry/vsplinepath.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -30,6 +30,8 @@ #include "vsplinepath_p.h" #include "../libs/ifc/exception/vexception.h" +#include + //--------------------------------------------------------------------------------------------------------------------- VSplinePath::VSplinePath(qreal kCurve, quint32 idObject, Draw mode) : VAbstractCurve(GOType::SplinePath, idObject, mode), d(new VSplinePathData(kCurve)) @@ -47,6 +49,11 @@ VSplinePath::~VSplinePath() //--------------------------------------------------------------------------------------------------------------------- void VSplinePath::append(const VSplinePoint &point) { + if (d->path.size() > 0 && d->path.last().P().toQPointF() == point.P().toQPointF()) + { + return; + } + d->path.append(point); QString name = splPath; name.append(QString("_%1").arg(d->path.first().P().name())); @@ -231,6 +238,30 @@ void VSplinePath::setMaxCountPoints(const qint32 &value) d->maxCountPoints = value; } +//--------------------------------------------------------------------------------------------------------------------- +int VSplinePath::Segment(const QPointF &p) const +{ + int index = -1; + for (qint32 i = 1; i <= Count(); ++i) + { + VSpline spl = VSpline(d->path.at(i-1).P(), d->path.at(i).P(), d->path.at(i-1).Angle2(), d->path.at(i).Angle1(), + d->path.at(i-1).KAsm2(), d->path.at(i).KAsm1(), d->kCurve); + + const qreal t = spl.ParamT(p); + + if (qFloor(t) == -1) + { + continue; + } + else + { + index = i; + break; + } + } + return index; +} + //--------------------------------------------------------------------------------------------------------------------- qint32 VSplinePath::CountPoint() const { @@ -250,13 +281,13 @@ void VSplinePath::Clear() } //--------------------------------------------------------------------------------------------------------------------- -qreal VSplinePath::getKCurve() const +qreal VSplinePath::GetKCurve() const { return d->kCurve; } //--------------------------------------------------------------------------------------------------------------------- -void VSplinePath::setKCurve(const qreal &value) +void VSplinePath::SetKCurve(const qreal &value) { if (value > 0) { diff --git a/src/app/geometry/vsplinepath.h b/src/app/geometry/vsplinepath.h index e562be232..6804eb36c 100644 --- a/src/app/geometry/vsplinepath.h +++ b/src/app/geometry/vsplinepath.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -118,15 +118,15 @@ public: */ void Clear(); /** - * @brief getKCurve return coefficient of curvature spline path. + * @brief GetKCurve return coefficient of curvature spline path. * @return coefficient of curvature spline. */ - qreal getKCurve() const; + qreal GetKCurve() const; /** - * @brief setKCurve set coefficient of curvature spline path. + * @brief SetKCurve set coefficient of curvature spline path. * @param value coefficient of curvature spline path. */ - void setKCurve(const qreal &value); + void SetKCurve(const qreal &value); /** * @brief GetPoint pointer to list spline point. * @return list. @@ -160,8 +160,8 @@ public: * * VSplinePoint splP1 = splPath->at(p1); * VSplinePoint splP2 = splPath->at(p2); - * VSpline spl1 = VSpline(splP1.P(), spl1p2, spl1p3, *p, splPath->getKCurve()); - * VSpline spl2 = VSpline(*p, spl2p2, spl2p3, splP2.P(), splPath->getKCurve()); + * VSpline spl1 = VSpline(splP1.P(), spl1p2, spl1p3, *p, splPath->GetKCurve()); + * VSpline spl2 = VSpline(*p, spl2p2, spl2p3, splP2.P(), splPath->GetKCurve()); * @param length length first spline path. * @param p1 index first spline point in list. * @param p2 index second spline point in list. @@ -185,6 +185,8 @@ public: * @param value max count. */ void setMaxCountPoints(const qint32 &value); + + int Segment(const QPointF &p) const; private: QSharedDataPointer d; }; diff --git a/src/app/geometry/vsplinepath_p.h b/src/app/geometry/vsplinepath_p.h index c671c1f3e..555139e64 100644 --- a/src/app/geometry/vsplinepath_p.h +++ b/src/app/geometry/vsplinepath_p.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/geometry/vsplinepoint.cpp b/src/app/geometry/vsplinepoint.cpp index 2928bece2..0168b0312 100644 --- a/src/app/geometry/vsplinepoint.cpp +++ b/src/app/geometry/vsplinepoint.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/geometry/vsplinepoint.h b/src/app/geometry/vsplinepoint.h index ae9d569d5..e6aae714f 100644 --- a/src/app/geometry/vsplinepoint.h +++ b/src/app/geometry/vsplinepoint.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/geometry/vsplinepoint_p.h b/src/app/geometry/vsplinepoint_p.h index 4e7789358..99e1491a7 100644 --- a/src/app/geometry/vsplinepoint_p.h +++ b/src/app/geometry/vsplinepoint_p.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/main.cpp b/src/app/main.cpp index fc19562e5..16cb4f758 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/mainwindow.cpp b/src/app/mainwindow.cpp index 86d1161b6..649958727 100644 --- a/src/app/mainwindow.cpp +++ b/src/app/mainwindow.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -29,7 +29,6 @@ #include "mainwindow.h" #include "ui_mainwindow.h" #include "geometry/vspline.h" -#include "geometry/vequidistant.h" #include "exception/vexceptionobjecterror.h" #include "exception/vexceptionconversionerror.h" #include "exception/vexceptionemptyparameter.h" @@ -72,7 +71,7 @@ Q_LOGGING_CATEGORY(vMainWindow, "v.mainwindow") * @param parent parent widget. */ MainWindow::MainWindow(QWidget *parent) - :QMainWindow(parent), ui(new Ui::MainWindow), pattern(nullptr), doc(nullptr), tool(Tool::Arrow), + :QMainWindow(parent), ui(new Ui::MainWindow), pattern(nullptr), doc(nullptr), currentTool(Tool::Arrow), lastUsedTool(Tool::Arrow), currentScene(nullptr), sceneDraw(nullptr), sceneDetails(nullptr), mouseCoordinate(nullptr), helpLabel(nullptr), isInitialized(false), dialogTable(nullptr), dialogTool(nullptr), dialogHistory(nullptr), comboBoxDraws(nullptr), curFile(QString()), mode(Draw::Calculation), currentDrawIndex(0), @@ -93,6 +92,7 @@ MainWindow::MainWindow(QWidget *parent) sceneDraw = new VMainGraphicsScene(); currentScene = sceneDraw; qApp->setCurrentScene(currentScene); + connect(this, &MainWindow::EnableItemMove, sceneDraw, &VMainGraphicsScene::EnableItemMove); connect(sceneDraw, &VMainGraphicsScene::mouseMove, this, &MainWindow::mouseMove); sceneDetails = new VMainGraphicsScene(); connect(sceneDetails, &VMainGraphicsScene::mouseMove, this, &MainWindow::mouseMove); @@ -134,6 +134,7 @@ MainWindow::MainWindow(QWidget *parent) PropertyBrowser(); setCurrentFile(""); + WindowsLocale(); } //--------------------------------------------------------------------------------------------------------------------- @@ -245,7 +246,9 @@ void MainWindow::ActionNewPP() sceneDraw->addItem(spoint); ui->view->itemClicked(spoint); connect(spoint, &VToolPoint::ChoosedTool, sceneDraw, &VMainGraphicsScene::ChoosedItem); + connect(sceneDraw, &VMainGraphicsScene::DisableItem, spoint, &VToolSinglePoint::Disable); connect(sceneDraw, &VMainGraphicsScene::NewFactor, spoint, &VToolSinglePoint::SetFactor); + connect(sceneDraw, &VMainGraphicsScene::EnableToolMove, spoint, &VToolSinglePoint::EnableToolMove); QHash* tools = doc->getTools(); SCASSERT(tools != nullptr); tools->insert(id, spoint); @@ -297,7 +300,8 @@ void MainWindow::SetToolButton(bool checked, Tool t, const QString &cursor, cons if (checked) { CancelTool(); - tool = t; + emit EnableItemMove(false); + currentTool = lastUsedTool = t; QPixmap pixmap(cursor); QCursor cur(pixmap, 2, 3); ui->view->setCursor(cur); @@ -337,7 +341,8 @@ void MainWindow::SetToolButtonWithApply(bool checked, Tool t, const QString &cur if (checked) { CancelTool(); - tool = t; + emit EnableItemMove(false); + currentTool = lastUsedTool = t; QPixmap pixmap(cursor); QCursor cur(pixmap, 2, 3); ui->view->setCursor(cur); @@ -659,7 +664,7 @@ void MainWindow::ToolPointOfIntersection(bool checked) { SetToolButtonWithApply(checked, Tool::PointOfIntersection, ":/cursor/pointofintersect_cursor.png", - tr("Select point vertically"), + tr("Select point for X value (vertical)"), &MainWindow::ClosedDialogWithApply, &MainWindow::ApplyDialog); } @@ -856,12 +861,12 @@ void MainWindow::ToolBarOption() const QStringList listSizes = VMeasurement::ListSizes(doc->GetGradationSizes()); gradationHeights = SetGradationList(tr("Height: "), listHeights); - SetDefaultHeight(static_cast(GHeights::H176)); + SetDefaultHeight(static_cast(pattern->height())); connect(gradationHeights, static_cast(&QComboBox::currentIndexChanged), this, &MainWindow::ChangedHeight); gradationSizes = SetGradationList(tr("Size: "), listSizes); - SetDefaultSize(static_cast(GSizes::S50)); + SetDefaultSize(static_cast(pattern->size())); connect(gradationSizes, static_cast(&QComboBox::currentIndexChanged), this, &MainWindow::ChangedSize); @@ -885,12 +890,13 @@ QComboBox *MainWindow::SetGradationList(const QString &label, const QStringList } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief SetDefaultHeight set base height in combobox. + * @param value [in] height value in pattern units. + */ void MainWindow::SetDefaultHeight(int value) { - qreal val = VAbstractMeasurements::UnitConvertor(value, Unit::Cm, qApp->patternUnit()); - QString strVal = QString("%1").arg(val); - - qint32 index = gradationHeights->findText(strVal); + const qint32 index = gradationHeights->findText(QString("%1").arg(value)); if (index != -1) { gradationHeights->setCurrentIndex(index); @@ -902,12 +908,13 @@ void MainWindow::SetDefaultHeight(int value) } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief SetDefaultSize set base size in combobox. + * @param value [in] size value in pattern units. + */ void MainWindow::SetDefaultSize(int value) { - qreal val = VAbstractMeasurements::UnitConvertor(value, Unit::Cm, qApp->patternUnit()); - QString strVal = QString("%1").arg(val); - - qint32 index = gradationSizes->findText(strVal); + const qint32 index = gradationSizes->findText(QString("%1").arg(value)); if (index != -1) { gradationSizes->setCurrentIndex(index); @@ -943,7 +950,6 @@ void MainWindow::ToolBarDraws() ui->actionHistory->setEnabled(false); connect(ui->actionHistory, &QAction::triggered, this, &MainWindow::ActionHistory); - ui->toolBarDraws->addAction(ui->actionLayout); connect(ui->actionLayout, &QAction::triggered, this, &MainWindow::ActionLayout); ui->actionLayout->setEnabled(false); } @@ -1042,120 +1048,80 @@ void MainWindow::CancelTool() delete dialogTool; dialogTool = nullptr; qCDebug(vMainWindow)<<"Dialog closed."; - switch ( tool ) + switch ( currentTool ) { case Tool::Arrow: ui->actionArrowTool->setChecked(false); helpLabel->setText(""); ui->actionStopTool->setEnabled(true); - break; + return; case Tool::SinglePoint: Q_UNREACHABLE(); //Nothing to do here because we can't create this tool from main window. break; case Tool::EndLine: ui->toolButtonEndLine->setChecked(false); - currentScene->setFocus(Qt::OtherFocusReason); - currentScene->clearSelection(); break; case Tool::Line: ui->toolButtonLine->setChecked(false); - currentScene->setFocus(Qt::OtherFocusReason); - currentScene->clearFocus(); break; case Tool::AlongLine: ui->toolButtonAlongLine->setChecked(false); - currentScene->setFocus(Qt::OtherFocusReason); - currentScene->clearSelection(); break; case Tool::ShoulderPoint: ui->toolButtonShoulderPoint->setChecked(false); - currentScene->setFocus(Qt::OtherFocusReason); - currentScene->clearSelection(); break; case Tool::Normal: ui->toolButtonNormal->setChecked(false); - currentScene->setFocus(Qt::OtherFocusReason); - currentScene->clearSelection(); break; case Tool::Bisector: ui->toolButtonBisector->setChecked(false); - currentScene->setFocus(Qt::OtherFocusReason); - currentScene->clearSelection(); break; case Tool::LineIntersect: ui->toolButtonLineIntersect->setChecked(false); - currentScene->setFocus(Qt::OtherFocusReason); - currentScene->clearSelection(); break; case Tool::Spline: ui->toolButtonSpline->setChecked(false); - currentScene->setFocus(Qt::OtherFocusReason); - currentScene->clearSelection(); break; case Tool::Arc: ui->toolButtonArc->setChecked(false); - currentScene->setFocus(Qt::OtherFocusReason); - currentScene->clearSelection(); break; case Tool::SplinePath: ui->toolButtonSplinePath->setChecked(false); - currentScene->setFocus(Qt::OtherFocusReason); - currentScene->clearSelection(); break; case Tool::PointOfContact: ui->toolButtonPointOfContact->setChecked(false); - currentScene->setFocus(Qt::OtherFocusReason); - currentScene->clearSelection(); break; case Tool::Detail: ui->toolButtonNewDetail->setChecked(false); break; case Tool::Height: ui->toolButtonHeight->setChecked(false); - currentScene->setFocus(Qt::OtherFocusReason); - currentScene->clearSelection(); break; case Tool::Triangle: ui->toolButtonTriangle->setChecked(false); - currentScene->setFocus(Qt::OtherFocusReason); - currentScene->clearSelection(); break; case Tool::PointOfIntersection: ui->toolButtonPointOfIntersection->setChecked(false); - currentScene->setFocus(Qt::OtherFocusReason); - currentScene->clearSelection(); break; case Tool::CutSpline: ui->toolButtonSplineCutPoint->setChecked(false); - currentScene->setFocus(Qt::OtherFocusReason); - currentScene->clearSelection(); break; case Tool::CutSplinePath: ui->toolButtonSplinePathCutPoint->setChecked(false); - currentScene->setFocus(Qt::OtherFocusReason); - currentScene->clearSelection(); break; case Tool::UnionDetails: ui->toolButtonUnionDetails->setChecked(false); - currentScene->setFocus(Qt::OtherFocusReason); - currentScene->clearSelection(); break; case Tool::CutArc: ui->toolButtonArcCutPoint->setChecked(false); - currentScene->setFocus(Qt::OtherFocusReason); - currentScene->clearSelection(); break; case Tool::LineIntersectAxis: ui->toolButtonLineIntersectAxis->setChecked(false); - currentScene->setFocus(Qt::OtherFocusReason); - currentScene->clearSelection(); break; case Tool::CurveIntersectAxis: ui->toolButtonCurveIntersectAxis->setChecked(false); ui->toolButtonArcIntersectAxis->setChecked(false); - currentScene->setFocus(Qt::OtherFocusReason); - currentScene->clearSelection(); break; case Tool::NodePoint: case Tool::NodeArc: @@ -1165,6 +1131,8 @@ void MainWindow::CancelTool() qDebug()<<"Got wrong tool type. Ignored."; break; } + currentScene->setFocus(Qt::OtherFocusReason); + currentScene->clearSelection(); } //--------------------------------------------------------------------------------------------------------------------- @@ -1177,7 +1145,8 @@ void MainWindow::ArrowTool() CancelTool(); ui->actionArrowTool->setChecked(true); ui->actionStopTool->setEnabled(false); - tool = Tool::Arrow; + currentTool = Tool::Arrow; + emit EnableItemMove(true); QCursor cur(Qt::ArrowCursor); ui->view->setCursor(cur); helpLabel->setText(""); @@ -1269,6 +1238,7 @@ void MainWindow::ActionDraw(bool checked) ui->actionHistory->setEnabled(true); ui->actionOptionDraw->setEnabled(true); ui->actionNewDraw->setEnabled(true); + } else { @@ -1308,6 +1278,7 @@ void MainWindow::ActionDetails(bool checked) ui->actionHistory->setEnabled(false); ui->actionOptionDraw->setEnabled(false); ui->actionNewDraw->setEnabled(false); + } else { @@ -1437,6 +1408,8 @@ void MainWindow::Open() void MainWindow::Preferences() { ConfigDialog dlg(this); + connect(&dlg, &ConfigDialog::UpdateProperties, this, &MainWindow::WindowsLocale); // Must be first + connect(&dlg, &ConfigDialog::UpdateProperties, toolOptions, &VToolOptionsPropertyBrowser::RefreshOptions); if (dlg.exec() == QDialog::Accepted) { InitAutoSave(); @@ -1454,7 +1427,7 @@ void MainWindow::RepotBug() void MainWindow::OnlineHelp() { qCDebug(vMainWindow)<<"Showing online help"; - QDesktopServices::openUrl(QUrl("https://bitbucket.org/dismine/valentina/wiki/manual/v0.2.9/Content")); + QDesktopServices::openUrl(QUrl("https://bitbucket.org/dismine/valentina/wiki/manual/Content")); } //--------------------------------------------------------------------------------------------------------------------- @@ -1470,7 +1443,6 @@ void MainWindow::Clear() qCDebug(vMainWindow)<<"Unlocked pattern file."; ui->actionDetails->setChecked(false); - ui->actionDetails->setEnabled(false); ui->actionDraw->setChecked(true); ui->actionDraw->setEnabled(false); qCDebug(vMainWindow)<<"Returned to Draw mode."; @@ -1494,6 +1466,7 @@ void MainWindow::Clear() ui->actionHistory->setEnabled(false); ui->actionTable->setEnabled(false); ui->actionEdit_pattern_code->setEnabled(false); + ui->actionLast_tool->setEnabled(false); SetEnableTool(false); qApp->setPatternUnit(Unit::Cm); qApp->setPatternType(MeasurementsType::Individual); @@ -1507,6 +1480,7 @@ void MainWindow::Clear() qt_ntfs_permission_lookup--; // turn it off again #endif /*Q_OS_WIN32*/ qApp->getUndoStack()->clear(); + toolOptions->itemClicked(nullptr); } //--------------------------------------------------------------------------------------------------------------------- @@ -1680,11 +1654,20 @@ void MainWindow::SetEnabledGUI(bool enabled) ui->actionHistory->setEnabled(enabled); ui->actionNewDraw->setEnabled(enabled); ui->actionDraw->setEnabled(enabled); - ui->actionDetails->setEnabled(enabled); ui->actionTable->setEnabled(enabled); - ui->actionLayout->setEnabled(enabled); ui->actionZoomFitBest->setEnabled(enabled); ui->actionZoomOriginal->setEnabled(enabled); + + if (enabled) + { + Layout(); + } + else + { + ui->actionDetails->setEnabled(enabled); + ui->actionLayout->setEnabled(enabled); + } + guiEnabled = enabled; sceneDraw->SetDisable(!enabled); @@ -1710,10 +1693,12 @@ void MainWindow::Layout() const QHash *details = pattern->DataDetails(); if (details->size() > 0) { + ui->actionDetails->setEnabled(true); ui->actionLayout->setEnabled(true); } else { + ui->actionDetails->setEnabled(false); ui->actionLayout->setEnabled(false); } } @@ -1828,12 +1813,12 @@ void MainWindow::SetEnableWidgets(bool enable) { ui->actionSaveAs->setEnabled(enable); ui->actionDraw->setEnabled(enable); - ui->actionDetails->setEnabled(enable); ui->actionOptionDraw->setEnabled(enable); if (enable == true && curFile.isEmpty() == false) { ui->actionSave->setEnabled(enable); } + Layout(); ui->actionTable->setEnabled(enable); ui->actionHistory->setEnabled(enable); ui->actionPattern_properties->setEnabled(enable); @@ -1908,7 +1893,7 @@ void MainWindow::ActionLayout(bool checked) { Q_UNUSED(checked); ActionDetails(true);//Get all list of details. - QVector listDetails; + QVector listDetails; const QHash *details = pattern->DataDetails(); if (details->count() == 0) { @@ -1919,8 +1904,14 @@ void MainWindow::ActionLayout(bool checked) while (idetail.hasNext()) { idetail.next(); - QPainterPath path = VEquidistant(pattern).ContourPath(idetail.key()); - listDetails.append(new VItem(path, listDetails.size())); + VLayoutDetail det = VLayoutDetail(); + det.SetCountourPoints(idetail.value().ContourPoints(pattern)); + det.SetSeamAllowencePoints(idetail.value().SeamAllowancePoints(pattern)); + det.setSeamAllowance(idetail.value().getSeamAllowance()); + det.setName(idetail.value().getName()); + det.setWidth(qApp->toPixel(idetail.value().getWidth())); + + listDetails.append(det); } QString description = doc->GetDescription(); @@ -1979,6 +1970,8 @@ void MainWindow::SetEnableTool(bool enable) ui->toolButtonCurveIntersectAxis->setEnabled(drawTools); ui->toolButtonArcIntersectAxis->setEnabled(drawTools); + ui->actionLast_tool->setEnabled(drawTools); + //Modeling Tools ui->toolButtonUnionDetails->setEnabled(modelingTools); } @@ -2013,6 +2006,7 @@ bool MainWindow::SavePattern(const QString &fileName, QString &error) setCurrentFile(fileName); helpLabel->setText(tr("File saved")); qCDebug(vMainWindow)<<"File"<getUndoStack()->createUndoAction(this, tr("&Undo")); undoAction->setShortcuts(QKeySequence::Undo); undoAction->setIcon(QIcon::fromTheme("edit-undo")); - ui->menuPatternPiece->insertAction(ui->actionPattern_properties, undoAction); + ui->menuPatternPiece->insertAction(ui->actionLast_tool, undoAction); ui->toolBarTools->addAction(undoAction); QAction *redoAction = qApp->getUndoStack()->createRedoAction(this, tr("&Redo")); redoAction->setShortcuts(QKeySequence::Redo); redoAction->setIcon(QIcon::fromTheme("edit-redo")); - ui->menuPatternPiece->insertAction(ui->actionPattern_properties, redoAction); + ui->menuPatternPiece->insertAction(ui->actionLast_tool, redoAction); ui->toolBarTools->addAction(redoAction); separatorAct = new QAction(this); @@ -2204,6 +2198,115 @@ void MainWindow::CreateMenus() AddDocks(); } +void MainWindow::LastUsedTool() +{ + if (currentTool == lastUsedTool) + return; + + switch ( lastUsedTool ) + { + case Tool::Arrow: + ui->actionArrowTool->setChecked(true); + ArrowTool(); + break; + case Tool::SinglePoint: + Q_UNREACHABLE(); + //Nothing to do here because we can't create this tool from main window. + break; + case Tool::EndLine: + ui->toolButtonEndLine->setChecked(true); + ToolEndLine(true); + break; + case Tool::Line: + ui->toolButtonLine->setChecked(true); + ToolLine(true); + break; + case Tool::AlongLine: + ui->toolButtonAlongLine->setChecked(true); + ToolAlongLine(true); + break; + case Tool::ShoulderPoint: + ui->toolButtonShoulderPoint->setChecked(true); + ToolShoulderPoint(true); + break; + case Tool::Normal: + ui->toolButtonNormal->setChecked(true); + ToolNormal(true); + break; + case Tool::Bisector: + ui->toolButtonBisector->setChecked(true); + ToolBisector(true); + break; + case Tool::LineIntersect: + ui->toolButtonLineIntersect->setChecked(true); + ToolLineIntersect(true); + break; + case Tool::Spline: + ui->toolButtonSpline->setChecked(true); + ToolSpline(true); + break; + case Tool::Arc: + ui->toolButtonArc->setChecked(true); + ToolArc(true); + break; + case Tool::SplinePath: + ui->toolButtonSplinePath->setChecked(true); + ToolSplinePath(true); + break; + case Tool::PointOfContact: + ui->toolButtonPointOfContact->setChecked(true); + ToolPointOfContact(true); + break; + case Tool::Detail: + ui->toolButtonNewDetail->setChecked(true); + ToolDetail(true); + break; + case Tool::Height: + ui->toolButtonHeight->setChecked(true); + ToolHeight(true); + break; + case Tool::Triangle: + ui->toolButtonTriangle->setChecked(true); + ToolTriangle(true); + break; + case Tool::PointOfIntersection: + ui->toolButtonPointOfIntersection->setChecked(true); + ToolPointOfIntersection(true); + break; + case Tool::CutSpline: + ui->toolButtonSplineCutPoint->setChecked(true); + ToolCutSpline(true); + break; + case Tool::CutSplinePath: + ui->toolButtonSplinePathCutPoint->setChecked(true); + ToolCutSplinePath(true); + break; + case Tool::UnionDetails: + ui->toolButtonUnionDetails->setChecked(true); + ToolUnionDetails(true); + break; + case Tool::CutArc: + ui->toolButtonArcCutPoint->setChecked(true); + ToolCutArc(true); + break; + case Tool::LineIntersectAxis: + ui->toolButtonLineIntersectAxis->setChecked(true); + ToolLineIntersectAxis(true); + break; + case Tool::CurveIntersectAxis: + ui->toolButtonCurveIntersectAxis->setChecked(true); + ToolCurveIntersectAxis(true); + break; + case Tool::NodePoint: + case Tool::NodeArc: + case Tool::NodeSpline: + case Tool::NodeSplinePath: + default: + qDebug()<<"Got wrong tool type. Ignored."; + break; + } +} + //--------------------------------------------------------------------------------------------------------------------- void MainWindow::AddDocks() { @@ -2257,6 +2360,7 @@ void MainWindow::CreateActions() connect(ui->actionPreferences, &QAction::triggered, this, &MainWindow::Preferences); connect(ui->actionRepotBug, &QAction::triggered, this, &MainWindow::RepotBug); connect(ui->actionOnlineHelp, &QAction::triggered, this, &MainWindow::OnlineHelp); + connect(ui->actionLast_tool, &QAction::triggered, this, &MainWindow::LastUsedTool); connect(ui->actionPattern_properties, &QAction::triggered, this, &MainWindow::PatternProperties); ui->actionPattern_properties->setEnabled(false); connect(ui->actionEdit_pattern_code, &QAction::triggered, this, &MainWindow::EditPatternCode); @@ -2360,7 +2464,7 @@ void MainWindow::LoadPattern(const QString &fileName) qCDebug(vMainWindow)<<"Loking file"; lock = new QLockFile(fileName+".lock"); lock->setStaleLockTime(0); - if (lock->tryLock()) + if (VApplication::TryLock(lock)) { qCDebug(vMainWindow) << "Pattern file"<setStaleLockTime(0); - if (lock->tryLock()) + if (VApplication::TryLock(lock)) { restoreFiles.append(files.at(i)); } @@ -2492,6 +2596,12 @@ QStringList MainWindow::GetUnlokedRestoreFileList() const return restoreFiles; } +//--------------------------------------------------------------------------------------------------------------------- +void MainWindow::WindowsLocale() +{ + qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); +} + //--------------------------------------------------------------------------------------------------------------------- void MainWindow::ReopenFilesAfterCrash(QStringList &args) { @@ -2560,15 +2670,21 @@ QString MainWindow::CheckPathToMeasurements(const QString &path, const Measureme else { QString filter; + QString mPath; if (patternType == MeasurementsType::Standard) { filter = tr("Standard measurements (*.vst)"); + //Use standard path to standard measurements + const QString path = qApp->getSettings()->GetPathStandardMeasurements(); + mPath = QFileDialog::getOpenFileName(this, tr("Open file"), path, filter); } else { filter = tr("Individual measurements (*.vit)"); + //Use standard path to individual measurements + const QString path = qApp->getSettings()->GetPathIndividualMeasurements(); + mPath = QFileDialog::getOpenFileName(this, tr("Open file"), path, filter); } - QString mPath = QFileDialog::getOpenFileName(this, tr("Open file"), qApp->pathToTables(), filter); if (mPath.isEmpty()) { diff --git a/src/app/mainwindow.h b/src/app/mainwindow.h index 0463bd06c..45aa2708d 100644 --- a/src/app/mainwindow.h +++ b/src/app/mainwindow.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -32,12 +32,12 @@ #include #include "widgets/vmaingraphicsscene.h" #include "widgets/vmaingraphicsview.h" -#include "widgets/vitem.h" #include "dialogs/dialogs.h" #include "tools/vtooldetail.h" #include "tools/vtooluniondetails.h" #include "tools/drawTools/drawtools.h" #include "xml/vdomdocument.h" +#include "../libs/vlayout/vlayoutdetail.h" namespace Ui { @@ -120,6 +120,9 @@ public slots: void AboutQt(); void PatternProperties(); +//tmp + void LastUsedTool(); + /** * @brief Edit XML code of pattern */ @@ -130,14 +133,17 @@ public slots: void Layout(); void UpdateGradation(); void GlobalChangePP(const QString &patternPiece); + void WindowsLocale(); signals: /** * @brief ModelChosen emit after calculation all details. * @param listDetails list of details. * @param description pattern description. */ - void ModelChosen(QVector listDetails, const QString &curFile, const QString &description); + void ModelChosen(QVector listDetails, const QString &curFile, + const QString &description); void RefreshHistory(); + void EnableItemMove(bool move); protected: virtual void keyPressEvent(QKeyEvent *event); virtual void showEvent(QShowEvent *event); @@ -155,7 +161,10 @@ private: VPattern *doc; /** @brief tool current tool */ - Tool tool; + Tool currentTool; + + /** @brief tool last used tool */ + Tool lastUsedTool; /** @brief currentScene pointer to current scene. */ VMainGraphicsScene *currentScene; diff --git a/src/app/mainwindow.ui b/src/app/mainwindow.ui index 688b6463f..8cff5bbc0 100644 --- a/src/app/mainwindow.ui +++ b/src/app/mainwindow.ui @@ -40,7 +40,7 @@ - 3 + 4 @@ -99,7 +99,7 @@ false - Special point on shoulder. + Special point on shoulder ... @@ -125,7 +125,7 @@ false - Tool triangle. + Triangle tool ... @@ -203,7 +203,7 @@ false - Point at intersection of arc and line. + Point at intersection of arc and line ... @@ -229,7 +229,7 @@ false - Tool to make point from x & y of two other points. + Point from X and Y of two other points ... @@ -307,7 +307,7 @@ false - Point of intersection line and axis + Point intersect line and axis ... @@ -433,7 +433,7 @@ false - Curve tool. + Simple curve ... @@ -459,7 +459,7 @@ false - Tool for path curve. + Curved path ... @@ -485,7 +485,7 @@ false - Tool for segmenting a curve. + Segmenting a simple curve ... @@ -511,7 +511,7 @@ false - Tool segment a pathed curve. + Segment a curved path ... @@ -536,6 +536,9 @@ false + + Point intersect curve and axis + ... @@ -584,7 +587,7 @@ false - Arc tool. + Arc ... @@ -610,7 +613,7 @@ false - Cut arc tool. + Segment an arc ... @@ -635,6 +638,9 @@ false + + Point intersect arc and axis + ... @@ -680,7 +686,7 @@ - Tool new detail. + Seam allowance tool ... @@ -706,7 +712,7 @@ false - Tool for union two details. + Union tool ... @@ -796,6 +802,7 @@ + @@ -832,7 +839,7 @@ - + true @@ -847,7 +854,7 @@ - + @@ -906,6 +913,18 @@ + + + toolBar + + + TopToolBarArea + + + false + + + @@ -1106,6 +1125,9 @@ + + false + :/icon/32x32/layout.png:/icon/32x32/layout.png @@ -1264,7 +1286,9 @@ - + + + Online help @@ -1273,6 +1297,17 @@ Show online help + + + Last Tool + + + Activate last used tool again + + + L + + diff --git a/src/app/options.cpp b/src/app/options.cpp index 0f102247f..d4703df93 100644 --- a/src/app/options.cpp +++ b/src/app/options.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -37,6 +37,9 @@ const QString nameRegExp = QStringLiteral("^([^0-9-*/^+=\\s\\(\\)%:;!.,`'\"]){1, // furthermore blows up the binary sizes. const QString degreeSymbol = QStringLiteral("°"); +const QString cursorArrowOpenHand = QStringLiteral("://cursor/cursor-arrow-openhand.png"); +const QString cursorArrowCloseHand = QStringLiteral("://cursor/cursor-arrow-closehand.png"); + // Keep synchronize all names with initialization in VApllication class!!!!! //measurements //head and neck diff --git a/src/app/options.h b/src/app/options.h index 6c640a075..57380992a 100644 --- a/src/app/options.h +++ b/src/app/options.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -50,6 +50,9 @@ class QStringList; extern const QString nameRegExp; extern const QString degreeSymbol; +extern const QString cursorArrowOpenHand; +extern const QString cursorArrowCloseHand; + enum class SceneObject : char { Point, Line, Spline, Arc, SplinePath, Detail, Unknown }; enum class Tool : unsigned char { @@ -118,7 +121,6 @@ enum class Source : char { FromGui, FromFile, FromTool }; enum class Draw : char { Calculation, Modeling }; enum class NodeDetail : char { Contour, Modeling }; enum class Contour : char { OpenContour, CloseContour }; -enum class EquidistantType : char { OpenEquidistant, CloseEquidistant }; enum class GOType : char { Point, Arc, Spline, SplinePath, Unknown }; enum class SplinePointPosition : char { FirstPoint, LastPoint }; enum class VarType : char { Measurement, Increment, LineLength, SplineLength, ArcLength, LineAngle, Unknown }; diff --git a/src/app/share/resources/flags.qrc b/src/app/share/resources/flags.qrc index 5a33e6161..f7d9efe87 100644 --- a/src/app/share/resources/flags.qrc +++ b/src/app/share/resources/flags.qrc @@ -10,5 +10,6 @@ flags/Russia.png flags/Ukraine.png flags/UnitedStates.png + flags/Spain.png diff --git a/src/app/share/resources/flags/Spain.png b/src/app/share/resources/flags/Spain.png new file mode 100644 index 000000000..cf53a8d65 Binary files /dev/null and b/src/app/share/resources/flags/Spain.png differ diff --git a/src/app/share/resources/icon.qrc b/src/app/share/resources/icon.qrc index 073e985a0..329cd555f 100644 --- a/src/app/share/resources/icon.qrc +++ b/src/app/share/resources/icon.qrc @@ -52,5 +52,8 @@ icon/32x32/line_intersect_axis.png icon/32x32/arc_intersect_axis.png icon/32x32/curve_intersect_axis.png + icon/16x16/landscape.png + icon/16x16/portrait.png + icon/16x16/template.png diff --git a/src/app/share/resources/icon/16x16/landscape.png b/src/app/share/resources/icon/16x16/landscape.png new file mode 100644 index 000000000..a30d3b0ca Binary files /dev/null and b/src/app/share/resources/icon/16x16/landscape.png differ diff --git a/src/app/share/resources/icon/16x16/portrait.png b/src/app/share/resources/icon/16x16/portrait.png new file mode 100644 index 000000000..75fbbab49 Binary files /dev/null and b/src/app/share/resources/icon/16x16/portrait.png differ diff --git a/src/app/share/resources/icon/16x16/template.png b/src/app/share/resources/icon/16x16/template.png new file mode 100644 index 000000000..9934a3a26 Binary files /dev/null and b/src/app/share/resources/icon/16x16/template.png differ diff --git a/src/app/stable.cpp b/src/app/stable.cpp index 243b23938..e291c2801 100644 --- a/src/app/stable.cpp +++ b/src/app/stable.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/stable.h b/src/app/stable.h index 695fe3df7..643dc33eb 100644 --- a/src/app/stable.h +++ b/src/app/stable.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tablewindow.cpp b/src/app/tablewindow.cpp index 525c5fe2c..e16d98232 100644 --- a/src/app/tablewindow.cpp +++ b/src/app/tablewindow.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -29,11 +29,18 @@ #include "tablewindow.h" #include "ui_tablewindow.h" #include "widgets/vtablegraphicsview.h" +#include "core/vapplication.h" +#include "core/vsettings.h" +#include "../../libs/vobj/vobjpaintdevice.h" +#include "../dialogs/app/dialoglayoutsettings.h" +#include "../../libs/vlayout/vlayoutgenerator.h" +#include "../dialogs/app/dialoglayoutprogress.h" +#include "../dialogs/app/dialogsavelayout.h" + #include #include -#include "core/vapplication.h" +#include #include -#include "../../libs/vobj/vobjpaintdevice.h" #ifdef Q_OS_WIN # define PDFTOPS "pdftops.exe" @@ -47,97 +54,39 @@ * @param parent parent widget. */ TableWindow::TableWindow(QWidget *parent) - :QMainWindow(parent), numberDetal(nullptr), colission(nullptr), ui(new Ui::TableWindow), - listDetails(QVector()), outItems(false), collidingItems(false), tableScene(nullptr), - paper(nullptr), shadowPaper(nullptr), listOutItems(nullptr), listCollidingItems(QList()), - indexDetail(0), sceneRect(QRectF()), fileName(QString()), description(QString()) + :QMainWindow(parent), ui(new Ui::TableWindow), + listDetails(QVector()), papers(QList()), shadows(QList()), + scenes(QList()), details(QList >()),fileName(QString()), + description(QString()), tempScene(nullptr) { ui->setupUi(this); - numberDetal = new QLabel(tr("0 details left."), this); - colission = new QLabel(tr("Collisions not found."), this); - ui->statusBar->addWidget(numberDetal); - ui->statusBar->addWidget(colission); - outItems = collidingItems = false; - sceneRect = QRectF(0, 0, qApp->toPixel(823, Unit::Mm), qApp->toPixel(1171, Unit::Mm)); - tableScene = new QGraphicsScene(sceneRect); + + qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C)); + + tempScene = new QGraphicsScene(QRectF(0, 0, qApp->toPixel(823, Unit::Mm), qApp->toPixel(1171, Unit::Mm))); QBrush brush; brush.setStyle( Qt::SolidPattern ); brush.setColor( QColor( Qt::gray ) ); - tableScene->setBackgroundBrush( brush ); + tempScene->setBackgroundBrush( brush ); - ui->view->setScene(tableScene); + ui->view->setScene(tempScene); ui->view->fitInView(ui->view->scene()->sceneRect(), Qt::KeepAspectRatio); ui->horizontalLayout->addWidget(ui->view); - connect(tableScene, &QGraphicsScene::selectionChanged, ui->view, &VTableGraphicsView::selectionChanged); - connect(ui->actionTurn, &QAction::triggered, ui->view, &VTableGraphicsView::rotateItems); - connect(ui->actionMirror, &QAction::triggered, ui->view, &VTableGraphicsView::MirrorItem); connect(ui->actionZoomIn, &QAction::triggered, ui->view, &VTableGraphicsView::ZoomIn); connect(ui->actionZoomOut, &QAction::triggered, ui->view, &VTableGraphicsView::ZoomOut); connect(ui->actionStop, &QAction::triggered, this, &TableWindow::StopTable); - connect(ui->actionSave, &QAction::triggered, this, &TableWindow::saveScene); - connect(ui->actionNext, &QAction::triggered, this, &TableWindow::GetNextDetail); - connect(ui->actionAdd, &QAction::triggered, this, &TableWindow::AddLength); - connect(ui->actionRemove, &QAction::triggered, this, &TableWindow::RemoveLength); - connect(ui->view, &VTableGraphicsView::itemChect, this, &TableWindow::itemChect); + connect(ui->actionSave, &QAction::triggered, this, &TableWindow::SaveLayout); + connect(ui->actionLayout, &QAction::triggered, this, &TableWindow::Layout); + connect(ui->listWidget, &QListWidget::currentRowChanged, this, &TableWindow::ShowPaper); } //--------------------------------------------------------------------------------------------------------------------- TableWindow::~TableWindow() { - delete tableScene; + ClearLayout(); delete ui; } -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief AddPaper add to the scene paper and shadow. - */ -void TableWindow::AddPaper() -{ - qreal x1, y1, x2, y2; - sceneRect.getCoords(&x1, &y1, &x2, &y2); - shadowPaper = new QGraphicsRectItem(QRectF(x1+4, y1+4, x2+4, y2+4)); - shadowPaper->setBrush(QBrush(Qt::black)); - tableScene->addItem(shadowPaper); - paper = new QGraphicsRectItem(QRectF(x1, y1, x2, y2)); - paper->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthMainLine()))); - paper->setBrush(QBrush(Qt::white)); - tableScene->addItem(paper); - qDebug()<rect().size().toSize(); -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief AddDetail show on scene next detail. - */ -void TableWindow::AddDetail() -{ - if (indexDetailclearSelection(); - VItem* Detail = listDetails[indexDetail]; - SCASSERT(Detail != nullptr); - connect(Detail, &VItem::itemOut, this, &TableWindow::itemOut); - connect(Detail, &VItem::itemColliding, this, &TableWindow::itemColliding); - connect(this, &TableWindow::LengthChanged, Detail, &VItem::LengthChanged); - Detail->setPen(QPen(Qt::black, 1)); - Detail->setBrush(QBrush(Qt::white)); - Detail->setPos(paper->boundingRect().center()); - Detail->setFlag(QGraphicsItem::ItemIsMovable, true); - Detail->setFlag(QGraphicsItem::ItemIsSelectable, true); - Detail->setFlag(QGraphicsItem::ItemSendsGeometryChanges, true); - Detail->setPaper(paper); - tableScene->addItem(Detail); - Detail->setSelected(true); - indexDetail++; - if (indexDetail==listDetails.count()) - { - ui->actionSave->setEnabled(true); - } - } - numberDetal->setText(QString(tr("%1 details left.")).arg(listDetails.count()-indexDetail)); -} - //--------------------------------------------------------------------------------------------------------------------- /** * @brief ModelChosen show window when user want create new layout. @@ -147,7 +96,7 @@ void TableWindow::AddDetail() /* * Get details for creation layout. */ -void TableWindow::ModelChosen(QVector listDetails, const QString &fileName, const QString &description) +void TableWindow::ModelChosen(QVector listDetails, const QString &fileName, const QString &description) { this->description = description; @@ -164,10 +113,6 @@ void TableWindow::ModelChosen(QVector listDetails, const QString &fileNa this->fileName = fi.baseName(); this->listDetails = listDetails; - listOutItems = new QBitArray(this->listDetails.count()); - AddPaper(); - indexDetail = 0; - AddDetail(); show(); } @@ -212,11 +157,7 @@ void TableWindow::showEvent ( QShowEvent * event ) void TableWindow::StopTable() { hide(); - tableScene->clear(); - delete listOutItems; - listDetails.clear(); - sceneRect = QRectF(0, 0, qApp->toPixel(823, Unit::Mm), qApp->toPixel(1171, Unit::Mm)); - tableScene->setSceneRect(sceneRect); + ClearLayout(); emit closed(); } @@ -224,308 +165,138 @@ void TableWindow::StopTable() /** * @brief saveScene save created layout. */ -void TableWindow::saveScene() +void TableWindow::SaveLayout() { - QMap extByMessage; - extByMessage[ tr("Svg files (*.svg)") ] = ".svg"; - extByMessage[ tr("PDF files (*.pdf)") ] = ".pdf"; - extByMessage[ tr("Images (*.png)") ] = ".png"; - extByMessage[ tr("Wavefront OBJ (*.obj)") ] = ".obj"; + QMap extByMessage = InitFormates(); + DialogSaveLayout dialog(extByMessage, scenes.size(), fileName, this); - QProcess proc; - proc.start(PDFTOPS); - if (proc.waitForFinished(15000)) - { - extByMessage[ tr("PS files (*.ps)") ] = ".ps"; - extByMessage[ tr("EPS files (*.eps)") ] = ".eps"; - } - else - { - qWarning()< i(extByMessage); - while (i.hasNext()) - { - i.next(); - saveMessage += i.key(); - if (i.hasNext()) - { - saveMessage += ";;"; - } - } - - QString sf; - // the save function - QString dir = QDir::homePath()+"/"+fileName; - QString name = QFileDialog::getSaveFileName(this, tr("Save layout"), dir, saveMessage, &sf); - - if (name.isEmpty()) + if (dialog.exec() == QDialog::Rejected) { return; } - // what if the user did not specify a suffix...? - QString suf = extByMessage.value(sf); + QString suf = dialog.Formate(); suf.replace(".", ""); - QFileInfo f( name ); - if (f.suffix().isEmpty() || f.suffix() != suf) - { - name += extByMessage.value(sf); - } - QBrush *brush = new QBrush(); - brush->setColor( QColor( Qt::white ) ); - tableScene->setBackgroundBrush( *brush ); - tableScene->clearSelection(); // Selections would also render to the file, so need delete them - shadowPaper->setVisible(false); - paper->setPen(QPen(Qt::white, 0.1, Qt::NoPen)); - QFileInfo fi( name ); - QStringList suffix = QStringList() << "svg" << "png" << "pdf" << "eps" << "ps" << "obj"; - switch (suffix.indexOf(fi.suffix())) + const QString path = dialog.Path(); + qApp->getSettings()->SetPathLayout(path); + const QString mask = dialog.FileName(); + + for (int i=0; i < scenes.size(); ++i) { - case 0: //svg - paper->setVisible(false); - SvgFile(name); - paper->setVisible(true); - break; - case 1: //png - PngFile(name); - break; - case 2: //pdf - PdfFile(name); - break; - case 3: //eps - EpsFile(name); - break; - case 4: //ps - PsFile(name); - break; - case 5: //obj - paper->setVisible(false); - ObjFile(name); - paper->setVisible(true); - break; - default: - qDebug() << "Can't recognize file suffix. File file "<(papers.at(i)); + if (paper) + { + const QString name = path + "/" + mask+QString::number(i+1) + dialog.Formate(); + QBrush *brush = new QBrush(); + brush->setColor( QColor( Qt::white ) ); + scenes[i]->setBackgroundBrush( *brush ); + shadows[i]->setVisible(false); + paper->setPen(QPen(Qt::white, 0.1, Qt::NoPen)); + QStringList suffix = QStringList() << "svg" << "png" << "pdf" << "eps" << "ps" << "obj"; + switch (suffix.indexOf(suf)) + { + case 0: //svg + paper->setVisible(false); + SvgFile(name, i); + paper->setVisible(true); + break; + case 1: //png + PngFile(name, i); + break; + case 2: //pdf + PdfFile(name, i); + break; + case 3: //eps + EpsFile(name, i); + break; + case 4: //ps + PsFile(name, i); + break; + case 5: //obj + paper->setVisible(false); + ObjFile(name, i); + paper->setVisible(true); + break; + default: + qDebug() << "Can't recognize file suffix." << Q_FUNC_INFO; + break; + } + paper->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthMainLine()))); + brush->setColor( QColor( Qt::gray ) ); + brush->setStyle( Qt::SolidPattern ); + scenes[i]->setBackgroundBrush( *brush ); + shadows[i]->setVisible(true); + delete brush; + } } - paper->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthMainLine()))); - brush->setColor( QColor( Qt::gray ) ); - brush->setStyle( Qt::SolidPattern ); - tableScene->setBackgroundBrush( *brush ); - shadowPaper->setVisible(true); - delete brush; } //--------------------------------------------------------------------------------------------------------------------- -/** - * @brief itemChect turn off rotation button if don't selected detail. - * @param flag true - enable button. - */ -void TableWindow::itemChect(bool flag) +void TableWindow::ShowPaper(int index) { - ui->actionTurn->setDisabled(flag); - ui->actionMirror->setDisabled(flag); -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief checkNext disable next detail button if exist colission or out details. - */ -void TableWindow::checkNext() -{ - if (outItems == true && collidingItems == true) + if (index < 0 || index > scenes.size()) { - colission->setText(tr("Collisions not found.")); - if (indexDetail==listDetails.count()) - { - ui->actionSave->setEnabled(true); - ui->actionNext->setDisabled(true); - } - else - { - ui->actionNext->setDisabled(false); - ui->actionSave->setEnabled(false); - } - } - else - { - colission->setText(tr("Collisions found.")); - ui->actionNext->setDisabled(true); + ui->view->setScene(tempScene); ui->actionSave->setEnabled(false); } -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief itemOut handled if detail moved out paper sheet. - * @param number Number detail in list. - * @param flag set state of detail. True if detail moved out paper sheet. - */ -void TableWindow::itemOut(int number, bool flag) -{ - listOutItems->setBit(number, flag); - for ( int i = 0; i < listOutItems->count(); ++i ) - { - if (listOutItems->at(i)==true) - { - outItems=false; - qDebug()<<"itemOut::outItems="< list, int number) -{ - //qDebug()<<"number="<1) - { - for ( int i = 0; i < listCollidingItems.count(); ++i ) - { - QList lis = listCollidingItems.at(i)->collidingItems(); - if (lis.size()-2 <= 0) - { - VItem * bitem = qgraphicsitem_cast ( listCollidingItems.at(i) ); - SCASSERT(bitem != nullptr); - bitem->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthMainLine()))); - listCollidingItems.removeAt(i); - } - } - } - else if (listCollidingItems.size()==1) - { - VItem * bitem = qgraphicsitem_cast ( listCollidingItems.at(0) ); - SCASSERT(bitem != nullptr); - bitem->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthMainLine()))); - listCollidingItems.clear(); - collidingItems = true; - } - } - else - { - collidingItems = true; - } - } - else - { - collidingItems = true; - } - } - else if (number==1) - { - if (list.contains(paper)==true) - { - list.removeAt(list.indexOf(paper)); - } - if (list.contains(shadowPaper)==true) - { - list.removeAt(list.indexOf(shadowPaper)); - } - for ( int i = 0; i < list.count(); ++i ) - { - if (listCollidingItems.contains(list.at(i))==false) - { - listCollidingItems.append(list.at(i)); - } - } - collidingItems = false; - } - qDebug()<<"itemColliding::outItems="<sceneRect(); - rect.setHeight(rect.height()+qApp->toPixel(279, Unit::Mm)); - tableScene->setSceneRect(rect); - rect = shadowPaper->rect(); - rect.setHeight(rect.height()+qApp->toPixel(279, Unit::Mm)); - shadowPaper->setRect(rect); - rect = paper->rect(); - rect.setHeight(rect.height()+qApp->toPixel(279, Unit::Mm)); - paper->setRect(rect); - ui->actionRemove->setEnabled(true); - emit LengthChanged(); -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief RemoveLength reduce the length of paper sheet. You can reduce to the minimal value only. - */ -void TableWindow::RemoveLength() -{ - if (sceneRect.height() <= tableScene->sceneRect().height() - 100) - { - QRectF rect = tableScene->sceneRect(); - rect.setHeight(rect.height()-qApp->toPixel(279, Unit::Mm)); - tableScene->setSceneRect(rect); - rect = shadowPaper->rect(); - rect.setHeight(rect.height()-qApp->toPixel(279, Unit::Mm)); - shadowPaper->setRect(rect); - rect = paper->rect(); - rect.setHeight(rect.height()-qApp->toPixel(279, Unit::Mm)); - paper->setRect(rect); - if (fabs(sceneRect.height() - tableScene->sceneRect().height()) < 0.01) - { - ui->actionRemove->setDisabled(true); - } - emit LengthChanged(); - } else { - ui->actionRemove->setDisabled(true); + ui->view->setScene(scenes.at(index)); } + + ui->view->fitInView(ui->view->scene()->sceneRect(), Qt::KeepAspectRatio); } //--------------------------------------------------------------------------------------------------------------------- -/** - * @brief keyPressEvent handle key press events. - * @param event key event. - */ -void TableWindow::keyPressEvent ( QKeyEvent * event ) +void TableWindow::Layout() { - if ( event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return ) + DialogLayoutSettings layout(this); + if (layout.exec() == QDialog::Rejected) { - if (ui->actionNext->isEnabled() == true ) - { - AddDetail(); - qDebug()<<"Added detail."; - } + return; + } + + VLayoutGenerator lGenerator(this); + lGenerator.SetDetails(listDetails); + lGenerator.SetLayoutWidth(layout.GetLayoutWidth()); + lGenerator.SetCaseType(layout.GetGroup()); + lGenerator.SetPaperHeight(layout.GetPaperHeight()); + lGenerator.SetPaperWidth(layout.GetPaperWidth()); + lGenerator.SetShift(layout.GetShift()); + lGenerator.SetRotate(layout.GetRotate()); + lGenerator.SetRotationIncrease(layout.GetIncrease()); + + DialogLayoutProgress progress(listDetails.count(), this); + + connect(&lGenerator, &VLayoutGenerator::Start, &progress, &DialogLayoutProgress::Start); + connect(&lGenerator, &VLayoutGenerator::Arranged, &progress, &DialogLayoutProgress::Arranged); + connect(&lGenerator, &VLayoutGenerator::Error, &progress, &DialogLayoutProgress::Error); + connect(&lGenerator, &VLayoutGenerator::Finished, &progress, &DialogLayoutProgress::Finished); + connect(&progress, &DialogLayoutProgress::Abort, &lGenerator, &VLayoutGenerator::Abort); + + lGenerator.Generate(); + + switch (lGenerator.State()) + { + case LayoutErrors::NoError: + ClearLayout(); + papers = lGenerator.GetPapersItems(); + details = lGenerator.GetAllDetails(); + CreateShadows(); + CreateScenes(); + PrepareSceneList(); + break; + case LayoutErrors::ProcessStoped: + break; + case LayoutErrors::PrepareLayoutError: + case LayoutErrors::PaperSizeError: + case LayoutErrors::EmptyPaperError: + ClearLayout(); + break; + default: + break; } - QMainWindow::keyPressEvent ( event ); } //--------------------------------------------------------------------------------------------------------------------- @@ -533,23 +304,28 @@ void TableWindow::keyPressEvent ( QKeyEvent * event ) * @brief SvgFile save layout to svg file. * @param name name layout file. */ -void TableWindow::SvgFile(const QString &name) const +void TableWindow::SvgFile(const QString &name, int i) const { - QSvgGenerator generator; - generator.setFileName(name); - generator.setSize(paper->rect().size().toSize()); - generator.setViewBox(paper->rect()); - generator.setTitle("Valentina pattern"); - generator.setDescription(description); - generator.setResolution(static_cast(qApp->PrintDPI)); - QPainter painter; - painter.begin(&generator); - painter.setFont( QFont( "Arial", 8, QFont::Normal ) ); - painter.setRenderHint(QPainter::Antialiasing, true); - painter.setPen(QPen(Qt::black, qApp->toPixel(qApp->widthHairLine()), Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)); - painter.setBrush ( QBrush ( Qt::NoBrush ) ); - tableScene->render(&painter); - painter.end(); + QGraphicsRectItem *paper = qgraphicsitem_cast(papers.at(i)); + if (paper) + { + QSvgGenerator generator; + generator.setFileName(name); + generator.setSize(paper->rect().size().toSize()); + generator.setViewBox(paper->rect()); + generator.setTitle("Valentina. Pattern layout"); + generator.setDescription(description); + generator.setResolution(static_cast(qApp->PrintDPI)); + QPainter painter; + painter.begin(&generator); + painter.setFont( QFont( "Arial", 8, QFont::Normal ) ); + painter.setRenderHint(QPainter::Antialiasing, true); + painter.setPen(QPen(Qt::black, qApp->toPixel(qApp->widthHairLine()), Qt::SolidLine, Qt::RoundCap, + Qt::RoundJoin)); + painter.setBrush ( QBrush ( Qt::NoBrush ) ); + scenes.at(i)->render(&painter); + painter.end(); + } } //--------------------------------------------------------------------------------------------------------------------- @@ -557,21 +333,24 @@ void TableWindow::SvgFile(const QString &name) const * @brief PngFile save layout to png file. * @param name name layout file. */ -void TableWindow::PngFile(const QString &name) const +void TableWindow::PngFile(const QString &name, int i) const { - QRectF r = paper->rect(); - qreal x=0, y=0, w=0, h=0; - r.getRect(&x, &y, &w, &h);// Re-shrink the scene to it's bounding contents - // Create the image with the exact size of the shrunk scene - QImage image(QSize(static_cast(w), static_cast(h)), QImage::Format_ARGB32); - image.fill(Qt::transparent); // Start all pixels transparent - QPainter painter(&image); - painter.setFont( QFont( "Arial", 8, QFont::Normal ) ); - painter.setRenderHint(QPainter::Antialiasing, true); - painter.setPen(QPen(Qt::black, qApp->toPixel(qApp->widthMainLine()), Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)); - painter.setBrush ( QBrush ( Qt::NoBrush ) ); - tableScene->render(&painter); - image.save(name); + QGraphicsRectItem *paper = qgraphicsitem_cast(papers.at(i)); + if (paper) + { + const QRectF r = paper->rect(); + // Create the image with the exact size of the shrunk scene + QImage image(QSize(static_cast(r.width()), static_cast(r.height())), QImage::Format_ARGB32); + image.fill(Qt::transparent); // Start all pixels transparent + QPainter painter(&image); + painter.setFont( QFont( "Arial", 8, QFont::Normal ) ); + painter.setRenderHint(QPainter::Antialiasing, true); + painter.setPen(QPen(Qt::black, qApp->toPixel(qApp->widthMainLine()), Qt::SolidLine, Qt::RoundCap, + Qt::RoundJoin)); + painter.setBrush ( QBrush ( Qt::NoBrush ) ); + scenes.at(i)->render(&painter); + image.save(name); + } } //--------------------------------------------------------------------------------------------------------------------- @@ -579,28 +358,32 @@ void TableWindow::PngFile(const QString &name) const * @brief PdfFile save layout to pdf file. * @param name name layout file. */ -void TableWindow::PdfFile(const QString &name) const +void TableWindow::PdfFile(const QString &name, int i) const { - QPrinter printer; - printer.setOutputFormat(QPrinter::PdfFormat); - printer.setOutputFileName(name); - QRectF r = paper->rect(); - qreal x=0, y=0, w=0, h=0; - r.getRect(&x, &y, &w, &h);// Re-shrink the scene to it's bounding contents - printer.setResolution(static_cast(qApp->PrintDPI)); - printer.setPaperSize ( QSizeF(qApp->fromPixel(w, Unit::Mm), qApp->fromPixel(h, Unit::Mm)), QPrinter::Millimeter ); - QPainter painter; - if (painter.begin( &printer ) == false) - { // failed to open file - qCritical("Can't open printer %s", qPrintable(name)); - return; + QGraphicsRectItem *paper = qgraphicsitem_cast(papers.at(i)); + if (paper) + { + QPrinter printer; + printer.setOutputFormat(QPrinter::PdfFormat); + printer.setOutputFileName(name); + const QRectF r = paper->rect(); + printer.setResolution(static_cast(qApp->PrintDPI)); + printer.setPaperSize ( QSizeF(qApp->fromPixel(r.width(), Unit::Mm), qApp->fromPixel(r.height(), Unit::Mm)), + QPrinter::Millimeter ); + QPainter painter; + if (painter.begin( &printer ) == false) + { // failed to open file + qCritical("Can't open printer %s", qPrintable(name)); + return; + } + painter.setFont( QFont( "Arial", 8, QFont::Normal ) ); + painter.setRenderHint(QPainter::Antialiasing, true); + painter.setPen(QPen(Qt::black, qApp->toPixel(qApp->widthMainLine()), Qt::SolidLine, Qt::RoundCap, + Qt::RoundJoin)); + painter.setBrush ( QBrush ( Qt::NoBrush ) ); + scenes.at(i)->render(&painter); + painter.end(); } - painter.setFont( QFont( "Arial", 8, QFont::Normal ) ); - painter.setRenderHint(QPainter::Antialiasing, true); - painter.setPen(QPen(Qt::black, qApp->toPixel(qApp->widthMainLine()), Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)); - painter.setBrush ( QBrush ( Qt::NoBrush ) ); - tableScene->render(&painter); - painter.end(); } //--------------------------------------------------------------------------------------------------------------------- @@ -608,12 +391,12 @@ void TableWindow::PdfFile(const QString &name) const * @brief EpsFile save layout to eps file. * @param name name layout file. */ -void TableWindow::EpsFile(const QString &name) const +void TableWindow::EpsFile(const QString &name, int i) const { QTemporaryFile tmp; if (tmp.open()) { - PdfFile(tmp.fileName()); + PdfFile(tmp.fileName(), i); QStringList params = QStringList() << "-eps" << tmp.fileName() << name; PdfToPs(params); } @@ -624,12 +407,12 @@ void TableWindow::EpsFile(const QString &name) const * @brief PsFile save layout to ps file. * @param name name layout file. */ -void TableWindow::PsFile(const QString &name) const +void TableWindow::PsFile(const QString &name, int i) const { QTemporaryFile tmp; if (tmp.open()) { - PdfFile(tmp.fileName()); + PdfFile(tmp.fileName(), i); QStringList params = QStringList() << tmp.fileName() << name; PdfToPs(params); } @@ -663,14 +446,140 @@ void TableWindow::PdfToPs(const QStringList ¶ms) const } //--------------------------------------------------------------------------------------------------------------------- -void TableWindow::ObjFile(const QString &name) const +void TableWindow::ObjFile(const QString &name, int i) const { - VObjPaintDevice generator; - generator.setFileName(name); - generator.setSize(paper->rect().size().toSize()); - generator.setResolution(static_cast(qApp->PrintDPI)); - QPainter painter; - painter.begin(&generator); - tableScene->render(&painter); - painter.end(); + QGraphicsRectItem *paper = qgraphicsitem_cast(papers.at(i)); + if (paper) + { + VObjPaintDevice generator; + generator.setFileName(name); + generator.setSize(paper->rect().size().toSize()); + generator.setResolution(static_cast(qApp->PrintDPI)); + QPainter painter; + painter.begin(&generator); + scenes.at(i)->render(&painter); + painter.end(); + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void TableWindow::ClearLayout() +{ + qDeleteAll (scenes); + scenes.clear(); + shadows.clear(); + papers.clear(); + ui->listWidget->clear(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void TableWindow::CreateShadows() +{ + for (int i=0; i< papers.size(); ++i) + { + qreal x1=0, y1=0, x2=0, y2=0; + QGraphicsRectItem *item = qgraphicsitem_cast(papers.at(i)); + if (item) + { + item->rect().getCoords(&x1, &y1, &x2, &y2); + QGraphicsRectItem *shadowPaper = new QGraphicsRectItem(QRectF(x1+4, y1+4, x2+4, y2+4)); + shadowPaper->setBrush(QBrush(Qt::black)); + shadows.append(shadowPaper); + } + else + { + shadows.append(nullptr); + } + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void TableWindow::CreateScenes() +{ + QBrush brush; + brush.setStyle( Qt::SolidPattern ); + brush.setColor( QColor( Qt::gray ) ); + + for (int i=0; isetBackgroundBrush(brush); + scene->addItem(shadows.at(i)); + scene->addItem(papers.at(i)); + + QList paperDetails = details.at(i); + for (int i=0; i < paperDetails.size(); ++i) + { + scene->addItem(paperDetails.at(i)); + } + + scenes.append(scene); + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void TableWindow::PrepareSceneList() +{ + for (int i=1; i<=scenes.size(); ++i) + { + QListWidgetItem *item = new QListWidgetItem(ScenePreview(i-1), QString::number(i)); + ui->listWidget->addItem(item); + } + + if (scenes.isEmpty() == false) + { + ui->listWidget->setCurrentRow(0); + ui->actionSave->setEnabled(true); + } +} + +//--------------------------------------------------------------------------------------------------------------------- +QIcon TableWindow::ScenePreview(int i) const +{ + QImage image; + QGraphicsRectItem *paper = qgraphicsitem_cast(papers.at(i)); + if (paper) + { + const QRectF r = paper->rect(); + // Create the image with the exact size of the shrunk scene + image = QImage(QSize(static_cast(r.width()), static_cast(r.height())), QImage::Format_RGB32); + image.fill(Qt::white); + QPainter painter(&image); + painter.setFont( QFont( "Arial", 8, QFont::Normal ) ); + painter.setRenderHint(QPainter::Antialiasing, true); + painter.setPen(QPen(Qt::black, qApp->toPixel(qApp->widthMainLine()), Qt::SolidLine, Qt::RoundCap, + Qt::RoundJoin)); + painter.setBrush ( QBrush ( Qt::NoBrush ) ); + scenes.at(i)->render(&painter); + image.scaled(101, 146, Qt::KeepAspectRatio); + } + else + { + image = QImage(QSize(101, 146), QImage::Format_RGB32); + image.fill(Qt::white); + } + return QIcon(QBitmap::fromImage(image)); +} + +//--------------------------------------------------------------------------------------------------------------------- +QMap TableWindow::InitFormates() const +{ + QMap extByMessage; + extByMessage[ tr("Svg files (*.svg)") ] = ".svg"; + extByMessage[ tr("PDF files (*.pdf)") ] = ".pdf"; + extByMessage[ tr("Images (*.png)") ] = ".png"; + extByMessage[ tr("Wavefront OBJ (*.obj)") ] = ".obj"; + + QProcess proc; + proc.start(PDFTOPS); + if (proc.waitForFinished(15000)) + { + extByMessage[ tr("PS files (*.ps)") ] = ".ps"; + extByMessage[ tr("EPS files (*.eps)") ] = ".eps"; + } + else + { + qWarning()< All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -31,13 +31,18 @@ #include #include -#include "widgets/vitem.h" + +#include "../../libs/vlayout/vlayoutdetail.h" +#include "../../libs/vlayout/vbank.h" namespace Ui { class TableWindow; } +class QGraphicsScene; +class QGraphicsRectItem; + /** * @brief TableWindow class layout window. */ @@ -45,85 +50,38 @@ class TableWindow : public QMainWindow { Q_OBJECT public: - /** @brief numberDetal show count details, what need placed. */ - QLabel* numberDetal; - - /** @brief colission show if exist colissions. */ - QLabel* colission; - explicit TableWindow(QWidget *parent = nullptr); ~TableWindow(); + public slots: - - void ModelChosen(QVector listDetails, const QString &fileName, const QString &description); - + void ModelChosen(QVector listDetails, const QString &fileName, + const QString &description); + void Layout(); void StopTable(); + void SaveLayout(); + void ShowPaper(int index); - void saveScene(); - - void GetNextDetail(); - - void itemChect(bool flag); - - void itemOut(int number, bool flag); - - void itemColliding(QList list, int number); - - void AddLength(); - - void RemoveLength(); signals: - /** - * @brief closed emit if window is closing. - */ + /** @brief closed emit if window is closing. */ void closed(); - /** - * @brief LengthChanged emit if changing length of paper sheet. - */ - void LengthChanged(); + protected: - void closeEvent(QCloseEvent *event); - void moveToCenter(); - void showEvent ( QShowEvent * event ); - void keyPressEvent ( QKeyEvent * event ); private: Q_DISABLE_COPY(TableWindow) /** @brief ui keeps information about user interface */ Ui::TableWindow* ui; /** @brief listDetails list of details. */ - QVector listDetails; + QVector listDetails; - /** @brief outItems true if we have details out paper sheet. */ - bool outItems; - - /** @brief collidingItems true if we have colission details. */ - bool collidingItems; - - /** @brief currentScene pointer to scene. */ - QGraphicsScene* tableScene; - - /** @brief paper paper sheet. */ - QGraphicsRectItem* paper; - - /** @brief shadowPaper paper sheet shadow. */ - QGraphicsRectItem* shadowPaper; - - /** @brief listOutItems list state out each detail. */ - QBitArray* listOutItems; - - /** @brief listCollidingItems list colissed details. */ - QList listCollidingItems; - - /** @brief indexDetail index next detail in list what will be shown. */ - qint32 indexDetail; - - /** @brief sceneRect minimal size of a paper. */ - QRectF sceneRect; + QList papers; + QList shadows; + QList scenes; + QList > details; /** @brief fileName keep name of pattern file. */ QString fileName; @@ -131,16 +89,22 @@ private: /** @brief description pattern description */ QString description; - void checkNext(); - void AddPaper(); - void AddDetail(); - void SvgFile(const QString &name)const; - void PngFile(const QString &name)const; - void PdfFile(const QString &name)const; - void EpsFile(const QString &name)const; - void PsFile(const QString &name)const; + QGraphicsScene* tempScene; + + void SvgFile(const QString &name, int i)const; + void PngFile(const QString &name, int i)const; + void PdfFile(const QString &name, int i)const; + void EpsFile(const QString &name, int i)const; + void PsFile(const QString &name, int i)const; void PdfToPs(const QStringList ¶ms)const; - void ObjFile(const QString &name)const; + void ObjFile(const QString &name, int i)const; + + void ClearLayout(); + void CreateShadows(); + void CreateScenes(); + void PrepareSceneList(); + QIcon ScenePreview(int i) const; + QMap InitFormates() const; }; #endif // TABLEWINDOW_H diff --git a/src/app/tablewindow.ui b/src/app/tablewindow.ui index 8f237a1d5..11bcf6891 100644 --- a/src/app/tablewindow.ui +++ b/src/app/tablewindow.ui @@ -22,23 +22,18 @@ - - QLayout::SetMinAndMaxSize - - - 9 - - - 9 - - - 9 - - - 9 - - + + + + 20 + 0 + + + + QGraphicsView::AnchorUnderMouse + + @@ -48,8 +43,8 @@ - 16 - 16 + 24 + 24 @@ -62,16 +57,82 @@ false - - - - - + + + + + 0 + 0 + + + + + 187 + 121 + + + + + 187 + 524287 + + + + QDockWidget::DockWidgetMovable + + + Qt::LeftDockWidgetArea|Qt::RightDockWidgetArea + + + Layout pages + + + 1 + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 200 + 200 + + + + QListView::Static + + + QListView::TopToBottom + + + true + + + QListView::IconMode + + + + + + false @@ -88,35 +149,6 @@ Save layout - - - - - - - - Next - - - Next detail - - - - - false - - - - - - - - Turn - - - Turn the detail 90 degrees - - @@ -130,50 +162,6 @@ Stop laying - - - - - - - - Enlarge letter - - - Enlarge the length of the sheet - - - - - false - - - - - - - - Reduce sheet - - - Reduce the length of the sheet - - - - - false - - - - :/icon/16x16/mirror.png:/icon/16x16/mirror.png - - - Mirroring - - - Mirroring - - @@ -200,6 +188,15 @@ Zoom Out + + + + :/icon/32x32/layout.png:/icon/32x32/layout.png + + + Layout + + diff --git a/src/app/tools/drawTools/drawtools.h b/src/app/tools/drawTools/drawtools.h index 50930c440..804266cb5 100644 --- a/src/app/tools/drawTools/drawtools.h +++ b/src/app/tools/drawTools/drawtools.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/drawTools/vabstractspline.cpp b/src/app/tools/drawTools/vabstractspline.cpp index aa6efbe7e..8d17770d8 100644 --- a/src/app/tools/drawTools/vabstractspline.cpp +++ b/src/app/tools/drawTools/vabstractspline.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -68,13 +68,18 @@ QString VAbstractSpline::getTagName() const */ void VAbstractSpline::FullUpdateFromFile() { + ReadAttributes(); RefreshGeometry(); } //--------------------------------------------------------------------------------------------------------------------- void VAbstractSpline::Disable(bool disable) { - DisableItem(this, disable); + enabled = !disable; + this->setEnabled(enabled); + this->setPen(QPen(CorrectColor(lineColor), qApp->toPixel(qApp->widthMainLine())/factor, Qt::SolidLine, + Qt::RoundCap)); + emit setEnabledPoint(enabled); } //--------------------------------------------------------------------------------------------------------------------- @@ -84,23 +89,18 @@ void VAbstractSpline::Disable(bool disable) */ void VAbstractSpline::ChangedActivDraw(const QString &newName) { - VDrawTool::ChangedActivDraw(newName); - const bool selectable = (nameActivDraw == newName); - this->setEnabled(selectable); - this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor)); - emit setEnabledPoint(selectable); + Disable(!(nameActivDraw == newName)); } //--------------------------------------------------------------------------------------------------------------------- /** * @brief ShowTool highlight tool. * @param id object id in container - * @param color highlight color. * @param enable enable or disable highlight. */ -void VAbstractSpline::ShowTool(quint32 id, Qt::GlobalColor color, bool enable) +void VAbstractSpline::ShowTool(quint32 id, bool enable) { - ShowItem(this, id, color, enable); + ShowItem(this, id, enable); } //--------------------------------------------------------------------------------------------------------------------- @@ -123,7 +123,8 @@ void VAbstractSpline::SetFactor(qreal factor) void VAbstractSpline::hoverEnterEvent(QGraphicsSceneHoverEvent *event) { Q_UNUSED(event); - this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthMainLine())/factor, Qt::SolidLine, Qt::RoundCap)); + this->setPen(QPen(CorrectColor(lineColor), qApp->toPixel(qApp->widthMainLine())/factor, Qt::SolidLine, + Qt::RoundCap)); this->setPath(ToolPath(PathDirection::Show)); isHovered = true; QGraphicsPathItem::hoverEnterEvent(event); @@ -138,7 +139,7 @@ void VAbstractSpline::hoverEnterEvent(QGraphicsSceneHoverEvent *event) void VAbstractSpline::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) { Q_UNUSED(event); - this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor)); + this->setPen(QPen(CorrectColor(lineColor), qApp->toPixel(qApp->widthHairLine())/factor)); this->setPath(ToolPath()); isHovered = false; QGraphicsPathItem::hoverLeaveEvent(event); @@ -211,6 +212,12 @@ QPainterPath VAbstractSpline::ToolPath(PathDirection direction) const return path; } +//--------------------------------------------------------------------------------------------------------------------- +void VAbstractSpline::ReadToolAttributes(const QDomElement &domElement) +{ + lineColor = doc->GetParametrString(domElement, AttrColor, ColorBlack); +} + //--------------------------------------------------------------------------------------------------------------------- void VAbstractSpline::ShowFoot(bool show) { @@ -219,3 +226,17 @@ void VAbstractSpline::ShowFoot(bool show) controlPoints.at(i)->setVisible(show); } } + +//--------------------------------------------------------------------------------------------------------------------- +void VAbstractSpline::setEnabled(bool enabled) +{ + QGraphicsPathItem::setEnabled(enabled); + if (enabled) + { + setPen(QPen(QColor(lineColor), qApp->toPixel(qApp->widthHairLine())/factor)); + } + else + { + setPen(QPen(Qt::gray, qApp->toPixel(qApp->widthHairLine())/factor)); + } +} diff --git a/src/app/tools/drawTools/vabstractspline.h b/src/app/tools/drawTools/vabstractspline.h index 2c39f033f..c6c3e7688 100644 --- a/src/app/tools/drawTools/vabstractspline.h +++ b/src/app/tools/drawTools/vabstractspline.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -45,6 +45,9 @@ public: enum { Type = UserType + static_cast(Tool::AbstractSpline)}; virtual QString getTagName() const; void ShowFoot(bool show); + + void setEnabled(bool enabled); + public slots: virtual void FullUpdateFromFile (); void Disable(bool disable); @@ -75,7 +78,7 @@ protected: */ virtual void RefreshGeometry ()=0; virtual void ChangedActivDraw ( const QString &newName ); - virtual void ShowTool(quint32 id, Qt::GlobalColor color, bool enable); + virtual void ShowTool(quint32 id, bool enable); virtual void SetFactor(qreal factor); virtual void hoverEnterEvent ( QGraphicsSceneHoverEvent * event ); virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event ); @@ -83,6 +86,7 @@ protected: virtual void keyReleaseEvent(QKeyEvent * event); virtual void mouseReleaseEvent ( QGraphicsSceneMouseEvent * event ); QPainterPath ToolPath(PathDirection direction = PathDirection::Hide) const; + virtual void ReadToolAttributes(const QDomElement &domElement); private: Q_DISABLE_COPY(VAbstractSpline) }; diff --git a/src/app/tools/drawTools/vdrawtool.cpp b/src/app/tools/drawTools/vdrawtool.cpp index 0902db7ba..944d06d9b 100644 --- a/src/app/tools/drawTools/vdrawtool.cpp +++ b/src/app/tools/drawTools/vdrawtool.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -46,8 +46,8 @@ qreal VDrawTool::factor = 1; * @param id object id in container. */ VDrawTool::VDrawTool(VPattern *doc, VContainer *data, quint32 id, QObject *parent) - :VAbstractTool(doc, data, id, parent), ignoreFullUpdate(false), - nameActivDraw(doc->GetNameActivPP()), dialog(nullptr) + :VAbstractTool(doc, data, id, parent), ignoreFullUpdate(false), nameActivDraw(doc->GetNameActivPP()), + dialog(nullptr), typeLine(TypeLineLine), lineColor(ColorBlack), enabled(true) { connect(this->doc, &VPattern::ChangedActivPP, this, &VDrawTool::ChangedActivDraw); connect(this->doc, &VPattern::ChangedNameDraw, this, &VDrawTool::ChangedNameDraw); @@ -64,33 +64,14 @@ VDrawTool::~VDrawTool() /** * @brief ShowTool highlight tool. * @param id object id in container. - * @param color highlight color. * @param enable enable or disable highlight. */ -void VDrawTool::ShowTool(quint32 id, Qt::GlobalColor color, bool enable) +void VDrawTool::ShowTool(quint32 id, bool enable) { Q_UNUSED(id); - Q_UNUSED(color); Q_UNUSED(enable); } -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief ChangedActivDraw disable or enable context menu after change active pattern peace. - * @param newName new name active pattern peace. name new active pattern peace. - */ -void VDrawTool::ChangedActivDraw(const QString &newName) -{ - if (nameActivDraw == newName) - { - currentColor = baseColor; - } - else - { - currentColor = Qt::gray; - } -} - //--------------------------------------------------------------------------------------------------------------------- /** * @brief ChangedNameDraw save new name active pattern peace. @@ -133,7 +114,7 @@ void VDrawTool::FullUpdateFromGuiApply() void VDrawTool::SaveDialogChange() { qCDebug(vTool)<<"Saving tool options after using dialog"; - QDomElement oldDomElement = doc->elementById(QString().setNum(id)); + QDomElement oldDomElement = doc->elementById(id); if (oldDomElement.isElement()) { QDomElement newDomElement = oldDomElement.cloneNode().toElement(); @@ -167,7 +148,7 @@ void VDrawTool::AddToFile() */ void VDrawTool::RefreshDataInFile() { - QDomElement domElement = doc->elementById(QString().setNum(id)); + QDomElement domElement = doc->elementById(id); if (domElement.isElement()) { QSharedPointer obj = VAbstractTool::data.GetGObject(id); @@ -175,7 +156,34 @@ void VDrawTool::RefreshDataInFile() } else { - qDebug()<<"Can't find tool with id ="<< id << Q_FUNC_INFO; + qCDebug(vTool)<<"Can't find tool with id ="<< id << Q_FUNC_INFO; + } +} + +//--------------------------------------------------------------------------------------------------------------------- +QColor VDrawTool::CorrectColor(const QColor &color) const +{ + if (enabled) + { + return color; + } + else + { + return Qt::gray; + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void VDrawTool::ReadAttributes() +{ + const QDomElement domElement = doc->elementById(id); + if (domElement.isElement()) + { + ReadToolAttributes(domElement); + } + else + { + qCDebug(vTool)<<"Can't find tool with id ="<< id << Q_FUNC_INFO; } } @@ -198,6 +206,13 @@ void VDrawTool::SetFactor(qreal factor) VApplication::CheckFactor(this->factor, factor); } +//--------------------------------------------------------------------------------------------------------------------- +void VDrawTool::EnableToolMove(bool move) +{ + Q_UNUSED(move) + // Do nothing. +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief CheckFormula check formula. @@ -241,10 +256,10 @@ qreal VDrawTool::CheckFormula(const quint32 &toolId, QString &formula, VContaine { DialogEditWrongFormula *dialog = new DialogEditWrongFormula(data, toolId, qApp->getMainWindow()); dialog->setWindowTitle(tr("Edit wrong formula")); - dialog->setFormula(formula); + dialog->SetFormula(formula); if (dialog->exec() == QDialog::Accepted) { - formula = dialog->getFormula(); + formula = dialog->GetFormula(); /* Need delete dialog here because parser in dialog don't allow use correct separator for parsing * here. */ delete dialog; @@ -285,3 +300,34 @@ void VDrawTool::AddToCalculation(const QDomElement &domElement) connect(addToCal, &AddToCalc::NeedFullParsing, doc, &VPattern::NeedFullParsing); qApp->getUndoStack()->push(addToCal); } + +//--------------------------------------------------------------------------------------------------------------------- +QString VDrawTool::getLineType() const +{ + return typeLine; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VDrawTool::SetTypeLine(const QString &value) +{ + typeLine = value; + + QSharedPointer obj = VAbstractTool::data.GetGObject(id); + SaveOption(obj); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString VDrawTool::GetLineColor() const +{ + return lineColor; +} + + +//--------------------------------------------------------------------------------------------------------------------- +void VDrawTool::SetLineColor(const QString &value) +{ + lineColor = value; + + QSharedPointer obj = VAbstractTool::data.GetGObject(id); + SaveOption(obj); +} diff --git a/src/app/tools/drawTools/vdrawtool.h b/src/app/tools/drawTools/vdrawtool.h index 14044c766..c4e3d4586 100644 --- a/src/app/tools/drawTools/vdrawtool.h +++ b/src/app/tools/drawTools/vdrawtool.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -55,13 +55,21 @@ public: virtual void setDialog() {} virtual void DialogLinkDestroy(); static qreal CheckFormula(const quint32 &toolId, QString &formula, VContainer *data); + + QString getLineType() const; + virtual void SetTypeLine(const QString &value); + + QString GetLineColor() const; + virtual void SetLineColor(const QString &value); + public slots: - virtual void ShowTool(quint32 id, Qt::GlobalColor color, bool enable); - virtual void ChangedActivDraw(const QString &newName); + virtual void ShowTool(quint32 id, bool enable); + virtual void ChangedActivDraw(const QString &newName) = 0; void ChangedNameDraw(const QString &oldName, const QString &newName); virtual void FullUpdateFromGuiOk(int result); virtual void FullUpdateFromGuiApply(); virtual void SetFactor(qreal factor); + virtual void EnableToolMove(bool move); protected: /** @brief ignoreFullUpdate ignore or not full updates. */ @@ -71,7 +79,15 @@ protected: QString nameActivDraw; /** @brief dialog dialog options.*/ - DialogTool *dialog; + DialogTool *dialog; + + /** @brief typeLine line type. */ + QString typeLine; + + /** @brief lineColor color line or curve, but not a point. */ + QString lineColor; + + bool enabled; void AddToCalculation(const QDomElement &domElement); @@ -80,6 +96,10 @@ protected: void SaveDialogChange(); virtual void AddToFile(); virtual void RefreshDataInFile(); + QColor CorrectColor(const QColor &color) const; + + void ReadAttributes(); + virtual void ReadToolAttributes(const QDomElement &domElement)=0; template /** @@ -142,39 +162,16 @@ protected: * @brief ShowItem highlight tool. * @param item tool. * @param id object id in container. - * @param color highlight color. * @param enable enable or disable highlight. */ - void ShowItem(Item *item, quint32 id, Qt::GlobalColor color, bool enable) + void ShowItem(Item *item, quint32 id, bool enable) { SCASSERT(item != nullptr); if (id == item->id) { - if (enable == false) - { - currentColor = baseColor; - } - else - { - currentColor = color; - } - item->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor)); + ShowVisualization(enable); } } - template - void DisableItem(Item *item, bool disable) - { - SCASSERT(item != nullptr); - if (disable) - { - currentColor = Qt::gray; - } - else - { - currentColor = baseColor; - } - item->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor)); - } private: Q_DISABLE_COPY(VDrawTool) }; diff --git a/src/app/tools/drawTools/vtoolalongline.cpp b/src/app/tools/drawTools/vtoolalongline.cpp index 597618386..0f656aa57 100644 --- a/src/app/tools/drawTools/vtoolalongline.cpp +++ b/src/app/tools/drawTools/vtoolalongline.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -50,9 +50,9 @@ const QString VToolAlongLine::ToolType = QStringLiteral("alongLine"); */ VToolAlongLine::VToolAlongLine(VPattern *doc, VContainer *data, quint32 id, const QString &formula, const quint32 &firstPointId, const quint32 &secondPointId, - const QString &typeLine, const Source &typeCreation, + const QString &typeLine, const QString &lineColor, const Source &typeCreation, QGraphicsItem *parent) - :VToolLinePoint(doc, data, id, typeLine, formula, firstPointId, 0, parent), secondPointId(secondPointId) + :VToolLinePoint(doc, data, id, typeLine, lineColor, formula, firstPointId, 0, parent), secondPointId(secondPointId) { if (typeCreation == Source::FromGui) @@ -71,14 +71,7 @@ VToolAlongLine::VToolAlongLine(VPattern *doc, VContainer *data, quint32 id, cons */ void VToolAlongLine::FullUpdateFromFile() { - QDomElement domElement = doc->elementById(QString().setNum(id)); - if (domElement.isElement()) - { - typeLine = domElement.attribute(AttrTypeLine, ""); - formulaLength = domElement.attribute(AttrLength, ""); - basePointId = domElement.attribute(AttrFirstPoint, "").toUInt(); - secondPointId = domElement.attribute(AttrSecondPoint, "").toUInt(); - } + ReadAttributes(); RefreshGeometry(); if (vis != nullptr) @@ -87,7 +80,7 @@ void VToolAlongLine::FullUpdateFromFile() visual->setPoint1Id(basePointId); visual->setPoint2Id(secondPointId); visual->setLength(qApp->FormulaToUser(formulaLength)); - visual->setLineStyle(VAbstractTool::LineStyle(typeLine)); + visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); } } @@ -144,10 +137,11 @@ void VToolAlongLine::SaveDialog(QDomElement &domElement) DialogAlongLine *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); - doc->SetAttribute(domElement, AttrTypeLine, dialogTool->getTypeLine()); - doc->SetAttribute(domElement, AttrLength, dialogTool->getFormula()); - doc->SetAttribute(domElement, AttrFirstPoint, dialogTool->getFirstPointId()); - doc->SetAttribute(domElement, AttrSecondPoint, dialogTool->getSecondPointId()); + doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine()); + doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor()); + doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula()); + doc->SetAttribute(domElement, AttrFirstPoint, dialogTool->GetFirstPointId()); + doc->SetAttribute(domElement, AttrSecondPoint, dialogTool->GetSecondPointId()); } //--------------------------------------------------------------------------------------------------------------------- @@ -163,19 +157,30 @@ void VToolAlongLine::SaveOptions(QDomElement &tag, QSharedPointer &obj doc->SetAttribute(tag, AttrMy, qApp->fromPixel(point->my())); doc->SetAttribute(tag, AttrTypeLine, typeLine); + doc->SetAttribute(tag, AttrLineColor, lineColor); doc->SetAttribute(tag, AttrLength, formulaLength); doc->SetAttribute(tag, AttrFirstPoint, basePointId); doc->SetAttribute(tag, AttrSecondPoint, secondPointId); } //--------------------------------------------------------------------------------------------------------------------- -quint32 VToolAlongLine::getSecondPointId() const +void VToolAlongLine::ReadToolAttributes(const QDomElement &domElement) +{ + typeLine = doc->GetParametrString(domElement, AttrTypeLine, TypeLineLine); + lineColor = doc->GetParametrString(domElement, AttrLineColor, ColorBlack); + formulaLength = doc->GetParametrString(domElement, AttrLength, ""); + basePointId = doc->GetParametrUInt(domElement, AttrFirstPoint, NULL_ID_STR); + secondPointId = doc->GetParametrUInt(domElement, AttrSecondPoint, NULL_ID_STR); +} + +//--------------------------------------------------------------------------------------------------------------------- +quint32 VToolAlongLine::GetSecondPointId() const { return secondPointId; } //--------------------------------------------------------------------------------------------------------------------- -void VToolAlongLine::setSecondPointId(const quint32 &value) +void VToolAlongLine::SetSecondPointId(const quint32 &value) { if (value != NULL_ID) { @@ -201,7 +206,7 @@ void VToolAlongLine::ShowVisualization(bool show) visual->setPoint1Id(basePointId); visual->setPoint2Id(secondPointId); visual->setLength(qApp->FormulaToUser(formulaLength)); - visual->setLineStyle(VAbstractTool::LineStyle(typeLine)); + visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); vis = visual; } @@ -231,11 +236,12 @@ void VToolAlongLine::setDialog() DialogAlongLine *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); const QSharedPointer p = VAbstractTool::data.GeometricObject(id); - dialogTool->setTypeLine(typeLine); - dialogTool->setFormula(formulaLength); - dialogTool->setFirstPointId(basePointId); - dialogTool->setSecondPointId(secondPointId); - dialogTool->setPointName(p->name()); + dialogTool->SetTypeLine(typeLine); + dialogTool->SetLineColor(lineColor); + dialogTool->SetFormula(formulaLength); + dialogTool->SetFirstPointId(basePointId); + dialogTool->SetSecondPointId(secondPointId); + dialogTool->SetPointName(p->name()); } //--------------------------------------------------------------------------------------------------------------------- @@ -251,14 +257,15 @@ VToolAlongLine* VToolAlongLine::Create(DialogTool *dialog, VMainGraphicsScene *s SCASSERT(dialog != nullptr); DialogAlongLine *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); - QString formula = dialogTool->getFormula(); - const quint32 firstPointId = dialogTool->getFirstPointId(); - const quint32 secondPointId = dialogTool->getSecondPointId(); - const QString typeLine = dialogTool->getTypeLine(); + QString formula = dialogTool->GetFormula(); + const quint32 firstPointId = dialogTool->GetFirstPointId(); + const quint32 secondPointId = dialogTool->GetSecondPointId(); + const QString typeLine = dialogTool->GetTypeLine(); + const QString lineColor = dialogTool->GetLineColor(); const QString pointName = dialogTool->getPointName(); VToolAlongLine *point=nullptr; - point = Create(0, pointName, typeLine, formula, firstPointId, secondPointId, 5, 10, scene, doc, data, - Document::FullParse, Source::FromGui); + point = Create(0, pointName, typeLine, lineColor, formula, firstPointId, secondPointId, 5, 10, scene, doc, data, + Document::FullParse, Source::FromGui); if (point != nullptr) { point->dialog=dialogTool; @@ -284,9 +291,10 @@ VToolAlongLine* VToolAlongLine::Create(DialogTool *dialog, VMainGraphicsScene *s * @param typeCreation way we create this tool. */ VToolAlongLine* VToolAlongLine::Create(const quint32 _id, const QString &pointName, const QString &typeLine, - QString &formula, const quint32 &firstPointId, const quint32 &secondPointId, - const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, - VContainer *data, const Document &parse, const Source &typeCreation) + const QString &lineColor, QString &formula, const quint32 &firstPointId, + const quint32 &secondPointId, const qreal &mx, const qreal &my, + VMainGraphicsScene *scene, VPattern *doc, VContainer *data, + const Document &parse, const Source &typeCreation) { const QSharedPointer firstPoint = data->GeometricObject(firstPointId); const QSharedPointer secondPoint = data->GeometricObject(secondPointId); @@ -314,8 +322,8 @@ VToolAlongLine* VToolAlongLine::Create(const quint32 _id, const QString &pointNa VDrawTool::AddRecord(id, Tool::AlongLine, doc); if (parse == Document::FullParse) { - VToolAlongLine *point = new VToolAlongLine(doc, data, id, formula, firstPointId, - secondPointId, typeLine, typeCreation); + VToolAlongLine *point = new VToolAlongLine(doc, data, id, formula, firstPointId, secondPointId, typeLine, + lineColor, typeCreation); scene->addItem(point); connect(point, &VToolAlongLine::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolAlongLine::SetFactor); diff --git a/src/app/tools/drawTools/vtoolalongline.h b/src/app/tools/drawTools/vtoolalongline.h index 09b44ef31..52bf7a1f8 100644 --- a/src/app/tools/drawTools/vtoolalongline.h +++ b/src/app/tools/drawTools/vtoolalongline.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -40,20 +40,21 @@ class VToolAlongLine : public VToolLinePoint public: VToolAlongLine(VPattern *doc, VContainer *data, quint32 id, const QString &formula, const quint32 &firstPointId, - const quint32 &secondPointId, const QString &typeLine, const Source &typeCreation, - QGraphicsItem * parent = nullptr); + const quint32 &secondPointId, const QString &typeLine, const QString &lineColor, + const Source &typeCreation, QGraphicsItem * parent = nullptr); virtual void setDialog(); static VToolAlongLine* Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data); static VToolAlongLine* Create(const quint32 _id, const QString &pointName, const QString &typeLine, - QString &formula, const quint32 &firstPointId, const quint32 &secondPointId, - const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, - VContainer *data, const Document &parse, const Source &typeCreation); + const QString &lineColor, QString &formula, const quint32 &firstPointId, + const quint32 &secondPointId, const qreal &mx, const qreal &my, + VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse, + const Source &typeCreation); static const QString ToolType; virtual int type() const {return Type;} enum { Type = UserType + static_cast(Tool::AlongLine)}; - quint32 getSecondPointId() const; - void setSecondPointId(const quint32 &value); + quint32 GetSecondPointId() const; + void SetSecondPointId(const quint32 &value); virtual void ShowVisualization(bool show); public slots: virtual void FullUpdateFromFile(); @@ -64,6 +65,7 @@ protected: virtual void RemoveReferens(); virtual void SaveDialog(QDomElement &domElement); virtual void SaveOptions(QDomElement &tag, QSharedPointer &obj); + virtual void ReadToolAttributes(const QDomElement &domElement); private: /** @brief secondPointId id second point of line. */ quint32 secondPointId; diff --git a/src/app/tools/drawTools/vtoolarc.cpp b/src/app/tools/drawTools/vtoolarc.cpp index 5e245d2e3..4ec731a5a 100644 --- a/src/app/tools/drawTools/vtoolarc.cpp +++ b/src/app/tools/drawTools/vtoolarc.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -47,10 +47,12 @@ const QString VToolArc::ToolType = QStringLiteral("simple"); * @param typeCreation way we create this tool. * @param parent parent object */ -VToolArc::VToolArc(VPattern *doc, VContainer *data, quint32 id, const Source &typeCreation, QGraphicsItem *parent) +VToolArc::VToolArc(VPattern *doc, VContainer *data, quint32 id, const QString &color, const Source &typeCreation, + QGraphicsItem *parent) :VAbstractSpline(doc, data, id, parent) { sceneType = SceneObject::Arc; + lineColor = color; this->setPath(ToolPath()); this->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthHairLine())/factor)); @@ -82,6 +84,7 @@ void VToolArc::setDialog() dialogTool->SetF1(arc->GetFormulaF1()); dialogTool->SetF2(arc->GetFormulaF2()); dialogTool->SetRadius(arc->GetFormulaRadius()); + dialogTool->SetColor(lineColor); } //--------------------------------------------------------------------------------------------------------------------- @@ -101,8 +104,9 @@ VToolArc* VToolArc::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPatte QString radius = dialogTool->GetRadius(); QString f1 = dialogTool->GetF1(); QString f2 = dialogTool->GetF2(); + const QString color = dialogTool->GetColor(); VToolArc* point = nullptr; - point=Create(0, center, radius, f1, f2, scene, doc, data, Document::FullParse, Source::FromGui); + point=Create(0, center, radius, f1, f2, color, scene, doc, data, Document::FullParse, Source::FromGui); if (point != nullptr) { point->dialog=dialogTool; @@ -125,8 +129,8 @@ VToolArc* VToolArc::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPatte * @param typeCreation way we create this tool. */ VToolArc* VToolArc::Create(const quint32 _id, const quint32 ¢er, QString &radius, QString &f1, QString &f2, - VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse, - const Source &typeCreation) + const QString &color, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, + const Document &parse, const Source &typeCreation) { qreal calcRadius = 0, calcF1 = 0, calcF2 = 0; @@ -155,7 +159,7 @@ VToolArc* VToolArc::Create(const quint32 _id, const quint32 ¢er, QString &ra VDrawTool::AddRecord(id, Tool::Arc, doc); if (parse == Document::FullParse) { - VToolArc *toolArc = new VToolArc(doc, data, id, typeCreation); + VToolArc *toolArc = new VToolArc(doc, data, id, color, typeCreation); scene->addItem(toolArc); connect(toolArc, &VToolArc::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(scene, &VMainGraphicsScene::NewFactor, toolArc, &VToolArc::SetFactor); @@ -197,7 +201,7 @@ void VToolArc::setCenter(const quint32 &value) } //--------------------------------------------------------------------------------------------------------------------- -VFormula VToolArc::getFormulaRadius() const +VFormula VToolArc::GetFormulaRadius() const { QSharedPointer arc = VAbstractTool::data.GeometricObject(id); SCASSERT(arc.isNull() == false); @@ -210,7 +214,7 @@ VFormula VToolArc::getFormulaRadius() const } //--------------------------------------------------------------------------------------------------------------------- -void VToolArc::setFormulaRadius(const VFormula &value) +void VToolArc::SetFormulaRadius(const VFormula &value) { if (value.error() == false) { @@ -225,7 +229,7 @@ void VToolArc::setFormulaRadius(const VFormula &value) } //--------------------------------------------------------------------------------------------------------------------- -VFormula VToolArc::getFormulaF1() const +VFormula VToolArc::GetFormulaF1() const { QSharedPointer arc = VAbstractTool::data.GeometricObject(id); SCASSERT(arc.isNull() == false); @@ -238,7 +242,7 @@ VFormula VToolArc::getFormulaF1() const } //--------------------------------------------------------------------------------------------------------------------- -void VToolArc::setFormulaF1(const VFormula &value) +void VToolArc::SetFormulaF1(const VFormula &value) { if (value.error() == false) { @@ -254,7 +258,7 @@ void VToolArc::setFormulaF1(const VFormula &value) } //--------------------------------------------------------------------------------------------------------------------- -VFormula VToolArc::getFormulaF2() const +VFormula VToolArc::GetFormulaF2() const { QSharedPointer arc = VAbstractTool::data.GeometricObject(id); SCASSERT(arc.isNull() == false); @@ -267,7 +271,7 @@ VFormula VToolArc::getFormulaF2() const } //--------------------------------------------------------------------------------------------------------------------- -void VToolArc::setFormulaF2(const VFormula &value) +void VToolArc::SetFormulaF2(const VFormula &value) { if (value.error() == false) { @@ -297,8 +301,8 @@ void VToolArc::ShowVisualization(bool show) visual->setPoint1Id(arc->GetCenter().id()); visual->setRadius(qApp->FormulaToUser(arc->GetFormulaRadius())); - visual->setF1(arc->GetFormulaF1()); - visual->setF2(arc->GetFormulaF2()); + visual->setF1(qApp->FormulaToUser(arc->GetFormulaF1())); + visual->setF2(qApp->FormulaToUser(arc->GetFormulaF2())); visual->RefreshGeometry(); vis = visual; } @@ -351,6 +355,7 @@ void VToolArc::SaveDialog(QDomElement &domElement) doc->SetAttribute(domElement, AttrRadius, dialogTool->GetRadius()); doc->SetAttribute(domElement, AttrAngle1, dialogTool->GetF1()); doc->SetAttribute(domElement, AttrAngle2, dialogTool->GetF2()); + doc->SetAttribute(domElement, AttrColor, dialogTool->GetColor()); } //--------------------------------------------------------------------------------------------------------------------- @@ -365,6 +370,7 @@ void VToolArc::SaveOptions(QDomElement &tag, QSharedPointer &obj) doc->SetAttribute(tag, AttrRadius, arc->GetFormulaRadius()); doc->SetAttribute(tag, AttrAngle1, arc->GetFormulaF1()); doc->SetAttribute(tag, AttrAngle2, arc->GetFormulaF2()); + doc->SetAttribute(tag, AttrColor, lineColor); } //--------------------------------------------------------------------------------------------------------------------- @@ -373,7 +379,7 @@ void VToolArc::SaveOptions(QDomElement &tag, QSharedPointer &obj) */ void VToolArc::RefreshGeometry() { - this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor)); + this->setPen(QPen(CorrectColor(lineColor), qApp->toPixel(qApp->widthHairLine())/factor)); this->setPath(ToolPath()); if (vis != nullptr) @@ -383,8 +389,8 @@ void VToolArc::RefreshGeometry() visual->setPoint1Id(arc->GetCenter().id()); visual->setRadius(qApp->FormulaToUser(arc->GetFormulaRadius())); - visual->setF1(arc->GetFormulaF1()); - visual->setF2(arc->GetFormulaF2()); + visual->setF1(qApp->FormulaToUser(arc->GetFormulaF1())); + visual->setF2(qApp->FormulaToUser(arc->GetFormulaF2())); visual->RefreshGeometry(); } } diff --git a/src/app/tools/drawTools/vtoolarc.h b/src/app/tools/drawTools/vtoolarc.h index b8264694b..21df02572 100644 --- a/src/app/tools/drawTools/vtoolarc.h +++ b/src/app/tools/drawTools/vtoolarc.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -40,12 +40,13 @@ class VToolArc :public VAbstractSpline { Q_OBJECT public: - VToolArc(VPattern *doc, VContainer *data, quint32 id, const Source &typeCreation, QGraphicsItem * parent = nullptr); + VToolArc(VPattern *doc, VContainer *data, quint32 id, const QString &color, const Source &typeCreation, + QGraphicsItem * parent = nullptr); virtual void setDialog(); static VToolArc* Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data); static VToolArc* Create(const quint32 _id, const quint32 ¢er, QString &radius, QString &f1, QString &f2, - VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse, - const Source &typeCreation); + const QString &color, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, + const Document &parse, const Source &typeCreation); static const QString TagName; static const QString ToolType; virtual int type() const {return Type;} @@ -55,14 +56,14 @@ public: quint32 getCenter() const; void setCenter(const quint32 &value); - VFormula getFormulaRadius() const; - void setFormulaRadius(const VFormula &value); + VFormula GetFormulaRadius() const; + void SetFormulaRadius(const VFormula &value); - VFormula getFormulaF1() const; - void setFormulaF1(const VFormula &value); + VFormula GetFormulaF1() const; + void SetFormulaF1(const VFormula &value); - VFormula getFormulaF2() const; - void setFormulaF2(const VFormula &value); + VFormula GetFormulaF2() const; + void SetFormulaF2(const VFormula &value); virtual void ShowVisualization(bool show); protected: diff --git a/src/app/tools/drawTools/vtoolbisector.cpp b/src/app/tools/drawTools/vtoolbisector.cpp index 3a4eefa53..def29cbc7 100644 --- a/src/app/tools/drawTools/vtoolbisector.cpp +++ b/src/app/tools/drawTools/vtoolbisector.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -49,9 +49,10 @@ const QString VToolBisector::ToolType = QStringLiteral("bisector"); * @param parent parent object. */ VToolBisector::VToolBisector(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, - const QString &formula, const quint32 &firstPointId, const quint32 &secondPointId, - const quint32 &thirdPointId, const Source &typeCreation, QGraphicsItem *parent) - :VToolLinePoint(doc, data, id, typeLine, formula, secondPointId, 0, parent), firstPointId(NULL_ID), + const QString &lineColor, const QString &formula, const quint32 &firstPointId, + const quint32 &secondPointId, const quint32 &thirdPointId, const Source &typeCreation, + QGraphicsItem *parent) + :VToolLinePoint(doc, data, id, typeLine, lineColor, formula, secondPointId, 0, parent), firstPointId(NULL_ID), thirdPointId(NULL_ID) { this->firstPointId = firstPointId; @@ -112,12 +113,13 @@ void VToolBisector::setDialog() DialogBisector *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); const QSharedPointer p = VAbstractTool::data.GeometricObject(id); - dialogTool->setTypeLine(typeLine); - dialogTool->setFormula(formulaLength); - dialogTool->setFirstPointId(firstPointId); - dialogTool->setSecondPointId(basePointId); - dialogTool->setThirdPointId(thirdPointId); - dialogTool->setPointName(p->name()); + dialogTool->SetTypeLine(typeLine); + dialogTool->SetLineColor(lineColor); + dialogTool->SetFormula(formulaLength); + dialogTool->SetFirstPointId(firstPointId); + dialogTool->SetSecondPointId(basePointId); + dialogTool->SetThirdPointId(thirdPointId); + dialogTool->SetPointName(p->name()); } //--------------------------------------------------------------------------------------------------------------------- @@ -134,15 +136,16 @@ VToolBisector* VToolBisector::Create(DialogTool *dialog, VMainGraphicsScene *sce SCASSERT(dialog != nullptr); DialogBisector *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); - QString formula = dialogTool->getFormula(); - const quint32 firstPointId = dialogTool->getFirstPointId(); - const quint32 secondPointId = dialogTool->getSecondPointId(); - const quint32 thirdPointId = dialogTool->getThirdPointId(); - const QString typeLine = dialogTool->getTypeLine(); + QString formula = dialogTool->GetFormula(); + const quint32 firstPointId = dialogTool->GetFirstPointId(); + const quint32 secondPointId = dialogTool->GetSecondPointId(); + const quint32 thirdPointId = dialogTool->GetThirdPointId(); + const QString typeLine = dialogTool->GetTypeLine(); + const QString lineColor = dialogTool->GetLineColor(); const QString pointName = dialogTool->getPointName(); VToolBisector *point = nullptr; - point=Create(0, formula, firstPointId, secondPointId, thirdPointId, typeLine, pointName, 5, 10, scene, doc, data, - Document::FullParse, Source::FromGui); + point=Create(0, formula, firstPointId, secondPointId, thirdPointId, typeLine, lineColor, pointName, 5, 10, scene, + doc, data, Document::FullParse, Source::FromGui); if (point != nullptr) { point->dialog=dialogTool; @@ -169,10 +172,10 @@ VToolBisector* VToolBisector::Create(DialogTool *dialog, VMainGraphicsScene *sce * @param typeCreation way we create this tool. */ VToolBisector* VToolBisector::Create(const quint32 _id, QString &formula, const quint32 &firstPointId, - const quint32 &secondPointId, const quint32 &thirdPointId, const QString &typeLine, - const QString &pointName, const qreal &mx, const qreal &my, - VMainGraphicsScene *scene, VPattern *doc, VContainer *data, - const Document &parse, const Source &typeCreation) + const quint32 &secondPointId, const quint32 &thirdPointId, const QString &typeLine, + const QString &lineColor, const QString &pointName, const qreal &mx, + const qreal &my, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, + const Document &parse, const Source &typeCreation) { const QSharedPointer firstPoint = data->GeometricObject(firstPointId); const QSharedPointer secondPoint = data->GeometricObject(secondPointId); @@ -200,12 +203,12 @@ VToolBisector* VToolBisector::Create(const quint32 _id, QString &formula, const VDrawTool::AddRecord(id, Tool::Bisector, doc); if (parse == Document::FullParse) { - VToolBisector *point = new VToolBisector(doc, data, id, typeLine, formula, firstPointId, secondPointId, - thirdPointId, typeCreation); + VToolBisector *point = new VToolBisector(doc, data, id, typeLine, lineColor, formula, firstPointId, + secondPointId, thirdPointId, typeCreation); scene->addItem(point); connect(point, &VToolPoint::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolBisector::SetFactor); - connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolPoint::Disable); + connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolBisector::Disable); doc->AddTool(id, point); doc->IncrementReferens(firstPointId); doc->IncrementReferens(secondPointId); @@ -221,15 +224,7 @@ VToolBisector* VToolBisector::Create(const quint32 _id, QString &formula, const */ void VToolBisector::FullUpdateFromFile() { - QDomElement domElement = doc->elementById(QString().setNum(id)); - if (domElement.isElement()) - { - typeLine = domElement.attribute(AttrTypeLine, ""); - formulaLength = domElement.attribute(AttrLength, ""); - firstPointId = domElement.attribute(AttrFirstPoint, "").toUInt(); - basePointId = domElement.attribute(AttrSecondPoint, "").toUInt(); - thirdPointId = domElement.attribute(AttrThirdPoint, "").toUInt(); - } + ReadAttributes(); RefreshGeometry(); if (vis != nullptr) @@ -239,7 +234,7 @@ void VToolBisector::FullUpdateFromFile() visual->setPoint2Id(basePointId); visual->setPoint3Id(thirdPointId); visual->setLength(qApp->FormulaToUser(formulaLength)); - visual->setLineStyle(VAbstractTool::LineStyle(typeLine)); + visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); } } @@ -296,11 +291,12 @@ void VToolBisector::SaveDialog(QDomElement &domElement) DialogBisector *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); - doc->SetAttribute(domElement, AttrTypeLine, dialogTool->getTypeLine()); - doc->SetAttribute(domElement, AttrLength, dialogTool->getFormula()); - doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->getFirstPointId())); - doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->getSecondPointId())); - doc->SetAttribute(domElement, AttrThirdPoint, QString().setNum(dialogTool->getThirdPointId())); + doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine()); + doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor()); + doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula()); + doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->GetFirstPointId())); + doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->GetSecondPointId())); + doc->SetAttribute(domElement, AttrThirdPoint, QString().setNum(dialogTool->GetThirdPointId())); } //--------------------------------------------------------------------------------------------------------------------- @@ -316,6 +312,7 @@ void VToolBisector::SaveOptions(QDomElement &tag, QSharedPointer &obj) doc->SetAttribute(tag, AttrMy, qApp->fromPixel(point->my())); doc->SetAttribute(tag, AttrTypeLine, typeLine); + doc->SetAttribute(tag, AttrLineColor, lineColor); doc->SetAttribute(tag, AttrLength, formulaLength); doc->SetAttribute(tag, AttrFirstPoint, firstPointId); doc->SetAttribute(tag, AttrSecondPoint, basePointId); @@ -323,13 +320,24 @@ void VToolBisector::SaveOptions(QDomElement &tag, QSharedPointer &obj) } //--------------------------------------------------------------------------------------------------------------------- -quint32 VToolBisector::getThirdPointId() const +void VToolBisector::ReadToolAttributes(const QDomElement &domElement) +{ + typeLine = doc->GetParametrString(domElement, AttrTypeLine, TypeLineLine); + lineColor = doc->GetParametrString(domElement, AttrLineColor, ColorBlack); + formulaLength = doc->GetParametrString(domElement, AttrLength, ""); + firstPointId = doc->GetParametrUInt(domElement, AttrFirstPoint, NULL_ID_STR); + basePointId = doc->GetParametrUInt(domElement, AttrSecondPoint, NULL_ID_STR); + thirdPointId = doc->GetParametrUInt(domElement, AttrThirdPoint, NULL_ID_STR); +} + +//--------------------------------------------------------------------------------------------------------------------- +quint32 VToolBisector::GetThirdPointId() const { return thirdPointId; } //--------------------------------------------------------------------------------------------------------------------- -void VToolBisector::setThirdPointId(const quint32 &value) +void VToolBisector::SetThirdPointId(const quint32 &value) { if (value != NULL_ID) { @@ -356,7 +364,7 @@ void VToolBisector::ShowVisualization(bool show) visual->setPoint2Id(basePointId); visual->setPoint3Id(thirdPointId); visual->setLength(qApp->FormulaToUser(formulaLength)); - visual->setLineStyle(VAbstractTool::LineStyle(typeLine)); + visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); vis = visual; } @@ -377,13 +385,13 @@ void VToolBisector::ShowVisualization(bool show) } //--------------------------------------------------------------------------------------------------------------------- -quint32 VToolBisector::getFirstPointId() const +quint32 VToolBisector::GetFirstPointId() const { return firstPointId; } //--------------------------------------------------------------------------------------------------------------------- -void VToolBisector::setFirstPointId(const quint32 &value) +void VToolBisector::SetFirstPointId(const quint32 &value) { if (value != NULL_ID) { diff --git a/src/app/tools/drawTools/vtoolbisector.h b/src/app/tools/drawTools/vtoolbisector.h index 42ac58091..428512cef 100644 --- a/src/app/tools/drawTools/vtoolbisector.h +++ b/src/app/tools/drawTools/vtoolbisector.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -39,9 +39,9 @@ class VToolBisector : public VToolLinePoint Q_OBJECT public: - VToolBisector(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const QString &formula, - const quint32 &firstPointId, const quint32 &secondPointId, const quint32 &thirdPointId, - const Source &typeCreation, QGraphicsItem * parent = nullptr); + VToolBisector(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const QString &lineColor, + const QString &formula, const quint32 &firstPointId, const quint32 &secondPointId, + const quint32 &thirdPointId, const Source &typeCreation, QGraphicsItem * parent = nullptr); static qreal BisectorAngle(const QPointF &firstPoint, const QPointF &secondPoint, const QPointF &thirdPoint); static QPointF FindPoint(const QPointF &firstPoint, const QPointF &secondPoint, const QPointF &thirdPoint, const qreal& length); @@ -49,18 +49,18 @@ public: static VToolBisector* Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data); static VToolBisector* Create(const quint32 _id, QString &formula, const quint32 &firstPointId, const quint32 &secondPointId, const quint32 &thirdPointId, const QString &typeLine, - const QString &pointName, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, - VPattern *doc, VContainer *data, const Document &parse, + const QString &lineColor, const QString &pointName, const qreal &mx, const qreal &my, + VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation); static const QString ToolType; virtual int type() const {return Type;} enum { Type = UserType + static_cast(Tool::Bisector)}; - quint32 getFirstPointId() const; - void setFirstPointId(const quint32 &value); + quint32 GetFirstPointId() const; + void SetFirstPointId(const quint32 &value); - quint32 getThirdPointId() const; - void setThirdPointId(const quint32 &value); + quint32 GetThirdPointId() const; + void SetThirdPointId(const quint32 &value); virtual void ShowVisualization(bool show); public slots: @@ -72,6 +72,7 @@ protected: virtual void RemoveReferens(); virtual void SaveDialog(QDomElement &domElement); virtual void SaveOptions(QDomElement &tag, QSharedPointer &obj); + virtual void ReadToolAttributes(const QDomElement &domElement); private: /** @brief firstPointId id first point of angle. */ quint32 firstPointId; diff --git a/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp b/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp index ad60c3af9..d554676c2 100644 --- a/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp +++ b/src/app/tools/drawTools/vtoolcurveintersectaxis.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -38,10 +38,11 @@ const QString VToolCurveIntersectAxis::ToolType = QStringLiteral("curveIntersect //--------------------------------------------------------------------------------------------------------------------- VToolCurveIntersectAxis::VToolCurveIntersectAxis(VPattern *doc, VContainer *data, const quint32 &id, - const QString &typeLine, const QString &formulaAngle, - const quint32 &basePointId, const quint32 &curveId, - const Source &typeCreation, QGraphicsItem *parent) - :VToolLinePoint(doc, data, id, typeLine, QString(), basePointId, 0, parent), formulaAngle(formulaAngle), + const QString &typeLine, const QString &lineColor, + const QString &formulaAngle, const quint32 &basePointId, + const quint32 &curveId, const Source &typeCreation, + QGraphicsItem *parent) + :VToolLinePoint(doc, data, id, typeLine, lineColor, QString(), basePointId, 0, parent), formulaAngle(formulaAngle), curveId(curveId) { if (typeCreation == Source::FromGui) @@ -66,11 +67,12 @@ void VToolCurveIntersectAxis::setDialog() DialogCurveIntersectAxis *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); const QSharedPointer p = VAbstractTool::data.GeometricObject(id); - dialogTool->setTypeLine(typeLine); - dialogTool->setAngle(formulaAngle); - dialogTool->setBasePointId(basePointId); + dialogTool->SetTypeLine(typeLine); + dialogTool->SetLineColor(lineColor); + dialogTool->SetAngle(formulaAngle); + dialogTool->SetBasePointId(basePointId); dialogTool->setCurveId(curveId); - dialogTool->setPointName(p->name()); + dialogTool->SetPointName(p->name()); } //--------------------------------------------------------------------------------------------------------------------- @@ -81,13 +83,14 @@ VToolCurveIntersectAxis *VToolCurveIntersectAxis::Create(DialogTool *dialog, VMa DialogCurveIntersectAxis *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool); const QString pointName = dialogTool->getPointName(); - const QString typeLine = dialogTool->getTypeLine(); - QString formulaAngle = dialogTool->getAngle(); - const quint32 basePointId = dialogTool->getBasePointId(); + const QString typeLine = dialogTool->GetTypeLine(); + const QString lineColor = dialogTool->GetLineColor(); + QString formulaAngle = dialogTool->GetAngle(); + const quint32 basePointId = dialogTool->GetBasePointId(); const quint32 curveId = dialogTool->getCurveId(); VToolCurveIntersectAxis *point = nullptr; - point=Create(0, pointName, typeLine, formulaAngle, basePointId, curveId, 5, 10, scene, doc, data, + point=Create(0, pointName, typeLine, lineColor, formulaAngle, basePointId, curveId, 5, 10, scene, doc, data, Document::FullParse, Source::FromGui); if (point != nullptr) { @@ -98,9 +101,9 @@ VToolCurveIntersectAxis *VToolCurveIntersectAxis::Create(DialogTool *dialog, VMa //--------------------------------------------------------------------------------------------------------------------- VToolCurveIntersectAxis *VToolCurveIntersectAxis::Create(const quint32 _id, const QString &pointName, - const QString &typeLine, QString &formulaAngle, - const quint32 &basePointId, const quint32 &curveId, - const qreal &mx, const qreal &my, + const QString &typeLine, const QString &lineColor, + QString &formulaAngle, const quint32 &basePointId, + const quint32 &curveId, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation) { @@ -127,12 +130,12 @@ VToolCurveIntersectAxis *VToolCurveIntersectAxis::Create(const quint32 _id, cons VDrawTool::AddRecord(id, Tool::CurveIntersectAxis, doc); if (parse == Document::FullParse) { - VToolCurveIntersectAxis *point = new VToolCurveIntersectAxis(doc, data, id, typeLine, formulaAngle, basePointId, - curveId, typeCreation); + VToolCurveIntersectAxis *point = new VToolCurveIntersectAxis(doc, data, id, typeLine, lineColor, formulaAngle, + basePointId, curveId, typeCreation); scene->addItem(point); connect(point, &VToolPoint::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); - connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolPoint::SetFactor); - connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolPoint::Disable); + connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolCurveIntersectAxis::SetFactor); + connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolCurveIntersectAxis::Disable); doc->AddTool(id, point); doc->IncrementReferens(basePointId); doc->IncrementReferens(curveId); @@ -173,7 +176,7 @@ QPointF VToolCurveIntersectAxis::FindPoint(const QPointF &point, qreal angle, } //--------------------------------------------------------------------------------------------------------------------- -VFormula VToolCurveIntersectAxis::getFormulaAngle() const +VFormula VToolCurveIntersectAxis::GetFormulaAngle() const { VFormula fAngle(formulaAngle, getData()); fAngle.setCheckZero(false); @@ -183,11 +186,11 @@ VFormula VToolCurveIntersectAxis::getFormulaAngle() const } //--------------------------------------------------------------------------------------------------------------------- -void VToolCurveIntersectAxis::setFormulaAngle(const VFormula &value) +void VToolCurveIntersectAxis::SetFormulaAngle(const VFormula &value) { if (value.error() == false) { - formulaAngle = value.getFormula(FormulaType::FromUser); + formulaAngle = value.GetFormula(FormulaType::FromUser); QSharedPointer obj = VAbstractTool::data.GetGObject(id); SaveOption(obj); @@ -226,8 +229,8 @@ void VToolCurveIntersectAxis::ShowVisualization(bool show) visual->setPoint1Id(curveId); visual->setAxisPointId(basePointId); - visual->setAngle(qApp->FormulaToUser(formulaAngle)); - visual->setLineStyle(VAbstractTool::LineStyle(typeLine)); + visual->SetAngle(qApp->FormulaToUser(formulaAngle)); + visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); vis = visual; } @@ -250,14 +253,7 @@ void VToolCurveIntersectAxis::ShowVisualization(bool show) //--------------------------------------------------------------------------------------------------------------------- void VToolCurveIntersectAxis::FullUpdateFromFile() { - QDomElement domElement = doc->elementById(QString().setNum(id)); - if (domElement.isElement()) - { - typeLine = domElement.attribute(AttrTypeLine, ""); - basePointId = domElement.attribute(AttrBasePoint, "").toUInt(); - curveId = domElement.attribute(AttrCurve, "").toUInt(); - formulaAngle = domElement.attribute(AttrAngle, ""); - } + ReadAttributes(); RefreshGeometry(); if (vis != nullptr) @@ -265,8 +261,8 @@ void VToolCurveIntersectAxis::FullUpdateFromFile() VisToolCurveIntersectAxis *visual = qobject_cast(vis); visual->setPoint1Id(curveId); visual->setAxisPointId(basePointId); - visual->setAngle(qApp->FormulaToUser(formulaAngle)); - visual->setLineStyle(VAbstractTool::LineStyle(typeLine)); + visual->SetAngle(qApp->FormulaToUser(formulaAngle)); + visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); } } @@ -290,9 +286,10 @@ void VToolCurveIntersectAxis::SaveDialog(QDomElement &domElement) DialogCurveIntersectAxis *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); - doc->SetAttribute(domElement, AttrTypeLine, dialogTool->getTypeLine()); - doc->SetAttribute(domElement, AttrAngle, dialogTool->getAngle()); - doc->SetAttribute(domElement, AttrBasePoint, QString().setNum(dialogTool->getBasePointId())); + doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine()); + doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor()); + doc->SetAttribute(domElement, AttrAngle, dialogTool->GetAngle()); + doc->SetAttribute(domElement, AttrBasePoint, QString().setNum(dialogTool->GetBasePointId())); doc->SetAttribute(domElement, AttrCurve, QString().setNum(dialogTool->getCurveId())); } @@ -309,7 +306,18 @@ void VToolCurveIntersectAxis::SaveOptions(QDomElement &tag, QSharedPointerSetAttribute(tag, AttrMy, qApp->fromPixel(point->my())); doc->SetAttribute(tag, AttrTypeLine, typeLine); + doc->SetAttribute(tag, AttrLineColor, lineColor); doc->SetAttribute(tag, AttrAngle, formulaAngle); doc->SetAttribute(tag, AttrBasePoint, basePointId); doc->SetAttribute(tag, AttrCurve, curveId); } + +//--------------------------------------------------------------------------------------------------------------------- +void VToolCurveIntersectAxis::ReadToolAttributes(const QDomElement &domElement) +{ + typeLine = doc->GetParametrString(domElement, AttrTypeLine, TypeLineLine); + lineColor = doc->GetParametrString(domElement, AttrLineColor, ColorBlack); + basePointId = doc->GetParametrUInt(domElement, AttrBasePoint, NULL_ID_STR); + curveId = doc->GetParametrUInt(domElement, AttrCurve, NULL_ID_STR); + formulaAngle = doc->GetParametrString(domElement, AttrAngle, ""); +} diff --git a/src/app/tools/drawTools/vtoolcurveintersectaxis.h b/src/app/tools/drawTools/vtoolcurveintersectaxis.h index fedd78c8b..cff89776f 100644 --- a/src/app/tools/drawTools/vtoolcurveintersectaxis.h +++ b/src/app/tools/drawTools/vtoolcurveintersectaxis.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -36,17 +36,18 @@ class VToolCurveIntersectAxis : public VToolLinePoint Q_OBJECT public: VToolCurveIntersectAxis(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, - const QString &formulaAngle, const quint32 &basePointId, const quint32 &curveId, - const Source &typeCreation, QGraphicsItem * parent = nullptr); + const QString &lineColor, const QString &formulaAngle, const quint32 &basePointId, + const quint32 &curveId, const Source &typeCreation, QGraphicsItem * parent = nullptr); virtual ~VToolCurveIntersectAxis(); virtual void setDialog(); static VToolCurveIntersectAxis *Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data); static VToolCurveIntersectAxis *Create(const quint32 _id, const QString &pointName, const QString &typeLine, - QString &formulaAngle, const quint32 &basePointId, const quint32 &curveId, - const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, - VContainer *data, const Document &parse, const Source &typeCreation); + const QString &lineColor, QString &formulaAngle, const quint32 &basePointId, + const quint32 &curveId, const qreal &mx, const qreal &my, + VMainGraphicsScene *scene, VPattern *doc, VContainer *data, + const Document &parse, const Source &typeCreation); static QPointF FindPoint(const QPointF &point, qreal angle, const QSharedPointer &curve); @@ -54,8 +55,8 @@ public: virtual int type() const {return Type;} enum { Type = UserType + static_cast(Tool::CurveIntersectAxis)}; - VFormula getFormulaAngle() const; - void setFormulaAngle(const VFormula &value); + VFormula GetFormulaAngle() const; + void SetFormulaAngle(const VFormula &value); quint32 getCurveId() const; void setCurveId(const quint32 &value); @@ -68,6 +69,7 @@ protected: virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event ); virtual void SaveDialog(QDomElement &domElement); virtual void SaveOptions(QDomElement &tag, QSharedPointer &obj); + virtual void ReadToolAttributes(const QDomElement &domElement); private: Q_DISABLE_COPY(VToolCurveIntersectAxis) QString formulaAngle; diff --git a/src/app/tools/drawTools/vtoolcut.cpp b/src/app/tools/drawTools/vtoolcut.cpp index ff2365dcd..6af5c8133 100644 --- a/src/app/tools/drawTools/vtoolcut.cpp +++ b/src/app/tools/drawTools/vtoolcut.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -32,7 +32,7 @@ //--------------------------------------------------------------------------------------------------------------------- VToolCut::VToolCut(VPattern *doc, VContainer *data, const quint32 &id, const QString &formula, - const quint32 &curveCutId, const quint32 &curve1id, const quint32 &curve2id, + const quint32 &curveCutId, const quint32 &curve1id, const quint32 &curve2id, const QString &color, QGraphicsItem *parent) :VToolPoint(doc, data, id, parent), formula(formula), firstCurve(nullptr), secondCurve(nullptr), curveCutId(curveCutId), curve1id(curve1id), curve2id(curve2id) @@ -41,15 +41,20 @@ VToolCut::VToolCut(VPattern *doc, VContainer *data, const quint32 &id, const QSt Q_ASSERT_X(curve1id > 0, Q_FUNC_INFO, "curve1id <= 0"); Q_ASSERT_X(curve2id > 0, Q_FUNC_INFO, "curve2id <= 0"); - firstCurve = new VSimpleCurve(curve1id, ¤tColor, SimpleCurvePoint::ForthPoint, &factor); + lineColor = color; + + firstCurve = new VSimpleCurve(curve1id, QColor(lineColor), SimpleCurvePoint::ForthPoint, &factor); firstCurve->setParentItem(this); connect(firstCurve, &VSimpleCurve::Choosed, this, &VToolCut::CurveChoosed); connect(firstCurve, &VSimpleCurve::HoverPath, this, &VToolCut::HoverPath); + // TODO: Now we only hide simple curves, but in future need totally delete them all. + firstCurve->setVisible(false); - secondCurve = new VSimpleCurve(curve2id, ¤tColor, SimpleCurvePoint::FirstPoint, &factor); + secondCurve = new VSimpleCurve(curve2id, QColor(lineColor), SimpleCurvePoint::FirstPoint, &factor); secondCurve->setParentItem(this); connect(secondCurve, &VSimpleCurve::Choosed, this, &VToolCut::CurveChoosed); connect(secondCurve, &VSimpleCurve::HoverPath, this, &VToolCut::HoverPath); + secondCurve->setVisible(false); } //--------------------------------------------------------------------------------------------------------------------- @@ -59,11 +64,7 @@ VToolCut::VToolCut(VPattern *doc, VContainer *data, const quint32 &id, const QSt */ void VToolCut::ChangedActivDraw(const QString &newName) { - VToolPoint::ChangedActivDraw(newName); - const bool flag = (nameActivDraw == newName); - this->setEnabled(flag); - firstCurve->ChangedActivDraw(flag); - secondCurve->ChangedActivDraw(flag); + Disable(!(nameActivDraw == newName)); } //--------------------------------------------------------------------------------------------------------------------- @@ -76,6 +77,14 @@ void VToolCut::HoverPath(quint32 id, SimpleCurvePoint curvePosition, PathDirecti } } +//--------------------------------------------------------------------------------------------------------------------- +void VToolCut::Disable(bool disable) +{ + VToolPoint::Disable(disable); + firstCurve->ChangedActivDraw(enabled); + secondCurve->ChangedActivDraw(enabled); +} + //--------------------------------------------------------------------------------------------------------------------- quint32 VToolCut::getCurveCutId() const { @@ -94,7 +103,7 @@ void VToolCut::setCurveCutId(const quint32 &value) } //--------------------------------------------------------------------------------------------------------------------- -VFormula VToolCut::getFormula() const +VFormula VToolCut::GetFormula() const { VFormula val(formula, getData()); val.setCheckZero(true); @@ -104,11 +113,11 @@ VFormula VToolCut::getFormula() const } //--------------------------------------------------------------------------------------------------------------------- -void VToolCut::setFormula(const VFormula &value) +void VToolCut::SetFormula(const VFormula &value) { if (value.error() == false) { - formula = value.getFormula(FormulaType::FromUser); + formula = value.GetFormula(FormulaType::FromUser); QSharedPointer obj = VAbstractTool::data.GetGObject(id); SaveOption(obj); @@ -140,11 +149,10 @@ void VToolCut::FullUpdateCurveFromFile(const QString &attrCurve) { Q_ASSERT_X(attrCurve.isEmpty() == false, Q_FUNC_INFO, "attribute name is empty"); - QDomElement domElement = doc->elementById(QString().setNum(id)); + QDomElement domElement = doc->elementById(id); if (domElement.isElement()) { formula = domElement.attribute(AttrLength, ""); curveCutId = domElement.attribute(attrCurve, "").toUInt(); } - RefreshGeometry(); } diff --git a/src/app/tools/drawTools/vtoolcut.h b/src/app/tools/drawTools/vtoolcut.h index f99e82847..836650f98 100644 --- a/src/app/tools/drawTools/vtoolcut.h +++ b/src/app/tools/drawTools/vtoolcut.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -39,12 +39,12 @@ class VToolCut : public VToolPoint Q_OBJECT public: VToolCut(VPattern *doc, VContainer *data, const quint32 &id, const QString &formula, const quint32 &curveCutId, - const quint32 &curve1id, const quint32 &curve2id, QGraphicsItem * parent = nullptr); + const quint32 &curve1id, const quint32 &curve2id, const QString &color, QGraphicsItem * parent = nullptr); virtual int type() const {return Type;} enum { Type = UserType + static_cast(Tool::Cut)}; - VFormula getFormula() const; - void setFormula(const VFormula &value); + VFormula GetFormula() const; + void SetFormula(const VFormula &value); quint32 getCurveCutId() const; void setCurveCutId(const quint32 &value); @@ -53,6 +53,7 @@ public slots: virtual void ChangedActivDraw(const QString &newName); virtual void CurveChoosed(quint32 id)=0; void HoverPath(quint32 id, SimpleCurvePoint curvePosition, PathDirection direction); + void Disable(bool disable); protected: /** @brief formula keep formula of length */ QString formula; diff --git a/src/app/tools/drawTools/vtoolcutarc.cpp b/src/app/tools/drawTools/vtoolcutarc.cpp index 1bdb9d222..dd159b6db 100644 --- a/src/app/tools/drawTools/vtoolcutarc.cpp +++ b/src/app/tools/drawTools/vtoolcutarc.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -50,9 +50,9 @@ const QString VToolCutArc::AttrArc = QStringLiteral("arc"); * @param parent parent object. */ VToolCutArc::VToolCutArc(VPattern *doc, VContainer *data, const quint32 &id, const QString &formula, - const quint32 &arcId, const quint32 &arc1id, const quint32 &arc2id, + const quint32 &arcId, const quint32 &arc1id, const quint32 &arc2id, const QString &color, const Source &typeCreation, QGraphicsItem * parent) - :VToolCut(doc, data, id, formula, arcId, arc1id, arc2id, parent) + :VToolCut(doc, data, id, formula, arcId, arc1id, arc2id, color, parent) { RefreshCurve(firstCurve, curve1id, SimpleCurvePoint::ForthPoint); RefreshCurve(secondCurve, curve2id, SimpleCurvePoint::FirstPoint); @@ -77,9 +77,10 @@ void VToolCutArc::setDialog() DialogCutArc *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); const QSharedPointer point = VAbstractTool::data.GeometricObject(id); - dialogTool->setFormula(formula); + dialogTool->SetFormula(formula); dialogTool->setArcId(curveCutId); - dialogTool->setPointName(point->name()); + dialogTool->SetPointName(point->name()); + dialogTool->SetColor(lineColor); } //--------------------------------------------------------------------------------------------------------------------- @@ -96,10 +97,11 @@ VToolCutArc* VToolCutArc::Create(DialogTool *dialog, VMainGraphicsScene *scene, DialogCutArc *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); const QString pointName = dialogTool->getPointName(); - QString formula = dialogTool->getFormula(); + QString formula = dialogTool->GetFormula(); const quint32 arcId = dialogTool->getArcId(); + const QString color = dialogTool->GetColor(); VToolCutArc* point = nullptr; - point=Create(0, pointName, formula, arcId, 5, 10, scene, doc, data, Document::FullParse, Source::FromGui); + point=Create(0, pointName, formula, arcId, 5, 10, color, scene, doc, data, Document::FullParse, Source::FromGui); if (point != nullptr) { point->dialog=dialogTool; @@ -123,8 +125,8 @@ VToolCutArc* VToolCutArc::Create(DialogTool *dialog, VMainGraphicsScene *scene, * @param typeCreation way we create this tool. */ VToolCutArc* VToolCutArc::Create(const quint32 _id, const QString &pointName, QString &formula, const quint32 &arcId, - const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, - VContainer *data, const Document &parse, const Source &typeCreation) + const qreal &mx, const qreal &my, const QString &color, VMainGraphicsScene *scene, + VPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation) { const QSharedPointer arc = data->GeometricObject(arcId); @@ -167,11 +169,11 @@ VToolCutArc* VToolCutArc::Create(const quint32 _id, const QString &pointName, QS VDrawTool::AddRecord(id, Tool::CutArc, doc); if (parse == Document::FullParse) { - VToolCutArc *point = new VToolCutArc(doc, data, id, formula, arcId, arc1id, arc2id, typeCreation); + VToolCutArc *point = new VToolCutArc(doc, data, id, formula, arcId, arc1id, arc2id, color, typeCreation); scene->addItem(point); connect(point, &VToolPoint::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolCutArc::SetFactor); - connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolPoint::Disable); + connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolCutArc::Disable); doc->AddTool(id, point); doc->AddTool(arc1id, point); doc->AddTool(arc2id, point); @@ -220,7 +222,8 @@ void VToolCutArc::ShowVisualization(bool show) */ void VToolCutArc::FullUpdateFromFile() { - FullUpdateCurveFromFile(AttrArc); + ReadAttributes(); + RefreshGeometry(); if (vis != nullptr) { @@ -271,8 +274,9 @@ void VToolCutArc::SaveDialog(QDomElement &domElement) DialogCutArc *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); - doc->SetAttribute(domElement, AttrLength, dialogTool->getFormula()); + doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula()); doc->SetAttribute(domElement, AttrArc, QString().setNum(dialogTool->getArcId())); + doc->SetAttribute(domElement, AttrColor, dialogTool->GetColor()); } //--------------------------------------------------------------------------------------------------------------------- @@ -296,6 +300,7 @@ void VToolCutArc::RefreshCurve(VSimpleCurve *curve, quint32 curveId, SimpleCurve { path.translate(-arc->GetP2().x(), -arc->GetP2().y()); } + curve->SetCurrentColor(QColor(lineColor)); curve->setPath(path); } @@ -310,7 +315,16 @@ void VToolCutArc::SaveOptions(QDomElement &tag, QSharedPointer &obj) doc->SetAttribute(tag, AttrName, point->name()); doc->SetAttribute(tag, AttrMx, qApp->fromPixel(point->mx())); doc->SetAttribute(tag, AttrMy, qApp->fromPixel(point->my())); + doc->SetAttribute(tag, AttrColor, lineColor); doc->SetAttribute(tag, AttrLength, formula); doc->SetAttribute(tag, AttrArc, curveCutId); } + +//--------------------------------------------------------------------------------------------------------------------- +void VToolCutArc::ReadToolAttributes(const QDomElement &domElement) +{ + formula = doc->GetParametrString(domElement, AttrLength, ""); + curveCutId = doc->GetParametrUInt(domElement, AttrArc, NULL_ID_STR); + lineColor = doc->GetParametrString(domElement, AttrColor, ColorBlack); +} diff --git a/src/app/tools/drawTools/vtoolcutarc.h b/src/app/tools/drawTools/vtoolcutarc.h index 2e852cdca..7505e729f 100644 --- a/src/app/tools/drawTools/vtoolcutarc.h +++ b/src/app/tools/drawTools/vtoolcutarc.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -39,13 +39,13 @@ class VToolCutArc : public VToolCut Q_OBJECT public: VToolCutArc(VPattern *doc, VContainer *data, const quint32 &id, const QString &formula, const quint32 &arcId, - const quint32 &arc1id, const quint32 &arc2id, const Source &typeCreation, + const quint32 &arc1id, const quint32 &arc2id, const QString &color, const Source &typeCreation, QGraphicsItem * parent = nullptr); virtual void setDialog(); static VToolCutArc* Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data); static VToolCutArc* Create(const quint32 _id, const QString &pointName, QString &formula, const quint32 &arcId, - const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, - VContainer *data, const Document &parse, const Source &typeCreation); + const qreal &mx, const qreal &my, const QString &color, VMainGraphicsScene *scene, + VPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation); static const QString ToolType; static const QString AttrArc; virtual int type() const {return Type;} @@ -61,6 +61,7 @@ protected: virtual void RefreshCurve(VSimpleCurve *curve, quint32 curveId, SimpleCurvePoint curvePosition, PathDirection direction = PathDirection::Hide); virtual void SaveOptions(QDomElement &tag, QSharedPointer &obj); + virtual void ReadToolAttributes(const QDomElement &domElement); private: Q_DISABLE_COPY(VToolCutArc) }; diff --git a/src/app/tools/drawTools/vtoolcutspline.cpp b/src/app/tools/drawTools/vtoolcutspline.cpp index eed9eba7a..4ea200552 100644 --- a/src/app/tools/drawTools/vtoolcutspline.cpp +++ b/src/app/tools/drawTools/vtoolcutspline.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -50,8 +50,8 @@ const QString VToolCutSpline::AttrSpline = QStringLiteral("spline"); */ VToolCutSpline::VToolCutSpline(VPattern *doc, VContainer *data, const quint32 &id, const QString &formula, const quint32 &splineId, const quint32 &spl1id, const quint32 &spl2id, - const Source &typeCreation, QGraphicsItem *parent) - :VToolCut(doc, data, id, formula, splineId, spl1id, spl2id, parent) + const QString &color, const Source &typeCreation, QGraphicsItem *parent) + :VToolCut(doc, data, id, formula, splineId, spl1id, spl2id, color, parent) { RefreshCurve(firstCurve, curve1id, SimpleCurvePoint::ForthPoint); RefreshCurve(secondCurve, curve2id, SimpleCurvePoint::FirstPoint); @@ -76,9 +76,10 @@ void VToolCutSpline::setDialog() DialogCutSpline *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); const QSharedPointer point = VAbstractTool::data.GeometricObject(id); - dialogTool->setFormula(formula); + dialogTool->SetFormula(formula); dialogTool->setSplineId(curveCutId); - dialogTool->setPointName(point->name()); + dialogTool->SetPointName(point->name()); + dialogTool->SetColor(lineColor); } //--------------------------------------------------------------------------------------------------------------------- @@ -96,10 +97,12 @@ VToolCutSpline* VToolCutSpline::Create(DialogTool *dialog, VMainGraphicsScene *s DialogCutSpline *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); const QString pointName = dialogTool->getPointName(); - QString formula = dialogTool->getFormula(); + QString formula = dialogTool->GetFormula(); const quint32 splineId = dialogTool->getSplineId(); + const QString color = dialogTool->GetColor(); VToolCutSpline* point = nullptr; - point = Create(0, pointName, formula, splineId, 5, 10, scene, doc, data, Document::FullParse, Source::FromGui); + point = Create(0, pointName, formula, splineId, 5, 10, color, scene, doc, data, Document::FullParse, + Source::FromGui); if (point != nullptr) { point->dialog=dialogTool; @@ -123,7 +126,7 @@ VToolCutSpline* VToolCutSpline::Create(DialogTool *dialog, VMainGraphicsScene *s * @param typeCreation way we create this tool. */ VToolCutSpline* VToolCutSpline::Create(const quint32 _id, const QString &pointName, QString &formula, - const quint32 &splineId, const qreal &mx, const qreal &my, + const quint32 &splineId, const qreal &mx, const qreal &my, const QString &color, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation) { @@ -174,11 +177,12 @@ VToolCutSpline* VToolCutSpline::Create(const quint32 _id, const QString &pointNa VDrawTool::AddRecord(id, Tool::CutSpline, doc); if (parse == Document::FullParse) { - VToolCutSpline *point = new VToolCutSpline(doc, data, id, formula, splineId, spl1id, spl2id, typeCreation); + VToolCutSpline *point = new VToolCutSpline(doc, data, id, formula, splineId, spl1id, spl2id, color, + typeCreation); scene->addItem(point); connect(point, &VToolPoint::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolCutSpline::SetFactor); - connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolPoint::Disable); + connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolCutSpline::Disable); doc->AddTool(id, point); doc->AddTool(spl1id, point); doc->AddTool(spl2id, point); @@ -231,7 +235,8 @@ void VToolCutSpline::ShowVisualization(bool show) */ void VToolCutSpline::FullUpdateFromFile() { - FullUpdateCurveFromFile(AttrSpline); + ReadAttributes(); + RefreshGeometry(); if (vis != nullptr) { @@ -282,8 +287,9 @@ void VToolCutSpline::SaveDialog(QDomElement &domElement) DialogCutSpline *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); - doc->SetAttribute(domElement, AttrLength, dialogTool->getFormula()); + doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula()); doc->SetAttribute(domElement, AttrSpline, QString().setNum(dialogTool->getSplineId())); + doc->SetAttribute(domElement, AttrColor, dialogTool->GetColor()); } //--------------------------------------------------------------------------------------------------------------------- @@ -307,6 +313,7 @@ void VToolCutSpline::RefreshCurve(VSimpleCurve *curve, quint32 curveId, SimpleCu { path.translate(-spl->GetP4().toQPointF().x(), -spl->GetP4().toQPointF().y()); } + curve->SetCurrentColor(QColor(lineColor)); curve->setPath(path); } @@ -321,7 +328,16 @@ void VToolCutSpline::SaveOptions(QDomElement &tag, QSharedPointer &obj doc->SetAttribute(tag, AttrName, point->name()); doc->SetAttribute(tag, AttrMx, qApp->fromPixel(point->mx())); doc->SetAttribute(tag, AttrMy, qApp->fromPixel(point->my())); + doc->SetAttribute(tag, AttrColor, lineColor); doc->SetAttribute(tag, AttrLength, formula); doc->SetAttribute(tag, AttrSpline, curveCutId); } + +//--------------------------------------------------------------------------------------------------------------------- +void VToolCutSpline::ReadToolAttributes(const QDomElement &domElement) +{ + formula = doc->GetParametrString(domElement, AttrLength, ""); + curveCutId = doc->GetParametrUInt(domElement, AttrSpline, NULL_ID_STR); + lineColor = doc->GetParametrString(domElement, AttrColor, ColorBlack); +} diff --git a/src/app/tools/drawTools/vtoolcutspline.h b/src/app/tools/drawTools/vtoolcutspline.h index d1b184edc..eb151e0a9 100644 --- a/src/app/tools/drawTools/vtoolcutspline.h +++ b/src/app/tools/drawTools/vtoolcutspline.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -40,13 +40,14 @@ class VToolCutSpline : public VToolCut public: VToolCutSpline(VPattern *doc, VContainer *data, const quint32 &id, const QString &formula, - const quint32 &splineId, const quint32 &spl1id, const quint32 &spl2id, + const quint32 &splineId, const quint32 &spl1id, const quint32 &spl2id, const QString &color, const Source &typeCreation, QGraphicsItem * parent = nullptr); virtual void setDialog(); static VToolCutSpline *Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data); static VToolCutSpline *Create(const quint32 _id, const QString &pointName, QString &formula, - const quint32 &splineId, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, - VPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation); + const quint32 &splineId, const qreal &mx, const qreal &my, const QString &color, + VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse, + const Source &typeCreation); static const QString ToolType; static const QString AttrSpline; virtual int type() const {return Type;} @@ -62,6 +63,7 @@ protected: virtual void RefreshCurve(VSimpleCurve *curve, quint32 curveId, SimpleCurvePoint curvePosition, PathDirection direction = PathDirection::Hide); virtual void SaveOptions(QDomElement &tag, QSharedPointer &obj); + virtual void ReadToolAttributes(const QDomElement &domElement); private: Q_DISABLE_COPY(VToolCutSpline) }; diff --git a/src/app/tools/drawTools/vtoolcutsplinepath.cpp b/src/app/tools/drawTools/vtoolcutsplinepath.cpp index 92678b185..b27338f21 100644 --- a/src/app/tools/drawTools/vtoolcutsplinepath.cpp +++ b/src/app/tools/drawTools/vtoolcutsplinepath.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -53,9 +53,9 @@ const QString VToolCutSplinePath::AttrSplinePath = QStringLiteral("splinePath"); */ VToolCutSplinePath::VToolCutSplinePath(VPattern *doc, VContainer *data, const quint32 &id, const QString &formula, const quint32 &splinePathId, - const quint32 &splPath1id, const quint32 &splPath2id, + const quint32 &splPath1id, const quint32 &splPath2id, const QString &color, const Source &typeCreation, QGraphicsItem *parent) - :VToolCut(doc, data, id, formula, splinePathId, splPath1id, splPath2id, parent) + :VToolCut(doc, data, id, formula, splinePathId, splPath1id, splPath2id, color, parent) { RefreshCurve(firstCurve, curve1id, SimpleCurvePoint::ForthPoint); RefreshCurve(secondCurve, curve2id, SimpleCurvePoint::FirstPoint); @@ -80,9 +80,10 @@ void VToolCutSplinePath::setDialog() DialogCutSplinePath *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); const QSharedPointer point = VAbstractTool::data.GeometricObject(id); - dialogTool->setFormula(formula); + dialogTool->SetFormula(formula); dialogTool->setSplinePathId(curveCutId); - dialogTool->setPointName(point->name()); + dialogTool->SetPointName(point->name()); + dialogTool->SetColor(lineColor); } //--------------------------------------------------------------------------------------------------------------------- @@ -100,10 +101,12 @@ VToolCutSplinePath* VToolCutSplinePath::Create(DialogTool *dialog, VMainGraphics DialogCutSplinePath *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); const QString pointName = dialogTool->getPointName(); - QString formula = dialogTool->getFormula(); + QString formula = dialogTool->GetFormula(); const quint32 splinePathId = dialogTool->getSplinePathId(); + const QString color = dialogTool->GetColor(); VToolCutSplinePath* point = nullptr; - point = Create(0, pointName, formula, splinePathId, 5, 10, scene, doc, data, Document::FullParse, Source::FromGui); + point = Create(0, pointName, formula, splinePathId, 5, 10, color, scene, doc, data, Document::FullParse, + Source::FromGui); if (point != nullptr) { point->dialog=dialogTool; @@ -128,8 +131,8 @@ VToolCutSplinePath* VToolCutSplinePath::Create(DialogTool *dialog, VMainGraphics */ VToolCutSplinePath* VToolCutSplinePath::Create(const quint32 _id, const QString &pointName, QString &formula, const quint32 &splinePathId, const qreal &mx, const qreal &my, - VMainGraphicsScene *scene, VPattern *doc, VContainer *data, - const Document &parse, const Source &typeCreation) + const QString &color, VMainGraphicsScene *scene, VPattern *doc, + VContainer *data, const Document &parse, const Source &typeCreation) { const QSharedPointer splPath = data->GeometricObject(splinePathId); SCASSERT(splPath != nullptr); @@ -156,8 +159,8 @@ VToolCutSplinePath* VToolCutSplinePath::Create(const quint32 _id, const QString VSplinePoint splP1 = splPath->at(p1); VSplinePoint splP2 = splPath->at(p2); - const VSpline spl1 = VSpline(splP1.P(), spl1p2, spl1p3, *p, splPath->getKCurve()); - const VSpline spl2 = VSpline(*p, spl2p2, spl2p3, splP2.P(), splPath->getKCurve()); + const VSpline spl1 = VSpline(splP1.P(), spl1p2, spl1p3, *p, splPath->GetKCurve()); + const VSpline spl2 = VSpline(*p, spl2p2, spl2p3, splP2.P(), splPath->GetKCurve()); VSplinePath *splPath1 = new VSplinePath(); VSplinePath *splPath2 = new VSplinePath(); @@ -191,8 +194,8 @@ VToolCutSplinePath* VToolCutSplinePath::Create(const quint32 _id, const QString splPath2->append(splPath->at(i)); } } - splPath1->setKCurve(splPath->getKCurve()); - splPath2->setKCurve(splPath->getKCurve()); + splPath1->SetKCurve(splPath->GetKCurve()); + splPath2->SetKCurve(splPath->GetKCurve()); splPath1->setMaxCountPoints(splPath->CountPoint()); splPath2->setMaxCountPoints(splPath->CountPoint()); @@ -223,11 +226,11 @@ VToolCutSplinePath* VToolCutSplinePath::Create(const quint32 _id, const QString if (parse == Document::FullParse) { VToolCutSplinePath *point = new VToolCutSplinePath(doc, data, id, formula, splinePathId, splPath1id, - splPath2id, typeCreation); + splPath2id, color, typeCreation); scene->addItem(point); connect(point, &VToolPoint::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); - connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolPoint::SetFactor); - connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolPoint::Disable); + connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolCutSplinePath::SetFactor); + connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolCutSplinePath::Disable); doc->AddTool(id, point); doc->AddTool(splPath1id, point); doc->AddTool(splPath2id, point); @@ -280,7 +283,8 @@ void VToolCutSplinePath::ShowVisualization(bool show) */ void VToolCutSplinePath::FullUpdateFromFile() { - FullUpdateCurveFromFile(AttrSplinePath); + ReadAttributes(); + RefreshGeometry(); if (vis != nullptr) { @@ -331,8 +335,9 @@ void VToolCutSplinePath::SaveDialog(QDomElement &domElement) DialogCutSplinePath *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); - doc->SetAttribute(domElement, AttrLength, dialogTool->getFormula()); + doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula()); doc->SetAttribute(domElement, AttrSplinePath, QString().setNum(dialogTool->getSplinePathId())); + doc->SetAttribute(domElement, AttrColor, dialogTool->GetColor()); } //--------------------------------------------------------------------------------------------------------------------- @@ -358,6 +363,7 @@ void VToolCutSplinePath::RefreshCurve(VSimpleCurve *curve, quint32 curveId, Simp VSpline spl = splPath->GetSpline(splPath->Count()); path.translate(-spl.GetP4().toQPointF().x(), -spl.GetP4().toQPointF().y()); } + curve->SetCurrentColor(QColor(lineColor)); curve->setPath(path); } @@ -372,7 +378,16 @@ void VToolCutSplinePath::SaveOptions(QDomElement &tag, QSharedPointer doc->SetAttribute(tag, AttrName, point->name()); doc->SetAttribute(tag, AttrMx, qApp->fromPixel(point->mx())); doc->SetAttribute(tag, AttrMy, qApp->fromPixel(point->my())); + doc->SetAttribute(tag, AttrColor, lineColor); doc->SetAttribute(tag, AttrLength, formula); doc->SetAttribute(tag, AttrSplinePath, curveCutId); } + +//--------------------------------------------------------------------------------------------------------------------- +void VToolCutSplinePath::ReadToolAttributes(const QDomElement &domElement) +{ + formula = doc->GetParametrString(domElement, AttrLength, ""); + curveCutId = doc->GetParametrUInt(domElement, AttrSplinePath, NULL_ID_STR); + lineColor = doc->GetParametrString(domElement, AttrColor, ColorBlack); +} diff --git a/src/app/tools/drawTools/vtoolcutsplinepath.h b/src/app/tools/drawTools/vtoolcutsplinepath.h index 6f5db493c..67fdf0ae0 100644 --- a/src/app/tools/drawTools/vtoolcutsplinepath.h +++ b/src/app/tools/drawTools/vtoolcutsplinepath.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -42,12 +42,12 @@ public: VToolCutSplinePath(VPattern *doc, VContainer *data, const quint32 &id, const QString &formula, const quint32 &splinePathId, const quint32 &splPath1id, const quint32 &splPath2id, - const Source &typeCreation, QGraphicsItem * parent = nullptr); + const QString &color, const Source &typeCreation, QGraphicsItem * parent = nullptr); virtual void setDialog(); static VToolCutSplinePath *Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data); static VToolCutSplinePath *Create(const quint32 _id, const QString &pointName, QString &formula, const quint32 &splinePathId, const qreal &mx, const qreal &my, - VMainGraphicsScene *scene, VPattern *doc, VContainer *data, + const QString &color, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation); static const QString ToolType; static const QString AttrSplinePath; @@ -64,6 +64,7 @@ protected: virtual void RefreshCurve(VSimpleCurve *curve, quint32 curveId, SimpleCurvePoint curvePosition, PathDirection direction = PathDirection::Hide); virtual void SaveOptions(QDomElement &tag, QSharedPointer &obj); + virtual void ReadToolAttributes(const QDomElement &domElement); private: Q_DISABLE_COPY(VToolCutSplinePath) }; diff --git a/src/app/tools/drawTools/vtoolendline.cpp b/src/app/tools/drawTools/vtoolendline.cpp index 4a41806f3..7929ee0da 100644 --- a/src/app/tools/drawTools/vtoolendline.cpp +++ b/src/app/tools/drawTools/vtoolendline.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -50,9 +50,10 @@ const QString VToolEndLine::ToolType = QStringLiteral("endLine"); * @param parent parent object. */ VToolEndLine::VToolEndLine(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, - const QString &formulaLength, const QString &formulaAngle, const quint32 &basePointId, - const Source &typeCreation, QGraphicsItem *parent) - :VToolLinePoint(doc, data, id, typeLine, formulaLength, basePointId, 0, parent), formulaAngle(formulaAngle) + const QString &lineColor, const QString &formulaLength, const QString &formulaAngle, + const quint32 &basePointId, const Source &typeCreation, QGraphicsItem *parent) + :VToolLinePoint(doc, data, id, typeLine, lineColor, formulaLength, basePointId, 0, parent), + formulaAngle(formulaAngle) { if (typeCreation == Source::FromGui) { @@ -79,11 +80,12 @@ void VToolEndLine::setDialog() DialogEndLine *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); const QSharedPointer p = VAbstractTool::data.GeometricObject(id); - dialogTool->setTypeLine(typeLine); - dialogTool->setFormula(formulaLength); - dialogTool->setAngle(formulaAngle); - dialogTool->setBasePointId(basePointId); - dialogTool->setPointName(p->name()); + dialogTool->SetTypeLine(typeLine); + dialogTool->SetLineColor(lineColor); + dialogTool->SetFormula(formulaLength); + dialogTool->SetAngle(formulaAngle); + dialogTool->SetBasePointId(basePointId); + dialogTool->SetPointName(p->name()); } //--------------------------------------------------------------------------------------------------------------------- @@ -101,13 +103,14 @@ VToolEndLine* VToolEndLine::Create(DialogTool *dialog, VMainGraphicsScene *scene DialogEndLine *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool); const QString pointName = dialogTool->getPointName(); - const QString typeLine = dialogTool->getTypeLine(); - QString formulaLength = dialogTool->getFormula(); - QString formulaAngle = dialogTool->getAngle(); - const quint32 basePointId = dialogTool->getBasePointId(); + const QString typeLine = dialogTool->GetTypeLine(); + const QString lineColor = dialogTool->GetLineColor(); + QString formulaLength = dialogTool->GetFormula(); + QString formulaAngle = dialogTool->GetAngle(); + const quint32 basePointId = dialogTool->GetBasePointId(); VToolEndLine *point = nullptr; - point=Create(0, pointName, typeLine, formulaLength, formulaAngle, basePointId, 5, 10, scene, doc, data, + point=Create(0, pointName, typeLine, lineColor, formulaLength, formulaAngle, basePointId, 5, 10, scene, doc, data, Document::FullParse, Source::FromGui); if (point != nullptr) { @@ -122,6 +125,7 @@ VToolEndLine* VToolEndLine::Create(DialogTool *dialog, VMainGraphicsScene *scene * @param _id tool id, 0 if tool doesn't exist yet. * @param pointName point name. * @param typeLine line type. + * @param lineColor line color. * @param formulaLength string with formula length of line. * @param formulaAngle formula angle of line. * @param basePointId id first point of line. @@ -135,9 +139,10 @@ VToolEndLine* VToolEndLine::Create(DialogTool *dialog, VMainGraphicsScene *scene * @return the created tool */ VToolEndLine* VToolEndLine::Create(const quint32 _id, const QString &pointName, const QString &typeLine, - QString &formulaLength, QString &formulaAngle, const quint32 &basePointId, - const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, - VContainer *data, const Document &parse, const Source &typeCreation) + const QString &lineColor, QString &formulaLength, QString &formulaAngle, + const quint32 &basePointId, const qreal &mx, const qreal &my, + VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse, + const Source &typeCreation) { const QSharedPointer basePoint = data->GeometricObject(basePointId); QLineF line = QLineF(basePoint->toQPointF(), QPointF(basePoint->x()+100, basePoint->y())); @@ -162,12 +167,12 @@ VToolEndLine* VToolEndLine::Create(const quint32 _id, const QString &pointName, VDrawTool::AddRecord(id, Tool::EndLine, doc); if (parse == Document::FullParse) { - VToolEndLine *point = new VToolEndLine(doc, data, id, typeLine, formulaLength, formulaAngle, basePointId, - typeCreation); + VToolEndLine *point = new VToolEndLine(doc, data, id, typeLine, lineColor, formulaLength, formulaAngle, + basePointId, typeCreation); scene->addItem(point); connect(point, &VToolPoint::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); - connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolPoint::SetFactor); - connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolPoint::Disable); + connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolEndLine::SetFactor); + connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolEndLine::Disable); doc->AddTool(id, point); doc->IncrementReferens(basePointId); return point; @@ -181,14 +186,7 @@ VToolEndLine* VToolEndLine::Create(const quint32 _id, const QString &pointName, */ void VToolEndLine::FullUpdateFromFile() { - QDomElement domElement = doc->elementById(QString().setNum(id)); - if (domElement.isElement()) - { - typeLine = domElement.attribute(AttrTypeLine, ""); - formulaLength = domElement.attribute(AttrLength, ""); - basePointId = domElement.attribute(AttrBasePoint, "").toUInt(); - formulaAngle = domElement.attribute(AttrAngle, ""); - } + ReadAttributes(); RefreshGeometry(); if (vis != nullptr) @@ -196,8 +194,8 @@ void VToolEndLine::FullUpdateFromFile() VisToolEndLine *visual = qobject_cast(vis); visual->setPoint1Id(basePointId); visual->setLength(qApp->FormulaToUser(formulaLength)); - visual->setAngle(qApp->FormulaToUser(formulaAngle)); - visual->setLineStyle(VAbstractTool::LineStyle(typeLine)); + visual->SetAngle(qApp->FormulaToUser(formulaAngle)); + visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); } } @@ -232,10 +230,11 @@ void VToolEndLine::SaveDialog(QDomElement &domElement) DialogEndLine *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); - doc->SetAttribute(domElement, AttrTypeLine, dialogTool->getTypeLine()); - doc->SetAttribute(domElement, AttrLength, dialogTool->getFormula()); - doc->SetAttribute(domElement, AttrAngle, dialogTool->getAngle()); - doc->SetAttribute(domElement, AttrBasePoint, QString().setNum(dialogTool->getBasePointId())); + doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine()); + doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor()); + doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula()); + doc->SetAttribute(domElement, AttrAngle, dialogTool->GetAngle()); + doc->SetAttribute(domElement, AttrBasePoint, QString().setNum(dialogTool->GetBasePointId())); } //--------------------------------------------------------------------------------------------------------------------- @@ -251,13 +250,24 @@ void VToolEndLine::SaveOptions(QDomElement &tag, QSharedPointer &obj) doc->SetAttribute(tag, AttrMy, qApp->fromPixel(point->my())); doc->SetAttribute(tag, AttrTypeLine, typeLine); + doc->SetAttribute(tag, AttrLineColor, lineColor); doc->SetAttribute(tag, AttrLength, formulaLength); doc->SetAttribute(tag, AttrAngle, formulaAngle); doc->SetAttribute(tag, AttrBasePoint, basePointId); } //--------------------------------------------------------------------------------------------------------------------- -VFormula VToolEndLine::getFormulaAngle() const +void VToolEndLine::ReadToolAttributes(const QDomElement &domElement) +{ + typeLine = doc->GetParametrString(domElement, AttrTypeLine, TypeLineLine); + lineColor = doc->GetParametrString(domElement, AttrLineColor, ColorBlack); + formulaLength = doc->GetParametrString(domElement, AttrLength, ""); + basePointId = doc->GetParametrUInt(domElement, AttrBasePoint, NULL_ID_STR); + formulaAngle = doc->GetParametrString(domElement, AttrAngle, ""); +} + +//--------------------------------------------------------------------------------------------------------------------- +VFormula VToolEndLine::GetFormulaAngle() const { VFormula fAngle(formulaAngle, getData()); fAngle.setCheckZero(false); @@ -267,11 +277,11 @@ VFormula VToolEndLine::getFormulaAngle() const } //--------------------------------------------------------------------------------------------------------------------- -void VToolEndLine::setFormulaAngle(const VFormula &value) +void VToolEndLine::SetFormulaAngle(const VFormula &value) { if (value.error() == false) { - formulaAngle = value.getFormula(FormulaType::FromUser); + formulaAngle = value.GetFormula(FormulaType::FromUser); QSharedPointer obj = VAbstractTool::data.GetGObject(id); SaveOption(obj); @@ -292,8 +302,8 @@ void VToolEndLine::ShowVisualization(bool show) visual->setPoint1Id(basePointId); visual->setLength(qApp->FormulaToUser(formulaLength)); - visual->setAngle(qApp->FormulaToUser(formulaAngle)); - visual->setLineStyle(VAbstractTool::LineStyle(typeLine)); + visual->SetAngle(qApp->FormulaToUser(formulaAngle)); + visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); vis = visual; } diff --git a/src/app/tools/drawTools/vtoolendline.h b/src/app/tools/drawTools/vtoolendline.h index b60014931..5233078bc 100644 --- a/src/app/tools/drawTools/vtoolendline.h +++ b/src/app/tools/drawTools/vtoolendline.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -39,22 +39,23 @@ class VToolEndLine : public VToolLinePoint Q_OBJECT public: - VToolEndLine(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, + VToolEndLine(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const QString &lineColor, const QString &formulaLength, const QString &formulaAngle, const quint32 &basePointId, const Source &typeCreation, QGraphicsItem * parent = nullptr); virtual ~VToolEndLine(); virtual void setDialog(); static VToolEndLine *Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data); static VToolEndLine *Create(const quint32 _id, const QString &pointName, const QString &typeLine, - QString &formulaLength, QString &formulaAngle, const quint32 &basePointId, - const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, - VContainer *data, const Document &parse, const Source &typeCreation); + const QString &lineColor, QString &formulaLength, QString &formulaAngle, + const quint32 &basePointId, const qreal &mx, const qreal &my, + VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse, + const Source &typeCreation); static const QString ToolType; virtual int type() const {return Type;} enum { Type = UserType + static_cast(Tool::EndLine)}; - VFormula getFormulaAngle() const; - void setFormulaAngle(const VFormula &value); + VFormula GetFormulaAngle() const; + void SetFormulaAngle(const VFormula &value); virtual void ShowVisualization(bool show); public slots: virtual void FullUpdateFromFile(); @@ -63,6 +64,7 @@ protected: virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event ); virtual void SaveDialog(QDomElement &domElement); virtual void SaveOptions(QDomElement &tag, QSharedPointer &obj); + virtual void ReadToolAttributes(const QDomElement &domElement); private: QString formulaAngle; }; diff --git a/src/app/tools/drawTools/vtoolheight.cpp b/src/app/tools/drawTools/vtoolheight.cpp index 25ea2a864..f5665d411 100644 --- a/src/app/tools/drawTools/vtoolheight.cpp +++ b/src/app/tools/drawTools/vtoolheight.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -47,9 +47,10 @@ const QString VToolHeight::ToolType = QStringLiteral("height"); * @param parent parent object. */ VToolHeight::VToolHeight(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, - const quint32 &basePointId, const quint32 &p1LineId, const quint32 &p2LineId, - const Source &typeCreation, QGraphicsItem * parent) - :VToolLinePoint(doc, data, id, typeLine, QString(), basePointId, 0, parent), p1LineId(p1LineId), p2LineId(p2LineId) + const QString &lineColor, const quint32 &basePointId, const quint32 &p1LineId, + const quint32 &p2LineId, const Source &typeCreation, QGraphicsItem * parent) + :VToolLinePoint(doc, data, id, typeLine, lineColor, QString(), basePointId, 0, parent), p1LineId(p1LineId), + p2LineId(p2LineId) { ignoreFullUpdate = true; if (typeCreation == Source::FromGui) @@ -72,11 +73,12 @@ void VToolHeight::setDialog() DialogHeight *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); const QSharedPointer p = VAbstractTool::data.GeometricObject(id); - dialogTool->setTypeLine(typeLine); - dialogTool->setBasePointId(basePointId); - dialogTool->setP1LineId(p1LineId); - dialogTool->setP2LineId(p2LineId); - dialogTool->setPointName(p->name()); + dialogTool->SetTypeLine(typeLine); + dialogTool->SetLineColor(lineColor); + dialogTool->SetBasePointId(basePointId); + dialogTool->SetP1LineId(p1LineId); + dialogTool->SetP2LineId(p2LineId); + dialogTool->SetPointName(p->name()); } //--------------------------------------------------------------------------------------------------------------------- @@ -95,13 +97,14 @@ VToolHeight* VToolHeight::Create(DialogTool *dialog, VMainGraphicsScene *scene, SCASSERT(dialogTool != nullptr); disconnect(doc, &VPattern::FullUpdateFromFile, dialogTool, &DialogHeight::UpdateList); const QString pointName = dialogTool->getPointName(); - const QString typeLine = dialogTool->getTypeLine(); - const quint32 basePointId = dialogTool->getBasePointId(); - const quint32 p1LineId = dialogTool->getP1LineId(); - const quint32 p2LineId = dialogTool->getP2LineId(); + const QString typeLine = dialogTool->GetTypeLine(); + const QString lineColor = dialogTool->GetLineColor(); + const quint32 basePointId = dialogTool->GetBasePointId(); + const quint32 p1LineId = dialogTool->GetP1LineId(); + const quint32 p2LineId = dialogTool->GetP2LineId(); VToolHeight *point = nullptr; - point = Create(0, pointName, typeLine, basePointId, p1LineId, p2LineId, 5, 10, scene, doc, data, + point = Create(0, pointName, typeLine, lineColor, basePointId, p1LineId, p2LineId, 5, 10, scene, doc, data, Document::FullParse, Source::FromGui); if (point != nullptr) { @@ -129,9 +132,9 @@ VToolHeight* VToolHeight::Create(DialogTool *dialog, VMainGraphicsScene *scene, * @return the created tool */ VToolHeight* VToolHeight::Create(const quint32 _id, const QString &pointName, const QString &typeLine, - const quint32 &basePointId, const quint32 &p1LineId, const quint32 &p2LineId, - const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, - VContainer *data, const Document &parse, const Source &typeCreation) + const QString &lineColor, const quint32 &basePointId, const quint32 &p1LineId, + const quint32 &p2LineId, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, + VPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation) { const QSharedPointer basePoint = data->GeometricObject(basePointId); const QSharedPointer p1Line = data->GeometricObject(p1LineId); @@ -160,12 +163,12 @@ VToolHeight* VToolHeight::Create(const quint32 _id, const QString &pointName, co VDrawTool::AddRecord(id, Tool::Height, doc); if (parse == Document::FullParse) { - VToolHeight *point = new VToolHeight(doc, data, id, typeLine, basePointId, p1LineId, p2LineId, + VToolHeight *point = new VToolHeight(doc, data, id, typeLine, lineColor, basePointId, p1LineId, p2LineId, typeCreation); scene->addItem(point); connect(point, &VToolPoint::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); - connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolPoint::SetFactor); - connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolPoint::Disable); + connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolHeight::SetFactor); + connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolHeight::Disable); doc->AddTool(id, point); doc->IncrementReferens(basePointId); doc->IncrementReferens(p1LineId); @@ -193,14 +196,7 @@ QPointF VToolHeight::FindPoint(const QLineF &line, const QPointF &point) */ void VToolHeight::FullUpdateFromFile() { - QDomElement domElement = doc->elementById(QString().setNum(id)); - if (domElement.isElement()) - { - typeLine = domElement.attribute(AttrTypeLine, ""); - basePointId = domElement.attribute(AttrBasePoint, "").toUInt(); - p1LineId = domElement.attribute(AttrP1Line, "").toUInt(); - p2LineId = domElement.attribute(AttrP2Line, "").toUInt(); - } + ReadAttributes(); RefreshGeometry(); if (vis != nullptr) @@ -209,7 +205,7 @@ void VToolHeight::FullUpdateFromFile() visual->setPoint1Id(basePointId); visual->setLineP1Id(p1LineId); visual->setLineP2Id(p2LineId); - visual->setLineStyle(VAbstractTool::LineStyle(typeLine)); + visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); } } @@ -244,10 +240,11 @@ void VToolHeight::SaveDialog(QDomElement &domElement) DialogHeight *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); - doc->SetAttribute(domElement, AttrTypeLine, dialogTool->getTypeLine()); - doc->SetAttribute(domElement, AttrBasePoint, QString().setNum(dialogTool->getBasePointId())); - doc->SetAttribute(domElement, AttrP1Line, QString().setNum(dialogTool->getP1LineId())); - doc->SetAttribute(domElement, AttrP2Line, QString().setNum(dialogTool->getP2LineId())); + doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine()); + doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor()); + doc->SetAttribute(domElement, AttrBasePoint, QString().setNum(dialogTool->GetBasePointId())); + doc->SetAttribute(domElement, AttrP1Line, QString().setNum(dialogTool->GetP1LineId())); + doc->SetAttribute(domElement, AttrP2Line, QString().setNum(dialogTool->GetP2LineId())); } //--------------------------------------------------------------------------------------------------------------------- @@ -263,19 +260,30 @@ void VToolHeight::SaveOptions(QDomElement &tag, QSharedPointer &obj) doc->SetAttribute(tag, AttrMy, qApp->fromPixel(point->my())); doc->SetAttribute(tag, AttrTypeLine, typeLine); + doc->SetAttribute(tag, AttrLineColor, lineColor); doc->SetAttribute(tag, AttrBasePoint, basePointId); doc->SetAttribute(tag, AttrP1Line, p1LineId); doc->SetAttribute(tag, AttrP2Line, p2LineId); } //--------------------------------------------------------------------------------------------------------------------- -quint32 VToolHeight::getP2LineId() const +void VToolHeight::ReadToolAttributes(const QDomElement &domElement) +{ + typeLine = doc->GetParametrString(domElement, AttrTypeLine, TypeLineLine); + lineColor = doc->GetParametrString(domElement, AttrLineColor, ColorBlack); + basePointId = doc->GetParametrUInt(domElement, AttrBasePoint, NULL_ID_STR); + p1LineId = doc->GetParametrUInt(domElement, AttrP1Line, NULL_ID_STR); + p2LineId = doc->GetParametrUInt(domElement, AttrP2Line, NULL_ID_STR); +} + +//--------------------------------------------------------------------------------------------------------------------- +quint32 VToolHeight::GetP2LineId() const { return p2LineId; } //--------------------------------------------------------------------------------------------------------------------- -void VToolHeight::setP2LineId(const quint32 &value) +void VToolHeight::SetP2LineId(const quint32 &value) { if (value != NULL_ID) { @@ -301,7 +309,7 @@ void VToolHeight::ShowVisualization(bool show) visual->setPoint1Id(basePointId); visual->setLineP1Id(p1LineId); visual->setLineP2Id(p2LineId); - visual->setLineStyle(VAbstractTool::LineStyle(typeLine)); + visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); vis = visual; } @@ -322,13 +330,13 @@ void VToolHeight::ShowVisualization(bool show) } //--------------------------------------------------------------------------------------------------------------------- -quint32 VToolHeight::getP1LineId() const +quint32 VToolHeight::GetP1LineId() const { return p1LineId; } //--------------------------------------------------------------------------------------------------------------------- -void VToolHeight::setP1LineId(const quint32 &value) +void VToolHeight::SetP1LineId(const quint32 &value) { if (value != NULL_ID) { diff --git a/src/app/tools/drawTools/vtoolheight.h b/src/app/tools/drawTools/vtoolheight.h index 79dcfe08f..7f76f94c3 100644 --- a/src/app/tools/drawTools/vtoolheight.h +++ b/src/app/tools/drawTools/vtoolheight.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -39,25 +39,25 @@ class VToolHeight: public VToolLinePoint Q_OBJECT public: - VToolHeight(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const quint32 &basePointId, - const quint32 &p1LineId, const quint32 &p2LineId, const Source &typeCreation, - QGraphicsItem * parent = nullptr); + VToolHeight(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const QString &lineColor, + const quint32 &basePointId, const quint32 &p1LineId, const quint32 &p2LineId, + const Source &typeCreation, QGraphicsItem * parent = nullptr); virtual void setDialog(); static VToolHeight *Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data); static VToolHeight *Create(const quint32 _id, const QString &pointName, const QString &typeLine, - const quint32 &basePointId, const quint32 &p1LineId, const quint32 &p2LineId, - const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, - VContainer *data, const Document &parse, const Source &typeCreation); + const QString &lineColor, const quint32 &basePointId, const quint32 &p1LineId, + const quint32 &p2LineId, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, + VPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation); static QPointF FindPoint(const QLineF &line, const QPointF &point); static const QString ToolType; virtual int type() const {return Type;} enum { Type = UserType + static_cast(Tool::Height)}; - quint32 getP1LineId() const; - void setP1LineId(const quint32 &value); + quint32 GetP1LineId() const; + void SetP1LineId(const quint32 &value); - quint32 getP2LineId() const; - void setP2LineId(const quint32 &value); + quint32 GetP2LineId() const; + void SetP2LineId(const quint32 &value); virtual void ShowVisualization(bool show); public slots: @@ -67,6 +67,7 @@ protected: virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event ); virtual void SaveDialog(QDomElement &domElement); virtual void SaveOptions(QDomElement &tag, QSharedPointer &obj); + virtual void ReadToolAttributes(const QDomElement &domElement); private: /** @brief p1LineId id first point of line. */ quint32 p1LineId; diff --git a/src/app/tools/drawTools/vtoolline.cpp b/src/app/tools/drawTools/vtoolline.cpp index ec85c2b29..1f67a5221 100644 --- a/src/app/tools/drawTools/vtoolline.cpp +++ b/src/app/tools/drawTools/vtoolline.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -48,10 +48,12 @@ const QString VToolLine::TagName = QStringLiteral("line"); * @param parent parent object. */ VToolLine::VToolLine(VPattern *doc, VContainer *data, quint32 id, quint32 firstPoint, quint32 secondPoint, - const QString &typeLine, const Source &typeCreation, QGraphicsItem *parent) + const QString &typeLine, const QString &lineColor, const Source &typeCreation, + QGraphicsItem *parent) :VDrawTool(doc, data, id), QGraphicsLineItem(parent), firstPoint(firstPoint), secondPoint(secondPoint) { this->typeLine = typeLine; + this->lineColor = lineColor; ignoreFullUpdate = true; //Line const QSharedPointer first = data->GeometricObject(firstPoint); @@ -61,7 +63,7 @@ VToolLine::VToolLine(VPattern *doc, VContainer *data, quint32 id, quint32 firstP this->setFlag(QGraphicsItem::ItemIsSelectable, true); this->setFlag(QGraphicsItem::ItemIsFocusable, true); this->setAcceptHoverEvents(true); - this->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthHairLine())/factor, LineStyle(typeLine))); + this->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthHairLine())/factor, LineStyleToPenStyle(typeLine))); if (typeCreation == Source::FromGui) { @@ -82,9 +84,10 @@ void VToolLine::setDialog() SCASSERT(dialog != nullptr); DialogLine *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); - dialogTool->setFirstPoint(firstPoint); - dialogTool->setSecondPoint(secondPoint); - dialogTool->setTypeLine(typeLine); + dialogTool->SetFirstPoint(firstPoint); + dialogTool->SetSecondPoint(secondPoint); + dialogTool->SetTypeLine(typeLine); + dialogTool->SetLineColor(lineColor); } //--------------------------------------------------------------------------------------------------------------------- @@ -100,12 +103,14 @@ VToolLine *VToolLine::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPat SCASSERT(dialog != nullptr); DialogLine *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); - const quint32 firstPoint = dialogTool->getFirstPoint(); - const quint32 secondPoint = dialogTool->getSecondPoint(); - const QString typeLine = dialogTool->getTypeLine(); + const quint32 firstPoint = dialogTool->GetFirstPoint(); + const quint32 secondPoint = dialogTool->GetSecondPoint(); + const QString typeLine = dialogTool->GetTypeLine(); + const QString lineColor = dialogTool->GetLineColor(); VToolLine *line = nullptr; - line = Create(0, firstPoint, secondPoint, typeLine, scene, doc, data, Document::FullParse, Source::FromGui); + line = Create(0, firstPoint, secondPoint, typeLine, lineColor, scene, doc, data, Document::FullParse, + Source::FromGui); if (line != nullptr) { line->dialog=dialogTool; @@ -127,8 +132,8 @@ VToolLine *VToolLine::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPat * @param typeCreation way we create this tool. */ VToolLine * VToolLine::Create(const quint32 &_id, const quint32 &firstPoint, const quint32 &secondPoint, - const QString &typeLine, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, - const Document &parse, const Source &typeCreation) + const QString &typeLine, const QString &lineColor, VMainGraphicsScene *scene, + VPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation) { SCASSERT(scene != nullptr); SCASSERT(doc != nullptr); @@ -151,7 +156,7 @@ VToolLine * VToolLine::Create(const quint32 &_id, const quint32 &firstPoint, con VDrawTool::AddRecord(id, Tool::Line, doc); if (parse == Document::FullParse) { - VToolLine *line = new VToolLine(doc, data, id, firstPoint, secondPoint, typeLine, typeCreation); + VToolLine *line = new VToolLine(doc, data, id, firstPoint, secondPoint, typeLine, lineColor, typeCreation); scene->addItem(line); connect(line, &VToolLine::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(scene, &VMainGraphicsScene::NewFactor, line, &VToolLine::SetFactor); @@ -189,6 +194,7 @@ QString VToolLine::getTagName() const */ void VToolLine::FullUpdateFromFile() { + ReadAttributes(); RefreshGeometry(); if (vis != nullptr) @@ -196,7 +202,7 @@ void VToolLine::FullUpdateFromFile() VisToolLine *visual = qobject_cast(vis); visual->setPoint1Id(firstPoint); visual->setPoint2Id(secondPoint); - visual->setLineStyle(VAbstractTool::LineStyle(typeLine)); + visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); } } @@ -205,12 +211,11 @@ void VToolLine::FullUpdateFromFile() /** * @brief ShowTool highlight tool. * @param id object id in container - * @param color highlight color. * @param enable enable or disable highlight. */ -void VToolLine::ShowTool(quint32 id, Qt::GlobalColor color, bool enable) +void VToolLine::ShowTool(quint32 id, bool enable) { - ShowItem(this, id, color, enable); + ShowItem(this, id, enable); } //--------------------------------------------------------------------------------------------------------------------- @@ -227,7 +232,9 @@ void VToolLine::SetFactor(qreal factor) //--------------------------------------------------------------------------------------------------------------------- void VToolLine::Disable(bool disable) { - DisableItem(this, disable); + enabled = !disable; + this->setEnabled(enabled); + this->setPen(QPen(QColor(baseColor), qApp->toPixel(qApp->widthHairLine())/factor, LineStyleToPenStyle(typeLine))); } //--------------------------------------------------------------------------------------------------------------------- @@ -237,9 +244,7 @@ void VToolLine::Disable(bool disable) */ void VToolLine::ChangedActivDraw(const QString &newName) { - VDrawTool::ChangedActivDraw(newName); - this->setEnabled(nameActivDraw == newName); - this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor, LineStyle(typeLine))); + Disable(!(nameActivDraw == newName)); } //--------------------------------------------------------------------------------------------------------------------- @@ -270,7 +275,7 @@ void VToolLine::AddToFile() */ void VToolLine::RefreshDataInFile() { - QDomElement domElement = doc->elementById(QString().setNum(id)); + QDomElement domElement = doc->elementById(id); if (domElement.isElement()) { QSharedPointer obj = QSharedPointer (); @@ -290,7 +295,8 @@ void VToolLine::RefreshDataInFile() void VToolLine::hoverEnterEvent(QGraphicsSceneHoverEvent *event) { Q_UNUSED(event); - this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthMainLine())/factor, LineStyle(typeLine))); + this->setPen(QPen(CorrectColor(lineColor), qApp->toPixel(qApp->widthMainLine())/factor, + LineStyleToPenStyle(typeLine))); } //--------------------------------------------------------------------------------------------------------------------- @@ -301,7 +307,11 @@ void VToolLine::hoverEnterEvent(QGraphicsSceneHoverEvent *event) void VToolLine::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) { Q_UNUSED(event); - this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor, LineStyle(typeLine))); + if (vis == nullptr) + { + this->setPen(QPen(CorrectColor(lineColor), qApp->toPixel(qApp->widthHairLine())/factor, + LineStyleToPenStyle(typeLine))); + } } //--------------------------------------------------------------------------------------------------------------------- @@ -366,9 +376,10 @@ void VToolLine::SaveDialog(QDomElement &domElement) SCASSERT(dialog != nullptr); DialogLine *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); - doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->getFirstPoint())); - doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->getSecondPoint())); - doc->SetAttribute(domElement, AttrTypeLine, dialogTool->getTypeLine()); + doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->GetFirstPoint())); + doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->GetSecondPoint())); + doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine()); + doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor()); } //--------------------------------------------------------------------------------------------------------------------- @@ -380,22 +391,32 @@ void VToolLine::SaveOptions(QDomElement &tag, QSharedPointer &obj) doc->SetAttribute(tag, AttrFirstPoint, firstPoint); doc->SetAttribute(tag, AttrSecondPoint, secondPoint); doc->SetAttribute(tag, AttrTypeLine, typeLine); + doc->SetAttribute(tag, AttrLineColor, lineColor); } //--------------------------------------------------------------------------------------------------------------------- -quint32 VToolLine::getSecondPoint() const +void VToolLine::ReadToolAttributes(const QDomElement &domElement) +{ + firstPoint = doc->GetParametrUInt(domElement, AttrFirstPoint, NULL_ID_STR); + secondPoint = doc->GetParametrUInt(domElement, AttrSecondPoint, NULL_ID_STR); + typeLine = doc->GetParametrString(domElement, AttrTypeLine, TypeLineLine); + lineColor = doc->GetParametrString(domElement, AttrLineColor, ColorBlack); +} + +//--------------------------------------------------------------------------------------------------------------------- +quint32 VToolLine::GetSecondPoint() const { return secondPoint; } //--------------------------------------------------------------------------------------------------------------------- -void VToolLine::setSecondPoint(const quint32 &value) +void VToolLine::SetSecondPoint(const quint32 &value) { if (value != NULL_ID) { secondPoint = value; - QSharedPointer obj = VAbstractTool::data.GetGObject(id); + QSharedPointer obj;//We don't have object for line in data container. Just will send empty object. SaveOption(obj); } } @@ -414,7 +435,7 @@ void VToolLine::ShowVisualization(bool show) visual->setPoint1Id(firstPoint); visual->setPoint2Id(secondPoint); - visual->setLineStyle(VAbstractTool::LineStyle(typeLine)); + visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); vis = visual; } @@ -431,11 +452,12 @@ void VToolLine::ShowVisualization(bool show) { delete vis; vis = nullptr; + hoverLeaveEvent(nullptr); } } //--------------------------------------------------------------------------------------------------------------------- -void VToolLine::setTypeLine(const QString &value) +void VToolLine::SetTypeLine(const QString &value) { typeLine = value; @@ -444,19 +466,28 @@ void VToolLine::setTypeLine(const QString &value) } //--------------------------------------------------------------------------------------------------------------------- -quint32 VToolLine::getFirstPoint() const +void VToolLine::SetLineColor(const QString &value) +{ + lineColor = value; + + QSharedPointer obj;//We don't have object for line in data container. Just will send empty object. + SaveOption(obj); +} + +//--------------------------------------------------------------------------------------------------------------------- +quint32 VToolLine::GetFirstPoint() const { return firstPoint; } //--------------------------------------------------------------------------------------------------------------------- -void VToolLine::setFirstPoint(const quint32 &value) +void VToolLine::SetFirstPoint(const quint32 &value) { if (value != NULL_ID) { firstPoint = value; - QSharedPointer obj = VAbstractTool::data.GetGObject(id); + QSharedPointer obj;//We don't have object for line in data container. Just will send empty object. SaveOption(obj); } } @@ -467,15 +498,8 @@ void VToolLine::setFirstPoint(const quint32 &value) */ void VToolLine::RefreshGeometry() { - QDomElement domElement = doc->elementById(QString().setNum(id)); - if (domElement.isElement()) - { - firstPoint = doc->GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, NULL_ID_STR); - secondPoint = doc->GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, NULL_ID_STR); - typeLine = doc->GetParametrString(domElement, VAbstractTool::AttrTypeLine, VAbstractTool::TypeLineLine); - } const QSharedPointer first = VAbstractTool::data.GeometricObject(firstPoint); const QSharedPointer second = VAbstractTool::data.GeometricObject(secondPoint); this->setLine(QLineF(first->toQPointF(), second->toQPointF())); - this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor, LineStyle(typeLine))); + this->setPen(QPen(CorrectColor(lineColor), pen().widthF(), LineStyleToPenStyle(typeLine))); } diff --git a/src/app/tools/drawTools/vtoolline.h b/src/app/tools/drawTools/vtoolline.h index 1d852957a..8326d95cc 100644 --- a/src/app/tools/drawTools/vtoolline.h +++ b/src/app/tools/drawTools/vtoolline.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -40,29 +40,32 @@ class VToolLine: public VDrawTool, public QGraphicsLineItem Q_OBJECT public: VToolLine(VPattern *doc, VContainer *data, quint32 id, quint32 firstPoint, quint32 secondPoint, - const QString &typeLine, const Source &typeCreation, QGraphicsItem * parent = nullptr); + const QString &typeLine, const QString &lineColor, const Source &typeCreation, + QGraphicsItem * parent = nullptr); virtual void setDialog(); static VToolLine *Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data); static VToolLine *Create(const quint32 &_id, const quint32 &firstPoint, const quint32 &secondPoint, - const QString &typeLine, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, - const Document &parse, const Source &typeCreation); + const QString &typeLine, const QString &lineColor, VMainGraphicsScene *scene, + VPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation); static const QString TagName; virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0); virtual int type() const {return Type;} enum { Type = UserType + static_cast(Tool::Line)}; virtual QString getTagName() const; - quint32 getFirstPoint() const; - void setFirstPoint(const quint32 &value); + quint32 GetFirstPoint() const; + void SetFirstPoint(const quint32 &value); - quint32 getSecondPoint() const; - void setSecondPoint(const quint32 &value); + quint32 GetSecondPoint() const; + void SetSecondPoint(const quint32 &value); virtual void ShowVisualization(bool show); - virtual void setTypeLine(const QString &value); + + virtual void SetTypeLine(const QString &value); + virtual void SetLineColor(const QString &value); public slots: virtual void FullUpdateFromFile(); virtual void ChangedActivDraw(const QString &newName); - virtual void ShowTool(quint32 id, Qt::GlobalColor color, bool enable); + virtual void ShowTool(quint32 id, bool enable); virtual void SetFactor(qreal factor); void Disable(bool disable); protected: @@ -76,6 +79,7 @@ protected: virtual void keyReleaseEvent(QKeyEvent * event); virtual void SaveDialog(QDomElement &domElement); virtual void SaveOptions(QDomElement &tag, QSharedPointer &obj); + virtual void ReadToolAttributes(const QDomElement &domElement); private: /** @brief firstPoint id first line point. */ quint32 firstPoint; diff --git a/src/app/tools/drawTools/vtoollineintersect.cpp b/src/app/tools/drawTools/vtoollineintersect.cpp index 973836f6a..850abaab7 100644 --- a/src/app/tools/drawTools/vtoollineintersect.cpp +++ b/src/app/tools/drawTools/vtoollineintersect.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -74,11 +74,11 @@ void VToolLineIntersect::setDialog() DialogLineIntersect *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); const QSharedPointer p = VAbstractTool::data.GeometricObject(id); - dialogTool->setP1Line1(p1Line1); - dialogTool->setP2Line1(p2Line1); - dialogTool->setP1Line2(p1Line2); - dialogTool->setP2Line2(p2Line2); - dialogTool->setPointName(p->name()); + dialogTool->SetP1Line1(p1Line1); + dialogTool->SetP2Line1(p2Line1); + dialogTool->SetP1Line2(p1Line2); + dialogTool->SetP2Line2(p2Line2); + dialogTool->SetPointName(p->name()); } //--------------------------------------------------------------------------------------------------------------------- @@ -96,10 +96,10 @@ VToolLineIntersect* VToolLineIntersect::Create(DialogTool *dialog, VMainGraphics SCASSERT(dialog != nullptr); DialogLineIntersect *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); - const quint32 p1Line1Id = dialogTool->getP1Line1(); - const quint32 p2Line1Id = dialogTool->getP2Line1(); - const quint32 p1Line2Id = dialogTool->getP1Line2(); - const quint32 p2Line2Id = dialogTool->getP2Line2(); + const quint32 p1Line1Id = dialogTool->GetP1Line1(); + const quint32 p2Line1Id = dialogTool->GetP2Line1(); + const quint32 p1Line2Id = dialogTool->GetP1Line2(); + const quint32 p2Line2Id = dialogTool->GetP2Line2(); const QString pointName = dialogTool->getPointName(); VToolLineIntersect* point = nullptr; point = Create(0, p1Line1Id, p2Line1Id, p1Line2Id, p2Line2Id, pointName, 5, 10, scene, doc, data, @@ -175,7 +175,7 @@ VToolLineIntersect* VToolLineIntersect::Create(const quint32 _id, const quint32 scene->addItem(point); connect(point, &VToolLineIntersect::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolLineIntersect::SetFactor); - connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolPoint::Disable); + connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolLineIntersect::Disable); doc->AddTool(id, point); doc->IncrementReferens(p1Line1Id); doc->IncrementReferens(p2Line1Id); @@ -193,14 +193,7 @@ VToolLineIntersect* VToolLineIntersect::Create(const quint32 _id, const quint32 */ void VToolLineIntersect::FullUpdateFromFile() { - QDomElement domElement = doc->elementById(QString().setNum(id)); - if (domElement.isElement()) - { - p1Line1 = domElement.attribute(AttrP1Line1, "").toUInt(); - p2Line1 = domElement.attribute(AttrP2Line1, "").toUInt(); - p1Line2 = domElement.attribute(AttrP1Line2, "").toUInt(); - p2Line2 = domElement.attribute(AttrP2Line2, "").toUInt(); - } + ReadAttributes(); RefreshPointGeometry(*VAbstractTool::data.GeometricObject(id)); if (vis != nullptr) @@ -267,10 +260,10 @@ void VToolLineIntersect::SaveDialog(QDomElement &domElement) DialogLineIntersect *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); - doc->SetAttribute(domElement, AttrP1Line1, QString().setNum(dialogTool->getP1Line1())); - doc->SetAttribute(domElement, AttrP2Line1, QString().setNum(dialogTool->getP2Line1())); - doc->SetAttribute(domElement, AttrP1Line2, QString().setNum(dialogTool->getP1Line2())); - doc->SetAttribute(domElement, AttrP2Line2, QString().setNum(dialogTool->getP2Line2())); + doc->SetAttribute(domElement, AttrP1Line1, QString().setNum(dialogTool->GetP1Line1())); + doc->SetAttribute(domElement, AttrP2Line1, QString().setNum(dialogTool->GetP2Line1())); + doc->SetAttribute(domElement, AttrP1Line2, QString().setNum(dialogTool->GetP1Line2())); + doc->SetAttribute(domElement, AttrP2Line2, QString().setNum(dialogTool->GetP2Line2())); } //--------------------------------------------------------------------------------------------------------------------- @@ -292,13 +285,22 @@ void VToolLineIntersect::SaveOptions(QDomElement &tag, QSharedPointer } //--------------------------------------------------------------------------------------------------------------------- -quint32 VToolLineIntersect::getP2Line2() const +void VToolLineIntersect::ReadToolAttributes(const QDomElement &domElement) +{ + p1Line1 = doc->GetParametrUInt(domElement, AttrP1Line1, NULL_ID_STR); + p2Line1 = doc->GetParametrUInt(domElement, AttrP2Line1, NULL_ID_STR); + p1Line2 = doc->GetParametrUInt(domElement, AttrP1Line2, NULL_ID_STR); + p2Line2 = doc->GetParametrUInt(domElement, AttrP2Line2, NULL_ID_STR); +} + +//--------------------------------------------------------------------------------------------------------------------- +quint32 VToolLineIntersect::GetP2Line2() const { return p2Line2; } //--------------------------------------------------------------------------------------------------------------------- -void VToolLineIntersect::setP2Line2(const quint32 &value) +void VToolLineIntersect::SetP2Line2(const quint32 &value) { if (value != NULL_ID) { @@ -345,13 +347,13 @@ void VToolLineIntersect::ShowVisualization(bool show) } //--------------------------------------------------------------------------------------------------------------------- -quint32 VToolLineIntersect::getP1Line2() const +quint32 VToolLineIntersect::GetP1Line2() const { return p1Line2; } //--------------------------------------------------------------------------------------------------------------------- -void VToolLineIntersect::setP1Line2(const quint32 &value) +void VToolLineIntersect::SetP1Line2(const quint32 &value) { if (value != NULL_ID) { @@ -363,13 +365,13 @@ void VToolLineIntersect::setP1Line2(const quint32 &value) } //--------------------------------------------------------------------------------------------------------------------- -quint32 VToolLineIntersect::getP2Line1() const +quint32 VToolLineIntersect::GetP2Line1() const { return p2Line1; } //--------------------------------------------------------------------------------------------------------------------- -void VToolLineIntersect::setP2Line1(const quint32 &value) +void VToolLineIntersect::SetP2Line1(const quint32 &value) { if (value != NULL_ID) { @@ -381,13 +383,13 @@ void VToolLineIntersect::setP2Line1(const quint32 &value) } //--------------------------------------------------------------------------------------------------------------------- -quint32 VToolLineIntersect::getP1Line1() const +quint32 VToolLineIntersect::GetP1Line1() const { return p1Line1; } //--------------------------------------------------------------------------------------------------------------------- -void VToolLineIntersect::setP1Line1(const quint32 &value) +void VToolLineIntersect::SetP1Line1(const quint32 &value) { if (value != NULL_ID) { diff --git a/src/app/tools/drawTools/vtoollineintersect.h b/src/app/tools/drawTools/vtoollineintersect.h index dd28d16b9..722feba2f 100644 --- a/src/app/tools/drawTools/vtoollineintersect.h +++ b/src/app/tools/drawTools/vtoollineintersect.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -51,17 +51,17 @@ public: virtual int type() const {return Type;} enum { Type = UserType + static_cast(Tool::LineIntersect)}; - quint32 getP1Line1() const; - void setP1Line1(const quint32 &value); + quint32 GetP1Line1() const; + void SetP1Line1(const quint32 &value); - quint32 getP2Line1() const; - void setP2Line1(const quint32 &value); + quint32 GetP2Line1() const; + void SetP2Line1(const quint32 &value); - quint32 getP1Line2() const; - void setP1Line2(const quint32 &value); + quint32 GetP1Line2() const; + void SetP1Line2(const quint32 &value); - quint32 getP2Line2() const; - void setP2Line2(const quint32 &value); + quint32 GetP2Line2() const; + void SetP2Line2(const quint32 &value); virtual void ShowVisualization(bool show); public slots: @@ -73,6 +73,7 @@ protected: virtual void RemoveReferens(); virtual void SaveDialog(QDomElement &domElement); virtual void SaveOptions(QDomElement &tag, QSharedPointer &obj); + virtual void ReadToolAttributes(const QDomElement &domElement); private: /** @brief p1Line1 id first point first line. */ quint32 p1Line1; diff --git a/src/app/tools/drawTools/vtoollineintersectaxis.cpp b/src/app/tools/drawTools/vtoollineintersectaxis.cpp index c9f28c18e..bdef767aa 100644 --- a/src/app/tools/drawTools/vtoollineintersectaxis.cpp +++ b/src/app/tools/drawTools/vtoollineintersectaxis.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -38,11 +38,11 @@ const QString VToolLineIntersectAxis::ToolType = QStringLiteral("lineIntersectAx //--------------------------------------------------------------------------------------------------------------------- VToolLineIntersectAxis::VToolLineIntersectAxis(VPattern *doc, VContainer *data, const quint32 &id, - const QString &typeLine, const QString &formulaAngle, - const quint32 &basePointId, const quint32 &firstPointId, - const quint32 &secondPointId, const Source &typeCreation, - QGraphicsItem *parent) - :VToolLinePoint(doc, data, id, typeLine, QString(), basePointId, 0, parent), formulaAngle(formulaAngle), + const QString &typeLine, const QString &lineColor, + const QString &formulaAngle, const quint32 &basePointId, + const quint32 &firstPointId, const quint32 &secondPointId, + const Source &typeCreation, QGraphicsItem *parent) + :VToolLinePoint(doc, data, id, typeLine, lineColor, QString(), basePointId, 0, parent), formulaAngle(formulaAngle), firstPointId(firstPointId), secondPointId(secondPointId) { if (typeCreation == Source::FromGui) @@ -67,12 +67,13 @@ void VToolLineIntersectAxis::setDialog() DialogLineIntersectAxis *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); const QSharedPointer p = VAbstractTool::data.GeometricObject(id); - dialogTool->setTypeLine(typeLine); - dialogTool->setAngle(formulaAngle); - dialogTool->setBasePointId(basePointId); - dialogTool->setFirstPointId(firstPointId); - dialogTool->setSecondPointId(secondPointId); - dialogTool->setPointName(p->name()); + dialogTool->SetTypeLine(typeLine); + dialogTool->SetLineColor(lineColor); + dialogTool->SetAngle(formulaAngle); + dialogTool->SetBasePointId(basePointId); + dialogTool->SetFirstPointId(firstPointId); + dialogTool->SetSecondPointId(secondPointId); + dialogTool->SetPointName(p->name()); } //--------------------------------------------------------------------------------------------------------------------- @@ -83,15 +84,16 @@ VToolLineIntersectAxis *VToolLineIntersectAxis::Create(DialogTool *dialog, VMain DialogLineIntersectAxis *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool); const QString pointName = dialogTool->getPointName(); - const QString typeLine = dialogTool->getTypeLine(); - QString formulaAngle = dialogTool->getAngle(); - const quint32 basePointId = dialogTool->getBasePointId(); - const quint32 firstPointId = dialogTool->getFirstPointId(); - const quint32 secondPointId = dialogTool->getSecondPointId(); + const QString typeLine = dialogTool->GetTypeLine(); + const QString lineColor = dialogTool->GetLineColor(); + QString formulaAngle = dialogTool->GetAngle(); + const quint32 basePointId = dialogTool->GetBasePointId(); + const quint32 firstPointId = dialogTool->GetFirstPointId(); + const quint32 secondPointId = dialogTool->GetSecondPointId(); VToolLineIntersectAxis *point = nullptr; - point=Create(0, pointName, typeLine, formulaAngle, basePointId, firstPointId, secondPointId, 5, 10, scene, doc, - data, Document::FullParse, Source::FromGui); + point=Create(0, pointName, typeLine, lineColor, formulaAngle, basePointId, firstPointId, secondPointId, 5, 10, + scene, doc, data, Document::FullParse, Source::FromGui); if (point != nullptr) { point->dialog=dialogTool; @@ -101,11 +103,12 @@ VToolLineIntersectAxis *VToolLineIntersectAxis::Create(DialogTool *dialog, VMain //--------------------------------------------------------------------------------------------------------------------- VToolLineIntersectAxis *VToolLineIntersectAxis::Create(const quint32 _id, const QString &pointName, - const QString &typeLine, QString &formulaAngle, - const quint32 &basePointId, const quint32 &firstPointId, - const quint32 &secondPointId, const qreal &mx, const qreal &my, - VMainGraphicsScene *scene, VPattern *doc, VContainer *data, - const Document &parse, const Source &typeCreation) + const QString &typeLine, const QString &lineColor, + QString &formulaAngle, const quint32 &basePointId, + const quint32 &firstPointId, const quint32 &secondPointId, + const qreal &mx, const qreal &my, VMainGraphicsScene *scene, + VPattern *doc, VContainer *data, const Document &parse, + const Source &typeCreation) { const QSharedPointer basePoint = data->GeometricObject(basePointId); QLineF axis = QLineF(basePoint->toQPointF(), QPointF(basePoint->x()+100, basePoint->y())); @@ -138,13 +141,13 @@ VToolLineIntersectAxis *VToolLineIntersectAxis::Create(const quint32 _id, const VDrawTool::AddRecord(id, Tool::LineIntersectAxis, doc); if (parse == Document::FullParse) { - VToolLineIntersectAxis *point = new VToolLineIntersectAxis(doc, data, id, typeLine, formulaAngle, + VToolLineIntersectAxis *point = new VToolLineIntersectAxis(doc, data, id, typeLine, lineColor, formulaAngle, basePointId, firstPointId, secondPointId, typeCreation); scene->addItem(point); connect(point, &VToolPoint::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); - connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolPoint::SetFactor); - connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolPoint::Disable); + connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolLineIntersectAxis::SetFactor); + connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolLineIntersectAxis::Disable); doc->AddTool(id, point); doc->IncrementReferens(basePointId); doc->IncrementReferens(firstPointId); @@ -170,7 +173,7 @@ QPointF VToolLineIntersectAxis::FindPoint(const QLineF &axis, const QLineF &line } //--------------------------------------------------------------------------------------------------------------------- -VFormula VToolLineIntersectAxis::getFormulaAngle() const +VFormula VToolLineIntersectAxis::GetFormulaAngle() const { VFormula fAngle(formulaAngle, getData()); fAngle.setCheckZero(false); @@ -180,11 +183,11 @@ VFormula VToolLineIntersectAxis::getFormulaAngle() const } //--------------------------------------------------------------------------------------------------------------------- -void VToolLineIntersectAxis::setFormulaAngle(const VFormula &value) +void VToolLineIntersectAxis::SetFormulaAngle(const VFormula &value) { if (value.error() == false) { - formulaAngle = value.getFormula(FormulaType::FromUser); + formulaAngle = value.GetFormula(FormulaType::FromUser); QSharedPointer obj = VAbstractTool::data.GetGObject(id); SaveOption(obj); @@ -192,13 +195,13 @@ void VToolLineIntersectAxis::setFormulaAngle(const VFormula &value) } //--------------------------------------------------------------------------------------------------------------------- -quint32 VToolLineIntersectAxis::getFirstPointId() const +quint32 VToolLineIntersectAxis::GetFirstPointId() const { return firstPointId; } //--------------------------------------------------------------------------------------------------------------------- -void VToolLineIntersectAxis::setFirstPointId(const quint32 &value) +void VToolLineIntersectAxis::SetFirstPointId(const quint32 &value) { if (value != NULL_ID) { @@ -210,13 +213,13 @@ void VToolLineIntersectAxis::setFirstPointId(const quint32 &value) } //--------------------------------------------------------------------------------------------------------------------- -quint32 VToolLineIntersectAxis::getSecondPointId() const +quint32 VToolLineIntersectAxis::GetSecondPointId() const { return secondPointId; } //--------------------------------------------------------------------------------------------------------------------- -void VToolLineIntersectAxis::setSecondPointId(const quint32 &value) +void VToolLineIntersectAxis::SetSecondPointId(const quint32 &value) { if (value != NULL_ID) { @@ -242,8 +245,8 @@ void VToolLineIntersectAxis::ShowVisualization(bool show) visual->setPoint1Id(firstPointId); visual->setPoint2Id(secondPointId); visual->setAxisPointId(basePointId); - visual->setAngle(qApp->FormulaToUser(formulaAngle)); - visual->setLineStyle(VAbstractTool::LineStyle(typeLine)); + visual->SetAngle(qApp->FormulaToUser(formulaAngle)); + visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); vis = visual; } @@ -266,15 +269,7 @@ void VToolLineIntersectAxis::ShowVisualization(bool show) //--------------------------------------------------------------------------------------------------------------------- void VToolLineIntersectAxis::FullUpdateFromFile() { - QDomElement domElement = doc->elementById(QString().setNum(id)); - if (domElement.isElement()) - { - typeLine = domElement.attribute(AttrTypeLine, ""); - basePointId = domElement.attribute(AttrBasePoint, "").toUInt(); - firstPointId = domElement.attribute(AttrP1Line, "").toUInt(); - secondPointId = domElement.attribute(AttrP2Line, "").toUInt(); - formulaAngle = domElement.attribute(AttrAngle, ""); - } + ReadAttributes(); RefreshGeometry(); if (vis != nullptr) @@ -283,8 +278,8 @@ void VToolLineIntersectAxis::FullUpdateFromFile() visual->setPoint1Id(firstPointId); visual->setPoint2Id(secondPointId); visual->setAxisPointId(basePointId); - visual->setAngle(qApp->FormulaToUser(formulaAngle)); - visual->setLineStyle(VAbstractTool::LineStyle(typeLine)); + visual->SetAngle(qApp->FormulaToUser(formulaAngle)); + visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); } } @@ -308,11 +303,12 @@ void VToolLineIntersectAxis::SaveDialog(QDomElement &domElement) DialogLineIntersectAxis *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); - doc->SetAttribute(domElement, AttrTypeLine, dialogTool->getTypeLine()); - doc->SetAttribute(domElement, AttrAngle, dialogTool->getAngle()); - doc->SetAttribute(domElement, AttrBasePoint, QString().setNum(dialogTool->getBasePointId())); - doc->SetAttribute(domElement, AttrP1Line, QString().setNum(dialogTool->getFirstPointId())); - doc->SetAttribute(domElement, AttrP2Line, QString().setNum(dialogTool->getSecondPointId())); + doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine()); + doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor()); + doc->SetAttribute(domElement, AttrAngle, dialogTool->GetAngle()); + doc->SetAttribute(domElement, AttrBasePoint, QString().setNum(dialogTool->GetBasePointId())); + doc->SetAttribute(domElement, AttrP1Line, QString().setNum(dialogTool->GetFirstPointId())); + doc->SetAttribute(domElement, AttrP2Line, QString().setNum(dialogTool->GetSecondPointId())); } //--------------------------------------------------------------------------------------------------------------------- @@ -328,8 +324,20 @@ void VToolLineIntersectAxis::SaveOptions(QDomElement &tag, QSharedPointerSetAttribute(tag, AttrMy, qApp->fromPixel(point->my())); doc->SetAttribute(tag, AttrTypeLine, typeLine); + doc->SetAttribute(tag, AttrLineColor, lineColor); doc->SetAttribute(tag, AttrAngle, formulaAngle); doc->SetAttribute(tag, AttrBasePoint, basePointId); doc->SetAttribute(tag, AttrP1Line, firstPointId); doc->SetAttribute(tag, AttrP2Line, secondPointId); } + +//--------------------------------------------------------------------------------------------------------------------- +void VToolLineIntersectAxis::ReadToolAttributes(const QDomElement &domElement) +{ + typeLine = doc->GetParametrString(domElement, AttrTypeLine, TypeLineLine); + lineColor = doc->GetParametrString(domElement, AttrLineColor, ColorBlack); + basePointId = doc->GetParametrUInt(domElement, AttrBasePoint, NULL_ID_STR); + firstPointId = doc->GetParametrUInt(domElement, AttrP1Line, NULL_ID_STR); + secondPointId = doc->GetParametrUInt(domElement, AttrP2Line, NULL_ID_STR); + formulaAngle = doc->GetParametrString(domElement, AttrAngle, ""); +} diff --git a/src/app/tools/drawTools/vtoollineintersectaxis.h b/src/app/tools/drawTools/vtoollineintersectaxis.h index b7ddb00d7..8db43bb49 100644 --- a/src/app/tools/drawTools/vtoollineintersectaxis.h +++ b/src/app/tools/drawTools/vtoollineintersectaxis.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -36,15 +36,16 @@ class VToolLineIntersectAxis : public VToolLinePoint Q_OBJECT public: VToolLineIntersectAxis(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, - const QString &formulaAngle, const quint32 &basePointId, const quint32 &firstPointId, - const quint32 &secondPointId, const Source &typeCreation, QGraphicsItem * parent = nullptr); + const QString &lineColor, const QString &formulaAngle, const quint32 &basePointId, + const quint32 &firstPointId, const quint32 &secondPointId, const Source &typeCreation, + QGraphicsItem * parent = nullptr); virtual ~VToolLineIntersectAxis(); virtual void setDialog(); static VToolLineIntersectAxis *Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data); static VToolLineIntersectAxis *Create(const quint32 _id, const QString &pointName, const QString &typeLine, - QString &formulaAngle, const quint32 &basePointId, + const QString &lineColor, QString &formulaAngle, const quint32 &basePointId, const quint32 &firstPointId, const quint32 &secondPointId, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation); @@ -55,14 +56,14 @@ public: virtual int type() const {return Type;} enum { Type = UserType + static_cast(Tool::LineIntersectAxis)}; - VFormula getFormulaAngle() const; - void setFormulaAngle(const VFormula &value); + VFormula GetFormulaAngle() const; + void SetFormulaAngle(const VFormula &value); - quint32 getFirstPointId() const; - void setFirstPointId(const quint32 &value); + quint32 GetFirstPointId() const; + void SetFirstPointId(const quint32 &value); - quint32 getSecondPointId() const; - void setSecondPointId(const quint32 &value); + quint32 GetSecondPointId() const; + void SetSecondPointId(const quint32 &value); virtual void ShowVisualization(bool show); public slots: @@ -72,6 +73,7 @@ protected: virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event ); virtual void SaveDialog(QDomElement &domElement); virtual void SaveOptions(QDomElement &tag, QSharedPointer &obj); + virtual void ReadToolAttributes(const QDomElement &domElement); private: Q_DISABLE_COPY(VToolLineIntersectAxis) QString formulaAngle; diff --git a/src/app/tools/drawTools/vtoollinepoint.cpp b/src/app/tools/drawTools/vtoollinepoint.cpp index 67983917c..ba52aad1b 100644 --- a/src/app/tools/drawTools/vtoollinepoint.cpp +++ b/src/app/tools/drawTools/vtoollinepoint.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -36,23 +36,25 @@ * @param data container with variables. * @param id object id in container. * @param typeLine line type. + * @param lineColor line color. * @param formula string with length formula. * @param basePointId id base line point. * @param angle line angle. * @param parent parent object. */ -VToolLinePoint::VToolLinePoint(VPattern *doc, VContainer *data, const quint32 &id, - const QString &typeLine, const QString &formula, const quint32 &basePointId, +VToolLinePoint::VToolLinePoint(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, + const QString &lineColor, const QString &formula, const quint32 &basePointId, const qreal &angle, QGraphicsItem *parent) - :VToolPoint(doc, data, id, parent), formulaLength(formula), angle(angle), basePointId(basePointId), + :VToolPoint(doc, data, id, parent), formulaLength(formula), angle(angle), basePointId(basePointId), mainLine(nullptr) { this->typeLine = typeLine; + this->lineColor = lineColor; Q_ASSERT_X(basePointId > 0, Q_FUNC_INFO, "basePointId <= 0"); QPointF point1 = data->GeometricObject(basePointId)->toQPointF(); QPointF point2 = data->GeometricObject(id)->toQPointF(); mainLine = new QGraphicsLineItem(QLineF(point1 - point2, QPointF()), this); - mainLine->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthHairLine())/factor, LineStyle(typeLine))); + mainLine->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthHairLine())/factor, LineStyleToPenStyle(typeLine))); mainLine->setFlag(QGraphicsItem::ItemStacksBehindParent, true); } @@ -69,9 +71,7 @@ VToolLinePoint::~VToolLinePoint() */ void VToolLinePoint::ChangedActivDraw(const QString &newName) { - VToolPoint::ChangedActivDraw(newName); - this->setEnabled(nameActivDraw == newName); - mainLine->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor, LineStyle(typeLine))); + Disable(!(nameActivDraw == newName)); } //--------------------------------------------------------------------------------------------------------------------- @@ -80,7 +80,8 @@ void VToolLinePoint::ChangedActivDraw(const QString &newName) */ void VToolLinePoint::RefreshGeometry() { - mainLine->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor, LineStyle(typeLine))); + mainLine->setPen(QPen(CorrectColor(QColor(lineColor)), qApp->toPixel(qApp->widthHairLine())/factor, + LineStyleToPenStyle(typeLine))); VToolPoint::RefreshPointGeometry(*VDrawTool::data.GeometricObject(id)); QPointF point = VDrawTool::data.GeometricObject(id)->toQPointF(); QPointF basePoint = VDrawTool::data.GeometricObject(basePointId)->toQPointF(); @@ -108,13 +109,22 @@ void VToolLinePoint::SetFactor(qreal factor) } //--------------------------------------------------------------------------------------------------------------------- -qreal VToolLinePoint::getAngle() const +void VToolLinePoint::Disable(bool disable) +{ + VToolPoint::Disable(disable); + mainLine->setPen(QPen(QColor(lineColor), qApp->toPixel(qApp->widthHairLine())/factor, + LineStyleToPenStyle(typeLine))); + mainLine->setEnabled(enabled); +} + +//--------------------------------------------------------------------------------------------------------------------- +qreal VToolLinePoint::GetAngle() const { return angle; } //--------------------------------------------------------------------------------------------------------------------- -void VToolLinePoint::setAngle(const qreal &value) +void VToolLinePoint::SetAngle(const qreal &value) { angle = value; QSharedPointer obj = VAbstractTool::data.GetGObject(id); @@ -122,13 +132,13 @@ void VToolLinePoint::setAngle(const qreal &value) } //--------------------------------------------------------------------------------------------------------------------- -quint32 VToolLinePoint::getBasePointId() const +quint32 VToolLinePoint::GetBasePointId() const { return basePointId; } //--------------------------------------------------------------------------------------------------------------------- -void VToolLinePoint::setBasePointId(const quint32 &value) +void VToolLinePoint::SetBasePointId(const quint32 &value) { if (value != NULL_ID) { @@ -140,7 +150,7 @@ void VToolLinePoint::setBasePointId(const quint32 &value) } //--------------------------------------------------------------------------------------------------------------------- -VFormula VToolLinePoint::getFormulaLength() const +VFormula VToolLinePoint::GetFormulaLength() const { VFormula fLength(formulaLength, this->getData()); fLength.setCheckZero(true); @@ -151,11 +161,11 @@ VFormula VToolLinePoint::getFormulaLength() const } //--------------------------------------------------------------------------------------------------------------------- -void VToolLinePoint::setFormulaLength(const VFormula &value) +void VToolLinePoint::SetFormulaLength(const VFormula &value) { if (value.error() == false) { - formulaLength = value.getFormula(FormulaType::FromUser); + formulaLength = value.GetFormula(FormulaType::FromUser); QSharedPointer obj = VAbstractTool::data.GetGObject(id); SaveOption(obj); diff --git a/src/app/tools/drawTools/vtoollinepoint.h b/src/app/tools/drawTools/vtoollinepoint.h index 3c29e248e..073d4b9c0 100644 --- a/src/app/tools/drawTools/vtoollinepoint.h +++ b/src/app/tools/drawTools/vtoollinepoint.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -39,23 +39,24 @@ class VToolLinePoint : public VToolPoint { Q_OBJECT public: - VToolLinePoint(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const QString &formula, + VToolLinePoint(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const QString &lineColor, const QString &formula, const quint32 &basePointId, const qreal &angle, QGraphicsItem * parent = nullptr); virtual ~VToolLinePoint(); virtual int type() const {return Type;} enum { Type = UserType + static_cast(Tool::LinePoint)}; - VFormula getFormulaLength() const; - void setFormulaLength(const VFormula &value); + VFormula GetFormulaLength() const; + void SetFormulaLength(const VFormula &value); - quint32 getBasePointId() const; - void setBasePointId(const quint32 &value); + quint32 GetBasePointId() const; + void SetBasePointId(const quint32 &value); - qreal getAngle() const; - void setAngle(const qreal &value); + qreal GetAngle() const; + void SetAngle(const qreal &value); public slots: virtual void ChangedActivDraw(const QString &newName); virtual void SetFactor(qreal factor); + void Disable(bool disable); protected: /** @brief formula string with length formula. */ QString formulaLength; diff --git a/src/app/tools/drawTools/vtoolnormal.cpp b/src/app/tools/drawTools/vtoolnormal.cpp index abf347a7f..61107598e 100644 --- a/src/app/tools/drawTools/vtoolnormal.cpp +++ b/src/app/tools/drawTools/vtoolnormal.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -49,9 +49,10 @@ const QString VToolNormal::ToolType = QStringLiteral("normal"); * @param parent parent object. */ VToolNormal::VToolNormal(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, - const QString &formula, const qreal &angle, const quint32 &firstPointId, - const quint32 &secondPointId, const Source &typeCreation, QGraphicsItem *parent) - :VToolLinePoint(doc, data, id, typeLine, formula, firstPointId, angle, parent), + const QString &lineColor, const QString &formula, const qreal &angle, + const quint32 &firstPointId, const quint32 &secondPointId, const Source &typeCreation, + QGraphicsItem *parent) + :VToolLinePoint(doc, data, id, typeLine, lineColor, formula, firstPointId, angle, parent), secondPointId(secondPointId) { @@ -75,12 +76,12 @@ void VToolNormal::setDialog() DialogNormal *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); const QSharedPointer p = VAbstractTool::data.GeometricObject(id); - dialogTool->setTypeLine(typeLine); - dialogTool->setFormula(formulaLength); - dialogTool->setAngle(angle); - dialogTool->setFirstPointId(basePointId); - dialogTool->setSecondPointId(secondPointId); - dialogTool->setPointName(p->name()); + dialogTool->SetTypeLine(typeLine); + dialogTool->SetFormula(formulaLength); + dialogTool->SetAngle(angle); + dialogTool->SetFirstPointId(basePointId); + dialogTool->SetSecondPointId(secondPointId); + dialogTool->SetPointName(p->name()); } //--------------------------------------------------------------------------------------------------------------------- @@ -96,15 +97,16 @@ VToolNormal* VToolNormal::Create(DialogTool *dialog, VMainGraphicsScene *scene, SCASSERT(dialog != nullptr); DialogNormal *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); - QString formula = dialogTool->getFormula(); - const quint32 firstPointId = dialogTool->getFirstPointId(); - const quint32 secondPointId = dialogTool->getSecondPointId(); - const QString typeLine = dialogTool->getTypeLine(); + QString formula = dialogTool->GetFormula(); + const quint32 firstPointId = dialogTool->GetFirstPointId(); + const quint32 secondPointId = dialogTool->GetSecondPointId(); + const QString typeLine = dialogTool->GetTypeLine(); + const QString lineColor = dialogTool->GetLineColor(); const QString pointName = dialogTool->getPointName(); - const qreal angle = dialogTool->getAngle(); + const qreal angle = dialogTool->GetAngle(); VToolNormal *point = nullptr; - point=Create(0, formula, firstPointId, secondPointId, typeLine, pointName, angle, 5, 10, scene, doc, data, - Document::FullParse, Source::FromGui); + point=Create(0, formula, firstPointId, secondPointId, typeLine, lineColor, pointName, angle, 5, 10, scene, doc, + data, Document::FullParse, Source::FromGui); if (point != nullptr) { point->dialog=dialogTool; @@ -131,10 +133,10 @@ VToolNormal* VToolNormal::Create(DialogTool *dialog, VMainGraphicsScene *scene, * @param typeCreation way we create this tool. */ VToolNormal* VToolNormal::Create(const quint32 _id, QString &formula, const quint32 &firstPointId, - const quint32 &secondPointId, const QString &typeLine, const QString &pointName, - const qreal angle, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, - VPattern *doc, VContainer *data, const Document &parse, - const Source &typeCreation) + const quint32 &secondPointId, const QString &typeLine, const QString &lineColor, + const QString &pointName, const qreal angle, const qreal &mx, const qreal &my, + VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse, + const Source &typeCreation) { const QSharedPointer firstPoint = data->GeometricObject(firstPointId); const QSharedPointer secondPoint = data->GeometricObject(secondPointId); @@ -161,12 +163,12 @@ VToolNormal* VToolNormal::Create(const quint32 _id, QString &formula, const quin VDrawTool::AddRecord(id, Tool::Normal, doc); if (parse == Document::FullParse) { - VToolNormal *point = new VToolNormal(doc, data, id, typeLine, formula, angle, - firstPointId, secondPointId, typeCreation); + VToolNormal *point = new VToolNormal(doc, data, id, typeLine, lineColor, formula, angle, firstPointId, + secondPointId, typeCreation); scene->addItem(point); connect(point, &VToolNormal::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolNormal::SetFactor); - connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolPoint::Disable); + connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolNormal::Disable); doc->AddTool(id, point); doc->IncrementReferens(firstPointId); doc->IncrementReferens(secondPointId); @@ -200,15 +202,7 @@ QPointF VToolNormal::FindPoint(const QPointF &firstPoint, const QPointF &secondP */ void VToolNormal::FullUpdateFromFile() { - QDomElement domElement = doc->elementById(QString().setNum(id)); - if (domElement.isElement()) - { - typeLine = domElement.attribute(AttrTypeLine, ""); - formulaLength = domElement.attribute(AttrLength, ""); - basePointId = domElement.attribute(AttrFirstPoint, "").toUInt(); - secondPointId = domElement.attribute(AttrSecondPoint, "").toUInt(); - angle = domElement.attribute(AttrAngle, "").toDouble(); - } + ReadAttributes(); RefreshGeometry(); if (vis != nullptr) @@ -217,8 +211,8 @@ void VToolNormal::FullUpdateFromFile() visual->setPoint1Id(basePointId); visual->setPoint2Id(secondPointId); visual->setLength(qApp->FormulaToUser(formulaLength)); - visual->setAngle(angle); - visual->setLineStyle(VAbstractTool::LineStyle(typeLine)); + visual->SetAngle(angle); + visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); } } @@ -274,11 +268,12 @@ void VToolNormal::SaveDialog(QDomElement &domElement) DialogNormal *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); - doc->SetAttribute(domElement, AttrTypeLine, dialogTool->getTypeLine()); - doc->SetAttribute(domElement, AttrLength, dialogTool->getFormula()); - doc->SetAttribute(domElement, AttrAngle, QString().setNum(dialogTool->getAngle())); - doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->getFirstPointId())); - doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->getSecondPointId())); + doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine()); + doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor()); + doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula()); + doc->SetAttribute(domElement, AttrAngle, QString().setNum(dialogTool->GetAngle())); + doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->GetFirstPointId())); + doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->GetSecondPointId())); } //--------------------------------------------------------------------------------------------------------------------- @@ -294,6 +289,7 @@ void VToolNormal::SaveOptions(QDomElement &tag, QSharedPointer &obj) doc->SetAttribute(tag, AttrMy, qApp->fromPixel(point->my())); doc->SetAttribute(tag, AttrTypeLine, typeLine); + doc->SetAttribute(tag, AttrLineColor, lineColor); doc->SetAttribute(tag, AttrLength, formulaLength); doc->SetAttribute(tag, AttrAngle, angle); doc->SetAttribute(tag, AttrFirstPoint, basePointId); @@ -301,13 +297,24 @@ void VToolNormal::SaveOptions(QDomElement &tag, QSharedPointer &obj) } //--------------------------------------------------------------------------------------------------------------------- -quint32 VToolNormal::getSecondPointId() const +void VToolNormal::ReadToolAttributes(const QDomElement &domElement) +{ + typeLine = doc->GetParametrString(domElement, AttrTypeLine, TypeLineLine); + lineColor = doc->GetParametrString(domElement, AttrLineColor, ColorBlack); + formulaLength = doc->GetParametrString(domElement, AttrLength, ""); + basePointId = doc->GetParametrUInt(domElement, AttrFirstPoint, NULL_ID_STR); + secondPointId = doc->GetParametrUInt(domElement, AttrSecondPoint, NULL_ID_STR); + angle = doc->GetParametrDouble(domElement, AttrAngle, "0"); +} + +//--------------------------------------------------------------------------------------------------------------------- +quint32 VToolNormal::GetSecondPointId() const { return secondPointId; } //--------------------------------------------------------------------------------------------------------------------- -void VToolNormal::setSecondPointId(const quint32 &value) +void VToolNormal::SetSecondPointId(const quint32 &value) { if (value != NULL_ID) { @@ -333,8 +340,8 @@ void VToolNormal::ShowVisualization(bool show) visual->setPoint1Id(basePointId); visual->setPoint2Id(secondPointId); visual->setLength(qApp->FormulaToUser(formulaLength)); - visual->setAngle(angle); - visual->setLineStyle(VAbstractTool::LineStyle(typeLine)); + visual->SetAngle(angle); + visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); vis = visual; } diff --git a/src/app/tools/drawTools/vtoolnormal.h b/src/app/tools/drawTools/vtoolnormal.h index 3c85cb439..2752101fd 100644 --- a/src/app/tools/drawTools/vtoolnormal.h +++ b/src/app/tools/drawTools/vtoolnormal.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -38,23 +38,24 @@ class VToolNormal : public VToolLinePoint { Q_OBJECT public: - VToolNormal(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const QString &formula, - const qreal &angle, const quint32 &firstPointId, const quint32 &secondPointId, + VToolNormal(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const QString &lineColor, + const QString &formula, const qreal &angle, const quint32 &firstPointId, const quint32 &secondPointId, const Source &typeCreation, QGraphicsItem * parent = nullptr); virtual void setDialog(); static VToolNormal* Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data); static VToolNormal* Create(const quint32 _id, QString &formula, const quint32 &firstPointId, - const quint32 &secondPointId, const QString &typeLine, const QString &pointName, - const qreal angle, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, - VPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation); + const quint32 &secondPointId, const QString &typeLine, const QString &lineColor, + const QString &pointName, const qreal angle, const qreal &mx, const qreal &my, + VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse, + const Source &typeCreation); static QPointF FindPoint(const QPointF &firstPoint, const QPointF &secondPoint, const qreal &length, const qreal &angle = 0); static const QString ToolType; virtual int type() const {return Type;} enum { Type = UserType + static_cast(Tool::Normal)}; - quint32 getSecondPointId() const; - void setSecondPointId(const quint32 &value); + quint32 GetSecondPointId() const; + void SetSecondPointId(const quint32 &value); virtual void ShowVisualization(bool show); public slots: @@ -66,6 +67,7 @@ protected: virtual void RemoveReferens(); virtual void SaveDialog(QDomElement &domElement); virtual void SaveOptions(QDomElement &tag, QSharedPointer &obj); + virtual void ReadToolAttributes(const QDomElement &domElement); private: /** @brief secondPointId id second line point. */ quint32 secondPointId; diff --git a/src/app/tools/drawTools/vtoolpoint.cpp b/src/app/tools/drawTools/vtoolpoint.cpp index 53025c402..18e6fc444 100644 --- a/src/app/tools/drawTools/vtoolpoint.cpp +++ b/src/app/tools/drawTools/vtoolpoint.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -50,9 +50,7 @@ VToolPoint::VToolPoint(VPattern *doc, VContainer *data, quint32 id, QGraphicsIte namePoint = new VGraphicsSimpleTextItem(this); connect(namePoint, &VGraphicsSimpleTextItem::ShowContextMenu, this, &VToolPoint::ShowContextMenu); connect(namePoint, &VGraphicsSimpleTextItem::DeleteTool, this, &VToolPoint::DeleteFromLabel); - namePoint->setBrush(Qt::black); lineName = new QGraphicsLineItem(this); - lineName->setPen(QPen(Qt::black)); connect(namePoint, &VGraphicsSimpleTextItem::NameChangePosition, this, &VToolPoint::NameChangePosition); this->setBrush(QBrush(Qt::NoBrush)); this->setFlag(QGraphicsItem::ItemIsSelectable, true); @@ -134,23 +132,18 @@ void VToolPoint::UpdateNamePosition(qreal mx, qreal my) */ void VToolPoint::ChangedActivDraw(const QString &newName) { - VDrawTool::ChangedActivDraw(newName); - this->setEnabled(nameActivDraw == newName); - namePoint->setBrush(QBrush(currentColor)); - lineName->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor)); - this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor)); + Disable(!(nameActivDraw == newName)); } //--------------------------------------------------------------------------------------------------------------------- /** * @brief ShowTool highlight tool. * @param id object id in container. - * @param color highlight color. * @param enable enable or disable highlight. */ -void VToolPoint::ShowTool(quint32 id, Qt::GlobalColor color, bool enable) +void VToolPoint::ShowTool(quint32 id, bool enable) { - ShowItem(this, id, color, enable); + ShowItem(this, id, enable); } //--------------------------------------------------------------------------------------------------------------------- @@ -177,7 +170,9 @@ void VToolPoint::ShowContextMenu(QGraphicsSceneContextMenuEvent *event) //--------------------------------------------------------------------------------------------------------------------- void VToolPoint::Disable(bool disable) { - DisableItem(this, disable); + enabled = !disable; + this->setEnabled(enabled); + namePoint->setEnabled(enabled); } //--------------------------------------------------------------------------------------------------------------------- @@ -208,7 +203,7 @@ void VToolPoint::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) void VToolPoint::hoverEnterEvent(QGraphicsSceneHoverEvent *event) { Q_UNUSED(event); - this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthMainLine())/factor)); + this->setPen(QPen(CorrectColor(baseColor), qApp->toPixel(qApp->widthMainLine())/factor)); QGraphicsEllipseItem::hoverEnterEvent(event); } @@ -220,7 +215,8 @@ void VToolPoint::hoverEnterEvent(QGraphicsSceneHoverEvent *event) void VToolPoint::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) { Q_UNUSED(event); - this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor)); + this->setPen(QPen(CorrectColor(baseColor), qApp->toPixel(qApp->widthHairLine())/factor)); + QGraphicsEllipseItem::hoverLeaveEvent(event); } //--------------------------------------------------------------------------------------------------------------------- @@ -231,7 +227,7 @@ void VToolPoint::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) void VToolPoint::RefreshPointGeometry(const VPointF &point) { this->setFlag(QGraphicsItem::ItemSendsGeometryChanges, false); - this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor)); + this->setPen(QPen(CorrectColor(baseColor), qApp->toPixel(qApp->widthHairLine())/factor)); QRectF rec = QRectF(0, 0, radius*2, radius*2); rec.translate(-rec.center().x(), -rec.center().y()); this->setRect(rec); @@ -263,14 +259,7 @@ void VToolPoint::RefreshLine() VGObject::LineIntersectCircle(QPointF(), radius, QLineF(QPointF(), nameRec.center() - scenePos()), p1, p2); QPointF pRec = VGObject::LineIntersectRect(nameRec, QLineF(scenePos(), nameRec.center())); lineName->setLine(QLineF(p1, pRec - scenePos())); - if (currentColor == Qt::gray) - { - lineName->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor)); - } - else - { - lineName->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthHairLine())/factor)); - } + lineName->setPen(QPen(CorrectColor(Qt::black), qApp->toPixel(qApp->widthHairLine())/factor)); if (QLineF(p1, pRec - scenePos()).length() <= qApp->toPixel(4, Unit::Mm)) { @@ -329,3 +318,17 @@ void VToolPoint::keyReleaseEvent(QKeyEvent *event) } QGraphicsEllipseItem::keyReleaseEvent ( event ); } + +//--------------------------------------------------------------------------------------------------------------------- +void VToolPoint::setEnabled(bool enabled) +{ + QGraphicsEllipseItem::setEnabled(enabled); + if (enabled) + { + setPen(QPen(QColor(baseColor), qApp->toPixel(qApp->widthHairLine())/factor)); + } + else + { + setPen(QPen(Qt::gray, qApp->toPixel(qApp->widthHairLine())/factor)); + } +} diff --git a/src/app/tools/drawTools/vtoolpoint.h b/src/app/tools/drawTools/vtoolpoint.h index 218753e31..02c8620d6 100644 --- a/src/app/tools/drawTools/vtoolpoint.h +++ b/src/app/tools/drawTools/vtoolpoint.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -49,10 +49,12 @@ public: void setName(const QString &name); virtual QString getTagName() const; static const QString TagName; + + void setEnabled(bool enabled); public slots: void NameChangePosition(const QPointF &pos); virtual void ChangedActivDraw(const QString &newName); - virtual void ShowTool(quint32 id, Qt::GlobalColor color, bool enable); + virtual void ShowTool(quint32 id, bool enable); virtual void SetFactor(qreal factor); virtual void ShowContextMenu(QGraphicsSceneContextMenuEvent *event); void Disable(bool disable); diff --git a/src/app/tools/drawTools/vtoolpointofcontact.cpp b/src/app/tools/drawTools/vtoolpointofcontact.cpp index 96e4eabe7..cd0663ed5 100644 --- a/src/app/tools/drawTools/vtoolpointofcontact.cpp +++ b/src/app/tools/drawTools/vtoolpointofcontact.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -78,9 +78,9 @@ void VToolPointOfContact::setDialog() const QSharedPointer p = VAbstractTool::data.GeometricObject(id); dialogTool->setRadius(arcRadius); dialogTool->setCenter(center); - dialogTool->setFirstPoint(firstPointId); - dialogTool->setSecondPoint(secondPointId); - dialogTool->setPointName(p->name()); + dialogTool->SetFirstPoint(firstPointId); + dialogTool->SetSecondPoint(secondPointId); + dialogTool->SetPointName(p->name()); } //--------------------------------------------------------------------------------------------------------------------- @@ -138,8 +138,8 @@ VToolPointOfContact* VToolPointOfContact::Create(DialogTool *dialog, VMainGraphi SCASSERT(dialogTool != nullptr); QString radius = dialogTool->getRadius(); const quint32 center = dialogTool->getCenter(); - const quint32 firstPointId = dialogTool->getFirstPoint(); - const quint32 secondPointId = dialogTool->getSecondPoint(); + const quint32 firstPointId = dialogTool->GetFirstPoint(); + const quint32 secondPointId = dialogTool->GetSecondPoint(); const QString pointName = dialogTool->getPointName(); VToolPointOfContact *point = nullptr; point=Create(0, radius, center, firstPointId, secondPointId, pointName, 5, 10, scene, doc, data, @@ -209,7 +209,7 @@ VToolPointOfContact* VToolPointOfContact::Create(const quint32 _id, QString &rad scene->addItem(point); connect(point, &VToolPointOfContact::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolPointOfContact::SetFactor); - connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolPoint::Disable); + connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolPointOfContact::Disable); doc->AddTool(id, point); doc->IncrementReferens(center); doc->IncrementReferens(firstPointId); @@ -225,14 +225,7 @@ VToolPointOfContact* VToolPointOfContact::Create(const quint32 _id, QString &rad */ void VToolPointOfContact::FullUpdateFromFile() { - QDomElement domElement = doc->elementById(QString().setNum(id)); - if (domElement.isElement()) - { - arcRadius = domElement.attribute(AttrRadius, ""); - center = domElement.attribute(AttrCenter, "").toUInt(); - firstPointId = domElement.attribute(AttrFirstPoint, "").toUInt(); - secondPointId = domElement.attribute(AttrSecondPoint, "").toUInt(); - } + ReadAttributes(); RefreshPointGeometry(*VAbstractTool::data.GeometricObject(id)); if (vis != nullptr) @@ -300,8 +293,8 @@ void VToolPointOfContact::SaveDialog(QDomElement &domElement) doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); doc->SetAttribute(domElement, AttrRadius, dialogTool->getRadius()); doc->SetAttribute(domElement, AttrCenter, QString().setNum(dialogTool->getCenter())); - doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->getFirstPoint())); - doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->getSecondPoint())); + doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->GetFirstPoint())); + doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->GetSecondPoint())); } //--------------------------------------------------------------------------------------------------------------------- @@ -323,13 +316,22 @@ void VToolPointOfContact::SaveOptions(QDomElement &tag, QSharedPointer } //--------------------------------------------------------------------------------------------------------------------- -quint32 VToolPointOfContact::getSecondPointId() const +void VToolPointOfContact::ReadToolAttributes(const QDomElement &domElement) +{ + arcRadius = doc->GetParametrString(domElement, AttrRadius, ""); + center = doc->GetParametrUInt(domElement, AttrCenter, NULL_ID_STR); + firstPointId = doc->GetParametrUInt(domElement, AttrFirstPoint, NULL_ID_STR); + secondPointId = doc->GetParametrUInt(domElement, AttrSecondPoint, NULL_ID_STR); +} + +//--------------------------------------------------------------------------------------------------------------------- +quint32 VToolPointOfContact::GetSecondPointId() const { return secondPointId; } //--------------------------------------------------------------------------------------------------------------------- -void VToolPointOfContact::setSecondPointId(const quint32 &value) +void VToolPointOfContact::SetSecondPointId(const quint32 &value) { secondPointId = value; } @@ -370,13 +372,13 @@ void VToolPointOfContact::ShowVisualization(bool show) } //--------------------------------------------------------------------------------------------------------------------- -quint32 VToolPointOfContact::getFirstPointId() const +quint32 VToolPointOfContact::GetFirstPointId() const { return firstPointId; } //--------------------------------------------------------------------------------------------------------------------- -void VToolPointOfContact::setFirstPointId(const quint32 &value) +void VToolPointOfContact::SetFirstPointId(const quint32 &value) { firstPointId = value; } @@ -415,7 +417,7 @@ void VToolPointOfContact::setArcRadius(const VFormula &value) { if (value.error() == false) { - arcRadius = value.getFormula(FormulaType::FromUser); + arcRadius = value.GetFormula(FormulaType::FromUser); QSharedPointer obj = VAbstractTool::data.GetGObject(id); SaveOption(obj); diff --git a/src/app/tools/drawTools/vtoolpointofcontact.h b/src/app/tools/drawTools/vtoolpointofcontact.h index 1cbc84815..f47b044cf 100644 --- a/src/app/tools/drawTools/vtoolpointofcontact.h +++ b/src/app/tools/drawTools/vtoolpointofcontact.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -62,11 +62,11 @@ public: quint32 getCenter() const; void setCenter(const quint32 &value); - quint32 getFirstPointId() const; - void setFirstPointId(const quint32 &value); + quint32 GetFirstPointId() const; + void SetFirstPointId(const quint32 &value); - quint32 getSecondPointId() const; - void setSecondPointId(const quint32 &value); + quint32 GetSecondPointId() const; + void SetSecondPointId(const quint32 &value); virtual void ShowVisualization(bool show); public slots: @@ -78,6 +78,7 @@ protected: virtual void RemoveReferens(); virtual void SaveDialog(QDomElement &domElement); virtual void SaveOptions(QDomElement &tag, QSharedPointer &obj); + virtual void ReadToolAttributes(const QDomElement &domElement); private: /** @brief radius string with formula radius arc. */ QString arcRadius; diff --git a/src/app/tools/drawTools/vtoolpointofintersection.cpp b/src/app/tools/drawTools/vtoolpointofintersection.cpp index 52ef71132..7f3eeb903 100644 --- a/src/app/tools/drawTools/vtoolpointofintersection.cpp +++ b/src/app/tools/drawTools/vtoolpointofintersection.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -70,9 +70,9 @@ void VToolPointOfIntersection::setDialog() DialogPointOfIntersection *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); const QSharedPointer p = VAbstractTool::data.GeometricObject(id); - dialogTool->setFirstPointId(firstPointId); - dialogTool->setSecondPointId(secondPointId); - dialogTool->setPointName(p->name()); + dialogTool->SetFirstPointId(firstPointId); + dialogTool->SetSecondPointId(secondPointId); + dialogTool->SetPointName(p->name()); } //--------------------------------------------------------------------------------------------------------------------- @@ -90,8 +90,8 @@ VToolPointOfIntersection *VToolPointOfIntersection::Create(DialogTool *dialog, V SCASSERT(dialog != nullptr); DialogPointOfIntersection *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); - const quint32 firstPointId = dialogTool->getFirstPointId(); - const quint32 secondPointId = dialogTool->getSecondPointId(); + const quint32 firstPointId = dialogTool->GetFirstPointId(); + const quint32 secondPointId = dialogTool->GetSecondPointId(); const QString pointName = dialogTool->getPointName(); VToolPointOfIntersection *point = nullptr; point = Create(0, pointName, firstPointId, secondPointId, 5, 10, scene, doc, data, Document::FullParse, @@ -150,7 +150,7 @@ VToolPointOfIntersection *VToolPointOfIntersection::Create(const quint32 _id, co scene->addItem(point); connect(point, &VToolPointOfIntersection::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolPointOfIntersection::SetFactor); - connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolPoint::Disable); + connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolPointOfIntersection::Disable); doc->AddTool(id, point); doc->IncrementReferens(firstPointId); doc->IncrementReferens(secondPointId); @@ -165,12 +165,7 @@ VToolPointOfIntersection *VToolPointOfIntersection::Create(const quint32 _id, co */ void VToolPointOfIntersection::FullUpdateFromFile() { - QDomElement domElement = doc->elementById(QString().setNum(id)); - if (domElement.isElement()) - { - firstPointId = domElement.attribute(AttrFirstPoint, "").toUInt(); - secondPointId = domElement.attribute(AttrSecondPoint, "").toUInt(); - } + ReadAttributes(); VToolPoint::RefreshPointGeometry(*VDrawTool::data.GeometricObject(id)); if (vis != nullptr) @@ -222,8 +217,8 @@ void VToolPointOfIntersection::SaveDialog(QDomElement &domElement) DialogPointOfIntersection *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); - doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->getFirstPointId())); - doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->getSecondPointId())); + doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->GetFirstPointId())); + doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->GetSecondPointId())); } //--------------------------------------------------------------------------------------------------------------------- @@ -243,13 +238,20 @@ void VToolPointOfIntersection::SaveOptions(QDomElement &tag, QSharedPointerGetParametrUInt(domElement, AttrFirstPoint, NULL_ID_STR); + secondPointId = doc->GetParametrUInt(domElement, AttrSecondPoint, NULL_ID_STR); +} + +//--------------------------------------------------------------------------------------------------------------------- +quint32 VToolPointOfIntersection::GetSecondPointId() const { return secondPointId; } //--------------------------------------------------------------------------------------------------------------------- -void VToolPointOfIntersection::setSecondPointId(const quint32 &value) +void VToolPointOfIntersection::SetSecondPointId(const quint32 &value) { if (value != NULL_ID) { @@ -294,13 +296,13 @@ void VToolPointOfIntersection::ShowVisualization(bool show) } //--------------------------------------------------------------------------------------------------------------------- -quint32 VToolPointOfIntersection::getFirstPointId() const +quint32 VToolPointOfIntersection::GetFirstPointId() const { return firstPointId; } //--------------------------------------------------------------------------------------------------------------------- -void VToolPointOfIntersection::setFirstPointId(const quint32 &value) +void VToolPointOfIntersection::SetFirstPointId(const quint32 &value) { if (value != NULL_ID) { diff --git a/src/app/tools/drawTools/vtoolpointofintersection.h b/src/app/tools/drawTools/vtoolpointofintersection.h index 80e2980de..751a88c75 100644 --- a/src/app/tools/drawTools/vtoolpointofintersection.h +++ b/src/app/tools/drawTools/vtoolpointofintersection.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -52,11 +52,11 @@ public: virtual int type() const {return Type;} enum { Type = UserType + static_cast(Tool::PointOfIntersection) }; - quint32 getFirstPointId() const; - void setFirstPointId(const quint32 &value); + quint32 GetFirstPointId() const; + void SetFirstPointId(const quint32 &value); - quint32 getSecondPointId() const; - void setSecondPointId(const quint32 &value); + quint32 GetSecondPointId() const; + void SetSecondPointId(const quint32 &value); virtual void ShowVisualization(bool show); public slots: @@ -67,6 +67,7 @@ protected: virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event ); virtual void SaveDialog(QDomElement &domElement); virtual void SaveOptions(QDomElement &tag, QSharedPointer &obj); + virtual void ReadToolAttributes(const QDomElement &domElement); private: Q_DISABLE_COPY(VToolPointOfIntersection) /** @brief firstPointId id first line point. */ diff --git a/src/app/tools/drawTools/vtoolshoulderpoint.cpp b/src/app/tools/drawTools/vtoolshoulderpoint.cpp index 33d29bae5..00744a5c9 100644 --- a/src/app/tools/drawTools/vtoolshoulderpoint.cpp +++ b/src/app/tools/drawTools/vtoolshoulderpoint.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -49,10 +49,11 @@ const QString VToolShoulderPoint::ToolType = QStringLiteral("shoulder"); * @param parent parent object. */ VToolShoulderPoint::VToolShoulderPoint(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, - const QString &formula, const quint32 &p1Line, const quint32 &p2Line, - const quint32 &pShoulder, const Source &typeCreation, + const QString &lineColor, const QString &formula, const quint32 &p1Line, + const quint32 &p2Line, const quint32 &pShoulder, const Source &typeCreation, QGraphicsItem * parent) - :VToolLinePoint(doc, data, id, typeLine, formula, p1Line, 0, parent), p2Line(p2Line), pShoulder(pShoulder) + :VToolLinePoint(doc, data, id, typeLine, lineColor, formula, p1Line, 0, parent), p2Line(p2Line), + pShoulder(pShoulder) { if (typeCreation == Source::FromGui) { @@ -74,12 +75,13 @@ void VToolShoulderPoint::setDialog() DialogShoulderPoint *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); const QSharedPointer p = VAbstractTool::data.GeometricObject(id); - dialogTool->setTypeLine(typeLine); - dialogTool->setFormula(formulaLength); - dialogTool->setP1Line(basePointId); - dialogTool->setP2Line(p2Line); - dialogTool->setP3(pShoulder); - dialogTool->setPointName(p->name()); + dialogTool->SetTypeLine(typeLine); + dialogTool->SetLineColor(lineColor); + dialogTool->SetFormula(formulaLength); + dialogTool->SetP1Line(basePointId); + dialogTool->SetP2Line(p2Line); + dialogTool->SetP3(pShoulder); + dialogTool->SetPointName(p->name()); } //--------------------------------------------------------------------------------------------------------------------- @@ -134,15 +136,16 @@ VToolShoulderPoint* VToolShoulderPoint::Create(DialogTool *dialog, VMainGraphics SCASSERT(dialog != nullptr); DialogShoulderPoint *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool); - QString formula = dialogTool->getFormula(); - const quint32 p1Line = dialogTool->getP1Line(); - const quint32 p2Line = dialogTool->getP2Line(); - const quint32 pShoulder = dialogTool->getP3(); - const QString typeLine = dialogTool->getTypeLine(); + QString formula = dialogTool->GetFormula(); + const quint32 p1Line = dialogTool->GetP1Line(); + const quint32 p2Line = dialogTool->GetP2Line(); + const quint32 pShoulder = dialogTool->GetP3(); + const QString typeLine = dialogTool->GetTypeLine(); + const QString lineColor = dialogTool->GetLineColor(); const QString pointName = dialogTool->getPointName(); VToolShoulderPoint * point = nullptr; - point=Create(0, formula, p1Line, p2Line, pShoulder, typeLine, pointName, 5, 10, scene, doc, data, - Document::FullParse, Source::FromGui); + point=Create(0, formula, p1Line, p2Line, pShoulder, typeLine, lineColor, pointName, 5, 10, scene, doc, data, + Document::FullParse, Source::FromGui); if (point != nullptr) { point->dialog=dialogTool; @@ -170,7 +173,7 @@ VToolShoulderPoint* VToolShoulderPoint::Create(DialogTool *dialog, VMainGraphics * @return the created tool */ VToolShoulderPoint* VToolShoulderPoint::Create(const quint32 _id, QString &formula, const quint32 &p1Line, - const quint32 &p2Line, const quint32 &pShoulder, const QString &typeLine, + const quint32 &p2Line, const quint32 &pShoulder, const QString &typeLine, const QString &lineColor, const QString &pointName, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation) @@ -203,13 +206,13 @@ VToolShoulderPoint* VToolShoulderPoint::Create(const quint32 _id, QString &formu VDrawTool::AddRecord(id, Tool::ShoulderPoint, doc); if (parse == Document::FullParse) { - VToolShoulderPoint *point = new VToolShoulderPoint(doc, data, id, typeLine, formula, + VToolShoulderPoint *point = new VToolShoulderPoint(doc, data, id, typeLine, lineColor, formula, p1Line, p2Line, pShoulder, typeCreation); scene->addItem(point); connect(point, &VToolShoulderPoint::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolShoulderPoint::SetFactor); - connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolPoint::Disable); + connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolShoulderPoint::Disable); doc->AddTool(id, point); doc->IncrementReferens(p1Line); doc->IncrementReferens(p2Line); @@ -225,15 +228,7 @@ VToolShoulderPoint* VToolShoulderPoint::Create(const quint32 _id, QString &formu */ void VToolShoulderPoint::FullUpdateFromFile() { - QDomElement domElement = doc->elementById(QString().setNum(id)); - if (domElement.isElement()) - { - typeLine = domElement.attribute(AttrTypeLine, ""); - formulaLength = domElement.attribute(AttrLength, ""); - basePointId = domElement.attribute(AttrP1Line, "").toUInt(); - p2Line = domElement.attribute(AttrP2Line, "").toUInt(); - pShoulder = domElement.attribute(AttrPShoulder, "").toUInt(); - } + ReadAttributes(); RefreshGeometry(); if (vis != nullptr) @@ -243,7 +238,7 @@ void VToolShoulderPoint::FullUpdateFromFile() visual->setLineP1Id(basePointId); visual->setLineP2Id(p2Line); visual->setLength(qApp->FormulaToUser(formulaLength)); - visual->setLineStyle(VAbstractTool::LineStyle(typeLine)); + visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); } } @@ -300,11 +295,12 @@ void VToolShoulderPoint::SaveDialog(QDomElement &domElement) DialogShoulderPoint *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); - doc->SetAttribute(domElement, AttrTypeLine, dialogTool->getTypeLine()); - doc->SetAttribute(domElement, AttrLength, dialogTool->getFormula()); - doc->SetAttribute(domElement, AttrP1Line, QString().setNum(dialogTool->getP1Line())); - doc->SetAttribute(domElement, AttrP2Line, QString().setNum(dialogTool->getP2Line())); - doc->SetAttribute(domElement, AttrPShoulder, QString().setNum(dialogTool->getP3())); + doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine()); + doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor()); + doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula()); + doc->SetAttribute(domElement, AttrP1Line, QString().setNum(dialogTool->GetP1Line())); + doc->SetAttribute(domElement, AttrP2Line, QString().setNum(dialogTool->GetP2Line())); + doc->SetAttribute(domElement, AttrPShoulder, QString().setNum(dialogTool->GetP3())); } //--------------------------------------------------------------------------------------------------------------------- @@ -320,12 +316,24 @@ void VToolShoulderPoint::SaveOptions(QDomElement &tag, QSharedPointer doc->SetAttribute(tag, AttrMy, qApp->fromPixel(point->my())); doc->SetAttribute(tag, AttrTypeLine, typeLine); + doc->SetAttribute(tag, AttrLineColor, lineColor); doc->SetAttribute(tag, AttrLength, formulaLength); doc->SetAttribute(tag, AttrP1Line, basePointId); doc->SetAttribute(tag, AttrP2Line, p2Line); doc->SetAttribute(tag, AttrPShoulder, pShoulder); } +//--------------------------------------------------------------------------------------------------------------------- +void VToolShoulderPoint::ReadToolAttributes(const QDomElement &domElement) +{ + typeLine = doc->GetParametrString(domElement, AttrTypeLine, TypeLineLine); + lineColor = doc->GetParametrString(domElement, AttrLineColor, ColorBlack); + formulaLength = doc->GetParametrString(domElement, AttrLength, ""); + basePointId = doc->GetParametrUInt(domElement, AttrP1Line, NULL_ID_STR); + p2Line = doc->GetParametrUInt(domElement, AttrP2Line, NULL_ID_STR); + pShoulder = doc->GetParametrUInt(domElement, AttrPShoulder, NULL_ID_STR); +} + //--------------------------------------------------------------------------------------------------------------------- quint32 VToolShoulderPoint::getPShoulder() const { @@ -360,7 +368,7 @@ void VToolShoulderPoint::ShowVisualization(bool show) visual->setLineP1Id(basePointId); visual->setLineP2Id(p2Line); visual->setLength(qApp->FormulaToUser(formulaLength)); - visual->setLineStyle(VAbstractTool::LineStyle(typeLine)); + visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine)); visual->RefreshGeometry(); vis = visual; } @@ -381,13 +389,13 @@ void VToolShoulderPoint::ShowVisualization(bool show) } //--------------------------------------------------------------------------------------------------------------------- -quint32 VToolShoulderPoint::getP2Line() const +quint32 VToolShoulderPoint::GetP2Line() const { return p2Line; } //--------------------------------------------------------------------------------------------------------------------- -void VToolShoulderPoint::setP2Line(const quint32 &value) +void VToolShoulderPoint::SetP2Line(const quint32 &value) { if (value != NULL_ID) { diff --git a/src/app/tools/drawTools/vtoolshoulderpoint.h b/src/app/tools/drawTools/vtoolshoulderpoint.h index ef8c08df6..78348ab84 100644 --- a/src/app/tools/drawTools/vtoolshoulderpoint.h +++ b/src/app/tools/drawTools/vtoolshoulderpoint.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -40,22 +40,23 @@ class VToolShoulderPoint : public VToolLinePoint Q_OBJECT public: VToolShoulderPoint(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, - const QString &formula, const quint32 &p1Line, const quint32 &p2Line, const quint32 &pShoulder, - const Source &typeCreation, QGraphicsItem * parent = nullptr); + const QString &lineColor, const QString &formula, const quint32 &p1Line, const quint32 &p2Line, + const quint32 &pShoulder, const Source &typeCreation, QGraphicsItem * parent = nullptr); virtual void setDialog(); static QPointF FindPoint(const QPointF &p1Line, const QPointF &p2Line, const QPointF &pShoulder, const qreal &length); static VToolShoulderPoint* Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data); static VToolShoulderPoint* Create(const quint32 _id, QString &formula, const quint32 &p1Line, const quint32 &p2Line, - const quint32 &pShoulder, const QString &typeLine, const QString &pointName, - const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, - VContainer *data, const Document &parse, const Source &typeCreation); + const quint32 &pShoulder, const QString &typeLine, const QString &lineColor, + const QString &pointName, const qreal &mx, const qreal &my, + VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse, + const Source &typeCreation); static const QString ToolType; virtual int type() const {return Type;} enum { Type = UserType + static_cast(Tool::ShoulderPoint) }; - quint32 getP2Line() const; - void setP2Line(const quint32 &value); + quint32 GetP2Line() const; + void SetP2Line(const quint32 &value); quint32 getPShoulder() const; void setPShoulder(const quint32 &value); @@ -70,6 +71,7 @@ protected: virtual void RemoveReferens(); virtual void SaveDialog(QDomElement &domElement); virtual void SaveOptions(QDomElement &tag, QSharedPointer &obj); + virtual void ReadToolAttributes(const QDomElement &domElement); private: /** @brief p2Line id second line point. */ quint32 p2Line; diff --git a/src/app/tools/drawTools/vtoolsinglepoint.cpp b/src/app/tools/drawTools/vtoolsinglepoint.cpp index a90ed60da..f964e8cfb 100644 --- a/src/app/tools/drawTools/vtoolsinglepoint.cpp +++ b/src/app/tools/drawTools/vtoolsinglepoint.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -33,6 +33,7 @@ #include "../../undocommands/addpatternpiece.h" #include "../../undocommands/deletepatternpiece.h" #include "../../geometry/vpointf.h" +#include "../../options.h" #include @@ -52,13 +53,12 @@ VToolSinglePoint::VToolSinglePoint (VPattern *doc, VContainer *data, quint32 id, :VToolPoint(doc, data, id, parent), namePP(namePP), mPath(mPath) { baseColor = Qt::red; - currentColor = baseColor; - this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor)); + this->setPen(QPen(baseColor, qApp->toPixel(qApp->widthHairLine())/factor)); ignoreFullUpdate = true; this->setFlag(QGraphicsItem::ItemIsMovable, true); this->setFlag(QGraphicsItem::ItemSendsGeometryChanges, true); this->setFlag(QGraphicsItem::ItemIsFocusable, false); - setColorLabel(Qt::black); + SetColorLabel(Qt::black); if (typeCreation == Source::FromGui) { AddToFile(); @@ -79,7 +79,7 @@ void VToolSinglePoint::setDialog() DialogSinglePoint *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); const QSharedPointer p = VAbstractTool::data.GeometricObject(id); - dialogTool->setData(p->name(), p->toQPointF()); + dialogTool->SetData(p->name(), p->toQPointF()); } //--------------------------------------------------------------------------------------------------------------------- @@ -173,7 +173,7 @@ void VToolSinglePoint::DeleteTool(bool ask) qApp->getSceneView()->itemClicked(nullptr); if (ask) { - if (ConfirmDeletion() == QMessageBox::Cancel) + if (ConfirmDeletion() == QMessageBox::No) { return; } @@ -194,8 +194,8 @@ void VToolSinglePoint::SaveDialog(QDomElement &domElement) SCASSERT(dialog != nullptr); DialogSinglePoint *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); - QPointF p = dialogTool->getPoint(); - QString name = dialogTool->getName(); + QPointF p = dialogTool->GetPoint(); + QString name = dialogTool->getPointName(); doc->SetAttribute(domElement, AttrName, name); doc->SetAttribute(domElement, AttrX, QString().setNum(qApp->fromPixel(p.x()))); doc->SetAttribute(domElement, AttrY, QString().setNum(qApp->fromPixel(p.y()))); @@ -206,7 +206,10 @@ void VToolSinglePoint::hoverEnterEvent(QGraphicsSceneHoverEvent *event) { VToolPoint::hoverEnterEvent(event); - VApplication::setOverrideCursor(QStringLiteral("://cursor/cursor-arrow-openhand.png"), 1, 1); + if (flags() & QGraphicsItem::ItemIsMovable) + { + VApplication::setOverrideCursor(cursorArrowOpenHand, 1, 1); + } } //--------------------------------------------------------------------------------------------------------------------- @@ -214,16 +217,22 @@ void VToolSinglePoint::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) { VToolPoint::hoverLeaveEvent(event); - //Disable cursor-arrow-openhand - VApplication::restoreOverrideCursor(QStringLiteral("://cursor/cursor-arrow-openhand.png")); + if (flags() & QGraphicsItem::ItemIsMovable) + { + //Disable cursor-arrow-openhand + VApplication::restoreOverrideCursor(cursorArrowOpenHand); + } } //--------------------------------------------------------------------------------------------------------------------- void VToolSinglePoint::mousePressEvent(QGraphicsSceneMouseEvent *event) { - if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick) + if (flags() & QGraphicsItem::ItemIsMovable) { - VApplication::setOverrideCursor(QStringLiteral("://cursor/cursor-arrow-closehand.png"), 1, 1); + if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick) + { + VApplication::setOverrideCursor(cursorArrowCloseHand, 1, 1); + } } VToolPoint::mousePressEvent(event); } @@ -231,20 +240,23 @@ void VToolSinglePoint::mousePressEvent(QGraphicsSceneMouseEvent *event) //--------------------------------------------------------------------------------------------------------------------- void VToolSinglePoint::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { - if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick) + if (flags() & QGraphicsItem::ItemIsMovable) { - //Disable cursor-arrow-closehand - VApplication::restoreOverrideCursor(QStringLiteral("://cursor/cursor-arrow-closehand.png")); + if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick) + { + //Disable cursor-arrow-closehand + VApplication::restoreOverrideCursor(cursorArrowCloseHand); + } } VToolPoint::mouseReleaseEvent(event); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief setColorLabel change color for label and label line. + * @brief SetColorLabel change color for label and label line. * @param color new color. */ -void VToolSinglePoint::setColorLabel(const Qt::GlobalColor &color) +void VToolSinglePoint::SetColorLabel(const Qt::GlobalColor &color) { namePoint->setBrush(color); lineName->setPen(QPen(color, qApp->toPixel(qApp->widthHairLine())/factor)); @@ -265,6 +277,13 @@ void VToolSinglePoint::SaveOptions(QDomElement &tag, QSharedPointer &o doc->SetAttribute(tag, AttrMy, qApp->fromPixel(point->my())); } +//--------------------------------------------------------------------------------------------------------------------- +void VToolSinglePoint::ReadToolAttributes(const QDomElement &domElement) +{ + Q_UNUSED(domElement); + // This tool doesn't need read attributes from file. +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief contextMenuEvent handle context menu events. @@ -299,26 +318,6 @@ void VToolSinglePoint::FullUpdateFromFile() RefreshPointGeometry(point); } -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief ChangedActivDraw disable or enable context menu after change active pattern peace. - * @param newName new name active pattern peace. - */ -void VToolSinglePoint::ChangedActivDraw(const QString &newName) -{ - VToolPoint::ChangedActivDraw(newName); - if (nameActivDraw == newName) - { - this->setEnabled(true); - setColorLabel(Qt::black); - } - else - { - this->setEnabled(false); - setColorLabel(Qt::gray); - } -} - //--------------------------------------------------------------------------------------------------------------------- /** * @brief SetFactor set current scale factor of scene. @@ -346,3 +345,9 @@ void VToolSinglePoint::ShowContextMenu(QGraphicsSceneContextMenuEvent *event) ContextMenu(this, event, false); } } + +//--------------------------------------------------------------------------------------------------------------------- +void VToolSinglePoint::EnableToolMove(bool move) +{ + this->setFlag(QGraphicsItem::ItemIsMovable, move); +} diff --git a/src/app/tools/drawTools/vtoolsinglepoint.h b/src/app/tools/drawTools/vtoolsinglepoint.h index 2e9aa14f1..fa0af58a8 100644 --- a/src/app/tools/drawTools/vtoolsinglepoint.h +++ b/src/app/tools/drawTools/vtoolsinglepoint.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -48,9 +48,9 @@ public: virtual void ShowVisualization(bool show); public slots: virtual void FullUpdateFromFile(); - virtual void ChangedActivDraw(const QString &newName); virtual void SetFactor(qreal factor); virtual void ShowContextMenu(QGraphicsSceneContextMenuEvent *event); + virtual void EnableToolMove(bool move); signals: /** * @brief FullUpdateTree handle if need update pattern file. @@ -68,10 +68,11 @@ protected: virtual void mousePressEvent( QGraphicsSceneMouseEvent * event ); virtual void mouseReleaseEvent ( QGraphicsSceneMouseEvent * event ); virtual void SaveOptions(QDomElement &tag, QSharedPointer &obj); + virtual void ReadToolAttributes(const QDomElement &domElement); private: QString namePP; QString mPath; - void setColorLabel(const Qt::GlobalColor & color); + void SetColorLabel(const Qt::GlobalColor & color); }; diff --git a/src/app/tools/drawTools/vtoolspline.cpp b/src/app/tools/drawTools/vtoolspline.cpp index 96eddc313..f097b1129 100644 --- a/src/app/tools/drawTools/vtoolspline.cpp +++ b/src/app/tools/drawTools/vtoolspline.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -31,6 +31,8 @@ #include "../../dialogs/tools/dialogspline.h" #include "../../undocommands/movespline.h" #include "../../visualization/vistoolspline.h" +#include "../../options.h" +#include const QString VToolSpline::ToolType = QStringLiteral("simple"); @@ -43,15 +45,17 @@ const QString VToolSpline::ToolType = QStringLiteral("simple"); * @param typeCreation way we create this tool. * @param parent parent object. */ -VToolSpline::VToolSpline(VPattern *doc, VContainer *data, quint32 id, const Source &typeCreation, +VToolSpline::VToolSpline(VPattern *doc, VContainer *data, quint32 id, const QString color, const Source &typeCreation, QGraphicsItem *parent) - :VAbstractSpline(doc, data, id, parent) + :VAbstractSpline(doc, data, id, parent), oldPosition() { sceneType = SceneObject::Spline; + lineColor = color; this->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthHairLine())/factor)); this->setFlag(QGraphicsItem::ItemIsSelectable, true); this->setFlag(QGraphicsItem::ItemIsFocusable, true); + this->setFlag(QGraphicsItem::ItemIsMovable, true); this->setAcceptHoverEvents(true); this->setPath(ToolPath()); @@ -98,13 +102,14 @@ void VToolSpline::setDialog() DialogSpline *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); const QSharedPointer spl = VAbstractTool::data.GeometricObject(id); - dialogTool->setP1(spl->GetP1().id()); - dialogTool->setP4(spl->GetP4().id()); - dialogTool->setAngle1(spl->GetAngle1()); - dialogTool->setAngle2(spl->GetAngle2()); - dialogTool->setKAsm1(spl->GetKasm1()); - dialogTool->setKAsm2(spl->GetKasm2()); - dialogTool->setKCurve(spl->GetKcurve()); + dialogTool->SetP1(spl->GetP1().id()); + dialogTool->SetP4(spl->GetP4().id()); + dialogTool->SetAngle1(spl->GetAngle1()); + dialogTool->SetAngle2(spl->GetAngle2()); + dialogTool->SetKAsm1(spl->GetKasm1()); + dialogTool->SetKAsm2(spl->GetKasm2()); + dialogTool->SetKCurve(spl->GetKcurve()); + dialogTool->SetColor(lineColor); } //--------------------------------------------------------------------------------------------------------------------- @@ -121,15 +126,16 @@ VToolSpline* VToolSpline::Create(DialogTool *dialog, VMainGraphicsScene *scene, SCASSERT(dialog != nullptr); DialogSpline *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); - const quint32 p1 = dialogTool->getP1(); - const quint32 p4 = dialogTool->getP4(); - const qreal kAsm1 = dialogTool->getKAsm1(); - const qreal kAsm2 = dialogTool->getKAsm2(); - const qreal angle1 = dialogTool->getAngle1(); - const qreal angle2 = dialogTool->getAngle2(); - const qreal kCurve = dialogTool->getKCurve(); + const quint32 p1 = dialogTool->GetP1(); + const quint32 p4 = dialogTool->GetP4(); + const qreal kAsm1 = dialogTool->GetKAsm1(); + const qreal kAsm2 = dialogTool->GetKAsm2(); + const qreal angle1 = dialogTool->GetAngle1(); + const qreal angle2 = dialogTool->GetAngle2(); + const qreal kCurve = dialogTool->GetKCurve(); + const QString color = dialogTool->GetColor(); VToolSpline *spl = nullptr; - spl = Create(0, p1, p4, kAsm1, kAsm2, angle1, angle2, kCurve, scene, doc, data, Document::FullParse, + spl = Create(0, p1, p4, kAsm1, kAsm2, angle1, angle2, kCurve, color, scene, doc, data, Document::FullParse, Source::FromGui); if (spl != nullptr) { @@ -158,7 +164,7 @@ VToolSpline* VToolSpline::Create(DialogTool *dialog, VMainGraphicsScene *scene, */ VToolSpline* VToolSpline::Create(const quint32 _id, const quint32 &p1, const quint32 &p4, const qreal &kAsm1, const qreal kAsm2, const qreal &angle1, const qreal &angle2, const qreal &kCurve, - VMainGraphicsScene *scene, VPattern *doc, VContainer *data, + const QString &color, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation) { VPointF point1 = *data->GeometricObject(p1); @@ -182,11 +188,12 @@ VToolSpline* VToolSpline::Create(const quint32 _id, const quint32 &p1, const qui VDrawTool::AddRecord(id, Tool::Spline, doc); if (parse == Document::FullParse) { - VToolSpline *spl = new VToolSpline(doc, data, id, typeCreation); + VToolSpline *spl = new VToolSpline(doc, data, id, color, typeCreation); scene->addItem(spl); connect(spl, &VToolSpline::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(scene, &VMainGraphicsScene::NewFactor, spl, &VToolSpline::SetFactor); connect(scene, &VMainGraphicsScene::DisableItem, spl, &VToolSpline::Disable); + connect(scene, &VMainGraphicsScene::EnableToolMove, spl, &VToolSpline::EnableToolMove); doc->AddTool(id, spl); doc->IncrementReferens(p1); doc->IncrementReferens(p4); @@ -225,11 +232,11 @@ void VToolSpline::ShowVisualization(bool show) const QSharedPointer spl = VAbstractTool::data.GeometricObject(id); visual->setPoint1Id(spl->GetP1().id()); visual->setPoint4Id(spl->GetP4().id()); - visual->setAngle1(spl->GetAngle1()); - visual->setAngle2(spl->GetAngle2()); - visual->setKAsm1(spl->GetKasm1()); - visual->setKAsm2(spl->GetKasm2()); - visual->setKCurve(spl->GetKcurve()); + visual->SetAngle1(spl->GetAngle1()); + visual->SetAngle2(spl->GetAngle2()); + visual->SetKAsm1(spl->GetKasm1()); + visual->SetKAsm2(spl->GetKasm2()); + visual->SetKCurve(spl->GetKcurve()); visual->RefreshGeometry(); vis = visual; } @@ -277,6 +284,12 @@ void VToolSpline::ControlPointChangePosition(const qint32 &indexSpline, const Sp qApp->getUndoStack()->push(moveSpl); } +//--------------------------------------------------------------------------------------------------------------------- +void VToolSpline::EnableToolMove(bool move) +{ + this->setFlag(QGraphicsItem::ItemIsMovable, move); +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief contextMenuEvent handle context menu events. @@ -308,10 +321,10 @@ void VToolSpline::SaveDialog(QDomElement &domElement) DialogSpline *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); - VPointF point1 = *VAbstractTool::data.GeometricObject(dialogTool->getP1()); - VPointF point4 = *VAbstractTool::data.GeometricObject(dialogTool->getP4()); - VSpline spl = VSpline (point1, point4, dialogTool->getAngle1(), dialogTool->getAngle2(), - dialogTool->getKAsm1(), dialogTool->getKAsm2(), dialogTool->getKCurve()); + VPointF point1 = *VAbstractTool::data.GeometricObject(dialogTool->GetP1()); + VPointF point4 = *VAbstractTool::data.GeometricObject(dialogTool->GetP4()); + VSpline spl = VSpline (point1, point4, dialogTool->GetAngle1(), dialogTool->GetAngle2(), + dialogTool->GetKAsm1(), dialogTool->GetKAsm2(), dialogTool->GetKCurve()); controlPoints[0]->blockSignals(true); controlPoints[1]->blockSignals(true); @@ -322,7 +335,7 @@ void VToolSpline::SaveDialog(QDomElement &domElement) controlPoints[0]->blockSignals(false); controlPoints[1]->blockSignals(false); - spl = VSpline (point1, controlPoints[0]->pos(), controlPoints[1]->pos(), point4, dialogTool->getKCurve()); + spl = VSpline (point1, controlPoints[0]->pos(), controlPoints[1]->pos(), point4, dialogTool->GetKCurve()); doc->SetAttribute(domElement, AttrPoint1, spl.GetP1().id()); doc->SetAttribute(domElement, AttrPoint4, spl.GetP4().id()); @@ -331,6 +344,7 @@ void VToolSpline::SaveDialog(QDomElement &domElement) doc->SetAttribute(domElement, AttrKAsm1, spl.GetKasm1()); doc->SetAttribute(domElement, AttrKAsm2, spl.GetKasm2()); doc->SetAttribute(domElement, AttrKCurve, spl.GetKcurve()); + doc->SetAttribute(domElement, AttrColor, dialogTool->GetColor()); } //--------------------------------------------------------------------------------------------------------------------- @@ -348,6 +362,112 @@ void VToolSpline::SaveOptions(QDomElement &tag, QSharedPointer &obj) doc->SetAttribute(tag, AttrKAsm1, spl->GetKasm1()); doc->SetAttribute(tag, AttrKAsm2, spl->GetKasm2()); doc->SetAttribute(tag, AttrKCurve, spl->GetKcurve()); + doc->SetAttribute(tag, AttrColor, lineColor); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VToolSpline::mousePressEvent(QGraphicsSceneMouseEvent *event) +{ + if (flags() & QGraphicsItem::ItemIsMovable) + { + if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick) + { + VApplication::setOverrideCursor(cursorArrowCloseHand, 1, 1); + oldPosition = event->scenePos(); + event->accept(); + } + } + VAbstractSpline::mousePressEvent(event); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VToolSpline::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) +{ + if (flags() & QGraphicsItem::ItemIsMovable) + { + if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick) + { + //Disable cursor-arrow-closehand + VApplication::restoreOverrideCursor(cursorArrowCloseHand); + } + } + VAbstractSpline::mouseReleaseEvent(event); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VToolSpline::mouseMoveEvent(QGraphicsSceneMouseEvent *event) +{ + // Don't need check if left mouse button was pressed. According to the Qt documentation "If you do receive this + // event, you can be certain that this item also received a mouse press event, and that this item is the current + // mouse grabber.". + + // Magic Bezier Drag Equations follow! + // "weight" describes how the influence of the drag should be distributed + // among the handles; 0 = front handle only, 1 = back handle only. + + const QSharedPointer spline = VAbstractTool::data.GeometricObject(id); + const qreal t = spline->ParamT(oldPosition); + + if (qFloor(t) == -1) + { + return; + } + + double weight; + if (t <= 1.0 / 6.0) + { + weight = 0; + } + else if (t <= 0.5) + { + weight = (pow((6 * t - 1) / 2.0, 3)) / 2; + } + else if (t <= 5.0 / 6.0) + { + weight = (1 - pow((6 * (1-t) - 1) / 2.0, 3)) / 2 + 0.5; + } + else + { + weight = 1; + } + + const QPointF delta = event->scenePos() - oldPosition; + const QPointF offset0 = ((1-weight)/(3*t*(1-t)*(1-t))) * delta; + const QPointF offset1 = (weight/(3*t*t*(1-t))) * delta; + + const QPointF p2 = spline->GetP2() + offset0; + const QPointF p3 = spline->GetP3() + offset1; + + oldPosition = event->scenePos(); // Now mouse here + + VSpline spl = VSpline(spline->GetP1(), p2, p3, spline->GetP4(), spline->GetKcurve()); + + MoveSpline *moveSpl = new MoveSpline(doc, spline.data(), spl, id, this->scene()); + connect(moveSpl, &MoveSpline::NeedLiteParsing, doc, &VPattern::LiteParseTree); + qApp->getUndoStack()->push(moveSpl); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VToolSpline::hoverEnterEvent(QGraphicsSceneHoverEvent *event) +{ + if (flags() & QGraphicsItem::ItemIsMovable) + { + VApplication::setOverrideCursor(cursorArrowOpenHand, 1, 1); + } + + VAbstractSpline::hoverEnterEvent(event); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VToolSpline::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) +{ + if (flags() & QGraphicsItem::ItemIsMovable) + { + //Disable cursor-arrow-openhand + VApplication::restoreOverrideCursor(cursorArrowOpenHand); + } + + VAbstractSpline::hoverLeaveEvent(event); } //--------------------------------------------------------------------------------------------------------------------- @@ -356,7 +476,7 @@ void VToolSpline::SaveOptions(QDomElement &tag, QSharedPointer &obj) */ void VToolSpline::RefreshGeometry() { - //this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor)); + this->setPen(QPen(CorrectColor(lineColor), qApp->toPixel(qApp->widthHairLine())/factor)); if (isHovered) { this->setPath(ToolPath(PathDirection::Show)); @@ -388,11 +508,11 @@ void VToolSpline::RefreshGeometry() VisToolSpline *visual = qobject_cast(vis); visual->setPoint1Id(spl->GetP1().id()); visual->setPoint4Id(spl->GetP4().id()); - visual->setAngle1(spl->GetAngle1()); - visual->setAngle2(spl->GetAngle2()); - visual->setKAsm1(spl->GetKasm1()); - visual->setKAsm2(spl->GetKasm2()); - visual->setKCurve(spl->GetKcurve()); + visual->SetAngle1(spl->GetAngle1()); + visual->SetAngle2(spl->GetAngle2()); + visual->SetKAsm1(spl->GetKasm1()); + visual->SetKAsm2(spl->GetKasm2()); + visual->SetKCurve(spl->GetKcurve()); visual->RefreshGeometry(); } } diff --git a/src/app/tools/drawTools/vtoolspline.h b/src/app/tools/drawTools/vtoolspline.h index 214b14687..7d6d5acfb 100644 --- a/src/app/tools/drawTools/vtoolspline.h +++ b/src/app/tools/drawTools/vtoolspline.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -38,14 +38,14 @@ class VToolSpline:public VAbstractSpline { Q_OBJECT public: - VToolSpline (VPattern *doc, VContainer *data, quint32 id, const Source &typeCreation, + VToolSpline (VPattern *doc, VContainer *data, quint32 id, const QString color, const Source &typeCreation, QGraphicsItem * parent = nullptr ); virtual ~VToolSpline(); virtual void setDialog(); static VToolSpline *Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data); static VToolSpline *Create(const quint32 _id, const quint32 &p1, const quint32 &p4, const qreal &kAsm1, const qreal kAsm2, const qreal &angle1, const qreal &angle2, const qreal &kCurve, - VMainGraphicsScene *scene, VPattern *doc, VContainer *data, + const QString &color, VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation); static const QString ToolType; virtual int type() const {return Type;} @@ -58,14 +58,21 @@ public: public slots: void ControlPointChangePosition (const qint32 &indexSpline, const SplinePointPosition &position, const QPointF &pos); + virtual void EnableToolMove(bool move); protected: virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event ); virtual void RemoveReferens(); virtual void SaveDialog(QDomElement &domElement); virtual void SaveOptions(QDomElement &tag, QSharedPointer &obj); + virtual void mousePressEvent(QGraphicsSceneMouseEvent * event); + virtual void mouseReleaseEvent ( QGraphicsSceneMouseEvent * event ); + virtual void mouseMoveEvent(QGraphicsSceneMouseEvent * event); + virtual void hoverEnterEvent ( QGraphicsSceneHoverEvent * event ); + virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event ); private: Q_DISABLE_COPY(VToolSpline) void RefreshGeometry (); + QPointF oldPosition; }; #endif // VTOOLSPLINE_H diff --git a/src/app/tools/drawTools/vtoolsplinepath.cpp b/src/app/tools/drawTools/vtoolsplinepath.cpp index 3a53d0193..bf9d82f72 100644 --- a/src/app/tools/drawTools/vtoolsplinepath.cpp +++ b/src/app/tools/drawTools/vtoolsplinepath.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -31,6 +31,8 @@ #include "../../undocommands/movesplinepath.h" #include "../../visualization/vistoolsplinepath.h" +#include + const QString VToolSplinePath::ToolType = QStringLiteral("path"); //--------------------------------------------------------------------------------------------------------------------- @@ -42,16 +44,18 @@ const QString VToolSplinePath::ToolType = QStringLiteral("path"); * @param typeCreation way we create this tool. * @param parent parent object. */ -VToolSplinePath::VToolSplinePath(VPattern *doc, VContainer *data, quint32 id, const Source &typeCreation, - QGraphicsItem *parent) - :VAbstractSpline(doc, data, id, parent) +VToolSplinePath::VToolSplinePath(VPattern *doc, VContainer *data, quint32 id, const QString &color, + const Source &typeCreation, QGraphicsItem *parent) + :VAbstractSpline(doc, data, id, parent), oldPosition() { sceneType = SceneObject::SplinePath; + lineColor = color; this->setPath(ToolPath()); this->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthHairLine())/factor)); this->setFlag(QGraphicsItem::ItemIsSelectable, true); this->setFlag(QGraphicsItem::ItemIsFocusable, true); + this->setFlag(QGraphicsItem::ItemIsMovable, true); this->setAcceptHoverEvents(true); const QSharedPointer splPath = data->GeometricObject(id); @@ -98,6 +102,7 @@ void VToolSplinePath::setDialog() SCASSERT(dialogTool != nullptr); const QSharedPointer splPath = VAbstractTool::data.GeometricObject(id); dialogTool->SetPath(*splPath); + dialogTool->SetColor(lineColor); } //--------------------------------------------------------------------------------------------------------------------- @@ -114,12 +119,13 @@ VToolSplinePath* VToolSplinePath::Create(DialogTool *dialog, VMainGraphicsScene DialogSplinePath *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); VSplinePath *path = new VSplinePath(dialogTool->GetPath()); + const QString color = dialogTool->GetColor(); for (qint32 i = 0; i < path->CountPoint(); ++i) { doc->IncrementReferens((*path)[i].P().id()); } VToolSplinePath* spl = nullptr; - spl = Create(0, path, scene, doc, data, Document::FullParse, Source::FromGui); + spl = Create(0, path, color, scene, doc, data, Document::FullParse, Source::FromGui); if (spl != nullptr) { spl->dialog=dialogTool; @@ -138,8 +144,9 @@ VToolSplinePath* VToolSplinePath::Create(DialogTool *dialog, VMainGraphicsScene * @param parse parser file mode. * @param typeCreation way we create this tool. */ -VToolSplinePath* VToolSplinePath::Create(const quint32 _id, VSplinePath *path, VMainGraphicsScene *scene, VPattern *doc, - VContainer *data, const Document &parse, const Source &typeCreation) +VToolSplinePath* VToolSplinePath::Create(const quint32 _id, VSplinePath *path, const QString &color, + VMainGraphicsScene *scene, VPattern *doc, VContainer *data, + const Document &parse, const Source &typeCreation) { quint32 id = _id; if (typeCreation == Source::FromGui) @@ -159,11 +166,12 @@ VToolSplinePath* VToolSplinePath::Create(const quint32 _id, VSplinePath *path, V VDrawTool::AddRecord(id, Tool::SplinePath, doc); if (parse == Document::FullParse) { - VToolSplinePath *spl = new VToolSplinePath(doc, data, id, typeCreation); + VToolSplinePath *spl = new VToolSplinePath(doc, data, id, color, typeCreation); scene->addItem(spl); connect(spl, &VToolSplinePath::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(scene, &VMainGraphicsScene::NewFactor, spl, &VToolSplinePath::SetFactor); connect(scene, &VMainGraphicsScene::DisableItem, spl, &VToolSplinePath::Disable); + connect(scene, &VMainGraphicsScene::EnableToolMove, spl, &VToolSplinePath::EnableToolMove); doc->AddTool(id, spl); return spl; } @@ -199,6 +207,12 @@ void VToolSplinePath::ControlPointChangePosition(const qint32 &indexSpline, cons qApp->getUndoStack()->push(moveSplPath); } +//--------------------------------------------------------------------------------------------------------------------- +void VToolSplinePath::EnableToolMove(bool move) +{ + this->setFlag(QGraphicsItem::ItemIsMovable, move); +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief UpdateControlPoints update position points control points in file. @@ -237,7 +251,7 @@ void VToolSplinePath::RefreshSplinePath(VSplinePath &splPath) controlPoints[j-1]->blockSignals(false); spl = VSpline (spl.GetP1(), controlPoints[j-2]->pos(), controlPoints[j-1]->pos(), spl.GetP4(), - splPath.getKCurve()); + splPath.GetKCurve()); UpdateControlPoints(spl, splPath, i); } } @@ -251,20 +265,18 @@ void VToolSplinePath::RefreshSplinePath(VSplinePath &splPath) */ void VToolSplinePath::UpdatePathPoint(VPattern *doc, QDomNode& node, const VSplinePath &path) { - SCASSERT(doc != nullptr) - QDomNodeList nodeList = node.childNodes(); - qint32 num = nodeList.size(); - for (qint32 i = 0; i < num; ++i) + SCASSERT(doc != nullptr); + QDomElement element = node.toElement(); + if (element.isElement() == false) { - QDomElement domElement = nodeList.at(i).toElement(); - if (domElement.isNull() == false) - { - VSplinePoint p = path.at(i); - doc->SetAttribute(domElement, AttrPSpline, p.P().id()); - doc->SetAttribute(domElement, AttrKAsm1, p.KAsm1()); - doc->SetAttribute(domElement, AttrKAsm2, p.KAsm2()); - doc->SetAttribute(domElement, AttrAngle, p.Angle2()); - } + qDebug()<<"Couldn't convert parent to element."; + return; + } + + doc->removeAllChilds(element); + for (qint32 i = 0; i < path.CountPoint(); ++i) + { + AddPathPoint(doc, element, path.at(i)); } } @@ -334,7 +346,7 @@ void VToolSplinePath::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) */ void VToolSplinePath::RefreshDataInFile() { - QDomElement domElement = doc->elementById(QString().setNum(id)); + QDomElement domElement = doc->elementById(id); if (domElement.isElement() == false) { qDebug()<<"Can't find element with id="<(id); RefreshSplinePath(splPath); - doc->SetAttribute(domElement, AttrKCurve, QString().setNum(splPath.getKCurve())); + doc->SetAttribute(domElement, AttrKCurve, QString().setNum(splPath.GetKCurve())); UpdatePathPoint(doc, domElement, splPath); } @@ -352,8 +364,9 @@ void VToolSplinePath::RefreshDataInFile() * @param domElement dom element. * @param splPoint spline path point. */ -void VToolSplinePath::AddPathPoint(QDomElement &domElement, const VSplinePoint &splPoint) +void VToolSplinePath::AddPathPoint(VPattern *doc, QDomElement &domElement, const VSplinePoint &splPoint) { + SCASSERT(doc != nullptr); QDomElement pathPoint = doc->createElement(AttrPathPoint); doc->SetAttribute(pathPoint, AttrPSpline, splPoint.P().id()); @@ -389,7 +402,8 @@ void VToolSplinePath::SaveDialog(QDomElement &domElement) VSplinePath splPath = dialogTool->GetPath(); RefreshSplinePath(splPath); - doc->SetAttribute(domElement, AttrKCurve, QString().setNum(splPath.getKCurve())); + doc->SetAttribute(domElement, AttrKCurve, QString().setNum(splPath.GetKCurve())); + doc->SetAttribute(domElement, AttrColor, dialogTool->GetColor()); UpdatePathPoint(doc, domElement, splPath); } @@ -401,15 +415,131 @@ void VToolSplinePath::SaveOptions(QDomElement &tag, QSharedPointer &ob doc->SetAttribute(tag, VDomDocument::AttrId, id); doc->SetAttribute(tag, AttrType, ToolType); - doc->SetAttribute(tag, AttrKCurve, splPath->getKCurve()); + doc->SetAttribute(tag, AttrKCurve, splPath->GetKCurve()); + doc->SetAttribute(tag, AttrColor, lineColor); doc->RemoveAllChild(tag); for (qint32 i = 0; i < splPath->CountPoint(); ++i) { - AddPathPoint(tag, splPath->at(i)); + AddPathPoint(doc, tag, splPath->at(i)); } } +//--------------------------------------------------------------------------------------------------------------------- +void VToolSplinePath::mousePressEvent(QGraphicsSceneMouseEvent *event) +{ + if (flags() & QGraphicsItem::ItemIsMovable) + { + if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick) + { + VApplication::setOverrideCursor(cursorArrowCloseHand, 1, 1); + oldPosition = event->scenePos(); + event->accept(); + } + } + VAbstractSpline::mousePressEvent(event); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VToolSplinePath::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) +{ + if (flags() & QGraphicsItem::ItemIsMovable) + { + if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick) + { + //Disable cursor-arrow-closehand + VApplication::restoreOverrideCursor(cursorArrowCloseHand); + } + } + VAbstractSpline::mouseReleaseEvent(event); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VToolSplinePath::mouseMoveEvent(QGraphicsSceneMouseEvent *event) +{ + // Don't need check if left mouse button was pressed. According to the Qt documentation "If you do receive this + // event, you can be certain that this item also received a mouse press event, and that this item is the current + // mouse grabber.". + + VSplinePath oldSplPath = *VAbstractTool::data.GeometricObject(id); + VSplinePath newSplPath = oldSplPath; + int indexSpline = oldSplPath.Segment(oldPosition); + if (indexSpline == -1) + { + return; + } + + VSpline spline = newSplPath.GetSpline(indexSpline); + const qreal t = spline.ParamT(oldPosition); + + if (qFloor(t) == -1) + { + return; + } + + // Magic Bezier Drag Equations follow! + // "weight" describes how the influence of the drag should be distributed + // among the handles; 0 = front handle only, 1 = back handle only. + + double weight; + if (t <= 1.0 / 6.0) + { + weight = 0; + } + else if (t <= 0.5) + { + weight = (pow((6 * t - 1) / 2.0, 3)) / 2; + } + else if (t <= 5.0 / 6.0) + { + weight = (1 - pow((6 * (1-t) - 1) / 2.0, 3)) / 2 + 0.5; + } + else + { + weight = 1; + } + + const QPointF delta = event->scenePos() - oldPosition; + const QPointF offset0 = ((1-weight)/(3*t*(1-t)*(1-t))) * delta; + const QPointF offset1 = (weight/(3*t*t*(1-t))) * delta; + + const QPointF p2 = spline.GetP2() + offset0; + const QPointF p3 = spline.GetP3() + offset1; + + oldPosition = event->scenePos(); // Now mouse here + + const VSpline spl = VSpline(spline.GetP1(), p2, p3, spline.GetP4(), spline.GetKcurve()); + + UpdateControlPoints(spl, newSplPath, indexSpline); + + MoveSplinePath *moveSplPath = new MoveSplinePath(doc, oldSplPath, newSplPath, id, this->scene()); + connect(moveSplPath, &VUndoCommand::NeedLiteParsing, doc, &VPattern::LiteParseTree); + qApp->getUndoStack()->push(moveSplPath); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VToolSplinePath::hoverEnterEvent(QGraphicsSceneHoverEvent *event) +{ + if (flags() & QGraphicsItem::ItemIsMovable) + { + VApplication::setOverrideCursor(cursorArrowOpenHand, 1, 1); + } + + VAbstractSpline::hoverEnterEvent(event); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VToolSplinePath::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) +{ + if (flags() & QGraphicsItem::ItemIsMovable) + { + //Disable cursor-arrow-openhand + VApplication::restoreOverrideCursor(cursorArrowOpenHand); + } + + VAbstractSpline::hoverLeaveEvent(event); +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief RefreshGeometry refresh item on scene. @@ -424,7 +554,7 @@ void VToolSplinePath::RefreshGeometry() { this->setPath(ToolPath()); } - + this->setPen(QPen(CorrectColor(lineColor), qApp->toPixel(qApp->widthHairLine())/factor)); const QSharedPointer splPath = VAbstractTool::data.GeometricObject(id); for (qint32 i = 1; i<=splPath->Count(); ++i) { diff --git a/src/app/tools/drawTools/vtoolsplinepath.h b/src/app/tools/drawTools/vtoolsplinepath.h index 3943a4626..0e057644c 100644 --- a/src/app/tools/drawTools/vtoolsplinepath.h +++ b/src/app/tools/drawTools/vtoolsplinepath.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -38,12 +38,13 @@ class VToolSplinePath:public VAbstractSpline { Q_OBJECT public: - VToolSplinePath(VPattern *doc, VContainer *data, quint32 id, const Source &typeCreation, + VToolSplinePath(VPattern *doc, VContainer *data, quint32 id, const QString &color, const Source &typeCreation, QGraphicsItem * parent = nullptr); virtual void setDialog(); static VToolSplinePath *Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data); - static VToolSplinePath *Create(const quint32 _id, VSplinePath *path, VMainGraphicsScene *scene, VPattern *doc, - VContainer *data, const Document &parse, const Source &typeCreation); + static VToolSplinePath *Create(const quint32 _id, VSplinePath *path, const QString &color, + VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse, + const Source &typeCreation); static const QString ToolType; static void UpdatePathPoint(VPattern *doc, QDomNode& node, const VSplinePath &path); virtual int type() const {return Type;} @@ -72,15 +73,23 @@ public slots: void ControlPointChangePosition(const qint32 &indexSpline, const SplinePointPosition &position, const QPointF &pos); + virtual void EnableToolMove(bool move); protected: virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event ); virtual void RefreshDataInFile(); virtual void RemoveReferens(); virtual void SaveDialog(QDomElement &domElement); virtual void SaveOptions(QDomElement &tag, QSharedPointer &obj); + virtual void mousePressEvent(QGraphicsSceneMouseEvent * event); + virtual void mouseReleaseEvent ( QGraphicsSceneMouseEvent * event ); + virtual void mouseMoveEvent(QGraphicsSceneMouseEvent * event); + virtual void hoverEnterEvent ( QGraphicsSceneHoverEvent * event ); + virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event ); private: + QPointF oldPosition; + void RefreshGeometry(); - void AddPathPoint(QDomElement &domElement, const VSplinePoint &splPoint); + static void AddPathPoint(VPattern *doc, QDomElement &domElement, const VSplinePoint &splPoint); void UpdateControlPoints(const VSpline &spl, VSplinePath &splPath, const qint32 &indexSpline) const; void RefreshSplinePath(VSplinePath &splPath); }; diff --git a/src/app/tools/drawTools/vtooltriangle.cpp b/src/app/tools/drawTools/vtooltriangle.cpp index 6afce72ce..28b99f1fd 100644 --- a/src/app/tools/drawTools/vtooltriangle.cpp +++ b/src/app/tools/drawTools/vtooltriangle.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -74,11 +74,11 @@ void VToolTriangle::setDialog() DialogTriangle *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); const QSharedPointer p = VAbstractTool::data.GeometricObject(id); - dialogTool->setAxisP1Id(axisP1Id); - dialogTool->setAxisP2Id(axisP2Id); - dialogTool->setFirstPointId(firstPointId); - dialogTool->setSecondPointId(secondPointId); - dialogTool->setPointName(p->name()); + dialogTool->SetAxisP1Id(axisP1Id); + dialogTool->SetAxisP2Id(axisP2Id); + dialogTool->SetFirstPointId(firstPointId); + dialogTool->SetSecondPointId(secondPointId); + dialogTool->SetPointName(p->name()); } //--------------------------------------------------------------------------------------------------------------------- @@ -95,10 +95,10 @@ VToolTriangle* VToolTriangle::Create(DialogTool *dialog, VMainGraphicsScene *sce SCASSERT(dialog != nullptr); DialogTriangle *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); - const quint32 axisP1Id = dialogTool->getAxisP1Id(); - const quint32 axisP2Id = dialogTool->getAxisP2Id(); - const quint32 firstPointId = dialogTool->getFirstPointId(); - const quint32 secondPointId = dialogTool->getSecondPointId(); + const quint32 axisP1Id = dialogTool->GetAxisP1Id(); + const quint32 axisP2Id = dialogTool->GetAxisP2Id(); + const quint32 firstPointId = dialogTool->GetFirstPointId(); + const quint32 secondPointId = dialogTool->GetSecondPointId(); const QString pointName = dialogTool->getPointName(); VToolTriangle* point = nullptr; point = Create(0, pointName, axisP1Id, axisP2Id, firstPointId, secondPointId, 5, 10, scene, doc, data, @@ -161,7 +161,7 @@ VToolTriangle* VToolTriangle::Create(const quint32 _id, const QString &pointName scene->addItem(point); connect(point, &VToolTriangle::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolTriangle::SetFactor); - connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolPoint::Disable); + connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolTriangle::Disable); doc->AddTool(id, point); doc->IncrementReferens(axisP1Id); doc->IncrementReferens(axisP2Id); @@ -220,14 +220,7 @@ QPointF VToolTriangle::FindPoint(const QPointF &axisP1, const QPointF &axisP2, c */ void VToolTriangle::FullUpdateFromFile() { - QDomElement domElement = doc->elementById(QString().setNum(id)); - if (domElement.isElement()) - { - axisP1Id = domElement.attribute(AttrAxisP1, "").toUInt(); - axisP2Id = domElement.attribute(AttrAxisP2, "").toUInt(); - firstPointId = domElement.attribute(AttrFirstPoint, "").toUInt(); - secondPointId = domElement.attribute(AttrSecondPoint, "").toUInt(); - } + ReadAttributes(); VToolPoint::RefreshPointGeometry(*VDrawTool::data.GeometricObject(id)); if (vis != nullptr) @@ -283,10 +276,10 @@ void VToolTriangle::SaveDialog(QDomElement &domElement) DialogTriangle *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); doc->SetAttribute(domElement, AttrName, dialogTool->getPointName()); - doc->SetAttribute(domElement, AttrAxisP1, QString().setNum(dialogTool->getAxisP1Id())); - doc->SetAttribute(domElement, AttrAxisP2, QString().setNum(dialogTool->getAxisP2Id())); - doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->getFirstPointId())); - doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->getSecondPointId())); + doc->SetAttribute(domElement, AttrAxisP1, QString().setNum(dialogTool->GetAxisP1Id())); + doc->SetAttribute(domElement, AttrAxisP2, QString().setNum(dialogTool->GetAxisP2Id())); + doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->GetFirstPointId())); + doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->GetSecondPointId())); } //--------------------------------------------------------------------------------------------------------------------- @@ -308,13 +301,22 @@ void VToolTriangle::SaveOptions(QDomElement &tag, QSharedPointer &obj) } //--------------------------------------------------------------------------------------------------------------------- -quint32 VToolTriangle::getSecondPointId() const +void VToolTriangle::ReadToolAttributes(const QDomElement &domElement) +{ + axisP1Id = doc->GetParametrUInt(domElement, AttrAxisP1, NULL_ID_STR); + axisP2Id = doc->GetParametrUInt(domElement, AttrAxisP2, NULL_ID_STR); + firstPointId = doc->GetParametrUInt(domElement, AttrFirstPoint, NULL_ID_STR); + secondPointId = doc->GetParametrUInt(domElement, AttrSecondPoint, NULL_ID_STR); +} + +//--------------------------------------------------------------------------------------------------------------------- +quint32 VToolTriangle::GetSecondPointId() const { return secondPointId; } //--------------------------------------------------------------------------------------------------------------------- -void VToolTriangle::setSecondPointId(const quint32 &value) +void VToolTriangle::SetSecondPointId(const quint32 &value) { if (value != NULL_ID) { @@ -361,13 +363,13 @@ void VToolTriangle::ShowVisualization(bool show) } //--------------------------------------------------------------------------------------------------------------------- -quint32 VToolTriangle::getFirstPointId() const +quint32 VToolTriangle::GetFirstPointId() const { return firstPointId; } //--------------------------------------------------------------------------------------------------------------------- -void VToolTriangle::setFirstPointId(const quint32 &value) +void VToolTriangle::SetFirstPointId(const quint32 &value) { if (value != NULL_ID) { @@ -379,13 +381,13 @@ void VToolTriangle::setFirstPointId(const quint32 &value) } //--------------------------------------------------------------------------------------------------------------------- -quint32 VToolTriangle::getAxisP2Id() const +quint32 VToolTriangle::GetAxisP2Id() const { return axisP2Id; } //--------------------------------------------------------------------------------------------------------------------- -void VToolTriangle::setAxisP2Id(const quint32 &value) +void VToolTriangle::SetAxisP2Id(const quint32 &value) { if (value != NULL_ID) { @@ -397,13 +399,13 @@ void VToolTriangle::setAxisP2Id(const quint32 &value) } //--------------------------------------------------------------------------------------------------------------------- -quint32 VToolTriangle::getAxisP1Id() const +quint32 VToolTriangle::GetAxisP1Id() const { return axisP1Id; } //--------------------------------------------------------------------------------------------------------------------- -void VToolTriangle::setAxisP1Id(const quint32 &value) +void VToolTriangle::SetAxisP1Id(const quint32 &value) { if (value != NULL_ID) { diff --git a/src/app/tools/drawTools/vtooltriangle.h b/src/app/tools/drawTools/vtooltriangle.h index 5ae0743dc..1e7f80b0f 100644 --- a/src/app/tools/drawTools/vtooltriangle.h +++ b/src/app/tools/drawTools/vtooltriangle.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -54,17 +54,17 @@ public: virtual int type() const {return Type;} enum { Type = UserType + static_cast(Tool::Triangle)}; - quint32 getAxisP1Id() const; - void setAxisP1Id(const quint32 &value); + quint32 GetAxisP1Id() const; + void SetAxisP1Id(const quint32 &value); - quint32 getAxisP2Id() const; - void setAxisP2Id(const quint32 &value); + quint32 GetAxisP2Id() const; + void SetAxisP2Id(const quint32 &value); - quint32 getFirstPointId() const; - void setFirstPointId(const quint32 &value); + quint32 GetFirstPointId() const; + void SetFirstPointId(const quint32 &value); - quint32 getSecondPointId() const; - void setSecondPointId(const quint32 &value); + quint32 GetSecondPointId() const; + void SetSecondPointId(const quint32 &value); virtual void ShowVisualization(bool show); public slots: @@ -75,6 +75,7 @@ protected: virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event ); virtual void SaveDialog(QDomElement &domElement); virtual void SaveOptions(QDomElement &tag, QSharedPointer &obj); + virtual void ReadToolAttributes(const QDomElement &domElement); private: Q_DISABLE_COPY(VToolTriangle) /** @brief axisP1Id id first axis point. */ diff --git a/src/app/tools/nodeDetails/nodedetails.h b/src/app/tools/nodeDetails/nodedetails.h index fbdf2b2ba..497136c6e 100644 --- a/src/app/tools/nodeDetails/nodedetails.h +++ b/src/app/tools/nodeDetails/nodedetails.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/nodeDetails/vabstractnode.cpp b/src/app/tools/nodeDetails/vabstractnode.cpp index 13ea1b71b..c3e9d23b0 100644 --- a/src/app/tools/nodeDetails/vabstractnode.cpp +++ b/src/app/tools/nodeDetails/vabstractnode.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -47,7 +47,7 @@ const QString VAbstractNode::AttrIdTool = QStringLiteral("idTool"); */ VAbstractNode::VAbstractNode(VPattern *doc, VContainer *data, const quint32 &id, const quint32 &idNode, const quint32 &idTool, QObject *parent) - : VAbstractTool(doc, data, id, parent), idNode(idNode), idTool(idTool) + : VAbstractTool(doc, data, id, parent), idNode(idNode), idTool(idTool), currentColor(Qt::black) { _referens = 0; } @@ -99,7 +99,7 @@ void VAbstractNode::decrementReferens() if (_referens <= 0) { doc->DecrementReferens(idNode); - QDomElement domElement = doc->elementById(QString().setNum(id)); + QDomElement domElement = doc->elementById(id); if (domElement.isElement()) { QDomNode element = domElement.parentNode(); diff --git a/src/app/tools/nodeDetails/vabstractnode.h b/src/app/tools/nodeDetails/vabstractnode.h index 61f505ccc..7c3ca0926 100644 --- a/src/app/tools/nodeDetails/vabstractnode.h +++ b/src/app/tools/nodeDetails/vabstractnode.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -31,6 +31,8 @@ #include "../vabstracttool.h" +#include + /** * @brief The VAbstractNode class parent class for all detail node. */ @@ -53,6 +55,9 @@ protected: /** @brief idTool id tool. */ quint32 idTool; + /** @brief currentColor current tool color. */ + QColor currentColor; + void AddToModeling(const QDomElement &domElement); virtual void decrementReferens(); virtual void RemoveReferens(); diff --git a/src/app/tools/nodeDetails/vnodearc.cpp b/src/app/tools/nodeDetails/vnodearc.cpp index d7c0aeb68..a49ce5f4e 100644 --- a/src/app/tools/nodeDetails/vnodearc.cpp +++ b/src/app/tools/nodeDetails/vnodearc.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -164,7 +164,7 @@ void VNodeArc::AddToFile() */ void VNodeArc::RefreshDataInFile() { - QDomElement domElement = doc->elementById(QString().setNum(id)); + QDomElement domElement = doc->elementById(id); if (domElement.isElement()) { doc->SetAttribute(domElement, AttrIdObject, idNode); diff --git a/src/app/tools/nodeDetails/vnodearc.h b/src/app/tools/nodeDetails/vnodearc.h index 5341a3f99..5f818a356 100644 --- a/src/app/tools/nodeDetails/vnodearc.h +++ b/src/app/tools/nodeDetails/vnodearc.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/nodeDetails/vnodepoint.cpp b/src/app/tools/nodeDetails/vnodepoint.cpp index 19a930f5c..ee5566ae4 100644 --- a/src/app/tools/nodeDetails/vnodepoint.cpp +++ b/src/app/tools/nodeDetails/vnodepoint.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -55,7 +55,7 @@ VNodePoint::VNodePoint(VPattern *doc, VContainer *data, quint32 id, quint32 idPo :VAbstractNode(doc, data, id, idPoint, idTool, qoParent), QGraphicsEllipseItem(parent), radius(0), namePoint(nullptr), lineName(nullptr) { - radius = (1.5/*mm*/ / 25.4) * VApplication::PrintDPI; + radius = qApp->toPixel(DefPointRadius/*mm*/, Unit::Mm); namePoint = new VGraphicsSimpleTextItem(this); lineName = new QGraphicsLineItem(this); connect(namePoint, &VGraphicsSimpleTextItem::NameChangePosition, this, @@ -180,7 +180,7 @@ void VNodePoint::AddToFile() void VNodePoint::RefreshDataInFile() { const QSharedPointer point = VAbstractTool::data.GeometricObject(id); - QDomElement domElement = doc->elementById(QString().setNum(id)); + QDomElement domElement = doc->elementById(id); if (domElement.isElement()) { doc->SetAttribute(domElement, AttrIdObject, idNode); @@ -253,7 +253,7 @@ void VNodePoint::NameChangePosition(const QPointF &pos) */ void VNodePoint::UpdateNamePosition(qreal mx, qreal my) { - QDomElement domElement = doc->elementById(QString().setNum(id)); + QDomElement domElement = doc->elementById(id); if (domElement.isElement()) { doc->SetAttribute(domElement, AttrMx, QString().setNum(qApp->fromPixel(mx))); diff --git a/src/app/tools/nodeDetails/vnodepoint.h b/src/app/tools/nodeDetails/vnodepoint.h index 23e666aa8..7414b7ef2 100644 --- a/src/app/tools/nodeDetails/vnodepoint.h +++ b/src/app/tools/nodeDetails/vnodepoint.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/nodeDetails/vnodespline.cpp b/src/app/tools/nodeDetails/vnodespline.cpp index a83545287..ade8c26fd 100644 --- a/src/app/tools/nodeDetails/vnodespline.cpp +++ b/src/app/tools/nodeDetails/vnodespline.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -167,7 +167,7 @@ void VNodeSpline::AddToFile() */ void VNodeSpline::RefreshDataInFile() { - QDomElement domElement = doc->elementById(QString().setNum(id)); + QDomElement domElement = doc->elementById(id); if (domElement.isElement()) { doc->SetAttribute(domElement, AttrIdObject, QString().setNum(idNode)); diff --git a/src/app/tools/nodeDetails/vnodespline.h b/src/app/tools/nodeDetails/vnodespline.h index 4ae2225f5..e4403ccdf 100644 --- a/src/app/tools/nodeDetails/vnodespline.h +++ b/src/app/tools/nodeDetails/vnodespline.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/nodeDetails/vnodesplinepath.cpp b/src/app/tools/nodeDetails/vnodesplinepath.cpp index a2654e473..c7adf9479 100644 --- a/src/app/tools/nodeDetails/vnodesplinepath.cpp +++ b/src/app/tools/nodeDetails/vnodesplinepath.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -170,7 +170,7 @@ void VNodeSplinePath::AddToFile() */ void VNodeSplinePath::RefreshDataInFile() { - QDomElement domElement = doc->elementById(QString().setNum(id)); + QDomElement domElement = doc->elementById(id); if (domElement.isElement()) { doc->SetAttribute(domElement, AttrIdObject, QString().setNum(idNode)); diff --git a/src/app/tools/nodeDetails/vnodesplinepath.h b/src/app/tools/nodeDetails/vnodesplinepath.h index d92bed5a3..0871e1e46 100644 --- a/src/app/tools/nodeDetails/vnodesplinepath.h +++ b/src/app/tools/nodeDetails/vnodesplinepath.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/tools.h b/src/app/tools/tools.h index 2802f71ce..0c63496a9 100644 --- a/src/app/tools/tools.h +++ b/src/app/tools/tools.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/vabstracttool.cpp b/src/app/tools/vabstracttool.cpp index 67037a51a..51dc6f60d 100644 --- a/src/app/tools/vabstracttool.cpp +++ b/src/app/tools/vabstracttool.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -28,13 +28,17 @@ #include "vabstracttool.h" #include +#include +#include #include +#include +#include "../../libs/vpropertyexplorer/checkablemessagebox.h" #include "../undocommands/deltool.h" #include "../core/vapplication.h" #include "../geometry/vpointf.h" #include "../undocommands/savetooloptions.h" #include "../widgets/vmaingraphicsview.h" -#include +#include "../core/vsettings.h" const QString VAbstractTool::AttrType = QStringLiteral("type"); const QString VAbstractTool::AttrMx = QStringLiteral("mx"); @@ -70,6 +74,8 @@ const QString VAbstractTool::AttrPSpline = QStringLiteral("pSpline"); const QString VAbstractTool::AttrAxisP1 = QStringLiteral("axisP1"); const QString VAbstractTool::AttrAxisP2 = QStringLiteral("axisP2"); const QString VAbstractTool::AttrCurve = QStringLiteral("curve"); +const QString VAbstractTool::AttrLineColor = QStringLiteral("lineColor"); +const QString VAbstractTool::AttrColor = QStringLiteral("color"); const QString VAbstractTool::TypeLineNone = QStringLiteral("none"); const QString VAbstractTool::TypeLineLine = QStringLiteral("hair"); @@ -78,6 +84,14 @@ const QString VAbstractTool::TypeLineDotLine = QStringLiteral("dotLine"); const QString VAbstractTool::TypeLineDashDotLine = QStringLiteral("dashDotLine"); const QString VAbstractTool::TypeLineDashDotDotLine = QStringLiteral("dashDotDotLine"); +const QString VAbstractTool::ColorBlack = QStringLiteral("black"); +const QString VAbstractTool::ColorGreen = QStringLiteral("green"); +const QString VAbstractTool::ColorBlue = QStringLiteral("blue"); +const QString VAbstractTool::ColorDarkRed = QStringLiteral("darkRed"); +const QString VAbstractTool::ColorDarkGreen = QStringLiteral("darkGreen"); +const QString VAbstractTool::ColorDarkBlue = QStringLiteral("darkBlue"); +const QString VAbstractTool::ColorYellow = QStringLiteral("yellow"); + //--------------------------------------------------------------------------------------------------------------------- /** * @brief VAbstractTool container. @@ -87,8 +101,7 @@ const QString VAbstractTool::TypeLineDashDotDotLine = QStringLiteral("dashDotDot * @param parent parent object. */ VAbstractTool::VAbstractTool(VPattern *doc, VContainer *data, quint32 id, QObject *parent) - :VDataTool(data, parent), doc(doc), id(id), baseColor(Qt::black), currentColor(Qt::black), typeLine(TypeLineLine), - vis(nullptr) + :VDataTool(data, parent), doc(doc), id(id), baseColor(Qt::black), vis(nullptr) { SCASSERT(doc != nullptr); connect(this, &VAbstractTool::toolhaveChange, this->doc, &VPattern::haveLiteChange); @@ -108,6 +121,9 @@ VAbstractTool::~VAbstractTool() */ void VAbstractTool::NewSceneRect(QGraphicsScene *sc, QGraphicsView *view) { + SCASSERT(sc != nullptr); + SCASSERT(view != nullptr); + QRectF rect = sc->itemsBoundingRect(); QRect rec0 = view->rect(); @@ -145,7 +161,7 @@ void VAbstractTool::DeleteTool(bool ask) qApp->getSceneView()->itemClicked(nullptr); if (ask) { - if (ConfirmDeletion() == QMessageBox::Cancel) + if (ConfirmDeletion() == QMessageBox::No) { return; } @@ -156,14 +172,39 @@ void VAbstractTool::DeleteTool(bool ask) } } +//--------------------------------------------------------------------------------------------------------------------- +int VAbstractTool::ConfirmDeletion() +{ + if (false == qApp->getSettings()->GetConfirmItemDelete()) + { + return QMessageBox::Yes; + } + + Utils::CheckableMessageBox msgBox(qApp->getMainWindow()); + msgBox.setWindowTitle(tr("Confirm deletion")); + msgBox.setText(tr("Do you really want to delete?")); + msgBox.setStandardButtons(QDialogButtonBox::Yes | QDialogButtonBox::No); + msgBox.setDefaultButton(QDialogButtonBox::No); + msgBox.setIconPixmap(qApp->style()->standardIcon(QStyle::SP_MessageBoxQuestion).pixmap(32,32) ); + + int dialogResult = msgBox.exec(); + + if (dialogResult == QDialog::Accepted) + { + qApp->getSettings()->SetConfirmItemDelete(not msgBox.isChecked()); + } + + return dialogResult == QDialog::Accepted ? QMessageBox::Yes : QMessageBox::No; +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief LineStyle return pen style for current line style. * @return pen style. */ -Qt::PenStyle VAbstractTool::LineStyle(const QString &typeLine) +Qt::PenStyle VAbstractTool::LineStyleToPenStyle(const QString &typeLine) { - QStringList styles = Styles(); + const QStringList styles = StylesList(); switch (styles.indexOf(typeLine)) { case 0: // TypeLineNone @@ -191,18 +232,77 @@ Qt::PenStyle VAbstractTool::LineStyle(const QString &typeLine) } //--------------------------------------------------------------------------------------------------------------------- -QString VAbstractTool::getLineType() const +QMap VAbstractTool::LineStylesPics() { - return typeLine; + QMap map; + const QStringList styles = StylesList(); + + for (int i=0; i < styles.size(); ++i) + { + const Qt::PenStyle style = LineStyleToPenStyle(styles.at(i)); + QPixmap pix(80, 14); + pix.fill(Qt::white); + + QBrush brush(Qt::black); + QPen pen(brush, 2.5, style); + + QPainter painter(&pix); + painter.setPen(pen); + painter.drawLine(2, 7, 78, 7); + + map.insert(styles.at(i), QIcon(pix)); + } + return map; } //--------------------------------------------------------------------------------------------------------------------- -void VAbstractTool::setTypeLine(const QString &value) +const QStringList VAbstractTool::Colors() { - typeLine = value; + const QStringList colors = QStringList() << ColorBlack << ColorGreen << ColorBlue << ColorDarkRed << ColorDarkGreen + << ColorDarkBlue << ColorYellow; + return colors; +} - QSharedPointer obj = VAbstractTool::data.GetGObject(id); - SaveOption(obj); +//--------------------------------------------------------------------------------------------------------------------- +QMap VAbstractTool::ColorsList() +{ + QMap map; + + const QStringList colorNames = Colors(); + for (int i = 0; i < colorNames.size(); ++i) + { + QString name; + switch (i) + { + case 0: // ColorBlack + name = tr("black"); + break; + case 1: // ColorGreen + name = tr("green"); + break; + case 2: // ColorBlue + name = tr("blue"); + break; + case 3: // ColorDarkRed + name = tr("dark red"); + break; + case 4: // ColorDarkGreen + name = tr("dark green"); + break; + case 5: // ColorDarkBlue + name = tr("dark blue"); + break; + case 6: // ColorYellow + name = tr("yellow"); + break; + default: + name = tr("black"); + break; + } + + map.insert(colorNames.at(i), name); + } + return map; } //--------------------------------------------------------------------------------------------------------------------- @@ -226,23 +326,11 @@ QMap VAbstractTool::PointsList() const return list; } -//--------------------------------------------------------------------------------------------------------------------- -int VAbstractTool::ConfirmDeletion() -{ - QMessageBox msgBox; - msgBox.setText(tr("Confirm the deletion.")); - msgBox.setInformativeText(tr("Do you really want delete?")); - msgBox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel); - msgBox.setDefaultButton(QMessageBox::Ok); - msgBox.setIcon(QMessageBox::Question); - return msgBox.exec(); -} - //--------------------------------------------------------------------------------------------------------------------- void VAbstractTool::SaveOption(QSharedPointer &obj) { qCDebug(vTool)<<"Saving tool options"; - QDomElement oldDomElement = doc->elementById(QString().setNum(id)); + QDomElement oldDomElement = doc->elementById(id); if (oldDomElement.isElement()) { QDomElement newDomElement = oldDomElement.cloneNode().toElement(); @@ -264,10 +352,10 @@ void VAbstractTool::SaveOption(QSharedPointer &obj) * @brief Styles return list of all line styles. * @return list of all line styles. */ -const QStringList VAbstractTool::Styles() +const QStringList VAbstractTool::StylesList() { - QStringList styles = QStringList() << TypeLineNone << TypeLineLine << TypeLineDashLine << TypeLineDotLine << - TypeLineDashDotLine << TypeLineDashDotDotLine; + const QStringList styles = QStringList() << TypeLineNone << TypeLineLine << TypeLineDashLine << TypeLineDotLine + << TypeLineDashDotLine << TypeLineDashDotDotLine; return styles; } diff --git a/src/app/tools/vabstracttool.h b/src/app/tools/vabstracttool.h index f69a1339b..962d87239 100644 --- a/src/app/tools/vabstracttool.h +++ b/src/app/tools/vabstracttool.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -86,19 +86,35 @@ public: static const QString AttrAxisP1; static const QString AttrAxisP2; static const QString AttrCurve; + static const QString AttrLineColor; + static const QString AttrColor; + static const QString TypeLineNone; static const QString TypeLineLine; static const QString TypeLineDashLine; static const QString TypeLineDotLine; static const QString TypeLineDashDotLine; static const QString TypeLineDashDotDotLine; - static const QStringList Styles(); + + static const QString ColorBlack; + static const QString ColorGreen; + static const QString ColorBlue; + static const QString ColorDarkRed; + static const QString ColorDarkGreen; + static const QString ColorDarkBlue; + static const QString ColorYellow; + + static const QStringList StylesList(); + static Qt::PenStyle LineStyleToPenStyle(const QString &typeLine); + static QMap LineStylesPics(); + + static const QStringList Colors(); + static QMap ColorsList(); + static void AddRecord(const quint32 id, const Tool &toolType, VPattern *doc); - static Qt::PenStyle LineStyle(const QString &typeLine); + const VContainer *getData() const; - QString getLineType() const; - virtual void setTypeLine(const QString &value); QMap PointsList() const; virtual QString getTagName() const =0; virtual void ShowVisualization(bool show) =0; @@ -132,12 +148,6 @@ protected: /** @brief baseColor base color for tool. */ Qt::GlobalColor baseColor; - /** @brief currentColor current tool color. */ - Qt::GlobalColor currentColor; - - /** @brief typeLine line type. */ - QString typeLine; - Visualization *vis; /** diff --git a/src/app/tools/vdatatool.cpp b/src/app/tools/vdatatool.cpp index aea1651f7..1ac7544f9 100644 --- a/src/app/tools/vdatatool.cpp +++ b/src/app/tools/vdatatool.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/vdatatool.h b/src/app/tools/vdatatool.h index e0798c7cb..3af039e2f 100644 --- a/src/app/tools/vdatatool.h +++ b/src/app/tools/vdatatool.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/vtooldetail.cpp b/src/app/tools/vtooldetail.cpp index 9205c334f..5cfb1cbd2 100644 --- a/src/app/tools/vtooldetail.cpp +++ b/src/app/tools/vtooldetail.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -30,7 +30,6 @@ #include "nodeDetails/nodedetails.h" #include "../geometry/varc.h" #include "../geometry/vsplinepath.h" -#include "../geometry/vequidistant.h" #include "../widgets/vmaingraphicsscene.h" #include "../dialogs/tools/dialogtool.h" #include "../dialogs/tools/dialogdetail.h" @@ -130,7 +129,7 @@ void VToolDetail::setDialog() DialogDetail *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); VDetail detail = VAbstractTool::data.GetDetail(id); - dialogTool->setDetails(detail); + dialogTool->setDetail(detail); } //--------------------------------------------------------------------------------------------------------------------- @@ -146,7 +145,7 @@ void VToolDetail::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern SCASSERT(dialog != nullptr); DialogDetail *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); - VDetail detail = dialogTool->getDetails(); + VDetail detail = dialogTool->getDetail(); VDetail det; qApp->getUndoStack()->beginMacro("add detail"); for (int i = 0; i< detail.CountNode(); ++i) @@ -261,7 +260,7 @@ void VToolDetail::FullUpdateFromGuiOk(int result) SCASSERT(dialog != nullptr); DialogDetail *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); - VDetail newDet = dialogTool->getDetails(); + VDetail newDet = dialogTool->getDetail(); VDetail oldDet = VAbstractTool::data.GetDetail(id); SaveDetailOptions *saveCommand = new SaveDetailOptions(oldDet, newDet, doc, id, this->scene()); @@ -305,7 +304,7 @@ void VToolDetail::AddToFile() */ void VToolDetail::RefreshDataInFile() { - QDomElement domElement = doc->elementById(QString().setNum(id)); + QDomElement domElement = doc->elementById(id); if (domElement.isElement()) { VDetail det = VAbstractTool::data.GetDetail(id); @@ -511,10 +510,8 @@ void VToolDetail::ShowVisualization(bool show) void VToolDetail::RefreshGeometry() { this->setFlag(QGraphicsItem::ItemSendsGeometryChanges, false); - QPainterPath path = VEquidistant(this->getData()).ContourPath(id); - this->setPath(path); - VDetail detail = VAbstractTool::data.GetDetail(id); + this->setPath(detail.ContourPath(this->getData())); this->setPos(detail.getMx(), detail.getMy()); this->setFlag(QGraphicsItem::ItemSendsGeometryChanges, true); } @@ -525,7 +522,7 @@ void VToolDetail::DeleteTool(bool ask) DeleteDetail *delDet = new DeleteDetail(doc, id); if (ask) { - if (ConfirmDeletion() == QMessageBox::Cancel) + if (ConfirmDeletion() == QMessageBox::No) { return; } diff --git a/src/app/tools/vtooldetail.h b/src/app/tools/vtooldetail.h index f5aeefe06..62e4a1c38 100644 --- a/src/app/tools/vtooldetail.h +++ b/src/app/tools/vtooldetail.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/tools/vtooluniondetails.cpp b/src/app/tools/vtooluniondetails.cpp index d59f93e40..80da08f26 100644 --- a/src/app/tools/vtooluniondetails.cpp +++ b/src/app/tools/vtooluniondetails.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -206,7 +206,7 @@ void VToolUnionDetails::AddToNewDetail(QObject *tool, VPattern *doc, VContainer { VSpline spline(splinePath->at(i-1).P(), splinePath->at(i).P(), splinePath->at(i-1).Angle2(), splinePath->at(i).Angle1(), splinePath->at(i-1).KAsm2(), - splinePath->at(i).KAsm1(), splinePath->getKCurve()); + splinePath->at(i).KAsm1(), splinePath->GetKCurve()); VPointF *p1 = new VPointF(spline.GetP1()); BiasRotatePoint(p1, dx, dy, data->GeometricObject(pRotate)->toQPointF(), @@ -366,7 +366,7 @@ void VToolUnionDetails::UpdatePoints(const quint32 &idDetail, VContainer *data, { VSpline spline(splinePath->at(i-1).P(), splinePath->at(i).P(), splinePath->at(i-1).Angle2(), splinePath->at(i).Angle1(), splinePath->at(i-1).KAsm2(), - splinePath->at(i).KAsm1(), splinePath->getKCurve()); + splinePath->at(i).KAsm1(), splinePath->GetKCurve()); VPointF *p1 = new VPointF(spline.GetP1()); BiasRotatePoint(p1, dx, dy, data->GeometricObject(pRotate)->toQPointF(), @@ -750,7 +750,7 @@ void VToolUnionDetails::AddToFile() */ void VToolUnionDetails::RefreshDataInFile() { - QDomElement domElement = doc->elementById(QString().setNum(id)); + QDomElement domElement = doc->elementById(id); if (domElement.isElement()) { doc->SetAttribute(domElement, AttrIndexD1, indexD1); diff --git a/src/app/tools/vtooluniondetails.h b/src/app/tools/vtooluniondetails.h index 2685bf049..cde1e793b 100644 --- a/src/app/tools/vtooluniondetails.h +++ b/src/app/tools/vtooluniondetails.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/adddet.cpp b/src/app/undocommands/adddet.cpp index de773f50d..125cc5ae3 100644 --- a/src/app/undocommands/adddet.cpp +++ b/src/app/undocommands/adddet.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -50,7 +50,7 @@ void AddDet::undo() QDomElement element; if (doc->GetActivNodeElement(VPattern::TagDetails, element)) { - QDomElement domElement = doc->elementById(QString().setNum(nodeId)); + QDomElement domElement = doc->elementById(nodeId); if (domElement.isElement()) { if (element.removeChild(domElement).isNull()) diff --git a/src/app/undocommands/adddet.h b/src/app/undocommands/adddet.h index 87166cc20..230c216e7 100644 --- a/src/app/undocommands/adddet.h +++ b/src/app/undocommands/adddet.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/adddetnode.cpp b/src/app/undocommands/adddetnode.cpp index fc483ed0c..6f6a78e5d 100644 --- a/src/app/undocommands/adddetnode.cpp +++ b/src/app/undocommands/adddetnode.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -49,7 +49,7 @@ void AddDetNode::undo() QDomElement modelingElement; if (doc->GetActivNodeElement(VPattern::TagModeling, modelingElement)) { - QDomElement domElement = doc->elementById(QString().setNum(nodeId)); + QDomElement domElement = doc->elementById(nodeId); if (domElement.isElement()) { if (modelingElement.removeChild(domElement).isNull()) diff --git a/src/app/undocommands/adddetnode.h b/src/app/undocommands/adddetnode.h index f6456e8fc..d58b255dc 100644 --- a/src/app/undocommands/adddetnode.h +++ b/src/app/undocommands/adddetnode.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/addpatternpiece.cpp b/src/app/undocommands/addpatternpiece.cpp index cad8e21b1..760487ce7 100644 --- a/src/app/undocommands/addpatternpiece.cpp +++ b/src/app/undocommands/addpatternpiece.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/addpatternpiece.h b/src/app/undocommands/addpatternpiece.h index 035816de7..52416ac01 100644 --- a/src/app/undocommands/addpatternpiece.h +++ b/src/app/undocommands/addpatternpiece.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/addtocalc.cpp b/src/app/undocommands/addtocalc.cpp index 87f205c1f..dbe3799cf 100644 --- a/src/app/undocommands/addtocalc.cpp +++ b/src/app/undocommands/addtocalc.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -56,7 +56,7 @@ void AddToCalc::undo() QDomElement calcElement; if (doc->GetActivNodeElement(VPattern::TagCalculation, calcElement)) { - QDomElement domElement = doc->elementById(QString().setNum(nodeId)); + QDomElement domElement = doc->elementById(nodeId); if (domElement.isElement()) { if (calcElement.removeChild(domElement).isNull()) @@ -102,7 +102,7 @@ void AddToCalc::redo() } else { - QDomElement refElement = doc->elementById(QString().setNum(cursor)); + QDomElement refElement = doc->elementById(cursor); if (refElement.isElement()) { calcElement.insertAfter(xml, refElement); diff --git a/src/app/undocommands/addtocalc.h b/src/app/undocommands/addtocalc.h index 81d589d82..261be91df 100644 --- a/src/app/undocommands/addtocalc.h +++ b/src/app/undocommands/addtocalc.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/adduniondetails.cpp b/src/app/undocommands/adduniondetails.cpp index 9f5a8549e..bb58b6213 100644 --- a/src/app/undocommands/adduniondetails.cpp +++ b/src/app/undocommands/adduniondetails.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -49,7 +49,7 @@ void AddUnionDetails::undo() QDomElement modelingElement; if (doc->GetActivNodeElement(VPattern::TagModeling, modelingElement)) { - QDomElement domElement = doc->elementById(QString().setNum(nodeId)); + QDomElement domElement = doc->elementById(nodeId); if (domElement.isElement()) { if (modelingElement.removeChild(domElement).isNull()) diff --git a/src/app/undocommands/adduniondetails.h b/src/app/undocommands/adduniondetails.h index bd1cb5fc0..29ab151d4 100644 --- a/src/app/undocommands/adduniondetails.h +++ b/src/app/undocommands/adduniondetails.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/deletedetail.cpp b/src/app/undocommands/deletedetail.cpp index a67794df3..f07c27479 100644 --- a/src/app/undocommands/deletedetail.cpp +++ b/src/app/undocommands/deletedetail.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -36,7 +36,7 @@ DeleteDetail::DeleteDetail(VPattern *doc, quint32 id, QUndoCommand *parent) { setText(tr("Delete tool")); nodeId = id; - QDomElement domElement = doc->elementById(QString().setNum(id)); + QDomElement domElement = doc->elementById(id); if (domElement.isElement()) { xml = domElement.cloneNode().toElement(); @@ -77,7 +77,7 @@ void DeleteDetail::redo() { qCDebug(vUndo)<<"Redo."; - QDomElement domElement = doc->elementById(QString().setNum(nodeId)); + QDomElement domElement = doc->elementById(nodeId); if (domElement.isElement()) { parentNode.removeChild(domElement); diff --git a/src/app/undocommands/deletedetail.h b/src/app/undocommands/deletedetail.h index a5b5f62a0..8923d5244 100644 --- a/src/app/undocommands/deletedetail.h +++ b/src/app/undocommands/deletedetail.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/deletepatternpiece.cpp b/src/app/undocommands/deletepatternpiece.cpp index 4a3ba85bf..e3c3630f8 100644 --- a/src/app/undocommands/deletepatternpiece.cpp +++ b/src/app/undocommands/deletepatternpiece.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/deletepatternpiece.h b/src/app/undocommands/deletepatternpiece.h index 4c4c21564..1d29fab5d 100644 --- a/src/app/undocommands/deletepatternpiece.h +++ b/src/app/undocommands/deletepatternpiece.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/deltool.cpp b/src/app/undocommands/deltool.cpp index 161bb88a8..762624174 100644 --- a/src/app/undocommands/deltool.cpp +++ b/src/app/undocommands/deltool.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/deltool.h b/src/app/undocommands/deltool.h index df8c12377..f92f9463f 100644 --- a/src/app/undocommands/deltool.h +++ b/src/app/undocommands/deltool.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/movedetail.cpp b/src/app/undocommands/movedetail.cpp index 8d5b42b16..ba847af69 100644 --- a/src/app/undocommands/movedetail.cpp +++ b/src/app/undocommands/movedetail.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -42,7 +42,7 @@ MoveDetail::MoveDetail(VPattern *doc, const double &x, const double &y, const qu nodeId = id; SCASSERT(scene != nullptr); - QDomElement domElement = doc->elementById(QString().setNum(id)); + QDomElement domElement = doc->elementById(id); if (domElement.isElement()) { oldX = qApp->toPixel(doc->GetParametrDouble(domElement, VAbstractTool::AttrMx, "0.0")); @@ -64,7 +64,7 @@ void MoveDetail::undo() { qCDebug(vUndo)<<"Undo."; - QDomElement domElement = doc->elementById(QString().setNum(nodeId)); + QDomElement domElement = doc->elementById(nodeId); if (domElement.isElement()) { SaveCoordinates(domElement, oldX, oldY); @@ -86,7 +86,7 @@ void MoveDetail::redo() { qCDebug(vUndo)<<"Redo."; - QDomElement domElement = doc->elementById(QString().setNum(nodeId)); + QDomElement domElement = doc->elementById(nodeId); if (domElement.isElement()) { SaveCoordinates(domElement, newX, newY); diff --git a/src/app/undocommands/movedetail.h b/src/app/undocommands/movedetail.h index 54b439b5d..2c42a396a 100644 --- a/src/app/undocommands/movedetail.h +++ b/src/app/undocommands/movedetail.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/movelabel.cpp b/src/app/undocommands/movelabel.cpp index eaada78e2..92502e0bb 100644 --- a/src/app/undocommands/movelabel.cpp +++ b/src/app/undocommands/movelabel.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -46,7 +46,7 @@ MoveLabel::MoveLabel(VPattern *doc, const double &x, const double &y, const quin qCDebug(vUndo)<<"Label new My"<elementById(QString().setNum(id)); + QDomElement domElement = doc->elementById(id); if (domElement.isElement()) { oldMx = qApp->toPixel(doc->GetParametrDouble(domElement, VAbstractTool::AttrMx, "0.0")); @@ -114,7 +114,7 @@ void MoveLabel::Do(double mx, double my) qCDebug(vUndo)<<"New mx"<elementById(QString().setNum(nodeId)); + QDomElement domElement = doc->elementById(nodeId); if (domElement.isElement()) { doc->SetAttribute(domElement, VAbstractTool::AttrMx, QString().setNum(qApp->fromPixel(mx))); diff --git a/src/app/undocommands/movelabel.h b/src/app/undocommands/movelabel.h index 6ead6cfb4..f3d277560 100644 --- a/src/app/undocommands/movelabel.h +++ b/src/app/undocommands/movelabel.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/movespline.cpp b/src/app/undocommands/movespline.cpp index a59ac23c8..00cc65698 100644 --- a/src/app/undocommands/movespline.cpp +++ b/src/app/undocommands/movespline.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -88,7 +88,7 @@ int MoveSpline::id() const //--------------------------------------------------------------------------------------------------------------------- void MoveSpline::Do(const VSpline &spl) { - QDomElement domElement = doc->elementById(QString().setNum(nodeId)); + QDomElement domElement = doc->elementById(nodeId); if (domElement.isElement()) { doc->SetAttribute(domElement, VAbstractTool::AttrAngle1, QString().setNum(spl.GetAngle1())); diff --git a/src/app/undocommands/movespline.h b/src/app/undocommands/movespline.h index 96f252065..ff81965ec 100644 --- a/src/app/undocommands/movespline.h +++ b/src/app/undocommands/movespline.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/movesplinepath.cpp b/src/app/undocommands/movesplinepath.cpp index 1e756ad8a..43e7b63a0 100644 --- a/src/app/undocommands/movesplinepath.cpp +++ b/src/app/undocommands/movesplinepath.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -86,10 +86,10 @@ int MoveSplinePath::id() const //--------------------------------------------------------------------------------------------------------------------- void MoveSplinePath::Do(const VSplinePath &splPath) { - QDomElement domElement = doc->elementById(QString().setNum(nodeId)); + QDomElement domElement = doc->elementById(nodeId); if (domElement.isElement()) { - doc->SetAttribute(domElement, VToolSplinePath::AttrKCurve, QString().setNum(splPath.getKCurve())); + doc->SetAttribute(domElement, VToolSplinePath::AttrKCurve, QString().setNum(splPath.GetKCurve())); VToolSplinePath::UpdatePathPoint(doc, domElement, splPath); emit NeedLiteParsing(Document::LiteParse); diff --git a/src/app/undocommands/movesplinepath.h b/src/app/undocommands/movesplinepath.h index 509a07ddd..16f3e276a 100644 --- a/src/app/undocommands/movesplinepath.h +++ b/src/app/undocommands/movesplinepath.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/movespoint.cpp b/src/app/undocommands/movespoint.cpp index dbc04eaf6..36764e802 100644 --- a/src/app/undocommands/movespoint.cpp +++ b/src/app/undocommands/movespoint.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -46,7 +46,7 @@ MoveSPoint::MoveSPoint(VPattern *doc, const double &x, const double &y, const qu qCDebug(vUndo)<<"SPoint newY"<elementById(QString().setNum(id)); + QDomElement domElement = doc->elementById(id); if (domElement.isElement()) { oldX = qApp->toPixel(doc->GetParametrDouble(domElement, VAbstractTool::AttrX, "0.0")); @@ -89,8 +89,10 @@ bool MoveSPoint::mergeWith(const QUndoCommand *command) SCASSERT(moveCommand != nullptr); const quint32 id = moveCommand->getSPointId(); + qCDebug(vUndo)<<"Mergin."; if (id != nodeId) { + qCDebug(vUndo)<<"Merging canceled."; return false; } @@ -114,7 +116,7 @@ void MoveSPoint::Do(double x, double y) qCDebug(vUndo)<<"Move to x"<elementById(QString().setNum(nodeId)); + QDomElement domElement = doc->elementById(nodeId); if (domElement.isElement()) { doc->SetAttribute(domElement, VAbstractTool::AttrX, QString().setNum(qApp->fromPixel(x))); diff --git a/src/app/undocommands/movespoint.h b/src/app/undocommands/movespoint.h index e9825b19c..49e1d4ad2 100644 --- a/src/app/undocommands/movespoint.h +++ b/src/app/undocommands/movespoint.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/renamepp.cpp b/src/app/undocommands/renamepp.cpp index 05255daf7..8520652d9 100644 --- a/src/app/undocommands/renamepp.cpp +++ b/src/app/undocommands/renamepp.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/renamepp.h b/src/app/undocommands/renamepp.h index 36183986f..84e790ac3 100644 --- a/src/app/undocommands/renamepp.h +++ b/src/app/undocommands/renamepp.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/savedetailoptions.cpp b/src/app/undocommands/savedetailoptions.cpp index 4dcb7d8d7..dee20ce26 100644 --- a/src/app/undocommands/savedetailoptions.cpp +++ b/src/app/undocommands/savedetailoptions.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -48,7 +48,7 @@ void SaveDetailOptions::undo() { qCDebug(vUndo)<<"Undo."; - QDomElement domElement = doc->elementById(QString().setNum(nodeId)); + QDomElement domElement = doc->elementById(nodeId); if (domElement.isElement()) { SaveDet(domElement, oldDet); @@ -85,7 +85,7 @@ void SaveDetailOptions::redo() { qCDebug(vUndo)<<"Redo."; - QDomElement domElement = doc->elementById(QString().setNum(nodeId)); + QDomElement domElement = doc->elementById(nodeId); if (domElement.isElement()) { SaveDet(domElement, newDet); diff --git a/src/app/undocommands/savedetailoptions.h b/src/app/undocommands/savedetailoptions.h index cfb1ab0f8..9fb4394e8 100644 --- a/src/app/undocommands/savedetailoptions.h +++ b/src/app/undocommands/savedetailoptions.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/savetooloptions.cpp b/src/app/undocommands/savetooloptions.cpp index a57416c3e..ce176ecdf 100644 --- a/src/app/undocommands/savetooloptions.cpp +++ b/src/app/undocommands/savetooloptions.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -48,7 +48,7 @@ void SaveToolOptions::undo() { qCDebug(vUndo)<<"Undo."; - QDomElement domElement = doc->elementById(QString().setNum(nodeId)); + QDomElement domElement = doc->elementById(nodeId); if (domElement.isElement()) { domElement.parentNode().replaceChild(oldXml, domElement); @@ -67,7 +67,7 @@ void SaveToolOptions::redo() { qCDebug(vUndo)<<"Redo."; - QDomElement domElement = doc->elementById(QString().setNum(nodeId)); + QDomElement domElement = doc->elementById(nodeId); if (domElement.isElement()) { domElement.parentNode().replaceChild(newXml, domElement); diff --git a/src/app/undocommands/savetooloptions.h b/src/app/undocommands/savetooloptions.h index 4ac44c7e6..21cd29d9e 100644 --- a/src/app/undocommands/savetooloptions.h +++ b/src/app/undocommands/savetooloptions.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/vundocommand.cpp b/src/app/undocommands/vundocommand.cpp index f02f3c426..873f66081 100644 --- a/src/app/undocommands/vundocommand.cpp +++ b/src/app/undocommands/vundocommand.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/undocommands/vundocommand.h b/src/app/undocommands/vundocommand.h index ef5971fb1..034962541 100644 --- a/src/app/undocommands/vundocommand.h +++ b/src/app/undocommands/vundocommand.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/version.cpp b/src/app/version.cpp index 70d0c93fe..f9ca57d77 100644 --- a/src/app/version.cpp +++ b/src/app/version.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/version.h b/src/app/version.h index 892e19d68..ef6586f7a 100644 --- a/src/app/version.h +++ b/src/app/version.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vcontrolpointspline.cpp b/src/app/visualization/vcontrolpointspline.cpp index 31c22d7aa..f330d4525 100644 --- a/src/app/visualization/vcontrolpointspline.cpp +++ b/src/app/visualization/vcontrolpointspline.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -90,7 +90,7 @@ void VControlPointSpline::paint(QPainter *painter, const QStyleOptionGraphicsIte void VControlPointSpline::hoverEnterEvent(QGraphicsSceneHoverEvent *event) { this->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthMainLine()))); - VApplication::setOverrideCursor(QStringLiteral("://cursor/cursor-arrow-openhand.png"), 1, 1); + VApplication::setOverrideCursor(cursorArrowOpenHand, 1, 1); QGraphicsEllipseItem::hoverEnterEvent(event); } @@ -99,7 +99,7 @@ void VControlPointSpline::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) { this->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthHairLine()))); //Disable cursor-arrow-openhand - VApplication::restoreOverrideCursor(QStringLiteral("://cursor/cursor-arrow-openhand.png")); + VApplication::restoreOverrideCursor(cursorArrowOpenHand); QGraphicsEllipseItem::hoverLeaveEvent(event); } @@ -126,7 +126,7 @@ void VControlPointSpline::mousePressEvent(QGraphicsSceneMouseEvent *event) { if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick) { - VApplication::setOverrideCursor(QStringLiteral("://cursor/cursor-arrow-closehand.png"), 1, 1); + VApplication::setOverrideCursor(cursorArrowCloseHand, 1, 1); } QGraphicsEllipseItem::mousePressEvent(event); } @@ -137,7 +137,7 @@ void VControlPointSpline::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick) { //Disable cursor-arrow-closehand - VApplication::restoreOverrideCursor(QStringLiteral("://cursor/cursor-arrow-closehand.png")); + VApplication::restoreOverrideCursor(cursorArrowCloseHand); } QGraphicsEllipseItem::mouseReleaseEvent(event); } diff --git a/src/app/visualization/vcontrolpointspline.h b/src/app/visualization/vcontrolpointspline.h index e72c78951..45d8b4268 100644 --- a/src/app/visualization/vcontrolpointspline.h +++ b/src/app/visualization/vcontrolpointspline.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vgraphicssimpletextitem.cpp b/src/app/visualization/vgraphicssimpletextitem.cpp index 49921e86b..5f4be0c90 100644 --- a/src/app/visualization/vgraphicssimpletextitem.cpp +++ b/src/app/visualization/vgraphicssimpletextitem.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -83,6 +83,21 @@ void VGraphicsSimpleTextItem::paint(QPainter *painter, const QStyleOptionGraphic QGraphicsSimpleTextItem::paint(painter, &myOption, widget); } +//--------------------------------------------------------------------------------------------------------------------- +void VGraphicsSimpleTextItem::setEnabled(bool enabled) +{ + QGraphicsSimpleTextItem::setEnabled(enabled); + const QPalette palet = this->scene()->palette(); + if (enabled) + { + setBrush(palet.brush(QPalette::Active, QPalette::Text)); + } + else + { + setBrush(palet.brush(QPalette::Disabled, QPalette::Text)); + } +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief itemChange handle item change. @@ -109,7 +124,7 @@ void VGraphicsSimpleTextItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event) { this->setBrush(Qt::green); - VApplication::setOverrideCursor(QStringLiteral("://cursor/cursor-arrow-openhand.png"), 1, 1); + VApplication::setOverrideCursor(cursorArrowOpenHand, 1, 1); QGraphicsSimpleTextItem::hoverEnterEvent(event); } @@ -124,7 +139,7 @@ void VGraphicsSimpleTextItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) this->setBrush(Qt::black); //Disable cursor-arrow-openhand - VApplication::restoreOverrideCursor(QStringLiteral("://cursor/cursor-arrow-openhand.png")); + VApplication::restoreOverrideCursor(cursorArrowOpenHand); QGraphicsSimpleTextItem::hoverLeaveEvent(event); } @@ -143,7 +158,7 @@ void VGraphicsSimpleTextItem::mousePressEvent(QGraphicsSceneMouseEvent *event) { if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick) { - VApplication::setOverrideCursor(QStringLiteral("://cursor/cursor-arrow-closehand.png"), 1, 1); + VApplication::setOverrideCursor(cursorArrowCloseHand, 1, 1); } QGraphicsSimpleTextItem::mousePressEvent(event); } @@ -154,7 +169,7 @@ void VGraphicsSimpleTextItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick) { //Disable cursor-arrow-closehand - VApplication::restoreOverrideCursor(QStringLiteral("://cursor/cursor-arrow-closehand.png")); + VApplication::restoreOverrideCursor(cursorArrowCloseHand); } QGraphicsSimpleTextItem::mouseReleaseEvent(event); } diff --git a/src/app/visualization/vgraphicssimpletextitem.h b/src/app/visualization/vgraphicssimpletextitem.h index daf3c9297..0b6a891a9 100644 --- a/src/app/visualization/vgraphicssimpletextitem.h +++ b/src/app/visualization/vgraphicssimpletextitem.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -47,6 +47,8 @@ public: virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); virtual int type() const {return Type;} enum { Type = UserType + static_cast(Vis::GraphicsSimpleTextItem)}; + + void setEnabled(bool enabled); signals: /** * @brief NameChangePosition emit when label change position. diff --git a/src/app/visualization/visline.cpp b/src/app/visualization/visline.cpp index 6a8371f22..6c8424784 100644 --- a/src/app/visualization/visline.cpp +++ b/src/app/visualization/visline.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/visline.h b/src/app/visualization/visline.h index d22389c3a..dfad23120 100644 --- a/src/app/visualization/visline.h +++ b/src/app/visualization/visline.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vispath.cpp b/src/app/visualization/vispath.cpp index 715d4000d..b93549394 100644 --- a/src/app/visualization/vispath.cpp +++ b/src/app/visualization/vispath.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vispath.h b/src/app/visualization/vispath.h index 4ac4e6fcb..a694d68fe 100644 --- a/src/app/visualization/vispath.h +++ b/src/app/visualization/vispath.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolalongline.cpp b/src/app/visualization/vistoolalongline.cpp index 4287bac2e..da845493f 100644 --- a/src/app/visualization/vistoolalongline.cpp +++ b/src/app/visualization/vistoolalongline.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolalongline.h b/src/app/visualization/vistoolalongline.h index 45d6d61e3..9225c1a69 100644 --- a/src/app/visualization/vistoolalongline.h +++ b/src/app/visualization/vistoolalongline.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolarc.cpp b/src/app/visualization/vistoolarc.cpp index dc0ee62b0..e4cad9c18 100644 --- a/src/app/visualization/vistoolarc.cpp +++ b/src/app/visualization/vistoolarc.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolarc.h b/src/app/visualization/vistoolarc.h index 5e44d0f1a..57fa4b66f 100644 --- a/src/app/visualization/vistoolarc.h +++ b/src/app/visualization/vistoolarc.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolbisector.cpp b/src/app/visualization/vistoolbisector.cpp index c98bb7fb5..d778bd151 100644 --- a/src/app/visualization/vistoolbisector.cpp +++ b/src/app/visualization/vistoolbisector.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolbisector.h b/src/app/visualization/vistoolbisector.h index be85db27b..5f8226a23 100644 --- a/src/app/visualization/vistoolbisector.h +++ b/src/app/visualization/vistoolbisector.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolcurveintersectaxis.cpp b/src/app/visualization/vistoolcurveintersectaxis.cpp index d3cabc903..62a222822 100644 --- a/src/app/visualization/vistoolcurveintersectaxis.cpp +++ b/src/app/visualization/vistoolcurveintersectaxis.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -92,7 +92,7 @@ QString VisToolCurveIntersectAxis::Angle() const } //--------------------------------------------------------------------------------------------------------------------- -void VisToolCurveIntersectAxis::setAngle(const QString &expression) +void VisToolCurveIntersectAxis::SetAngle(const QString &expression) { angle = FindVal(expression); } diff --git a/src/app/visualization/vistoolcurveintersectaxis.h b/src/app/visualization/vistoolcurveintersectaxis.h index d6481bf48..621e54342 100644 --- a/src/app/visualization/vistoolcurveintersectaxis.h +++ b/src/app/visualization/vistoolcurveintersectaxis.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -43,7 +43,7 @@ public: virtual void RefreshGeometry(); QString Angle() const; - void setAngle(const QString &expression); + void SetAngle(const QString &expression); void setAxisPointId(const quint32 &value); virtual int type() const {return Type;} diff --git a/src/app/visualization/vistoolcutarc.cpp b/src/app/visualization/vistoolcutarc.cpp index ba770361e..68b66c872 100644 --- a/src/app/visualization/vistoolcutarc.cpp +++ b/src/app/visualization/vistoolcutarc.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolcutarc.h b/src/app/visualization/vistoolcutarc.h index 84aa695be..755da9330 100644 --- a/src/app/visualization/vistoolcutarc.h +++ b/src/app/visualization/vistoolcutarc.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolcutspline.cpp b/src/app/visualization/vistoolcutspline.cpp index 204d1f740..c120ed622 100644 --- a/src/app/visualization/vistoolcutspline.cpp +++ b/src/app/visualization/vistoolcutspline.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolcutspline.h b/src/app/visualization/vistoolcutspline.h index 5967f3ba5..02c26d443 100644 --- a/src/app/visualization/vistoolcutspline.h +++ b/src/app/visualization/vistoolcutspline.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolcutsplinepath.cpp b/src/app/visualization/vistoolcutsplinepath.cpp index fcea7e2ee..5ef52c37d 100644 --- a/src/app/visualization/vistoolcutsplinepath.cpp +++ b/src/app/visualization/vistoolcutsplinepath.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -67,8 +67,8 @@ void VisToolCutSplinePath::RefreshGeometry() VSplinePoint splP1 = splPath->at(p1); VSplinePoint splP2 = splPath->at(p2); - const VSpline spl1 = VSpline(splP1.P(), spl1p2, spl1p3, p, splPath->getKCurve()); - const VSpline spl2 = VSpline(p, spl2p2, spl2p3, splP2.P(), splPath->getKCurve()); + const VSpline spl1 = VSpline(splP1.P(), spl1p2, spl1p3, p, splPath->GetKCurve()); + const VSpline spl2 = VSpline(p, spl2p2, spl2p3, splP2.P(), splPath->GetKCurve()); VSplinePath spPath1 = VSplinePath(); VSplinePath spPath2 = VSplinePath(); @@ -104,8 +104,8 @@ void VisToolCutSplinePath::RefreshGeometry() } } - spPath1.setKCurve(splPath->getKCurve()); - spPath2.setKCurve(splPath->getKCurve()); + spPath1.SetKCurve(splPath->GetKCurve()); + spPath2.SetKCurve(splPath->GetKCurve()); DrawPoint(point, cutPoint, mainColor); diff --git a/src/app/visualization/vistoolcutsplinepath.h b/src/app/visualization/vistoolcutsplinepath.h index 6dd4bdfcb..6a0a7fab9 100644 --- a/src/app/visualization/vistoolcutsplinepath.h +++ b/src/app/visualization/vistoolcutsplinepath.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolendline.cpp b/src/app/visualization/vistoolendline.cpp index 0bd977362..d9148150a 100644 --- a/src/app/visualization/vistoolendline.cpp +++ b/src/app/visualization/vistoolendline.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -72,7 +72,7 @@ QString VisToolEndLine::Angle() const } //--------------------------------------------------------------------------------------------------------------------- -void VisToolEndLine::setAngle(const QString &expression) +void VisToolEndLine::SetAngle(const QString &expression) { angle = FindVal(expression); } diff --git a/src/app/visualization/vistoolendline.h b/src/app/visualization/vistoolendline.h index 7b44f697f..0161bb6c9 100644 --- a/src/app/visualization/vistoolendline.h +++ b/src/app/visualization/vistoolendline.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -42,7 +42,7 @@ public: virtual void RefreshGeometry(); QString Angle() const; - void setAngle(const QString &expression); + void SetAngle(const QString &expression); void setLength(const QString &expression); virtual int type() const {return Type;} enum { Type = UserType + static_cast(Vis::ToolEndLine)}; diff --git a/src/app/visualization/vistoolheight.cpp b/src/app/visualization/vistoolheight.cpp index 60f0456c0..87044c8b3 100644 --- a/src/app/visualization/vistoolheight.cpp +++ b/src/app/visualization/vistoolheight.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolheight.h b/src/app/visualization/vistoolheight.h index 0b17b78bb..9666e4387 100644 --- a/src/app/visualization/vistoolheight.h +++ b/src/app/visualization/vistoolheight.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolline.cpp b/src/app/visualization/vistoolline.cpp index edcd4e763..b90c9e84c 100644 --- a/src/app/visualization/vistoolline.cpp +++ b/src/app/visualization/vistoolline.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolline.h b/src/app/visualization/vistoolline.h index b46c1a49c..fd45c2ef6 100644 --- a/src/app/visualization/vistoolline.h +++ b/src/app/visualization/vistoolline.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoollineintersect.cpp b/src/app/visualization/vistoollineintersect.cpp index 8b732e55a..72d858f4e 100644 --- a/src/app/visualization/vistoollineintersect.cpp +++ b/src/app/visualization/vistoollineintersect.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoollineintersect.h b/src/app/visualization/vistoollineintersect.h index b69d03ff7..8b7b7544d 100644 --- a/src/app/visualization/vistoollineintersect.h +++ b/src/app/visualization/vistoollineintersect.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoollineintersectaxis.cpp b/src/app/visualization/vistoollineintersectaxis.cpp index 371d46cad..8305d679f 100644 --- a/src/app/visualization/vistoollineintersectaxis.cpp +++ b/src/app/visualization/vistoollineintersectaxis.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -108,7 +108,7 @@ QString VisToolLineIntersectAxis::Angle() const } //--------------------------------------------------------------------------------------------------------------------- -void VisToolLineIntersectAxis::setAngle(const QString &expression) +void VisToolLineIntersectAxis::SetAngle(const QString &expression) { angle = FindVal(expression); } diff --git a/src/app/visualization/vistoollineintersectaxis.h b/src/app/visualization/vistoollineintersectaxis.h index f9f0f370e..d9950c492 100644 --- a/src/app/visualization/vistoollineintersectaxis.h +++ b/src/app/visualization/vistoollineintersectaxis.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -43,7 +43,7 @@ public: virtual void RefreshGeometry(); QString Angle() const; - void setAngle(const QString &expression); + void SetAngle(const QString &expression); void setPoint2Id(const quint32 &value); void setAxisPointId(const quint32 &value); diff --git a/src/app/visualization/vistoolnormal.cpp b/src/app/visualization/vistoolnormal.cpp index e9b5402c5..344232972 100644 --- a/src/app/visualization/vistoolnormal.cpp +++ b/src/app/visualization/vistoolnormal.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -104,13 +104,13 @@ void VisToolNormal::setLength(const QString &expression) } //--------------------------------------------------------------------------------------------------------------------- -qreal VisToolNormal::getAngle() const +qreal VisToolNormal::GetAngle() const { return angle; } //--------------------------------------------------------------------------------------------------------------------- -void VisToolNormal::setAngle(const qreal &value) +void VisToolNormal::SetAngle(const qreal &value) { angle = value; } diff --git a/src/app/visualization/vistoolnormal.h b/src/app/visualization/vistoolnormal.h index 1593d03f5..ae73725a9 100644 --- a/src/app/visualization/vistoolnormal.h +++ b/src/app/visualization/vistoolnormal.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -42,8 +42,8 @@ public: void setPoint2Id(const quint32 &value); void setLength(const QString &expression); - qreal getAngle() const; - void setAngle(const qreal &value); + qreal GetAngle() const; + void SetAngle(const qreal &value); virtual int type() const {return Type;} enum { Type = UserType + static_cast(Vis::ToolNormal)}; private: diff --git a/src/app/visualization/vistoolpointofcontact.cpp b/src/app/visualization/vistoolpointofcontact.cpp index e1db720eb..290623ec4 100644 --- a/src/app/visualization/vistoolpointofcontact.cpp +++ b/src/app/visualization/vistoolpointofcontact.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolpointofcontact.h b/src/app/visualization/vistoolpointofcontact.h index 4edc79ea0..c1a2b605e 100644 --- a/src/app/visualization/vistoolpointofcontact.h +++ b/src/app/visualization/vistoolpointofcontact.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolpointofintersection.cpp b/src/app/visualization/vistoolpointofintersection.cpp index 85c84af8a..a33ed5175 100644 --- a/src/app/visualization/vistoolpointofintersection.cpp +++ b/src/app/visualization/vistoolpointofintersection.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -48,12 +48,18 @@ VisToolPointOfIntersection::~VisToolPointOfIntersection() //--------------------------------------------------------------------------------------------------------------------- void VisToolPointOfIntersection::RefreshGeometry() { - if (point1Id > NULL_ID) + QLineF axisL1; + if (point1Id <= NULL_ID) + { + axisL1 = Axis(Visualization::scenePos, 90); + DrawLine(this, axisL1, supportColor, Qt::DashLine); + } + else { const QSharedPointer first = Visualization::data->GeometricObject(point1Id); DrawPoint(axisP1, first->toQPointF(), supportColor); - QLineF axisL1 = Axis(first->toQPointF(), 90); + axisL1 = Axis(first->toQPointF(), 90); DrawLine(this, axisL1, supportColor, Qt::DashLine); QLineF axisL2; diff --git a/src/app/visualization/vistoolpointofintersection.h b/src/app/visualization/vistoolpointofintersection.h index a2c594f75..dc8bb4b75 100644 --- a/src/app/visualization/vistoolpointofintersection.h +++ b/src/app/visualization/vistoolpointofintersection.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolshoulderpoint.cpp b/src/app/visualization/vistoolshoulderpoint.cpp index c6863176a..e107c13d0 100644 --- a/src/app/visualization/vistoolshoulderpoint.cpp +++ b/src/app/visualization/vistoolshoulderpoint.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolshoulderpoint.h b/src/app/visualization/vistoolshoulderpoint.h index bfda38bc5..b5b27e54b 100644 --- a/src/app/visualization/vistoolshoulderpoint.h +++ b/src/app/visualization/vistoolshoulderpoint.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolspline.cpp b/src/app/visualization/vistoolspline.cpp index 92562e751..c56708c71 100644 --- a/src/app/visualization/vistoolspline.cpp +++ b/src/app/visualization/vistoolspline.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -84,31 +84,31 @@ void VisToolSpline::setPoint4Id(const quint32 &value) } //--------------------------------------------------------------------------------------------------------------------- -void VisToolSpline::setAngle1(const qreal &value) +void VisToolSpline::SetAngle1(const qreal &value) { angle1 = value; } //--------------------------------------------------------------------------------------------------------------------- -void VisToolSpline::setAngle2(const qreal &value) +void VisToolSpline::SetAngle2(const qreal &value) { angle2 = value; } //--------------------------------------------------------------------------------------------------------------------- -void VisToolSpline::setKAsm1(const qreal &value) +void VisToolSpline::SetKAsm1(const qreal &value) { kAsm1 = value; } //--------------------------------------------------------------------------------------------------------------------- -void VisToolSpline::setKAsm2(const qreal &value) +void VisToolSpline::SetKAsm2(const qreal &value) { kAsm2 = value; } //--------------------------------------------------------------------------------------------------------------------- -void VisToolSpline::setKCurve(const qreal &value) +void VisToolSpline::SetKCurve(const qreal &value) { kCurve = value; } diff --git a/src/app/visualization/vistoolspline.h b/src/app/visualization/vistoolspline.h index 56c12d021..6c48dcdd5 100644 --- a/src/app/visualization/vistoolspline.h +++ b/src/app/visualization/vistoolspline.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -41,11 +41,11 @@ public: virtual void RefreshGeometry(); void setPoint4Id(const quint32 &value); - void setAngle1(const qreal &value); - void setAngle2(const qreal &value); - void setKAsm1(const qreal &value); - void setKAsm2(const qreal &value); - void setKCurve(const qreal &value); + void SetAngle1(const qreal &value); + void SetAngle2(const qreal &value); + void SetKAsm1(const qreal &value); + void SetKAsm2(const qreal &value); + void SetKCurve(const qreal &value); virtual int type() const {return Type;} enum { Type = UserType + static_cast(Vis::ToolSpline)}; diff --git a/src/app/visualization/vistoolsplinepath.cpp b/src/app/visualization/vistoolsplinepath.cpp index 108f73c54..73261cf55 100644 --- a/src/app/visualization/vistoolsplinepath.cpp +++ b/src/app/visualization/vistoolsplinepath.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistoolsplinepath.h b/src/app/visualization/vistoolsplinepath.h index be9dc2b3c..8817805cf 100644 --- a/src/app/visualization/vistoolsplinepath.h +++ b/src/app/visualization/vistoolsplinepath.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistooltriangle.cpp b/src/app/visualization/vistooltriangle.cpp index d646a9056..373705bc7 100644 --- a/src/app/visualization/vistooltriangle.cpp +++ b/src/app/visualization/vistooltriangle.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vistooltriangle.h b/src/app/visualization/vistooltriangle.h index a15defaf7..4cfb698e0 100644 --- a/src/app/visualization/vistooltriangle.h +++ b/src/app/visualization/vistooltriangle.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/visualization.cpp b/src/app/visualization/visualization.cpp index fe86684f4..6050fc7f0 100644 --- a/src/app/visualization/visualization.cpp +++ b/src/app/visualization/visualization.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/visualization.h b/src/app/visualization/visualization.h index c63527d24..1c398bfd5 100644 --- a/src/app/visualization/visualization.h +++ b/src/app/visualization/visualization.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/visualization/vsimplecurve.cpp b/src/app/visualization/vsimplecurve.cpp index 92ba03fba..4a2661d2e 100644 --- a/src/app/visualization/vsimplecurve.cpp +++ b/src/app/visualization/vsimplecurve.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -40,18 +40,18 @@ * @param currentColor current color. * @param parent parent object. */ -VSimpleCurve::VSimpleCurve(quint32 id, Qt::GlobalColor *currentColor, SimpleCurvePoint pointPosition, qreal *factor, +VSimpleCurve::VSimpleCurve(quint32 id, QColor currentColor, SimpleCurvePoint pointPosition, qreal *factor, QObject *parent) :QObject(parent), QGraphicsPathItem(), id (id), factor(factor), currentColor(currentColor), - curvePosition(pointPosition) + curvePosition(pointPosition), enabled(true) { if (factor == nullptr) { - setPen(QPen(Qt::black, qApp->toPixel(qApp->widthHairLine()))); + setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine()))); } else { - setPen(QPen(Qt::black, qApp->toPixel(qApp->widthHairLine())/ *factor)); + setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/ *factor)); } setFlag(QGraphicsItem::ItemIsSelectable, true); setAcceptHoverEvents(true); @@ -60,9 +60,9 @@ VSimpleCurve::VSimpleCurve(quint32 id, Qt::GlobalColor *currentColor, SimpleCurv //--------------------------------------------------------------------------------------------------------------------- void VSimpleCurve::ChangedActivDraw(const bool &flag) { - setFlag(QGraphicsItem::ItemIsSelectable, flag); - setAcceptHoverEvents(flag); - setPen(QPen(*currentColor, qApp->toPixel(qApp->widthHairLine())/ *factor)); + enabled = flag; + setEnabled(enabled); + setPen(QPen(CorrectColor(currentColor), qApp->toPixel(qApp->widthHairLine())/ *factor)); } //--------------------------------------------------------------------------------------------------------------------- @@ -102,11 +102,11 @@ void VSimpleCurve::hoverMoveEvent(QGraphicsSceneHoverEvent *event) Q_UNUSED(event); if (factor == nullptr) { - this->setPen(QPen(*currentColor, qApp->toPixel(qApp->widthMainLine()))); + this->setPen(QPen(CorrectColor(currentColor), qApp->toPixel(qApp->widthMainLine()))); } else { - this->setPen(QPen(*currentColor, qApp->toPixel(qApp->widthMainLine())/ *factor)); + this->setPen(QPen(CorrectColor(currentColor), qApp->toPixel(qApp->widthMainLine())/ *factor)); } emit HoverPath(id, curvePosition, PathDirection::Show); } @@ -121,12 +121,44 @@ void VSimpleCurve::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) Q_UNUSED(event); if (factor == nullptr) { - this->setPen(QPen(*currentColor, qApp->toPixel(qApp->widthHairLine()))); + this->setPen(QPen(CorrectColor(currentColor), qApp->toPixel(qApp->widthHairLine()))); } else { - this->setPen(QPen(*currentColor, qApp->toPixel(qApp->widthHairLine())/ *factor)); + this->setPen(QPen(CorrectColor(currentColor), qApp->toPixel(qApp->widthHairLine())/ *factor)); } emit HoverPath(id, curvePosition, PathDirection::Hide); } + +//--------------------------------------------------------------------------------------------------------------------- +QColor VSimpleCurve::GetCurrentColor() const +{ + return currentColor; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VSimpleCurve::SetCurrentColor(const QColor &value) +{ + currentColor = value; + setPen(QPen(CorrectColor(currentColor), pen().widthF())); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VSimpleCurve::mousePressEvent(QGraphicsSceneMouseEvent *event) +{ + event->ignore(); +} + +//--------------------------------------------------------------------------------------------------------------------- +QColor VSimpleCurve::CorrectColor(const QColor &color) const +{ + if (enabled) + { + return color; + } + else + { + return Qt::gray; + } +} diff --git a/src/app/visualization/vsimplecurve.h b/src/app/visualization/vsimplecurve.h index d33afb269..1c33c6990 100644 --- a/src/app/visualization/vsimplecurve.h +++ b/src/app/visualization/vsimplecurve.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -41,13 +41,17 @@ class VSimpleCurve : public QObject, public QGraphicsPathItem { Q_OBJECT public: - VSimpleCurve(quint32 id, Qt::GlobalColor *currentColor, SimpleCurvePoint curvePosition, + VSimpleCurve(quint32 id, QColor currentColor, SimpleCurvePoint curvePosition, qreal *factor = nullptr, QObject *parent = 0); void ChangedActivDraw(const bool &flag); virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0); virtual int type() const {return Type;} enum { Type = UserType + static_cast(Vis::SimpleSplinePath)}; + + QColor GetCurrentColor() const; + void SetCurrentColor(const QColor &value); + signals: /** * @brief Choosed send id when clicked. @@ -56,6 +60,7 @@ signals: void Choosed(quint32 id); void HoverPath(quint32 id, SimpleCurvePoint curvePosition, PathDirection direction); protected: + virtual void mousePressEvent(QGraphicsSceneMouseEvent * event); virtual void mouseReleaseEvent ( QGraphicsSceneMouseEvent * event ); virtual void hoverMoveEvent ( QGraphicsSceneHoverEvent * event ); virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event ); @@ -68,9 +73,13 @@ private: qreal *factor; /** @brief currentColor current color. */ - Qt::GlobalColor *currentColor; + QColor currentColor; SimpleCurvePoint curvePosition; + + bool enabled; + + QColor CorrectColor(const QColor &color) const; }; #endif // VSIMPLECURVE_H diff --git a/src/app/widgets/doubledelegate.cpp b/src/app/widgets/doubledelegate.cpp index 981ad3d0d..46feb8e09 100644 --- a/src/app/widgets/doubledelegate.cpp +++ b/src/app/widgets/doubledelegate.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -53,6 +53,7 @@ QWidget *DoubleSpinBoxDelegate::createEditor(QWidget *parent, const QStyleOption Q_UNUSED(index); emit NewLastValue(-10001.0);//Here need reset value to default because we begin work with new item QDoubleSpinBox *editor = new QDoubleSpinBox(parent); + editor->setLocale(parent->locale()); editor->setMinimum(-10000.0); editor->setMaximum(10000.0); connect(editor, &QDoubleSpinBox::editingFinished, this, &DoubleSpinBoxDelegate::commitAndCloseEditor); diff --git a/src/app/widgets/doubledelegate.h b/src/app/widgets/doubledelegate.h index 68557de9d..790be3ae5 100644 --- a/src/app/widgets/doubledelegate.h +++ b/src/app/widgets/doubledelegate.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/widgets/textdelegate.cpp b/src/app/widgets/textdelegate.cpp index 296dd1507..860175bb6 100644 --- a/src/app/widgets/textdelegate.cpp +++ b/src/app/widgets/textdelegate.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -58,6 +58,7 @@ QWidget *TextDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem Q_UNUSED(option); Q_UNUSED(index); QLineEdit *editor = new QLineEdit(parent); + editor->setLocale(parent->locale()); //Same regex pattern in xsd file editor->setValidator( new QRegExpValidator(QRegExp(regex)) ); connect(editor, &QLineEdit::editingFinished, this, &TextDelegate::commitAndCloseEditor); diff --git a/src/app/widgets/textdelegate.h b/src/app/widgets/textdelegate.h index 974579ed7..d19012d7e 100644 --- a/src/app/widgets/textdelegate.h +++ b/src/app/widgets/textdelegate.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/widgets/vformulaproperty.cpp b/src/app/widgets/vformulaproperty.cpp index 444a9fca6..c9f468e46 100644 --- a/src/app/widgets/vformulaproperty.cpp +++ b/src/app/widgets/vformulaproperty.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -94,8 +94,8 @@ QWidget* VFormulaProperty::createEditor(QWidget* parent, const QStyleOptionViewI VFormula formula = VProperty::d_ptr->VariantValue.value(); VFormulaPropertyEditor* tmpEditor = new VFormulaPropertyEditor(parent); - - tmpEditor->setFormula(formula); + tmpEditor->setLocale(parent->locale()); + tmpEditor->SetFormula(formula); VProperty::d_ptr->editor = tmpEditor; return VProperty::d_ptr->editor; } @@ -108,7 +108,7 @@ bool VFormulaProperty::setEditorData(QWidget* editor) if (tmpWidget) { VFormula formula = VProperty::d_ptr->VariantValue.value(); - tmpWidget->setFormula(formula); + tmpWidget->SetFormula(formula); } else return false; @@ -124,7 +124,7 @@ QVariant VFormulaProperty::getEditorData(const QWidget *editor) const if (tmpWidget) { QVariant value; - value.setValue(tmpWidget->getFormula()); + value.setValue(tmpWidget->GetFormula()); return value; } @@ -163,26 +163,26 @@ VProperty *VFormulaProperty::clone(bool include_children, VProperty *container) void VFormulaProperty::setValue(const QVariant &value) { VFormula tmpFormula = value.value(); - setFormula(tmpFormula); + SetFormula(tmpFormula); } //--------------------------------------------------------------------------------------------------------------------- QVariant VFormulaProperty::getValue() const { - VFormula tmpFormula = getFormula(); + VFormula tmpFormula = GetFormula(); QVariant value; value.setValue(tmpFormula); return value; } //--------------------------------------------------------------------------------------------------------------------- -VFormula VFormulaProperty::getFormula() const +VFormula VFormulaProperty::GetFormula() const { return VProperty::d_ptr->VariantValue.value(); } //--------------------------------------------------------------------------------------------------------------------- -void VFormulaProperty::setFormula(const VFormula &formula) +void VFormulaProperty::SetFormula(const VFormula &formula) { if (d_ptr->Children.count() < 2) { @@ -197,7 +197,7 @@ void VFormulaProperty::setFormula(const VFormula &formula) QVariant tmpValue(formula.getStringValue()); tmpValue.convert(QVariant::String); - QVariant tmpFormula(formula.getFormula()); + QVariant tmpFormula(formula.GetFormula()); tmpFormula.convert(QVariant::String); VProperty::d_ptr->Children.at(0)->setValue(tmpValue); @@ -213,8 +213,8 @@ void VFormulaProperty::ValueChildChanged(const QVariant &value, int typeForParen { if (typeForParent == static_cast(ChildType::Formula)) { - VFormula newFormula = getFormula(); - newFormula.setFormula(value.toString()); - setFormula(newFormula); + VFormula newFormula = GetFormula(); + newFormula.SetFormula(value.toString(), FormulaType::FromUser); + SetFormula(newFormula); } } diff --git a/src/app/widgets/vformulaproperty.h b/src/app/widgets/vformulaproperty.h index 90c177aed..ee63ee3cd 100644 --- a/src/app/widgets/vformulaproperty.h +++ b/src/app/widgets/vformulaproperty.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -76,10 +76,10 @@ public: virtual QVariant getValue() const; //! Returns the formula - virtual VFormula getFormula() const; + virtual VFormula GetFormula() const; //! Sets the formula - virtual void setFormula(const VFormula &formula); + virtual void SetFormula(const VFormula &formula); public slots: virtual void ValueChildChanged(const QVariant &value, int typeForParent); diff --git a/src/app/widgets/vformulapropertyeditor.cpp b/src/app/widgets/vformulapropertyeditor.cpp index 7030ae7fa..930da6272 100644 --- a/src/app/widgets/vformulapropertyeditor.cpp +++ b/src/app/widgets/vformulapropertyeditor.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -73,7 +73,7 @@ VFormulaPropertyEditor::VFormulaPropertyEditor(QWidget *parent) } //--------------------------------------------------------------------------------------------------------------------- -void VFormulaPropertyEditor::setFormula(const VFormula& formula) +void VFormulaPropertyEditor::SetFormula(const VFormula& formula) { if (this->formula != formula) { @@ -89,11 +89,11 @@ void VFormulaPropertyEditor::onToolButtonClicked() qApp->getMainWindow()); tmpWidget->setCheckZero(formula.getCheckZero()); tmpWidget->setPostfix(formula.getPostfix()); - tmpWidget->setFormula(formula.getFormula(FormulaType::FromUser)); + tmpWidget->SetFormula(formula.GetFormula(FormulaType::FromUser)); if (tmpWidget->exec() == QDialog::Accepted) { - formula.setFormula(tmpWidget->getFormula(), FormulaType::ToUser); + formula.SetFormula(tmpWidget->GetFormula(), FormulaType::ToUser); TextLabel->setText(formula.getStringValue()); delete tmpWidget; emit dataChangedByUser(formula, this); @@ -122,7 +122,7 @@ VFormulaPropertyEditor::~VFormulaPropertyEditor() } //--------------------------------------------------------------------------------------------------------------------- -VFormula VFormulaPropertyEditor::getFormula() const +VFormula VFormulaPropertyEditor::GetFormula() const { return formula; } diff --git a/src/app/widgets/vformulapropertyeditor.h b/src/app/widgets/vformulapropertyeditor.h index e7a1ab291..e3d25b0c9 100644 --- a/src/app/widgets/vformulapropertyeditor.h +++ b/src/app/widgets/vformulapropertyeditor.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -49,20 +49,20 @@ public: virtual ~VFormulaPropertyEditor(); //! Returns the formula currently set - VFormula getFormula() const; + VFormula GetFormula() const; //! Needed for proper event handling bool eventFilter(QObject *obj, QEvent *ev); signals: //! This is emitted, when the user changes the color - void dataChangedByUser(const VFormula &getFormula, VFormulaPropertyEditor* editor); + void dataChangedByUser(const VFormula &GetFormula, VFormulaPropertyEditor* editor); void dataChanged(); public slots: //! Sets the color of the widget - void setFormula(const VFormula &formula); + void SetFormula(const VFormula &formula); private slots: void onToolButtonClicked(); diff --git a/src/app/widgets/vitem.cpp b/src/app/widgets/vitem.cpp deleted file mode 100644 index b70c06833..000000000 --- a/src/app/widgets/vitem.cpp +++ /dev/null @@ -1,135 +0,0 @@ -/************************************************************************ - ** - ** @file vitem.cpp - ** @author Roman Telezhynskyi - ** @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 - ** 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 . - ** - *************************************************************************/ - -#include "vitem.h" - -#include -#include -#include "../core/vapplication.h" - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief VItem constructor. - * @param path detail path. - * @param numInList index in list of details. - * @param parent parent object. - */ -VItem::VItem (const QPainterPath & path, int numInList, QGraphicsItem * parent ) - :QGraphicsPathItem ( path, parent ), numInOutList(numInList), paper(nullptr) -{} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief VItem default constructor. - */ -VItem::VItem():numInOutList(0), paper(nullptr) -{} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief VItem constructor. - * @param numInList index in list of details. - * @param parent parent object. - */ -VItem::VItem(int numInList, QGraphicsItem *parent):QGraphicsPathItem (parent), numInOutList(numInList), - paper(nullptr) -{} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief checkItemChange check item change. If detail create colission or moved out paper emit signal. - */ -void VItem::checkItemChange() -{ - QRectF rect; - if (paper == nullptr) - { - qDebug()<<"Don't set paper for detail!!!!"; - rect = this->scene()->sceneRect(); - } - else - { - rect = paper->sceneBoundingRect(); - } - QRectF myrect = sceneBoundingRect(); - if ( rect.contains( myrect )==true ) - { - setPen(QPen(Qt::black, qApp->toPixel(qApp->widthMainLine()))); - emit itemOut( numInOutList, false ); - } - else - { - setPen(QPen(Qt::red, qApp->toPixel(qApp->widthMainLine()))); - emit itemOut( numInOutList, true ); - } - QList list = QGraphicsItem::collidingItems (); - if ( list.size() - 2 > 0 ) - { - list.append( this ); - setPen(QPen(Qt::red, qApp->toPixel(qApp->widthMainLine()))); - emit itemColliding( list, 1 );//Detail intersect with other details. - } - else - { - QList itemList; - itemList.append( this ); - emit itemColliding( itemList, 0 );//Detail doesn't intersect more with other details. - } - //qDebug()<<"list="< - ** @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 - ** 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 . - ** - *************************************************************************/ - -#ifndef VITEM_H -#define VITEM_H - -#include -#include - -/** - * @brief VItem class detail on layout table. - */ -class VItem : public QObject, public QGraphicsPathItem -{ - Q_OBJECT -public: - VItem (); - VItem (int numInList, QGraphicsItem * parent = nullptr); - VItem ( const QPainterPath & path, int numInList, QGraphicsItem * parent = nullptr ); - /** - * @brief getPaper return pointer to paper sheet. - * @return pointer to paper sheet. - */ - QGraphicsRectItem *getPaper() const {return paper;} - /** - * @brief setPaper set pointer to paper sheet. - * @param value pointer to paper sheet. - */ - void setPaper(QGraphicsRectItem *value) {paper = value;} -public slots: - void LengthChanged(); - void SetIndexInList( qint32 index ); -protected: - QVariant itemChange ( GraphicsItemChange change, const QVariant &value ); - void checkItemChange (); -private: - Q_DISABLE_COPY(VItem) - /** @brief numInOutList index in list. */ - qint32 numInOutList; - - /** @brief paper pointer to paper item. */ - QGraphicsRectItem* paper; -signals: - /** - * @brief itemOut emit if detail moved out paper. Detail send this signal each time when was moved. - * @param numInOutList index in list. - * @param flag true if moved out. false if not. - */ - void itemOut ( int numInOutList, bool flag ); - /** - * @brief itemColliding emit if change create colission. - * @param list list with all colission detalis. - * @param number 1 - colission exist, 0 - colission doesn't exist. - */ - void itemColliding ( QList list, int number ); -}; - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief SetIndexInList set detail index in list. - * @param index index in list. - */ -inline void VItem::SetIndexInList(qint32 index) -{ - numInOutList = index; -} -#endif // VITEM_H diff --git a/src/app/widgets/vmaingraphicsscene.cpp b/src/app/widgets/vmaingraphicsscene.cpp index 7ecad701f..c93a2392d 100644 --- a/src/app/widgets/vmaingraphicsscene.cpp +++ b/src/app/widgets/vmaingraphicsscene.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -126,3 +126,9 @@ void VMainGraphicsScene::SetFactor(qreal factor) scaleFactor=scaleFactor*factor; emit NewFactor(scaleFactor); } + +//--------------------------------------------------------------------------------------------------------------------- +void VMainGraphicsScene::EnableItemMove(bool move) +{ + emit EnableToolMove(move); +} diff --git a/src/app/widgets/vmaingraphicsscene.h b/src/app/widgets/vmaingraphicsscene.h index 96288c0ca..cde39f846 100644 --- a/src/app/widgets/vmaingraphicsscene.h +++ b/src/app/widgets/vmaingraphicsscene.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -52,6 +52,7 @@ public: public slots: void ChoosedItem(quint32 id, const SceneObject &type); void SetFactor(qreal factor); + void EnableItemMove(bool move); protected: virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event); virtual void mousePressEvent(QGraphicsSceneMouseEvent *event); @@ -78,6 +79,7 @@ signals: */ void NewFactor(qreal factor); void DisableItem(bool disable); + void EnableToolMove(bool move); private: /** @brief horScrollBar value horizontal scroll bar. */ qint32 horScrollBar; diff --git a/src/app/widgets/vmaingraphicsview.cpp b/src/app/widgets/vmaingraphicsview.cpp index 198c95f53..e01a1d685 100644 --- a/src/app/widgets/vmaingraphicsview.cpp +++ b/src/app/widgets/vmaingraphicsview.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/widgets/vmaingraphicsview.h b/src/app/widgets/vmaingraphicsview.h index 706648197..cb0a488fa 100644 --- a/src/app/widgets/vmaingraphicsview.h +++ b/src/app/widgets/vmaingraphicsview.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/widgets/vtablegraphicsview.cpp b/src/app/widgets/vtablegraphicsview.cpp index e2028e54a..c4ac8b003 100644 --- a/src/app/widgets/vtablegraphicsview.cpp +++ b/src/app/widgets/vtablegraphicsview.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/widgets/vtablegraphicsview.h b/src/app/widgets/vtablegraphicsview.h index 6b523c71f..9bb837f42 100644 --- a/src/app/widgets/vtablegraphicsview.h +++ b/src/app/widgets/vtablegraphicsview.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/widgets/vtooloptionspropertybrowser.cpp b/src/app/widgets/vtooloptionspropertybrowser.cpp index b3cae144e..77e069795 100644 --- a/src/app/widgets/vtooloptionspropertybrowser.cpp +++ b/src/app/widgets/vtooloptionspropertybrowser.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -232,6 +232,14 @@ void VToolOptionsPropertyBrowser::UpdateOptions() } } +//--------------------------------------------------------------------------------------------------------------------- +void VToolOptionsPropertyBrowser::RefreshOptions() +{ + QGraphicsItem *item = currentItem; + itemClicked(nullptr);//close options + itemClicked(item);//reopen options +} + //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::userChangedData(VProperty *property) { @@ -367,7 +375,7 @@ void VToolOptionsPropertyBrowser::AddPropertyFormula(const QString &propertyName const QString &attrName) { VFormulaProperty* itemLength = new VFormulaProperty(propertyName); - itemLength->setFormula(formula); + itemLength->SetFormula(formula); AddProperty(itemLength, attrName); } @@ -382,12 +390,12 @@ void VToolOptionsPropertyBrowser::AddPropertyPointName(Tool *i, const QString &p //--------------------------------------------------------------------------------------------------------------------- template -void VToolOptionsPropertyBrowser::AddPropertyLineType(Tool *i, const QString &propertyName) +void VToolOptionsPropertyBrowser::AddPropertyLineType(Tool *i, const QString &propertyName, + const QMap &styles) { - VEnumProperty *lineTypeProperty = new VEnumProperty(propertyName); - QStringList styles = VAbstractTool::Styles(); - lineTypeProperty->setLiterals(styles); - qint32 index = styles.indexOf(i->getLineType()); + VLineTypeProperty *lineTypeProperty = new VLineTypeProperty(propertyName); + lineTypeProperty->setStyles(styles); + const qint32 index = VLineTypeProperty::IndexOfStyle(styles, i->getLineType()); if (index == -1) { qWarning()<<"Can't find line style" << i->getLineType()<<"in list"; @@ -396,6 +404,22 @@ void VToolOptionsPropertyBrowser::AddPropertyLineType(Tool *i, const QString &pr AddProperty(lineTypeProperty, VAbstractTool::AttrTypeLine); } +//--------------------------------------------------------------------------------------------------------------------- +template +void VToolOptionsPropertyBrowser::AddPropertyLineColor(Tool *i, const QString &propertyName, + const QMap &colors, const QString &id) +{ + VLineColorProperty *lineColorProperty = new VLineColorProperty(propertyName); + lineColorProperty->setColors(colors); + const qint32 index = VLineColorProperty::IndexOfColor(colors, i->GetLineColor()); + if (index == -1) + { + qWarning()<<"Can't find line style" << i->GetLineColor()<<"in list"; + } + lineColorProperty->setValue(index); + AddProperty(lineColorProperty, id); +} + //--------------------------------------------------------------------------------------------------------------------- template void VToolOptionsPropertyBrowser::SetPointName(const QString &name) @@ -469,13 +493,16 @@ void VToolOptionsPropertyBrowser::ChangeDataToolEndLine(VProperty *property) SetPointName(value.toString()); break; case 3: // VAbstractTool::AttrTypeLine - i->setTypeLine(value.toString()); + i->SetTypeLine(value.toString()); + break; + case 26: // VAbstractTool::AttrTypeLineColor + i->SetLineColor(value.toString()); break; case 4: // VAbstractTool::AttrLength - i->setFormulaLength(value.value()); + i->SetFormulaLength(value.value()); break; case 5: // VAbstractTool::AttrAngle - i->setFormulaAngle(value.value()); + i->SetFormulaAngle(value.value()); break; default: qWarning()<<"Unknown property type. id = "<(value.toString()); break; case 3: // VAbstractTool::AttrTypeLine - i->setTypeLine(value.toString()); + i->SetTypeLine(value.toString()); + break; + case 26: // VAbstractTool::AttrTypeLineColor + i->SetLineColor(value.toString()); break; case 4: // VAbstractTool::AttrLength - i->setFormulaLength(value.value()); + i->SetFormulaLength(value.value()); break; default: qWarning()<<"Unknown property type. id = "<setFormulaRadius(value.value()); + i->SetFormulaRadius(value.value()); break; case 9: // VAbstractTool::AttrAngle1 - i->setFormulaF1(value.value()); + i->SetFormulaF1(value.value()); break; case 10: // VAbstractTool::AttrAngle2 - i->setFormulaF2(value.value()); + i->SetFormulaF2(value.value()); + break; + case 27: // VAbstractTool::AttrTypeColor + i->SetLineColor(value.toString()); break; default: qWarning()<<"Unknown property type. id = "<(value.toString()); break; case 4: // VAbstractTool::AttrLength - i->setFormulaLength(value.value()); + i->SetFormulaLength(value.value()); break; case 3: // VAbstractTool::AttrTypeLine - i->setTypeLine(value.toString()); + i->SetTypeLine(value.toString()); + break; + case 26: // VAbstractTool::AttrTypeLineColor + i->SetLineColor(value.toString()); break; default: qWarning()<<"Unknown property type. id = "<(value.toString()); break; case 4: // VAbstractTool::AttrLength - i->setFormula(value.value()); + i->SetFormula(value.value()); + break; + case 27: // VAbstractTool::AttrTypeColor + i->SetLineColor(value.toString()); break; default: qWarning()<<"Unknown property type. id = "<(value.toString()); break; case 4: // VAbstractTool::AttrLength - i->setFormula(value.value()); + i->SetFormula(value.value()); + break; + case 27: // VAbstractTool::AttrTypeColor + i->SetLineColor(value.toString()); break; default: qWarning()<<"Unknown property type. id = "<(value.toString()); break; case 4: // VAbstractTool::AttrLength - i->setFormula(value.value()); + i->SetFormula(value.value()); + break; + case 27: // VAbstractTool::AttrTypeColor + i->SetLineColor(value.toString()); break; default: qWarning()<<"Unknown property type. id = "<(value.toString()); break; case 3: // VAbstractTool::AttrTypeLine - i->setTypeLine(value.toString()); + i->SetTypeLine(value.toString()); + break; + case 26: // VAbstractTool::AttrTypeLineColor + i->SetLineColor(value.toString()); break; default: qWarning()<<"Unknown property type. id = "<setTypeLine(value.toString()); + i->SetTypeLine(value.toString()); + break; + case 26: // VAbstractTool::AttrTypeLineColor + i->SetLineColor(value.toString()); break; default: qWarning()<<"Unknown property type. id = "<setFormulaLength(value.value()); + i->SetFormulaLength(value.value()); break; case 0: // VAbstractTool::AttrName SetPointName(value.toString()); break; case 5: // VAbstractTool::AttrAngle - i->setAngle(value.toDouble()); + i->SetAngle(value.toDouble()); break; case 3: // VAbstractTool::AttrTypeLine - i->setTypeLine(value.toString()); + i->SetTypeLine(value.toString()); + break; + case 26: // VAbstractTool::AttrTypeLineColor + i->SetLineColor(value.toString()); break; default: qWarning()<<"Unknown property type. id = "<setFormulaLength(value.value()); + i->SetFormulaLength(value.value()); break; case 0: // VAbstractTool::AttrName SetPointName(value.toString()); break; case 3: // VAbstractTool::AttrTypeLine - i->setTypeLine(value.toString()); + i->SetTypeLine(value.toString()); + break; + case 26: // VAbstractTool::AttrTypeLineColor + i->SetLineColor(value.toString()); break; default: qWarning()<<"Unknown property type. id = "<setSpline(spl); break; } + case 27: // VAbstractTool::AttrTypeColor + i->SetLineColor(value.toString()); + break; default: qWarning()<<"Unknown property type. id = "<getSplinePath(); - splPath.setKCurve(value.toDouble()); + splPath.SetKCurve(value.toDouble()); i->setSplinePath(splPath); break; } + case 27: // VAbstractTool::AttrTypeColor + i->SetLineColor(value.toString()); + break; default: qWarning()<<"Unknown property type. id = "<(value.toString()); break; case 3: // VAbstractTool::AttrTypeLine - i->setTypeLine(value.toString()); + i->SetTypeLine(value.toString()); + break; + case 26: // VAbstractTool::AttrTypeLineColor + i->SetLineColor(value.toString()); break; case 5: // VAbstractTool::AttrAngle - i->setFormulaAngle(value.value()); + i->SetFormulaAngle(value.value()); break; default: qWarning()<<"Unknown property type. id = "<(value.toString()); break; case 3: // VAbstractTool::AttrTypeLine - i->setTypeLine(value.toString()); + i->SetTypeLine(value.toString()); + break; + case 26: // VAbstractTool::AttrTypeLineColor + i->SetLineColor(value.toString()); break; case 5: // VAbstractTool::AttrAngle - i->setFormulaAngle(value.value()); + i->SetFormulaAngle(value.value()); break; default: qWarning()<<"Unknown property type. id = "<setTitle(tr("Point at distance and angle")); AddPropertyPointName(i, tr("Point label")); - AddPropertyLineType(i, tr("Line type")); - AddPropertyFormula(tr("Length"), i->getFormulaLength(), VAbstractTool::AttrLength); - AddPropertyFormula(tr("Angle"), i->getFormulaAngle(), VAbstractTool::AttrAngle); + AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics()); + AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), VAbstractTool::AttrLineColor); + AddPropertyFormula(tr("Length"), i->GetFormulaLength(), VAbstractTool::AttrLength); + AddPropertyFormula(tr("Angle"), i->GetFormulaAngle(), VAbstractTool::AttrAngle); } //--------------------------------------------------------------------------------------------------------------------- @@ -958,8 +1028,9 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolAlongLine(QGraphicsItem *item) formView->setTitle(tr("Point at distance along line")); AddPropertyPointName(i, tr("Point label")); - AddPropertyLineType(i, tr("Line type")); - AddPropertyFormula(tr("Length"), i->getFormulaLength(), VAbstractTool::AttrLength); + AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics()); + AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), VAbstractTool::AttrLineColor); + AddPropertyFormula(tr("Length"), i->GetFormulaLength(), VAbstractTool::AttrLength); } //--------------------------------------------------------------------------------------------------------------------- @@ -969,9 +1040,10 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolArc(QGraphicsItem *item) i->ShowVisualization(true); formView->setTitle(tr("Arc")); - AddPropertyFormula(tr("Radius"), i->getFormulaRadius(), VAbstractTool::AttrRadius); - AddPropertyFormula(tr("First angle"), i->getFormulaF1(), VAbstractTool::AttrAngle1); - AddPropertyFormula(tr("Second angle"), i->getFormulaF2(), VAbstractTool::AttrAngle2); + AddPropertyFormula(tr("Radius"), i->GetFormulaRadius(), VAbstractTool::AttrRadius); + AddPropertyFormula(tr("First angle"), i->GetFormulaF1(), VAbstractTool::AttrAngle1); + AddPropertyFormula(tr("Second angle"), i->GetFormulaF2(), VAbstractTool::AttrAngle2); + AddPropertyLineColor(i, tr("Color"), VAbstractTool::ColorsList(), VAbstractTool::AttrColor); } //--------------------------------------------------------------------------------------------------------------------- @@ -982,8 +1054,9 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolBisector(QGraphicsItem *item) formView->setTitle(tr("Point along bisector")); AddPropertyPointName(i, tr("Point label")); - AddPropertyLineType(i, tr("Line type")); - AddPropertyFormula(tr("Length"), i->getFormulaLength(), VAbstractTool::AttrLength); + AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics()); + AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), VAbstractTool::AttrLineColor); + AddPropertyFormula(tr("Length"), i->GetFormulaLength(), VAbstractTool::AttrLength); } //--------------------------------------------------------------------------------------------------------------------- @@ -994,7 +1067,8 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolCutArc(QGraphicsItem *item) formView->setTitle(tr("Cut arc tool")); AddPropertyPointName(i, tr("Point label")); - AddPropertyFormula(tr("Length"), i->getFormula(), VAbstractTool::AttrLength); + AddPropertyFormula(tr("Length"), i->GetFormula(), VAbstractTool::AttrLength); + AddPropertyLineColor(i, tr("Color"), VAbstractTool::ColorsList(), VAbstractTool::AttrColor); } //--------------------------------------------------------------------------------------------------------------------- @@ -1005,7 +1079,8 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolCutSpline(QGraphicsItem *item) formView->setTitle(tr("Tool for segmenting a curve")); AddPropertyPointName(i, tr("Point label")); - AddPropertyFormula(tr("Length"), i->getFormula(), VAbstractTool::AttrLength); + AddPropertyFormula(tr("Length"), i->GetFormula(), VAbstractTool::AttrLength); + AddPropertyLineColor(i, tr("Color"), VAbstractTool::ColorsList(), VAbstractTool::AttrColor); } //--------------------------------------------------------------------------------------------------------------------- @@ -1016,7 +1091,8 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolCutSplinePath(QGraphicsItem *it formView->setTitle(tr("Tool segment a pathed curve")); AddPropertyPointName(i, tr("Point label")); - AddPropertyFormula(tr("Length"), i->getFormula(), VAbstractTool::AttrLength); + AddPropertyFormula(tr("Length"), i->GetFormula(), VAbstractTool::AttrLength); + AddPropertyLineColor(i, tr("Color"), VAbstractTool::ColorsList(), VAbstractTool::AttrColor); } //--------------------------------------------------------------------------------------------------------------------- @@ -1027,7 +1103,8 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolHeight(QGraphicsItem *item) formView->setTitle(tr("Perpendicular point along line")); AddPropertyPointName(i, tr("Point label")); - AddPropertyLineType(i, tr("Line type")); + AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics()); + AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), VAbstractTool::AttrLineColor); } //--------------------------------------------------------------------------------------------------------------------- @@ -1037,7 +1114,10 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolLine(QGraphicsItem *item) i->ShowVisualization(true); formView->setTitle(tr("Line between points")); - AddPropertyLineType(i, tr("Line type")); + QMap styles = VAbstractTool::LineStylesPics(); + styles.remove(VAbstractTool::TypeLineNone); + AddPropertyLineType(i, tr("Line type"), styles); + AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), VAbstractTool::AttrLineColor); } //--------------------------------------------------------------------------------------------------------------------- @@ -1057,12 +1137,13 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolNormal(QGraphicsItem *item) i->ShowVisualization(true); formView->setTitle(tr("Point along perpendicular")); - AddPropertyFormula(tr("Length"), i->getFormulaLength(), VAbstractTool::AttrLength); + AddPropertyFormula(tr("Length"), i->GetFormulaLength(), VAbstractTool::AttrLength); AddPropertyPointName(i, tr("Point label")); - AddPropertyLineType(i, tr("Line type")); + AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics()); + AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), VAbstractTool::AttrLineColor); VDoubleProperty* itemAngle = new VDoubleProperty(tr("Additional angle degrees")); - itemAngle->setValue(i->getAngle()); + itemAngle->setValue(i->GetAngle()); itemAngle->setSetting("Min", -360); itemAngle->setSetting("Max", 360); itemAngle->setSetting("Precision", 3); @@ -1098,8 +1179,9 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolShoulderPoint(QGraphicsItem *it formView->setTitle(tr("Special point on shoulder")); AddPropertyPointName(i, tr("Point label")); - AddPropertyLineType(i, tr("Line type")); - AddPropertyFormula(tr("Length"), i->getFormulaLength(), VAbstractTool::AttrLength); + AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics()); + AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), VAbstractTool::AttrLineColor); + AddPropertyFormula(tr("Length"), i->GetFormulaLength(), VAbstractTool::AttrLength); } //--------------------------------------------------------------------------------------------------------------------- @@ -1117,6 +1199,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolSpline(QGraphicsItem *item) itemFactor->setSetting("Precision", 3); itemFactor->setValue(spl.GetKcurve()); AddProperty(itemFactor, VAbstractTool::AttrKCurve); + AddPropertyLineColor(i, tr("Color"), VAbstractTool::ColorsList(), VAbstractTool::AttrColor); } //--------------------------------------------------------------------------------------------------------------------- @@ -1132,8 +1215,9 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolSplinePath(QGraphicsItem *item) itemFactor->setSetting("Max", 1000); itemFactor->setSetting("Step", 0.01); itemFactor->setSetting("Precision", 3); - itemFactor->setValue(splPath.getKCurve()); + itemFactor->setValue(splPath.GetKCurve()); AddProperty(itemFactor, VAbstractTool::AttrKCurve); + AddPropertyLineColor(i, tr("Color"), VAbstractTool::ColorsList(), VAbstractTool::AttrColor); } //--------------------------------------------------------------------------------------------------------------------- @@ -1154,8 +1238,9 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolLineIntersectAxis(QGraphicsItem formView->setTitle(tr("Point intersection line and axis")); AddPropertyPointName(i, tr("Point label")); - AddPropertyLineType(i, tr("Line type")); - AddPropertyFormula(tr("Angle"), i->getFormulaAngle(), VAbstractTool::AttrAngle); + AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics()); + AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), VAbstractTool::AttrLineColor); + AddPropertyFormula(tr("Angle"), i->GetFormulaAngle(), VAbstractTool::AttrAngle); } //--------------------------------------------------------------------------------------------------------------------- @@ -1163,11 +1248,12 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolCurveIntersectAxis(QGraphicsIte { VToolCurveIntersectAxis *i = qgraphicsitem_cast(item); i->ShowVisualization(true); - formView->setTitle(tr("Point intersection line and axis")); + formView->setTitle(tr("Point intersection curve and axis")); AddPropertyPointName(i, tr("Point label")); - AddPropertyLineType(i, tr("Line type")); - AddPropertyFormula(tr("Angle"), i->getFormulaAngle(), VAbstractTool::AttrAngle); + AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics()); + AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), VAbstractTool::AttrLineColor); + AddPropertyFormula(tr("Angle"), i->GetFormulaAngle(), VAbstractTool::AttrAngle); } //--------------------------------------------------------------------------------------------------------------------- @@ -1184,16 +1270,22 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolEndLine() VToolEndLine *i = qgraphicsitem_cast(currentItem); idToProperty[VAbstractTool::AttrName]->setValue(i->name()); - QStringList styles = VAbstractTool::Styles(); - qint32 index = styles.indexOf(i->getLineType()); + { + const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); idToProperty[VAbstractTool::AttrTypeLine]->setValue(index); + } + + { + const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); + idToProperty[VAbstractTool::AttrLineColor]->setValue(index); + } QVariant valueFormula; - valueFormula.setValue(i->getFormulaLength()); + valueFormula.setValue(i->GetFormulaLength()); idToProperty[VAbstractTool::AttrLength]->setValue(valueFormula); QVariant valueAngle; - valueAngle.setValue(i->getFormulaAngle()); + valueAngle.setValue(i->GetFormulaAngle()); idToProperty[VAbstractTool::AttrAngle]->setValue(valueAngle); } @@ -1203,12 +1295,18 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolAlongLine() VToolAlongLine *i = qgraphicsitem_cast(currentItem); idToProperty[VAbstractTool::AttrName]->setValue(i->name()); - QStringList styles = VAbstractTool::Styles(); - qint32 index = styles.indexOf(i->getLineType()); + { + const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); idToProperty[VAbstractTool::AttrTypeLine]->setValue(index); + } + + { + const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); + idToProperty[VAbstractTool::AttrLineColor]->setValue(index); + } QVariant valueFormula; - valueFormula.setValue(i->getFormulaLength()); + valueFormula.setValue(i->GetFormulaLength()); idToProperty[VAbstractTool::AttrLength]->setValue(valueFormula); } @@ -1219,16 +1317,19 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolArc() QVariant valueRadius; - valueRadius.setValue(i->getFormulaRadius()); + valueRadius.setValue(i->GetFormulaRadius()); idToProperty[VAbstractTool::AttrRadius]->setValue(valueRadius); QVariant valueFirstAngle; - valueFirstAngle.setValue(i->getFormulaF1()); + valueFirstAngle.setValue(i->GetFormulaF1()); idToProperty[VAbstractTool::AttrAngle1]->setValue(valueFirstAngle); QVariant valueSecondAngle; - valueSecondAngle.setValue(i->getFormulaF2()); + valueSecondAngle.setValue(i->GetFormulaF2()); idToProperty[VAbstractTool::AttrAngle2]->setValue(valueSecondAngle); + + const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); + idToProperty[VAbstractTool::AttrColor]->setValue(index); } //--------------------------------------------------------------------------------------------------------------------- @@ -1239,12 +1340,18 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolBisector() idToProperty[VAbstractTool::AttrName]->setValue(i->name()); QVariant valueFormula; - valueFormula.setValue(i->getFormulaLength()); + valueFormula.setValue(i->GetFormulaLength()); idToProperty[VAbstractTool::AttrLength]->setValue(valueFormula); - QStringList styles = VAbstractTool::Styles(); - qint32 index = styles.indexOf(i->getLineType()); + { + const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); idToProperty[VAbstractTool::AttrTypeLine]->setValue(index); + } + + { + const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); + idToProperty[VAbstractTool::AttrLineColor]->setValue(index); + } } //--------------------------------------------------------------------------------------------------------------------- @@ -1255,8 +1362,11 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolCutArc() idToProperty[VAbstractTool::AttrName]->setValue(i->name()); QVariant valueFormula; - valueFormula.setValue(i->getFormula()); + valueFormula.setValue(i->GetFormula()); idToProperty[VAbstractTool::AttrLength]->setValue(valueFormula); + + const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); + idToProperty[VAbstractTool::AttrColor]->setValue(index); } //--------------------------------------------------------------------------------------------------------------------- @@ -1267,8 +1377,11 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolCutSpline() idToProperty[VAbstractTool::AttrName]->setValue(i->name()); QVariant valueFormula; - valueFormula.setValue(i->getFormula()); + valueFormula.setValue(i->GetFormula()); idToProperty[VAbstractTool::AttrLength]->setValue(valueFormula); + + const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); + idToProperty[VAbstractTool::AttrColor]->setValue(index); } //--------------------------------------------------------------------------------------------------------------------- @@ -1279,8 +1392,11 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolCutSplinePath() idToProperty[VAbstractTool::AttrName]->setValue(i->name()); QVariant valueFormula; - valueFormula.setValue(i->getFormula()); + valueFormula.setValue(i->GetFormula()); idToProperty[VAbstractTool::AttrLength]->setValue(valueFormula); + + const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); + idToProperty[VAbstractTool::AttrColor]->setValue(index); } //--------------------------------------------------------------------------------------------------------------------- @@ -1290,9 +1406,15 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolHeight() idToProperty[VAbstractTool::AttrName]->setValue(i->name()); - QStringList styles = VAbstractTool::Styles(); - qint32 index = styles.indexOf(i->getLineType()); + { + const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); idToProperty[VAbstractTool::AttrTypeLine]->setValue(index); + } + + { + const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); + idToProperty[VAbstractTool::AttrLineColor]->setValue(index); + } } //--------------------------------------------------------------------------------------------------------------------- @@ -1300,9 +1422,15 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolLine() { VToolLine *i = qgraphicsitem_cast(currentItem); - QStringList styles = VAbstractTool::Styles(); - qint32 index = styles.indexOf(i->getLineType()); + { + const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); idToProperty[VAbstractTool::AttrTypeLine]->setValue(index); + } + + { + const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); + idToProperty[VAbstractTool::AttrLineColor]->setValue(index); + } } //--------------------------------------------------------------------------------------------------------------------- @@ -1319,16 +1447,22 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolNormal() VToolNormal *i = qgraphicsitem_cast(currentItem); QVariant valueFormula; - valueFormula.setValue(i->getFormulaLength()); + valueFormula.setValue(i->GetFormulaLength()); idToProperty[VAbstractTool::AttrLength]->setValue(valueFormula); idToProperty[VAbstractTool::AttrName]->setValue(i->name()); - idToProperty[VAbstractTool::AttrAngle]->setValue( i->getAngle()); + idToProperty[VAbstractTool::AttrAngle]->setValue( i->GetAngle()); - QStringList styles = VAbstractTool::Styles(); - qint32 index = styles.indexOf(i->getLineType()); + { + const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); idToProperty[VAbstractTool::AttrTypeLine]->setValue(index); + } + + { + const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); + idToProperty[VAbstractTool::AttrLineColor]->setValue(index); + } } //--------------------------------------------------------------------------------------------------------------------- @@ -1357,14 +1491,20 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolShoulderPoint() VToolShoulderPoint *i = qgraphicsitem_cast(currentItem); QVariant valueFormula; - valueFormula.setValue(i->getFormulaLength()); + valueFormula.setValue(i->GetFormulaLength()); idToProperty[VAbstractTool::AttrLength]->setValue(valueFormula); idToProperty[VAbstractTool::AttrName]->setValue(i->name()); - QStringList styles = VAbstractTool::Styles(); - qint32 index = styles.indexOf(i->getLineType()); + { + const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); idToProperty[VAbstractTool::AttrTypeLine]->setValue(index); + } + + { + const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); + idToProperty[VAbstractTool::AttrLineColor]->setValue(index); + } } //--------------------------------------------------------------------------------------------------------------------- @@ -1374,6 +1514,9 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolSpline() VSpline spl = i->getSpline(); idToProperty[VAbstractTool::AttrKCurve]->setValue(spl.GetKcurve()); + + const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); + idToProperty[VAbstractTool::AttrColor]->setValue(index); } //--------------------------------------------------------------------------------------------------------------------- @@ -1382,7 +1525,10 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolSplinePath() VToolSplinePath *i = qgraphicsitem_cast(currentItem); VSplinePath splPath = i->getSplinePath(); - idToProperty[VAbstractTool::AttrKCurve]->setValue(splPath.getKCurve()); + idToProperty[VAbstractTool::AttrKCurve]->setValue(splPath.GetKCurve()); + + const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); + idToProperty[VAbstractTool::AttrColor]->setValue(index); } //--------------------------------------------------------------------------------------------------------------------- @@ -1399,12 +1545,18 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolLineIntersectAxis() VToolLineIntersectAxis *i = qgraphicsitem_cast(currentItem); idToProperty[VAbstractTool::AttrName]->setValue(i->name()); - QStringList styles = VAbstractTool::Styles(); - qint32 index = styles.indexOf(i->getLineType()); + { + const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); idToProperty[VAbstractTool::AttrTypeLine]->setValue(index); + } + + { + const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); + idToProperty[VAbstractTool::AttrLineColor]->setValue(index); + } QVariant valueAngle; - valueAngle.setValue(i->getFormulaAngle()); + valueAngle.setValue(i->GetFormulaAngle()); idToProperty[VAbstractTool::AttrAngle]->setValue(valueAngle); } @@ -1414,12 +1566,18 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolCurveIntersectAxis() VToolCurveIntersectAxis *i = qgraphicsitem_cast(currentItem); idToProperty[VAbstractTool::AttrName]->setValue(i->name()); - QStringList styles = VAbstractTool::Styles(); - qint32 index = styles.indexOf(i->getLineType()); + { + const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType()); idToProperty[VAbstractTool::AttrTypeLine]->setValue(index); + } + + { + const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); + idToProperty[VAbstractTool::AttrLineColor]->setValue(index); + } QVariant valueAngle; - valueAngle.setValue(i->getFormulaAngle()); + valueAngle.setValue(i->GetFormulaAngle()); idToProperty[VAbstractTool::AttrAngle]->setValue(valueAngle); } @@ -1451,6 +1609,8 @@ QStringList VToolOptionsPropertyBrowser::PropertiesList() const << VAbstractTool::AttrPShoulder /* 22 */ << VAbstractTool::AttrAxisP1 /* 23 */ << VAbstractTool::AttrAxisP2 /* 24 */ - << VAbstractTool::AttrKCurve; /* 25 */ + << VAbstractTool::AttrKCurve /* 25 */ + << VAbstractTool::AttrLineColor /* 26 */ + << VAbstractTool::AttrColor; /* 27 */ return attr; } diff --git a/src/app/widgets/vtooloptionspropertybrowser.h b/src/app/widgets/vtooloptionspropertybrowser.h index 1c4c65fa1..e0830771a 100644 --- a/src/app/widgets/vtooloptionspropertybrowser.h +++ b/src/app/widgets/vtooloptionspropertybrowser.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -51,6 +51,7 @@ public slots: void itemClicked(QGraphicsItem *item); void userChangedData(VPE::VProperty* property); void UpdateOptions(); + void RefreshOptions(); private: Q_DISABLE_COPY(VToolOptionsPropertyBrowser) @@ -71,7 +72,11 @@ private: void AddPropertyPointName(Tool *i, const QString &propertyName); template - void AddPropertyLineType(Tool *i, const QString &propertyName); + void AddPropertyLineType(Tool *i, const QString &propertyName, const QMap &styles); + + template + void AddPropertyLineColor(Tool *i, const QString &propertyName, const QMap &colors, + const QString &id); void AddPropertyFormula(const QString &propertyName, const VFormula &formula, const QString &attrName); diff --git a/src/app/widgets/vwidgetpopup.cpp b/src/app/widgets/vwidgetpopup.cpp new file mode 100644 index 000000000..5329dafca --- /dev/null +++ b/src/app/widgets/vwidgetpopup.cpp @@ -0,0 +1,114 @@ +/************************************************************************ + ** + ** @file vwidgetpopup.cpp + ** @author Roman Telezhynskyi + ** @date 16 2, 2015 + ** + ** @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-2015 Valentina project + ** 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 . + ** + *************************************************************************/ + +#include "vwidgetpopup.h" + +#include +#include +#include + +//--------------------------------------------------------------------------------------------------------------------- +VWidgetPopup::VWidgetPopup(QWidget *parent) + :QFrame(parent, Qt::Popup), mWidget(nullptr), mOwn(true), mOldParent(nullptr), lifeTime(-1) +{ + setAttribute(Qt::WA_WindowPropagation); + + if (parentWidget() == nullptr) + { + setAttribute(Qt::WA_DeleteOnClose); + } + + setLayout(new QVBoxLayout()); + layout()->setContentsMargins(0, 0, 0, 0); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VWidgetPopup::SetWidget(QWidget *widget, bool own) +{ + if (mWidget) + { + layout()->removeWidget(mWidget); + + if (mOwn) + { + mWidget->setParent(0); + delete mWidget; + } + else + { + mWidget->setParent(mOldParent); + } + } + + mWidget = widget; + mOwn = own; + mOldParent = 0; + + if (mWidget) + { + mOldParent = mWidget->parentWidget(); + mWidget->setParent(this); + layout()->addWidget(mWidget); + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void VWidgetPopup::Show(QPoint coord) +{ + // important to do this before following adjustments! + QFrame::show(); + + const QRect screen(QDesktopWidget().availableGeometry()); + coord.setX(coord.x() - width()/2); + + if (coord.x() < screen.x()) + { + coord.setX(screen.x()); + } + + if (coord.y() < screen.y()) + { + coord.setY(screen.y()); + } + + if (coord.x() > (screen.right()-width())) + { + coord.setX(screen.right()-width()); + } + + if (coord.y() > (screen.bottom()-height())) + { + coord.setY(screen.bottom()-height()); + } + move(coord); + + if (lifeTime > 0) + { + QTimer::singleShot(lifeTime, this, SLOT(close())); + } +} diff --git a/src/app/widgets/vwidgetpopup.h b/src/app/widgets/vwidgetpopup.h new file mode 100644 index 000000000..eb6529435 --- /dev/null +++ b/src/app/widgets/vwidgetpopup.h @@ -0,0 +1,106 @@ +/************************************************************************ + ** + ** @file vwidgetpopup.h + ** @author Roman Telezhynskyi + ** @date 16 2, 2015 + ** + ** @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-2015 Valentina project + ** 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 . + ** + *************************************************************************/ + +#ifndef VWIDGETPOPUP_H +#define VWIDGETPOPUP_H + +#include + +/** + \brief Class showing a widget as popup window. + + setWidget() function allows you to specify the widget to be popped up. + After widget is set, you normally should call show() slot in order to pop the + widget up at the specified global position. + + VWidgetPopup takes care about positioning of your widget on the screen so it will + be always visible even if popped beside. +*/ +class VWidgetPopup : public QFrame +{ + Q_OBJECT + +public: + /** Constructor. + + If \a parent not specified (default), then popup widget gets + attribute Qt::WA_DeleteOnClose and will be deleted after close. + */ + VWidgetPopup(QWidget *parent = 0); + + /** Sets widget to be popped up to \a widget. + If \a own is true then the widget will be reparented to the popup widget. + */ + void SetWidget(QWidget *widget, bool own = true); + + /** Returns widget to be popped up. */ + inline QWidget* Widget() const; + + /** Returns true if widget is owned by this popup widget, false otherwise. */ + inline bool isOwned() const; + + int GetLifeTime() const; + void SetLifeTime(int value); + +public slots: + /** Pops up the widget at global coordinates \a coord. */ + void Show(QPoint coord); + +protected: + Q_DISABLE_COPY(VWidgetPopup) + QWidget *mWidget; + bool mOwn; + QWidget *mOldParent; + int lifeTime; +}; + +//--------------------------------------------------------------------------------------------------------------------- +inline QWidget *VWidgetPopup::Widget() const +{ + return mWidget; +} + +//--------------------------------------------------------------------------------------------------------------------- +inline bool VWidgetPopup::isOwned() const +{ + return mOwn; +} + +//--------------------------------------------------------------------------------------------------------------------- +inline int VWidgetPopup::GetLifeTime() const +{ + return lifeTime; +} + +//--------------------------------------------------------------------------------------------------------------------- +inline void VWidgetPopup::SetLifeTime(int value) +{ + lifeTime = value; +} + +#endif // VWIDGETPOPUP_H diff --git a/src/app/widgets/widgets.pri b/src/app/widgets/widgets.pri index ef5e646c1..1e0e507e6 100644 --- a/src/app/widgets/widgets.pri +++ b/src/app/widgets/widgets.pri @@ -5,20 +5,20 @@ HEADERS += \ $$PWD/vtablegraphicsview.h \ $$PWD/vmaingraphicsview.h \ $$PWD/vmaingraphicsscene.h \ - $$PWD/vitem.h \ $$PWD/doubledelegate.h \ $$PWD/textdelegate.h \ $$PWD/vtooloptionspropertybrowser.h \ $$PWD/vformulapropertyeditor.h \ - $$PWD/vformulaproperty.h + $$PWD/vformulaproperty.h \ + $$PWD/vwidgetpopup.h SOURCES += \ $$PWD/vtablegraphicsview.cpp \ $$PWD/vmaingraphicsview.cpp \ $$PWD/vmaingraphicsscene.cpp \ - $$PWD/vitem.cpp \ $$PWD/doubledelegate.cpp \ $$PWD/textdelegate.cpp \ $$PWD/vtooloptionspropertybrowser.cpp \ $$PWD/vformulapropertyeditor.cpp \ - $$PWD/vformulaproperty.cpp + $$PWD/vformulaproperty.cpp \ + $$PWD/vwidgetpopup.cpp diff --git a/src/app/xml/vabstractmeasurements.cpp b/src/app/xml/vabstractmeasurements.cpp index fbf3339b7..97be9fb28 100644 --- a/src/app/xml/vabstractmeasurements.cpp +++ b/src/app/xml/vabstractmeasurements.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -27,6 +27,7 @@ *************************************************************************/ #include "vabstractmeasurements.h" +#include "../core/vapplication.h" const QString VAbstractMeasurements::TagUnit = QStringLiteral("unit"); const QString VAbstractMeasurements::AttrValue = QStringLiteral("value"); @@ -214,6 +215,8 @@ qreal VAbstractMeasurements::UnitConvertor(qreal value, const Unit &from, const return value / 10.0; case Unit::Inch: return value / 25.4; + case Unit::Px: + return (value / 25.4) * VApplication::PrintDPI; default: break; } @@ -227,6 +230,8 @@ qreal VAbstractMeasurements::UnitConvertor(qreal value, const Unit &from, const return value; case Unit::Inch: return value / 2.54; + case Unit::Px: + return ((value * 10.0) / 25.4) * VApplication::PrintDPI; default: break; } @@ -240,6 +245,23 @@ qreal VAbstractMeasurements::UnitConvertor(qreal value, const Unit &from, const return value * 2.54; case Unit::Inch: return value; + case Unit::Px: + return value * VApplication::PrintDPI; + default: + break; + } + break; + case Unit::Px: + switch (to) + { + case Unit::Mm: + return (value / VApplication::PrintDPI) * 25.4; + case Unit::Cm: + return ((value / VApplication::PrintDPI) * 25.4) / 10.0; + case Unit::Inch: + return value / VApplication::PrintDPI; + case Unit::Px: + return value; default: break; } diff --git a/src/app/xml/vabstractmeasurements.h b/src/app/xml/vabstractmeasurements.h index ac64c9828..10917bc0b 100644 --- a/src/app/xml/vabstractmeasurements.h +++ b/src/app/xml/vabstractmeasurements.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/xml/vindividualmeasurements.cpp b/src/app/xml/vindividualmeasurements.cpp index c39dc72ac..580b57a85 100644 --- a/src/app/xml/vindividualmeasurements.cpp +++ b/src/app/xml/vindividualmeasurements.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/xml/vindividualmeasurements.h b/src/app/xml/vindividualmeasurements.h index 85e967216..50e339c2e 100644 --- a/src/app/xml/vindividualmeasurements.h +++ b/src/app/xml/vindividualmeasurements.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/xml/vpattern.cpp b/src/app/xml/vpattern.cpp index 4e567f6c3..56d637832 100644 --- a/src/app/xml/vpattern.cpp +++ b/src/app/xml/vpattern.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -301,6 +301,21 @@ bool VPattern::ChangeNamePP(const QString& oldName, const QString &newName) void VPattern::Parse(const Document &parse) { qCDebug(vXML)<<"Parsing pattern."; + switch (parse) + { + case Document::FullParse: + qCDebug(vXML)<<"Full parse."; + break; + case Document::LiteParse: + qCDebug(vXML)<<"Lite parse."; + break; + case Document::LitePPParse: + qCDebug(vXML)<<"Lite pattern piece parse."; + break; + default: + break; + } + SCASSERT(sceneDraw != nullptr); SCASSERT(sceneDetail != nullptr); QStringList tags = QStringList() << TagDraw << TagIncrements << TagAuthor << TagDescription << TagNotes @@ -317,6 +332,7 @@ void VPattern::Parse(const Document &parse) switch (tags.indexOf(domElement.tagName())) { case 0: // TagDraw + qCDebug(vXML)<<"Tag draw."; if (parse == Document::FullParse) { if (nameActivPP.isEmpty()) @@ -336,22 +352,29 @@ void VPattern::Parse(const Document &parse) ParseDrawElement(domElement, parse); break; case 1: // TagIncrements + qCDebug(vXML)<<"Tag increments."; ParseIncrementsElement(domElement); break; case 2: // TagAuthor + qCDebug(vXML)<<"Tag author."; break; case 3: // TagDescription + qCDebug(vXML)<<"Tag description."; break; case 4: // TagNotes + qCDebug(vXML)<<"Tag notes."; break; case 5: // TagMeasurements + qCDebug(vXML)<<"Tag measurements."; break; case 6: // TagVersion + qCDebug(vXML)<<"Tag version."; break; case 7: // TagGradation + qCDebug(vXML)<<"Tag gradation."; break; default: - qDebug()<<"Wrong tag name"<ClearCalculationGObjects(); ParseDrawMode(domElement, parse, Draw::Calculation); break; case 1: // TagModeling + qCDebug(vXML)<<"Tag modeling."; ParseDrawMode(domElement, parse, Draw::Modeling); break; case 2: // TagDetails + qCDebug(vXML)<<"Tag details."; ParseDetails(domElement, parse); break; default: - qDebug()<<"Wrong tag name"<addItem(spoint); connect(spoint, &VToolSinglePoint::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(scene, &VMainGraphicsScene::NewFactor, spoint, &VToolSinglePoint::SetFactor); - connect(scene, &VMainGraphicsScene::DisableItem, spoint, &VToolPoint::Disable); + connect(scene, &VMainGraphicsScene::DisableItem, spoint, &VToolSinglePoint::Disable); + connect(scene, &VMainGraphicsScene::EnableToolMove, spoint, &VToolSinglePoint::EnableToolMove); tools[id] = spoint; } } @@ -1147,7 +1180,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem case 1: //VToolEndLine::ToolType try { - PointsCommonAttributes(domElement, id, name, mx, my, typeLine); + PointsCommonAttributes(domElement, id, name, mx, my, typeLine, lineColor); const QString formula = GetParametrString(domElement, VAbstractTool::AttrLength, "100.0"); QString f = formula;//need for saving fixed formula; @@ -1157,8 +1190,8 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem const QString angle = GetParametrString(domElement, VAbstractTool::AttrAngle, "0.0"); QString angleFix = angle; - VToolEndLine::Create(id, name, typeLine, f, angleFix, basePointId, mx, my, scene, this, data, parse, - Source::FromFile); + VToolEndLine::Create(id, name, typeLine, lineColor, f, angleFix, basePointId, mx, my, scene, this, data, + parse, Source::FromFile); //Rewrite attribute formula. Need for situation when we have wrong formula. if (f != formula || angleFix != angle) { @@ -1183,14 +1216,14 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem case 2: //VToolAlongLine::ToolType try { - PointsCommonAttributes(domElement, id, name, mx, my, typeLine); + PointsCommonAttributes(domElement, id, name, mx, my, typeLine, lineColor); const QString formula = GetParametrString(domElement, VAbstractTool::AttrLength, "100.0"); QString f = formula;//need for saving fixed formula; const quint32 firstPointId = GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, NULL_ID_STR); const quint32 secondPointId = GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, NULL_ID_STR); - VToolAlongLine::Create(id, name, typeLine, f, firstPointId, secondPointId, mx, my, scene, this, - data, parse, Source::FromFile); + VToolAlongLine::Create(id, name, typeLine, lineColor, f, firstPointId, secondPointId, mx, my, scene, + this, data, parse, Source::FromFile); //Rewrite attribute formula. Need for situation when we have wrong formula. if (f != formula) { @@ -1214,15 +1247,15 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem case 3: //VToolShoulderPoint::ToolType try { - PointsCommonAttributes(domElement, id, name, mx, my, typeLine); + PointsCommonAttributes(domElement, id, name, mx, my, typeLine, lineColor); const QString formula = GetParametrString(domElement, VAbstractTool::AttrLength, "100.0"); QString f = formula;//need for saving fixed formula; const quint32 p1Line = GetParametrUInt(domElement, VAbstractTool::AttrP1Line, NULL_ID_STR); const quint32 p2Line = GetParametrUInt(domElement, VAbstractTool::AttrP2Line, NULL_ID_STR); const quint32 pShoulder = GetParametrUInt(domElement, VAbstractTool::AttrPShoulder, NULL_ID_STR); - VToolShoulderPoint::Create(id, f, p1Line, p2Line, pShoulder, typeLine, name, mx, my, scene, this, - data, parse, Source::FromFile); + VToolShoulderPoint::Create(id, f, p1Line, p2Line, pShoulder, typeLine, lineColor, name, mx, my, scene, + this, data, parse, Source::FromFile); //Rewrite attribute formula. Need for situation when we have wrong formula. if (f != formula) { @@ -1246,14 +1279,14 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem case 4: //VToolNormal::ToolType try { - PointsCommonAttributes(domElement, id, name, mx, my, typeLine); + PointsCommonAttributes(domElement, id, name, mx, my, typeLine, lineColor); const QString formula = GetParametrString(domElement, VAbstractTool::AttrLength, "100.0"); QString f = formula;//need for saving fixed formula; const quint32 firstPointId = GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, NULL_ID_STR); const quint32 secondPointId = GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, NULL_ID_STR); const qreal angle = GetParametrDouble(domElement, VAbstractTool::AttrAngle, "0.0"); - VToolNormal::Create(id, f, firstPointId, secondPointId, typeLine, name, angle, mx, my, scene, + VToolNormal::Create(id, f, firstPointId, secondPointId, typeLine, lineColor, name, angle, mx, my, scene, this, data, parse, Source::FromFile); //Rewrite attribute formula. Need for situation when we have wrong formula. if (f != formula) @@ -1278,7 +1311,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem case 5: //VToolBisector::ToolType try { - PointsCommonAttributes(domElement, id, name, mx, my, typeLine); + PointsCommonAttributes(domElement, id, name, mx, my, typeLine, lineColor); const QString formula = GetParametrString(domElement, VAbstractTool::AttrLength, "100.0"); QString f = formula;//need for saving fixed formula; const quint32 firstPointId = GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, NULL_ID_STR); @@ -1286,7 +1319,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem const quint32 thirdPointId = GetParametrUInt(domElement, VAbstractTool::AttrThirdPoint, NULL_ID_STR); VToolBisector::Create(id, f, firstPointId, secondPointId, thirdPointId, - typeLine, name, mx, my, scene, this, data, parse, Source::FromFile); + typeLine, lineColor, name, mx, my, scene, this, data, parse, Source::FromFile); //Rewrite attribute formula. Need for situation when we have wrong formula. if (f != formula) { @@ -1379,12 +1412,12 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem case 9: //VToolHeight::ToolType try { - PointsCommonAttributes(domElement, id, name, mx, my, typeLine); + PointsCommonAttributes(domElement, id, name, mx, my, typeLine, lineColor); const quint32 basePointId = GetParametrUInt(domElement, VAbstractTool::AttrBasePoint, NULL_ID_STR); const quint32 p1LineId = GetParametrUInt(domElement, VAbstractTool::AttrP1Line, NULL_ID_STR); const quint32 p2LineId = GetParametrUInt(domElement, VAbstractTool::AttrP2Line, NULL_ID_STR); - VToolHeight::Create(id, name, typeLine, basePointId, p1LineId, p2LineId, + VToolHeight::Create(id, name, typeLine, lineColor, basePointId, p1LineId, p2LineId, mx, my, scene, this, data, parse, Source::FromFile); } catch (const VExceptionBadId &e) @@ -1437,8 +1470,11 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem const QString formula = GetParametrString(domElement, VAbstractTool::AttrLength, "0"); QString f = formula;//need for saving fixed formula; const quint32 splineId = GetParametrUInt(domElement, VToolCutSpline::AttrSpline, NULL_ID_STR); + const QString color = GetParametrString(domElement, VAbstractTool::AttrColor, + VAbstractTool::ColorBlack); - VToolCutSpline::Create(id, name, f, splineId, mx, my, scene, this, data, parse, Source::FromFile); + VToolCutSpline::Create(id, name, f, splineId, mx, my, color, scene, this, data, parse, + Source::FromFile); //Rewrite attribute formula. Need for situation when we have wrong formula. if (f != formula) { @@ -1467,8 +1503,10 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem QString f = formula;//need for saving fixed formula; const quint32 splinePathId = GetParametrUInt(domElement, VToolCutSplinePath::AttrSplinePath, NULL_ID_STR); + const QString color = GetParametrString(domElement, VAbstractTool::AttrColor, + VAbstractTool::ColorBlack); - VToolCutSplinePath::Create(id, name, f, splinePathId, mx, my, scene, this, data, parse, + VToolCutSplinePath::Create(id, name, f, splinePathId, mx, my, color, scene, this, data, parse, Source::FromFile); //Rewrite attribute formula. Need for situation when we have wrong formula. if (f != formula) @@ -1497,8 +1535,10 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem const QString formula = GetParametrString(domElement, VAbstractTool::AttrLength, "0"); QString f = formula;//need for saving fixed formula; const quint32 arcId = GetParametrUInt(domElement, VToolCutArc::AttrArc, NULL_ID_STR); + const QString color = GetParametrString(domElement, VAbstractTool::AttrColor, + VAbstractTool::ColorBlack); - VToolCutArc::Create(id, name, f, arcId, mx, my, scene, this, data, parse, Source::FromFile); + VToolCutArc::Create(id, name, f, arcId, mx, my, color, scene, this, data, parse, Source::FromFile); //Rewrite attribute formula. Need for situation when we have wrong formula. if (f != formula) { @@ -1522,7 +1562,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem case 15: //VToolLineIntersectAxis::ToolType try { - PointsCommonAttributes(domElement, id, name, mx, my, typeLine); + PointsCommonAttributes(domElement, id, name, mx, my, typeLine, lineColor); const quint32 basePointId = GetParametrUInt(domElement, VAbstractTool::AttrBasePoint, NULL_ID_STR); const quint32 firstPointId = GetParametrUInt(domElement, VAbstractTool::AttrP1Line, NULL_ID_STR); @@ -1531,8 +1571,8 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem const QString angle = GetParametrString(domElement, VAbstractTool::AttrAngle, "0.0"); QString angleFix = angle; - VToolLineIntersectAxis::Create(id, name, typeLine, angleFix, basePointId, firstPointId, secondPointId, - mx, my, scene, this, data, parse, Source::FromFile); + VToolLineIntersectAxis::Create(id, name, typeLine, lineColor, angleFix, basePointId, firstPointId, + secondPointId, mx, my, scene, this, data, parse, Source::FromFile); //Rewrite attribute formula. Need for situation when we have wrong formula. if (angleFix != angle) { @@ -1558,15 +1598,15 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem case 16: //VToolCurveIntersectAxis::ToolType try { - PointsCommonAttributes(domElement, id, name, mx, my, typeLine); + PointsCommonAttributes(domElement, id, name, mx, my, typeLine, lineColor); const quint32 basePointId = GetParametrUInt(domElement, VAbstractTool::AttrBasePoint, NULL_ID_STR); const quint32 curveId = GetParametrUInt(domElement, VAbstractTool::AttrCurve, NULL_ID_STR); const QString angle = GetParametrString(domElement, VAbstractTool::AttrAngle, "0.0"); QString angleFix = angle; - VToolCurveIntersectAxis::Create(id, name, typeLine, angleFix, basePointId, curveId, mx, my, scene, this, - data, parse, Source::FromFile); + VToolCurveIntersectAxis::Create(id, name, typeLine, lineColor, angleFix, basePointId, curveId, mx, my, + scene, this, data, parse, Source::FromFile); //Rewrite attribute formula. Need for situation when we have wrong formula. if (angleFix != angle) { @@ -1615,8 +1655,10 @@ void VPattern::ParseLineElement(VMainGraphicsScene *scene, const QDomElement &do const quint32 secondPoint = GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, NULL_ID_STR); const QString typeLine = GetParametrString(domElement, VAbstractTool::AttrTypeLine, VAbstractTool::TypeLineLine); + const QString lineColor = GetParametrString(domElement, VAbstractTool::AttrLineColor, + VAbstractTool::ColorBlack); - VToolLine::Create(id, firstPoint, secondPoint, typeLine, scene, this, data, parse, Source::FromFile); + VToolLine::Create(id, firstPoint, secondPoint, typeLine, lineColor, scene, this, data, parse, Source::FromFile); } catch (const VExceptionBadId &e) { @@ -1813,6 +1855,7 @@ void VPattern::ParseSplineElement(VMainGraphicsScene *scene, const QDomElement & switch (splines.indexOf(type)) { case 0: //VToolSpline::ToolType + qCDebug(vXML)<<"VToolSpline."; try { ToolsCommonAttributes(domElement, id); @@ -1823,9 +1866,11 @@ void VPattern::ParseSplineElement(VMainGraphicsScene *scene, const QDomElement & const qreal kAsm1 = GetParametrDouble(domElement, VAbstractTool::AttrKAsm1, "1.0"); const qreal kAsm2 = GetParametrDouble(domElement, VAbstractTool::AttrKAsm2, "1.0"); const qreal kCurve = GetParametrDouble(domElement, VAbstractTool::AttrKCurve, "1.0"); + const QString color = GetParametrString(domElement, VAbstractTool::AttrColor, + VAbstractTool::ColorBlack); - VToolSpline::Create(id, point1, point4, kAsm1, kAsm2, angle1, angle2, kCurve, scene, this, data, parse, - Source::FromFile); + VToolSpline::Create(id, point1, point4, kAsm1, kAsm2, angle1, angle2, kCurve, color, scene, this, data, + parse, Source::FromFile); } catch (const VExceptionBadId &e) { @@ -1835,10 +1880,13 @@ void VPattern::ParseSplineElement(VMainGraphicsScene *scene, const QDomElement & } break; case 1: //VToolSplinePath::ToolType + qCDebug(vXML)<<"VToolSplinePath."; try { ToolsCommonAttributes(domElement, id); const qreal kCurve = GetParametrDouble(domElement, VAbstractTool::AttrKCurve, "1.0"); + const QString color = GetParametrString(domElement, VAbstractTool::AttrColor, + VAbstractTool::ColorBlack); VSplinePath *path = new VSplinePath(kCurve); const QDomNodeList nodeList = domElement.childNodes(); @@ -1869,7 +1917,7 @@ void VPattern::ParseSplineElement(VMainGraphicsScene *scene, const QDomElement & } } - VToolSplinePath::Create(id, path, scene, this, data, parse, Source::FromFile); + VToolSplinePath::Create(id, path, color, scene, this, data, parse, Source::FromFile); } catch (const VExceptionBadId &e) { @@ -1879,6 +1927,7 @@ void VPattern::ParseSplineElement(VMainGraphicsScene *scene, const QDomElement & } break; case 2: //VNodeSpline::ToolType + qCDebug(vXML)<<"VNodeSpline."; try { SplinesCommonAttributes(domElement, id, idObject, idTool); @@ -1896,6 +1945,7 @@ void VPattern::ParseSplineElement(VMainGraphicsScene *scene, const QDomElement & } break; case 3: //VNodeSplinePath::ToolType + qCDebug(vXML)<<"VNodeSplinePath."; try { SplinesCommonAttributes(domElement, id, idObject, idTool); @@ -1913,7 +1963,7 @@ void VPattern::ParseSplineElement(VMainGraphicsScene *scene, const QDomElement & } break; default: - qDebug() << "Illegal spline type in VDomDocument::ParseSplineElement()."; + qCDebug(vXML) << "Illegal spline type in VDomDocument::ParseSplineElement()."; break; } } @@ -1949,8 +1999,10 @@ void VPattern::ParseArcElement(VMainGraphicsScene *scene, QDomElement &domElemen QString f1Fix = f1;//need for saving fixed formula; const QString f2 = GetParametrString(domElement, VAbstractTool::AttrAngle2, "270"); QString f2Fix = f2;//need for saving fixed formula; + const QString color = GetParametrString(domElement, VAbstractTool::AttrColor, + VAbstractTool::ColorBlack); - VToolArc::Create(id, center, r, f1Fix, f2Fix, scene, this, data, parse, Source::FromFile); + VToolArc::Create(id, center, r, f1Fix, f2Fix, color, scene, this, data, parse, Source::FromFile); //Rewrite attribute formula. Need for situation when we have wrong formula. if (r != radius || f1Fix != f1 || f2Fix != f2) { diff --git a/src/app/xml/vpattern.h b/src/app/xml/vpattern.h index 439d5c0be..bac00fe71 100644 --- a/src/app/xml/vpattern.h +++ b/src/app/xml/vpattern.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -197,10 +197,9 @@ signals: /** * @brief ShowTool highlight tool. * @param id tool id. - * @param color highlight color. * @param enable enable or disable highlight. */ - void ShowTool(quint32 id, Qt::GlobalColor color, bool enable); + void ShowTool(quint32 id, bool enable); /** * @brief ChangedCursor change cursor position. * @param id tool id. @@ -214,7 +213,7 @@ signals: public slots: void LiteParseTree(const Document &parse); void haveLiteChange(); - void ShowHistoryTool(quint32 id, Qt::GlobalColor color, bool enable); + void ShowHistoryTool(quint32 id, bool enable); void NeedFullParsing(); void ClearScene(); protected: @@ -267,7 +266,7 @@ private: void UpdateMeasurements(); void ToolsCommonAttributes(const QDomElement &domElement, quint32 &id); void PointsCommonAttributes(const QDomElement &domElement, quint32 &id, QString &name, qreal &mx, - qreal &my, QString &typeLine); + qreal &my, QString &typeLine, QString &lineColor); void PointsCommonAttributes(const QDomElement &domElement, quint32 &id, QString &name, qreal &mx, qreal &my); void PointsCommonAttributes(const QDomElement &domElement, quint32 &id, qreal &mx, qreal &my); diff --git a/src/app/xml/vstandardmeasurements.cpp b/src/app/xml/vstandardmeasurements.cpp index 43124da00..49424aca2 100644 --- a/src/app/xml/vstandardmeasurements.cpp +++ b/src/app/xml/vstandardmeasurements.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -34,8 +34,10 @@ const QString VStandardMeasurements::TagDescription = QStringLiteral("descr const QString VStandardMeasurements::TagId = QStringLiteral("id"); const QString VStandardMeasurements::TagSize = QStringLiteral("size"); const QString VStandardMeasurements::TagHeight = QStringLiteral("height"); + const QString VStandardMeasurements::AttrSize_increase = QStringLiteral("size_increase"); const QString VStandardMeasurements::AttrHeight_increase = QStringLiteral("height_increase"); +const QString VStandardMeasurements::AttrBase = QStringLiteral("base"); //--------------------------------------------------------------------------------------------------------------------- VStandardMeasurements::VStandardMeasurements(VContainer *data) @@ -49,7 +51,7 @@ VStandardMeasurements::~VStandardMeasurements() {} //--------------------------------------------------------------------------------------------------------------------- -QString VStandardMeasurements::Description() +QString VStandardMeasurements::OrigDescription () { const QString desc = UniqueTagText(TagDescription, ""); if (desc.isEmpty()) @@ -59,6 +61,20 @@ QString VStandardMeasurements::Description() return desc; } +//--------------------------------------------------------------------------------------------------------------------- +QString VStandardMeasurements::TrDescription() +{ + const QString trDesc = qApp->STDescription(Id()); + if (trDesc.isEmpty() == false) + { + return trDesc; + } + else + { + return OrigDescription (); + } +} + //--------------------------------------------------------------------------------------------------------------------- QString VStandardMeasurements::Id() { @@ -70,6 +86,18 @@ QString VStandardMeasurements::Id() return id; } +//--------------------------------------------------------------------------------------------------------------------- +qreal VStandardMeasurements::Size() const +{ + return TakeParametr(TagSize, AttrBase, 50); +} + +//--------------------------------------------------------------------------------------------------------------------- +qreal VStandardMeasurements::Height() const +{ + return TakeParametr(TagHeight, AttrBase, 176); +} + //--------------------------------------------------------------------------------------------------------------------- void VStandardMeasurements::ReadMeasurement(const QDomElement &domElement, const QString &tag) { @@ -93,7 +121,7 @@ void VStandardMeasurements::ReadMeasurement(const QDomElement &domElement, const //--------------------------------------------------------------------------------------------------------------------- -qreal VStandardMeasurements::TakeParametr(const QString &tag, qreal defValue) const +qreal VStandardMeasurements::TakeParametr(const QString &tag, const QString &attr, qreal defValue) const { const qreal defVal = UnitConvertor(defValue, Unit::Cm, qApp->patternUnit()); @@ -110,7 +138,7 @@ qreal VStandardMeasurements::TakeParametr(const QString &tag, qreal defValue) co const QDomElement domElement = domNode.toElement(); if (domElement.isNull() == false) { - qreal value = GetParametrDouble(domElement, AttrValue, QString("%1").arg(defVal)); + qreal value = GetParametrDouble(domElement, attr, QString("%1").arg(defVal)); value = UnitConvertor(value, MUnit(), qApp->patternUnit()); return value; } @@ -122,15 +150,13 @@ qreal VStandardMeasurements::TakeParametr(const QString &tag, qreal defValue) co //--------------------------------------------------------------------------------------------------------------------- void VStandardMeasurements::SetSize() { - const qreal value = TakeParametr(TagSize, 50); - data->SetSize(value); + data->SetSize(Size()); data->SetSizeName(size_M); } //--------------------------------------------------------------------------------------------------------------------- void VStandardMeasurements::SetHeight() { - const qreal value = TakeParametr(TagHeight, 176); - data->SetHeight(value); + data->SetHeight(Height()); data->SetHeightName(height_M); } diff --git a/src/app/xml/vstandardmeasurements.h b/src/app/xml/vstandardmeasurements.h index 93082b7bc..b5f822d68 100644 --- a/src/app/xml/vstandardmeasurements.h +++ b/src/app/xml/vstandardmeasurements.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -44,8 +44,13 @@ class VStandardMeasurements:public VAbstractMeasurements public: VStandardMeasurements(VContainer *data); virtual ~VStandardMeasurements(); - QString Description(); + QString OrigDescription (); + QString TrDescription (); QString Id(); + + qreal Size() const; + qreal Height() const; + void SetSize(); void SetHeight(); static const QString TagMeasurement; @@ -53,13 +58,15 @@ public: static const QString TagId; static const QString TagSize; static const QString TagHeight; + static const QString AttrSize_increase; static const QString AttrHeight_increase; + static const QString AttrBase; protected: virtual void ReadMeasurement(const QDomElement &domElement, const QString &tag); private: Q_DISABLE_COPY(VStandardMeasurements) - qreal TakeParametr(const QString &tag, qreal defValue) const; + qreal TakeParametr(const QString &tag, const QString &attr, qreal defValue) const; }; #endif // VSTANDARDMEASUREMENTS_H diff --git a/src/app/xml/vtoolrecord.cpp b/src/app/xml/vtoolrecord.cpp index 036d88583..12bbc3660 100644 --- a/src/app/xml/vtoolrecord.cpp +++ b/src/app/xml/vtoolrecord.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/app/xml/vtoolrecord.h b/src/app/xml/vtoolrecord.h index 5cf185f5a..836f0a779 100644 --- a/src/app/xml/vtoolrecord.h +++ b/src/app/xml/vtoolrecord.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/ifc/exception/vexception.cpp b/src/libs/ifc/exception/vexception.cpp index 051c6d60f..f7fce7b8d 100644 --- a/src/libs/ifc/exception/vexception.cpp +++ b/src/libs/ifc/exception/vexception.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/ifc/exception/vexception.h b/src/libs/ifc/exception/vexception.h index 302010102..d3987e412 100644 --- a/src/libs/ifc/exception/vexception.h +++ b/src/libs/ifc/exception/vexception.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/ifc/exception/vexceptionbadid.cpp b/src/libs/ifc/exception/vexceptionbadid.cpp index 7b2dad8f1..cec574d53 100644 --- a/src/libs/ifc/exception/vexceptionbadid.cpp +++ b/src/libs/ifc/exception/vexceptionbadid.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/ifc/exception/vexceptionbadid.h b/src/libs/ifc/exception/vexceptionbadid.h index 59fe25d15..72ce160c5 100644 --- a/src/libs/ifc/exception/vexceptionbadid.h +++ b/src/libs/ifc/exception/vexceptionbadid.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/ifc/exception/vexceptionconversionerror.cpp b/src/libs/ifc/exception/vexceptionconversionerror.cpp index f30cbc8a5..3ae802ec7 100644 --- a/src/libs/ifc/exception/vexceptionconversionerror.cpp +++ b/src/libs/ifc/exception/vexceptionconversionerror.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/ifc/exception/vexceptionconversionerror.h b/src/libs/ifc/exception/vexceptionconversionerror.h index bf82b2f08..9a6fa3224 100644 --- a/src/libs/ifc/exception/vexceptionconversionerror.h +++ b/src/libs/ifc/exception/vexceptionconversionerror.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/ifc/exception/vexceptionemptyparameter.cpp b/src/libs/ifc/exception/vexceptionemptyparameter.cpp index b85b721d0..1123d65b4 100644 --- a/src/libs/ifc/exception/vexceptionemptyparameter.cpp +++ b/src/libs/ifc/exception/vexceptionemptyparameter.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/ifc/exception/vexceptionemptyparameter.h b/src/libs/ifc/exception/vexceptionemptyparameter.h index fc188acb3..61571f34a 100644 --- a/src/libs/ifc/exception/vexceptionemptyparameter.h +++ b/src/libs/ifc/exception/vexceptionemptyparameter.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/ifc/exception/vexceptionobjecterror.cpp b/src/libs/ifc/exception/vexceptionobjecterror.cpp index b97257ddd..b3d1258d4 100644 --- a/src/libs/ifc/exception/vexceptionobjecterror.cpp +++ b/src/libs/ifc/exception/vexceptionobjecterror.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/ifc/exception/vexceptionobjecterror.h b/src/libs/ifc/exception/vexceptionobjecterror.h index 1a33432a4..f1e6a5aae 100644 --- a/src/libs/ifc/exception/vexceptionobjecterror.h +++ b/src/libs/ifc/exception/vexceptionobjecterror.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/ifc/exception/vexceptionundo.cpp b/src/libs/ifc/exception/vexceptionundo.cpp index c93cd5290..2fd6a622f 100644 --- a/src/libs/ifc/exception/vexceptionundo.cpp +++ b/src/libs/ifc/exception/vexceptionundo.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/ifc/exception/vexceptionundo.h b/src/libs/ifc/exception/vexceptionundo.h index 58521d899..be4110863 100644 --- a/src/libs/ifc/exception/vexceptionundo.h +++ b/src/libs/ifc/exception/vexceptionundo.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/ifc/exception/vexceptionwrongid.cpp b/src/libs/ifc/exception/vexceptionwrongid.cpp index edc4c989e..93fdd7fb5 100644 --- a/src/libs/ifc/exception/vexceptionwrongid.cpp +++ b/src/libs/ifc/exception/vexceptionwrongid.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/ifc/exception/vexceptionwrongid.h b/src/libs/ifc/exception/vexceptionwrongid.h index a0bf9bd1e..86b73488c 100644 --- a/src/libs/ifc/exception/vexceptionwrongid.h +++ b/src/libs/ifc/exception/vexceptionwrongid.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/ifc/ifcdef.h b/src/libs/ifc/ifcdef.h index 616772c5f..a3d98ad03 100644 --- a/src/libs/ifc/ifcdef.h +++ b/src/libs/ifc/ifcdef.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -34,9 +34,10 @@ #ifdef Q_OS_WIN32 extern Q_CORE_EXPORT int qt_ntfs_permission_lookup; + #include #endif /*Q_OS_WIN32*/ -enum class Unit : char { Mm, Cm, Inch }; +enum class Unit : char { Mm, Cm, Inch, Px }; enum class MeasurementsType : char { Standard, Individual }; static const quint32 null_id = 0; @@ -72,7 +73,7 @@ static const quint32 null_id = 0; } \ } \ -#else +#else // GCC (Windows) #define SCASSERT(cond) \ { \ @@ -85,7 +86,7 @@ static const quint32 null_id = 0; } \ #endif /*Q_CC_MSVC*/ -#else +#else // UNIX #define SCASSERT(cond) \ { \ if (!(cond)) \ @@ -99,7 +100,7 @@ static const quint32 null_id = 0; #endif /* Q_OS_WIN32 */ #else // define but disable this function if debugging is not set #define SCASSERT(cond) qt_noop(); -#endif /* QT_NO_DEBUG */ +#endif /* V_NO_ASSERT */ // Detect whether the compiler supports C++11 noexcept exception specifications. # if defined(__clang__) diff --git a/src/libs/ifc/schema.qrc b/src/libs/ifc/schema.qrc index 2037ec8b5..f8b8fe11e 100644 --- a/src/libs/ifc/schema.qrc +++ b/src/libs/ifc/schema.qrc @@ -5,5 +5,6 @@ schema/pattern/v0.1.0.xsd schema/pattern/v0.1.1.xsd schema/pattern/v0.1.2.xsd + schema/pattern/v0.1.3.xsd diff --git a/src/libs/ifc/schema/pattern/v0.1.3.xsd b/src/libs/ifc/schema/pattern/v0.1.3.xsd new file mode 100644 index 000000000..6d72527c3 --- /dev/null +++ b/src/libs/ifc/schema/pattern/v0.1.3.xsd @@ -0,0 +1,308 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/libs/ifc/schema/standard_measurements.xsd b/src/libs/ifc/schema/standard_measurements.xsd index 97730dd24..913b6db89 100644 --- a/src/libs/ifc/schema/standard_measurements.xsd +++ b/src/libs/ifc/schema/standard_measurements.xsd @@ -15,7 +15,6 @@ - diff --git a/src/libs/ifc/stable.cpp b/src/libs/ifc/stable.cpp index 877ab2ddf..a42d3fd7c 100644 --- a/src/libs/ifc/stable.cpp +++ b/src/libs/ifc/stable.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/ifc/stable.h b/src/libs/ifc/stable.h index c2c2a7780..d94550e68 100644 --- a/src/libs/ifc/stable.h +++ b/src/libs/ifc/stable.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/ifc/xml/vabstractconverter.cpp b/src/libs/ifc/xml/vabstractconverter.cpp index f148d3fac..48fc13a10 100644 --- a/src/libs/ifc/xml/vabstractconverter.cpp +++ b/src/libs/ifc/xml/vabstractconverter.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/ifc/xml/vabstractconverter.h b/src/libs/ifc/xml/vabstractconverter.h index c3ce71d33..470e4e554 100644 --- a/src/libs/ifc/xml/vabstractconverter.h +++ b/src/libs/ifc/xml/vabstractconverter.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/ifc/xml/vdomdocument.cpp b/src/libs/ifc/xml/vdomdocument.cpp index 0f29fb26f..ce52253f7 100644 --- a/src/libs/ifc/xml/vdomdocument.cpp +++ b/src/libs/ifc/xml/vdomdocument.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -96,6 +96,7 @@ const QString VDomDocument::AttrUnit = QStringLiteral("unit"); const QString VDomDocument::UnitMM = QStringLiteral("mm"); const QString VDomDocument::UnitCM = QStringLiteral("cm"); const QString VDomDocument::UnitINCH = QStringLiteral("inch"); +const QString VDomDocument::UnitPX = QStringLiteral("px"); const QString VDomDocument::TagVersion = QStringLiteral("version"); //--------------------------------------------------------------------------------------------------------------------- @@ -133,6 +134,12 @@ QDomElement VDomDocument::elementById(const QString& id) return QDomElement(); } +//--------------------------------------------------------------------------------------------------------------------- +QDomElement VDomDocument::elementById(quint32 id) +{ + return elementById(QString().setNum(id)); +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief Removes all children of a given element tag. RENAME: removeAllChildren @@ -499,7 +506,7 @@ void VDomDocument::setXMLContent(const QString &fileName) //--------------------------------------------------------------------------------------------------------------------- Unit VDomDocument::StrToUnits(const QString &unit) { - QStringList units = QStringList() << UnitMM << UnitCM << UnitINCH; + QStringList units = QStringList() << UnitMM << UnitCM << UnitINCH << UnitPX; Unit result = Unit::Cm; switch (units.indexOf(unit)) { @@ -512,6 +519,9 @@ Unit VDomDocument::StrToUnits(const QString &unit) case 2:// inch result = Unit::Inch; break; + case 3:// px + result = Unit::Px; + break; default: result = Unit::Cm; break; @@ -563,6 +573,16 @@ QString VDomDocument::UnitsToStr(const Unit &unit, const bool translate) result = UnitINCH; } break; + case Unit::Px: + if (translate) + { + result = QObject::tr("px"); + } + else + { + result = UnitPX; + } + break; default: if (translate) { diff --git a/src/libs/ifc/xml/vdomdocument.h b/src/libs/ifc/xml/vdomdocument.h index ac2d5029a..1bf1b1963 100644 --- a/src/libs/ifc/xml/vdomdocument.h +++ b/src/libs/ifc/xml/vdomdocument.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentina project, a pattern making ** program that allows creating and modelling patterns of clothing. - ** Copyright (C) 2013 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -73,6 +73,7 @@ public: static const QString UnitMM; static const QString UnitCM; static const QString UnitINCH; + static const QString UnitPX; static const QString TagVersion; /** * @param data container with variables @@ -80,6 +81,7 @@ public: VDomDocument(); virtual ~VDomDocument(); QDomElement elementById(const QString& id); + QDomElement elementById(quint32 id); void removeAllChilds(QDomElement &element); template /** diff --git a/src/libs/ifc/xml/vpatternconverter.cpp b/src/libs/ifc/xml/vpatternconverter.cpp index af47c64ed..362fe7e28 100644 --- a/src/libs/ifc/xml/vpatternconverter.cpp +++ b/src/libs/ifc/xml/vpatternconverter.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -40,8 +40,8 @@ */ const QString VPatternConverter::PatternMinVerStr = QStringLiteral("0.1.0"); -const QString VPatternConverter::PatternMaxVerStr = QStringLiteral("0.1.2"); -const QString VPatternConverter::CurrentSchema = QStringLiteral("://schema/pattern/v0.1.2.xsd"); +const QString VPatternConverter::PatternMaxVerStr = QStringLiteral("0.1.3"); +const QString VPatternConverter::CurrentSchema = QStringLiteral("://schema/pattern/v0.1.3.xsd"); //--------------------------------------------------------------------------------------------------------------------- VPatternConverter::VPatternConverter(const QString &fileName) @@ -91,6 +91,8 @@ QString VPatternConverter::XSDSchema(int ver) const case (0x000101): return QStringLiteral("://schema/pattern/v0.1.1.xsd"); case (0x000102): + return QStringLiteral("://schema/pattern/v0.1.2.xsd"); + case (0x000103): return CurrentSchema; default: { @@ -119,9 +121,16 @@ void VPatternConverter::ApplyPatches() ToV0_1_2(); const QString schema = XSDSchema(0x000102); ValidateXML(schema, fileName); - break; + // continue conversion } case (0x000102): + { + ToV0_1_3(); + const QString schema = XSDSchema(0x000103); + ValidateXML(schema, fileName); + // continue conversion + } + case (0x000103): break; default: break; @@ -159,3 +168,10 @@ void VPatternConverter::ToV0_1_2() SetVersion(QStringLiteral("0.1.2")); Save(); } + +//--------------------------------------------------------------------------------------------------------------------- +void VPatternConverter::ToV0_1_3() +{ + SetVersion(QStringLiteral("0.1.3")); + Save(); +} diff --git a/src/libs/ifc/xml/vpatternconverter.h b/src/libs/ifc/xml/vpatternconverter.h index 5d8b4c651..c9075318d 100644 --- a/src/libs/ifc/xml/vpatternconverter.h +++ b/src/libs/ifc/xml/vpatternconverter.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -57,6 +57,7 @@ private: void ToV0_1_1(); void ToV0_1_2(); + void ToV0_1_3(); }; #endif // VPATTERNCONVERTER_H diff --git a/src/libs/libs.pro b/src/libs/libs.pro index 1828fc39e..508095bbf 100644 --- a/src/libs/libs.pro +++ b/src/libs/libs.pro @@ -3,4 +3,5 @@ CONFIG += ordered SUBDIRS = qmuparser \ vpropertyexplorer \ ifc \ - vobj + vobj \ + vlayout diff --git a/src/libs/qmuparser/qmuparser.cpp b/src/libs/qmuparser/qmuparser.cpp index 799c6c8ca..03f2e7805 100644 --- a/src/libs/qmuparser/qmuparser.cpp +++ b/src/libs/qmuparser/qmuparser.cpp @@ -1,7 +1,6 @@ /*************************************************************************************************** ** - ** Original work Copyright (C) 2013 Ingo Berg - ** Modified work Copyright 2014 Roman Telezhynskyi + ** Copyright (C) 2013 Ingo Berg ** ** Permission is hereby granted, free of charge, to any person obtaining a copy of this ** software and associated documentation files (the "Software"), to deal in the Software @@ -199,14 +198,14 @@ qreal QmuParser::Max(const qreal *a_afArg, int a_iArgc) * @param [out] a_fVal Pointer where the value should be stored in case one is found. * @return 1 if a value was found 0 otherwise. */ -int QmuParser::IsVal(const QString &a_szExpr, int *a_iPos, qreal *a_fVal) +int QmuParser::IsVal(const QString &a_szExpr, int *a_iPos, qreal *a_fVal, const std::locale &s_locale) { qreal fVal(0); std::wstring a_szExprStd = a_szExpr.toStdWString(); stringstream_type stream(a_szExprStd); stream.seekg(0); // todo: check if this really is necessary - stream.imbue(QmuParser::s_locale); + stream.imbue(s_locale); stream >> fVal; stringstream_type::pos_type iEnd = stream.tellg(); // Position after reading diff --git a/src/libs/qmuparser/qmuparser.h b/src/libs/qmuparser/qmuparser.h index e65bdfa40..fddbe451b 100644 --- a/src/libs/qmuparser/qmuparser.h +++ b/src/libs/qmuparser/qmuparser.h @@ -1,7 +1,6 @@ /*************************************************************************************************** ** - ** Original work Copyright (C) 2013 Ingo Berg - ** Modified work Copyright 2014 Roman Telezhynskyi + ** Copyright (C) 2013 Ingo Berg ** ** Permission is hereby granted, free of charge, to any person obtaining a copy of this ** software and associated documentation files (the "Software"), to deal in the Software @@ -54,7 +53,7 @@ namespace qmu virtual void OnDetectVar(const QString &pExpr, int &nStart, int &nEnd); qreal Diff(qreal *a_Var, qreal a_fPos, qreal a_fEpsilon = 0) const; protected: - static int IsVal(const QString &a_szExpr, int *a_iPos, qreal *a_fVal); + static int IsVal(const QString &a_szExpr, int *a_iPos, qreal *a_fVal, const std::locale &s_locale); // Trigonometric functions static qreal Tan2(qreal, qreal); // hyperbolic functions diff --git a/src/libs/qmuparser/qmuparser_global.h b/src/libs/qmuparser/qmuparser_global.h index 95202fc48..d06c58adf 100644 --- a/src/libs/qmuparser/qmuparser_global.h +++ b/src/libs/qmuparser/qmuparser_global.h @@ -1,7 +1,6 @@ /*************************************************************************************************** ** - ** Original work Copyright (C) 2013 Ingo Berg - ** Modified work Copyright 2014 Roman Telezhynskyi + ** Copyright (C) 2014 Roman Telezhynskyi ** ** Permission is hereby granted, free of charge, to any person obtaining a copy of this ** software and associated documentation files (the "Software"), to deal in the Software diff --git a/src/libs/qmuparser/qmuparserbase.cpp b/src/libs/qmuparser/qmuparserbase.cpp index c627e1f80..2a0a8d68f 100644 --- a/src/libs/qmuparser/qmuparserbase.cpp +++ b/src/libs/qmuparser/qmuparserbase.cpp @@ -1,7 +1,6 @@ /*************************************************************************************************** ** - ** Original work Copyright (C) 2013 Ingo Berg - ** Modified work Copyright 2014 Roman Telezhynskyi + ** Copyright (C) 2013 Ingo Berg ** ** Permission is hereby granted, free of charge, to any person obtaining a copy of this ** software and associated documentation files (the "Software"), to deal in the Software @@ -37,7 +36,6 @@ using namespace std; namespace qmu { -std::locale QmuParserBase::s_locale = std::locale(std::locale::classic(), new change_dec_sep('.')); bool QmuParserBase::g_DbgDumpCmdCode = false; bool QmuParserBase::g_DbgDumpStack = false; @@ -57,7 +55,8 @@ const QStringList QmuParserBase::c_DefaultOprt = QStringList()<< "<=" << ">=" << * @brief Constructor. */ QmuParserBase::QmuParserBase() - :m_pParseFormula(&QmuParserBase::ParseString), m_vRPN(), m_vStringBuf(), m_vStringVarBuf(), m_pTokenReader(), + :s_locale(std::locale(std::locale::classic(), new change_dec_sep('.'))), + m_pParseFormula(&QmuParserBase::ParseString), m_vRPN(), m_vStringBuf(), m_vStringVarBuf(), m_pTokenReader(), m_FunDef(), m_PostOprtDef(), m_InfixOprtDef(), m_OprtDef(), m_ConstDef(), m_StrVarDef(), m_VarDef(), m_bBuiltInOp(true), m_sNameChars(), m_sOprtChars(), m_sInfixOprtChars(), m_nIfElseCounter(0), m_vStackBuffer(), m_nFinalResultIdx(0), m_Tokens(QMap()), m_Numbers(QMap()), allowSubexpressions(true) @@ -72,10 +71,11 @@ QmuParserBase::QmuParserBase() * Tha parser can be safely copy constructed but the bytecode is reset during copy construction. */ QmuParserBase::QmuParserBase(const QmuParserBase &a_Parser) - :m_pParseFormula(&QmuParserBase::ParseString), m_vRPN(), m_vStringBuf(), m_vStringVarBuf(), m_pTokenReader(), - m_FunDef(), m_PostOprtDef(), m_InfixOprtDef(), m_OprtDef(), m_ConstDef(), m_StrVarDef(), m_VarDef(), - m_bBuiltInOp(true), m_sNameChars(), m_sOprtChars(), m_sInfixOprtChars(), m_nIfElseCounter(0), m_vStackBuffer(), - m_nFinalResultIdx(0), m_Tokens(QMap()), m_Numbers(QMap()), allowSubexpressions(true) + :s_locale(a_Parser.getLocale()), m_pParseFormula(&QmuParserBase::ParseString), m_vRPN(), m_vStringBuf(), + m_vStringVarBuf(), m_pTokenReader(), m_FunDef(), m_PostOprtDef(), m_InfixOprtDef(), m_OprtDef(), m_ConstDef(), + m_StrVarDef(), m_VarDef(), m_bBuiltInOp(true), m_sNameChars(), m_sOprtChars(), m_sInfixOprtChars(), + m_nIfElseCounter(0), m_vStackBuffer(), m_nFinalResultIdx(0), m_Tokens(QMap()), + m_Numbers(QMap()), allowSubexpressions(true) { m_pTokenReader.reset(new token_reader_type(this)); Assign(a_Parser); @@ -220,6 +220,18 @@ void QmuParserBase::setAllowSubexpressions(bool value) allowSubexpressions = value; } +//--------------------------------------------------------------------------------------------------------------------- +std::locale QmuParserBase::getLocale() const +{ + return s_locale; +} + +//--------------------------------------------------------------------------------------------------------------------- +void QmuParserBase::setLocale(const std::locale &value) +{ + s_locale = value; +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief Returns the version of muparser. @@ -1300,7 +1312,7 @@ void QmuParserBase::CreateRPN() const for (;;) { - opt = m_pTokenReader->ReadNextToken(); + opt = m_pTokenReader->ReadNextToken(s_locale); switch (opt.GetCode()) { diff --git a/src/libs/qmuparser/qmuparserbase.h b/src/libs/qmuparser/qmuparserbase.h index 59d8b7c59..aa96547a0 100644 --- a/src/libs/qmuparser/qmuparserbase.h +++ b/src/libs/qmuparser/qmuparserbase.h @@ -1,7 +1,6 @@ /*************************************************************************************************** ** - ** Original work Copyright (C) 2013 Ingo Berg - ** Modified work Copyright 2014 Roman Telezhynskyi + ** Copyright (C) 2013 Ingo Berg ** ** Permission is hereby granted, free of charge, to any person obtaining a copy of this ** software and associated documentation files (the "Software"), to deal in the Software @@ -122,9 +121,12 @@ public: } void setAllowSubexpressions(bool value); + std::locale getLocale() const; + void setLocale(const std::locale &value); + protected: static const QStringList c_DefaultOprt; - static std::locale s_locale; ///< The locale used by the parser + std::locale s_locale; ///< The locale used by the parser static bool g_DbgDumpCmdCode; static bool g_DbgDumpStack; void Init(); diff --git a/src/libs/qmuparser/qmuparserbytecode.cpp b/src/libs/qmuparser/qmuparserbytecode.cpp index 680566436..83c8b97e9 100644 --- a/src/libs/qmuparser/qmuparserbytecode.cpp +++ b/src/libs/qmuparser/qmuparserbytecode.cpp @@ -1,7 +1,6 @@ /*************************************************************************************************** ** - ** Original work Copyright (C) 2013 Ingo Berg - ** Modified work Copyright 2014 Roman Telezhynskyi + ** Copyright (C) 2013 Ingo Berg ** ** Permission is hereby granted, free of charge, to any person obtaining a copy of this ** software and associated documentation files (the "Software"), to deal in the Software diff --git a/src/libs/qmuparser/qmuparserbytecode.h b/src/libs/qmuparser/qmuparserbytecode.h index 8ef932e03..a466fa068 100644 --- a/src/libs/qmuparser/qmuparserbytecode.h +++ b/src/libs/qmuparser/qmuparserbytecode.h @@ -1,7 +1,6 @@ /*************************************************************************************************** ** - ** Original work Copyright (C) 2013 Ingo Berg - ** Modified work Copyright 2014 Roman Telezhynskyi + ** Copyright (C) 2013 Ingo Berg ** ** Permission is hereby granted, free of charge, to any person obtaining a copy of this ** software and associated documentation files (the "Software"), to deal in the Software diff --git a/src/libs/qmuparser/qmuparsercallback.cpp b/src/libs/qmuparser/qmuparsercallback.cpp index 6f1cd95da..826ab03e9 100644 --- a/src/libs/qmuparser/qmuparsercallback.cpp +++ b/src/libs/qmuparser/qmuparsercallback.cpp @@ -1,7 +1,6 @@ /*************************************************************************************************** ** - ** Original work Copyright (C) 2013 Ingo Berg - ** Modified work Copyright 2014 Roman Telezhynskyi + ** Copyright (C) 2013 Ingo Berg ** ** Permission is hereby granted, free of charge, to any person obtaining a copy of this ** software and associated documentation files (the "Software"), to deal in the Software diff --git a/src/libs/qmuparser/qmuparsercallback.h b/src/libs/qmuparser/qmuparsercallback.h index f6573a5f9..c959050ba 100644 --- a/src/libs/qmuparser/qmuparsercallback.h +++ b/src/libs/qmuparser/qmuparsercallback.h @@ -1,7 +1,6 @@ /*************************************************************************************************** ** - ** Original work Copyright (C) 2013 Ingo Berg - ** Modified work Copyright 2014 Roman Telezhynskyi + ** Copyright (C) 2013 Ingo Berg ** ** Permission is hereby granted, free of charge, to any person obtaining a copy of this ** software and associated documentation files (the "Software"), to deal in the Software diff --git a/src/libs/qmuparser/qmuparserdef.h b/src/libs/qmuparser/qmuparserdef.h index cf6ce2652..7b2a306a2 100644 --- a/src/libs/qmuparser/qmuparserdef.h +++ b/src/libs/qmuparser/qmuparserdef.h @@ -1,7 +1,6 @@ /*************************************************************************************************** ** - ** Original work Copyright (C) 2013 Ingo Berg - ** Modified work Copyright 2014 Roman Telezhynskyi + ** Copyright (C) 2013 Ingo Berg ** ** Permission is hereby granted, free of charge, to any person obtaining a copy of this ** software and associated documentation files (the "Software"), to deal in the Software @@ -25,6 +24,7 @@ #include #include +#include #include "qmuparserfixes.h" @@ -275,7 +275,7 @@ typedef qreal ( *strfun_type2 ) ( const QString &, qreal ); typedef qreal ( *strfun_type3 ) ( const QString &, qreal, qreal ); /** @brief Callback used for functions that identify values in a string. */ -typedef int ( *identfun_type ) ( const QString &sExpr, int *nPos, qreal *fVal ); +typedef int ( *identfun_type ) ( const QString &sExpr, int *nPos, qreal *fVal, const std::locale &s_locale ); /** @brief Callback used for variable creation factory functions. */ typedef qreal* ( *facfun_type ) ( const QString &, void* ); diff --git a/src/libs/qmuparser/qmuparsererror.cpp b/src/libs/qmuparser/qmuparsererror.cpp index 89ffbea50..d5bc769a9 100644 --- a/src/libs/qmuparser/qmuparsererror.cpp +++ b/src/libs/qmuparser/qmuparsererror.cpp @@ -1,7 +1,6 @@ /*************************************************************************************************** ** - ** Original work Copyright (C) 2013 Ingo Berg - ** Modified work Copyright 2014 Roman Telezhynskyi + ** Copyright (C) 2013 Ingo Berg ** ** Permission is hereby granted, free of charge, to any person obtaining a copy of this ** software and associated documentation files (the "Software"), to deal in the Software diff --git a/src/libs/qmuparser/qmuparsererror.h b/src/libs/qmuparser/qmuparsererror.h index 4aea8f35f..4ec0d90bf 100644 --- a/src/libs/qmuparser/qmuparsererror.h +++ b/src/libs/qmuparser/qmuparsererror.h @@ -1,7 +1,6 @@ /*************************************************************************************************** ** - ** Original work Copyright (C) 2013 Ingo Berg - ** Modified work Copyright 2014 Roman Telezhynskyi + ** Copyright (C) 2013 Ingo Berg ** ** Permission is hereby granted, free of charge, to any person obtaining a copy of this ** software and associated documentation files (the "Software"), to deal in the Software diff --git a/src/libs/qmuparser/qmuparserfixes.h b/src/libs/qmuparser/qmuparserfixes.h index 85b4298cd..29c6d4f70 100644 --- a/src/libs/qmuparser/qmuparserfixes.h +++ b/src/libs/qmuparser/qmuparserfixes.h @@ -1,7 +1,6 @@ /*************************************************************************************************** ** - ** Original work Copyright (C) 2013 Ingo Berg - ** Modified work Copyright 2014 Roman Telezhynskyi + ** Copyright (C) 2013 Ingo Berg ** ** Permission is hereby granted, free of charge, to any person obtaining a copy of this ** software and associated documentation files (the "Software"), to deal in the Software diff --git a/src/libs/qmuparser/qmuparsertest.cpp b/src/libs/qmuparser/qmuparsertest.cpp index 1d11cef83..d71ecf514 100644 --- a/src/libs/qmuparser/qmuparsertest.cpp +++ b/src/libs/qmuparser/qmuparsertest.cpp @@ -1,7 +1,6 @@ /*************************************************************************************************** ** - ** Original work Copyright (C) 2013 Ingo Berg - ** Modified work Copyright 2014 Roman Telezhynskyi + ** Copyright (C) 2013 Ingo Berg ** ** Permission is hereby granted, free of charge, to any person obtaining a copy of this ** software and associated documentation files (the "Software"), to deal in the Software @@ -62,8 +61,9 @@ QmuParserTester::QmuParserTester() } //--------------------------------------------------------------------------------------------------------------------- -int QmuParserTester::IsHexVal ( const QString &a_szExpr, int *a_iPos, qreal *a_fVal ) +int QmuParserTester::IsHexVal ( const QString &a_szExpr, int *a_iPos, qreal *a_fVal, const std::locale &s_locale ) { + Q_UNUSED(s_locale) if ( a_szExpr.data()[1] == 0 || ( a_szExpr.data()[0] != '0' || a_szExpr.data()[1] != 'x' ) ) { return 0; diff --git a/src/libs/qmuparser/qmuparsertest.h b/src/libs/qmuparser/qmuparsertest.h index d2ae906ef..8444175ca 100644 --- a/src/libs/qmuparser/qmuparsertest.h +++ b/src/libs/qmuparser/qmuparsertest.h @@ -1,7 +1,6 @@ /*************************************************************************************************** ** - ** Original work Copyright (C) 2013 Ingo Berg - ** Modified work Copyright 2014 Roman Telezhynskyi + ** Copyright (C) 2013 Ingo Berg ** ** Permission is hereby granted, free of charge, to any person obtaining a copy of this ** software and associated documentation files (the "Software"), to deal in the Software @@ -276,7 +275,7 @@ private: } // Custom value recognition - static int IsHexVal ( const QString &a_szExpr, int *a_iPos, qreal *a_fVal ); + static int IsHexVal (const QString &a_szExpr, int *a_iPos, qreal *a_fVal , const std::locale &s_locale); // cppcheck-suppress functionStatic int TestNames(); diff --git a/src/libs/qmuparser/qmuparsertoken.h b/src/libs/qmuparser/qmuparsertoken.h index 8db39d292..2c68be7cd 100644 --- a/src/libs/qmuparser/qmuparsertoken.h +++ b/src/libs/qmuparser/qmuparsertoken.h @@ -1,7 +1,6 @@ /*************************************************************************************************** ** - ** Original work Copyright (C) 2013 Ingo Berg - ** Modified work Copyright 2014 Roman Telezhynskyi + ** Copyright (C) 2013 Ingo Berg ** ** Permission is hereby granted, free of charge, to any person obtaining a copy of this ** software and associated documentation files (the "Software"), to deal in the Software diff --git a/src/libs/qmuparser/qmuparsertokenreader.cpp b/src/libs/qmuparser/qmuparsertokenreader.cpp index 9475308cc..b6da95f2e 100644 --- a/src/libs/qmuparser/qmuparsertokenreader.cpp +++ b/src/libs/qmuparser/qmuparsertokenreader.cpp @@ -1,7 +1,6 @@ /*************************************************************************************************** ** - ** Original work Copyright (C) 2013 Ingo Berg - ** Modified work Copyright 2014 Roman Telezhynskyi + ** Copyright (C) 2013 Ingo Berg ** ** Permission is hereby granted, free of charge, to any person obtaining a copy of this ** software and associated documentation files (the "Software"), to deal in the Software @@ -204,7 +203,7 @@ void QmuParserTokenReader::ReInit() /** * @brief Read the next token from the string. */ -QmuParserTokenReader::token_type QmuParserTokenReader::ReadNextToken() +QmuParserTokenReader::token_type QmuParserTokenReader::ReadNextToken(const std::locale &s_locale) { assert ( m_pParser ); @@ -236,7 +235,7 @@ QmuParserTokenReader::token_type QmuParserTokenReader::ReadNextToken() { return SaveBeforeReturn ( tok ); // Check for function argument separators } - if ( IsValTok ( tok ) ) + if ( IsValTok ( tok, s_locale ) ) { return SaveBeforeReturn ( tok ); // Check for values / constant tokens } @@ -766,7 +765,7 @@ bool QmuParserTokenReader::IsPostOpTok ( token_type &a_Tok ) * @param a_Tok [out] If a value token is found it will be placed here. * @return true if a value token has been found. */ -bool QmuParserTokenReader::IsValTok ( token_type &a_Tok ) +bool QmuParserTokenReader::IsValTok ( token_type &a_Tok, const std::locale &s_locale ) { assert ( m_pConstDef ); assert ( m_pParser ); @@ -802,7 +801,7 @@ bool QmuParserTokenReader::IsValTok ( token_type &a_Tok ) for ( item = m_vIdentFun.begin(); item != m_vIdentFun.end(); ++item ) { int iStart = m_iPos; - if ( ( *item ) ( m_strFormula.mid ( m_iPos ), &m_iPos, &fVal ) == 1 ) + if ( ( *item ) ( m_strFormula.mid ( m_iPos ), &m_iPos, &fVal, s_locale ) == 1 ) { // 2013-11-27 Issue 2: https://code.google.com/p/muparser/issues/detail?id=2 strTok = m_strFormula.mid ( iStart, m_iPos-iStart ); diff --git a/src/libs/qmuparser/qmuparsertokenreader.h b/src/libs/qmuparser/qmuparsertokenreader.h index 43d08106e..af4dbc245 100644 --- a/src/libs/qmuparser/qmuparsertokenreader.h +++ b/src/libs/qmuparser/qmuparsertokenreader.h @@ -1,7 +1,6 @@ /*************************************************************************************************** ** - ** Original work Copyright (C) 2013 Ingo Berg - ** Modified work Copyright 2014 Roman Telezhynskyi + ** Copyright (C) 2013 Ingo Berg ** ** Permission is hereby granted, free of charge, to any person obtaining a copy of this ** software and associated documentation files (the "Software"), to deal in the Software @@ -58,7 +57,7 @@ public: QChar GetArgSep() const; void IgnoreUndefVar(bool bIgnore); void ReInit(); - token_type ReadNextToken(); + token_type ReadNextToken(const std::locale &s_locale); private: /** @@ -103,7 +102,7 @@ private: bool IsFunTok(token_type &a_Tok); bool IsPostOpTok(token_type &a_Tok); bool IsOprt(token_type &a_Tok); - bool IsValTok(token_type &a_Tok); + bool IsValTok(token_type &a_Tok, const std::locale &s_locale); bool IsVarTok(token_type &a_Tok); bool IsStrVarTok(token_type &a_Tok); bool IsUndefVarTok(token_type &a_Tok); diff --git a/src/libs/qmuparser/qmutranslation.cpp b/src/libs/qmuparser/qmutranslation.cpp index a01b5cdf5..b558f1345 100644 --- a/src/libs/qmuparser/qmutranslation.cpp +++ b/src/libs/qmuparser/qmutranslation.cpp @@ -1,6 +1,6 @@ /*************************************************************************************************** ** - ** Original work Copyright (C) 2014 Roman Telezhynskyi + ** Copyright (C) 2014 Roman Telezhynskyi ** ** Permission is hereby granted, free of charge, to any person obtaining a copy of this ** software and associated documentation files (the "Software"), to deal in the Software diff --git a/src/libs/qmuparser/qmutranslation.h b/src/libs/qmuparser/qmutranslation.h index 688e8ecb5..850168077 100644 --- a/src/libs/qmuparser/qmutranslation.h +++ b/src/libs/qmuparser/qmutranslation.h @@ -1,6 +1,6 @@ /*************************************************************************************************** ** - ** Original work Copyright (C) 2014 Roman Telezhynskyi + ** Copyright (C) 2014 Roman Telezhynskyi ** ** Permission is hereby granted, free of charge, to any person obtaining a copy of this ** software and associated documentation files (the "Software"), to deal in the Software diff --git a/src/libs/qmuparser/stable.cpp b/src/libs/qmuparser/stable.cpp index 243b23938..fd6b6e173 100644 --- a/src/libs/qmuparser/stable.cpp +++ b/src/libs/qmuparser/stable.cpp @@ -1,30 +1,27 @@ -/************************************************************************ +/*************************************************************************************************** ** - ** @file stable.cpp - ** @author Roman Telezhynskyi - ** @date November 15, 2013 + ** @file stable.h + ** @author Copyright (C) 2014 Roman Telezhynskyi + ** @date April 30, 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 - ** All Rights Reserved. + ** Permission is hereby granted, free of charge, to any person obtaining a copy of this + ** software and associated documentation files (the "Software"), to deal in the Software + ** without restriction, including without limitation the rights to use, copy, modify, + ** merge, publish, distribute, sublicense, and/or sell copies of the Software, and to + ** permit persons to whom the Software is furnished to do so, subject to the following conditions: ** - ** 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. + ** The above copyright notice and this permission notice shall be included in all copies or + ** substantial portions of the Software. ** - ** 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. + ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT + ** NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + ** NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + ** DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + ** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ** - ** You should have received a copy of the GNU General Public License - ** along with Valentina. If not, see . - ** - *************************************************************************/ + ******************************************************************************************************/ // Build the precompiled headers. #include "stable.h" diff --git a/src/libs/qmuparser/stable.h b/src/libs/qmuparser/stable.h index 2c8c41189..66fbc35dd 100644 --- a/src/libs/qmuparser/stable.h +++ b/src/libs/qmuparser/stable.h @@ -1,30 +1,27 @@ -/************************************************************************ +/*************************************************************************************************** ** ** @file stable.h - ** @author Roman Telezhynskyi - ** @date November 15, 2013 + ** @author Copyright (C) 2014 Roman Telezhynskyi + ** @date April 30, 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 - ** All Rights Reserved. + ** Permission is hereby granted, free of charge, to any person obtaining a copy of this + ** software and associated documentation files (the "Software"), to deal in the Software + ** without restriction, including without limitation the rights to use, copy, modify, + ** merge, publish, distribute, sublicense, and/or sell copies of the Software, and to + ** permit persons to whom the Software is furnished to do so, subject to the following conditions: ** - ** 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. + ** The above copyright notice and this permission notice shall be included in all copies or + ** substantial portions of the Software. ** - ** 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. + ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT + ** NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + ** NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + ** DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + ** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ** - ** You should have received a copy of the GNU General Public License - ** along with Valentina. If not, see . - ** - *************************************************************************/ + ******************************************************************************************************/ #ifndef STABLE_H #define STABLE_H diff --git a/src/libs/vlayout/stable.cpp b/src/libs/vlayout/stable.cpp new file mode 100644 index 000000000..16fc7b547 --- /dev/null +++ b/src/libs/vlayout/stable.cpp @@ -0,0 +1,30 @@ +/************************************************************************ + ** + ** @file stable.cpp + ** @author Roman Telezhynskyi + ** @date 2 1, 2015 + ** + ** @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-2015 Valentina project + ** 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 . + ** + *************************************************************************/ + +// Build the precompiled headers. +#include "stable.h" diff --git a/src/libs/vlayout/stable.h b/src/libs/vlayout/stable.h new file mode 100644 index 000000000..829c1d86f --- /dev/null +++ b/src/libs/vlayout/stable.h @@ -0,0 +1,48 @@ +/************************************************************************ + ** + ** @file stable.h + ** @author Roman Telezhynskyi + ** @date 2 1, 2015 + ** + ** @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-2015 Valentina project + ** 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 . + ** + *************************************************************************/ + +#ifndef STABLE_H +#define STABLE_H + +/* I like to include this pragma too, so the build log indicates if pre-compiled headers were in use. */ +#ifndef __clang__ +#pragma message("Compiling precompiled headers for VLayout library.\n") +#endif + +/* Add C includes here */ + +#if defined __cplusplus +/* Add C++ includes here */ + +#ifdef QT_CORE_LIB +#include +#endif + +#endif/*__cplusplus*/ + +#endif // STABLE_H diff --git a/src/app/geometry/vequidistant.cpp b/src/libs/vlayout/vabstractdetail.cpp similarity index 55% rename from src/app/geometry/vequidistant.cpp rename to src/libs/vlayout/vabstractdetail.cpp index 6593e54dd..ef0a85aa7 100644 --- a/src/app/geometry/vequidistant.cpp +++ b/src/libs/vlayout/vabstractdetail.cpp @@ -1,14 +1,14 @@ /************************************************************************ ** - ** @file vequidistant.cpp + ** @file vabstractdetail.cpp ** @author Roman Telezhynskyi - ** @date 28 1, 2014 + ** @date 2 1, 2015 ** ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify @@ -26,163 +26,239 @@ ** *************************************************************************/ -#include "varc.h" -#include "vequidistant.h" -#include "vpointf.h" -#include "vspline.h" -#include "vsplinepath.h" -#include "../core/vapplication.h" +#include "vabstractdetail.h" +#include "vabstractdetail_p.h" + +#include +#include +#include #include -#include -#include "../container/vcontainer.h" -#include //--------------------------------------------------------------------------------------------------------------------- -VEquidistant::VEquidistant(const VContainer *data) - :data(data) +/** + * @brief VAbstractDetail default contructor. Create empty detail. + */ +VAbstractDetail::VAbstractDetail() + :d(new VAbstractDetailData) +{} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief VAbstractDetail constructor. + * @param name detail name. + */ +VAbstractDetail::VAbstractDetail(const QString &name) + :d(new VAbstractDetailData(name)) +{} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief VAbstractDetail copy constructor. + * @param detail detail. + */ +VAbstractDetail::VAbstractDetail(const VAbstractDetail &detail) + :d (detail.d) +{} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief operator = assignment operator. + * @param detail detail. + * @return new detail. + */ +VAbstractDetail &VAbstractDetail::operator=(const VAbstractDetail &detail) { - SCASSERT(data != nullptr); + if ( &detail == this ) + { + return *this; + } + d = detail.d; + return *this; } //--------------------------------------------------------------------------------------------------------------------- -QPainterPath VEquidistant::ContourPath(const quint32 &idDetail) const +VAbstractDetail::~VAbstractDetail() +{} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief Clear detail full clear. + */ +void VAbstractDetail::Clear() { - SCASSERT(data != nullptr); - VDetail detail = data->GetDetail(idDetail); - QVector points; - QVector pointsEkv; - for (int i = 0; i< detail.CountNode(); ++i) + d->name.clear(); + d->seamAllowance = false; + d->closed = true; + d->width = 0; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getName return detail name. + * @return name. + */ +QString VAbstractDetail::getName() const +{ + return d->name; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief setName set detail name. + * @param value new name. + */ +void VAbstractDetail::setName(const QString &value) +{ + d->name = value; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getSeamAllowance keep status for seam allowance detail. + * @return true - need seam allowance, false - no need seam allowance. + */ +bool VAbstractDetail::getSeamAllowance() const +{ + return d->seamAllowance; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief setSeamAllowance set status for seam allowance detail. + * @param value true - need seam allowance, false - no need seam allowance. + */ +void VAbstractDetail::setSeamAllowance(bool value) +{ + d->seamAllowance = value; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getClosed keep close status for detail equdistant. + * @return true - close equdistant, false - don't close equdistant. + */ +bool VAbstractDetail::getClosed() const +{ + return d->closed; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief setClosed set close status for detail equdistant. + * @param value true - close equdistant, false - don't close equdistant. + */ +void VAbstractDetail::setClosed(bool value) +{ + d->closed = value; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getWidth return value detail seam allowance. + * @return value in mm. + */ +qreal VAbstractDetail::getWidth() const +{ + return d->width; +} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief setWidth set value detail seam allowance. + * @param value width in mm. + */ +void VAbstractDetail::setWidth(const qreal &value) +{ + d->width = value; +} + +//--------------------------------------------------------------------------------------------------------------------- +QVector VAbstractDetail::Equidistant(const QVector &points, const EquidistantType &eqv, qreal width) +{ + QVector ekvPoints; + + if (width <= 0) { - switch (detail.at(i).getTypeTool()) + qDebug()<<"Width <= 0."; + return QVector(); + } + + QVector p = CorrectEquidistantPoints(points); + if ( p.size() < 3 ) + { + qDebug()<<"Not enough points for building the equidistant."; + return QVector(); + } + + if (eqv == EquidistantType::CloseEquidistant) + { + p.append(p.at(0)); + } + for (qint32 i = 0; i < p.size(); ++i ) + { + if ( i == 0 && eqv == EquidistantType::CloseEquidistant) + {//first point, polyline closed + ekvPoints< VAbstractDetail::RemoveDublicates(const QVector &points) +{ + QVector p = points; + for(int i = 0; i < p.size(); i++) + { + QPointF current = p.at(i); + + for(int j = i; j < p.size(); j++) { - case (Tool::NodePoint): + if(j == i) { - const QSharedPointer point = data->GeometricObject(detail.at(i).getId()); - points.append(point->toQPointF()); - if (detail.getSeamAllowance() == true) + continue; + } + else + { + QPointF temp = p.at(j); + if(current == temp) { - QPointF pEkv = point->toQPointF(); - pEkv.setX(pEkv.x()+detail.at(i).getMx()); - pEkv.setY(pEkv.y()+detail.at(i).getMy()); - pointsEkv.append(pEkv); + QVector::iterator iter = p.begin() + j; + p.erase(iter); + j--; } } - break; - case (Tool::NodeArc): - case (Tool::NodeSpline): - case (Tool::NodeSplinePath): - { - const QSharedPointer curve=data->GeometricObject(detail.at(i).getId()); - - const QPointF begin = StartSegment(detail, i); - const QPointF end = EndSegment(detail, i); - - QVector nodePoints = curve->GetSegmentPoints(begin, end, detail.at(i).getReverse()); - points << nodePoints; - if (detail.getSeamAllowance() == true) - { - pointsEkv << biasPoints(nodePoints, detail.at(i).getMx(), detail.at(i).getMy()); - } - } - break; - default: - qDebug()<<"Get wrong tool type. Ignore."<< static_cast(detail.at(i).getTypeTool()); - break; } } - QPainterPath path; - path.moveTo(points[0]); - for (qint32 i = 1; i < points.count(); ++i) - { - path.lineTo(points.at(i)); - } - path.lineTo(points.at(0)); - - pointsEkv = CorrectEquidistantPoints(pointsEkv); - pointsEkv = CheckLoops(pointsEkv); - - if (detail.getSeamAllowance() == true) - { - QPainterPath ekv; - if (detail.getClosed() == true) - { - ekv = Equidistant(pointsEkv, EquidistantType::CloseEquidistant, qApp->toPixel(detail.getWidth())); - } - else - { - ekv = Equidistant(pointsEkv, EquidistantType::OpenEquidistant, qApp->toPixel(detail.getWidth())); - } - path.addPath(ekv); - path.setFillRule(Qt::WindingFill); - } - return path; -} - -//--------------------------------------------------------------------------------------------------------------------- -QPointF VEquidistant::StartSegment(const VDetail &detail, const int &i) const -{ - QPointF begin; - if (detail.CountNode() > 1) - { - if (i == 0) - { - if (detail.at(detail.CountNode()-1).getTypeTool() == Tool::NodePoint) - { - begin = data->GeometricObject(detail.at(detail.CountNode()-1).getId())->toQPointF(); - } - } - else - { - if (detail.at(i-1).getTypeTool() == Tool::NodePoint) - { - begin = data->GeometricObject(detail.at(i-1).getId())->toQPointF(); - } - } - } - return begin; -} - -//--------------------------------------------------------------------------------------------------------------------- -QPointF VEquidistant::EndSegment(const VDetail &detail, const int &i) const -{ - QPointF end; - if (detail.CountNode() > 2) - { - if (i == detail.CountNode() - 1) - { - if (detail.at(0).getTypeTool() == Tool::NodePoint) - { - end = data->GeometricObject(detail.at(0).getId())->toQPointF(); - } - } - else - { - if (detail.at(i+1).getTypeTool() == Tool::NodePoint) - { - end = data->GeometricObject(detail.at(i+1).getId())->toQPointF(); - } - } - } - return end; -} - -//--------------------------------------------------------------------------------------------------------------------- -QVector VEquidistant::biasPoints(const QVector &points, const qreal &mx, const qreal &my) -{ - QVector p; - for (qint32 i = 0; i < points.size(); ++i) - { - QPointF point = points.at(i); - point.setX(point.x() + mx); - point.setY(point.y() + my); - p.append(point); - } return p; } //--------------------------------------------------------------------------------------------------------------------- -QVector VEquidistant::CorrectEquidistantPoints(const QVector &points) +/** + * @brief CorrectEquidistantPoints clear equivalent points and remove point on line from equdistant. + * @param points list of points equdistant. + * @return corrected list. + */ +QVector VAbstractDetail::CorrectEquidistantPoints(const QVector &points) { QVector correctPoints; if (points.size()<4)//Better don't check if only three points. We can destroy equidistant. @@ -190,24 +266,10 @@ QVector VEquidistant::CorrectEquidistantPoints(const QVector & qDebug()<<"Only three points."; return points; } + //Clear equivalent points - for (qint32 i = 0; i VEquidistant::CorrectEquidistantPoints(const QVector & correctPoints.remove(i); } } + correctPoints = CheckLoops(correctPoints); return correctPoints; } //--------------------------------------------------------------------------------------------------------------------- -QPainterPath VEquidistant::Equidistant(QVector points, const EquidistantType &eqv, const qreal &width) -{ - QPainterPath ekv; - QVector ekvPoints; - if ( points.size() < 3 ) - { - qDebug()<<"Not enough points for building the equidistant."; - return ekv; - } - if (width <= 0) - { - qDebug()<<"Width <= 0."; - return ekv; - } - for (qint32 i = 0; i < points.size(); ++i ) - { - if (i != points.size()-1) - { - if (points.at(i) == points.at(i+1)) - { - points.remove(i+1); - } - } - else - { - if (points.at(i) == points.at(0)) - { - points.remove(i); - } - } - } - if (eqv == EquidistantType::CloseEquidistant) - { - points.append(points.at(0)); - } - for (qint32 i = 0; i < points.size(); ++i ) - { - if ( i == 0 && eqv == EquidistantType::CloseEquidistant) - {//first point, polyline closed - ekvPoints< VEquidistant::CheckLoops(const QVector &points) +/** + * @brief CheckLoops seek and delete loops in equidistant. + * @param points vector of points of equidistant. + * @return vector of points of equidistant. + */ +QVector VAbstractDetail::CheckLoops(const QVector &points) { QVector ekvPoints; /*If we got less than 4 points no need seek loops.*/ @@ -360,9 +356,19 @@ QVector VEquidistant::CheckLoops(const QVector &points) } //--------------------------------------------------------------------------------------------------------------------- -QVector VEquidistant::EkvPoint(const QLineF &line1, const QLineF &line2, const qreal &width) +/** + * @brief EkvPoint return vector of points of equidistant two lines. Last point of two lines must be equal. + * @param line1 first line. + * @param line2 second line. + * @param width width of equidistant. + * @return vector of points. + */ +QVector VAbstractDetail::EkvPoint(const QLineF &line1, const QLineF &line2, const qreal &width) { - SCASSERT(width > 0); + if (width <= 0) + { + return QVector(); + } QVector points; if (line1.p2() != line2.p2()) { @@ -426,18 +432,29 @@ QVector VEquidistant::EkvPoint(const QLineF &line1, const QLineF &line2 } //--------------------------------------------------------------------------------------------------------------------- -QLineF VEquidistant::ParallelLine(const QLineF &line, qreal width) +/** + * @brief ParallelLine create parallel line. + * @param line starting line. + * @param width width to parallel line. + * @return parallel line. + */ +QLineF VAbstractDetail::ParallelLine(const QLineF &line, qreal width) { - SCASSERT(width > 0); QLineF paralel = QLineF (SingleParallelPoint(line, 90, width), SingleParallelPoint(QLineF(line.p2(), line.p1()), -90, width)); return paralel; } //--------------------------------------------------------------------------------------------------------------------- -QPointF VEquidistant::SingleParallelPoint(const QLineF &line, const qreal &angle, const qreal &width) +/** + * @brief SingleParallelPoint return point of parallel line. + * @param line starting line. + * @param angle angle in degree. + * @param width width to parallel line. + * @return point of parallel line. + */ +QPointF VAbstractDetail::SingleParallelPoint(const QLineF &line, const qreal &angle, const qreal &width) { - SCASSERT(width > 0); QLineF pLine = line; pLine.setAngle( pLine.angle() + angle ); pLine.setLength( width ); diff --git a/src/libs/vlayout/vabstractdetail.h b/src/libs/vlayout/vabstractdetail.h new file mode 100644 index 000000000..04ef46214 --- /dev/null +++ b/src/libs/vlayout/vabstractdetail.h @@ -0,0 +1,82 @@ +/************************************************************************ + ** + ** @file vabstractdetail.h + ** @author Roman Telezhynskyi + ** @date 2 1, 2015 + ** + ** @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-2015 Valentina project + ** 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 . + ** + *************************************************************************/ + +#ifndef VABSTRACTDETAIL_H +#define VABSTRACTDETAIL_H + +#include + +#include "vlayoutdef.h" + +class QString; +class VAbstractDetailData; +class QPointF; +class QLineF; + +/** + * @brief The VAbstractDetail class abstract class for all details. + */ +class VAbstractDetail +{ +public: + VAbstractDetail(); + VAbstractDetail(const QString &name); + VAbstractDetail(const VAbstractDetail &detail); + VAbstractDetail &operator=(const VAbstractDetail &detail); + virtual ~VAbstractDetail(); + + void Clear(); + + QString getName() const; + void setName(const QString &value); + + bool getSeamAllowance() const; + void setSeamAllowance(bool value); + + bool getClosed() const; + void setClosed(bool value); + + qreal getWidth() const; + void setWidth(const qreal &value); + + static QVector Equidistant(const QVector &points, const EquidistantType &eqv, qreal width); + +protected: + static QVector RemoveDublicates(const QVector &points); + +private: + QSharedDataPointer d; + + static QVector CorrectEquidistantPoints(const QVector &points); + static QVector CheckLoops(const QVector &points); + static QVector EkvPoint(const QLineF &line1, const QLineF &line2, const qreal &width); + static QLineF ParallelLine(const QLineF &line, qreal width ); + static QPointF SingleParallelPoint(const QLineF &line, const qreal &angle, const qreal &width); +}; + +#endif // VABSTRACTDETAIL_H diff --git a/src/libs/vlayout/vabstractdetail_p.h b/src/libs/vlayout/vabstractdetail_p.h new file mode 100644 index 000000000..9f4fca2f5 --- /dev/null +++ b/src/libs/vlayout/vabstractdetail_p.h @@ -0,0 +1,72 @@ +/************************************************************************ + ** + ** @file vabstractdetail_p.h + ** @author Roman Telezhynskyi + ** @date 2 1, 2015 + ** + ** @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-2015 Valentina project + ** 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 . + ** + *************************************************************************/ + +#ifndef VABSTRACTDETAIL_P_H +#define VABSTRACTDETAIL_P_H + +#include +#include + +#ifdef Q_CC_GNU + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Weffc++" +#endif + +class VAbstractDetailData : public QSharedData +{ +public: + VAbstractDetailData() + :name(QString()), seamAllowance(false), closed(true), width(0) + {} + + VAbstractDetailData(const QString &name) + :name(name), seamAllowance(false), closed(true), width(0) + {} + + VAbstractDetailData(const VAbstractDetailData &detail) + :QSharedData(detail), name(detail.name), seamAllowance(detail.seamAllowance), closed(detail.closed), + width(detail.width) + {} + + ~VAbstractDetailData() {} + + /** @brief name detail name. */ + QString name; + /** @brief seamAllowance status seamAllowance detail. */ + bool seamAllowance; + /** @brief closed status equdistant detail. */ + bool closed; + /** @brief width value seamAllowance in mm. */ + qreal width; +}; + +#ifdef Q_CC_GNU + #pragma GCC diagnostic pop +#endif + +#endif // VABSTRACTDETAIL_P_H diff --git a/src/libs/vlayout/vbank.cpp b/src/libs/vlayout/vbank.cpp new file mode 100644 index 000000000..a3237e0a4 --- /dev/null +++ b/src/libs/vlayout/vbank.cpp @@ -0,0 +1,426 @@ +/************************************************************************ + ** + ** @file vbank.cpp + ** @author Roman Telezhynskyi + ** @date 11 1, 2015 + ** + ** @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-2015 Valentina project + ** 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 . + ** + *************************************************************************/ + +#include "vbank.h" +#include "vlayoutdetail.h" + +#include +#include +#include + +//--------------------------------------------------------------------------------------------------------------------- +VBank::VBank() + :details(QVector()), unsorted(QHash()), big(QHash()), + middle(QHash()), small(QHash()), layoutWidth(0), caseType(Cases::CaseDesc), + prepare(false), boundingRect(QRectF()) +{} + +//--------------------------------------------------------------------------------------------------------------------- +qreal VBank::GetLayoutWidth() const +{ + return layoutWidth; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VBank::SetLayoutWidth(const qreal &value) +{ + layoutWidth = value; + Reset(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VBank::SetDetails(const QVector &details) +{ + this->details = details; + Reset(); +} + +//--------------------------------------------------------------------------------------------------------------------- +int VBank::GetTiket() +{ + if (prepare == false) + { + return -1; + } + + if (LeftArrange() == 0) + { + if (unsorted.isEmpty()) + { + return -1; + } + else + { + PrepareGroup(); + } + } + + switch(caseType) + { + case Cases::CaseThreeGroup: + return GetNextThreeGroups(); + case Cases::CaseTwoGroup: + return GetNextTwoGroups(); + case Cases::CaseDesc: + return GetNextDescGroup(); + default: + return -1; + } +} + +//--------------------------------------------------------------------------------------------------------------------- +VLayoutDetail VBank::GetDetail(int i) const +{ + if (i >= 0 && i < details.size()) + { + return details.at(i); + } + else + { + return VLayoutDetail(); + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void VBank::Arranged(int i) +{ + if (big.contains(i)) + { + big.remove(i); + return; + } + + if (middle.contains(i)) + { + middle.remove(i); + return; + } + + if (small.contains(i)) + { + small.remove(i); + return; + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void VBank::NotArranged(int i) +{ + if (big.contains(i)) + { + unsorted.insert(i, big.value(i)); + big.remove(i); + return; + } + + if (middle.contains(i)) + { + unsorted.insert(i, middle.value(i)); + middle.remove(i); + return; + } + + if (small.contains(i)) + { + unsorted.insert(i, small.value(i)); + small.remove(i); + return; + } +} + +//--------------------------------------------------------------------------------------------------------------------- +bool VBank::Prepare() +{ + if (layoutWidth <= 0) + { + prepare = false; + return prepare; + } + + if (details.isEmpty()) + { + prepare = false; + return prepare; + } + + for (int i=0; i < details.size(); ++i) + { + details[i].SetLayoutWidth(layoutWidth); + details[i].SetLayoutAllowencePoints(); + const qint64 square = details.at(i).Square(); + if (square <= 0) + { + prepare = false; + return prepare; + } + unsorted.insert(i, square); + } + + BiggestBoundingRect(); + PrepareGroup(); + + prepare = true; + return prepare; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VBank::Reset() +{ + prepare = false; + unsorted.clear(); + big.clear(); + middle.clear(); + small.clear(); + boundingRect = QRectF(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VBank::SetCaseType(Cases caseType) +{ + this->caseType = caseType; +} + +//--------------------------------------------------------------------------------------------------------------------- +int VBank::AllDetailsCount() const +{ + return unsorted.count() + big.count() + middle.count() + small.count(); +} + +//--------------------------------------------------------------------------------------------------------------------- +int VBank::LeftArrange() const +{ + return big.count() + middle.count() + small.count(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VBank::BiggestBoundingRect() +{ + int index = -1; + qint64 sMax = LLONG_MIN; + + QHash::const_iterator i = unsorted.constBegin(); + while (i != unsorted.constEnd()) + { + if (i.value() > sMax) + { + sMax = i.value(); + index = i.key(); + } + + ++i; + } + + if (index >= 0 && index < details.size()) + { + boundingRect = QPolygonF(details.at(index).GetLayoutAllowencePoints()).boundingRect(); + } + else + { + boundingRect = QRectF(); + } +} + +//--------------------------------------------------------------------------------------------------------------------- +QRectF VBank::GetBiggestBoundingRect() const +{ + return boundingRect; +} + +//--------------------------------------------------------------------------------------------------------------------- +int VBank::ArrangedCount() const +{ + return details.size() - AllDetailsCount(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VBank::PrepareGroup() +{ + switch(caseType) + { + case Cases::CaseThreeGroup: + PrepareThreeGroups(); + break; + case Cases::CaseTwoGroup: + PrepareTwoGroups(); + break; + case Cases::CaseDesc: + PrepareDescGroup(); + break; + default: + break; + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void VBank::PrepareThreeGroups() +{ + qint64 sMax = LLONG_MIN; + qint64 sMin = LLONG_MAX; + + SqMaxMin(sMax, sMin); + + const qint64 s1 = sMax - (sMax - sMin)/3; + const qint64 s2 = sMin + (sMax - sMin)/3; + + QHash::const_iterator i = unsorted.constBegin(); + while (i != unsorted.constEnd()) + { + if (i.value() > s1) + { + big.insert(i.key(), i.value()); + } + else if (s1 >= i.value() && i.value() > s2) + { + middle.insert(i.key(), i.value()); + } + else + { + small.insert(i.key(), i.value()); + } + ++i; + } + unsorted.clear(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VBank::PrepareTwoGroups() +{ + qint64 sMax = LLONG_MIN; + qint64 sMin = LLONG_MAX; + + SqMaxMin(sMax, sMin); + + const qint64 s = (sMax + sMin)/2; + QHash::const_iterator i = unsorted.constBegin(); + while (i != unsorted.constEnd()) + { + if (i.value() >= s) + { + big.insert(i.key(), i.value()); + } + else + { + small.insert(i.key(), i.value()); + } + ++i; + } + unsorted.clear(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VBank::PrepareDescGroup() +{ + big = unsorted; + unsorted.clear(); +} + +//--------------------------------------------------------------------------------------------------------------------- +int VBank::GetNextThreeGroups() const +{ + if (big.isEmpty() == false) + { + QHash::const_iterator i = big.constBegin(); + return i.key(); + } + + if (middle.isEmpty() == false) + { + QHash::const_iterator i = middle.constBegin(); + return i.key(); + } + + if (small.isEmpty() == false) + { + QHash::const_iterator i = small.constBegin(); + return i.key(); + } + + return -1; +} + +//--------------------------------------------------------------------------------------------------------------------- +int VBank::GetNextTwoGroups() const +{ + if (big.isEmpty() == false) + { + QHash::const_iterator i = big.constBegin(); + return i.key(); + } + + if (small.isEmpty() == false) + { + QHash::const_iterator i = small.constBegin(); + return i.key(); + } + + return -1; +} + +//--------------------------------------------------------------------------------------------------------------------- +int VBank::GetNextDescGroup() const +{ + int index = -1; + qint64 sMax = LLONG_MIN; + + QHash::const_iterator i = big.constBegin(); + while (i != big.constEnd()) + { + if (i.value() > sMax) + { + sMax = i.value(); + index = i.key(); + } + + ++i; + } + + return index; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VBank::SqMaxMin(qint64 &sMax, qint64 &sMin) const +{ + sMax = LLONG_MIN; + sMin = LLONG_MAX; + + QHash::const_iterator i = unsorted.constBegin(); + while (i != unsorted.constEnd()) + { + if (i.value() < sMin) + { + sMin = i.value(); + } + + if (i.value() > sMax) + { + sMax = i.value(); + } + ++i; + } + +} diff --git a/src/libs/vlayout/vbank.h b/src/libs/vlayout/vbank.h new file mode 100644 index 000000000..944a0144b --- /dev/null +++ b/src/libs/vlayout/vbank.h @@ -0,0 +1,95 @@ +/************************************************************************ + ** + ** @file vbank.h + ** @author Roman Telezhynskyi + ** @date 11 1, 2015 + ** + ** @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-2015 Valentina project + ** 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 . + ** + *************************************************************************/ + +#ifndef VBANK_H +#define VBANK_H + +#include +#include +#include + +class QPointF; +class VLayoutDetail; + +enum class Cases : char { CaseThreeGroup, CaseTwoGroup, CaseDesc}; + +class VBank +{ +public: + VBank(); + + qreal GetLayoutWidth() const; + void SetLayoutWidth(const qreal &value); + + void SetDetails(const QVector &details); + int GetTiket(); + VLayoutDetail GetDetail(int i) const; + + void Arranged(int i); + void NotArranged(int i); + + bool Prepare(); + void Reset(); + void SetCaseType(Cases caseType); + + int AllDetailsCount() const; + int LeftArrange() const; + int ArrangedCount() const; + + QRectF GetBiggestBoundingRect() const; + +private: + Q_DISABLE_COPY(VBank) + QVector details; + QHash unsorted; + + QHash big; + QHash middle; + QHash small; + + qreal layoutWidth; + + Cases caseType; + bool prepare; + QRectF boundingRect; + + void PrepareGroup(); + + void PrepareThreeGroups(); + void PrepareTwoGroups(); + void PrepareDescGroup(); + + int GetNextThreeGroups() const; + int GetNextTwoGroups() const; + int GetNextDescGroup() const; + + void SqMaxMin(qint64 &sMax, qint64 &sMin) const; + void BiggestBoundingRect(); +}; + +#endif // VBANK_H diff --git a/src/libs/vlayout/vbestsquare.cpp b/src/libs/vlayout/vbestsquare.cpp new file mode 100644 index 000000000..773bbfc96 --- /dev/null +++ b/src/libs/vlayout/vbestsquare.cpp @@ -0,0 +1,101 @@ +/************************************************************************ + ** + ** @file vbestsquare.cpp + ** @author Roman Telezhynskyi + ** @date 21 1, 2015 + ** + ** @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-2015 Valentina project + ** 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 . + ** + *************************************************************************/ + +#include "vbestsquare.h" + +//--------------------------------------------------------------------------------------------------------------------- +VBestSquare::VBestSquare() + :resI(0), resJ(0), resMatrix(QMatrix()), resSquare(LLONG_MAX), valideResult(false), resMirror(false), + type (BestFrom::Rotation) +{} + +//--------------------------------------------------------------------------------------------------------------------- +void VBestSquare::NewResult(qint64 square, int i, int j, const QTransform &matrix, bool mirror, BestFrom type) +{ + if (square <= resSquare && square > 0 && type >= this->type) + { + resI = i; + resJ = j; + resMatrix = matrix; + resSquare = square; + valideResult = true; + resMirror = mirror; + this->type = type; + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void VBestSquare::NewResult(const VBestSquare &best) +{ + if (best.ValideResult()) + { + NewResult(best.BestSquare(), best.GContourEdge(), best.DetailEdge(), best.Matrix(), best.Mirror(), best.Type()); + } +} + +//--------------------------------------------------------------------------------------------------------------------- +qint64 VBestSquare::BestSquare() const +{ + return resSquare; +} + +//--------------------------------------------------------------------------------------------------------------------- +int VBestSquare::GContourEdge() const +{ + return resI; +} + +//--------------------------------------------------------------------------------------------------------------------- +int VBestSquare::DetailEdge() const +{ + return resJ; +} + +//--------------------------------------------------------------------------------------------------------------------- +QTransform VBestSquare::Matrix() const +{ + return resMatrix; +} + +//--------------------------------------------------------------------------------------------------------------------- +bool VBestSquare::ValideResult() const +{ + return valideResult; +} + +//--------------------------------------------------------------------------------------------------------------------- +bool VBestSquare::Mirror() const +{ + return resMirror; +} + +//--------------------------------------------------------------------------------------------------------------------- +BestFrom VBestSquare::Type() const +{ + return type; +} diff --git a/src/libs/vlayout/vbestsquare.h b/src/libs/vlayout/vbestsquare.h new file mode 100644 index 000000000..fee9bad44 --- /dev/null +++ b/src/libs/vlayout/vbestsquare.h @@ -0,0 +1,63 @@ +/************************************************************************ + ** + ** @file vbestsquare.h + ** @author Roman Telezhynskyi + ** @date 21 1, 2015 + ** + ** @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-2015 Valentina project + ** 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 . + ** + *************************************************************************/ + +#ifndef VBESTSQUARE_H +#define VBESTSQUARE_H + +#include "vlayoutdef.h" + +#include + +class VBestSquare +{ +public: + VBestSquare(); + + void NewResult(qint64 square, int i, int j, const QTransform &matrix, bool mirror, BestFrom type); + void NewResult(const VBestSquare &best); + + qint64 BestSquare() const; + int GContourEdge() const; + int DetailEdge() const; + QTransform Matrix() const; + bool ValideResult() const; + bool Mirror() const; + BestFrom Type() const; + +private: + // All nedded information about best result + int resI; // Edge of global contour + int resJ; // Edge of detail + QTransform resMatrix; // Matrix for rotation and translation detail + qint64 resSquare; // Best square size (least). For begin set max value. + bool valideResult; + bool resMirror; + BestFrom type; +}; + +#endif // VBESTSQUARE_H diff --git a/src/libs/vlayout/vcontour.cpp b/src/libs/vlayout/vcontour.cpp new file mode 100644 index 000000000..831b81d50 --- /dev/null +++ b/src/libs/vlayout/vcontour.cpp @@ -0,0 +1,327 @@ +/************************************************************************ + ** + ** @file vcontour.cpp + ** @author Roman Telezhynskyi + ** @date 21 1, 2015 + ** + ** @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-2015 Valentina project + ** 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 . + ** + *************************************************************************/ + +#include "vcontour.h" +#include "vcontour_p.h" +#include "vlayoutdetail.h" + +#include +#include +#include + +//--------------------------------------------------------------------------------------------------------------------- +VContour::VContour() + :d(new VContourData()) +{} + +//--------------------------------------------------------------------------------------------------------------------- +VContour::VContour(int height, int width) + :d(new VContourData(height, width)) +{} + +//--------------------------------------------------------------------------------------------------------------------- +VContour::VContour(const VContour &contour) + :d (contour.d) +{} + +//--------------------------------------------------------------------------------------------------------------------- +VContour &VContour::operator=(const VContour &contour) +{ + if ( &contour == this ) + { + return *this; + } + d = contour.d; + return *this; +} + +//--------------------------------------------------------------------------------------------------------------------- +VContour::~VContour() +{} + +//--------------------------------------------------------------------------------------------------------------------- +void VContour::SetContour(const QVector &contour) +{ + d->globalContour = contour; +} + +//--------------------------------------------------------------------------------------------------------------------- +QVector VContour::GetContour() const +{ + return d->globalContour; +} + +//--------------------------------------------------------------------------------------------------------------------- +unsigned int VContour::GetShift() const +{ + return d->shift; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VContour::SetShift(unsigned int shift) +{ + d->shift = shift; +} + +//--------------------------------------------------------------------------------------------------------------------- +int VContour::GetHeight() const +{ + return d->paperHeight; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VContour::SetHeight(int height) +{ + d->paperHeight = height; +} + +//--------------------------------------------------------------------------------------------------------------------- +int VContour::GetWidth() const +{ + return d->paperWidth; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VContour::SetWidth(int width) +{ + d->paperWidth = width; +} + +//--------------------------------------------------------------------------------------------------------------------- +QVector VContour::UniteWithContour(const VLayoutDetail &detail, int globalI, int detJ, BestFrom type) const +{ + QVector newContour; + if (d->globalContour.isEmpty()) + { + AppendWhole(newContour, detail, detJ); + } + else + { + if (globalI <= 0 || globalI > EdgesCount()) + { + return QVector(); + } + + if (detJ <= 0 || detJ > detail.EdgesCount()) + { + return QVector(); + } + + int i2 = 0; + if (globalI == d->globalContour.count()) + { + i2 = 0; + } + else + { + i2 = globalI; + } + + int i=0; + while(i < d->globalContour.count()) + { + if (i == i2) + { + if (type == BestFrom::Rotation) + { + AppendWhole(newContour, detail, detJ); + } + else + { + int processedEdges = 0; + const int nD = detail.EdgesCount(); + int j = detJ+1; + do + { + if (j > nD) + { + j=1; + } + if (j != detJ) + { + const QVector points = CutEdge(detail.Edge(j)); + for (int i = 0; i < points.size()-1; ++i) + { + newContour.append(points.at(i)); + } + } + ++processedEdges; + ++j; + }while (processedEdges < nD); + } + } + + if (newContour.isEmpty() == false) + { + if (newContour.last() != d->globalContour.at(i)) + { + newContour.append(d->globalContour.at(i)); + } + } + else + { + newContour.append(d->globalContour.at(i)); + } + ++i; + } + } + return newContour; +} + +//--------------------------------------------------------------------------------------------------------------------- +int VContour::EdgesCount() const +{ + if (d->globalContour.isEmpty()) + { + if (d->shift == 0) + { + return 1; + } + + const QLineF axis = QLineF(0, 0, d->paperWidth, 0); + const int n = qFloor(axis.length()/d->shift); + if (n <= 0) + { + return 1; + } + else + { + return n; + } + } + else + { + return d->globalContour.count(); + } +} + +//--------------------------------------------------------------------------------------------------------------------- +QLineF VContour::GlobalEdge(int i) const +{ + if (d->globalContour.isEmpty()) + { + // Because sheet is blank we have one global edge for all cases - Ox axis. + const QLineF axis = QLineF(0, 0, d->paperWidth - 5, 0); + if (d->shift == 0) + { + return axis; + } + + const int n = qFloor(axis.length()/d->shift); + + if (i < 1 || i > n) + { // Doesn't exist such edge + return QLineF(); + } + + if (n <= 0) + { + return axis; + } + else + { + const qreal nShift = axis.length()/n; + return QLineF(nShift*(i-1), 0, nShift*i, 0); + } + } + else + { + if (i < 1 || i > EdgesCount()) + { // Doesn't exist such edge + return QLineF(); + } + QLineF edge; + if (i < EdgesCount()) + { + edge = QLineF(d->globalContour.at(i-1), d->globalContour.at(i)); + } + else + { // Closed countour + edge = QLineF(d->globalContour.at(EdgesCount()-1), d->globalContour.at(0)); + } + return edge; + } +} + +//--------------------------------------------------------------------------------------------------------------------- +QVector VContour::CutEdge(const QLineF &edge) const +{ + QVector points; + if (d->shift == 0) + { + points.append(edge.p1()); + points.append(edge.p2()); + } + + const int n = qFloor(edge.length()/d->shift); + + if (n <= 0) + { + points.append(edge.p1()); + points.append(edge.p2()); + } + else + { + const qreal nShift = edge.length()/n; + for (int i = 1; i <= n+1; ++i) + { + QLineF l1 = edge; + l1.setLength(nShift*(i-1)); + points.append(l1.p2()); + } + } + return points; +} + +//--------------------------------------------------------------------------------------------------------------------- +const QPointF &VContour::at(int i) const +{ + return d->globalContour.at(i); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VContour::AppendWhole(QVector &contour, const VLayoutDetail &detail, int detJ) const +{ + int processedEdges = 0; + const int nD = detail.EdgesCount(); + int j = detJ+1; + do + { + if (j > nD) + { + j=1; + } + const QVector points = CutEdge(detail.Edge(j)); + for (int i = 0; i < points.size()-1; ++i) + { + contour.append(points.at(i)); + } + ++processedEdges; + ++j; + }while (processedEdges < nD); +} diff --git a/src/libs/vlayout/vcontour.h b/src/libs/vlayout/vcontour.h new file mode 100644 index 000000000..bef34f6d0 --- /dev/null +++ b/src/libs/vlayout/vcontour.h @@ -0,0 +1,77 @@ +/************************************************************************ + ** + ** @file vcontour.h + ** @author Roman Telezhynskyi + ** @date 21 1, 2015 + ** + ** @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-2015 Valentina project + ** 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 . + ** + *************************************************************************/ + +#ifndef VCONTOUR_H +#define VCONTOUR_H + +#include "vlayoutdef.h" + +#include +#include + +class VContourData; +class QPointF; +class VLayoutDetail; +class QLineF; + +class VContour +{ +public: + VContour(); + VContour(int height, int width); + VContour(const VContour &contour); + VContour &operator=(const VContour &contour); + virtual ~VContour(); + + void SetContour(const QVector &contour); + QVector GetContour() const; + + unsigned int GetShift() const; + void SetShift(unsigned int shift); + + int GetHeight() const; + void SetHeight(int height); + + int GetWidth() const; + void SetWidth(int width); + + QVector UniteWithContour(const VLayoutDetail &detail, int globalI, int detJ, BestFrom type) const; + + int EdgesCount() const; + QLineF GlobalEdge(int i) const; + QVector CutEdge(const QLineF &edge) const; + + const QPointF & at(int i) const; + +private: + QSharedDataPointer d; + + void AppendWhole(QVector &contour, const VLayoutDetail &detail, int detJ) const; +}; + +#endif // VCONTOUR_H diff --git a/src/libs/vlayout/vcontour_p.h b/src/libs/vlayout/vcontour_p.h new file mode 100644 index 000000000..c0d4f1710 --- /dev/null +++ b/src/libs/vlayout/vcontour_p.h @@ -0,0 +1,74 @@ +/************************************************************************ + ** + ** @file vcontour_p.h + ** @author Roman Telezhynskyi + ** @date 21 1, 2015 + ** + ** @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-2015 Valentina project + ** 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 . + ** + *************************************************************************/ + +#ifndef VCONTOUR_P_H +#define VCONTOUR_P_H + +#include +#include + +#ifdef Q_CC_GNU + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Weffc++" +#endif + +class VContourData : public QSharedData +{ +public: + VContourData() + :globalContour(QVector()), paperHeight(0), paperWidth(0), shift(0) + {} + + VContourData(int height, int width) + :globalContour(QVector()), paperHeight(height), paperWidth(width), shift(0) + {} + + VContourData(const VContourData &contour) + :QSharedData(contour), globalContour(contour.globalContour), paperHeight(contour.paperHeight), + paperWidth(contour.paperWidth), shift(contour.shift) + {} + + ~VContourData() {} + + /** @brief globalContour list of global points contour. */ + QVector globalContour; + + /** @brief paperHeight height of paper in pixels*/ + int paperHeight; + + /** @brief paperWidth width of paper in pixels*/ + int paperWidth; + + unsigned int shift; +}; + +#ifdef Q_CC_GNU + #pragma GCC diagnostic pop +#endif + +#endif // VCONTOUR_P_H diff --git a/src/libs/vlayout/vlayout.pri b/src/libs/vlayout/vlayout.pri new file mode 100644 index 000000000..65bebdf49 --- /dev/null +++ b/src/libs/vlayout/vlayout.pri @@ -0,0 +1,29 @@ +# ADD TO EACH PATH $$PWD VARIABLE!!!!!! +# This need for corect working file translations.pro + +HEADERS += \ + $$PWD/stable.h \ + $$PWD/vlayoutgenerator.h \ + $$PWD/vlayoutdetail.h \ + $$PWD/vabstractdetail.h \ + $$PWD/vabstractdetail_p.h \ + $$PWD/vlayoutdetail_p.h \ + $$PWD/vlayoutdef.h \ + $$PWD/vlayoutpaper.h \ + $$PWD/vlayoutpaper_p.h \ + $$PWD/vbank.h \ + $$PWD/vcontour.h \ + $$PWD/vcontour_p.h \ + $$PWD/vbestsquare.h \ + $$PWD/vposition.h + +SOURCES += \ + $$PWD/stable.cpp \ + $$PWD/vlayoutgenerator.cpp \ + $$PWD/vlayoutdetail.cpp \ + $$PWD/vabstractdetail.cpp \ + $$PWD/vlayoutpaper.cpp \ + $$PWD/vbank.cpp \ + $$PWD/vcontour.cpp \ + $$PWD/vbestsquare.cpp \ + $$PWD/vposition.cpp diff --git a/src/libs/vlayout/vlayout.pro b/src/libs/vlayout/vlayout.pro new file mode 100644 index 000000000..4744dd938 --- /dev/null +++ b/src/libs/vlayout/vlayout.pro @@ -0,0 +1,89 @@ +#------------------------------------------------- +# +# Project created by QtCreator 2015-01-02T15:39:01 +# +#------------------------------------------------- + +# File with common stuff for whole project +include(../../../Valentina.pri) + +QT += core gui widgets + +# Name of library +TARGET = vlayout + +# We want create library +TEMPLATE = lib + +CONFIG += \ + staticlib \# Making static library + c++11 # We use C++11 standard + +# Use out-of-source builds (shadow builds) +CONFIG -= debug_and_release debug_and_release_target + +# Since Qt 5.4.0 the source code location is recorded only in debug builds. +# We need this information also in release builds. For this need define QT_MESSAGELOGCONTEXT. +DEFINES += QT_MESSAGELOGCONTEXT + +include(vlayout.pri) + +# This is static library so no need in "make install" + +# directory for executable file +DESTDIR = bin + +# files created moc +MOC_DIR = moc + +# objecs files +OBJECTS_DIR = obj + +# Set using ccache. Function enable_ccache() defined in Valentina.pri. +$$enable_ccache() + +# Set precompiled headers. Function set_PCH() defined in Valentina.pri. +$$set_PCH() + +CONFIG(debug, debug|release){ + # Debug mode + unix { + #Turn on compilers warnings. + *-g++{ + QMAKE_CXXFLAGS += \ + # Key -isystem disable checking errors in system headers. + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + $$GCC_DEBUG_CXXFLAGS # See Valentina.pri for more details. + + #gcc’s 4.8.0 Address Sanitizer + #http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/ + QMAKE_CFLAGS+=-fsanitize=address -fno-omit-frame-pointer + QMAKE_LFLAGS+=-fsanitize=address + } + clang*{ + QMAKE_CXXFLAGS += \ + # Key -isystem disable checking errors in system headers. + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + $$CLANG_DEBUG_CXXFLAGS # See Valentina.pri for more details. + } + } else { + *-g++{ + QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See Valentina.pri for more details. + } + } + +}else{ + # Release mode + DEFINES += V_NO_ASSERT + !unix:*-g++{ + QMAKE_CXXFLAGS += -fno-omit-frame-pointer # Need for exchndl.dll + } + + !macx:!win32-msvc*{ + # Turn on debug symbols in release mode on Unix systems. + # On Mac OS X temporarily disabled. TODO: find way how to strip binary file. + QMAKE_CXXFLAGS_RELEASE += -g -gdwarf-3 + QMAKE_CFLAGS_RELEASE += -g -gdwarf-3 + QMAKE_LFLAGS_RELEASE = + } +} diff --git a/src/libs/vlayout/vlayoutdef.h b/src/libs/vlayout/vlayoutdef.h new file mode 100644 index 000000000..7bb9ab662 --- /dev/null +++ b/src/libs/vlayout/vlayoutdef.h @@ -0,0 +1,63 @@ +/************************************************************************ + ** + ** @file vlayoutdef.h + ** @author Roman Telezhynskyi + ** @date 7 1, 2015 + ** + ** @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-2015 Valentina project + ** 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 . + ** + *************************************************************************/ + +#ifndef VLAYOUTDEF_H +#define VLAYOUTDEF_H + +enum class EquidistantType : char { OpenEquidistant, CloseEquidistant }; + +enum class LayoutErrors : char +{ + NoError, + PrepareLayoutError, + PaperSizeError, + ProcessStoped, + EmptyPaperError +}; + +enum class BestFrom : char +{ + Rotation = 0, + Combine = 1 +}; + +//#define LAYOUT_DEBUG // Enable debug mode + +#ifdef LAYOUT_DEBUG +# define SHOW_VERTICES // Show contour vertices +# define SHOW_DIRECTION // Show contour direction +# define ARRANGED_DETAILS // Show already arranged details +//# define SHOW_CANDIDATE +//# define SHOW_ROTATION +//# define SHOW_COMBINE +//# define SHOW_MIRROR +//# define SHOW_CANDIDATE_BEST +//# define SHOW_BEST +#endif//LAYOUT_DEBUG + +#endif // VLAYOUTDEF_H diff --git a/src/libs/vlayout/vlayoutdetail.cpp b/src/libs/vlayout/vlayoutdetail.cpp new file mode 100644 index 000000000..2be3c848c --- /dev/null +++ b/src/libs/vlayout/vlayoutdetail.cpp @@ -0,0 +1,435 @@ +/************************************************************************ + ** + ** @file vlayoutdetail.cpp + ** @author Roman Telezhynskyi + ** @date 2 1, 2015 + ** + ** @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-2015 Valentina project + ** 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 . + ** + *************************************************************************/ + +#include "vlayoutdetail.h" +#include "vlayoutdetail_p.h" + +#include +#include +#include + +//--------------------------------------------------------------------------------------------------------------------- +VLayoutDetail::VLayoutDetail() + :VAbstractDetail(), d(new VLayoutDetailData) +{} + +//--------------------------------------------------------------------------------------------------------------------- +VLayoutDetail::VLayoutDetail(const VLayoutDetail &detail) + :VAbstractDetail(detail), d (detail.d) +{} + +//--------------------------------------------------------------------------------------------------------------------- +VLayoutDetail &VLayoutDetail::operator=(const VLayoutDetail &detail) +{ + if ( &detail == this ) + { + return *this; + } + VAbstractDetail::operator=(detail); + d = detail.d; + return *this; +} + +//--------------------------------------------------------------------------------------------------------------------- +VLayoutDetail::~VLayoutDetail() +{} + +//--------------------------------------------------------------------------------------------------------------------- +QVector VLayoutDetail::GetContourPoints() const +{ + return d->contour; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutDetail::SetCountourPoints(const QVector &points) +{ + d->contour = points; + // Contour can't be closed + if (d->contour.first() == d->contour.last()) + { + d->contour.removeLast(); + } + + d->contour = RemoveDublicates(RoundPoints(d->contour)); +} + +//--------------------------------------------------------------------------------------------------------------------- +QVector VLayoutDetail::GetSeamAllowencePoints() const +{ + return d->seamAllowence; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutDetail::SetSeamAllowencePoints(const QVector &points) +{ + d->seamAllowence = points; + // Seam allowence can't be closed + if (d->seamAllowence.first() == d->seamAllowence.last()) + { + d->seamAllowence.removeLast(); + } + + d->seamAllowence = RemoveDublicates(RoundPoints(d->seamAllowence)); +} + +//--------------------------------------------------------------------------------------------------------------------- +QVector VLayoutDetail::GetLayoutAllowencePoints() const +{ + return Map(d->layoutAllowence); +} + +//--------------------------------------------------------------------------------------------------------------------- +QTransform VLayoutDetail::GetMatrix() const +{ + return d->matrix; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutDetail::SetMatrix(const QTransform &matrix) +{ + d->matrix = matrix; +} + +//--------------------------------------------------------------------------------------------------------------------- +qreal VLayoutDetail::GetLayoutWidth() const +{ + return d->layoutWidth; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutDetail::SetLayoutWidth(const qreal &value) +{ + d->layoutWidth = value; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutDetail::Translate(qreal dx, qreal dy) +{ + QTransform m; + m.translate(dx, dy); + d->matrix *= m; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutDetail::Rotate(const QPointF &originPoint, qreal degrees) +{ + QTransform m; + m.translate(originPoint.x(), originPoint.y()); + m.rotate(-degrees); + m.translate(-originPoint.x(), -originPoint.y()); + d->matrix *= m; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutDetail::Mirror(const QLineF &edge) +{ + if (edge.isNull()) + { + return; + } + + const QLineF axis = QLineF(edge.x2(), edge.y2(), edge.x2() + 100, edge.y2()); // Ox axis + + const qreal angle = edge.angleTo(axis); + QTransform m; + m.translate(edge.p2().x(), edge.p2().y()); + m.rotate(-angle); + m.translate(-edge.p2().x(), -edge.p2().y()); + d->matrix *= m; + + m.reset(); + m.translate(edge.p2().x(), edge.p2().y()); + m.scale(m.m11(), m.m22()*-1); + m.translate(-edge.p2().x(), -edge.p2().y()); + d->matrix *= m; + + m.reset(); + m.translate(edge.p2().x(), edge.p2().y()); + m.rotate(-(360-angle)); + m.translate(-edge.p2().x(), -edge.p2().y()); + d->matrix *= m; + + d->mirror = !d->mirror; +} + +//--------------------------------------------------------------------------------------------------------------------- +int VLayoutDetail::EdgesCount() const +{ + return d->layoutAllowence.count(); +} + +//--------------------------------------------------------------------------------------------------------------------- +QLineF VLayoutDetail::Edge(int i) const +{ + if (i < 1 || i > EdgesCount()) + { // Doesn't exist such edge + return QLineF(); + } + + int i1, i2; + if (i < EdgesCount()) + { + i1 = i-1; + i2 = i; + } + else + { + i1 = EdgesCount()-1; + i2 = 0; + } + + if (d->mirror) + { + const int oldI1 = i1; + i1 = (d->layoutAllowence.size()-1) - i2; + i2 = (d->layoutAllowence.size()-1) - oldI1; + return QLineF(d->matrix.map(d->layoutAllowence.at(i2)), d->matrix.map(d->layoutAllowence.at(i1))); + } + else + { + return QLineF(d->matrix.map(d->layoutAllowence.at(i1)), d->matrix.map(d->layoutAllowence.at(i2))); + } +} + +//--------------------------------------------------------------------------------------------------------------------- +int VLayoutDetail::EdgeByPoint(const QPointF &p1) const +{ + if (p1.isNull()) + { + return 0; + } + + if (EdgesCount() < 3) + { + return 0; + } + + const QVector points = GetLayoutAllowencePoints(); + for (int i=0; i< points.size(); i++) + { + if (points.at(i) == p1) + { + return i+1; + } + } + return 0; // Did not find edge +} + +//--------------------------------------------------------------------------------------------------------------------- +QRectF VLayoutDetail::BoundingRect() const +{ + QVector points = GetLayoutAllowencePoints(); + points.append(points.first()); + QRectF rec = QPolygonF(points).boundingRect(); + return rec; +} + +//--------------------------------------------------------------------------------------------------------------------- +bool VLayoutDetail::isNull() const +{ + if (d->contour.isEmpty() == false && d->layoutWidth > 0) + { + if (getSeamAllowance() && d->seamAllowence.isEmpty() == false) + { + return false; + } + else + { + return true; + } + } + else + { + return true; + } +} + +//--------------------------------------------------------------------------------------------------------------------- +qint64 VLayoutDetail::Square() const +{ + if (d->layoutAllowence.isEmpty()) + { + return 0; + } + + const int n = d->layoutAllowence.count(); + qreal s, res = 0; + qint64 sq = 0; + + QVector x; + QVector y; + + for(int i=0; i < n; ++i) + { + x.append(d->layoutAllowence.at(i).x()); + y.append(d->layoutAllowence.at(i).y()); + } + + // Calculation a polygon area through the sum of the areas of trapezoids + for (int i = 0; i < n; ++i) + { + if (i == 0) + { + s = x.at(i)*(y.at(n-1) - y.at(i+1)); //if i == 0, then y[i-1] replace on y[n-1] + res += s; + } + else + { + if (i == n-1) + { + s = x.at(i)*(y.at(i-1) - y.at(0)); // if i == n-1, then y[i+1] replace on y[0] + res += s; + } + else + { + s = x.at(i)*(y.at(i-1) - y.at(i+1)); + res += s; + } + } + } + sq = qFloor(qAbs(res/2.0)); + return sq; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutDetail::SetLayoutAllowencePoints() +{ + if (d->layoutWidth > 0) + { + if (getSeamAllowance()) + { + d->layoutAllowence = Equidistant(d->seamAllowence, EquidistantType::CloseEquidistant, d->layoutWidth); + if (d->layoutAllowence.isEmpty() == false) + { + d->layoutAllowence.removeLast(); + } + } + else + { + d->layoutAllowence = Equidistant(d->contour, EquidistantType::CloseEquidistant, d->layoutWidth); + if (d->layoutAllowence.isEmpty() == false) + { + d->layoutAllowence.removeLast(); + } + } + } + else + { + d->layoutAllowence.clear(); + } +} + +//--------------------------------------------------------------------------------------------------------------------- +QVector VLayoutDetail::Map(const QVector &points) const +{ + QVector p; + for (int i = 0; i < points.size(); ++i) + { + p.append(d->matrix.map(points.at(i))); + } + + if (d->mirror) + { + QList list = p.toList(); + for(int k=0, s=list.size(), max=(s/2); k VLayoutDetail::RoundPoints(const QVector &points) const +{ + QVector p; + for (int i=0; i < points.size(); ++i) + { + p.append(QPointF(qRound(points.at(i).x()), qRound(points.at(i).y()))); + } + return p; +} + +//--------------------------------------------------------------------------------------------------------------------- +QPainterPath VLayoutDetail::ContourPath() const +{ + QPainterPath path; + + // contour + QVector points = Map(d->contour); + path.moveTo(points.at(0)); + for (qint32 i = 1; i < points.count(); ++i) + { + path.lineTo(points.at(i)); + } + path.lineTo(points.at(0)); + + // seam allowence + if (getSeamAllowance() == true) + { + points = Map(d->seamAllowence); + + if (getClosed() == true) + { + points.append(points.at(0)); + } + + QPainterPath ekv; + ekv.moveTo(points.at(0)); + for (qint32 i = 1; i < points.count(); ++i) + { + ekv.lineTo(points.at(i)); + } + + path.addPath(ekv); + path.setFillRule(Qt::WindingFill); + } + + return path; +} + +//--------------------------------------------------------------------------------------------------------------------- +QGraphicsItem *VLayoutDetail::GetItem() const +{ + QGraphicsPathItem *item = new QGraphicsPathItem(); + item->setPath(ContourPath()); + return item; +} + +//--------------------------------------------------------------------------------------------------------------------- +bool VLayoutDetail::IsMirror() const +{ + return d->mirror; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutDetail::SetMirror(bool value) +{ + d->mirror = value; +} diff --git a/src/libs/vlayout/vlayoutdetail.h b/src/libs/vlayout/vlayoutdetail.h new file mode 100644 index 000000000..58dbfc85b --- /dev/null +++ b/src/libs/vlayout/vlayoutdetail.h @@ -0,0 +1,88 @@ +/************************************************************************ + ** + ** @file vlayoutdetail.h + ** @author Roman Telezhynskyi + ** @date 2 1, 2015 + ** + ** @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-2015 Valentina project + ** 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 . + ** + *************************************************************************/ + +#ifndef VLAYOUTDETAIL_H +#define VLAYOUTDETAIL_H + +#include "vabstractdetail.h" + +#include +#include + +class VLayoutDetailData; +class QGraphicsItem; + +class VLayoutDetail :public VAbstractDetail +{ +public: + VLayoutDetail(); + VLayoutDetail(const VLayoutDetail &detail); + VLayoutDetail &operator=(const VLayoutDetail &detail); + virtual ~VLayoutDetail(); + + QVector GetContourPoints() const; + void SetCountourPoints(const QVector &points); + + QVector GetSeamAllowencePoints() const; + void SetSeamAllowencePoints(const QVector &points); + + QVector GetLayoutAllowencePoints() const; + void SetLayoutAllowencePoints(); + + QTransform GetMatrix() const; + void SetMatrix(const QTransform &matrix); + + qreal GetLayoutWidth() const; + void SetLayoutWidth(const qreal &value); + + bool IsMirror() const; + void SetMirror(bool value); + + void Translate(qreal dx, qreal dy); + void Rotate(const QPointF &originPoint, qreal degrees); + void Mirror(const QLineF &edge); + + int EdgesCount() const; + QLineF Edge(int i) const; + int EdgeByPoint(const QPointF &p1) const; + + QRectF BoundingRect() const; + + bool isNull() const; + qint64 Square() const; + QPainterPath ContourPath() const; + QGraphicsItem *GetItem() const; + +private: + QSharedDataPointer d; + + QVector Map(const QVector &points) const; + QVector RoundPoints(const QVector &points) const; +}; + +#endif // VLAYOUTDETAIL_H diff --git a/src/libs/vlayout/vlayoutdetail_p.h b/src/libs/vlayout/vlayoutdetail_p.h new file mode 100644 index 000000000..1e469d6c4 --- /dev/null +++ b/src/libs/vlayout/vlayoutdetail_p.h @@ -0,0 +1,80 @@ +/************************************************************************ + ** + ** @file vlayoutdetail_p.h + ** @author Roman Telezhynskyi + ** @date 3 1, 2015 + ** + ** @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-2015 Valentina project + ** 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 . + ** + *************************************************************************/ + +#ifndef VLAYOUTDETAIL_P_H +#define VLAYOUTDETAIL_P_H + +#include +#include +#include +#include + +#ifdef Q_CC_GNU + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Weffc++" +#endif + +class VLayoutDetailData : public QSharedData +{ +public: + VLayoutDetailData() + :contour(QVector()), seamAllowence(QVector()), layoutAllowence(QVector()), + matrix(QMatrix()), layoutWidth(0), mirror(false) + {} + + VLayoutDetailData(const VLayoutDetailData &detail) + :QSharedData(detail), contour(detail.contour), seamAllowence(detail.seamAllowence), + layoutAllowence(detail.layoutAllowence), matrix(detail.matrix), layoutWidth(detail.layoutWidth), + mirror(detail.mirror) + {} + + ~VLayoutDetailData() {} + + /** @brief contour list of contour points. */ + QVector contour; + + /** @brief seamAllowence list of seam allowence points. */ + QVector seamAllowence; + + /** @brief layoutAllowence list of layout allowence points. */ + QVector layoutAllowence; + + /** @brief matrix transformation matrix*/ + QTransform matrix; + + /** @brief layoutWidth value layout allowence width in pixels. */ + qreal layoutWidth; + + bool mirror; +}; + +#ifdef Q_CC_GNU + #pragma GCC diagnostic pop +#endif + +#endif // VLAYOUTDETAIL_P_H diff --git a/src/libs/vlayout/vlayoutgenerator.cpp b/src/libs/vlayout/vlayoutgenerator.cpp new file mode 100644 index 000000000..10d0ee387 --- /dev/null +++ b/src/libs/vlayout/vlayoutgenerator.cpp @@ -0,0 +1,261 @@ +/************************************************************************ + ** + ** @file vlayoutgenerator.cpp + ** @author Roman Telezhynskyi + ** @date 2 1, 2015 + ** + ** @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-2015 Valentina project + ** 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 . + ** + *************************************************************************/ + +#include "vlayoutgenerator.h" +#include "vlayoutpaper.h" +#include "vlayoutdetail.h" + +#include +#include +#include +#include + +//--------------------------------------------------------------------------------------------------------------------- +VLayoutGenerator::VLayoutGenerator(QObject *parent) + :QObject(parent), papers(QVector()), bank(new VBank()), paperHeight(0), paperWidth(0), + stopGeneration(false), state(LayoutErrors::NoError), shift(0), rotate(true), rotationIncrease(180) +{} + +//--------------------------------------------------------------------------------------------------------------------- +VLayoutGenerator::~VLayoutGenerator() +{ + delete bank; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutGenerator::SetDetails(const QVector &details) +{ + bank->SetDetails(details); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutGenerator::SetLayoutWidth(qreal width) +{ + bank->SetLayoutWidth(width); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutGenerator::SetCaseType(Cases caseType) +{ + bank->SetCaseType(caseType); +} + +//--------------------------------------------------------------------------------------------------------------------- +int VLayoutGenerator::DetailsCount() +{ + return bank->AllDetailsCount(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutGenerator::Generate() +{ + stopGeneration = false; + papers.clear(); + state = LayoutErrors::NoError; + +#ifdef LAYOUT_DEBUG + const QString path = QDir::homePath()+QStringLiteral("/LayoutDebug"); + QDir debugDir(path); + debugDir.removeRecursively(); + debugDir.mkpath(path); +#endif + + emit Start(); + + if (bank->Prepare()) + { + CheckDetailsSize(); + while (bank->AllDetailsCount() > 0) + { + if (stopGeneration) + { + break; + } + + VLayoutPaper paper(paperHeight, paperWidth); + paper.SetShift(shift); + paper.SetLayoutWidth(bank->GetLayoutWidth()); + paper.SetPaperIndex(papers.count()); + paper.SetRotate(rotate); + paper.SetRotationIncrease(rotationIncrease); + do + { + const int index = bank->GetTiket(); + if (paper.ArrangeDetail(bank->GetDetail(index), stopGeneration)) + { + bank->Arranged(index); + emit Arranged(bank->ArrangedCount()); + } + else + { + bank->NotArranged(index); + } + + if (stopGeneration) + { + break; + } + } while(bank->LeftArrange() > 0); + + if (stopGeneration) + { + break; + } + + if (paper.Count() > 0) + { + papers.append(paper); + } + else + { + state = LayoutErrors::EmptyPaperError; + emit Error(state); + return; + } + } + } + else + { + state = LayoutErrors::PrepareLayoutError; + emit Error(state); + return; + } + emit Finished(); +} + +//--------------------------------------------------------------------------------------------------------------------- +LayoutErrors VLayoutGenerator::State() const +{ + return state; +} + +//--------------------------------------------------------------------------------------------------------------------- +QList VLayoutGenerator::GetPapersItems() const +{ + QList list; + for (int i=0; i < papers.count(); ++i) + { + list.append(papers.at(i).GetPaperItem()); + } + return list; +} + +//--------------------------------------------------------------------------------------------------------------------- +QList > VLayoutGenerator::GetAllDetails() const +{ + QList > list; + for (int i=0; i < papers.count(); ++i) + { + list.append(papers.at(i).GetDetails()); + } + return list; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutGenerator::Abort() +{ + stopGeneration = true; + state = LayoutErrors::ProcessStoped; +} + +//--------------------------------------------------------------------------------------------------------------------- +int VLayoutGenerator::GetRotationIncrease() const +{ + return rotationIncrease; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutGenerator::SetRotationIncrease(int value) +{ + rotationIncrease = value; + + if ((rotationIncrease >= 1 && rotationIncrease <= 180 && 360 % rotationIncrease == 0) == false) + { + rotationIncrease = 180; + } +} + +//--------------------------------------------------------------------------------------------------------------------- +bool VLayoutGenerator::GetRotate() const +{ + return rotate; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutGenerator::SetRotate(bool value) +{ + rotate = value; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutGenerator::CheckDetailsSize() +{ + const QRectF rec = bank->GetBiggestBoundingRect(); + if (rec.width() > paperWidth || rec.height() > paperHeight) + { + state = LayoutErrors::PaperSizeError; + emit Error(state); + stopGeneration = true; + } +} + +//--------------------------------------------------------------------------------------------------------------------- +int VLayoutGenerator::GetPaperWidth() const +{ + return paperWidth; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutGenerator::SetPaperWidth(int value) +{ + paperWidth = value; +} + +//--------------------------------------------------------------------------------------------------------------------- +unsigned int VLayoutGenerator::GetShift() const +{ + return shift; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutGenerator::SetShift(unsigned int shift) +{ + this->shift = shift; +} + +//--------------------------------------------------------------------------------------------------------------------- +int VLayoutGenerator::GetPaperHeight() const +{ + return paperHeight; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutGenerator::SetPaperHeight(int value) +{ + paperHeight = value; +} diff --git a/src/libs/vlayout/vlayoutgenerator.h b/src/libs/vlayout/vlayoutgenerator.h new file mode 100644 index 000000000..7bc99c4ac --- /dev/null +++ b/src/libs/vlayout/vlayoutgenerator.h @@ -0,0 +1,100 @@ +/************************************************************************ + ** + ** @file vlayoutgenerator.h + ** @author Roman Telezhynskyi + ** @date 2 1, 2015 + ** + ** @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-2015 Valentina project + ** 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 . + ** + *************************************************************************/ + +#ifndef VLAYOUTGENERATOR_H +#define VLAYOUTGENERATOR_H + +#include +#include + +#include "vlayoutdef.h" +#include "vbank.h" + +class VLayoutPaper; +class VLayoutDetail; +class QGraphicsItem; + +class VLayoutGenerator :public QObject +{ + Q_OBJECT +public: + VLayoutGenerator(QObject *parent = 0); + virtual ~VLayoutGenerator(); + + void SetDetails(const QVector &details); + void SetLayoutWidth(qreal width); + void SetCaseType(Cases caseType); + int DetailsCount(); + + int GetPaperHeight() const; + void SetPaperHeight(int value); + + int GetPaperWidth() const; + void SetPaperWidth(int value); + + unsigned int GetShift() const; + void SetShift(unsigned int shift); + + void Generate(); + + LayoutErrors State() const; + + QList GetPapersItems() const; + QList> GetAllDetails() const; + + bool GetRotate() const; + void SetRotate(bool value); + + int GetRotationIncrease() const; + void SetRotationIncrease(int value); + +signals: + void Start(); + void Arranged(int count); + void Error(const LayoutErrors &state); + void Finished(); + +public slots: + void Abort(); + +private: + Q_DISABLE_COPY(VLayoutGenerator) + QVector papers; + VBank *bank; + int paperHeight; + int paperWidth; + bool stopGeneration; + LayoutErrors state; + unsigned int shift; + bool rotate; + int rotationIncrease; + + void CheckDetailsSize(); +}; + +#endif // VLAYOUTGENERATOR_H diff --git a/src/libs/vlayout/vlayoutpaper.cpp b/src/libs/vlayout/vlayoutpaper.cpp new file mode 100644 index 000000000..258a94604 --- /dev/null +++ b/src/libs/vlayout/vlayoutpaper.cpp @@ -0,0 +1,291 @@ +/************************************************************************ + ** + ** @file vlayoutpaper.cpp + ** @author Roman Telezhynskyi + ** @date 7 1, 2015 + ** + ** @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-2015 Valentina project + ** 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 . + ** + *************************************************************************/ + +#include "vlayoutpaper.h" +#include "vlayoutpaper_p.h" +#include "vbestsquare.h" +#include "vposition.h" + +#include +#include +#include +#include + +//--------------------------------------------------------------------------------------------------------------------- +VLayoutPaper::VLayoutPaper() + :d(new VLayoutPaperData) +{} + +//--------------------------------------------------------------------------------------------------------------------- +VLayoutPaper::VLayoutPaper(int height, int width) + :d(new VLayoutPaperData(height, width)) +{} + +//--------------------------------------------------------------------------------------------------------------------- +VLayoutPaper::VLayoutPaper(const VLayoutPaper &paper) + :d (paper.d) +{} + +//--------------------------------------------------------------------------------------------------------------------- +VLayoutPaper &VLayoutPaper::operator=(const VLayoutPaper &paper) +{ + if ( &paper == this ) + { + return *this; + } + d = paper.d; + return *this; +} + +//--------------------------------------------------------------------------------------------------------------------- +VLayoutPaper::~VLayoutPaper() +{} + +//--------------------------------------------------------------------------------------------------------------------- +int VLayoutPaper::GetHeight() const +{ + return d->globalContour.GetHeight(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutPaper::SetHeight(int height) +{ + d->globalContour.SetHeight(height); +} + +//--------------------------------------------------------------------------------------------------------------------- +int VLayoutPaper::GetWidth() const +{ + return d->globalContour.GetWidth(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutPaper::SetWidth(int width) +{ + d->globalContour.SetWidth(width); +} + +//--------------------------------------------------------------------------------------------------------------------- +qreal VLayoutPaper::GetLayoutWidth() const +{ + return d->layoutWidth; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutPaper::SetLayoutWidth(qreal width) +{ + if (width >= 0) + { + d->layoutWidth = width; + } +} + +//--------------------------------------------------------------------------------------------------------------------- +unsigned int VLayoutPaper::GetShift() const +{ + return d->globalContour.GetShift(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutPaper::SetShift(unsigned int shift) +{ + d->globalContour.SetShift(shift); +} + +//--------------------------------------------------------------------------------------------------------------------- +bool VLayoutPaper::GetRotate() const +{ + return d->rotate; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutPaper::SetRotate(bool value) +{ + d->rotate = value; +} + +//--------------------------------------------------------------------------------------------------------------------- +int VLayoutPaper::GetRotationIncrease() const +{ + return d->rotationIncrease; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutPaper::SetRotationIncrease(int value) +{ + d->rotationIncrease = value; + + if ((d->rotationIncrease >= 1 && d->rotationIncrease <= 180 && 360 % d->rotationIncrease == 0) == false) + { + d->rotationIncrease = 180; + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutPaper::SetPaperIndex(quint32 index) +{ + d->paperIndex = index; +} + +//--------------------------------------------------------------------------------------------------------------------- +bool VLayoutPaper::ArrangeDetail(const VLayoutDetail &detail, bool &stop) +{ + // First need set size of paper + if (d->globalContour.GetHeight() <= 0 || d->globalContour.GetWidth() <= 0) + { + return false; + } + + if (detail.EdgesCount() < 3) + { + return false;//Not enough edges + } + + d->frame = 0; + + return AddToSheet(detail, stop); +} + +//--------------------------------------------------------------------------------------------------------------------- +int VLayoutPaper::Count() const +{ + return d->details.count(); +} + +//--------------------------------------------------------------------------------------------------------------------- +bool VLayoutPaper::AddToSheet(const VLayoutDetail &detail, bool &stop) +{ + VBestSquare bestResult; + QThreadPool *thread_pool = QThreadPool::globalInstance(); + QVector threads; + + for (int j=1; j <= d->globalContour.EdgesCount(); ++j) + { + for (int i=1; i<= detail.EdgesCount(); i++) + { + QCoreApplication::processEvents(); + + VPosition *thread = new VPosition(d->globalContour, j, detail, i, &stop, d->rotate, d->rotationIncrease); + //Info for debug + #ifdef LAYOUT_DEBUG + thread->setPaperIndex(d->paperIndex); + thread->setFrame(d->frame); + thread->setDetailsCount(d->details.count()); + thread->setDetails(d->details); + #endif + + thread->setAutoDelete(false); + threads.append(thread); + thread_pool->start(thread); + + d->frame = d->frame + 3 + 360/d->rotationIncrease*2; + } + } + + if (thread_pool->waitForDone() == false) + { + return false; + } + + QCoreApplication::processEvents(); + + if (stop) + { + return false; + } + + for (int i=0; i < threads.size(); ++i) + { + bestResult.NewResult(threads.at(i)->getBestResult()); + } + + qDeleteAll(threads.begin(), threads.end()); + threads.clear(); + + return SaveResult(bestResult, detail); +} + +//--------------------------------------------------------------------------------------------------------------------- +bool VLayoutPaper::SaveResult(const VBestSquare &bestResult, const VLayoutDetail &detail) +{ + if (bestResult.ValideResult()) + { + VLayoutDetail workDetail = detail; + workDetail.SetMatrix(bestResult.Matrix());// Don't forget set matrix + workDetail.SetMirror(bestResult.Mirror()); + const QVector newGContour = d->globalContour.UniteWithContour(workDetail, bestResult.GContourEdge(), + bestResult.DetailEdge(), + bestResult.Type()); + if (newGContour.isEmpty()) + { + return false; + } + d->details.append(workDetail); + d->globalContour.SetContour(newGContour); + +#ifdef LAYOUT_DEBUG +# ifdef SHOW_BEST + VPosition::DrawDebug(d->globalContour, workDetail, UINT_MAX, d->paperIndex, d->details.count(), d->details); +# endif +#endif + } + + return bestResult.ValideResult(); // Do we have the best result? +} + +//--------------------------------------------------------------------------------------------------------------------- +void VLayoutPaper::SaveCandidate(VBestSquare &bestResult, const VLayoutDetail &detail, int globalI, int detJ, + BestFrom type) +{ + QVector newGContour = d->globalContour.UniteWithContour(detail, globalI, detJ, type); + newGContour.append(newGContour.first()); + const QRectF rec = QPolygonF(newGContour).boundingRect(); + bestResult.NewResult(static_cast(rec.width()*rec.height()), globalI, detJ, + detail.GetMatrix(), detail.IsMirror(), type); +} + +//--------------------------------------------------------------------------------------------------------------------- +QGraphicsRectItem *VLayoutPaper::GetPaperItem() const +{ + QGraphicsRectItem *paper = new QGraphicsRectItem(QRectF(0, 0, d->globalContour.GetWidth(), + d->globalContour.GetHeight())); + paper->setPen(QPen(Qt::black, 1)); + paper->setBrush(QBrush(Qt::white)); + return paper; +} + +//--------------------------------------------------------------------------------------------------------------------- +QList VLayoutPaper::GetDetails() const +{ + QList list; + for (int i=0; i < d->details.count(); ++i) + { + list.append(d->details.at(i).GetItem()); + } + return list; +} diff --git a/src/libs/vlayout/vlayoutpaper.h b/src/libs/vlayout/vlayoutpaper.h new file mode 100644 index 000000000..5bbac84d1 --- /dev/null +++ b/src/libs/vlayout/vlayoutpaper.h @@ -0,0 +1,85 @@ +/************************************************************************ + ** + ** @file vlayoutpaper.h + ** @author Roman Telezhynskyi + ** @date 7 1, 2015 + ** + ** @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-2015 Valentina project + ** 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 . + ** + *************************************************************************/ + +#ifndef VLAYOUTPAPER_H +#define VLAYOUTPAPER_H + +#include +#include "vlayoutdef.h" + +class VLayoutPaperData; +class VLayoutDetail; +class QGraphicsItem; +class VBestSquare; +class QGraphicsRectItem; + +class VLayoutPaper +{ +public: + VLayoutPaper(); + VLayoutPaper(int height, int width); + VLayoutPaper(const VLayoutPaper &paper); + VLayoutPaper &operator=(const VLayoutPaper &paper); + virtual ~VLayoutPaper(); + + int GetHeight() const; + void SetHeight(int height); + + int GetWidth() const; + void SetWidth(int width); + + qreal GetLayoutWidth() const; + void SetLayoutWidth(qreal width); + + unsigned int GetShift() const; + void SetShift(unsigned int shift); + + bool GetRotate() const; + void SetRotate(bool value); + + int GetRotationIncrease() const; + void SetRotationIncrease(int value); + + void SetPaperIndex(quint32 index); + + bool ArrangeDetail(const VLayoutDetail &detail, bool &stop); + int Count() const; + QGraphicsRectItem *GetPaperItem() const; + QList GetDetails() const; + +private: + QSharedDataPointer d; + + bool AddToSheet(const VLayoutDetail &detail, bool &stop); + + bool SaveResult(const VBestSquare &bestResult, const VLayoutDetail &detail); + void SaveCandidate(VBestSquare &bestResult, const VLayoutDetail &detail, int globalI, int detJ, BestFrom type); + +}; + +#endif // VLAYOUTPAPER_H diff --git a/src/libs/vlayout/vlayoutpaper_p.h b/src/libs/vlayout/vlayoutpaper_p.h new file mode 100644 index 000000000..fb31a0649 --- /dev/null +++ b/src/libs/vlayout/vlayoutpaper_p.h @@ -0,0 +1,82 @@ +/************************************************************************ + ** + ** @file vlayoutpaper_p.h + ** @author Roman Telezhynskyi + ** @date 8 1, 2015 + ** + ** @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-2015 Valentina project + ** 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 . + ** + *************************************************************************/ + +#ifndef VLAYOUTPAPER_P_H +#define VLAYOUTPAPER_P_H + +#include +#include +#include + +#include "vlayoutdetail.h" +#include "vcontour.h" + +#ifdef Q_CC_GNU + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Weffc++" +#endif + +class VLayoutPaperData : public QSharedData +{ +public: + VLayoutPaperData() + :details(QVector()), globalContour(VContour()), paperIndex(0), frame(0), layoutWidth(0), + rotate(true), rotationIncrease(180) + {} + + VLayoutPaperData(int height, int width) + :details(QVector()), globalContour(VContour(height, width)), paperIndex(0), frame(0), + layoutWidth(0), rotate(true), rotationIncrease(180) + {} + + VLayoutPaperData(const VLayoutPaperData &paper) + :QSharedData(paper), details(paper.details), globalContour(paper.globalContour), paperIndex(paper.paperIndex), + frame(paper.frame), layoutWidth(paper.layoutWidth), rotate(paper.rotate), + rotationIncrease(paper.rotationIncrease) + {} + + ~VLayoutPaperData() {} + + /** @brief details list of arranged details. */ + QVector details; + + /** @brief globalContour list of global points contour. */ + VContour globalContour; + + quint32 paperIndex; + quint32 frame; + qreal layoutWidth; + bool rotate; + int rotationIncrease; +}; + +#ifdef Q_CC_GNU + #pragma GCC diagnostic pop +#endif + +#endif // VLAYOUTPAPER_P_H diff --git a/src/libs/vlayout/vposition.cpp b/src/libs/vlayout/vposition.cpp new file mode 100644 index 000000000..4cd649620 --- /dev/null +++ b/src/libs/vlayout/vposition.cpp @@ -0,0 +1,736 @@ +/************************************************************************ + ** + ** @file vposition.cpp + ** @author Roman Telezhynskyi + ** @date 20 1, 2015 + ** + ** @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-2015 Valentina project + ** 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 . + ** + *************************************************************************/ + +#include "vposition.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +//--------------------------------------------------------------------------------------------------------------------- +VPosition::VPosition(const VContour &gContour, int j, const VLayoutDetail &detail, int i, bool *stop, bool rotate, + int rotationIncrease) + :QRunnable(), bestResult(VBestSquare()), gContour(gContour), detail(detail), i(i), j(j), paperIndex(0), frame(0), + detailsCount(0), details(QVector()), stop(stop), rotate(rotate), rotationIncrease(rotationIncrease) +{ + if ((rotationIncrease >= 1 && rotationIncrease <= 180 && 360 % rotationIncrease == 0) == false) + { + rotationIncrease = 180; + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void VPosition::run() +{ + QCoreApplication::processEvents(); + + if (*stop) + { + return; + } + + // We should use copy of the detail. + VLayoutDetail workDetail = detail; + + int dEdge = i;// For mirror detail edge will be different + if (CheckCombineEdges(workDetail, j, dEdge)) + { + #ifdef LAYOUT_DEBUG + # ifdef SHOW_CANDIDATE_BEST + DrawDebug(gContour, workDetail, frame+2, paperIndex, detailsCount, details); + # endif + #endif + + SaveCandidate(bestResult, workDetail, j, dEdge, BestFrom::Combine); + } + frame = frame + 3; + + if (rotate) + { + Rotate(rotationIncrease); + } + else + { + if (gContour.GetContour().isEmpty()) + { + Rotate(rotationIncrease); + } + } +} + +//--------------------------------------------------------------------------------------------------------------------- +quint32 VPosition::getPaperIndex() const +{ + return paperIndex; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VPosition::setPaperIndex(const quint32 &value) +{ + paperIndex = value; +} + +//--------------------------------------------------------------------------------------------------------------------- +quint32 VPosition::getFrame() const +{ + return frame; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VPosition::setFrame(const quint32 &value) +{ + frame = value; +} + +//--------------------------------------------------------------------------------------------------------------------- +quint32 VPosition::getDetailsCount() const +{ + return detailsCount; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VPosition::setDetailsCount(const quint32 &value) +{ + detailsCount = value; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VPosition::setDetails(const QVector &details) +{ + this->details = details; +} + +//--------------------------------------------------------------------------------------------------------------------- +VBestSquare VPosition::getBestResult() const +{ + return bestResult; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VPosition::DrawDebug(const VContour &contour, const VLayoutDetail &detail, int frame, quint32 paperIndex, + int detailsCount, const QVector &details) +{ + QImage frameImage(contour.GetWidth()*2, contour.GetHeight()*2, QImage::Format_RGB32); + frameImage.fill(Qt::white); + QPainter paint; + paint.begin(&frameImage); + + paint.setPen(QPen(Qt::darkRed, 10, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin)); + paint.drawRect(QRectF(contour.GetWidth()/2, contour.GetHeight()/2, contour.GetWidth(), contour.GetHeight())); + + paint.setPen(QPen(Qt::black, 3, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin)); + QPainterPath p; + if (contour.GetContour().isEmpty()) + { + p = DrawContour(contour.CutEdge(QLineF(0, 0, contour.GetWidth(), 0))); + p.translate(contour.GetWidth()/2, contour.GetHeight()/2); + paint.drawPath(p); + } + else + { + p = DrawContour(contour.GetContour()); + p.translate(contour.GetWidth()/2, contour.GetHeight()/2); + paint.drawPath(p); + } + +#ifdef SHOW_CANDIDATE + paint.setPen(QPen(Qt::darkGreen, 3, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin)); + p = DrawContour(detail.GetLayoutAllowencePoints()); + p.translate(contour.GetWidth()/2, contour.GetHeight()/2); + paint.drawPath(p); +#endif + +#ifdef ARRANGED_DETAILS + paint.setPen(QPen(Qt::blue, 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin)); + p = DrawDetails(details); + p.translate(contour.GetWidth()/2, contour.GetHeight()/2); + paint.drawPath(p); +#endif + + paint.end(); + const QString path = QDir::homePath()+QStringLiteral("/LayoutDebug/")+QString("%1_%2_%3.png").arg(paperIndex) + .arg(detailsCount).arg(frame); + frameImage.save (path); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VPosition::SaveCandidate(VBestSquare &bestResult, const VLayoutDetail &detail, int globalI, int detJ, + BestFrom type) +{ + QVector newGContour = gContour.UniteWithContour(detail, globalI, detJ, type); + newGContour.append(newGContour.first()); + const QRectF rec = QPolygonF(newGContour).boundingRect(); + bestResult.NewResult(static_cast(rec.width()*rec.height()), globalI, detJ, detail.GetMatrix(), + detail.IsMirror(), type); +} + +//--------------------------------------------------------------------------------------------------------------------- +bool VPosition::CheckCombineEdges(VLayoutDetail &detail, int j, int &dEdge) const +{ + const QLineF globalEdge = gContour.GlobalEdge(j); + bool flagMirror = false; + bool flagSquare = false; + + CombineEdges(detail, globalEdge, dEdge); + +#ifdef LAYOUT_DEBUG +# ifdef SHOW_COMBINE + DrawDebug(gContour, detail, frame, paperIndex, detailsCount, details); +# endif +#endif + + CrossingType type = CrossingType::Intersection; + if (SheetContains(detail.BoundingRect())) + { + type = Crossing(detail, j, dEdge); + } + + switch (type) + { + case CrossingType::EdgeError: + return false; + case CrossingType::Intersection: + detail.Mirror(globalEdge); + flagMirror = true; + break; + case CrossingType::NoIntersection: + { + switch (InsideContour(detail, dEdge)) + { + case InsideType::EdgeError: + return false; + case InsideType::Inside: + detail.Mirror(globalEdge); + flagMirror = true; + break; + case InsideType::Outside: + flagSquare = true; + break; + default: + break; + } + } + default: + break; + } + + if (flagMirror) + { + #ifdef LAYOUT_DEBUG + #ifdef SHOW_MIRROR + DrawDebug(gContour, detail, frame+1, paperIndex, detailsCount, details); + #endif + #endif + + dEdge = detail.EdgeByPoint(globalEdge.p2()); + if (dEdge <= 0) + { + return false; + } + + CrossingType type = CrossingType::Intersection; + if (SheetContains(detail.BoundingRect())) + { + type = Crossing(detail, j, dEdge); + } + + switch (type) + { + case CrossingType::EdgeError: + return false; + case CrossingType::Intersection: + flagSquare = false; + break; + case CrossingType::NoIntersection: + { + switch (InsideContour(detail, dEdge)) + { + case InsideType::EdgeError: + return false; + case InsideType::Inside: + flagSquare = false; + break; + case InsideType::Outside: + flagSquare = true; + break; + default: + break; + } + } + default: + break; + } + } + return flagSquare; +} + +//--------------------------------------------------------------------------------------------------------------------- +bool VPosition::CheckRotationEdges(VLayoutDetail &detail, int j, int dEdge, int angle) const +{ + const QLineF globalEdge = gContour.GlobalEdge(j); + bool flagSquare = false; + + RotateEdges(detail, globalEdge, dEdge, angle); + +#ifdef LAYOUT_DEBUG + #ifdef SHOW_ROTATION + DrawDebug(gContour, detail, frame, paperIndex, detailsCount, details); + #endif +#endif + + CrossingType type = CrossingType::Intersection; + if (SheetContains(detail.BoundingRect())) + { + type = Crossing(detail, j, dEdge); + } + + switch (type) + { + case CrossingType::EdgeError: + return false; + case CrossingType::Intersection: + flagSquare = false; + break; + case CrossingType::NoIntersection: + { + switch (InsideContour(detail, dEdge)) + { + case InsideType::EdgeError: + return false; + case InsideType::Inside: + flagSquare = false; + break; + case InsideType::Outside: + flagSquare = true; + break; + default: + break; + } + } + default: + break; + } + return flagSquare; +} + +//--------------------------------------------------------------------------------------------------------------------- +VPosition::CrossingType VPosition::Crossing(const VLayoutDetail &detail, const int &globalI, const int &detailI) const +{ + int globalEdgesCount = gContour.EdgesCount(); + if (globalEdgesCount == 0) + { + globalEdgesCount = 1;// For blank sheet + } + + const int detailEdgesCount = detail.EdgesCount(); + if (detailEdgesCount < 3) + { + return CrossingType::EdgeError; + } + + for(int i = 1; i <= globalEdgesCount; i++) + { + const QLineF globalEdge = gContour.GlobalEdge(i); + if (globalEdge.isNull()) // Got null edge + { + return CrossingType::EdgeError; + } + + for(int j = 1; j <= detailEdgesCount; j++) + { + if (i == globalI && j == detailI) + { + continue; + } + + const QLineF detailEdge = detail.Edge(j); + if (detailEdge.isNull()) // Got null edge + { + return CrossingType::EdgeError; + } + + QPointF xPoint; + QLineF::IntersectType type = globalEdge.intersect(detailEdge, &xPoint); + + if (type == QLineF::BoundedIntersection) + { + if (TrueIntersection(gContour.GlobalEdge(globalI), detail.Edge(detailI), xPoint)) + { + return CrossingType::Intersection; + } + } + } + } + + return CrossingType::NoIntersection; +} + +//--------------------------------------------------------------------------------------------------------------------- +VPosition::InsideType VPosition::InsideContour(const VLayoutDetail &detail, const int &detailI) const +{ + if (detail.EdgesCount() < 3) + { + return InsideType::EdgeError; + } + + const QVector lPoints = detail.GetLayoutAllowencePoints(); + + const QLineF detailEdge = detail.Edge(detailI); + if (detailEdge.isNull()) // Got null edge + { + return InsideType::EdgeError; + } + + if (gContour.GetContour().isEmpty()) + { + const QLineF globalEdge = gContour.GlobalEdge(1); + for(int i = 0; i < lPoints.count(); i++) + { + if (CheckSide(globalEdge, lPoints.at(i)) < 0) + { + return InsideType::Inside; + } + } + } + else + { + const int polyCorners = gContour.EdgesCount(); + int j = polyCorners-1; + + QVector constant; + QVector multiple; + + for(int i=0; i p = Triplet(detailEdge); + for (int n=0; n= p.at(n).y()) || (yj < p.at(n).y() && yi >= p.at(n).y()))) + { + oddNodes ^= (p.at(n).y() * multiple.at(i) + constant.at(i) < p.at(n).x()); + } + + j=i; + } + + if (oddNodes) + { + return InsideType::Inside; + } + } + } + } + return InsideType::Outside; +} + +//--------------------------------------------------------------------------------------------------------------------- +qreal VPosition::CheckSide(const QLineF &edge, const QPointF &p) const +{ + return (edge.x2() - edge.x1()) * (p.y() - edge.y1()) - (edge.y2() - edge.y1()) * (p.x() - edge.x1()); +} + +//--------------------------------------------------------------------------------------------------------------------- +bool VPosition::SheetContains(const QRectF &rect) const +{ + const QRectF bRect(0, 0, gContour.GetWidth(), gContour.GetHeight()); + return bRect.contains(rect); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VPosition::CombineEdges(VLayoutDetail &detail, const QLineF &globalEdge, const int &dEdge) const +{ + QLineF detailEdge = detail.Edge(dEdge); + + // Find distance between two edges for two begin vertex. + const qreal dx = globalEdge.x2() - detailEdge.x2(); + const qreal dy = globalEdge.y2() - detailEdge.y2(); + + detailEdge.translate(dx, dy); // Use values for translate detail edge. + + const qreal angle_between = globalEdge.angleTo(detailEdge); // Seek angle between two edges. + + // Now we move detail to position near to global contour edge. + detail.Translate(dx, dy); + detail.Rotate(detailEdge.p2(), -angle_between); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VPosition::RotateEdges(VLayoutDetail &detail, const QLineF &globalEdge, int dEdge, int angle) const +{ + QLineF detailEdge = detail.Edge(dEdge); + + // Find distance between two edges for two begin vertex. + const qreal dx = globalEdge.x2() - detailEdge.x2(); + const qreal dy = globalEdge.y2() - detailEdge.y2(); + + detailEdge.translate(dx, dy); // Use values for translate detail edge. + + // Now we move detail to position near to global contour edge. + detail.Translate(dx, dy); + detail.Rotate(globalEdge.p2(), angle); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VPosition::AppendWhole(QVector &contour, const VLayoutDetail &detail, int detJ, unsigned int shift) +{ + int processedEdges = 0; + const int nD = detail.EdgesCount(); + int j = detJ+1; + do + { + if (j > nD) + { + j=1; + } + const QVector points = CutEdge(detail.Edge(j), shift); + for (int i = 0; i < points.size()-1; ++i) + { + contour.append(points.at(i)); + } + ++processedEdges; + ++j; + }while (processedEdges < nD); +} + +//--------------------------------------------------------------------------------------------------------------------- +QPolygonF VPosition::GlobalPolygon() const +{ + QVector points = gContour.GetContour(); + points.append(points.first()); + return QPolygonF(points); +} + +//--------------------------------------------------------------------------------------------------------------------- +QVector VPosition::CutEdge(const QLineF &edge, unsigned int shift) +{ + QVector points; + if (shift == 0) + { + points.append(edge.p1()); + points.append(edge.p2()); + } + + const int n = qFloor(edge.length()/shift); + + if (n <= 0) + { + points.append(edge.p1()); + points.append(edge.p2()); + } + else + { + const qreal nShift = edge.length()/n; + for (int i = 1; i <= n+1; ++i) + { + QLineF l1 = edge; + l1.setLength(nShift*(i-1)); + points.append(l1.p2()); + } + } + return points; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VPosition::Rotate(int increase) +{ + for (int angle = 0; angle <= 360; angle = angle+increase) + { + if (*stop) + { + return; + } + + QCoreApplication::processEvents(); + + // We should use copy of the detail. + VLayoutDetail workDetail = detail; + + if (CheckRotationEdges(workDetail, j, i, angle)) + { + #ifdef LAYOUT_DEBUG + # ifdef SHOW_CANDIDATE_BEST + ++frame; + DrawDebug(gContour, workDetail, frame, paperIndex, detailsCount, details); + # endif + #endif + + SaveCandidate(bestResult, workDetail, j, i, BestFrom::Rotation); + } + ++frame; + } +} + +//--------------------------------------------------------------------------------------------------------------------- +bool VPosition::TrueIntersection(const QLineF &gEdge, const QLineF &dEdge, const QPointF &p) const +{ + const QPointF pX = RoundedPoint(p); + const QPointF gP1 = RoundedPoint(gEdge.p1()); + const QPointF gP2 = RoundedPoint(gEdge.p2()); + const QPointF dP1 = RoundedPoint(dEdge.p1()); + const QPointF dP2 = RoundedPoint(dEdge.p2()); + return !(pX == gP1 || pX == gP2 || pX == dP1 || pX == dP2); +} + +//--------------------------------------------------------------------------------------------------------------------- +QPointF VPosition::RoundedPoint(const QPointF &p) const +{ + return QPointF(qRound(p.x()), qRound(p.y())); +} + +//--------------------------------------------------------------------------------------------------------------------- +QVector VPosition::Triplet(const QLineF &edge) const +{ + QVector p; + QLineF line = edge; + line.setLength(edge.length()/2); + + p.append(edge.p1()); + p.append(line.p2()); + p.append(edge.p2()); + return p; +} + +//--------------------------------------------------------------------------------------------------------------------- +QPainterPath VPosition::ShowDirection(const QLineF &edge) +{ + const int arrowLength = 14; + QPainterPath path; + if (edge.length()/arrowLength < 5) + { + return path; + } + + QLineF arrow = edge; + arrow.setLength(edge.length()/2.0); + + //Reverse line because we want start arrow from this point + arrow = QLineF(arrow.p2(), arrow.p1()); + const qreal angle = arrow.angle();//we each time change line angle, better save original angle value + arrow.setLength(arrowLength);//arrow length in pixels + + arrow.setAngle(angle-35); + path.moveTo(arrow.p1()); + path.lineTo(arrow.p2()); + + arrow.setAngle(angle+35); + path.moveTo(arrow.p1()); + path.lineTo(arrow.p2()); + return path; +} + +//--------------------------------------------------------------------------------------------------------------------- +QPainterPath VPosition::DrawContour(const QVector &points) +{ + QPainterPath path; + path.setFillRule(Qt::WindingFill); + if (points.count() >= 2) + { + for (qint32 i = 0; i < points.count()-1; ++i) + { + path.moveTo(points.at(i)); + path.lineTo(points.at(i+1)); + } + path.lineTo(points.at(0)); + +#ifdef SHOW_DIRECTION + for (qint32 i = 0; i < points.count()-1; ++i) + { + path.addPath(ShowDirection(QLineF(points.at(i), points.at(i+1)))); + } +#endif + +#ifdef SHOW_VERTICES + for (qint32 i = 0; i < points.count(); ++i) + { + path.addRect(points.at(i).x()-3, points.at(i).y()-3, 6, 6); + } +#endif + } + return path; +} + +//--------------------------------------------------------------------------------------------------------------------- +QPainterPath VPosition::DrawDetails(const QVector &details) +{ + QPainterPath path; + path.setFillRule(Qt::WindingFill); + if (details.count() > 0) + { + for (int i = 0; i < details.size(); ++i) + { + path.addPath(details.at(i).ContourPath()); + } + } + return path; +} diff --git a/src/libs/vlayout/vposition.h b/src/libs/vlayout/vposition.h new file mode 100644 index 000000000..ad7f16c0a --- /dev/null +++ b/src/libs/vlayout/vposition.h @@ -0,0 +1,129 @@ +/************************************************************************ + ** + ** @file vposition.h + ** @author Roman Telezhynskyi + ** @date 20 1, 2015 + ** + ** @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-2015 Valentina project + ** 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 . + ** + *************************************************************************/ + +#ifndef VPOSITION_H +#define VPOSITION_H + +#include +#include + +#include "vlayoutdef.h" +#include "vbestsquare.h" +#include "vcontour.h" +#include "vlayoutdetail.h" + +class QPointF; +class QRectF; +class QLineF; +class QPolygonF; +class QPainterPath; + +class VPosition : public QRunnable +{ +public: + VPosition(const VContour &gContour, int j, const VLayoutDetail &detail, int i, bool *stop, bool rotate, + int rotationIncrease); + virtual ~VPosition(){} + + virtual void run(); + + quint32 getPaperIndex() const; + void setPaperIndex(const quint32 &value); + + quint32 getFrame() const; + void setFrame(const quint32 &value); + + quint32 getDetailsCount() const; + void setDetailsCount(const quint32 &value); + + void setDetails(const QVector &details); + + VBestSquare getBestResult() const; + + static void DrawDebug(const VContour &contour, const VLayoutDetail &detail, int frame, quint32 paperIndex, + int detailsCount, const QVector &details = QVector()); + +private: + Q_DISABLE_COPY(VPosition) + VBestSquare bestResult; + const VContour gContour; + const VLayoutDetail detail; + int i; + int j; + quint32 paperIndex; + quint32 frame; + quint32 detailsCount; + QVector details; + bool *stop; + bool rotate; + int rotationIncrease; + + enum class CrossingType : char + { + NoIntersection = 0, + Intersection = 1, + EdgeError = 2 + }; + + enum class InsideType : char + { + Outside = 0, + Inside = 1, + EdgeError = 2 + }; + + void SaveCandidate(VBestSquare &bestResult, const VLayoutDetail &detail, int globalI, int detJ, BestFrom type); + + bool CheckCombineEdges(VLayoutDetail &detail, int j, int &dEdge) const; + bool CheckRotationEdges(VLayoutDetail &detail, int j, int dEdge, int angle) const; + + CrossingType Crossing(const VLayoutDetail &detail, const int &globalI, const int &detailI) const; + InsideType InsideContour(const VLayoutDetail &detail, const int &detailI) const; + qreal CheckSide(const QLineF &edge, const QPointF &p) const; + bool SheetContains(const QRectF &rect) const; + + void CombineEdges(VLayoutDetail &detail, const QLineF &globalEdge, const int &dEdge) const; + void RotateEdges(VLayoutDetail &detail, const QLineF &globalEdge, int dEdge, int angle) const; + + QPolygonF GlobalPolygon() const; + + bool TrueIntersection(const QLineF &gEdge, const QLineF &dEdge, const QPointF &p) const; + QPointF RoundedPoint(const QPointF &p) const; + QVector Triplet(const QLineF &edge) const; + + static QPainterPath ShowDirection(const QLineF &edge); + static QPainterPath DrawContour(const QVector &points); + static QPainterPath DrawDetails(const QVector &details); + + static void AppendWhole(QVector &contour, const VLayoutDetail &detail, int detJ, unsigned int shift); + static QVector CutEdge(const QLineF &edge, unsigned int shift); + + void Rotate(int increase); +}; + +#endif // VPOSITION_H diff --git a/src/libs/vobj/stable.cpp b/src/libs/vobj/stable.cpp index 877ab2ddf..a42d3fd7c 100644 --- a/src/libs/vobj/stable.cpp +++ b/src/libs/vobj/stable.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/vobj/stable.h b/src/libs/vobj/stable.h index adb5eed9f..f24b2cdf9 100644 --- a/src/libs/vobj/stable.h +++ b/src/libs/vobj/stable.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/vobj/vobjengine.cpp b/src/libs/vobj/vobjengine.cpp index ee1536355..189ea6ead 100644 --- a/src/libs/vobj/vobjengine.cpp +++ b/src/libs/vobj/vobjengine.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/vobj/vobjengine.h b/src/libs/vobj/vobjengine.h index 52e71055a..3d8fb3513 100644 --- a/src/libs/vobj/vobjengine.h +++ b/src/libs/vobj/vobjengine.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/vobj/vobjpaintdevice.cpp b/src/libs/vobj/vobjpaintdevice.cpp index 0b248b48d..3d5b7e021 100644 --- a/src/libs/vobj/vobjpaintdevice.cpp +++ b/src/libs/vobj/vobjpaintdevice.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/vobj/vobjpaintdevice.h b/src/libs/vobj/vobjpaintdevice.h index 365a6da7a..36f037252 100644 --- a/src/libs/vobj/vobjpaintdevice.h +++ b/src/libs/vobj/vobjpaintdevice.h @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/libs/vpropertyexplorer/checkablemessagebox.cpp b/src/libs/vpropertyexplorer/checkablemessagebox.cpp new file mode 100644 index 000000000..df285e0b7 --- /dev/null +++ b/src/libs/vpropertyexplorer/checkablemessagebox.cpp @@ -0,0 +1,427 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** All rights reserved. This program and the accompanying materials are made +** available under the terms of the GNU Lesser General Public License (LGPL) +** version 2.1 which accompanies this distribution, and is available at +** http://www.gnu.org/licenses/lgpl-2.1.html +** +** This library 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 Lesser General Public License +** for more details. +** +****************************************************************************/ + +#include "checkablemessagebox.h" + +#include +#include +#include +#include +#include +#include + +/*! + \class Utils::CheckableMessageBox + + \brief The CheckableMessageBox class implements a message box suitable for + questions with a + "Do not ask me again" checkbox. + + Emulates the QMessageBox API with + static conveniences. The message label can open external URLs. +*/ + +static const char kDoNotAskAgainKey[] = "DoNotAskAgain"; + +namespace Utils { + +class CheckableMessageBoxPrivate +{ +public: + CheckableMessageBoxPrivate(QDialog *q) + : clickedButton(0) + { + QSizePolicy sizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred); + + pixmapLabel = new QLabel(q); + sizePolicy.setHorizontalStretch(0); + sizePolicy.setVerticalStretch(0); + sizePolicy.setHeightForWidth(pixmapLabel->sizePolicy().hasHeightForWidth()); + pixmapLabel->setSizePolicy(sizePolicy); + pixmapLabel->setVisible(false); + + QSpacerItem *pixmapSpacer = + new QSpacerItem(0, 5, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding); + + messageLabel = new QLabel(q); + messageLabel->setMinimumSize(QSize(300, 0)); + messageLabel->setWordWrap(true); + messageLabel->setOpenExternalLinks(true); + messageLabel->setTextInteractionFlags(Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse); + + QSpacerItem *checkBoxRightSpacer = + new QSpacerItem(1, 1, QSizePolicy::Expanding, QSizePolicy::Minimum); + QSpacerItem *buttonSpacer = + new QSpacerItem(0, 1, QSizePolicy::Minimum, QSizePolicy::Minimum); + + checkBox = new QCheckBox(q); + checkBox->setText(CheckableMessageBox::tr("Do not ask again")); + + buttonBox = new QDialogButtonBox(q); + buttonBox->setOrientation(Qt::Horizontal); + buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok); + + QVBoxLayout *verticalLayout = new QVBoxLayout(); + verticalLayout->addWidget(pixmapLabel); + verticalLayout->addItem(pixmapSpacer); + + QHBoxLayout *horizontalLayout_2 = new QHBoxLayout(); + horizontalLayout_2->addLayout(verticalLayout); + horizontalLayout_2->addWidget(messageLabel); + + QHBoxLayout *horizontalLayout = new QHBoxLayout(); + horizontalLayout->addWidget(checkBox); + horizontalLayout->addItem(checkBoxRightSpacer); + + QVBoxLayout *verticalLayout_2 = new QVBoxLayout(q); + verticalLayout_2->addLayout(horizontalLayout_2); + verticalLayout_2->addLayout(horizontalLayout); + verticalLayout_2->addItem(buttonSpacer); + verticalLayout_2->addWidget(buttonBox); + } + + QLabel *pixmapLabel; + QLabel *messageLabel; + QCheckBox *checkBox; + QDialogButtonBox *buttonBox; + QAbstractButton *clickedButton; +}; + +CheckableMessageBox::CheckableMessageBox(QWidget *parent) : + QDialog(parent), + d(new CheckableMessageBoxPrivate(this)) +{ + setModal(true); + setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); + connect(d->buttonBox, SIGNAL(accepted()), SLOT(accept())); + connect(d->buttonBox, SIGNAL(rejected()), SLOT(reject())); + connect(d->buttonBox, SIGNAL(clicked(QAbstractButton*)), + SLOT(slotClicked(QAbstractButton*))); +} + +CheckableMessageBox::~CheckableMessageBox() +{ + delete d; +} + +void CheckableMessageBox::slotClicked(QAbstractButton *b) +{ + d->clickedButton = b; +} + +QAbstractButton *CheckableMessageBox::clickedButton() const +{ + return d->clickedButton; +} + +QDialogButtonBox::StandardButton CheckableMessageBox::clickedStandardButton() const +{ + if (d->clickedButton) + return d->buttonBox->standardButton(d->clickedButton); + return QDialogButtonBox::NoButton; +} + +QString CheckableMessageBox::text() const +{ + return d->messageLabel->text(); +} + +void CheckableMessageBox::setText(const QString &t) +{ + d->messageLabel->setText(t); +} + +QPixmap CheckableMessageBox::iconPixmap() const +{ + if (const QPixmap *p = d->pixmapLabel->pixmap()) + return QPixmap(*p); + return QPixmap(); +} + +void CheckableMessageBox::setIconPixmap(const QPixmap &p) +{ + d->pixmapLabel->setPixmap(p); + d->pixmapLabel->setVisible(!p.isNull()); +} + +bool CheckableMessageBox::isChecked() const +{ + return d->checkBox->isChecked(); +} + +void CheckableMessageBox::setChecked(bool s) +{ + d->checkBox->setChecked(s); +} + +QString CheckableMessageBox::checkBoxText() const +{ + return d->checkBox->text(); +} + +void CheckableMessageBox::setCheckBoxText(const QString &t) +{ + d->checkBox->setText(t); +} + +bool CheckableMessageBox::isCheckBoxVisible() const +{ + return d->checkBox->isVisible(); +} + +void CheckableMessageBox::setCheckBoxVisible(bool v) +{ + d->checkBox->setVisible(v); +} + +QDialogButtonBox::StandardButtons CheckableMessageBox::standardButtons() const +{ + return d->buttonBox->standardButtons(); +} + +void CheckableMessageBox::setStandardButtons(QDialogButtonBox::StandardButtons s) +{ + d->buttonBox->setStandardButtons(s); +} + +QPushButton *CheckableMessageBox::button(QDialogButtonBox::StandardButton b) const +{ + return d->buttonBox->button(b); +} + +QPushButton *CheckableMessageBox::addButton(const QString &text, QDialogButtonBox::ButtonRole role) +{ + return d->buttonBox->addButton(text, role); +} + +QDialogButtonBox::StandardButton CheckableMessageBox::defaultButton() const +{ + foreach (QAbstractButton *b, d->buttonBox->buttons()) + if (QPushButton *pb = qobject_cast(b)) + if (pb->isDefault()) + return d->buttonBox->standardButton(pb); + return QDialogButtonBox::NoButton; +} + +void CheckableMessageBox::setDefaultButton(QDialogButtonBox::StandardButton s) +{ + if (QPushButton *b = d->buttonBox->button(s)) { + b->setDefault(true); + b->setFocus(); + } +} + +QDialogButtonBox::StandardButton +CheckableMessageBox::question(QWidget *parent, + const QString &title, + const QString &question, + const QString &checkBoxText, + bool *checkBoxSetting, + QDialogButtonBox::StandardButtons buttons, + QDialogButtonBox::StandardButton defaultButton) +{ + CheckableMessageBox mb(parent); + mb.setWindowTitle(title); + mb.setIconPixmap(QMessageBox::standardIcon(QMessageBox::Question)); + mb.setText(question); + mb.setCheckBoxText(checkBoxText); + mb.setChecked(*checkBoxSetting); + mb.setStandardButtons(buttons); + mb.setDefaultButton(defaultButton); + mb.exec(); + *checkBoxSetting = mb.isChecked(); + return mb.clickedStandardButton(); +} + +QDialogButtonBox::StandardButton +CheckableMessageBox::information(QWidget *parent, + const QString &title, + const QString &text, + const QString &checkBoxText, + bool *checkBoxSetting, + QDialogButtonBox::StandardButtons buttons, + QDialogButtonBox::StandardButton defaultButton) +{ + CheckableMessageBox mb(parent); + mb.setWindowTitle(title); + mb.setIconPixmap(QMessageBox::standardIcon(QMessageBox::Information)); + mb.setText(text); + mb.setCheckBoxText(checkBoxText); + mb.setChecked(*checkBoxSetting); + mb.setStandardButtons(buttons); + mb.setDefaultButton(defaultButton); + mb.exec(); + *checkBoxSetting = mb.isChecked(); + return mb.clickedStandardButton(); +} + +QMessageBox::StandardButton CheckableMessageBox::dialogButtonBoxToMessageBoxButton(QDialogButtonBox::StandardButton db) +{ + return static_cast(int(db)); +} + +bool askAgain(QSettings *settings, const QString &settingsSubKey) +{ + //QTC_CHECK(settings); + if (settings) { + settings->beginGroup(QLatin1String(kDoNotAskAgainKey)); + bool shouldNotAsk = settings->value(settingsSubKey, false).toBool(); + settings->endGroup(); + if (shouldNotAsk) + return false; + } + return true; +} + +enum DoNotAskAgainType{Question, Information}; + +void initDoNotAskAgainMessageBox(CheckableMessageBox &messageBox, const QString &title, + const QString &text, QDialogButtonBox::StandardButtons buttons, + QDialogButtonBox::StandardButton defaultButton, + DoNotAskAgainType type) +{ + messageBox.setWindowTitle(title); + messageBox.setIconPixmap(QMessageBox::standardIcon(type == Information + ? QMessageBox::Information + : QMessageBox::Question)); + messageBox.setText(text); + messageBox.setCheckBoxVisible(true); + messageBox.setCheckBoxText(type == Information ? CheckableMessageBox::msgDoNotShowAgain() + : CheckableMessageBox::msgDoNotAskAgain()); + messageBox.setChecked(false); + messageBox.setStandardButtons(buttons); + messageBox.setDefaultButton(defaultButton); +} + +void doNotAskAgain(QSettings *settings, const QString &settingsSubKey) +{ + if (!settings) + return; + + settings->beginGroup(QLatin1String(kDoNotAskAgainKey)); + settings->setValue(settingsSubKey, true); + settings->endGroup(); +} + +/*! + Shows a message box with given \a title and \a text, and a \gui {Do not ask again} check box. + If the user checks the check box and accepts the dialog with the \a acceptButton, + further invocations of this function with the same \a settings and \a settingsSubKey will not + show the dialog, but instantly return \a acceptButton. + + Returns the clicked button, or QDialogButtonBox::NoButton if the user rejects the dialog + with the escape key, or \a acceptButton if the dialog is suppressed. +*/ +QDialogButtonBox::StandardButton +CheckableMessageBox::doNotAskAgainQuestion(QWidget *parent, const QString &title, + const QString &text, QSettings *settings, + const QString &settingsSubKey, + QDialogButtonBox::StandardButtons buttons, + QDialogButtonBox::StandardButton defaultButton, + QDialogButtonBox::StandardButton acceptButton) + +{ + if (!askAgain(settings, settingsSubKey)) + return acceptButton; + + CheckableMessageBox messageBox(parent); + initDoNotAskAgainMessageBox(messageBox, title, text, buttons, defaultButton, Question); + messageBox.exec(); + if (messageBox.isChecked() && (messageBox.clickedStandardButton() == acceptButton)) + doNotAskAgain(settings, settingsSubKey); + + return messageBox.clickedStandardButton(); +} + +/*! + Shows a message box with given \a title and \a text, and a \gui {Do not show again} check box. + If the user checks the check box and quits the dialog, further invocations of this + function with the same \a settings and \a settingsSubKey will not show the dialog, but instantly return. + + Returns the clicked button, or QDialogButtonBox::NoButton if the user rejects the dialog + with the escape key, or \a defaultButton if the dialog is suppressed. +*/ +QDialogButtonBox::StandardButton +CheckableMessageBox::doNotShowAgainInformation(QWidget *parent, const QString &title, + const QString &text, QSettings *settings, + const QString &settingsSubKey, + QDialogButtonBox::StandardButtons buttons, + QDialogButtonBox::StandardButton defaultButton) + +{ + if (!askAgain(settings, settingsSubKey)) + return defaultButton; + + CheckableMessageBox messageBox(parent); + initDoNotAskAgainMessageBox(messageBox, title, text, buttons, defaultButton, Information); + messageBox.exec(); + if (messageBox.isChecked()) + doNotAskAgain(settings, settingsSubKey); + + return messageBox.clickedStandardButton(); +} + +/*! + Resets all suppression settings for doNotAskAgainQuestion() found in \a settings, + so all these message boxes are shown again. + */ +void CheckableMessageBox::resetAllDoNotAskAgainQuestions(QSettings *settings) +{ + //Q_ASSERT(settings, return); + settings->beginGroup(QLatin1String(kDoNotAskAgainKey)); + settings->remove(QString()); + settings->endGroup(); +} + +/*! + Returns whether any message boxes from doNotAskAgainQuestion() are suppressed + in the \a settings. +*/ +bool CheckableMessageBox::hasSuppressedQuestions(QSettings *settings) +{ + //Q_ASSERT(settings, return false); + bool hasSuppressed = false; + settings->beginGroup(QLatin1String(kDoNotAskAgainKey)); + foreach (const QString &subKey, settings->childKeys()) { + if (settings->value(subKey, false).toBool()) { + hasSuppressed = true; + break; + } + } + settings->endGroup(); + return hasSuppressed; +} + +/*! + Returns the standard \gui {Do not ask again} check box text. + \sa doNotAskAgainQuestion() +*/ +QString CheckableMessageBox::msgDoNotAskAgain() +{ + return QApplication::translate("Utils::CheckableMessageBox", "Do not &ask again"); +} + +/*! + Returns the standard \gui {Do not show again} check box text. + \sa doNotShowAgainInformation() +*/ +QString CheckableMessageBox::msgDoNotShowAgain() +{ + return QApplication::translate("Utils::CheckableMessageBox", "Do not &show again"); +} + +} // namespace Utils diff --git a/src/libs/vpropertyexplorer/checkablemessagebox.h b/src/libs/vpropertyexplorer/checkablemessagebox.h new file mode 100644 index 000000000..5056f7947 --- /dev/null +++ b/src/libs/vpropertyexplorer/checkablemessagebox.h @@ -0,0 +1,127 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** All rights reserved. This program and the accompanying materials are made +** available under the terms of the GNU Lesser General Public License (LGPL) +** version 2.1 which accompanies this distribution, and is available at +** http://www.gnu.org/licenses/lgpl-2.1.html +** +** This library 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 Lesser General Public License +** for more details. +** +****************************************************************************/ + +#ifndef CHECKABLEMESSAGEBOX_H +#define CHECKABLEMESSAGEBOX_H + +#include +#include + +QT_BEGIN_NAMESPACE +class QSettings; +QT_END_NAMESPACE + +namespace Utils { + +class CheckableMessageBoxPrivate; + +class Q_DECL_EXPORT CheckableMessageBox : public QDialog +{ + Q_OBJECT + Q_PROPERTY(QString text READ text WRITE setText) + Q_PROPERTY(QPixmap iconPixmap READ iconPixmap WRITE setIconPixmap) + Q_PROPERTY(bool isChecked READ isChecked WRITE setChecked) + Q_PROPERTY(QString checkBoxText READ checkBoxText WRITE setCheckBoxText) + Q_PROPERTY(QDialogButtonBox::StandardButtons buttons READ standardButtons WRITE setStandardButtons) + Q_PROPERTY(QDialogButtonBox::StandardButton defaultButton READ defaultButton WRITE setDefaultButton) + +public: + explicit CheckableMessageBox(QWidget *parent); + virtual ~CheckableMessageBox(); + + static QDialogButtonBox::StandardButton + question(QWidget *parent, + const QString &title, + const QString &question, + const QString &checkBoxText, + bool *checkBoxSetting, + QDialogButtonBox::StandardButtons buttons = QDialogButtonBox::Yes|QDialogButtonBox::No, + QDialogButtonBox::StandardButton defaultButton = QDialogButtonBox::No); + + static QDialogButtonBox::StandardButton + information(QWidget *parent, + const QString &title, + const QString &text, + const QString &checkBoxText, + bool *checkBoxSetting, + QDialogButtonBox::StandardButtons buttons = QDialogButtonBox::Ok, + QDialogButtonBox::StandardButton defaultButton = QDialogButtonBox::NoButton); + + static QDialogButtonBox::StandardButton + doNotAskAgainQuestion(QWidget *parent, + const QString &title, + const QString &text, + QSettings *settings, + const QString &settingsSubKey, + QDialogButtonBox::StandardButtons buttons = QDialogButtonBox::Yes|QDialogButtonBox::No, + QDialogButtonBox::StandardButton defaultButton = QDialogButtonBox::No, + QDialogButtonBox::StandardButton acceptButton = QDialogButtonBox::Yes); + + static QDialogButtonBox::StandardButton + doNotShowAgainInformation(QWidget *parent, + const QString &title, + const QString &text, + QSettings *settings, + const QString &settingsSubKey, + QDialogButtonBox::StandardButtons buttons = QDialogButtonBox::Ok, + QDialogButtonBox::StandardButton defaultButton = QDialogButtonBox::NoButton); + + QString text() const; + void setText(const QString &); + + bool isChecked() const; + void setChecked(bool s); + + QString checkBoxText() const; + void setCheckBoxText(const QString &); + + bool isCheckBoxVisible() const; + void setCheckBoxVisible(bool); + + QDialogButtonBox::StandardButtons standardButtons() const; + void setStandardButtons(QDialogButtonBox::StandardButtons s); + QPushButton *button(QDialogButtonBox::StandardButton b) const; + QPushButton *addButton(const QString &text, QDialogButtonBox::ButtonRole role); + + QDialogButtonBox::StandardButton defaultButton() const; + void setDefaultButton(QDialogButtonBox::StandardButton s); + + // See static QMessageBox::standardPixmap() + QPixmap iconPixmap() const; + void setIconPixmap (const QPixmap &p); + + // Query the result + QAbstractButton *clickedButton() const; + QDialogButtonBox::StandardButton clickedStandardButton() const; + + // Conversion convenience + static QMessageBox::StandardButton dialogButtonBoxToMessageBoxButton(QDialogButtonBox::StandardButton); + static void resetAllDoNotAskAgainQuestions(QSettings *settings); + static bool hasSuppressedQuestions(QSettings *settings); + static QString msgDoNotAskAgain(); + static QString msgDoNotShowAgain(); + +private slots: + void slotClicked(QAbstractButton *b); + +private: + CheckableMessageBoxPrivate *d; +}; + +} // namespace Utils + +#endif // CHECKABLEMESSAGEBOX_H diff --git a/src/libs/vpropertyexplorer/plugins/vcolorproperty.cpp b/src/libs/vpropertyexplorer/plugins/vcolorproperty.cpp index f47b41856..fc27d18f2 100644 --- a/src/libs/vpropertyexplorer/plugins/vcolorproperty.cpp +++ b/src/libs/vpropertyexplorer/plugins/vcolorproperty.cpp @@ -36,7 +36,7 @@ QVariant VColorProperty::data (int column, int role) const { if (column == DPC_Data && (Qt::DisplayRole == role)) { - return VColorPropertyEditor::getColorString(d_ptr->VariantValue.value()); + return VColorPropertyEditor::GetColorString(d_ptr->VariantValue.value()); } else if (Qt::EditRole == role) { @@ -44,7 +44,7 @@ QVariant VColorProperty::data (int column, int role) const } else if (column == DPC_Data && (Qt::DecorationRole == role)) { - return VColorPropertyEditor::getColorPixmap(d_ptr->VariantValue.value()); + return VColorPropertyEditor::GetColorPixmap(d_ptr->VariantValue.value()); } else return VProperty::data(column, role); @@ -58,7 +58,8 @@ QWidget* VColorProperty::createEditor(QWidget* parent, const QStyleOptionViewIte Q_UNUSED(delegate); VColorPropertyEditor* tmpWidget = new VColorPropertyEditor(parent); - tmpWidget->setColor(d_ptr->VariantValue.value()); + tmpWidget->setLocale(parent->locale()); + tmpWidget->SetColor(d_ptr->VariantValue.value()); return tmpWidget; } @@ -68,7 +69,7 @@ bool VColorProperty::setEditorData(QWidget* editor) VColorPropertyEditor* tmpWidget = qobject_cast(editor); if (tmpWidget) { - tmpWidget->setColor(d_ptr->VariantValue.value()); + tmpWidget->SetColor(d_ptr->VariantValue.value()); } else return false; @@ -82,7 +83,7 @@ QVariant VColorProperty::getEditorData(const QWidget *editor) const const VColorPropertyEditor* tmpWidget = qobject_cast(editor); if (tmpWidget) { - return tmpWidget->getColor(); + return tmpWidget->GetColor(); } return QVariant(); diff --git a/src/libs/vpropertyexplorer/plugins/vcolorpropertyeditor.cpp b/src/libs/vpropertyexplorer/plugins/vcolorpropertyeditor.cpp index ab55c2378..8dface9a7 100644 --- a/src/libs/vpropertyexplorer/plugins/vcolorpropertyeditor.cpp +++ b/src/libs/vpropertyexplorer/plugins/vcolorpropertyeditor.cpp @@ -47,11 +47,11 @@ VColorPropertyEditor::VColorPropertyEditor(QWidget *parent) // Create the text label TextLabel = new QLabel(this); - TextLabel->setText(getColorString(Color)); + TextLabel->setText(GetColorString(Color)); // Create the label for the pixmap ColorLabel = new QLabel(this); - ColorLabel->setPixmap(getColorPixmap(Color)); + ColorLabel->setPixmap(GetColorPixmap(Color)); // Spacer (this is needed for proper display of the label and button) Spacer = new QSpacerItem(1, 0, QSizePolicy::Expanding, QSizePolicy::Ignored); @@ -68,17 +68,17 @@ VColorPropertyEditor::VColorPropertyEditor(QWidget *parent) //ColorLabel->hide(); // for now, we just use the standard display and only add the button } -void VColorPropertyEditor::setColor(const QColor& color_) +void VColorPropertyEditor::SetColor(const QColor& color_) { if (Color != color_) { Color = color_; - ColorLabel->setPixmap(getColorPixmap(Color)); - TextLabel->setText(getColorString(Color)); + ColorLabel->setPixmap(GetColorPixmap(Color)); + TextLabel->setText(GetColorString(Color)); } } -QPixmap VColorPropertyEditor::getColorPixmap(const QColor& color, unsigned int size) +QPixmap VColorPropertyEditor::GetColorPixmap(const QColor& color, unsigned int size) { QImage tmpImgage(static_cast(size), static_cast(size), QImage::Format_ARGB32_Premultiplied); tmpImgage.fill(static_cast(color.rgb())); @@ -86,7 +86,7 @@ QPixmap VColorPropertyEditor::getColorPixmap(const QColor& color, unsigned int s // todo: support alpha channel } -QString VColorPropertyEditor::getColorString(const QColor& color) +QString VColorPropertyEditor::GetColorString(const QColor& color) { return QString("[%1, %2, %3] (%4)").arg(color.red()).arg(color.green()).arg(color.blue()).arg(color.alpha()); } @@ -98,7 +98,7 @@ void VColorPropertyEditor::onToolButtonClicked() QRgb newRgba = QColorDialog::getRgba(oldRgba, &ok, this); if (ok && newRgba != oldRgba) { - setColor(QColor::fromRgba(newRgba)); + SetColor(QColor::fromRgba(newRgba)); emit dataChangedByUser(Color, this); UserChangeEvent *event = new UserChangeEvent(); QCoreApplication::postEvent ( this, event ); @@ -123,7 +123,7 @@ VColorPropertyEditor::~VColorPropertyEditor() // } -QColor VColorPropertyEditor::getColor() const +QColor VColorPropertyEditor::GetColor() const { return Color; } diff --git a/src/libs/vpropertyexplorer/plugins/vcolorpropertyeditor.h b/src/libs/vpropertyexplorer/plugins/vcolorpropertyeditor.h index ac6dba31a..2de237f34 100644 --- a/src/libs/vpropertyexplorer/plugins/vcolorpropertyeditor.h +++ b/src/libs/vpropertyexplorer/plugins/vcolorpropertyeditor.h @@ -45,31 +45,31 @@ public: //! Returns the color currently set - QColor getColor() const; + QColor GetColor() const; //! A little helper function generating an image to represent a color //! \param color The color to fill the image with //! \size The size of the generated pixmap //! \return Returns a QPixmap - static QPixmap getColorPixmap(const QColor& color, unsigned int size = 16); + static QPixmap GetColorPixmap(const QColor& color, unsigned int size = 16); //! A helper function to convert a color into a string. //! \param color The color to fill the image with //! \return The color as string, usually in the format [RRR, GGG, BBB] (AAA) - static QString getColorString(const QColor& color); + static QString GetColorString(const QColor& color); //! Needed for proper event handling bool eventFilter(QObject *obj, QEvent *ev); signals: //! This is emitted, when the user changes the color - void dataChangedByUser(const QColor &getColor, VColorPropertyEditor* editor); + void dataChangedByUser(const QColor &GetColor, VColorPropertyEditor* editor); void dataChanged(); public slots: //! Sets the color of the widget - void setColor(const QColor &color_); + void SetColor(const QColor &color_); private slots: void onToolButtonClicked(); diff --git a/src/libs/vpropertyexplorer/plugins/venumproperty.cpp b/src/libs/vpropertyexplorer/plugins/venumproperty.cpp index 30330044d..14d3d5ea7 100644 --- a/src/libs/vpropertyexplorer/plugins/venumproperty.cpp +++ b/src/libs/vpropertyexplorer/plugins/venumproperty.cpp @@ -70,6 +70,7 @@ QWidget* VEnumProperty::createEditor(QWidget * parent, const QStyleOptionViewIte Q_UNUSED(delegate); QComboBox* tmpEditor = new QComboBox(parent); tmpEditor->clear(); + tmpEditor->setLocale(parent->locale()); tmpEditor->addItems(EnumerationLiterals); tmpEditor->setCurrentIndex(VProperty::d_ptr->VariantValue.toInt()); connect(tmpEditor, static_cast(&QComboBox::currentIndexChanged), this, diff --git a/src/libs/vpropertyexplorer/plugins/venumproperty.h b/src/libs/vpropertyexplorer/plugins/venumproperty.h index b15a04cd5..1fae1a975 100644 --- a/src/libs/vpropertyexplorer/plugins/venumproperty.h +++ b/src/libs/vpropertyexplorer/plugins/venumproperty.h @@ -86,7 +86,7 @@ public slots: void currentIndexChanged(int index); protected: - //! The list of possible options to choose frome + //! The list of possible options to choose from QStringList EnumerationLiterals; // No use of d-pointer in this case, because it is unlikely this will change. If it does, we can still add other //members by reimplementing the VPropertyPrivate class without touching this header file. diff --git a/src/libs/vpropertyexplorer/plugins/vfileproperty.cpp b/src/libs/vpropertyexplorer/plugins/vfileproperty.cpp index 4434675d0..8e965fabf 100644 --- a/src/libs/vpropertyexplorer/plugins/vfileproperty.cpp +++ b/src/libs/vpropertyexplorer/plugins/vfileproperty.cpp @@ -87,6 +87,7 @@ QWidget* VFileProperty::createEditor(QWidget * parent, const QStyleOptionViewIte VFileEditWidget::connect(tmpWidget, SIGNAL(commitData(QWidget*)), delegate, SIGNAL(commitData(QWidget*))); } + tmpWidget->setLocale(parent->locale()); tmpWidget->setFilter(static_cast(d_ptr)->FileFilters); // todo: parse this string tmpWidget->setFile(d_ptr->VariantValue.toString()); tmpWidget->setDirectory(static_cast(d_ptr)->Directory); diff --git a/src/libs/vpropertyexplorer/plugins/vlinecolorproperty.cpp b/src/libs/vpropertyexplorer/plugins/vlinecolorproperty.cpp new file mode 100644 index 000000000..c82e50c3c --- /dev/null +++ b/src/libs/vpropertyexplorer/plugins/vlinecolorproperty.cpp @@ -0,0 +1,171 @@ +/************************************************************************ + ** + ** @file vlinecolorproperty.cpp + ** @author Roman Telezhynskyi + ** @date 7 2, 2015 + ** + ** @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-2015 Valentina project + ** 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 . + ** + *************************************************************************/ + +#include "vlinecolorproperty.h" +#include "../vproperty_p.h" + +#include +#include + +using namespace VPE; + +VLineColorProperty::VLineColorProperty(const QString &name) + : VProperty(name, QVariant::Int), colors(), indexList() +{ + VProperty::d_ptr->VariantValue = 0; + VProperty::d_ptr->VariantValue.convert(QVariant::Int); +} + +QVariant VLineColorProperty::data(int column, int role) const +{ + if (colors.empty()) + { + return QVariant(); + } + + int tmpIndex = VProperty::d_ptr->VariantValue.toInt(); + + if (tmpIndex < 0 || tmpIndex >= indexList.count()) + { + tmpIndex = 0; + } + + if (column == DPC_Data && Qt::DisplayRole == role) + { + return indexList.at(tmpIndex); + } + else if (column == DPC_Data && Qt::EditRole == role) + { + return tmpIndex; + } + else + { + return VProperty::data(column, role); + } +} + +QWidget *VLineColorProperty::createEditor(QWidget *parent, const QStyleOptionViewItem &options, + const QAbstractItemDelegate *delegate) +{ + Q_UNUSED(options); + Q_UNUSED(delegate); + QComboBox* tmpEditor = new QComboBox(parent); + tmpEditor->clear(); + + QMap::const_iterator i = colors.constBegin(); + while (i != colors.constEnd()) + { + QPixmap pix(16, 16); + pix.fill(QColor(i.key())); + tmpEditor->addItem(QIcon(pix), i.value(), QVariant(i.key())); + ++i; + } + + tmpEditor->setLocale(parent->locale()); + tmpEditor->setCurrentIndex(VProperty::d_ptr->VariantValue.toInt()); + connect(tmpEditor, static_cast(&QComboBox::currentIndexChanged), this, + &VLineColorProperty::currentIndexChanged); + + VProperty::d_ptr->editor = tmpEditor; + return VProperty::d_ptr->editor; +} + +QVariant VLineColorProperty::getEditorData(const QWidget *editor) const +{ + const QComboBox* tmpEditor = qobject_cast(editor); + if (tmpEditor) + { + return tmpEditor->currentIndex(); + } + + return QVariant(0); +} + +void VLineColorProperty::setColors(const QMap &colors) +{ + this->colors = colors; + indexList.clear(); + QMap::const_iterator i = colors.constBegin(); + while (i != colors.constEnd()) + { + indexList.append(i.key()); + ++i; + } +} + +QMap VLineColorProperty::getColors() const +{ + return colors; +} + +void VLineColorProperty::setValue(const QVariant &value) +{ + int tmpIndex = value.toInt(); + + if (tmpIndex < 0 || tmpIndex >= indexList.count()) + { + tmpIndex = 0; + } + + VProperty::d_ptr->VariantValue = tmpIndex; + VProperty::d_ptr->VariantValue.convert(QVariant::Int); + + if (VProperty::d_ptr->editor != nullptr) + { + setEditorData(VProperty::d_ptr->editor); + } +} + +QString VLineColorProperty::type() const +{ + return QStringLiteral("lineColor"); +} + +VProperty *VLineColorProperty::clone(bool include_children, VProperty *container) const +{ + return VProperty::clone(include_children, container ? container : new VLineColorProperty(getName())); +} + +int VLineColorProperty::IndexOfColor(const QMap &colors, const QString &color) +{ + QVector indexList; + QMap::const_iterator i = colors.constBegin(); + while (i != colors.constEnd()) + { + indexList.append(i.key()); + ++i; + } + return indexList.indexOf(color); +} + +void VLineColorProperty::currentIndexChanged(int index) +{ + Q_UNUSED(index) + UserChangeEvent *event = new UserChangeEvent(); + QCoreApplication::postEvent ( VProperty::d_ptr->editor, event ); +} diff --git a/src/libs/vpropertyexplorer/plugins/vlinecolorproperty.h b/src/libs/vpropertyexplorer/plugins/vlinecolorproperty.h new file mode 100644 index 000000000..f68c20f29 --- /dev/null +++ b/src/libs/vpropertyexplorer/plugins/vlinecolorproperty.h @@ -0,0 +1,100 @@ +/************************************************************************ + ** + ** @file vlinecolorproperty.h + ** @author Roman Telezhynskyi + ** @date 7 2, 2015 + ** + ** @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-2015 Valentina project + ** 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 . + ** + *************************************************************************/ + +#ifndef VLINECOLORPROPERTY_H +#define VLINECOLORPROPERTY_H + +#include "../vproperty.h" + +#include +#include + +namespace VPE +{ + +class VPROPERTYEXPLORERSHARED_EXPORT VLineColorProperty : public VProperty +{ + Q_OBJECT +public: + //! Constructor + VLineColorProperty(const QString& name); + + //! Destructor + ~VLineColorProperty() {} + + //! Get the data how it should be displayed + virtual QVariant data (int column = DPC_Name, int role = Qt::DisplayRole) const; + + //! Returns an editor widget, or NULL if it doesn't supply one + //! \param parent The widget to which the editor will be added as a child + //! \options Render options + //! \delegate A pointer to the QAbstractItemDelegate requesting the editor. This can be used to connect signals and + //! slots. + virtual QWidget *createEditor(QWidget* parent, const QStyleOptionViewItem& options, + const QAbstractItemDelegate* delegate); + + //! Gets the data from the widget + virtual QVariant getEditorData(const QWidget* editor) const; + + //! Sets the colors + virtual void setColors(const QMap &colors); + + //! Get the settings. This function has to be implemented in a subclass in order to have an effect + virtual QMap getColors() const; + + //! Sets the value of the property + virtual void setValue(const QVariant& value); + + //! Returns a string containing the type of the property + virtual QString type() const; + + //! Clones this property + //! \param include_children Indicates whether to also clone the children + //! \param container If a property is being passed here, no new VProperty is being created but instead it is tried + //! to fill all the data into container. This can also be used when subclassing this function. + //! \return Returns the newly created property (or container, if it was not NULL) + virtual VProperty* clone(bool include_children = true, VProperty* container = nullptr) const; + + static int IndexOfColor(const QMap &colors, const QString &color); + +public slots: + void currentIndexChanged(int index); + +protected: + //! The list of possible options to choose from + QMap colors; + QVector indexList; + // No use of d-pointer in this case, because it is unlikely this will change. If it does, we can still add other + //members by reimplementing the VPropertyPrivate class without touching this header file. +private: + Q_DISABLE_COPY(VLineColorProperty) +}; + +} + +#endif // VLINECOLORPROPERTY_H diff --git a/src/libs/vpropertyexplorer/plugins/vlinetypeproperty.cpp b/src/libs/vpropertyexplorer/plugins/vlinetypeproperty.cpp new file mode 100644 index 000000000..558e40ec1 --- /dev/null +++ b/src/libs/vpropertyexplorer/plugins/vlinetypeproperty.cpp @@ -0,0 +1,172 @@ +/************************************************************************ + ** + ** @file vlinetypeproperty.cpp + ** @author Roman Telezhynskyi + ** @date 29 1, 2015 + ** + ** @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-2015 Valentina project + ** 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 . + ** + *************************************************************************/ + +#include "vlinetypeproperty.h" +#include "../vproperty_p.h" + +#include +#include + +using namespace VPE; + +VLineTypeProperty::VLineTypeProperty(const QString &name) + : VProperty(name, QVariant::Int), styles(), indexList() +{ + VProperty::d_ptr->VariantValue = 0; + VProperty::d_ptr->VariantValue.convert(QVariant::Int); +} + +QVariant VLineTypeProperty::data(int column, int role) const +{ + if (styles.empty()) + { + return QVariant(); + } + + int tmpIndex = VProperty::d_ptr->VariantValue.toInt(); + + if (tmpIndex < 0 || tmpIndex >= indexList.count()) + { + tmpIndex = 0; + } + + if (column == DPC_Data && Qt::DisplayRole == role) + { + return indexList.at(tmpIndex); + } + else if (column == DPC_Data && Qt::EditRole == role) + { + return tmpIndex; + } + else + { + return VProperty::data(column, role); + } +} + +QWidget *VLineTypeProperty::createEditor(QWidget *parent, const QStyleOptionViewItem &options, + const QAbstractItemDelegate *delegate) +{ + Q_UNUSED(options); + Q_UNUSED(delegate); + QComboBox* tmpEditor = new QComboBox(parent); + tmpEditor->clear(); + tmpEditor->setLocale(parent->locale()); + tmpEditor->setIconSize(QSize(80, 14)); + tmpEditor->setMinimumWidth(80); + tmpEditor->setMaximumWidth(110); + + QMap::const_iterator i = styles.constBegin(); + while (i != styles.constEnd()) + { + tmpEditor->addItem(i.value(), "", QVariant(i.key())); + ++i; + } + + tmpEditor->setCurrentIndex(VProperty::d_ptr->VariantValue.toInt()); + connect(tmpEditor, static_cast(&QComboBox::currentIndexChanged), this, + &VLineTypeProperty::currentIndexChanged); + + VProperty::d_ptr->editor = tmpEditor; + return VProperty::d_ptr->editor; +} + +QVariant VLineTypeProperty::getEditorData(const QWidget *editor) const +{ + const QComboBox* tmpEditor = qobject_cast(editor); + if (tmpEditor) + { + return tmpEditor->currentIndex(); + } + + return QVariant(0); +} + +void VLineTypeProperty::setStyles(const QMap &styles) +{ + this->styles = styles; + indexList.clear(); + QMap::const_iterator i = styles.constBegin(); + while (i != styles.constEnd()) + { + indexList.append(i.key()); + ++i; + } +} + +QMap VLineTypeProperty::getStyles() const +{ + return styles; +} + +void VLineTypeProperty::setValue(const QVariant &value) +{ + int tmpIndex = value.toInt(); + + if (tmpIndex < 0 || tmpIndex >= indexList.count()) + { + tmpIndex = 0; + } + + VProperty::d_ptr->VariantValue = tmpIndex; + VProperty::d_ptr->VariantValue.convert(QVariant::Int); + + if (VProperty::d_ptr->editor != nullptr) + { + setEditorData(VProperty::d_ptr->editor); + } +} + +QString VLineTypeProperty::type() const +{ + return QStringLiteral("lineType"); +} + +VProperty *VLineTypeProperty::clone(bool include_children, VProperty *container) const +{ + return VProperty::clone(include_children, container ? container : new VLineTypeProperty(getName())); +} + +int VLineTypeProperty::IndexOfStyle(const QMap &styles, const QString &style) +{ + QVector indexList; + QMap::const_iterator i = styles.constBegin(); + while (i != styles.constEnd()) + { + indexList.append(i.key()); + ++i; + } + return indexList.indexOf(style); +} + +void VLineTypeProperty::currentIndexChanged(int index) +{ + Q_UNUSED(index) + UserChangeEvent *event = new UserChangeEvent(); + QCoreApplication::postEvent ( VProperty::d_ptr->editor, event ); +} diff --git a/src/libs/vpropertyexplorer/plugins/vlinetypeproperty.h b/src/libs/vpropertyexplorer/plugins/vlinetypeproperty.h new file mode 100644 index 000000000..3942cf140 --- /dev/null +++ b/src/libs/vpropertyexplorer/plugins/vlinetypeproperty.h @@ -0,0 +1,101 @@ +/************************************************************************ + ** + ** @file vlinetypeproperty.h + ** @author Roman Telezhynskyi + ** @date 29 1, 2015 + ** + ** @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-2015 Valentina project + ** 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 . + ** + *************************************************************************/ + +#ifndef VLINETYPEPROPERTY_H +#define VLINETYPEPROPERTY_H + +#include "../vproperty.h" + +#include +#include +#include + +namespace VPE +{ + +class VPROPERTYEXPLORERSHARED_EXPORT VLineTypeProperty : public VProperty +{ + Q_OBJECT +public: + //! Constructor + VLineTypeProperty(const QString& name); + + //! Destructor + ~VLineTypeProperty() {} + + //! Get the data how it should be displayed + virtual QVariant data (int column = DPC_Name, int role = Qt::DisplayRole) const; + + //! Returns an editor widget, or NULL if it doesn't supply one + //! \param parent The widget to which the editor will be added as a child + //! \options Render options + //! \delegate A pointer to the QAbstractItemDelegate requesting the editor. This can be used to connect signals and + //! slots. + virtual QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& options, + const QAbstractItemDelegate* delegate); + + //! Gets the data from the widget + virtual QVariant getEditorData(const QWidget* editor) const; + + //! Sets the line styles + virtual void setStyles(const QMap &styles); + + //! Get the settings. This function has to be implemented in a subclass in order to have an effect + virtual QMap getStyles() const; + + //! Sets the value of the property + virtual void setValue(const QVariant& value); + + //! Returns a string containing the type of the property + virtual QString type() const; + + //! Clones this property + //! \param include_children Indicates whether to also clone the children + //! \param container If a property is being passed here, no new VProperty is being created but instead it is tried + //! to fill all the data into container. This can also be used when subclassing this function. + //! \return Returns the newly created property (or container, if it was not NULL) + virtual VProperty* clone(bool include_children = true, VProperty* container = nullptr) const; + + static int IndexOfStyle(const QMap &styles, const QString &style); + +public slots: + void currentIndexChanged(int index); + +protected: + //! The list of possible options to choose from + QMap styles; + QVector indexList; + // No use of d-pointer in this case, because it is unlikely this will change. If it does, we can still add other + //members by reimplementing the VPropertyPrivate class without touching this header file. +private: + Q_DISABLE_COPY(VLineTypeProperty) +}; + +} + +#endif // VLINETYPEPROPERTY_H diff --git a/src/libs/vpropertyexplorer/plugins/vnumberproperty.cpp b/src/libs/vpropertyexplorer/plugins/vnumberproperty.cpp index b86def022..65ee10a1a 100644 --- a/src/libs/vpropertyexplorer/plugins/vnumberproperty.cpp +++ b/src/libs/vpropertyexplorer/plugins/vnumberproperty.cpp @@ -56,6 +56,7 @@ QWidget* VIntegerProperty::createEditor(QWidget * parent, const QStyleOptionView Q_UNUSED(delegate); QSpinBox* tmpEditor = new QSpinBox(parent); + tmpEditor->setLocale(parent->locale()); tmpEditor->setMinimum(static_cast(minValue)); tmpEditor->setMaximum(static_cast(maxValue)); tmpEditor->setSingleStep(static_cast(singleStep)); @@ -162,6 +163,7 @@ QWidget* VDoubleProperty::createEditor(QWidget * parent, const QStyleOptionViewI Q_UNUSED(options); Q_UNUSED(delegate); QDoubleSpinBox* tmpEditor = new QDoubleSpinBox(parent); + tmpEditor->setLocale(parent->locale()); tmpEditor->setMinimum(minValue); tmpEditor->setMaximum(maxValue); tmpEditor->setDecimals(Precision); diff --git a/src/libs/vpropertyexplorer/plugins/vobjectproperty.cpp b/src/libs/vpropertyexplorer/plugins/vobjectproperty.cpp index 513d8d812..d117e764e 100644 --- a/src/libs/vpropertyexplorer/plugins/vobjectproperty.cpp +++ b/src/libs/vpropertyexplorer/plugins/vobjectproperty.cpp @@ -64,6 +64,7 @@ QWidget* VObjectProperty::createEditor(QWidget * parent, const QStyleOptionViewI Q_UNUSED(delegate); QComboBox* tmpEditor = new QComboBox(parent); tmpEditor->clear(); + tmpEditor->setLocale(parent->locale()); FillList(tmpEditor, objects); tmpEditor->setCurrentIndex(tmpEditor->findData(VProperty::d_ptr->VariantValue.toUInt())); connect(tmpEditor, static_cast(&QComboBox::currentIndexChanged), this, diff --git a/src/libs/vpropertyexplorer/plugins/vshortcutproperty.cpp b/src/libs/vpropertyexplorer/plugins/vshortcutproperty.cpp index f51346d54..6d10a23f2 100644 --- a/src/libs/vpropertyexplorer/plugins/vshortcutproperty.cpp +++ b/src/libs/vpropertyexplorer/plugins/vshortcutproperty.cpp @@ -61,7 +61,7 @@ QWidget* VShortcutProperty::createEditor(QWidget * parent, const QStyleOptionVie { VShortcutEditWidget::connect(tmpWidget, SIGNAL(commitData(QWidget*)), delegate, SIGNAL(commitData(QWidget*))); } - + tmpWidget->setLocale(parent->locale()); return tmpWidget; } diff --git a/src/libs/vpropertyexplorer/plugins/vstringproperty.cpp b/src/libs/vpropertyexplorer/plugins/vstringproperty.cpp index d4bac678c..08341ded4 100644 --- a/src/libs/vpropertyexplorer/plugins/vstringproperty.cpp +++ b/src/libs/vpropertyexplorer/plugins/vstringproperty.cpp @@ -50,6 +50,7 @@ QWidget *VPE::VStringProperty::createEditor(QWidget *parent, const QStyleOptionV Q_UNUSED(delegate); QLineEdit* tmpEditor = new QLineEdit(parent); + tmpEditor->setLocale(parent->locale()); tmpEditor->setReadOnly(readOnly); tmpEditor->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); tmpEditor->setText(d_ptr->VariantValue.toString()); diff --git a/src/libs/vpropertyexplorer/vproperties.h b/src/libs/vpropertyexplorer/vproperties.h index f1c531f27..a86299421 100644 --- a/src/libs/vpropertyexplorer/vproperties.h +++ b/src/libs/vpropertyexplorer/vproperties.h @@ -26,6 +26,7 @@ #include "plugins/vcolorproperty.h" #include "plugins/Vector3d/vvector3dproperty.h" #include "plugins/vemptyproperty.h" +#include "plugins/vlinetypeproperty.h" #include "plugins/venumproperty.h" #include "plugins/vfileproperty.h" #include "plugins/vnumberproperty.h" @@ -34,5 +35,6 @@ #include "plugins/vshortcutproperty.h" #include "plugins/vstringproperty.h" #include "plugins/vwidgetproperty.h" +#include "plugins/vlinecolorproperty.h" #endif // VPROPERTIES_H diff --git a/src/libs/vpropertyexplorer/vpropertyexplorer.pri b/src/libs/vpropertyexplorer/vpropertyexplorer.pri index d5ab89175..eb38f6dcc 100644 --- a/src/libs/vpropertyexplorer/vpropertyexplorer.pri +++ b/src/libs/vpropertyexplorer/vpropertyexplorer.pri @@ -1,70 +1,76 @@ -# ADD TO EACH PATH $$PWD VARIABLE!!!!!! -# This need for corect working file translations.pro - -SOURCES += \ - $$PWD/vproperty.cpp \ - $$PWD/vpropertydelegate.cpp \ - $$PWD/vpropertyfactorymanager.cpp \ - $$PWD/vpropertyformview.cpp \ - $$PWD/vpropertyformwidget.cpp \ - $$PWD/vpropertymodel.cpp \ - $$PWD/vpropertyset.cpp \ - $$PWD/vpropertytreeview.cpp \ - $$PWD/vserializedproperty.cpp \ - $$PWD/plugins/vwidgetproperty.cpp \ - $$PWD/plugins/vemptyproperty.cpp \ - $$PWD/plugins/vboolproperty.cpp \ - $$PWD/plugins/vshortcutproperty.cpp \ - $$PWD/plugins/vcolorproperty.cpp \ - $$PWD/plugins/vshortcutpropertyeditor.cpp \ - $$PWD/plugins/venumproperty.cpp \ - $$PWD/plugins/vfileproperty.cpp \ - $$PWD/plugins/vcolorpropertyeditor.cpp \ - $$PWD/plugins/vfilepropertyeditor.cpp \ - $$PWD/plugins/vnumberproperty.cpp \ - $$PWD/plugins/Vector3d/vvector3dproperty.cpp \ - $$PWD/vstandardpropertyfactory.cpp \ - $$PWD/plugins/vstringproperty.cpp \ - $$PWD/plugins/vpointfproperty.cpp \ - $$PWD/plugins/vobjectproperty.cpp \ - $$PWD/stable.cpp - -HEADERS +=\ - $$PWD/vpropertyexplorer_global.h \ - $$PWD/vpropertyfactorymanager_p.h \ - $$PWD/vpropertytreeview_p.h \ - $$PWD/vpropertyset_p.h \ - $$PWD/vabstractpropertyfactory.h \ - $$PWD/vfileproperty_p.h \ - $$PWD/vwidgetproperty_p.h \ - $$PWD/vpropertymodel_p.h \ - $$PWD/vstandardpropertyfactory.h \ - $$PWD/vpropertyformview_p.h \ - $$PWD/vpropertytreeview.h \ - $$PWD/vpropertyformwidget_p.h \ - $$PWD/vpropertydelegate.h \ - $$PWD/vproperty_p.h \ - $$PWD/vpropertyformwidget.h \ - $$PWD/vpropertyformview.h \ - $$PWD/vpropertyset.h \ - $$PWD/vpropertymodel.h \ - $$PWD/vproperty.h \ - $$PWD/plugins/vwidgetproperty.h \ - $$PWD/plugins/vcolorproperty.h \ - $$PWD/plugins/vboolproperty.h \ - $$PWD/plugins/vcolorpropertyeditor.h \ - $$PWD/plugins/vshortcutpropertyeditor.h \ - $$PWD/plugins/vemptyproperty.h \ - $$PWD/plugins/vshortcutproperty.h \ - $$PWD/plugins/venumproperty.h \ - $$PWD/plugins/vfilepropertyeditor.h \ - $$PWD/plugins/vfileproperty.h \ - $$PWD/plugins/vnumberproperty.h \ - $$PWD/plugins/Vector3d/vvector3dproperty.h \ - $$PWD/vpropertyfactorymanager.h \ - $$PWD/vserializedproperty.h \ - $$PWD/plugins/vstringproperty.h \ - $$PWD/plugins/vpointfproperty.h \ - $$PWD/plugins/vobjectproperty.h \ - $$PWD/vproperties.h \ - $$PWD/stable.h +# ADD TO EACH PATH $$PWD VARIABLE!!!!!! +# This need for corect working file translations.pro + +SOURCES += \ + $$PWD/vproperty.cpp \ + $$PWD/vpropertydelegate.cpp \ + $$PWD/vpropertyfactorymanager.cpp \ + $$PWD/vpropertyformview.cpp \ + $$PWD/vpropertyformwidget.cpp \ + $$PWD/vpropertymodel.cpp \ + $$PWD/vpropertyset.cpp \ + $$PWD/vpropertytreeview.cpp \ + $$PWD/vserializedproperty.cpp \ + $$PWD/plugins/vwidgetproperty.cpp \ + $$PWD/plugins/vemptyproperty.cpp \ + $$PWD/plugins/vboolproperty.cpp \ + $$PWD/plugins/vshortcutproperty.cpp \ + $$PWD/plugins/vcolorproperty.cpp \ + $$PWD/plugins/vshortcutpropertyeditor.cpp \ + $$PWD/plugins/venumproperty.cpp \ + $$PWD/plugins/vfileproperty.cpp \ + $$PWD/plugins/vcolorpropertyeditor.cpp \ + $$PWD/plugins/vfilepropertyeditor.cpp \ + $$PWD/plugins/vnumberproperty.cpp \ + $$PWD/plugins/Vector3d/vvector3dproperty.cpp \ + $$PWD/vstandardpropertyfactory.cpp \ + $$PWD/plugins/vstringproperty.cpp \ + $$PWD/plugins/vpointfproperty.cpp \ + $$PWD/plugins/vobjectproperty.cpp \ + $$PWD/stable.cpp \ + $$PWD/plugins/vlinetypeproperty.cpp \ + $$PWD/plugins/vlinecolorproperty.cpp \ + $$PWD/checkablemessagebox.cpp + +HEADERS +=\ + $$PWD/vpropertyexplorer_global.h \ + $$PWD/vpropertyfactorymanager_p.h \ + $$PWD/vpropertytreeview_p.h \ + $$PWD/vpropertyset_p.h \ + $$PWD/vabstractpropertyfactory.h \ + $$PWD/vfileproperty_p.h \ + $$PWD/vwidgetproperty_p.h \ + $$PWD/vpropertymodel_p.h \ + $$PWD/vstandardpropertyfactory.h \ + $$PWD/vpropertyformview_p.h \ + $$PWD/vpropertytreeview.h \ + $$PWD/vpropertyformwidget_p.h \ + $$PWD/vpropertydelegate.h \ + $$PWD/vproperty_p.h \ + $$PWD/vpropertyformwidget.h \ + $$PWD/vpropertyformview.h \ + $$PWD/vpropertyset.h \ + $$PWD/vpropertymodel.h \ + $$PWD/vproperty.h \ + $$PWD/plugins/vwidgetproperty.h \ + $$PWD/plugins/vcolorproperty.h \ + $$PWD/plugins/vboolproperty.h \ + $$PWD/plugins/vcolorpropertyeditor.h \ + $$PWD/plugins/vshortcutpropertyeditor.h \ + $$PWD/plugins/vemptyproperty.h \ + $$PWD/plugins/vshortcutproperty.h \ + $$PWD/plugins/venumproperty.h \ + $$PWD/plugins/vfilepropertyeditor.h \ + $$PWD/plugins/vfileproperty.h \ + $$PWD/plugins/vnumberproperty.h \ + $$PWD/plugins/Vector3d/vvector3dproperty.h \ + $$PWD/vpropertyfactorymanager.h \ + $$PWD/vserializedproperty.h \ + $$PWD/plugins/vstringproperty.h \ + $$PWD/plugins/vpointfproperty.h \ + $$PWD/plugins/vobjectproperty.h \ + $$PWD/vproperties.h \ + $$PWD/stable.h \ + $$PWD/plugins/vlinetypeproperty.h \ + $$PWD/plugins/vlinecolorproperty.h \ + $$PWD/checkablemessagebox.h diff --git a/src/test/ParserTest/main.cpp b/src/test/ParserTest/main.cpp index 6239835c8..d53e71096 100644 --- a/src/test/ParserTest/main.cpp +++ b/src/test/ParserTest/main.cpp @@ -8,7 +8,7 @@ ** @copyright ** This source code is part of the Valentine project, a pattern making ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2014 Valentina project + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/test/ParserTest/stable.cpp b/src/test/ParserTest/stable.cpp index 243b23938..e291c2801 100644 --- a/src/test/ParserTest/stable.cpp +++ b/src/test/ParserTest/stable.cpp @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify diff --git a/src/test/ParserTest/stable.h b/src/test/ParserTest/stable.h index 4d9dd80f4..b4f802c0a 100644 --- a/src/test/ParserTest/stable.h +++ b/src/test/ParserTest/stable.h @@ -8,7 +8,7 @@ ** @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 + ** Copyright (C) 2013-2015 Valentina project ** All Rights Reserved. ** ** Valentina is free software: you can redistribute it and/or modify