The VToolLine class tool for creation line. More...
#include <vtoolline.h>
Public Types | |
enum | { Type = UserType + static_cast<int>(Tool::Line) } |
Public Slots | |
virtual void | FullUpdateFromFile () Q_DECL_OVERRIDE |
FullUpdateFromFile update tool data form file. More... | |
virtual void | ShowTool (quint32 id, bool enable) Q_DECL_OVERRIDE |
ShowTool highlight tool. More... | |
virtual void | Disable (bool disable, const QString &draftBlockName) Q_DECL_OVERRIDE |
virtual void | AllowHover (bool enabled) Q_DECL_OVERRIDE |
virtual void | AllowSelecting (bool enabled) Q_DECL_OVERRIDE |
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) |
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 QString | getTagName () const Q_DECL_OVERRIDE |
virtual void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr) Q_DECL_OVERRIDE |
QString | FirstPointName () const |
QString | SecondPointName () const |
quint32 | GetFirstPoint () const |
void | SetFirstPoint (const quint32 &value) |
quint32 | GetSecondPoint () const |
void | SetSecondPoint (const quint32 &value) |
QString | getLineColor () const |
void | setLineColor (const QString &value) |
virtual void | ShowVisualization (bool show) Q_DECL_OVERRIDE |
virtual void | setLineType (const QString &value) Q_DECL_OVERRIDE |
void | setLineWeight (const QString &value) Q_DECL_OVERRIDE |
virtual void | GroupVisibility (quint32 object, bool visible) Q_DECL_OVERRIDE |
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 |
QString | getLineWeight () const |
virtual bool | isPointNameVisible (quint32 id) const |
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 VContainer * | getData () const |
getData return pointer to data container. More... | |
QMap< QString, quint32 > | PointsList () const |
virtual void | setPointNamePosition (quint32 id, const QPointF &pos) |
virtual void | setPointNameVisiblity (quint32 id, bool visible) |
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 VToolLine * | Create (QSharedPointer< DialogTool > dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) |
Create help create tool form GUI. More... | |
static VToolLine * | Create (const quint32 &_id, const quint32 &firstPoint, const quint32 &secondPoint, const QString &typeLine, const QString &lineWeight, const QString &lineColor, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data, const Document &parse, const Source &typeCreation) |
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... | |
Protected Slots | |
virtual void | showContextMenu (QGraphicsSceneContextMenuEvent *event, quint32 id=NULL_ID) Q_DECL_OVERRIDE |
contextMenuEvent handle context menu events. More... | |
Protected Slots inherited from VDrawTool | |
virtual void | showContextMenu (QGraphicsSceneContextMenuEvent *event, quint32 id=NULL_ID)=0 |
Protected Member Functions | |
virtual void | contextMenuEvent (QGraphicsSceneContextMenuEvent *event) override |
contextMenuEvent handle context menu events. More... | |
virtual void | AddToFile () Q_DECL_OVERRIDE |
AddToFile add tag with informations about tool into file. More... | |
virtual void | hoverEnterEvent (QGraphicsSceneHoverEvent *event) Q_DECL_OVERRIDE |
hoverEnterEvent handle hover enter events. More... | |
virtual void | hoverLeaveEvent (QGraphicsSceneHoverEvent *event) Q_DECL_OVERRIDE |
hoverLeaveEvent handle hover leave events. More... | |
virtual void | RemoveReferens () Q_DECL_OVERRIDE |
RemoveReferens decrement value of reference. More... | |
virtual QVariant | itemChange (GraphicsItemChange change, const QVariant &value) Q_DECL_OVERRIDE |
itemChange handle item change. More... | |
virtual void | keyReleaseEvent (QKeyEvent *event) Q_DECL_OVERRIDE |
keyReleaseEvent handle key realse events. 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 |
virtual QString | makeToolTip () const Q_DECL_OVERRIDE |
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) |
bool | CorrectDisable (bool disable, const QString &draftBlockName) const |
void | ReadAttributes () |
virtual void | updatePointNameVisibility (quint32 id, bool visible) |
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 | |
VToolLine (VAbstractPattern *doc, VContainer *data, quint32 id, quint32 firstPoint, quint32 secondPoint, const QString &typeLine, const QString &lineWeight, const QString &lineColor, const Source &typeCreation, QGraphicsItem *parent=nullptr) | |
VToolLine constructor. More... | |
void | RefreshGeometry () |
RefreshGeometry refresh item on scene. More... | |
Private Attributes | |
quint32 | firstPoint |
firstPoint id first line point. More... | |
quint32 | secondPoint |
secondPoint id second line point. More... | |
QString | lineColor |
lineColor color of a line. More... | |
bool | m_isHovered |
Additional Inherited Members | |
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) |
Static Public Attributes inherited from VAbstractTool | |
static bool | m_suppressContextMenu = false |
static const QString | AttrInUse = QStringLiteral("inUse") |
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 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< VPieceNode > | PrepareNodes (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 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< DialogTool > | m_dialog |
m_dialog tool's dialog options. More... | |
Protected Attributes inherited from VAbstractTool | |
VAbstractPattern * | doc |
doc dom document container More... | |
const quint32 | m_id |
id object id. More... | |
QPointer< Visualization > | vis |
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... | |
The VToolLine class tool for creation line.
Definition at line 74 of file vtoolline.h.
anonymous enum |
Enumerator | |
---|---|
Type |
Definition at line 89 of file vtoolline.h.
|
private |
VToolLine constructor.
doc | dom document container. |
data | container with variables. |
id | object id in container. |
firstPoint | id first line point. |
secondPoint | id second line point. |
lineType | line type. |
typeCreation | way we create this tool. |
parent | parent object. |
Definition at line 87 of file vtoolline.cpp.
References VDrawTool::m_lineType, VDrawTool::m_lineWeight, RefreshGeometry(), and VAbstractTool::ToolCreation().
Referenced by Create().
|
protectedvirtual |
AddToFile add tag with informations about tool into file.
Reimplemented from VDrawTool.
Definition at line 319 of file vtoolline.cpp.
References VDrawTool::AddToCalculation(), VAbstractTool::doc, getTagName(), and SaveOptions().
|
virtualslot |
Definition at line 275 of file vtoolline.cpp.
Referenced by Create().
|
virtualslot |
Definition at line 281 of file vtoolline.cpp.
Referenced by Create().
|
overrideprotectedvirtual |
contextMenuEvent handle context menu events.
event | context menu event. |
Definition at line 310 of file vtoolline.cpp.
References showContextMenu().
|
static |
Create help create tool.
_id | tool id, 0 if tool doesn't exist yet. |
firstPoint | id first line point. |
secondPoint | id second line point. |
lineType | line type. |
lineWeight | line weight. |
lineColor | line color. |
scene | pointer to scene. |
doc | dom document container. |
data | container with variables. |
parse | parser file mode. |
typeCreation | way we create this tool. |
Definition at line 169 of file vtoolline.cpp.
References VContainer::AddLine(), VAbstractTool::AddRecord(), VAbstractPattern::AddTool(), AllowHover(), AllowSelecting(), VDataTool::data, VAbstractTool::doc, VMainGraphicsScene::EnableLineItemHover(), VMainGraphicsScene::EnableLineItemSelection(), firstPoint, FromGui, FullParse, VContainer::GeometricObject(), VContainer::getNextId(), VAbstractPattern::IncrementReferens(), VDrawTool::InitDrawToolConnections(), Line, lineColor, SCASSERT, secondPoint, VContainer::UpdateId(), VAbstractPattern::UpdateToolData(), and VToolLine().
|
static |
Create help create tool form GUI.
dialog | dialog. |
scene | pointer to scene. |
doc | dom document container. |
data | container with variables. |
Definition at line 133 of file vtoolline.cpp.
References VDataTool::data, VAbstractTool::doc, firstPoint, FromGui, FullParse, lineColor, VInteractiveTool::m_dialog, SCASSERT, and secondPoint.
Referenced by VPattern::ParseLineElement().
|
virtualslot |
Definition at line 268 of file vtoolline.cpp.
References VDrawTool::CorrectDisable().
QString VToolLine::FirstPointName | ( | ) | const |
Definition at line 234 of file vtoolline.cpp.
References VDataTool::data, firstPoint, and VContainer::GetGObject().
Referenced by VToolOptionsPropertyBrowser::showOptionsToolLine(), and VToolOptionsPropertyBrowser::updateOptionsToolLine().
|
virtualslot |
FullUpdateFromFile update tool data form file.
Definition at line 249 of file vtoolline.cpp.
References VDrawTool::ReadAttributes(), RefreshGeometry(), and SetVisualization().
quint32 VToolLine::GetFirstPoint | ( | ) | const |
Definition at line 567 of file vtoolline.cpp.
References firstPoint.
QString VToolLine::getLineColor | ( | ) | const |
Definition at line 545 of file vtoolline.cpp.
References lineColor.
Referenced by VToolOptionsPropertyBrowser::updateOptionsToolLine().
quint32 VToolLine::GetSecondPoint | ( | ) | const |
Definition at line 484 of file vtoolline.cpp.
References secondPoint.
|
virtual |
Implements VAbstractTool.
Definition at line 214 of file vtoolline.cpp.
References VAbstractPattern::TagLine.
Referenced by AddToFile().
|
virtual |
Implements VDataTool.
Definition at line 560 of file vtoolline.cpp.
|
protectedvirtual |
hoverEnterEvent handle hover enter events.
event | hover enter event. |
Definition at line 332 of file vtoolline.cpp.
References m_isHovered, and makeToolTip().
|
protectedvirtual |
hoverLeaveEvent handle hover leave events.
event | hover leave event. |
Definition at line 344 of file vtoolline.cpp.
References m_isHovered, and VAbstractTool::vis.
Referenced by ShowVisualization().
|
protectedvirtual |
itemChange handle item change.
change | change. |
value | value. |
Definition at line 373 of file vtoolline.cpp.
References VDrawTool::ChangedToolSelection(), and VAbstractTool::m_id.
|
protectedvirtual |
keyReleaseEvent handle key realse events.
event | key realse event. |
Definition at line 388 of file vtoolline.cpp.
References VAbstractTool::deleteTool().
|
protectedvirtual |
Reimplemented from VDrawTool.
Definition at line 464 of file vtoolline.cpp.
References VDataTool::data, firstPoint, VContainer::GeometricObject(), qApp, secondPoint, and UnitsToStr().
Referenced by hoverEnterEvent().
|
virtual |
Definition at line 220 of file vtoolline.cpp.
References correctColor(), VAbstractTool::doc, lineColor, lineTypeToPenStyle(), VAbstractTool::m_id, m_isHovered, VDrawTool::m_lineType, VDrawTool::m_lineWeight, Mm, scaleWidth(), sceneScale(), ToPixel(), VAbstractPattern::useGroupColor(), VAbstractPattern::useGroupLineType(), and VAbstractPattern::useGroupLineWeight().
|
protectedvirtual |
Implements VDrawTool.
Definition at line 438 of file vtoolline.cpp.
References AttrFirstPoint, AttrLineColor, AttrLineType, AttrLineWeight, AttrSecondPoint, ColorBlack, VAbstractTool::doc, firstPoint, VDomDocument::GetParametrString(), VDomDocument::GetParametrUInt(), lineColor, LineTypeSolidLine, VDrawTool::m_lineType, VDrawTool::m_lineWeight, NULL_ID_STR, and secondPoint.
|
private |
RefreshGeometry refresh item on scene.
Definition at line 588 of file vtoolline.cpp.
References VDataTool::data, firstPoint, VContainer::GeometricObject(), and secondPoint.
Referenced by FullUpdateFromFile(), and VToolLine().
|
protectedvirtual |
RemoveReferens decrement value of reference.
Reimplemented from VAbstractTool.
Definition at line 357 of file vtoolline.cpp.
References VDataTool::data, VAbstractPattern::DecrementReferens(), VAbstractTool::doc, firstPoint, VContainer::GetGObject(), and secondPoint.
|
protectedvirtual |
SaveDialog save options into file after change in dialog.
Implements VDrawTool.
Definition at line 413 of file vtoolline.cpp.
References AttrFirstPoint, AttrLineColor, AttrLineType, AttrLineWeight, AttrSecondPoint, VAbstractTool::doc, VInteractiveTool::m_dialog, SCASSERT, and VDomDocument::SetAttribute().
|
protectedvirtual |
Reimplemented from VDrawTool.
Definition at line 426 of file vtoolline.cpp.
References AttrFirstPoint, AttrLineColor, AttrLineType, AttrLineWeight, AttrSecondPoint, VAbstractTool::doc, firstPoint, lineColor, VDrawTool::m_lineType, VDrawTool::m_lineWeight, VDrawTool::SaveOptions(), secondPoint, and VDomDocument::SetAttribute().
Referenced by AddToFile().
QString VToolLine::SecondPointName | ( | ) | const |
Definition at line 240 of file vtoolline.cpp.
References VDataTool::data, VContainer::GetGObject(), and secondPoint.
Referenced by VToolOptionsPropertyBrowser::showOptionsToolLine(), and VToolOptionsPropertyBrowser::updateOptionsToolLine().
|
virtual |
setDialog set dialog when user want change tool option.
Reimplemented from VInteractiveTool.
Definition at line 112 of file vtoolline.cpp.
References firstPoint, lineColor, VInteractiveTool::m_dialog, VDrawTool::m_lineType, VDrawTool::m_lineWeight, SCASSERT, and secondPoint.
void VToolLine::SetFirstPoint | ( | const quint32 & | value | ) |
Definition at line 573 of file vtoolline.cpp.
References firstPoint, NULL_ID, and VDrawTool::SaveOption().
Referenced by VToolOptionsPropertyBrowser::changeDataToolLine().
void VToolLine::setLineColor | ( | const QString & | value | ) |
Definition at line 551 of file vtoolline.cpp.
References lineColor, and VDrawTool::SaveOption().
Referenced by VToolOptionsPropertyBrowser::changeDataToolLine().
|
virtual |
Reimplemented from VDrawTool.
Definition at line 527 of file vtoolline.cpp.
References VDrawTool::m_lineType, and VDrawTool::SaveOption().
Referenced by VToolOptionsPropertyBrowser::changeDataToolLine().
|
virtual |
Reimplemented from VDrawTool.
Definition at line 536 of file vtoolline.cpp.
References VDrawTool::m_lineWeight, and VDrawTool::SaveOption().
Referenced by VToolOptionsPropertyBrowser::changeDataToolLine().
void VToolLine::SetSecondPoint | ( | const quint32 & | value | ) |
Definition at line 490 of file vtoolline.cpp.
References NULL_ID, VDrawTool::SaveOption(), and secondPoint.
Referenced by VToolOptionsPropertyBrowser::changeDataToolLine().
|
protectedvirtual |
Implements VAbstractTool.
Definition at line 448 of file vtoolline.cpp.
References firstPoint, lineTypeToPenStyle(), VDrawTool::m_lineType, VDrawTool::m_lineWeight, VisToolLine::RefreshGeometry(), SCASSERT, secondPoint, Visualization::setLineStyle(), Visualization::setLineWeight(), Visualization::setObject1Id(), VisToolLine::setPoint2Id(), and VAbstractTool::vis.
Referenced by FullUpdateFromFile(), and ShowVisualization().
|
protectedvirtualslot |
contextMenuEvent handle context menu events.
event | context menu event. |
Definition at line 291 of file vtoolline.cpp.
Referenced by contextMenuEvent().
|
virtualslot |
ShowTool highlight tool.
id | object id in container |
enable | enable or disable highlight. |
Definition at line 262 of file vtoolline.cpp.
References VDrawTool::ShowItem().
|
virtual |
Implements VAbstractTool.
Definition at line 502 of file vtoolline.cpp.
References hoverLeaveEvent(), SetVisualization(), and VAbstractTool::vis.
Referenced by VToolOptionsPropertyBrowser::showOptionsToolLine().
|
inlinevirtual |
Definition at line 88 of file vtoolline.h.
References Type.
|
private |
firstPoint id first line point.
Definition at line 142 of file vtoolline.h.
Referenced by Create(), FirstPointName(), GetFirstPoint(), makeToolTip(), ReadToolAttributes(), RefreshGeometry(), RemoveReferens(), SaveOptions(), setDialog(), SetFirstPoint(), and SetVisualization().
|
private |
lineColor color of a line.
Definition at line 148 of file vtoolline.h.
Referenced by Create(), getLineColor(), paint(), ReadToolAttributes(), SaveOptions(), setDialog(), and setLineColor().
|
private |
Definition at line 150 of file vtoolline.h.
Referenced by hoverEnterEvent(), hoverLeaveEvent(), and paint().
|
private |
secondPoint id second line point.
Definition at line 145 of file vtoolline.h.
Referenced by Create(), GetSecondPoint(), makeToolTip(), ReadToolAttributes(), RefreshGeometry(), RemoveReferens(), SaveOptions(), SecondPointName(), setDialog(), SetSecondPoint(), and SetVisualization().