yangqiaosheng / libcitygml

Automatically exported from code.google.com/p/libcitygml
GNU Lesser General Public License v2.1
0 stars 0 forks source link

Added support for appearance isFront property and 2 material appearances on a target geometry #36

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
CityGML allows for up to 4 appearances on a geometry; a texture- and a material 
appearance on either side.

This patch introduces the getIsFront() API method to read the boolean that 
indicates wether the appearance is for the front or the back.

For materials, both a front and a back material can be defined. The polygon API 
method getMaterial() returns the front material by preference. If it's not 
there it will return the back material. Two new API methods, getMaterialFront() 
and getMaterialBack() were introduced.

The texture implementation wasn't changed. This means that there is still only 
at most one texture definition taken from the cityGML per polygon. I did not 
change this because it's a little harder to implement and I didn't have an 
immediate need for it.

The problem with it is that it affects more than just the texture; it also 
affects the texture coordinates and wrapping and thus affect the code quite 
some. To implement this in a neat way, I see to options: Either a poly has 2 
AppearanceManagers, one for each side or a cityGML poly can result in upto 2 
polygons, one for each side, that are somehow linked to each other. The 
advantage of the latter would be that also the normals and indices of the back 
side poly can be adjusted in code. This would take the burden of duplicating 
geometry and orienting it away from the user of the library.

Looking forward to your feedback, I hope the patch is useful. If you have 
questions or I can do something to help integrating the patch, let me know!

Cheers

Original issue reported on code.google.com by W.Ya...@gmail.com on 12 Mar 2012 at 10:33

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks a lot for your patch. I have applied it in Revision 131.

Original comment by jpouder...@gmail.com on 15 Jun 2012 at 6:26