Geometrize  1.0
An application for geometrizing images into geometric primitives
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
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 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
< ImageTaskScriptingWidgetImpl
d
 

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

geometrize::dialog::ImageTaskScriptingWidget::ImageTaskScriptingWidget ( QWidget *  parent = nullptr)
532  :
533  QWidget{parent},
534  d{std::make_unique<ImageTaskScriptingWidget::ImageTaskScriptingWidgetImpl>(this)}
535 {
536 }
std::unique_ptr< ImageTaskScriptingWidgetImpl > d
Definition: imagetaskscriptingwidget.h:145
geometrize::dialog::ImageTaskScriptingWidget::~ImageTaskScriptingWidget ( )
virtual
539 {
540 }

Member Function Documentation

void geometrize::dialog::ImageTaskScriptingWidget::changeEvent ( QEvent *  event)
overrideprotected
543 {
544  if (event->type() == QEvent::LanguageChange) {
545  d->onLanguageChange();
546  }
547  QWidget::changeEvent(event);
548 }
std::unique_ptr< ImageTaskScriptingWidgetImpl > d
Definition: imagetaskscriptingwidget.h:145
void geometrize::dialog::ImageTaskScriptingWidget::evaluateAfterAddShapeScripts ( ) const

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

581 {
582  d->evaluateAfterAddShapeScripts();
583 }
std::unique_ptr< ImageTaskScriptingWidgetImpl > d
Definition: imagetaskscriptingwidget.h:145
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).

566 {
567  d->evaluateAfterStepScripts();
568 }
std::unique_ptr< ImageTaskScriptingWidgetImpl > d
Definition: imagetaskscriptingwidget.h:145
void geometrize::dialog::ImageTaskScriptingWidget::evaluateBeforeAddShapeScripts ( ) const

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

576 {
577  d->evaluateBeforeAddShapeScripts();
578 }
std::unique_ptr< ImageTaskScriptingWidgetImpl > d
Definition: imagetaskscriptingwidget.h:145
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).

561 {
562  d->evaluateBeforeStepScripts();
563 }
std::unique_ptr< ImageTaskScriptingWidgetImpl > d
Definition: imagetaskscriptingwidget.h:145
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.

601 {
602  d->evaluateOnKeyDownEventScripts();
603 }
std::unique_ptr< ImageTaskScriptingWidgetImpl > d
Definition: imagetaskscriptingwidget.h:145
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.

606 {
607  d->evaluateOnKeyUpEventScripts();
608 }
std::unique_ptr< ImageTaskScriptingWidgetImpl > d
Definition: imagetaskscriptingwidget.h:145
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.

611 {
612  d->evaluateOnMouseDownEventScripts();
613 }
std::unique_ptr< ImageTaskScriptingWidgetImpl > d
Definition: imagetaskscriptingwidget.h:145
void geometrize::dialog::ImageTaskScriptingWidget::evaluateOnMouseMoveEventScripts ( ) const

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

621 {
622  d->evaluateOnMouseMoveEventScripts();
623 }
std::unique_ptr< ImageTaskScriptingWidgetImpl > d
Definition: imagetaskscriptingwidget.h:145
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.

616 {
617  d->evaluateOnMouseUpEventScripts();
618 }
std::unique_ptr< ImageTaskScriptingWidgetImpl > d
Definition: imagetaskscriptingwidget.h:145
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.

626 {
627  d->evaluateOnMouseWheelEventScripts();
628 }
std::unique_ptr< ImageTaskScriptingWidgetImpl > d
Definition: imagetaskscriptingwidget.h:145
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.

586 {
587  d->evaluateOnPenInputEventScripts();
588 }
std::unique_ptr< ImageTaskScriptingWidgetImpl > d
Definition: imagetaskscriptingwidget.h:145
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).

591 {
592  d->evaluateOnPenProximityEnterEventScripts();
593 }
std::unique_ptr< ImageTaskScriptingWidgetImpl > d
Definition: imagetaskscriptingwidget.h:145
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).

596 {
597  d->evaluateOnPenProximityExitEventScripts();
598 }
std::unique_ptr< ImageTaskScriptingWidgetImpl > d
Definition: imagetaskscriptingwidget.h:145
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).

631 {
632  d->evaluateOnTimedUpdateEventScripts();
633 }
std::unique_ptr< ImageTaskScriptingWidgetImpl > d
Definition: imagetaskscriptingwidget.h:145
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
571 {
572  return d->evaluateStopConditionScripts();
573 }
std::unique_ptr< ImageTaskScriptingWidgetImpl > d
Definition: imagetaskscriptingwidget.h:145
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.
636 {
637  return d->getScripts();
638 }
std::unique_ptr< ImageTaskScriptingWidgetImpl > d
Definition: imagetaskscriptingwidget.h:145
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.
551 {
552  d->setImageTask(task);
553 }
std::unique_ptr< ImageTaskScriptingWidgetImpl > d
Definition: imagetaskscriptingwidget.h:145
void geometrize::dialog::ImageTaskScriptingWidget::signal_scriptChanged ( const std::string &  functionName,
const std::string &  code 
)
signal
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.

556 {
557  d->syncUserInterface();
558 }
std::unique_ptr< ImageTaskScriptingWidgetImpl > d
Definition: imagetaskscriptingwidget.h:145

Member Data Documentation

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

The documentation for this class was generated from the following files: