From 47fd852173321d7333c37ab439c1e75688fe7f72 Mon Sep 17 00:00:00 2001 From: Clarisse Genrault Date: Mon, 21 Nov 2016 11:12:09 +0100 Subject: [PATCH] Suppressing white space at the end line. --- src/FeaturesAPI/FeaturesAPI_Translation.cpp | 6 ++-- src/FeaturesAPI/FeaturesAPI_Translation.h | 8 ++--- .../FeaturesPlugin_Translation.cpp | 34 +++++++++---------- .../FeaturesPlugin_Translation.h | 10 +++--- src/GeomAPI/GeomAPI_Trsf.h | 2 +- src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.cpp | 16 ++++----- src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.h | 4 +-- src/GeomAlgoAPI/GeomAlgoAPI_Translation.cpp | 8 ++--- src/GeomAlgoAPI/GeomAlgoAPI_Translation.h | 10 +++--- src/PrimitivesAPI/PrimitivesAPI_Box.cpp | 4 +-- 10 files changed, 50 insertions(+), 52 deletions(-) diff --git a/src/FeaturesAPI/FeaturesAPI_Translation.cpp b/src/FeaturesAPI/FeaturesAPI_Translation.cpp index a57e812af..bfcd5bdfc 100644 --- a/src/FeaturesAPI/FeaturesAPI_Translation.cpp +++ b/src/FeaturesAPI/FeaturesAPI_Translation.cpp @@ -90,14 +90,14 @@ void FeaturesAPI_Translation::dump(ModelHighAPI_Dumper& theDumper) const { FeaturePtr aBase = feature(); const std::string& aDocName = theDumper.name(aBase->document()); - + AttributeSelectionListPtr anAttrObjects = aBase->selectionList(FeaturesPlugin_Translation::OBJECTS_LIST_ID()); theDumper << aBase << " = model.addTranslation(" << aDocName << ", " << anAttrObjects; - + std::string aCreationMethod = aBase->string(FeaturesPlugin_Translation::CREATION_METHOD())->value(); - + if(aCreationMethod == FeaturesPlugin_Translation::CREATION_METHOD_BY_DISTANCE()) { AttributeSelectionPtr anAttrAxis = aBase->selection(FeaturesPlugin_Translation::AXIS_OBJECT_ID()); diff --git a/src/FeaturesAPI/FeaturesAPI_Translation.h b/src/FeaturesAPI/FeaturesAPI_Translation.h index 3fd650e52..7a14f8a88 100644 --- a/src/FeaturesAPI/FeaturesAPI_Translation.h +++ b/src/FeaturesAPI/FeaturesAPI_Translation.h @@ -56,11 +56,11 @@ public: ModelAPI_AttributeSelection, /** Axis object */, distance, FeaturesPlugin_Translation::DISTANCE_ID(), ModelAPI_AttributeDouble, /** Distance */, - dx, FeaturesPlugin_Translation::DX_ID(), + dx, FeaturesPlugin_Translation::DX_ID(), ModelAPI_AttributeDouble, /** Dimension in X */, - dy, FeaturesPlugin_Translation::DY_ID(), + dy, FeaturesPlugin_Translation::DY_ID(), ModelAPI_AttributeDouble, /** Dimension in Y */, - dz, FeaturesPlugin_Translation::DZ_ID(), + dz, FeaturesPlugin_Translation::DZ_ID(), ModelAPI_AttributeDouble, /** Dimension in Z */ ) @@ -72,7 +72,7 @@ public: FEATURESAPI_EXPORT void setAxisAndDistance(const ModelHighAPI_Selection& theAxisObject, const ModelHighAPI_Double& theDistance); - + /// Modify CreationMethod, dx, dy, dz attributes of the feature. FEATURESAPI_EXPORT void setDimensions(const ModelHighAPI_Double& theDx, diff --git a/src/FeaturesPlugin/FeaturesPlugin_Translation.cpp b/src/FeaturesPlugin/FeaturesPlugin_Translation.cpp index b176b485d..5fbe5f184 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Translation.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Translation.cpp @@ -30,7 +30,7 @@ FeaturesPlugin_Translation::FeaturesPlugin_Translation() void FeaturesPlugin_Translation::initAttributes() { data()->addAttribute(CREATION_METHOD(), ModelAPI_AttributeString::typeId()); - + AttributeSelectionListPtr aSelection = std::dynamic_pointer_cast(data()->addAttribute( FeaturesPlugin_Translation::OBJECTS_LIST_ID(), ModelAPI_AttributeSelectionList::typeId())); @@ -39,12 +39,12 @@ void FeaturesPlugin_Translation::initAttributes() ModelAPI_AttributeSelection::typeId()); data()->addAttribute(FeaturesPlugin_Translation::DISTANCE_ID(), ModelAPI_AttributeDouble::typeId()); - - data()->addAttribute(FeaturesPlugin_Translation::DX_ID(), + + data()->addAttribute(FeaturesPlugin_Translation::DX_ID(), ModelAPI_AttributeDouble::typeId()); - data()->addAttribute(FeaturesPlugin_Translation::DY_ID(), + data()->addAttribute(FeaturesPlugin_Translation::DY_ID(), ModelAPI_AttributeDouble::typeId()); - data()->addAttribute(FeaturesPlugin_Translation::DZ_ID(), + data()->addAttribute(FeaturesPlugin_Translation::DZ_ID(), ModelAPI_AttributeDouble::typeId()); } @@ -53,11 +53,11 @@ void FeaturesPlugin_Translation::execute() { AttributeStringPtr aMethodTypeAttr = string(FeaturesPlugin_Translation::CREATION_METHOD()); std::string aMethodType = aMethodTypeAttr->value(); - + if (aMethodType == CREATION_METHOD_BY_DISTANCE()) { performTranslationByAxisAndDistance(); } - + if (aMethodType == CREATION_METHOD_BY_DIMENSIONS()) { performTranslationByDimensions(); } @@ -83,14 +83,14 @@ void FeaturesPlugin_Translation::performTranslationByAxisAndDistance() anObjects.push_back(anObject); aContextes.push_back(anObjectAttr->context()); } - + //Getting axis. std::shared_ptr anAxis; std::shared_ptr anEdge; std::shared_ptr anObjRef = selection(FeaturesPlugin_Translation::AXIS_OBJECT_ID()); if(anObjRef && anObjRef->value() && anObjRef->value()->isEdge()) { anEdge = std::shared_ptr(new GeomAPI_Edge(anObjRef->value())); - } else if (anObjRef && !anObjRef->value() && anObjRef->context() && + } else if (anObjRef && !anObjRef->value() && anObjRef->context() && anObjRef->context()->shape() && anObjRef->context()->shape()->isEdge()) { anEdge = std::shared_ptr(new GeomAPI_Edge(anObjRef->context()->shape())); } @@ -100,7 +100,7 @@ void FeaturesPlugin_Translation::performTranslationByAxisAndDistance() // Getting distance. double aDistance = real(FeaturesPlugin_Translation::DISTANCE_ID())->value(); - + // Moving each object. int aResultIndex = 0; std::list::iterator aContext = aContextes.begin(); @@ -119,12 +119,12 @@ void FeaturesPlugin_Translation::performTranslationByAxisAndDistance() setResult(aResultPart, aResultIndex); } else { GeomAlgoAPI_Translation aTranslationAlgo(aBaseShape, anAxis, aDistance); - + if (!aTranslationAlgo.check()) { setError(aTranslationAlgo.getError()); return; } - + aTranslationAlgo.build(); // Checking that the algorithm worked properly. @@ -175,12 +175,12 @@ void FeaturesPlugin_Translation::performTranslationByDimensions() anObjects.push_back(anObject); aContextes.push_back(anObjectAttr->context()); } - + // Getting dimensions in X, in Y and in Z double aDX = real(FeaturesPlugin_Translation::DX_ID())->value(); double aDY = real(FeaturesPlugin_Translation::DY_ID())->value(); double aDZ = real(FeaturesPlugin_Translation::DZ_ID())->value(); - + // Moving each object. int aResultIndex = 0; std::list::iterator aContext = aContextes.begin(); @@ -199,12 +199,12 @@ void FeaturesPlugin_Translation::performTranslationByDimensions() setResult(aResultPart, aResultIndex); } else { GeomAlgoAPI_Translation aTranslationAlgo(aBaseShape, aDX, aDY, aDZ); - + if (!aTranslationAlgo.check()) { setError(aTranslationAlgo.getError()); return; } - + aTranslationAlgo.build(); // Checking that the algorithm worked properly. @@ -247,7 +247,7 @@ void FeaturesPlugin_Translation::loadNamingDS(GeomAlgoAPI_Translation& theTransl std::string aTranslatedName = "Translated"; std::shared_ptr aSubShapes = theTranslationAlgo.mapOfSubShapes(); - FeaturesPlugin_Tools::storeModifiedShapes(theTranslationAlgo, theResultBody, + FeaturesPlugin_Tools::storeModifiedShapes(theTranslationAlgo, theResultBody, theBaseShape, aTranslatedTag, aTranslatedName, *aSubShapes.get()); } diff --git a/src/FeaturesPlugin/FeaturesPlugin_Translation.h b/src/FeaturesPlugin/FeaturesPlugin_Translation.h index da144ab20..2e3cf314b 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Translation.h +++ b/src/FeaturesPlugin/FeaturesPlugin_Translation.h @@ -69,21 +69,21 @@ class FeaturesPlugin_Translation : public ModelAPI_Feature static const std::string MY_DISTANCE_ID("distance"); return MY_DISTANCE_ID; } - + /// Attribute name of dimension in X. inline static const std::string& DX_ID() { static const std::string MY_DX_ID("dx"); return MY_DX_ID; } - + /// Attribute name of dimension in Y. inline static const std::string& DY_ID() { static const std::string MY_DY_ID("dy"); return MY_DY_ID; } - + /// Attribute name of dimension in Z. inline static const std::string& DZ_ID() { @@ -110,10 +110,10 @@ class FeaturesPlugin_Translation : public ModelAPI_Feature private: ///Perform the translation using an axis and a distance. void performTranslationByAxisAndDistance(); - + ///Perform the translation using three dimensions X, Y and Z void performTranslationByDimensions(); - + void loadNamingDS(GeomAlgoAPI_Translation& theTranslationAlgo, std::shared_ptr theResultBody, std::shared_ptr theBaseShape); diff --git a/src/GeomAPI/GeomAPI_Trsf.h b/src/GeomAPI/GeomAPI_Trsf.h index 47bcb2b3e..630c36fdd 100644 --- a/src/GeomAPI/GeomAPI_Trsf.h +++ b/src/GeomAPI/GeomAPI_Trsf.h @@ -33,7 +33,7 @@ class GeomAPI_Trsf : public GeomAPI_Interface */ GEOMAPI_EXPORT void setTranslation(const std::shared_ptr theAxis, const double theDistance); - + /** \brief Sets a translation transformation using three coordinates. * \param[in] theDx x coordinate of the translation vector * \param[in] theDy y coordinate of the translation vector diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.cpp index dc94f7123..bd5f6015b 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.cpp @@ -59,7 +59,7 @@ namespace GeomAlgoAPI_ShapeAPI } return aBoxAlgo.shape(); } - + //========================================================================================================= std::shared_ptr GeomAlgoAPI_ShapeAPI::makeTranslation( std::shared_ptr theSourceShape, @@ -67,13 +67,13 @@ namespace GeomAlgoAPI_ShapeAPI const double theDistance) throw (GeomAlgoAPI_Exception) { GeomAlgoAPI_Translation aTranslationAlgo(theSourceShape, theAxis, theDistance); - + if (!aTranslationAlgo.check()) { throw GeomAlgoAPI_Exception(aTranslationAlgo.getError()); } - + aTranslationAlgo.build(); - + if(!aTranslationAlgo.isDone()) { throw GeomAlgoAPI_Exception(aTranslationAlgo.getError()); } @@ -82,7 +82,7 @@ namespace GeomAlgoAPI_ShapeAPI } return aTranslationAlgo.shape(); } - + //========================================================================================================= std::shared_ptr GeomAlgoAPI_ShapeAPI::makeTranslation( std::shared_ptr theSourceShape, @@ -91,13 +91,13 @@ namespace GeomAlgoAPI_ShapeAPI const double theDz) throw (GeomAlgoAPI_Exception) { GeomAlgoAPI_Translation aTranslationAlgo(theSourceShape, theDx, theDy, theDz); - + if (!aTranslationAlgo.check()) { throw GeomAlgoAPI_Exception(aTranslationAlgo.getError()); } - + aTranslationAlgo.build(); - + if(!aTranslationAlgo.isDone()) { throw GeomAlgoAPI_Exception(aTranslationAlgo.getError()); } diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.h b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.h index d84249c61..f5769a35e 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.h @@ -37,7 +37,7 @@ public: /// \return a shape static std::shared_ptr makeBox(std::shared_ptr theFirstPoint, std::shared_ptr theSecondPoint) throw (GeomAlgoAPI_Exception); - + /// Performs a translation from an axis and a distance. /// \param theSourceShape Shape to be moved. /// \param theAxis Movement axis. @@ -47,7 +47,7 @@ public: std::shared_ptr theSourceShape, std::shared_ptr theAxis, const double theDistance) throw (GeomAlgoAPI_Exception); - + /// Performs a translation from dimensions. /// \param theSourceShape Shape to be moved. /// \param theDx Movement dimension on X. diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Translation.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Translation.cpp index c9bfeacf9..148bfacf8 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Translation.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Translation.cpp @@ -53,8 +53,8 @@ bool GeomAlgoAPI_Translation::check() return true; } case BY_DIM: { - if ((fabs(myDx) < Precision::Confusion()) && - (fabs(myDy) < Precision::Confusion()) && + if ((fabs(myDx) < Precision::Confusion()) && + (fabs(myDy) < Precision::Confusion()) && (fabs(myDz) < Precision::Confusion())) { myError = "Translation builder :: Dx, Dy and Dz are null."; return false; @@ -76,7 +76,7 @@ bool GeomAlgoAPI_Translation::check() void GeomAlgoAPI_Translation::build() { gp_Trsf* aTrsf = new gp_Trsf(); - + switch (myMethodType) { case BY_DISTANCE: { const gp_Ax1& anAxis = myAxis->impl(); @@ -99,7 +99,7 @@ void GeomAlgoAPI_Translation::build() myError = "Translation builder :: source shape does not contain any actual shape."; return; } - + // Transform the shape while copying it. BRepBuilderAPI_Transform* aBuilder = new BRepBuilderAPI_Transform(aSourceShape, *aTrsf, true); if(!aBuilder) { diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Translation.h b/src/GeomAlgoAPI/GeomAlgoAPI_Translation.h index fe6f0a7d6..91fc03c8f 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Translation.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Translation.h @@ -27,7 +27,7 @@ public: BY_DIM, ///< Translation by dimensions in X, Y and Z BY_POINTS ///< Translation by two points }; - + /// \brief Creates an object which is obtained from current object by moving it along the axis. /// \param[in] theSourceShape a shape to be moved. /// \param[in] theAxis movement axis. @@ -35,8 +35,8 @@ public: GEOMALGOAPI_EXPORT GeomAlgoAPI_Translation(std::shared_ptr theSourceShape, std::shared_ptr theAxis, double theDistance); - - /// \brief Creates an object which is obtained from current object by moving it along a vector + + /// \brief Creates an object which is obtained from current object by moving it along a vector /// defined by its dimensions in X, Y and Z. /// \param[in] theSourceShape the shape to be moved. /// \param[in] theDX the movement dimension in X. @@ -46,10 +46,10 @@ public: double theDx, double theDy, double theDz); - + /// Checks if data for the translation execution is OK. GEOMALGOAPI_EXPORT bool check(); - + /// Execute the translation. GEOMALGOAPI_EXPORT void build(); diff --git a/src/PrimitivesAPI/PrimitivesAPI_Box.cpp b/src/PrimitivesAPI/PrimitivesAPI_Box.cpp index 3e3fb54c0..03fd6b9d3 100644 --- a/src/PrimitivesAPI/PrimitivesAPI_Box.cpp +++ b/src/PrimitivesAPI/PrimitivesAPI_Box.cpp @@ -76,19 +76,17 @@ void PrimitivesAPI_Box::dump(ModelHighAPI_Dumper& theDumper) const theDumper << aBase << " = model.addBox(" << aDocName; std::string aCreationMethod = aBase->string(PrimitivesPlugin_Box::CREATION_METHOD())->value(); - + if(aCreationMethod == PrimitivesPlugin_Box::CREATION_METHOD_BY_DIMENSIONS()) { AttributeDoublePtr anAttrDx = aBase->real(PrimitivesPlugin_Box::DX_ID()); AttributeDoublePtr anAttrDy = aBase->real(PrimitivesPlugin_Box::DY_ID()); AttributeDoublePtr anAttrDz = aBase->real(PrimitivesPlugin_Box::DZ_ID()); - theDumper << ", " << anAttrDx << ", " << anAttrDy << ", " << anAttrDz; } else if (aCreationMethod == PrimitivesPlugin_Box::CREATION_METHOD_BY_TWO_POINTS()) { AttributeSelectionPtr anAttrFirstPnt = aBase->selection(PrimitivesPlugin_Box::POINT_FIRST_ID()); AttributeSelectionPtr anAttrSecondPnt = aBase->selection(PrimitivesPlugin_Box::POINT_SECOND_ID()); - theDumper << ", " << anAttrFirstPnt << ", " << anAttrSecondPnt; } -- 2.39.2