wiRedPanda
Logic Circuit Simulator
Loading...
Searching...
No Matches
SelectionCapabilities.h
Go to the documentation of this file.
1// Copyright 2015 - 2026, GIBIS-UNIFESP and the wiRedPanda contributors
2// SPDX-License-Identifier: GPL-3.0-or-later
3
7
8#pragma once
9
10#include <QList>
11
12#include "App/Core/Enums.h"
13
14class GraphicElement;
15
25 // --- Feature flags (AND-reduced: true only if every selected element has the feature) ---
26
27 bool hasAudioBox = false;
28 bool hasAudio = false;
29 bool hasColors = false;
30 bool hasDelay = false;
31 bool hasElements = false;
32 bool hasFrequency = false;
33 bool hasLabel = false;
34 bool hasOnlyInputs = false;
35 bool hasLatchedValue = false;
36 bool hasWirelessMode = false;
37 bool hasTrigger = false;
38 bool hasTruthTable = false;
39 bool hasVolume = false;
40
41 // --- Embedded IC flags ---
42
43 bool isFileBacked = false;
44 bool isEmbedded = false;
45
46 // --- Mutability flags (derived from port count ranges across the selection) ---
47
48 bool canChangeAppearance = false;
49 bool canChangeInputSize = false;
50 bool canChangeOutputSize = false;
51 bool canMorph = false;
52
53 // --- Consensus flags (true when all selected elements share the same value) ---
54
55 bool hasSameAudio = false;
56 bool hasSameColors = false;
57 bool hasSameDelay = false;
58 bool hasSameFrequency = false;
59 bool hasSameInputSize = false;
60 bool hasSameLabel = false;
61 bool hasSameOutputSize = false;
62 bool hasSameOutputValue = false;
63 bool hasSameTrigger = false;
64 bool hasSameType = false;
65 bool hasSameVolume = false;
66
67 // --- Derived state ---
68
69 bool sameCheckState = false;
75 ElementType elementType = ElementType::Unknown;
76};
77
83SelectionCapabilities computeCapabilities(const QList<GraphicElement *> &elements);
Central enumeration types for element types, groups, and signal status.
Enums::ElementType ElementType
Definition Enums.h:107
SelectionCapabilities computeCapabilities(const QList< GraphicElement * > &elements)
Computes the SelectionCapabilities for a list of selected elements.
Abstract base class for all graphical circuit elements in wiRedPanda.
Computed capabilities and consensus state of the current element selection.