Seamly2D
Code documentation
VToolTrueDarts Class Reference

#include <vtooltruedarts.h>

Inheritance diagram for VToolTrueDarts:
Collaboration diagram for VToolTrueDarts:

Public Types

enum  { Type = UserType + static_cast<int>(Tool::TrueDarts) }
 
- Public Types inherited from VToolDoublePoint
enum  { Type = UserType + static_cast<int>(Tool::DoublePoint) }
 

Public Member Functions

virtual void setDialog () Q_DECL_OVERRIDE
 setDialog set dialog when user want change tool option. More...
 
virtual int type () const Q_DECL_OVERRIDE
 
virtual void ShowVisualization (bool show) Q_DECL_OVERRIDE
 
QString BaseLineP1Name () const
 
QString BaseLineP2Name () const
 
QString DartP1Name () const
 
QString DartP2Name () const
 
QString DartP3Name () const
 
quint32 GetBaseLineP1Id () const
 
void SetBaseLineP1Id (const quint32 &value)
 
quint32 GetBaseLineP2Id () const
 
void SetBaseLineP2Id (const quint32 &value)
 
quint32 GetDartP1Id () const
 
void SetDartP1Id (const quint32 &value)
 
quint32 GetDartP2Id () const
 
void SetDartP2Id (const quint32 &value)
 
quint32 GetDartP3Id () const
 
void SetDartP3Id (const quint32 &value)
 
- Public Member Functions inherited from VToolDoublePoint
 VToolDoublePoint (VAbstractPattern *doc, VContainer *data, quint32 id, quint32 p1id, quint32 p2id, QGraphicsItem *parent=nullptr)
 
virtual ~VToolDoublePoint () Q_DECL_EQ_DEFAULT
 
QString nameP1 () const
 
void setNameP1 (const QString &name)
 
QString nameP2 () const
 
void setNameP2 (const QString &name)
 
virtual void GroupVisibility (quint32 object, bool visible) Q_DECL_OVERRIDE
 
virtual void setPointNamePosition (quint32 id, const QPointF &pos) Q_DECL_OVERRIDE
 
virtual bool isPointNameVisible (quint32 id) const Q_DECL_OVERRIDE
 
virtual void setPointNameVisiblity (quint32 id, bool visible) Q_DECL_OVERRIDE
 
- Public Member Functions inherited from VAbstractPoint
 VAbstractPoint (VAbstractPattern *doc, VContainer *data, quint32 id)
 
virtual ~VAbstractPoint () Q_DECL_EQ_DEFAULT
 
virtual QString getTagName () const Q_DECL_OVERRIDE
 
template<typename T >
void ShowToolVisualization (bool show)
 
- Public Member Functions inherited from VDrawTool
 VDrawTool (VAbstractPattern *doc, VContainer *data, quint32 id, QObject *parent=nullptr)
 VDrawTool constructor. More...
 
virtual ~VDrawTool () Q_DECL_EQ_DEFAULT
 
QString getLineType () const
 
virtual void setLineType (const QString &value)
 
QString getLineWeight () const
 
virtual void setLineWeight (const QString &value)
 
- Public Member Functions inherited from VInteractiveTool
 VInteractiveTool (VAbstractPattern *doc, VContainer *data, quint32 id, QObject *parent=nullptr)
 
virtual ~VInteractiveTool () Q_DECL_EQ_DEFAULT
 
void DialogLinkDestroy ()
 
- Public Member Functions inherited from VAbstractTool
 VAbstractTool (VAbstractPattern *doc, VContainer *data, quint32 id, QObject *parent=nullptr)
 VAbstractTool container. More...
 
virtual ~VAbstractTool () Q_DECL_OVERRIDE
 
quint32 getId () const
 getId return object id. More...
 
const VContainergetData () const
 getData return pointer to data container. More...
 
QMap< QString, quint32 > PointsList () const
 
- Public Member Functions inherited from VDataTool
 VDataTool (VContainer *data, QObject *parent=nullptr)
 VDataTool constructor. More...
 
virtual ~VDataTool () Q_DECL_EQ_DEFAULT
 
VContainer getData () const
 getData return data container. More...
 
void setData (const VContainer *value)
 setData set data container. More...
 
virtual quint32 referens () const
 referens return count of referens. More...
 
virtual void incrementReferens ()
 incrementReferens increment referens. More...
 
virtual void decrementReferens ()
 decrementReferens decrement referens. More...
 

Static Public Member Functions

static void FindPoint (const QPointF &baseLineP1, const QPointF &baseLineP2, const QPointF &dartP1, const QPointF &dartP2, const QPointF &dartP3, QPointF &p1, QPointF &p2)
 
static VToolTrueDartsCreate (QSharedPointer< DialogTool > dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data)
 
static VToolTrueDartsCreate (quint32 _id, const quint32 &_p1id, const quint32 &_p2id, const quint32 &baseLineP1Id, const quint32 &baseLineP2Id, const quint32 &dartP1Id, const quint32 &dartP2Id, const quint32 &dartP3Id, const QString &point1Name, qreal mx1, qreal my1, bool showPointName1, const QString &point2Name, qreal mx2, qreal my2, bool showPointName2, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation)
 
- Static Public Member Functions inherited from VAbstractTool
static qreal CheckFormula (const quint32 &toolId, QString &formula, VContainer *data)
 CheckFormula check formula. More...
 
static const QStringList Colors ()
 
static QMap< QString, QString > ColorsList ()
 
static QMap< QString, QString > supportColorsList ()
 
static QMap< QString, QString > backgroundColorsList ()
 
static QPixmap createColorIcon (const int w, const int h, const QString &color)
 
static const QStringList fills ()
 
static void AddRecord (const quint32 id, const Tool &toolType, VAbstractPattern *doc)
 AddRecord add record about tool in history. More...
 
static void AddNodes (VAbstractPattern *doc, QDomElement &domElement, const VPiecePath &path)
 
static void AddNodes (VAbstractPattern *doc, QDomElement &domElement, const VPiece &piece)
 
template<typename T >
static quint32 CreateNode (VContainer *data, quint32 id)
 CreateNode create new node for detail. More...
 

Static Public Attributes

static const QString ToolType = QStringLiteral("trueDarts")
 
- Static Public Attributes inherited from VAbstractTool
static bool m_suppressContextMenu = false
 
static const QString AttrInUse = QStringLiteral("inUse")
 

Protected Slots

virtual void showContextMenu (QGraphicsSceneContextMenuEvent *event, quint32 id=NULL_ID) Q_DECL_OVERRIDE
 
- Protected Slots inherited from VDrawTool
virtual void showContextMenu (QGraphicsSceneContextMenuEvent *event, quint32 id=NULL_ID)=0
 

Protected Member Functions

virtual void RemoveReferens () Q_DECL_OVERRIDE
 RemoveReferens decrement value of reference. More...
 
virtual void SaveDialog (QDomElement &domElement) Q_DECL_OVERRIDE
 SaveDialog save options into file after change in dialog. More...
 
virtual void SaveOptions (QDomElement &tag, QSharedPointer< VGObject > &obj) Q_DECL_OVERRIDE
 
virtual void ReadToolAttributes (const QDomElement &domElement) Q_DECL_OVERRIDE
 
virtual void SetVisualization () Q_DECL_OVERRIDE
 
- Protected Member Functions inherited from VToolDoublePoint
virtual void updatePointNamePosition (quint32 id, const QPointF &pos) Q_DECL_OVERRIDE
 
virtual QVariant itemChange (GraphicsItemChange change, const QVariant &value) Q_DECL_OVERRIDE
 itemChange hadle item change. More...
 
virtual void keyReleaseEvent (QKeyEvent *event) Q_DECL_OVERRIDE
 keyReleaseEvent handle key release events. More...
 
virtual void contextMenuEvent (QGraphicsSceneContextMenuEvent *event) Q_DECL_OVERRIDE
 
virtual void AddToFile () Q_DECL_OVERRIDE
 AddToFile add tag with Information about tool into file. More...
 
virtual void updatePointNameVisibility (quint32 id, bool visible) Q_DECL_OVERRIDE
 
QString complexToolTip (quint32 itemId) const
 
- Protected Member Functions inherited from VAbstractPoint
void SetPointName (quint32 id, const QString &name)
 
- Protected Member Functions inherited from VDrawTool
void AddToCalculation (const QDomElement &domElement)
 typeLine line weight. More...
 
void addDependence (QList< quint32 > &list, quint32 objectId) const
 
virtual void SaveDialogChange () Q_DECL_FINAL
 
void SaveOption (QSharedPointer< VGObject > &obj)
 
virtual QString makeToolTip () const
 
