From 87474d56199326bace66da349e9dc2c44e02d3a7 Mon Sep 17 00:00:00 2001 From: vsv Date: Mon, 7 Nov 2016 16:59:53 +0300 Subject: [PATCH] Issue #1834: Fix length of lines --- src/GeomAPI/GeomAPI_Angle.h | 3 ++- src/GeomAPI/GeomAPI_Angle2d.h | 3 ++- src/GeomAPI/GeomAPI_Ax1.cpp | 6 ++++-- src/GeomAPI/GeomAPI_Circ.cpp | 3 ++- src/GeomAPI/GeomAPI_Circ2d.cpp | 3 ++- .../GeomAPI_DataMapOfShapeMapOfShapes.h | 3 ++- src/GeomAPI/GeomAPI_DataMapOfShapeShape.cpp | 17 +++++++++++------ src/GeomAPI/GeomAPI_DataMapOfShapeShape.h | 3 ++- src/GeomAPI/GeomAPI_Dir.cpp | 3 ++- src/GeomAPI/GeomAPI_Dir.h | 6 ++++-- src/GeomAPI/GeomAPI_ICustomPrs.h | 3 ++- src/GeomAPI/GeomAPI_Lin.cpp | 6 ++++-- src/GeomAPI/GeomAPI_Lin.h | 6 ++++-- src/GeomAPI/GeomAPI_Lin2d.cpp | 3 ++- src/GeomAPI/GeomAPI_Lin2d.h | 3 ++- src/GeomAPI/GeomAPI_Pln.cpp | 18 ++++++++++++------ src/GeomAPI/GeomAPI_Shape.cpp | 9 ++++++--- src/GeomAPI/GeomAPI_ShapeExplorer.h | 6 ++++-- src/GeomAPI/GeomAPI_ShapeIterator.h | 3 ++- src/GeomData/GeomData_Point.cpp | 3 ++- src/GeomData/GeomData_Point.h | 6 ++++-- src/GeomData/GeomData_Point2D.cpp | 3 ++- src/GeomDataAPI/GeomDataAPI_Point.h | 9 ++++++--- src/GeomDataAPI/GeomDataAPI_Point2D.h | 3 ++- .../GeomValidators_BodyShapes.cpp | 3 ++- .../GeomValidators_BooleanArguments.cpp | 3 ++- .../GeomValidators_BooleanArguments.h | 3 ++- .../GeomValidators_Different.cpp | 6 ++++-- src/GeomValidators/GeomValidators_Different.h | 3 ++- src/GeomValidators/GeomValidators_Finite.cpp | 9 ++++++--- .../GeomValidators_IntersectionSelection.cpp | 3 ++- .../GeomValidators_MinObjectsSelected.cpp | 8 +++++--- .../GeomValidators_MinObjectsSelected.h | 3 ++- .../GeomValidators_PartitionArguments.cpp | 6 ++++-- .../GeomValidators_PartitionArguments.h | 3 ++- src/GeomValidators/GeomValidators_Plugin.cpp | 18 ++++++++++++------ .../GeomValidators_ShapeType.cpp | 16 ++++++++++------ src/GeomValidators/GeomValidators_Tools.cpp | 9 ++++++--- .../GeomValidators_ZeroOffset.cpp | 12 ++++++++---- src/GeomValidators/GeomValidators_ZeroOffset.h | 3 ++- .../InitializationPlugin_Plugin.cpp | 9 ++++++--- 41 files changed, 164 insertions(+), 84 deletions(-) diff --git a/src/GeomAPI/GeomAPI_Angle.h b/src/GeomAPI/GeomAPI_Angle.h index f926ba912..8d8743351 100644 --- a/src/GeomAPI/GeomAPI_Angle.h +++ b/src/GeomAPI/GeomAPI_Angle.h @@ -47,7 +47,8 @@ public: GEOMAPI_EXPORT double angleRadian(); /// Returns \c true if the line is reversed during angle calculation. - /// If theIndex = 0, the result corresponds to the first line, if theIndex = 1, the to the second line + /// If theIndex = 0, the result corresponds to the first line, + /// if theIndex = 1, the to the second line GEOMAPI_EXPORT bool isReversed(int theIndex); }; diff --git a/src/GeomAPI/GeomAPI_Angle2d.h b/src/GeomAPI/GeomAPI_Angle2d.h index eb6985624..f7000e0a9 100644 --- a/src/GeomAPI/GeomAPI_Angle2d.h +++ b/src/GeomAPI/GeomAPI_Angle2d.h @@ -47,7 +47,8 @@ public: GEOMAPI_EXPORT double angleRadian(); /// Returns \c true if the line is reversed during angle calculation. - /// If theIndex = 0, the result corresponds to the first line, if theIndex = 1, the to the second line + /// If theIndex = 0, the result corresponds to the first line, + /// if theIndex = 1, the to the second line GEOMAPI_EXPORT bool isReversed(int theIndex); }; diff --git a/src/GeomAPI/GeomAPI_Ax1.cpp b/src/GeomAPI/GeomAPI_Ax1.cpp index 65bc65bb4..8068a3d2c 100644 --- a/src/GeomAPI/GeomAPI_Ax1.cpp +++ b/src/GeomAPI/GeomAPI_Ax1.cpp @@ -60,7 +60,9 @@ void GeomAPI_Ax1::reverse() std::shared_ptr GeomAPI_Ax1::reversed() { gp_Ax1 anAxis = MY_AX1->Reversed(); - std::shared_ptr aPnt(new GeomAPI_Pnt(anAxis.Location().X(), anAxis.Location().Y(), anAxis.Location().Z())); - std::shared_ptr aDir(new GeomAPI_Dir(anAxis.Direction().X(), anAxis.Direction().Y(), anAxis.Direction().Z())); + std::shared_ptr aPnt( + new GeomAPI_Pnt(anAxis.Location().X(), anAxis.Location().Y(), anAxis.Location().Z())); + std::shared_ptr aDir( + new GeomAPI_Dir(anAxis.Direction().X(), anAxis.Direction().Y(), anAxis.Direction().Z())); return std::shared_ptr(new GeomAPI_Ax1(aPnt, aDir)); } diff --git a/src/GeomAPI/GeomAPI_Circ.cpp b/src/GeomAPI/GeomAPI_Circ.cpp index 4346391bd..8988870ca 100644 --- a/src/GeomAPI/GeomAPI_Circ.cpp +++ b/src/GeomAPI/GeomAPI_Circ.cpp @@ -90,7 +90,8 @@ const bool GeomAPI_Circ::parameter(const std::shared_ptr thePoint, double& theParameter) const { Handle(Geom_Circle) aCurve = new Geom_Circle(*MY_CIRC); - return GeomLib_Tool::Parameter(aCurve, thePoint->impl(), theTolerance, theParameter) == Standard_True; + return GeomLib_Tool::Parameter(aCurve, thePoint->impl(), + theTolerance, theParameter) == Standard_True; } //================================================================================================= diff --git a/src/GeomAPI/GeomAPI_Circ2d.cpp b/src/GeomAPI/GeomAPI_Circ2d.cpp index cbb16dd4b..5edbab178 100644 --- a/src/GeomAPI/GeomAPI_Circ2d.cpp +++ b/src/GeomAPI/GeomAPI_Circ2d.cpp @@ -157,7 +157,8 @@ const bool GeomAPI_Circ2d::parameter(const std::shared_ptr thePoi double& theParameter) const { Handle(Geom2d_Circle) aCurve = new Geom2d_Circle(*MY_CIRC2D); - return GeomLib_Tool::Parameter(aCurve, thePoint->impl(), theTolerance, theParameter) == Standard_True; + return GeomLib_Tool::Parameter(aCurve, thePoint->impl(), + theTolerance, theParameter) == Standard_True; } //================================================================================================= diff --git a/src/GeomAPI/GeomAPI_DataMapOfShapeMapOfShapes.h b/src/GeomAPI/GeomAPI_DataMapOfShapeMapOfShapes.h index 1d2c55911..a2c020c27 100644 --- a/src/GeomAPI/GeomAPI_DataMapOfShapeMapOfShapes.h +++ b/src/GeomAPI/GeomAPI_DataMapOfShapeMapOfShapes.h @@ -22,7 +22,8 @@ public: /// \brief Binds list of shapes to the key shape. /// \param[in] theKey key shape. - /// \param[in] theItems list of shapes. If shapes have duplications in list only one will be stored. + /// \param[in] theItems list of shapes. + /// If shapes have duplications in list only one will be stored. /// \returns true if items bound successfully. GEOMAPI_EXPORT bool bind(const std::shared_ptr theKey, const ListOfShape& theItems); diff --git a/src/GeomAPI/GeomAPI_DataMapOfShapeShape.cpp b/src/GeomAPI/GeomAPI_DataMapOfShapeShape.cpp index a21ac5f04..a5b88c522 100644 --- a/src/GeomAPI/GeomAPI_DataMapOfShapeShape.cpp +++ b/src/GeomAPI/GeomAPI_DataMapOfShapeShape.cpp @@ -25,11 +25,13 @@ int GeomAPI_DataMapOfShapeShape::size() return implPtr()->Extent(); } -bool GeomAPI_DataMapOfShapeShape::bind (std::shared_ptr theKey, std::shared_ptr theItem) +bool GeomAPI_DataMapOfShapeShape::bind(std::shared_ptr theKey, + std::shared_ptr theItem) { bool flag(false); - if(implPtr()->Bind(theKey->impl(), theItem->impl())) - flag = true; + if (implPtr()->Bind(theKey->impl(), + theItem->impl())) + flag = true; return flag; } @@ -42,7 +44,8 @@ void GeomAPI_DataMapOfShapeShape::merge(const GeomAPI_DataMapOfShapeShape& theDa } } -void GeomAPI_DataMapOfShapeShape::merge(const std::shared_ptr theDataMap) +void GeomAPI_DataMapOfShapeShape:: + merge(const std::shared_ptr theDataMap) { if(theDataMap.get()) { merge(*theDataMap.get()); @@ -57,10 +60,12 @@ bool GeomAPI_DataMapOfShapeShape::isBound (std::shared_ptr theKey return flag; } -const std::shared_ptr GeomAPI_DataMapOfShapeShape::find(std::shared_ptr theKey) +const std::shared_ptr + GeomAPI_DataMapOfShapeShape::find(std::shared_ptr theKey) { std::shared_ptr aShape(new GeomAPI_Shape()); - aShape->setImpl(new TopoDS_Shape(impl().Find(theKey->impl()))); + aShape->setImpl( + new TopoDS_Shape(impl().Find(theKey->impl()))); return aShape; } diff --git a/src/GeomAPI/GeomAPI_DataMapOfShapeShape.h b/src/GeomAPI/GeomAPI_DataMapOfShapeShape.h index 2e11b8574..a507f6ed2 100644 --- a/src/GeomAPI/GeomAPI_DataMapOfShapeShape.h +++ b/src/GeomAPI/GeomAPI_DataMapOfShapeShape.h @@ -33,7 +33,8 @@ class GeomAPI_DataMapOfShapeShape : public GeomAPI_Interface /// Adds \a theKey to me with \a theItem. Returns True if the Key was not already in the map. GEOMAPI_EXPORT - bool bind (const std::shared_ptr theKey, const std::shared_ptr theItem); + bool bind (const std::shared_ptr theKey, + const std::shared_ptr theItem); /// Merges two maps. GEOMAPI_EXPORT void merge(const GeomAPI_DataMapOfShapeShape& theDataMap); diff --git a/src/GeomAPI/GeomAPI_Dir.cpp b/src/GeomAPI/GeomAPI_Dir.cpp index d9963d46c..52cab10c0 100644 --- a/src/GeomAPI/GeomAPI_Dir.cpp +++ b/src/GeomAPI/GeomAPI_Dir.cpp @@ -63,7 +63,8 @@ double GeomAPI_Dir::angle(const std::shared_ptr& theArg) const return MY_DIR->Angle(theArg->impl()); } -bool GeomAPI_Dir::isParallel(const std::shared_ptr theDir, const double theTolerance) const +bool GeomAPI_Dir::isParallel(const std::shared_ptr theDir, + const double theTolerance) const { return MY_DIR->IsParallel(theDir->impl(), theTolerance) == Standard_True; } diff --git a/src/GeomAPI/GeomAPI_Dir.h b/src/GeomAPI/GeomAPI_Dir.h index 9b9d4f354..6a84d1c40 100644 --- a/src/GeomAPI/GeomAPI_Dir.h +++ b/src/GeomAPI/GeomAPI_Dir.h @@ -55,9 +55,11 @@ class GeomAPI_Dir : public GeomAPI_Interface GEOMAPI_EXPORT double angle(const std::shared_ptr& theArg) const; - /// \return true if the angle between this unit vector and theDir unit vector is equal to 0 or to Pi. + /// \return true if the angle between this unit vector and + /// theDir unit vector is equal to 0 or to Pi. GEOMAPI_EXPORT - bool isParallel(const std::shared_ptr theDir, const double theTolerance = 1.e-7) const; + bool isParallel(const std::shared_ptr theDir, + const double theTolerance = 1.e-7) const; }; diff --git a/src/GeomAPI/GeomAPI_ICustomPrs.h b/src/GeomAPI/GeomAPI_ICustomPrs.h index 2c2520ba9..1129c1014 100644 --- a/src/GeomAPI/GeomAPI_ICustomPrs.h +++ b/src/GeomAPI/GeomAPI_ICustomPrs.h @@ -26,7 +26,8 @@ public: GEOMAPI_EXPORT virtual ~GeomAPI_ICustomPrs(); /// Modifies the given presentation in the custom way. - virtual bool customisePresentation(std::shared_ptr theResult, AISObjectPtr thePrs, + virtual bool customisePresentation(std::shared_ptr theResult, + AISObjectPtr thePrs, std::shared_ptr theDefaultPrs) = 0; }; diff --git a/src/GeomAPI/GeomAPI_Lin.cpp b/src/GeomAPI/GeomAPI_Lin.cpp index 40e456e59..1c980e017 100644 --- a/src/GeomAPI/GeomAPI_Lin.cpp +++ b/src/GeomAPI/GeomAPI_Lin.cpp @@ -105,7 +105,8 @@ const std::shared_ptr GeomAPI_Lin::project( return std::shared_ptr(new GeomAPI_Pnt(aResult.X(), aResult.Y(), aResult.Z())); } -bool GeomAPI_Lin::contains(const std::shared_ptr thePoint, const double theLinearTolerance) const +bool GeomAPI_Lin::contains(const std::shared_ptr thePoint, + const double theLinearTolerance) const { if(!thePoint.get()) { return false; @@ -116,7 +117,8 @@ bool GeomAPI_Lin::contains(const std::shared_ptr thePoint, const do bool GeomAPI_Lin::isParallel(const std::shared_ptr theLin) const { - return MY_LIN->Direction().IsParallel(theLin->impl().Direction(), Precision::Confusion()) == Standard_True; + return MY_LIN->Direction().IsParallel(theLin->impl().Direction(), + Precision::Confusion()) == Standard_True; } bool GeomAPI_Lin::isCoplanar(const std::shared_ptr theLin) const diff --git a/src/GeomAPI/GeomAPI_Lin.h b/src/GeomAPI/GeomAPI_Lin.h index e9e35296a..520c87a91 100644 --- a/src/GeomAPI/GeomAPI_Lin.h +++ b/src/GeomAPI/GeomAPI_Lin.h @@ -54,10 +54,12 @@ class GeomAPI_Lin : public GeomAPI_Interface const std::shared_ptr project( const std::shared_ptr& thePoint) const; - /// \return true if this line contains thePoint, that is, if the distance between thePoint and this line + /// \return true if this line contains thePoint, that is, + /// if the distance between thePoint and this line /// is less than or equal to theLinearTolerance. GEOMAPI_EXPORT - bool contains(const std::shared_ptr thePoint, const double theLinearTolerance = 1.e-7) const; + bool contains(const std::shared_ptr thePoint, + const double theLinearTolerance = 1.e-7) const; /// \return true if lines are parallel. GEOMAPI_EXPORT diff --git a/src/GeomAPI/GeomAPI_Lin2d.cpp b/src/GeomAPI/GeomAPI_Lin2d.cpp index 2d97bd6c8..51849328d 100644 --- a/src/GeomAPI/GeomAPI_Lin2d.cpp +++ b/src/GeomAPI/GeomAPI_Lin2d.cpp @@ -103,5 +103,6 @@ std::shared_ptr GeomAPI_Lin2d::shiftedLocation(double theShift) c aVec.Reverse(); aVec.Scale(theShift); gp_Lin2d aLin = MY_LIN2D->Translated(aVec); - return std::shared_ptr(new GeomAPI_Pnt2d(aLin.Location().X(), aLin.Location().Y())); + return std::shared_ptr(new GeomAPI_Pnt2d(aLin.Location().X(), + aLin.Location().Y())); } diff --git a/src/GeomAPI/GeomAPI_Lin2d.h b/src/GeomAPI/GeomAPI_Lin2d.h index 7aef47937..91cc546b7 100644 --- a/src/GeomAPI/GeomAPI_Lin2d.h +++ b/src/GeomAPI/GeomAPI_Lin2d.h @@ -53,7 +53,8 @@ class GeomAPI_Lin2d : public GeomAPI_Interface GEOMAPI_EXPORT const std::shared_ptr project( const std::shared_ptr& thePoint) const; - /// Computes the cross product of the line direction and a vector from the line start point to the point + /// Computes the cross product of the line direction and a vector + /// from the line start point to the point GEOMAPI_EXPORT bool isRight(const std::shared_ptr& thePoint) const; diff --git a/src/GeomAPI/GeomAPI_Pln.cpp b/src/GeomAPI/GeomAPI_Pln.cpp index b562a0c41..41bf4e1c4 100644 --- a/src/GeomAPI/GeomAPI_Pln.cpp +++ b/src/GeomAPI/GeomAPI_Pln.cpp @@ -56,7 +56,8 @@ void GeomAPI_Pln::coefficients(double& theA, double& theB, double& theC, double& impl().Coefficients(theA, theB, theC, theD); } -bool GeomAPI_Pln::isCoincident(const std::shared_ptr thePlane, const double theTolerance) +bool GeomAPI_Pln::isCoincident(const std::shared_ptr thePlane, + const double theTolerance) { if(!thePlane.get()) { return false; @@ -64,7 +65,8 @@ bool GeomAPI_Pln::isCoincident(const std::shared_ptr thePlane, cons const gp_Pln& aMyPln = impl(); const gp_Pln& anOtherPln = thePlane->impl(); - return (aMyPln.Contains(anOtherPln.Location(), theTolerance) && aMyPln.Axis().IsParallel(anOtherPln.Axis(), theTolerance)); + return (aMyPln.Contains(anOtherPln.Location(), theTolerance) && + aMyPln.Axis().IsParallel(anOtherPln.Axis(), theTolerance)); } bool GeomAPI_Pln::isParallel(const std::shared_ptr theLine) @@ -79,7 +81,8 @@ bool GeomAPI_Pln::isParallel(const std::shared_ptr theLine) return Abs(aDot) < Precision::SquareConfusion(); } -std::shared_ptr GeomAPI_Pln::intersect(const std::shared_ptr& theLine) const +std::shared_ptr + GeomAPI_Pln::intersect(const std::shared_ptr& theLine) const { std::shared_ptr aLineDir = theLine->direction()->xyz(); std::shared_ptr aLineLoc = theLine->location()->xyz(); @@ -92,10 +95,12 @@ std::shared_ptr GeomAPI_Pln::intersect(const std::shared_ptr(); double aParam = aNormal->dot(aLocation->decreased(aLineLoc)) / aDot; - return std::shared_ptr(new GeomAPI_Pnt(aLineLoc->added(aLineDir->multiplied(aParam)))); + return std::shared_ptr( + new GeomAPI_Pnt(aLineLoc->added(aLineDir->multiplied(aParam)))); } -std::shared_ptr GeomAPI_Pln::project(const std::shared_ptr& thePoint) const +std::shared_ptr + GeomAPI_Pln::project(const std::shared_ptr& thePoint) const { std::shared_ptr aNormal = direction()->xyz(); std::shared_ptr aLocation = location()->xyz(); @@ -123,7 +128,8 @@ void GeomAPI_Pln::translate(const std::shared_ptr theDir, double th implPtr()->Translate(aVec); } -std::shared_ptr GeomAPI_Pln::intersect(const std::shared_ptr thePlane) const +std::shared_ptr + GeomAPI_Pln::intersect(const std::shared_ptr thePlane) const { std::shared_ptr aRes; diff --git a/src/GeomAPI/GeomAPI_Shape.cpp b/src/GeomAPI/GeomAPI_Shape.cpp index 5a520fb7c..31cb11086 100644 --- a/src/GeomAPI/GeomAPI_Shape.cpp +++ b/src/GeomAPI/GeomAPI_Shape.cpp @@ -117,7 +117,8 @@ bool GeomAPI_Shape::isConnectedTopology() const const TopoDS_Shape& aShape = const_cast(this)->impl(); if (aShape.IsNull() || aShape.ShapeType() != TopAbs_COMPOUND) return false; - NCollection_List aNotConnected; // list of simple elements that are not detected in connection to others + // list of simple elements that are not detected in connection to others + NCollection_List aNotConnected; addSimpleToList(aShape, aNotConnected); if (aNotConnected.IsEmpty()) // an empty compound return false; @@ -140,7 +141,8 @@ bool GeomAPI_Shape::isConnectedTopology() const bool aConnected = false; NCollection_List::Iterator aNewIter(aNewConnected); for(; !aConnected && aNewIter.More(); aNewIter.Next()) { - // checking topological connecion of aNotIter and aNewIter (if shapes are connected, vertices are connected for sure) + // checking topological connecion of aNotIter and aNewIter + // (if shapes are connected, vertices are connected for sure) TopExp_Explorer anExp2(aNewIter.Value(), TopAbs_VERTEX); for(; !aConnected && anExp2.More(); anExp2.Next()) { NCollection_List::Iterator aNotIter(aNotVertices); @@ -207,7 +209,8 @@ bool GeomAPI_Shape::isPlanar() const Handle(Standard_Type) aType = aSurface->DynamicType(); if(aType == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) { - Handle(Geom_RectangularTrimmedSurface) aTrimSurface = Handle(Geom_RectangularTrimmedSurface)::DownCast(aSurface); + Handle(Geom_RectangularTrimmedSurface) aTrimSurface = + Handle(Geom_RectangularTrimmedSurface)::DownCast(aSurface); aType = aTrimSurface->BasisSurface()->DynamicType(); } return (aType == STANDARD_TYPE(Geom_Plane)) == Standard_True; diff --git a/src/GeomAPI/GeomAPI_ShapeExplorer.h b/src/GeomAPI/GeomAPI_ShapeExplorer.h index 44320fa64..896a65b5a 100644 --- a/src/GeomAPI/GeomAPI_ShapeExplorer.h +++ b/src/GeomAPI/GeomAPI_ShapeExplorer.h @@ -49,11 +49,13 @@ public: GEOMAPI_EXPORT bool more() const; - /// Moves to the next Shape in the exploration or do nothing if there are no more shapes to explore. + /// Moves to the next Shape in the exploration or do nothing + /// if there are no more shapes to explore. GEOMAPI_EXPORT void next(); - /// \return the current shape in the exploration or empty pointer if this explorer has no more shapes to explore. + /// \return the current shape in the exploration or empty pointer + /// if this explorer has no more shapes to explore. GEOMAPI_EXPORT std::shared_ptr current(); diff --git a/src/GeomAPI/GeomAPI_ShapeIterator.h b/src/GeomAPI/GeomAPI_ShapeIterator.h index 098f1710e..25a40590d 100644 --- a/src/GeomAPI/GeomAPI_ShapeIterator.h +++ b/src/GeomAPI/GeomAPI_ShapeIterator.h @@ -12,7 +12,8 @@ /// \class GeomAPI_ShapeIterator /// \ingroup DataModel -/// \brief Iterates on the underlying shape underlying a given GeomAPI_Shape object, providing access +/// \brief Iterates on the underlying shape underlying a given GeomAPI_Shape object, +/// providing access /// to its component sub-shapes. Each component shape is returned as a GeomAPI_Shape with /// an orientation, and a compound of the original values and the relative values. class GeomAPI_ShapeIterator : public GeomAPI_Interface diff --git a/src/GeomData/GeomData_Point.cpp b/src/GeomData/GeomData_Point.cpp index 9ceced262..8f5923df1 100644 --- a/src/GeomData/GeomData_Point.cpp +++ b/src/GeomData/GeomData_Point.cpp @@ -125,7 +125,8 @@ std::string GeomData_Point::expressionError(int theComponent) return myExpression[theComponent]->error(); } -void GeomData_Point::setUsedParameters(int theComponent, const std::set& theUsedParameters) +void GeomData_Point::setUsedParameters(int theComponent, + const std::set& theUsedParameters) { assert(theComponent >= 0 && theComponent < NUM_COMPONENTS); myExpression[theComponent]->setUsedParameters(theUsedParameters); diff --git a/src/GeomData/GeomData_Point.h b/src/GeomData/GeomData_Point.h index 8936ffef8..e6dc4ba55 100644 --- a/src/GeomData/GeomData_Point.h +++ b/src/GeomData/GeomData_Point.h @@ -21,7 +21,8 @@ class ModelAPI_ExpressionDouble; class GeomData_Point : public GeomDataAPI_Point { enum { NUM_COMPONENTS = 3 }; - std::shared_ptr myExpression[NUM_COMPONENTS]; ///< Expressions for X, Y and Z + /// Expressions for X, Y and Z + std::shared_ptr myExpression[NUM_COMPONENTS]; public: /// Defines the double value GEOMDATA_EXPORT virtual void setValue(const double theX, const double theY, const double theZ); @@ -38,7 +39,8 @@ class GeomData_Point : public GeomDataAPI_Point GEOMDATA_EXPORT virtual std::shared_ptr pnt(); /// Defines the calculated double value - GEOMDATA_EXPORT virtual void setCalculatedValue(const double theX, const double theY, const double theZ); + GEOMDATA_EXPORT virtual + void setCalculatedValue(const double theX, const double theY, const double theZ); /// Defines the text values GEOMDATA_EXPORT virtual void setText(const std::string& theX, diff --git a/src/GeomData/GeomData_Point2D.cpp b/src/GeomData/GeomData_Point2D.cpp index 7c9cb73e3..6873674b0 100644 --- a/src/GeomData/GeomData_Point2D.cpp +++ b/src/GeomData/GeomData_Point2D.cpp @@ -114,7 +114,8 @@ std::string GeomData_Point2D::expressionError(int theComponent) return myExpression[theComponent]->error(); } -void GeomData_Point2D::setUsedParameters(int theComponent, const std::set& theUsedParameters) +void GeomData_Point2D::setUsedParameters(int theComponent, + const std::set& theUsedParameters) { assert(theComponent >= 0 && theComponent < NUM_COMPONENTS); myExpression[theComponent]->setUsedParameters(theUsedParameters); diff --git a/src/GeomDataAPI/GeomDataAPI_Point.h b/src/GeomDataAPI/GeomDataAPI_Point.h index ffa07285d..a68e0762b 100644 --- a/src/GeomDataAPI/GeomDataAPI_Point.h +++ b/src/GeomDataAPI/GeomDataAPI_Point.h @@ -23,7 +23,8 @@ class GeomDataAPI_Point : public ModelAPI_Attribute { public: /// Defines the double value - GEOMDATAAPI_EXPORT virtual void setValue(const double theX, const double theY, const double theZ) = 0; + GEOMDATAAPI_EXPORT virtual + void setValue(const double theX, const double theY, const double theZ) = 0; /// Defines the point GEOMDATAAPI_EXPORT virtual void setValue(const std::shared_ptr& thePoint) = 0; @@ -37,7 +38,8 @@ class GeomDataAPI_Point : public ModelAPI_Attribute GEOMDATAAPI_EXPORT virtual std::shared_ptr pnt() = 0; /// Defines the calculated double value - GEOMDATAAPI_EXPORT virtual void setCalculatedValue(const double theX, const double theY, const double theZ) = 0; + GEOMDATAAPI_EXPORT virtual + void setCalculatedValue(const double theX, const double theY, const double theZ) = 0; /// Defines the text values GEOMDATAAPI_EXPORT virtual void setText(const std::string& theX, @@ -64,7 +66,8 @@ class GeomDataAPI_Point : public ModelAPI_Attribute GEOMDATAAPI_EXPORT virtual bool expressionInvalid(int theComponent) = 0; /// Allows to set expression (text) error (by the parameters listener) - GEOMDATAAPI_EXPORT virtual void setExpressionError(int theComponent, const std::string& theError) = 0; + GEOMDATAAPI_EXPORT virtual + void setExpressionError(int theComponent, const std::string& theError) = 0; /// Returns an expression error GEOMDATAAPI_EXPORT virtual std::string expressionError(int theComponent) = 0; diff --git a/src/GeomDataAPI/GeomDataAPI_Point2D.h b/src/GeomDataAPI/GeomDataAPI_Point2D.h index 633ef8255..fa8a57158 100644 --- a/src/GeomDataAPI/GeomDataAPI_Point2D.h +++ b/src/GeomDataAPI/GeomDataAPI_Point2D.h @@ -59,7 +59,8 @@ class GeomDataAPI_Point2D : public ModelAPI_Attribute GEOMDATAAPI_EXPORT virtual bool expressionInvalid(int theComponent) = 0; /// Allows to set expression (text) error (by the parameters listener) - GEOMDATAAPI_EXPORT virtual void setExpressionError(int theComponent, const std::string& theError) = 0; + GEOMDATAAPI_EXPORT virtual + void setExpressionError(int theComponent, const std::string& theError) = 0; /// Returns an expression error GEOMDATAAPI_EXPORT virtual std::string expressionError(int theComponent) = 0; diff --git a/src/GeomValidators/GeomValidators_BodyShapes.cpp b/src/GeomValidators/GeomValidators_BodyShapes.cpp index 504daa4af..56068837a 100644 --- a/src/GeomValidators/GeomValidators_BodyShapes.cpp +++ b/src/GeomValidators/GeomValidators_BodyShapes.cpp @@ -26,7 +26,8 @@ bool GeomValidators_BodyShapes::isValid(const AttributePtr& theAttribute, return false; } - ResultConstructionPtr aResultConstruction = std::dynamic_pointer_cast(aContext); + ResultConstructionPtr aResultConstruction = + std::dynamic_pointer_cast(aContext); if(aResultConstruction.get()) { theError = "Error: Result construction selected."; return false; diff --git a/src/GeomValidators/GeomValidators_BooleanArguments.cpp b/src/GeomValidators/GeomValidators_BooleanArguments.cpp index 1db13e607..92a598c7b 100644 --- a/src/GeomValidators/GeomValidators_BooleanArguments.cpp +++ b/src/GeomValidators/GeomValidators_BooleanArguments.cpp @@ -54,7 +54,8 @@ bool GeomValidators_BooleanArguments::isValid(const std::shared_ptr& } // Search differences inside each attribute list - std::map >::const_iterator anAttributesMapIt = anAttributesMap.begin(); + std::map >::const_iterator + anAttributesMapIt = anAttributesMap.begin(); for (; anAttributesMapIt != anAttributesMap.end(); ++anAttributesMapIt) { const std::list& anAttributes = anAttributesMapIt->second; // for the list of attributes check that all elements are unique @@ -81,7 +82,8 @@ bool GeomValidators_Different::isValid(const std::shared_ptr& std::list::const_iterator aFindIt = std::find_if(aNextIt, anAttributes.end(), IsEqual(*anAttributeIt)); if (aFindIt != anAttributes.end()) { - theError = "Attributes " + (*anAttributeIt)->id() + " and " + (*aFindIt)->id() + " are equal." ; + theError = "Attributes " + (*anAttributeIt)->id() + " and " + + (*aFindIt)->id() + " are equal." ; return false; } ++anAttributeIt; diff --git a/src/GeomValidators/GeomValidators_Different.h b/src/GeomValidators/GeomValidators_Different.h index e5d7e15bf..61fbeb0d7 100644 --- a/src/GeomValidators/GeomValidators_Different.h +++ b/src/GeomValidators/GeomValidators_Different.h @@ -28,7 +28,8 @@ public: const std::list& theArguments, Events_InfoMessage& theError) const; - GEOMVALIDATORS_EXPORT virtual bool isNotObligatory(std::string theFeature, std::string theAttribute); + GEOMVALIDATORS_EXPORT virtual + bool isNotObligatory(std::string theFeature, std::string theAttribute); }; #endif diff --git a/src/GeomValidators/GeomValidators_Finite.cpp b/src/GeomValidators/GeomValidators_Finite.cpp index 67f8d70c9..c8f5d02ad 100755 --- a/src/GeomValidators/GeomValidators_Finite.cpp +++ b/src/GeomValidators/GeomValidators_Finite.cpp @@ -20,9 +20,11 @@ bool GeomValidators_Finite::isValid(const AttributePtr& theAttribute, const std::string anAttributeType = theAttribute->attributeType(); if(anAttributeType == ModelAPI_AttributeSelection::typeId()) { - AttributeSelectionPtr aSelectionAttr = std::dynamic_pointer_cast(theAttribute); + AttributeSelectionPtr aSelectionAttr = + std::dynamic_pointer_cast(theAttribute); ResultPtr aResult = aSelectionAttr->context(); - ResultConstructionPtr aConstruction = std::dynamic_pointer_cast(aResult); + ResultConstructionPtr aConstruction = + std::dynamic_pointer_cast(aResult); if (aConstruction.get() && aConstruction->isInfinite()) { aValid = false; theError = "Infinite result is selected."; @@ -34,7 +36,8 @@ bool GeomValidators_Finite::isValid(const AttributePtr& theAttribute, AttributeSelectionPtr aSelectAttr = aSelectionListAttr->value(i); ResultPtr aResult = aSelectAttr->context(); if (aResult.get() && aResult->groupName() == ModelAPI_ResultConstruction::group()) { - ResultConstructionPtr aConstruction = std::dynamic_pointer_cast(aResult); + ResultConstructionPtr aConstruction = + std::dynamic_pointer_cast(aResult); if (aConstruction.get() && aConstruction->isInfinite()) { aValid = false; theError = "Infinite result is selected."; diff --git a/src/GeomValidators/GeomValidators_IntersectionSelection.cpp b/src/GeomValidators/GeomValidators_IntersectionSelection.cpp index 039b0eda7..9e108be80 100644 --- a/src/GeomValidators/GeomValidators_IntersectionSelection.cpp +++ b/src/GeomValidators/GeomValidators_IntersectionSelection.cpp @@ -21,7 +21,8 @@ bool GeomValidators_IntersectionSelection::isValid(const AttributePtr& theAttrib return false; } FeaturePtr aFeature = std::dynamic_pointer_cast(theAttribute->owner()); - AttributeSelectionListPtr anAttrSelectionList = std::dynamic_pointer_cast(theAttribute); + AttributeSelectionListPtr anAttrSelectionList = + std::dynamic_pointer_cast(theAttribute); for(int anIndex = 0; anIndex < anAttrSelectionList->size(); ++anIndex) { AttributeSelectionPtr anAttrSelection = anAttrSelectionList->value(anIndex); if(!anAttrSelection.get()) { diff --git a/src/GeomValidators/GeomValidators_MinObjectsSelected.cpp b/src/GeomValidators/GeomValidators_MinObjectsSelected.cpp index 29167f8d0..31f8d0c3d 100644 --- a/src/GeomValidators/GeomValidators_MinObjectsSelected.cpp +++ b/src/GeomValidators/GeomValidators_MinObjectsSelected.cpp @@ -17,7 +17,8 @@ bool GeomValidators_MinObjectsSelected::isValid(const std::shared_ptrvalue(); } - if((anObjectsNb > 0 && aToolsNb > 0) || (isCombine && anObjectsNb != 0 && (anObjectsNb + aToolsNb > 1))) { + if((anObjectsNb > 0 && aToolsNb > 0) || + (isCombine && anObjectsNb != 0 && (anObjectsNb + aToolsNb > 1))) { return true; } @@ -52,7 +53,8 @@ bool GeomValidators_PartitionArguments::isValid(const std::shared_ptrvalidators(); aFactory->registerValidator("GeomValidators_BodyShapes", new GeomValidators_BodyShapes); - aFactory->registerValidator("GeomValidators_BooleanArguments", new GeomValidators_BooleanArguments); - aFactory->registerValidator("GeomValidators_ConstructionComposite", new GeomValidators_ConstructionComposite); + aFactory->registerValidator("GeomValidators_BooleanArguments", + new GeomValidators_BooleanArguments); + aFactory->registerValidator("GeomValidators_ConstructionComposite", + new GeomValidators_ConstructionComposite); aFactory->registerValidator("GeomValidators_Different", new GeomValidators_Different); - aFactory->registerValidator("GeomValidators_DifferentShapes", new GeomValidators_DifferentShapes); + aFactory->registerValidator("GeomValidators_DifferentShapes", + new GeomValidators_DifferentShapes); aFactory->registerValidator("GeomValidators_Face", new GeomValidators_Face); aFactory->registerValidator("GeomValidators_Finite", new GeomValidators_Finite); - aFactory->registerValidator("GeomValidators_PartitionArguments", new GeomValidators_PartitionArguments); + aFactory->registerValidator("GeomValidators_PartitionArguments", + new GeomValidators_PartitionArguments); aFactory->registerValidator("GeomValidators_ShapeType", new GeomValidators_ShapeType); aFactory->registerValidator("GeomValidators_ZeroOffset", new GeomValidators_ZeroOffset); - aFactory->registerValidator("GeomValidators_IntersectionSelection", new GeomValidators_IntersectionSelection); + aFactory->registerValidator("GeomValidators_IntersectionSelection", + new GeomValidators_IntersectionSelection); aFactory->registerValidator("GeomValidators_FeatureKind", new GeomValidators_FeatureKind); - aFactory->registerValidator("GeomValidators_MinObjectsSelected", new GeomValidators_MinObjectsSelected); + aFactory->registerValidator("GeomValidators_MinObjectsSelected", + new GeomValidators_MinObjectsSelected); // register this plugin ModelAPI_Session::get()->registerPlugin(this); diff --git a/src/GeomValidators/GeomValidators_ShapeType.cpp b/src/GeomValidators/GeomValidators_ShapeType.cpp index 4991b9225..022704317 100755 --- a/src/GeomValidators/GeomValidators_ShapeType.cpp +++ b/src/GeomValidators/GeomValidators_ShapeType.cpp @@ -22,7 +22,8 @@ typedef std::map EdgeTypes; static EdgeTypes MyShapeTypes; -GeomValidators_ShapeType::TypeOfShape GeomValidators_ShapeType::shapeType(const std::string& theType) +GeomValidators_ShapeType::TypeOfShape + GeomValidators_ShapeType::shapeType(const std::string& theType) { if (MyShapeTypes.size() == 0) { MyShapeTypes["empty"] = Empty; @@ -51,8 +52,8 @@ std::string getShapeTypeDescription(const GeomValidators_ShapeType::TypeOfShape& std::string aValue = ""; if (MyShapeTypes.size() != 0) { - std::map::const_iterator anIt = MyShapeTypes.begin(), - aLast = MyShapeTypes.end(); + std::map::const_iterator + anIt = MyShapeTypes.begin(), aLast = MyShapeTypes.end(); for (; anIt != aLast; anIt++) { if (anIt->second == theType) aValue = anIt->first; @@ -90,7 +91,8 @@ bool GeomValidators_ShapeType::isValid(const AttributePtr& theAttribute, if (!aTypes.empty()) aTypes += ", "; } - theError = "It does not contain element with acceptable shape type. The type should be one of the next: %1"; + theError = "It does not contain element with acceptable shape type. \ + The type should be one of the next: %1"; theError.arg(aTypes); } @@ -105,7 +107,8 @@ bool GeomValidators_ShapeType::isValidAttribute(const AttributePtr& theAttribute std::string anAttributeType = theAttribute->attributeType(); if (anAttributeType == ModelAPI_AttributeSelection::typeId()) { - AttributeSelectionPtr anAttr = std::dynamic_pointer_cast(theAttribute); + AttributeSelectionPtr anAttr = + std::dynamic_pointer_cast(theAttribute); GeomShapePtr aShape = anAttr->value(); if (aShape.get()) aValid = isValidShape(aShape, theShapeType, theError); @@ -175,7 +178,8 @@ bool GeomValidators_ShapeType::isValidObject(const ObjectPtr& theObject, ResultPtr aResult = std::dynamic_pointer_cast(theObject); if( theShapeType==Plane ) { - ResultConstructionPtr aResultConstruction = std::dynamic_pointer_cast(theObject); + ResultConstructionPtr aResultConstruction = + std::dynamic_pointer_cast(theObject); FeaturePtr aFeature = ModelAPI_Feature::feature(theObject); const std::string& aKind = aFeature->getKind(); return aResult.get() != NULL && aKind == "Plane"; diff --git a/src/GeomValidators/GeomValidators_Tools.cpp b/src/GeomValidators/GeomValidators_Tools.cpp index ef49c197d..d9136fe2f 100644 --- a/src/GeomValidators/GeomValidators_Tools.cpp +++ b/src/GeomValidators/GeomValidators_Tools.cpp @@ -19,17 +19,20 @@ namespace GeomValidators_Tools { ObjectPtr anObject; std::string anAttrType = theAttribute->attributeType(); if (anAttrType == ModelAPI_AttributeRefAttr::typeId()) { - AttributeRefAttrPtr anAttr = std::dynamic_pointer_cast(theAttribute); + AttributeRefAttrPtr anAttr = + std::dynamic_pointer_cast(theAttribute); if (anAttr != NULL && anAttr->isObject()) anObject = anAttr->object(); } if (anAttrType == ModelAPI_AttributeSelection::typeId()) { - AttributeSelectionPtr anAttr = std::dynamic_pointer_cast(theAttribute); + AttributeSelectionPtr anAttr = + std::dynamic_pointer_cast(theAttribute); if (anAttr != NULL) anObject = anAttr->context(); } if (anAttrType == ModelAPI_AttributeReference::typeId()) { - AttributeReferencePtr anAttr = std::dynamic_pointer_cast(theAttribute); + AttributeReferencePtr anAttr = + std::dynamic_pointer_cast(theAttribute); if (anAttr.get() != NULL) anObject = anAttr->value(); } diff --git a/src/GeomValidators/GeomValidators_ZeroOffset.cpp b/src/GeomValidators/GeomValidators_ZeroOffset.cpp index e66cc4333..34aec623f 100644 --- a/src/GeomValidators/GeomValidators_ZeroOffset.cpp +++ b/src/GeomValidators/GeomValidators_ZeroOffset.cpp @@ -43,11 +43,13 @@ bool GeomValidators_ZeroOffset::isValid(const std::shared_ptr& ListOfShape aFacesList; if(theFeature->selection(*anIt)) { AttributeSelectionPtr aFaceSelection = theFeature->selection(*anIt); - ResultConstructionPtr aConstruction = std::dynamic_pointer_cast(aFaceSelection->context()); + ResultConstructionPtr aConstruction = + std::dynamic_pointer_cast(aFaceSelection->context()); if(aConstruction.get()) { int aSketchFacesNum = aConstruction->facesNum(); for(int aFaceIndex = 0; aFaceIndex < aSketchFacesNum; aFaceIndex++) { - std::shared_ptr aFace = std::dynamic_pointer_cast(aConstruction->face(aFaceIndex)); + std::shared_ptr aFace = + std::dynamic_pointer_cast(aConstruction->face(aFaceIndex)); if(aFace->isFace() && aFace->isPlanar()) { aFacesList.push_back(aFace); } @@ -68,7 +70,8 @@ bool GeomValidators_ZeroOffset::isValid(const std::shared_ptr& if(!aContextShape.get()) { break; } - ResultConstructionPtr aConstruction = std::dynamic_pointer_cast(aContext); + ResultConstructionPtr aConstruction = + std::dynamic_pointer_cast(aContext); if(!aConstruction.get()) { break; } @@ -175,7 +178,8 @@ bool GeomValidators_ZeroOffset::isValid(const std::shared_ptr& } std::shared_ptr aPln = aFace->getPlane(); if(aPln.get()) { - for(ListOfShape::const_iterator anIter = aFacesList.cbegin(); anIter != aFacesList.cend(); anIter++) { + for(ListOfShape::const_iterator + anIter = aFacesList.cbegin(); anIter != aFacesList.cend(); anIter++) { std::shared_ptr aSketchShape = *anIter; std::shared_ptr aSketchFace(new GeomAPI_Face(aSketchShape)); std::shared_ptr aSketchPln = aSketchFace->getPlane(); diff --git a/src/GeomValidators/GeomValidators_ZeroOffset.h b/src/GeomValidators/GeomValidators_ZeroOffset.h index 3d5c3b864..06348e145 100644 --- a/src/GeomValidators/GeomValidators_ZeroOffset.h +++ b/src/GeomValidators/GeomValidators_ZeroOffset.h @@ -29,7 +29,8 @@ public: Events_InfoMessage& theError) const; /// \return true if the attribute in feature is not obligatory for the feature execution. - GEOMVALIDATORS_EXPORT virtual bool isNotObligatory(std::string theFeature, std::string theAttribute); + GEOMVALIDATORS_EXPORT virtual + bool isNotObligatory(std::string theFeature, std::string theAttribute); }; #endif diff --git a/src/InitializationPlugin/InitializationPlugin_Plugin.cpp b/src/InitializationPlugin/InitializationPlugin_Plugin.cpp index 93b60ffd2..a82ff65e4 100644 --- a/src/InitializationPlugin/InitializationPlugin_Plugin.cpp +++ b/src/InitializationPlugin/InitializationPlugin_Plugin.cpp @@ -97,7 +97,8 @@ FeaturePtr InitializationPlugin_Plugin::createPlane(DocumentPtr theDoc, double t } else if (theZ) { aPlane->data()->setName("XOY"); } - aPlane->setInHistory(aPlane, false); // don't show automatically created feature in the features history + // don't show automatically created feature in the features history + aPlane->setInHistory(aPlane, false); // the plane should be executed in order to build the feature result immediatelly // the results are to be hidden in the plugin @@ -119,7 +120,8 @@ FeaturePtr InitializationPlugin_Plugin::createPoint(DocumentPtr theDoc, const st aPoint->real("y")->setValue(theY); aPoint->real("z")->setValue(theZ); aPoint->data()->setName(theName); - aPoint->setInHistory(aPoint, false); // don't show automatically created feature in the features history + // don't show automatically created feature in the features history + aPoint->setInHistory(aPoint, false); // the point should be executed in order to build the feature result immediatelly // the results are to be hidden in the plugin @@ -150,7 +152,8 @@ FeaturePtr InitializationPlugin_Plugin::createAxis(DocumentPtr theDoc, FeaturePt } else if (theZ != 0) { aAxis->data()->setName("OZ"); } - aAxis->setInHistory(aAxis, false); // don't show automatically created feature in the features history + // don't show automatically created feature in the features history + aAxis->setInHistory(aAxis, false); aAxis->execute(); aAxis->data()->execState(ModelAPI_StateDone); aAxis->firstResult()->data()->execState(ModelAPI_StateDone); -- 2.39.2