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

State.hh

00001 /*
00002     libpdf++: a C++ Free library to generate PDF file
00003     Copyright (C) 2002 Nestal Wan
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Lesser General Public
00007     License as published by the Free Software Foundation; either
00008     version 2.1 of the License, or (at your option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Lesser General Public License for more details.
00014 
00015     You should have received a copy of the GNU Lesser General Public
00016     License along with this library; if not, write to the Free Software
00017     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 */
00026 #ifndef __PDF_GRAPH_STATE_HEADER_INCLUDED__
00027 #define __PDF_GRAPH_STATE_HEADER_INCLUDED__
00028 
00029 #ifndef __PDF_UTIL_COLOUR_HEADER_INCLUDED__
00030 #include "util/Colour.hh"
00031 #endif
00032 
00033 #ifndef __PDF_UTIL_MATRIX2D_HEADER_INCLUDED__
00034 #include "util/Matrix2D.hh"
00035 #endif
00036 
00037 #ifndef __PDF_GRAPH_DASH_HEADER_INCLUDED__
00038 #include "Dash.hh"
00039 #endif
00040 
00041 #include <iosfwd>
00042 
00043 namespace pdf { namespace graph {
00044 
00052 class CState
00053 {
00054 public :
00055     enum ECapStyle  { butt_cap = 0,    round_cap = 1,  square_cap = 2 } ;
00056     enum EJoinStyle { mitter_join = 0, round_join = 1, bevel_join = 2 } ;
00057 
00058 private :
00059     double      m_line_width ;
00060     ECapStyle   m_line_cap ;
00061     EJoinStyle  m_line_join ;
00062     double      m_miter_limit ;
00063     CDash       m_pattern ;
00064     
00065     // there should be a rendering intent here, but I don't understand what it
00066     // is.
00067     
00068     double m_flatness ;
00069     
00070     util::CMatrix2D m_transform ;
00071     
00072     util::CColour   m_line_colour, m_fill_colour ;
00073 
00074 public :
00075     CState( ) ;
00076     CState( double line_width, ECapStyle line_cap = butt_cap,
00077             EJoinStyle line_join = mitter_join, double miter_limit = 10.0f,
00078             const CDash& dash = CDash( ), double flatness = 1.0f ) ;
00079     CState( const CState& state ) ;
00080     ~CState( ) ;
00081 
00082     CState& operator=( const CState& state ) ;
00083     void Swap( CState& state ) ;
00084 
00085     std::ostream& Print( std::ostream& os, const CState& prev ) const ;
00086 
00087     const util::CColour& LineColour( ) const ;
00088     void LineColour( const util::CColour& colour ) ; 
00089 
00090     const util::CColour& FillColour( ) const ;
00091     void FillColour( const util::CColour& colour ) ; 
00092 } ;
00093 
00094 /*
00095 inline std::ostream& operator<<( std::ostream& os, const CState& state )
00096 {
00097     return state.Print( os ) ;
00098 }
00099 */
00100 } } // end of namespace
00101 
00102 #endif

Generated on Sun Feb 2 09:16:05 2003 for libpdf++ by doxygen1.2.16