LCOV - code coverage report
Current view: directory - ogr/ogrsf_frmts/ili - ogr_ili1.h (source / functions) Found Hit Coverage
Test: gdal_filtered.info Lines: 5 1 20.0 %
Date: 2011-12-18 Functions: 5 1 20.0 %

       1                 : /******************************************************************************
       2                 :  * $Id: ogr_ili1.h 15268 2008-08-31 19:03:09Z pka $
       3                 :  *
       4                 :  * Project:  Interlis 1 Translator
       5                 :  * Purpose:   Definition of classes for OGR Interlis 1 driver.
       6                 :  * Author:   Pirmin Kalberer, Sourcepole AG
       7                 :  *
       8                 :  ******************************************************************************
       9                 :  * Copyright (c) 2004, Pirmin Kalberer, Sourcepole AG
      10                 :  *
      11                 :  * Permission is hereby granted, free of charge, to any person obtaining a
      12                 :  * copy of this software and associated documentation files (the "Software"),
      13                 :  * to deal in the Software without restriction, including without limitation
      14                 :  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
      15                 :  * and/or sell copies of the Software, and to permit persons to whom the
      16                 :  * Software is furnished to do so, subject to the following conditions:
      17                 :  *
      18                 :  * The above copyright notice and this permission notice shall be included
      19                 :  * in all copies or substantial portions of the Software.
      20                 :  *
      21                 :  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
      22                 :  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
      23                 :  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
      24                 :  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
      25                 :  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
      26                 :  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
      27                 :  * DEALINGS IN THE SOFTWARE.
      28                 :  ****************************************************************************/
      29                 : 
      30                 : #ifndef _OGR_ILI1_H_INCLUDED
      31                 : #define _OGR_ILI1_H_INCLUDED
      32                 : 
      33                 : #include "ogrsf_frmts.h"
      34                 : #include "ili1reader.h"
      35                 : 
      36                 : 
      37                 : 
      38                 : class OGRILI1DataSource;
      39                 : 
      40                 : /************************************************************************/
      41                 : /*                           OGRILI1Layer                               */
      42                 : /************************************************************************/
      43                 : 
      44                 : class OGRILI1Layer : public OGRLayer
      45                 : {
      46                 : private:
      47                 :     OGRSpatialReference *poSRS;
      48                 :     OGRFeatureDefn      *poFeatureDefn;
      49                 : 
      50                 :     OGRILI1Layer        *poSurfacePolyLayer; //Corresponding poly layer for surfaces
      51                 :     OGRILI1Layer        *poAreaReferenceLayer; //corresponding point layer for AREA's
      52                 :     OGRILI1Layer        *poAreaLineLayer; //corresponding line layer with AREA's
      53                 : 
      54                 :     int                 nFeatures;
      55                 :     OGRFeature          **papoFeatures;
      56                 :     int                 nFeatureIdx;
      57                 : 
      58                 :     int                 bWriter;
      59                 : 
      60                 :     OGRILI1DataSource   *poDS;
      61                 : 
      62                 :   public:
      63                 :                         OGRILI1Layer( const char * pszName,
      64                 :                                      OGRSpatialReference *poSRS,
      65                 :                                      int bWriter,
      66                 :                                      OGRwkbGeometryType eType,
      67                 :                                      OGRILI1DataSource *poDS );
      68                 : 
      69                 :                        ~OGRILI1Layer();
      70                 : 
      71                 :     OGRErr              AddFeature(OGRFeature *poFeature);
      72                 : 
      73                 :     void                ResetReading();
      74                 :     OGRFeature *        GetNextFeature();
      75                 :     OGRFeature *        GetNextFeatureRef();
      76                 :     OGRFeature *        GetFeatureRef( long nFID );
      77                 : 
      78                 :     void                SetSurfacePolyLayer(OGRILI1Layer *poSurfacePolyLayer);
      79                 :     void                SetAreaLayers(OGRILI1Layer *poReferenceLayer, OGRILI1Layer *poAreaLineLayer);
      80                 : 
      81                 :     int                 GetFeatureCount( int bForce = TRUE );
      82                 : 
      83                 :     OGRErr              CreateFeature( OGRFeature *poFeature );
      84                 :     int                 GeometryAppend( OGRGeometry *poGeometry );
      85                 : 
      86               0 :     OGRFeatureDefn *    GetLayerDefn() { return poFeatureDefn; }
      87                 : 
      88                 :     OGRErr              CreateField( OGRFieldDefn *poField, int bApproxOK = TRUE );
      89                 : 
      90                 :     OGRSpatialReference *GetSpatialRef();
      91                 : 
      92                 :     int                 TestCapability( const char * );
      93                 : 
      94                 :   private:
      95                 :     void                JoinSurfaceLayer();
      96                 :     OGRMultiPolygon*    Polygonize( OGRGeometryCollection* poLines, bool fix_crossing_lines = false );
      97                 :     void                PolygonizeAreaLayer();
      98                 : };
      99                 : 
     100                 : /************************************************************************/
     101                 : /*                          OGRILI1DataSource                           */
     102                 : /************************************************************************/
     103                 : 
     104                 : class OGRILI1DataSource : public OGRDataSource
     105                 : {
     106                 :   private:
     107                 :     char       *pszName;
     108                 :     IILI1Reader *poReader;
     109                 :     FILE       *fpTransfer;
     110                 :     char       *pszTopic;
     111                 :     int         nLayers;
     112                 :     OGRILI1Layer** papoLayers;
     113                 : 
     114                 :   public:
     115                 :                 OGRILI1DataSource();
     116                 :                ~OGRILI1DataSource();
     117                 : 
     118                 :     int         Open( const char *, int bTestOpen );
     119                 :     int         Create( const char *pszFile, char **papszOptions );
     120                 : 
     121               0 :     const char *GetName() { return pszName; }
     122               0 :     int         GetLayerCount() { return poReader ? poReader->GetLayerCount() : 0; }
     123                 :     OGRLayer   *GetLayer( int );
     124                 : 
     125               0 :     FILE       *GetTransferFile() { return fpTransfer; }
     126                 : 
     127                 :     virtual OGRLayer *CreateLayer( const char *,
     128                 :                                       OGRSpatialReference * = NULL,
     129                 :                                       OGRwkbGeometryType = wkbUnknown,
     130                 :                                       char ** = NULL );
     131                 : 
     132                 :     int         TestCapability( const char * );
     133                 : };
     134                 : 
     135                 : /************************************************************************/
     136                 : /*                            OGRILI1Driver                             */
     137                 : /************************************************************************/
     138                 : 
     139                 : class OGRILI1Driver : public OGRSFDriver
     140             178 : {
     141                 :   public:
     142                 :                 ~OGRILI1Driver();
     143                 : 
     144                 :     const char *GetName();
     145                 :     OGRDataSource *Open( const char *, int );
     146                 : 
     147                 :     virtual OGRDataSource *CreateDataSource( const char *pszName,
     148                 :                                              char ** = NULL );
     149                 : 
     150                 :     int                 TestCapability( const char * );
     151                 : };
     152                 : 
     153                 : #endif /* _OGR_ILI1_H_INCLUDED */

Generated by: LCOV version 1.7