void QtViewController::showActionMenu(const QPoint &pos)
{
  if (m_qtView != NULL) {
    QMenu menu;
    menu.addAction(tr("&Fit all"), m_qtView, SLOT(fitAll()));
    menu.exec(QCursor::pos());
  }
}
Beispiel #2
0
void OccView::initializeGL()
{
    WId handle = winId();

#if defined(Q_OS_WIN32)
    Handle(WNT_Window) wind = new WNT_Window((Aspect_Handle)handle);
#elif defined(Q_OS_OSX)
    Handle(Cocoa_Window) wind = new Cocoa_Window((NSView*)handle);
#elif defined(Q_OS_LINUX)
    Handle(Xw_Window) wind = new Xw_Window(m_document->viewer()->Driver()->GetDisplayConnection(), handle);
#endif

    m_view->SetWindow(wind);
    m_view->SetBackgroundColor(Quantity_NOC_BLACK);
    m_view->TriedronDisplay(Aspect_TOTP_LEFT_LOWER, Quantity_NOC_GOLD, 0.08, V3d_ZBUFFER);
    fitAll();
}
Beispiel #3
0
int View3D::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: selectionChanged(); break;
        case 1: fitAll(); break;
        case 2: fitArea(); break;
        case 3: zoom(); break;
        case 4: zoomplus(); break;
        case 5: zoomminus(); break;
        case 6: pan(); break;
        case 7: globalPan(); break;
        case 8: front(); break;
        case 9: back(); break;
        case 10: top(); break;
        case 11: bottom(); break;
        case 12: left(); break;
        case 13: right(); break;
        case 14: axo(); break;
        case 15: rotation(); break;
        case 16: reset(); break;
        case 17: hlrOn(); break;
        case 18: hlrOff(); break;
        case 19: updateToggled((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 20: onBackground(); break;
        case 21: timerEvent(); break;
        case 22: onWireframe(); break;
        case 23: onShading(); break;
        case 24: onColor(); break;
        case 25: onMaterial(); break;
        case 26: onMaterial((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 27: onTransparency(); break;
        case 28: onTransparency((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 29: onDelete(); break;
        case 30: onUnDelete(); break;
        }
        _id -= 31;
    }
    return _id;
}
Beispiel #4
0
void MainWindow::createActions() {
  printAct = new QAction(QIcon(":/images/print.png"), tr("&Print..."), this);
  //   printAct->setShortcut(QKeySequence::Print);
  printAct->setStatusTip(tr("Print the document"));
  connect(printAct, SIGNAL(triggered()), this, SLOT(printFile()));
  
  // Added by AiO to Open a new file
  openAct = new QAction(tr("&Open"), this);
  openAct->setShortcut(Qt::Key_O | Qt::CTRL);
  openAct->setStatusTip(tr("Open a new file"));
  connect(openAct, SIGNAL(triggered()), this, SLOT(open()));
  
  saveAsAct = new QAction(tr("Save &As..."), this);
  //   saveAsAct->setShortcut(QKeySequence::SaveAs);
  saveAsAct->setStatusTip(tr("Save the document under a new name"));
  connect(saveAsAct, SIGNAL(triggered()), this, SLOT(saveAs()));

  exitAct = new QAction(tr("E&xit"), this);
  exitAct->setShortcut(Qt::Key_Escape);
  exitAct->setStatusTip(tr("Exit the application"));
  connect(exitAct, SIGNAL(triggered()), this, SLOT(close()));

  normalAct = new QAction(QIcon(":/images/normalView.png"), tr("Normal view"), this);
  normalAct->setCheckable(true);
  normalAct->setChecked(true);
  normalAct->setShortcut(Qt::Key_N);
  normalAct->setStatusTip(tr("Normal view"));
  connect(normalAct, SIGNAL(triggered()), this, SLOT(normal()));

  polarAct = new QAction(QIcon(":/images/polar.png"), tr("Polar fish eye"), this);
  polarAct->setCheckable(true);
  polarAct->setShortcut(Qt::Key_P | Qt::CTRL);
  polarAct->setStatusTip(tr("Polar fish eye"));
  connect(polarAct, SIGNAL(triggered()), this, SLOT(polar()));

  polarFixedAct = new QAction(QIcon(":/images/fixedPolar.png"), tr("Fixed radius polar fish eye"), this);
  polarFixedAct->setCheckable(true);
  polarFixedAct->setShortcut(Qt::Key_P);
  polarFixedAct->setStatusTip(tr("Fixed radius polar fish eye"));
  connect(polarFixedAct, SIGNAL(triggered()), this, SLOT(polarFixed()));

  cartAct = new QAction(QIcon(":/images/cartesian.png"), tr("Cartesian fish eye"), this);
  cartAct->setCheckable(true);
  cartAct->setShortcut(Qt::Key_C | Qt::CTRL);
  cartAct->setStatusTip(tr("Cartesian fish eye"));
  connect(cartAct, SIGNAL(triggered()), this, SLOT(cart()));

  cartFixedAct = new QAction(QIcon(":/images/fixedCartesian.png"), tr("Fixed radius cartesian fish eye"), this);
  cartFixedAct->setCheckable(true);
  cartFixedAct->setShortcut(Qt::Key_C);
  cartFixedAct->setStatusTip(tr("Fixed radius cartesian fish eye"));
  connect(cartFixedAct, SIGNAL(triggered()), this, SLOT(cartFixed()));

  showLabelsAct = new QAction(QIcon(":/images/labelEdges.png"), tr("Display edge labels"), this);
  showLabelsAct->setCheckable(true);
  showLabelsAct->setStatusTip(tr("Display edge labels"));
  connect(showLabelsAct, SIGNAL(triggered()), this, SLOT(showLabels()));
  //   connect(showLabelsAct, SIGNAL(toggled(bool)), this, SLOT(toggleShowLabels(bool)));

  zoomInAct = new QAction(QIcon(":/images/zoomIn.png"), tr("Zoom in"), this);
  zoomInAct->setShortcut(Qt::Key_Plus);
  zoomInAct->setStatusTip(tr("Zoom in"));
  connect(zoomInAct, SIGNAL(triggered()), this, SLOT(zoomIn()));

  zoomOutAct = new QAction(QIcon(":/images/zoomOut.png"), tr("Zoom out"), this);
  zoomOutAct->setShortcut(Qt::Key_Minus);
  zoomOutAct->setStatusTip(tr("Zoom out"));
  connect(zoomOutAct, SIGNAL(triggered()), this, SLOT(zoomOut()));

  zoomNormalAct = new QAction(QIcon(":/images/zoomNormal.png"), tr("Zoom normal"), this);
  zoomNormalAct->setShortcut(Qt::Key_0);
  zoomNormalAct->setStatusTip(tr("Zoom normal (100%)"));
  connect(zoomNormalAct, SIGNAL(triggered()), this, SLOT(zoomNormal()));

  fitAllAct = new QAction(QIcon(":/images/fitAll.png"), tr("Fit all graph"), this);
  fitAllAct->setShortcut(Qt::Key_M);
  fitAllAct->setStatusTip(tr("Fit all graph"));
  connect(fitAllAct, SIGNAL(triggered()), this, SLOT(fitAll()));

  positOriginAct = new QAction(QIcon(":/images/positOrigin.png"), tr("Position on origin"), this);
  positOriginAct->setShortcut(Qt::Key_O);
  positOriginAct->setStatusTip(tr("Position on origin"));
  connect(positOriginAct, SIGNAL(triggered()), this, SLOT(positOrigin()));

  easyPanAct = new QAction(tr("Easy graph panning"), this);
  easyPanAct->setCheckable(true);
  easyPanAct->setStatusTip(tr("Easy graph panning"));
  connect(easyPanAct, SIGNAL(triggered()), this, SLOT(easyPan()));

  helpAct = new QAction(tr("Help"), this);
  helpAct->setShortcut(Qt::Key_F1);
  helpAct->setStatusTip(tr("Display help"));
  connect(helpAct, SIGNAL(triggered()), this /*qApp*/, SLOT(help()));

  aboutAct = new QAction(tr("&About..."), this);
  aboutAct->setStatusTip(tr("Show the About box"));
  connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));
  
  //Added by AiO  new action for search window
  searchAct = new QAction(tr("&Search"), this);
  searchAct->setShortcut(Qt::Key_F5);
  searchAct->setStatusTip(tr("Search F5"));
  connect(searchAct, SIGNAL(triggered()), this, SLOT(showSearch()));

}
Beispiel #5
0
void QoccHarnessWindow::createActions()
{
    newAction = new QAction(tr("&New"), this);
    newAction->setShortcut(tr("Ctrl+N"));
    newAction->setStatusTip(tr("Create a new file"));
    connect(newAction, SIGNAL(triggered()), this, SLOT(newFile()));

    openAction = new QAction(tr("&Open..."), this);
    openAction->setShortcut(tr("Ctrl+O"));
    openAction->setStatusTip(tr("Open an existing file"));
    connect(openAction, SIGNAL(triggered()), this, SLOT(open()));

    saveAction = new QAction(tr("&Save"), this);
    saveAction->setShortcut(tr("Ctrl+S"));
    saveAction->setStatusTip(tr("Save the document to disk"));
    connect(saveAction, SIGNAL(triggered()), this, SLOT(save()));

    printAction = new QAction(tr("&Print..."), this);
    printAction->setShortcut(tr("Ctrl+P"));
    printAction->setStatusTip(tr("Print the document"));
    connect(printAction, SIGNAL(triggered()), this, SLOT(print()));

    exitAction = new QAction(tr("E&xit"), this);
    exitAction->setShortcut(tr("Ctrl+X"));
    exitAction->setStatusTip(tr("Exit the application"));
    connect(exitAction, SIGNAL(triggered()), this, SLOT(close()));

    undoAction = new QAction(tr("&Undo"), this);
    undoAction->setShortcut(tr("Ctrl+Z"));
    undoAction->setStatusTip(tr("Undo the last operation"));
    connect(undoAction, SIGNAL(triggered()), this, SLOT(undo()));

    redoAction = new QAction(tr("&Redo"), this);
    redoAction->setShortcut(tr("Ctrl+Y"));
    redoAction->setStatusTip(tr("Redo the last operation"));
    connect(redoAction, SIGNAL(triggered()), this, SLOT(redo()));

    cutAction = new QAction(tr("Cu&t"), this);
    cutAction->setShortcut(tr("Ctrl+X"));
    cutAction->setStatusTip(tr("Cut the current selection's contents to the clipboard"));
    connect(cutAction, SIGNAL(triggered()), this, SLOT(cut()));

    copyAction = new QAction(tr("&Copy"), this);
    copyAction->setShortcut(tr("Ctrl+C"));
    copyAction->setStatusTip(tr("Copy the current selection's contents to the clipboard"));
    connect(copyAction, SIGNAL(triggered()), this, SLOT(copy()));

    pasteAction = new QAction(tr("&Paste"), this);
    pasteAction->setShortcut(tr("Ctrl+V"));
    pasteAction->setStatusTip(tr("Paste the clipboard's contents into the current selection"));
    connect(pasteAction, SIGNAL(triggered()), this, SLOT(paste()));

    aboutAction = new QAction(tr("&About"), this);
    aboutAction->setStatusTip(tr("Show the application's About box"));
    connect(aboutAction, SIGNAL(triggered()), this, SLOT(about()));

    aboutQtAction = new QAction(tr("About &Qt"), this);
    aboutQtAction->setStatusTip(tr("Show the Qt library's About box"));
    connect(aboutQtAction, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
    connect(aboutQtAction, SIGNAL(triggered()), this, SLOT(aboutQt()));

	// Now for the QtOCCViewWidget slots.
/*
	fitAction = new QAction(tr("&Fit Window"), this);
	fitAction->setShortcut(tr("Ctrl+F"));
    fitAction->setStatusTip(tr("Fit to window"));
    connect(fitAction, SIGNAL(triggered()), myOCC, SLOT(fitExtents()));
*/
	fitAllAction = new QAction(tr("&Fit All"), this);
	fitAllAction->setShortcut(tr("Ctrl+F"));
    fitAllAction->setStatusTip(tr("Fit contents to viewport"));
    connect(fitAllAction, SIGNAL(triggered()), myOCC, SLOT(fitAll()));

	zoomAction = new QAction(tr("&Zoom"), this);
	zoomAction->setStatusTip(tr("Zoom in window"));
    connect(zoomAction, SIGNAL(triggered()), myOCC, SLOT(fitArea()));

	panAction = new QAction(tr("&Pan"), this);
    panAction->setStatusTip(tr("Window panning"));
    connect(panAction, SIGNAL(triggered()), myOCC, SLOT(pan()));

	rotAction = new QAction(tr("&Rotate"), this);
	rotAction->setShortcut(tr("Ctrl+R"));
    rotAction->setStatusTip(tr("Window rotation"));
    connect(rotAction, SIGNAL(triggered()), myOCC, SLOT(rotation()));

	gridToggleAction = new QAction(tr("Toggle &Grid"), this);
	gridToggleAction->setShortcut(tr("Ctrl+G"));
    gridToggleAction->setStatusTip(tr("Turn the grid on or off"));
    connect(gridToggleAction, SIGNAL(triggered()), myVC, SLOT(gridToggle()));

/*	gridOffAction = new QAction(tr("Gri&d Off"), this);
	gridOffAction->setShortcut(tr("Ctrl+D"));
    gridOffAction->setStatusTip(tr("Turn the grid on"));
    connect(gridOffAction, SIGNAL(triggered()), myVC, SLOT(gridOff()));
*/
	gridXYAction = new QAction(tr("XY Grid"), this);
    gridXYAction->setStatusTip(tr("Grid on XY Plane"));
	//gridOffAction->setShortcut(tr("Ctrl+Z"));
    connect(gridXYAction, SIGNAL(triggered()), myVC, SLOT(gridXY()));

	gridXZAction = new QAction(tr("XZ Grid"), this);
    gridXZAction->setStatusTip(tr("Grid on XZ Plane"));
	//gridXZAction->setShortcut(tr("Ctrl+Y"));
    connect(gridXZAction, SIGNAL(triggered()), myVC, SLOT(gridXZ()));

	gridYZAction = new QAction(tr("YZ Grid"), this);
	gridYZAction->setStatusTip(tr("Grid on YZ Plane"));
	//gridOffAction->setShortcut(tr("Ctrl+Z"));
    connect(gridYZAction, SIGNAL(triggered()), myVC, SLOT(gridYZ()));

	gridRectAction = new QAction(tr("Rectangular"), this);
	gridRectAction->setStatusTip(tr("Retangular grid"));
	//gridOffAction->setShortcut(tr("Ctrl+Z"));
    connect(gridRectAction, SIGNAL(triggered()), myVC, SLOT(gridRect()));

	gridCircAction = new QAction(tr("Circular"), this);
	gridCircAction->setStatusTip(tr("Circular grid"));
	//gridOffAction->setShortcut(tr("Ctrl+Z"));
    connect(gridCircAction, SIGNAL(triggered()), myVC, SLOT(gridCirc()));

	// Standard View

	viewFrontAction = new QAction(tr("Front"), this);
	viewFrontAction->setStatusTip(tr("View From Front"));
    connect(viewFrontAction, SIGNAL(triggered()), myOCC, SLOT(viewFront()));

	viewBackAction = new QAction(tr("Back"), this);
	viewBackAction->setStatusTip(tr("View From Back"));
    connect(viewBackAction, SIGNAL(triggered()), myOCC, SLOT(viewBack()));

	viewTopAction = new QAction(tr("Top"), this);
	viewTopAction->setStatusTip(tr("View From Top"));
    connect(viewTopAction, SIGNAL(triggered()), myOCC, SLOT(viewTop()));

	viewBottomAction = new QAction(tr("Bottom"), this);
	viewBottomAction->setStatusTip(tr("View From Bottom"));
    connect(viewBottomAction, SIGNAL(triggered()), myOCC, SLOT(viewBottom()));

	viewLeftAction = new QAction(tr("Left"), this);
	viewLeftAction->setStatusTip(tr("View From Left"));
    connect(viewLeftAction, SIGNAL(triggered()), myOCC, SLOT(viewLeft()));

	viewRightAction = new QAction(tr("Right"), this);
	viewRightAction->setStatusTip(tr("View From Right"));
    connect(viewRightAction, SIGNAL(triggered()), myOCC, SLOT(viewRight()));

	viewAxoAction = new QAction(tr("&Axonometric Fit"), this);
	viewAxoAction->setStatusTip(tr("Axonometric view and fit all"));
    viewAxoAction->setShortcut(tr("Ctrl+A"));
    connect(viewAxoAction, SIGNAL(triggered()), myOCC, SLOT(viewAxo()));

	viewGridAction = new QAction(tr("Grid"), this);
	viewGridAction->setStatusTip(tr("View from grid"));
    connect(viewGridAction, SIGNAL(triggered()), myOCC, SLOT(viewGrid()));

	viewResetAction = new QAction(tr("Reset"), this);
	viewResetAction->setStatusTip(tr("Reset the view"));
    connect(viewResetAction, SIGNAL(triggered()), myOCC, SLOT(viewReset()));

	backgroundAction = new QAction( tr("&Background"), this );
	backgroundAction->setStatusTip(tr("Change the background colour"));
	connect(backgroundAction, SIGNAL(triggered()), myOCC, SLOT(background()));

	// The co-ordinates from the view
	connect( myOCC, SIGNAL(mouseMoved(V3d_Coordinate,V3d_Coordinate,V3d_Coordinate)),
		     this,   SLOT(xyzPosition(V3d_Coordinate,V3d_Coordinate,V3d_Coordinate)) );

	// Add a point from the view
	connect( myOCC, SIGNAL(pointClicked(V3d_Coordinate,V3d_Coordinate,V3d_Coordinate)),
		     this,   SLOT (addPoint    (V3d_Coordinate,V3d_Coordinate,V3d_Coordinate)) );

	connect( myOCC, SIGNAL(sendStatus(const QString)),
		     this,  SLOT  (statusMessage(const QString)) );

	// And the bottle example

	bottleAction = new QAction(tr("Load &Bottle"), this);
	bottleAction->setShortcut(tr("Ctrl+B"));
    bottleAction->setStatusTip(tr("Bottle sample."));
    connect(bottleAction, SIGNAL(triggered()), this, SLOT(bottle()));

}
Beispiel #6
0
void OccView::right()
{
    m_view->SetProj( V3d_Yneg );
    fitAll();
}
Beispiel #7
0
void OccView::left()
{
    m_view->SetProj( V3d_Ypos );
    fitAll();
}
Beispiel #8
0
void OccView::bottom()
{
    m_view->SetProj( V3d_Zneg );
    fitAll();
}
Beispiel #9
0
void OccView::top()
{
    m_view->SetProj( V3d_Zpos );
    fitAll();
}
Beispiel #10
0
void OccView::back()
{
    m_view->SetProj( V3d_Xneg );
    fitAll();
}
Beispiel #11
0
void OccView::front()
{
    m_view->SetProj( V3d_Xpos );
    fitAll();
}
Beispiel #12
0
void OccView::axo()
{
    m_view->SetProj( V3d_XposYnegZpos );
    fitAll();
}
Beispiel #13
0
void occQt::createActions( void )
{
    mExitAction = new QAction(tr("Exit"), this);
    mExitAction->setShortcut(tr("Ctrl+Q"));
    mExitAction->setIcon(QIcon(":/Resources/close.png"));
    mExitAction->setStatusTip(tr("Exit the application"));
    connect(mExitAction, SIGNAL(triggered()), this, SLOT(close()));

    mViewZoomAction = new QAction(tr("Zoom"), this);
    mViewZoomAction->setIcon(QIcon(":/Resources/Zoom.png"));
    mViewZoomAction->setStatusTip(tr("Zoom the view"));
    connect(mViewZoomAction, SIGNAL(triggered()), mOccView, SLOT(zoom()));

    mViewPanAction = new QAction(tr("Pan"), this);
    mViewPanAction->setIcon(QIcon(":/Resources/Pan.png"));
    mViewPanAction->setStatusTip(tr("Pan the view"));
    connect(mViewPanAction, SIGNAL(triggered()), mOccView, SLOT(pan()));

    mViewRotateAction = new QAction(tr("Rotate"), this);
    mViewRotateAction->setIcon(QIcon(":/Resources/Rotate.png"));
    mViewRotateAction->setStatusTip(tr("Rotate the view"));
    connect(mViewRotateAction, SIGNAL(triggered()), mOccView, SLOT(rotate()));

    mViewResetAction = new QAction(tr("Reset"), this);
    mViewResetAction->setIcon(QIcon(":/Resources/Home.png"));
    mViewResetAction->setStatusTip(tr("Reset the view"));
    connect(mViewResetAction, SIGNAL(triggered()), mOccView, SLOT(reset()));

    mViewFitallAction = new QAction(tr("Fit All"), this);
    mViewFitallAction->setIcon(QIcon(":/Resources/FitAll.png"));
    mViewFitallAction->setStatusTip(tr("Fit all "));
    connect(mViewFitallAction, SIGNAL(triggered()), mOccView, SLOT(fitAll()));

    mMakeBoxAction = new QAction(tr("Box"), this);
    mMakeBoxAction->setIcon(QIcon(":/Resources/box.png"));
    mMakeBoxAction->setStatusTip(tr("Make a box"));
    connect(mMakeBoxAction, SIGNAL(triggered()), this, SLOT(makeBox()));

    mMakeConeAction = new QAction(tr("Cone"), this);
    mMakeConeAction->setIcon(QIcon(":/Resources/cone.png"));
    mMakeConeAction->setStatusTip(tr("Make a cone"));
    connect(mMakeConeAction, SIGNAL(triggered()), this, SLOT(makeCone()));

    mMakeSphereAction = new QAction(tr("Sphere"), this);
    mMakeSphereAction->setStatusTip(tr("Make a sphere"));
    mMakeSphereAction->setIcon(QIcon(":/Resources/sphere.png"));
    connect(mMakeSphereAction, SIGNAL(triggered()), this, SLOT(makeSphere()));

    mMakeCylinderAction = new QAction(tr("Cylinder"), this);
    mMakeCylinderAction->setStatusTip(tr("Make a cylinder"));
    mMakeCylinderAction->setIcon(QIcon(":/Resources/cylinder.png"));
    connect(mMakeCylinderAction, SIGNAL(triggered()), this, SLOT(makeCylinder()));

    mMakeTorusAction = new QAction(tr("Torus"), this);
    mMakeTorusAction->setStatusTip(tr("Make a torus"));
    mMakeTorusAction->setIcon(QIcon(":/Resources/torus.png"));
    connect(mMakeTorusAction, SIGNAL(triggered()), this, SLOT(makeTorus()));

    mFilletAction = new QAction(tr("Fillet"), this);
    mFilletAction->setIcon(QIcon(":/Resources/fillet.png"));
    mFilletAction->setStatusTip(tr("Test Fillet algorithm"));
    connect(mFilletAction, SIGNAL(triggered()), this, SLOT(makeFillet()));

    mChamferAction = new QAction(tr("Chamfer"), this);
    mChamferAction->setIcon(QIcon(":/Resources/chamfer.png"));
    mChamferAction->setStatusTip(tr("Test chamfer algorithm"));
    connect(mChamferAction, SIGNAL(triggered()), this, SLOT(makeChamfer()));

    mExtrudeAction = new QAction(tr("Extrude"), this);
    mExtrudeAction->setIcon(QIcon(":/Resources/extrude.png"));
    mExtrudeAction->setStatusTip(tr("Test extrude algorithm"));
    connect(mExtrudeAction, SIGNAL(triggered()), this, SLOT(makeExtrude()));

    mRevolveAction = new QAction(tr("Revolve"), this);
    mRevolveAction->setIcon(QIcon(":/Resources/revolve.png"));
    mRevolveAction->setStatusTip(tr("Test revol algorithm"));
    connect(mRevolveAction, SIGNAL(triggered()), this, SLOT(makeRevol()));

    mLoftAction = new QAction(tr("Loft"), this);
    mLoftAction->setIcon(QIcon(":/Resources/loft.png"));
    mLoftAction->setStatusTip(tr("Test loft algorithm"));
    connect(mLoftAction, SIGNAL(triggered()), this, SLOT(makeLoft()));

    mCutAction = new QAction(tr("Cut"), this);
    mCutAction->setIcon(QIcon(":/Resources/cut.png"));
    mCutAction->setStatusTip(tr("Boolean operation cut"));
    connect(mCutAction, SIGNAL(triggered()), this, SLOT(testCut()));

    mFuseAction = new QAction(tr("Fuse"), this);
    mFuseAction->setIcon(QIcon(":/Resources/fuse.png"));
    mFuseAction->setStatusTip(tr("Boolean operation fuse"));
    connect(mFuseAction, SIGNAL(triggered()), this, SLOT(testFuse()));

    mCommonAction = new QAction(tr("Common"), this);
    mCommonAction->setIcon(QIcon(":/Resources/common.png"));
    mCommonAction->setStatusTip(tr("Boolean operation common"));
    connect(mCommonAction, SIGNAL(triggered()), this, SLOT(testCommon()));

    mAboutAction = new QAction(tr("About"), this);
    mAboutAction->setStatusTip(tr("About the application"));
    mAboutAction->setIcon(QIcon(":/Resources/lamp.png"));
    connect(mAboutAction, SIGNAL(triggered()), this, SLOT(about()));
}
Beispiel #14
0
void TIGLViewerWindow::connectSignals()
{
    connect(newAction, SIGNAL(triggered()), this, SLOT(newFile()));
    connect(openAction, SIGNAL(triggered()), this, SLOT(open()));
    connect(openScriptAction, SIGNAL(triggered()), this, SLOT(openScript()));
    connect(closeAction, SIGNAL(triggered()), this, SLOT(closeConfiguration()));

    for (int i = 0; i < MaxRecentFiles; ++i) {
        recentFileActions[i] = new QAction(this);
        recentFileActions[i]->setVisible(false);
        connect(recentFileActions[i], SIGNAL(triggered()),
                this, SLOT(openRecentFile()));
    }

    connect(saveAction, SIGNAL(triggered()), this, SLOT(save()));
    connect(saveScreenshotAction, SIGNAL(triggered()), this, SLOT(makeScreenShot()));
    connect(setBackgroundAction, SIGNAL(triggered()), this, SLOT(setBackgroundImage()));
    connect(exitAction, SIGNAL(triggered()), this, SLOT(close()));
    connect(aboutAction, SIGNAL(triggered()), this, SLOT(about()));
    connect(aboutQtAction, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
    connect(aboutQtAction, SIGNAL(triggered()), this, SLOT(aboutQt()));

    // Misc drawing actions
    connect(drawPointAction, SIGNAL(triggered()), this, SLOT(drawPoint()));
    connect(drawVectorAction, SIGNAL(triggered()), this, SLOT(drawVector()));
    

    // view->actions menu
    connect(fitAction, SIGNAL(triggered()), myOCC, SLOT(fitExtents()));
    connect(fitAllAction, SIGNAL(triggered()), myOCC, SLOT(fitAll()));
    //connect(zoomAction, SIGNAL(triggered()), myOCC, SLOT(fitArea()));
    connect(zoomAction, SIGNAL(triggered()),myOCC, SLOT(zoom()));
    connect(panAction, SIGNAL(triggered()), myOCC, SLOT(pan()));
    connect(rotAction, SIGNAL(triggered()), myOCC, SLOT(rotation()));
    connect(selectAction, SIGNAL(triggered()), myOCC, SLOT(selecting()));

    // view->grid menu
    connect(gridOnAction, SIGNAL(toggled(bool)), myScene, SLOT(toggleGrid(bool)));
    connect(gridXYAction, SIGNAL(triggered()), myScene, SLOT(gridXY()));
    connect(gridXZAction, SIGNAL(triggered()), myScene, SLOT(gridXZ()));
    connect(gridYZAction, SIGNAL(triggered()), myScene, SLOT(gridYZ()));
    connect(gridRectAction, SIGNAL(triggered()), myScene, SLOT(gridRect()));
    connect(gridCircAction, SIGNAL(triggered()), myScene, SLOT(gridCirc()));

    // Standard View
    connect(viewFrontAction, SIGNAL(triggered()), myOCC, SLOT(viewFront()));
    connect(viewBackAction, SIGNAL(triggered()), myOCC, SLOT(viewBack()));
    connect(viewTopAction, SIGNAL(triggered()), myOCC, SLOT(viewTop()));
    connect(viewBottomAction, SIGNAL(triggered()), myOCC, SLOT(viewBottom()));
    connect(viewLeftAction, SIGNAL(triggered()), myOCC, SLOT(viewLeft()));
    connect(viewRightAction, SIGNAL(triggered()), myOCC, SLOT(viewRight()));
    connect(viewAxoAction, SIGNAL(triggered()), myOCC, SLOT(viewAxo()));
    connect(viewGridAction, SIGNAL(triggered()), myOCC, SLOT(viewGrid()));
    connect(viewResetAction, SIGNAL(triggered()), myOCC, SLOT(viewReset()));
    connect(viewZoomInAction, SIGNAL(triggered()), myOCC, SLOT(zoomIn()));
    connect(viewZoomOutAction, SIGNAL(triggered()), myOCC, SLOT(zoomOut()));
    connect(showConsoleAction, SIGNAL(toggled(bool)), consoleDockWidget, SLOT(setVisible(bool)));
    connect(consoleDockWidget, SIGNAL(visibilityChanged(bool)), showConsoleAction, SLOT(setChecked(bool)));
    connect(showWireframeAction, SIGNAL(toggled(bool)), myScene, SLOT(wireFrame(bool)));

    connect(openTimer, SIGNAL(timeout()), this, SLOT(reopenFile()));

    // The co-ordinates from the view
    connect( myOCC, SIGNAL(mouseMoved(V3d_Coordinate,V3d_Coordinate,V3d_Coordinate)),
             this,   SLOT(xyzPosition(V3d_Coordinate,V3d_Coordinate,V3d_Coordinate)) );

    // Add a point from the view
    connect( myOCC, SIGNAL(pointClicked(V3d_Coordinate,V3d_Coordinate,V3d_Coordinate)),
             this,   SLOT (addPoint    (V3d_Coordinate,V3d_Coordinate,V3d_Coordinate)) );

    connect( myOCC, SIGNAL(sendStatus(const QString)), this,  SLOT  (statusMessage(const QString)) );

    connect(stdoutStream, SIGNAL(sendString(QString)), console, SLOT(output(QString)));
    connect(errorStream , SIGNAL(sendString(QString)), console, SLOT(output(QString)));

    connect(logDirect.get(), SIGNAL(newMessage(QString)), console, SLOT(output(QString)));

    connect(scriptEngine, SIGNAL(scriptResult(QString)), console, SLOT(output(QString)));
    connect(scriptEngine, SIGNAL(scriptError(QString)), console, SLOT(outputError(QString)));
    connect(scriptEngine, SIGNAL(evalDone()), console, SLOT(endCommand()));
    connect(console, SIGNAL(onChange(QString)), scriptEngine, SLOT(textChanged(QString)));
    connect(console, SIGNAL(onCommand(QString)), scriptEngine, SLOT(eval(QString)));

    connect(settingsAction, SIGNAL(triggered()), this, SLOT(changeSettings()));
}