From ff8dddcf84d766be5f9ff8af79f4bedfdf06d03f Mon Sep 17 00:00:00 2001 From: Guillaume Jacquemin Date: Sat, 10 Aug 2013 13:05:07 +0300 Subject: [PATCH] IanniX 0.9.11 RC1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - rare bug with file saving fixed (not reproducible and not enough info on bug — so fixed in theory) - bug with abusive triggering while looping on a curve fixed - new "factor of elasticity" parameter on curves (made with points - not equations or circles -) making the curve "elastic" while moving points - new "Save As" and "Close" menus --- .DS_Store | Bin 21508 -> 21508 bytes Examples/Shape with Xenakis Score.iannix | 2 +- IanniX.pro.user | 2 +- gui/uiinspector.cpp | 11 +- gui/uiinspector.ui | 273 +++++++++++++++-------- gui/uiview.cpp | 6 +- gui/uiview.ui | 18 ++ iannix_cmd.h | 2 +- iannixapp.cpp | 1 + items/uitreeview.cpp | 2 +- misc/applicationexecute.cpp | 2 + misc/applicationexecute.h | 1 + objects/nxcursor.cpp | 18 +- objects/nxcurve.cpp | 40 ++-- objects/nxcurve.h | 2 +- objects/nxtrigger.cpp | 20 +- 16 files changed, 268 insertions(+), 132 deletions(-) diff --git a/.DS_Store b/.DS_Store index bf12a3c9cc29ed6c952ec7d15d8861e0ec7cb793..73932c88fbe1f6d35b8648f08dc3692c46b46dba 100644 GIT binary patch delta 72 zcmV-O0Jr~yr~!ni0gz7td9hHt4*@unkP#TOBoN92laL^C95XXDEFdvCFnuf_dp9>Q eEFd&9IDLHy2nY!fppzaUFtg0NMY9r~!ni0gz7tc(G8s4*@rmkP#TOBoN92v$Ygf3z2}wvkM^kGZWtqbpQYW diff --git a/Examples/Shape with Xenakis Score.iannix b/Examples/Shape with Xenakis Score.iannix index b9d1ac9..693248c 100644 --- a/Examples/Shape with Xenakis Score.iannix +++ b/Examples/Shape with Xenakis Score.iannix @@ -52,7 +52,7 @@ function addLine(lineIndex, start, end) { /* * //APP VERSION: NEVER EVER REMOVE THIS LINE - * Made with IanniX 0.9.0 + * Made with IanniX 0.9.11 * //APP VERSION: NEVER EVER REMOVE THIS LINE */ diff --git a/IanniX.pro.user b/IanniX.pro.user index 9d45ca0..fb3ea2a 100644 --- a/IanniX.pro.user +++ b/IanniX.pro.user @@ -1,6 +1,6 @@ - + ProjectExplorer.Project.ActiveTarget diff --git a/gui/uiinspector.cpp b/gui/uiinspector.cpp index 866ce3f..719cd51 100644 --- a/gui/uiinspector.cpp +++ b/gui/uiinspector.cpp @@ -39,6 +39,7 @@ UiInspector::UiInspector(QWidget *parent) : Help::syncHelpWith(ui->depthSpin, COMMAND_CURSOR_DEPTH); Help::syncHelpWith(ui->speedFSpin, COMMAND_CURSOR_SPEEDF); Help::syncHelpWith(ui->speedSpin, COMMAND_CURSOR_SPEED); + Help::syncHelpWith(ui->intertiaSpin, COMMAND_CURVE_INERTIE); Help::syncHelpWith(ui->cursorLengthSpin, COMMAND_CURSOR_SPEED); Help::syncHelpWith(ui->triggerOffSpin, COMMAND_TRIGGER_OFF); Help::syncHelpWith(ui->equationPoints, COMMAND_CURVE_EQUATION_POINTS); @@ -303,6 +304,7 @@ void UiInspector::actionInfo() { else if(ui->depthSpin == sender()) Application::current->execute(QString("%1 selection %2").arg(COMMAND_CURSOR_DEPTH).arg(ui->depthSpin->value()), ExecuteSourceGui); else if(ui->speedFSpin == sender()) Application::current->execute(QString("%1 selection %2").arg(COMMAND_CURSOR_SPEEDF).arg(ui->speedFSpin->value()), ExecuteSourceGui); else if(ui->speedSpin == sender()) Application::current->execute(QString("%1 selection %2").arg(COMMAND_CURSOR_SPEED).arg(ui->speedSpin->value()), ExecuteSourceGui); + else if(ui->intertiaSpin == sender()) Application::current->execute(QString("%1 selection %2").arg(COMMAND_CURVE_INERTIE).arg(ui->intertiaSpin->value()), ExecuteSourceGui); else if(ui->triggerOffSpin == sender()) Application::current->execute(QString("%1 selection %2").arg(COMMAND_TRIGGER_OFF).arg(ui->triggerOffSpin->value()), ExecuteSourceGui); else if(ui->pointsLists == sender()) Application::current->execute(QString("%1 selection 1").arg(COMMAND_CURVE_EDITOR), ExecuteSourceGui); else if(ui->pointsResample == sender()) Application::current->execute(QString("%1 selection 1").arg(COMMAND_CURVE_RESAMPLE), ExecuteSourceGui); @@ -616,6 +618,7 @@ void UiInspector::refresh() { change(indexObject, ui->sizeWSpin, curve->getResize().width(), prevCurve->getResize().width()); change(indexObject, ui->sizeHSpin, curve->getResize().height(), prevCurve->getResize().height()); + change(indexObject, ui->intertiaSpin, curve->getInertie(), prevCurve->getInertie()); change(indexObject, ui->equationPoints, curve->getEquationPoints(), prevCurve->getEquationPoints()); change(indexObject, ui->equationType0, curve->getEquationType()==0, prevCurve->getEquationType()==0); change(indexObject, ui->equationType1, curve->getEquationType()==1, prevCurve->getEquationType()==1); @@ -768,9 +771,11 @@ void UiInspector::refresh() { ui->triggerOffLabel->setVisible(showTriggerInfo); ui->triggerOffSpin->setVisible(showTriggerInfo); - ui->sizeHSpin->setVisible(showCurveInfo); - ui->sizeWSpin->setVisible(showCurveInfo); - ui->sizeLabel->setVisible(showCurveInfo); + ui->sizeHSpin->setVisible(showCurvePointsInfo); + ui->sizeWSpin->setVisible(showCurvePointsInfo); + ui->sizeLabel->setVisible(showCurvePointsInfo); + ui->intertiaSpin->setVisible(showCurvePointsInfo); + ui->intertiaLabel->setVisible(showCurvePointsInfo); ui->pointsLabel->setVisible(showCurvePointsInfo); ui->pointsLists->setVisible(showCurvePointsInfo); ui->pointsResample->setVisible(showCurvePointsInfo); diff --git a/gui/uiinspector.ui b/gui/uiinspector.ui index 1ebf652..6ab5990 100644 --- a/gui/uiinspector.ui +++ b/gui/uiinspector.ui @@ -1489,6 +1489,89 @@ if INACTIVE + + + + 10 + + + + + + 85 + 20 + + + + + 85 + 16777215 + + + + ELASTICITY +FACTOR + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + sizeWSpin + + + + + + + + 70 + 30 + + + + + 70 + 16777215 + + + + Set a factor of elasticity making the curve "elastic" while moving points + + + + + + 2 + + + 0.000000000000000 + + + 999999.000000000000000 + + + 0.100000000000000 + + + + + + + Qt::Horizontal + + + + 40 + 1 + + + + + + @@ -4988,8 +5071,8 @@ padding: 0px; actionCCButton() - 64 - 352 + 50 + 58 55 @@ -5004,8 +5087,8 @@ padding: 0px; actionCCButton() - 301 - 352 + 93 + 58 199 @@ -5020,8 +5103,8 @@ padding: 0px; actionCCButton() - 301 - 379 + 93 + 60 282 @@ -5036,8 +5119,8 @@ padding: 0px; actionCCButton() - 64 - 379 + 50 + 60 78 @@ -5052,8 +5135,8 @@ padding: 0px; actionCCButton() - 245 - 455 + 125 + 83 34 @@ -5149,7 +5232,7 @@ padding: 0px; 186 - 195 + 232 390 @@ -5165,7 +5248,7 @@ padding: 0px; 266 - 195 + 232 390 @@ -5180,7 +5263,7 @@ padding: 0px; actionInfo() - 196 + 140 121 @@ -5196,8 +5279,8 @@ padding: 0px; actionInfo() - 266 - 158 + 128 + 125 390 @@ -5212,8 +5295,8 @@ padding: 0px; actionInfo() - 176 - 158 + 97 + 125 390 @@ -5228,8 +5311,8 @@ padding: 0px; actionInfo() - 196 - 196 + 140 + 125 390 @@ -5244,8 +5327,8 @@ padding: 0px; actionInfo() - 313 - 226 + 257 + 118 390 @@ -5260,8 +5343,8 @@ padding: 0px; actionInfo() - 313 - 226 + 257 + 118 390 @@ -5276,8 +5359,8 @@ padding: 0px; actionInfo() - 313 - 259 + 257 + 120 390 @@ -5292,8 +5375,8 @@ padding: 0px; actionInfo() - 330 - 299 + 139 + 133 390 @@ -5308,8 +5391,8 @@ padding: 0px; actionInfo() - 254 - 331 + 135 + 133 390 @@ -5324,8 +5407,8 @@ padding: 0px; actionInfo() - 344 - 331 + 150 + 133 390 @@ -5356,7 +5439,7 @@ padding: 0px; actionInfo() - 372 + 243 124 @@ -5372,8 +5455,8 @@ padding: 0px; actionInfo() - 188 - 265 + 102 + 128 390 @@ -5388,8 +5471,8 @@ padding: 0px; actionInfo() - 278 - 265 + 139 + 128 390 @@ -5404,8 +5487,8 @@ padding: 0px; actionInfo() - 188 - 295 + 102 + 126 390 @@ -5420,8 +5503,8 @@ padding: 0px; actionInfo() - 278 - 295 + 139 + 126 390 @@ -5436,8 +5519,8 @@ padding: 0px; actionInfo() - 188 - 331 + 102 + 127 390 @@ -5452,8 +5535,8 @@ padding: 0px; actionInfo() - 278 - 331 + 139 + 127 390 @@ -5468,8 +5551,8 @@ padding: 0px; actionInfo() - 188 - 361 + 102 + 125 390 @@ -5484,8 +5567,8 @@ padding: 0px; actionInfo() - 278 - 361 + 139 + 125 390 @@ -5500,8 +5583,8 @@ padding: 0px; actionInfo() - 188 - 397 + 102 + 127 390 @@ -5516,8 +5599,8 @@ padding: 0px; actionInfo() - 278 - 397 + 139 + 127 390 @@ -5532,8 +5615,8 @@ padding: 0px; actionInfo() - 188 - 427 + 102 + 127 390 @@ -5548,8 +5631,8 @@ padding: 0px; actionInfo() - 278 - 427 + 139 + 127 390 @@ -5564,8 +5647,8 @@ padding: 0px; actionInfo() - 318 - 157 + 98 + 120 390 @@ -5580,8 +5663,8 @@ padding: 0px; actionInfo() - 221 - 359 + 322 + 406 602 @@ -5597,7 +5680,7 @@ padding: 0px; 213 - 230 + 267 553 @@ -5613,7 +5696,7 @@ padding: 0px; 319 - 329 + 376 560 @@ -5660,8 +5743,8 @@ padding: 0px; actionInfo() - 221 - 290 + 319 + 327 497 @@ -5676,8 +5759,8 @@ padding: 0px; actionInfo() - 221 - 304 + 319 + 346 499 @@ -5692,8 +5775,8 @@ padding: 0px; actionInfo() - 105 - 177 + 98 + 117 488 @@ -5708,8 +5791,8 @@ padding: 0px; actionInfo() - 105 - 196 + 98 + 118 488 @@ -5724,8 +5807,8 @@ padding: 0px; actionInfo() - 105 - 215 + 98 + 119 519 @@ -5740,8 +5823,8 @@ padding: 0px; actionInfo() - 105 - 234 + 98 + 120 512 @@ -5772,8 +5855,8 @@ padding: 0px; actionCCButton() - 265 - 470 + 89 + 65 693 @@ -5788,8 +5871,8 @@ padding: 0px; actionCCButton() - 197 - 536 + 141 + 56 520 @@ -5805,7 +5888,7 @@ padding: 0px; 316 - 264 + 301 702 @@ -5885,7 +5968,7 @@ padding: 0px; 314 - 230 + 267 677 @@ -5900,8 +5983,8 @@ padding: 0px; actionInfo() - 277 - 381 + 303 + 418 1157 @@ -5916,8 +5999,8 @@ padding: 0px; actionInfo() - 277 - 411 + 303 + 435 1160 @@ -5933,7 +6016,7 @@ padding: 0px; 303 - 437 + 452 1125 @@ -5981,7 +6064,7 @@ padding: 0px; 363 - 394 + 425 859 @@ -5997,7 +6080,7 @@ padding: 0px; 363 - 418 + 442 825 @@ -6069,6 +6152,22 @@ padding: 0px; + + intertiaSpin + valueChanged(double) + UiInspector + actionInfo() + + + 135 + 177 + + + 794 + 132 + + + actionTabChange(int) diff --git a/gui/uiview.cpp b/gui/uiview.cpp index 24e24e1..a437e72 100644 --- a/gui/uiview.cpp +++ b/gui/uiview.cpp @@ -56,8 +56,10 @@ UiView::UiView(QWidget *parent) : connect(ui->render, SIGNAL(editingStop()), SLOT(editingStop())); connect(ui->actionNew, SIGNAL(triggered()), ui->render, SLOT(actionNew())); + connect(ui->actionClose_score, SIGNAL(triggered()), ui->render, SLOT(actionNew())); connect(ui->actionOpen, SIGNAL(triggered()), ui->render, SLOT(actionOpen())); connect(ui->actionSave, SIGNAL(triggered()), ui->render, SLOT(actionSave())); + connect(ui->actionSave_score_as, SIGNAL(triggered()), ui->render, SLOT(actionSave_as())); connect(ui->actionImoprt_SVG, SIGNAL(triggered()), SLOT(actionImportSVG())); connect(ui->actionImoprt_Background, SIGNAL(triggered()), SLOT(actionImportBackground())); connect(ui->actionImoprt_Text, SIGNAL(triggered()), SLOT(actionImportText())); @@ -489,7 +491,7 @@ void UiView::actionAddMathCurve() { unToogleDraw(4); ui->render->selectionClear(true); quint16 id = Application::current->execute("add curve auto", ExecuteSourceGui).toUInt(); - Application::current->execute("setequation " + QString::number(id) + " cartesian 5*t, sin(10*t*PI) * exp(1-4*t), cos(4*t*PI)", ExecuteSourceGui); + Application::current->execute("setequation " + QString::number(id) + " cartesian 10*param1*t , sin(param2*20*t*PI) * exp(1-4*param3*t) , 2*param5*cos(8*param4*t*PI)", ExecuteSourceGui); ui->render->selectionAdd((NxObject*)Application::current->getObjectById(id)); ui->inspector->showSpaceTab(); id = Application::current->execute("add cursor auto", ExecuteSourceGui).toUInt(); @@ -502,7 +504,7 @@ void UiView::actionAddMathCurveSimple() { unToogleDraw(4); ui->render->selectionClear(true); quint16 id = Application::current->execute("add curve auto", ExecuteSourceGui).toUInt(); - Application::current->execute("setequation " + QString::number(id) + " cartesian 5*t, sin(10*t*PI) * exp(1-4*t), 0", ExecuteSourceGui); + Application::current->execute("setequation " + QString::number(id) + " cartesian 10*param1*t , sin(param2*20*t*PI) * exp(1-4*param3*t) , 0", ExecuteSourceGui); ui->render->selectionAdd((NxObject*)Application::current->getObjectById(id)); ui->inspector->showSpaceTab(); } diff --git a/gui/uiview.ui b/gui/uiview.ui index fc4b8dc..d19aaf7 100644 --- a/gui/uiview.ui +++ b/gui/uiview.ui @@ -445,7 +445,9 @@ QDialogButtonBox QPushButton { + + @@ -1914,6 +1916,22 @@ QDialogButtonBox QPushButton { Opens the Config tab in Inspector + + + Save score as… + + + Ctrl+Shift+S + + + + + Close score + + + Ctrl+W + + diff --git a/iannix_cmd.h b/iannix_cmd.h index 794c22e..2cf9548 100644 --- a/iannix_cmd.h +++ b/iannix_cmd.h @@ -119,7 +119,7 @@ // BETA FUNCTIONS -#define COMMAND_CURVE_INERTIE "setinertia" +#define COMMAND_CURVE_INERTIE "setelasticity" #define COMMAND_LINE "setline" diff --git a/iannixapp.cpp b/iannixapp.cpp index 039ee92..37fb90a 100644 --- a/iannixapp.cpp +++ b/iannixapp.cpp @@ -335,6 +335,7 @@ void IanniXApp::setHelp() { Help::categories["commands"].infos << HelpInfo(COMMAND_CURVE_POINT , tr("Objects and 3D space"), tr("Defines point position of a curve"), tr(" ")); Help::categories["commands"].infos << HelpInfo(COMMAND_CURVE_POINT_SMOOTH , tr("Objects and 3D space"), tr("Defines smoothed point position of a curve"), tr(" ")); Help::categories["commands"].infos << HelpInfo(COMMAND_CURVE_POINT_RMV , tr("Objects and 3D space"), tr("Removes point from a curve"), tr(" ")); + Help::categories["commands"].infos << HelpInfo(COMMAND_CURVE_INERTIE , tr(""), tr(""), tr(" ")); Help::categories["commands"].infos << HelpInfo(COMMAND_SIZE , tr(""), tr(""), tr(" ")); Help::categories["commands"].infos << HelpInfo(COMMAND_POS , tr("Objects and 3D space"), tr("Changes the absolute position of object"), tr(" ")); Help::categories["commands"].infos << HelpInfo(COMMAND_POS_TRANSLATE , tr("Objects and 3D space"), tr("Translate position of object"), tr(" ")); diff --git a/items/uitreeview.cpp b/items/uitreeview.cpp index f363e02..38db673 100644 --- a/items/uitreeview.cpp +++ b/items/uitreeview.cpp @@ -17,7 +17,7 @@ UiTreeView::UiTreeView(QWidget *parent) : showImport (false); showOpen (false); showSave (false); - showSaveAs (false); + showSaveAs (true); importAsFiles = true; } diff --git a/misc/applicationexecute.cpp b/misc/applicationexecute.cpp index 097bf6a..cc55aa2 100644 --- a/misc/applicationexecute.cpp +++ b/misc/applicationexecute.cpp @@ -1,3 +1,5 @@ #include "applicationexecute.h" ApplicationExecute *ApplicationExecute::current = 0; + + diff --git a/misc/applicationexecute.h b/misc/applicationexecute.h index ef5561b..bbe00bc 100644 --- a/misc/applicationexecute.h +++ b/misc/applicationexecute.h @@ -4,6 +4,7 @@ #include #include "iannix_spec.h" + class ApplicationExecute { public: static ApplicationExecute *current; diff --git a/objects/nxcursor.cpp b/objects/nxcursor.cpp index 4a7b63d..5b0f9fa 100644 --- a/objects/nxcursor.cpp +++ b/objects/nxcursor.cpp @@ -29,8 +29,7 @@ NxCursor::NxCursor(ApplicationCurrent *parent, QTreeWidgetItem *ccParentItem) : timeLocal = 0; timeLocalOld = 0; timeLocalAbsolute = 0; - previousCursorReliable = false; - previousPreviousCursorReliable = false; + previousCursorReliable = previousPreviousCursorReliable = false; cursorAngleCacheSinZ = cursorAngleCacheCosZ = cursorAngleCacheSinY = cursorAngleCacheCosY = 0; cursorPoly = NxPolygon(4); cursorPoly[0] = NxPoint(); @@ -72,6 +71,8 @@ NxCursor::~NxCursor() { glDeleteLists(glListCursor, 1); } void NxCursor::setTime(qreal delta) { + previousPreviousCursorReliable = previousCursorReliable; + if((curve) && (start.count())) { //toto += delta; @@ -132,10 +133,8 @@ void NxCursor::setTime(qreal delta) { } //Preparation of time difference - if(!previousCursorReliable) - timeOld = nextTimeOld; - else - timeOld = time; + if(!previousCursorReliable) timeOld = nextTimeOld; + else timeOld = time; nextTimeOld = timeOld; previousCursorReliable = true; @@ -208,7 +207,6 @@ void NxCursor::calculate() { NxPoint cursorPosDelta = cursorPosOld - cursorPos; previousCursorReliable = true; - previousPreviousCursorReliable = true; qreal angleZ = -qAtan2(cursorPosDelta.x(), cursorPosDelta.y()) * 180.0F / M_PI + 90; qreal angleY = qAtan2(qSqrt(cursorPosDelta.x()*cursorPosDelta.x() + cursorPosDelta.y()*cursorPosDelta.y()), cursorPosDelta.z()) * 180.0F / M_PI + 90; @@ -243,6 +241,10 @@ void NxCursor::calculate() { cursorPos.y() + cursorPoly.at(i).x() * angleSin + cursorPoly.at(i).y() * angleCos, cursorPos.z() + cursorPoly.at(i).z())); + if((!previousCursorReliable) || (!previousPreviousCursorReliable)) + cursorPolyOld = cursorPolyOldOld = cursorPoly; + + calcBoundingRect(); if((cursorPos.sx() != cursorPosOld.sx()) || (cursorPos.sy() != cursorPosOld.sy()) || (cursorPos.sz() != cursorPosOld.sz())) @@ -504,7 +506,7 @@ void NxCursor::trig(bool force) { bool NxCursor::contains(NxTrigger *trigger) const { qint64 timestamp = QDateTime::currentMSecsSinceEpoch(); - if((previousCursorReliable) && (trigger->getActive()) && ((timestamp - trigger->lastTrigTime) > 20)) { + if((previousPreviousCursorReliable) && (trigger->getActive()) && ((timestamp - trigger->lastTrigTime) > 10)) { NxPoint centre1 = trigger->getPos() - NxPoint( (cursorPoly.at(0).x() + cursorPoly.at(1).x() + cursorPoly.at(2).x() + cursorPoly.at(3).x()) / 4., (cursorPoly.at(0).y() + cursorPoly.at(1).y() + cursorPoly.at(2).y() + cursorPoly.at(3).y()) / 4., (cursorPoly.at(0).z() + cursorPoly.at(1).z() + cursorPoly.at(2).z() + cursorPoly.at(3).z()) / 4.); diff --git a/objects/nxcurve.cpp b/objects/nxcurve.cpp index 322478d..ce99533 100644 --- a/objects/nxcurve.cpp +++ b/objects/nxcurve.cpp @@ -330,7 +330,7 @@ void NxCurve::addMousePointAt(const NxPoint & _mousePos, bool remove) { else pathPoints[indexPoint].smooth = true; if(pathPoints.count()) - setPointAt(0, getPathPointsAt(0), getPathPointsAt(0).c1, getPathPointsAt(0).c2, getPathPointsAt(0).smooth); + setPointAt(0, getPathPointsAt(0), getPathPointsAt(0).c1, getPathPointsAt(0).c2, getPathPointsAt(0).smooth); } return; } @@ -361,7 +361,7 @@ void NxCurve::addMousePointAt(const NxPoint & _mousePos, bool remove) { pathPoints[indexPoint].smooth = pathPoints.at(indexPoint-1).smooth; } if(pathPoints.count()) - setPointAt(0, getPathPointsAt(0), getPathPointsAt(0).c1, getPathPointsAt(0).c2, getPathPointsAt(0).smooth); + setPointAt(0, getPathPointsAt(0), getPathPointsAt(0).c1, getPathPointsAt(0).c2, getPathPointsAt(0).smooth); calcBoundingRect(); return; } @@ -416,11 +416,22 @@ const NxPoint & NxCurve::setPointAt(quint16 index, const NxPoint & point, const pointStruct.c2 = c2; pointStruct.smooth = smooth; pathPoints.append(pointStruct); - pathPointsDest.append(pointStruct); hasCreate = true; } else { - if(inertie == 1) { + if((inertie != 1) && (inertie > 0)) { + while(pathPointsDest.count() <= index) + pathPointsDest.append(pathPoints.at(index)); + pathPointsDest[index].setX(point.x()); + pathPointsDest[index].setY(point.y()); + pathPointsDest[index].setZ(point.z()); + pathPointsDest[index].setSx(point.sx()); + pathPointsDest[index].setSy(point.sy()); + pathPointsDest[index].setSz(point.sz()); + pathPointsDest[index].c1 = c1; + pathPointsDest[index].c2 = c2; + } + else { pathPoints[index].setX(point.x()); pathPoints[index].setY(point.y()); pathPoints[index].setZ(point.z()); @@ -431,17 +442,6 @@ const NxPoint & NxCurve::setPointAt(quint16 index, const NxPoint & point, const pathPoints[index].c2 = c2; pathPoints[index].smooth = smooth; } - else { - pathPointsDest[index].setX(point.x()); - pathPointsDest[index].setY(point.y()); - pathPointsDest[index].setZ(point.z()); - pathPointsDest[index].setSx(point.sx()); - pathPointsDest[index].setSy(point.sy()); - pathPointsDest[index].setSz(point.sz()); - pathPointsDest[index].c1 = c1; - pathPointsDest[index].c2 = c2; - pathPointsDest[index].smooth = smooth; - } } if(fromGui) { @@ -501,9 +501,11 @@ const NxPoint & NxCurve::setPointAt(quint16 index, const NxPoint & point, const void NxCurve::computeInertie() { if((inertie != 1) && (inertie > 0)) { for(quint16 index = 0 ; index < pathPoints.count() ; index++) { - pathPoints[index].setX (pathPoints.at(index).x() + (pathPointsDest.at(index).x() - pathPoints.at(index).x()) / inertie); - pathPoints[index].setY (pathPoints.at(index).y() + (pathPointsDest.at(index).y() - pathPoints.at(index).y()) / inertie); - pathPoints[index].setZ (pathPoints.at(index).z() + (pathPointsDest.at(index).z() - pathPoints.at(index).z()) / inertie); + while(pathPointsDest.count() <= index) + pathPointsDest.append(pathPoints.at(index)); + pathPoints[index].setX (pathPoints.at(index).x() + (pathPointsDest.at(index).x() - pathPoints.at(index).x()) / inertie); + pathPoints[index].setY (pathPoints.at(index).y() + (pathPointsDest.at(index).y() - pathPoints.at(index).y()) / inertie); + pathPoints[index].setZ (pathPoints.at(index).z() + (pathPointsDest.at(index).z() - pathPoints.at(index).z()) / inertie); pathPoints[index].setSx(pathPoints.at(index).sx() + (pathPointsDest.at(index).sx() - pathPoints.at(index).sx()) / inertie); pathPoints[index].setSy(pathPoints.at(index).sy() + (pathPointsDest.at(index).sy() - pathPoints.at(index).sy()) / inertie); pathPoints[index].setSz(pathPoints.at(index).sz() + (pathPointsDest.at(index).sz() - pathPoints.at(index).sz()) / inertie); @@ -977,7 +979,7 @@ void NxCurve::resample(quint16 nbPoints, bool smooth) { pathPoints.append(cPt); } if(pathPoints.count()) - setPointAt(0, getPathPointsAt(0), getPathPointsAt(0).c1, getPathPointsAt(0).c2, getPathPointsAt(0).smooth); + setPointAt(0, getPathPointsAt(0), getPathPointsAt(0).c1, getPathPointsAt(0).c2, getPathPointsAt(0).smooth); curveType = CurveTypePoints; calcBoundingRect(); glListRecreate = true; diff --git a/objects/nxcurve.h b/objects/nxcurve.h index 30481e0..1cfaed8 100644 --- a/objects/nxcurve.h +++ b/objects/nxcurve.h @@ -43,7 +43,7 @@ class NxCurve : public NxObject { Q_PROPERTY(bool displaycurveeditor READ getShowPathPointsEditor WRITE setShowPathPointsEditor) Q_PROPERTY(bool displaycurveresample READ getShowPathPointsResample WRITE setShowPathPointsResample) - Q_PROPERTY(qreal setinertia READ getInertie WRITE setInertie) + Q_PROPERTY(qreal setelasticity READ getInertie WRITE setInertie) Q_PROPERTY(qreal setlength READ getPathLength WRITE setPathLength) Q_PROPERTY(QString setresize READ getResizeStr WRITE setResizeStr) Q_PROPERTY(qreal setresizef READ getResizeF WRITE setResizeF) diff --git a/objects/nxtrigger.cpp b/objects/nxtrigger.cpp index d9b9a42..2cb6746 100644 --- a/objects/nxtrigger.cpp +++ b/objects/nxtrigger.cpp @@ -160,13 +160,17 @@ void NxTrigger::trig(NxObject *cursor) { //} } void NxTrigger::trigEnd() { - NxObject *cursorTriggedTmp = cursorTrigged; - bool isMidiMessage = false; - foreach(const QVector & messagePattern, this->getMessagePatterns()) { - if(messagePattern.at(0).startsWith("midi")) - isMidiMessage = true; + if(triggerOff > 0) { + NxObject *cursorTriggedTmp = cursorTrigged; + bool sendMessage = false; + foreach(const QVector & messagePattern, this->getMessagePatterns()) { + foreach(const QByteArray &messageArgument, messagePattern) { + if(messageArgument == "trigger_value") + sendMessage = true; + } + } + cursorTrigged = 0; + if(sendMessage) + MessageManager::outgoingMessage(MessageManagerDestination(this, this, cursorTriggedTmp)); } - cursorTrigged = 0; - if(triggerOff > 0 && !isMidiMessage) - MessageManager::outgoingMessage(MessageManagerDestination(this, this, cursorTriggedTmp)); }