#ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include "Application.h" #include "MouseAddNode.h" void MouseAddNode::mPressEvent(GlGraphWidget *glGraphWidget, QMouseEvent *qMouseEv){ SuperGraph*_superGraph=glGraphWidget->getSuperGraph(); LayoutProxy* mLayout=getProxy(_superGraph,"viewLayout"); ColorsProxy* mColors=getProxy(_superGraph,"viewColors"); node newNode; double x1,y1,z1; switch(qMouseEv->button()) { case QEvent::LeftButton : newNode = _superGraph->addNode(); //if (isViewStrahler()) orderedNode.push_front(newNode); x1 = (double) glGraphWidget->width() - (double) qMouseEv->x() ;y1 = (double) qMouseEv->y();z1 = 0; glGraphWidget->getGlGraph()->changeCoord(x1,y1,z1); mLayout->setNodeValue(newNode, Coord(x1,y1,z1)); mColors->setNodeValue(newNode,((Application *)qApp)->nodeColor); glGraphWidget->redraw(); break; default: break; } } void MouseAddNode::mPaint(GlGraphWidget *){} void MouseAddNode:: mReleaseEvent(GlGraphWidget *glGraphWidget,QMouseEvent *qMouseEv){} void MouseAddNode:: mMoveEvent(GlGraphWidget *glGraphWidget,QMouseEvent *qMouseEv){}