List of all members | Public Member Functions | Public Attributes
create_image_settings Class Referenceabstract

Generic class for the create_image function (Template Design Pattern) More...

Inheritance diagram for create_image_settings:
create_pstricks_settings create_tikz_settings

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...
 

Detailed Description

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.

Member Function Documentation

virtual void draw_after ( std::ostream &  os) const
virtual

User callback for user-defined drawing after the circuit was painted.

Parameters
osOutput stream of the create_image function
Author
RevKit
Since
1.0
virtual void draw_before ( std::ostream &  os) const
virtual

User callback for user-defined drawing before the circuit is painted.

Parameters
osOutput stream of the create_image function
Author
RevKit
Since
1.0
virtual void draw_begin ( std::ostream &  os) const
pure virtual

Begin with drawing.

This method is called when it is started to paint the image.

Parameters
osOutput stream of the create_image function
Author
RevKit
Since
1.0

Implemented in create_tikz_settings, and create_pstricks_settings.

virtual void draw_control ( std::ostream &  os,
float  x,
float  y 
) const
pure virtual

Draws a control.

This methods draws a control

Parameters
osOutput stream of the create_image function
xX-coordinate of the center of the control
yY-coordinate of the center of the control
Author
RevKit
Since
1.0

Implemented in create_tikz_settings, and create_pstricks_settings.

virtual void draw_end ( std::ostream &  os) const
pure virtual

Stops ending the image.

This methods is called after finishing painting the image.

Parameters
osOutput stream of the create_image function
Author
RevKit
Since
1.0

Implemented in create_tikz_settings, and create_pstricks_settings.

virtual void draw_gate_line ( std::ostream &  os,
float  x,
float  y1,
float  y2 
) const
pure virtual

Draws a gate line.

Draws a line from the top most element to the bottom most element

Parameters
osOutput stream of the create_image function
xX-coordinate of the line
y1Top Y-coordinate of the line
y2Bottom Y-coordinate of the line
Author
RevKit
Since
1.0

Implemented in create_tikz_settings, and create_pstricks_settings.

virtual void draw_in_between ( std::ostream &  os) const
virtual

User callback for user-defined drawing after the lines but before the gates are painted.

Parameters
osOutput stream of the create_image function
Author
RevKit
Since
1.0
virtual void draw_input ( std::ostream &  os,
float  x,
float  y,
const std::string &  text,
bool  is_constant 
) const
pure virtual

Draws an input name.

This methods draws an input name at the starting position of a line

Parameters
osOutput stream of the create_image function
xHorizontal starting position of the ascending line
yVertical position of the ascending line
textName of the input
is_constantSpecifies whether the input is a constant input
Author
RevKit
Since
1.0

Implemented in create_tikz_settings, and create_pstricks_settings.

virtual void draw_line ( std::ostream &  os,
float  x1,
float  x2,
float  y 
) const
pure virtual

Draws a circuit line.

This method draws a circuit line.

Parameters
osOutput stream of the create_image function
x1Horizontal starting position of the line
x2Horizontal ending position of the line
yVertical position of the line
Author
RevKit
Since
1.0

Implemented in create_tikz_settings, and create_pstricks_settings.

virtual void draw_output ( std::ostream &  os,
float  x,
float  y,
const std::string &  text,
bool  is_garbage 
) const
pure virtual

Draws an output name.

This methods draws an output name at the starting position of a line

Parameters
osOutput stream of the create_image function
xHorizontal ending position of the ascending line
yVertical position of the ascending line
textName of the output
is_garbageSpecifies whether the output is a garbage output
Author
RevKit
Since
1.0

Implemented in create_tikz_settings, and create_pstricks_settings.

virtual void draw_peres_frame ( std::ostream &  os,
float  x1,
float  y1,
float  x2,
float  y2 
) const
pure virtual

Draws the frame around Peres Gates.

This method draws the frame around Peres gates.

Parameters
osOutput stream of the create_image function
x1Left X-coordinate
y1Bottom Y-coordinate
x2Right X-coordinate
y2Top Y-coordinate
Author
RevKit
Since
1.0

Implemented in create_tikz_settings, and create_pstricks_settings.

virtual void draw_targets ( std::ostream &  os,
float  x,
const std::vector< float > &  ys,
const boost::any &  target_tag 
) const
pure virtual

Draws a control.

This methods draws a control

Parameters
osOutput stream of the create_image function
xX-coordinate of the center of the targets
ysY-coordinates of the centers of the targets
target_tagType of the target
Author
RevKit
Since
1.0

Implemented in create_tikz_settings, and create_pstricks_settings.

Member Data Documentation

float control_radius

Radius of a control element.

No default value, can be different for different create_image_settings implementations.

Author
RevKit
Since
1.0
std::string draw_after_text

Text written after the circuit is printed.

Default value is empty

Author
RevKit
Since
1.0
std::string draw_before_text

Text written before the circuit is printed.

Default value is empty

Author
RevKit
Since
1.0
std::string draw_in_between_text

Text written after the lines but before the gates are printed.

Default value is empty

Author
RevKit
Since
1.0
float elem_height

Height of a gate.

No default value, can be different for different create_image_settings implementations.

Author
RevKit
Since
1.0
float elem_width

Width of a gate.

No default value, can be different for different create_image_settings implementations.

Author
RevKit
Since
1.0
float height

Height of the image.

Set by create_image function

Author
RevKit
Since
1.0
float line_width

Width of a line.

No default value, can be different for different create_image_settings implementations.

Author
RevKit
Since
1.0
float target_radius

Radius of a target element.

No default value, can be different for different create_image_settings implementations.

Author
RevKit
Since
1.0
float width

With of the image.

Set by create_image function

Author
RevKit
Since
1.0

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

Generated on Tue Apr 16 2013 08:12:02 for RevKit by doxygen 1.8.3.1