Salome HOME
961fa92f7d262ebdb0d0e5065f1c4951196b1719
[modules/shaper.git] / src / SketchAPI / SketchAPI_Mirror.h
1 // Copyright (C) 2014-2021  CEA/DEN, EDF R&D
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 SRC_SKETCHAPI_SKETCHAPI_MIRROR_H_
21 #define SRC_SKETCHAPI_SKETCHAPI_MIRROR_H_
22
23 //--------------------------------------------------------------------------------------
24 #include "SketchAPI.h"
25 #include "SketchAPI_SketchEntity.h"
26
27 #include <list>
28
29 #include <SketchPlugin_ConstraintMirror.h>
30
31 #include <ModelHighAPI_Interface.h>
32 #include <ModelHighAPI_Macro.h>
33 //--------------------------------------------------------------------------------------
34 class ModelAPI_Object;
35 class ModelHighAPI_RefAttr;
36 //--------------------------------------------------------------------------------------
37 /**\class SketchAPI_Mirror
38  * \ingroup CPPHighAPI
39  * \brief Interface for Mirror feature
40  */
41 class SketchAPI_Mirror : public ModelHighAPI_Interface
42 {
43 public:
44   /// Constructor without values
45   SKETCHAPI_EXPORT
46   explicit SketchAPI_Mirror(const std::shared_ptr<ModelAPI_Feature> & theFeature);
47   /// Constructor with values
48   SKETCHAPI_EXPORT
49   SketchAPI_Mirror(const std::shared_ptr<ModelAPI_Feature> & theFeature,
50                    const ModelHighAPI_RefAttr & theMirrorLine,
51                    const std::list<std::shared_ptr<ModelAPI_Object> > & theObjects);
52   /// Destructor
53   SKETCHAPI_EXPORT
54   virtual ~SketchAPI_Mirror();
55
56   INTERFACE_4(SketchPlugin_ConstraintMirror::ID(),
57               mirrorLine, SketchPlugin_ConstraintMirror::ENTITY_A(),
58               ModelAPI_AttributeRefAttr, /** Mirror line */,
59               mirrorList, SketchPlugin_ConstraintMirror::MIRROR_LIST_ID(),
60               ModelAPI_AttributeRefList, /** Mirror list */,
61               referenceObjects, SketchPlugin_ConstraintMirror::ENTITY_B(),
62               ModelAPI_AttributeRefList, /** Reference objects */,
63               mirroredObjects, SketchPlugin_ConstraintMirror::ENTITY_C(),
64               ModelAPI_AttributeRefList, /** Mirrored objects */
65   )
66
67   /// Set list of original objects
68   SKETCHAPI_EXPORT
69   void setMirrorList(const std::list<std::shared_ptr<ModelAPI_Object> >& theObjects);
70
71   /// List of mirrored objects
72   SKETCHAPI_EXPORT
73   std::list<std::shared_ptr<SketchAPI_SketchEntity> > mirrored() const;
74
75   /// Dump wrapped feature
76   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
77 };
78
79 //! Pointer on Mirror object
80 typedef std::shared_ptr<SketchAPI_Mirror> MirrorPtr;
81
82 //--------------------------------------------------------------------------------------
83 //--------------------------------------------------------------------------------------
84 #endif /* SRC_SKETCHAPI_SKETCHAPI_MIRROR_H_ */