BlockBusItem::PointInfo and BlockBusItem::pointInfo()

This commit is contained in:
2022-07-20 20:44:51 +03:00
parent 1eea9eb386
commit b6ebddb54e
2 changed files with 32 additions and 2 deletions

View File

@@ -33,6 +33,17 @@ public:
BlockBusItem(bool temp = false);
BlockBusItem(const BlockBusItem & other);
~BlockBusItem() {;}
struct QAD_BLOCKVIEW_EXPORT PointInfo {
enum Type {
tNone,
tNode, // point > 2 segments
tEndpoint,
tSegment
};
Type type = tNone;
BlockItemPin * pin = nullptr; // if tEndpoint and pin connected
};
void setGridStep(double gs) {grid_step = gs;}
void setEndpointsNumber(int num) {max_ep = num;}
@@ -66,6 +77,7 @@ public:
bool isBusSelected() const {return selSegment >= 0 || selPoint >= 0;}
QList<BlockItem * > connectedBlocks() const;
QList<BlockItemPin * > connectedPins() const;
PointInfo pointInfo(QPointF pos) const;
void setBusState(bool state);
bool busState() const {return state_ > 0;}
@@ -86,7 +98,7 @@ protected:
void updateGeometry();
bool checkDelete();
void emitAction(BlockItemBase::Action a);
void testPoint(QPointF pos, int * sel_point, int * sel_segment, bool for_trace = false);
void testPoint(QPointF pos, int * sel_point, int * sel_segment, bool for_trace = false) const;
int addPoint(const QPointF & point, bool update = true);
int segmentPointPair(int point, int * seg = 0) const;
int pointSegmentsCount(int point, QList<int> * segs = 0) const;