• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ deletePreview函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: snapPoint

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

    RS_Vector mouse = snapPoint(e);

    switch (getStatus()) {
    case SetCenter:
        break;

    case SetCorner:
		if (pPoints->center.valid) {
			pPoints->corner = mouse;
            deletePreview();

			RS_Creation creation(preview.get(), nullptr, false);
			creation.createPolygon(pPoints->center, pPoints->corner, number);

            drawPreview();
        }
        break;

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


示例17: deletePreview

void RS_ActionDrawPolyline::undo() {
    if (history.size()>1) {
        history.removeLast();
        bHistory.removeLast();
        deletePreview();
        point = history.last();

        if(history.size()==1){
            graphicView->moveRelativeZero(history.at(0));
            //remove polyline from container,
            //container calls delete over polyline
            container->removeEntity(polyline);
            polyline = NULL;
            graphicView->drawEntity(polyline);
        }
        if (polyline!=NULL) {
            polyline->removeLastVertex();
            graphicView->moveRelativeZero(polyline->getEndpoint());
            graphicView->drawEntity(polyline);
        }
    } else {
        RS_DIALOGFACTORY->commandMessage(
            tr("Cannot undo: "
               "Not enough entities defined yet."));
    }
}
开发者ID:absorb-it,项目名称:LibreCAD,代码行数:26,代码来源:rs_actiondrawpolyline.cpp


示例18: switch

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

	switch (getStatus()) {

    case SetPos:
		if (entity) {
			*pos = snapPoint(e);

            preparePreview();
			RS_DimDiametric* d = new RS_DimDiametric(preview.get(), *data, *edata);

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

    default:
        break;
    }

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


示例19: RS_Vector

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

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

    entity = catchEntity(e, RS2::ResolveAll);

    switch (getStatus()) {
    case SetEntity: {
            deletePreview();

			RS_Creation creation(preview.get(), nullptr, false);
            creation.createParallel(coord,
                                    distance, number,
                                    entity);

            drawPreview();
        }
        break;

    default:
        break;
    }

    RS_DEBUG->print("RS_ActionDrawLineParallel::mouseMoveEvent end");
}
开发者ID:rmamba,项目名称:LibreCAD,代码行数:27,代码来源:rs_actiondrawlineparallel.cpp


示例20: mouse

void RS_ActionInfoAngle::mouseReleaseEvent(QMouseEvent* e) {
    if (e->button()==Qt::LeftButton) {

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

        switch (getStatus()) {
        case SetEntity1:
            entity1 = catchEntity(e, RS2::ResolveAll);
            if (entity1 && entity1->rtti()==RS2::EntityLine) {
                point1 = entity1->getNearestPointOnEntity(mouse);
                setStatus(SetEntity2);
            }
            break;

        case SetEntity2:
            entity2 = catchEntity(e, RS2::ResolveAll);
            if (entity2 && entity2->rtti()==RS2::EntityLine) {
                point2 = entity2->getNearestPointOnEntity(mouse);
                trigger();
                setStatus(SetEntity1);
            }
            break;

        default:
            break;
        }
    } else if (e->button()==Qt::RightButton) {
        deletePreview();
        init(getStatus()-1);
    }
}
开发者ID:Ngassa,项目名称:LibreCAD,代码行数:32,代码来源:rs_actioninfoangle.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ deleteRecord函数代码示例发布时间:2022-05-30
下一篇:
C++ deleteObject函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap