Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   Related Pages  

pdf::graph::CState Class Reference

graph state class More...

#include <State.hh>

Collaboration diagram for pdf::graph::CState:

Collaboration graph
[legend]
List of all members.

Public Types

Public Methods

Private Attributes


Detailed Description

graph state class

this class represents the PDF graph state. it contains information like line width, line cap style etc.


Constructor & Destructor Documentation

pdf::graph::CState::CState  
 

default constructor. it will ininitalize the members to their PDF default values.

00036     : m_line_width( 1.0f ), m_line_cap( butt_cap ),
00037       m_line_join( mitter_join ), m_miter_limit( 10.0f ),
00038       m_flatness( 1.0f )
00039 {
00040 }

pdf::graph::CState::CState double    line_width,
ECapStyle    line_cap = butt_cap,
EJoinStyle    line_join = mitter_join,
double    miter_limit = 10.0f,
const CDash   dash = CDash( ),
double    flatness = 1.0f
 

constructor initializes all members with parameters.

Parameters:
line_width  width of line is user space
line_cap  a code specifying the shape of the endpoints for any open path that is stroked
line_join  A code specifying the shape of joints between connected segments of a stroked path
miter_limit  the maximum length of mitered line joins for stroked paths
dash  dash pattern. see its reference for details.
flatness  the precision with which curves are to be rendered on the output device.

00057     : m_line_width( line_width ), m_line_cap( line_cap ),
00058       m_line_join( line_join ), m_miter_limit( miter_limit ),
00059       m_flatness( flatness )
00060 {
00061 }

pdf::graph::CState::CState const CState &    state
 

copy constructor.

00066     : m_line_width( state.m_line_width ),
00067       m_line_cap( state.m_line_cap ),
00068       m_line_join( state.m_line_join ),
00069       m_miter_limit( state.m_miter_limit ),
00070       m_pattern( state.m_pattern ),
00071       m_flatness( state.m_flatness ),
00072       m_line_colour( state.m_line_colour ),
00073       m_fill_colour( state.m_fill_colour )
00074 {
00075 }

pdf::graph::CState::~CState  
 

destructor does nothing

00080 {
00081 }


Member Function Documentation

std::ostream & pdf::graph::CState::Print std::ostream &    os,
const CState &    prev
const
 

print the state into an output stream. like CTextState::Print(), this function takes the previous state as parameter. only the difference between the previous state will be printed.

00108 {
00109     if ( m_line_width != prev.m_line_width )
00110         os << m_line_width  << " w\n" ;
00111     
00112     if ( m_line_colour != prev.m_line_colour )
00113         os << m_line_colour << " RG\n" ;
00114 
00115     if ( m_fill_colour != prev.m_fill_colour )
00116         os << m_fill_colour << " RG\n" ;
00117 
00118     if ( m_line_cap != prev.m_line_cap )
00119         os << m_line_cap    << " J\n" ;
00120     
00121     if ( m_line_join != prev.m_line_join )
00122         os << m_line_join   << " j\n" ;
00123     
00124     if ( m_miter_limit != prev.m_miter_limit )
00125         os << m_miter_limit << " M\n" ;
00126 
00127     if ( m_pattern != prev.m_pattern )
00128         os << m_pattern ;
00129     
00130     if ( m_flatness != prev.m_flatness )
00131         os << m_flatness    << " i\n" ;
00132 
00133     return os ;
00134 }


The documentation for this class was generated from the following files:
Generated on Sun Feb 2 09:17:27 2003 for libpdf++ by doxygen1.2.16