Salome HOME
Merge branch 'Pre_2.8.0_development'
[modules/shaper.git] / src / SketchAPI / SketchAPI_Rectangle.cpp
index 3da59f0ff8a220b4b3c1fc5cc7260b93bd4c78fa..135285e6a0b3cc78b71deb244eaaf721ee27156c 100644 (file)
@@ -1,10 +1,23 @@
-// Name   : SketchAPI_Rectangle.cpp
-// Purpose: 
+// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or
+// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
 //
-// History:
-// 17/06/16 - Sergey POKHODENKO - Creation of the file
 
-//--------------------------------------------------------------------------------------
 #include "SketchAPI_Rectangle.h"
 //--------------------------------------------------------------------------------------
 #include <GeomAPI_Pnt2d.h>
@@ -66,3 +79,12 @@ void SketchAPI_Rectangle::setByPoints(
 
 //--------------------------------------------------------------------------------------
 
+std::list<std::shared_ptr<SketchAPI_SketchEntity> > SketchAPI_Rectangle::lines() const
+{
+  std::list<FeaturePtr> aFeatures;
+  std::list<ObjectPtr> aList = linesList()->list();
+  std::list<ObjectPtr>::const_iterator anIt = aList.begin();
+  for (; anIt != aList.end(); ++anIt)
+    aFeatures.push_back(ModelAPI_Feature::feature(*anIt));
+  return SketchAPI_SketchEntity::wrap(aFeatures);
+}