]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Support of newer compilers
authormpv <mpv@opencascade.com>
Wed, 14 Mar 2018 07:08:07 +0000 (10:08 +0300)
committermpv <mpv@opencascade.com>
Wed, 14 Mar 2018 07:08:07 +0000 (10:08 +0300)
12 files changed:
src/BuildPlugin/BuildPlugin_CompSolid.cpp
src/BuildPlugin/BuildPlugin_Solid.cpp
src/BuildPlugin/BuildPlugin_Validators.cpp
src/GeomAlgoAPI/GeomAlgoAPI_MakeVolume.cpp
src/GeomAlgoAPI/GeomAlgoAPI_MakeVolume.h
src/Model/Model_Application.h
src/ModuleBase/ModuleBase_ViewerPrs.cpp
src/PartSet/PartSet_CustomPrs.cpp
src/SketchPlugin/SketchPlugin_Fillet.cpp
src/SketcherPrs/SketcherPrs_Angle.cpp
src/SketcherPrs/SketcherPrs_Radius.cpp
src/XGUI/XGUI_Selection.h

index c88cac3248d2257c631c505b5b7af7efc495d114..0fdb399fa31098b109dc1c4aa34577bb503dfd9c 100644 (file)
@@ -47,7 +47,8 @@ void BuildPlugin_CompSolid::execute()
       aShape = aSelection->context()->shape();
     anOriginalShapes.push_back(aShape);
   }
-  std::shared_ptr<GeomAlgoAPI_MakeVolume> anAlgo(new GeomAlgoAPI_MakeVolume(anOriginalShapes));
+  std::shared_ptr<GeomAlgoAPI_MakeVolume> anAlgo(
+    new GeomAlgoAPI_MakeVolume(anOriginalShapes, false));
   GeomShapePtr aVolumeRes = anAlgo->shape();
 
   // check and process result of volume maker
index 5a98995260263c28b974e5450ec122570b6e317a..0f044564e5a0355f4c340ee5af970fd53f127953 100644 (file)
@@ -51,7 +51,8 @@ void BuildPlugin_Solid::execute()
       aShape = aSelection->context()->shape();
     anOriginalShapes.push_back(aShape);
   }
-  std::shared_ptr<GeomAlgoAPI_MakeVolume> anAlgo(new GeomAlgoAPI_MakeVolume(anOriginalShapes));
+  std::shared_ptr<GeomAlgoAPI_MakeVolume> anAlgo(
+    new GeomAlgoAPI_MakeVolume(anOriginalShapes, false));
   // check and process result of volume maker
   GeomShapePtr aResShape = getSingleSubshape(anAlgo->shape());
   storeResult(anOriginalShapes, aResShape, anAlgo);
index 99140d20eb5c498ab7619a9751b11fedecd0eb22..1dc69c0a38c5566aaf2b651693ef48bd452604cb 100644 (file)
@@ -289,7 +289,8 @@ bool BuildPlugin_ValidatorBaseForSolids::isValid(
     anOriginalShapes.push_back(aShape);
   }
 
-  std::shared_ptr<GeomAlgoAPI_MakeVolume> anAlgorithm(new GeomAlgoAPI_MakeVolume(anOriginalShapes));
+  std::shared_ptr<GeomAlgoAPI_MakeVolume> anAlgorithm(
+    new GeomAlgoAPI_MakeVolume(anOriginalShapes, false));
 
   if (!anAlgorithm->isDone()) {
     theError = "MakeVolume algorithm failed.";
index 9dad362eaa3e60a7b5d3ac19f3eff84e2f66416f..f730342fdf58d1547395c6701556cade9d6fd4ee 100644 (file)
@@ -27,7 +27,7 @@
 //=================================================================================================
 std::shared_ptr<GeomAPI_Shape> 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<GeomAPI_Shape> 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
index b273fb4cdda9e0a6d3ed8e35c9b8af885fa2f21b..c8bcf3005f38812d5b854586fb54bd9e9eaee456 100644 (file)
@@ -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<GeomAPI_Shape> 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.
index 6ec3c8df938bf137bf8346f71fdc1d8d770166ec..b91f69a81f98d1c2ed73dcfab282c502c9bd207f 100644 (file)
@@ -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<Model_Document> document(const int theDocID);
index 3d4d446e616c5057711b2f7ec1a3583dd3f62816..d1988484dcc612de7ce9228478555273c47d6e85 100644 (file)
@@ -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)
index 7fc82d061616070bf05d2b5ae0ff41e6e5b5265b..1780f0d44f6299d88775afb1130ad0c0aea10cf0 100755 (executable)
@@ -118,7 +118,7 @@ bool PartSet_CustomPrs::displayPresentation(
     default:
       return isModified;
   }
-  NCollection_DataMap<TopoDS_Shape, Handle_AIS_InteractiveObject>& aShapeMap =
+  NCollection_DataMap<TopoDS_Shape, Handle(AIS_InteractiveObject)>& aShapeMap =
                                                                  anOperationPrs->shapesMap();
   PartSet_OperationPrs::fillShapeList(aFeatureShapes, myWorkshop, aShapeMap);
 
index 519bb30c6795ddacb61c68a0574658fd3caad595..3373df8c6df0504ea4a39d8531c6cb8e5c534a10 100644 (file)
@@ -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<FeaturePtr> findFeaturesToRemove(const FeaturePtr theFeature,
index c8f79b464d7f1b696f4b4a56cf0b1e8fc69688cc..79014c40b8dbf2181b61598483fdea7a84ea1e2a 100644 (file)
@@ -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
index 8fa795e90b4e94c4d29122700ac908c701c1476a..0219e2f37f9b9b2c0ec3d2c26f8c30056f4dbc87 100644 (file)
@@ -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);
 
 
index 5717d3580712ca023d7327073521a17268865c45..8d9a0a24f82c5e99087e69e60dd9b4acffe1001e 100644 (file)
@@ -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.