Alexmercer
CAD practitioner
I'm trying to display a Poly_Triangulation。I use AIS_ Triangulation to display the mesh
Handle(Poly_Triangulation) Tri = tris->GetTriangulation();
Handle(AIS_Triangulation) anAisTriangulation = new AIS_Triangulation(Tri);
Handle(AIS_Shape) anAISShape = new AIS_Shape(IgsShape);
//Handle(AIS_Shape) anAISShape = new AIS_Shape(aCompound);
anAISShape->SetColor(Quantity_NOC_BLACK);
anAISShape->SetDisplayMode(AIS_WireFrame/AIS_Shaded);
I use AIS_Shaded and AIS_WireFrame,But the results are very bad.
Then I use MeshVS_Mesh
Handle(XSDRAWSTLVRML_DataSource) aDS = new XSDRAWSTLVRML_DataSource(aTriangulation);
Handle(MeshVS_Mesh) aMesh = new MeshVS_Mesh();
aMesh->SetDataSource(aDS);
// use default presentation builder.
Handle(MeshVS_MeshPrsBuilder) Builder = new MeshVS_MeshPrsBuilder(aMesh.operator->());
aMesh->AddBuilder(Builder, TRUE);
aMesh->SetDisplayMode(MeshVS_DMF_Shading);
aMesh->SetMeshSelMethod(MeshVS_MSM_PRECISE);
aMesh->SetHilightMode(MeshVS_DMF_Shading);
aMesh->SetTransparency(0.4);
aMesh->SetColor(Quantity_NOC_GOLD);
H_Aiscontext->Display(aMesh,Standard_True);
But nothing is shown.I don't know why
Handle(Poly_Triangulation) Tri = tris->GetTriangulation();
Handle(AIS_Triangulation) anAisTriangulation = new AIS_Triangulation(Tri);
Handle(AIS_Shape) anAISShape = new AIS_Shape(IgsShape);
//Handle(AIS_Shape) anAISShape = new AIS_Shape(aCompound);
anAISShape->SetColor(Quantity_NOC_BLACK);
anAISShape->SetDisplayMode(AIS_WireFrame/AIS_Shaded);
I use AIS_Shaded and AIS_WireFrame,But the results are very bad.
Then I use MeshVS_Mesh
Handle(XSDRAWSTLVRML_DataSource) aDS = new XSDRAWSTLVRML_DataSource(aTriangulation);
Handle(MeshVS_Mesh) aMesh = new MeshVS_Mesh();
aMesh->SetDataSource(aDS);
// use default presentation builder.
Handle(MeshVS_MeshPrsBuilder) Builder = new MeshVS_MeshPrsBuilder(aMesh.operator->());
aMesh->AddBuilder(Builder, TRUE);
aMesh->SetDisplayMode(MeshVS_DMF_Shading);
aMesh->SetMeshSelMethod(MeshVS_MSM_PRECISE);
aMesh->SetHilightMode(MeshVS_DMF_Shading);
aMesh->SetTransparency(0.4);
aMesh->SetColor(Quantity_NOC_GOLD);
H_Aiscontext->Display(aMesh,Standard_True);
But nothing is shown.I don't know why