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 to remove sub shapes like faces from an AIS object?

Dulana Hansisi's picture
Forums: 

I'm using following code to create a box and it displays all the 6 faces on AIS display one by one. I can select either one face or multiple faces in my program. What I really need to do is select one or more faces from that box and remove all that selected faces from the AIS display.

TopoDS_Shape aTopoBox = BRepPrimAPI_MakeBox(3.0, 4.0, 5.0).Shape();

shapesOnDisplay.push_back(aTopoBox);

TopExp_Explorer* boxFaceExp = new TopExp_Explorer(aTopoBox,TopAbs_FACE);

while (boxFaceExp->More()) {

//theSolidTool = TopoDS::Solid(solidExplorer->Current());

TopoDS_Face face= TopoDS::Face(boxFaceExp->Current());

Handle(AIS_Shape) anAisBox = new AIS_Shape(face);

anAisBox->SetColor(Quantity_NOC_AZURE);

myOccView->getContext()->Display(anAisBox, Standard_True);

boxFaceExp->Next();

}

AND if I display the box(it can be a solid or a shell) as a one object on the AIS display, how could I remove a face(sub shape of the box) from that AIS box object?

Thank You!

Regards,

Dulana