From 5f21fe20f508109e5508116174256d6d0494293b Mon Sep 17 00:00:00 2001 From: vsr Date: Mon, 14 Sep 2009 13:21:39 +0000 Subject: [PATCH] Issue 0020474: Symbols multi-defined in SMESHimpl.dll --- src/Controls/SMESH_Controls.cxx | 41 +++++++++++++++++++++++------- src/Controls/SMESH_ControlsDef.hxx | 24 ++++++++++++----- 2 files changed, 49 insertions(+), 16 deletions(-) diff --git a/src/Controls/SMESH_Controls.cxx b/src/Controls/SMESH_Controls.cxx index 2ae7f399b..7a6e5428c 100644 --- a/src/Controls/SMESH_Controls.cxx +++ b/src/Controls/SMESH_Controls.cxx @@ -3254,31 +3254,54 @@ void ElementsOnShape::process (const SMDS_MeshElement* theElemPtr) TSequenceOfXYZ::TSequenceOfXYZ() {} -TSequenceOfXYZ::TSequenceOfXYZ(size_type n) : std::vector(n) +TSequenceOfXYZ::TSequenceOfXYZ(size_type n) : myArray(n) {} -TSequenceOfXYZ::TSequenceOfXYZ(size_type n, const value_type& t) : std::vector(n,t) +TSequenceOfXYZ::TSequenceOfXYZ(size_type n, const gp_XYZ& t) : myArray(n,t) {} -TSequenceOfXYZ::TSequenceOfXYZ(const TSequenceOfXYZ& theSequenceOfXYZ) : std::vector(theSequenceOfXYZ) +TSequenceOfXYZ::TSequenceOfXYZ(const TSequenceOfXYZ& theSequenceOfXYZ) : myArray(theSequenceOfXYZ.myArray) {} template -TSequenceOfXYZ::TSequenceOfXYZ(InputIterator theBegin, InputIterator theEnd): std::vector(theBegin,theEnd) +TSequenceOfXYZ::TSequenceOfXYZ(InputIterator theBegin, InputIterator theEnd): myArray(theBegin,theEnd) +{} + +TSequenceOfXYZ::~TSequenceOfXYZ() {} TSequenceOfXYZ& TSequenceOfXYZ::operator=(const TSequenceOfXYZ& theSequenceOfXYZ) { - std::vector::operator=(theSequenceOfXYZ); + myArray = theSequenceOfXYZ.myArray; return *this; } -std::vector::reference TSequenceOfXYZ::operator()(size_type n) +gp_XYZ& TSequenceOfXYZ::operator()(size_type n) +{ + return myArray[n-1]; +} + +const gp_XYZ& TSequenceOfXYZ::operator()(size_type n) const +{ + return myArray[n-1]; +} + +void TSequenceOfXYZ::clear() +{ + myArray.clear(); +} + +void TSequenceOfXYZ::reserve(size_type n) +{ + myArray.reserve(n); +} + +void TSequenceOfXYZ::push_back(const gp_XYZ& v) { - return std::vector::operator[](n-1); + myArray.push_back(v); } -std::vector::const_reference TSequenceOfXYZ::operator()(size_type n) const +TSequenceOfXYZ::size_type TSequenceOfXYZ::size() const { - return std::vector::operator[](n-1); + return myArray.size(); } diff --git a/src/Controls/SMESH_ControlsDef.hxx b/src/Controls/SMESH_ControlsDef.hxx index 38a507c84..bd63cc522 100644 --- a/src/Controls/SMESH_ControlsDef.hxx +++ b/src/Controls/SMESH_ControlsDef.hxx @@ -68,30 +68,40 @@ class gp_Pnt; namespace SMESH{ namespace Controls{ - class SMESHCONTROLS_EXPORT TSequenceOfXYZ: public std::vector + class SMESHCONTROLS_EXPORT TSequenceOfXYZ { + typedef std::vector::size_type size_type; + public: TSequenceOfXYZ(); TSequenceOfXYZ(size_type n); - TSequenceOfXYZ(size_type n, const value_type& t); + TSequenceOfXYZ(size_type n, const gp_XYZ& t); TSequenceOfXYZ(const TSequenceOfXYZ& theSequenceOfXYZ); template TSequenceOfXYZ(InputIterator theBegin, InputIterator theEnd); + ~TSequenceOfXYZ(); + TSequenceOfXYZ& operator=(const TSequenceOfXYZ& theSequenceOfXYZ); - reference operator()(size_type n); + gp_XYZ& operator()(size_type n); - const_reference operator()(size_type n) const; + const gp_XYZ& operator()(size_type n) const; - private: - reference operator[](size_type n); + void clear(); + + void reserve(size_type n); - const_reference operator[](size_type n) const; + void push_back(const gp_XYZ& v); + + size_type size() const; + + private: + std::vector myArray; }; /* -- 2.39.2