当前位置: 首页>>代码示例>>C++>>正文


C++ deletePreview函数代码示例

本文整理汇总了C++中deletePreview函数的典型用法代码示例。如果您正苦于以下问题:C++ deletePreview函数的具体用法?C++ deletePreview怎么用?C++ deletePreview使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了deletePreview函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: switch

void RS_ActionModifyMirror::coordinateEvent(RS_CoordinateEvent* e) {
    if (e==NULL) {
        return;
    }

    RS_Vector mouse = e->getCoordinate();

        switch (getStatus()) {
        case SetAxisPoint1:
            axisPoint1 = mouse;
            setStatus(SetAxisPoint2);
                graphicView->moveRelativeZero(mouse);
            break;

        case SetAxisPoint2:
            axisPoint2 = mouse;
            setStatus(ShowDialog);
                graphicView->moveRelativeZero(mouse);
            if (RS_DIALOGFACTORY) {
				if (RS_DIALOGFACTORY->requestMirrorDialog(*data)) {
					data->axisPoint1 = axisPoint1;
					data->axisPoint2 = axisPoint2;
                    deletePreview();
                    trigger();
                    finish(false);
                }
            }
            break;

        default:
            break;
        }
}
开发者ID:Ngassa,项目名称:LibreCAD,代码行数:33,代码来源:rs_actionmodifymirror.cpp

示例2: RS_Leader

void RS_ActionDimLeader::trigger() {
    RS_PreviewActionInterface::trigger();

    if (points.count()>0) {

        RS_Leader* leader = new RS_Leader(container, RS_LeaderData(true));
        leader->setLayerToActive();
        leader->setPenToActive();

        for (RS_Vector* v=points.first(); v!=NULL; v=points.next()) {
            leader->addVertex(*v);
        }

        container->addEntity(leader);

        // upd. undo list:
        if (document!=NULL) {
            document->startUndoCycle();
            document->addUndoable(leader);
            document->endUndoCycle();
        }

        deletePreview();
        clearPreview();
        deleteSnapper();
        RS_Vector rz = graphicView->getRelativeZero();
        graphicView->moveRelativeZero(RS_Vector(0.0,0.0));
        graphicView->drawEntity(leader);
        graphicView->moveRelativeZero(rz);
        //drawSnapper();

        RS_DEBUG->print("RS_ActionDimLeader::trigger(): leader added: %d",
                        leader->getId());
    }
}
开发者ID:Akaur,项目名称:qdraw,代码行数:35,代码来源:rs_actiondimleader.cpp

示例3: catchEntity

void RS_ActionDrawEllipseInscribe::mouseMoveEvent(QMouseEvent* e) {
    RS_DEBUG->print("RS_ActionDrawEllipse4Line::mouseMoveEvent begin");

    if(getStatus() == SetLine4) {
        RS_Entity*  en = catchEntity(e, RS2::EntityLine, RS2::ResolveAll);
        if(!en) return;
        if(!(en->isVisible() && en->rtti()== RS2::EntityLine)) return;
        for(auto p: lines){
            if(en == p) return; //do not pull in the same line again
        }

        if(en->getParent() && en->getParent()->ignoredOnModification()){
                return;
            }

		deletePreview();

		clearLines(true);
		lines.push_back(static_cast<RS_Line*>(en));
		if(preparePreview()) {
			lines.back()->setHighlighted(true);
			graphicView->drawEntity(lines.back());
			RS_Ellipse* e=new RS_Ellipse(preview.get(), *eData);
            preview->addEntity(e);
            drawPreview();
        }

    }
    RS_DEBUG->print("RS_ActionDrawEllipse4Line::mouseMoveEvent end");
}
开发者ID:Ngassa,项目名称:LibreCAD,代码行数:30,代码来源:rs_actiondrawellipseinscribe.cpp

示例4: RS_Leader

void RS_ActionDimLeader::trigger() {
    RS_PreviewActionInterface::trigger();

    if (points.count()>0) {

        RS_Leader* leader = new RS_Leader(container, RS_LeaderData(true));
        leader->setLayerToActive();
        leader->setPenToActive();

        for (int i = 0; i < points.size(); ++i) {
            leader->addVertex(points.at(i));
        }

        container->addEntity(leader);

        // upd. undo list:
        if (document!=NULL) {
            document->startUndoCycle();
            document->addUndoable(leader);
            document->endUndoCycle();
        }

        deletePreview();
        RS_Vector rz = graphicView->getRelativeZero();
		graphicView->redraw(RS2::RedrawDrawing);
        graphicView->moveRelativeZero(rz);
        //drawSnapper();

        RS_DEBUG->print("RS_ActionDimLeader::trigger(): leader added: %d",
                        leader->getId());
    }
}
开发者ID:Samsagax,项目名称:LibreCAD,代码行数:32,代码来源:rs_actiondimleader.cpp

示例5: deletePreview

void RS_ActionDrawLineBisector::mouseReleaseEvent(QMouseEvent* e) {

    if (e->button()==Qt::RightButton) {
        deletePreview();
        init(getStatus()-1);
    } else {

        RS_Vector mouse = RS_Vector(graphicView->toGraphX(e->x()),
                                    graphicView->toGraphY(e->y()));

        switch (getStatus()) {
        case SetLine1: {
                coord1 = mouse;
                RS_Entity* en = catchEntity(e, RS2::ResolveAll);
                if (en!=NULL && en->rtti()==RS2::EntityLine) {
                    line1 = (RS_Line*)en;
                }
            }
            setStatus(SetLine2);
            break;

        case SetLine2:
            coord2 = mouse;
            trigger();
            setStatus(SetLine1);
            break;
        }
    }

}
开发者ID:Samsagax,项目名称:LibreCAD,代码行数:30,代码来源:rs_actiondrawlinebisector.cpp

示例6: getStatus

void QC_ActionGetPoint::mouseMoveEvent(QMouseEvent* e) {
    RS_DEBUG->print("QC_ActionGetPoint::mouseMoveEvent begin");
    if (getStatus()==SetReferencePoint ||
            getStatus()==SetTargetPoint) {

        RS_Vector mouse = snapPoint(e);
        switch (getStatus()) {
        case SetReferencePoint:
            targetPoint = mouse;
            break;

        case SetTargetPoint:
            if (referencePoint.valid) {
                targetPoint = mouse;
                deletePreview();
                RS_Line *line =new RS_Line(preview,
                                       RS_LineData(referencePoint, mouse));
                line->setPen(RS_Pen(RS_Color(0,0,0), RS2::Width00, RS2::DotLine ));
                preview->addEntity(line);
                RS_DEBUG->print("QC_ActionGetPoint::mouseMoveEvent: draw preview");
                drawPreview();
                preview->addSelectionFrom(*container);
            }
            break;

        default:
            break;
        }
    }

    RS_DEBUG->print("QC_ActionGetPoint::mouseMoveEvent end");
}
开发者ID:Samsagax,项目名称:LibreCAD,代码行数:32,代码来源:qc_actiongetpoint.cpp

示例7: mouse

void RS_ActionDimAngular::mouseMoveEvent(QMouseEvent* e) {
    RS_DEBUG->print("RS_ActionDimAngular::mouseMoveEvent begin");

    RS_Vector mouse(graphicView->toGraphX(e->x()),
                    graphicView->toGraphY(e->y()));

    switch (getStatus()) {
    case SetLine1:
        drawSnapper();
        break;

    case SetLine2:
        drawSnapper();
        break;

    case SetPos:
        if (line1!=NULL && line2!=NULL && center.valid) {
            RS_Vector mouse = snapPoint(e);
            edata.definitionPoint4 = mouse;

            RS_DimAngular* d = new RS_DimAngular(preview, data, edata);

            deletePreview();
            preview->addEntity(d);
            d->update();
            drawPreview();
        }
        break;

    default:
        break;
    }

    RS_DEBUG->print("RS_ActionDimAngular::mouseMoveEvent end");
}
开发者ID:0825732889,项目名称:LibreCAD,代码行数:35,代码来源:rs_actiondimangular.cpp

示例8: switch

