Geometrize  1.0
An application for geometrizing images into geometric primitives
Classes | Signals | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
geometrize::dialog::ImageTaskScriptingWidget Class Reference

The ImageTaskScriptingWidget implements a widget for manipulating scripts that are run when an image is being geometrized e.g. before/after a shape is added. More...

#include <imagetaskscriptingwidget.h>

Inheritance diagram for geometrize::dialog::ImageTaskScriptingWidget:
Inheritance graph
[legend]
Collaboration diagram for geometrize::dialog::ImageTaskScriptingWidget:
Collaboration graph
[legend]

Classes

class  ImageTaskScriptingWidgetImpl
 

Signals

void signal_scriptChanged (const std::string &functionName, const std::string &code)
 

Public Member Functions

 ImageTaskScriptingWidget (QWidget *parent=nullptr)
 
virtual ~ImageTaskScriptingWidget ()
 
void setImageTask (task::ImageTask *task)
 setImageTask Sets the current image task used by the scripts. More...
 
void syncUserInterface ()
 syncUserInterface Syncs the user interface with the current image task. This should be called after setting a new image task, or new task settings. More...
 
std::map< std::string, std::string > getScripts () const
 getScripts Gets all the scripts (shape setup/mutation scripts, and additional scripts). More...
 
void evaluateBeforeStepScripts () const
 evaluateBeforeStepScripts Evaluates the scripts set to run directly before the image task is stepped (i.e. immediately before the image task starts a step). More...
 
void evaluateAfterStepScripts () const
 evaluateAfterStepScripts Evaluates the scripts set to run directly after the image task is stepped (i.e. immediately after the image task starts a step). More...
 
bool evaluateStopConditionScripts () const
 evaluateStopConditionScripts Returns true if the condition(s) for stopping geometrizing the image were met. This is run each time the image task completes a step. More...
 
void evaluateOnStopConditionMetScripts () const
 evaluateOnStopConditionMetScripts Evaluates the scripts set to run when the stop condition for stopping geometrizing the image is met. More...
 
bool evaluateAddShapePreconditionScripts () const
 evaluateAddShapePreconditionScripts Evaluates the scripts set to decide whether to add a shape to the image or not. More...
 
void evaluateBeforeAddShapeScripts () const
 evaluateBeforeAddShapeScripts Evaluates the scripts set to run directly before a shape is added to the image. More...
 
void evaluateAfterAddShapeScripts () const
 evaluateAfterAddShapeScripts Evaluates the scripts set to run directly after a shape is added to the image. More...
 
void evaluateOnPenInputEventScripts () const
 evaluateOnPenInputEventScripts Evaluates the scripts set to run directly after a pen e.g. Wacom stylus interacts with the scenes. More...
 
void evaluateOnPenProximityEnterEventScripts () const
 evaluateOnPenProximityEnterEventScripts Evaluates the scripts set to run directly after a pen e.g. Wacom stylus enters proximity of the screen (application global, not just the scenes). More...
 
void evaluateOnPenProximityExitEventScripts () const
 evaluateOnPenProximityExitEventScripts Evaluates the scripts set to run directly after a pen e.g. Wacom stylus leaves the proximity of the screen (application global, not just the scenes). More...
 
void evaluateOnKeyDownEventScripts () const
 evaluateOnKeyDownEventScripts Evaluates the scripts set to run directly after a keyboard key is pressed in the context of a scene. More...
 
void evaluateOnKeyUpEventScripts () const
 evaluateOnKeyUpEventScripts Evaluates the scripts set to run directly after a keyboard key is released in the context of a scene. More...
 
void evaluateOnMouseDownEventScripts () const
 evaluateOnMouseDownEventScripts Evaluates the scripts set to run directly after a mouse key is pressed in the context of a scene. More...
 
void evaluateOnMouseUpEventScripts () const
 evaluateOnMouseUpEventScripts Evaluates the scripts set to run directly after a mouse key is released in the context of a scene. More...
 
void evaluateOnMouseMoveEventScripts () const
 evaluateOnMouseMoveEventScripts Evaluates the scripts set to run when the mouse is moved in the context of a scene. More...
 
void evaluateOnMouseWheelEventScripts () const
 evaluateOnMouseWheelEventScripts Evaluates the scripts set to run when the mouse wheel is moved in the context of a scene. More...
 
void evaluateOnTimedUpdateEventScripts () const
 evaluateOnTimedUpdateEventScripts Evaluates the scripts that are set to run periodically (i.e. on an update function triggered by a timer). More...
 

Protected Member Functions

