For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings

 

Need to speed up your development?
Have a look at our:

Samples & Tools

 

Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

How can i select more than one entity? hlp plz

g's picture
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?

A.Akbari's picture

Hi,
Try this:
for(myAISContext->InitSelected(); myAISContext->MoreSelected();
myAISContext->NextSelected())
{
TopoDS_Shape shape=myAISContext->SelectedShape();
//Do some with shape...
}
Regards,
Akbari

g's picture

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);

Patrik Müller's picture

Hi,

have you tried "ShiftSelect" as Hugues wrote?

Greets,

Patrik

Hugues's picture

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.

g's picture

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...

Contact us

Attention: DO NOT use this form for all kind of request for the removal of your personal data. Please follow this link for such cases.