Seamly2D
Code documentation
VNodePoint Class Reference

The VNodePoint class point detail node. More...

#include <vnodepoint.h>

Inheritance diagram for VNodePoint:
Collaboration diagram for VNodePoint:

Public Types

enum  { Type = UserType + static_cast<int>(Tool::NodePoint) }
 
- Public Types inherited from VScenePoint
enum  { Type = UserType + static_cast<int>(Vis::ScenePoint) }
 

Public Slots

virtual void FullUpdateFromFile () Q_DECL_OVERRIDE
 showContextMenu emit when need show tool context menu. More...
 
void nameChangedPosition (const QPointF &pos)
 nameChangedPosition point name change position. More...
 
void pointChosen ()
 
void EnableToolMove (bool move)
 
virtual void AllowHover (bool enabled) Q_DECL_OVERRIDE
 
virtual void AllowSelecting (bool enabled) Q_DECL_OVERRIDE
 
void allowTextHover (bool enabled)
 
void allowTextSelectable (bool enabled)
 
- 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)
 

Public Member Functions

virtual int type () const Q_DECL_OVERRIDE
 
virtual QString getTagName () const Q_DECL_OVERRIDE
 
virtual void setPointNamePosition (quint32 id, const QPointF &pos) Q_DECL_OVERRIDE
 setPointNamePosition change name text position. More...
 
virtual void setPointNameVisiblity (quint32 id, bool visible) Q_DECL_OVERRIDE
 
- Public Member Functions inherited from VAbstractNode
 VAbstractNode (VAbstractPattern *doc, VContainer *data, const quint32 &id, const quint32 &idNode, const QString &blockName=QString(), const quint32 &idTool=0, QObject *parent=nullptr)
 VAbstractNode constructor. More...
 
virtual ~VAbstractNode () Q_DECL_EQ_DEFAULT
 
virtual void ShowVisualization (bool show) Q_DECL_OVERRIDE
 
virtual void incrementReferens () Q_DECL_OVERRIDE
 incrementReferens increment referens. More...
 
virtual void decrementReferens () Q_DECL_OVERRIDE
 decrementReferens decrement reference for all parent objects. More...
 
ParentType GetParentType () const
 
void SetParentType (const ParentType &value)
 
virtual void GroupVisibility (quint32 object, bool visible) Q_DECL_OVERRIDE
 
bool IsExluded () const
 
void SetExluded (bool exluded)
 
- 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...
 
- Public Member Functions inherited from VScenePoint
 VScenePoint (const QColor &lineColor, QGraphicsItem *parent=nullptr)
 
virtual ~VScenePoint ()=default
 
virtual void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr) Q_DECL_OVERRIDE
 
virtual void refreshPointGeometry (const VPointF &point)
 
void refreshLeader ()
 

Static Public Member Functions

static void Create (VAbstractPattern *doc, VContainer *data, VMainGraphicsScene *scene, quint32 id, quint32 idPoint, const Document &parse, const Source &typeCreation, const QString &blockName=QString(), const quint32 &idTool=0)
 Create help create tool. More...
 
- 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("modeling")
 
- Static Public Attributes inherited from VAbstractNode
static const QString AttrIdTool = QStringLiteral("idTool")
 
- Static Public Attributes inherited from VAbstractTool
static bool m_suppressContextMenu = false
 
static const QString AttrInUse = QStringLiteral("inUse")
 

Protected Member Functions

virtual void AddToFile () Q_DECL_OVERRIDE
 AddToFile add tag with Information about tool into file. More...
 
