Model

Everything that exists in a project is represented by a model class, including the project itself. A model class contains those attributes that remain the same regardless of the format in which something is accessed. For example, the model class of an object does not contain information about whether the object is selected for editing, because that is only relevant inside the graphical editor. All model classes reside in files under the src/model/ directory or one of its subdirectories.

Entity

Overview

Inheritance graph

../../_images/classEntity__inherit__graph.svg

An entity is an object that can have metadata associated with it. The following entities are defined: Project, Sheet, CompositeObject, and all of their subclasses. Note that primitive objects are never entities.

class Entity

Subclassed by CompositeObject, Project, Sheet

Public Functions

explicit Entity(Entity *parent = nullptr)
virtual ~Entity() = default
VariableSet getVariables() const

Project

A project is little more than a collection of sheets (of paper) and some properties. It is also an Entity.

class Project : public Entity

Public Functions

Project()
virtual Entity *getParent() const = delete
virtual void setParent() const = delete

Sheet

class Sheet : public Entity

Public Functions

int getIndex()
virtual Project *getParent() const
void setHeader(Header *header, bool destroy = true)

Object

Overview

Inheritance graph

../../_images/classObject__inherit__graph.svg

Collaboration graph

_build/html/doxygen/classObject__coll__graph.svg

All objects are derived from the base class Object.

class Object

Subclassed by CompositeObject, Line, Rect, Terminal, Text

Public Functions

virtual ~Object() = default
virtual QPointF getPos() const = 0
virtual void setPos(const QPointF &pos) = 0

Primitive objects

Objects that directly inherit from the class Object (apart from CompositeObject) are primitive objects. Currently, the following primitive objects are defined:

Composite objects

Objects like electrical devices consist of multiple primitive objects such as lines, rectangles, etc. Such objects are called composite objects. They are all derived from the class CompositeObject, which in turn inherits Object.

class CompositeObject : public Object, public Entity

Subclassed by Component, Corner, Header, ObjectArray

Public Functions

CompositeObject(const CompositeObject &obj)
virtual QPointF getPos() const override
virtual void setPos(const QPointF &pos) override
virtual void remove(Object *obj)

Variables

For familiarity with the concept of variables, see Variables in the user manual.

struct Variable

Public Members

QStringList names

Public Static Functions

static QString allowedPatterns()
static Variable find(const VariableSet &list, QString name)
static QString substitute(QString str, const VariableSet &variableSet)