Geometrize  1.0
An application for geometrizing images into geometric primitives
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
Signals | Public Member Functions | Private Member Functions | Private Attributes | List of all members
geometrize::script::GeometrizerEngine Class Reference

The GeometrizerEngine class encapsulates script-based setup and mutation methods for geometrizing shapes. More...

#include <geometrizerengine.h>

Inheritance diagram for geometrize::script::GeometrizerEngine:
Inheritance graph
[legend]
Collaboration diagram for geometrize::script::GeometrizerEngine:
Collaboration graph
[legend]

Signals

void signal_scriptEvaluationSucceeded (const std::string &functionName, const std::string &code)
 signal_scriptEvaluationSucceeded Signal dispatched when a script is successfully parsed/evaluated. More...
 
void signal_scriptEvaluationFailed (const std::string &functionName, const std::string &code, const std::string &errorMessage)
 signal_scriptEvaluationFailed Signal dispatched when a script fails to parse/evaluate. More...
 

Public Member Functions

 GeometrizerEngine ()
 
 GeometrizerEngine (const chaiscript::ChaiScript::State &state)
 
virtual ~GeometrizerEngine ()=default
 
GeometrizerEngineoperator= (const GeometrizerEngine &)=delete
 
 GeometrizerEngine (const GeometrizerEngine &)=delete
 
void installScripts (const std::map< std::string, std::string > &scripts)
 
geometrize::core::EnergyFunction makeEnergyFunction () const
 makeEnergyFunction Returns a custom energy function for the core geometrization algorithm. More...
 
std::function< std::shared_ptr
< geometrize::Shape >)> 
makeShapeCreator (geometrize::ShapeTypes types, std::int32_t w, std::int32_t h) const
 makeShapeCreator Returns a function that generates shapes for the core geometrization algorithm This is passed to the geometrization algorithm and called across many threads. So it's unsafe to change any state used by the script engine while we're busy adding shapes. It also captures "this", meaning the engine won't be destroyed until the shape creation code is finished using it. More...
 
chaiscript::ChaiScript * getEngine ()
 getEngine Gets a pointer to the script engine used by the shape mutation engine. More...
 

Private Member Functions

template<class T >
void installShapeScript (const std::string &functionName, const std::map< std::string, std::string > &scripts)
 
void installCustomEnergyScript (const std::string &functionName, const std::string &scriptCode)
 
void setup (geometrize::Circle &shape) const
 
void mutate (geometrize::Circle &shape) const
 
void setSetupFunction (const std::function< void(geometrize::Circle &)> &f)
 
void setMutatorFunction (const std::function< void(geometrize::Circle &)> &f)
 
void setup (geometrize::Ellipse &shape) const
 
void mutate (geometrize::Ellipse &shape) const
 
void setSetupFunction (const std::function< void(geometrize::Ellipse &)> &f)
 
void setMutatorFunction (const std::function< void(geometrize::Ellipse &)> &f)
 
void setup (geometrize::Line &shape) const
 
void mutate (geometrize::Line &shape) const
 
void setSetupFunction (const std::function< void(geometrize::Line &)> &f)
 
void setMutatorFunction (const std::function< void(geometrize::Line &)> &f)
 
void setup (geometrize::Polyline &shape) const
 
void mutate (geometrize::Polyline &shape) const
 
void setSetupFunction (const std::function< void(geometrize::Polyline &)> &f)
 
void setMutatorFunction (const std::function< void(geometrize::Polyline &)> &f)
 
void setup (geometrize::QuadraticBezier &shape) const
 
void mutate (geometrize::QuadraticBezier &shape) const
 
void setSetupFunction (const std::function< void(geometrize::QuadraticBezier &)> &f)
 
void setMutatorFunction (const std::function< void(geometrize::QuadraticBezier &)> &f)
 
void setup (geometrize::Rectangle &shape) const
 
void mutate (geometrize::Rectangle &shape) const
 
void setSetupFunction (const std::function< void(geometrize::Rectangle &)> &f)
 
void setMutatorFunction (const std::function< void(geometrize::Rectangle &)> &f)
 
void setup (geometrize::RotatedEllipse &shape) const
 
void mutate (geometrize::RotatedEllipse &shape) const
 
void setSetupFunction (const std::function< void(geometrize::RotatedEllipse &)> &f)
 
