12 #include "ui_CircuitDiagram.h"
13 #include "DynExpDefinitions.h"
27 using NodeMapType = std::unordered_map<DynExp::ItemIDType, CircuitDiagramItem>;
28 using NodeListType = std::vector<typename NodeMapType::mapped_type*>;
109 QGraphicsSimpleTextItem*
Label =
nullptr;
111 std::vector<QGraphicsPathItem*>
Links;
151 virtual void wheelEvent(QWheelEvent* Event)
override;
209 Ui::CircuitDiagram
ui;
210 std::unique_ptr<QGraphicsScene>
Scene;
Implementation of DynExp objects as the base for derived resources and implementation of the object p...
QGraphicsPathItem * Frame
size_t GetNumLinkedItems()
QGraphicsEllipseItem * OutputSocket
std::vector< LinkedItemType > LinkedItems
QGraphicsSimpleTextItem * Label
QString NetworkAddress
String of a network address and a network port indicating whether this item connects to a network....
QGraphicsPathItem * StateFrame
QTreeWidgetItem * TreeWidgetItem
Pointer to QTreeWidgetItem listed in main window's tree view. Pointer may be dereferenced after this ...
CircuitDiagramItem(QTreeWidgetItem *TreeWidgetItem)
QGraphicsSimpleTextItem * StateLabel
QGraphicsPathItem * NetworkLink
void InsertLinks(const DynExp::ParamsBase::ObjectLinkParamsType &ObjectLinkParams, const DynExp::DynExpCore &DynExpCore, NodeMapType *HardwareAdapterNodes, NodeMapType *InstrumentNodes)
QPointF TopLeftPos
Node's top left position in the diagram in painting area's coordinates.
const bool Empty
Indicates whether this item points to an existing object.
std::vector< ParamGraphicsItemsType > ParamGraphicsItems
QGraphicsPixmapItem * ItemPixmap
QGraphicsPixmapItem * NetworkPixmap
QGraphicsPixmapItem * StatePixmap
std::vector< LinkedParamType > LinkedParams
List of linked params making use of this item.
size_t ParamGraphicsItemIndex
QGraphicsPathItem * ItemFrame
std::vector< QGraphicsPathItem * > Links
QGraphicsSimpleTextItem * ItemLabel
std::string_view LinkTitle
std::vector< QGraphicsEllipseItem * > Sockets
static constexpr int AdditionalHeightPerParam
static QLinearGradient GetGrayLinearGradient()
bool Redraw(const DynExp::DynExpCore &DynExpCore)
Rebuilds the complete circuit diagram.
NodeMapType HardwareAdapterNodes
static constexpr int InnerWidth
QTreeWidgetItem * SelectedTreeWidgetItem
static constexpr int StateIconSize
void UpdateItem(CircuitDiagramItem &Item)
QTreeWidgetItem * GetSelectedEntry()
static constexpr int ParamSep
void OnContextMenuRequested(QPoint Position)
static constexpr int InnerMarginTop
static constexpr double ZoomFactor
std::unordered_map< DynExp::ItemIDType, CircuitDiagramItem > NodeMapType
static constexpr int CornerRoundingRadius
static constexpr int TreeWidgetParentTypeColumn
std::vector< typename NodeMapType::mapped_type * > NodeListType
static constexpr int NetworkIconDistance
void RenderLinks(CircuitDiagramItem &Item)
bool UpdateStates(const DynExp::DynExpCore &DynExpCore)
Updates the items' states shown in the circuit diagram displayed currently.
CircuitDiagram(QWidget *parent)
void RenderItem(CircuitDiagramItem &Item, bool DrawOutputSocket)
static constexpr int TreeWidgetItemTypeColumn
static constexpr int TreeWidgetItemStateColumn
NodeMapType InstrumentNodes
static const QColor SocketInnerColor
virtual void mouseDoubleClickEvent(QMouseEvent *Event) override
std::unique_ptr< QGraphicsScene > Scene
static constexpr int TypeIconSize
static constexpr int InnerStartHeight
static constexpr int IconMargin
static constexpr int SocketDiameter
static constexpr int NodeHSep
static constexpr int InnerMargin
static constexpr int SocketPenLineWidth
static constexpr int NodeVSep
static constexpr int TreeWidgetItemNameColumn
static const QColor SocketOuterColor
virtual void wheelEvent(QWheelEvent *Event) override
static constexpr int InnerPenLineWidth
void RefineBySimulatedAnnealing(GraphType &Graph)
void BuildTree(const DynExp::DynExpCore &DynExpCore)
static constexpr int OuterPenLineWidth
int TransformIconSize(int Size) const
static constexpr int InnerMarginBottom
DynExp's core class acts as the interface between the user interface and DynExp's internal data like ...
std::vector< std::reference_wrapper< LinkBase > > ObjectLinkParamsType
Type of a list of all owned object link parameters.
DynExp's main namespace contains the implementation of DynExp including classes to manage resources (...
CircuitDiagramItem * Item
LinkedItemType(CircuitDiagramItem *Item) noexcept
LinkedItemType() noexcept
bool operator==(const GraphType &Other) const
double EvaluateEnergy() const
NodeListType HardwareAdapters
bool operator!=(const GraphType &Other) const
double DistanceTo(const GraphType &Other) const