PSImageBase.hpp

Go to the documentation of this file.
00001 #pragma ident "$Id: PSImageBase.hpp 1644 2009-01-27 19:26:14Z ckiesch $"
00002 
00004 
00005 //============================================================================
00006 //
00007 //  This file is part of GPSTk, the GPS Toolkit.
00008 //
00009 //  The GPSTk is free software; you can redistribute it and/or modify
00010 //  it under the terms of the GNU Lesser General Public License as published
00011 //  by the Free Software Foundation; either version 2.1 of the License, or
00012 //  any later version.
00013 //
00014 //  The GPSTk is distributed in the hope that it will be useful,
00015 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 //  GNU Lesser General Public License for more details.
00018 //
00019 //  You should have received a copy of the GNU Lesser General Public
00020 //  License along with GPSTk; if not, write to the Free Software Foundation,
00021 //  Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022 //  
00023 //  Copyright 2004, The University of Texas at Austin
00024 //
00025 //============================================================================
00026 
00027 
00028 #ifndef VDRAW_PSIMAGEBASE_H
00029 #define VDRAW_PSIMAGEBASE_H
00030 
00031 #include <string>
00032 #include <iostream>
00033 #include <fstream>
00034 
00035 #include "VDrawException.hpp"
00036 #include "VGImage.hpp"
00037 #include "StrokeStyle.hpp"
00038 
00039 namespace vdraw
00040 {
00043 
00048    class PSImageBase : public VGImage {
00049 
00050    public:
00051 
00059       PSImageBase(std::ostream& stream, 
00060                            double width=US_LETTER_WIDTH_PTS, 
00061                            double height=US_LETTER_HEIGHT_PTS, 
00062                            ORIGIN_LOCATION iloc=LOWER_LEFT);
00063 
00071       PSImageBase(const char* fname, 
00072                            double width=US_LETTER_WIDTH_PTS, 
00073                            double height=US_LETTER_HEIGHT_PTS, 
00074                            ORIGIN_LOCATION iloc=LOWER_LEFT);
00075 
00077       ~PSImageBase(void);
00078 
00079       void setMarker( const Marker& newMarker ) 
00080         {VGImage::setMarker(newMarker);defineMarker(newMarker,"dflt");}
00081 
00082       void comment(const Comment& comment);
00083 
00084       using VGImage::comment;
00085 
00086       void line(const Line& line);
00087 
00088       using VGImage::line;
00089 
00090       void rectangle (const Rectangle& rect);
00091 
00092       void circle (const Circle& circle);
00093 
00094       void polygon (const Polygon& polygon);
00095 
00096       void bitmap(const Bitmap& bitmap);      
00097 
00098       void text (const Text& text);
00099 
00100    protected:
00101 
00103       std::ofstream myfstream;
00104 
00106       std::ostream& ostr;
00107 
00109       std::string filename;
00110 
00115       StrokeStyle lastUsedStrokeStyle;
00116 
00118       TextStyle lastUsedTextStyle;
00119 
00120       using VGImage::StyleType;
00121       using VGImage::getCorrectStrokeStyle;
00122       using VGImage::getCorrectMarker;
00123       using VGImage::getCorrectTextStyle;
00124       using VGImage::getCorrectFillColor;
00125 
00126    private:
00127 
00129       void updateStrokeStyle(StrokeStyle& ss);
00130 
00132       void printStrokeStyle(void);
00133 
00135       void printTextStyle(const TextStyle& ts);
00136 
00138       void printStrokeStyle(const StrokeStyle& style);
00139 
00141       void outputPath(const Path& path);
00142 
00144       std::string fillWithColor(const Color& color) const;
00145 
00147       static const bool extraComments=true;
00148 
00152       void defineMarker(const Marker& mark, const char * markername=0);
00153 
00154       void markPath(const Path& path, const char * name="mark");
00155 
00156 
00157       // This determines if a marker of some sort has been defined yet.
00158       bool markerDefined;
00159 
00160       // This contains the last defined marker.
00161       Marker lastMarker;
00162 
00167 
00168       bool strokeStylePrinted;
00169 
00171       bool textStylePrinted;
00172 
00179 
00180        bool centerDefined;
00181 
00183        bool rightDefined;
00184 
00185 
00186    }; // class PSImageBase
00187 
00189 
00190 } // namespace vdraw
00191 #endif //VDRAW_PSIMAGEBASE_H
00192 

Generated on Wed Feb 8 03:31:01 2012 for GPS ToolKit Software Library by  doxygen 1.3.9.1