Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages  

sdts_al.h

This is the verbatim text of the sdts_al.h include file.

#ifndef SDTS_AL_H_INCLUDED
#define STDS_AL_H_INCLUDED

#include "cpl_conv.h"
#include "iso8211.h"

class SDTS_IREF;
class SDTSModId;
class SDTSTransfer;

#define SDTS_SIZEOF_SADR	8

char **SDTSScanModuleReferences( DDFModule *, const char * );

/*                              SDTS_IREF                               */

class SDTS_IREF
{
    int		nDefaultSADRFormat;

  public:
    		SDTS_IREF();
		~SDTS_IREF();

    int         Read( const char *pszFilename );

    char	*pszXAxisName;			/* XLBL */
    char  	*pszYAxisName;			/* YLBL */

    double	dfXScale;			/* SFAX */
    double      dfYScale;			/* SFAY */

    double	dfXOffset;			/* XORG */
    double	dfYOffset;			/* YORG */

    double      dfXRes;				/* XHRS */
    double      dfYRes;				/* YHRS */

    char  	*pszCoordinateFormat;		/* HFMT */

    int		GetSADRCount( DDFField * );
    int		GetSADR( DDFField *, int, double *, double *, double * );
};

/*                              SDTS_XREF                               */


class SDTS_XREF
{
  public:
    		SDTS_XREF();
		~SDTS_XREF();

    int         Read( const char *pszFilename );

    
    char	*pszSystemName;

    
    char	*pszDatum;

    
    int		nZone;		      	      
};

/*                              SDTS_CATD                               */

class SDTS_CATDEntry;



typedef enum {
  SLTUnknown,
  SLTPoint,
  SLTLine,
  SLTAttr,
  SLTPoly,
  SLTRaster
} SDTSLayerType;


class SDTS_CATD
{
    char	*pszPrefixPath;

    int		nEntries;
    SDTS_CATDEntry **papoEntries;

  public:
    		SDTS_CATD();
                ~SDTS_CATD();

    int         Read( const char * pszFilename );

    const char  *GetModuleFilePath( const char * pszModule );

    int		GetEntryCount() { return nEntries; }
    const char * GetEntryModule(int);
    const char * GetEntryTypeDesc(int);
    const char * GetEntryFilePath(int);
    SDTSLayerType GetEntryType(int);
};

/*                              SDTSModId                               */

class SDTSModId
{
  public:
    		SDTSModId() { szModule[0] = '\0';
                              nRecord = -1;
                	      szOBRP[0] = '\0'; }

    int		Set( DDFField * );

    const char *GetName();

    
    char	szModule[8];

    
    long	nRecord;

    
    char	szOBRP[8]; 
};

/*                             SDTSFeature                              */

class SDTSFeature
{
public:

    virtual            ~SDTSFeature();

    
    SDTSModId		oModId;

#define MAX_ATID	4
    
    int		nAttributes;

    
    SDTSModId	aoATID[MAX_ATID];

    void        ApplyATID( DDFField * );

    
    virtual void Dump( FILE * ) = 0;
};

/*                          SDTSIndexedReader                           */


class SDTSIndexedReader
{
    int			nIndexSize;
    SDTSFeature	      **papoFeatures;

    int			iCurrentFeature;

protected:    
    DDFModule   	oDDFModule;

public:
    			SDTSIndexedReader();
    virtual            ~SDTSIndexedReader();

    virtual SDTSFeature  *GetNextRawFeature() = 0;

    SDTSFeature	       *GetNextFeature();

    virtual void        Rewind();

    void		FillIndex();
    void		ClearIndex();
    int			IsIndexed();

    SDTSFeature	       *GetIndexedFeatureRef( int );
    char **		ScanModuleReferences( const char * = "ATID" );
};

/*                             SDTSRawLine                              */


class SDTSRawLine : public SDTSFeature
{
  public:
    		SDTSRawLine();
    virtual    ~SDTSRawLine();

    int         Read( SDTS_IREF *, DDFRecord * );

    
    int		nVertices;

    
    double	*padfX;
    
    double	*padfY;
    
    double	*padfZ;

    
    SDTSModId	oLeftPoly;

    
    SDTSModId	oRightPoly;

    
    SDTSModId	oStartNode;		/* SNID */

    
    SDTSModId	oEndNode;		/* ENID */

    void	Dump( FILE * );
};

/*                            SDTSLineReader                            */
/*                                                                      */
/*      Class for reading any of the files lines.                       */






class SDTSLineReader : public SDTSIndexedReader
{
    SDTS_IREF	*poIREF;

  public:
    		SDTSLineReader( SDTS_IREF * );
                ~SDTSLineReader();

    int         Open( const char * );
    SDTSRawLine *GetNextLine( void );
    void	Close();

    SDTSFeature *GetNextRawFeature( void ) { return GetNextLine(); }

    void        AttachToPolygons( SDTSTransfer * );
};

/*                            SDTSAttrRecord                            */




class SDTSAttrRecord : public SDTSFeature
{
  public:
    		SDTSAttrRecord();
    virtual    ~SDTSAttrRecord();

    
    DDFRecord   *poWholeRecord;

    

    DDFField    *poATTR;

    virtual void Dump( FILE * );
};

/*                            SDTSAttrReader                            */


class SDTSAttrReader : public SDTSIndexedReader
{
    SDTS_IREF	*poIREF;

