MCPcopy Create free account
hub / github.com/BehaviorTree/Groot / drawFilledConnectionPoints

Method drawFilledConnectionPoints

QtNodeEditor/src/NodePainter.cpp:188–230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186
187
188void
189NodePainter::
190drawFilledConnectionPoints(QPainter * painter,
191 NodeGeometry const & geom,
192 NodeState const & state,
193 NodeDataModel const * model)
194{
195 NodeStyle const& nodeStyle = model->nodeStyle();
196 auto const & connectionStyle = StyleCollection::connectionStyle();
197
198 auto diameter = nodeStyle.ConnectionPointDiameter;
199
200 for(PortType portType: {PortType::Out, PortType::In})
201 {
202 size_t n = state.getEntries(portType).size();
203
204 for (size_t i = 0; i < n; ++i)
205 {
206 QPointF p = geom.portScenePosition(i, portType);
207
208 if (!state.getEntries(portType)[i].empty())
209 {
210 auto const & dataType = model->dataType(portType, i);
211
212 if (connectionStyle.useDataDefinedColors())
213 {
214 QColor const c = connectionStyle.normalColor(dataType.id);
215 painter->setPen(c);
216 painter->setBrush(c);
217 }
218 else
219 {
220 painter->setPen(nodeStyle.FilledConnectionPointColor);
221 painter->setBrush(nodeStyle.FilledConnectionPointColor);
222 }
223
224 painter->drawEllipse(p,
225 diameter * 0.4,
226 diameter * 0.4);
227 }
228 }
229 }
230}
231
232
233void

Callers

nothing calls this directly

Calls 1

dataTypeMethod · 0.80

Tested by

no test coverage detected