Salome HOME
updated copyright message
[modules/shaper.git] / src / SketcherPrs / SketcherPrs_Angle.cpp
index 5d626ed8c54f72847fd3b32d6cf3e38cef13dbba..88d57dd1ad221a45737fbe9d091e878a1cb7e8bd 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2020  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2023  CEA, EDF
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 #include <TopExp.hxx>
 #include <BRep_Tool.hxx>
 
+#include <Standard_Version.hxx>
+
+#if OCC_VERSION_HEX > 0x070400
+#include <PrsDim_TypeOfAngleArrowVisibility.hxx>
+#endif
+
 /// Update variable aspect parameters (depending on viewer scale)
 /// \param theDimAspect an aspect to be changed
 /// \param theDimValue an arrow value
@@ -51,11 +57,11 @@ extern void updateArrows(Handle(Prs3d_DimensionAspect) theDimAspect,
 //  #define COMPILATION_CORRECTION
 //#endif
 
-IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Angle, AIS_AngleDimension);
+IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Angle, PrsDim_AngleDimension);
 
 SketcherPrs_Angle::SketcherPrs_Angle(ModelAPI_Feature* theConstraint,
                                      SketchPlugin_Sketch* theSketcher)
-: AIS_AngleDimension(gp_Pnt(0,0,0), gp_Pnt(1,0,0), gp_Pnt(0,1,0)),
+: PrsDim_AngleDimension(gp_Pnt(0,0,0), gp_Pnt(1,0,0), gp_Pnt(0,1,0)),
   myConstraint(theConstraint),
   mySketcher(theSketcher),
   myFirstPoint(gp_Pnt(0,0,0)),
@@ -221,12 +227,20 @@ void SketcherPrs_Angle::Compute(const Handle(PrsMgr_PresentationManager3d)& theP
 
   double aDist = -1;
 #ifndef COMPILATION_CORRECTION
+#if OCC_VERSION_HEX > 0x070400
+  SetArrowsVisibility(PrsDim_TypeOfAngleArrowVisibility_Both);
+#else
   SetArrowsVisibility(AIS_TOAV_Both);
+#endif
 #endif
   SetMeasuredGeometry(myFirstPoint, myCenterPoint, mySecondPoint);
 #ifndef COMPILATION_CORRECTION
   bool isReversedPlanes = isAnglePlaneReversedToSketchPlane();
+#if OCC_VERSION_HEX > 0x070400
+  SetType(!isReversedPlanes ? PrsDim_TypeOfAngle_Exterior : PrsDim_TypeOfAngle_Interior);
+#else
   SetType(!isReversedPlanes ? AIS_TOA_Exterior : AIS_TOA_Interior);
+#endif
 #endif
   if (aDist < 0) /// it was not calculated yet
     aDist = calculateDistanceToFlyoutPoint();
@@ -249,7 +263,7 @@ void SketcherPrs_Angle::Compute(const Handle(PrsMgr_PresentationManager3d)& theP
 
   updateArrows(myAspect, anAngleCircleLength, aTextSize, aLocationType);
 
-  AIS_AngleDimension::Compute(thePresentationManager, thePresentation, theMode);
+  PrsDim_AngleDimension::Compute(thePresentationManager, thePresentation, theMode);
 
   if (!aReadyToDisplay)
     SketcherPrs_Tools::sendEmptyPresentationError(myConstraint,
@@ -280,7 +294,7 @@ void SketcherPrs_Angle::ComputeSelection(const Handle(SelectMgr_Selection)& aSel
   }
   }
   SetSelToleranceForText2d(SketcherPrs_Tools::getArrowSize()/5.);
-  AIS_AngleDimension::ComputeSelection(aSelection, aMode);
+  PrsDim_AngleDimension::ComputeSelection(aSelection, aMode);
 }
 
 bool SketcherPrs_Angle::isAnglePlaneReversedToSketchPlane()