MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ region_of() [2/2]

MAYAFLUX_API std::optional< Kinesis::AABB2D > MayaFlux::Portal::Forma::region_of ( const RectPlacementInputs & placement,
std::string & error )
nodiscard

The surface region a rect placement covers.

Parameters
errorReceives the reason when nullopt is returned: the width and height must be positive.

Definition at line 5 of file PlacementInputs.cpp.

6{
7 const glm::vec4 rect = placement.rect;
8 if (!(rect.z > 0.F) || !(rect.w > 0.F)) {
9 error = "rect needs a positive width and height";
10 return std::nullopt;
11 }
12 return Kinesis::AABB2D::from_origin_size({ rect.x, rect.y }, { rect.z, rect.w });
13}
static AABB2D from_origin_size(glm::vec2 origin, glm::vec2 size) noexcept
Construct from a minimum corner and a size.
Definition Bounds.hpp:104

References MayaFlux::Kinesis::AABB2D::from_origin_size(), and MayaFlux::Portal::Forma::RectPlacementInputs::rect.

Referenced by handle_path_form(), MayaFlux::Portal::Forma::PolygonFactory::operator()(), scale_form(), and vertex_geometry_form().

Here is the call graph for this function:
Here is the caller graph for this function: