SHAPER  9.12.0
BuildPlugin_Face.h
1 // Copyright (C) 2014-2023 CEA, EDF
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 
20 #ifndef BuildPlugin_Face_H_
21 #define BuildPlugin_Face_H_
22 
23 #include "BuildPlugin.h"
24 #include "BuildPlugin_Shape.h"
25 
26 class GeomAPI_Dir;
27 class GeomAPI_Shape;
29 
34 {
35 public:
38 
40  inline static const std::string& ID()
41  {
42  static const std::string MY_ID("Face");
43  return MY_ID;
44  }
45 
47  inline static const std::string& BASE_OBJECTS_ID()
48  {
49  static const std::string MY_BASE_OBJECTS_ID("base_objects");
50  return MY_BASE_OBJECTS_ID;
51  }
52 
54  BUILDPLUGIN_EXPORT virtual const std::string& getKind()
55  {
56  static std::string MY_KIND = BuildPlugin_Face::ID();
57  return MY_KIND;
58  }
59 
61  BUILDPLUGIN_EXPORT virtual void initAttributes();
62 
64  BUILDPLUGIN_EXPORT virtual void execute();
65 
66 private:
68  void buildFacesByEdges(const std::list< std::shared_ptr<GeomAPI_Shape> >& theEdges,
69  const std::list< std::shared_ptr<GeomAPI_Dir> >& theNormals,
70  std::list< std::shared_ptr<GeomAPI_Shape> >& theFaces,
71  std::shared_ptr<GeomAlgoAPI_MakeShape>& theBuilderAlgo) const;
72 
73  void buildNonPlanarFacesByEdges(const ListOfShape& theShapes,
74  ListOfShape& theFaces,
75  std::shared_ptr<GeomAlgoAPI_MakeShape>& theBuilderAlgo) const;
76 };
77 
78 #endif
Feature for creation of face from sketch edges or existing wires.
Definition: BuildPlugin_Face.h:34
BuildPlugin_Face()
Use plugin manager for features creation.
Definition: BuildPlugin_Face.cpp:38
virtual void execute()
Creates a new part document if needed.
Definition: BuildPlugin_Face.cpp:49
static const std::string & ID()
Feature kind.
Definition: BuildPlugin_Face.h:40
virtual const std::string & getKind()
Definition: BuildPlugin_Face.h:54
virtual void initAttributes()
Request for initialization of data model of the feature: adding all attributes.
Definition: BuildPlugin_Face.cpp:43
static const std::string & BASE_OBJECTS_ID()
Attribute name of base objects.
Definition: BuildPlugin_Face.h:47
Base class containing common methods for shape creating operations.
Definition: BuildPlugin_Shape.h:35
3D direction defined by three normalized coordinates
Definition: GeomAPI_Dir.h:34
Interface to the topological shape object.
Definition: GeomAPI_Shape.h:43
Interface to the root class of all topological shapes constructions.
Definition: GeomAlgoAPI_MakeShape.h:35