bool CorrectDisable (bool disable, const QString &draftBlockName) const
 
void ReadAttributes ()
 
template<typename Dialog >
void ContextMenu (QGraphicsSceneContextMenuEvent *event, quint32 itemId=NULL_ID, const RemoveOption &showRemove=RemoveOption::Enable, const Referens &ref=Referens::Follow)
 ContextMenu show context menu for tool. More...
 
template<typename Item >
void ShowItem (Item *item, quint32 id, bool enable)
 ShowItem highlight tool. More...
 
template<typename T >
QString ObjectName (quint32 id) const
 ObjectName get object (point, curve, arc) name. More...
 
- Protected Member Functions inherited from VAbstractTool
virtual void RefreshDataInFile ()
 RefreshDataInFile refresh attributes in file. If attributes don't exist create them. More...
 
virtual void deleteTool (bool ask=true)
 deleteTool full delete object form scene and file. More...
 
template<typename T >
void AddVisualization ()
 
virtual void ToolCreation (const Source &typeCreation)
 

Private Member Functions

 VToolTrueDarts (VAbstractPattern *doc, VContainer *data, const quint32 &id, const quint32 &p1id, const quint32 &p2id, const quint32 &baseLineP1Id, const quint32 &baseLineP2Id, const quint32 &dartP1Id, const quint32 &dartP2Id, const quint32 &dartP3Id, const Source &typeCreation, QGraphicsItem *parent=nullptr)
 

Private Attributes

quint32 baseLineP1Id
 
quint32 baseLineP2Id
 
quint32 dartP1Id
 
quint32 dartP2Id
 
quint32 dartP3Id
 

Additional Inherited Members

- Public Slots inherited from VToolDoublePoint
void changePointName1Position (const QPointF &pos)
 
void changePointName2Position (const QPointF &pos)
 
virtual void Disable (bool disable, const QString &draftBlockName) Q_DECL_OVERRIDE
 
virtual void EnableToolMove (bool move) Q_DECL_OVERRIDE
 
void point1Chosen ()
 
void point2Chosen ()
 
void point1Selected (bool selected)
 
void point2Selected (bool selected)
 
virtual void FullUpdateFromFile () Q_DECL_OVERRIDE
 
virtual void AllowHover (bool enabled) Q_DECL_OVERRIDE
 
virtual void AllowSelecting (bool enabled) Q_DECL_OVERRIDE
 
void allowTextHover (bool enabled)
 
void allowTextSelectable (bool enabled)
 
virtual void ToolSelectionType (const SelectionType &type) Q_DECL_OVERRIDE
 
- Public Slots inherited from VAbstractPoint
virtual void ShowTool (quint32 id, bool enable) Q_DECL_OVERRIDE
 ShowTool highlight tool. More...
 
void deletePoint ()
 
- Public Slots inherited from VDrawTool
virtual void ShowTool (quint32 id, bool enable)
 ShowTool highlight tool. More...
 
virtual void activeBlockChanged (const QString &newName)
 activeBlockChanged disable or enable context menu after change active draft block. More...
 
void blockNameChanged (const QString &oldName, const QString &newName)
 blockNameChanged save new name active draft block. More...
 
virtual void EnableToolMove (bool move)
 
virtual void Disable (bool disable, const QString &draftBlockName)=0
 
virtual void piecesMode (bool mode)
 
- Public Slots inherited from VInteractiveTool
void FullUpdateFromGuiOk (int result)
 FullUpdateFromGuiOk refresh tool data after change in options. More...
 
void FullUpdateFromGuiApply ()
 FullUpdateFromGuiApply refresh tool data after change in options but do not delete dialog. More...
 
- Public Slots inherited from VAbstractTool
virtual void FullUpdateFromFile ()=0
 FullUpdateFromFile update tool data form file. More...
 
virtual void AllowHover (bool enabled)=0
 
virtual void AllowSelecting (bool enabled)=0
 
virtual void ToolSelectionType (const SelectionType &type)
 
- Signals inherited from VDrawTool
void ChangedToolSelection (bool selected, quint32 object, quint32 tool)
 
- Signals inherited from VAbstractTool
void toolHasChanges ()
 toolHasChanges emit if tool create change that need save. More...
 
void chosenTool (quint32 id, SceneObject type)
 chosenTool emit if object was clicked. More...
 
void LiteUpdateTree (const Document &parse)
 FullUpdateTree emit if need reparse pattern file. More...
 
