QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
Public Types | Signals | Public Member Functions | Protected Member Functions | Properties | Private Member Functions | Private Attributes | List of all members
PartPolygon Class Reference

The PartPolygon class This class represents a polygon primitive which may be used to compose the drawing of an electrical element within the element editor. More...

#include <partpolygon.h>

Inheritance diagram for PartPolygon:
Inheritance graph
Collaboration diagram for PartPolygon:
Collaboration graph

Public Types

enum  { Type = UserType + 1105 }
 
- Public Types inherited from CustomElementGraphicPart
enum  LineStyle { NormalStyle , DashedStyle , DottedStyle , DashdottedStyle }
 
enum  LineWeight {
  NoneWeight , ThinWeight , NormalWeight , UltraWeight ,
  BigWeight
}
 
enum  Filling {
  NoneFilling , BlackFilling , WhiteFilling , GreenFilling ,
  RedFilling , BlueFilling , GrayFilling , BrunFilling ,
  YellowFilling , CyanFilling , MagentaFilling , LightgrayFilling ,
  OrangeFilling , PurpleFilling , HTMLPinkPinkFilling , HTMLPinkLightPinkFilling ,
  HTMLPinkHotPinkFilling , HTMLPinkDeepPinkFilling , HTMLPinkPaleVioletRedFilling , HTMLPinkMediumVioletRedFilling ,
  HTMLRedLightSalmonFilling , HTMLRedSalmonFilling , HTMLRedDarkSalmonFilling , HTMLRedLightCoralFilling ,
  HTMLRedIndianRedFilling , HTMLRedCrimsonFilling , HTMLRedFirebrickFilling , HTMLRedDarkRedFilling ,
  HTMLRedRedFilling , HTMLOrangeOrangeRedFilling , HTMLOrangeTomatoFilling , HTMLOrangeCoralFilling ,
  HTMLOrangeDarkOrangeFilling , HTMLOrangeOrangeFilling , HTMLYellowYellowFilling , HTMLYellowLightYellowFilling ,
  HTMLYellowLemonChiffonFilling , HTMLYellowLightGoldenrodYellowFilling , HTMLYellowPapayaWhipFilling , HTMLYellowMoccasinFilling ,
  HTMLYellowPeachPuffFilling , HTMLYellowPaleGoldenrodFilling , HTMLYellowKhakiFilling , HTMLYellowDarkKhakiFilling ,
  HTMLYellowGoldFilling , HTMLBrownCornsilkFilling , HTMLBrownBlanchedAlmondFilling , HTMLBrownBisqueFilling ,
  HTMLBrownNavajoWhiteFilling , HTMLBrownWheatFilling , HTMLBrownBurlywoodFilling , HTMLBrownTanFilling ,
  HTMLBrownRosyBrownFilling , HTMLBrownSandyBrownFilling , HTMLBrownGoldenrodFilling , HTMLBrownDarkGoldenrodFilling ,
  HTMLBrownPeruFilling , HTMLBrownChocolateFilling , HTMLBrownSaddleBrownFilling , HTMLBrownSiennaFilling ,
  HTMLBrownBrownFilling , HTMLBrownMaroonFilling , HTMLGreenDarkOliveGreenFilling , HTMLGreenOliveFilling ,
  HTMLGreenOliveDrabFilling , HTMLGreenYellowGreenFilling , HTMLGreenLimeGreenFilling , HTMLGreenLimeFilling ,
  HTMLGreenLawnGreenFilling , HTMLGreenChartreuseFilling , HTMLGreenGreenYellowFilling , HTMLGreenSpringGreenFilling ,
  HTMLGreenMediumSpringGreenFilling , HTMLGreenLightGreenFilling , HTMLGreenPaleGreenFilling , HTMLGreenDarkSeaGreenFilling ,
  HTMLGreenMediumAquamarineFilling , HTMLGreenMediumSeaGreenFilling , HTMLGreenSeaGreenFilling , HTMLGreenForestGreenFilling ,
  HTMLGreenGreenFilling , HTMLGreenDarkGreenFilling , HTMLCyanAquaFilling , HTMLCyanCyanFilling ,
  HTMLCyanLightCyanFilling , HTMLCyanPaleTurquoiseFilling , HTMLCyanAquamarineFilling , HTMLCyanTurquoiseFilling ,
  HTMLCyanMediumTurquoiseFilling , HTMLCyanDarkTurquoiseFilling , HTMLCyanLightSeaGreenFilling , HTMLCyanCadetBlueFilling ,
  HTMLCyanDarkCyanFilling , HTMLCyanTealFilling , HTMLBlueLightSteelBlueFilling , HTMLBluePowderBlueFilling ,
  HTMLBlueLightBlueFilling , HTMLBlueSkyBlueFilling , HTMLBlueLightSkyBlueFilling , HTMLBlueDeepSkyBlueFilling ,
  HTMLBlueDodgerBlueFilling , HTMLBlueCornflowerBlueFilling , HTMLBlueSteelBlueFilling , HTMLBlueRoyalBlueFilling ,
  HTMLBlueBlueFilling , HTMLBlueMediumBlueFilling , HTMLBlueDarkBlueFilling , HTMLBlueNavyFilling ,
  HTMLBlueMidnightBlueFilling , HTMLPurpleLavenderFilling , HTMLPurpleThistleFilling , HTMLPurplePlumFilling ,
  HTMLPurpleVioletFilling , HTMLPurpleOrchidFilling , HTMLPurpleFuchsiaFilling , HTMLPurpleMagentaFilling ,
  HTMLPurpleMediumOrchidFilling , HTMLPurpleMediumPurpleFilling , HTMLPurpleBlueVioletFilling , HTMLPurpleDarkVioletFilling ,
  HTMLPurpleDarkOrchidFilling , HTMLPurpleDarkMagentaFilling , HTMLPurplePurpleFilling , HTMLPurpleIndigoFilling ,
  HTMLPurpleDarkSlateBlueFilling , HTMLPurpleSlateBlueFilling , HTMLPurpleMediumSlateBlueFilling , HTMLWhiteWhiteFilling ,
  HTMLWhiteSnowFilling , HTMLWhiteHoneydewFilling , HTMLWhiteMintCreamFilling , HTMLWhiteAzureFilling ,
  HTMLWhiteAliceBlueFilling , HTMLWhiteGhostWhiteFilling , HTMLWhiteWhiteSmokeFilling , HTMLWhiteSeashellFilling ,
  HTMLWhiteBeigeFilling , HTMLWhiteOldLaceFilling , HTMLWhiteFloralWhiteFilling , HTMLWhiteIvoryFilling ,
  HTMLWhiteAntiqueWhiteFilling , HTMLWhiteLinenFilling , HTMLWhiteLavenderBlushFilling , HTMLWhiteMistyRoseFilling ,
  HTMLGrayGainsboroFilling , HTMLGrayLightGrayFilling , HTMLGraySilverFilling , HTMLGrayDarkGrayFilling ,
  HTMLGrayGrayFilling , HTMLGrayDimGrayFilling , HTMLGrayLightSlateGrayFilling , HTMLGraySlateGrayFilling ,
  HTMLGrayDarkSlateGrayFilling , HTMLGrayBlackFilling , HorFilling , VerFilling ,
  BdiagFilling , FdiagFilling
}
 
