#include <Path.hh>
Collaboration diagram for pdf::graph::CPath:
a path is a line with specified properties, e.g. line colour, fill colour. it will contain vertices also.
|
an enum to specify how to paint the path.
00054 { 00055 stoke, 00056 00057 close_stoke, 00058 00059 fill_non_zero, 00060 00061 00062 00063 fill_even_odd, 00064 00065 00066 fill_stoke_non_zero, 00067 00068 00069 00070 fill_stoke_even_odd, 00071 00072 00073 00074 close_fill_stoke_non_zero, 00075 00076 00077 00078 close_fill_stoke_even_odd, 00079 00080 00081 00082 no_op 00083 00084 00085 } ; |
|
initialize a path by setting the paint operation and the state of this path.
00052 : m_state( state ), m_paint_op( op ) 00053 { 00054 assert( IsValid( ) ) ; 00055 } |
|
destructor does nothing
00060 { 00061 assert( IsValid( ) ) ; 00062 } |
|
begin a new subpath by moving the current point to coordinates (x y), omitting any connecting line segment.
00068 { 00069 assert( IsValid( ) ) ; 00070 00071 m_nodes.push_back( CNodePtr( new CNode2( x, y, "m" ) ) ) ; 00072 00073 assert( IsValid( ) ) ; 00074 } |
|
append a straight line segment from the current point to the point (x y). the new current point is (x y).
00080 { 00081 assert( IsValid( ) ) ; 00082 00083 m_nodes.push_back( CNodePtr( new CNode2( x, y, "l" ) ) ) ; 00084 00085 assert( IsValid( ) ) ; 00086 } |
|
append a cubic Bézier curve to the current path.The curve extends from the current point to the point (x3 ,y3), using (x1 ,y1) and (x2 ,y2) as the Bézier control points. the new current point is (x3, y3).
00134 { 00135 double array[6] = { x1, y1, x2, y2, x3, y3 } ; 00136 m_nodes.push_back( CNodePtr( new CNodes( array, array + 6, "c" ) ) ) ; 00137 } |
|
append a cubic Bézier curve to the current path.The curve extends from the current point to the point (x3, y3), using (x1, y1) and (x3, y3) as the Bézier control points. the new current point is (x3, y3).
00144 { 00145 double array[4] = { x1, y1, x3, y3 } ; 00146 m_nodes.push_back( CNodePtr( new CNodes( array, array + 4, "y" ) ) ) ; 00147 } |
|
close the current subpath by appending a straight line segment from the current point to the starting point of the subpath.
00109 { 00110 assert( IsValid( ) ) ; 00111 00112 m_nodes.push_back( CNodePtr( new COperator( "h" ) ) ) ; 00113 00114 assert( IsValid( ) ) ; 00115 } |
|
change the paint operation.
00120 { 00121 assert( IsValid( ) ) ; 00122 00123 m_paint_op = op ; 00124 00125 assert( IsValid( ) ) ; 00126 } |
|
write the path object to a output stream
00091 { 00092 assert( IsValid( ) ) ; 00093 00094 using namespace boost::lambda ; 00095 using namespace std ; 00096 00097 m_state.Print( os, prev ) ; 00098 00099 transform( m_nodes.begin( ), m_nodes.end( ), 00100 ostream_iterator<CNode>( os, "\n" ), ret<const CNode&>( *_1 ) ) ; 00101 00102 return os << paint_ops[m_paint_op] << '\n' ; 00103 } |
|
a vector of nodes, making the path.
|
|
the graphic state of the path.
|
|
the paint operation
|