]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
Improve measure tools (increase size of arrows)
authorvsr <vsr@opencascade.com>
Wed, 25 Jun 2008 03:52:35 +0000 (03:52 +0000)
committervsr <vsr@opencascade.com>
Wed, 25 Jun 2008 03:52:35 +0000 (03:52 +0000)
src/MeasureGUI/MeasureGUI_AngleDlg.cxx
src/MeasureGUI/MeasureGUI_DistanceDlg.cxx

index de13dd70b45305e71bb6b080a39e325d4e1ef369..5da840cf1d698f5e43287ee43901296e93e20663 100644 (file)
@@ -55,6 +55,7 @@
 #include <Geom_Plane.hxx>
 #include <gce_MakePln.hxx>
 #include <Precision.hxx>
+#include <AIS.hxx>
 
 // QT Includes
 #include <qlineedit.h>
@@ -313,6 +314,31 @@ SALOME_Prs* MeasureGUI_AngleDlg::buildPrs()
         Handle(AIS_AngleDimension) anIO = new AIS_AngleDimension
           (anEdge1, anEdge2, aPlane, anAngle * PI180,
            TCollection_ExtendedString((Standard_CString)aLabel.latin1()));
+       Handle(Geom_Line) geom_lin1,geom_lin2;
+       gp_Pnt ptat11,ptat12,ptat21,ptat22;
+       Standard_Boolean isInfinite1,isInfinite2;
+       Handle(Geom_Curve) extCurv;
+       Standard_Integer extShape;
+       if ( AIS::ComputeGeometry(anEdge1,
+                                 anEdge2,
+                                 extShape,
+                                 geom_lin1,
+                                 geom_lin2,
+                                 ptat11,
+                                 ptat12,
+                                 ptat21,
+                                 ptat22,
+                                 extCurv,
+                                 isInfinite1,
+                                 isInfinite2,
+                                 aPlane)) {
+         Standard_Real arrSize1 = anIO->ArrowSize();
+         Standard_Real arrSize2 = anIO->ArrowSize();
+         if (!isInfinite1) arrSize1 = ptat11.Distance(ptat12)/10.;
+         if (!isInfinite2) arrSize2 = ptat21.Distance(ptat22)/10.;
+         Standard_Real arrowSize = Max(arrSize1,arrSize2);
+         anIO->SetArrowSize(arrowSize);
+       }
 
         SOCC_Prs* aPrs =
           dynamic_cast<SOCC_Prs*>(((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->CreatePrs(0));
index 2591b69816106c7265681166db520e37b512d112..100f3bad94cbb8669edaeab838c7e3a4860732e8 100644 (file)
@@ -312,6 +312,7 @@ SALOME_Prs* MeasureGUI_DistanceDlg::buildPrs()
 
       Handle( AIS_LengthDimension ) anIO = new AIS_LengthDimension
         (aVert1, aVert2, P, aDist, TCollection_ExtendedString((Standard_CString)aLabel.latin1()));
+      anIO->SetArrowSize( aDist/20 );
 
       SOCC_Prs* aPrs =
         dynamic_cast<SOCC_Prs*>( ((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->CreatePrs( 0 ) );