From: sbh Date: Wed, 1 Apr 2015 09:57:54 +0000 (+0300) Subject: Make v1.1.0 compilable under linux X-Git-Tag: V_1.1.0~66^2~2^2~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9e9c9a449415e86c8635345460e3db6701799ef2;p=modules%2Fshaper.git Make v1.1.0 compilable under linux --- diff --git a/src/Config/Config_Prop.h b/src/Config/Config_Prop.h index 5e6cc4bc8..b24e42278 100644 --- a/src/Config/Config_Prop.h +++ b/src/Config/Config_Prop.h @@ -4,8 +4,8 @@ // Created: 12 Aug 2014 // Author: Vitaly SMETANNIKOV -#ifndef Config_Prop_H -#define Config_Prop_H +#ifndef CONFIG_PROP_H +#define CONFIG_PROP_H #include "Config_def.h" @@ -26,7 +26,7 @@ class Config_Prop { Disabled, Space, - Bool, + Boolean, Color, String, Selector, diff --git a/src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp b/src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp index 3d8c5bbc8..3056c2682 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp @@ -72,8 +72,12 @@ void FeaturesPlugin_Extrusion::execute() for(int aFaceIndex = 0; aFaceIndex < aFacesNum || aFacesNum == -1; aFaceIndex++) { ResultBodyPtr aResultBody = document()->createBody(data(), aResultIndex); - std::shared_ptr aFace = - aFacesNum == -1 ? aValueFace : aConstruction->face(aFaceIndex); + std::shared_ptr aFace; + if (aFacesNum == -1) { + aFace = aValueFace; + } else { + aFace = std::dynamic_pointer_cast(aConstruction->face(aFaceIndex)); + } GeomAlgoAPI_Extrusion aFeature(aFace, aSize); if(!aFeature.isDone()) { static const std::string aFeatureError = "Extrusion algorithm failed"; diff --git a/src/Model/Model_Update.cpp b/src/Model/Model_Update.cpp index 2390df826..f1b4f50ff 100644 --- a/src/Model/Model_Update.cpp +++ b/src/Model/Model_Update.cpp @@ -50,7 +50,7 @@ Model_Update::Model_Update() aLoop->registerListener(this, kOpStartEvent); Config_PropManager::registerProp("Model update", "automatic_rebuild", "Rebuild immediately", - Config_Prop::Bool, "false"); + Config_Prop::Boolean, "false"); myIsAutomatic = Config_PropManager::findProp("Model update", "automatic_rebuild")->value() == "true"; } diff --git a/src/ModuleBase/ModuleBase_PagedContainer.cpp b/src/ModuleBase/ModuleBase_PagedContainer.cpp index 43fb4de22..b4e8b5690 100644 --- a/src/ModuleBase/ModuleBase_PagedContainer.cpp +++ b/src/ModuleBase/ModuleBase_PagedContainer.cpp @@ -13,7 +13,7 @@ #include #include -#include +#include #include diff --git a/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp b/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp index 8b53074f9..9d74cc2fb 100644 --- a/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp @@ -231,7 +231,7 @@ bool ModuleBase_WidgetMultiSelector::setSelection(const Handle_SelectMgr_EntityO AttributeSelectionListPtr aSelectionListAttr = std::dynamic_pointer_cast(aData->attribute(attributeID())); if (aShape->isEqual(aResult->shape())) - aSelectionListAttr->append(aResult, NULL); + aSelectionListAttr->append(aResult, GeomShapePtr()); else aSelectionListAttr->append(aResult, aShape); diff --git a/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp b/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp index 36bbd0314..34eb3e189 100644 --- a/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp @@ -377,7 +377,7 @@ void ModuleBase_WidgetShapeSelector::storeAttributeValue() myObject = GeomValidators_Tools::getObject(anAttribute); myShape = getShape(); - myRefAttribute = NULL; + myRefAttribute = AttributePtr(); myIsObject = false; AttributeRefAttrPtr aRefAttr = aData->refattr(attributeID()); if (aRefAttr) { diff --git a/src/PartSet/PartSet_WidgetShapeSelector.cpp b/src/PartSet/PartSet_WidgetShapeSelector.cpp index 7352c1344..3dc5460c2 100644 --- a/src/PartSet/PartSet_WidgetShapeSelector.cpp +++ b/src/PartSet/PartSet_WidgetShapeSelector.cpp @@ -116,6 +116,6 @@ void PartSet_WidgetShapeSelector::removeExternal() anIgnoredFeatures.insert(sketch()); XGUI_Workshop::deleteFeatures(anObjects, anIgnoredFeatures); } - myExternalObject = NULL; + myExternalObject = ObjectPtr(); } } diff --git a/src/SketchPlugin/SketchPlugin_ConstraintMirror.cpp b/src/SketchPlugin/SketchPlugin_ConstraintMirror.cpp index fde907d81..5dc94ef4a 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintMirror.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintMirror.cpp @@ -79,8 +79,7 @@ void SketchPlugin_ConstraintMirror::execute() ResultConstructionPtr aRC = std::dynamic_pointer_cast(*aMirrorIter); DocumentPtr aDoc = aRC ? aRC->document() : DocumentPtr(); - FeaturePtr aFeature = aDoc ? std::dynamic_pointer_cast( - aDoc->feature(aRC)) : FeaturePtr(); + FeaturePtr aFeature = aDoc ? aDoc->feature(aRC) : FeaturePtr(); if (aFeature) aDoc->removeFeature(aFeature); } diff --git a/src/SketchSolver/SketchSolver_ConstraintGroup.cpp b/src/SketchSolver/SketchSolver_ConstraintGroup.cpp index 9b0ae4325..a3f083faf 100644 --- a/src/SketchSolver/SketchSolver_ConstraintGroup.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintGroup.cpp @@ -687,10 +687,10 @@ bool SketchSolver_ConstraintGroup::changeMirrorConstraint( for ( ; aBaseIter != aBaseList.end(); aBaseIter++, aMirIter++) { aRC = std::dynamic_pointer_cast(*aBaseIter); aBaseFeature = aRC ? aRC->document()->feature(aRC) : - std::dynamic_pointer_cast(*aBaseIter); + std::dynamic_pointer_cast(*aBaseIter); aRC = std::dynamic_pointer_cast(*aMirIter); aMirrorFeature = aRC ? aRC->document()->feature(aRC) : - std::dynamic_pointer_cast(*aMirIter); + std::dynamic_pointer_cast(*aMirIter); if (!aBaseFeature || !aMirrorFeature || aBaseFeature->getKind() != aMirrorFeature->getKind()) @@ -806,7 +806,7 @@ bool SketchSolver_ConstraintGroup::changeMirrorConstraint( for (aBaseIter = aBaseList.begin(); aBaseIter != aBaseList.end(); aBaseIter++) { aRC = std::dynamic_pointer_cast(*aBaseIter); aBaseFeature = aRC ? aRC->document()->feature(aRC) : - std::dynamic_pointer_cast(*aBaseIter); + std::dynamic_pointer_cast(*aBaseIter); if (!aBaseFeature) continue; std::list aPoints = aBaseFeature->data()->attributes(GeomDataAPI_Point2D::typeId()); std::list::iterator anIt = aPoints.begin(); @@ -921,7 +921,7 @@ bool SketchSolver_ConstraintGroup::changeFilletConstraint( for (int indEnt = 0; aFilIter != aFilletList.end(); aFilIter++, indEnt++) { aRC = std::dynamic_pointer_cast(*aFilIter); aFilletFeature = aRC ? aRC->document()->feature(aRC) : - std::dynamic_pointer_cast(*aFilIter); + std::dynamic_pointer_cast(*aFilIter); if (!aFilletFeature) return false; aFilletEnt[indEnt] = changeEntityFeature(aFilletFeature); @@ -1080,7 +1080,7 @@ Slvs_hEntity SketchSolver_ConstraintGroup::changeEntity( std::map, Slvs_hEntity>::const_iterator aEntIter = myEntityAttrMap.find(theEntity); int aEntPos; - std::vector::const_iterator aParamIter; // looks at first parameter of already existent entity or at the end of vector otherwise + std::vector::iterator aParamIter; // looks at first parameter of already existent entity or at the end of vector otherwise if (aEntIter == myEntityAttrMap.end()) // no such entity => should be created aParamIter = myParams.end(); else { // the entity already exists @@ -1297,7 +1297,7 @@ Slvs_hEntity SketchSolver_ConstraintGroup::changeNormal( // Try to find existent normal std::map, Slvs_hEntity>::const_iterator aEntIter = myEntityAttrMap.find(theNorm); - std::vector::const_iterator aParamIter; // looks to the first parameter of already existent entity or to the end of vector otherwise + std::vector::iterator aParamIter; // looks to the first parameter of already existent entity or to the end of vector otherwise if (aEntIter == myEntityAttrMap.end()) // no such entity => should be created aParamIter = myParams.end(); else { // the entity already exists, update it @@ -1378,7 +1378,7 @@ bool SketchSolver_ConstraintGroup::updateWorkplane() // Purpose: create/update value of parameter // ============================================================================ Slvs_hParam SketchSolver_ConstraintGroup::changeParameter( - const double& theParam, std::vector::const_iterator& thePrmIter) + double theParam, std::vector::iterator& thePrmIter) { if (thePrmIter != myParams.end()) { // Parameter should be updated int aParamPos = thePrmIter - myParams.begin(); @@ -2192,7 +2192,7 @@ Slvs_hConstraint SketchSolver_ConstraintGroup::changeMirrorPoints( std::map::iterator aMapIter = thePrevMirror.find(theBasePoint); if (aMapIter != thePrevMirror.end()) { thePrevMirror.erase(aMapIter); - std::vector::const_iterator anIter = thePrevConstr.begin(); + std::vector::iterator anIter = thePrevConstr.begin(); for (; anIter != thePrevConstr.end(); anIter++) if (anIter->ptA == theBasePoint) { if (anIter->ptB != theMirrorPoint) { diff --git a/src/SketchSolver/SketchSolver_ConstraintGroup.h b/src/SketchSolver/SketchSolver_ConstraintGroup.h index 73dc23d63..8ec26852f 100644 --- a/src/SketchSolver/SketchSolver_ConstraintGroup.h +++ b/src/SketchSolver/SketchSolver_ConstraintGroup.h @@ -168,8 +168,8 @@ protected: * (the iterator will be increased if it does not reach the end of the list) * \return identifier of changed parameter; when the parameter cannot be created, returned ID is 0 */ - Slvs_hParam changeParameter(const double& theParam, - std::vector::const_iterator& thePrmIter); + Slvs_hParam changeParameter(double theParam, + std::vector::iterator& thePrmIter); /** \brief Removes specified entities and their parameters * \param[in] theEntities list of IDs of the entities to be removed diff --git a/src/SketcherPrs/SketcherPrs_Radius.cpp b/src/SketcherPrs/SketcherPrs_Radius.cpp index 07957c4db..5e30f527f 100644 --- a/src/SketcherPrs/SketcherPrs_Radius.cpp +++ b/src/SketcherPrs/SketcherPrs_Radius.cpp @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include #include