X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAlgoAPI%2FGeomAlgoAPI_SketchBuilder.h;h=35b8924b5f54b077c143a2f20d8b5595fbe31939;hb=88ee9b2b81cf93a6324336b57e30cc8a3a487499;hp=22eafe77ef05252485c8b63d52b0f5d6c8f68cbd;hpb=8dc74f82810d5f597b78633b457efb0ef4f89f9f;p=modules%2Fshaper.git diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_SketchBuilder.h b/src/GeomAlgoAPI/GeomAlgoAPI_SketchBuilder.h index 22eafe77e..35b8924b5 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_SketchBuilder.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_SketchBuilder.h @@ -1,52 +1,79 @@ -// File: GeomAlgoAPI_SketchBuilder.h -// Created: 02 Jun 2014 -// Author: Artem ZHIDKOV +// Copyright (C) 2014-2022 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 +// #ifndef GeomAlgoAPI_SketchBuilder_H_ #define GeomAlgoAPI_SketchBuilder_H_ #include +#include -#include +#include #include -#include -#include -#include +class GeomAPI_Dir; +class GeomAPI_Pln; +class GeomAPI_Pnt; +class GeomAPI_Shape; /** \class GeomAlgoAPI_SketchBuilder * \ingroup DataAlgo * \brief Creates planar faces based on the list of Sketch features */ -class GEOMALGOAPI_EXPORT GeomAlgoAPI_SketchBuilder +class GeomAlgoAPI_SketchBuilder : public GeomAlgoAPI_MakeShape { - public: +public: + /** \brief Creates list of faces based on the edges of the sketch + * \param[in] thePlane plane of the sketch + * \param[in] theEdges initial edges of the sketch + * + * The algorithm searches all loops of edges surrounding lesser areas. + */ + GEOMALGOAPI_EXPORT + GeomAlgoAPI_SketchBuilder(const std::shared_ptr& thePlane, + const std::list >& theEdges); + /** \brief Creates list of faces and unclosed wires on basis of the features of the sketch * \param[in] theOrigin origin point of the sketch * \param[in] theDirX x-direction of the sketch - * \param[in] theDirY y-direction of the sketch * \param[in] theNorm normal of the sketch - * \param[in] theFeatures initial features of the sketch - * \param[out] theResultFaces faces based on closed wires - * \param[out] theResultWires unclosed wires of the sketch + * \param[in] theWire a wire which contains all edges * - * The algorithm searches all loops of edges surrounding lesser squares. - * It finds the vertex with minimal coordinates along X axis (theDirX) and then - * goes through the edges passing the surrounding area on the left. - */ - static void createFaces(const boost::shared_ptr& theOrigin, - const boost::shared_ptr& theDirX, - const boost::shared_ptr& theDirY, - const boost::shared_ptr& theNorm, - const std::list >& theFeatures, - std::list >& theResultFaces, - std::list >& theResultWires); - - /** \brief Searches intersections between the faces in the list - * and make holes in the faces to avoid intersections - * \param[in,out] theFaces list of faces to proccess + * The algorithm searches all loops of edges surrounding lesser areas. */ - static void fixIntersections(std::list >& theFaces); + GEOMALGOAPI_EXPORT + GeomAlgoAPI_SketchBuilder(const std::shared_ptr& theOrigin, + const std::shared_ptr& theDirX, + const std::shared_ptr& theNorm, + const std::shared_ptr& theWire); + + /// Return list of created faces + GEOMALGOAPI_EXPORT const std::list >& faces() const + { return myResultFaces; } + +private: + void build(const std::shared_ptr& theOrigin, + const std::shared_ptr& theDirX, + const std::shared_ptr& theNorm, + const std::list >& theEdges); + +private: + std::list > myResultFaces; }; #endif