From 41744f1d7b2249a3361610c0de5fc9eea7def470 Mon Sep 17 00:00:00 2001 From: apl Date: Fri, 24 Jan 2014 11:44:11 +0000 Subject: [PATCH] 21854: Add persistent dimensions - Add posibility to measure internal diameter of torus --- .../MeasureGUI_DimensionCreateTool.cxx | 26 +++++++------------ 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/src/MeasureGUI/MeasureGUI_DimensionCreateTool.cxx b/src/MeasureGUI/MeasureGUI_DimensionCreateTool.cxx index 0e3c9e1b9..dbd26cf0d 100644 --- a/src/MeasureGUI/MeasureGUI_DimensionCreateTool.cxx +++ b/src/MeasureGUI/MeasureGUI_DimensionCreateTool.cxx @@ -495,21 +495,6 @@ Handle(AIS_DiameterDimension) MeasureGUI_DimensionCreateTool::Diameter( const GE break; } - - // get arguments of closed torus - if ( aSurf.GetType() == GeomAbs_Torus ) - { - if ( !aSurf.IsUClosed() || !aSurf.IsVClosed() ) - { - return NULL; - } - - gp_Torus aTorus = aSurf.Torus(); - gp_Ax2 anAx2 = aTorus.Position().Ax2(); - aCircle = new Geom_Circle( anAx2, aTorus.MinorRadius() ); - break; - } - // get arguments of closed cone if ( aSurf.GetType() == GeomAbs_Cone ) { @@ -528,9 +513,14 @@ Handle(AIS_DiameterDimension) MeasureGUI_DimensionCreateTool::Diameter( const GE break; } - // get arguments of closed/opened cylinder - if ( aSurf.GetType() == GeomAbs_Cylinder ) + // get arguments of closed torus or cylinder + if ( aSurf.GetType() == GeomAbs_Torus || aSurf.GetType() == GeomAbs_Cylinder ) { + if ( !aSurf.IsUClosed() || !aSurf.IsVClosed() ) + { + return NULL; + } + Handle(Geom_Surface) aBasisSurface = Handle(Geom_Surface)::DownCast( aSurf.Surface().Surface()->Transformed( aSurf.Trsf() ) ); @@ -807,6 +797,8 @@ Handle(AIS_AngleDimension) MeasureGUI_DimensionCreateTool::AngleByThreePoints( c return NULL; } + aDimension->SetFlyout( Settings.DefaultFlyout ); + return aDimension; }