enum  Color {
  BlackColor , WhiteColor , GreenColor , RedColor ,
  BlueColor , GrayColor , BrunColor , YellowColor ,
  CyanColor , MagentaColor , LightgrayColor , OrangeColor ,
  PurpleColor , HTMLPinkPinkColor , HTMLPinkLightPinkColor , HTMLPinkHotPinkColor ,
  HTMLPinkDeepPinkColor , HTMLPinkPaleVioletRedColor , HTMLPinkMediumVioletRedColor , HTMLRedLightSalmonColor ,
  HTMLRedSalmonColor , HTMLRedDarkSalmonColor , HTMLRedLightCoralColor , HTMLRedIndianRedColor ,
  HTMLRedCrimsonColor , HTMLRedFirebrickColor , HTMLRedDarkRedColor , HTMLRedRedColor ,
  HTMLOrangeOrangeRedColor , HTMLOrangeTomatoColor , HTMLOrangeCoralColor , HTMLOrangeDarkOrangeColor ,
  HTMLOrangeOrangeColor , HTMLYellowYellowColor , HTMLYellowLightYellowColor , HTMLYellowLemonChiffonColor ,
  HTMLYellowLightGoldenrodYellowColor , HTMLYellowPapayaWhipColor , HTMLYellowMoccasinColor , HTMLYellowPeachPuffColor ,
  HTMLYellowPaleGoldenrodColor , HTMLYellowKhakiColor , HTMLYellowDarkKhakiColor , HTMLYellowGoldColor ,
  HTMLBrownCornsilkColor , HTMLBrownBlanchedAlmondColor , HTMLBrownBisqueColor , HTMLBrownNavajoWhiteColor ,
  HTMLBrownWheatColor , HTMLBrownBurlywoodColor , HTMLBrownTanColor , HTMLBrownRosyBrownColor ,
  HTMLBrownSandyBrownColor , HTMLBrownGoldenrodColor , HTMLBrownDarkGoldenrodColor , HTMLBrownPeruColor ,
  HTMLBrownChocolateColor , HTMLBrownSaddleBrownColor , HTMLBrownSiennaColor , HTMLBrownBrownColor ,
  HTMLBrownMaroonColor , HTMLGreenDarkOliveGreenColor , HTMLGreenOliveColor , HTMLGreenOliveDrabColor ,
  HTMLGreenYellowGreenColor , HTMLGreenLimeGreenColor , HTMLGreenLimeColor , HTMLGreenLawnGreenColor ,
  HTMLGreenChartreuseColor , HTMLGreenGreenYellowColor , HTMLGreenSpringGreenColor , HTMLGreenMediumSpringGreenColor ,
  HTMLGreenLightGreenColor , HTMLGreenPaleGreenColor , HTMLGreenDarkSeaGreenColor , HTMLGreenMediumAquamarineColor ,
  HTMLGreenMediumSeaGreenColor , HTMLGreenSeaGreenColor , HTMLGreenForestGreenColor , HTMLGreenGreenColor ,
  HTMLGreenDarkGreenColor , HTMLCyanAquaColor , HTMLCyanCyanColor , HTMLCyanLightCyanColor ,
  HTMLCyanPaleTurquoiseColor , HTMLCyanAquamarineColor , HTMLCyanTurquoiseColor , HTMLCyanMediumTurquoiseColor ,
  HTMLCyanDarkTurquoiseColor , HTMLCyanLightSeaGreenColor , HTMLCyanCadetBlueColor , HTMLCyanDarkCyanColor ,
  HTMLCyanTealColor , HTMLBlueLightSteelBlueColor , HTMLBluePowderBlueColor , HTMLBlueLightBlueColor ,
  HTMLBlueSkyBlueColor , HTMLBlueLightSkyBlueColor , HTMLBlueDeepSkyBlueColor , HTMLBlueDodgerBlueColor ,
  HTMLBlueCornflowerBlueColor , HTMLBlueSteelBlueColor , HTMLBlueRoyalBlueColor , HTMLBlueBlueColor ,
  HTMLBlueMediumBlueColor , HTMLBlueDarkBlueColor , HTMLBlueNavyColor , HTMLBlueMidnightBlueColor ,
  HTMLPurpleLavenderColor , HTMLPurpleThistleColor , HTMLPurplePlumColor , HTMLPurpleVioletColor ,
  HTMLPurpleOrchidColor , HTMLPurpleFuchsiaColor , HTMLPurpleMagentaColor , HTMLPurpleMediumOrchidColor ,
  HTMLPurpleMediumPurpleColor , HTMLPurpleBlueVioletColor , HTMLPurpleDarkVioletColor , HTMLPurpleDarkOrchidColor ,
  HTMLPurpleDarkMagentaColor , HTMLPurplePurpleColor , HTMLPurpleIndigoColor , HTMLPurpleDarkSlateBlueColor ,
  HTMLPurpleSlateBlueColor , HTMLPurpleMediumSlateBlueColor , HTMLWhiteWhiteColor , HTMLWhiteSnowColor ,
  HTMLWhiteHoneydewColor , HTMLWhiteMintCreamColor , HTMLWhiteAzureColor , HTMLWhiteAliceBlueColor ,
  HTMLWhiteGhostWhiteColor , HTMLWhiteWhiteSmokeColor , HTMLWhiteSeashellColor , HTMLWhiteBeigeColor ,
  HTMLWhiteOldLaceColor , HTMLWhiteFloralWhiteColor , HTMLWhiteIvoryColor , HTMLWhiteAntiqueWhiteColor ,
  HTMLWhiteLinenColor , HTMLWhiteLavenderBlushColor , HTMLWhiteMistyRoseColor , HTMLGrayGainsboroColor ,
  HTMLGrayLightGrayColor , HTMLGraySilverColor , HTMLGrayDarkGrayColor , HTMLGrayGrayColor ,
  HTMLGrayDimGrayColor , HTMLGrayLightSlateGrayColor , HTMLGraySlateGrayColor , HTMLGrayDarkSlateGrayColor ,
  HTMLGrayBlackColor , NoneColor
}
 