void changeEvent (QEvent *) override
 

Private Attributes

std::unique_ptr< ImageTaskScriptingWidgetImpld
 

Detailed Description

The ImageTaskScriptingWidget implements a widget for manipulating scripts that are run when an image is being geometrized e.g. before/after a shape is added.

Constructor & Destructor Documentation

◆ ImageTaskScriptingWidget()

geometrize::dialog::ImageTaskScriptingWidget::ImageTaskScriptingWidget ( QWidget *  parent = nullptr)
573  :
574  QWidget{parent},
575  d{std::make_unique<ImageTaskScriptingWidget::ImageTaskScriptingWidgetImpl>(this)}
576 {
577 }

◆ ~ImageTaskScriptingWidget()

geometrize::dialog::ImageTaskScriptingWidget::~ImageTaskScriptingWidget ( )
virtual
580 {
581 }

Member Function Documentation

◆ changeEvent()

void geometrize::dialog::ImageTaskScriptingWidget::changeEvent ( QEvent *  event)
overrideprotected
584 {
585  if (event->type() == QEvent::LanguageChange) {
586  d->onLanguageChange();
587  }
588  QWidget::changeEvent(event);
589 }

◆ evaluateAddShapePreconditionScripts()

bool geometrize::dialog::ImageTaskScriptingWidget::evaluateAddShapePreconditionScripts ( ) const

evaluateAddShapePreconditionScripts Evaluates the scripts set to decide whether to add a shape to the image or not.

Returns
True if the shape should be added.
622 {
623  return d->evaluateAddShapePreconditionScripts();
624 }

◆ evaluateAfterAddShapeScripts()

void geometrize::dialog::ImageTaskScriptingWidget::evaluateAfterAddShapeScripts ( ) const

evaluateAfterAddShapeScripts Evaluates the scripts set to run directly after a shape is added to the image.

632 {
633  d->evaluateAfterAddShapeScripts();
634 }

◆ evaluateAfterStepScripts()

void geometrize::dialog::ImageTaskScriptingWidget::evaluateAfterStepScripts ( ) const

evaluateAfterStepScripts Evaluates the scripts set to run directly after the image task is stepped (i.e. immediately after the image task starts a step).

607 {
608  d->evaluateAfterStepScripts();
609 }

◆ evaluateBeforeAddShapeScripts()

void geometrize::dialog::ImageTaskScriptingWidget::evaluateBeforeAddShapeScripts ( ) const

evaluateBeforeAddShapeScripts Evaluates the scripts set to run directly before a shape is added to the image.

627 {
628  d->evaluateBeforeAddShapeScripts();
629 }

◆ evaluateBeforeStepScripts()

void geometrize::dialog::ImageTaskScriptingWidget::evaluateBeforeStepScripts ( ) const

evaluateBeforeStepScripts Evaluates the scripts set to run directly before the image task is stepped (i.e. immediately before the image task starts a step).

602 {
603  d->evaluateBeforeStepScripts();
604 }

◆ evaluateOnKeyDownEventScripts()

void geometrize::dialog::ImageTaskScriptingWidget::evaluateOnKeyDownEventScripts ( ) const

evaluateOnKeyDownEventScripts Evaluates the scripts set to run directly after a keyboard key is pressed in the context of a scene.

652 {
653  d->evaluateOnKeyDownEventScripts();
654 }

◆ evaluateOnKeyUpEventScripts()

void geometrize::dialog::ImageTaskScriptingWidget::evaluateOnKeyUpEventScripts ( ) const

evaluateOnKeyUpEventScripts Evaluates the scripts set to run directly after a keyboard key is released in the context of a scene.

657 {
658  d->evaluateOnKeyUpEventScripts();
659 }

◆ evaluateOnMouseDownEventScripts()

void geometrize::dialog::ImageTaskScriptingWidget::evaluateOnMouseDownEventScripts ( ) const

evaluateOnMouseDownEventScripts Evaluates the scripts set to run directly after a mouse key is pressed in the context of a scene.

662 {
663  d->evaluateOnMouseDownEventScripts();
664 }

◆ evaluateOnMouseMoveEventScripts()

void geometrize::dialog::ImageTaskScriptingWidget::evaluateOnMouseMoveEventScripts ( ) const

evaluateOnMouseMoveEventScripts Evaluates the scripts set to run when the mouse is moved in the context of a scene.

672 {
673  d->evaluateOnMouseMoveEventScripts();
674 }

◆ evaluateOnMouseUpEventScripts()

