Seamly2D
Code documentation
vcontainer.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  ** @file vcontainer.cpp
3  ** @author Douglas S Caskey
4  ** @date Dec 11, 2022
5  **
6  ** @copyright
7  ** Copyright (C) 2017 - 2022 Seamly, LLC
8  ** https://github.com/fashionfreedom/seamly2d
9  **
10  ** @brief
11  ** Seamly2D is free software: you can redistribute it and/or modify
12  ** it under the terms of the GNU General Public License as published by
13  ** the Free Software Foundation, either version 3 of the License, or
14  ** (at your option) any later version.
15  **
16  ** Seamly2D is distributed in the hope that it will be useful,
17  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
18  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  ** GNU General Public License for more details.
20  **
21  ** You should have received a copy of the GNU General Public License
22  ** along with Seamly2D. If not, see <http://www.gnu.org/licenses/>.
23  **************************************************************************/
24 
25 /************************************************************************
26  **
27  ** @file vcontainer.cpp
28  ** @author Roman Telezhynskyi <dismine(at)gmail.com>
29  ** @date November 15, 2013
30  **
31  ** @brief
32  ** @copyright
33  ** This source code is part of the Valentina project, a pattern making
34  ** program, whose allow create and modeling patterns of clothing.
35  ** Copyright (C) 2013 Valentina project
36  ** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
37  **
38  ** Seamly2D is free software: you can redistribute it and/or modify
39  ** it under the terms of the GNU General Public License as published by
40  ** the Free Software Foundation, either version 3 of the License, or
41  ** (at your option) any later version.
42  **
43  ** Seamly2D is distributed in the hope that it will be useful,
44  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
45  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
46  ** GNU General Public License for more details.
47  **
48  ** You should have received a copy of the GNU General Public License
49  ** along with Seamly2D. If not, see <http://www.gnu.org/licenses/>.
50  **
51  *************************************************************************/
52 
53 #include "vcontainer.h"
54 
55 #include <limits.h>
56 #include <QVector>
57 #include <QtDebug>
58 
59 #include "../ifc/exception/vexception.h"
60 #include "../vgeometry/vabstractcubicbezierpath.h"
61 #include "../vgeometry/vabstractcurve.h"
62 #include "../vgeometry/vgeometrydef.h"
63 #include "../vgeometry/vgobject.h"
64 #include "../vgeometry/vpointf.h"
65 #include "../vgeometry/vspline.h"
66 #include "../vgeometry/varc.h"
67 #include "../vgeometry/vellipticalarc.h"
68 #include "../vmisc/diagnostic.h"
69 #include "../vmisc/logging.h"
70 #include "../vmisc/vabstractapplication.h"
71 #include "variables/varcradius.h"
72 #include "variables/vcurveangle.h"
73 #include "variables/vcurvelength.h"
75 #include "variables/vincrement.h"
76 #include "variables/vlineangle.h"
77 #include "variables/vlinelength.h"
78 #include "variables/vmeasurement.h"
79 #include "variables/vvariable.h"
80 #include "vtranslatevars.h"
81 
82 QT_WARNING_PUSH
83 QT_WARNING_DISABLE_CLANG("-Wmissing-prototypes")
84 QT_WARNING_DISABLE_INTEL(1418)
85 
86 Q_LOGGING_CATEGORY(vCon, "v.container")
87 
89 
90 quint32 VContainer::_id = NULL_ID;
91 qreal VContainer::_size = 50;
92 qreal VContainer::_height = 176;
93 QSet<QString> VContainer::uniqueNames = QSet<QString>();
94 
95 #ifdef Q_COMPILER_RVALUE_REFS
96 VContainer &VContainer::operator=(VContainer &&data) Q_DECL_NOTHROW
97 { Swap(data); return *this; }
98 #endif
99 
100 void VContainer::Swap(VContainer &data) Q_DECL_NOTHROW
101 { std::swap(d, data.d); }
102 
103 //---------------------------------------------------------------------------------------------------------------------
104 /**
105  * @brief VContainer create empty container
106  */
107 VContainer::VContainer(const VTranslateVars *trVars, const Unit *patternUnit)
108  :d(new VContainerData(trVars, patternUnit))
109 {}
110 
111 //---------------------------------------------------------------------------------------------------------------------
112 /**
113  * @brief operator = copy constructor
114  * @param data container
115  * @return copy container
116  */
118 {
119  if ( &data == this )
120  {
121  return *this;
122  }
123  d = data.d;
124  return *this;
125 }
126 
127 //---------------------------------------------------------------------------------------------------------------------
128 /**
129  * @brief VContainer create container from another container
130  * @param data container
131  */
133  :d(data.d)
134 {}
135 
136 //---------------------------------------------------------------------------------------------------------------------
138 {
139  ClearGObjects();
140  ClearVariables();
141 }
142 
143 //---------------------------------------------------------------------------------------------------------------------
144 /**
145  * @brief GetGObject returns a point by id
146  * @param id id of point
147  * @return point
148  */
149 // cppcheck-suppress unusedFunction
151 {
152  return GetObject(d->gObjects, id);
153 }
154 
155 //---------------------------------------------------------------------------------------------------------------------
157 {
158  VGObject *obj = new VGObject();
159  obj->setId(id);
160  QSharedPointer<VGObject> pointer(obj);
161  return pointer;
162 }
163 
164 //---------------------------------------------------------------------------------------------------------------------
165 /**
166  * @brief GetObject return object from container
167  * @param obj container
168  * @param id id of object
169  * @return Object
170  */
171 template <typename key, typename val>
172 const val VContainer::GetObject(const QHash<key, val> &obj, key id) const
173 {
174  if (obj.contains(id))
175  {
176  return obj.value(id);
177  }
178  else
179  {
180  throw VExceptionBadId(tr("Can't find object: "), id);
181  }
182 }
183 
184 //---------------------------------------------------------------------------------------------------------------------
185 VPiece VContainer::GetPiece(quint32 id) const
186 {
187  if (d->pieces->contains(id))
188  {
189  return d->pieces->value(id);
190  }
191  else
192  {
193  throw VExceptionBadId(tr("Can't find piece: "), id);
194  }
195 }
196 
197 //---------------------------------------------------------------------------------------------------------------------
199 {
200  if (d->piecePaths->contains(id))
201  {
202  return d->piecePaths->value(id);
203  }
204  else
205  {
206  throw VExceptionBadId(tr("Can't find path: "), id);
207  }
208 }
209 
210 //---------------------------------------------------------------------------------------------------------------------
211 /**
212  * @brief AddGObject add new GObject to container
213  * @param obj new object
214  * @return return id of new object in container
215  */
217 {
218  SCASSERT(obj != nullptr)
219  QSharedPointer<VGObject> pointer(obj);
220  uniqueNames.insert(obj->name());
221  return AddObject(d->gObjects, pointer);
222 }
223 
224 //---------------------------------------------------------------------------------------------------------------------
225 quint32 VContainer::AddPiece(const VPiece &piece)
226 {
227  const quint32 id = getNextId();
228  d->pieces->insert(id, piece);
229  return id;
230 }
231 
232 //---------------------------------------------------------------------------------------------------------------------
234 {
235  const quint32 id = getNextId();
236  d->piecePaths->insert(id, path);
237  return id;
238 }
239 
240 //---------------------------------------------------------------------------------------------------------------------
242 {
243  return _id;
244 }
245 
246 //---------------------------------------------------------------------------------------------------------------------
247 /**
248  * @brief getNextId generate next unique id
249  * @return next unique id
250  */
252 {
253  //TODO. Current count of ids are very big and allow us save time before someone will reach its max value.
254  //Better way, of cource, is to seek free ids inside the set of values and reuse them.
255  //But for now better to keep it as it is now.
256  if (_id == UINT_MAX)
257  {
258  qCritical()<<(tr("Number of free id exhausted."));
259  }
260  _id++;
261  return _id;
262 }
263 
264 //---------------------------------------------------------------------------------------------------------------------
265 /**
266  * @brief UpdateId update id. If new id bigger when current save new like current.
267  * @param newId id
268  */
269 void VContainer::UpdateId(quint32 newId)
270 {
271  if (newId > _id)
272  {
273  _id = newId;
274  }
275 }
276 
277 //---------------------------------------------------------------------------------------------------------------------
278 /**
279  * @brief Clear clear data in container. Id will be 0.
280  */
282 {
283  qCDebug(vCon, "Clearing container data.");
284  _id = NULL_ID;
285 
286  d->pieces->clear();
287  d->piecePaths->clear();
288  ClearVariables();
289  ClearGObjects();
291 }
292 
293 //---------------------------------------------------------------------------------------------------------------------
295 {
296  qCDebug(vCon, "Clearing container data for full parse.");
297  _id = NULL_ID;
298 
299  d->pieces->clear();
300  d->piecePaths->clear();
308  ClearGObjects();
310 }
311 
312 //---------------------------------------------------------------------------------------------------------------------
313 /**
314  * @brief ClearObject points, splines, arcs, spline paths will be cleared.
315  */
317 {
318  d->gObjects.clear();
319 }
320 
321 //---------------------------------------------------------------------------------------------------------------------
323 {
324  if (not d->gObjects.isEmpty()) //-V807
325  {
326  QVector<quint32> keys;
328  for (i = d->gObjects.begin(); i != d->gObjects.end(); ++i)
329  {
330  if (i.value()->getMode() == Draw::Calculation)
331  {
332  i.value().clear();
333  keys.append(i.key());
334  }
335  }
336  // We can't delete objects in previous loop it will destroy the iterator.
337  if (not keys.isEmpty())
338  {
339  for (int i = 0; i < keys.size(); ++i)
340  {
341  d->gObjects.remove(keys.at(i));
342  }
343  }
344  }
345 }
346 
347 //---------------------------------------------------------------------------------------------------------------------
349 {
350  if (d->variables.size()>0) //-V807
351  {
352  if (type == VarType::Unknown)
353  {
354  d->variables.clear();
355  }
356  else
357  {
358  QVector<QString> keys;
360  for (i = d->variables.begin(); i != d->variables.end(); ++i)
361  {
362  if (i.value()->GetType() == type)
363  {
364  keys.append(i.key());
365  }
366  }
367 
368  for (int i = 0; i < keys.size(); ++i)
369  {
370  d->variables.remove(keys.at(i));
371  }
372  }
373  }
374 }
375 
376 //---------------------------------------------------------------------------------------------------------------------
377 /**
378  * @brief AddLine add line to container
379  * @param firstPointId id of first point of line
380  * @param secondPointId id of second point of line
381  */
382 void VContainer::AddLine(const quint32 &firstPointId, const quint32 &secondPointId)
383 {
384  const QSharedPointer<VPointF> first = GeometricObject<VPointF>(firstPointId);
385  const QSharedPointer<VPointF> second = GeometricObject<VPointF>(secondPointId);
386 
387  VLengthLine *length = new VLengthLine(first.data(), firstPointId, second.data(), secondPointId, *GetPatternUnit());
388  AddVariable(length->GetName(), length);
389 
390  VLineAngle *angle = new VLineAngle(first.data(), firstPointId, second.data(), secondPointId);
391  AddVariable(angle->GetName(), angle);
392 }
393 
394 //---------------------------------------------------------------------------------------------------------------------
395 void VContainer::AddArc(const QSharedPointer<VAbstractCurve> &arc, const quint32 &id, const quint32 &parentId)
396 {
397  AddCurve(arc, id, parentId);
398 
399  if (arc->getType() == GOType::Arc)
400  {
401  const QSharedPointer<VArc> casted = arc.staticCast<VArc>();
402 
403  VArcRadius *radius = new VArcRadius(id, parentId, casted.data(), *GetPatternUnit());
404  AddVariable(radius->GetName(), radius);
405  }
406  else if (arc->getType() == GOType::EllipticalArc)
407  {
408  const QSharedPointer<VEllipticalArc> casted = arc.staticCast<VEllipticalArc>();
409 
410  VArcRadius *radius1 = new VArcRadius(id, parentId, casted.data(), 1, *GetPatternUnit());
411  AddVariable(radius1->GetName(), radius1);
412 
413  VArcRadius *radius2 = new VArcRadius(id, parentId, casted.data(), 2, *GetPatternUnit());
414  AddVariable(radius2->GetName(), radius2);
415  }
416 }
417 
418 //---------------------------------------------------------------------------------------------------------------------
419 void VContainer::AddCurve(const QSharedPointer<VAbstractCurve> &curve, const quint32 &id, quint32 parentId)
420 {
421  const GOType curveType = curve->getType();
422  if (curveType != GOType::Spline && curveType != GOType::SplinePath &&
423  curveType != GOType::CubicBezier && curveType != GOType::CubicBezierPath &&
424  curveType != GOType::Arc && curveType != GOType::EllipticalArc)
425  {
426  throw VException(tr("Can't create a curve with type '%1'").arg(static_cast<int>(curveType)));
427  }
428 
429  VCurveLength *length = new VCurveLength(id, parentId, curve.data(), *GetPatternUnit());
430  AddVariable(length->GetName(), length);
431 
432  VCurveAngle *startAngle = new VCurveAngle(id, parentId, curve.data(), CurveAngle::StartAngle);
433  AddVariable(startAngle->GetName(), startAngle);
434 
435  VCurveAngle *endAngle = new VCurveAngle(id, parentId, curve.data(), CurveAngle::EndAngle);
436  AddVariable(endAngle->GetName(), endAngle);
437 }
438 
439 //---------------------------------------------------------------------------------------------------------------------
440 void VContainer::AddSpline(const QSharedPointer<VAbstractBezier> &curve, quint32 id, quint32 parentId)
441 {
442  AddCurve(curve, id, parentId);
443 
444  VCurveCLength *c1Length = new VCurveCLength(id, parentId, curve.data(), CurveCLength::C1, *GetPatternUnit());
445  AddVariable(c1Length->GetName(), c1Length);
446 
447  VCurveCLength *c2Length = new VCurveCLength(id, parentId, curve.data(), CurveCLength::C2, *GetPatternUnit());
448  AddVariable(c2Length->GetName(), c2Length);
449 }
450 
451 //---------------------------------------------------------------------------------------------------------------------
453  quint32 parentId)
454 {
455  AddSpline(curve, id, parentId);
456 
457  for (qint32 i = 1; i <= curve->CountSubSpl(); ++i)
458  {
459  const VSpline spl = curve->GetSpline(i);
460 
461  VCurveLength *length = new VCurveLength(id, parentId, curve->name(), spl, *GetPatternUnit(), i);
462  AddVariable(length->GetName(), length);
463 
464  VCurveAngle *startAngle = new VCurveAngle(id, parentId, curve->name(), spl, CurveAngle::StartAngle, i);
465  AddVariable(startAngle->GetName(), startAngle);
466 
467  VCurveAngle *endAngle = new VCurveAngle(id, parentId, curve->name(), spl, CurveAngle::EndAngle, i);
468  AddVariable(endAngle->GetName(), endAngle);
469 
470  VCurveCLength *c1Length = new VCurveCLength(id, parentId, curve->name(), spl, CurveCLength::C1,
471  *GetPatternUnit(), i);
472  AddVariable(c1Length->GetName(), c1Length);
473 
474  VCurveCLength *c2Length = new VCurveCLength(id, parentId, curve->name(), spl, CurveCLength::C2,
475  *GetPatternUnit(), i);
476  AddVariable(c2Length->GetName(), c2Length);
477  }
478 }
479 
480 //---------------------------------------------------------------------------------------------------------------------
481 void VContainer::RemoveVariable(const QString &name)
482 {
483  d->variables.remove(name);
484 }
485 
486 //---------------------------------------------------------------------------------------------------------------------
487 void VContainer::RemovePiece(quint32 id)
488 {
489  d->pieces->remove(id);
490 }
491 
492 //---------------------------------------------------------------------------------------------------------------------
493 /**
494  * @brief AddObject add object to container
495  * @param obj container
496  * @param value object
497  * @return id of object in container
498  */
499 template <typename key, typename val>
500 quint32 VContainer::AddObject(QHash<key, val> &obj, val value)
501 {
502  SCASSERT(value != nullptr)
503  const quint32 id = getNextId();
504  value->setId(id);
505  obj[id] = value;
506  return id;
507 }
508 
509 //---------------------------------------------------------------------------------------------------------------------
510 void VContainer::UpdatePiece(quint32 id, const VPiece &piece)
511 {
512  Q_ASSERT_X(id != NULL_ID, Q_FUNC_INFO, "id == 0"); //-V654 //-V712
513  d->pieces->insert(id, piece);
514  UpdateId(id);
515 }
516 
517 //---------------------------------------------------------------------------------------------------------------------
518 void VContainer::UpdatePiecePath(quint32 id, const VPiecePath &path)
519 {
520  Q_ASSERT_X(id != NULL_ID, Q_FUNC_INFO, "id == 0"); //-V654 //-V712
521  d->piecePaths->insert(id, path);
522  UpdateId(id);
523 }
524 
525 //---------------------------------------------------------------------------------------------------------------------
526 /**
527  * @brief removeCustomVariable remove increment by name from increment table
528  * @param name name of existing increment
529  */
530 void VContainer::removeCustomVariable(const QString &name)
531 {
532  d->variables[name].clear();
533  d->variables.remove(name);
534 }
535 
536 //---------------------------------------------------------------------------------------------------------------------
538 {
539  return DataVar<VMeasurement>(VarType::Measurement);
540 }
541 
542 //---------------------------------------------------------------------------------------------------------------------
544 {
545  return DataVar<VIncrement>(VarType::Increment);
546 }
547 
548 //---------------------------------------------------------------------------------------------------------------------
550 {
551  return DataVar<VLengthLine>(VarType::LineLength);
552 }
553 
554 //---------------------------------------------------------------------------------------------------------------------
556 {
557  return DataVar<VCurveLength>(VarType::CurveLength);
558 }
559 
560 //---------------------------------------------------------------------------------------------------------------------
562 {
563  return DataVar<VCurveCLength>(VarType::CurveCLength);
564 }
565 
566 //---------------------------------------------------------------------------------------------------------------------
568 {
569  return DataVar<VLineAngle>(VarType::LineAngle);
570 }
571 
572 //---------------------------------------------------------------------------------------------------------------------
574 {
575  return DataVar<VArcRadius>(VarType::ArcRadius);
576 }
577 
578 //---------------------------------------------------------------------------------------------------------------------
580 {
581  return DataVar<VCurveAngle>(VarType::CurveAngle);
582 }
583 
584 //---------------------------------------------------------------------------------------------------------------------
585 bool VContainer::IsUnique(const QString &name)
586 {
587  return (!uniqueNames.contains(name) && !builInFunctions.contains(name));
588 }
589 
590 //---------------------------------------------------------------------------------------------------------------------
592 {
593  QStringList names = builInFunctions;
594  names.append(uniqueNames.values());
595  return names;
596 }
597 
598 //---------------------------------------------------------------------------------------------------------------------
600 {
601  return d->patternUnit;
602 }
603 
604 //---------------------------------------------------------------------------------------------------------------------
606 {
607  return d->trVars;
608 }
609 
610 //---------------------------------------------------------------------------------------------------------------------
611 template <typename T>
613 {
615  //Sorting QHash by id
617  for (i = d->variables.constBegin(); i != d->variables.constEnd(); ++i)
618  {
619  if (i.value()->GetType() == type)
620  {
621  QSharedPointer<T> var = GetVariable<T>(i.key());
622  map.insert(d->trVars->VarToUser(i.key()), var);
623  }
624  }
625  return map;
626 }
627 
628 //---------------------------------------------------------------------------------------------------------------------
630 {
631  uniqueNames.clear();
632 }
633 
634 //---------------------------------------------------------------------------------------------------------------------
636 {
637  const QList<QString> list = uniqueNames.values();
639 
640  for(int i = 0; i < list.size(); ++i)
641  {
642  if (not list.at(i).startsWith('#'))
643  {
644  uniqueNames.insert(list.at(i));
645  }
646  }
647 }
648 
649 //---------------------------------------------------------------------------------------------------------------------
650 /**
651  * @brief SetSize set value of size
652  * @param size value of size
653  */
654 void VContainer::SetSize(qreal size)
655 {
656  _size = size;
657 }
658 
659 //---------------------------------------------------------------------------------------------------------------------
660 /**
661  * @brief SetGrowth set value of growth
662  * @param height value of height
663  */
664 void VContainer::SetHeight(qreal height)
665 {
666  _height = height;
667 }
668 
669 //---------------------------------------------------------------------------------------------------------------------
670 /**
671  * @brief size return size
672  * @return size in mm
673  */
675 {
676  return _size;
677 }
678 
679 //---------------------------------------------------------------------------------------------------------------------
681 {
682  return &_size;
683 }
684 
685 //---------------------------------------------------------------------------------------------------------------------
686 /**
687  * @brief height return height
688  * @return height in pattern units
689  */
691 {
692  return _height;
693 }
694 
695 //---------------------------------------------------------------------------------------------------------------------
697 {
698  return &_height;
699 }
700 
701 //---------------------------------------------------------------------------------------------------------------------
702 /**
703  * @brief data container with datagObjects return container of gObjects
704  * @return pointer on container of gObjects
705  */
707 {
708  return &d->gObjects;
709 }
710 
711 //---------------------------------------------------------------------------------------------------------------------
713 {
714  return d->pieces.data();
715 }
716 
717 //---------------------------------------------------------------------------------------------------------------------
719 {
720  return &d->variables;
721 }
722 
723 //---------------------------------------------------------------------------------------------------------------------
725 {}
VArc class for anticlockwise arc.
Definition: varc.h:74
virtual ~VContainerData()
Definition: vcontainer.cpp:724
The VContainer class container of all variables.
Definition: vcontainer.h:141
const QMap< QString, QSharedPointer< VArcRadius > > arcRadiusesData() const
Definition: vcontainer.cpp:573
const QMap< QString, QSharedPointer< VLineAngle > > lineAnglesData() const
Definition: vcontainer.cpp:567
const QMap< QString, QSharedPointer< VCurveAngle > > curveAnglesData() const
Definition: vcontainer.cpp:579
void AddVariable(const QString &name, T *var)
Definition: vcontainer.h:327
static qreal height()
height return height
Definition: vcontainer.cpp:690
static void SetSize(qreal size)
SetSize set value of size.
Definition: vcontainer.cpp:654
static QSet< QString > uniqueNames
Definition: vcontainer.h:235
const VTranslateVars * GetTrVars() const
Definition: vcontainer.cpp:605
const QHash< quint32, VPiece > * DataPieces() const
Definition: vcontainer.cpp:712
static quint32 _id
_id current id. New object will have value +1. For empty class equal 0.
Definition: vcontainer.h:232
const QMap< QString, QSharedPointer< VCurveCLength > > controlPointLengthsData() const
Definition: vcontainer.cpp:561
void AddArc(const QSharedPointer< VAbstractCurve > &arc, const quint32 &id, const quint32 &parentId=null_id)
Definition: vcontainer.cpp:395
VContainer & operator=(const VContainer &data)
operator = copy constructor
Definition: vcontainer.cpp:117
static void ClearUniqueNames()
Definition: vcontainer.cpp:629
void UpdatePiece(quint32 id, const VPiece &piece)
Definition: vcontainer.cpp:510
void RemovePiece(quint32 id)
Definition: vcontainer.cpp:487
void RemoveVariable(const QString &name)
Definition: vcontainer.cpp:481
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
static void UpdateId(quint32 newId)
UpdateId update id. If new id bigger when current save new like current.
Definition: vcontainer.cpp:269
VContainer(const VTranslateVars *trVars, const Unit *patternUnit)
VContainer create empty container.
Definition: vcontainer.cpp:107
void UpdatePiecePath(quint32 id, const VPiecePath &path)
Definition: vcontainer.cpp:518
void ClearCalculationGObjects()
Definition: vcontainer.cpp:322
static bool IsUnique(const QString &name)
Definition: vcontainer.cpp:585
void ClearVariables(const VarType &type=VarType::Unknown)
Definition: vcontainer.cpp:348
static qreal * rsize()
Definition: vcontainer.cpp:680
void Clear()
Clear clear data in container. Id will be 0.
Definition: vcontainer.cpp:281
void AddCurve(const QSharedPointer< VAbstractCurve > &curve, const quint32 &id, quint32 parentId=null_id)
Definition: vcontainer.cpp:419
void ClearGObjects()
ClearObject points, splines, arcs, spline paths will be cleared.
Definition: vcontainer.cpp:316
const QMap< QString, QSharedPointer< VCurveLength > > curveLengthsData() const
Definition: vcontainer.cpp:555
const QMap< QString, QSharedPointer< VLengthLine > > lineLengthsData() const
Definition: vcontainer.cpp:549
const QHash< QString, QSharedPointer< VInternalVariable > > * DataVariables() const
Definition: vcontainer.cpp:718
static qreal size()
size return size
Definition: vcontainer.cpp:674
static quint32 getId()
Definition: vcontainer.cpp:241
static quint32 AddObject(QHash< key, val > &obj, val value)
AddObject add object to container.
Definition: vcontainer.cpp:500
const QSharedPointer< VGObject > GetGObject(quint32 id) const
GetGObject returns a point by id.
Definition: vcontainer.cpp:150
static qreal _size
Definition: vcontainer.h:233
quint32 AddPiece(const VPiece &piece)
Definition: vcontainer.cpp:225
const val GetObject(const QHash< key, val > &obj, key id) const
GetObject return object from container.
Definition: vcontainer.cpp:172
void AddSpline(const QSharedPointer< VAbstractBezier > &curve, quint32 id, quint32 parentId=null_id)
Definition: vcontainer.cpp:440
static qreal * rheight()
Definition: vcontainer.cpp:696
static QStringList AllUniqueNames()
Definition: vcontainer.cpp:591
const QMap< QString, QSharedPointer< VIncrement > > variablesData() const
Definition: vcontainer.cpp:543
VPiecePath GetPiecePath(quint32 id) const
Definition: vcontainer.cpp:198
const QHash< quint32, QSharedPointer< VGObject > > * DataGObjects() const
data container with datagObjects return container of gObjects
Definition: vcontainer.cpp:706
void AddCurveWithSegments(const QSharedPointer< VAbstractCubicBezierPath > &curve, const quint32 &id, quint32 parentId=null_id)
Definition: vcontainer.cpp:452
quint32 AddGObject(VGObject *obj)
AddGObject add new GObject to container.
Definition: vcontainer.cpp:216
QSharedDataPointer< VContainerData > d
Definition: vcontainer.h:237
const Unit * GetPatternUnit() const
Definition: vcontainer.cpp:599
static void SetHeight(qreal height)
SetGrowth set value of growth.
Definition: vcontainer.cpp:664
static const QSharedPointer< VGObject > GetFakeGObject(quint32 id)
Definition: vcontainer.cpp:156
void ClearForFullParse()
Definition: vcontainer.cpp:294
void Swap(VContainer &data) Q_DECL_NOTHROW
Definition: vcontainer.cpp:100
quint32 AddPiecePath(const VPiecePath &path)
Definition: vcontainer.cpp:233
void removeCustomVariable(const QString &name)
removeCustomVariable remove increment by name from increment table
Definition: vcontainer.cpp:530
static void ClearUniqueIncrementNames()
Definition: vcontainer.cpp:635
const QMap< QString, QSharedPointer< VMeasurement > > DataMeasurements() const
Definition: vcontainer.cpp:537
static qreal _height
Definition: vcontainer.h:234
const QMap< QString, QSharedPointer< T > > DataVar(const VarType &type) const
Definition: vcontainer.cpp:612
VPiece GetPiece(quint32 id) const
Definition: vcontainer.cpp:185
The VExceptionBadId class for exception bad id.
The VException class parent for all exception. Could be use for abstract exception.
Definition: vexception.h:66
The VGObject class keep information graphical objects.
Definition: vgobject.h:74
virtual QString name() const
name return name graphical object.
Definition: vgobject.cpp:148
virtual void setId(const quint32 &id)
setId set id object.
Definition: vgobject.cpp:215
QString GetName() const
Definition: vpiece.h:88
VSpline class that implements the spline.
Definition: vspline.h:75
const QStringList builInFunctions
Definition: def.cpp:120
#define SCASSERT(cond)
Definition: def.h:317
VarType
Definition: def.h:276
@ CurveCLength
Unit
Definition: def.h:105
#define NULL_ID
Definition: ifcdef.h:76
GOType
Definition: vgeometrydef.h:56
@ CubicBezierPath
@ SplinePath
@ EllipticalArc
@ CubicBezier
@ Calculation