From: apl Date: Tue, 21 Jan 2014 16:42:20 +0000 (+0000) Subject: 21854: Add persistent dimensions X-Git-Tag: V7_4_0a1~44 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7ae44206e96a6bac33644ee63f7ed0bd91a23986;p=modules%2Fgeom.git 21854: Add persistent dimensions - Minor remarks: LCS from TopLoc_Location for quickness --- diff --git a/src/GEOMGUI/GEOM_Displayer.cxx b/src/GEOMGUI/GEOM_Displayer.cxx index 0272d8ef7..252880f56 100644 --- a/src/GEOMGUI/GEOM_Displayer.cxx +++ b/src/GEOMGUI/GEOM_Displayer.cxx @@ -1021,6 +1021,11 @@ void GEOM_Displayer::updateDimensions( const Handle(SALOME_InteractiveObject)& t } aListOfIO.Remove( aIterateIO ); + + if ( !aIterateIO.More() ) + { + break; + } } // prepare dimension styling @@ -1333,7 +1338,7 @@ void GEOM_Displayer::Update( SALOME_OCCPrs* prs ) } } - updateDimensions( myIO, occPrs, GEOMUtils::GetPosition( myShape ) ); + updateDimensions( myIO, occPrs, gp_Ax3().Transformed( myShape.Location().Transformation() ) ); } } diff --git a/src/MeasureGUI/MeasureGUI_CreateDimensionDlg.cxx b/src/MeasureGUI/MeasureGUI_CreateDimensionDlg.cxx index 5da50d8a3..160abfb68 100644 --- a/src/MeasureGUI/MeasureGUI_CreateDimensionDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_CreateDimensionDlg.cxx @@ -635,7 +635,7 @@ bool MeasureGUI_CreateDimensionDlg::AddDimensionToOwner() TopoDS_Shape anParentSh; if ( GEOMBase::GetShape( myParentObj.get(), anParentSh ) ) { - aLCS = GEOMUtils::GetPosition( anParentSh ); + aLCS = gp_Ax3().Transformed( anParentSh.Location().Transformation() ); } QString aName = getNewObjectName(); diff --git a/src/MeasureGUI/MeasureGUI_DimensionCreateTool.cxx b/src/MeasureGUI/MeasureGUI_DimensionCreateTool.cxx index 38b7c98b9..0e3c9e1b9 100644 --- a/src/MeasureGUI/MeasureGUI_DimensionCreateTool.cxx +++ b/src/MeasureGUI/MeasureGUI_DimensionCreateTool.cxx @@ -602,7 +602,9 @@ Handle(AIS_DiameterDimension) MeasureGUI_DimensionCreateTool::Diameter( const GE TopTools_ListIteratorOfListOfShape aFaceIt( aFaces ); for ( ; aFaceIt.More(); aFaceIt.Next() ) { - Handle(Geom_Surface) aSurface = BRep_Tool::Surface( TopoDS::Face( aFaceIt.Value() ) ); + TopoDS_Face aFace = TopoDS::Face( aFaceIt.Value() ); + + Handle(Geom_Surface) aSurface = BRep_Tool::Surface( TopoDS::Face( aFace ) ); gp_Pnt aCircCenter = aCircle->Circ().Location(); Standard_Real aCircU = 0.0, aCircV = 0.0; @@ -619,7 +621,7 @@ Handle(AIS_DiameterDimension) MeasureGUI_DimensionCreateTool::Diameter( const GE continue; } - aFaceN = gp_Vec( aNorm ); + aFaceN = gp_Vec( aFace.Orientation() == TopAbs_REVERSED ? -aNorm : aNorm ); } } break; @@ -676,7 +678,9 @@ Handle(AIS_DiameterDimension) MeasureGUI_DimensionCreateTool::Diameter( const GE Standard_Real aCircR = aCircle->Circ().Radius(); // construct closed circle as base for the diameter dimension - gp_Circ aRuledCirc = gce_MakeCirc( gp_Ax2( aCircP, aCircN, aCircX ), aCircR ); + Standard_Boolean isReversed = ( ( aPln.Axis().Direction() ^ aCircX ) * aCircN ) < 0.0; + + gp_Circ aRuledCirc = gce_MakeCirc( gp_Ax2( aCircP, isReversed ? -aCircN : aCircN, aCircX ), aCircR ); Handle(AIS_DiameterDimension) aDimension = new AIS_DiameterDimension( aRuledCirc, aPln ); diff --git a/src/MeasureGUI/MeasureGUI_ManageDimensionsDlg.cxx b/src/MeasureGUI/MeasureGUI_ManageDimensionsDlg.cxx index fb739349e..9433464b1 100644 --- a/src/MeasureGUI/MeasureGUI_ManageDimensionsDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_ManageDimensionsDlg.cxx @@ -643,7 +643,7 @@ void MeasureGUI_ManageDimensionsDlg::OnInteractionFinished( Handle(AIS_Interacti TopoDS_Shape anParentSh; if ( GEOMBase::GetShape( myEditObject.get(), anParentSh ) ) { - aLCS = GEOMUtils::GetPosition( anParentSh ); + aLCS = gp_Ax3().Transformed( anParentSh.Location().Transformation() ); } int aDimensionId = IdFromPrs( theIO );