From: vro Date: Thu, 11 Feb 2021 11:49:44 +0000 (+0300) Subject: 0025936: Modeling Data - reusable data structure for 2D tesselation (3- and 4-nodal... X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2FCR25936_4;p=occt-copy.git 0025936: Modeling Data - reusable data structure for 2D tesselation (3- and 4-nodal mesh) // Implementation of Poly_PolygonOnTriangulation::Node() was skipped --- diff --git a/src/Poly/Poly_PolygonOnTriangulation.cxx b/src/Poly/Poly_PolygonOnTriangulation.cxx index c7832eedbd..c087894555 100644 --- a/src/Poly/Poly_PolygonOnTriangulation.cxx +++ b/src/Poly/Poly_PolygonOnTriangulation.cxx @@ -79,6 +79,18 @@ Handle(Poly_PolygonOnTriangulation) Poly_PolygonOnTriangulation::Copy() const return aCopy; } +//======================================================================= +//function : Node +//purpose : +//======================================================================= + +Standard_Integer Poly_PolygonOnTriangulation::Node (const Standard_Integer theIndex) const +{ + Standard_OutOfRange_Raise_if ((theIndex < 1 || theIndex > myNodes.Length()), + "Poly_PolygonOnTriangulation::Node : index out of range"); + return myNodes.Value (theIndex); +} + //======================================================================= //function : SetNode //purpose : diff --git a/src/Poly/Poly_PolygonOnTriangulation.hxx b/src/Poly/Poly_PolygonOnTriangulation.hxx index a4764e078d..8b2c1d2384 100644 --- a/src/Poly/Poly_PolygonOnTriangulation.hxx +++ b/src/Poly/Poly_PolygonOnTriangulation.hxx @@ -86,11 +86,11 @@ public: //! Return node at the given index. //! Raises exception if theIndex is less than NodesLowerIndex or bigger than NodesUpperIndex. - Standard_EXPORT Standard_Integer Node(const Standard_Integer theIndex) const; + Standard_EXPORT Standard_Integer Node (const Standard_Integer theIndex) const; //! Sets node at the given index. //! Raises exception if theIndex is less than NodesLowerIndex or bigger than NodesUpperIndex. - Standard_EXPORT void SetNode(const Standard_Integer theIndex, const Standard_Integer theNode); + Standard_EXPORT void SetNode (const Standard_Integer theIndex, const Standard_Integer theNode); //! Returns true if parameters are associated with the nodes in this polygon. Standard_Boolean HasParameters() const { return !myParameters.IsNull(); } @@ -104,12 +104,12 @@ public: //! Return parameter at the given index. //! Raises Standard_NullObject exception if parameters has not been initialized. //! Raises Standard_OutOfRange exception if theIndex is less than ParametersLowerIndex or bigger than ParametersUpperIndex. - Standard_EXPORT Standard_Real Parameter(const Standard_Integer theIndex) const; + Standard_EXPORT Standard_Real Parameter (const Standard_Integer theIndex) const; //! Sets parameter at the given index. //! Raises Standard_NullObject exception if parameters has not been initialized. //! Raises Standard_OutOfRange exception if theIndex is less than ParametersLowerIndex or bigger than ParametersUpperIndex. - Standard_EXPORT void SetParameter(const Standard_Integer theIndex, const Standard_Real theValue); + Standard_EXPORT void SetParameter (const Standard_Integer theIndex, const Standard_Real theValue); //! Sets the table of the parameters associated with each node in this polygon.