LibrePCB Developers Documentation
Loading...
Searching...
No Matches
si_image.h
Go to the documentation of this file.
1/*
2 * LibrePCB - Professional EDA for everyone!
3 * Copyright (C) 2013 LibrePCB Developers, see AUTHORS.md for contributors.
4 * https://librepcb.org/
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef LIBREPCB_CORE_SI_IMAGE_H
21#define LIBREPCB_CORE_SI_IMAGE_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "../../../geometry/image.h"
27#include "si_symbol.h"
28
29#include <QtCore>
30
31/*******************************************************************************
32 * Namespace / Forward Declarations
33 ******************************************************************************/
34namespace librepcb {
35
36class Schematic;
37
38/*******************************************************************************
39 * Class SI_Image
40 ******************************************************************************/
41
45class SI_Image final : public SI_Base {
46 Q_OBJECT
47
48public:
49 // Constructors / Destructor
50 SI_Image() = delete;
51 SI_Image(const SI_Image& other) = delete;
52 SI_Image(Schematic& schematic, const Image& image);
53 ~SI_Image() noexcept;
54
55 // Getters
56 const Uuid& getUuid() const noexcept { return mImage->getUuid(); }
57 const Point& getPosition() const noexcept { return mImage->getPosition(); }
58 const Angle& getRotation() const noexcept { return mImage->getRotation(); }
59 const std::shared_ptr<Image>& getImage() noexcept { return mImage; }
60 std::shared_ptr<const Image> getImage() const noexcept { return mImage; }
61
62 // General Methods
63 SI_Symbol* getSymbol() const noexcept { return mSymbol; }
64 void setSymbol(SI_Symbol* symbol) noexcept;
65 void addToSchematic() override;
66 void removeFromSchematic() override;
67
68 // Operator Overloadings
69 SI_Image& operator=(const SI_Image& rhs) = delete;
70
71private:
72 QPointer<SI_Symbol> mSymbol;
73 std::shared_ptr<Image> mImage;
74};
75
76/*******************************************************************************
77 * End of File
78 ******************************************************************************/
79
80} // namespace librepcb
81
82#endif
The Angle class is used to represent an angle (for example 12.75 degrees)
Definition angle.h:76
The Image class.
Definition image.h:49
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5....
Definition point.h:78
The Schematic Item Base (SI_Base) class.
Definition si_base.h:45
The SI_Image class represents an image in a schematic.
Definition si_image.h:45
const std::shared_ptr< Image > & getImage() noexcept
Definition si_image.h:59
const Angle & getRotation() const noexcept
Definition si_image.h:58
std::shared_ptr< Image > mImage
Definition si_image.h:73
SI_Image(const SI_Image &other)=delete
~SI_Image() noexcept
Definition si_image.cpp:42
std::shared_ptr< const Image > getImage() const noexcept
Definition si_image.h:60
void setSymbol(SI_Symbol *symbol) noexcept
Definition si_image.cpp:49
void removeFromSchematic() override
Definition si_image.cpp:64
SI_Image & operator=(const SI_Image &rhs)=delete
SI_Symbol * getSymbol() const noexcept
Definition si_image.h:63
void addToSchematic() override
Definition si_image.cpp:57
QPointer< SI_Symbol > mSymbol
Definition si_image.h:72
const Point & getPosition() const noexcept
Definition si_image.h:57
const Uuid & getUuid() const noexcept
Definition si_image.h:56
The SI_Symbol class.
Definition si_symbol.h:54
The Schematic class represents one schematic page of a project and is always part of a circuit.
Definition schematic.h:81
The Uuid class is a replacement for QUuid to get UUID strings without {} braces.
Definition uuid.h:56
Definition occmodel.cpp:77