23#include "guillaume/systems/divider.hpp"
32 utility::graphic::PoseF shifted(
const utility::graphic::PoseF &pose,
36 result.setPosition(utility::graphic::PositionF(
37 pose.getPosition().getX() + offset, pose.getPosition().getY(),
38 pose.getPosition().getZ()));
58 const float leading = divider.getLeadingInset();
59 const float trailing = divider.getTrailingInset();
65 divider.setOriginPose(shifted(transform.getPose(), -leading));
68 const auto pose = shifted(divider.getOriginPose(), leading);
69 transform.setPose(pose);
73 .setWidth(std::max(0.0f, divider.getLength() - leading - trailing))
77 .setThickness(divider.getThickness());
80 .setColor(divider.getColor());
Size of an entity: the width and height, in dp, of the rectangle that starts at the position of its c...
Bound & setHeight(float height) noexcept
Set the height.
Main color of an entity: the fill of a shape, or the ink of a text or an icon.
State of a divider: a thin horizontal line separating content.
Divider & setAppliedPose(const utility::graphic::PoseF &pose)
Record the pose written to the Transform.
const utility::graphic::PoseF & getAppliedPose(void) const
Get the pose systems::Divider last wrote to the Transform.
A straight stroke across the width of the entity: a divider, an indicator, the underline of a text fi...
Stores every component of a scene, per component type and per entity identifier, and knows which ones...
ComponentType & getComponent(const Entity::Identifier &entityIdentifier)
Get a component of an entity, to read or modify it.
std::size_t Identifier
The key under which an entity's components are stored. Systems and components refer to entities by th...
SystemFiller(Phase phase)
ecs::ComponentRegistry & getComponentRegistry(void)
Get the component registry of the scene being processed.
bool requireComponent(const ecs::Entity::Identifier &entityIdentifier)
Tell whether an entity has a component, and log a warning naming the entity and the component when it...
void update(const ecs::Entity::Identifier &entityIdentifier) override
Write the geometry of one divider for this frame.
Divider(void)
Create the system in the Measure phase.
static void apply(ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier)
Write the geometry of one divider from its configuration.
State. Every class here is plain data attached to an entity.
The entity-component-system core, independent of any widget.
Rules. Every class here runs each frame on the entities that have the components it declares.