コード例 #1
0
ファイル: MeshSelection.cpp プロジェクト: 5263/FreeCAD
void MeshSelection::stopSelection()
{
    Gui::View3DInventorViewer* viewer = getViewer();
    if (viewer) {
        stopInteractiveCallback(viewer);
        viewer->navigationStyle()->stopSelection();
    }
}
コード例 #2
0
ファイル: MeshSelection.cpp プロジェクト: 5263/FreeCAD
void MeshSelection::deselectTriangle()
{
    this->addToSelection = false;

    Gui::View3DInventorViewer* viewer = this->getViewer();
    if (viewer) {
        stopInteractiveCallback(viewer);
        viewer->navigationStyle()->stopSelection();
        startInteractiveCallback(viewer, pickFaceCallback);
        viewer->setEditingCursor(QCursor(Qt::PointingHandCursor));
    }
}
コード例 #3
0
ファイル: MeshSelection.cpp プロジェクト: 5263/FreeCAD
void MeshSelection::prepareBrushSelection(bool add,SoEventCallbackCB *cb)
{
    // a rubberband to select a rectangle area of the meshes
    Gui::View3DInventorViewer* viewer = this->getViewer();
    if (viewer) {
        stopInteractiveCallback(viewer);
        startInteractiveCallback(viewer, cb);
        // set cross cursor
        Gui::BrushSelection* brush = new Gui::BrushSelection();
        brush->setClosed(true);
        brush->setColor(1.0f,0.0f,0.0f);
        brush->setLineWidth(3.0f);
        viewer->navigationStyle()->startSelection(brush);
        
        QBitmap cursor = QBitmap::fromData(QSize(CROSS_WIDTH, CROSS_HEIGHT), cross_bitmap);
        QBitmap mask = QBitmap::fromData(QSize(CROSS_WIDTH, CROSS_HEIGHT), cross_mask_bitmap);
        QCursor custom(cursor, mask, CROSS_HOT_X, CROSS_HOT_Y);
        viewer->setComponentCursor(custom);
        this->addToSelection = add;
    }
}
コード例 #4
0
ファイル: Overlay.cpp プロジェクト: 3DPrinterGuy/FreeCAD
void MeshSelection::prepareBrushSelection(bool add)
{
    // a rubberband to select a rectangle area of the meshes
    Gui::View3DInventorViewer* viewer = this->getViewer();
    if (viewer) {
        stopInteractiveCallback(viewer);
        startInteractiveCallback(viewer, selectGLCallback);
        // set cross cursor
        DrawingPlane* brush = new DrawingPlane();
        //brush->setColor(1.0f,0.0f,0.0f);
        //brush->setLineWidth(3.0f);
        viewer->navigationStyle()->startSelection(brush);
        SoQtCursor::CustomCursor custom;
        custom.dim.setValue(16, 16);
        custom.hotspot.setValue(7, 7);
        custom.bitmap = cross_bitmap;
        custom.mask = cross_mask_bitmap;
        viewer->setComponentCursor(SoQtCursor(&custom));
        this->addToSelection = add;
    }
}