virtual void mousePressEvent (QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE
 
virtual void mouseReleaseEvent (QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE
 mouseReleaseEvent handle mouse release events. More...
 
virtual void hoverEnterEvent (QGraphicsSceneHoverEvent *event) override
 
virtual void ShowNode () Q_DECL_OVERRIDE
 
virtual void HideNode () Q_DECL_OVERRIDE
 
virtual void contextMenuEvent (QGraphicsSceneContextMenuEvent *event) Q_DECL_OVERRIDE
 
- Protected Member Functions inherited from VAbstractNode
void AddToModeling (const QDomElement &domElement)
 AddToModeling add tag to modeling tag current pattern peace. More...
 
virtual void ToolCreation (const Source &typeCreation) Q_DECL_OVERRIDE
 
virtual void SetVisualization () Q_DECL_OVERRIDE
 
- Protected Member Functions inherited from VAbstractTool
virtual void RefreshDataInFile ()
 RefreshDataInFile refresh attributes in file. If attributes don't exist create them. More...
 
virtual void RemoveReferens ()
 RemoveReferens decrement value of reference. More...
 
virtual void deleteTool (bool ask=true)
 deleteTool full delete object form scene and file. More...
 
template<typename T >
void AddVisualization ()
 
- Protected Member Functions inherited from VScenePoint
virtual void hoverLeaveEvent (QGraphicsSceneHoverEvent *event) Q_DECL_OVERRIDE
 
void setOnlyPoint (bool value)
 
bool isOnlyPoint () const
 
void setPointColor (const QString &value)
 

Private Member Functions

 VNodePoint (VAbstractPattern *doc, VContainer *data, quint32 id, quint32 idPoint, const Source &typeCreation, const QString &blockName=QString(), const quint32 &idTool=0, QObject *qoParent=nullptr, QGraphicsItem *parent=nullptr)
 VNodePoint constructor. More...
 

Additional Inherited Members

- 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)
 
- 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 VAbstractNode
ParentType parentType
 
quint32 idNode
 idNodenode id. More...
 
quint32 idTool
 idTool id tool. More...
 
QString m_blockName
 
bool m_exluded
 
- 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...
 
- Protected Attributes inherited from VScenePoint
VGraphicsSimpleTextItemm_pointName
 
VScaledLinem_pointLeader
 namePoint point text. More...
 
QColor m_pointColor
 pointL line that we see if Text is moved too away from point. More...
 
bool m_onlyPoint
 m_pointColor color of point. More...
 
bool m_isHovered
 
bool m_showPointName
 

Detailed Description

The VNodePoint class point detail node.

Definition at line 72 of file vnodepoint.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
Type 

Definition at line 82 of file vnodepoint.h.

Constructor & Destructor Documentation

◆ VNodePoint()

VNodePoint::VNodePoint ( VAbstractPattern doc,
VContainer data,
quint32  id,
quint32  idPoint,
const Source typeCreation,
const QString &  blockName = QString(),
const quint32 &  idTool = 0,
QObject *  qoParent = nullptr,
QGraphicsItem *  parent = nullptr 
)
private

VNodePoint constructor.

Parameters
docdom document container.
datacontainer with variables.
idobject id in container.
idPointobject id in containerPoint.
typeCreationway we create this tool.
idTooltool id.
qoParentQObject parent
parentparent object.

Definition at line 104 of file vnodepoint.cpp.

References contextMenuEvent(), VDataTool::data, VScenePoint::m_pointName, nameChangedPosition(), VGraphicsSimpleTextItem::nameChangedPosition(), pointChosen(), VGraphicsSimpleTextItem::pointChosen(), VScenePoint::refreshPointGeometry(), VGraphicsSimpleTextItem::setShowParentTooltip(), VGraphicsSimpleTextItem::showContextMenu(), and VAbstractNode::ToolCreation().

Referenced by Create().

Member Function Documentation

◆ AddToFile()

◆ AllowHover

void VNodePoint::AllowHover ( bool  enabled)
virtualslot

Definition at line 352 of file vnodepoint.cpp.

Referenced by Create().

◆ AllowSelecting

void VNodePoint::AllowSelecting ( bool  enabled)
virtualslot

Definition at line 358 of file vnodepoint.cpp.

Referenced by Create().

◆ allowTextHover

void VNodePoint::allowTextHover ( bool  enabled)
slot

Definition at line 364 of file vnodepoint.cpp.

References VScenePoint::m_pointName.

Referenced by Create().

◆ allowTextSelectable

void VNodePoint::allowTextSelectable ( bool  enabled)
slot

Definition at line 370 of file vnodepoint.cpp.

References VScenePoint::m_pointName.

Referenced by Create().

◆ contextMenuEvent()

void VNodePoint::contextMenuEvent ( QGraphicsSceneContextMenuEvent *  event)
protectedvirtual

◆ Create()

void VNodePoint::Create ( VAbstractPattern doc,
VContainer data,
VMainGraphicsScene scene,
quint32  id,
quint32  idPoint,
const Document parse,
const Source typeCreation,
const QString &  blockName = QString(),
const quint32 &  idTool = 0 
)
static

◆ EnableToolMove

void VNodePoint::EnableToolMove ( bool  move)
slot

◆ FullUpdateFromFile

void VNodePoint::FullUpdateFromFile ( )
virtualslot

showContextMenu emit when need show tool context menu.

FullUpdateFromFile update tool data form file.

Parameters
eventcontext menu event.

Definition at line 188 of file vnodepoint.cpp.

References VDataTool::data, VAbstractTool::m_id, and VScenePoint::refreshPointGeometry().

◆ getTagName()

QString VNodePoint::getTagName ( ) const
virtual

Implements VAbstractTool.

Definition at line 173 of file vnodepoint.cpp.

References VAbstractPattern::TagPoint.

Referenced by AddToFile().

◆ HideNode()

void VNodePoint::HideNode ( )
protectedvirtual

Implements VAbstractNode.

Definition at line 317 of file vnodepoint.cpp.

◆ hoverEnterEvent()

void VNodePoint::hoverEnterEvent ( QGraphicsSceneHoverEvent *  event)
overrideprotectedvirtual

◆ mousePressEvent()

void VNodePoint::mousePressEvent ( QGraphicsSceneMouseEvent *  event)
protectedvirtual

Definition at line 225 of file vnodepoint.cpp.

◆ mouseReleaseEvent()

void VNodePoint::mouseReleaseEvent ( QGraphicsSceneMouseEvent *  event)
protectedvirtual

mouseReleaseEvent handle mouse release events.

Parameters
eventmouse release event.

Definition at line 253 of file vnodepoint.cpp.

References VAbstractTool::chosenTool(), VAbstractTool::m_id, and Point.

◆ nameChangedPosition

void VNodePoint::nameChangedPosition ( const QPointF &  pos)
slot

nameChangedPosition point name change position.

Parameters
posnew position.

Definition at line 302 of file vnodepoint.cpp.

References VAbstractTool::doc, VAbstractTool::m_id, MoveLabel, and qApp.

Referenced by VNodePoint().

◆ pointChosen

void VNodePoint::pointChosen ( )
slot

Definition at line 179 of file vnodepoint.cpp.

References VAbstractTool::chosenTool(), VAbstractTool::m_id, and Point.

Referenced by VNodePoint().

◆ setPointNamePosition()

void VNodePoint::setPointNamePosition ( quint32  id,
const QPointF &  pos 
)
virtual

setPointNamePosition change name text position.

Parameters
posnew position.

Reimplemented from VAbstractTool.

Definition at line 267 of file vnodepoint.cpp.

References VDataTool::data, VContainer::GeometricObject(), VAbstractTool::m_id, VScenePoint::m_pointName, VMainGraphicsView::NewSceneRect(), qApp, VScenePoint::refreshLeader(), and VGraphicsSimpleTextItem::setPosition().

◆ setPointNameVisiblity()

void VNodePoint::setPointNameVisiblity ( quint32  id,
bool  visible 
)
virtual

◆ ShowNode()

void VNodePoint::ShowNode ( )
protectedvirtual

Implements VAbstractNode.

Definition at line 308 of file vnodepoint.cpp.

References VAbstractNode::m_exluded, VAbstractNode::parentType, and Scene.

◆ type()

virtual int VNodePoint::type ( ) const
inlinevirtual

Reimplemented from VScenePoint.

Definition at line 81 of file vnodepoint.h.

References Type.

Member Data Documentation

◆ ToolType

const QString VNodePoint::ToolType = QStringLiteral("modeling")
static

Definition at line 80 of file vnodepoint.h.

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


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