// File: TopOpeBRep_Hctxff2d.cxx // Created: Thu Oct 29 12:46:21 1998 // Author: Jean Yves LEBEY // #include #include #include #include #include //======================================================================= //function : TopOpeBRep_Hctxff2d //purpose : //======================================================================= TopOpeBRep_Hctxff2d::TopOpeBRep_Hctxff2d() { myf1surf1F_sameoriented = Standard_True; myf2surf1F_sameoriented = Standard_True; mySurfacesSameOriented = Standard_False; myFacesSameOriented = Standard_False; myTol1 = 0.; myTol2 = 0.; } //======================================================================= //function : SetFaces //purpose : //======================================================================= void TopOpeBRep_Hctxff2d::SetFaces(const TopoDS_Face& F1,const TopoDS_Face& F2) { Standard_Boolean newf1 = !F1.IsEqual(myFace1); Standard_Boolean newf2 = !F2.IsEqual(myFace2); Standard_Boolean yaduneuf = (newf1 || newf2); if (!yaduneuf) return; Standard_Boolean computerestriction = Standard_False; if (newf1) { if (mySurface1.IsNull()) mySurface1 = new BRepAdaptor_HSurface(); mySurface1->ChangeSurface().Initialize(F1,computerestriction); } if (newf2) { if (mySurface2.IsNull()) mySurface2 = new BRepAdaptor_HSurface(); mySurface2->ChangeSurface().Initialize(F2,computerestriction); } SetHSurfacesPrivate(); } // SetFaces //======================================================================= //function : SetHSurfaces //purpose : //======================================================================= void TopOpeBRep_Hctxff2d::SetHSurfaces(const Handle(BRepAdaptor_HSurface)& HS1, const Handle(BRepAdaptor_HSurface)& HS2) { Standard_Boolean newf1 = Standard_False; Standard_Boolean newf2 = Standard_False; if (!HS1.IsNull()) newf1 = !HS1->ChangeSurface().Face().IsEqual(myFace1); if (!HS2.IsNull()) newf2 = !HS2->ChangeSurface().Face().IsEqual(myFace2); Standard_Boolean yaduneuf = (newf1 || newf2); if (!yaduneuf) return; mySurface1 = HS1; mySurface2 = HS2; SetHSurfacesPrivate(); } // SetHSurfaces //======================================================================= //function : SetHSurfacesPrivate //purpose : //======================================================================= void TopOpeBRep_Hctxff2d::SetHSurfacesPrivate() { BRepAdaptor_Surface& S1 = mySurface1->ChangeSurface(); myFace1 = S1.Face(); mySurfaceType1 = S1.GetType(); BRepAdaptor_Surface& S2 = mySurface2->ChangeSurface(); myFace2 = S2.Face(); mySurfaceType2 = S2.GetType(); mySurfacesSameOriented = Standard_True; myFacesSameOriented = Standard_True; Standard_Boolean so11 = Standard_True; myf1surf1F_sameoriented = so11; Standard_Boolean so21 = Standard_True; myf2surf1F_sameoriented = so21; TopoDS_Face face1forward = myFace1; face1forward.Orientation(TopAbs_FORWARD); so11 = TopOpeBRepTool_ShapeTool::FacesSameOriented(face1forward,myFace1); myf1surf1F_sameoriented = so11; so21 = TopOpeBRepTool_ShapeTool::FacesSameOriented(face1forward,myFace2); myf2surf1F_sameoriented = so21; mySurfacesSameOriented = TopOpeBRepTool_ShapeTool::SurfacesSameOriented(S1,S2); myFacesSameOriented = TopOpeBRepTool_ShapeTool::FacesSameOriented(myFace1,myFace2); #ifdef DEB Standard_Integer DEBi = 0; if ( DEBi ) { cout<<"TopOpeBRep_Hctxff2d::SetSurfacesPrivate : "; cout<<"f1 "; TopAbs::Print(myFace1.Orientation(),cout); cout<< " / f1F : "; if (so11) cout<<"sameoriented"; else cout<<"difforiented"; cout<