QElectroTech  0.70
Public Member Functions | Private Attributes | List of all members
DiagramPosition Class Reference

#include <diagramposition.h>

Public Member Functions

 DiagramPosition (const QString &="", unsigned int=0)
 
virtual ~DiagramPosition ()
 
QPointF position () const
 
void setPosition (const QPointF &)
 
QString toString ()
 
bool isOutOfBounds () const
 
unsigned int number () const
 
QString letter () const
 

Private Attributes

QString letter_
 
unsigned int number_
 
QPointF position_
 

Detailed Description

This class stores the position of an electrical element on its parent diagram. While exact coordinates can be stored for convenience, the concept of diagram position as implemented by this class simply designates the intersection between a column and a row, e.g. B2 or C4.

Definition at line 29 of file diagramposition.h.

Constructor & Destructor Documentation

◆ DiagramPosition()

DiagramPosition::DiagramPosition ( const QString &  letter = "",
unsigned int  number = 0 
)

Constructeur

Parameters
letterLettre(s) composant la position
numberNumero composant la position Si une chaine entierement invalide ou vide, ou bien un 0 est passe en parametre, il en resulte un objet DiagramPosition invalide, dont la methode isOutOfBounds renverra true.

Definition at line 29 of file diagramposition.cpp.

References letter(), letter_, number(), and number_.

◆ ~DiagramPosition()

DiagramPosition::~DiagramPosition ( )
virtual

Destructeur

Definition at line 39 of file diagramposition.cpp.

Member Function Documentation

◆ isOutOfBounds()

bool DiagramPosition::isOutOfBounds ( ) const
Returns
true si l'element est en dehors des bords du schema

Definition at line 75 of file diagramposition.cpp.

References letter_, and number_.

Referenced by toString().

◆ letter()

QString DiagramPosition::letter ( ) const
inline

Definition at line 42 of file diagramposition.h.

References letter_.

Referenced by DiagramPosition().

◆ number()

unsigned int DiagramPosition::number ( ) const
inline

Definition at line 41 of file diagramposition.h.

References number_.

Referenced by DiagramPosition().

◆ position()

QPointF DiagramPosition::position ( ) const
Returns
les coordonnees stockees dans cet objet, ou un QPointF nul sinon.

Definition at line 45 of file diagramposition.cpp.

References position_.

Referenced by setPosition().

◆ setPosition()

void DiagramPosition::setPosition ( const QPointF &  position)
Parameters
positionPosition a stocker dans cet objet

Definition at line 52 of file diagramposition.cpp.

References position(), and position_.

Referenced by Diagram::convertPosition().

◆ toString()

QString DiagramPosition::toString ( )
Returns
une representation textuelle de la position

Definition at line 59 of file diagramposition.cpp.

References isOutOfBounds(), letter_, and number_.

Member Data Documentation

◆ letter_

QString DiagramPosition::letter_
private

Definition at line 46 of file diagramposition.h.

Referenced by DiagramPosition(), isOutOfBounds(), letter(), and toString().

◆ number_

unsigned int DiagramPosition::number_
private

Definition at line 47 of file diagramposition.h.

Referenced by DiagramPosition(), isOutOfBounds(), number(), and toString().

◆ position_

QPointF DiagramPosition::position_
private

Definition at line 48 of file diagramposition.h.

Referenced by position(), and setPosition().


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