Hexagon Geospatial
MENU

Developer Discussions

Discuss topics with other Hexagon Geospatial Power Portfolio developers and experts to get the most out of our products.
Showing results for 
Search instead for 
Do you mean 
Reply
Occasional Contributor
Posts: 10
Registered: ‎03-26-2018

How to make a polygon fill detection with StyleLibrary?

I am using IMAGINE Developer's Toolkit 2016 Version.

I want to make polygon fill detection of annotation file with StyleLibrary.

In StyleLibrary_5, styleLibrary-> fillStyles.data becomes NULL and abnormal end.

 

I am using the following code.

 

   int isFill = styleLibrary->fillStyles.data[polygon->fillStyle].fill;

      styleLibrary get emif_DictionarySearchByName function, and polygon get ehfa_ObjectReadIfPresent function.

 

How to make polygon fill detection of annotation file with StyleLibrary_5.

 

In Style Library_4, it was possible to make polygon fill detection of annotation file with this code.But, for the second parameter of the emif_DictionarySearchByName function Using StyleLibrary_4 become an error in ERDAS IMAGINE 2016 Version.

 

If you have a way to use "StyleLibrary_4", that way is fine.

Highlighted
Technical Evangelist
Posts: 53
Registered: ‎09-16-2015

Re: How to make a polygon fill detection with StyleLibrary?

You should not be using low-level packages such as ehfa and emif to read annotation elements and style information from a file.  Instead you should be using eant_LayerOpen to read the entire annotation layer, including elements and style information, at once.  You can then access the elements using antlayer->antInfo->headElm and the style library using antlayer->antInfo->styleLib.  You should not, however, access members of the Eant_StyleLibrary directly.  Use eant_GetFillStyle to get the Eant_FillStyle for the element (polygon) and then query the fill member of the returned structure.  Use eant_GetPolygonMapVectorData to obtain the coordinates of the polygon.  There are many other eant_Get* functions and even more eant_* functions you might want to explore as well.

 

I hope this helps.

 

Occasional Contributor
Posts: 10
Registered: ‎03-26-2018

Re: How to make a polygon fill detection with StyleLibrary?

Thanks for the answer.
I understand that eant function shoud be used.

 

However, if I replace with the eant function,
I will need to change a massive amount of the program I am currently working on.
So I would like to replace as minimal parts as possible.
Please provide me with a way to use eant_GetFillStyle function and
eant_GetPolygonMapVectorData function with a Created StyleLibraryType
structure by either converting or wrapping.

 

> There are many other eant_Get* functions and even more eant_* functions.
Please give me any sample code of eant function.

 

Best Regards

Occasional Contributor
Posts: 10
Registered: ‎03-26-2018

Re: How to make a polygon fill detection with StyleLibrary?

Hi,

I am still working on this issue.

 

I would like to compare codes between using low level
emif library and higher level eant library in order to do polygon fill detection.
Please provide me with sample codes for polygon fill detection using the eant library.

 

 

Thanks

Technical Evangelist
Posts: 53
Registered: ‎09-16-2015

Re: How to make a polygon fill detection with StyleLibrary?

Hi,

 

Attached is an example of reading an OVR file and converting it to DXF.  Any eant functions you would need to use should be used in this example.

 

I hope this helps!

 

Occasional Contributor
Posts: 10
Registered: ‎03-26-2018

Re: How to make a polygon fill detection with StyleLibrary?

Hi,
I am still working on this issue.

What is the difference between using StyleLibrary_4 and StyleLibrary_5?
Are there any differences in usage?
If there are any samples using each of these types, they are very much appreciated.

Thanks.
Do you need immediate support?
Please submit a Ticket through our
Development Ticket Portal.