void setMutatorFunction (const std::function< void(geometrize::RotatedEllipse &)> &f)
 
void setup (geometrize::RotatedRectangle &shape) const
 
void mutate (geometrize::RotatedRectangle &shape) const
 
void setSetupFunction (const std::function< void(geometrize::RotatedRectangle &)> &f)
 
void setMutatorFunction (const std::function< void(geometrize::RotatedRectangle &)> &f)
 
void setup (geometrize::Triangle &shape) const
 
void mutate (geometrize::Triangle &shape) const
 
void setSetupFunction (const std::function< void(geometrize::Triangle &)> &f)
 
void setMutatorFunction (const std::function< void(geometrize::Triangle &)> &f)
 
void setCustomEnergyFunction (const geometrize::core::EnergyFunction &f)
 

Private Attributes

std::function< void(geometrize::Circle &)> m_setupCircle
 
std::function< void(geometrize::Ellipse &)> m_setupEllipse
 
std::function< void(geometrize::Line &)> m_setupLine
 
std::function< void(geometrize::Polyline &)> m_setupPolyline
 
std::function< void(geometrize::QuadraticBezier &)> m_setupQuadraticBezier
 
std::function< void(geometrize::Rectangle &)> m_setupRectangle
 
std::function< void(geometrize::RotatedEllipse &)> m_setupRotatedEllipse
 
std::function< void(geometrize::RotatedRectangle &)> m_setupRotatedRectangle
 
std::function< void(geometrize::Triangle &)> m_setupTriangle
 
std::function< void(geometrize::Circle &)> m_mutateCircle
 
std::function< void(geometrize::Ellipse &)> m_mutateEllipse
 
std::function< void(geometrize::Line &)> m_mutateLine
 
std::function< void(geometrize::Polyline &)> m_mutatePolyline
 
std::function< void(geometrize::QuadraticBezier &)> m_mutateQuadraticBezier
 
std::function< void(geometrize::Rectangle &)> m_mutateRectangle
 
std::function< void(geometrize::RotatedEllipse &)> m_mutateRotatedEllipse
 
std::function< void(geometrize::RotatedRectangle &)> m_mutateRotatedRectangle
 
std::function< void(geometrize::Triangle &)> m_mutateTriangle
 
geometrize::core::EnergyFunction m_customEnergyFunction
 
std::unique_ptr
< chaiscript::ChaiScript > 
m_engine
 

Detailed Description

The GeometrizerEngine class encapsulates script-based setup and mutation methods for geometrizing shapes.

Constructor & Destructor Documentation

geometrize::script::GeometrizerEngine::GeometrizerEngine ( )
44 {
45 }
std::unique_ptr< chaiscript::ChaiScript > createShapeMutatorEngine()
createShapeMutatorEngine Creates a Chaiscript engine object for mutating shapes.
Definition: chaiscriptcreator.cpp:82
std::unique_ptr< chaiscript::ChaiScript > m_engine
Definition: geometrizerengine.h:471

Here is the call graph for this function:

geometrize::script::GeometrizerEngine::GeometrizerEngine ( const chaiscript::ChaiScript::State &  state)
48 {
49  m_engine->set_state(state);
50 }
std::unique_ptr< chaiscript::ChaiScript > createShapeMutatorEngine()
createShapeMutatorEngine Creates a Chaiscript engine object for mutating shapes.
Definition: chaiscriptcreator.cpp:82
std::unique_ptr< chaiscript::ChaiScript > m_engine
Definition: geometrizerengine.h:471

Here is the call graph for this function:

virtual geometrize::script::GeometrizerEngine::~GeometrizerEngine ( )
virtualdefault
geometrize::script::GeometrizerEngine::GeometrizerEngine ( const GeometrizerEngine )
delete

Member Function Documentation

chaiscript::ChaiScript * geometrize::script::GeometrizerEngine::getEngine ( )

getEngine Gets a pointer to the script engine used by the shape mutation engine.

Returns
A pointer to the script engine used by the shape mutation engine.
53 {
54  return m_engine.get();
55 }
std::unique_ptr< chaiscript::ChaiScript > m_engine
Definition: geometrizerengine.h:471

Here is the caller graph for this function:

