47 bool IsLast()
const {
return i == list->Size(); }
53 if (i == 0)
return glm::vec2(0, (*list)[0].y);
54 return (*list)[i - 1];
58 if (i == list->SizeLines() - 1)
return glm::vec2(1, (*list)[list->Size() - 1].y);
61 void setA(
const glm::vec2 &v)
63 if (i != 0) (*list)[i - 1] = v;
65 void setB(
const glm::vec2 &v)
67 if (i != list->SizeLines() - 1) (*list)[i] = v;
82 int Add(
const glm::vec2 &v)
84 for (
int i = 0; i <
_points.size(); i++)
90 int Add(
const glm::vec2 &v,
const int i)
93 glm::vec2 vClamped = glm::clamp(v, glm::vec2(0, 0), glm::vec2(1, 1));
143 bool _isDraggingControl =
false;
144 bool _isDraggingLine =
false;
147 glm::vec2 _dragOffset;
148 glm::vec2 _dragOffsetB;
150 int _selectedControl = -1;
152 void opacityChanged();
154 bool controlPointContainsPixel(
const glm::vec2 &cp,
const glm::vec2 &pixel)
const;
160 void addControlPoint(
const glm::vec2 &ndc);
171 void menuDeleteSelectedControlPoint();
172 void menuAddControlPoint();
glm::vec2 & operator*()=delete
LineIterator operator-(int x) const
void setB(const glm::vec2 &v)
void setA(const glm::vec2 &v)
LineIterator operator+(int x) const
bool operator==(const PointIterator &other)
PointIterator & operator++()
bool operator!=(const PointIterator &other)
PointIterator operator-(int x) const
PointIterator operator+(int x) const
PointIterator & operator--()
std::vector< glm::vec2 > _points
PointIterator EndPoints()
int Add(const glm::vec2 &v, const LineIterator &line)
PointIterator BeginPoints()
glm::vec2 & operator[](const int i)
LineIterator BeginLines()
int Add(const glm::vec2 &v)
int Add(const glm::vec2 &v, const int i)
void Remove(const PointIterator &point)
void LostFocus() override
void paintEvent(QPainter &p) override
These map to the QWidget counterparts.
void mouseMoveEvent(QMouseEvent *event) override
TFOpacityMap(const std::string &variableNameTag, TFMapWidget *parent=nullptr)
void UpdateInfo(float value, float opacity)
void paramsUpdate() override
void mouseDoubleClickEvent(QMouseEvent *event) override
QSize minimumSizeHint() const override
void mouseReleaseEvent(QMouseEvent *event) override
TFInfoWidget * createInfoWidget() override
void UpdateFromInfo(float value, float opacity)
void ControlPointDeselected()
void PopulateContextMenu(QMenu *menu, const glm::vec2 &p) override
(Right-click menu)
void mousePressEvent(QMouseEvent *event) override
void DeselectControlPoint()
void PopulateSettingsMenu(QMenu *menu) const override