<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Hi!</span><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
I have some doubts about vtkVRMLImporter.</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">I am using VTK version 5.4 and Visual Studio C++ 2008 to import a wrl file.</div>
<div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">But it is not working very well.</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
If the wrl file has more then one DEF node, vtk only visualizes the first DEF node.</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
For example, a solid model like a building can be writing in wrl format using a DEF node for which object (foundations, columns, beams, slabs, walls and roofs).</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
Here is a part of the wrl file i like to visualize in vtk:</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<div>#VRML V2.0 utf8</div><div><br></div></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><div>DEF Structural_Columns_&lt;M_Concrete_Square_Column_:_500_x_500mm&gt; Transform {</div>
<div><span style="white-space:pre-wrap">        </span>translation -10700 4650 -17490</div><div><span style="white-space:pre-wrap">        </span>children DEF Structural_Columns_&lt;M_Concrete_Square_Column_:_500_x_500mm&gt;_0 Transform {</div>
<div><span style="white-space:pre-wrap">                </span>translation 0 0 0</div><div><span style="white-space:pre-wrap">                </span>children Shape {</div><div><span style="white-space:pre-wrap">                        </span>appearance Appearance {</div>
<div><span style="white-space:pre-wrap">                                </span>material Material {diffuseColor 1 0 1}</div><div><span style="white-space:pre-wrap">                                </span>texture ImageTexture {</div><div><span style="white-space:pre-wrap">                                        </span>url &quot;<a href="http://t3.gstatic.com/images?q=tbn:ANd9GcSNUBcHJyaWrODD9_EyOSBRAvBB_3dRhTlocB1S6qEk5Mz3XW9x2w" target="_blank" style="color:rgb(17,85,204)">http://t3.gstatic.com/images?q=tbn:ANd9GcSNUBcHJyaWrODD9_EyOSBRAvBB_3dRhTlocB1S6qEk5Mz3XW9x2w</a>&quot;</div>
<div><span style="white-space:pre-wrap">                                        </span>repeatS TRUE</div><div><span style="white-space:pre-wrap">                                        </span>repeatT TRUE </div><div><span style="white-space:pre-wrap">                                </span>}</div><div><span style="white-space:pre-wrap">                        </span>}</div>
<div><span style="white-space:pre-wrap">                        </span>geometry DEF Structural_Columns_&lt;M_Concrete_Square_Column_:_500_x_500mm&gt;_0-FACES IndexedFaceSet {</div><div><span style="white-space:pre-wrap">                                </span>ccw TRUE </div>
<div><span style="white-space:pre-wrap">                                </span>solid TRUE </div><div><span style="white-space:pre-wrap">                                </span>coord DEF Structural_Columns_&lt;M_Concrete_Square_Column_:_500_x_500mm&gt;_0-COORD Coordinate {point [...]}</div>
<div><span style="white-space:pre-wrap">                                </span>coordIndex [ ... ]</div><div><span style="white-space:pre-wrap">                        </span>}</div><div><span style="white-space:pre-wrap">                </span>}</div><div><span style="white-space:pre-wrap">        </span>}</div>
<div>}</div></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<div>DEF Structural_Columns_&lt;M_Concrete_Square_Column_:_500_x_500mm&gt;_01 Transform {</div><div><span style="white-space:pre-wrap">        </span>translation -5204 7750 -17490</div><div><span style="white-space:pre-wrap">        </span>children DEF Structural_Columns_&lt;M_Concrete_Square_Column_:_500_x_500mm&gt;_02 Transform {</div>
<div><span style="white-space:pre-wrap">                </span>translation 0 0 0</div><div><span style="white-space:pre-wrap">                </span>children Shape {</div><div><span style="white-space:pre-wrap">                        </span>appearance Appearance {material Material {diffuseColor 1 0 1}}</div>
<div><span style="white-space:pre-wrap">                        </span>geometry DEF Structural_Columns_&lt;M_Concrete_Square_Column_:_500_x_500mm&gt;_02-FACES IndexedFaceSet {</div><div><span style="white-space:pre-wrap">                                </span>ccw TRUE </div>
<div><span style="white-space:pre-wrap">                                </span>solid TRUE </div><div><span style="white-space:pre-wrap">                                </span>coord DEF Structural_Columns_&lt;M_Concrete_Square_Column_:_500_x_500mm&gt;_02-COORD Coordinate {point [...}</div>
<div><span style="white-space:pre-wrap">                                </span>coordIndex [...]</div><div><span style="white-space:pre-wrap">                        </span>}</div><div><span style="white-space:pre-wrap">                </span>}</div><div><span style="white-space:pre-wrap">        </span>}</div>
<div>}</div></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">... </div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Even if i use the group node vtk still visualizes the first DEF node.</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
And there is more problems. </div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">The first DEF node that vtk visualizes does not read the Appearance node, the Material node and the Color node.</div>
<div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
I am using the example in <a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/IO/VRML" target="_blank" style="color:rgb(17,85,204)">http://www.vtk.org/Wiki/VTK/Examples/Cxx/IO/VRML</a>.</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
Is something wrong or the vtkVRMLImporter works like that?</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
Thanks,</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Fabiano Stange</div>