LibrePCB Developers Documentation
Via Class Referencefinal

The Via class represents a via of a board. More...

#include <via.h>

+ Inheritance diagram for Via:
+ Collaboration diagram for Via:

Public Types

enum  Event
 
enum  Shape
 
typedef Slot< Via, EventOnEditedSlot
 

Public Member Functions

 Via ()=delete
 
 Via (const Via &other) noexcept
 
 Via (const Uuid &uuid, const Via &other) noexcept
 
 Via (const Uuid &uuid, const Point &position, Shape shape, const PositiveLength &size, const PositiveLength &drillDiameter) noexcept
 
 Via (const SExpression &node)
 
 ~Via () noexcept
 
const UuidgetUuid () const noexcept
 
const PointgetPosition () const noexcept
 
Shape getShape () const noexcept
 
const PositiveLengthgetSize () const noexcept
 
const PositiveLengthgetDrillDiameter () const noexcept
 
Path getOutline (const Length &expansion=Length(0)) const noexcept
 
Path getSceneOutline (const Length &expansion=Length(0)) const noexcept
 
QPainterPath toQPainterPathPx (const Length &expansion=Length(0)) const noexcept
 
bool setUuid (const Uuid &uuid) noexcept
 
bool setPosition (const Point &position) noexcept
 
bool setShape (Shape shape) noexcept
 
bool setSize (const PositiveLength &size) noexcept
 
bool setDrillDiameter (const PositiveLength &diameter) noexcept
 
void serialize (SExpression &root) const override
 Serialize the object into an existing S-Expression node. More...
 
bool operator== (const Via &rhs) const noexcept
 
bool operator!= (const Via &rhs) const noexcept
 
Viaoperator= (const Via &rhs) noexcept
 
- Public Member Functions inherited from SerializableObject
 SerializableObject () noexcept
 
virtual ~SerializableObject () noexcept
 
SExpression serializeToDomElement (const QString &name) const
 Serialize the object to a new S-Expression node. More...
 

Public Attributes

Signal< Via, EventonEdited
 

Private Attributes

Uuid mUuid
 
Point mPosition
 
Shape mShape
 
PositiveLength mSize
 
PositiveLength mDrillDiameter
 

Additional Inherited Members

- Static Public Member Functions inherited from SerializableObject
template<typename T >
static void serializeObjectContainer (SExpression &root, const T &container, const QString &itemName)
 
template<typename T >
static void serializePointerContainer (SExpression &root, const T &container, const QString &itemName)
 
template<typename T >
static void serializePointerContainerUuidSorted (SExpression &root, const T &container, const QString &itemName)
 

Detailed Description

The Via class represents a via of a board.

The main purpose of this class is to serialize and deserialize vias contained in boards.

Member Typedef Documentation

◆ OnEditedSlot

Member Enumeration Documentation

◆ Event

enum Event
strong
Enumerator
UuidChanged 
PositionChanged 
ShapeChanged 
SizeChanged 
DrillDiameterChanged 

◆ Shape

enum Shape
strong
Enumerator
Round 
Square 
Octagon 

Constructor & Destructor Documentation

◆ Via() [1/5]

Via ( )
delete

◆ Via() [2/5]

Via ( const Via other)
noexcept

◆ Via() [3/5]

Via ( const Uuid uuid,
const Via other 
)
noexcept

◆ Via() [4/5]

Via ( const Uuid uuid,
const Point position,
Shape  shape,
const PositiveLength size,
const PositiveLength drillDiameter 
)
noexcept

◆ Via() [5/5]

Via ( const SExpression node)
explicit

◆ ~Via()

~Via ( )
noexcept

Member Function Documentation

◆ getUuid()

const Uuid& getUuid ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ getPosition()

const Point& getPosition ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ getShape()

Shape getShape ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ getSize()

const PositiveLength& getSize ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ getDrillDiameter()

const PositiveLength& getDrillDiameter ( ) const
inlinenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getOutline()

Path getOutline ( const Length expansion = Length(0)) const
noexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSceneOutline()

Path getSceneOutline ( const Length expansion = Length(0)) const
noexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toQPainterPathPx()

QPainterPath toQPainterPathPx ( const Length expansion = Length(0)) const
noexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setUuid()

bool setUuid ( const Uuid uuid)
noexcept
+ Here is the caller graph for this function:

◆ setPosition()

bool setPosition ( const Point position)
noexcept
+ Here is the caller graph for this function:

◆ setShape()

bool setShape ( Shape  shape)
noexcept
+ Here is the caller graph for this function:

◆ setSize()

bool setSize ( const PositiveLength size)
noexcept
+ Here is the caller graph for this function:

◆ setDrillDiameter()

bool setDrillDiameter ( const PositiveLength diameter)
noexcept
+ Here is the caller graph for this function:

◆ serialize()

void serialize ( SExpression root) const
overridevirtual

Serialize the object into an existing S-Expression node.

This method inserts/appends all attributes and childs of the object to an existing S-Expression node. The content which already exists in the given S-Expression node will not be removed.

Note
The generated S-Expression node has always the format of the application's major version (it's not possible to generate DOMs of older versions).
Parameters
rootThe target DOM root node
Exceptions
ExceptionThis method throws an exception if an error occurs.

Implements SerializableObject.

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

◆ operator==()

bool operator== ( const Via rhs) const
noexcept
+ Here is the caller graph for this function:

◆ operator!=()

bool operator!= ( const Via rhs) const
inlinenoexcept
+ Here is the call graph for this function:

◆ operator=()

Via & operator= ( const Via rhs)
noexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ onEdited

Signal<Via, Event> onEdited

◆ mUuid

Uuid mUuid
private

◆ mPosition

Point mPosition
private

◆ mShape

Shape mShape
private

◆ mSize

PositiveLength mSize
private

◆ mDrillDiameter

PositiveLength mDrillDiameter
private

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