summaryrefslogtreecommitdiffstats
path: root/Project/TransferFunction.cpp
diff options
context:
space:
mode:
authorThales1330 <thaleslima.ufu@gmail.com>2017-01-28 14:50:12 -0200
committerThales1330 <thaleslima.ufu@gmail.com>2017-01-28 14:50:12 -0200
commit5e7c19ae397164dd718b2593663cee5d1be687cd (patch)
treeea14141c3f4bb83ea8448cf017dfeb5b211611a0 /Project/TransferFunction.cpp
parent10bb7105946bc0a892a9daf42ec5181ad9994fcf (diff)
downloadPSP.git-5e7c19ae397164dd718b2593663cee5d1be687cd.tar.gz
PSP.git-5e7c19ae397164dd718b2593663cee5d1be687cd.tar.xz
PSP.git-5e7c19ae397164dd718b2593663cee5d1be687cd.zip
Node bug fixes, tf form implemented
Diffstat (limited to 'Project/TransferFunction.cpp')
-rw-r--r--Project/TransferFunction.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/Project/TransferFunction.cpp b/Project/TransferFunction.cpp
index b295864..74314a2 100644
--- a/Project/TransferFunction.cpp
+++ b/Project/TransferFunction.cpp
@@ -1,4 +1,5 @@
#include "TransferFunction.h"
+#include "TransferFunctionForm.h"
TransferFunction::TransferFunction()
{
@@ -48,7 +49,7 @@ void TransferFunction::Draw(wxPoint2DDouble translation, double scale) const
linePts.push_back(wxPoint2DDouble(m_position.m_x - m_width / 2 + 5 + m_borderSize, m_position.m_y));
linePts.push_back(wxPoint2DDouble(m_position.m_x + m_width / 2 - 5 - m_borderSize, m_position.m_y));
DrawLine(linePts);
-
+
DrawNodes();
glEnable(GL_TEXTURE_2D);
@@ -188,4 +189,19 @@ void TransferFunction::UpdateTFText()
wxString num, den;
GetTFString(num, den);
SetText(num, den);
+ if(m_nodeList.size() == 2) {
+ m_nodeList[0].SetPosition(m_position + wxPoint2DDouble(-m_width / 2, 0));
+ m_nodeList[1].SetPosition(m_position + wxPoint2DDouble(m_width / 2, 0));
+ }
+}
+
+bool TransferFunction::ShowForm(wxWindow* parent, Element* element)
+{
+ TransferFunctionForm* tfForm = new TransferFunctionForm(parent, this);
+ if(tfForm->ShowModal() == wxID_OK) {
+ tfForm->Destroy();
+ return true;
+ }
+ tfForm->Destroy();
+ return false;
}