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::ScriptEditorWidget Class Reference

The ScriptEditorWidget class implements a widget for interactively editing a Chaiscript function. More...

#include <scripteditorwidget.h>

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

Classes

class  ScriptEditorWidgetImpl
 

Signals

void signal_scriptChanged (ScriptEditorWidget *self, const std::string &functionName, const std::string &code)
 signal_scriptChanged Signal emitted when the user change the script code of a function. More...
 
void signal_scriptReset (ScriptEditorWidget *self, const std::string &functionName, const std::string &code)
 signal_scriptReset Signal emitted when the user hits the reset button, expecting the script to be reset to some default code. More...
 

Public Member Functions

 ScriptEditorWidget (QObject *parent)
 
 ScriptEditorWidget (const std::string &title, const std::string &functionName, const std::string &defaultCode, QWidget *parent=nullptr)
 
virtual ~ScriptEditorWidget ()
 
std::string getFunctionName () const
 
std::string getDefaultCode () const
 
std::string getCurrentCode () const
 
void setCurrentCode (const std::string &code)
 
void resetCodeToDefault ()
 
void onScriptEvaluationSucceeded ()
 
void onScriptEvaluationFailed (const std::string &errorMessage)
 

Protected Member Functions

void changeEvent (QEvent *) override
 

Private Attributes

std::unique_ptr
< ScriptEditorWidgetImpl
d
 

Detailed Description

The ScriptEditorWidget class implements a widget for interactively editing a Chaiscript function.

Constructor & Destructor Documentation

geometrize::dialog::ScriptEditorWidget::ScriptEditorWidget ( QObject *  parent)
geometrize::dialog::ScriptEditorWidget::ScriptEditorWidget ( const std::string &  title,
const std::string &  functionName,
const std::string &  defaultCode,
QWidget *  parent = nullptr 
)
169  : QGroupBox(parent), d{std::make_unique<ScriptEditorWidgetImpl>(this, title, functionName, defaultCode)}
170 {
171 }
std::unique_ptr< ScriptEditorWidgetImpl > d
Definition: scripteditorwidget.h:59
geometrize::dialog::ScriptEditorWidget::~ScriptEditorWidget ( )
virtual
174 {
175 }

Member Function Documentation

void geometrize::dialog::ScriptEditorWidget::changeEvent ( QEvent *  event)
overrideprotected
178 {
179  if (event->type() == QEvent::LanguageChange) {
180  d->onLanguageChange();
181  }
182  QGroupBox::changeEvent(event);
183 }
std::unique_ptr< ScriptEditorWidgetImpl > d
Definition: scripteditorwidget.h:59
std::string geometrize::dialog::ScriptEditorWidget::getCurrentCode ( ) const
201 {
202  return d->getCurrentCode();
203 }
std::unique_ptr< ScriptEditorWidgetImpl > d
Definition: scripteditorwidget.h:59

Here is the caller graph for this function:

std::string geometrize::dialog::ScriptEditorWidget::getDefaultCode ( ) const
196 {
197  return d->getDefaultCode();
198 }
std::unique_ptr< ScriptEditorWidgetImpl > d
Definition: scripteditorwidget.h:59
std::string geometrize::dialog::ScriptEditorWidget::getFunctionName ( ) const
191 {
192  return d->getFunctionName();
193 }
std::unique_ptr< ScriptEditorWidgetImpl > d
Definition: scripteditorwidget.h:59
void geometrize::dialog::ScriptEditorWidget::onScriptEvaluationFailed ( const std::string &  errorMessage)
216 {
217  d->onScriptEvaluationFailed(errorMessage);
218 }
std::unique_ptr< ScriptEditorWidgetImpl > d
Definition: scripteditorwidget.h:59
void geometrize::dialog::ScriptEditorWidget::onScriptEvaluationSucceeded ( )
211 {
212  d->onScriptEvaluationSucceeded();
213 }
std::unique_ptr< ScriptEditorWidgetImpl > d
Definition: scripteditorwidget.h:59

Here is the caller graph for this function:

void geometrize::dialog::ScriptEditorWidget::resetCodeToDefault ( )
186 {
187  d->resetCodeToDefault();
188 }
std::unique_ptr< ScriptEditorWidgetImpl > d
Definition: scripteditorwidget.h:59
void geometrize::dialog::ScriptEditorWidget::setCurrentCode ( const std::string &  code)
206 {
207  d->setCurrentCode(code);
208 }
std::unique_ptr< ScriptEditorWidgetImpl > d
Definition: scripteditorwidget.h:59
void geometrize::dialog::ScriptEditorWidget::signal_scriptChanged ( ScriptEditorWidget self,
const std::string &  functionName,
const std::string &  code 
)
signal

signal_scriptChanged Signal emitted when the user change the script code of a function.

Parameters
selfThe widget emitting this signal.
functionNameThe name of the function that was edited.
codeThe new Chaiscript code.

Here is the caller graph for this function:

void geometrize::dialog::ScriptEditorWidget::signal_scriptReset ( ScriptEditorWidget self,
const std::string &  functionName,
const std::string &  code 
)
signal

signal_scriptReset Signal emitted when the user hits the reset button, expecting the script to be reset to some default code.

Parameters
selfThe widget emitting this signal.
functionNameThe name of the function that was reset.
codeThe default Chaiscript code.

Member Data Documentation

std::unique_ptr<ScriptEditorWidgetImpl> geometrize::dialog::ScriptEditorWidget::d
private

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