Signals

void closedChange ()
 
void polygonChanged ()
 

Public Member Functions

 PartPolygon (QETElementEditor *editor, QGraphicsItem *parent=nullptr)
 PartPolygon::PartPolygon Constructor.
 
 ~PartPolygon () override
 PartPolygon::~PartPolygon.
 
int type () const override
 
void paint (QPainter *, const QStyleOptionGraphicsItem *, QWidget *) override
 PartPolygon::paint Draw this polygon.
 
QString name () const override
 
QString xmlName () const override
 
void fromXml (const QDomElement &) override
 PartPolygon::fromXml Import the properties of this polygon from a xml element.
 
const QDomElement toXml (QDomDocument &) const override
 PartPolygon::toXml Export this polygin in xml.
 
QPainterPath shape () const override
 PartPolygon::shape.
 
QPainterPath shadowShape () const override
 
QRectF boundingRect () const override
 PartPolygon::boundingRect.
 
bool isUseless () const override
 PartPolygon::isUseless.
 
QRectF sceneGeometricRect () const override
 PartPolygon::sceneGeometricRect.
 
void startUserTransformation (const QRectF &) override
 PartPolygon::startUserTransformation Start the user-induced transformation, provided this primitive is contained within the initial_selection_rect bounding rectangle.
 
