MeshOctTree::MeshOctTree(ObjMesh *mesh) { QTime t; t.start(); m_mesh = mesh; maxDepth = 4; minTrianglesForSplitting = 5; calculateBoundingBox(); m_root = new OctTreeNode(boundingMin, boundingMax, maxDepth-1); for (int i = 0; i < m_mesh->triangles.size(); i++){ insertTriangle(m_mesh->triangles.at(i)); } cout << "done building octtree: "<< t.restart() << "ms" << endl; }
void GraphicUI::createActions() { CreateAct = new QAction(QIcon("images/create.png"), tr("&Create a mind map"), this); connect(CreateAct, SIGNAL(triggered()), this, SLOT(create())); OpenAct = new QAction(QIcon("images/open.png"), tr("&Open a mind map"), this); OpenAct->setStatusTip(tr("Open an existing file")); connect(OpenAct, SIGNAL(triggered()), this, SLOT(open())); SaveAct = new QAction(QIcon("images/save.png"), tr("&Save a mind map"), this); connect(SaveAct, SIGNAL(triggered()), this, SLOT(save())); ExitAct = new QAction(QIcon("images/exit.png"), tr("&Exit"), this); ExitAct->setStatusTip(tr("Exit the application")); connect(ExitAct, SIGNAL(triggered()), this, SLOT(close())); EditAct = new QAction(QIcon("images/edit.png"), tr("&Edit"), this); connect(EditAct, SIGNAL(triggered()), this, SLOT(edit())); DeleteAct = new QAction(QIcon("images/delete.png"), tr("&Delete"), this); connect(DeleteAct, SIGNAL(triggered()), this, SLOT(deleteNode())); InsertAChildAct = new QAction(QIcon("images/child.png"), tr("&Insert a child"), this); connect(InsertAChildAct, SIGNAL(triggered()), this, SLOT(insertChild())); InsertASiblingAct = new QAction(QIcon("images/silbing.png"), tr("&Insert a silbing"), this); connect(InsertASiblingAct, SIGNAL(triggered()), this, SLOT(insertSilbing())); InsertAParentAct = new QAction(QIcon("images/parent.png"), tr("&Insert a parent"), this); connect(InsertAParentAct, SIGNAL(triggered()), this, SLOT(insertParent())); AboutAct = new QAction(QIcon("images/about.png"), tr("&About"), this); connect(AboutAct, SIGNAL(triggered()), this, SLOT(about())); CutAct = new QAction(QIcon("images/cut.png"), tr("&Cut"), this); connect(CutAct, SIGNAL(triggered()), this, SLOT(cut())); CopyAct = new QAction(QIcon("images/copy.png"), tr("&Copy"), this); connect(CopyAct, SIGNAL(triggered()), this, SLOT(copy())); PasteAct = new QAction(QIcon("images/paste.png"), tr("&Paste"), this); connect(PasteAct, SIGNAL(triggered()), this, SLOT(paste())); RedoAct = new QAction(QIcon("images/redo.png"), tr("&Redo"), this); connect(RedoAct, SIGNAL(triggered()), this, SLOT(redo())); UndoAct = new QAction(QIcon("images/undo.png"), tr("&Undo"), this); connect(UndoAct, SIGNAL(triggered()), this, SLOT(undo())); InsertARectangleAct = new QAction(QIcon("images/rectangle.png"), tr("&Insert a rectangle"), this); connect(InsertARectangleAct, SIGNAL(triggered()), this, SLOT(insertRectangle())); InsertACircleAct = new QAction(QIcon("images/circle.png"), tr("&Insert a circle"), this); connect(InsertACircleAct, SIGNAL(triggered()), this, SLOT(insertCircle())); InsertATriangleAct = new QAction(QIcon("images/triangle.png"), tr("&Insert a triangle"), this); connect(InsertATriangleAct, SIGNAL(triggered()), this, SLOT(insertTriangle())); UpAct = new QAction(QIcon("images/up.png"), tr("&Up"), this); connect(UpAct, SIGNAL(triggered()), this, SLOT(up())); DownAct = new QAction(QIcon("images/down.png"), tr("&Down"), this); connect(DownAct, SIGNAL(triggered()), this, SLOT(down())); ExpandAct = new QAction(QIcon("images/expand.png"), tr("&Expand"), this); connect(ExpandAct, SIGNAL(triggered()), this, SLOT(expand())); CollapseAct = new QAction(QIcon("images/collapse.png"), tr("&Collapse"), this); connect(CollapseAct, SIGNAL(triggered()), this, SLOT(collapse())); ExpandOneAct = new QAction(QIcon("images/expand2.png"), tr("&Expand"), this); connect(ExpandOneAct, SIGNAL(triggered()), this, SLOT(expandOne())); CollapseOneAct = new QAction(QIcon("images/collapse2.png"), tr("&Collapse"), this); connect(CollapseOneAct, SIGNAL(triggered()), this, SLOT(collapseOne())); ClearAct = new QAction(QIcon("images/clear.png"), tr("&Clear"), this); connect(ClearAct, SIGNAL(triggered()), this, SLOT(clear())); initialAction(); GraphicAction.push_back(DeleteAct); GraphicAction.push_back(InsertAChildAct); GraphicAction.push_back(InsertASiblingAct); GraphicAction.push_back(InsertAParentAct); GraphicAction.push_back(EditAct); GraphicAction.push_back(CutAct); GraphicAction.push_back(CopyAct); GraphicAction.push_back(PasteAct); GraphicAction.push_back(RedoAct); GraphicAction.push_back(UndoAct); GraphicAction.push_back(InsertARectangleAct); GraphicAction.push_back(InsertACircleAct); GraphicAction.push_back(InsertATriangleAct); GraphicAction.push_back(UpAct); GraphicAction.push_back(DownAct); GraphicAction.push_back(ExpandAct); GraphicAction.push_back(CollapseAct); GraphicAction.push_back(ExpandOneAct); GraphicAction.push_back(CollapseOneAct); GraphicAction.push_back(ClearAct); Gui_presentation->setGraphicAction(GraphicAction); }