15 #ifndef BORNAGAIN_GUI_COREGUI_VIEWS_SAMPLEDESIGNER_SAMPLEVIEWALIGNER_H
16 #define BORNAGAIN_GUI_COREGUI_VIEWS_SAMPLEDESIGNER_SAMPLEVIEWALIGNER_H
19 #include <QModelIndex>
32 void alignSample(
const QModelIndex& parentIndex, QPointF reference = {},
33 bool force_alignment =
false);
36 void updateViews(
const QModelIndex& parentIndex = {});
Main class which represents SessionModel on graphics scene.
parent class for graphic representation of all ISampleNode's
Makes alignment of sample droped on graphics scene.
void advance()
Applies calculated positions to views.
void updateForces()
Calculates forces acting on all views for smart alignment.
void alignSample(SessionItem *item, QPointF reference={}, bool force_alignment=false)
Aligns sample starting from.
void smartAlign()
Spring based implified algorithm for smart alignment.
void calculateForces(IView *view)
Calculates forces acting on single view (simplified force directed spring algorithm) and deduce new p...
QList< IView * > m_views
list of all views which are subject to smart align
QList< IView * > getConnectedViews(IView *view)
Returns list of views connected with given view for the subsequent force calculation.
void updateViews(const QModelIndex &parentIndex={})
Forms list of all views which are subject for smart alignment (i.e.
QMap< IView *, QPointF > m_viewToPos
IView * getViewForIndex(const QModelIndex &index)
SampleViewAligner(DesignerScene *scene)