void RS_ActionDrawMText::init(int status) {
    RS_ActionInterface::init(status);
    if (RS_DIALOGFACTORY) {

        switch (status) {
        case ShowDialog: {
                reset();

				RS_MText tmp(NULL, *data);
                if (RS_DIALOGFACTORY->requestMTextDialog(&tmp)) {
					data.reset(new RS_MTextData(tmp.getData()));
                    setStatus(SetPos);
                    showOptions();
                } else {
                    hideOptions();
					finish(true);
                }
            }
            break;

        case SetPos:
            RS_DIALOGFACTORY->requestOptions(this, true, true);
            deletePreview();
            preview->setVisible(true);
            preparePreview();
            break;

        default:
            break;
        }
    }
}
开发者ID:Joeycc,项目名称:LibreCAD,代码行数:32,代码来源:rs_actiondrawmtext.cpp

示例9: switch

void RS_ActionInfoDist2::mouseReleaseEvent(RS_MouseEvent* e) {
    if (RS2::qtToRsButtonState(e->button())==RS2::LeftButton) {

        switch (getStatus()) {
        case SetEntity:
            entity = catchEntity(e);
            if (entity!=NULL) {
                setStatus(SetPoint);
            }
            break;

        case SetPoint: {
                RS_CoordinateEvent ce(snapPoint(e));
                coordinateEvent(&ce);
            }
            break;

        default:
            break;
        }
    } else if (RS2::qtToRsButtonState(e->button())==RS2::RightButton) {
        deletePreview();
        deleteSnapper();
        init(getStatus()-1);
    }
}
开发者ID:Akaur,项目名称:qdraw,代码行数:26,代码来源:rs_actioninfodist2.cpp

示例10: getStatus

void RS_ActionModifyMove::mouseMoveEvent(QMouseEvent* e) {
    RS_DEBUG->print("RS_ActionModifyMove::mouseMoveEvent begin");

    if (getStatus()==SetReferencePoint ||
            getStatus()==SetTargetPoint) {

        RS_Vector mouse = snapPoint(e);
        switch (getStatus()) {
        case SetReferencePoint:
			pPoints->referencePoint = mouse;
            break;

        case SetTargetPoint:
			if (pPoints->referencePoint.valid) {
				pPoints->targetPoint = mouse;

                deletePreview();
                preview->addSelectionFrom(*container);
				preview->move(pPoints->targetPoint-pPoints->referencePoint);
                drawPreview();
            }
            break;

        default:
            break;
        }
    }

    RS_DEBUG->print("RS_ActionModifyMove::mouseMoveEvent end");
}
开发者ID:Joeycc,项目名称:LibreCAD,代码行数:30,代码来源:rs_actionmodifymove.cpp

示例11: getAvailableCommands

void RS_ActionDrawMText::commandEvent(RS_CommandEvent* e) {
    QString c = e->getCommand().toLower();

    if (checkCommand("help", c)) {
        if (RS_DIALOGFACTORY) {
            RS_DIALOGFACTORY->commandMessage(msgAvailableCommands()
                                             + getAvailableCommands().join(", "));
        }
        return;
    }

    switch (getStatus()) {
    case SetPos:
        if (checkCommand("text", c)) {
            deletePreview();
            graphicView->disableCoordinateInput();
            setStatus(SetText);
        }
        break;

    case SetText: {
            setText(e->getCommand());
            if (RS_DIALOGFACTORY) {
                RS_DIALOGFACTORY->requestOptions(this, true, true);
            }
            graphicView->enableCoordinateInput();
            setStatus(SetPos);
        }
        break;

    default:
        break;
    }
}
开发者ID:Joeycc,项目名称:LibreCAD,代码行数:34,代码来源:rs_actiondrawmtext.cpp

示例12: catchEntity

void RS_ActionDrawLineTangent2::mouseMoveEvent(QMouseEvent* e) {
//    RS_DEBUG->print("RS_ActionDrawLineTangent2::mouseMoveEvent begin");
    if(getStatus() != SetCircle2) return;
    circle2= catchEntity(e, circleType, RS2::ResolveAll);
    if(circle2==NULL) return;
    if(circle2->rtti()!=RS2::EntityCircle &&
            circle2->rtti()!=RS2::EntityEllipse &&
            circle2->rtti()!=RS2::EntityArc
            ) {
        circle2=NULL;
        return;
    }
    RS_Creation creation(NULL, NULL);
    RS_Vector mouse(graphicView->toGraphX(e->x()),
                    graphicView->toGraphY(e->y()));
    tangent.reset(creation.createTangent2(mouse,
                                          circle1,
                                          circle2));
    if(tangent.get()==NULL) {
        valid=false;
        return;
    }
    valid=true;
	lineData.reset(new RS_LineData(tangent->getData()));

    deletePreview();
	preview->addEntity(new RS_Line(preview.get(), *lineData));
    drawPreview();
}
开发者ID:CERobertson,项目名称:LibreCAD,代码行数:29,代码来源:rs_actiondrawlinetangent2.cpp