void handleUserTransformation (const QRectF &, const QRectF &) override
 PartPolygon::handleUserTransformation Handle the user-induced transformation from initial_selection_rect to new_selection_rect.
 
QET::ScalingMethod preferredScalingMethod () const override
 PartPolygon::preferredScalingMethod This method is called by the decorator when it needs to determine the best way to interactively scale a primitive. It is typically called when only a single primitive is being scaled.
 
QPolygonF polygon () const
 PartPolygon::polygon.
 
void setPolygon (const QPolygonF &polygon)
 PartPolygon::setPolygon Sets the item's polygon to be the given polygon.
 
void addPoint (const QPointF &point)
 PartPolygon::addPoint Add new point to polygon.
 
void setLastPoint (const QPointF &point)
 PartPolygon::setLastPoint Set the last point of polygon to point.
 
void removeLastPoint ()
 PartPolygon::removeLastPoint Remove the last point of polygon.
 
bool isClosed () const
 
void setClosed (bool close)
 
void setHandlerColor (QPointF pos, const QColor &color) final
 PartPolygon::setHandlerColor Set the handler at pos pos (in polygon coordinate) to color color.
 
void resetAllHandlerColor () final
 PartPolygon::resetAllHandlerColor Reset the color of every handlers.
 
void setRotation (qreal angle)
 
