2 #include "Clustering.h"
14 #include "GLM/gtx.hpp"
15 #include "GLM/gtc.hpp"
16 #include "GLM/gtx/type_ptr.hpp"
100 const QVector<TPoint>&
points()
const;
199 void DoClustering(
int K);
202 void updateActionObjectType(
int type);
216 std::vector<TFObjects> tf_objects;
222 inline QRectF pointBoundingRect(
int i)
const;
227 inline QRectF insertBoundingRect(
int i)
const;
234 void movePoint(
int i,
const TPoint &newPos,
bool emitChange =
true);
240 QVector<TPoint>* m_points;
250 ConnectionType m_connectionType;
252 QVector<uint> m_locks;
268 QPen m_connectionPen;
291 QPainterPath drawing_path;
292 glm::vec2 start_rectangle;
293 glm::vec2 act_rectangle;
298 inline QRectF TransferPoints::pointBoundingRect(
int i)
const
301 TPoint p = m_points[mode].at(i);
302 double w = m_pointSize.width();
303 double h = m_pointSize.height();
304 double x = p.x() - w / 2;
305 double y = p.y() - h / 2;
306 return QRectF(x, y, w, h);
309 inline QRectF TransferPoints::insertBoundingRect(
int i)
const
312 TPoint p = m_points[mode].at(i);
313 double w = m_pointSize.width() * 2.0;
314 double h = m_pointSize.height() * 2.0;
315 double x = p.x() - w / 2;
316 double y = p.y() - h / 2;
317 return QRectF(x, y, w, h);
322 if (m_bounds.isEmpty())
323 return m_widget->rect();