LibrePCB Developers Documentation
Trace Class Referencefinal

The Trace class represents a trace within a board. More...

#include <trace.h>

+ Inheritance diagram for Trace:
+ Collaboration diagram for Trace:

Public Types

enum  Event
 
typedef Slot< Trace, EventOnEditedSlot
 

Public Member Functions

 Trace ()=delete
 
 Trace (const Trace &other) noexcept
 
 Trace (const Uuid &uuid, const Trace &other) noexcept
 
 Trace (const Uuid &uuid, const GraphicsLayerName &layer, const PositiveLength &width, const TraceAnchor &start, const TraceAnchor &end) noexcept
 
 Trace (const SExpression &node, const Version &fileFormat)
 
 ~Trace () noexcept
 
const UuidgetUuid () const noexcept
 
const GraphicsLayerNamegetLayer () const noexcept
 
const PositiveLengthgetWidth () const noexcept
 
const TraceAnchorgetStartPoint () const noexcept
 
const TraceAnchorgetEndPoint () const noexcept
 
bool setUuid (const Uuid &uuid) noexcept
 
bool setLayer (const GraphicsLayerName &layer) noexcept
 
bool setWidth (const PositiveLength &width) noexcept
 
bool setStartPoint (const TraceAnchor &start) noexcept
 
bool setEndPoint (const TraceAnchor &end) noexcept
 
void serialize (SExpression &root) const override
 Serialize the object into an existing S-Expression node. More...
 
bool operator== (const Trace &rhs) const noexcept
 
bool operator!= (const Trace &rhs) const noexcept
 
Traceoperator= (const Trace &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< Trace, EventonEdited
 

Private Attributes

Uuid mUuid
 
GraphicsLayerName mLayer
 
PositiveLength mWidth
 
TraceAnchor mStart
 
TraceAnchor mEnd
 

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 Trace class represents a trace within a board.

The main purpose of this class is to serialize and deserialize traces.

Member Typedef Documentation

◆ OnEditedSlot

Member Enumeration Documentation

◆ Event

enum Event
strong
Enumerator
UuidChanged 
LayerChanged 
WidthChanged 
StartPointChanged 
EndPointChanged 

Constructor & Destructor Documentation

◆ Trace() [1/5]

Trace ( )
delete

◆ Trace() [2/5]

Trace ( const Trace other)
noexcept

◆ Trace() [3/5]

Trace ( const Uuid uuid,
const Trace other 
)
noexcept

◆ Trace() [4/5]

Trace ( const Uuid uuid,
const GraphicsLayerName layer,
const PositiveLength width,
const TraceAnchor start,
const TraceAnchor end 
)
noexcept

◆ Trace() [5/5]

Trace ( const SExpression node,
const Version fileFormat 
)

◆ ~Trace()

~Trace ( )
noexcept

Member Function Documentation

◆ getUuid()

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

◆ getLayer()

const GraphicsLayerName& getLayer ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ getWidth()

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

◆ getStartPoint()

const TraceAnchor& getStartPoint ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ getEndPoint()

const TraceAnchor& getEndPoint ( ) const
inlinenoexcept
+ 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:

◆ setLayer()

bool setLayer ( const GraphicsLayerName layer)
noexcept
+ Here is the caller graph for this function:

◆ setWidth()

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

◆ setStartPoint()

bool setStartPoint ( const TraceAnchor start)
noexcept
+ Here is the caller graph for this function:

◆ setEndPoint()

bool setEndPoint ( const TraceAnchor end)
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 Trace rhs) const
noexcept

◆ operator!=()

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

◆ operator=()

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

Member Data Documentation

◆ onEdited

Signal<Trace, Event> onEdited

◆ mUuid

Uuid mUuid
private

◆ mLayer

GraphicsLayerName mLayer
private

◆ mWidth

PositiveLength mWidth
private

◆ mStart

TraceAnchor mStart
private

◆ mEnd

TraceAnchor mEnd
private

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