QElectroTech  0.8-dev
Public Types | Signals | Public Member Functions | Properties | Private Member Functions | Private Attributes | List of all members
PartTerminal Class Reference

#include <partterminal.h>

Inheritance diagram for PartTerminal:
Inheritance graph
Collaboration diagram for PartTerminal:
Collaboration graph

Public Types

enum  { Type = UserType + 1106 }
 
- 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 orientationChanged ()
 
void nameChanged ()
 

Public Member Functions

 PartTerminal (QETElementEditor *editor, QGraphicsItem *parent=nullptr)
 PartTerminal::PartTerminal. More...
 
 ~PartTerminal () override
 Destructeur. More...
 
int type () const override
 
QString name () const override
 
QString xmlName () const override
 
void fromXml (const QDomElement &) override
 
const QDomElement toXml (QDomDocument &) const override
 
void paint (QPainter *, const QStyleOptionGraphicsItem *, QWidget *) override
 
QPainterPath shape () const override
 PartTerminal::shape. More...
 
QPainterPath shadowShape () const override
 
QRectF boundingRect () const override
 PartTerminal::boundingRect. More...
 
bool isUseless () const override
 
QRectF sceneGeometricRect () const override
 
void startUserTransformation (const QRectF &) override
 
void handleUserTransformation (const QRectF &, const QRectF &) override
 
Qet::Orientation orientation () const
 
void setOrientation (Qet::Orientation ori)
 
void setName (QString &name)
 PartTerminal::setName. More...
 
void setNewUuid ()
 
- 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. More...
 
 ~CustomElementGraphicPart () override
 CustomElementGraphicPart::~CustomElementGraphicPart Destructor. More...
 
LineStyle lineStyle () const
 
void setLineStyle (const LineStyle ls)
 CustomElementGraphicPart::setLineStyle Set line style to ls. More...
 
LineWeight lineWeight () const
 
void setLineWeight (const LineWeight lw)
 CustomElementGraphicPart::setLineWeight Set line weight to lw. More...
 
qreal penWeight () const
 CustomElementGraphicPart::penWeight. More...
 
Filling filling () const
 
void setFilling (const Filling f)
 CustomElementGraphicPart::setFilling Set filling to f. More...
 
Color color () const
 
void setColor (const Color c)
 CustomElementGraphicPart::setColor Set color to c. More...
 
bool antialiased () const
 
void setAntialiased (const bool b)
 CustomElementGraphicPart::setAntialiased Set antialias to b. More...
 
void setProperty (const char *name, const QVariant &value) override
 
QVariant property (const char *name) const override
 
virtual void setHandlerColor (QPointF, const QColor &)
 
virtual void resetAllHandlerColor ()
 
- Public Member Functions inherited from CustomElementPart
 CustomElementPart (QETElementEditor *editor)
 CustomElementPart Constructor. More...
 
virtual ~CustomElementPart ()
 ~CustomElementPart Destructor More...
 
virtual QETElementEditorelementEditor () const
 
virtual void updateCurrentPartEditor () const
 
virtual ElementSceneelementScene () const
 
virtual QUndoStack & undoStack () const
 
virtual QGraphicsItem * toItem ()
 
virtual QET::ScalingMethod preferredScalingMethod () const
 

Properties

Qet::Orientation orientation
 
QString name
 
- Properties inherited from CustomElementGraphicPart
LineStyle line_style
 
LineWeight line_weight
 
Filling filling
 
Color color
 
bool antialias
 

Private Member Functions

 PartTerminal (const PartTerminal &)
 
void updateSecondPoint ()
 

Private Attributes

TerminalDatad
 
QPointF saved_position_
 

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. More...
 
- Protected Member Functions inherited from CustomElementGraphicPart
void stylesToXml (QDomElement &) const
 CustomElementGraphicPart::stylesToXml Write the curent 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 : More...
 
void stylesFromXml (const QDomElement &)
 CustomElementGraphicPart::stylesFromXml Read the style used by this, from a xml element. More...
 
void resetStyles ()
 CustomElementGraphicPart::resetStyles Reset the curent style to default, same style of default constructor. More...
 
void applyStylesToQPainter (QPainter &) const
 CustomElementGraphicPart::applyStylesToQPainter Apply the current style to the QPainter. More...
 
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. More...
 
QVariant itemChange (GraphicsItemChange change, const QVariant &value) override
 CustomElementGraphicPart::itemChange Reimplemented from QGraphicsObject. If the item position change call updateCurrentPartEditor() the change is always send to QGraphicsObject. More...
 
void hoverEnterEvent (QGraphicsSceneHoverEvent *event) override
 CustomElementGraphicPart::hoverEnterEvent Reimplemented from QGraphicsObject. Set m_hovered to true. More...
 
void hoverLeaveEvent (QGraphicsSceneHoverEvent *event) override
 CustomElementGraphicPart::hoverLeaveEvent Reimplemented from QGraphicsObject. Set m_hovered to false. More...
 
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 > &)
 
- Protected Attributes inherited from CustomElementGraphicPart
bool m_hovered
 

Detailed Description

This class represents a terminal 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

◆ PartTerminal() [1/2]

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

PartTerminal::PartTerminal.

Parameters
editor: L'editeur d'element concerne
parent: Le QGraphicsItem parent de cette borne
Here is the call graph for this function:

◆ ~PartTerminal()

PartTerminal::~PartTerminal ( )
override

Destructeur.

◆ PartTerminal() [2/2]

PartTerminal::PartTerminal ( const PartTerminal )
private

Member Function Documentation

◆ boundingRect()

QRectF PartTerminal::boundingRect ( ) const
override

PartTerminal::boundingRect.

Returns
the bounding rect of this item

◆ fromXml()

void PartTerminal::fromXml ( const QDomElement &  xml_elmt)
overridevirtual

Importe les proprietes d'une borne depuis un element XML

Parameters
xml_elmtElement XML a lire

Implements CustomElementPart.

Here is the call graph for this function:

◆ handleUserTransformation()

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

Handle the user-induced transformation from initial_selection_rect to new_selection_rect

Implements CustomElementPart.

Here is the call graph for this function:

◆ isUseless()

bool PartTerminal::isUseless ( ) const
overridevirtual
Returns
true si cette partie n'est pas pertinente et ne merite pas d'etre conservee / enregistree. Une borne est toujours pertinente ; cette fonction renvoie donc toujours false

Implements CustomElementPart.

◆ name()

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

Implements CustomElementPart.

◆ nameChanged

void PartTerminal::nameChanged ( )
signal
Here is the caller graph for this function:

◆ orientation()

Qet::Orientation PartTerminal::orientation ( ) const
inline

◆ orientationChanged

void PartTerminal::orientationChanged ( )
signal
Here is the caller graph for this function:

◆ paint()

void PartTerminal::paint ( QPainter *  p,
const QStyleOptionGraphicsItem *  options,
QWidget *  widget 
)
override

Dessine la borne

Parameters
pQPainter a utiliser pour rendre le dessin
optionsOptions pour affiner le rendu
widgetWidget sur lequel le rendu est effectue
Here is the call graph for this function:

◆ sceneGeometricRect()

QRectF PartTerminal::sceneGeometricRect ( ) const
overridevirtual
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.

◆ setName()

void PartTerminal::setName ( QString &  name)

PartTerminal::setName.

Parameters
name

◆ setNewUuid()

void PartTerminal::setNewUuid ( )
Here is the caller graph for this function:

◆ setOrientation()

void PartTerminal::setOrientation ( Qet::Orientation  ori)

Definit l'orientation de la borne

Parameters
orila nouvelle orientation de la borne
Here is the call graph for this function:

◆ shadowShape()

QPainterPath PartTerminal::shadowShape ( ) const
inlineoverridevirtual

Implements CustomElementGraphicPart.

Here is the call graph for this function:

◆ shape()

QPainterPath PartTerminal::shape ( ) const
override

PartTerminal::shape.

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

◆ startUserTransformation()

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

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

Implements CustomElementPart.

◆ toXml()

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

Exporte la borne en XML

Parameters
xml_documentDocument XML a utiliser pour creer l'element XML
Returns
un element XML decrivant la borne

Implements CustomElementPart.

◆ type()

int PartTerminal::type ( ) const
inlineoverride

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

Returns
the QGraphicsItem type

◆ updateSecondPoint()

void PartTerminal::updateSecondPoint ( )
private

Met a jour la position du second point en fonction de la position et de l'orientation de la borne.

Here is the caller graph for this function:

◆ xmlName()

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

Implements CustomElementPart.

Member Data Documentation

◆ d

TerminalData* PartTerminal::d
private

◆ saved_position_

QPointF PartTerminal::saved_position_
private

Property Documentation

◆ name

QString PartTerminal::name
readwrite

◆ orientation

Qet::Orientation PartTerminal::orientation
readwrite

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