void geometrize::script::GeometrizerEngine::installCustomEnergyScript ( const std::string &  functionName,
const std::string &  scriptCode 
)
inlineprivate
229  {
230  try {
231  m_engine->eval(scriptCode);
232  } catch(...) {
233  // Either syntax error or the function was already defined
234  //assert(0 && "Encountered script error when adding custom energy function");
235  }
236 
237  try {
238  const auto f{m_engine->eval<geometrize::core::EnergyFunction>(functionName)};
239 
240  const geometrize::core::EnergyFunction g = [f](
241  const std::vector<geometrize::Scanline>& lines,
242  const std::uint32_t alpha,
243  const geometrize::Bitmap& target,
244  const geometrize::Bitmap& current,
245  geometrize::Bitmap& buffer,
246  const double score) {
247  try {
248  return f(lines, alpha, target, current, buffer, score);
249  } catch(std::exception& e) {
250  std::cout << e.what() << std::endl;
251  return 0.0;
252  }
253  };
254 
256  return;
257  } catch(std::exception& e) {
258  std::cout << e.what() << std::endl;
259  }
260 
261  assert(0 && "Checking for unrecognized required function, will ignore it");
262  }
std::unique_ptr< chaiscript::ChaiScript > m_engine
Definition: geometrizerengine.h:471
void setCustomEnergyFunction(const geometrize::core::EnergyFunction &f)
Definition: geometrizerengine.h:444

Here is the call graph for this function:

Here is the caller graph for this function:

void geometrize::script::GeometrizerEngine::installScripts ( const std::map< std::string, std::string > &  scripts)
58 {
59  installShapeScript<geometrize::Circle>("setupCircle", scripts);
60  installShapeScript<geometrize::Ellipse>("setupEllipse", scripts);
61  installShapeScript<geometrize::Line>("setupLine", scripts);
62  installShapeScript<geometrize::Polyline>("setupPolyline", scripts);
63  installShapeScript<geometrize::QuadraticBezier>("setupQuadraticBezier", scripts);
64  installShapeScript<geometrize::Rectangle>("setupRectangle", scripts);
65  installShapeScript<geometrize::RotatedEllipse>("setupRotatedEllipse", scripts);
66  installShapeScript<geometrize::RotatedRectangle>("setupRotatedRectangle", scripts);
67  installShapeScript<geometrize::Triangle>("setupTriangle", scripts);
68 
69  installShapeScript<geometrize::Circle>("mutateCircle", scripts);
70  installShapeScript<geometrize::Ellipse>("mutateEllipse", scripts);
71  installShapeScript<geometrize::Line>("mutateLine", scripts);
72  installShapeScript<geometrize::Polyline>("mutatePolyline", scripts);
73  installShapeScript<geometrize::QuadraticBezier>("mutateQuadraticBezier", scripts);
74  installShapeScript<geometrize::Rectangle>("mutateRectangle", scripts);
75  installShapeScript<geometrize::RotatedEllipse>("mutateRotatedEllipse", scripts);
76  installShapeScript<geometrize::RotatedRectangle>("mutateRotatedRectangle", scripts);
77  installShapeScript<geometrize::Triangle>("mutateTriangle", scripts);
78 
79  const auto iter = scripts.find("customEnergyFunction");
80  if(iter != scripts.end()) {
81  installCustomEnergyScript(iter->first, iter->second);
82  }
83 }
void installCustomEnergyScript(const std::string &functionName, const std::string &scriptCode)
Definition: geometrizerengine.h:228

Here is the call graph for this function:

template<class T >
void geometrize::script::GeometrizerEngine::installShapeScript ( const std::string &  functionName,
const std::map< std::string, std::string > &  scripts 
)
inlineprivate
191  {
192  try {
193  const auto it{scripts.find(functionName)};
194  assert(it != scripts.end());
195  m_engine->eval(it->second);
196  } catch(...) {
197  // Either syntax error or the function was already defined
198  //assert(0 && "Encountered script error when adding default shape function");
199  }
200 
201  try {
202  const auto f{m_engine->eval<std::function<void(T&)>>(functionName)};
203 
204  const auto g = [f](T& s) {
205  try {
206  f(s);
207  } catch(std::exception& e) {
208  std::cout << e.what() << std::endl;
209  }
210  };
211 
212  const std::string setupPrefix{"setup"};
213  const std::string mutatePrefix{"mutate"};
214  if(functionName.find(setupPrefix) == 0) {
215  setSetupFunction(g);
216  return;
217  } else if(functionName.find(mutatePrefix) == 0) {
219  return;
220  }
221  } catch(std::exception& e) {
222  std::cout << e.what() << std::endl;
223  }
224 
225  assert(0 && "Checking for unrecognized required function, will ignore it");
226  }
void setMutatorFunction(const std::function< void(geometrize::Circle &)> &f)
Definition: geometrizerengine.h:279
std::unique_ptr< chaiscript::ChaiScript > m_engine
Definition: geometrizerengine.h:471
void setSetupFunction(const std::function< void(geometrize::Circle &)> &f)
Definition: geometrizerengine.h:274

