Developer Reference Architecture



This article is an overview of the organisation of the ENCX COM library. You will also need low level class documentation.


To use ENCX, you must first create an instance of the Library coclass. There should only be one Library object in your application. It should exist for longer that any other ENCX class.

The Library instance starts up the security system (dongle) for ENCX.

The security system can be either a software or hardware dongle. Either way the software license is tied to the computer in use. This is a requirement for ENC and ARCS chart use (except using demonstration data).

S57 and Raster Classes

There is a rough division of the library into vector and raster chart display classes. Both halves follow a similar pattern - a manager class is responsible for maintaining a portfolio of information. A draw class is responsible for drawing the chart onto a Windows HDC. A GeoPix class converts between pixel and geographic positions.

In addition to these similarities both sides have their own families of value classes which reflect the fundemental differences between the formats.

The names of classes in the S57 half of the library start with S57 and the names of raster classes start with Ras.

The differences between Vector and Raster charting.

Geo Value Classes

  • GeoPoint - used to express latitude and longitude.  All positions are WGS 84.
  • GeoPoints - collection of GeoPoint
  • GeoLine - contains two GeoPoint instances defining the start and end points of a line.  The type of line can be great circle or rhumb.
  • GeoArea - collection of GeoPoint where a line is assumed to connect consecutive points and the first and last points
  • GeoRect - rectangle expressed in terms of North-South latitude and East-West longitude values.

Pixel Value Classes

  • PixelPoint - (x,y) coordinates
  • PixelSize - width and height measurements in pixel units (not the size of an individual pixel).  This class is used to express the size of a chart drawing.
  • PixelRect - rectangle expressed in terms of left, top, width and height.
  • PixelPoints - collection of PixelPoint.
  • PolyLines - collection of PixelPoints (i.e. a collection of collections of PixelPoint).  A line is assumed to connect consecutive points within one PixelPoints instance.  Returned by GeoPix.Line.
  • PolyAreas - collection of PixelPoints (i.e. a collection of collections of PixelPoint) where each set of points within a PixelPoints forms a ring.  A line is assumed to connect consecutive points and the first and last points within one PixelPoints instance.  Returned by GeoPix.Area.

GeoPix Class

The geopix class is the underlying class to convert from geographical positions on a particular chart to pixels.  A typical use of this class is to help draw overlays on top of your charts.  It is worth noting that S57 charts only ever have one GeoPix whereas ARCS charts (because of panels) can have several.

To convert geographical lines and polygon areas you should use the appropriate function in this class (Line or Area) rather than converting the vertices individually.  This ensures that the pixel points returned are correctly clipped to panel extents.

Dongle and DongleObserver Classes

To use ENCX with commerical charts you need to have a dongle.  The Dongle class allows you to determine the state and device name of your dongle.  The DongleObserver class is used to notify your code when the state of the dongle has changed.  You can also use the Dongle class to encrypt and decrypt your own data.

Class Level Documentation