Generic class for the create_image function (Template Design Pattern) More...
Public Member Functions | |
virtual void | draw_begin (std::ostream &os) const =0 |
Begin with drawing. More... | |
virtual void | draw_line (std::ostream &os, float x1, float x2, float y) const =0 |
Draws a circuit line. More... | |
virtual void | draw_input (std::ostream &os, float x, float y, const std::string &text, bool is_constant) const =0 |
Draws an input name. More... | |
virtual void | draw_output (std::ostream &os, float x, float y, const std::string &text, bool is_garbage) const =0 |
Draws an output name. More... | |
virtual void | draw_control (std::ostream &os, float x, float y) const =0 |
Draws a control. More... | |
virtual void | draw_targets (std::ostream &os, float x, const std::vector< float > &ys, const boost::any &target_tag) const =0 |
Draws a control. More... | |
virtual void | draw_peres_frame (std::ostream &os, float x1, float y1, float x2, float y2) const =0 |
Draws the frame around Peres Gates. More... | |
virtual void | draw_gate_line (std::ostream &os, float x, float y1, float y2) const =0 |
Draws a gate line. More... | |
virtual void | draw_end (std::ostream &os) const =0 |
Stops ending the image. More... | |
virtual void | draw_before (std::ostream &os) const |
User callback for user-defined drawing before the circuit is painted. More... | |
virtual void | draw_in_between (std::ostream &os) const |
User callback for user-defined drawing after the lines but before the gates are painted. More... | |
virtual void | draw_after (std::ostream &os) const |
User callback for user-defined drawing after the circuit was painted. More... | |
Public Attributes | |
float | width |
With of the image. More... | |
float | height |
Height of the image. More... | |
float | elem_width |
Width of a gate. More... | |
float | elem_height |
Height of a gate. More... | |
float | line_width |
Width of a line. More... | |
float | control_radius |
Radius of a control element. More... | |
float | target_radius |
Radius of a target element. More... | |
std::string | draw_before_text |
Text written before the circuit is printed. More... | |
std::string | draw_in_between_text |
Text written after the lines but before the gates are printed. More... | |
std::string | draw_after_text |
Text written after the circuit is printed. More... | |
Generic class for the create_image function (Template Design Pattern)
This class is never used directly. Instead use other derived classes as create_latex_settings or derive an image creation class on your own.
All pure virtual methods have to be implemented and the methods draw_before, draw_in_between and draw_after are supposed to be overridden for special use cases.
|
virtual |
User callback for user-defined drawing after the circuit was painted.
os | Output stream of the create_image function |
|
virtual |
User callback for user-defined drawing before the circuit is painted.
os | Output stream of the create_image function |
|
pure virtual |
Begin with drawing.
This method is called when it is started to paint the image.
os | Output stream of the create_image function |
Implemented in create_tikz_settings, and create_pstricks_settings.
|
pure virtual |
Draws a control.
This methods draws a control
os | Output stream of the create_image function |
x | X-coordinate of the center of the control |
y | Y-coordinate of the center of the control |
Implemented in create_tikz_settings, and create_pstricks_settings.
|
pure virtual |
Stops ending the image.
This methods is called after finishing painting the image.
os | Output stream of the create_image function |
Implemented in create_tikz_settings, and create_pstricks_settings.
|
pure virtual |
Draws a gate line.
Draws a line from the top most element to the bottom most element
os | Output stream of the create_image function |
x | X-coordinate of the line |
y1 | Top Y-coordinate of the line |
y2 | Bottom Y-coordinate of the line |
Implemented in create_tikz_settings, and create_pstricks_settings.
|
virtual |
User callback for user-defined drawing after the lines but before the gates are painted.
os | Output stream of the create_image function |
|
pure virtual |
Draws an input name.
This methods draws an input name at the starting position of a line
os | Output stream of the create_image function |
x | Horizontal starting position of the ascending line |
y | Vertical position of the ascending line |
text | Name of the input |
is_constant | Specifies whether the input is a constant input |
Implemented in create_tikz_settings, and create_pstricks_settings.
|
pure virtual |
Draws a circuit line.
This method draws a circuit line.
os | Output stream of the create_image function |
x1 | Horizontal starting position of the line |
x2 | Horizontal ending position of the line |
y | Vertical position of the line |
Implemented in create_tikz_settings, and create_pstricks_settings.
|
pure virtual |
Draws an output name.
This methods draws an output name at the starting position of a line
os | Output stream of the create_image function |
x | Horizontal ending position of the ascending line |
y | Vertical position of the ascending line |
text | Name of the output |
is_garbage | Specifies whether the output is a garbage output |
Implemented in create_tikz_settings, and create_pstricks_settings.
|
pure virtual |
Draws the frame around Peres Gates.
This method draws the frame around Peres gates.
os | Output stream of the create_image function |
x1 | Left X-coordinate |
y1 | Bottom Y-coordinate |
x2 | Right X-coordinate |
y2 | Top Y-coordinate |
Implemented in create_tikz_settings, and create_pstricks_settings.
|
pure virtual |
Draws a control.
This methods draws a control
os | Output stream of the create_image function |
x | X-coordinate of the center of the targets |
ys | Y-coordinates of the centers of the targets |
target_tag | Type of the target |
Implemented in create_tikz_settings, and create_pstricks_settings.
float control_radius |
Radius of a control element.
No default value, can be different for different create_image_settings implementations.
std::string draw_after_text |
Text written after the circuit is printed.
Default value is empty
std::string draw_before_text |
Text written before the circuit is printed.
Default value is empty
std::string draw_in_between_text |
Text written after the lines but before the gates are printed.
Default value is empty
float elem_height |
Height of a gate.
No default value, can be different for different create_image_settings implementations.
float elem_width |
Width of a gate.
No default value, can be different for different create_image_settings implementations.
float height |
Height of the image.
Set by create_image function
float line_width |
Width of a line.
No default value, can be different for different create_image_settings implementations.
float target_radius |
Radius of a target element.
No default value, can be different for different create_image_settings implementations.
float width |
With of the image.
Set by create_image function