Here is the call graph for this function:

geometrize::core::EnergyFunction geometrize::script::GeometrizerEngine::makeEnergyFunction ( ) const
inline

makeEnergyFunction Returns a custom energy function for the core geometrization algorithm.

Returns
An energy function, for passing to an ImageRunner.
75  {
76  auto self(shared_from_this());
77  geometrize::core::EnergyFunction f = [self, this](const std::vector<geometrize::Scanline>& lines,
78  const std::uint32_t alpha,
79  const geometrize::Bitmap& target,
80  const geometrize::Bitmap& current,
81  geometrize::Bitmap& buffer,
82  double score) {
83  return m_customEnergyFunction(lines, alpha, target, current, buffer, score);
84  };
85  return f;
86  }
geometrize::core::EnergyFunction m_customEnergyFunction
Definition: geometrizerengine.h:469
std::function<std::shared_ptr<geometrize::Shape>)> geometrize::script::GeometrizerEngine::makeShapeCreator ( geometrize::ShapeTypes  types,
std::int32_t  w,
std::int32_t  h 
) const
inline

makeShapeCreator Returns a function that generates shapes for the core geometrization algorithm This is passed to the geometrization algorithm and called across many threads. So it's unsafe to change any state used by the script engine while we're busy adding shapes. It also captures "this", meaning the engine won't be destroyed until the shape creation code is finished using it.

