- else {
- GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() );
- try {
- Handle(Poly_Triangulation) Trtn = 0;
-
- GEOM::GEOM_Gen_var aGeomGen = GeometryGUI::GetGeomGen();
- if ( CORBA::is_nil(aGeomGen) )
- return false;
-
- QString IOR = GEOMBase::GetIORFromObject( myObj );
- GEOM::GEOM_Object_var anObject = aGeomGen->GetIORFromString( IOR.toLatin1().constData() );
- if ( CORBA::is_nil(anObject) )
- return false;
-
- TopoDS_Shape aShape;
- GEOMBase::GetShape(anObject, aShape, TopAbs_SHAPE);
- if ( aShape.IsNull() )
- return false;
-
- TopLoc_Location l;
- Handle(Poly_Triangulation) T;
- TopExp_Explorer ex;
- for (ex.Init(aShape,TopAbs_FACE); ex.More(); ex.Next()) {
- const TopoDS_Face& F = TopoDS::Face(ex.Current());
- BRepAdaptor_Surface surf(F);
- if (surf.GetType() == GeomAbs_Sphere) {
- T = BRep_Tool::Triangulation(F, l);
- if (!T.IsNull()) {
- Handle(Poly_Triangulation) NullTrtn = 0;
- (*((Handle(BRep_TFace)*)&F.TShape()))->Triangulation(NullTrtn);
- Trtn = T;
- break;
- }
- }
- else
- break;
- }
-
- anOper->GetBoundingBox( myObj, theXmin, theXmax, theYmin, theYmax, theZmin, theZmax );
-
- if (!Trtn.IsNull()) {
- TopLoc_Location l;
- Handle(Poly_Triangulation) T;
- TopExp_Explorer ex;
- for (ex.Init(aShape,TopAbs_FACE); ex.More(); ex.Next()) {
- const TopoDS_Face& F = TopoDS::Face(ex.Current());
- (*((Handle(BRep_TFace)*)&F.TShape()))->Triangulation(Trtn);
- break;
- }
- }
-
- }
- catch( const SALOME::SALOME_Exception& e ) {
- SalomeApp_Tools::QtCatchCorbaException( e );
- return false;
- }
-
- return anOper->IsDone();
- }
+
+ GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow(getOperation());
+ anOper->GetBoundingBox(myObj, theXmin, theXmax, theYmin, theYmax, theZmin, theZmax);
+
+ return anOper->IsDone();