Skip to content

henc · Display Environment

Layer / visibility / pixel / symbol scale / Mercator / depth / color / font display settings

DWORD hencGetMapLevelMask()
  • The ENC map has six map levels. This function obtains a flag value indicating whether or not the current map is displayed for each level. That is, the display setting value for each level is obtained.
  • For each level, the bit values of LSBs 0 to 5 correspond to 1 to 6 S-57 codes. Depending on the value of each bit, the corresponding level is not displayed or displayed on the screen.
  • 0 : not display, 1: display

None

Bit Mask per each level


void hencSetMapLevelMask( DWORD mask )
  • This function sets whether to display the map by level. Whether or not to set an display for each map level is specified in the form of a bit mask.
  • For each level, the bit values of LSBs 0 to 5 correspond to 1 to 6 S-57 codes. Depending on the value of each bit, the level does not display or display the map on the screen.
  • If it is 0, it is not displayed. If it is 1, it is displayed.
  • Levels 0 ~ 5 correspond to S-57 Code 1 ~ 6 and decide whether each map is displayed or not.

None

  • When the electronic chart is loaded, the level value is set to the value of L when the file name of the map cell is xxLxxxxx.xxx. This value can be set from 1 to 6 as S-57 code value. The internally stored level value is set to one less than the S-57 code value.
  • (Ex) Level 0 = S-57 Code 1
  • If the level value can not be checked, set it to “0”.
  • Level 10 is treated separately as a top level, and is drawn at the top level of all maps.
  • You can change the level value of the map with the result of the function.

int hencEncfileGetVisible( int no )

Checke whether the display is set for each map cell.

int no : IN (Map number)

  • 0 : Display

  • == 0 : Not display
  • < 0 : Fail (Map number error)
  • See “Map File I / O” for details.

int hencEncfileSetVisible( int no, int isShow )
  • If the flag is 0, the map cell is hidden from view on the screen.
  • int no : IN (Map number)
  • int isShow : IN (0 : Not display, 1 : Display)
  • = 0 : Success
  • < 0 : Fail

int hencEncfileSetLevel( int no, int level )
  • Change the level of the individual map file.
  • When loading each map, the display level is determined according to the S-57 code value included in the file name.
  • If the upper level (the higher the number) is overlapped with the lower level map, the upper level map will cover the lower level map.
  • int no : IN (Map number)
  • int level : IN (Map level, 0~5 or available up to 10)
  • = 0 : Success
  • < 0 : Fail

int hencEncfileGetLevel( int no )

Obtain the currently configured level value of the map file (Map File).

int no : IN (Map number)

  • 0~5 or 10 : Success (Level value)
  • < 0 : Fail

int hencEncfileSetBottom( int no )

Set a specific map cell to level 0 so that it is drawn on the lower layer of another map on the screen.

None

  • = 0 : Success
  • < 0 : Fail

int hencEncfileSetTopMost( int no )

Designate a specific map cell at level 10 so that it is drawn on the upper layer of another map on the screen.

None

  • = 0 : Success.
  • < 0 : Fail

int hencEncfileSetScaleForTopmost( int scale )
  • That is, this can be applied to a purpose of using a map that is additionally overlayed on an existing electronic chart.
  • 0 : Always display
  • 0 : Display when N value is lower than scale on 1:N scale

  • = 0 : Success
  • < 0 : Fail

int hencSetObjMask( EEncObject obj, bool flag )

Specifies whether to display the ENC Feature Object by type.

  • EEncObject obj : IN (ENC Feature Object Code)
  • Refer the chapter 2.23.1 S-57 Feature Object Catalog< in API reference manual/li>
  • bool flag : IN
  • true : Display
  • false : Do not display
  • = 0 : Success
  • < 0 : Fail

bool hencGetObjMask( EEncObject obj )

Obtains the display mask of each ENC Feature Object.

  • Refer S-57 Feature Object Catalog in chapter 2.23.1 in API reference manual
  • true : Display
  • false : Not display

int hencSetPixelSize( double meter )
  • Specifies the size of the screen pixels used to scale the map. (Unit : Meter)
  • It is interlocked with the function, and only the units are different.

double meter : IN (1 pixel size of screen기, meter)

  • = 0 : Success
  • < 0 : Fail

Default setting : 0.000265 ~= 96DPI


int hencSetPixelDPI( int dpi )
  • Specifies the size of the screen pixels used to scale the map. (Unit : Number of pixels, DPI)
  • It is interlocked with function and there is only difference in unit.

int dpi : IN (Pixels per inch of screen, DPI)

  • = 0 : Success
  • < 0 : Fail

Default setting : 0.000265 ~= 96DPI


double hencGetPixelSize()

It converts the size value of 1 pixel of the screen into metric unit and returns it.

None

Size value corresponding to 1 pixel of the screen (meter unit)

Default setting : 0.000265 ~= 96DPI


int hencGetPixelDPI()

Converts the size value of 1 pixel of the screen into DPI unit and returns it.

None

Screen DPI value

Default setting : 0.000265 ~= 96DPI


double hencGetSymbolScale()

Obtains the size values of S-52 Symbol, Pattern, Line and so on.

None

Symbol scale value


int hencSetSymbolScale( double scale )

Specify the size value of the S-52’s Symbol, Pattern, Line, and so on. Depending on the ratio of these values, each symbol, pattern, and line change at the same rate.

double scale : IN (Symbol Scale)

  • = 0 : Success
  • < 0 : Fail

Default setting : 0.033333 ~= 96DPI


bool hencIsAutoScaleToZoom()

Confirm whether you are using the automatic magnification adjustment function when changing the latitude.

None

  • true : Use auto scaling
  • false : Do not use auto scaling

int hencSetAutoScaleToZoom( bool flag )

Confirm whether you are using the automatic magnification adjustment function when changing the latitude.

  • true : Use auto scaling
  • false : Do not use auto scaling
  • = 0 : Success
  • < 0 : Fail

bool hencIsMercator()

Check whether Mercator projection is used.

None

  • true : Use Mercator projection
  • false : Do not use Mercator projection

void hencSetMercator( bool flag )

Specifies whether to use the Mercator projection.

  • true : Use Mercator projection
  • false : Do not use Mercator projection

None


void hencSetSimplifiedSymbol( bool flag )

Specifies whether Simpilfied Symbol should be used when displaying S-52 symbols, patterns, and lines.

  • true : Use simpilfied symbol, pattern and line
  • false : Do not use simpilfied symbol, pattern and line

None


bool hencIsSimplifiedSymbol()

Check whether Simpilfied Symbol is used when displaying S-52 symbols, patterns and lines.

None

  • true : Use simpilfied Symbols, Patterns, and Lines
  • false : Do not use simpilfied Symbols, Patterns, and Lines

EDisplayCategory hencGetDisplayCategory()

Obtain display category.(Refer S-52 Display Category in chapter 2.23.5 in API reference manual)

None

Current setting of EDisplayCategory


void hencSetDisplayCategory( EDisplayCategory c )

Specify the display category.(Refer chapter 2.23.5 in API reference manual.)

EDisplayCategory c : IN (EDisplayCategory setting value)

None


void hencSetNationalLanguage( bool flag )
  • Specifies whether to use the local language in the ENC file.
  • When displaying the information of each ENC Feature Object, it specifies whether to use the local language information if it contains the local language information. When disabled, it is always displayed in English.
  • true : Use local language
  • false : Use English only

None


bool hencIsNationalLanguage()

Check whether the local language is used in the ENC file.

None

  • true : Use local language
  • false : English only

int hencGetUseScaleMinMax()

Check whether SCAMIN and SCAMAX values are used in the ENC Feature Object.

None

  • != 0 : In use
  • ==0 : Not use
  • < 0 : Fail

void hencSetUseScaleMinMax( int flag )

Specifies whether to use the SCAMIN, SCAMAX values within the ENC Feature Object to display.

  • != 0 : Use
  • ==0 : Do not use

None


int hencGetViewMapByScale()

Obtains using status of the function which determines whether to display according to the level when display map.

None

  • != 0 : In use
  • ==0 : Not use
  • < 0 : Fail

void hencSetViewMapByScale( int flag )

Set whether or not to use the function to decide whether to display or not according to the level when displaying the map. Below the specified scale, set the function to hide the detail map on the screen.

  • != 0 : Use
  • ==0 : Do not use

None


int hencSetDepth( EDepthType t, double depth )

Change the setting value that shows the currently set water depth. S-52 Sets water depth value used for color and line segment display by depth defined in CSP.

  • EDepthType t: IN (Depth type)
  • double depth : IN (depth value, meter)
  • = 0 : Success

  • < 0 : Fail

double hencGetDepth( EDepthType t );
  • Obtains the setting value for the currently configured water depth display.
  • Refer function for the details

EDepthType t : IN (Water depth type) enum EDepthType { SHALLOW_CONTOUR, DEEP_CONTOUR, SAFETY_CONTOUR, SAFETY_DEPTH, DEPTHTYPE_MAX };

Current setting


int hencSetShallowPattern( bool flag )

Set whether or not to display a shallow depth pattern (shallow pattern) for displaying the shallow water depth.

  • true : Display shallow pattern
  • false : Do not display shallow pattern
  • = 0 : Success

  • < 0 : Fail

bool hencIsShallowPattern()

Obtains setting value of whether to display of the low-water depth pattern (Shallow pattern) for displaying the shallow water depth.

None

Setting value of whether to display of the low-water depth pattern


int hencSetTwoShades( bool flag )
  • Set whether to use only two colors when displaying the depth of sea level area.
  • The sea level is represented by two colors or four different colors, depending on the depth of the water. Specify the number of colors to use at this time.
  • true : Use two colors only
  • false : Use more than 2 colors
  • = 0 : Success

  • < 0 : Fail

bool hencIsTwoShades()

Obtain whether to use two colors mode when displaying sea level.

None

1 : Use two colors mode 0 : Do not use two colors mode(4 colors are used)


int hencSetHideMeta( bool flag )

Sets whether to display the object corresponding to the Meta Object(300th Object Code) among the Feature Objects of the S-57 ENC.

  • true : Do not display meta-objects
  • false : Display meta-objects
  • = 0 : Success

  • < 0 : Fail

bool hencIsHideMeta()

Obtain the display setting value of the meta-object.

None

Whether the meta-object is displayed


int hencSetColorset( EEncColorset colorset )

Specify the color of the map display. (Refer S-52 Color)

EEncColorset colorset : IN (Value of color table) enum EEncColorset { COLORSET_DAY_BRIGHT, COLORSET_DAY_WHITEBACK, COLORSET_DAY_BLACKBACK, COLORSET_DUSK, COLORSET_NIGHT, COLORSET_USER, COLORSET_MAX };

  • = 0 : Success
  • < 0 : Fail

EEncColorset hencGetColorset()

Obtain the map display color table value in use. (Refer S-52 Color)

None

Map display color table value in use. enum EEncColorset { COLORSET_DAY_BRIGHT, COLORSET_DAY_WHITEBACK, COLORSET_DAY_BLACKBACK, COLORSET_DUSK, COLORSET_NIGHT, COLORSET_USER, COLORSET_MAX };


int hencFontGet( LOGFONT *lf )

Obtain the setting value for the font to be used for map display.

LOGFONT *lf : IN, OUT (Win32 LOGFONT structure)

  • = 0 : Success
  • < 0 : Fail

int hencFontSet( LOGFONT *lf )

Specify the setting value of the font to be used for map display.

LOGFONT *lf : IN (Win32 LOGFONT structure)

  • = 0 : Success
  • < 0 : Fail

int hencPrintf( double x, double y, COLORREF co, const char *fmt, ... )
  • Draws a string with the color specified in the specified coordinates in the same font as the font used for map display.
  • This function has a formatting functionality like printf of C language.
  • double x : IN (OpenGL x coordinate value to display text)
  • double y : IN (OpenGL y coordinate value to display text)
  • COLORREF co : IN (Text color)
  • const char *fmt : IN (String to display on screen, Null-terminated string)
  • See the printf format specification of C language.
  • = 0 : Success

  • < 0 : Fail
int hencPrintf( double x, double y, double z, COLORREF co, const char *fmt, ... )
  • Draws a string with the color specified in the specified coordinates in the same font as the font used for map display. (including z-coordinate)
  • This function has a formatting functionality like printf of C language.
  • double x : IN (OpenGL x coordinate value to display tex)
  • double y : IN (OpenGL y coordinate value to display tex)
  • double z : IN (OpenGL z coordinate value to display tex값)
  • COLORREF co : IN (Text color)
  • const char *fmt : IN (String to display on screen, Null-terminated string)
  • See the printf format specification of C language.
  • = 0 : Success

  • < 0 : Fail