From 8f97a06b8d60f299574b9b8600c49cdebc50f048 Mon Sep 17 00:00:00 2001 From: rnv Date: Mon, 27 Jul 2020 12:32:17 +0300 Subject: [PATCH] Build SHAPER with dev version of OCCT (IR-2020-07-10) --- src/FeaturesPlugin/FeaturesPlugin_Measurement.cpp | 1 + src/GeomAPI/GeomAPI_AISObject.cpp | 1 + src/ModuleBase/ModuleBase_ResultPrs.cpp | 10 +++++++++- src/PartSet/PartSet_ResultSketchPrs.cpp | 10 ++++++++++ src/PartSet/PartSet_WidgetSketchLabel.cpp | 1 - src/SketcherPrs/SketcherPrs_Angle.cpp | 14 ++++++++++++++ src/SketcherPrs/SketcherPrs_DimensionStyle.cpp | 5 +++++ src/SketcherPrs/SketcherPrs_DimensionStyle.h | 1 + src/SketcherPrs/SketcherPrs_LengthDimension.cpp | 1 - src/SketcherPrs/SketcherPrs_SensitivePoint.cpp | 4 ++++ src/SketcherPrs/SketcherPrs_SensitivePoint.h | 6 +++++- src/SketcherPrs/SketcherPrs_Tools.h | 1 - src/XGUI/XGUI_Displayer.cpp | 1 - 13 files changed, 50 insertions(+), 6 deletions(-) diff --git a/src/FeaturesPlugin/FeaturesPlugin_Measurement.cpp b/src/FeaturesPlugin/FeaturesPlugin_Measurement.cpp index 2a6119eb4..dfde5d610 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Measurement.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Measurement.cpp @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include diff --git a/src/GeomAPI/GeomAPI_AISObject.cpp b/src/GeomAPI/GeomAPI_AISObject.cpp index b150bffca..cf078f6ca 100644 --- a/src/GeomAPI/GeomAPI_AISObject.cpp +++ b/src/GeomAPI/GeomAPI_AISObject.cpp @@ -32,6 +32,7 @@ #include #include +#include #include #include #include diff --git a/src/ModuleBase/ModuleBase_ResultPrs.cpp b/src/ModuleBase/ModuleBase_ResultPrs.cpp index 9d3a5c616..10f3d798b 100644 --- a/src/ModuleBase/ModuleBase_ResultPrs.cpp +++ b/src/ModuleBase/ModuleBase_ResultPrs.cpp @@ -60,6 +60,11 @@ #include #include #include +#include + +#if OCC_VERSION_HEX > 0x070400 +#include +#endif //******************************************************************************************* @@ -427,8 +432,11 @@ bool ModuleBase_ResultPrs::appendVertexSelection(const Handle(SelectMgr_Selectio const TopoDS_Shape& aShape = Shape(); int aPriority = StdSelect_BRepSelectionTool::GetStandardPriority(aShape, TopAbs_VERTEX); +#if OCC_VERSION_HEX > 0x070400 + double aDeflection = StdPrs_ToolTriangulatedShape::GetDeflection(aShape, myDrawer); +#else double aDeflection = Prs3d::GetDeflection(aShape, myDrawer); - +#endif /// The cause of this method is the last parameter of BRep owner setting into True. /// That means that owner should behave like it comes from decomposition. (In this case, OCCT /// visualizes it in Ring style) OCCT version is 7.0.0 with path for SHAPER module. diff --git a/src/PartSet/PartSet_ResultSketchPrs.cpp b/src/PartSet/PartSet_ResultSketchPrs.cpp index a40d0f208..c6e5585a9 100644 --- a/src/PartSet/PartSet_ResultSketchPrs.cpp +++ b/src/PartSet/PartSet_ResultSketchPrs.cpp @@ -55,6 +55,12 @@ #include #endif +#include + +#if OCC_VERSION_HEX > 0x070400 +#include +#endif + //******************************************************************************************* IMPLEMENT_STANDARD_RTTIEXT(PartSet_ResultSketchPrs, ViewerData_AISShape); @@ -215,7 +221,11 @@ void PartSet_ResultSketchPrs::appendShapeSelection(const Handle(SelectMgr_Select const TopAbs_ShapeEnum& theTypeOfSelection) { // POP protection against crash in low layers +#if OCC_VERSION_HEX > 0x070400 + Standard_Real aDeflection = StdPrs_ToolTriangulatedShape::GetDeflection(theShape, myDrawer); +#else Standard_Real aDeflection = Prs3d::GetDeflection(theShape, myDrawer); +#endif try { StdSelect_BRepSelectionTool::Load(theSelection, this, diff --git a/src/PartSet/PartSet_WidgetSketchLabel.cpp b/src/PartSet/PartSet_WidgetSketchLabel.cpp index 4a2a5154f..2f41d3ed9 100644 --- a/src/PartSet/PartSet_WidgetSketchLabel.cpp +++ b/src/PartSet/PartSet_WidgetSketchLabel.cpp @@ -63,7 +63,6 @@ #include #include #include -#include #include #include diff --git a/src/SketcherPrs/SketcherPrs_Angle.cpp b/src/SketcherPrs/SketcherPrs_Angle.cpp index 5d626ed8c..58def1833 100644 --- a/src/SketcherPrs/SketcherPrs_Angle.cpp +++ b/src/SketcherPrs/SketcherPrs_Angle.cpp @@ -38,6 +38,12 @@ #include #include +#include + +#if OCC_VERSION_HEX > 0x070400 +#include +#endif + /// Update variable aspect parameters (depending on viewer scale) /// \param theDimAspect an aspect to be changed /// \param theDimValue an arrow value @@ -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(); diff --git a/src/SketcherPrs/SketcherPrs_DimensionStyle.cpp b/src/SketcherPrs/SketcherPrs_DimensionStyle.cpp index 90444ba5d..d535569f7 100644 --- a/src/SketcherPrs/SketcherPrs_DimensionStyle.cpp +++ b/src/SketcherPrs/SketcherPrs_DimensionStyle.cpp @@ -27,6 +27,7 @@ #include #include +#include //#ifndef WNT // #define COMPILATION_CORRECTION @@ -82,7 +83,11 @@ void SketcherPrs_DimensionStyle::updateDimensions(AIS_Dimension* theDimension, /// do not show special symbols of dimension: /// previous implementation did not allow to unite them theDimension->SetSpecialSymbol(MyEmptySymbol); +#if OCC_VERSION_HEX > 0x070400 + theDimension->SetDisplaySpecialSymbol(PrsDim_DisplaySpecialSymbol_No); +#else theDimension->SetDisplaySpecialSymbol(AIS_DSS_No); +#endif TCollection_ExtendedString aCustomValue; if (theHasParameters) { diff --git a/src/SketcherPrs/SketcherPrs_DimensionStyle.h b/src/SketcherPrs/SketcherPrs_DimensionStyle.h index 4e2f96882..96c8b9c27 100644 --- a/src/SketcherPrs/SketcherPrs_DimensionStyle.h +++ b/src/SketcherPrs/SketcherPrs_DimensionStyle.h @@ -23,6 +23,7 @@ //#include #include +#include #include "SketcherPrs_Tools.h" diff --git a/src/SketcherPrs/SketcherPrs_LengthDimension.cpp b/src/SketcherPrs/SketcherPrs_LengthDimension.cpp index b2cabccc3..495f3d069 100644 --- a/src/SketcherPrs/SketcherPrs_LengthDimension.cpp +++ b/src/SketcherPrs/SketcherPrs_LengthDimension.cpp @@ -40,7 +40,6 @@ #include #include -#include #define OCCT_28850_FIXED diff --git a/src/SketcherPrs/SketcherPrs_SensitivePoint.cpp b/src/SketcherPrs/SketcherPrs_SensitivePoint.cpp index 1d19616fb..24b90a1fa 100644 --- a/src/SketcherPrs/SketcherPrs_SensitivePoint.cpp +++ b/src/SketcherPrs/SketcherPrs_SensitivePoint.cpp @@ -98,7 +98,11 @@ Select3D_BndBox3d SketcherPrs_SensitivePoint::BoundingBox() SelectMgr_Vec3 (aPnt.X(), aPnt.Y(), aPnt.Z())); } +#if OCC_VERSION_HEX > 0x070400 +Standard_Integer SketcherPrs_SensitivePoint::NbSubElements() const +#else Standard_Integer SketcherPrs_SensitivePoint::NbSubElements() +#endif { return 1; } diff --git a/src/SketcherPrs/SketcherPrs_SensitivePoint.h b/src/SketcherPrs/SketcherPrs_SensitivePoint.h index e3ef20954..68aeeda1f 100644 --- a/src/SketcherPrs/SketcherPrs_SensitivePoint.h +++ b/src/SketcherPrs/SketcherPrs_SensitivePoint.h @@ -23,6 +23,7 @@ #include #include #include +#include DEFINE_STANDARD_HANDLE(SketcherPrs_SensitivePoint, Select3D_SensitiveEntity) @@ -42,8 +43,11 @@ public: int theId); /// Returns number of sub-elements +#if OCC_VERSION_HEX > 0x070400 + Standard_EXPORT virtual Standard_Integer NbSubElements() const Standard_OVERRIDE; +#else Standard_EXPORT virtual Standard_Integer NbSubElements() Standard_OVERRIDE; - +#endif //! Update location of the point Standard_EXPORT virtual Handle(Select3D_SensitiveEntity) GetConnected() Standard_OVERRIDE; diff --git a/src/SketcherPrs/SketcherPrs_Tools.h b/src/SketcherPrs/SketcherPrs_Tools.h index 35c836814..33254fd18 100644 --- a/src/SketcherPrs/SketcherPrs_Tools.h +++ b/src/SketcherPrs/SketcherPrs_Tools.h @@ -35,7 +35,6 @@ #include class GeomDataAPI_Point2D; -class AIS_Dimension; namespace SketcherPrs_Tools { diff --git a/src/XGUI/XGUI_Displayer.cpp b/src/XGUI/XGUI_Displayer.cpp index 096749adb..d34ec9da4 100644 --- a/src/XGUI/XGUI_Displayer.cpp +++ b/src/XGUI/XGUI_Displayer.cpp @@ -56,7 +56,6 @@ #include #include #include -#include #include #include #include -- 2.30.2