void geometrize::dialog::ImageTaskScriptingWidget::evaluateOnMouseUpEventScripts ( ) const

evaluateOnMouseUpEventScripts Evaluates the scripts set to run directly after a mouse key is released in the context of a scene.

667 {
668  d->evaluateOnMouseUpEventScripts();
669 }

◆ evaluateOnMouseWheelEventScripts()

void geometrize::dialog::ImageTaskScriptingWidget::evaluateOnMouseWheelEventScripts ( ) const

evaluateOnMouseWheelEventScripts Evaluates the scripts set to run when the mouse wheel is moved in the context of a scene.

677 {
678  d->evaluateOnMouseWheelEventScripts();
679 }

◆ evaluateOnPenInputEventScripts()

void geometrize::dialog::ImageTaskScriptingWidget::evaluateOnPenInputEventScripts ( ) const

evaluateOnPenInputEventScripts Evaluates the scripts set to run directly after a pen e.g. Wacom stylus interacts with the scenes.

637 {
638  d->evaluateOnPenInputEventScripts();
639 }

◆ evaluateOnPenProximityEnterEventScripts()

void geometrize::dialog::ImageTaskScriptingWidget::evaluateOnPenProximityEnterEventScripts ( ) const

evaluateOnPenProximityEnterEventScripts Evaluates the scripts set to run directly after a pen e.g. Wacom stylus enters proximity of the screen (application global, not just the scenes).

642 {
643  d->evaluateOnPenProximityEnterEventScripts();
644 }

◆ evaluateOnPenProximityExitEventScripts()

void geometrize::dialog::ImageTaskScriptingWidget::evaluateOnPenProximityExitEventScripts ( ) const

evaluateOnPenProximityExitEventScripts Evaluates the scripts set to run directly after a pen e.g. Wacom stylus leaves the proximity of the screen (application global, not just the scenes).

647 {
648  d->evaluateOnPenProximityExitEventScripts();
649 }

◆ evaluateOnStopConditionMetScripts()

void geometrize::dialog::ImageTaskScriptingWidget::evaluateOnStopConditionMetScripts ( ) const

evaluateOnStopConditionMetScripts Evaluates the scripts set to run when the stop condition for stopping geometrizing the image is met.

617 {
618  d->evaluateOnStopConditionMetScripts();
619 }

◆ evaluateOnTimedUpdateEventScripts()

void geometrize::dialog::ImageTaskScriptingWidget::evaluateOnTimedUpdateEventScripts ( ) const

evaluateOnTimedUpdateEventScripts Evaluates the scripts that are set to run periodically (i.e. on an update function triggered by a timer).

682 {
683  d->evaluateOnTimedUpdateEventScripts();
684 }

◆ evaluateStopConditionScripts()

bool geometrize::dialog::ImageTaskScriptingWidget::evaluateStopConditionScripts ( ) const

evaluateStopConditionScripts Returns true if the condition(s) for stopping geometrizing the image were met. This is run each time the image task completes a step.

Returns
True if a stop condition was met
612 {
613  return d->evaluateStopConditionScripts();
614 }

◆ getScripts()

std::map< std::string, std::string > geometrize::dialog::ImageTaskScriptingWidget::getScripts ( ) const

getScripts Gets all the scripts (shape setup/mutation scripts, and additional scripts).

Returns
All scripts within the scripting widget and the shape scripting widget.
687 {
688  return d->getScripts();
689 }

◆ setImageTask()

void geometrize::dialog::ImageTaskScriptingWidget::setImageTask ( task::ImageTask task)

setImageTask Sets the current image task used by the scripts.

Parameters
taskNon-owning pointer to the image task that the scripts on this widget will use.
592 {
593  d->setImageTask(task);
594 }

◆ signal_scriptChanged

void geometrize::dialog::ImageTaskScriptingWidget::signal_scriptChanged ( const std::string &  functionName,
const std::string &  code 
)
signal

◆ syncUserInterface()

void geometrize::dialog::ImageTaskScriptingWidget::syncUserInterface ( )

syncUserInterface Syncs the user interface with the current image task. This should be called after setting a new image task, or new task settings.

597 {
598  d->syncUserInterface();
599 }

Member Data Documentation

◆ d

std::unique_ptr<ImageTaskScriptingWidgetImpl> geometrize::dialog::ImageTaskScriptingWidget::d
private

The documentation for this class was generated from the following files:
geometrize::dialog::ImageTaskScriptingWidget::d
std::unique_ptr< ImageTaskScriptingWidgetImpl > d
Definition: imagetaskscriptingwidget.h:156