| TerraLib 4.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/functions/TeSPRFile.h
Go to the documentation of this file.

    00001 /************************************************************************************
    00002  TerraLib - a library for developing GIS applications.
    00003 Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.
    00004
    00005 This code is part of the TerraLib library.
    00006 This library is free software; you can redistribute it and/or
    00007 modify it under the terms of the GNU Lesser General Public
    00008 License as published by the Free Software Foundation; either
    00009 version 2.1 of the License, or (at your option) any later version.
    00010
    00011 You should have received a copy of the GNU Lesser General Public
    00012 License along with this library.
    00013
    00014 The authors reassure the license terms regarding the warranties.
    00015 They specifically disclaim any warranties, including, but not limited to,
    00016 the implied warranties of merchantability and fitness for a particular purpose.
    00017 The library provided hereunder is on an "as is" basis, and the authors have no
    00018 obligation to provide maintenance, support, updates, enhancements, or modifications.
    00019 In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
    00020 indirect, special, incidental, or consequential damages arising out of the use
    00021 of this library and its documentation.
    00022 *************************************************************************************/
    00026 #ifndef  __TERRALIB_INTERNAL_SPRFILE_H
    00027 #define  __TERRALIB_INTERNAL_SPRFILE_H
    00028
    00029 #include "../kernel/TeAsciiFile.h"
    00030 #include "../kernel/TeDataTypes.h"
    00031 #include "../kernel/TeCoord2D.h"
    00032 #include "../kernel/TeAttribute.h"
    00033 #include "../kernel/TeProjection.h"
    00034
    00035 #include "TeFunctionsDefines.h"
    00036
    00037 #include <string>
    00038 #include <stdio.h>
    00039 using namespace std;
    00040
    00042 class TLFUNCTIONS_DLL TeSPRFile : public TeAsciiFile
    00043 {
    00044 public:
    00045
    00047
    00048            TeSPRFile(const string& fileName, const char* mode, char separator = ';');
    00049
    00051
    00052            virtual ~TeSPRFile() {}
    00053
    00055            void writeLinesHeader ();
    00056
    00058            void writeLine3DHeader()
    00059            { fprintf ( file_,"LINE3D\n"); }
    00060
    00062            void writeCoord ( const double& x, const double& y)
    00063 {          fprintf ( file_," %.6f %.6f\n", x, y ); }
    00064
    00066            void writeLabelHeader ( const int& option );
    00067
    00069            void  writeCadastralLabel ( const string& geoid, const double& x, const double& y,
    00070                                  const string& objectCategory = "");
    00071
    00073            void writeNetworkLabel ( const string& geoid, const double& x, const double& y,
    00074                                                           const string& objectCategory, bool isL=true);
    00075
    00077            void writeThematicLabel( const double& x, const double& y, const string& theme );
    00078
    00080            void writeThematicPoint( const double& x, const double& y, const string& theme );
    00081
    00083            void writePointsHeader();
    00084
    00086            void writePoint3DHeader()
    00087            { fprintf ( file_,"POINT3D\n"); }
    00088
    00090            void writePoint3D( const double& x, const double& y, const double& quote )
    00091            { fprintf ( file_," %.6f %.6f %.10E\n", x, y, quote ); }
    00092
    00094            void writePoint ( TeCoord2D& p )
    00095            { this->writeCoord ( p.x(), p.y() ); }
    00096
    00098            void writeNetworkHeader();
    00099
    00101            void writeArcHeader ( const string& geoid, const double& posImp = 0.,
    00102                       const double& negImp= 0., const double& demand = 0. );
    00103
    00105            void writeNetworkLineHeader(int id )
    00106            { fprintf ( file_,"%d 1 1 0.0\n", id ); }
    00107
    00109            void writeNetworkLabelHeader();
    00110
    00112            void writeTableHeader( const int& dType );
    00113
    00115            void writeAttributeInfo ( TeAttributeList&, const string&, const string& indexName = "" );
    00116
    00118            void writeTextParameterInfo ( const string& name, int w = 0);
    00119
    00121            void writeRealParameterInfo ( const string& );
    00122
    00124            void writeIntParameterInfo  ( const string& );
    00125
    00127            void writeGeoId ( const string& geoid )
    00128            { fprintf ( file_, "%s%c%s", geoid.c_str(), separator_, geoid.c_str() ); }
    00129
    00131            void writeValue ( const string& attrName, TeAttrDataType type );
    00132
    00134            void writeValue ( const int& value )
    00135            { fprintf ( file_, "%c%d", separator_, value ); }
    00136
    00138            void writeValue ( const double& value )
    00139            { fprintf ( file_, "%c%.10E", separator_, (float)value ); }
    00140
    00142            void writeValue ( const string& value )
    00143            { fprintf ( file_, "%c%s", separator_,value.c_str() ); }
    00144
    00146            void writeSampleHeader();
    00147
    00149            void writeSample ( const string& index, const double& x, const double& y,
    00150                       const string& value);
    00151
    00153            void writeSampleQuote( double quote )
    00154            { fprintf ( file_,"HEIGHT %.10E\n", quote ); }
    00155
    00157            void writeProjection ( TeProjection* );
    00158
    00160            void writeBox ( TeBox& );
    00161
    00163            void writeInfoEnd ()
    00164            { fprintf ( file_, "%s\n", "INFO_END"); }
    00165
    00167            void writeEnd ()
    00168            { fprintf ( file_, "%s \n", "END" ); }
    00169
    00171            void setSeparator ( const char& c )
    00172            { separator_ = c ; }
    00173
    00175            char separator ()
    00176            { return separator_; }
    00177
    00179
    00180 private:
    00181
    00182            TeSPRFile(const TeSPRFile&);
    00183            TeSPRFile& operator=(const TeSPRFile&){return *this;}
    00184            char       separator_;
    00185 };
    00186
    00187 #endif
    00188

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines