mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-02-03 18:10:34 +05:00
21854: Add persistent dimensions
- Minor remarks: LCS from TopLoc_Location for quickness
This commit is contained in:
parent
f7284cdba3
commit
7ae44206e9
@ -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() ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
|
@ -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 );
|
||||
|
||||
|
@ -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 );
|
||||
|
Loading…
Reference in New Issue
Block a user