Returns
A function that generates shapes for the core geometrization algorithm, for passing to an ImageRunner.
96  {
97  auto self(shared_from_this());
98  auto f = [self, this, types, w, h]() {
99  std::shared_ptr<geometrize::Shape> s = geometrize::randomShapeOf(types);
100 
101  switch(s->getType()) {
102  case geometrize::ShapeTypes::RECTANGLE: {
103  s->setup = [this](geometrize::Shape& s) { return setup(static_cast<geometrize::Rectangle&>(s)); };
104  s->mutate = [this](geometrize::Shape& s) { mutate(static_cast<geometrize::Rectangle&>(s)); };
105  s->rasterize = [w, h](const geometrize::Shape& s) { return geometrize::rasterize(static_cast<const geometrize::Rectangle&>(s), w, h); };
106  break;
107  }
108  case geometrize::ShapeTypes::ROTATED_RECTANGLE: {
109  s->setup = [this](geometrize::Shape& s) { return setup(static_cast<geometrize::RotatedRectangle&>(s)); };
110  s->mutate = [this](geometrize::Shape& s) { mutate(static_cast<geometrize::RotatedRectangle&>(s)); };
111  s->rasterize = [w, h](const geometrize::Shape& s) { return geometrize::rasterize(static_cast<const geometrize::RotatedRectangle&>(s), w, h); };
112  break;
113  }
114  case geometrize::ShapeTypes::TRIANGLE: {
115  s->setup = [this](geometrize::Shape& s) { return setup(static_cast<geometrize::Triangle&>(s)); };
116  s->mutate = [this](geometrize::Shape& s) { mutate(static_cast<geometrize::Triangle&>(s)); };
117  s->rasterize = [w, h](const geometrize::Shape& s) { return geometrize::rasterize(static_cast<const geometrize::Triangle&>(s), w, h); };
118  break;
119  }
120  case geometrize::ShapeTypes::ELLIPSE: {
121  s->setup = [this](geometrize::Shape& s) { return setup(static_cast<geometrize::Ellipse&>(s)); };
122  s->mutate = [this](geometrize::Shape& s) { mutate(static_cast<geometrize::Ellipse&>(s)); };
123  s->rasterize = [w, h](const geometrize::Shape& s) { return geometrize::rasterize(static_cast<const geometrize::Ellipse&>(s), w, h); };
124  break;
125  }
126  case geometrize::ShapeTypes::ROTATED_ELLIPSE: {
127  s->setup = [this](geometrize::Shape& s) { return setup(static_cast<geometrize::RotatedEllipse&>(s)); };
128  s->mutate = [this](geometrize::Shape& s) { mutate(static_cast<geometrize::RotatedEllipse&>(s)); };
129  s->rasterize = [w, h](const geometrize::Shape& s) { return geometrize::rasterize(static_cast<const geometrize::RotatedEllipse&>(s), w, h); };
130  break;
131  }
132  case geometrize::ShapeTypes::CIRCLE: {
133  s->setup = [this](geometrize::Shape& s) { return setup(static_cast<geometrize::Circle&>(s)); };
134  s->mutate = [this](geometrize::Shape& s) { mutate(static_cast<geometrize::Circle&>(s)); };
135  s->rasterize = [w, h](const geometrize::Shape& s) { return geometrize::rasterize(static_cast<const geometrize::Circle&>(s), w, h); };
136  break;
137  }
138  case geometrize::ShapeTypes::LINE: {
139  s->setup = [this](geometrize::Shape& s) { return setup(static_cast<geometrize::Line&>(s)); };
140  s->mutate = [this](geometrize::Shape& s) { mutate(static_cast<geometrize::Line&>(s)); };
141  s->rasterize = [w, h](const geometrize::Shape& s) { return geometrize::rasterize(static_cast<const geometrize::Line&>(s), w, h); };
142  break;
143  }
144  case geometrize::ShapeTypes::QUADRATIC_BEZIER: {
145  s->setup = [this](geometrize::Shape& s) { return setup(static_cast<geometrize::QuadraticBezier&>(s)); };
146  s->mutate = [this](geometrize::Shape& s) { mutate(static_cast<geometrize::QuadraticBezier&>(s)); };
147  s->rasterize = [w, h](const geometrize::Shape& s) { return geometrize::rasterize(static_cast<const geometrize::QuadraticBezier&>(s), w, h); };
148  break;
149  }
150  case geometrize::ShapeTypes::POLYLINE: {
151  s->setup = [this](geometrize::Shape& s) { return setup(static_cast<geometrize::Polyline&>(s)); };
152  s->mutate = [this](geometrize::Shape& s) { mutate(static_cast<geometrize::Polyline&>(s)); };
153  s->rasterize = [w, h](const geometrize::Shape& s) { return geometrize::rasterize(static_cast<const geometrize::Polyline&>(s), w, h); };
154  break;
155  }
156  default:
157  assert(0 && "Bad shape type");
158  }
159 
160  return s;
161  };
162 
163  return f;
164  }
void mutate(geometrize::Circle &shape) const
Definition: geometrizerengine.h:269
void setup(geometrize::Circle &shape) const
Definition: geometrizerengine.h:264

Here is the call graph for this function:

void geometrize::script::GeometrizerEngine::mutate ( geometrize::Circle &  shape) const
inlineprivate
270  {
271  m_mutateCircle(shape);
272  }
std::function< void(geometrize::Circle &)> m_mutateCircle
Definition: geometrizerengine.h:459

Here is the caller graph for this function:

void geometrize::script::GeometrizerEngine::mutate ( geometrize::Ellipse &  shape) const
inlineprivate
290  {
291  m_mutateEllipse(shape);
292  }
std::function< void(geometrize::Ellipse &)> m_mutateEllipse
Definition: geometrizerengine.h:460
void geometrize::script::GeometrizerEngine::mutate ( geometrize::Line &  shape) const
inlineprivate
310  {
311  m_mutateLine(shape);
312  }
std::function< void(geometrize::Line &)> m_mutateLine
Definition: geometrizerengine.h:461
void geometrize::script::GeometrizerEngine::mutate ( geometrize::Polyline &  shape) const
inlineprivate
330  {
331  m_mutatePolyline(shape);
332  }
std::function< void(geometrize::Polyline &)> m_mutatePolyline
Definition: geometrizerengine.h:462
void geometrize::script::GeometrizerEngine::mutate ( geometrize::QuadraticBezier &  shape) const
inlineprivate
350  {
352  }
std::function< void(geometrize::QuadraticBezier &)> m_mutateQuadraticBezier
Definition: geometrizerengine.h:463
void geometrize::script::GeometrizerEngine::mutate ( geometrize::Rectangle &  shape) const
inlineprivate
370  {
371  m_mutateRectangle(shape);
372  }
std::function< void(geometrize::Rectangle &)> m_mutateRectangle
Definition: geometrizerengine.h:464
void geometrize::script::GeometrizerEngine::mutate ( geometrize::RotatedEllipse &  shape) const
inlineprivate
390  {
391  m_mutateRotatedEllipse(shape);
392  }
std::function< void(geometrize::RotatedEllipse &)> m_mutateRotatedEllipse
Definition: geometrizerengine.h:465
void geometrize::script::GeometrizerEngine::mutate ( geometrize::RotatedRectangle &  shape) const
inlineprivate
410  {
412  }
std::function< void(geometrize::RotatedRectangle &)> m_mutateRotatedRectangle
Definition: geometrizerengine.h:466
void geometrize::script::GeometrizerEngine::mutate ( geometrize::Triangle &  shape) const
inlineprivate
430  {
431  m_mutateTriangle(shape);
432  }
std::function< void(geometrize::Triangle &)> m_mutateTriangle
Definition: geometrizerengine.h:467
GeometrizerEngine& geometrize::script::GeometrizerEngine::operator= ( const GeometrizerEngine )
delete
void geometrize::script::GeometrizerEngine::setCustomEnergyFunction ( const geometrize::core::EnergyFunction &  f)
inlineprivate
445  {
447  }
geometrize::core::EnergyFunction m_customEnergyFunction
Definition: geometrizerengine.h:469

Here is the caller graph for this function:

void geometrize::script::GeometrizerEngine::setMutatorFunction ( const std::function< void(geometrize::Circle &)> &  f)
inlineprivate
280  {
281  m_mutateCircle = f;
282  }
std::function< void(geometrize::Circle &)> m_mutateCircle
Definition: geometrizerengine.h:459

Here is the caller graph for this function:

void geometrize::script::GeometrizerEngine::setMutatorFunction ( const std::function< void(geometrize::Ellipse &)> &  f)
inlineprivate
300  {
301  m_mutateEllipse = f;
302  }
std::function< void(geometrize::Ellipse &)> m_mutateEllipse
Definition: geometrizerengine.h:460
void geometrize::script::GeometrizerEngine::setMutatorFunction ( const std::function< void(geometrize::Line &)> &  f)
inlineprivate
320  {
321  m_mutateLine = f;
322  }
std::function< void(geometrize::Line &)> m_mutateLine
Definition: geometrizerengine.h:461
void geometrize::script::GeometrizerEngine::setMutatorFunction ( const std::function< void(geometrize::Polyline &)> &  f)
inlineprivate
340  {
341  m_mutatePolyline = f;
342  }
std::function< void(geometrize::Polyline &)> m_mutatePolyline
Definition: geometrizerengine.h:462
void geometrize::script::GeometrizerEngine::setMutatorFunction ( const std::function< void(geometrize::QuadraticBezier &)> &  f)
inlineprivate
360  {
362  }
std::function< void(geometrize::QuadraticBezier &)> m_mutateQuadraticBezier
Definition: geometrizerengine.h:463
void geometrize::script::GeometrizerEngine::setMutatorFunction ( const std::function< void(geometrize::Rectangle &)> &  f)
inlineprivate
380  {
381  m_mutateRectangle = f;
382  }
std::function< void(geometrize::Rectangle &)> m_mutateRectangle
Definition: geometrizerengine.h:464
void geometrize::script::GeometrizerEngine::setMutatorFunction ( const std::function< void(geometrize::RotatedEllipse &)> &  f)
inlineprivate
400  {
402  }
std::function< void(geometrize::RotatedEllipse &)> m_mutateRotatedEllipse
Definition: geometrizerengine.h:465
void geometrize::script::GeometrizerEngine::setMutatorFunction ( const std::function< void(geometrize::RotatedRectangle &)> &  f)
inlineprivate
420  {
422  }
std::function< void(geometrize::RotatedRectangle &)> m_mutateRotatedRectangle
Definition: geometrizerengine.h:466
void geometrize::script::GeometrizerEngine::setMutatorFunction ( const std::function< void(geometrize::Triangle &)> &  f)
inlineprivate
440  {
441  m_mutateTriangle = f;
442  }
std::function< void(geometrize::Triangle &)> m_mutateTriangle
Definition: geometrizerengine.h:467
void geometrize::script::GeometrizerEngine::setSetupFunction ( const std::function< void(geometrize::Circle &)> &  f)
inlineprivate
275  {
276  m_setupCircle = f;
277  }
std::function< void(geometrize::Circle &)> m_setupCircle
Definition: geometrizerengine.h:449

