yangqiaosheng / libcitygml

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

app:target nodes with target specified as a child text node are not processed correctly #25

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Get 
http://www.citygml.org/fileadmin/count.php?f=fileadmin%2Fcitygml%2Fdocs%2FMunich
_LOD2_v1.0.0.zip
2. For every polygon p do:
    const citygml::Appearance* app = p->getAppearance();
    const citygml::Material* mat = dynamic_cast<const citygml::Material*>(app);
    if (mat)
        std::cout << "Found material" << std::endl;

What is the expected output? What do you see instead?
Expect to see at least some "Found material" lines since the file has materials 
in it.
Instead, no materials are reported on polygons.

What version of the product are you using? On what operating system?
Trunk revision 121 on Windows 7.

Please provide any additional information below.

This happens because in the Munich file materials are linked to their polygons 
using, for example:
<app:X3DMaterial>
  <app:diffuseColor>0.392 0.392 0.392</app:diffuseColor>
  <app:target>#ID_276003000001240_1poly</app:target>
  ...
and the code parsing app:target is wrong for targets that are child text nodes.

If the target URI is instead defined as an attribute (<app:target 
uri="#ID_276003000000768_1poly">) the appearance is correctly linked to its 
target.

Original issue reported on code.google.com by iacobcatalin@gmail.com on 19 Oct 2011 at 3:02

GoogleCodeExporter commented 9 years ago
Attached patch solves this, hopefully in a correct way.

Original comment by iacobcatalin@gmail.com on 19 Oct 2011 at 3:04

Attachments:

GoogleCodeExporter commented 9 years ago
Title should be "app:target nodes with target specified as a child text node 
are not processed correctly", but I can't edit it anymore

Original comment by iacobcatalin@gmail.com on 19 Oct 2011 at 3:06

GoogleCodeExporter commented 9 years ago
Thanks for your report and your fix. I have commited it on the SVN trunk.
Best regards,
Joachim

Original comment by jpouder...@gmail.com on 20 Oct 2011 at 7:24