Seamly2D
Code documentation
vtoolcurveintersectaxis.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  * *
3  * Copyright (C) 2017 Seamly, LLC *
4  * *
5  * https://github.com/fashionfreedom/seamly2d *
6  * *
7  ***************************************************************************
8  **
9  ** Seamly2D is free software: you can redistribute it and/or modify
10  ** it under the terms of the GNU General Public License as published by
11  ** the Free Software Foundation, either version 3 of the License, or
12  ** (at your option) any later version.
13  **
14  ** Seamly2D is distributed in the hope that it will be useful,
15  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
16  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  ** GNU General Public License for more details.
18  **
19  ** You should have received a copy of the GNU General Public License
20  ** along with Seamly2D. If not, see <http://www.gnu.org/licenses/>.
21  **
22  **************************************************************************
23 
24  ************************************************************************
25  **
26  ** @file vtoolcurveintersectaxis.cpp
27  ** @author Roman Telezhynskyi <dismine(at)gmail.com>
28  ** @date 21 10, 2014
29  **
30  ** @brief
31  ** @copyright
32  ** This source code is part of the Valentine project, a pattern making
33  ** program, whose allow create and modeling patterns of clothing.
34  ** Copyright (C) 2013-2015 Seamly2D project
35  ** <https://github.com/fashionfreedom/seamly2d> All Rights Reserved.
36  **
37  ** Seamly2D is free software: you can redistribute it and/or modify
38  ** it under the terms of the GNU General Public License as published by
39  ** the Free Software Foundation, either version 3 of the License, or
40  ** (at your option) any later version.
41  **
42  ** Seamly2D is distributed in the hope that it will be useful,
43  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
44  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
45  ** GNU General Public License for more details.
46  **
47  ** You should have received a copy of the GNU General Public License
48  ** along with Seamly2D. If not, see <http://www.gnu.org/licenses/>.
49  **
50  *************************************************************************/
51 
53 
54 #include <limits.h>
55 #include <QLineF>
56 #include <QMap>
57 #include <QRectF>
58 #include <QSharedPointer>
59 #include <QStaticStringData>
60 #include <QStringData>
61 #include <QStringDataPtr>
62 #include <QVector>
63 #include <QMessageBox>
64 #include <new>
65 
66 #include "../../../../../dialogs/tools/dialogtool.h"
67 #include "../../../../../dialogs/tools/dialogcurveintersectaxis.h"
68 #include "../ifc/ifcdef.h"
69 #include "../ifc/exception/vexception.h"
70 #include "../qmuparser/qmudef.h"
71 #include "../toolcut/vtoolcutsplinepath.h"
72 #include "../vgeometry/vabstractcubicbezier.h"
73 #include "../vgeometry/vabstractcubicbezierpath.h"
74 #include "../vgeometry/vabstractcurve.h"
75 #include "../vgeometry/varc.h"
76 #include "../vgeometry/vellipticalarc.h"
77 #include "../vgeometry/vgobject.h"
78 #include "../vgeometry/vpointf.h"
79 #include "../vgeometry/vspline.h"
80 #include "../vgeometry/vsplinepath.h"
81 #include "../vmisc/vabstractapplication.h"
82 #include "../vmisc/vcommonsettings.h"
83 #include "../vpatterndb/vcontainer.h"
84 #include "../vpatterndb/vtranslatevars.h"
85 #include "../vtools/visualization/visualization.h"
86 #include "../vtools/visualization/line/vistoolcurveintersectaxis.h"
87 #include "../vwidgets/vmaingraphicsscene.h"
88 #include "../../../../vabstracttool.h"
89 #include "../../../vdrawtool.h"
90 #include "vtoollinepoint.h"
91 
92 template <class T> class QSharedPointer;
93 
94 const QString VToolCurveIntersectAxis::ToolType = QStringLiteral("curveIntersectAxis");
95 
96 //---------------------------------------------------------------------------------------------------------------------
98  const QString &lineType, const QString &lineWeight,
99  const QString &lineColor,
100  const QString &formulaAngle, const quint32 &basePointId,
101  const quint32 &curveId, const Source &typeCreation,
102  QGraphicsItem *parent)
103  : VToolLinePoint(doc, data, id, lineType, lineWeight, lineColor, QString(), basePointId, 0, parent)
104  , formulaAngle(formulaAngle)
105  , curveId(curveId)
106 {
107  ToolCreation(typeCreation);
108 }
109 
110 //---------------------------------------------------------------------------------------------------------------------
112 {
113  SCASSERT(not m_dialog.isNull())
114  m_dialog->setModal(true);
116  SCASSERT(not dialogTool.isNull())
118  dialogTool->setLineType(m_lineType);
119  dialogTool->setLineWeight(m_lineWeight);
120  dialogTool->setLineColor(lineColor);
121  dialogTool->SetAngle(formulaAngle);
122  dialogTool->SetBasePointId(basePointId);
123  dialogTool->setCurveId(curveId);
124  dialogTool->SetPointName(intersectPoint->name());
125 }
126 
127 //---------------------------------------------------------------------------------------------------------------------
129  VAbstractPattern *doc,
130  VContainer *data)
131 {
132  SCASSERT(not dialog.isNull())
133  QSharedPointer<DialogCurveIntersectAxis> dialogTool = dialog.objectCast<DialogCurveIntersectAxis>();
134  SCASSERT(not dialogTool.isNull())
135  const QString pointName = dialogTool->getPointName();
136  const QString lineType = dialogTool->getLineType();
137  const QString lineWeight = dialogTool->getLineWeight();
138  const QString lineColor = dialogTool->getLineColor();
139  QString formulaAngle = dialogTool->GetAngle();
140  const quint32 basePointId = dialogTool->GetBasePointId();
141  const quint32 curveId = dialogTool->getCurveId();
142 
143  VToolCurveIntersectAxis *point = Create(0, pointName, lineType, lineWeight, lineColor, formulaAngle, basePointId,
144  curveId, 5, 10, true, scene, doc, data, Document::FullParse, Source::FromGui);
145  if (point != nullptr)
146  {
147  point->m_dialog = dialogTool;
148  }
149  return point;
150 }
151 
152 //---------------------------------------------------------------------------------------------------------------------
153 VToolCurveIntersectAxis *VToolCurveIntersectAxis::Create(const quint32 _id, const QString &pointName,
154  const QString &lineType, const QString &lineWeight,
155  const QString &lineColor,
156  QString &formulaAngle, quint32 basePointId,
157  quint32 curveId, qreal mx, qreal my, bool showPointName,
159  VContainer *data,
160  const Document &parse, const Source &typeCreation)
161 {
163  const qreal angle = CheckFormula(_id, formulaAngle, data);
165 
166  QPointF intersectPoint;
167  const bool isIntersect = FindPoint(static_cast<QPointF>(*basePoint), angle, curve, &intersectPoint);
168 
169  if (not isIntersect)
170  {
171  const QString msg = tr("<b><big>Can not create intersection point %1 from point %2</big></b><br>"
172  "<b><big>to curve %3 with an axis angle of %4°</big></b><br><br>"
173  "Using origin point as a place holder until pattern is corrected.")
174  .arg(pointName)
175  .arg(basePoint->name())
176  .arg(curve->name())
177  .arg(angle);
178  QMessageBox msgBox(qApp->getMainWindow());
179  msgBox.setWindowTitle(tr("Intersection Point of Curve & Axis"));
180  msgBox.setWindowFlags(msgBox.windowFlags() & ~Qt::WindowContextHelpButtonHint);
181  msgBox.setWindowIcon(QIcon(":/toolicon/32x32/curve_intersect_axis.png"));
182  msgBox.setIcon(QMessageBox::Warning);
183  msgBox.setText(msg);
184  msgBox.setStandardButtons(QMessageBox::Ok);
185  msgBox.exec();
186  }
187 
188  const qreal segLength = curve->GetLengthByPoint(intersectPoint);
189  quint32 id = _id;
190  VPointF *p = new VPointF(intersectPoint, pointName, mx, my);
191  p->setShowPointName(showPointName);
192 
193  if (typeCreation == Source::FromGui)
194  {
195  id = data->AddGObject(p);
196  data->AddLine(basePointId, id);
197 
200  InitSegments(curve->getType(), segLength, p, curveId, data);
201  }
202  else
203  {
204  data->UpdateGObject(id, p);
205  data->AddLine(basePointId, id);
206 
207  InitSegments(curve->getType(), segLength, p, curveId, data);
208 
209  if (parse != Document::FullParse)
210  {
211  doc->UpdateToolData(id, data);
212  }
213  }
214 
215  if (parse == Document::FullParse)
216  {
218  VToolCurveIntersectAxis *point = new VToolCurveIntersectAxis(doc, data, id, lineType, lineWeight, lineColor,
219  formulaAngle, basePointId, curveId, typeCreation);
220  scene->addItem(point);
221  InitToolConnections(scene, point);
222  VAbstractPattern::AddTool(id, point);
223  doc->IncrementReferens(basePoint->getIdTool());
224  doc->IncrementReferens(curve->getIdTool());
225  return point;
226  }
227  return nullptr;
228 }
229 
230 //---------------------------------------------------------------------------------------------------------------------
231 bool VToolCurveIntersectAxis::FindPoint(const QPointF &axisPoint, qreal angle,
232  const QSharedPointer<VAbstractCurve> &curve, QPointF *intersectPoint)
233 {
234  QRectF rectangle = QRectF(0, 0, INT_MAX, INT_MAX);
235  rectangle.translate(-INT_MAX/2.0, -INT_MAX/2.0);
236 
237  QLineF axis = QLineF(axisPoint, VGObject::BuildRay(axisPoint, angle, rectangle));
238  QVector<QPointF> points = curve->IntersectLine(axis);
239 
240  if (points.isEmpty())
241  {
242  QLineF axis2 = QLineF(axisPoint, VGObject::BuildRay(axisPoint, angle + 180, rectangle));
243  points = curve->IntersectLine(axis2);
244  }
245 
246  if (points.size() > 0)
247  {
248  if (points.size() == 1)
249  {
250  *intersectPoint = points.at(0);
251  return true;
252  }
253 
254  QMap<qreal, int> lengths;
255 
256  for ( qint32 i = 0; i < points.size(); ++i )
257  {
258  lengths.insert(QLineF(points.at(i), axisPoint).length(), i);
259  }
260 
261  QMap<qreal, int>::const_iterator i = lengths.constBegin();
262  if (i != lengths.constEnd())
263  {
264  *intersectPoint = points.at(i.value());
265  return true;
266  }
267 
268  }
269 
270  return false;
271 }
272 
273 //---------------------------------------------------------------------------------------------------------------------
275 {
276  VFormula fAngle(formulaAngle, getData());
277  fAngle.setCheckZero(false);
278  fAngle.setToolId(m_id);
279  fAngle.setPostfix(degreeSymbol);
280  return fAngle;
281 }
282 
283 //---------------------------------------------------------------------------------------------------------------------
285 {
286  if (value.error() == false)
287  {
289 
291  SaveOption(obj);
292  }
293 }
294 
295 //---------------------------------------------------------------------------------------------------------------------
297 {
298  return VAbstractTool::data.GetGObject(curveId)->name();
299 }
300 
301 //---------------------------------------------------------------------------------------------------------------------
303 {
304  return curveId;
305 }
306 
307 //---------------------------------------------------------------------------------------------------------------------
308 void VToolCurveIntersectAxis::setCurveId(const quint32 &value)
309 {
310  if (value != NULL_ID)
311  {
312  curveId = value;
313 
315  SaveOption(obj);
316  }
317 }
318 
319 //---------------------------------------------------------------------------------------------------------------------
321 {
322  ShowToolVisualization<VisToolCurveIntersectAxis>(show);
323 }
324 
325 //---------------------------------------------------------------------------------------------------------------------
326 void VToolCurveIntersectAxis::showContextMenu(QGraphicsSceneContextMenuEvent *event, quint32 id)
327 {
328  try
329  {
330  ContextMenu<DialogCurveIntersectAxis>(event, id);
331  }
332  catch(const VExceptionToolWasDeleted &e)
333  {
334  Q_UNUSED(e)
335  return;//Leave this method immediately!!!
336  }
337 }
338 
339 //---------------------------------------------------------------------------------------------------------------------
340 void VToolCurveIntersectAxis::SaveDialog(QDomElement &domElement)
341 {
342  SCASSERT(not m_dialog.isNull())
344  SCASSERT(not dialogTool.isNull())
345  doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
346  doc->SetAttribute(domElement, AttrLineType, dialogTool->getLineType());
347  doc->SetAttribute(domElement, AttrLineWeight, dialogTool->getLineWeight());
348  doc->SetAttribute(domElement, AttrLineColor, dialogTool->getLineColor());
349  doc->SetAttribute(domElement, AttrAngle, dialogTool->GetAngle());
350  doc->SetAttribute(domElement, AttrBasePoint, QString().setNum(dialogTool->GetBasePointId()));
351  doc->SetAttribute(domElement, AttrCurve, QString().setNum(dialogTool->getCurveId()));
352 }
353 
354 //---------------------------------------------------------------------------------------------------------------------
356 {
357  VToolLinePoint::SaveOptions(tag, obj);
358 
363 }
364 
365 //---------------------------------------------------------------------------------------------------------------------
366 void VToolCurveIntersectAxis::ReadToolAttributes(const QDomElement &domElement)
367 {
369  m_lineWeight = doc->GetParametrString(domElement, AttrLineWeight, "0.35");
373  formulaAngle = doc->GetParametrString(domElement, AttrAngle, "");
374 }
375 
376 //---------------------------------------------------------------------------------------------------------------------
378 {
379  if (not vis.isNull())
380  {
381  VisToolCurveIntersectAxis *visual = qobject_cast<VisToolCurveIntersectAxis *>(vis);
382  SCASSERT(visual != nullptr)
383 
384  visual->setObject1Id(curveId);
385  visual->setAxisPointId(basePointId);
386  visual->SetAngle(qApp->TrVars()->FormulaToUser(formulaAngle, qApp->Settings()->GetOsSeparator()));
388  visual->setLineWeight(m_lineWeight);
389  visual->RefreshGeometry();
390  }
391 }
392 
393 //---------------------------------------------------------------------------------------------------------------------
394 template <class Item>
395 void VToolCurveIntersectAxis::InitArc(VContainer *data, qreal segLength, const VPointF *p, quint32 curveId)
396 {
399 
401  Item arc1;
402  Item arc2;
403 
404  if (not VFuzzyComparePossibleNulls(segLength, -1))
405  {
406  arc->CutArc(segLength, arc1, arc2);
407  }
408  else
409  {
410  arc->CutArc(0, arc1, arc2);
411  }
412 
413  // Arc highly depend on id. Need for creating the name.
414  arc1.setId(p->id() + 1);
415  arc2.setId(p->id() + 2);
416 
417  if (not VFuzzyComparePossibleNulls(segLength, -1))
418  {
419  a1 = QSharedPointer<Item>(new Item(arc1));
420  a2 = QSharedPointer<Item>(new Item(arc2));
421  }
422  else
423  {
424  a1 = QSharedPointer<Item>(new Item());
425  a2 = QSharedPointer<Item>(new Item());
426 
427  // Take names for empty arcs from donors.
428  a1->setName(arc1.name());
429  a2->setName(arc2.name());
430  }
431 
432  data->AddArc(a1, arc1.id(), p->id());
433  data->AddArc(a2, arc2.id(), p->id());
434 }
435 
436 //---------------------------------------------------------------------------------------------------------------------
437 QT_WARNING_PUSH
438 QT_WARNING_DISABLE_GCC("-Wswitch-default")
439 void VToolCurveIntersectAxis::InitSegments(const GOType &curveType, qreal segLength, const VPointF *p, quint32 curveId,
440  VContainer *data)
441 {
442  switch(curveType)
443  {
445  InitArc<VEllipticalArc>(data, segLength, p, curveId);
446  break;
447  case GOType::Arc:
448  InitArc<VArc>(data, segLength, p, curveId);
449  break;
450  case GOType::CubicBezier:
451  case GOType::Spline:
452  {
455 
456  const auto spl = data->GeometricObject<VAbstractCubicBezier>(curveId);
457  QPointF spl1p2, spl1p3, spl2p2, spl2p3;
458  if (not VFuzzyComparePossibleNulls(segLength, -1))
459  {
460  spl->CutSpline(segLength, spl1p2, spl1p3, spl2p2, spl2p3);
461  }
462  else
463  {
464  spl->CutSpline(0, spl1p2, spl1p3, spl2p2, spl2p3);
465  }
466 
467  VSpline *spl1 = new VSpline(spl->GetP1(), spl1p2, spl1p3, *p);
468  VSpline *spl2 = new VSpline(*p, spl2p2, spl2p3, spl->GetP4());
469 
470  if (not VFuzzyComparePossibleNulls(segLength, -1))
471  {
472  spline1 = QSharedPointer<VAbstractBezier>(spl1);
473  spline2 = QSharedPointer<VAbstractBezier>(spl2);
474  }
475  else
476  {
477  spline1 = QSharedPointer<VAbstractBezier>(new VSpline());
478  spline2 = QSharedPointer<VAbstractBezier>(new VSpline());
479 
480  // Take names for empty splines from donors.
481  spline1->setName(spl1->name());
482  spline2->setName(spl2->name());
483 
484  delete spl1;
485  delete spl2;
486  }
487 
488  data->AddSpline(spline1, NULL_ID, p->id());
489  data->AddSpline(spline2, NULL_ID, p->id());
490  break;
491  }
493  case GOType::SplinePath:
494  {
497 
498  const auto splPath = data->GeometricObject<VAbstractCubicBezierPath>(curveId);
499  VSplinePath *splPath1 = nullptr;
500  VSplinePath *splPath2 = nullptr;
501  if (not VFuzzyComparePossibleNulls(segLength, -1))
502  {
503  VPointF *pC = VToolCutSplinePath::CutSplinePath(segLength, splPath, p->name(), &splPath1, &splPath2);
504  delete pC;
505  }
506  else
507  {
508  VPointF *pC = VToolCutSplinePath::CutSplinePath(0, splPath, p->name(), &splPath1, &splPath2);
509  delete pC;
510  }
511 
512  SCASSERT(splPath1 != nullptr)
513  SCASSERT(splPath2 != nullptr)
514 
515  if (not VFuzzyComparePossibleNulls(segLength, -1))
516  {
517  splP1 = QSharedPointer<VAbstractBezier>(splPath1);
518  splP2 = QSharedPointer<VAbstractBezier>(splPath2);
519  }
520  else
521  {
524 
525  // Take names for empty spline paths from donors.
526  splP1->setName(splPath1->name());
527  splP2->setName(splPath2->name());
528 
529  delete splPath1;
530  delete splPath2;
531  }
532 
533  data->AddSpline(splP1, NULL_ID, p->id());
534  data->AddSpline(splP2, NULL_ID, p->id());
535  break;
536  }
537  case GOType::Point:
538  case GOType::Unknown:
539  case GOType::Curve:
540  case GOType::Path:
541  case GOType::AllCurves:
542  default:
543  Q_UNREACHABLE();
544  break;
545  }
546 }
547 
QPointF CutSpline(qreal length, QPointF &spl1p2, QPointF &spl1p3, QPointF &spl2p2, QPointF &spl2p3) const
CutSpline cut spline.
virtual void UpdateToolData(const quint32 &id, VContainer *data)=0
virtual void IncrementReferens(quint32 id) const =0
static void AddTool(quint32 id, VDataTool *tool)
AddTool add tool to list tools.
static void InitToolConnections(VMainGraphicsScene *scene, T *tool)
VAbstractPattern * doc
doc dom document container
QPointer< Visualization > vis
const VContainer * getData() const
getData return pointer to data container.
virtual void ToolCreation(const Source &typeCreation)
static void AddRecord(const quint32 id, const Tool &toolType, VAbstractPattern *doc)
AddRecord add record about tool in history.
static qreal CheckFormula(const quint32 &toolId, QString &formula, VContainer *data)
CheckFormula check formula.
const quint32 m_id
id object id.
The VContainer class container of all variables.
Definition: vcontainer.h:141
void AddArc(const QSharedPointer< VAbstractCurve > &arc, const quint32 &id, const quint32 &parentId=null_id)
Definition: vcontainer.cpp:395
static quint32 getNextId()
getNextId generate next unique id
Definition: vcontainer.cpp:251
void AddLine(const quint32 &firstPointId, const quint32 &secondPointId)
AddLine add line to container.
Definition: vcontainer.cpp:382
const QSharedPointer< VGObject > GetGObject(quint32 id) const
GetGObject returns a point by id.
Definition: vcontainer.cpp:150
const QSharedPointer< T > GeometricObject(const quint32 &id) const
Definition: vcontainer.h:266
quint32 AddGObject(VGObject *obj)
AddGObject add new GObject to container.
Definition: vcontainer.cpp:216
void UpdateGObject(quint32 id, T *obj)
UpdateGObject update GObject by id.
Definition: vcontainer.h:374
VContainer data
data container with data
Definition: vdatatool.h:84
static QString GetParametrString(const QDomElement &domElement, const QString &name, const QString &defValue=QString())
Returns the string value of the given attribute. RENAME: see above.
static quint32 GetParametrUInt(const QDomElement &domElement, const QString &name, const QString &defValue)
Returns the long long value of the given attribute. RENAME: GetParameterLongLong?
void SetAttribute(QDomElement &domElement, const QString &name, const T &value) const
SetAttribute set attribute in pattern file. Replace "," by ".".
Definition: vdomdocument.h:185
QString m_lineWeight
typeLine line type.
Definition: vdrawtool.h:104
QString m_lineType
activeBlockName name of tool's pattern peace.
Definition: vdrawtool.h:103
void SaveOption(QSharedPointer< VGObject > &obj)
Definition: vdrawtool.cpp:142
bool error() const
Definition: vformula.cpp:238
QString GetFormula(FormulaType type=FormulaType::ToUser) const
Definition: vformula.cpp:135
void setToolId(const quint32 &value)
Definition: vformula.cpp:216
void setCheckZero(bool value)
Definition: vformula.cpp:184
void setPostfix(const QString &value)
Definition: vformula.cpp:228
virtual QString name() const
name return name graphical object.
Definition: vgobject.cpp:148
static QPointF BuildRay(const QPointF &firstPoint, const qreal &angle, const QRectF &scRect)
Definition: vgobject.cpp:251
quint32 id() const
id return id object.
Definition: vgobject.cpp:205
QSharedPointer< DialogTool > m_dialog
m_dialog tool's dialog options.
The VMainGraphicsScene class main scene.
The VPointF class keep data of point.
Definition: vpointf.h:75
void setShowPointName(bool show)
Definition: vpointf.cpp:265
The VSplinePath class keep information about splinePath.
Definition: vsplinepath.h:72
VSpline class that implements the spline.
Definition: vspline.h:75
virtual void showContextMenu(QGraphicsSceneContextMenuEvent *event, quint32 id=NULL_ID) Q_DECL_OVERRIDE
virtual void SaveOptions(QDomElement &tag, QSharedPointer< VGObject > &obj) Q_DECL_OVERRIDE
static void InitSegments(const GOType &curveType, qreal segLength, const VPointF *p, quint32 curveId, VContainer *data)
virtual void SetVisualization() Q_DECL_OVERRIDE
void setCurveId(const quint32 &value)
virtual void SaveDialog(QDomElement &domElement) Q_DECL_OVERRIDE
SaveDialog save options into file after change in dialog.
static const QString ToolType
VToolCurveIntersectAxis(VAbstractPattern *doc, VContainer *data, const quint32 &id, const QString &lineType, const QString &lineWeight, const QString &lineColor, const QString &formulaAngle, const quint32 &basePointId, const quint32 &curveId, const Source &typeCreation, QGraphicsItem *parent=nullptr)
static VToolCurveIntersectAxis * Create(QSharedPointer< DialogTool > dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data)
virtual void ReadToolAttributes(const QDomElement &domElement) Q_DECL_OVERRIDE
virtual void setDialog() Q_DECL_OVERRIDE
setDialog set dialog when user want change tool option.
virtual void ShowVisualization(bool show) Q_DECL_OVERRIDE
static bool FindPoint(const QPointF &point, qreal angle, const QSharedPointer< VAbstractCurve > &curve, QPointF *intersectPoint)
static void InitArc(VContainer *data, qreal segLength, const VPointF *p, quint32 curveId)
void SetFormulaAngle(const VFormula &value)
static Q_REQUIRED_RESULT VPointF * CutSplinePath(qreal length, const QSharedPointer< VAbstractCubicBezierPath > &splPath, const QString &pName, VSplinePath **splPath1, VSplinePath **splPath2)
The VToolLinePoint class parent for all tools what create point with line.
qreal angle
formula string with length formula.
quint32 basePointId
angle line angle.
QString lineColor
mainLine line item.
virtual void SaveOptions(QDomElement &tag, QSharedPointer< VGObject > &obj) Q_DECL_OVERRIDE
virtual void RefreshGeometry() Q_DECL_OVERRIDE
void SetAngle(const QString &expression)
void setAxisPointId(const quint32 &value)
void setLineWeight(const QString &value)
void setObject1Id(const quint32 &value)
void setLineStyle(const Qt::PenStyle &value)
const QString degreeSymbol
Definition: def.cpp:196
#define SCASSERT(cond)
Definition: def.h:317
static Q_REQUIRED_RESULT bool VFuzzyComparePossibleNulls(double p1, double p2)
Definition: def.h:490
@ CurveIntersectAxis
Source
Definition: def.h:106
const QString AttrBasePoint
Definition: ifcdef.cpp:95
const QString AttrName
Definition: ifcdef.cpp:76
const QString splPath
Definition: ifcdef.cpp:419
const QString AttrLineType
Definition: ifcdef.cpp:90
const QString LineTypeSolidLine
Definition: ifcdef.cpp:159
const QString AttrLineWeight
Definition: ifcdef.cpp:91
const QString AttrAngle
Definition: ifcdef.cpp:103
const QString AttrCurve
Definition: ifcdef.cpp:127
const QString ColorBlack
Definition: ifcdef.cpp:373
const QString AttrType
Definition: ifcdef.cpp:73
const QString AttrLineColor
Definition: ifcdef.cpp:130
Qt::PenStyle lineTypeToPenStyle(const QString &lineType)
LineStyle return pen style for current line style.
Definition: ifcdef.cpp:183
#define NULL_ID
Definition: ifcdef.h:76
#define NULL_ID_STR
Definition: ifcdef.h:77
Document
#define qApp
Definition: vapplication.h:67
GOType
Definition: vgeometrydef.h:56
@ CubicBezierPath
@ SplinePath
@ EllipticalArc
@ CubicBezier