示例13: deletePreview

void RS_ActionDrawSpline::undo() {
    if (history.size()>1) {
        history.removeLast();
        //bHistory.removeLast();
        deletePreview();
        //graphicView->setCurrentAction(
        //    new RS_ActionEditUndo(true, *container, *graphicView));
                if (!history.isEmpty()) {
                //point = *history.last();
                }
                if (spline!=NULL) {
                        spline->removeLastControlPoint();
                        if (!history.isEmpty()) {
                            RS_Vector v = history.last();
                            graphicView->moveRelativeZero(v);
                        }
                        graphicView->redraw(RS2::RedrawDrawing);

                }
    } else {
        RS_DIALOGFACTORY->commandMessage(
            tr("Cannot undo: "
               "Not enough entities defined yet."));
    }
}
开发者ID:CrazyHeex,项目名称:sodacad,代码行数:25,代码来源:rs_actiondrawspline.cpp

示例14: getStatus

void RS_ActionModifyMirror::mouseMoveEvent(QMouseEvent* e) {
    RS_DEBUG->print("RS_ActionModifyMirror::mouseMoveEvent begin");

    if (getStatus()==SetAxisPoint1 ||
            getStatus()==SetAxisPoint2) {

        RS_Vector mouse = snapPoint(e);
        switch (getStatus()) {
        case SetAxisPoint1:
            axisPoint1 = mouse;
            break;

        case SetAxisPoint2:
            if (axisPoint1.valid) {
                axisPoint2 = mouse;

                deletePreview();
                preview->addSelectionFrom(*container);
                preview->mirror(axisPoint1, axisPoint2);

				preview->addEntity(new RS_Line(preview.get(),
                                               RS_LineData(axisPoint1,
                                                           axisPoint2)));

                drawPreview();
            }
            break;

        default:
            break;
        }
    }

    RS_DEBUG->print("RS_ActionModifyMirror::mouseMoveEvent end");
}
开发者ID:Ngassa,项目名称:LibreCAD,代码行数:35,代码来源:rs_actionmodifymirror.cpp

示例15: switch

void RS_ActionDrawPolyline::coordinateEvent(RS_CoordinateEvent* e) {
    if (e==NULL) {
        return;
    }

    RS_Vector mouse = e->getCoordinate();
    double bulge=solveBulge(mouse);
    if (calculatedSegment)
        mouse=calculatedEndpoint;

    switch (getStatus()) {
    case SetStartpoint:
        //	data.startpoint = mouse;
        //printf ("SetStartpoint\n");
        point = mouse;
        history.clear();
        history.append(mouse);
        bHistory.clear();
        bHistory.append(0.0);
        start = point;
        setStatus(SetNextPoint);
        graphicView->moveRelativeZero(mouse);
        updateMouseButtonHints();
        break;

    case SetNextPoint:
        graphicView->moveRelativeZero(mouse);
        point = mouse;
        history.append(mouse);
        bHistory.append(bulge);
                if (polyline==NULL) {
                        //printf("polyline==NULL\n");
                        polyline = new RS_Polyline(container, data);
                        polyline->addVertex(start, 0.0);
                }
                if (polyline!=NULL) {
                        polyline->setNextBulge(bulge);
                        polyline->addVertex(mouse, 0.0);
                        polyline->setEndpoint(mouse);
                        if (polyline->count()==1) {
                        polyline->setLayerToActive();
                        polyline->setPenToActive();
                                container->addEntity(polyline);
                        }
                        deletePreview();
                        // clearPreview();
                        deleteSnapper();
                        graphicView->drawEntity(polyline);
                        drawSnapper();
                }
        //trigger();
        //data.startpoint = data.endpoint;
        updateMouseButtonHints();
        //graphicView->moveRelativeZero(mouse);
        break;

    default:
        break;
    }
}
开发者ID:absorb-it,项目名称:LibreCAD,代码行数:60,代码来源:rs_actiondrawpolyline.cpp


注:本文中的deletePreview函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。