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


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());
cout }else{
cout }
//--------------------------------for dbg-------------------- }

Wang Yue's picture

the attached file is the full code for testing