From: mpv Date: Wed, 14 Mar 2018 07:08:07 +0000 (+0300) Subject: Support of newer compilers X-Git-Tag: V8_5_0rc2~8^2~27 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=32fed3772d799227b91629f11b264c1f742ec7c8;p=modules%2Fshaper.git Support of newer compilers --- diff --git a/src/BuildPlugin/BuildPlugin_CompSolid.cpp b/src/BuildPlugin/BuildPlugin_CompSolid.cpp index c88cac324..0fdb399fa 100644 --- a/src/BuildPlugin/BuildPlugin_CompSolid.cpp +++ b/src/BuildPlugin/BuildPlugin_CompSolid.cpp @@ -47,7 +47,8 @@ void BuildPlugin_CompSolid::execute() aShape = aSelection->context()->shape(); anOriginalShapes.push_back(aShape); } - std::shared_ptr anAlgo(new GeomAlgoAPI_MakeVolume(anOriginalShapes)); + std::shared_ptr anAlgo( + new GeomAlgoAPI_MakeVolume(anOriginalShapes, false)); GeomShapePtr aVolumeRes = anAlgo->shape(); // check and process result of volume maker diff --git a/src/BuildPlugin/BuildPlugin_Solid.cpp b/src/BuildPlugin/BuildPlugin_Solid.cpp index 5a9899526..0f044564e 100644 --- a/src/BuildPlugin/BuildPlugin_Solid.cpp +++ b/src/BuildPlugin/BuildPlugin_Solid.cpp @@ -51,7 +51,8 @@ void BuildPlugin_Solid::execute() aShape = aSelection->context()->shape(); anOriginalShapes.push_back(aShape); } - std::shared_ptr anAlgo(new GeomAlgoAPI_MakeVolume(anOriginalShapes)); + std::shared_ptr anAlgo( + new GeomAlgoAPI_MakeVolume(anOriginalShapes, false)); // check and process result of volume maker GeomShapePtr aResShape = getSingleSubshape(anAlgo->shape()); storeResult(anOriginalShapes, aResShape, anAlgo); diff --git a/src/BuildPlugin/BuildPlugin_Validators.cpp b/src/BuildPlugin/BuildPlugin_Validators.cpp index 99140d20e..1dc69c0a3 100644 --- a/src/BuildPlugin/BuildPlugin_Validators.cpp +++ b/src/BuildPlugin/BuildPlugin_Validators.cpp @@ -289,7 +289,8 @@ bool BuildPlugin_ValidatorBaseForSolids::isValid( anOriginalShapes.push_back(aShape); } - std::shared_ptr anAlgorithm(new GeomAlgoAPI_MakeVolume(anOriginalShapes)); + std::shared_ptr anAlgorithm( + new GeomAlgoAPI_MakeVolume(anOriginalShapes, false)); if (!anAlgorithm->isDone()) { theError = "MakeVolume algorithm failed."; diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_MakeVolume.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_MakeVolume.cpp index 9dad362ea..f730342fd 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_MakeVolume.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_MakeVolume.cpp @@ -27,7 +27,7 @@ //================================================================================================= std::shared_ptr GeomAlgoAPI_MakeVolume::make(const ListOfShape& theFaces) { - GeomAlgoAPI_MakeVolume aMkVolAlgo(theFaces); + GeomAlgoAPI_MakeVolume aMkVolAlgo(theFaces, false); GeomShapePtr aResult; if(aMkVolAlgo.isDone() && !aMkVolAlgo.shape()->isNull() && aMkVolAlgo.isValid()) aResult = aMkVolAlgo.shape(); @@ -35,8 +35,10 @@ std::shared_ptr GeomAlgoAPI_MakeVolume::make(const ListOfShape& t } //================================================================================================= -GeomAlgoAPI_MakeVolume::GeomAlgoAPI_MakeVolume(const ListOfShape& theFaces) +GeomAlgoAPI_MakeVolume::GeomAlgoAPI_MakeVolume( + const ListOfShape& theFaces, const bool theAvoidInternal) { + myAvoidInternal = theAvoidInternal; build(theFaces); } @@ -65,7 +67,7 @@ void GeomAlgoAPI_MakeVolume::build(const ListOfShape& theFaces) // parameters of the volume maker aVolumeMaker->SetArguments(anArgs); aVolumeMaker->SetIntersect(true); // split edges and faces - aVolumeMaker->SetAvoidInternalShapes(true); + aVolumeMaker->SetAvoidInternalShapes(myAvoidInternal); aVolumeMaker->SetGlue(BOPAlgo_GlueOff); // building and getting result diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_MakeVolume.h b/src/GeomAlgoAPI/GeomAlgoAPI_MakeVolume.h index b273fb4cd..c8bcf3005 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_MakeVolume.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_MakeVolume.h @@ -31,6 +31,7 @@ /// \brief Perform building solid (compsolid) from a list of faces. class GeomAlgoAPI_MakeVolume : public GeomAlgoAPI_MakeShape { + bool myAvoidInternal; // to remove internal faces from the result public: /// \brief Perform making volume. /// \param[in] theObjects list of faces. @@ -38,7 +39,10 @@ public: GEOMALGOAPI_EXPORT static std::shared_ptr make(const ListOfShape& theFaces); /// Constructor. - GEOMALGOAPI_EXPORT GeomAlgoAPI_MakeVolume(const ListOfShape& theFaces); + /// \param theFaces faces that will construct a solid + /// \param theAvoidInternal to remove internal faces from the result + GEOMALGOAPI_EXPORT GeomAlgoAPI_MakeVolume(const ListOfShape& theFaces, + const bool theAvoidInternal); private: /// Builds resulting shape. diff --git a/src/Model/Model_Application.h b/src/Model/Model_Application.h index 6ec3c8df9..b91f69a81 100644 --- a/src/Model/Model_Application.h +++ b/src/Model/Model_Application.h @@ -46,7 +46,7 @@ public: DEFINE_STANDARD_RTTIEXT(Model_Application, TDocStd_Application) //! Retuns the application: one per process - MODEL_EXPORT static Handle_Model_Application getApplication(); + MODEL_EXPORT static Handle(Model_Application) getApplication(); //! Returns the document by the identifier //! \returns false of document is not yet created/not loaded MODEL_EXPORT std::shared_ptr document(const int theDocID); diff --git a/src/ModuleBase/ModuleBase_ViewerPrs.cpp b/src/ModuleBase/ModuleBase_ViewerPrs.cpp index 3d4d446e6..d1988484d 100644 --- a/src/ModuleBase/ModuleBase_ViewerPrs.cpp +++ b/src/ModuleBase/ModuleBase_ViewerPrs.cpp @@ -25,7 +25,7 @@ ModuleBase_ViewerPrs::ModuleBase_ViewerPrs(ObjectPtr theResult, const GeomShapePtr& theShape, - Handle_SelectMgr_EntityOwner theOwner) + Handle(SelectMgr_EntityOwner) theOwner) : myResult(theResult), myShape(theShape), myOwner(theOwner) diff --git a/src/PartSet/PartSet_CustomPrs.cpp b/src/PartSet/PartSet_CustomPrs.cpp index 7fc82d061..1780f0d44 100755 --- a/src/PartSet/PartSet_CustomPrs.cpp +++ b/src/PartSet/PartSet_CustomPrs.cpp @@ -118,7 +118,7 @@ bool PartSet_CustomPrs::displayPresentation( default: return isModified; } - NCollection_DataMap& aShapeMap = + NCollection_DataMap& aShapeMap = anOperationPrs->shapesMap(); PartSet_OperationPrs::fillShapeList(aFeatureShapes, myWorkshop, aShapeMap); diff --git a/src/SketchPlugin/SketchPlugin_Fillet.cpp b/src/SketchPlugin/SketchPlugin_Fillet.cpp index 519bb30c6..3373df8c6 100644 --- a/src/SketchPlugin/SketchPlugin_Fillet.cpp +++ b/src/SketchPlugin/SketchPlugin_Fillet.cpp @@ -565,7 +565,7 @@ double calculateFilletRadius(FeaturePtr theFilletFeatures[2]) if (anEdge) aLengths[i] = anEdge->length(); } - return std::min(aLengths[0], aLengths[1]) / 6.0; + return (aLengths[0] < aLengths[1] ? aLengths[0] : aLengths[1]) / 6.0; } std::set findFeaturesToRemove(const FeaturePtr theFeature, diff --git a/src/SketcherPrs/SketcherPrs_Angle.cpp b/src/SketcherPrs/SketcherPrs_Angle.cpp index c8f79b464..79014c40b 100644 --- a/src/SketcherPrs/SketcherPrs_Angle.cpp +++ b/src/SketcherPrs/SketcherPrs_Angle.cpp @@ -43,7 +43,7 @@ /// \param theDimAspect an aspect to be changed /// \param theDimValue an arrow value /// \param theTextSize an arrow value -extern void updateArrows(Handle_Prs3d_DimensionAspect theDimAspect, +extern void updateArrows(Handle(Prs3d_DimensionAspect) theDimAspect, double theDimValue, double theTextSize, SketcherPrs_Tools::LocationType theLocationType); #define PI 3.1415926535897932 diff --git a/src/SketcherPrs/SketcherPrs_Radius.cpp b/src/SketcherPrs/SketcherPrs_Radius.cpp index 8fa795e90..0219e2f37 100644 --- a/src/SketcherPrs/SketcherPrs_Radius.cpp +++ b/src/SketcherPrs/SketcherPrs_Radius.cpp @@ -44,7 +44,7 @@ extern Handle(Prs3d_DimensionAspect) createDimensionAspect(); /// \param theDimAspect an aspect to be changed /// \param theDimValue an arrow value /// \param theTextSize an arrow value -extern void updateArrows(Handle_Prs3d_DimensionAspect theDimAspect, +extern void updateArrows(Handle(Prs3d_DimensionAspect) theDimAspect, double theDimValue, double theTextSize, SketcherPrs_Tools::LocationType theLocationType); diff --git a/src/XGUI/XGUI_Selection.h b/src/XGUI/XGUI_Selection.h index 5717d3580..8d9a0a24f 100644 --- a/src/XGUI/XGUI_Selection.h +++ b/src/XGUI/XGUI_Selection.h @@ -78,7 +78,7 @@ class XGUI_EXPORT XGUI_Selection : public ModuleBase_ISelection /// It depends on the modes, in which the object is activated in the context /// \param theObject an object /// \param theOwners a map of entity owners - void entityOwners(const Handle_AIS_InteractiveObject& theObject, + void entityOwners(const Handle(AIS_InteractiveObject)& theObject, SelectMgr_IndexedMapOfOwner& theOwners) const; /// Return the IO from the viewer presentation.