22 return std::isfinite(
static_cast<double>(
centerX)) &&
23 std::isfinite(
static_cast<double>(
centerY)) &&
24 std::isfinite(
static_cast<double>(
radius)) &&
28 return std::isfinite(
static_cast<double>(
centerX)) &&
29 std::isfinite(
static_cast<double>(
centerY)) &&
30 std::isfinite(
static_cast<double>(
width)) &&
31 std::isfinite(
static_cast<double>(
height)) &&
40 float minimumHeight)
noexcept
44 shape.
centerX = 0.5f * (x1 + x2);
45 shape.
centerY = 0.5f * (y1 + y2);
46 shape.
width = std::max(std::abs(x2 - x1), std::max(minimumWidth, 0.0f));
47 shape.
height = std::max(std::abs(y2 - y1), std::max(minimumHeight, 0.0f));
55 float minimumRadius)
noexcept
61 const float dx = edgeX - centerX;
62 const float dy = edgeY - centerY;
63 shape.
radius = std::max(std::sqrt(dx * dx + dy * dy), std::max(minimumRadius, 0.0f));
static PotentialEditorShape circleFromDrag(float centerX, float centerY, float edgeX, float edgeY, float minimumRadius) noexcept
Performs circle from drag.
static PotentialEditorShape rectangleFromDrag(float x1, float y1, float x2, float y2, float minimumWidth, float minimumHeight) noexcept
Performs rectangle from drag.
Declares the quantumpotentialeditor2d visualization component used by QPE.
Data structure used by the Potential Editor Shape component.
bool valid() const noexcept
Performs valid.