aboutsummaryrefslogtreecommitdiff
path: root/tools/CurveEditor/source/GraphEditorTestApp
diff options
context:
space:
mode:
authorBryan Galdrikian <[email protected]>2017-08-23 11:24:32 -0700
committerBryan Galdrikian <[email protected]>2017-08-23 11:24:32 -0700
commitf1e539cadfb085cedc32f9773cfb9d14bfcdf138 (patch)
tree7ca74e06a4386dd22fd850a8417a31a85d282a30 /tools/CurveEditor/source/GraphEditorTestApp
parentUpdated to CL 22661993: (diff)
downloadblast-f1e539cadfb085cedc32f9773cfb9d14bfcdf138.tar.xz
blast-f1e539cadfb085cedc32f9773cfb9d14bfcdf138.zip
Removing ArtistTools and CurveEditor projects
Diffstat (limited to 'tools/CurveEditor/source/GraphEditorTestApp')
-rw-r--r--tools/CurveEditor/source/GraphEditorTestApp/CurveEditorTestApp.cpp342
-rw-r--r--tools/CurveEditor/source/GraphEditorTestApp/CurveEditorTestApp.h49
-rw-r--r--tools/CurveEditor/source/GraphEditorTestApp/CurveEditorTestApp.qrc4
-rw-r--r--tools/CurveEditor/source/GraphEditorTestApp/CurveEditorTestApp.ui35
-rw-r--r--tools/CurveEditor/source/GraphEditorTestApp/main.cpp10
5 files changed, 0 insertions, 440 deletions
diff --git a/tools/CurveEditor/source/GraphEditorTestApp/CurveEditorTestApp.cpp b/tools/CurveEditor/source/GraphEditorTestApp/CurveEditorTestApp.cpp
deleted file mode 100644
index 9aa42bd..0000000
--- a/tools/CurveEditor/source/GraphEditorTestApp/CurveEditorTestApp.cpp
+++ /dev/null
@@ -1,342 +0,0 @@
-#include "CurveEditorTestApp.h"
-#include "ui_CurveEditorTestApp.h"
-#include "CurveEditorMainWindow.h"
-#include <QtCore/QDebug>
-
-CurveEditorTestApp::CurveEditorTestApp(QWidget *parent, Qt::WindowFlags flags)
- : QWidget(parent, flags)
- , ui(new Ui::CurveEditorTestAppClass())
- , _curveEditor(new CurveEditorMainWindow(this))
-{
- ui->setupUi(this);
-
- bool val = connect(_curveEditor, SIGNAL(CurveAttributeChanged(nvidia::CurveEditor::CurveAttribute*)), this, SLOT(onCurveAttributeChanged(nvidia::CurveEditor::CurveAttribute*)));
- val = connect(_curveEditor, SIGNAL(ColorAttributeChanged(nvidia::CurveEditor::ColorAttribute*)), this, SLOT(onColorAttributeChanged(nvidia::CurveEditor::ColorAttribute*)) );
- val = connect(_curveEditor, SIGNAL(ReloadColorAttributeTexture(nvidia::CurveEditor::ColorAttribute*, bool, int)), this, SLOT(onReloadColorAttributeTexture(nvidia::CurveEditor::ColorAttribute*, bool, int)) );
-
- _curveEditor->hide();
-
- _fillCurveAttributes();
- _fillColorAttributes();
-}
-
-CurveEditorTestApp::~CurveEditorTestApp()
-{
-
-}
-
-void CurveEditorTestApp::on_btnCurveEditor_clicked(void)
-{
- _curveEditor->show();
-}
-
-void CurveEditorTestApp::onCurveAttributeChanged(CurveAttribute* attribute)
-{
- if (attribute)
- {
- qDebug()<<"-------------------------onCurveAttributeChanged---------------------------------";
- qDebug()<< attribute->getName().c_str() <<": changed";
-
- size_t count = attribute->curve.getControlPointCount();
- for (int i = 0; i < count; ++i)
- {
- const ControlPoint& ctrlPnt = attribute->curve.getControlPoint(i);
- if (attribute->getName() == "Y" && i == 9 && ctrlPnt.value.y() > 2.5)
- {
- int j = 0;
- ++j;
- }
- qDebug()<< ctrlPnt.value;
- }
- }
-}
-
-void CurveEditorTestApp::onColorAttributeChanged(ColorAttribute* attribute)
-{
- if (attribute)
- {
- qDebug()<<"----------------------------------------------------------";
- qDebug()<< attribute->getName().c_str() <<": changed";
- }
-}
-
-void CurveEditorTestApp::onReloadColorAttributeTexture(ColorAttribute* attribute, bool reloadColorTex, int selectedCtrlPntIndex)
-{
- if (attribute)
- {
- qDebug()<<"----------------------------------------------------------";
- qDebug()<< attribute->getName().c_str() <<": reloadColorTex" << reloadColorTex<< " selectedCtrlPntIndex: "<< selectedCtrlPntIndex;
- }
-}
-
-void CurveEditorTestApp::_fillCurveAttributes()
-{
- {
- std::vector<CurveAttributeBase*> attributes;
-
- CurveAttributeGroup* attrGroup = new CurveAttributeGroup("Position");
- attributes.push_back(attrGroup);
-
- CurveAttribute* attribute = new CurveAttribute("X", false, true, true);
- //attribute->color = QColor(0x11, 0x22, 0x33, 0x44);//
- attribute->color = QColor("#FF0000");
- attrGroup->attributes.push_back(attribute);
-
- {
- Curve& curve = attribute->curve;
- curve.initValueRange(QPointF(-1, 0), QPointF(6, 1));
- curve.appendControlPoint(ControlPoint(-1, 1, eDiscret));
- curve.appendControlPoint(ControlPoint(0, 0, eCatmullRomSpline));
- curve.appendControlPoint(ControlPoint(0.25, 0.5, eCatmullRomSpline));
- curve.appendControlPoint(ControlPoint(0.5, 0, eCatmullRomSpline));
- curve.appendControlPoint(ControlPoint(0.75, 0.5, eCatmullRomSpline));
- curve.appendControlPoint(ControlPoint(1, 0, eCatmullRomSpline));
- {
- BezierSplineData splineData;
- splineData.inLen = 0;
- splineData.inTan = 0;
- splineData.outLen = 1.0;
- splineData.outTan = 0;
- curve.appendControlPoint(ControlPoint(2, 1, eBezierSpline, splineData));
- splineData.inLen = 0.0;
- splineData.inTan = 0;
- splineData.outLen = 1.0;
- splineData.outTan = 0;
- curve.appendControlPoint(ControlPoint(3, 0, eBezierSpline, splineData));
- splineData.inLen = 1.0;
- splineData.inTan = 0;
- splineData.outLen = 1.0;
- splineData.outTan = 0;
- curve.appendControlPoint(ControlPoint(4, 1, eBezierSpline, splineData));
- }
- curve.appendControlPoint(ControlPoint(5, 0, eLinear));
- curve.appendControlPoint(ControlPoint(6, 1, eLinear));
- }
-
- attribute = new CurveAttribute("Y", true);
- attribute->color = QColor("#FFFF00");
- attrGroup->attributes.push_back(attribute);
- {
- Curve& curve = attribute->curve;
- curve.initValueRange(QPointF(-2, 0), QPointF(8, 2));
- curve.appendControlPoint(ControlPoint(-2, 2, eDiscret));
- curve.appendControlPoint(ControlPoint(1, 0, eCatmullRomSpline));
- curve.appendControlPoint(ControlPoint(1.25, 0.5, eCatmullRomSpline));
- curve.appendControlPoint(ControlPoint(1.5, 0, eCatmullRomSpline));
- curve.appendControlPoint(ControlPoint(1.75, 0.5, eCatmullRomSpline));
- curve.appendControlPoint(ControlPoint(2, 0, eCatmullRomSpline));
- {
- BezierSplineData splineData;
- splineData.inLen = 0;
- splineData.inTan = 0;
- splineData.outLen = 1.0;
- splineData.outTan = 0;
- curve.appendControlPoint(ControlPoint(3, 1, eBezierSpline, splineData));
- splineData.inLen = 0.0;
- splineData.inTan = 0;
- splineData.outLen = 1.0;
- splineData.outTan = 0;
- curve.appendControlPoint(ControlPoint(4, 0, eBezierSpline, splineData));
- splineData.inLen = 1.0;
- splineData.inTan = 0;
- splineData.outLen = 1.0;
- splineData.outTan = 0;
- curve.appendControlPoint(ControlPoint(5, 1, eBezierSpline, splineData));
- }
- curve.appendControlPoint(ControlPoint(6, 0, eLinear));
- curve.appendControlPoint(ControlPoint(8, 2, eLinear));
- }
-
- attribute = new CurveAttribute("Z", true);
- attribute->color = QColor("#00FF00");
- attrGroup->attributes.push_back(attribute);
- {
- Curve& curve = attribute->curve;
- curve.initValueRange(QPointF(-2, 0), QPointF(8, 4));
- curve.appendControlPoint(ControlPoint(-2, 2, eDiscret));
- curve.appendControlPoint(ControlPoint(1, 0, eCatmullRomSpline));
- curve.appendControlPoint(ControlPoint(1.5, 4, eCatmullRomSpline));
- curve.appendControlPoint(ControlPoint(1.75, 0.5, eCatmullRomSpline));
- curve.appendControlPoint(ControlPoint(2, 1, eCatmullRomSpline));
- {
- BezierSplineData splineData;
- splineData.inLen = 0;
- splineData.inTan = 0;
- splineData.outLen = 1.0;
- splineData.outTan = 0;
- curve.appendControlPoint(ControlPoint(3, 3, eBezierSpline, splineData));
- splineData.inLen = 0.0;
- splineData.inTan = 0;
- splineData.outLen = 1.0;
- splineData.outTan = 0;
- curve.appendControlPoint(ControlPoint(4, 0, eBezierSpline, splineData));
- splineData.inLen = 1.0;
- splineData.inTan = 0;
- splineData.outLen = 1.0;
- splineData.outTan = 0;
- curve.appendControlPoint(ControlPoint(5, 2, eBezierSpline, splineData));
- }
- curve.appendControlPoint(ControlPoint(6, 0, eLinear));
- curve.appendControlPoint(ControlPoint(8, 4, eLinear));
- }
-
- attribute = new CurveAttribute("AddRemove_ChangeTangent", true, true, true);
-
- attributes.push_back(attribute);
-
- {
- Curve& curve = attribute->curve;
- curve.initValueRange(QPointF(-1, 0), QPointF(4, 255));
- curve.appendControlPoint(ControlPoint(-1, 0, eLinear));
- {
- BezierSplineData splineData;
- splineData.inLen = 1.0;
- splineData.inTan = 0;
- splineData.outLen = 1.0;
- splineData.outTan = 0;
- curve.appendControlPoint(ControlPoint(4, 255, eBezierSpline, splineData));
- }
- }
-
-
- _curveAttributes = attributes;
- _curveEditor->setCurveAttributes(_curveAttributes);
- }
-}
-
-void CurveEditorTestApp::_fillColorAttributes()
-{
- {
- std::vector<ColorAttribute*> attributes;
-
- ColorAttribute* attribute = new ColorAttribute("Hair Color");
- attributes.push_back(attribute);
-
- {
- ColorCurve& colorCurve = attribute->colorCurve;
- colorCurve.initValueRange(0, 1);
- ColorCurve& alphaCurve = attribute->alphaCurve;
- alphaCurve.initValueRange(0, 1);
-
- colorCurve.appendControlPoint(ColorControlPoint(0, QColor(255, 0, 0, 255), eLinear));
- colorCurve.appendControlPoint(ColorControlPoint(1, QColor(0, 255, 0, 255), eLinear));
-
- alphaCurve.appendControlPoint(ColorControlPoint(0, QColor(0, 0, 0, 0), eLinear));
- alphaCurve.appendControlPoint(ColorControlPoint(1, QColor(0, 0, 0, 255), eLinear));
- }
-
- attribute = new ColorAttribute("XColor", true, true, true);
- //attribute->color = QColor(0x11, 0x22, 0x33, 0x44);//
- attributes.push_back(attribute);
-
- {
- ColorCurve& curve = attribute->colorCurve;
- curve.initValueRange(-1, 6);
- curve.appendControlPoint(ColorControlPoint(-1, QColor(255, 0, 0, 0), eDiscret));
- curve.appendControlPoint(ColorControlPoint(0, QColor(0, 255, 0, 255), eCatmullRomSpline));
- curve.appendControlPoint(ColorControlPoint(0.25, QColor(128, 0, 255, 128), eCatmullRomSpline));
- curve.appendControlPoint(ColorControlPoint(0.5, QColor(255, 0, 0, 255), eCatmullRomSpline));
- curve.appendControlPoint(ColorControlPoint(0.75, QColor(0, 255, 0, 128), eCatmullRomSpline));
- curve.appendControlPoint(ColorControlPoint(1, QColor(0, 0, 255, 0), eCatmullRomSpline));
- {
- BezierSplineData splineData;
- splineData.inLen = 0;
- splineData.inTan = 0;
- splineData.outLen = 1.0;
- splineData.outTan = 0;
- curve.appendControlPoint(ColorControlPoint(2, QColor(255, 0, 0, 255), eBezierSpline, splineData));
- splineData.inLen = 1.0;
- splineData.inTan = 0;
- splineData.outLen = 1.0;
- splineData.outTan = 0;
- curve.appendControlPoint(ColorControlPoint(3, QColor(0, 255, 0, 128), eBezierSpline, splineData));
- splineData.inLen = 1.0;
- splineData.inTan = 0;
- splineData.outLen = 1.0;
- splineData.outTan = 0;
- curve.appendControlPoint(ColorControlPoint(4, QColor(0, 0, 255, 0), eBezierSpline, splineData));
- }
- curve.appendControlPoint(ColorControlPoint(5, QColor(255, 0, 0, 255), eLinear));
- curve.appendControlPoint(ColorControlPoint(6, QColor(0, 255, 0, 128), eLinear));
- }
-
- attribute = new ColorAttribute("Color_NoAddRemove_NotChangeTangent", true, false, false);
-
- attributes.push_back(attribute);
-
- {
- ColorCurve& colorCurve = attribute->colorCurve;
- colorCurve.initValueRange(-1, 4);
- colorCurve.appendControlPoint(ColorControlPoint(-1, QColor(255, 0, 0, 0), eLinear));
- colorCurve.appendControlPoint(ColorControlPoint(0, QColor(0, 255, 0, 255), eLinear));
- colorCurve.appendControlPoint(ColorControlPoint(0.5, QColor(0, 0, 255, 255), eLinear));
- colorCurve.appendControlPoint(ColorControlPoint(1, QColor(255, 0, 0, 0), eLinear));
- {
- BezierSplineData splineData;
- splineData.inLen = 0;
- splineData.inTan = 0;
- splineData.outLen = 1.0;
- splineData.outTan = 0;
- colorCurve.appendControlPoint(ColorControlPoint(2, QColor(0, 255, 0, 255), eBezierSpline, splineData));
- splineData.inLen = 1.0;
- splineData.inTan = 0;
- splineData.outLen = 1.0;
- splineData.outTan = 0;
- colorCurve.appendControlPoint(ColorControlPoint(3, QColor(0, 0, 255, 128), eBezierSpline, splineData));
- splineData.inLen = 1.0;
- splineData.inTan = 0;
- splineData.outLen = 1.0;
- splineData.outTan = 0;
- colorCurve.appendControlPoint(ColorControlPoint(4, QColor(255, 0, 0, 0), eBezierSpline, splineData));
- }
-
- ColorCurve& alphaCurve = attribute->alphaCurve;
- alphaCurve.initValueRange(-1, 4);
- alphaCurve.appendControlPoint(ColorControlPoint(-1, QColor(0, 0, 0, 0), eDiscret));
- alphaCurve.appendControlPoint(ColorControlPoint(1, QColor(0, 0, 0, 255), eLinear));
- alphaCurve.appendControlPoint(ColorControlPoint(2, QColor(0, 0, 0, 80), eLinear));
- alphaCurve.appendControlPoint(ColorControlPoint(4, QColor(0, 0, 0, 255), eLinear));
- }
-
- attribute = new ColorAttribute("Color_AddRemove_ChangeTangent", true, true, true);
-
- attributes.push_back(attribute);
-
- {
- ColorCurve& colorCurve = attribute->colorCurve;
- colorCurve.initValueRange(-1, 4);
- colorCurve.appendControlPoint(ColorControlPoint(-1, QColor(255, 0, 0, 0), eLinear));
- //colorCurve.appendControlPoint(ColorControlPoint(0, QColor(0, 255, 0, 255), eLinear));
- //colorCurve.appendControlPoint(ColorControlPoint(0.5, QColor(0, 0, 255, 255), eLinear));
- //colorCurve.appendControlPoint(ColorControlPoint(1, QColor(255, 0, 0, 0), eLinear));
- {
- BezierSplineData splineData;
- //splineData.inLen = 0;
- //splineData.inTan = 0;
- //splineData.outLen = 1.0;
- //splineData.outTan = 0;
- //colorCurve.appendControlPoint(ColorControlPoint(2, QColor(0, 255, 0, 255), eBezierSpline, splineData));
- //splineData.inLen = 1.0;
- //splineData.inTan = 0;
- //splineData.outLen = 1.0;
- //splineData.outTan = 0;
- //colorCurve.appendControlPoint(ColorControlPoint(3, QColor(0, 0, 255, 128), eBezierSpline, splineData));
- splineData.inLen = 1.0;
- splineData.inTan = 0;
- splineData.outLen = 1.0;
- splineData.outTan = 0;
- colorCurve.appendControlPoint(ColorControlPoint(4, QColor(0, 255, 0, 0), eBezierSpline, splineData));
- }
-
- ColorCurve& alphaCurve = attribute->alphaCurve;
- alphaCurve.initValueRange(-1, 4);
- alphaCurve.appendControlPoint(ColorControlPoint(-1, QColor(0, 0, 0, 0), eDiscret));
- //alphaCurve.appendControlPoint(ColorControlPoint(1, QColor(0, 0, 0, 255), eLinear));
- //alphaCurve.appendControlPoint(ColorControlPoint(2, QColor(0, 0, 0, 80), eLinear));
- alphaCurve.appendControlPoint(ColorControlPoint(4, QColor(0, 0, 0, 255), eLinear));
- }
-
- _colorAttributes = attributes;
- _curveEditor->setColorCurveAttributes(_colorAttributes);
- }
-}
diff --git a/tools/CurveEditor/source/GraphEditorTestApp/CurveEditorTestApp.h b/tools/CurveEditor/source/GraphEditorTestApp/CurveEditorTestApp.h
deleted file mode 100644
index ed68141..0000000
--- a/tools/CurveEditor/source/GraphEditorTestApp/CurveEditorTestApp.h
+++ /dev/null
@@ -1,49 +0,0 @@
-#ifndef GRAPHEDITORTESTAPP_H
-#define GRAPHEDITORTESTAPP_H
-
-#include <QtWidgets/QWidget>
-
-namespace nvidia {
-namespace CurveEditor {
-
-class CurveEditorMainWindow;
-class CurveAttributeBase;
-class CurveAttribute;
-class ColorAttribute;
-
-} // namespace CurveEditor
-} // namespace nvidia
-
-using namespace nvidia::CurveEditor;
-
-namespace Ui
-{
- class CurveEditorTestAppClass;
-}
-
-class CurveEditorTestApp : public QWidget
-{
- Q_OBJECT
-
-public:
- CurveEditorTestApp(QWidget *parent = 0, Qt::WindowFlags flags = 0);
- ~CurveEditorTestApp();
-
-private slots:
- void on_btnCurveEditor_clicked(void);
- void onCurveAttributeChanged(nvidia::CurveEditor::CurveAttribute* attribute);
- void onColorAttributeChanged(nvidia::CurveEditor::ColorAttribute* attribute);
- void onReloadColorAttributeTexture(nvidia::CurveEditor::ColorAttribute* attribute, bool reloadColorTex, int selectedCtrlPntIndex);
-
-private:
- void _fillCurveAttributes();
- void _fillColorAttributes();
-
-private:
- Ui::CurveEditorTestAppClass* ui;
- CurveEditorMainWindow* _curveEditor;
- std::vector<CurveAttributeBase*> _curveAttributes;
- std::vector<ColorAttribute*> _colorAttributes;
-};
-
-#endif // GRAPHEDITORTESTAPP_H
diff --git a/tools/CurveEditor/source/GraphEditorTestApp/CurveEditorTestApp.qrc b/tools/CurveEditor/source/GraphEditorTestApp/CurveEditorTestApp.qrc
deleted file mode 100644
index 7537c0c..0000000
--- a/tools/CurveEditor/source/GraphEditorTestApp/CurveEditorTestApp.qrc
+++ /dev/null
@@ -1,4 +0,0 @@
-<RCC>
- <qresource prefix="CurveEditorTestApp">
- </qresource>
-</RCC>
diff --git a/tools/CurveEditor/source/GraphEditorTestApp/CurveEditorTestApp.ui b/tools/CurveEditor/source/GraphEditorTestApp/CurveEditorTestApp.ui
deleted file mode 100644
index 67df7d7..0000000
--- a/tools/CurveEditor/source/GraphEditorTestApp/CurveEditorTestApp.ui
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>CurveEditorTestAppClass</class>
- <widget class="QWidget" name="CurveEditorTestAppClass">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>400</width>
- <height>300</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>CurveEditorTestApp</string>
- </property>
- <widget class="QPushButton" name="btnCurveEditor">
- <property name="geometry">
- <rect>
- <x>160</x>
- <y>120</y>
- <width>75</width>
- <height>23</height>
- </rect>
- </property>
- <property name="text">
- <string>Curve Editor</string>
- </property>
- </widget>
- </widget>
- <layoutdefault spacing="6" margin="11"/>
- <resources>
- <include location="CurveEditorTestApp.qrc"/>
- </resources>
- <connections/>
-</ui>
diff --git a/tools/CurveEditor/source/GraphEditorTestApp/main.cpp b/tools/CurveEditor/source/GraphEditorTestApp/main.cpp
deleted file mode 100644
index ecc3a75..0000000
--- a/tools/CurveEditor/source/GraphEditorTestApp/main.cpp
+++ /dev/null
@@ -1,10 +0,0 @@
-#include "CurveEditorTestApp.h"
-#include <QtWidgets/QApplication>
-
-int main(int argc, char *argv[])
-{
- QApplication a(argc, argv);
- CurveEditorTestApp w;
- w.show();
- return a.exec();
-}