示例#1
0
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;
    }
}
示例#2
0
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;
    }
}