Implementation of create_image_settings for generating LaTeX code using PsTricks. More...
Public Member Functions | |
create_pstricks_settings () | |
Default constructor. | |
virtual void | draw_begin (std::ostream &os) const |
virtual void | draw_line (std::ostream &os, float x1, float x2, float y) const |
Draws a circuit line. | |
virtual void | draw_input (std::ostream &os, float x, float y, const std::string &text, bool is_constant) const |
Draws an input name. | |
virtual void | draw_output (std::ostream &os, float x, float y, const std::string &text, bool is_garbage) const |
Draws an output name. | |
virtual void | draw_control (std::ostream &os, float x, float y) const |
Draws a control. | |
virtual void | draw_targets (std::ostream &os, float x, const std::vector< float > &ys, const boost::any &target_tag) const |
Draws a control. | |
virtual void | draw_peres_frame (std::ostream &os, float x1, float y1, float x2, float y2) const |
Draws the frame around Peres Gates. | |
virtual void | draw_gate_line (std::ostream &os, float x, float y1, float y2) const |
Draws a gate line. | |
virtual void | draw_end (std::ostream &os) const |
Stops ending the image. | |
Public Attributes | |
bool | math_emph |
Specifies whether inputs and outputs should be put in $ ... $ math mode. |
Implementation of create_image_settings for generating LaTeX code using PsTricks.
For drawing the circuit the PsTricks package is used. For more information check http://www.pstricks.de
Default constructor.
virtual void draw_begin | ( | std::ostream & | os | ) | const [virtual] |
Implements create_image_settings.
virtual void draw_control | ( | std::ostream & | os, |
float | x, | ||
float | y | ||
) | const [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 |
Implements create_image_settings.
virtual void draw_end | ( | std::ostream & | os | ) | const [virtual] |
Stops ending the image.
This methods is called after finishing painting the image.
os | Output stream of the create_image function |
Implements create_image_settings.
virtual void draw_gate_line | ( | std::ostream & | os, |
float | x, | ||
float | y1, | ||
float | y2 | ||
) | const [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 |
Implements create_image_settings.
virtual void draw_input | ( | std::ostream & | os, |
float | x, | ||
float | y, | ||
const std::string & | text, | ||
bool | is_constant | ||
) | const [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 |
Implements create_image_settings.
virtual void draw_line | ( | std::ostream & | os, |
float | x1, | ||
float | x2, | ||
float | y | ||
) | const [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 |
Implements create_image_settings.
virtual void draw_output | ( | std::ostream & | os, |
float | x, | ||
float | y, | ||
const std::string & | text, | ||
bool | is_garbage | ||
) | const [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 |
Implements create_image_settings.
virtual void draw_peres_frame | ( | std::ostream & | os, |
float | x1, | ||
float | y1, | ||
float | x2, | ||
float | y2 | ||
) | const [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 |
Implements create_image_settings.
virtual void draw_targets | ( | std::ostream & | os, |
float | x, | ||
const std::vector< float > & | ys, | ||
const boost::any & | target_tag | ||
) | const [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 |
Implements create_image_settings.
bool math_emph |
Specifies whether inputs and outputs should be put in $ ... $ math mode.
Default value is false.