本文整理汇总了C++中preparePreview函数的典型用法代码示例。如果您正苦于以下问题:C++ preparePreview函数的具体用法?C++ preparePreview怎么用?C++ preparePreview使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了preparePreview函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: catchEntity
void RS_ActionDrawCircleInscribe::mouseMoveEvent(QMouseEvent* e) {
RS_DEBUG->print("RS_ActionDrawCircle4Line::mouseMoveEvent begin");
if(getStatus() == SetLine3) {
RS_Entity* en = catchEntity(e, RS2::EntityLine, RS2::ResolveAll);
if(en == NULL) return;
if(!(en->isVisible() && en->rtti()== RS2::EntityLine)) return;
for(int i=0;i<getStatus();i++) {
if(en->getId() == lines[i]->getId()) return; //do not pull in the same line again
}
if(en->getParent() != NULL) {
if ( en->getParent()->ignoredOnModification())
return;
}
coord= graphicView->toGraph(e->x(), e->y());
lines.resize(getStatus());
lines.push_back(static_cast<RS_Line*>(en));
// lines[getStatus()]=static_cast<RS_Line*>(en);
if(preparePreview()) {
deletePreview();
RS_Circle* e=new RS_Circle(preview.get(), *cData);
preview->addEntity(e);
drawPreview();
}
}
RS_DEBUG->print("RS_ActionDrawCircle4Line::mouseMoveEvent end");
}
开发者ID:CERobertson,项目名称:LibreCAD,代码行数:28,代码来源:rs_actiondrawcircleinscribe.cpp
示例2: preparePreview
void RS_ActionDrawLineRectangle::trigger() {
RS_PreviewActionInterface::trigger();
RS_Line* line[4];
preparePreview();
// create and add rectangle:
for (int i=0; i<4; ++i) {
line[i] = new RS_Line(container, *data[i]);
line[i]->setLayerToActive();
line[i]->setPenToActive();
container->addEntity(line[i]);
}
// upd. undo list:
if (document) {
document->startUndoCycle();
for (int i=0; i<4; ++i) {
document->addUndoable(line[i]);
}
document->endUndoCycle();
}
// upd. view
graphicView->redraw(RS2::RedrawDrawing);
graphicView->moveRelativeZero(corner2);
}
开发者ID:dinkel,项目名称:LibreCAD,代码行数:27,代码来源:rs_actiondrawlinerectangle.cpp
示例3: snapPoint
void LC_ActionDrawCircle2PR::mouseMoveEvent(QMouseEvent* e) {
RS_Vector mouse = snapPoint(e);
switch (getStatus()) {
case SetPoint1:
point1 = mouse;
break;
case SetPoint2:
if(mouse.distanceTo(point1) <= 2.*data->radius) point2 = mouse;
break;
case SelectCenter: {
if(preparePreview(mouse)){
RS_Circle* circle = new RS_Circle(preview.get(), *data);
deletePreview();
preview->addEntity(circle);
drawPreview();
}else{
if(data->isValid()) trigger();
}
}
}
}
开发者ID:CERobertson,项目名称:LibreCAD,代码行数:25,代码来源:lc_actiondrawcircle2pr.cpp
示例4: switch
void RS_ActionDrawEllipse4Points::coordinateEvent(RS_CoordinateEvent* e) {
if (e==NULL) {
return;
}
RS_Vector mouse = e->getCoordinate();
points.alloc(getStatus()+1);
points.set(getStatus(),mouse);
switch (getStatus()) {
case SetPoint1:
graphicView->moveRelativeZero(mouse);
setStatus(SetPoint2);
break;
case SetPoint2:
case SetPoint3:
case SetPoint4:
if( preparePreview()) {
graphicView->moveRelativeZero(mouse);
if(getStatus() == SetPoint4 ||
(points.get(getStatus()) - points.get(getStatus()-1)).squared() <RS_TOLERANCE*RS_TOLERANCE) {
//also draw the entity, if clicked on the same point twice
trigger();
}else{
setStatus(getStatus()+1);
}
}
default:
break;
}
}
开发者ID:JGabriel85,项目名称:LibreCAD,代码行数:32,代码来源:rs_actiondrawellipse4points.cpp
示例5: switch
void RS_ActionDrawText::init(int status) {
RS_ActionInterface::init(status);
if (RS_DIALOGFACTORY!=NULL) {
switch (status) {
case ShowDialog: {
clearPreview();
reset();
RS_Text tmp(NULL, data);
if (RS_DIALOGFACTORY->requestTextDialog(&tmp)) {
data = tmp.getData();
preparePreview();
preview->setVisible(false);
setStatus(SetPos);
showOptions();
} else {
hideOptions();
finish();
}
graphicView->redraw();
}
break;
case SetPos:
RS_DIALOGFACTORY->requestOptions(this, true, true);
break;
default:
break;
}
}
}
开发者ID:Akaur,项目名称:qdraw,代码行数:34,代码来源:rs_actiondrawtext.cpp
示例6: preparePreview
void RS_ActionDrawArcTangential::trigger() {
RS_PreviewActionInterface::trigger();
if (point.valid==false || baseEntity==NULL) {
RS_DEBUG->print("RS_ActionDrawArcTangential::trigger: "
"conditions not met");
return;
}
preparePreview();
RS_Arc* arc = new RS_Arc(container, *data);
arc->setLayerToActive();
arc->setPenToActive();
container->addEntity(arc);
// upd. undo list:
if (document!=NULL) {
document->startUndoCycle();
document->addUndoable(arc);
document->endUndoCycle();
}
graphicView->redraw(RS2::RedrawDrawing);
graphicView->moveRelativeZero(arc->getCenter());
setStatus(SetBaseEntity);
reset();
}
开发者ID:chenchizhao,项目名称:LibreCAD,代码行数:28,代码来源:rs_actiondrawarctangential.cpp
示例7: snapPoint
void RS_ActionDrawArc3P::mouseMoveEvent(QMouseEvent* e) {
RS_Vector mouse = snapPoint(e);
switch (getStatus()) {
case SetPoint1:
point1 = mouse;
break;
case SetPoint2:
point2 = mouse;
if (point1.valid) {
RS_Line* line = new RS_Line(preview.get(), RS_LineData(point1, point2));
deletePreview();
preview->addEntity(line);
drawPreview();
}
break;
case SetPoint3:
point3 = mouse;
preparePreview();
if (data->isValid()) {
RS_Arc* arc = new RS_Arc(preview.get(), *data);
deletePreview();
preview->addEntity(arc);
drawPreview();
}
break;
default:
break;
}
}
开发者ID:dinkel,项目名称:LibreCAD,代码行数:35,代码来源:rs_actiondrawarc3p.cpp
示例8: preparePreview
void RS_ActionDimDiametric::trigger() {
RS_PreviewActionInterface::trigger();
preparePreview();
if (entity) {
RS_DimDiametric* newEntity = nullptr;
newEntity = new RS_DimDiametric(container,
*data,
*edata);
newEntity->setLayerToActive();
newEntity->setPenToActive();
newEntity->update();
container->addEntity(newEntity);
// upd. undo list:
if (document) {
document->startUndoCycle();
document->addUndoable(newEntity);
document->endUndoCycle();
}
RS_Vector rz = graphicView->getRelativeZero();
graphicView->redraw(RS2::RedrawDrawing);
graphicView->moveRelativeZero(rz);
RS_Snapper::finish();
} else {
RS_DEBUG->print("RS_ActionDimDiametric::trigger:"
" Entity is nullptr\n");
}
}
开发者ID:Aly1029,项目名称:LibreCAD,代码行数:32,代码来源:rs_actiondimdiametric.cpp
示例9: snapPoint
void LC_ActionDrawCircle2PR::mouseMoveEvent(QMouseEvent* e) {
RS_Vector mouse = snapPoint(e);
switch (getStatus()) {
case SetPoint1:
pPoints->point1 = mouse;
break;
case SetPoint2:
if(mouse.distanceTo(pPoints->point1) <= 2.*data->radius) pPoints->point2 = mouse;
break;
case SelectCenter: {
if(preparePreview(mouse)){
bool existing=false;
for(auto p: *preview){
if(p->rtti() == RS2::EntityCircle){
if( static_cast<RS_Circle*>(p)->getData() == *data)
existing=true;
}
}
if(!existing){
deletePreview();
preview->addEntity(new RS_Point(preview.get(), RS_PointData(data->center)));
RS_Circle* circle = new RS_Circle(preview.get(), *data);
preview->addEntity(circle);
drawPreview();
}
}else{
if(data->isValid()) trigger();
}
}
}
}
开发者ID:Aly1029,项目名称:LibreCAD,代码行数:34,代码来源:lc_actiondrawcircle2pr.cpp
示例10: preparePreview
void RS_ActionDrawCircle2P::trigger() {
RS_PreviewActionInterface::trigger();
preparePreview();
if (data.isValid()) {
RS_Circle* circle = new RS_Circle(container,
data);
circle->setLayerToActive();
circle->setPenToActive();
container->addEntity(circle);
// upd. undo list:
if (document!=NULL) {
document->startUndoCycle();
document->addUndoable(circle);
document->endUndoCycle();
}
RS_Vector rz = graphicView->getRelativeZero();
graphicView->redraw(RS2::RedrawDrawing);
graphicView->moveRelativeZero(rz);
setStatus(SetPoint1);
reset();
} else {
if (RS_DIALOGFACTORY!=NULL) {
RS_DIALOGFACTORY->requestWarningDialog(tr("Invalid Circle data."));
}
}
}
开发者ID:JGabriel85,项目名称:LibreCAD,代码行数:30,代码来源:rs_actiondrawcircle2p.cpp
示例11: catchEntity
void RS_ActionDrawCircleInscribe::mouseMoveEvent(QMouseEvent* e) {
RS_DEBUG->print("RS_ActionDrawCircle4Line::mouseMoveEvent begin");
if(getStatus() == SetLine3) {
RS_Entity* en = catchEntity(e, RS2::EntityLine, RS2::ResolveAll);
if(!en) return;
if(!(en->isVisible() && en->rtti()== RS2::EntityLine)) return;
for(int i=0;i<getStatus();i++) {
if(en->getId() == lines[i]->getId()) return; //do not pull in the same line again
}
if(en->getParent() && en->getParent()->ignoredOnModification())
return;
pPoints->coord= graphicView->toGraph(e->x(), e->y());
deletePreview();
while(lines.size()==3){
lines.back()->setHighlighted(false);
graphicView->drawEntity(lines.back());
lines.pop_back();
}
en->setHighlighted(true);
lines.push_back(static_cast<RS_Line*>(en));
graphicView->drawEntity(lines.back());
if(preparePreview()) {
RS_Circle* e=new RS_Circle(preview.get(), pPoints->cData);
preview->addEntity(e);
drawPreview();
}
}
RS_DEBUG->print("RS_ActionDrawCircle4Line::mouseMoveEvent end");
}
开发者ID:Rupicapra-rupicapra,项目名称:LibreCAD,代码行数:31,代码来源:rs_actiondrawcircleinscribe.cpp
示例12: kDebug
void EditorToolThreaded::slotPreview()
{
// Computation already in process.
if (d->currentRenderingMode != EditorToolThreaded::NoneRendering)
{
return;
}
d->currentRenderingMode = EditorToolThreaded::PreviewRendering;
kDebug() << "Preview " << toolName() << " started...";
toolSettings()->enableButton(EditorToolSettings::Ok, false);
toolSettings()->enableButton(EditorToolSettings::SaveAs, false);
toolSettings()->enableButton(EditorToolSettings::Load, false);
toolSettings()->enableButton(EditorToolSettings::Default, false);
toolSettings()->enableButton(EditorToolSettings::Try, false);
toolView()->setEnabled(false);
EditorToolIface::editorToolIface()->setToolStartProgress(d->progressMess.isEmpty() ? toolName() : d->progressMess);
kapp->setOverrideCursor(Qt::WaitCursor);
if (d->delFilter && d->threadedFilter)
{
delete d->threadedFilter;
d->threadedFilter = 0;
}
preparePreview();
}
开发者ID:rickysarraf,项目名称:digikam,代码行数:29,代码来源:editortool.cpp
示例13: preparePreview
void RS_ActionDrawArc3P::trigger() {
RS_PreviewActionInterface::trigger();
preparePreview();
if (data.isValid()) {
RS_Arc* arc = new RS_Arc(container,
data);
arc->setLayerToActive();
arc->setPenToActive();
container->addEntity(arc);
// upd. undo list:
if (document!=NULL) {
document->startUndoCycle();
document->addUndoable(arc);
document->endUndoCycle();
}
deleteSnapper();
graphicView->moveRelativeZero(RS_Vector(0.0,0.0));
graphicView->drawEntity(arc);
graphicView->moveRelativeZero(arc->getEndpoint());
drawSnapper();
setStatus(SetPoint1);
reset();
} else {
//RS_DIALOGFACTORY->requestWarningDialog(tr("Invalid arc data."));
RS_DIALOGFACTORY->commandMessage(tr("Invalid arc data."));
}
}
开发者ID:Akaur,项目名称:qdraw,代码行数:31,代码来源:rs_actiondrawarc3p.cpp
示例14: switch
void RS_ActionDimRadial::mouseMoveEvent(QMouseEvent* e) {
RS_DEBUG->print("RS_ActionDimRadial::mouseMoveEvent begin");
//RS_Vector mouse(graphicView->toGraphX(e->x()),
// graphicView->toGraphY(e->y()));
switch (getStatus()) {
case SetEntity:
entity = catchEntity(e, RS2::ResolveAll);
break;
case SetPos:
if (entity) {
pos = snapPoint(e);
preparePreview();
RS_DimRadial* d = new RS_DimRadial(preview.get(), *data, *edata);
deletePreview();
preview->addEntity(d);
d->update();
drawPreview();
}
break;
default:
break;
}
RS_DEBUG->print("RS_ActionDimRadial::mouseMoveEvent end");
}
开发者ID:Ngassa,项目名称:LibreCAD,代码行数:32,代码来源:rs_actiondimradial.cpp
示例15: switch
void RS_ActionDrawText::init(int status) {
RS_ActionInterface::init(status);
if (RS_DIALOGFACTORY) {
switch (status) {
case ShowDialog: {
reset();
RS_Text tmp(NULL, *data);
if (RS_DIALOGFACTORY->requestTextDialog(&tmp)) {
data.reset(new RS_TextData(tmp.getData()));
setStatus(SetPos);
showOptions();
} else {
hideOptions();
setFinished();
}
}
break;
case SetPos:
RS_DIALOGFACTORY->requestOptions(this, true, true);
deletePreview();
preview->setVisible(true);
preparePreview();
break;
default:
break;
}
}
}
开发者ID:Harpalus,项目名称:LibreCAD,代码行数:32,代码来源:rs_actiondrawtext.cpp
示例16: snapPoint
void RS_ActionDrawEllipse4Points::mouseMoveEvent(QMouseEvent* e) {
// RS_DEBUG->print("RS_ActionDrawEllipse4Point::mouseMoveEvent begin");
RS_Vector mouse = snapPoint(e);
points.set(getStatus(),mouse);
if(preparePreview()) {
switch(getStatus()) {
case SetPoint2:
case SetPoint3:
{
RS_Circle* circle=new RS_Circle(preview, cData);
deletePreview();
preview->addEntity(circle);
drawPreview();
}
break;
case SetPoint4:
{
deletePreview();
RS_Ellipse* e=new RS_Ellipse(preview, eData);
preview->addEntity(e);
drawPreview();
}
default:
break;
}
}
// RS_DEBUG->print("RS_ActionDrawEllipse4Point::mouseMoveEvent end");
}
开发者ID:JGabriel85,项目名称:LibreCAD,代码行数:32,代码来源:rs_actiondrawellipse4points.cpp
示例17: 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:Harpalus,项目名称:LibreCAD,代码行数:30,代码来源:rs_actiondrawellipseinscribe.cpp
示例18: snapPoint
void RS_ActionDrawEllipseCenter3Points::mouseMoveEvent(QMouseEvent* e) {
// RS_DEBUG->print("RS_ActionDrawEllipseCenter3Points::mouseMoveEvent begin");
RS_Vector mouse = snapPoint(e);
if(getStatus() == SetCenter) return;
points.resize(getStatus());
points.push_back(mouse);
if(preparePreview()) {
switch(getStatus()) {
case SetPoint1:
{
RS_Circle* circle=new RS_Circle(preview.get(), *cData);
deletePreview();
preview->addEntity(circle);
drawPreview();
}
break;
case SetPoint2:
case SetPoint3:
{
deletePreview();
RS_Ellipse* e=new RS_Ellipse(preview.get(), *eData);
preview->addEntity(e);
drawPreview();
}
default:
break;
}
}
RS_DEBUG->print("RS_ActionDrawEllipseCenter3Points::mouseMoveEvent end");
}
开发者ID:PlastecProfiles,项目名称:LibreCAD,代码行数:33,代码来源:rs_actiondrawellipsecenter3points.cpp
示例19: preparePreview
void RS_ActionDimAligned::trigger() {
RS_ActionDimension::trigger();
preparePreview();
graphicView->moveRelativeZero(data->definitionPoint);
//data->text = getText();
RS_DimAligned* dim =
new RS_DimAligned(container, *data, *edata);
dim->setLayerToActive();
dim->setPenToActive();
dim->update();
container->addEntity(dim);
// upd. undo list:
if (document) {
document->startUndoCycle();
document->addUndoable(dim);
document->endUndoCycle();
}
RS_Vector rz = graphicView->getRelativeZero();
graphicView->redraw(RS2::RedrawDrawing);
graphicView->moveRelativeZero(rz);
RS_DEBUG->print("RS_ActionDimAligned::trigger():"
" dim added: %d", dim->getId());
}
开发者ID:Aly1029,项目名称:LibreCAD,代码行数:28,代码来源:rs_actiondimaligned.cpp
示例20: preparePreview
void RS_ActionDimRadial::trigger() {
RS_ActionDimension::trigger();
preparePreview();
if (entity) {
RS_DimRadial* newEntity = NULL;
newEntity = new RS_DimRadial(container,
*data,
*edata);
newEntity->setLayerToActive();
newEntity->setPenToActive();
newEntity->update();
container->addEntity(newEntity);
// upd. undo list:
if (document) {
document->startUndoCycle();
document->addUndoable(newEntity);
document->endUndoCycle();
}
RS_Vector rz = graphicView->getRelativeZero();
graphicView->redraw(RS2::RedrawDrawing);
graphicView->moveRelativeZero(rz);
//drawSnapper();
}
else {
RS_DEBUG->print("RS_ActionDimRadial::trigger:"
" Entity is NULL\n");
}
}
开发者ID:Ngassa,项目名称:LibreCAD,代码行数:33,代码来源:rs_actiondimradial.cpp
注:本文中的preparePreview函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论