Wed, 04/20/2005 - 13:17
Forums:
I want to select a surface and transform it to a face ,select a point and transform it to a vertex...etc
my probleme is that i can't manage more than one selected object so how can i do a multiple selection without unselecting the previous selected object?can i do this with OCC5?
Mon, 04/25/2005 - 10:32
Hi,
Try this:
for(myAISContext->InitSelected(); myAISContext->MoreSelected();
myAISContext->NextSelected())
{
TopoDS_Shape shape=myAISContext->SelectedShape();
//Do some with shape...
}
Regards,
Akbari
Wed, 04/27/2005 - 12:25
Hi,
I already find that but i still get no answer for what you call"//Do some with shape..."
I want to select two faces and get the intersection with BRepAlgoAPI_Cut , can you help me
for(myAISContext->InitCurrent();
myAISContext->MoreCurrent();
myAISContext->NextCurrent())
{
Handle(AIS_InteractiveObject) obj = myAISContext->Current();
Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast (obj);
//TopoDS_Shape Courrent = aShape->Shape ();
//if(Courrent1.IsNull) Courrent1=aShape->Shape ();
//else if (Courrent2.IsNull)Courrent2=aShape->Shape ();
//TopoDS_Shape ShapeCut = BRepAlgoAPI_Cut(Courrent1,Courrent2);
//Handle (AIS_Shape) aSection = new AIS_Shape(ShapeCut);
//myAISContext->SetDisplayMode(aSection,1,Standard_False);
//myAISContext->SetColor(aSection,Quantity_NOC_RED,Standard_False);
//myAISContext->SetMaterial(aSection,Graphic3d_NOM_PLASTIC,Standard_False);
//myAISContext->Display(aSection,Standard_False);
//myAISContext->SetCurrentObject(aSection,Standard_False);
Wed, 04/27/2005 - 12:36
Hi,
have you tried "ShiftSelect" as Hugues wrote?
Greets,
Patrik
Mon, 04/25/2005 - 12:08
If your problem is to allow the user to select more than one shape, then you should do the following :
- when the user picks an object :
- get the (x,y) mouse's coordinates
- call AIS_InteractiveContext::MoveTo (x, y, view_object)
- call AIS_InteractiveContext::ShiftSelect ()
Afterwards you can browse the selected shapes as Akbari shown it.
Fri, 04/29/2005 - 17:29
Thanks to All for alL,
Most included OCC samples support multiple-selection (Use Shift-MB1) click to select/unselect.
I had already found that and it's typically what you said so thanks...