Here is the caller graph for this function:

void geometrize::script::GeometrizerEngine::setSetupFunction ( const std::function< void(geometrize::Ellipse &)> &  f)
inlineprivate
295  {
296  m_setupEllipse = f;
297  }
std::function< void(geometrize::Ellipse &)> m_setupEllipse
Definition: geometrizerengine.h:450
void geometrize::script::GeometrizerEngine::setSetupFunction ( const std::function< void(geometrize::Line &)> &  f)
inlineprivate
315  {
316  m_setupLine = f;
317  }
std::function< void(geometrize::Line &)> m_setupLine
Definition: geometrizerengine.h:451
void geometrize::script::GeometrizerEngine::setSetupFunction ( const std::function< void(geometrize::Polyline &)> &  f)
inlineprivate
335  {
336  m_setupPolyline = f;
337  }
std::function< void(geometrize::Polyline &)> m_setupPolyline
Definition: geometrizerengine.h:452
void geometrize::script::GeometrizerEngine::setSetupFunction ( const std::function< void(geometrize::QuadraticBezier &)> &  f)
inlineprivate
355  {
357  }
std::function< void(geometrize::QuadraticBezier &)> m_setupQuadraticBezier
Definition: geometrizerengine.h:453
void geometrize::script::GeometrizerEngine::setSetupFunction ( const std::function< void(geometrize::Rectangle &)> &  f)
inlineprivate
375  {
376  m_setupRectangle = f;
377  }
std::function< void(geometrize::Rectangle &)> m_setupRectangle
Definition: geometrizerengine.h:454
void geometrize::script::GeometrizerEngine::setSetupFunction ( const std::function< void(geometrize::RotatedEllipse &)> &  f)
inlineprivate
395  {
397  }
std::function< void(geometrize::RotatedEllipse &)> m_setupRotatedEllipse
Definition: geometrizerengine.h:455
void geometrize::script::GeometrizerEngine::setSetupFunction ( const std::function< void(geometrize::RotatedRectangle &)> &  f)
inlineprivate
415  {
417  }
std::function< void(geometrize::RotatedRectangle &)> m_setupRotatedRectangle
Definition: geometrizerengine.h:456
void geometrize::script::GeometrizerEngine::setSetupFunction ( const std::function< void(geometrize::Triangle &)> &  f)
inlineprivate
435  {
436  m_setupTriangle = f;
437  }
std::function< void(geometrize::Triangle &)> m_setupTriangle
Definition: geometrizerengine.h:457
void geometrize::script::GeometrizerEngine::setup ( geometrize::Circle &  shape) const
inlineprivate
265  {
266  m_setupCircle(shape);
267  }
std::function< void(geometrize::Circle &)> m_setupCircle
Definition: geometrizerengine.h:449

Here is the caller graph for this function:

