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

the selected subshape does not have topological relationship with orginal shape in OCC680

Wang Yue's picture
Forums: 

Hello

1. I select one face of a box, and it is set as "m_SelectedShape".
2. the context is get as "aContext".
3. explore all subfaces of the context, and compare every subface with m_SelectedShape.
the result is: "Select-------------------------------------does not have Same SubFace"

the following is the code for testing:

if(this->GetAISContext()->HasOpenedContext()) {
for (this->GetAISContext()->InitSelected(); this->GetAISContext()->MoreSelected(); this->GetAISContext()->NextSelected()) {
if(this->GetAISContext()->HasSelectedShape()) {
// get the selected shape from local context
m_SelectedShape = this->GetAISContext()->SelectedShape();
// get the selected AIS_InteractiveObject "anInteractive" whose owner is ""
const Handle(AIS_Shape)& aSelInteractive = Handle(AIS_Shape)::DownCast (this->GetAISContext()->SelectedInteractive());

TopoDS_Shape aContext = aSelInteractive->Shape() ;

BRepTools::Write(m_SelectedShape, "ZZSelectedShape.brep");
BRepTools::Write(aContext, "ZZContext.brep");

//--------------------------------for dbg-------------------->>>
//*
TopExp_Explorer Ex;
for( Ex.Init(aContext, TopAbs_FACE);Ex.More(); Ex.Next() ){
TopoDS_Face tmpShape = TopoDS::Face(Ex.Current());
if(tmpShape.IsEqual(m_SelectedShape)){
cout }else{
cout }
}
//*/
//--------------------------------for dbg-------------------- }
}
}

Wang Yue's picture

the attached file is the full code for testing

Attachments: