|
Gamp v0.0.7-54-gccdc599
Gamp: Graphics, Audio, Multimedia and Processing
|
#include <Shape.hpp>
Public Types | |
| typedef jau::function< bool(Shape &s, render::gl::GL &gl, RenderState &rs)> | DrawCallback |
Shape draw listener action returning a boolean value | |
| typedef jau::function< void(Shape &s, const Vec3f &origin, const Vec3f &dest, const PointerEvent &e)> | MoveEventCallback |
Shape move listener | |
| typedef jau::function< void(Shape &s, const Vec3f &pos, const PointerEvent &e)> | PointerEventCallback |
Shape pointer listener, e.g. | |
| typedef jau::function< void(Shape &s)> | ShapeEventCallback |
General Shape listener action. | |
| typedef jau::function< bool(Shape &s)> | Visitor1Func |
| Visitor1 method. | |
| typedef jau::function< bool(Shape &s, PMVMat4f &pmv)> | Visitor2Func |
| Visitor2 method. | |
Public Member Functions | |
| Shape ()=default | |
| void | applyMatToMv (PMVMat4f &pmvMat) noexcept |
Applies the internal Matrix4f to the given modelview matrix, i.e. | |
| void | draw (render::gl::GL &gl, RenderState &rs) noexcept |
| Renders the shape. | |
| virtual bool | hasColorChannel () const noexcept |
Returns true if implementation uses an extra color channel or texture which will be modulated with the passed rgba color drawImpl0(GL2ES2, RenderState, float[]). | |
| bool | isPressed () const noexcept |
| bool | isToggleable () const noexcept |
| Returns true if this shape is toggable, i.e. | |
| void | markShapeDirty () noexcept |
Marks the shape dirty, causing next draw() to recreate the Graph shape and reset the region. | |
| void | markStateDirty () noexcept |
Marks the rendering state dirty, causing next draw() to notify the Graph region to reselect shader and repaint potentially used FBOs. | |
| void | onDrawOneShot (DrawCallback l) |
Set a user one-shot initializer callback or custom draw(GL2ES2, RegionRenderer) hook. | |
| constexpr const Vec3f & | position () const noexcept |
| constexpr Vec3f & | position () noexcept |
| constexpr const Quat4f & | rotation () const noexcept |
| constexpr Quat4f & | rotation () noexcept |
| constexpr const Vec3f & | rotationPivot () const noexcept |
| constexpr Vec3f & | rotationPivot () noexcept |
| constexpr const Vec3f & | scale () const noexcept |
| constexpr Vec3f & | scale () noexcept |
| Shape & | setPressed (bool b) noexcept |
| Shape & | setToggleable (bool toggleable) noexcept |
| Set this shape toggleable, default is off. | |
| final Shape | validate (final GL2ES2 gl, final GLProfile glp) |
Validate the shape via validate(GL2ES2) if gl is not null, otherwise uses validate(GLProfile). | |
| Shape & | validate (render::gl::GL &gl) noexcept |
Validates the shape's underlying GLRegion. | |
| Shape & | validate (render::gl::GLProfile &glp) |
Validates the shape's underlying GLRegion w/o a current GL2ES2 object. | |
| constexpr const float & | zOffset () const noexcept |
| constexpr float & | zOffset () noexcept |
Static Public Attributes | |
| static constexpr const uint32_t | DIRTY_SHAPE = 1_u32 << 0 |
| static constexpr const uint32_t | DIRTY_STATE = 1_u32 << 1 |
Protected Member Functions | |
| virtual void | clearImpl0 (render::gl::GL &gl, RenderState &rs) |
Custom clear(GL2ES2, RenderState) task, called 1st. | |
| virtual void | destroyImpl0 (render::gl::GL &gl, RenderState &rs) |
Custom destroy(GL2ES2, RenderState) task, called 1st. | |
| virtual void | drawImpl0 (render::gl::GL &gl, RenderState &rs) noexcept |
Actual draw implementation, called by draw(GL2ES2, RenderState). | |
| std::string_view | getDirtyString () const noexcept |
| bool | isShapeDirty () const noexcept |
Returns the shape's dirty state, see markShapeDirty(). | |
| bool | isStateDirty () const noexcept |
Returns the rendering dirty state, see markStateDirty(). | |
| virtual void | validateImpl (const render::gl::GLProfile &glp) noexcept |
| virtual void | validateImpl (render::gl::GL &gl) noexcept |
Protected Attributes | |
| jau::math::geom::AABBox3f | m_box |
| typedef jau::function<bool(Shape& s)> gamp::dag::Shape::Visitor1Func |
| typedef jau::function<bool(Shape& s, PMVMat4f& pmv)> gamp::dag::Shape::Visitor2Func |
| typedef jau::function<void(Shape& s, const Vec3f& origin, const Vec3f& dest, const PointerEvent& e)> gamp::dag::Shape::MoveEventCallback |
| typedef jau::function<void(Shape& s, const Vec3f& pos, const PointerEvent& e)> gamp::dag::Shape::PointerEventCallback |
Shape pointer listener, e.g.
for Shape#onClicked(PointerListener)
| s | the associated Shape for this event |
| pos | relative object coordinates to the associated Shape |
| e | original Newt MouseEvent |
| typedef jau::function<void(Shape& s)> gamp::dag::Shape::ShapeEventCallback |
| typedef jau::function<bool(Shape& s, render::gl::GL& gl, RenderState& rs)> gamp::dag::Shape::DrawCallback |
Shape draw listener action returning a boolean value
If run(Shape, GL2ES2, RenderState) returns true, the listener will be removed at Shape#draw(GL2ES2, RenderState) otherwise kept calling.
Return true to remove this DrawListener at Shape#draw(GL2ES2, RenderState), otherwise it is being kept and called.
| shape | The shape |
| gl | the current GL2ES2 object |
| rs | the RenderState |
|
default |
|
protectedvirtualnoexcept |
|
protectedvirtualnoexcept |
|
protectedvirtualnoexcept |
Actual draw implementation, called by draw(GL2ES2, RenderState).
| gl | |
| rs | |
| rgba |
|
protectedvirtual |
Custom clear(GL2ES2, RenderState) task, called 1st.
|
protectedvirtual |
Custom destroy(GL2ES2, RenderState) task, called 1st.
|
inline |
Set a user one-shot initializer callback or custom draw(GL2ES2, RegionRenderer) hook.
run(Shape, GL2ES2, RegionRenderer) is called at Shape#draw(GL2ES2, RegionRenderer) and if returning true, the listener will be removed. Otherwise kept calling.
This instrument allows the user either to be signaled when initialization of this Shape is completed, or just too hook-up custom draw(GL2ES2, RegionRenderer) actions.
| l | callback, which shall return true to be removed, i.e. user initialization is done. |
|
virtualnoexcept |
Returns true if implementation uses an extra color channel or texture which will be modulated with the passed rgba color drawImpl0(GL2ES2, RenderState, float[]).
Otherwise the base color will be modulated and passed to drawImpl0(GL2ES2, RenderState, float[]).
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlineprotectednoexcept |
Returns the shape's dirty state, see markShapeDirty().
Definition at line 255 of file Shape.hpp.
|
inlineprotectednoexcept |
Returns the rendering dirty state, see markStateDirty().
Definition at line 259 of file Shape.hpp.
|
inlineprotectednoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Returns true if this shape is toggable, i.e.
rendered w/ setToggleOnColorMod(float, float, float, float) or setToggleOffColorMod(float, float, float, float).
|
inlinenoexcept |
Renders the shape.
applyMatToMv(PMVMatrix4f) is expected to be completed beforehand.
| gl | the current GL object |
| renderer | RenderState which might be used for Graph Curve Rendering, also source of RenderState#getMatrix() and RenderState#getViewport(). |
|
inlinenoexcept |
|
inline |
|
inline |
Validate the shape via validate(GL2ES2) if gl is not null, otherwise uses validate(GLProfile).
|
inlinenoexcept |
Applies the internal Matrix4f to the given modelview matrix, i.e.
pmv.mulMv( getMat() ).
Calls updateMat() if dirty.
In case isMatIdentity() is true, implementation is a no-operation.
| pmv | the matrix |
|
staticconstexpr |
|
staticconstexpr |
|
protected |