15 #ifndef BORNAGAIN_GUI_COREGUI_VIEWS_SAMPLEDESIGNER_DESIGNERSCENE_H
16 #define BORNAGAIN_GUI_COREGUI_VIEWS_SAMPLEDESIGNER_DESIGNERSCENE_H
18 #include <QGraphicsScene>
20 #include <QModelIndex>
26 class QItemSelectionModel;
64 void onRowsInserted(
const QModelIndex& parent,
int first,
int last);
66 void onRowsRemoved(
const QModelIndex& parent,
int first,
int last);
80 void dropEvent(QGraphicsSceneDragDropEvent* event);
91 void updateViews(
const QModelIndex& parentIndex = {},
IView* parentView = 0);
98 QGraphicsSceneDragDropEvent* event);
Mime data for use with SampleDesigner drag and drop operations.
Main class which represents SessionModel on graphics scene.
void setLayerInterfaceLine(const QLineF &line={})
SampleModel * getSampleModel()
void updateViews(const QModelIndex &parentIndex={}, IView *parentView=0)
runs through all items recursively and updates corresponding views
void deleteSelectedItems()
propagates deletion of views on the scene to the model
void selectionModeChangeRequest(int)
void deleteViews(const QModelIndex &parentIndex)
runs recursively through model's item and schedules view removal
void setInstrumentModel(InstrumentModel *instrumentModel)
SampleModel * m_sampleModel
void setMaterialModel(MaterialModel *materialModel)
QItemSelectionModel * m_selectionModel
QLineF m_layer_interface_line
Foreground line representing appropriate interface during layer's movement.
void onSessionSelectionChanged(const QItemSelection &, const QItemSelection &)
propagate selection from model to scene
void onRowsInserted(const QModelIndex &parent, int first, int last)
NodeEditor * getNodeEditor()
void alignViews()
aligns SampleView's on graphical canvas
void drawForeground(QPainter *painter, const QRectF &rect)
shows appropriate layer interface to drop while moving ILayerView
void mouseMoveEvent(QGraphicsSceneMouseEvent *event)
IView * getViewForItem(SessionItem *item)
QMap< SessionItem *, IView * > m_ItemToView
Correspondance of model's item and scene's view.
void setSampleModel(SampleModel *sampleModel)
const DesignerMimeData * checkDragEvent(QGraphicsSceneDragDropEvent *event)
returns proper MimeData if the object can be hadled by graphics scene
bool isMultiLayerNearby(QGraphicsSceneDragDropEvent *event)
Returns true if there is MultiLayerView nearby during drag event.
SampleViewAligner * m_aligner
void onSceneSelectionChanged()
propagate selection from scene to model
bool isLayerDragged() const
IView * addViewForItem(SessionItem *item)
adds view for item, if it doesn't exists
FilterPropertyProxy * m_proxy
void removeItemViewFromScene(SessionItem *item)
removes view from scene corresponding to given item
void dragMoveEvent(QGraphicsSceneDragDropEvent *event)
handles drag event LayerView can be dragged only over MultiLayerView MultiLayerView can be dragged bo...
void removeConnection(NodeEditorConnection *)
propagates break of connection between views on scene to the model
DesignerScene(QObject *parent=0)
void onRowsAboutToBeRemoved(const QModelIndex &parent, int first, int last)
NodeEditor * m_nodeEditor
void onRowsRemoved(const QModelIndex &parent, int first, int last)
void dropEvent(QGraphicsSceneDragDropEvent *event)
Hadles drop event LayerView can be dropped on MultiLayerView only MultiLayerView can be droped on the...
InstrumentModel * m_instrumentModel
bool isAcceptedByMultiLayer(const DesignerMimeData *mimeData, QGraphicsSceneDragDropEvent *event)
void onEstablishedConnection(NodeEditorConnection *)
propagates connection established by NodeEditor to the model
void setSelectionModel(QItemSelectionModel *model, FilterPropertyProxy *proxy)
MaterialModel * m_materialModel
The FilterPropertyProxy class filters out all PropertyItem's and similar from SessionModel to have on...
parent class for graphic representation of all ISampleNode's
The NodeEditor class implement for QGraphicsScene an editable schematic of the dependency graph,...
Main model to hold sample items.
Makes alignment of sample droped on graphics scene.