From 3e4c53153801e63b480227da1463b58b164d288e Mon Sep 17 00:00:00 2001 From: K1rillProkhorov Date: Wed, 10 Apr 2024 01:18:40 +0300 Subject: [PATCH] Add default parametrs and new gradient types --- DesktopEditor/graphics/shading_info.h | 20 +- .../gradient/Gradient/mainwindow.cpp | 753 +++++- .../gradient/Gradient/mainwindow.h | 141 +- .../gradient/Gradient/mainwindow.ui | 2153 +++++++++++++++-- 4 files changed, 2775 insertions(+), 292 deletions(-) diff --git a/DesktopEditor/graphics/shading_info.h b/DesktopEditor/graphics/shading_info.h index d89524767b..9e0323a0ab 100644 --- a/DesktopEditor/graphics/shading_info.h +++ b/DesktopEditor/graphics/shading_info.h @@ -468,13 +468,13 @@ namespace NSStructures { GradientInfo ginfo; ginfo.shading.triangle = points; + ginfo.shading.f_type = ShadingInfo::UseNew; ginfo.shading.function = ColorFunction(256, t0, t1); ginfo.continue_shading_f = false; ginfo.continue_shading_b = false; if (parametric) { ginfo.shading.triangle_parameters = params; - ginfo.shading.f_type = ShadingInfo::UseNew; ginfo.shading.shading_type = ShadingInfo::Parametric; } else @@ -513,7 +513,10 @@ namespace NSStructures ginfo.shading.patch[2][0] = curve_points[10]; ginfo.shading.patch[1][0] = curve_points[11]; - + ginfo.shading.f_type = ShadingInfo::UseNew; + ginfo.shading.function = ColorFunction(256, t0, t1); + ginfo.continue_shading_f = false; + ginfo.continue_shading_b = false; if (parametric) { @@ -522,11 +525,7 @@ namespace NSStructures ginfo.shading.patch_parameters[0][1] = curve_parametrs[1]; ginfo.shading.patch_parameters[1][0] = curve_parametrs[3]; ginfo.shading.patch_parameters[1][1] = curve_parametrs[2]; - ginfo.shading.f_type = ShadingInfo::UseNew; - ginfo.shading.function = ColorFunction(256, t0, t1); ginfo.shading.shading_type = ShadingInfo::Parametric; - ginfo.continue_shading_f = false; - ginfo.continue_shading_b = false; } else { @@ -549,14 +548,15 @@ namespace NSStructures ginfo.shading.patch = curve_poits; + ginfo.shading.f_type = ShadingInfo::UseNew; + ginfo.shading.function = ColorFunction(256, t0, t1); + ginfo.continue_shading_f = false; + ginfo.continue_shading_b = false; + if (parametric) { ginfo.shading.patch_parameters = curve_parametrs; - ginfo.shading.f_type = ShadingInfo::UseNew; - ginfo.shading.function = ColorFunction(256, t0, t1); ginfo.shading.shading_type = ShadingInfo::Parametric; - ginfo.continue_shading_f = false; - ginfo.continue_shading_b = false; } else { diff --git a/Test/Applications/gradient/Gradient/mainwindow.cpp b/Test/Applications/gradient/Gradient/mainwindow.cpp index eb666ddbc6..88fcd0c783 100644 --- a/Test/Applications/gradient/Gradient/mainwindow.cpp +++ b/Test/Applications/gradient/Gradient/mainwindow.cpp @@ -10,9 +10,11 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi { ui->setupUi(this); ui->lable_test->setStyleSheet("QLabel { background-color : white;}"); - points = {{0, 0}, {500, 0}, {500, 500}, {0, 500}}; ui->stackedWidget->setCurrentIndex(0); + ui->stackedWidget_2->setCurrentIndex(0); ui->statusbar->showMessage("Linear"); + ui->Rainbow_Colorspace_Radio_Button->setChecked(true); + info.colorspace = Rainbow; } MainWindow::~MainWindow() @@ -86,35 +88,84 @@ QImage GenerateImg(std::vector &points, Info &info, const int& w, const i return img; } -bool parametric = false; - void MainWindow::on_actionLinear_Gradient_triggered() { ui->stackedWidget->setCurrentIndex(0); + ui->stackedWidget_2->setCurrentIndex(0); ui->statusbar->showMessage("Linear"); + info.gradient = Linear; info.gradient_type = c_BrushTypePathNewLinearGradient; + points = {{0, 0}, {500, 0}, {500, 500}, {0, 500}}; } void MainWindow::on_actionRadial_Gradient_triggered() { ui->stackedWidget->setCurrentIndex(1); + ui->stackedWidget_2->setCurrentIndex(1); ui->statusbar->showMessage("Radial"); + info.gradient = Radial; info.gradient_type = c_BrushTypePathRadialGradient; + points = {{0, 0}, {500, 0}, {500, 500}, {0, 500}}; } void MainWindow::on_actionTriangle_Gradient_triggered() { ui->stackedWidget->setCurrentIndex(2); + ui->stackedWidget_2->setCurrentIndex(2); ui->statusbar->showMessage("Triangle"); + info.gradient = Triangle; info.gradient_type = c_BrushTypeTriagnleMeshGradient; + points = {{0, 0}, {500, 0}, {500, 500}, {0, 500}}; } void MainWindow::on_actionTriangle_Parametric_Gradient_triggered() { - ui->stackedWidget->setCurrentIndex(3); + ui->stackedWidget->setCurrentIndex(2); + ui->stackedWidget_2->setCurrentIndex(3); ui->statusbar->showMessage("Triangle Parametric"); + info.gradient = TriangleParametric; info.gradient_type = c_BrushTypeTriagnleMeshGradient; - parametric = true; + points = {{0, 0}, {500, 0}, {500, 500}, {0, 500}}; +} + +void MainWindow::on_actionCoons_Patch_Gradient_triggered() +{ + ui->stackedWidget->setCurrentIndex(3); + ui->stackedWidget_2->setCurrentIndex(4); + ui->statusbar->showMessage("Coons Patch"); + info.gradient = CoonsPatch; + info.gradient_type = c_BrushTypePathNewLinearGradient; + points = {{0, 0}, {500, 0}, {500, 500}, {0, 500}}; +} + +void MainWindow::on_actionCoons_Patch_Parametric_triggered() +{ + ui->stackedWidget->setCurrentIndex(3); + ui->stackedWidget_2->setCurrentIndex(5); + ui->statusbar->showMessage("Coons Patch Parametric"); + info.gradient = CoonsPatchParametric; + info.gradient_type = c_BrushTypeCurveGradient; + points = {{0, 0}, {500, 0}, {500, 500}, {0, 500}}; +} + +void MainWindow::on_actionTensor_Coons_Patch_Gradient_triggered() +{ + ui->stackedWidget->setCurrentIndex(4); + ui->stackedWidget_2->setCurrentIndex(6); + ui->statusbar->showMessage("Tensor Coons Patch"); + info.gradient = TensorCoonsPatch; + info.gradient_type = c_BrushTypePathNewLinearGradient; + points = {{0, 0}, {500, 0}, {500, 500}, {0, 500}}; +} + +void MainWindow::on_actionTensor_Coons_Patch_Parametric_triggered() +{ + ui->stackedWidget->setCurrentIndex(4); + ui->stackedWidget_2->setCurrentIndex(7); + ui->statusbar->showMessage("Tensor Coons Patch Parametric"); + info.gradient = TensorCoonsPatchParametric; + info.gradient_type = c_BrushTypeTensorCurveGradient; + points = {{0, 0}, {500, 0}, {500, 500}, {0, 500}}; } void MainWindow::on_BAW_Colorspace_Radio_Button_clicked() @@ -138,7 +189,7 @@ void MainWindow::on_Rainbow_Colorspace_Radio_Button_clicked() void MainWindow::on_pushButton_clicked() { - if (info.gradient_type == c_BrushTypePathNewLinearGradient) + if (info.gradient == Linear) { if (ui->First_X_Coordinate_Input->text() == "") { @@ -166,7 +217,7 @@ void MainWindow::on_pushButton_clicked() info.p1.y = ui->Second_Y_Coordinate_Input->text().toInt(); info.ginfo = NSStructures::GInfoConstructor::get_linear(info.p0, info.p1, 0, 1, info.cont_b, info.cont_f); } - else if (info.gradient_type == c_BrushTypePathRadialGradient) + else if (info.gradient == Radial) { if (ui->First_Center_X_Coordinate_Input->text() == "") { @@ -206,7 +257,7 @@ void MainWindow::on_pushButton_clicked() info.r1 = ui->Second_Radius_Input->text().toInt(); info.ginfo = NSStructures::GInfoConstructor::get_radial(info.c0, info.c1, info.r0, info.r1, 0, 1, info.cont_b, info.cont_f); } - else if (info.gradient_type == c_BrushTypeTriagnleMeshGradient && !parametric) + else if (info.gradient == Triangle || info.gradient == TriangleParametric) { if (ui->First_Vertex_X_Coordinate_Input->text() == "") { @@ -244,58 +295,370 @@ void MainWindow::on_pushButton_clicked() return; } info.triangle[2].y = ui->Third_Vertex_Y_Coordinate_Input->text().toInt(); - info.ginfo = NSStructures::GInfoConstructor::get_triangle(info.triangle, {{255, 0, 0}, {0, 255, 0}, {0, 0, 255}}, {}, false); + info.ginfo = NSStructures::GInfoConstructor::get_triangle(info.triangle, + {{255, 0, 0}, {0, 255, 0}, {0, 0, 255}}, + {}, + info.gradient == TriangleParametric); points = {}; for (auto p : info.triangle) { points.push_back({p.x, p.y}); } } - else if (info.gradient_type = c_BrushTypeTriagnleMeshGradient && parametric) + else if (info.gradient == CoonsPatch || info.gradient == CoonsPatchParametric) { - if (ui->First_Vertex_X_Coordinate_Input_2->text() == "") + if (ui->First_Vertex_X_Coordinate_Input_3->text() == "") { - ui->statusbar->showMessage("First Vertex X coordinate = NULL"); + ui->statusbar->showMessage("First Vertex X Coordinate = NULL"); return; } - info.triangle[0].x = ui->First_Vertex_X_Coordinate_Input_2->text().toInt(); - if (ui->First_Vertex_Y_Coordinate_Input_2->text() == "") + info.curve[0].x = 5 * ui->First_Vertex_X_Coordinate_Input_3->text().toInt(); + if (ui->First_Vertex_Y_Coordinate_Input_3->text() == "") { - ui->statusbar->showMessage("First Vertex Y coordinate = NULL"); + ui->statusbar->showMessage("First Vertex Y Coordinate = NULL"); return; } - info.triangle[0].y = ui->First_Vertex_Y_Coordinate_Input_2->text().toInt(); - if (ui->Second_Vertex_X_Coordinate_Input_2->text() == "") + info.curve[0].y = 5 * ui->First_Vertex_Y_Coordinate_Input_3->text().toInt(); + if (ui->First_X_Coordinate_First_Edge->text() == "") { - ui->statusbar->showMessage("Second Vertex X coordinate = NULL"); + ui->statusbar->showMessage("First X Coordinate First Edge = NULL"); return; } - info.triangle[1].x = ui->Second_Vertex_X_Coordinate_Input_2->text().toInt(); - if (ui->Second_Vertex_Y_Coordinate_Input_2->text() == "") + info.curve[1].x = 5 * ui->First_X_Coordinate_First_Edge->text().toInt(); + if (ui->First_Y_Coordinate_First_Edge->text() == "") { - ui->statusbar->showMessage("Second Vertex Y coordinate = NULL"); + ui->statusbar->showMessage("First Y Coordinate First Edge = NULL"); return; } - info.triangle[1].y = ui->Second_Vertex_Y_Coordinate_Input_2->text().toInt(); - if (ui->Third_Vertex_X_Coordinate_Input_2->text() == "") + info.curve[1].y = 5 * ui->First_Y_Coordinate_First_Edge->text().toInt(); + if (ui->Second_X_Coordinate_First_Edge->text() == "") { - ui->statusbar->showMessage("Third Vertex X coordinate = NULL"); + ui->statusbar->showMessage("Second X Coordinate First Edge = NULL"); return; } - info.triangle[2].x = ui->Third_Vertex_X_Coordinate_Input_2->text().toInt(); - if (ui->Third_Vertex_Y_Coordinate_Input_2->text() == "") + info.curve[2].x = 5 * ui->Second_X_Coordinate_First_Edge->text().toInt(); + if (ui->Second_Y_Coordinate_First_Edge->text() == "") { - ui->statusbar->showMessage("Third Vertex Y coordinate = NULL"); + ui->statusbar->showMessage("Second Y Coordinate First Edge = NULL"); return; } - info.triangle[2].y = ui->Third_Vertex_Y_Coordinate_Input_2->text().toInt(); - info.ginfo = NSStructures::GInfoConstructor::get_triangle(info.triangle, {{255, 0, 0}, {0, 255, 0}, {0, 0, 255}}, - {0.f, 0.4f, 1.f}, true); - points = {}; - for (auto p : info.triangle) + info.curve[2].y = 5 * ui->Second_Y_Coordinate_First_Edge->text().toInt(); + if (ui->Second_Vertex_X_Coordinate_Input_3->text() == "") { - points.push_back({p.x, p.y}); + ui->statusbar->showMessage("Second Vertex X Coordinate = NULL"); + return; } + info.curve[3].x = 5 * ui->Second_Vertex_X_Coordinate_Input_3->text().toInt(); + if (ui->Second_Vertex_Y_Coordinate_Input_3->text() == "") + { + ui->statusbar->showMessage("Second Vertex Y Coordinate = NULL"); + return; + } + info.curve[3].y = 5 * ui->Second_Vertex_Y_Coordinate_Input_3->text().toInt(); + if (ui->First_X_Coordinate_Second_Edge->text() == "") + { + ui->statusbar->showMessage("First X Coordinate Second Edge = NULL"); + return; + } + info.curve[4].x = 5 * ui->First_X_Coordinate_Second_Edge->text().toInt(); + if (ui->First_Y_Coordinate_Second_Edge->text() == "") + { + ui->statusbar->showMessage("First Y Coordinate Second Edge = NULL"); + return; + } + info.curve[4].y = 5 * ui->First_Y_Coordinate_Second_Edge->text().toInt(); + if (ui->Second_X_Coordinate_Second_Edge->text() == "") + { + ui->statusbar->showMessage("Second X Coordinate Second Edge = NULL"); + return; + } + info.curve[5].x = 5 * ui->Second_X_Coordinate_Second_Edge->text().toInt(); + if (ui->Second_Y_Coordinate_Second_Edge->text() == "") + { + ui->statusbar->showMessage("Second Y Coordinate Second Edge = NULL"); + return; + } + info.curve[5].y = 5 * ui->Second_Y_Coordinate_Second_Edge->text().toInt(); + if (ui->Third_Vertex_X_Coordinate_Input_3->text() == "") + { + ui->statusbar->showMessage("Third Vertex X Coordinate = NULL"); + return; + } + info.curve[6].x = 5 * ui->Third_Vertex_X_Coordinate_Input_3->text().toInt(); + if (ui->Third_Vertex_Y_Coordinate_Input_3->text() == "") + { + ui->statusbar->showMessage("Third Vertex Y Coordinate = NULL"); + return; + } + info.curve[6].y = 5 * ui->Third_Vertex_Y_Coordinate_Input_3->text().toInt(); + if (ui->First_X_Coordinate_Third_Edge->text() == "") + { + ui->statusbar->showMessage("First X Coordinate Third Edge = NULL"); + return; + } + info.curve[7].x = 5 * ui->First_X_Coordinate_Third_Edge->text().toInt(); + if (ui->First_Y_Coordinate_Third_Edge->text() == "") + { + ui->statusbar->showMessage("First Y Coordinate Third Edge = NULL"); + return; + } + info.curve[7].y = 5 * ui->First_Y_Coordinate_Third_Edge->text().toInt(); + if (ui->Second_X_Coordinate_Third_Edge->text() == "") + { + ui->statusbar->showMessage("Second X Coordinate Third Edge = NULL"); + return; + } + info.curve[8].x = 5 * ui->Second_X_Coordinate_Third_Edge->text().toInt(); + if (ui->Second_Y_Coordinate_Third_Edge->text() == "") + { + ui->statusbar->showMessage("Second Y Coordinate Third Edge = NULL"); + return; + } + info.curve[8].y = 5 * ui->Second_Y_Coordinate_Third_Edge->text().toInt(); + if (ui->Fourth_Vertex_X_Coordinate_Input_3->text() == "") + { + ui->statusbar->showMessage("Fourth Vertex X Coordinate = NULL"); + return; + } + info.curve[9].x = 5 * ui->Fourth_Vertex_X_Coordinate_Input_3->text().toInt(); + if (ui->Fourth_Vertex_Y_Coordinate_Input_3->text() == "") + { + ui->statusbar->showMessage("Fourth Vertex Y Coordinate = NULL"); + return; + } + info.curve[9].y = 5 * ui->Fourth_Vertex_Y_Coordinate_Input_3->text().toInt(); + if (ui->First_X_Coordinate_Fourth_Edge->text() == "") + { + ui->statusbar->showMessage("First X Coordinate Fourth Edge = NULL"); + return; + } + info.curve[10].x = 5 * ui->First_X_Coordinate_Fourth_Edge->text().toInt(); + if (ui->First_Y_Coordinate_Fourth_Edge->text() == "") + { + ui->statusbar->showMessage("First Y Coordinate Fourth Edge = NULL"); + return; + } + info.curve[10].y = 5 * ui->First_Y_Coordinate_Fourth_Edge->text().toInt(); + if (ui->Second_X_Coordinate_Fourth_Edge->text() == "") + { + ui->statusbar->showMessage("Second X Coordinate Fourth Edge = NULL"); + return; + } + info.curve[11].x = 5 * ui->Second_X_Coordinate_Fourth_Edge->text().toInt(); + if (ui->Second_Y_Coordinate_Fourth_Edge->text() == "") + { + ui->statusbar->showMessage("Second Y Coordinate Fourth Edge = NULL"); + return; + } + info.curve[11].y = 5 * ui->Second_Y_Coordinate_Fourth_Edge->text().toInt(); + info.ginfo = NSStructures::GInfoConstructor::get_curve( + info.curve, + {0, 0.5, 1, 0.5}, + {{0, 0, 255}, {255, 0, 255}, + {255, 0, 0}, {0, 255, 0}}, + info.gradient == CoonsPatchParametric + ); + } + else if (info.gradient == TensorCoonsPatch || info.gradient == TensorCoonsPatchParametric) + { + if (ui->First_X_Coordinate_First_Edge_3->text() == "") + { + ui->statusbar->showMessage("First X Coordinate First Edge = NULL"); + return; + } + info.tensorcurve[0][0].x = 5 * ui->First_X_Coordinate_First_Edge_3->text().toInt(); + if (ui->First_Y_Coordinate_First_Edge_3->text() == "") + { + ui->statusbar->showMessage("First Y Coordinate First Edge = NULL"); + return; + } + info.tensorcurve[0][0].y = 5 * ui->First_Y_Coordinate_First_Edge_3->text().toInt(); + if (ui->Second_X_Coordinate_First_Edge_3->text() == "") + { + ui->statusbar->showMessage("Second X Coordinate First Edge = NULL"); + return; + } + info.tensorcurve[0][1].x = 5 * ui->Second_X_Coordinate_First_Edge_3->text().toInt(); + if (ui->Second_Y_Coordinate_First_Edge_3->text() == "") + { + ui->statusbar->showMessage("Second Y Coordinate First Edge = NULL"); + return; + } + info.tensorcurve[0][1].y = 5 * ui->Second_Y_Coordinate_First_Edge_3->text().toInt(); + if (ui->Third_X_Coordinate_First_Edge_3->text() == "") + { + ui->statusbar->showMessage("Third X Coordinate First Edge = NULL"); + return; + } + info.tensorcurve[0][2].x = 5 * ui->Third_X_Coordinate_First_Edge_3->text().toInt(); + if (ui->Third_Y_Coordinate_First_Edge_3->text() == "") + { + ui->statusbar->showMessage("Third Y Coordinate First Edge = NULL"); + return; + } + info.tensorcurve[0][2].y = 5 * ui->Third_Y_Coordinate_First_Edge_3->text().toInt(); + if (ui->Fourth_X_Coordinate_First_Edge_3->text() == "") + { + ui->statusbar->showMessage("Fourth X Coordinate First Edge = NULL"); + return; + } + info.tensorcurve[0][3].x = 5 * ui->Fourth_X_Coordinate_First_Edge_3->text().toInt(); + if (ui->Fourth_Y_Coordinate_First_Edge_3->text() == "") + { + ui->statusbar->showMessage("Fourth Y Coordinate First Edge = NULL"); + return; + } + info.tensorcurve[0][3].y = 5 * ui->Fourth_Y_Coordinate_First_Edge_3->text().toInt(); + if (ui->First_X_Coordinate_Second_Edge_3->text() == "") + { + ui->statusbar->showMessage("First X Coordinate Second Edge = NULL"); + return; + } + info.tensorcurve[1][0].x = 5 * ui->First_X_Coordinate_Second_Edge_3->text().toInt(); + if (ui->First_Vertex_Y_Coordinate_Input_3->text() == "") + { + ui->statusbar->showMessage("First Y Coordinate Second Edge = NULL"); + return; + } + info.tensorcurve[1][0].y = 5 * ui->First_Y_Coordinate_Second_Edge_3->text().toInt(); + if (ui->Second_X_Coordinate_Second_Edge_3->text() == "") + { + ui->statusbar->showMessage("Second X Coordinate Second Edge = NULL"); + return; + } + info.tensorcurve[1][1].x = 5 * ui->Second_X_Coordinate_Second_Edge_3->text().toInt(); + if (ui->Second_Y_Coordinate_Second_Edge_3->text() == "") + { + ui->statusbar->showMessage("Second Y Coordinate Second Edge = NULL"); + return; + } + info.tensorcurve[1][1].y = 5 * ui->Second_Y_Coordinate_Second_Edge_3->text().toInt(); + if (ui->Third_X_Coordinate_Second_Edge_3->text() == "") + { + ui->statusbar->showMessage("Third X Coordinate Second Edge = NULL"); + return; + } + info.tensorcurve[1][2].x = 5 * ui->Third_X_Coordinate_Second_Edge_3->text().toInt(); + if (ui->Third_Y_Coordinate_Second_Edge_3->text() == "") + { + ui->statusbar->showMessage("Third Y Coordinate Second Edge = NULL"); + return; + } + info.tensorcurve[1][2].y = 5 * ui->Third_Y_Coordinate_Second_Edge_3->text().toInt(); + if (ui->Fourth_X_Coordinate_Second_Edge_3->text() == "") + { + ui->statusbar->showMessage("Fourth X Coordinate Second Edge = NULL"); + return; + } + info.tensorcurve[1][3].x = 5 * ui->Fourth_X_Coordinate_Second_Edge_3->text().toInt(); + if (ui->Fourth_Y_Coordinate_Second_Edge_3->text() == "") + { + ui->statusbar->showMessage("Fourth Y Coordinate Second Edge = NULL"); + return; + } + info.tensorcurve[1][3].y = 5 * ui->Fourth_Y_Coordinate_Second_Edge_3->text().toInt(); + if (ui->First_X_Coordinate_Third_Edge_3->text() == "") + { + ui->statusbar->showMessage("First X Coordinate Third Edge = NULL"); + return; + } + info.tensorcurve[2][0].x = 5 * ui->First_X_Coordinate_Third_Edge_3->text().toInt(); + if (ui->First_Y_Coordinate_Third_Edge_3->text() == "") + { + ui->statusbar->showMessage("First Y Coordinate Third Edge = NULL"); + return; + } + info.tensorcurve[2][0].y = 5 * ui->First_Y_Coordinate_Third_Edge_3->text().toInt(); + if (ui->Second_X_Coordinate_Third_Edge_3->text() == "") + { + ui->statusbar->showMessage("Second X Coordinate Third Edge = NULL"); + return; + } + info.tensorcurve[2][1].x = 5 * ui->Second_Y_Coordinate_Third_Edge_3->text().toInt(); + if (ui->Second_Y_Coordinate_Third_Edge_3->text() == "") + { + ui->statusbar->showMessage("Second Y Coordinate Third Edge = NULL"); + return; + } + info.tensorcurve[2][1].y = 5 * ui->Second_Y_Coordinate_Third_Edge_3->text().toInt(); + if (ui->Third_X_Coordinate_Third_Edge_3->text() == "") + { + ui->statusbar->showMessage("Third X Coordinate Third Edge = NULL"); + return; + } + info.tensorcurve[2][2].x = 5 * ui->Third_X_Coordinate_Third_Edge_3->text().toInt(); + if (ui->Third_Y_Coordinate_Third_Edge_3->text() == "") + { + ui->statusbar->showMessage("Third Y Coordinate Third Edge = NULL"); + return; + } + info.tensorcurve[2][2].y = 5 * ui->Third_Y_Coordinate_Third_Edge_3->text().toInt(); + if (ui->Fourth_X_Coordinate_Third_Edge_3->text() == "") + { + ui->statusbar->showMessage("Fourth X Coordinate Third Edge = NULL"); + return; + } + info.tensorcurve[2][3].x = 5 * ui->Fourth_X_Coordinate_Third_Edge_3->text().toInt(); + if (ui->Fourth_Y_Coordinate_Third_Edge_3->text() == "") + { + ui->statusbar->showMessage("Fourth Y Coordinate Third Edge = NULL"); + return; + } + info.tensorcurve[2][3].y = 5 * ui->Fourth_Y_Coordinate_Third_Edge_3->text().toInt(); + if (ui->First_X_Coordinate_Fourth_Edge_3->text() == "") + { + ui->statusbar->showMessage("First X Coordinate Fourth Edge = NULL"); + return; + } + info.tensorcurve[3][0].x = 5 * ui->First_X_Coordinate_Fourth_Edge_3->text().toInt(); + if (ui->First_Y_Coordinate_Fourth_Edge_3->text() == "") + { + ui->statusbar->showMessage("First Y Coordinate Fourth Edge = NULL"); + return; + } + info.tensorcurve[3][0].y = 5 * ui->First_Y_Coordinate_Fourth_Edge_3->text().toInt(); + if (ui->Second_X_Coordinate_Fourth_Edge_3->text() == "") + { + ui->statusbar->showMessage("Second X Coordinate Fourth Edge = NULL"); + return; + } + info.tensorcurve[3][1].x = 5 * ui->Second_X_Coordinate_Fourth_Edge_3->text().toInt(); + if (ui->Second_Y_Coordinate_Fourth_Edge_3->text() == "") + { + ui->statusbar->showMessage("Second Y Coordinate Fourth Edge = NULL"); + return; + } + info.tensorcurve[3][1].y = 5 * ui->Second_Y_Coordinate_Fourth_Edge_3->text().toInt(); + if (ui->Third_X_Coordinate_Fourth_Edge_3->text() == "") + { + ui->statusbar->showMessage("Third X Coordinate Fourth Edge = NULL"); + return; + } + info.tensorcurve[3][2].x = 5 * ui->Third_X_Coordinate_Fourth_Edge_3->text().toInt(); + if (ui->Third_Y_Coordinate_Fourth_Edge_3->text() == "") + { + ui->statusbar->showMessage("Third X Coordinate Fourth Edge = NULL"); + return; + } + info.tensorcurve[3][2].y = 5 * ui->Third_Y_Coordinate_Fourth_Edge_3->text().toInt(); + if (ui->Fourth_X_Coordinate_Fourth_Edge_3->text() == "") + { + ui->statusbar->showMessage("Fourth X Coordinate Fourth Edge = NULL"); + return; + } + info.tensorcurve[3][3].x = 5 * ui->Fourth_X_Coordinate_Fourth_Edge_3->text().toInt(); + if (ui->Fourth_Y_Coordinate_Fourth_Edge_3->text() == "") + { + ui->statusbar->showMessage("Fourth Y Coordinate Fourth Edge = NULL"); + return; + } + info.tensorcurve[3][3].y = 5 * ui->Fourth_Y_Coordinate_Fourth_Edge_3->text().toInt(); + info.ginfo = NSStructures::GInfoConstructor::get_tensor_curve( + info.tensorcurve, + {{0, 0.5}, {1, 0.5}}, + {{{0, 0, 255}, {255, 0, 255}}, {{255, 0, 0}, {0, 255, 0}}}, + info.gradient == TensorCoonsPatchParametric + ); } if (info.colorspace == NoColorspaceType) @@ -451,38 +814,338 @@ void MainWindow::on_Third_Vertex_Y_Coordinate_Input_editingFinished() } -void MainWindow::on_First_Vertex_X_Coordinate_Input_2_editingFinished() +void MainWindow::on_First_Vertex_X_Coordinate_Input_3_editingFinished() { - ClampCoords(ui->First_Vertex_X_Coordinate_Input_2); + ClampCoords(ui->First_Vertex_X_Coordinate_Input_3); } -void MainWindow::on_First_Vertex_Y_Coordinate_Input_2_editingFinished() +void MainWindow::on_First_Vertex_Y_Coordinate_Input_3_editingFinished() { - ClampCoords(ui->First_Vertex_Y_Coordinate_Input_2); + ClampCoords(ui->First_Vertex_Y_Coordinate_Input_3); } -void MainWindow::on_Second_Vertex_X_Coordinate_Input_2_editingFinished() +void MainWindow::on_Second_Vertex_X_Coordinate_Input_3_editingFinished() { - ClampCoords(ui->Second_Vertex_X_Coordinate_Input_2); + ClampCoords(ui->Second_Vertex_X_Coordinate_Input_3); } -void MainWindow::on_Second_Vertex_Y_Coordinate_Input_2_editingFinished() +void MainWindow::on_Second_Vertex_Y_Coordinate_Input_3_editingFinished() { - ClampCoords(ui->Second_Vertex_Y_Coordinate_Input_2); + ClampCoords(ui->Second_Vertex_Y_Coordinate_Input_3); } -void MainWindow::on_Third_Vertex_X_Coordinate_Input_2_editingFinished() +void MainWindow::on_Third_Vertex_X_Coordinate_Input_3_editingFinished() { - ClampCoords(ui->Third_Vertex_X_Coordinate_Input_2); + ClampCoords(ui->Third_Vertex_X_Coordinate_Input_3); } -void MainWindow::on_Third_Vertex_Y_Coordinate_Input_2_editingFinished() +void MainWindow::on_Third_Vertex_Y_Coordinate_Input_3_editingFinished() { - ClampCoords(ui->Third_Vertex_Y_Coordinate_Input_2); + ClampCoords(ui->Third_Vertex_Y_Coordinate_Input_3); +} + + +void MainWindow::on_Fourth_Vertex_X_Coordinate_Input_3_editingFinished() +{ + ClampCoords(ui->Fourth_Vertex_X_Coordinate_Input_3); +} + + +void MainWindow::on_Fourth_Vertex_Y_Coordinate_Input_3_editingFinished() +{ + ClampCoords(ui->Fourth_Vertex_Y_Coordinate_Input_3); +} + + +void MainWindow::on_First_X_Coordinate_First_Edge_editingFinished() +{ + ClampCoords(ui->First_X_Coordinate_First_Edge); +} + + +void MainWindow::on_First_Y_Coordinate_First_Edge_editingFinished() +{ + ClampCoords(ui->First_Y_Coordinate_First_Edge); +} + + +void MainWindow::on_Second_X_Coordinate_First_Edge_editingFinished() +{ + ClampCoords(ui->Second_X_Coordinate_First_Edge); +} + + +void MainWindow::on_Second_Y_Coordinate_First_Edge_editingFinished() +{ + ClampCoords(ui->Second_Y_Coordinate_First_Edge); +} + + +void MainWindow::on_First_X_Coordinate_Second_Edge_editingFinished() +{ + ClampCoords(ui->First_X_Coordinate_Second_Edge); +} + + +void MainWindow::on_First_Y_Coordinate_Second_Edge_editingFinished() +{ + ClampCoords(ui->First_Y_Coordinate_Second_Edge); +} + + +void MainWindow::on_Second_X_Coordinate_Second_Edge_editingFinished() +{ + ClampCoords(ui->Second_X_Coordinate_Second_Edge); +} + + +void MainWindow::on_Second_Y_Coordinate_Second_Edge_editingFinished() +{ + ClampCoords(ui->Second_Y_Coordinate_Second_Edge); +} + + +void MainWindow::on_First_X_Coordinate_Third_Edge_editingFinished() +{ + ClampCoords(ui->First_X_Coordinate_Third_Edge); +} + + +void MainWindow::on_First_Y_Coordinate_Third_Edge_editingFinished() +{ + ClampCoords(ui->First_Y_Coordinate_Third_Edge); +} + + +void MainWindow::on_Second_X_Coordinate_Third_Edge_editingFinished() +{ + ClampCoords(ui->Second_X_Coordinate_Third_Edge); +} + + +void MainWindow::on_Second_Y_Coordinate_Third_Edge_editingFinished() +{ + ClampCoords(ui->Second_Y_Coordinate_Third_Edge); +} + + +void MainWindow::on_First_X_Coordinate_Fourth_Edge_editingFinished() +{ + ClampCoords(ui->First_X_Coordinate_Fourth_Edge); +} + + +void MainWindow::on_First_Y_Coordinate_Fourth_Edge_editingFinished() +{ + ClampCoords(ui->First_Y_Coordinate_Fourth_Edge); +} + + +void MainWindow::on_Second_X_Coordinate_Fourth_Edge_editingFinished() +{ + ClampCoords(ui->Second_X_Coordinate_Fourth_Edge); +} + + +void MainWindow::on_Second_Y_Coordinate_Fourth_Edge_editingFinished() +{ + ClampCoords(ui->Second_Y_Coordinate_Fourth_Edge); +} + + +void MainWindow::on_First_X_Coordinate_First_Edge_3_editingFinished() +{ + ClampCoords(ui->First_X_Coordinate_First_Edge_3); +} + + +void MainWindow::on_First_Y_Coordinate_First_Edge_3_editingFinished() +{ + ClampCoords(ui->First_Y_Coordinate_First_Edge_3); +} + + +void MainWindow::on_Second_X_Coordinate_First_Edge_3_editingFinished() +{ + ClampCoords(ui->Second_X_Coordinate_First_Edge_3); +} + + +void MainWindow::on_Second_Y_Coordinate_First_Edge_3_editingFinished() +{ + ClampCoords(ui->Second_Y_Coordinate_First_Edge_3); +} + + +void MainWindow::on_Third_X_Coordinate_First_Edge_3_editingFinished() +{ + ClampCoords(ui->Third_X_Coordinate_First_Edge_3); +} + + +void MainWindow::on_Third_Y_Coordinate_First_Edge_3_editingFinished() +{ + ClampCoords(ui->Third_Y_Coordinate_First_Edge_3); +} + + +void MainWindow::on_Fourth_X_Coordinate_First_Edge_3_editingFinished() +{ + ClampCoords(ui->Fourth_X_Coordinate_First_Edge_3); +} + + +void MainWindow::on_Fourth_Y_Coordinate_First_Edge_3_editingFinished() +{ + ClampCoords(ui->Fourth_Y_Coordinate_First_Edge_3); +} + + +void MainWindow::on_First_X_Coordinate_Second_Edge_3_editingFinished() +{ + ClampCoords(ui->First_X_Coordinate_Second_Edge_3); +} + + +void MainWindow::on_First_Y_Coordinate_Second_Edge_3_editingFinished() +{ + ClampCoords(ui->First_Y_Coordinate_Second_Edge_3); +} + + +void MainWindow::on_Second_X_Coordinate_Second_Edge_3_editingFinished() +{ + ClampCoords(ui->Second_X_Coordinate_Second_Edge_3); +} + + +void MainWindow::on_Second_Y_Coordinate_Second_Edge_3_editingFinished() +{ + ClampCoords(ui->Second_Y_Coordinate_Second_Edge_3); +} + + +void MainWindow::on_Third_X_Coordinate_Second_Edge_3_editingFinished() +{ + ClampCoords(ui->Third_X_Coordinate_Second_Edge_3); +} + + +void MainWindow::on_Third_Y_Coordinate_Second_Edge_3_editingFinished() +{ + ClampCoords(ui->Third_Y_Coordinate_Second_Edge_3); +} + + +void MainWindow::on_Fourth_X_Coordinate_Second_Edge_3_editingFinished() +{ + ClampCoords(ui->Fourth_X_Coordinate_Second_Edge_3); +} + + +void MainWindow::on_Fourth_Y_Coordinate_Second_Edge_3_editingFinished() +{ + ClampCoords(ui->Fourth_Y_Coordinate_Second_Edge_3); +} + + +void MainWindow::on_First_X_Coordinate_Third_Edge_3_editingFinished() +{ + ClampCoords(ui->First_X_Coordinate_Third_Edge_3); +} + + +void MainWindow::on_First_Y_Coordinate_Third_Edge_3_editingFinished() +{ + ClampCoords(ui->First_Y_Coordinate_Third_Edge_3); +} + + +void MainWindow::on_Second_X_Coordinate_Third_Edge_3_editingFinished() +{ + ClampCoords(ui->Second_X_Coordinate_Third_Edge_3); +} + + +void MainWindow::on_Second_Y_Coordinate_Third_Edge_3_editingFinished() +{ + ClampCoords(ui->Second_Y_Coordinate_Third_Edge_3); +} + + +void MainWindow::on_Third_X_Coordinate_Third_Edge_3_editingFinished() +{ + ClampCoords(ui->Third_X_Coordinate_Third_Edge_3); +} + + +void MainWindow::on_Third_Y_Coordinate_Third_Edge_3_editingFinished() +{ + ClampCoords(ui->Third_Y_Coordinate_Third_Edge_3); +} + + +void MainWindow::on_Fourth_X_Coordinate_Third_Edge_3_editingFinished() +{ + ClampCoords(ui->Fourth_X_Coordinate_Third_Edge_3); +} + + +void MainWindow::on_Fourth_Y_Coordinate_Third_Edge_3_editingFinished() +{ + ClampCoords(ui->Fourth_Y_Coordinate_Third_Edge_3); +} + + +void MainWindow::on_First_X_Coordinate_Fourth_Edge_3_editingFinished() +{ + ClampCoords(ui->First_X_Coordinate_Fourth_Edge_3); +} + + +void MainWindow::on_First_Y_Coordinate_Fourth_Edge_3_editingFinished() +{ + ClampCoords(ui->First_Y_Coordinate_Fourth_Edge_3); +} + + +void MainWindow::on_Second_X_Coordinate_Fourth_Edge_3_editingFinished() +{ + ClampCoords(ui->Second_X_Coordinate_Fourth_Edge_3); +} + + +void MainWindow::on_Second_Y_Coordinate_Fourth_Edge_3_editingFinished() +{ + ClampCoords(ui->Second_Y_Coordinate_Fourth_Edge_3); +} + + +void MainWindow::on_Third_X_Coordinate_Fourth_Edge_3_editingFinished() +{ + ClampCoords(ui->Third_X_Coordinate_Fourth_Edge_3); +} + + +void MainWindow::on_Third_Y_Coordinate_Fourth_Edge_3_editingFinished() +{ + ClampCoords(ui->Third_Y_Coordinate_Fourth_Edge_3); +} + + +void MainWindow::on_Fourth_X_Coordinate_Fourth_Edge_3_editingFinished() +{ + ClampCoords(ui->Fourth_X_Coordinate_Fourth_Edge_3); +} + + +void MainWindow::on_Fourth_Y_Coordinate_Fourth_Edge_3_editingFinished() +{ + ClampCoords(ui->Fourth_Y_Coordinate_Fourth_Edge_3); } diff --git a/Test/Applications/gradient/Gradient/mainwindow.h b/Test/Applications/gradient/Gradient/mainwindow.h index d9f5e08269..99c51b16d7 100644 --- a/Test/Applications/gradient/Gradient/mainwindow.h +++ b/Test/Applications/gradient/Gradient/mainwindow.h @@ -13,6 +13,19 @@ namespace Ui } QT_END_NAMESPACE +typedef enum +{ + Linear, + Radial, + Triangle, + TriangleParametric, + CoonsPatch, + CoonsPatchParametric, + TensorCoonsPatch, + TensorCoonsPatchParametric, + Functional +} GradientType; + typedef enum { NoColorspaceType, @@ -51,12 +64,20 @@ struct Color struct Info { ColorspaceType colorspace = NoColorspaceType; + GradientType gradient = Linear; float r0, r1; NSStructures::Point c0, c1; NSStructures::Point p0, p1; bool cont_b, cont_f; std::vector triangle = {{100, 100}, {300, 200}, {200, 350}}; + std::vector curve = {{100, 300}, {50, 250}, {150, 150}, {100, 100}, + {150, 50}, {250, 150}, {300, 100}, {250, 150}, + {350, 250}, {300, 300}, {250, 350}, {150,250}}; + std::vector> tensorcurve = {{{100, 300}, {150, 250}, {50, 150}, {100,100}}, + {{150, 250}, {170, 230}, {170, 170}, {50, 150}}, + {{350, 250}, {230, 230}, {230, 170}, {150, 250}}, + {{300, 300}, {250, 250}, {350, 150}, {300, 100}}}; NSStructures::GradientInfo ginfo; int gradient_type; @@ -155,17 +176,125 @@ private slots: void on_actionTriangle_Parametric_Gradient_triggered(); - void on_First_Vertex_X_Coordinate_Input_2_editingFinished(); + void on_actionCoons_Patch_Gradient_triggered(); - void on_First_Vertex_Y_Coordinate_Input_2_editingFinished(); + void on_actionCoons_Patch_Parametric_triggered(); - void on_Second_Vertex_X_Coordinate_Input_2_editingFinished(); + void on_actionTensor_Coons_Patch_Gradient_triggered(); - void on_Second_Vertex_Y_Coordinate_Input_2_editingFinished(); + void on_actionTensor_Coons_Patch_Parametric_triggered(); - void on_Third_Vertex_X_Coordinate_Input_2_editingFinished(); + void on_First_Vertex_X_Coordinate_Input_3_editingFinished(); - void on_Third_Vertex_Y_Coordinate_Input_2_editingFinished(); + void on_First_Vertex_Y_Coordinate_Input_3_editingFinished(); + + void on_Second_Vertex_X_Coordinate_Input_3_editingFinished(); + + void on_Second_Vertex_Y_Coordinate_Input_3_editingFinished(); + + void on_Third_Vertex_X_Coordinate_Input_3_editingFinished(); + + void on_Third_Vertex_Y_Coordinate_Input_3_editingFinished(); + + void on_Fourth_Vertex_X_Coordinate_Input_3_editingFinished(); + + void on_Fourth_Vertex_Y_Coordinate_Input_3_editingFinished(); + + void on_First_X_Coordinate_First_Edge_editingFinished(); + + void on_First_Y_Coordinate_First_Edge_editingFinished(); + + void on_Second_X_Coordinate_First_Edge_editingFinished(); + + void on_Second_Y_Coordinate_First_Edge_editingFinished(); + + void on_First_X_Coordinate_Second_Edge_editingFinished(); + + void on_First_Y_Coordinate_Second_Edge_editingFinished(); + + void on_Second_X_Coordinate_Second_Edge_editingFinished(); + + void on_Second_Y_Coordinate_Second_Edge_editingFinished(); + + void on_First_X_Coordinate_Third_Edge_editingFinished(); + + void on_First_Y_Coordinate_Third_Edge_editingFinished(); + + void on_Second_X_Coordinate_Third_Edge_editingFinished(); + + void on_Second_Y_Coordinate_Third_Edge_editingFinished(); + + void on_First_X_Coordinate_Fourth_Edge_editingFinished(); + + void on_First_Y_Coordinate_Fourth_Edge_editingFinished(); + + void on_Second_X_Coordinate_Fourth_Edge_editingFinished(); + + void on_Second_Y_Coordinate_Fourth_Edge_editingFinished(); + + void on_First_X_Coordinate_First_Edge_3_editingFinished(); + + void on_First_Y_Coordinate_First_Edge_3_editingFinished(); + + void on_Second_X_Coordinate_First_Edge_3_editingFinished(); + + void on_Second_Y_Coordinate_First_Edge_3_editingFinished(); + + void on_Third_X_Coordinate_First_Edge_3_editingFinished(); + + void on_Third_Y_Coordinate_First_Edge_3_editingFinished(); + + void on_Fourth_X_Coordinate_First_Edge_3_editingFinished(); + + void on_Fourth_Y_Coordinate_First_Edge_3_editingFinished(); + + void on_First_X_Coordinate_Second_Edge_3_editingFinished(); + + void on_First_Y_Coordinate_Second_Edge_3_editingFinished(); + + void on_Second_X_Coordinate_Second_Edge_3_editingFinished(); + + void on_Second_Y_Coordinate_Second_Edge_3_editingFinished(); + + void on_Third_X_Coordinate_Second_Edge_3_editingFinished(); + + void on_Third_Y_Coordinate_Second_Edge_3_editingFinished(); + + void on_Fourth_X_Coordinate_Second_Edge_3_editingFinished(); + + void on_Fourth_Y_Coordinate_Second_Edge_3_editingFinished(); + + void on_First_X_Coordinate_Third_Edge_3_editingFinished(); + + void on_First_Y_Coordinate_Third_Edge_3_editingFinished(); + + void on_Second_X_Coordinate_Third_Edge_3_editingFinished(); + + void on_Second_Y_Coordinate_Third_Edge_3_editingFinished(); + + void on_Third_X_Coordinate_Third_Edge_3_editingFinished(); + + void on_Third_Y_Coordinate_Third_Edge_3_editingFinished(); + + void on_Fourth_X_Coordinate_Third_Edge_3_editingFinished(); + + void on_Fourth_Y_Coordinate_Third_Edge_3_editingFinished(); + + void on_First_X_Coordinate_Fourth_Edge_3_editingFinished(); + + void on_First_Y_Coordinate_Fourth_Edge_3_editingFinished(); + + void on_Second_X_Coordinate_Fourth_Edge_3_editingFinished(); + + void on_Second_Y_Coordinate_Fourth_Edge_3_editingFinished(); + + void on_Third_X_Coordinate_Fourth_Edge_3_editingFinished(); + + void on_Third_Y_Coordinate_Fourth_Edge_3_editingFinished(); + + void on_Fourth_X_Coordinate_Fourth_Edge_3_editingFinished(); + + void on_Fourth_Y_Coordinate_Fourth_Edge_3_editingFinished(); private: Ui::MainWindow *ui; diff --git a/Test/Applications/gradient/Gradient/mainwindow.ui b/Test/Applications/gradient/Gradient/mainwindow.ui index 3f6d8e099e..713a17ab4b 100644 --- a/Test/Applications/gradient/Gradient/mainwindow.ui +++ b/Test/Applications/gradient/Gradient/mainwindow.ui @@ -6,8 +6,8 @@ 0 0 - 1060 - 592 + 1126 + 827 @@ -33,24 +33,12 @@ - 520 + 510 0 - 535 - 500 + 610 + 740 - - - 535 - 0 - - - - - 535 - 16777215 - - @@ -124,12 +112,12 @@ 10 160 - 511 - 330 + 590 + 570 - 3 + 0 @@ -137,8 +125,8 @@ 0 10 - 371 - 160 + 440 + 150 @@ -166,6 +154,9 @@ 28 + + 10 + @@ -189,11 +180,14 @@ 28 + + 10 + - 180 + 240 30 180 20 @@ -206,17 +200,20 @@ - 180 + 240 50 113 28 + + 90 + - 180 + 240 80 179 20 @@ -229,21 +226,24 @@ - 180 + 240 100 113 28 + + 90 + - 380 + 450 10 131 - 161 + 150 @@ -276,47 +276,15 @@ - - - - 10 - 180 - 415 - 20 - - - - A linear gradient describes a color change along a straight line - - - Qt::AutoText - - - - - - 10 - 200 - 415 - 20 - - - - that is defined by two points. - - - Qt::AutoText - - - 380 - 160 + 450 + 10 131 - 161 + 150 @@ -354,7 +322,7 @@ 0 10 - 510 + 440 150 @@ -383,6 +351,9 @@ 28 + + 50 + @@ -406,11 +377,14 @@ 28 + + 50 + - 280 + 230 30 190 20 @@ -423,17 +397,20 @@ - 280 + 230 50 113 28 + + 50 + - 280 + 230 80 189 20 @@ -446,12 +423,15 @@ - 280 + 230 100 113 28 + + 50 + @@ -459,7 +439,7 @@ 0 160 - 371 + 440 100 @@ -482,7 +462,7 @@ - 200 + 230 30 97 20 @@ -501,66 +481,33 @@ 28 + + 10 + - 200 + 230 50 113 28 + + 30 + - - - - 0 - 260 - 319 - 20 - - - - Radial gradient describes the color change from - - - - - - 0 - 280 - 335 - 20 - - - - the center to the edges, it is defined by two circles, - - - - - - 0 - 300 - 281 - 20 - - - - which are defined by the center and radius - - - + 0 10 - 510 - 240 + 590 + 140 @@ -569,7 +516,7 @@ - 20 + 10 30 168 20 @@ -582,17 +529,20 @@ - 20 + 10 50 113 28 + + 50 + - 20 + 10 80 167 20 @@ -605,17 +555,20 @@ - 20 + 10 100 113 28 + + 20 + - 280 + 200 30 188 20 @@ -628,17 +581,20 @@ - 280 + 200 50 113 28 + + 20 + - 280 + 200 80 187 20 @@ -651,18 +607,21 @@ - 280 + 200 100 113 28 + + 70 + - 20 - 140 + 410 + 30 173 20 @@ -674,18 +633,21 @@ - 20 - 160 + 410 + 50 113 28 + + 80 + - 20 - 190 + 410 + 80 173 20 @@ -697,217 +659,1605 @@ - 20 - 210 + 410 + 100 113 28 + + 70 + - - - - 0 - 250 - 502 - 20 - - - - Triangle gradient describes the color change between the three vertices of a - - - - - - 0 - 270 - 512 - 20 - - - - triangle. The color change occurs according to the principle of linear gradient - - - - - - 0 - 290 - 476 - 20 - - - - along the perpendiculars from the triangle vertex to the point where the - - - - - - 0 - 310 - 161 - 20 - - - - perpendiculars intersect. - - - - + + 0 10 - 510 - 260 + 590 + 140 - Set Coordinates Of Triangle Vertices + Set Coordinates Of Square Vertices - + - 20 + 10 30 - 168 + 118 20 - X Coordinate, First Vertex + First X Coordinate - + - 20 + 10 50 113 28 + + 20 + - + - 20 + 10 80 - 167 + 117 20 - Y Coordinate, First Vertex + First Y Coordinate - + - 20 + 10 100 113 28 + + 60 + - + - 280 + 140 30 - 188 + 140 20 - X Coordinate, Second Vertex + Second X Coordinate - + - 280 + 140 50 113 28 + + 20 + - + - 280 + 140 80 - 187 + 139 20 - Y Coordinate, Second Vertex + Second Y Coordinate - + - 280 + 140 100 113 28 + + 20 + - + - 20 - 140 - 173 + 300 + 30 + 125 20 - X Coordinate, Third Vertex + Third X Coordinate - + - 20 - 160 + 300 + 50 113 28 + + 60 + - + - 20 - 190 - 173 + 300 + 80 + 124 20 - Y Coordinate, Third Vertex + Third Y Coordinate - + - 20 - 210 + 300 + 100 113 28 + + 20 + + + + + + 450 + 30 + 133 + 20 + + + + Fourth X Coordinate + + + + + + 450 + 50 + 113 + 28 + + + + 60 + + + + + + 450 + 80 + 128 + 20 + + + + Fourth Y Coorfinate + + + + + + 450 + 100 + 113 + 28 + + + + 60 + + + + + + + 0 + 150 + 590 + 320 + + + + Set Curvature Coordinates Of Square Edges + + + + + 10 + 30 + 280 + 140 + + + + First Edge + + + + + 10 + 30 + 118 + 20 + + + + First X Coordinate + + + + + + 10 + 50 + 113 + 28 + + + + 10 + + + + + + 140 + 30 + 140 + 20 + + + + Second X Coordinate + + + + + + 140 + 50 + 113 + 28 + + + + 30 + + + + + + 10 + 80 + 117 + 20 + + + + First Y Coordinate + + + + + + 10 + 100 + 113 + 28 + + + + 50 + + + + + + 140 + 80 + 139 + 20 + + + + Second Y Coordinate + + + + + + 140 + 100 + 113 + 28 + + + + 30 + + + + + + + 300 + 30 + 280 + 140 + + + + Second Edge + + + + + 10 + 30 + 118 + 20 + + + + First X Coordinate + + + + + + 10 + 50 + 113 + 28 + + + + 30 + + + + + + 140 + 30 + 140 + 20 + + + + Second X Coordinate + + + + + + 140 + 50 + 113 + 28 + + + + 50 + + + + + + 10 + 80 + 117 + 20 + + + + First Y Coordinate + + + + + + 10 + 100 + 113 + 28 + + + + 10 + + + + + + 140 + 80 + 140 + 20 + + + + Second Y Coordinate + + + + + + 140 + 100 + 113 + 28 + + + + 30 + + + + + + + 10 + 170 + 280 + 140 + + + + Third Edge + + + + + 10 + 30 + 118 + 20 + + + + First X Coordinate + + + + + + 10 + 50 + 113 + 28 + + + + 50 + + + + + + 140 + 30 + 140 + 20 + + + + Second X Coordinate + + + + + + 140 + 50 + 113 + 28 + + + + 70 + + + + + + 10 + 80 + 117 + 20 + + + + First Y Coordinate + + + + + + 10 + 100 + 113 + 28 + + + + 30 + + + + + + 140 + 80 + 140 + 20 + + + + Second Y Coordinate + + + + + + 140 + 100 + 113 + 28 + + + + 50 + + + + + + + 300 + 170 + 280 + 140 + + + + Fourth Edge + + + + + 10 + 30 + 118 + 20 + + + + First X Coordinate + + + + + + 10 + 50 + 113 + 28 + + + + 50 + + + + + + 140 + 30 + 140 + 20 + + + + Second X Coordinate + + + + + + 140 + 50 + 113 + 28 + + + + 30 + + + + + + 10 + 80 + 117 + 20 + + + + First Y Coordinate + + + + + + 10 + 100 + 113 + 28 + + + + 70 + + + + + + 140 + 80 + 140 + 20 + + + + Second Y Coordinate + + + + + + 140 + 100 + 113 + 28 + + + + 50 + + + + + + + + + + 0 + 10 + 590 + 140 + + + + Set Coordinates Of First Curved Edge + + + + + 10 + 30 + 118 + 20 + + + + First X Coordinate + + + + + + 10 + 50 + 113 + 28 + + + + 20 + + + + + + 10 + 80 + 117 + 20 + + + + First Y Coordinate + + + + + + 10 + 100 + 113 + 28 + + + + 60 + + + + + + 140 + 30 + 140 + 20 + + + + Second X Coordinate + + + + + + 140 + 50 + 113 + 28 + + + + 30 + + + + + + 140 + 80 + 139 + 20 + + + + Second Y Coordinate + + + + + + 140 + 100 + 113 + 28 + + + + 50 + + + + + + 300 + 30 + 125 + 20 + + + + Third X Coordinate + + + + + + 300 + 50 + 113 + 28 + + + + 10 + + + + + + 300 + 80 + 124 + 20 + + + + Third Y Coordinate + + + + + + 300 + 100 + 113 + 28 + + + + 30 + + + + + + 450 + 30 + 133 + 20 + + + + Fourth X Coordinate + + + + + + 450 + 50 + 113 + 28 + + + + 20 + + + + + + 450 + 80 + 128 + 20 + + + + Fourth Y Coorfinate + + + + + + 450 + 100 + 113 + 28 + + + + 20 + + + + + + + 0 + 150 + 590 + 140 + + + + Set Coordinates Of Second Curved Edge + + + + + 10 + 30 + 118 + 20 + + + + First X Coordinate + + + + + + 10 + 50 + 113 + 28 + + + + 30 + + + + + + 10 + 80 + 117 + 20 + + + + First Y Coordinate + + + + + + 10 + 100 + 113 + 28 + + + + 50 + + + + + + 140 + 30 + 140 + 20 + + + + Second X Coordinate + + + + + + 140 + 50 + 113 + 28 + + + + 34 + + + + + + 140 + 80 + 139 + 20 + + + + Second Y Coordinate + + + + + + 140 + 100 + 113 + 28 + + + + 46 + + + + + + 300 + 30 + 125 + 20 + + + + Third X Coordinate + + + + + + 300 + 50 + 113 + 28 + + + + 34 + + + + + + 300 + 80 + 124 + 20 + + + + Third Y Coordinate + + + + + + 300 + 100 + 113 + 28 + + + + 34 + + + + + + 450 + 30 + 133 + 20 + + + + Fourth X Coordinate + + + + + + 450 + 50 + 113 + 28 + + + + 10 + + + + + + 450 + 80 + 128 + 20 + + + + Fourth Y Coorfinate + + + + + + 450 + 100 + 113 + 28 + + + + 30 + + + + + + + 0 + 290 + 590 + 140 + + + + Set Coordinates Of Third Curved Edge + + + + + 10 + 30 + 118 + 20 + + + + First X Coordinate + + + + + + 10 + 50 + 113 + 28 + + + + 70 + + + + + + 10 + 80 + 117 + 20 + + + + First Y Coordinate + + + + + + 10 + 100 + 113 + 28 + + + + 50 + + + + + + 140 + 30 + 140 + 20 + + + + Second X Coordinate + + + + + + 140 + 50 + 113 + 28 + + + + 46 + + + + + + 140 + 80 + 139 + 20 + + + + Second Y Coordinate + + + + + + 140 + 100 + 113 + 28 + + + + 46 + + + + + + 300 + 30 + 125 + 20 + + + + Third X Coordinate + + + + + + 300 + 50 + 113 + 28 + + + + 46 + + + + + + 300 + 80 + 124 + 20 + + + + Third Y Coordinate + + + + + + 300 + 100 + 113 + 28 + + + + 34 + + + + + + 450 + 30 + 133 + 20 + + + + Fourth X Coordinate + + + + + + 450 + 50 + 113 + 28 + + + + 30 + + + + + + 450 + 80 + 128 + 20 + + + + Fourth Y Coorfinate + + + + + + 450 + 100 + 113 + 28 + + + + 50 + + + + + + + 0 + 430 + 590 + 140 + + + + Set Coordinates Of Fourth Curved Edge + + + + + 10 + 30 + 118 + 20 + + + + First X Coordinate + + + + + + 10 + 50 + 113 + 28 + + + + 60 + + + + + + 10 + 80 + 117 + 20 + + + + First Y Coordinate + + + + + + 10 + 100 + 113 + 28 + + + + 60 + + + + + + 140 + 30 + 140 + 20 + + + + Second X Coordinate + + + + + + 140 + 50 + 113 + 28 + + + + 50 + + + + + + 140 + 80 + 139 + 20 + + + + Second Y Coordinate + + + + + + 140 + 100 + 113 + 28 + + + + 50 + + + + + + 300 + 30 + 125 + 20 + + + + Third X Coordinate + + + + + + 300 + 50 + 113 + 28 + + + + 70 + + + + + + 300 + 80 + 124 + 20 + + + + Third Y Coordinate + + + + + + 300 + 100 + 113 + 28 + + + + 30 + + + + + + 450 + 30 + 133 + 20 + + + + Fourth X Coordinate + + + + + + 450 + 50 + 113 + 28 + + + + 60 + + + + + + 450 + 80 + 128 + 20 + + + + Fourth Y Coorfinate + + + + + + 450 + 100 + 113 + 28 + + + + 20 + @@ -926,13 +2276,318 @@ + + + + 10 + 510 + 490 + 220 + + + + 6 + + + + + + 20 + 10 + 415 + 20 + + + + A linear gradient describes a color change along a straight line + + + Qt::AutoText + + + + + + 20 + 30 + 415 + 20 + + + + that is defined by two points. + + + Qt::AutoText + + + + + + + + 10 + 10 + 319 + 20 + + + + Radial gradient describes the color change from + + + + + + 10 + 30 + 335 + 20 + + + + the center to the edges, it is defined by two circles, + + + + + + 10 + 50 + 281 + 20 + + + + which are defined by the center and radius + + + + + + + + 0 + 10 + 472 + 20 + + + + Triangle gradient describes the color change between the three vertices + + + + + + 0 + 30 + 482 + 20 + + + + of a triangle. The color change occurs according to the principle of linear + + + + + + 0 + 50 + 467 + 20 + + + + gradient along the perpendiculars from the triangle vertex to the point + + + + + + 0 + 70 + 230 + 20 + + + + where the perpendiculars intersect. + + + + + + + + + 10 + 10 + 461 + 20 + + + + Coons Patch gradient describes the color change on the surface of the + + + + + + 10 + 30 + 456 + 20 + + + + Coons Patch on the plane. In mathematics, a Coons patch, is a type of + + + + + + 10 + 50 + 418 + 20 + + + + surface patch used in computer graphics to smoothly join other + + + + + + 10 + 70 + 117 + 20 + + + + surfaces together. + + + + + + 10 + 130 + 162 + 20 + + + + Note on set coordinates: + + + + + + 10 + 150 + 459 + 20 + + + + The vertices are counted clockwise. + + + + + + 10 + 170 + 457 + 20 + + + + The edges are counted clockwise starting from the edge between the + + + + + + 10 + 190 + 152 + 20 + + + + first and second vertex. + + + + + + + + + 10 + 10 + 435 + 20 + + + + Tensor Coons Patch gradient describes the color change as well as + + + + + + 10 + 30 + 279 + 20 + + + + Coons Patch gradient, but in tensor space. + + + + + + 10 + 130 + 162 + 20 + + + + Note on set coordinates: + + + + + + 10 + 150 + 222 + 20 + + + + The curves are counted clockwise. + + + + + 0 0 - 1060 + 1126 25 @@ -952,20 +2607,24 @@ + + + + - Linear Gradient + Linear - Radial Gradient + Radial - Triangle Gradient + Triangle QAction::TextHeuristicRole @@ -973,7 +2632,39 @@ - Triangle Parametric Gradient + Triangle Parametric + + + QAction::TextHeuristicRole + + + + + Coons Patch + + + QAction::TextHeuristicRole + + + + + Coons Patch Parametric + + + QAction::TextHeuristicRole + + + + + Tensor Coons Patch + + + QAction::TextHeuristicRole + + + + + Tensor Coons Patch Parametric QAction::TextHeuristicRole