Added new feature Zoom Fit Best Current pattern piece.
--HG-- branch : develop
This commit is contained in:
parent
61dcc52965
commit
8e0a7250df
|
@ -4,6 +4,7 @@
|
||||||
- [#684] Proposal: Add option to only show outer edges on detail.
|
- [#684] Proposal: Add option to only show outer edges on detail.
|
||||||
- [#244] New feature: Adjust line and point thickness and label size.
|
- [#244] New feature: Adjust line and point thickness and label size.
|
||||||
- [#637] Max scene size too small to fit all objects.
|
- [#637] Max scene size too small to fit all objects.
|
||||||
|
- New feature Zoom Fit Best Current pattern piece.
|
||||||
|
|
||||||
# Version 0.5.1
|
# Version 0.5.1
|
||||||
- [#683] Tool Seam allowance's dialog is off screen on small resolutions.
|
- [#683] Tool Seam allowance's dialog is off screen on small resolutions.
|
||||||
|
|
|
@ -280,7 +280,7 @@ void MainWindow::AddPP(const QString &PPName)
|
||||||
|
|
||||||
// Show best for new PP
|
// Show best for new PP
|
||||||
VMainGraphicsView::NewSceneRect(ui->view->scene(), ui->view);
|
VMainGraphicsView::NewSceneRect(ui->view->scene(), ui->view);
|
||||||
ui->view->fitInView(doc->ActiveDrawBoundingRect(), Qt::KeepAspectRatio);
|
ZoomFitBestCurrent();
|
||||||
|
|
||||||
ui->actionNewDraw->setEnabled(true);
|
ui->actionNewDraw->setEnabled(true);
|
||||||
helpLabel->setText("");
|
helpLabel->setText("");
|
||||||
|
@ -1172,6 +1172,29 @@ void MainWindow::ClosedDialogInsertNode(int result)
|
||||||
doc->LiteParseTree(Document::LiteParse);
|
doc->LiteParseTree(Document::LiteParse);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void MainWindow::ZoomFitBestCurrent()
|
||||||
|
{
|
||||||
|
const QRectF rect = doc->ActiveDrawBoundingRect();
|
||||||
|
if (rect.isEmpty())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ui->view->fitInView(rect, Qt::KeepAspectRatio);
|
||||||
|
QTransform transform = ui->view->transform();
|
||||||
|
|
||||||
|
qreal factor = transform.m11();
|
||||||
|
factor = qMax(factor, ui->view->MinScale());
|
||||||
|
factor = qMin(factor, ui->view->MaxScale());
|
||||||
|
|
||||||
|
transform.setMatrix(factor, transform.m12(), transform.m13(), transform.m21(), factor, transform.m23(),
|
||||||
|
transform.m31(), transform.m32(), transform.m33());
|
||||||
|
ui->view->setTransform(transform);
|
||||||
|
|
||||||
|
VMainGraphicsView::NewSceneRect(ui->view->scene(), ui->view);
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief ToolCutArc handler tool cutArc.
|
* @brief ToolCutArc handler tool cutArc.
|
||||||
|
@ -1855,6 +1878,11 @@ void MainWindow::ToolBarTools()
|
||||||
zoomFitBestShortcuts.append(QKeySequence(Qt::ControlModifier + Qt::Key_Equal));
|
zoomFitBestShortcuts.append(QKeySequence(Qt::ControlModifier + Qt::Key_Equal));
|
||||||
ui->actionZoomFitBest->setShortcuts(zoomFitBestShortcuts);
|
ui->actionZoomFitBest->setShortcuts(zoomFitBestShortcuts);
|
||||||
connect(ui->actionZoomFitBest, &QAction::triggered, ui->view, &VMainGraphicsView::ZoomFitBest);
|
connect(ui->actionZoomFitBest, &QAction::triggered, ui->view, &VMainGraphicsView::ZoomFitBest);
|
||||||
|
|
||||||
|
QList<QKeySequence> zoomFitBestCurrentShortcuts;
|
||||||
|
zoomFitBestCurrentShortcuts.append(QKeySequence(Qt::ControlModifier + Qt::Key_M));
|
||||||
|
ui->actionZoomFitBestCurrent->setShortcuts(zoomFitBestCurrentShortcuts);
|
||||||
|
connect(ui->actionZoomFitBestCurrent, &QAction::triggered, this, &MainWindow::ZoomFitBestCurrent);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -2742,6 +2770,7 @@ void MainWindow::Clear()
|
||||||
ui->actionZoomIn->setEnabled(false);
|
ui->actionZoomIn->setEnabled(false);
|
||||||
ui->actionZoomOut->setEnabled(false);
|
ui->actionZoomOut->setEnabled(false);
|
||||||
ui->actionZoomFitBest->setEnabled(false);
|
ui->actionZoomFitBest->setEnabled(false);
|
||||||
|
ui->actionZoomFitBestCurrent->setEnabled(false);
|
||||||
ui->actionZoomOriginal->setEnabled(false);
|
ui->actionZoomOriginal->setEnabled(false);
|
||||||
ui->actionHistory->setEnabled(false);
|
ui->actionHistory->setEnabled(false);
|
||||||
ui->actionTable->setEnabled(false);
|
ui->actionTable->setEnabled(false);
|
||||||
|
@ -2987,6 +3016,7 @@ void MainWindow::SetEnableWidgets(bool enable)
|
||||||
ui->actionLayout->setEnabled(enable);
|
ui->actionLayout->setEnabled(enable);
|
||||||
ui->actionTable->setEnabled(enable && drawStage);
|
ui->actionTable->setEnabled(enable && drawStage);
|
||||||
ui->actionZoomFitBest->setEnabled(enable);
|
ui->actionZoomFitBest->setEnabled(enable);
|
||||||
|
ui->actionZoomFitBestCurrent->setEnabled(enable && drawStage);
|
||||||
ui->actionZoomOriginal->setEnabled(enable);
|
ui->actionZoomOriginal->setEnabled(enable);
|
||||||
ui->actionShowCurveDetails->setEnabled(enable && drawStage);
|
ui->actionShowCurveDetails->setEnabled(enable && drawStage);
|
||||||
ui->actionLoadIndividual->setEnabled(enable && designStage);
|
ui->actionLoadIndividual->setEnabled(enable && designStage);
|
||||||
|
@ -4580,7 +4610,7 @@ void MainWindow::ChangePP(int index, bool zoomBestFit)
|
||||||
ArrowTool();
|
ArrowTool();
|
||||||
if (zoomBestFit)
|
if (zoomBestFit)
|
||||||
{
|
{
|
||||||
ui->view->fitInView(doc->ActiveDrawBoundingRect(), Qt::KeepAspectRatio);
|
ZoomFitBestCurrent();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
toolOptions->itemClicked(nullptr);//hide options for tool in previous pattern piece
|
toolOptions->itemClicked(nullptr);//hide options for tool in previous pattern piece
|
||||||
|
|
|
@ -177,6 +177,7 @@ private slots:
|
||||||
void ClosedDialogPin(int result);
|
void ClosedDialogPin(int result);
|
||||||
void ClosedDialogInsertNode(int result);
|
void ClosedDialogInsertNode(int result);
|
||||||
|
|
||||||
|
void ZoomFitBestCurrent();
|
||||||
void LoadIndividual();
|
void LoadIndividual();
|
||||||
void LoadStandard();
|
void LoadStandard();
|
||||||
void UnloadMeasurements();
|
void UnloadMeasurements();
|
||||||
|
|
|
@ -427,7 +427,7 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>127</width>
|
<width>140</width>
|
||||||
<height>110</height>
|
<height>110</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
@ -536,7 +536,7 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>127</width>
|
<width>140</width>
|
||||||
<height>248</height>
|
<height>248</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
@ -798,7 +798,7 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>127</width>
|
<width>140</width>
|
||||||
<height>248</height>
|
<height>248</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
@ -1324,7 +1324,7 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>127</width>
|
<width>140</width>
|
||||||
<height>196</height>
|
<height>196</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
@ -1663,6 +1663,7 @@
|
||||||
<addaction name="actionZoomIn"/>
|
<addaction name="actionZoomIn"/>
|
||||||
<addaction name="actionZoomOut"/>
|
<addaction name="actionZoomOut"/>
|
||||||
<addaction name="actionZoomFitBest"/>
|
<addaction name="actionZoomFitBest"/>
|
||||||
|
<addaction name="actionZoomFitBestCurrent"/>
|
||||||
<addaction name="actionZoomOriginal"/>
|
<addaction name="actionZoomOriginal"/>
|
||||||
<addaction name="separator"/>
|
<addaction name="separator"/>
|
||||||
<addaction name="actionLast_tool"/>
|
<addaction name="actionLast_tool"/>
|
||||||
|
@ -2645,6 +2646,23 @@
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Export increments to CSV</string>
|
<string>Export increments to CSV</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="menuRole">
|
||||||
|
<enum>QAction::NoRole</enum>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionZoomFitBestCurrent">
|
||||||
|
<property name="text">
|
||||||
|
<string>Zoom fit best current</string>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>zoom fit best current pattern piece</string>
|
||||||
|
</property>
|
||||||
|
<property name="shortcut">
|
||||||
|
<string notr="true">Ctrl+M</string>
|
||||||
|
</property>
|
||||||
|
<property name="menuRole">
|
||||||
|
<enum>QAction::NoRole</enum>
|
||||||
|
</property>
|
||||||
</action>
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<layoutdefault spacing="6" margin="11"/>
|
<layoutdefault spacing="6" margin="11"/>
|
||||||
|
|
|
@ -3794,106 +3794,50 @@ QRectF VPattern::ActiveDrawBoundingRect() const
|
||||||
Q_UNREACHABLE();
|
Q_UNREACHABLE();
|
||||||
break;
|
break;
|
||||||
case Tool::BasePoint:
|
case Tool::BasePoint:
|
||||||
rec = ToolBoundingRect<VToolBasePoint>(rec, tool.getId());
|
case Tool::LineIntersect:
|
||||||
|
case Tool::PointOfContact:
|
||||||
|
case Tool::Triangle:
|
||||||
|
case Tool::PointOfIntersection:
|
||||||
|
case Tool::CutArc:
|
||||||
|
case Tool::CutSpline:
|
||||||
|
case Tool::CutSplinePath:
|
||||||
|
case Tool::PointOfIntersectionArcs:
|
||||||
|
case Tool::PointOfIntersectionCircles:
|
||||||
|
case Tool::PointOfIntersectionCurves:
|
||||||
|
case Tool::PointFromCircleAndTangent:
|
||||||
|
case Tool::PointFromArcAndTangent:
|
||||||
|
rec = ToolBoundingRect<VToolSinglePoint>(rec, tool.getId());
|
||||||
break;
|
break;
|
||||||
case Tool::EndLine:
|
case Tool::EndLine:
|
||||||
rec = ToolBoundingRect<VToolEndLine>(rec, tool.getId());
|
case Tool::AlongLine:
|
||||||
|
case Tool::ShoulderPoint:
|
||||||
|
case Tool::Normal:
|
||||||
|
case Tool::Bisector:
|
||||||
|
case Tool::Height:
|
||||||
|
case Tool::LineIntersectAxis:
|
||||||
|
case Tool::CurveIntersectAxis:
|
||||||
|
rec = ToolBoundingRect<VToolLinePoint>(rec, tool.getId());
|
||||||
break;
|
break;
|
||||||
case Tool::Line:
|
case Tool::Line:
|
||||||
rec = ToolBoundingRect<VToolLine>(rec, tool.getId());
|
rec = ToolBoundingRect<VToolLine>(rec, tool.getId());
|
||||||
break;
|
break;
|
||||||
case Tool::AlongLine:
|
|
||||||
rec = ToolBoundingRect<VToolAlongLine>(rec, tool.getId());
|
|
||||||
break;
|
|
||||||
case Tool::ShoulderPoint:
|
|
||||||
rec = ToolBoundingRect<VToolShoulderPoint>(rec, tool.getId());
|
|
||||||
break;
|
|
||||||
case Tool::Normal:
|
|
||||||
rec = ToolBoundingRect<VToolNormal>(rec, tool.getId());
|
|
||||||
break;
|
|
||||||
case Tool::Bisector:
|
|
||||||
rec = ToolBoundingRect<VToolBisector>(rec, tool.getId());
|
|
||||||
break;
|
|
||||||
case Tool::LineIntersect:
|
|
||||||
rec = ToolBoundingRect<VToolLineIntersect>(rec, tool.getId());
|
|
||||||
break;
|
|
||||||
case Tool::Spline:
|
case Tool::Spline:
|
||||||
rec = ToolBoundingRect<VToolSpline>(rec, tool.getId());
|
|
||||||
break;
|
|
||||||
case Tool::CubicBezier:
|
case Tool::CubicBezier:
|
||||||
rec = ToolBoundingRect<VToolCubicBezier>(rec, tool.getId());
|
|
||||||
break;
|
|
||||||
case Tool::Arc:
|
case Tool::Arc:
|
||||||
rec = ToolBoundingRect<VToolArc>(rec, tool.getId());
|
|
||||||
break;
|
|
||||||
case Tool::SplinePath:
|
case Tool::SplinePath:
|
||||||
rec = ToolBoundingRect<VToolSplinePath>(rec, tool.getId());
|
|
||||||
break;
|
|
||||||
case Tool::CubicBezierPath:
|
case Tool::CubicBezierPath:
|
||||||
rec = ToolBoundingRect<VToolCubicBezierPath>(rec, tool.getId());
|
|
||||||
break;
|
|
||||||
case Tool::PointOfContact:
|
|
||||||
rec = ToolBoundingRect<VToolPointOfContact>(rec, tool.getId());
|
|
||||||
break;
|
|
||||||
case Tool::Height:
|
|
||||||
rec = ToolBoundingRect<VToolHeight>(rec, tool.getId());
|
|
||||||
break;
|
|
||||||
case Tool::Triangle:
|
|
||||||
rec = ToolBoundingRect<VToolTriangle>(rec, tool.getId());
|
|
||||||
break;
|
|
||||||
case Tool::PointOfIntersection:
|
|
||||||
rec = ToolBoundingRect<VToolPointOfIntersection>(rec, tool.getId());
|
|
||||||
break;
|
|
||||||
case Tool::CutArc:
|
|
||||||
rec = ToolBoundingRect<VToolCutArc>(rec, tool.getId());
|
|
||||||
break;
|
|
||||||
case Tool::CutSpline:
|
|
||||||
rec = ToolBoundingRect<VToolCutSpline>(rec, tool.getId());
|
|
||||||
break;
|
|
||||||
case Tool::CutSplinePath:
|
|
||||||
rec = ToolBoundingRect<VToolCutSplinePath>(rec, tool.getId());
|
|
||||||
break;
|
|
||||||
case Tool::ArcWithLength:
|
case Tool::ArcWithLength:
|
||||||
rec = ToolBoundingRect<VToolArcWithLength>(rec, tool.getId());
|
case Tool::EllipticalArc:
|
||||||
break;
|
rec = ToolBoundingRect<VAbstractSpline>(rec, tool.getId());
|
||||||
case Tool::LineIntersectAxis:
|
|
||||||
rec = ToolBoundingRect<VToolLineIntersectAxis>(rec, tool.getId());
|
|
||||||
break;
|
|
||||||
case Tool::PointOfIntersectionArcs:
|
|
||||||
rec = ToolBoundingRect<VToolPointOfIntersectionArcs>(rec, tool.getId());
|
|
||||||
break;
|
|
||||||
case Tool::PointOfIntersectionCircles:
|
|
||||||
rec = ToolBoundingRect<VToolPointOfIntersectionCircles>(rec, tool.getId());
|
|
||||||
break;
|
|
||||||
case Tool::PointOfIntersectionCurves:
|
|
||||||
rec = ToolBoundingRect<VToolPointOfIntersectionCurves>(rec, tool.getId());
|
|
||||||
break;
|
|
||||||
case Tool::CurveIntersectAxis:
|
|
||||||
rec = ToolBoundingRect<VToolCurveIntersectAxis>(rec, tool.getId());
|
|
||||||
break;
|
|
||||||
case Tool::PointFromCircleAndTangent:
|
|
||||||
rec = ToolBoundingRect<VToolPointFromCircleAndTangent>(rec, tool.getId());
|
|
||||||
break;
|
|
||||||
case Tool::PointFromArcAndTangent:
|
|
||||||
rec = ToolBoundingRect<VToolPointFromArcAndTangent>(rec, tool.getId());
|
|
||||||
break;
|
break;
|
||||||
case Tool::TrueDarts:
|
case Tool::TrueDarts:
|
||||||
rec = ToolBoundingRect<VToolTrueDarts>(rec, tool.getId());
|
rec = ToolBoundingRect<VToolDoublePoint>(rec, tool.getId());
|
||||||
break;
|
break;
|
||||||
case Tool::Rotation:
|
case Tool::Rotation:
|
||||||
rec = ToolBoundingRect<VToolRotation>(rec, tool.getId());
|
|
||||||
break;
|
|
||||||
case Tool::FlippingByLine:
|
case Tool::FlippingByLine:
|
||||||
rec = ToolBoundingRect<VToolFlippingByLine>(rec, tool.getId());
|
|
||||||
break;
|
|
||||||
case Tool::FlippingByAxis:
|
case Tool::FlippingByAxis:
|
||||||
rec = ToolBoundingRect<VToolFlippingByAxis>(rec, tool.getId());
|
|
||||||
break;
|
|
||||||
case Tool::Move:
|
case Tool::Move:
|
||||||
rec = ToolBoundingRect<VToolMove>(rec, tool.getId());
|
rec = ToolBoundingRect<VAbstractOperation>(rec, tool.getId());
|
||||||
break;
|
|
||||||
case Tool::EllipticalArc:
|
|
||||||
rec = ToolBoundingRect<VToolEllipticalArc>(rec, tool.getId());
|
|
||||||
break;
|
break;
|
||||||
//These tools are not accesseble in Draw mode, but still 'history' contains them.
|
//These tools are not accesseble in Draw mode, but still 'history' contains them.
|
||||||
case Tool::Piece:
|
case Tool::Piece:
|
||||||
|
@ -3930,7 +3874,7 @@ QRectF VPattern::ToolBoundingRect(const QRectF &rec, const quint32 &id) const
|
||||||
//map to scene coordinate.
|
//map to scene coordinate.
|
||||||
childrenRect.translate(vTool->scenePos());
|
childrenRect.translate(vTool->scenePos());
|
||||||
|
|
||||||
recTool = recTool.united(vTool->boundingRect());
|
recTool = recTool.united(vTool->sceneBoundingRect());
|
||||||
recTool = recTool.united(childrenRect);
|
recTool = recTool.united(childrenRect);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -97,9 +97,9 @@ void VToolLinePoint::paint(QPainter *painter, const QStyleOptionGraphicsItem *op
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QRectF VToolLinePoint::boundingRect() const
|
QRectF VToolLinePoint::boundingRect() const
|
||||||
{
|
{
|
||||||
QRectF rect = VToolSinglePoint::boundingRect();
|
QRectF recTool = VToolSinglePoint::boundingRect();
|
||||||
rect = rect.united(mainLine->boundingRect());
|
recTool = recTool.united(childrenBoundingRect());
|
||||||
return rect;
|
return recTool;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -90,11 +90,3 @@ void VisToolFlippingByAxis::paint(QPainter *painter, const QStyleOptionGraphicsI
|
||||||
|
|
||||||
VisOperation::paint(painter, option, widget);
|
VisOperation::paint(painter, option, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
QRectF VisToolFlippingByAxis::boundingRect() const
|
|
||||||
{
|
|
||||||
QRectF rect = VisOperation::boundingRect();
|
|
||||||
rect = rect.united(point1->boundingRect());
|
|
||||||
return rect;
|
|
||||||
}
|
|
||||||
|
|
|
@ -51,7 +51,6 @@ public:
|
||||||
|
|
||||||
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||||
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
||||||
virtual QRectF boundingRect() const Q_DECL_OVERRIDE;
|
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(VisToolFlippingByAxis)
|
Q_DISABLE_COPY(VisToolFlippingByAxis)
|
||||||
|
|
||||||
|
|
|
@ -83,15 +83,6 @@ void VisToolFlippingByLine::paint(QPainter *painter, const QStyleOptionGraphicsI
|
||||||
VisOperation::paint(painter, option, widget);
|
VisOperation::paint(painter, option, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
QRectF VisToolFlippingByLine::boundingRect() const
|
|
||||||
{
|
|
||||||
QRectF rect = VisOperation::boundingRect();
|
|
||||||
rect = rect.united(point1->boundingRect());
|
|
||||||
rect = rect.united(point2->boundingRect());
|
|
||||||
return rect;
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VisToolFlippingByLine::SetFirstLinePointId(quint32 value)
|
void VisToolFlippingByLine::SetFirstLinePointId(quint32 value)
|
||||||
{
|
{
|
||||||
|
|
|
@ -43,7 +43,6 @@ public:
|
||||||
virtual void RefreshGeometry() Q_DECL_OVERRIDE;
|
virtual void RefreshGeometry() Q_DECL_OVERRIDE;
|
||||||
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||||
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
||||||
virtual QRectF boundingRect() const Q_DECL_OVERRIDE;
|
|
||||||
|
|
||||||
void SetFirstLinePointId(quint32 value);
|
void SetFirstLinePointId(quint32 value);
|
||||||
void SetSecondLinePointId(quint32 value);
|
void SetSecondLinePointId(quint32 value);
|
||||||
|
|
|
@ -139,15 +139,6 @@ void VisToolMove::paint(QPainter *painter, const QStyleOptionGraphicsItem *optio
|
||||||
VisOperation::paint(painter, option, widget);
|
VisOperation::paint(painter, option, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
QRectF VisToolMove::boundingRect() const
|
|
||||||
{
|
|
||||||
QRectF rect = VisOperation::boundingRect();
|
|
||||||
rect = rect.united(pointOrigin->boundingRect());
|
|
||||||
rect = rect.united(pointFinish->boundingRect());
|
|
||||||
return rect;
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QString VisToolMove::Angle() const
|
QString VisToolMove::Angle() const
|
||||||
{
|
{
|
||||||
|
|
|
@ -53,7 +53,6 @@ public:
|
||||||
virtual void RefreshGeometry() Q_DECL_OVERRIDE;
|
virtual void RefreshGeometry() Q_DECL_OVERRIDE;
|
||||||
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||||
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
||||||
virtual QRectF boundingRect() const Q_DECL_OVERRIDE;
|
|
||||||
|
|
||||||
QString Angle() const;
|
QString Angle() const;
|
||||||
void SetAngle(const QString &expression);
|
void SetAngle(const QString &expression);
|
||||||
|
|
|
@ -202,16 +202,6 @@ void VisToolRotation::paint(QPainter *painter, const QStyleOptionGraphicsItem *o
|
||||||
VisOperation::paint(painter, option, widget);
|
VisOperation::paint(painter, option, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
QRectF VisToolRotation::boundingRect() const
|
|
||||||
{
|
|
||||||
QRectF rect = VisOperation::boundingRect();
|
|
||||||
rect = rect.united(point->boundingRect());
|
|
||||||
rect = rect.united(angleArc->boundingRect());
|
|
||||||
rect = rect.united(xAxis->boundingRect());
|
|
||||||
return rect;
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VisToolRotation::SetOriginPointId(quint32 value)
|
void VisToolRotation::SetOriginPointId(quint32 value)
|
||||||
{
|
{
|
||||||
|
|
|
@ -53,7 +53,6 @@ public:
|
||||||
virtual void RefreshGeometry() Q_DECL_OVERRIDE;
|
virtual void RefreshGeometry() Q_DECL_OVERRIDE;
|
||||||
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||||
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
||||||
virtual QRectF boundingRect() const Q_DECL_OVERRIDE;
|
|
||||||
|
|
||||||
void SetOriginPointId(quint32 value);
|
void SetOriginPointId(quint32 value);
|
||||||
|
|
||||||
|
|
|
@ -86,6 +86,14 @@ void VisLine::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, Q
|
||||||
QGraphicsLineItem::paint(painter, option, widget);
|
QGraphicsLineItem::paint(painter, option, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
QRectF VisLine::boundingRect() const
|
||||||
|
{
|
||||||
|
QRectF recTool = QGraphicsLineItem::boundingRect();
|
||||||
|
recTool = recTool.united(childrenBoundingRect());
|
||||||
|
return recTool;
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QPointF VisLine::Ray(const QPointF &firstPoint, const qreal &angle) const
|
QPointF VisLine::Ray(const QPointF &firstPoint, const qreal &angle) const
|
||||||
{
|
{
|
||||||
|
|
|
@ -55,8 +55,9 @@ public:
|
||||||
enum { Type = UserType + static_cast<int>(Vis::Line)};
|
enum { Type = UserType + static_cast<int>(Vis::Line)};
|
||||||
static qreal CorrectAngle(const qreal &angle);
|
static qreal CorrectAngle(const qreal &angle);
|
||||||
|
|
||||||
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||||
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
||||||
|
virtual QRectF boundingRect() const Q_DECL_OVERRIDE;
|
||||||
protected:
|
protected:
|
||||||
QPointF Ray(const QPointF &firstPoint, const qreal &angle) const;
|
QPointF Ray(const QPointF &firstPoint, const qreal &angle) const;
|
||||||
QPointF Ray(const QPointF &firstPoint) const;
|
QPointF Ray(const QPointF &firstPoint) const;
|
||||||
|
|
|
@ -82,17 +82,6 @@ void VisToolAlongLine::paint(QPainter *painter, const QStyleOptionGraphicsItem *
|
||||||
VisLine::paint(painter, option, widget);
|
VisLine::paint(painter, option, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
QRectF VisToolAlongLine::boundingRect() const
|
|
||||||
{
|
|
||||||
QRectF rect = VisLine::boundingRect();
|
|
||||||
rect = rect.united(point->boundingRect());
|
|
||||||
rect = rect.united(lineP1->boundingRect());
|
|
||||||
rect = rect.united(lineP2->boundingRect());
|
|
||||||
rect = rect.united(line->boundingRect());
|
|
||||||
return rect;
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VisToolAlongLine::RefreshGeometry()
|
void VisToolAlongLine::RefreshGeometry()
|
||||||
{
|
{
|
||||||
|
|
|
@ -54,7 +54,6 @@ public:
|
||||||
|
|
||||||
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||||
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
||||||
virtual QRectF boundingRect() const Q_DECL_OVERRIDE;
|
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(VisToolAlongLine)
|
Q_DISABLE_COPY(VisToolAlongLine)
|
||||||
quint32 object2Id;
|
quint32 object2Id;
|
||||||
|
|
|
@ -90,19 +90,6 @@ void VisToolBisector::paint(QPainter *painter, const QStyleOptionGraphicsItem *o
|
||||||
VisLine::paint(painter, option, widget);
|
VisLine::paint(painter, option, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
QRectF VisToolBisector::boundingRect() const
|
|
||||||
{
|
|
||||||
QRectF rect = VisLine::boundingRect();
|
|
||||||
rect = rect.united(point->boundingRect());
|
|
||||||
rect = rect.united(line1P1->boundingRect());
|
|
||||||
rect = rect.united(line1P2->boundingRect());
|
|
||||||
rect = rect.united(line1->boundingRect());
|
|
||||||
rect = rect.united(line2P2->boundingRect());
|
|
||||||
rect = rect.united(line2->boundingRect());
|
|
||||||
return rect;
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VisToolBisector::RefreshGeometry()
|
void VisToolBisector::RefreshGeometry()
|
||||||
{
|
{
|
||||||
|
|
|
@ -55,7 +55,6 @@ public:
|
||||||
|
|
||||||
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||||
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
||||||
virtual QRectF boundingRect() const Q_DECL_OVERRIDE;
|
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(VisToolBisector)
|
Q_DISABLE_COPY(VisToolBisector)
|
||||||
quint32 object2Id;
|
quint32 object2Id;
|
||||||
|
|
|
@ -127,15 +127,3 @@ void VisToolCurveIntersectAxis::paint(QPainter *painter, const QStyleOptionGraph
|
||||||
|
|
||||||
VisLine::paint(painter, option, widget);
|
VisLine::paint(painter, option, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
QRectF VisToolCurveIntersectAxis::boundingRect() const
|
|
||||||
{
|
|
||||||
QRectF rect = VisLine::boundingRect();
|
|
||||||
rect = rect.united(point->boundingRect());
|
|
||||||
rect = rect.united(basePoint->boundingRect());
|
|
||||||
rect = rect.united(baseLine->boundingRect());
|
|
||||||
rect = rect.united(axisLine->boundingRect());
|
|
||||||
rect = rect.united(visCurve->boundingRect());
|
|
||||||
return rect;
|
|
||||||
}
|
|
||||||
|
|
|
@ -57,7 +57,6 @@ public:
|
||||||
|
|
||||||
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||||
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
||||||
virtual QRectF boundingRect() const Q_DECL_OVERRIDE;
|
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(VisToolCurveIntersectAxis)
|
Q_DISABLE_COPY(VisToolCurveIntersectAxis)
|
||||||
quint32 axisPointId;
|
quint32 axisPointId;
|
||||||
|
|
|
@ -120,11 +120,3 @@ void VisToolEndLine::paint(QPainter *painter, const QStyleOptionGraphicsItem *op
|
||||||
|
|
||||||
VisLine::paint(painter, option, widget);
|
VisLine::paint(painter, option, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
QRectF VisToolEndLine::boundingRect() const
|
|
||||||
{
|
|
||||||
QRectF rect = VisLine::boundingRect();
|
|
||||||
rect = rect.united(point->boundingRect());
|
|
||||||
return rect;
|
|
||||||
}
|
|
||||||
|
|
|
@ -59,7 +59,6 @@ public:
|
||||||
|
|
||||||
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||||
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
||||||
virtual QRectF boundingRect() const Q_DECL_OVERRIDE;
|
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(VisToolEndLine)
|
Q_DISABLE_COPY(VisToolEndLine)
|
||||||
qreal length;
|
qreal length;
|
||||||
|
|
|
@ -127,19 +127,6 @@ void VisToolHeight::paint(QPainter *painter, const QStyleOptionGraphicsItem *opt
|
||||||
VisLine::paint(painter, option, widget);
|
VisLine::paint(painter, option, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
QRectF VisToolHeight::boundingRect() const
|
|
||||||
{
|
|
||||||
QRectF rect = VisLine::boundingRect();
|
|
||||||
rect = rect.united(point->boundingRect());
|
|
||||||
rect = rect.united(base_point->boundingRect());
|
|
||||||
rect = rect.united(lineP1->boundingRect());
|
|
||||||
rect = rect.united(lineP2->boundingRect());
|
|
||||||
rect = rect.united(line->boundingRect());
|
|
||||||
rect = rect.united(line_intersection->boundingRect());
|
|
||||||
return rect;
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VisToolHeight::ShowIntersection(const QLineF &height_line, const QLineF &base_line)
|
void VisToolHeight::ShowIntersection(const QLineF &height_line, const QLineF &base_line)
|
||||||
{
|
{
|
||||||
|
|
|
@ -56,7 +56,6 @@ public:
|
||||||
|
|
||||||
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||||
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
||||||
virtual QRectF boundingRect() const Q_DECL_OVERRIDE;
|
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(VisToolHeight)
|
Q_DISABLE_COPY(VisToolHeight)
|
||||||
//base point in parent class
|
//base point in parent class
|
||||||
|
|
|
@ -150,16 +150,3 @@ void VisToolLineIntersect::paint(QPainter *painter, const QStyleOptionGraphicsIt
|
||||||
|
|
||||||
VisLine::paint(painter, option, widget);
|
VisLine::paint(painter, option, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
QRectF VisToolLineIntersect::boundingRect() const
|
|
||||||
{
|
|
||||||
QRectF rect = VisLine::boundingRect();
|
|
||||||
rect = rect.united(point->boundingRect());
|
|
||||||
rect = rect.united(line1P1->boundingRect());
|
|
||||||
rect = rect.united(line1P2->boundingRect());
|
|
||||||
rect = rect.united(line1->boundingRect());
|
|
||||||
rect = rect.united(line2P1->boundingRect());
|
|
||||||
rect = rect.united(line2P2->boundingRect());
|
|
||||||
return rect;
|
|
||||||
}
|
|
||||||
|
|
|
@ -56,7 +56,6 @@ public:
|
||||||
|
|
||||||
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||||
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
||||||
virtual QRectF boundingRect() const Q_DECL_OVERRIDE;
|
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(VisToolLineIntersect)
|
Q_DISABLE_COPY(VisToolLineIntersect)
|
||||||
quint32 line1P2Id;
|
quint32 line1P2Id;
|
||||||
|
|
|
@ -149,20 +149,6 @@ void VisToolLineIntersectAxis::paint(QPainter *painter, const QStyleOptionGraphi
|
||||||
VisLine::paint(painter, option, widget);
|
VisLine::paint(painter, option, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
QRectF VisToolLineIntersectAxis::boundingRect() const
|
|
||||||
{
|
|
||||||
QRectF rect = VisLine::boundingRect();
|
|
||||||
rect = rect.united(point->boundingRect());
|
|
||||||
rect = rect.united(lineP1->boundingRect());
|
|
||||||
rect = rect.united(lineP2->boundingRect());
|
|
||||||
rect = rect.united(basePoint->boundingRect());
|
|
||||||
rect = rect.united(baseLine->boundingRect());
|
|
||||||
rect = rect.united(axisLine->boundingRect());
|
|
||||||
rect = rect.united(line_intersection->boundingRect());
|
|
||||||
return rect;
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VisToolLineIntersectAxis::ShowIntersection(const QLineF &axis_line, const QLineF &base_line)
|
void VisToolLineIntersectAxis::ShowIntersection(const QLineF &axis_line, const QLineF &base_line)
|
||||||
{
|
{
|
||||||
|
|
|
@ -59,7 +59,6 @@ public:
|
||||||
|
|
||||||
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||||
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
||||||
virtual QRectF boundingRect() const Q_DECL_OVERRIDE;
|
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(VisToolLineIntersectAxis)
|
Q_DISABLE_COPY(VisToolLineIntersectAxis)
|
||||||
quint32 point2Id;
|
quint32 point2Id;
|
||||||
|
|
|
@ -137,14 +137,3 @@ void VisToolNormal::paint(QPainter *painter, const QStyleOptionGraphicsItem *opt
|
||||||
|
|
||||||
VisLine::paint(painter, option, widget);
|
VisLine::paint(painter, option, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
QRectF VisToolNormal::boundingRect() const
|
|
||||||
{
|
|
||||||
QRectF rect = VisLine::boundingRect();
|
|
||||||
rect = rect.united(point->boundingRect());
|
|
||||||
rect = rect.united(lineP1->boundingRect());
|
|
||||||
rect = rect.united(lineP2->boundingRect());
|
|
||||||
rect = rect.united(line->boundingRect());
|
|
||||||
return rect;
|
|
||||||
}
|
|
||||||
|
|
|
@ -57,7 +57,6 @@ public:
|
||||||
|
|
||||||
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||||
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
||||||
virtual QRectF boundingRect() const Q_DECL_OVERRIDE;
|
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(VisToolNormal)
|
Q_DISABLE_COPY(VisToolNormal)
|
||||||
quint32 object2Id;
|
quint32 object2Id;
|
||||||
|
|
|
@ -104,17 +104,6 @@ void VisToolPointFromArcAndTangent::paint(QPainter *painter, const QStyleOptionG
|
||||||
VisLine::paint(painter, option, widget);
|
VisLine::paint(painter, option, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
QRectF VisToolPointFromArcAndTangent::boundingRect() const
|
|
||||||
{
|
|
||||||
QRectF rect = VisLine::boundingRect();
|
|
||||||
rect = rect.united(point->boundingRect());
|
|
||||||
rect = rect.united(tangent->boundingRect());
|
|
||||||
rect = rect.united(arcPath->boundingRect());
|
|
||||||
rect = rect.united(tangentLine2->boundingRect());
|
|
||||||
return rect;
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VisToolPointFromArcAndTangent::FindRays(const QPointF &p, const VArc *arc)
|
void VisToolPointFromArcAndTangent::FindRays(const QPointF &p, const VArc *arc)
|
||||||
{
|
{
|
||||||
|
|
|
@ -58,7 +58,6 @@ public:
|
||||||
|
|
||||||
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||||
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
||||||
virtual QRectF boundingRect() const Q_DECL_OVERRIDE;
|
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(VisToolPointFromArcAndTangent)
|
Q_DISABLE_COPY(VisToolPointFromArcAndTangent)
|
||||||
quint32 arcId;
|
quint32 arcId;
|
||||||
|
|
|
@ -115,18 +115,6 @@ void VisToolPointFromCircleAndTangent::paint(QPainter *painter, const QStyleOpti
|
||||||
VisLine::paint(painter, option, widget);
|
VisLine::paint(painter, option, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
QRectF VisToolPointFromCircleAndTangent::boundingRect() const
|
|
||||||
{
|
|
||||||
QRectF rect = VisLine::boundingRect();
|
|
||||||
rect = rect.united(point->boundingRect());
|
|
||||||
rect = rect.united(tangent->boundingRect());
|
|
||||||
rect = rect.united(cCenter->boundingRect());
|
|
||||||
rect = rect.united(cPath->boundingRect());
|
|
||||||
rect = rect.united(tangent2->boundingRect());
|
|
||||||
return rect;
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VisToolPointFromCircleAndTangent::FindRays(const QPointF &p, const QPointF ¢er, qreal radius)
|
void VisToolPointFromCircleAndTangent::FindRays(const QPointF &p, const QPointF ¢er, qreal radius)
|
||||||
{
|
{
|
||||||
|
|
|
@ -59,7 +59,6 @@ public:
|
||||||
|
|
||||||
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||||
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
||||||
virtual QRectF boundingRect() const Q_DECL_OVERRIDE;
|
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(VisToolPointFromCircleAndTangent)
|
Q_DISABLE_COPY(VisToolPointFromCircleAndTangent)
|
||||||
quint32 object2Id;
|
quint32 object2Id;
|
||||||
|
|
|
@ -128,15 +128,3 @@ void VisToolPointOfContact::paint(QPainter *painter, const QStyleOptionGraphicsI
|
||||||
|
|
||||||
VisLine::paint(painter, option, widget);
|
VisLine::paint(painter, option, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
QRectF VisToolPointOfContact::boundingRect() const
|
|
||||||
{
|
|
||||||
QRectF rect = VisLine::boundingRect();
|
|
||||||
rect = rect.united(point->boundingRect());
|
|
||||||
rect = rect.united(lineP1->boundingRect());
|
|
||||||
rect = rect.united(lineP2->boundingRect());
|
|
||||||
rect = rect.united(arc_point->boundingRect());
|
|
||||||
rect = rect.united(circle->boundingRect());
|
|
||||||
return rect;
|
|
||||||
}
|
|
||||||
|
|
|
@ -55,7 +55,6 @@ public:
|
||||||
|
|
||||||
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||||
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
||||||
virtual QRectF boundingRect() const Q_DECL_OVERRIDE;
|
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(VisToolPointOfContact)
|
Q_DISABLE_COPY(VisToolPointOfContact)
|
||||||
quint32 lineP2Id;
|
quint32 lineP2Id;
|
||||||
|
|
|
@ -106,17 +106,6 @@ void VisToolPointOfIntersection::paint(QPainter *painter, const QStyleOptionGrap
|
||||||
VisLine::paint(painter, option, widget);
|
VisLine::paint(painter, option, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
QRectF VisToolPointOfIntersection::boundingRect() const
|
|
||||||
{
|
|
||||||
QRectF rect = VisLine::boundingRect();
|
|
||||||
rect = rect.united(point->boundingRect());
|
|
||||||
rect = rect.united(axisP1->boundingRect());
|
|
||||||
rect = rect.united(axisP2->boundingRect());
|
|
||||||
rect = rect.united(axis2->boundingRect());
|
|
||||||
return rect;
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VisToolPointOfIntersection::ShowIntersection(const QLineF &axis1, const QLineF &axis2, const QColor &color)
|
void VisToolPointOfIntersection::ShowIntersection(const QLineF &axis1, const QLineF &axis2, const QColor &color)
|
||||||
{
|
{
|
||||||
|
|
|
@ -56,7 +56,6 @@ public:
|
||||||
|
|
||||||
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||||
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
||||||
virtual QRectF boundingRect() const Q_DECL_OVERRIDE;
|
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(VisToolPointOfIntersection)
|
Q_DISABLE_COPY(VisToolPointOfIntersection)
|
||||||
quint32 point2Id;
|
quint32 point2Id;
|
||||||
|
|
|
@ -126,13 +126,3 @@ void VisToolPointOfIntersectionArcs::paint(QPainter *painter, const QStyleOption
|
||||||
|
|
||||||
VisLine::paint(painter, option, widget);
|
VisLine::paint(painter, option, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
QRectF VisToolPointOfIntersectionArcs::boundingRect() const
|
|
||||||
{
|
|
||||||
QRectF rect = VisLine::boundingRect();
|
|
||||||
rect = rect.united(point->boundingRect());
|
|
||||||
rect = rect.united(arc1Path->boundingRect());
|
|
||||||
rect = rect.united(arc2Path->boundingRect());
|
|
||||||
return rect;
|
|
||||||
}
|
|
||||||
|
|
|
@ -59,7 +59,6 @@ public:
|
||||||
|
|
||||||
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||||
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
||||||
virtual QRectF boundingRect() const Q_DECL_OVERRIDE;
|
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(VisToolPointOfIntersectionArcs)
|
Q_DISABLE_COPY(VisToolPointOfIntersectionArcs)
|
||||||
quint32 arc1Id;
|
quint32 arc1Id;
|
||||||
|
|
|
@ -140,15 +140,3 @@ void VisToolPointOfIntersectionCircles::paint(QPainter *painter, const QStyleOpt
|
||||||
|
|
||||||
VisLine::paint(painter, option, widget);
|
VisLine::paint(painter, option, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
QRectF VisToolPointOfIntersectionCircles::boundingRect() const
|
|
||||||
{
|
|
||||||
QRectF rect = VisLine::boundingRect();
|
|
||||||
rect = rect.united(point->boundingRect());
|
|
||||||
rect = rect.united(c1Center->boundingRect());
|
|
||||||
rect = rect.united(c2Center->boundingRect());
|
|
||||||
rect = rect.united(c1Path->boundingRect());
|
|
||||||
rect = rect.united(c2Path->boundingRect());
|
|
||||||
return rect;
|
|
||||||
}
|
|
||||||
|
|
|
@ -60,7 +60,6 @@ public:
|
||||||
|
|
||||||
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||||
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
||||||
virtual QRectF boundingRect() const Q_DECL_OVERRIDE;
|
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(VisToolPointOfIntersectionCircles)
|
Q_DISABLE_COPY(VisToolPointOfIntersectionCircles)
|
||||||
quint32 object2Id;
|
quint32 object2Id;
|
||||||
|
|
|
@ -147,17 +147,3 @@ void VisToolShoulderPoint::paint(QPainter *painter, const QStyleOptionGraphicsIt
|
||||||
|
|
||||||
VisLine::paint(painter, option, widget);
|
VisLine::paint(painter, option, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
QRectF VisToolShoulderPoint::boundingRect() const
|
|
||||||
{
|
|
||||||
QRectF rect = VisLine::boundingRect();
|
|
||||||
rect = rect.united(point->boundingRect());
|
|
||||||
rect = rect.united(line1P1->boundingRect());
|
|
||||||
rect = rect.united(line1P2->boundingRect());
|
|
||||||
rect = rect.united(line1->boundingRect());
|
|
||||||
rect = rect.united(line2P2->boundingRect());
|
|
||||||
rect = rect.united(line2->boundingRect());
|
|
||||||
rect = rect.united(line3->boundingRect());
|
|
||||||
return rect;
|
|
||||||
}
|
|
||||||
|
|
|
@ -55,7 +55,6 @@ public:
|
||||||
|
|
||||||
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||||
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
||||||
virtual QRectF boundingRect() const Q_DECL_OVERRIDE;
|
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(VisToolShoulderPoint)
|
Q_DISABLE_COPY(VisToolShoulderPoint)
|
||||||
quint32 lineP1Id;
|
quint32 lineP1Id;
|
||||||
|
|
|
@ -160,21 +160,6 @@ void VisToolTriangle::paint(QPainter *painter, const QStyleOptionGraphicsItem *o
|
||||||
VisLine::paint(painter, option, widget);
|
VisLine::paint(painter, option, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
QRectF VisToolTriangle::boundingRect() const
|
|
||||||
{
|
|
||||||
QRectF rect = VisLine::boundingRect();
|
|
||||||
rect = rect.united(point->boundingRect());
|
|
||||||
rect = rect.united(axisP1->boundingRect());
|
|
||||||
rect = rect.united(axisP2->boundingRect());
|
|
||||||
rect = rect.united(axis->boundingRect());
|
|
||||||
rect = rect.united(hypotenuseP1->boundingRect());
|
|
||||||
rect = rect.united(hypotenuseP2->boundingRect());
|
|
||||||
rect = rect.united(foot1->boundingRect());
|
|
||||||
rect = rect.united(foot2->boundingRect());
|
|
||||||
return rect;
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VisToolTriangle::DrawAimedAxis(QGraphicsPathItem *item, const QLineF &line, const QColor &color,
|
void VisToolTriangle::DrawAimedAxis(QGraphicsPathItem *item, const QLineF &line, const QColor &color,
|
||||||
Qt::PenStyle style)
|
Qt::PenStyle style)
|
||||||
|
|
|
@ -60,7 +60,6 @@ public:
|
||||||
|
|
||||||
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||||
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
||||||
virtual QRectF boundingRect() const Q_DECL_OVERRIDE;
|
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(VisToolTriangle)
|
Q_DISABLE_COPY(VisToolTriangle)
|
||||||
quint32 object2Id;//axis second point
|
quint32 object2Id;//axis second point
|
||||||
|
|
|
@ -184,21 +184,3 @@ void VisToolTrueDarts::paint(QPainter *painter, const QStyleOptionGraphicsItem *
|
||||||
|
|
||||||
VisLine::paint(painter, option, widget);
|
VisLine::paint(painter, option, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
QRectF VisToolTrueDarts::boundingRect() const
|
|
||||||
{
|
|
||||||
QRectF rect = VisLine::boundingRect();
|
|
||||||
rect = rect.united(point1->boundingRect());
|
|
||||||
rect = rect.united(point2->boundingRect());
|
|
||||||
rect = rect.united(baseLineP1->boundingRect());
|
|
||||||
rect = rect.united(baseLineP2->boundingRect());
|
|
||||||
rect = rect.united(dartP1->boundingRect());
|
|
||||||
rect = rect.united(dartP2->boundingRect());
|
|
||||||
rect = rect.united(dartP3->boundingRect());
|
|
||||||
rect = rect.united(lineblP1P1->boundingRect());
|
|
||||||
rect = rect.united(lineblP2P2->boundingRect());
|
|
||||||
rect = rect.united(p1d2->boundingRect());
|
|
||||||
rect = rect.united(d2p2->boundingRect());
|
|
||||||
return rect;
|
|
||||||
}
|
|
||||||
|
|
|
@ -58,7 +58,6 @@ public:
|
||||||
|
|
||||||
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||||
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
||||||
virtual QRectF boundingRect() const Q_DECL_OVERRIDE;
|
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(VisToolTrueDarts)
|
Q_DISABLE_COPY(VisToolTrueDarts)
|
||||||
quint32 baseLineP2Id;
|
quint32 baseLineP2Id;
|
||||||
|
|
|
@ -53,6 +53,14 @@ void VisPath::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, Q
|
||||||
VCurvePathItem::paint(painter, option, widget);
|
VCurvePathItem::paint(painter, option, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
QRectF VisPath::boundingRect() const
|
||||||
|
{
|
||||||
|
QRectF recTool = VCurvePathItem::boundingRect();
|
||||||
|
recTool = recTool.united(childrenBoundingRect());
|
||||||
|
return recTool;
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VisPath::InitPen()
|
void VisPath::InitPen()
|
||||||
{
|
{
|
||||||
|
|
|
@ -52,8 +52,9 @@ public:
|
||||||
virtual int type() const Q_DECL_OVERRIDE {return Type;}
|
virtual int type() const Q_DECL_OVERRIDE {return Type;}
|
||||||
enum { Type = UserType + static_cast<int>(Vis::Path)};
|
enum { Type = UserType + static_cast<int>(Vis::Path)};
|
||||||
|
|
||||||
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||||
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
||||||
|
virtual QRectF boundingRect() const Q_DECL_OVERRIDE;
|
||||||
protected:
|
protected:
|
||||||
virtual void InitPen() Q_DECL_OVERRIDE;
|
virtual void InitPen() Q_DECL_OVERRIDE;
|
||||||
virtual void AddOnScene() Q_DECL_OVERRIDE;
|
virtual void AddOnScene() Q_DECL_OVERRIDE;
|
||||||
|
|
|
@ -92,11 +92,3 @@ void VisToolArc::paint(QPainter *painter, const QStyleOptionGraphicsItem *option
|
||||||
|
|
||||||
VisPath::paint(painter, option, widget);
|
VisPath::paint(painter, option, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
QRectF VisToolArc::boundingRect() const
|
|
||||||
{
|
|
||||||
QRectF rect = VisPath::boundingRect();
|
|
||||||
rect = rect.united(arcCenter->boundingRect());
|
|
||||||
return rect;
|
|
||||||
}
|
|
||||||
|
|
|
@ -55,7 +55,6 @@ public:
|
||||||
|
|
||||||
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||||
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
||||||
virtual QRectF boundingRect() const Q_DECL_OVERRIDE;
|
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(VisToolArc)
|
Q_DISABLE_COPY(VisToolArc)
|
||||||
QGraphicsEllipseItem *arcCenter;
|
QGraphicsEllipseItem *arcCenter;
|
||||||
|
|
|
@ -92,11 +92,3 @@ void VisToolArcWithLength::paint(QPainter *painter, const QStyleOptionGraphicsIt
|
||||||
|
|
||||||
VisPath::paint(painter, option, widget);
|
VisPath::paint(painter, option, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
QRectF VisToolArcWithLength::boundingRect() const
|
|
||||||
{
|
|
||||||
QRectF rect = VisPath::boundingRect();
|
|
||||||
rect = rect.united(arcCenter->boundingRect());
|
|
||||||
return rect;
|
|
||||||
}
|
|
||||||
|
|
|
@ -55,7 +55,6 @@ public:
|
||||||
|
|
||||||
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||||
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
||||||
virtual QRectF boundingRect() const Q_DECL_OVERRIDE;
|
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(VisToolArcWithLength)
|
Q_DISABLE_COPY(VisToolArcWithLength)
|
||||||
QGraphicsEllipseItem *arcCenter;
|
QGraphicsEllipseItem *arcCenter;
|
||||||
|
|
|
@ -150,16 +150,3 @@ void VisToolCubicBezier::paint(QPainter *painter, const QStyleOptionGraphicsItem
|
||||||
|
|
||||||
VisPath::paint(painter, option, widget);
|
VisPath::paint(painter, option, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
QRectF VisToolCubicBezier::boundingRect() const
|
|
||||||
{
|
|
||||||
QRectF rect = VisPath::boundingRect();
|
|
||||||
rect = rect.united(point1->boundingRect());
|
|
||||||
rect = rect.united(point2->boundingRect());
|
|
||||||
rect = rect.united(point3->boundingRect());
|
|
||||||
rect = rect.united(point4->boundingRect());
|
|
||||||
rect = rect.united(helpLine1->boundingRect());
|
|
||||||
rect = rect.united(helpLine2->boundingRect());
|
|
||||||
return rect;
|
|
||||||
}
|
|
||||||
|
|
|
@ -57,8 +57,6 @@ public:
|
||||||
|
|
||||||
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||||
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
||||||
virtual QRectF boundingRect() const Q_DECL_OVERRIDE;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Q_DISABLE_COPY(VisToolCubicBezier)
|
Q_DISABLE_COPY(VisToolCubicBezier)
|
||||||
quint32 object2Id;
|
quint32 object2Id;
|
||||||
|
|
|
@ -168,32 +168,6 @@ void VisToolCubicBezierPath::paint(QPainter *painter, const QStyleOptionGraphics
|
||||||
VisPath::paint(painter, option, widget);
|
VisPath::paint(painter, option, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
QRectF VisToolCubicBezierPath::boundingRect() const
|
|
||||||
{
|
|
||||||
QRectF rect = VisPath::boundingRect();
|
|
||||||
|
|
||||||
for (int i=0; i < mainPoints.size(); ++i)
|
|
||||||
{
|
|
||||||
rect = rect.united(mainPoints.at(i)->boundingRect());
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i=0; i < ctrlPoints.size(); ++i)
|
|
||||||
{
|
|
||||||
rect = rect.united(ctrlPoints.at(i)->boundingRect());
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i=0; i < lines.size(); ++i)
|
|
||||||
{
|
|
||||||
rect = rect.united(lines.at(i)->boundingRect());
|
|
||||||
}
|
|
||||||
|
|
||||||
rect = rect.united(newCurveSegment->boundingRect());
|
|
||||||
rect = rect.united(helpLine1->boundingRect());
|
|
||||||
rect = rect.united(helpLine2->boundingRect());
|
|
||||||
return rect;
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QGraphicsEllipseItem *VisToolCubicBezierPath::getPoint(QVector<QGraphicsEllipseItem *> &points, quint32 i, qreal z)
|
QGraphicsEllipseItem *VisToolCubicBezierPath::getPoint(QVector<QGraphicsEllipseItem *> &points, quint32 i, qreal z)
|
||||||
{
|
{
|
||||||
|
|
|
@ -58,8 +58,6 @@ public:
|
||||||
|
|
||||||
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||||
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
||||||
virtual QRectF boundingRect() const Q_DECL_OVERRIDE;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Q_DISABLE_COPY(VisToolCubicBezierPath)
|
Q_DISABLE_COPY(VisToolCubicBezierPath)
|
||||||
QVector<QGraphicsEllipseItem *> mainPoints;
|
QVector<QGraphicsEllipseItem *> mainPoints;
|
||||||
|
|
|
@ -95,13 +95,3 @@ void VisToolCutArc::paint(QPainter *painter, const QStyleOptionGraphicsItem *opt
|
||||||
|
|
||||||
VisPath::paint(painter, option, widget);
|
VisPath::paint(painter, option, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
QRectF VisToolCutArc::boundingRect() const
|
|
||||||
{
|
|
||||||
QRectF rect = VisPath::boundingRect();
|
|
||||||
rect = rect.united(point->boundingRect());
|
|
||||||
rect = rect.united(arc1->boundingRect());
|
|
||||||
rect = rect.united(arc2->boundingRect());
|
|
||||||
return rect;
|
|
||||||
}
|
|
||||||
|
|
|
@ -53,7 +53,6 @@ public:
|
||||||
|
|
||||||
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||||
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
||||||
virtual QRectF boundingRect() const Q_DECL_OVERRIDE;
|
|
||||||
protected:
|
protected:
|
||||||
Q_DISABLE_COPY(VisToolCutArc)
|
Q_DISABLE_COPY(VisToolCutArc)
|
||||||
QGraphicsEllipseItem *point;
|
QGraphicsEllipseItem *point;
|
||||||
|
|
|
@ -103,13 +103,3 @@ void VisToolCutSpline::paint(QPainter *painter, const QStyleOptionGraphicsItem *
|
||||||
|
|
||||||
VisPath::paint(painter, option, widget);
|
VisPath::paint(painter, option, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
QRectF VisToolCutSpline::boundingRect() const
|
|
||||||
{
|
|
||||||
QRectF rect = VisPath::boundingRect();
|
|
||||||
rect = rect.united(point->boundingRect());
|
|
||||||
rect = rect.united(spl1->boundingRect());
|
|
||||||
rect = rect.united(spl2->boundingRect());
|
|
||||||
return rect;
|
|
||||||
}
|
|
||||||
|
|
|
@ -53,7 +53,6 @@ public:
|
||||||
|
|
||||||
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||||
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
||||||
virtual QRectF boundingRect() const Q_DECL_OVERRIDE;
|
|
||||||
protected:
|
protected:
|
||||||
Q_DISABLE_COPY(VisToolCutSpline)
|
Q_DISABLE_COPY(VisToolCutSpline)
|
||||||
QGraphicsEllipseItem *point;
|
QGraphicsEllipseItem *point;
|
||||||
|
|
|
@ -105,13 +105,3 @@ void VisToolCutSplinePath::paint(QPainter *painter, const QStyleOptionGraphicsIt
|
||||||
|
|
||||||
VisPath::paint(painter, option, widget);
|
VisPath::paint(painter, option, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
QRectF VisToolCutSplinePath::boundingRect() const
|
|
||||||
{
|
|
||||||
QRectF rect = VisPath::boundingRect();
|
|
||||||
rect = rect.united(point->boundingRect());
|
|
||||||
rect = rect.united(splPath1->boundingRect());
|
|
||||||
rect = rect.united(splPath2->boundingRect());
|
|
||||||
return rect;
|
|
||||||
}
|
|
||||||
|
|
|
@ -53,7 +53,6 @@ public:
|
||||||
|
|
||||||
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||||
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
||||||
virtual QRectF boundingRect() const Q_DECL_OVERRIDE;
|
|
||||||
protected:
|
protected:
|
||||||
Q_DISABLE_COPY(VisToolCutSplinePath)
|
Q_DISABLE_COPY(VisToolCutSplinePath)
|
||||||
QGraphicsEllipseItem *point;
|
QGraphicsEllipseItem *point;
|
||||||
|
|
|
@ -101,11 +101,3 @@ void VisToolEllipticalArc::paint(QPainter *painter, const QStyleOptionGraphicsIt
|
||||||
|
|
||||||
VisPath::paint(painter, option, widget);
|
VisPath::paint(painter, option, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
QRectF VisToolEllipticalArc::boundingRect() const
|
|
||||||
{
|
|
||||||
QRectF rect = VisPath::boundingRect();
|
|
||||||
rect = rect.united(arcCenter->boundingRect());
|
|
||||||
return rect;
|
|
||||||
}
|
|
||||||
|
|
|
@ -57,7 +57,6 @@ public:
|
||||||
|
|
||||||
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||||
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
||||||
virtual QRectF boundingRect() const Q_DECL_OVERRIDE;
|
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(VisToolEllipticalArc)
|
Q_DISABLE_COPY(VisToolEllipticalArc)
|
||||||
QGraphicsEllipseItem *arcCenter;
|
QGraphicsEllipseItem *arcCenter;
|
||||||
|
|
|
@ -94,21 +94,6 @@ void VisToolPiece::paint(QPainter *painter, const QStyleOptionGraphicsItem *opti
|
||||||
VisPath::paint(painter, option, widget);
|
VisPath::paint(painter, option, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
QRectF VisToolPiece::boundingRect() const
|
|
||||||
{
|
|
||||||
QRectF rect = VisPath::boundingRect();
|
|
||||||
|
|
||||||
for (int i=0; i < m_points.size(); ++i)
|
|
||||||
{
|
|
||||||
rect = rect.united(m_points.at(i)->boundingRect());
|
|
||||||
}
|
|
||||||
|
|
||||||
rect = rect.united(m_line1->boundingRect());
|
|
||||||
rect = rect.united(m_line2->boundingRect());
|
|
||||||
return rect;
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QGraphicsEllipseItem *VisToolPiece::GetPoint(quint32 i, const QColor &color)
|
QGraphicsEllipseItem *VisToolPiece::GetPoint(quint32 i, const QColor &color)
|
||||||
{
|
{
|
||||||
|
|
|
@ -49,7 +49,6 @@ public:
|
||||||
|
|
||||||
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||||
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
||||||
virtual QRectF boundingRect() const Q_DECL_OVERRIDE;
|
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(VisToolPiece)
|
Q_DISABLE_COPY(VisToolPiece)
|
||||||
QVector<QGraphicsEllipseItem *> m_points;
|
QVector<QGraphicsEllipseItem *> m_points;
|
||||||
|
|
|
@ -93,20 +93,6 @@ void VisToolPiecePath::paint(QPainter *painter, const QStyleOptionGraphicsItem *
|
||||||
VisPath::paint(painter, option, widget);
|
VisPath::paint(painter, option, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
QRectF VisToolPiecePath::boundingRect() const
|
|
||||||
{
|
|
||||||
QRectF rect = VisPath::boundingRect();
|
|
||||||
|
|
||||||
for (int i=0; i < m_points.size(); ++i)
|
|
||||||
{
|
|
||||||
rect = rect.united(m_points.at(i)->boundingRect());
|
|
||||||
}
|
|
||||||
|
|
||||||
rect = rect.united(m_line->boundingRect());
|
|
||||||
return rect;
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VisToolPiecePath::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
void VisToolPiecePath::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
||||||
{
|
{
|
||||||
|
|
|
@ -51,8 +51,6 @@ public:
|
||||||
|
|
||||||
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||||
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
||||||
virtual QRectF boundingRect() const Q_DECL_OVERRIDE;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void mousePressEvent( QGraphicsSceneMouseEvent * event ) Q_DECL_OVERRIDE;
|
virtual void mousePressEvent( QGraphicsSceneMouseEvent * event ) Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
|
|
|
@ -118,13 +118,3 @@ void VisToolPointOfIntersectionCurves::paint(QPainter *painter, const QStyleOpti
|
||||||
|
|
||||||
VisPath::paint(painter, option, widget);
|
VisPath::paint(painter, option, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
QRectF VisToolPointOfIntersectionCurves::boundingRect() const
|
|
||||||
{
|
|
||||||
QRectF rect = VisPath::boundingRect();
|
|
||||||
|
|
||||||
rect = rect.united(point->boundingRect());
|
|
||||||
rect = rect.united(visCurve2->boundingRect());
|
|
||||||
return rect;
|
|
||||||
}
|
|
||||||
|
|
|
@ -59,7 +59,6 @@ public:
|
||||||
|
|
||||||
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||||
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
||||||
virtual QRectF boundingRect() const Q_DECL_OVERRIDE;
|
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(VisToolPointOfIntersectionCurves)
|
Q_DISABLE_COPY(VisToolPointOfIntersectionCurves)
|
||||||
quint32 object2Id;
|
quint32 object2Id;
|
||||||
|
|
|
@ -232,16 +232,6 @@ void VisToolSpline::paint(QPainter *painter, const QStyleOptionGraphicsItem *opt
|
||||||
VisPath::paint(painter, option, widget);
|
VisPath::paint(painter, option, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
QRectF VisToolSpline::boundingRect() const
|
|
||||||
{
|
|
||||||
QRectF rect = VisPath::boundingRect();
|
|
||||||
|
|
||||||
rect = rect.united(point1->boundingRect());
|
|
||||||
rect = rect.united(point4->boundingRect());
|
|
||||||
return rect;
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VisToolSpline::MouseLeftPressed()
|
void VisToolSpline::MouseLeftPressed()
|
||||||
{
|
{
|
||||||
|
|
|
@ -67,8 +67,6 @@ public:
|
||||||
|
|
||||||
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||||
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
||||||
virtual QRectF boundingRect() const Q_DECL_OVERRIDE;
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void MouseLeftPressed();
|
void MouseLeftPressed();
|
||||||
void MouseLeftReleased();
|
void MouseLeftReleased();
|
||||||
|
|
|
@ -152,19 +152,6 @@ void VisToolSplinePath::paint(QPainter *painter, const QStyleOptionGraphicsItem
|
||||||
VisPath::paint(painter, option, widget);
|
VisPath::paint(painter, option, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
QRectF VisToolSplinePath::boundingRect() const
|
|
||||||
{
|
|
||||||
QRectF rect = VisPath::boundingRect();
|
|
||||||
|
|
||||||
for (int i=0; i < points.size(); ++i)
|
|
||||||
{
|
|
||||||
rect = rect.united(points.at(i)->boundingRect());
|
|
||||||
}
|
|
||||||
|
|
||||||
return rect;
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VisToolSplinePath::MouseLeftPressed()
|
void VisToolSplinePath::MouseLeftPressed()
|
||||||
{
|
{
|
||||||
|
|
|
@ -61,8 +61,6 @@ public:
|
||||||
|
|
||||||
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||||
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
||||||
virtual QRectF boundingRect() const Q_DECL_OVERRIDE;
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void PathChanged(const VSplinePath &path);
|
void PathChanged(const VSplinePath &path);
|
||||||
|
|
||||||
|
|
|
@ -110,9 +110,9 @@ void VControlPointSpline::paint(QPainter *painter, const QStyleOptionGraphicsIte
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QRectF VControlPointSpline::boundingRect() const
|
QRectF VControlPointSpline::boundingRect() const
|
||||||
{
|
{
|
||||||
QRectF rect = VScenePoint::boundingRect();
|
QRectF recTool = VScenePoint::boundingRect();
|
||||||
rect = rect.united(controlLine->boundingRect());
|
recTool = recTool.united(childrenBoundingRect());
|
||||||
return rect;
|
return recTool;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -100,10 +100,9 @@ void VScenePoint::RefreshPointGeometry(const VPointF &point)
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QRectF VScenePoint::boundingRect() const
|
QRectF VScenePoint::boundingRect() const
|
||||||
{
|
{
|
||||||
QRectF rect = QGraphicsEllipseItem::boundingRect();
|
QRectF recTool = QGraphicsEllipseItem::boundingRect();
|
||||||
rect = rect.united(m_namePoint->boundingRect());
|
recTool = recTool.united(childrenBoundingRect());
|
||||||
rect = rect.united(m_lineName->boundingRect());
|
return recTool;
|
||||||
return rect;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue
Block a user