}
aListOfIO.Remove( aIterateIO );
+
+ if ( !aIterateIO.More() )
+ {
+ break;
+ }
}
// prepare dimension styling
}
}
- updateDimensions( myIO, occPrs, GEOMUtils::GetPosition( myShape ) );
+ updateDimensions( myIO, occPrs, gp_Ax3().Transformed( myShape.Location().Transformation() ) );
}
}
TopoDS_Shape anParentSh;
if ( GEOMBase::GetShape( myParentObj.get(), anParentSh ) )
{
- aLCS = GEOMUtils::GetPosition( anParentSh );
+ aLCS = gp_Ax3().Transformed( anParentSh.Location().Transformation() );
}
QString aName = getNewObjectName();
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;
continue;
}
- aFaceN = gp_Vec( aNorm );
+ aFaceN = gp_Vec( aFace.Orientation() == TopAbs_REVERSED ? -aNorm : aNorm );
}
}
break;
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 );
TopoDS_Shape anParentSh;
if ( GEOMBase::GetShape( myEditObject.get(), anParentSh ) )
{
- aLCS = GEOMUtils::GetPosition( anParentSh );
+ aLCS = gp_Ax3().Transformed( anParentSh.Location().Transformation() );
}
int aDimensionId = IdFromPrs( theIO );