    int		bIsSecondary;

  public:
    		SDTSAttrReader( SDTS_IREF * );
   virtual     ~SDTSAttrReader();

    int         Open( const char * );
    DDFField	*GetNextRecord( SDTSModId * = NULL,
                                DDFRecord ** = NULL,
                                int bDuplicate = FALSE );
    SDTSAttrRecord *GetNextAttrRecord();
    void	Close();

    
    int		IsSecondary() { return bIsSecondary; }

    SDTSFeature *GetNextRawFeature( void ) { return GetNextAttrRecord(); }
};

/*                             SDTSRawPoint                             */

class SDTSRawPoint : public SDTSFeature
{
  public:
    		SDTSRawPoint();
    virtual    ~SDTSRawPoint();

    int         Read( SDTS_IREF *, DDFRecord * );

    
    double	dfX;
    
    double	dfY;
    
    double	dfZ;

    
    SDTSModId   oAreaId;		/* ARID */

    virtual void Dump( FILE * );
};

/*                           SDTSPointReader                            */


class SDTSPointReader : public SDTSIndexedReader
{
    SDTS_IREF	*poIREF;

  public:
    		SDTSPointReader( SDTS_IREF * );
    virtual    ~SDTSPointReader();

    int         Open( const char * );
    SDTSRawPoint *GetNextPoint( void );
    void	Close();

    SDTSFeature *GetNextRawFeature( void ) { return GetNextPoint(); }
};

/*                             SDTSRawPolygon                           */








class SDTSRawPolygon : public SDTSFeature
{
    void        AddEdgeToRing( int, double *, double *, double *, int, int );

  public:
    		SDTSRawPolygon();
    virtual    ~SDTSRawPolygon();

    int         Read( DDFRecord * );

    int		nEdges;
    SDTSRawLine **papoEdges;

    void	AddEdge( SDTSRawLine * );

    
    int		AssembleRings();

    
    int		nRings;
    
    int		nVertices;
    
    int		*panRingStart;

    
    double	*padfX;
    
    double      *padfY;
    
    double      *padfZ;

    virtual void Dump( FILE * );
};

/*                          SDTSPolygonReader                           */


class SDTSPolygonReader : public SDTSIndexedReader
{
    int		bRingsAssembled;

  public:
    		SDTSPolygonReader();
    virtual    ~SDTSPolygonReader();

    int         Open( const char * );
    SDTSRawPolygon *GetNextPolygon( void );
    void	Close();

    SDTSFeature *GetNextRawFeature( void ) { return GetNextPolygon(); }

    void	AssembleRings( SDTSTransfer * );
};

/*                           SDTSRasterReader                           */




class SDTSRasterReader
{
    DDFModule	oDDFModule;

    char	szModule[20];

    int		nXSize;
    int		nYSize;
    int		nXBlockSize;
    int		nYBlockSize;

    int		nXStart;		/* SOCI */
    int		nYStart;		/* SORI */

    char	szINTR[4];		/* CE is center, TL is top left */
    char	szFMT[32];
    char	szUNITS[64];
    char	szLabel[64];

    double	adfTransform[6];

  public:
    		SDTSRasterReader();
                ~SDTSRasterReader();

    int         Open( SDTS_CATD * poCATD, SDTS_IREF *,
                      const char * pszModule  );
    void	Close();

    int		GetRasterType();	/* 1 = int16, see GDAL types */

    int		GetTransform( double * );

    


    int		GetXSize() { return nXSize; }
    


    int		GetYSize() { return nYSize; }

    
    int		GetBlockXSize() { return nXBlockSize; }
    
    int		GetBlockYSize() { return nYBlockSize; }

    int		GetBlock( int nXOffset, int nYOffset, void * pData );
};

/*                             SDTSTransfer                             */






class SDTSTransfer
{
  public:
    		SDTSTransfer();
                ~SDTSTransfer();

    int		Open( const char * );
    void	Close();

    int		FindLayer( const char * );
    int		GetLayerCount() { return nLayers; }
    SDTSLayerType GetLayerType( int );
    int		GetLayerCATDEntry( int );

    SDTSLineReader *GetLayerLineReader( int );
    SDTSPointReader *GetLayerPointReader( int );
    SDTSPolygonReader *GetLayerPolygonReader( int );
    SDTSAttrReader *GetLayerAttrReader( int );
    SDTSRasterReader *GetLayerRasterReader( int );
    DDFModule	*GetLayerModuleReader( int );

    SDTSIndexedReader *GetLayerIndexedReader( int );

    


    SDTS_CATD	*GetCATD() { return &oCATD ; }

    SDTS_IREF	*GetIREF() { return &oIREF; }

    


    SDTS_XREF   *GetXREF() { return &oXREF; }

    SDTSFeature *GetIndexedFeatureRef( SDTSModId *,
                                       SDTSLayerType *peType = NULL);

    DDFField *GetAttr( SDTSModId * );

  private:

    SDTS_CATD	oCATD;
    SDTS_IREF	oIREF;
    SDTS_XREF   oXREF;

    int		nLayers;
    int		*panLayerCATDEntry;
    SDTSIndexedReader **papoLayerReader;
};

#endif /* ndef SDTS_AL_H_INCLUDED */

Generated at Wed Sep 22 10:32:09 1999 for SDTS_AL by doxygen  written by Dimitri van Heesch, © 1997-1999