Inviwo 0.9.12-pre
Inviwo documentation
Loading...
Searching...
No Matches
inviwo::glui::ButtonPropertyWidget Class Reference

GLUI property widget for a button property using a glui Button. More...

#include <modules/userinterfacegl/glui/widgets/buttonpropertywidget.h>

Inheritance diagram for inviwo::glui::ButtonPropertyWidget:

Public Member Functions

 ButtonPropertyWidget (ButtonProperty &property, Processor &processor, Renderer &uiRenderer, const ivec2 &extent=ivec2(100, 24))
virtual std::string_view getClassIdentifier () const override
virtual void onSetDisplayName (Property *property, const std::string &displayName) override
virtual void onSetReadOnly (Property *property, bool readonly) override
virtual void onSetVisible (Property *property, bool visible) override
virtual void updateFromProperty () override
Public Member Functions inherited from inviwo::glui::Button
 Button (const std::string &label, Processor &processor, Renderer &uiRenderer, const ivec2 &extent=ivec2(100, 24))
Public Member Functions inherited from inviwo::glui::AbstractButton
 AbstractButton (const std::string &label, Processor &processor, Renderer &uiRenderer, const ivec2 &extent=ivec2(100, 24))
Public Member Functions inherited from inviwo::glui::Element
 Element (const std::string &label, Processor &processor, Renderer &uiRenderer, UIOrientation orientation=UIOrientation::Horizontal)
const ivec2 & getExtent ()
 return extent of the element, including both widget and label, and considering scaling
int getFontSize () const
const std::string & getLabel () const
UIOrientation getOrientation () const
double getScalingFactor () const
const ivec2 & getWidgetExtent () const
ivec2 getWidgetExtentScaled () const
 returns the true widget extent including scaling
bool isChecked () const
bool isDirty () const
bool isEnabled () const
bool isHovered () const
bool isLabelBold () const
bool isLabelVisible () const
bool isPushed () const
bool isVisible () const
void render (const ivec2 &origin, const size2_t &canvasDim)
 render the widget and its label at the given position
void setAction (const std::function< void()> &action)
 sets the callback action when the user releases the mouse button
void setChecked (bool checked)
void setEnabled (bool enable=true)
void setFontSize (int size)
void setHoverState (bool enable)
void setLabel (const std::string &str)
void setLabelBold (bool bold)
void setLabelVisible (bool visible=true)
void setOrientation (UIOrientation orientation)
void setPickingEventAction (std::function< void(PickingEvent *e)> pickingAction)
void setPushedState (bool pushed)
void setScalingFactor (double factor)
void setVisible (bool visible=true)
void setWidgetExtent (const ivec2 &extent)
 sets the extent of the widget
void setWidgetExtentScaled (const ivec2 &extent)
 sets the extent of the widget
Public Member Functions inherited from inviwo::PropertyWidget
virtual PropertyEditorWidgetgetEditorWidget () const
virtual PropertygetProperty ()
virtual bool hasEditorWidget () const
PropertyWidget & operator= (const PropertyWidget &)
PropertyWidget & operator= (PropertyWidget &&)
 PropertyWidget (const PropertyWidget &)
 PropertyWidget (Property *property)
 PropertyWidget (PropertyWidget &&)
virtual ~PropertyWidget ()
Public Member Functions inherited from inviwo::PropertyObserver
virtual void onSetIdentifier (Property *property, const std::string &identifier)
virtual void onSetSemantics (Property *property, const PropertySemantics &semantics)
Public Member Functions inherited from inviwo::Observer
 Observer (const Observer &other)
 Observer (Observer &&other)
Observer & operator= (const Observer &other)
Observer & operator= (Observer &&other)
void removeObservation (ObservableInterface *observable)
void removeObservations ()
virtual ~Observer ()

Static Public Attributes

static constexpr std::string_view classIdentifier {"org.inviwo.glui.ButtonPropertyWidget"}
Static Public Attributes inherited from inviwo::glui::Button
static constexpr std::string_view classIdentifier {"org.inviwo.glui.Button"}

Additional Inherited Members