qreal rotation () const
 
void addHandler () override
 PartPolygon::addHandler Add handlers for this item.
 
void removeHandler () override
 PartPolygon::removeHandler Remove the handlers of this item.
 
- Public Member Functions inherited from CustomElementGraphicPart
 CustomElementGraphicPart (QETElementEditor *editor, QGraphicsItem *parent=nullptr)
 CustomElementGraphicPart::CustomElementGraphicPart Default constructor. By default, item is selectable, send geometry change (Qt > 4.6), accept mouse left button and accept hover event.
 
 ~CustomElementGraphicPart () override
 CustomElementGraphicPart::~CustomElementGraphicPart Destructor.
 
LineStyle lineStyle () const
 
void setLineStyle (const LineStyle ls)
 CustomElementGraphicPart::setLineStyle Set line style to ls.
 
LineWeight lineWeight () const
 
void setLineWeight (const LineWeight lw)
 CustomElementGraphicPart::setLineWeight Set line weight to lw.
 
qreal penWeight () const
 CustomElementGraphicPart::penWeight.
 
Filling filling () const
 
void setFilling (const Filling f)
 CustomElementGraphicPart::setFilling Set filling to f.
 
Color color () const
 
void setColor (const Color c)
 CustomElementGraphicPart::setColor Set color to c.
 
bool antialiased () const
 
void setAntialiased (const bool b)
 CustomElementGraphicPart::setAntialiased Set antialias to b.
 
void setProperty (const char *name, const QVariant &value) override
 
QVariant property (const char *name) const override
 
- Public Member Functions inherited from CustomElementPart
 CustomElementPart (QETElementEditor *editor)
 CustomElementPart Constructor.
 
virtual ~CustomElementPart ()
 ~CustomElementPart Destructor
 
virtual QETElementEditorelementEditor () const
 
virtual void updateCurrentPartEditor () const
 
virtual ElementSceneelementScene () const
 
virtual QUndoStack & undoStack () const
 
virtual QGraphicsItem * toItem ()
 

Protected Member Functions

QVariant itemChange (GraphicsItemChange change, const QVariant &value) override
 PartPolygon::itemChange.
 
bool sceneEventFilter (QGraphicsItem *watched, QEvent *event) override
 PartPolygon::sceneEventFilter.
 
void contextMenuEvent (QGraphicsSceneContextMenuEvent *event) override
 
- Protected Member Functions inherited from CustomElementGraphicPart
void stylesToXml (QDomElement &) const
 CustomElementGraphicPart::stylesToXml Write the current style to xml element. The style are stored like this: name-of-style:value;name-of-style:value Each style separate by ; and name-style/value are separate by :
 
void stylesFromXml (const QDomElement &)
 CustomElementGraphicPart::stylesFromXml Read the style used by this, from a xml element.
 
void resetStyles ()
 CustomElementGraphicPart::resetStyles Reset the current style to default, same style of default constructor.
 
void applyStylesToQPainter (QPainter &) const
 CustomElementGraphicPart::applyStylesToQPainter Apply the current style to the QPainter.
 
void drawShadowShape (QPainter *painter)
 CustomElementGraphicPart::drawShadowShape Draw a transparent blue shadow arround the shape of this item. The QPainterPathStroker used to draw shadows have a width of SHADOWS_HEIGHT Be carefull if penWeight of this item is to 0 the outline of strock is bigger of 0.5.
 
void hoverEnterEvent (QGraphicsSceneHoverEvent *event) override
 CustomElementGraphicPart::hoverEnterEvent Reimplemented from QGraphicsObject. Set m_hovered to true.
 
void hoverLeaveEvent (QGraphicsSceneHoverEvent *event) override
 CustomElementGraphicPart::hoverLeaveEvent Reimplemented from QGraphicsObject. Set m_hovered to false.
 
void mousePressEvent (QGraphicsSceneMouseEvent *event) override
 
void mouseMoveEvent (QGraphicsSceneMouseEvent *event) override
 
void mouseReleaseEvent (QGraphicsSceneMouseEvent *event) override
 
- Protected Member Functions inherited from CustomElementPart
QList< QPointF > mapPoints (const QRectF &, const QRectF &, const QList< QPointF > &)
 

Properties

bool closed
 
QPolygonF polygon
 
- Properties inherited from CustomElementGraphicPart
LineStyle line_style
 
LineWeight line_weight
 
Filling filling
 
Color color
 
bool antialias
 

Private Member Functions

 PartPolygon (const PartPolygon &)
 
void adjusteHandlerPos ()
 PartPolygon::adjusteHandlerPos.
 
void handlerMousePressEvent (QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
 PartPolygon::handlerMousePressEvent.
 
void handlerMouseMoveEvent (QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
 PartPolygon::handlerMouseMoveEvent.
 
void handlerMouseReleaseEvent (QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
 PartPolygon::handlerMouseReleaseEvent.
 
void insertPoint ()
 PartPolygon::insertPoint Insert a point in this polygon.
 
void removePoint ()
 PartPolygon::removePoint remove a point on this polygon.
 

Private Attributes

bool m_closed
 
QList< QPointF > saved_points_
 
QPolygonF m_polygon
 
QPropertyUndoCommandm_undo_command
 
int m_vector_index = -1
 
QVector< QetGraphicsHandlerItem * > m_handler_vector
 
QAction * m_insert_point
 
QAction * m_remove_point
 
QPointF m_context_menu_pos
 
qreal m_rot
 

Additional Inherited Members

- Static Public Member Functions inherited from CustomElementGraphicPart
static void drawCross (const QPointF &center, QPainter *painter)
 CustomElementGraphicPart::drawCross Draw a cross at pos center.
 
- Protected Attributes inherited from CustomElementGraphicPart
bool m_hovered
 

Detailed Description

The PartPolygon class This class represents a polygon primitive which may be used to compose the drawing of an electrical element within the element editor.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
Type 

Constructor & Destructor Documentation

◆ PartPolygon() [1/2]

PartPolygon::PartPolygon ( QETElementEditor editor,
QGraphicsItem *  parent = nullptr 
)

PartPolygon::PartPolygon Constructor.

Parameters
editor: editor of this item
parent: parent item
Here is the call graph for this function:

◆ ~PartPolygon()

PartPolygon::~PartPolygon ( )
override

PartPolygon::~PartPolygon.

Here is the call graph for this function:

◆ PartPolygon() [2/2]

PartPolygon::PartPolygon ( const PartPolygon )
private

Member Function Documentation

◆ addHandler()

void PartPolygon::addHandler ( )
overridevirtual

PartPolygon::addHandler Add handlers for this item.

Reimplemented from CustomElementGraphicPart.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addPoint()

void PartPolygon::addPoint ( const QPointF &  point)

PartPolygon::addPoint Add new point to polygon.

Parameters
point

◆ adjusteHandlerPos()

void PartPolygon::adjusteHandlerPos ( )
private

PartPolygon::adjusteHandlerPos.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ boundingRect()

QRectF PartPolygon::boundingRect ( ) const
override

PartPolygon::boundingRect.

Returns
the bounding rect of this item
Here is the call graph for this function:

◆ closedChange

void PartPolygon::closedChange ( )
signal
Here is the caller graph for this function:

◆ contextMenuEvent()

void PartPolygon::contextMenuEvent ( QGraphicsSceneContextMenuEvent *  event)
overrideprotected
Here is the call graph for this function:

◆ fromXml()

void PartPolygon::fromXml ( const QDomElement &  qde)
overridevirtual

PartPolygon::fromXml Import the properties of this polygon from a xml element.

Parameters
qde: Xml document to use

Implements CustomElementPart.

Here is the call graph for this function:

◆ handlerMouseMoveEvent()

void PartPolygon::handlerMouseMoveEvent ( QetGraphicsHandlerItem qghi,
QGraphicsSceneMouseEvent *  event 
)
private

PartPolygon::handlerMouseMoveEvent.

Parameters
qghi
event
Here is the call graph for this function:
Here is the caller graph for this function:

◆ handlerMousePressEvent()

void PartPolygon::handlerMousePressEvent ( QetGraphicsHandlerItem qghi,
QGraphicsSceneMouseEvent *  event 
)
private

PartPolygon::handlerMousePressEvent.

Parameters
qghi
event
Here is the caller graph for this function:

◆ handlerMouseReleaseEvent()

void PartPolygon::handlerMouseReleaseEvent ( QetGraphicsHandlerItem qghi,
QGraphicsSceneMouseEvent *  event 
)
private

PartPolygon::handlerMouseReleaseEvent.

Parameters
qghi
event
Here is the call graph for this function:
Here is the caller graph for this function:

◆ handleUserTransformation()

void PartPolygon::handleUserTransformation ( const QRectF &  initial_selection_rect,
const QRectF &  new_selection_rect 
)
overridevirtual

PartPolygon::handleUserTransformation Handle the user-induced transformation from initial_selection_rect to new_selection_rect.

Parameters
initial_selection_rect
new_selection_rect

Implements CustomElementPart.

Here is the call graph for this function:

◆ insertPoint()

void PartPolygon::insertPoint ( )
private

PartPolygon::insertPoint Insert a point in this polygon.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isClosed()

bool PartPolygon::isClosed ( ) const
inline
Here is the caller graph for this function:

◆ isUseless()

bool PartPolygon::isUseless ( ) const
overridevirtual

PartPolygon::isUseless.

Returns
true if this part is irrelevant and does not deserve to be Retained / registered. A polygon is relevant when he have 2 differents points

Implements CustomElementPart.

◆ itemChange()

QVariant PartPolygon::itemChange ( GraphicsItemChange  change,
const QVariant &  value 
)
overrideprotected

PartPolygon::itemChange.

Parameters
change
value
Returns
Here is the call graph for this function:

◆ name()

QString PartPolygon::name ( ) const
inlineoverridevirtual
Returns
the name of the primitive

Implements CustomElementPart.

◆ paint()

void PartPolygon::paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  options,
QWidget *  widget 
)
override

PartPolygon::paint Draw this polygon.

Parameters
painter
options
widget
Here is the call graph for this function:

◆ polygon()

QPolygonF PartPolygon::polygon ( ) const

PartPolygon::polygon.

Returns
the item's polygon, or an empty polygon if no polygon has been set.

◆ polygonChanged

void PartPolygon::polygonChanged ( )
signal
Here is the caller graph for this function:

◆ preferredScalingMethod()

QET::ScalingMethod PartPolygon::preferredScalingMethod ( ) const
overridevirtual

PartPolygon::preferredScalingMethod This method is called by the decorator when it needs to determine the best way to interactively scale a primitive. It is typically called when only a single primitive is being scaled.

Returns
: This reimplementation systematically returns QET::RoundScaleRatios.

Reimplemented from CustomElementPart.

◆ removeHandler()

void PartPolygon::removeHandler ( )
overridevirtual

PartPolygon::removeHandler Remove the handlers of this item.

Reimplemented from CustomElementGraphicPart.

Here is the caller graph for this function:

◆ removeLastPoint()

void PartPolygon::removeLastPoint ( )

PartPolygon::removeLastPoint Remove the last point of polygon.

Here is the caller graph for this function:

◆ removePoint()

void PartPolygon::removePoint ( )
private

PartPolygon::removePoint remove a point on this polygon.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ resetAllHandlerColor()

void PartPolygon::resetAllHandlerColor ( )
finalvirtual

PartPolygon::resetAllHandlerColor Reset the color of every handlers.

Reimplemented from CustomElementGraphicPart.

Here is the caller graph for this function:

◆ rotation()

qreal PartPolygon::rotation ( ) const
Here is the caller graph for this function:

◆ sceneEventFilter()

bool PartPolygon::sceneEventFilter ( QGraphicsItem *  watched,
QEvent *  event 
)
overrideprotected

PartPolygon::sceneEventFilter.

Parameters
watched
event
Returns
Here is the call graph for this function:

◆ sceneGeometricRect()

QRectF PartPolygon::sceneGeometricRect ( ) const
overridevirtual

PartPolygon::sceneGeometricRect.

Returns
the minimum, margin-less rectangle this part can fit into, in scene coordinates. It is different from boundingRect() because it is not supposed to imply any margin, and it is different from shape because it is a regular rectangle, not a complex shape.

Implements CustomElementPart.

◆ setClosed()

void PartPolygon::setClosed ( bool  close)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setHandlerColor()

void PartPolygon::setHandlerColor ( QPointF  pos,
const QColor &  color 
)
finalvirtual

PartPolygon::setHandlerColor Set the handler at pos pos (in polygon coordinate) to color color.

Parameters
pos
color

Reimplemented from CustomElementGraphicPart.

Here is the caller graph for this function:

◆ setLastPoint()

void PartPolygon::setLastPoint ( const QPointF &  point)

PartPolygon::setLastPoint Set the last point of polygon to point.

Parameters
point

◆ setPolygon()

void PartPolygon::setPolygon ( const QPolygonF &  polygon)

PartPolygon::setPolygon Sets the item's polygon to be the given polygon.

Parameters
polygon
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setRotation()

void PartPolygon::setRotation ( qreal  angle)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ shadowShape()

QPainterPath PartPolygon::shadowShape ( ) const
overridevirtual

Implements CustomElementGraphicPart.

Here is the call graph for this function:

◆ shape()

QPainterPath PartPolygon::shape ( ) const
override

PartPolygon::shape.

Returns
the shape of this item
Here is the call graph for this function:
Here is the caller graph for this function:

◆ startUserTransformation()

void PartPolygon::startUserTransformation ( const QRectF &  initial_selection_rect)
overridevirtual

PartPolygon::startUserTransformation Start the user-induced transformation, provided this primitive is contained within the initial_selection_rect bounding rectangle.

Parameters
initial_selection_rect

Implements CustomElementPart.

◆ toXml()

const QDomElement PartPolygon::toXml ( QDomDocument &  xml_document) const
overridevirtual

PartPolygon::toXml Export this polygin in xml.

Parameters
xml_document: Xml document to use for create the xml element
Returns
an xml element that describe this polygon

Implements CustomElementPart.

Here is the call graph for this function:

◆ type()

int PartPolygon::type ( ) const
inlineoverride

Enable the use of qgraphicsitem_cast to safely cast a QGraphicsItem into a PartPolygon.

Returns
the QGraphicsItem type

◆ xmlName()

QString PartPolygon::xmlName ( ) const
inlineoverridevirtual
Returns
the name that will be used as XML tag when exporting the primitive

Implements CustomElementPart.

Member Data Documentation

◆ m_closed

bool PartPolygon::m_closed
private

◆ m_context_menu_pos

QPointF PartPolygon::m_context_menu_pos
private

◆ m_handler_vector

QVector<QetGraphicsHandlerItem *> PartPolygon::m_handler_vector
private

◆ m_insert_point

QAction* PartPolygon::m_insert_point
private

◆ m_polygon

QPolygonF PartPolygon::m_polygon
private

◆ m_remove_point

QAction * PartPolygon::m_remove_point
private

◆ m_rot

qreal PartPolygon::m_rot
private

◆ m_undo_command

QPropertyUndoCommand* PartPolygon::m_undo_command
private

◆ m_vector_index

int PartPolygon::m_vector_index = -1
private

◆ saved_points_

QList<QPointF> PartPolygon::saved_points_
private

Property Documentation

◆ closed

bool PartPolygon::closed
readwrite

◆ polygon

QPolygonF PartPolygon::polygon
readwrite

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