//多边形编辑模式 void Cocos2dxView::mousePressInPolygonEdit(QMouseEvent *event) { qDebug("press polygon1"); QPointF pos = event->localPos(); EditorScene *scene = getEditorScene(); //执行操作 if (m_curPolyOper == NULL) { m_curPolyOper = new PolygonEditOper(scene->getObjectLayer()); OperationManageX->exec(m_curPolyOper); } assert(m_curPolyOper); m_curPolyOper->pushPoint(convertToOpenglPoint(QCursor::pos())); }
void Cocos2dxView::mouseReleaseInCommonEdit(QMouseEvent *event) { if (m_commonPos != event->localPos()) return; ListWidgetItem *item = (ListWidgetItem*)m_listwidget->currentItem(); if (!item) return; EditorScene *scene = getEditorScene(); //执行操作 std::string tpname = std::string(item->text().toLatin1().data()); std::string filename = std::string(item->getAbsoluteFilePath().toLatin1().data()); OperationManageX->exec(new CommonEditOper(tpname, scene->getObjectLayer(), convertToOpenglPoint(QCursor::pos()), item->file_info)); }