Views
Maps Package API Reference Guide
Product Documentation:
Views Documentation Home
List of all members | Public Member Functions
IlvS57Reader Class Reference

This class is used to read an S57 file or an S57 catalog file. More...

#include <ilviews/maps/format/s57/s57reader.h>

Inheritance diagram for IlvS57Reader:
IlvS57Loader

Public Member Functions

 IlvS57Reader (IlvDisplay *display)
 Initializes a new instance of the reader. More...
 
IlvFRIDRecordgetFeature (IlInt index)
 Returns a read feature. More...
 
IlInt getFeatureCount ()
 Returns the feature count. More...
 
IlvFRIDRecord ** getFeatures ()
 Returns an array of the read features. More...
 
void readCatalog (std::ifstream *stream, const IlString &dir, IlBoolean skipNon000Files)
 Reads an S57 catalog file. More...
 
IlvDSIDRecordreadFile (std::ifstream *stream)
 Reads an S57 file which is not a catalog. More...
 
void reset ()
 Reset the reader. More...
 

Detailed Description

This class is used to read an S57 file or an S57 catalog file.

Library: ilvmaps

This class reads an S57 file or an S57 catalog file to load into memory the different features define in the file (or files of the catalog). The IlvS57Loader class uses these S57 features to determine the geometry, then builds an IlvMapFeature object which will be used by a renderer object to create an IlvGraphic object that you display in an IlvManager for example.

Note: The reader uses different files like S57Attributes.txt or S57Values.txt which are located into ILVHOME/data/maps/s57.

See also
IlvS57Loader, IlvS57Renderer.

Constructor & Destructor Documentation

◆ IlvS57Reader()

IlvS57Reader::IlvS57Reader ( IlvDisplay display)

Initializes a new instance of the reader.

Parameters
displayThe display to be used.

Member Function Documentation

◆ getFeature()

IlvFRIDRecord* IlvS57Reader::getFeature ( IlInt  index)

Returns a read feature.

Parameters
indexThe feature index.
Returns
The feature. The feature must NOT be deleted. However if the index is invalid, this function returns 0. If you wish to to keep the pointer for future use, you need to use the lock() function to lock it and the unLock() function to release it.

◆ getFeatureCount()

IlInt IlvS57Reader::getFeatureCount ( )

Returns the feature count.

Returns
The feature count.

◆ getFeatures()

IlvFRIDRecord** IlvS57Reader::getFeatures ( )

Returns an array of the read features.

Returns
The features. The array must NOT be deleted.

◆ readCatalog()

void IlvS57Reader::readCatalog ( std::ifstream *  stream,
const IlString dir,
IlBoolean  skipNon000Files 
)

Reads an S57 catalog file.

Reads an S57 catalog file which is a set of S57 files where each S57 file contains a set of S57 features.

Parameters
streamThe stream which is associated with the catalog file.
dirThe directory where the catalog file is located.
skipNon000FilesIf IlTrue, the S57 files which have no 000 extension are ignored.

◆ readFile()

IlvDSIDRecord* IlvS57Reader::readFile ( std::ifstream *  stream)

Reads an S57 file which is not a catalog.

Parameters
streamThe stream which is associated with the S57 file.
Returns
The DSID (Data Set Identification field) record.

◆ reset()

void IlvS57Reader::reset ( )

Reset the reader.

If you want to use the same reader to read several catalogs, you need to call this function if you want to remove all information from the previous catalog.