示例#1
0
QMenu* Scene_polylines_item::contextMenu() 
{
    const char* prop_name = "Menu modified by Scene_polylines_item.";

    QMenu* menu = Scene_item::contextMenu();

    // Use dynamic properties:
    // http://doc.qt.io/qt-5/qobject.html#property
    bool menuChanged = menu->property(prop_name).toBool();

    if(!menuChanged) {
        menu->addSeparator();
        // TODO: add actions to display corners
        QAction* action = menu->addAction(tr("Display corners with radius..."));
        connect(action, SIGNAL(triggered()),
                this, SLOT(change_corner_radii()));

        QAction* actionSmoothPolylines =
                menu->addAction(tr("Smooth polylines"));
        actionSmoothPolylines->setObjectName("actionSmoothPolylines");
        connect(actionSmoothPolylines, SIGNAL(triggered()),this, SLOT(smooth()));
        menu->setProperty(prop_name, true);
    }
    return menu;
}
示例#2
0
QMenu* Scene_c3t3_item::contextMenu()
{
  const char* prop_name = "Menu modified by Scene_c3t3_item.";

  QMenu* menu = Scene_item::contextMenu();

  // Use dynamic properties:
  // http://doc.qt.io/qt-5/qobject.html#property
  bool menuChanged = menu->property(prop_name).toBool();

  if (!menuChanged) {
    QAction* actionExportFacetsInComplex =
      menu->addAction(tr("Export facets in complex"));
    actionExportFacetsInComplex->setObjectName("actionExportFacetsInComplex");
    connect(actionExportFacetsInComplex,
      SIGNAL(triggered()), this,
      SLOT(export_facets_in_complex()));

    QAction* actionShowSpheres =
      menu->addAction(tr("Show protecting &spheres"));
    actionShowSpheres->setCheckable(true);
    actionShowSpheres->setObjectName("actionShowSpheres");
    connect(actionShowSpheres, SIGNAL(toggled(bool)),
            this, SLOT(show_spheres(bool)));
    menu->setProperty(prop_name, true);
  }
示例#3
0
QMenu* Scene_polylines_item::contextMenu() 
{
    const char* prop_name = "Menu modified by Scene_polylines_item.";

    QMenu* menu = Scene_item::contextMenu();

    // Use dynamic properties:
    // http://doc.qt.io/qt-5/qobject.html#property
    bool menuChanged = menu->property(prop_name).toBool();

    if(!menuChanged) {
        menu->addSeparator();
        // TODO: add actions to display corners
        QAction* action = menu->addAction(tr("Display corners with radius..."));
        connect(action, SIGNAL(triggered()),
                this, SLOT(change_corner_radii()));

        QAction* actionSmoothPolylines =
                menu->addAction(tr("Smooth polylines"));
        actionSmoothPolylines->setObjectName("actionSmoothPolylines");
        connect(actionSmoothPolylines, SIGNAL(triggered()),this, SLOT(smooth()));

        QMenu *container = new QMenu(tr("Line Width"));
        QWidgetAction *sliderAction = new QWidgetAction(0);
        connect(d->line_Slider, &QSlider::valueChanged, this, &Scene_polylines_item::itemChanged);

        sliderAction->setDefaultWidget(d->line_Slider);

        container->addAction(sliderAction);
        menu->addMenu(container);

        menu->setProperty(prop_name, true);
    }
    return menu;
}
QMenu* Scene_combinatorial_map_item::contextMenu()
{
    const char* prop_name = "Menu modified by Scene_combinatorial_map_item.";

    QMenu* menu = Scene_item::contextMenu();

    // Use dynamic properties:
    // http://doc.qt.io/qt-5/qobject.html#property
    bool menuChanged = menu->property(prop_name).toBool();

    if(!menuChanged) {
        QAction* actionSelectNextVolume =
                menu->addAction(tr("Iterate over volumes"));
        actionSelectNextVolume->setObjectName("actionSelectNextVolume");
        connect(actionSelectNextVolume, SIGNAL(triggered()),this, SLOT(set_next_volume()));

        exportSelectedVolume =
                menu->addAction(tr("Export current volume as polyhedron"));
        exportSelectedVolume->setObjectName("exportSelectedVolume");
        connect(exportSelectedVolume, SIGNAL(triggered()),this, SLOT(export_current_volume_as_polyhedron()));
        exportSelectedVolume->setEnabled(volume_to_display!=0);
        menu->setProperty(prop_name, true);

        if(is_from_corefinement()){
            //Export union as polyhedron
            QAction* exportUnion =
                    menu->addAction(tr("Export union as polyhedron"));
            exportUnion->setObjectName("exportUnion");
            connect(exportUnion, SIGNAL(triggered()),this, SLOT(export_union_as_polyhedron()));

            //Export intersection as polyhedron
            QAction* exportIntersection =
                    menu->addAction(tr("Export intersection as polyhedron"));
            exportIntersection->setObjectName("exportIntersection");
            connect(exportIntersection, SIGNAL(triggered()),this, SLOT(export_intersection_as_polyhedron()));

            //Export A minus B as polyhedron
            QAction* exportAMinusB =
                    menu->addAction(tr("Export A minus B as polyhedron"));
            exportAMinusB->setObjectName("exportAMinusB");
            connect(exportAMinusB, SIGNAL(triggered()),this, SLOT(export_A_minus_B_as_polyhedron()));

            //Export B minus A as polyhedron
            QAction* exportBMinusA =
                    menu->addAction(tr("Export B minus A as polyhedron"));
            exportBMinusA->setObjectName("exportBMinusA");
            connect(exportBMinusA, SIGNAL(triggered()),this, SLOT(export_B_minus_A_as_polyhedron()));

        }
    }
    return menu;
}