15 #ifndef BORNAGAIN_GUI2_SLDEDITOR_LAYERELEMENTCONTROLLER_H
16 #define BORNAGAIN_GUI2_SLDEDITOR_LAYERELEMENTCONTROLLER_H
18 #include "darefl_export.h"
21 #include <QPainterPath>
27 class LayerElementItem;
31 class HandleElementView;
33 class SegmentElementView;
35 class RoughnessElementView;
45 void deleteViewItems();
46 void connectToModel()
const;
47 void disconnectFormModel()
const;
57 void setSampleItemId(std::string indentifier);
58 std::string sampleItemId()
const;
59 void unsetSampleItemId();
67 void unsetLayerAbove(
bool silent =
true);
68 void unsetLayerBelow(
bool silent =
true);
76 void unsetSideSegment();
77 void unsetTopSegment();
85 void unsetSegmentHandles();
96 void unsetRoughness();
97 void unsetRoughnessHandles();
98 void updateRoughness()
const;
111 void updateSideSegment()
const;
112 void updateTopSegment()
const;
113 QRectF sideSegmentRect()
const;
114 QRectF topSegmentRect()
const;
115 void putSegementsOnScene()
const;
116 void removeSegmentsFromScene()
const;
118 void sideSegmentMoved()
const;
119 void topSegmentMoved()
const;
123 void updateSegmentHandles()
const;
124 QRectF firstSegmentHandleRect()
const;
125 QRectF secondSegmentHandleRect()
const;
126 void putSegmentHandlesOnScene()
const;
127 void removeSegmentHandlesFromScene()
const;
131 QPainterPath leftRoughnessPath()
const;
132 QPainterPath rightRoughnessPath()
const;
133 QRectF leftRoughnessHandleRect()
const;
134 QRectF rightRoughnessHandleRect()
const;
135 void putRoughnessOnScene()
const;
136 void putRoughnessHandlesOnScene()
const;
137 void removeRoughnessFromScene()
const;
138 void removeRoughnessHandlesFromScene()
const;
139 void setRoughnessInLimits(
double roughness,
bool active =
true)
const;
141 void leftHandleMoved()
const;
142 void rightHandleMoved()
const;
149 std::vector<SegmentElementView*> m_segment_views = {
nullptr,
nullptr};
150 std::vector<HandleElementView*> m_handle_views = {
nullptr,
nullptr};
151 std::vector<HandleElementView*> m_rough_handles_views = {
nullptr,
nullptr};
Interface to convert coordinates of "scene" to coordinates of "widget".
Custom graphics scene to show QCustomPlot with additional elements on top.
The handle QGraphicsViewItem on GraphicsScene.
Manages the whole appearance of a layer on the graphicsscene.
void widthChanged(std::string id, double value) const
void roughnessChanged(std::string id, double value) const
void heightChanged(std::string id, double value) const
LayerElementItem * p_model_item
std::string m_sample_item_id
The mvvm session item associated to a layer.
The roughness QGraphicsViewItem.
The segment QGraphicsViewItem on the Graphicsscene.
Based on Qt example "codeeditor" Copyright (C) 2016 The Qt Company Ltd.