void ToolTip (const QString &toolTip)
 
- Protected Types inherited from VDrawTool
enum class  RemoveOption : bool { Disable = false , Enable = true }
 
enum class  Referens : bool { Follow = true , Ignore = false }
 
- Static Protected Member Functions inherited from VAbstractPoint
template<typename T >
static void InitToolConnections (VMainGraphicsScene *scene, T *tool)
 
- Static Protected Member Functions inherited from VDrawTool
template<typename T >
static void InitDrawToolConnections (VMainGraphicsScene *scene, T *tool)
 
- Static Protected Member Functions inherited from VAbstractTool
static int ConfirmDeletion ()
 
static QDomElement AddSANode (VAbstractPattern *doc, const QString &tagName, const VPieceNode &node)
 
static void AddNode (VAbstractPattern *doc, QDomElement &domElement, const VPieceNode &node)
 
static QVector< VPieceNodePrepareNodes (const VPiecePath &path, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data)
 
static quint32 PrepareNode (const VPieceNode &node, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data)
 
- Protected Attributes inherited from VToolDoublePoint
VSimplePointfirstPoint
 
VSimplePointsecondPoint
 
quint32 p1id
 
quint32 p2id
 
- Protected Attributes inherited from VDrawTool
QString activeBlockName
 
QString m_lineType
 activeBlockName name of tool's pattern peace. More...
 
QString m_lineWeight
 typeLine line type. More...
 
- Protected Attributes inherited from VInteractiveTool
QSharedPointer< DialogToolm_dialog
 m_dialog tool's dialog options. More...
 
- Protected Attributes inherited from VAbstractTool
VAbstractPatterndoc
 doc dom document container More...
 
const quint32 m_id
 id object id. More...
 
QPointer< Visualizationvis
 
SelectionType selectionType
 
- Protected Attributes inherited from VDataTool
VContainer data
 data container with data More...
 
quint32 _referens
 _referens keep count tools what use this tool. If value more than 1 you can't delete tool. More...
 

Detailed Description

Definition at line 70 of file vtooltruedarts.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
Type 

Definition at line 96 of file vtooltruedarts.h.

Constructor & Destructor Documentation

◆ VToolTrueDarts()

VToolTrueDarts::VToolTrueDarts ( VAbstractPattern doc,
VContainer data,
const quint32 &  id,
const quint32 &  p1id,
const quint32 &  p2id,
const quint32 &  baseLineP1Id,
const quint32 &  baseLineP2Id,
const quint32 &  dartP1Id,
const quint32 &  dartP2Id,
const quint32 &  dartP3Id,
const Source typeCreation,
QGraphicsItem *  parent = nullptr 
)
private

Definition at line 81 of file vtooltruedarts.cpp.

References VAbstractTool::ToolCreation().

Referenced by Create().

Member Function Documentation

◆ BaseLineP1Name()

QString VToolTrueDarts::BaseLineP1Name ( ) const

◆ BaseLineP2Name()

QString VToolTrueDarts::BaseLineP2Name ( ) const

◆ Create() [1/2]

◆ Create() [2/2]

VToolTrueDarts * VToolTrueDarts::Create ( quint32  _id,
const quint32 &  _p1id,
const quint32 &  _p2id,
const quint32 &  baseLineP1Id,
const quint32 &  baseLineP2Id,
const quint32 &  dartP1Id,
const quint32 &  dartP2Id,
const quint32 &  dartP3Id,
const QString &  point1Name,
qreal  mx1,
qreal  my1,
bool  showPointName1,
const QString &  point2Name,
qreal  mx2,
qreal  my2,
bool  showPointName2,
VMainGraphicsScene scene,
VAbstractPattern doc,
VContainer data,
const Document parse,
const Source typeCreation 
)
static

◆ DartP1Name()

◆ DartP2Name()

◆ DartP3Name()

◆ FindPoint()

void VToolTrueDarts::FindPoint ( const QPointF &  baseLineP1,
const QPointF &  baseLineP2,
const QPointF &  dartP1,
const QPointF &  dartP2,
const QPointF &  dartP3,
QPointF &  p1,
QPointF &  p2 
)
static

Definition at line 104 of file vtooltruedarts.cpp.

Referenced by Create(), and VisToolTrueDarts::RefreshGeometry().

◆ GetBaseLineP1Id()

quint32 VToolTrueDarts::GetBaseLineP1Id ( ) const

Definition at line 281 of file vtooltruedarts.cpp.

References baseLineP1Id.

◆ GetBaseLineP2Id()

quint32 VToolTrueDarts::GetBaseLineP2Id ( ) const

Definition at line 299 of file vtooltruedarts.cpp.

References baseLineP2Id.

◆ GetDartP1Id()

quint32 VToolTrueDarts::GetDartP1Id ( ) const

Definition at line 317 of file vtooltruedarts.cpp.

References dartP1Id.

◆ GetDartP2Id()

quint32 VToolTrueDarts::GetDartP2Id ( ) const

Definition at line 335 of file vtooltruedarts.cpp.

References dartP2Id.

◆ GetDartP3Id()

quint32 VToolTrueDarts::GetDartP3Id ( ) const

Definition at line 353 of file vtooltruedarts.cpp.

References dartP3Id.

◆ ReadToolAttributes()

void VToolTrueDarts::ReadToolAttributes ( const QDomElement &  domElement)
protectedvirtual

◆ RemoveReferens()

void VToolTrueDarts::RemoveReferens ( )
protectedvirtual

◆ SaveDialog()

void VToolTrueDarts::SaveDialog ( QDomElement &  domElement)
protectedvirtual

SaveDialog save options into file after change in dialog.

Implements VDrawTool.

Definition at line 402 of file vtooltruedarts.cpp.

References AttrBaseLineP1, AttrBaseLineP2, AttrDartP1, AttrDartP2, AttrDartP3, AttrName1, AttrName2, VAbstractTool::doc, VInteractiveTool::m_dialog, SCASSERT, and VDomDocument::SetAttribute().

◆ SaveOptions()

void VToolTrueDarts::SaveOptions ( QDomElement &  tag,
QSharedPointer< VGObject > &  obj 
)
protectedvirtual

◆ SetBaseLineP1Id()

void VToolTrueDarts::SetBaseLineP1Id ( const quint32 &  value)

◆ SetBaseLineP2Id()

void VToolTrueDarts::SetBaseLineP2Id ( const quint32 &  value)

◆ SetDartP1Id()

void VToolTrueDarts::SetDartP1Id ( const quint32 &  value)

◆ SetDartP2Id()

void VToolTrueDarts::SetDartP2Id ( const quint32 &  value)

◆ SetDartP3Id()

void VToolTrueDarts::SetDartP3Id ( const quint32 &  value)

◆ setDialog()

void VToolTrueDarts::setDialog ( )
virtual

setDialog set dialog when user want change tool option.

Reimplemented from VInteractiveTool.

Definition at line 128 of file vtooltruedarts.cpp.

References baseLineP1Id, baseLineP2Id, dartP1Id, dartP2Id, dartP3Id, VDataTool::data, VContainer::GeometricObject(), VInteractiveTool::m_dialog, VToolDoublePoint::p1id, VToolDoublePoint::p2id, and SCASSERT.

◆ SetVisualization()

◆ showContextMenu

void VToolTrueDarts::showContextMenu ( QGraphicsSceneContextMenuEvent *  event,
quint32  id = NULL_ID 
)
protectedvirtualslot

Definition at line 371 of file vtooltruedarts.cpp.

◆ ShowVisualization()

void VToolTrueDarts::ShowVisualization ( bool  show)
virtual

Implements VAbstractTool.

Definition at line 245 of file vtooltruedarts.cpp.

Referenced by VToolOptionsPropertyBrowser::showOptionsToolTrueDarts().

◆ type()

virtual int VToolTrueDarts::type ( ) const
inlinevirtual

Reimplemented from VToolDoublePoint.

Definition at line 95 of file vtooltruedarts.h.

References Type.

Member Data Documentation

◆ baseLineP1Id

quint32 VToolTrueDarts::baseLineP1Id
private

◆ baseLineP2Id

quint32 VToolTrueDarts::baseLineP2Id
private

◆ dartP1Id

quint32 VToolTrueDarts::dartP1Id
private

◆ dartP2Id

quint32 VToolTrueDarts::dartP2Id
private

◆ dartP3Id

quint32 VToolTrueDarts::dartP3Id
private

◆ ToolType

const QString VToolTrueDarts::ToolType = QStringLiteral("trueDarts")
static

Definition at line 94 of file vtooltruedarts.h.

Referenced by VPattern::ParsePointElement(), and SaveOptions().


The documentation for this class was generated from the following files: