From 3dc2e158dde6f297c0d5538222804321a2323e23 Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Fri, 15 Sep 2017 12:50:09 -0300 Subject: Add doxygen documentation On docs folder --- docs/doxygen/html/class_element.html | 2979 ++++++++++++++++++++++++++++++++++ 1 file changed, 2979 insertions(+) create mode 100644 docs/doxygen/html/class_element.html (limited to 'docs/doxygen/html/class_element.html') diff --git a/docs/doxygen/html/class_element.html b/docs/doxygen/html/class_element.html new file mode 100644 index 0000000..8a0008f --- /dev/null +++ b/docs/doxygen/html/class_element.html @@ -0,0 +1,2979 @@ + + + + + + + +PSP-UFU: Element Class Reference + + + + + + + + + +
+
+ + + + + + + +
+
PSP-UFU +  2017w37a +
+
Power System Platform (UFU)
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+
+ +
+
Element Class Referenceabstract
+
+
+
+Inheritance diagram for Element:
+
+
+ + +ControlElement +GraphicalElement +PowerElement +ConnectionLine +Constant +Exponential +Gain +IOControl +Limiter +Multiplier +RateLimiter +Sum +TransferFunction +Text +Branch +Bus +Machines +Shunt + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

Element ()
 Constructor.
 
+virtual ~Element ()
 Destructor.
 
void SetDragging (bool dragging=true)
 Set if the element are being dragged. More...
 
void SetHeight (double height)
 Set element height. More...
 
void SetPosition (const wxPoint2DDouble position)
 Set the element position and update the rectangle. More...
 
void SetSelected (bool selected=true)
 Set element selection. More...
 
void SetWidth (double width)
 Set element width. More...
 
void SetAngle (double angle)
 Set element angle. More...
 
void ShowPickbox (bool showPickbox=true)
 Set if the pickbox is shown. More...
 
void SetBorderSize (double borderSize)
 Set the size of the border (shown in selected elements). More...
 
bool SetOnline (bool online=true)
 Set if the element is online or offline. More...
 
virtual void SetPointList (std::vector< wxPoint2DDouble > pointList)
 Set the list of points that connect the element to the bus. More...
 
wxRect2DDouble GetRect () const
 Get the element rectangle. More...
 
wxPoint2DDouble GetPosition () const
 Get the element position. More...
 
bool IsDragging () const
 Checks if the element is being dragged. More...
 
double GetHeight () const
 Get the element height. More...
 
bool IsSelected () const
 Checks if the element is selected. More...
 
double GetWidth () const
 Get the element width. More...
 
double GetAngle () const
 Get the element angle. More...
 
double GetRotationAngle () const
 Get the angle of rotation. More...
 
bool IsPickboxShown () const
 Checks if the pickbox is shown. More...
 
bool IsOnline () const
 Checks if the element is online or offline. More...
 
virtual std::vector< wxPoint2DDouble > GetPointList () const
 Get the list of points that connect the element to bus. More...
 
virtual bool AddParent (Element *parent, wxPoint2DDouble position)
 Add a parent to the element. This method must be used on power elements that connect to a bus, so the parent must be a bus. The element basic points are calculated in this method, so apply this when the element is being inserted. More...
 
virtual void AddParent (Element *parent)
 Add a parent to the element. More...
 
virtual bool Contains (wxPoint2DDouble position) const =0
 Checks if the element contains a position. More...
 
virtual bool Intersects (wxRect2DDouble rect) const =0
 Check if the element's rect intersects other rect. More...
 
virtual ElementGetCopy ()
 Get a the element copy. More...
 
virtual void SetID (int id)
 Set the element ID. More...
 
virtual int GetID () const
 Get the element ID. More...
 
virtual void AddChild (Element *child)
 Add a child to the child list. More...
 
virtual void RemoveChild (Element *child)
 Remove a child from the list. More...
 
virtual void ReplaceChild (Element *oldChild, Element *newChild)
 Replace a child from the list. More...
 
virtual wxString GetTipText () const
 Get the tip text. More...
 
virtual void Draw (wxPoint2DDouble translation, double scale) const
 Draw the element. More...
 
virtual void Rotate (bool clockwise=true)
 Rotate the element. More...
 
virtual bool GetContextMenu (wxMenu &menu)
 Get the element contex menu. More...
 
virtual void AddPoint (wxPoint2DDouble point)
 Add point to the list of points that connect the element to the bus. More...
 
virtual void StartMove (wxPoint2DDouble position)
 Update the element attributes related to the movement. More...
 
virtual void Move (wxPoint2DDouble position)
 Move the element other position. More...
 
virtual void MoveNode (Element *parent, wxPoint2DDouble position)
 Move a node. StartMove(wxPoint2DDouble position) before start moving. More...
 
virtual bool NodeContains (wxPoint2DDouble position)
 Check if a node contains a point. If contains, set the attributes related to node movement. More...
 
+virtual void UpdateNodes ()
 Update the nodes according to the parents. If a parent is removed, use this method.
 
virtual bool SetNodeParent (Element *parent)
 Set a perent to the node. If all conditions are met, a new parent are added to the element and the points related to the nodes will be calculated. More...
 
virtual void RemoveParent (Element *parent)
 Remove a parent. More...
 
virtual void ReplaceParent (Element *oldParent, Element *newParent)
 Replace a parent. More...
 
virtual void RotateNode (Element *parent, bool clockwise=true)
 Rotate a node. More...
 
virtual bool PickboxContains (wxPoint2DDouble position)
 Check if a pickbox contains a point. If contains the attributes related to pickbox movement will be calculated. More...
 
virtual void MovePickbox (wxPoint2DDouble position)
 Move the pickbox. More...
 
virtual wxCursor GetBestPickboxCursor () const
 Get the best cursor to shown to the user when the mouse is above a pickbox. More...
 
+virtual void ResetPickboxes ()
 Remove the pickboxes.
 
+virtual void ResetNodes ()
 Remove the active nodes.
 
virtual wxPoint2DDouble WorldToScreen (wxPoint2DDouble translation, double scale, double offsetX=0.0, double offsetY=0.0) const
 Convert the element position to screen position. More...
 
virtual wxPoint2DDouble WorldToScreen (wxPoint2DDouble position, wxPoint2DDouble translation, double scale, double offsetX=0.0, double offsetY=0.0) const
 Convert a generic position to screen position. More...
 
virtual bool RotatedRectanglesIntersects (wxRect2DDouble rect1, wxRect2DDouble rect2, double angle1, double angle2) const
 Check if two roteted rectangles intersect. More...
 
virtual void DrawCircle (wxPoint2DDouble position, double radius, int numSegments, GLenum mode=GL_LINE_LOOP) const
 Draw a circle. More...
 
+virtual void DrawArc (wxPoint2DDouble position, double radius, double initAngle, double finalAngle, int numSegments, GLenum mode=GL_LINE_LOOP) const
 
virtual void DrawRectangle (wxPoint2DDouble position, double width, double height, GLenum mode=GL_QUADS) const
 Draw rectangle. More...
 
virtual void DrawRectangle (wxPoint2DDouble *points, GLenum mode=GL_QUADS) const
 Draw rectangle. More...
 
virtual void DrawTriangle (std::vector< wxPoint2DDouble > points, GLenum mode=GL_TRIANGLES) const
 Draw a triangle. More...
 
virtual void DrawPoint (wxPoint2DDouble position, double size) const
 Draw a point. More...
 
virtual void DrawLine (std::vector< wxPoint2DDouble > points, GLenum mode=GL_LINE_STRIP) const
 Draw line. More...
 
virtual void DrawPickbox (wxPoint2DDouble position) const
 Draw pickbox. More...
 
virtual wxPoint2DDouble RotateAtPosition (wxPoint2DDouble pointToRotate, double angle, bool degrees=true) const
 Rotate a point as element position being the origin. More...
 
virtual std::vector< Element * > GetParentList () const
 Get the parent list. More...
 
virtual std::vector< Element * > GetChildList () const
 Get the Child list. More...
 
virtual void CalculateBoundaries (wxPoint2DDouble &leftUp, wxPoint2DDouble &rightBottom) const
 Calculate the element boundaries. More...
 
virtual void GeneralMenuItens (wxMenu &menu)
 Insert general itens to context menu. More...
 
virtual bool ShowForm (wxWindow *parent, Element *element)
 Show element data form. More...
 
virtual double PointToLineDistance (wxPoint2DDouble point, int *segmentNumber=NULL) const
 Calculate the distance between a line (formed by point list) and a point. More...
 
+ + + + + + + + + + +

+Static Public Member Functions

static bool DoubleFromString (wxWindow *parent, wxString strValue, double &value, wxString errorMsg)
 Get a double value from a string. Show a error message if the conversion fail. More...
 
static bool IntFromString (wxWindow *parent, wxString strValue, int &value, wxString errorMsg)
 Convert a string to int. Show a error message if the conversion fail. More...
 
static wxString StringFromDouble (double value, int minDecimal=1)
 Convert a double value to string. More...
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Protected Attributes

+int m_elementID = 0
 
+std::vector< Element * > m_parentList
 
+std::vector< Element * > m_childList
 
+wxRect2DDouble m_rect
 
+wxPoint2DDouble m_position
 
+double m_width = 0.0
 
+double m_height = 0.0
 
+double m_angle = 0.0
 
+double m_borderSize = 2.0
 
+double m_rotationAngle = 45.0
 
+double m_switchSize = 10.0
 
+std::vector< wxRect2DDouble > m_switchRect
 
+bool m_selected = false
 
+bool m_dragging = false
 
+bool m_showPickbox = false
 
+int m_activePickboxID = ID_PB_NONE
 
+int m_activeNodeID = 0
 
+std::vector< wxPoint2DDouble > m_pointList
 
+std::vector< wxPoint2DDouble > m_movePts
 
+wxPoint2DDouble m_moveStartPt
 
+wxPoint2DDouble m_movePos
 
+bool m_online = true
 
+OpenGLColour m_selectionColour
 
+

Member Function Documentation

+ +

◆ AddChild()

+ +
+
+ + + + + +
+ + + + + + + + +
void Element::AddChild (Elementchild)
+
+virtual
+
+ +

Add a child to the child list.

+
Parameters
+ + +
childNew child.
+
+
+ +
+
+ +

◆ AddParent() [1/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual bool Element::AddParent (Elementparent,
wxPoint2DDouble position 
)
+
+inlinevirtual
+
+ +

Add a parent to the element. This method must be used on power elements that connect to a bus, so the parent must be a bus. The element basic points are calculated in this method, so apply this when the element is being inserted.

+
Parameters
+ + + +
parentElement parent.
positionNode position in the parent.
+
+
+ +

Reimplemented in Transformer, Text, Bus, Line, Load, Capacitor, Inductor, and Machines.

+ +
+
+ +

◆ AddParent() [2/2]

+ +
+
+ + + + + +
+ + + + + + + + +
virtual void Element::AddParent (Elementparent)
+
+inlinevirtual
+
+ +

Add a parent to the element.

+
Parameters
+ + +
parentElement parent.
+
+
+ +
+
+ +

◆ AddPoint()

+ +
+
+ + + + + +
+ + + + + + + + +
virtual void Element::AddPoint (wxPoint2DDouble point)
+
+inlinevirtual
+
+ +

Add point to the list of points that connect the element to the bus.

+
Parameters
+ + +
pointPoint to be added.
+
+
+ +

Reimplemented in Line, and Branch.

+ +
+
+ +

◆ CalculateBoundaries()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void Element::CalculateBoundaries (wxPoint2DDouble & leftUp,
wxPoint2DDouble & rightBottom 
) const
+
+virtual
+
+ +

Calculate the element boundaries.

+
Parameters
+ + + +
leftUpTop-left position of the element.
rightBottomBottom-right position of the element.
+
+
+ +

Reimplemented in Line.

+ +
+
+ +

◆ Contains()

+ +
+
+ + + + + +
+ + + + + + + + +
virtual bool Element::Contains (wxPoint2DDouble position) const
+
+pure virtual
+
+ +

Checks if the element contains a position.

+
Parameters
+ + +
positionPosition to be checked.
+
+
+ +

Implemented in Transformer, Text, Bus, Line, IOControl, TransferFunction, Capacitor, Inductor, Constant, Gain, Machines, Sum, ConnectionLine, Exponential, Limiter, Multiplier, RateLimiter, Branch, and Shunt.

+ +
+
+ +

◆ DoubleFromString()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bool Element::DoubleFromString (wxWindow * parent,
wxString strValue,
double & value,
wxString errorMsg 
)
+
+static
+
+ +

Get a double value from a string. Show a error message if the conversion fail.

+
Parameters
+ + + + + +
parentMessage box parent.
strValueString value to be converted.
valueDouble value converted.
errorMsgError message.
+
+
+ +
+
+ +

◆ Draw()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual void Element::Draw (wxPoint2DDouble translation,
double scale 
) const
+
+inlinevirtual
+
+ +

Draw the element.

+
Parameters
+ + + +
translationTranslation of the system.
scaleScale of the system.
+
+
+ +

Reimplemented in Transformer, Bus, Line, Load, IOControl, TransferFunction, Capacitor, Inductor, Machines, Constant, Gain, Sum, Branch, ConnectionLine, Exponential, Limiter, Multiplier, and RateLimiter.

+ +
+
+ +

◆ DrawCircle()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void Element::DrawCircle (wxPoint2DDouble position,
double radius,
int numSegments,
GLenum mode = GL_LINE_LOOP 
) const
+
+virtual
+
+ +

Draw a circle.

+
Parameters
+ + + + + +
positionCircle position.
radiusCircle radius
numSegmentsNum of segments of the circle.
modeOpenGl primitive.
+
+
+ +
+
+ +

◆ DrawLine()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void Element::DrawLine (std::vector< wxPoint2DDouble > points,
GLenum mode = GL_LINE_STRIP 
) const
+
+virtual
+
+ +

Draw line.

+
Parameters
+ + + +
pointsLine vertices.
modeOpenGl primitive.
+
+
+ +
+
+ +

◆ DrawPickbox()

+ +
+
+ + + + + +
+ + + + + + + + +
void Element::DrawPickbox (wxPoint2DDouble position) const
+
+virtual
+
+ +

Draw pickbox.

+
Parameters
+ + +
positionPickbox position.
+
+
+ +
+
+ +

◆ DrawPoint()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void Element::DrawPoint (wxPoint2DDouble position,
double size 
) const
+
+virtual
+
+ +

Draw a point.

+
Parameters
+ + + +
positionPoint position.
sizePoint size.
+
+
+ +
+
+ +

◆ DrawRectangle() [1/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void Element::DrawRectangle (wxPoint2DDouble position,
double width,
double height,
GLenum mode = GL_QUADS 
) const
+
+virtual
+
+ +

Draw rectangle.

+
Parameters
+ + + + + +
positionRectangle position.
widthRectangle width.
heightRectangle height.
modeOpenGl primitive.
+
+
+ +
+
+ +

◆ DrawRectangle() [2/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void Element::DrawRectangle (wxPoint2DDouble * points,
GLenum mode = GL_QUADS 
) const
+
+virtual
+
+ +

Draw rectangle.

+
Parameters
+ + + +
pointsRectangle vertices.
modeOpenGl primitive.
+
+
+ +
+
+ +

◆ DrawTriangle()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void Element::DrawTriangle (std::vector< wxPoint2DDouble > points,
GLenum mode = GL_TRIANGLES 
) const
+
+virtual
+
+ +

Draw a triangle.

+
Parameters
+ + + +
pointsTriangle vertices.
modeOpenGl primitive.
+
+
+ +
+
+ +

◆ GeneralMenuItens()

+ +
+
+ + + + + +
+ + + + + + + + +
void Element::GeneralMenuItens (wxMenu & menu)
+
+virtual
+
+ +

Insert general itens to context menu.

+
Parameters
+ + +
menuMenu that will be inserted the general itens.
+
+
+ +
+
+ +

◆ GetAngle()

+ +
+
+ + + + + +
+ + + + + + + +
double Element::GetAngle () const
+
+inline
+
+ +

Get the element angle.

+
Returns
Angle value.
+ +
+
+ +

◆ GetBestPickboxCursor()

+ +
+
+ + + + + +
+ + + + + + + +
virtual wxCursor Element::GetBestPickboxCursor () const
+
+inlinevirtual
+
+ +

Get the best cursor to shown to the user when the mouse is above a pickbox.

+
Returns
Cursor.
+ +

Reimplemented in Bus, Line, and Branch.

+ +
+
+ +

◆ GetChildList()

+ +
+
+ + + + + +
+ + + + + + + +
virtual std::vector<Element*> Element::GetChildList () const
+
+inlinevirtual
+
+ +

Get the Child list.

+
Returns
Child List.
+ +
+
+ +

◆ GetContextMenu()

+ +
+
+ + + + + +
+ + + + + + + + +
virtual bool Element::GetContextMenu (wxMenu & menu)
+
+inlinevirtual
+
+ +

Get the element contex menu.

+
Parameters
+ + +
menumenu that will be inserted the element itens.
+
+
+
Returns
True if was possible to build the menu, false otherwise.
+ +

Reimplemented in SyncGenerator, SyncMotor, Transformer, Bus, Line, Load, Branch, Capacitor, Inductor, and IndMotor.

+ +
+
+ +

◆ GetCopy()

+ +
+
+ + + + + +
+ + + + + + + +
virtual Element* Element::GetCopy ()
+
+inlinevirtual
+
+ +

Get a the element copy.

+
Returns
Copy of the element.
+ +

Reimplemented in SyncGenerator, SyncMotor, Transformer, Text, Bus, Line, IOControl, TransferFunction, ConnectionLine, Sum, Gain, Load, Limiter, RateLimiter, Constant, Exponential, IndMotor, Multiplier, Capacitor, and Inductor.

+ +
+
+ +

◆ GetHeight()

+ +
+
+ + + + + +
+ + + + + + + +
double Element::GetHeight () const
+
+inline
+
+ +

Get the element height.

+
Returns
Element height.
+ +
+
+ +

◆ GetID()

+ +
+
+ + + + + +
+ + + + + + + +
virtual int Element::GetID () const
+
+inlinevirtual
+
+ +

Get the element ID.

+
Returns
Element ID.
+ +
+
+ +

◆ GetParentList()

+ +
+
+ + + + + +
+ + + + + + + +
virtual std::vector<Element*> Element::GetParentList () const
+
+inlinevirtual
+
+ +

Get the parent list.

+
Returns
Parent list.
+ +
+
+ +

◆ GetPointList()

+ +
+
+ + + + + +
+ + + + + + + +
virtual std::vector<wxPoint2DDouble> Element::GetPointList () const
+
+inlinevirtual
+
+ +

Get the list of points that connect the element to bus.

+
Returns
List of points.
+ +
+
+ +

◆ GetPosition()

+ +
+
+ + + + + +
+ + + + + + + +
wxPoint2DDouble Element::GetPosition () const
+
+inline
+
+ +

Get the element position.

+
Returns
Element position.
+ +
+
+ +

◆ GetRect()

+ +
+
+ + + + + +
+ + + + + + + +
wxRect2DDouble Element::GetRect () const
+
+inline
+
+ +

Get the element rectangle.

+
Returns
Element rectangle.
+ +
+
+ +

◆ GetRotationAngle()

+ +
+
+ + + + + +
+ + + + + + + +
double Element::GetRotationAngle () const
+
+inline
+
+ +

Get the angle of rotation.

+
Returns
Rotation angle.
+ +
+
+ +

◆ GetTipText()

+ +
+
+ + + + + +
+ + + + + + + +
virtual wxString Element::GetTipText () const
+
+inlinevirtual
+
+ +

Get the tip text.

+
Returns
Tip text.
+ +

Reimplemented in SyncGenerator, SyncMotor, Transformer, Bus, Line, Load, Capacitor, Inductor, and IndMotor.

+ +
+
+ +

◆ GetWidth()

+ +
+
+ + + + + +
+ + + + + + + +
double Element::GetWidth () const
+
+inline
+
+ +

Get the element width.

+
Returns
Element width.
+ +
+
+ +

◆ Intersects()

+ +
+
+ + + + + +
+ + + + + + + + +
virtual bool Element::Intersects (wxRect2DDouble rect) const
+
+pure virtual
+
+ +

Check if the element's rect intersects other rect.

+
Parameters
+ + +
rectRect to check intersection.
+
+
+ +

Implemented in Transformer, Text, Bus, Line, IOControl, TransferFunction, Capacitor, Inductor, Branch, Machines, Constant, Gain, Sum, ConnectionLine, Exponential, Limiter, Multiplier, RateLimiter, and Shunt.

+ +
+
+ +

◆ IntFromString()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bool Element::IntFromString (wxWindow * parent,
wxString strValue,
int & value,
wxString errorMsg 
)
+
+static
+
+ +

Convert a string to int. Show a error message if the conversion fail.

+
Parameters
+ + + + + +
parentMessage box parent.
strValueString value to be converted.
valueInt value converted.
errorMsgError message.
+
+
+ +
+
+ +

◆ IsDragging()

+ +
+
+ + + + + +
+ + + + + + + +
bool Element::IsDragging () const
+
+inline
+
+ +

Checks if the element is being dragged.

+
Returns
True if is being dragged, false otherwise.
+ +
+
+ +

◆ IsOnline()

+ +
+
+ + + + + +
+ + + + + + + +
bool Element::IsOnline () const
+
+inline
+
+ +

Checks if the element is online or offline.

+
Returns
True if online, false if offline.
+ +
+
+ +

◆ IsPickboxShown()

+ +
+
+ + + + + +
+ + + + + + + +
bool Element::IsPickboxShown () const
+
+inline
+
+ +

Checks if the pickbox is shown.

+
Returns
True if the pickbox is show, false otherwise.
+ +
+
+ +

◆ IsSelected()

+ +
+
+ + + + + +
+ + + + + + + +
bool Element::IsSelected () const
+
+inline
+
+ +

Checks if the element is selected.

+
Returns
True if selected, false otherwise.
+ +
+
+ +

◆ Move()

+ +
+
+ + + + + +
+ + + + + + + + +
void Element::Move (wxPoint2DDouble position)
+
+virtual
+
+ +

Move the element other position.

+
Parameters
+ + +
positionPosition that the element will be moved. Use StartMove(wxPoint2DDouble position) before start moving.
+
+
+ +

Reimplemented in Transformer, ControlElement, Line, Gain, Machines, ConnectionLine, Branch, and Shunt.

+ +
+
+ +

◆ MoveNode()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual void Element::MoveNode (Elementparent,
wxPoint2DDouble position 
)
+
+inlinevirtual
+
+ +

Move a node. StartMove(wxPoint2DDouble position) before start moving.

+
Parameters
+ + + +
parentNode's parent.
positionNew node position.
+
+
+ +

Reimplemented in Transformer, Line, Machines, Branch, and Shunt.

+ +
+
+ +

◆ MovePickbox()

+ +
+
+ + + + + +
+ + + + + + + + +
virtual void Element::MovePickbox (wxPoint2DDouble position)
+
+inlinevirtual
+
+ +

Move the pickbox.

+
Parameters
+ + +
positionposition that the pickbox will be moved.
+
+
+ +

Reimplemented in Bus, Line, and Branch.

+ +
+
+ +

◆ NodeContains()

+ +
+
+ + + + + +
+ + + + + + + + +
virtual bool Element::NodeContains (wxPoint2DDouble position)
+
+inlinevirtual
+
+ +

Check if a node contains a point. If contains, set the attributes related to node movement.

+
Parameters
+ + +
positionPosition tested.
+
+
+
Returns
True if at least one node contains the position, false otherwise.
+ +

Reimplemented in Machines, Shunt, and Branch.

+ +
+
+ +

◆ PickboxContains()

+ +
+
+ + + + + +
+ + + + + + + + +
virtual bool Element::PickboxContains (wxPoint2DDouble position)
+
+inlinevirtual
+
+ +

Check if a pickbox contains a point. If contains the attributes related to pickbox movement will be calculated.

+
Parameters
+ + +
positionPosition to be checked.
+
+
+
Returns
True if the element constains the pickbox, false otherwise.
+ +

Reimplemented in Bus, Line, and Branch.

+ +
+
+ +

◆ PointToLineDistance()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
double Element::PointToLineDistance (wxPoint2DDouble point,
int * segmentNumber = NULL 
) const
+
+virtual
+
+ +

Calculate the distance between a line (formed by point list) and a point.

+
Parameters
+ + + +
pointorigin point.
segmentNumberSotores the segment number clicked
+
+
+
Returns
The distance between the point and the line.
+ +
+
+ +

◆ RemoveChild()

+ +
+
+ + + + + +
+ + + + + + + + +
void Element::RemoveChild (Elementchild)
+
+virtual
+
+ +

Remove a child from the list.

+
Parameters
+ + +
childChild to remove.
+
+
+ +
+
+ +

◆ RemoveParent()

+ +
+
+ + + + + +
+ + + + + + + + +
virtual void Element::RemoveParent (Elementparent)
+
+inlinevirtual
+
+ +

Remove a parent.

+
Parameters
+ + +
parentParent to be removed.
+
+
+ +

Reimplemented in Machines, Branch, Shunt, and ConnectionLine.

+ +
+
+ +

◆ ReplaceChild()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void Element::ReplaceChild (ElementoldChild,
ElementnewChild 
)
+
+virtual
+
+ +

Replace a child from the list.

+
Parameters
+ + + +
oldChildOld child.
newChildNew child.
+
+
+ +
+
+ +

◆ ReplaceParent()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void Element::ReplaceParent (ElementoldParent,
ElementnewParent 
)
+
+virtual
+
+ +

Replace a parent.

+
Parameters
+ + + +
oldParentParent to be replaced.
newParentNew parent.
+
+
+ +
+
+ +

◆ Rotate()

+ +
+
+ + + + + +
+ + + + + + + + +
virtual void Element::Rotate (bool clockwise = true)
+
+inlinevirtual
+
+ +

Rotate the element.

+
Parameters
+ + +
clockwiseTrue to rotate clockwise, false to rotate counter-clockwise.
+
+
+ +

Reimplemented in Transformer, Text, Bus, Load, IOControl, Machines, TransferFunction, Capacitor, Inductor, Constant, Gain, Sum, Exponential, Limiter, Multiplier, and RateLimiter.

+ +
+
+ +

◆ RotateAtPosition()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
wxPoint2DDouble Element::RotateAtPosition (wxPoint2DDouble pointToRotate,
double angle,
bool degrees = true 
) const
+
+virtual
+
+ +

Rotate a point as element position being the origin.

+
Parameters
+ + + + +
pointToRotatePoint that will be rotated.
angleAngle of rotation.
degreesTrue if the angle is in degrees, false if radians.
+
+
+ +
+
+ +

◆ RotatedRectanglesIntersects()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bool Element::RotatedRectanglesIntersects (wxRect2DDouble rect1,
wxRect2DDouble rect2,
double angle1,
double angle2 
) const
+
+virtual
+
+ +

Check if two roteted rectangles intersect.

+
Parameters
+ + + + + +
rect1First rect.
rect2Second rect.
angle1Rotation algle of first rectangle.
angle2Rotation angle of second rectangle.
+
+
+ +
+
+ +

◆ RotateNode()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual void Element::RotateNode (Elementparent,
bool clockwise = true 
)
+
+inlinevirtual
+
+ +

Rotate a node.

+
Parameters
+ + + +
parentNode's parent.
clockwiseTrue to rotate clockwise, false to rotate counter-clockwise.
+
+
+ +

Reimplemented in Transformer, Line, Branch, Machines, and Shunt.

+ +
+
+ +

◆ SetAngle()

+ +
+
+ + + + + +
+ + + + + + + + +
void Element::SetAngle (double angle)
+
+inline
+
+ +

Set element angle.

+
Parameters
+ + +
angleAngle value in degrees.
+
+
+ +
+
+ +

◆ SetBorderSize()

+ +
+
+ + + + + +
+ + + + + + + + +
void Element::SetBorderSize (double borderSize)
+
+inline
+
+ +

Set the size of the border (shown in selected elements).

+
Parameters
+ + +
borderSizeBorder size.
+
+
+ +
+
+ +

◆ SetDragging()

+ +
+
+ + + + + +
+ + + + + + + + +
void Element::SetDragging (bool dragging = true)
+
+inline
+
+ +

Set if the element are being dragged.

+
Parameters
+ + +
draggingTrue if is dragging, false otherwise.
+
+
+ +
+
+ +

◆ SetHeight()

+ +
+
+ + + + + +
+ + + + + + + + +
void Element::SetHeight (double height)
+
+inline
+
+ +

Set element height.

+
Parameters
+ + +
heightHeight value.
+
+
+ +
+
+ +

◆ SetID()

+ +
+
+ + + + + +
+ + + + + + + + +
virtual void Element::SetID (int id)
+
+inlinevirtual
+
+ +

Set the element ID.

+
Parameters
+ + +
idElement ID.
+
+
+ +
+
+ +

◆ SetNodeParent()

+ +
+
+ + + + + +
+ + + + + + + + +
virtual bool Element::SetNodeParent (Elementparent)
+
+inlinevirtual
+
+ +

Set a perent to the node. If all conditions are met, a new parent are added to the element and the points related to the nodes will be calculated.

+
Parameters
+ + +
parentNode parent.
+
+
+
Returns
True if was possible to set the parent.
+ +

Reimplemented in Transformer, Line, Machines, Shunt, and Branch.

+ +
+
+ +

◆ SetOnline()

+ +
+
+ + + + + + + + +
bool Element::SetOnline (bool online = true)
+
+ +

Set if the element is online or offline.

+
Parameters
+ + +
onlineTrue if online, false if offline.
+
+
+ +
+
+ +

◆ SetPointList()

+ +
+
+ + + + + +
+ + + + + + + + +
virtual void Element::SetPointList (std::vector< wxPoint2DDouble > pointList)
+
+inlinevirtual
+
+ +

Set the list of points that connect the element to the bus.

+
Parameters
+ + +
pointListList of points.
+
+
+ +

Reimplemented in Line.

+ +
+
+ +

◆ SetPosition()

+ +
+
+ + + + + + + + +
void Element::SetPosition (const wxPoint2DDouble position)
+
+ +

Set the element position and update the rectangle.

+
Parameters
+ + +
positionPosition value.
+
+
+ +
+
+ +

◆ SetSelected()

+ +
+
+ + + + + +
+ + + + + + + + +
void Element::SetSelected (bool selected = true)
+
+inline
+
+ +

Set element selection.

+
Parameters
+ + +
selectedTrue if selected, false otherwise.
+
+
+ +
+
+ +

◆ SetWidth()

+ +
+
+ + + + + +
+ + + + + + + + +
void Element::SetWidth (double width)
+
+inline
+
+ +

Set element width.

+
Parameters
+ + +
widthWidth value.
+
+
+ +
+
+ +

◆ ShowForm()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual bool Element::ShowForm (wxWindow * parent,
Elementelement 
)
+
+inlinevirtual
+
+ +

Show element data form.

+
Parameters
+ + + +
parentForm parent
elementElement that will be edited.
+
+
+
Returns
True if the form is shown, false otherwise.
+ +

Reimplemented in SyncMotor, SyncGenerator, Transformer, Bus, Line, Load, Capacitor, Inductor, IOControl, IndMotor, TransferFunction, Constant, Gain, Sum, Exponential, Limiter, Multiplier, and RateLimiter.

+ +
+
+ +

◆ ShowPickbox()

+ +
+
+ + + + + +
+ + + + + + + + +
void Element::ShowPickbox (bool showPickbox = true)
+
+inline
+
+ +

Set if the pickbox is shown.

+
Parameters
+ + +
showPickboxTrue if show, false otherwise.
+
+
+ +
+
+ +

◆ StartMove()

+ +
+
+ + + + + +
+ + + + + + + + +
void Element::StartMove (wxPoint2DDouble position)
+
+virtual
+
+ +

Update the element attributes related to the movement.

+
Parameters
+ + +
positionStart move position.
+
+
+ +

Reimplemented in Transformer, ControlElement, Line, Machines, ConnectionLine, Shunt, and Branch.

+ +
+
+ +

◆ StringFromDouble()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
wxString Element::StringFromDouble (double value,
int minDecimal = 1 
)
+
+static
+
+ +

Convert a double value to string.

+
Parameters
+ + + +
valueValue to be converted.
minDecimalMinimum number of decimal places.
+
+
+ +
+
+ +

◆ WorldToScreen() [1/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
wxPoint2DDouble Element::WorldToScreen (wxPoint2DDouble translation,
double scale,
double offsetX = 0.0,
double offsetY = 0.0 
) const
+
+virtual
+
+ +

Convert the element position to screen position.

+
Parameters
+ + + + + +
translationSystem translation.
scaleSystem scale
offsetXOffset in X axis.
offsetYOffset if Y axis.
+
+
+ +
+
+ +

◆ WorldToScreen() [2/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
wxPoint2DDouble Element::WorldToScreen (wxPoint2DDouble position,
wxPoint2DDouble translation,
double scale,
double offsetX = 0.0,
double offsetY = 0.0 
) const
+
+virtual
+
+ +

Convert a generic position to screen position.

+
Parameters
+ + + + + + +
positionPosition to be converted.
translationSystem translation.
scaleSystem scale.
offsetXOffset in X axis.
offsetYOffset in Y axis.
+
+
+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + -- cgit