Shaded MeshVS_Mesh

Does anyone have an idea how to display a shaded MeshVS?
I use the following code:

Handle_StlMesh_Mesh handle_stlMesh;
//...
//loading mesh from an stl file

Handle( MeshVS_Mesh ) aMesh = new MeshVS_Mesh();
Handle( XSDRAWSTLVRML_DataSource ) aDS = new XSDRAWSTLVRML_DataSource(handle_stlMesh);

aMesh->SetDataSource(aDS);

aMesh->GetDrawer()->SetBoolean(MeshVS_DA_DisplayNodes,Standard_False); //MeshVS_DrawerAttribute

aMesh->AddBuilder( new MeshVS_MeshPrsBuilder( aMesh.operator->() ), Standard_True );

But still can't make OC display the shaded mesh (only as a wireframe model).

Regards
Pawel

Jun WANG's picture

Handle( MeshVS_Mesh ) aMesh = new MeshVS_Mesh();
Handle( XSDRAWSTLVRML_DataSource ) aDS = new XSDRAWSTLVRML_DataSource(handle_stlMesh);
aMesh->SetDataSource(aDS);

aMesh->GetDrawer()->SetBoolean(MeshVS_DA_SmoothShading,Standard_False); //MeshVS_DrawerAttribute

aMesh->AddBuilder( new MeshVS_MeshPrsBuilder( aMesh.operator->() ), Standard_True );
------------------------------------------------------------------------------------
When I change MeshVS_DA_DisplayNodes to MeshVS_DA_SmoothShading, it can not still visualize the shaded mesh? Why?
Does anyone know how to set the attributes to show shaded mesh ???
Thanks a lot!

Pawel's picture