void geometrize::script::GeometrizerEngine::setup ( geometrize::Ellipse &  shape) const
inlineprivate
285  {
286  m_setupEllipse(shape);
287  }
std::function< void(geometrize::Ellipse &)> m_setupEllipse
Definition: geometrizerengine.h:450
void geometrize::script::GeometrizerEngine::setup ( geometrize::Line &  shape) const
inlineprivate
305  {
306  m_setupLine(shape);
307  }
std::function< void(geometrize::Line &)> m_setupLine
Definition: geometrizerengine.h:451
void geometrize::script::GeometrizerEngine::setup ( geometrize::Polyline &  shape) const
inlineprivate
325  {
326  m_setupPolyline(shape);
327  }
std::function< void(geometrize::Polyline &)> m_setupPolyline
Definition: geometrizerengine.h:452
void geometrize::script::GeometrizerEngine::setup ( geometrize::QuadraticBezier &  shape) const
inlineprivate
345  {
346  m_setupQuadraticBezier(shape);
347  }
std::function< void(geometrize::QuadraticBezier &)> m_setupQuadraticBezier
Definition: geometrizerengine.h:453
void geometrize::script::GeometrizerEngine::setup ( geometrize::Rectangle &  shape) const
inlineprivate
365  {
366  m_setupRectangle(shape);
367  }
std::function< void(geometrize::Rectangle &)> m_setupRectangle
Definition: geometrizerengine.h:454
void geometrize::script::GeometrizerEngine::setup ( geometrize::RotatedEllipse &  shape) const
inlineprivate
385  {
386  m_setupRotatedEllipse(shape);
387  }
std::function< void(geometrize::RotatedEllipse &)> m_setupRotatedEllipse
Definition: geometrizerengine.h:455
void geometrize::script::GeometrizerEngine::setup ( geometrize::RotatedRectangle &  shape) const
inlineprivate
405  {
407  }
std::function< void(geometrize::RotatedRectangle &)> m_setupRotatedRectangle
Definition: geometrizerengine.h:456
void geometrize::script::GeometrizerEngine::setup ( geometrize::Triangle &  shape) const
inlineprivate
425  {
426  m_setupTriangle(shape);
427  }
std::function< void(geometrize::Triangle &)> m_setupTriangle
Definition: geometrizerengine.h:457
void geometrize::script::GeometrizerEngine::signal_scriptEvaluationFailed ( const std::string &  functionName,
const std::string &  code,
const std::string &  errorMessage 
)
signal

signal_scriptEvaluationFailed Signal dispatched when a script fails to parse/evaluate.

Parameters
functionNameThe name of the function.
codeThe code of the function.
errorThe text of the error message, if any.

Here is the caller graph for this function:

void geometrize::script::GeometrizerEngine::signal_scriptEvaluationSucceeded ( const std::string &  functionName,
const std::string &  code 
)
signal

signal_scriptEvaluationSucceeded Signal dispatched when a script is successfully parsed/evaluated.

Parameters
functionNameThe name of the function.
codeThe code of the function.

Here is the caller graph for this function:

Member Data Documentation

geometrize::core::EnergyFunction geometrize::script::GeometrizerEngine::m_customEnergyFunction
private
std::unique_ptr<chaiscript::ChaiScript> geometrize::script::GeometrizerEngine::m_engine
private
std::function<void(geometrize::Circle&)> geometrize::script::GeometrizerEngine::m_mutateCircle
private
std::function<void(geometrize::Ellipse&)> geometrize::script::GeometrizerEngine::m_mutateEllipse
private
std::function<void(geometrize::Line&)> geometrize::script::GeometrizerEngine::m_mutateLine
private
std::function<void(geometrize::Polyline&)> geometrize::script::GeometrizerEngine::m_mutatePolyline
private
std::function<void(geometrize::QuadraticBezier&)> geometrize::script::GeometrizerEngine::m_mutateQuadraticBezier
private
std::function<void(geometrize::Rectangle&)> geometrize::script::GeometrizerEngine::m_mutateRectangle
private
std::function<void(geometrize::RotatedEllipse&)> geometrize::script::GeometrizerEngine::m_mutateRotatedEllipse
private
std::function<void(geometrize::RotatedRectangle&)> geometrize::script::GeometrizerEngine::m_mutateRotatedRectangle
private
std::function<void(geometrize::Triangle&)> geometrize::script::GeometrizerEngine::m_mutateTriangle
private
std::function<void(geometrize::Circle&)> geometrize::script::GeometrizerEngine::m_setupCircle
private
std::function<void(geometrize::Ellipse&)> geometrize::script::GeometrizerEngine::m_setupEllipse
private
std::function<void(geometrize::Line&)> geometrize::script::GeometrizerEngine::m_setupLine
private
std::function<void(geometrize::Polyline&)> geometrize::script::GeometrizerEngine::m_setupPolyline
private
std::function<void(geometrize::QuadraticBezier&)> geometrize::script::GeometrizerEngine::m_setupQuadraticBezier
private
std::function<void(geometrize::Rectangle&)> geometrize::script::GeometrizerEngine::m_setupRectangle
private
std::function<void(geometrize::RotatedEllipse&)> geometrize::script::GeometrizerEngine::m_setupRotatedEllipse
private
std::function<void(geometrize::RotatedRectangle&)> geometrize::script::GeometrizerEngine::m_setupRotatedRectangle
private
std::function<void(geometrize::Triangle&)> geometrize::script::GeometrizerEngine::m_setupTriangle
private

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