selecting nodes & elements of mesh

Hi
I want to select nodes and elements of a mesh and I have tried so far:

Handle(MeshVS_Mesh) mAISMesh..

1) Handle(TColStd_HPackedMapOfInteger) packet...
...
mAISMesh->SetSelectableNodes(packet);

2)MeshVS_Array1OfIntegerBoolean array...
...
meshPrsBuilder->BuildHilightPrs(aPrs,array,true);
mAISMesh->AddBuilder(meshPrsBuilder, true);

3)mAISMesh->SetMeshSelMethod(MeshVS_MSM_NODES/PRECISE/BOX);

4)mAISMesh->SetSelectionMode(1); / context->ActivateStandartMode(TopAbs_VERTEX); //I thought maybe nodes are handled as vertices..

I tried all above to be able to select nodes(vertices) or elements(triangles) of a mesh but none succeeded. I can select hole mesh but not its elements. How can I select them? (Also is there any doc or samples codes about how to handle/visualize/select/modify meshes in occ?)

Thanks in advance
xaeroxx

Roman Lygin's picture

Hello,
The following will demonstrate selection of elements in DRAW. Check the source code in XSDRAWSTLVRML.cxx

Draw> pload ALL
Draw> psphere ss 15 #create a sphere
Draw> incmesh ss 0.1 #add triangulation
Draw> writestl ss sphere.stl #dump into STL file using triangulation
Draw> vinit #create 3D view
Draw> meshfromstl ms sphere.stl #create MeshVS from STL (use any other STL if you like)
Draw> meshselmode ms 8 (0x0008 bit is used for element selection)
Draw> getsource mesh #returns source files where mesh- prefixed commands are defined

Hope this helps.
Roman

---
opencascade.blogspot.com - blog on Open CASCADE

xaeroxx's picture

Thanks that really helped. But now I couldn't find how to modify (for ex: translate) selected node of a mesh. Is it possible without completely deleting whole mesh data and rebuild nodes and elements from stretch?
Thanks again
xaeroxx

Stefan Sicklinger's picture

May I ask, have you found a solution?