Public Types inherited from inviwo::glui::Element
enum class  UIState { Normal , Pressed , Checked }
Protected Member Functions inherited from inviwo::glui::Button
virtual void renderWidget (const ivec2 &origin, const size2_t &canvasDim) override
Protected Member Functions inherited from inviwo::glui::AbstractButton
virtual ivec2 computeLabelPos (int descent) const override
virtual vec2 marginScale () const override
virtual UIState uiState () const override
Protected Member Functions inherited from inviwo::glui::Element
TextRenderergetCurrentTextRenderer () const
 set up text renderer for rendering the label using current settings, i.e. font size, widget scaling, and whether it should be rendered bold
void handlePickingEvent (PickingEvent *e)
bool moveAction (const dvec2 &delta)
 gets called on mouse move events
virtual void pushStateChanged ()
 It is called by setPushState after the internal push state has been updated.
void renderLabel (const ivec2 &origin, const size2_t &canvasDim)
void setMouseMoveAction (const std::function< bool(const dvec2 &)> &action)
 set callback function for handling mouse movements based on a delta position. This callback gets called on mouse move events.
void triggerAction ()
 updates the UI state and triggers the callback action set by setAction(). This function is called when the user releases the mouse button.
void updateExtent ()
void updateLabel ()
void updateLabelPos ()
virtual void updateState ()
 is called before the action is triggered to update the internal UI state
Protected Member Functions inherited from inviwo::Observer
void addObservation (ObservableInterface *observable)
Static Protected Member Functions inherited from inviwo::glui::Element
static vec4 adjustColor (const vec4 &color)
Protected Attributes inherited from inviwo::glui::AbstractButton
std::array< int, 9 > uiTextureMap_
Texture2DArrayuiTextures_
Protected Attributes inherited from inviwo::glui::Element
std::function< void()> action_
bool boldLabel_
bool checked_
size_t currentPickingID_
bool enabled_
ivec2 extent_ = ivec2(0)
bool hovered_
bool labelDirty_
ivec2 labelExtent_ = ivec2(0)
int labelFontSize_
ivec2 labelPos_ = ivec2(0)
std::string labelStr_
std::shared_ptr< Texture2DlabelTexture_
bool labelVisible_
std::function< bool(const dvec2 &)> moveAction_
 is called by mouseMoved()
UIOrientation orientation_
std::function< void(PickingEvent *e)> pickingAction_
PickingMapper pickingMapper_
Processorprocessor_
bool pushed_
double scalingFactor_
RendereruiRenderer_
bool visible_
ivec2 widgetExtent_ = ivec2(0)
ivec2 widgetPos_ = ivec2(0)
Protected Attributes inherited from inviwo::PropertyWidget
Propertyproperty_ = nullptr
Protected Attributes inherited from inviwo::Observer
std::unordered_set< ObservableInterface * > observables_

Detailed Description

GLUI property widget for a button property using a glui Button.

Member Function Documentation

◆ getClassIdentifier()

virtual std::string_view inviwo::glui::ButtonPropertyWidget::getClassIdentifier ( ) const
overridevirtual

Reimplemented from inviwo::glui::Button.

◆ onSetDisplayName()

virtual void inviwo::glui::ButtonPropertyWidget::onSetDisplayName ( Property * property,
const std::string & displayName )
overridevirtual

Reimplemented from inviwo::PropertyObserver.

◆ onSetReadOnly()

virtual void inviwo::glui::ButtonPropertyWidget::onSetReadOnly ( Property * property,
bool readonly )
overridevirtual

Reimplemented from inviwo::PropertyObserver.

◆ onSetVisible()

virtual void inviwo::glui::ButtonPropertyWidget::onSetVisible ( Property * property,
bool visible )
overridevirtual

Reimplemented from inviwo::PropertyObserver.

◆ updateFromProperty()

virtual void inviwo::glui::ButtonPropertyWidget::updateFromProperty ( )
overridevirtual

Implement this function to update the widget after the property has been modified.

Implements inviwo::PropertyWidget.


The documentation for this class was generated from the following file:
  • modules/userinterfacegl/include/modules/userinterfacegl/glui/widgets/buttonpropertywidget.h