Salome HOME
Fix errors and adjust unit tests
[modules/shaper.git] / src / SketchAPI / SketchAPI_Mirror.cpp
1 // Name   : SketchAPI_Mirror.cpp
2 // Purpose: 
3 //
4 // History:
5 // 16/06/16 - Sergey POKHODENKO - Creation of the file
6
7 //--------------------------------------------------------------------------------------
8 #include "SketchAPI_Mirror.h"
9 //--------------------------------------------------------------------------------------
10 #include <ModelHighAPI_Dumper.h>
11 #include <ModelHighAPI_Selection.h>
12 #include <ModelHighAPI_Tools.h>
13 //--------------------------------------------------------------------------------------
14 SketchAPI_Mirror::SketchAPI_Mirror(
15     const std::shared_ptr<ModelAPI_Feature> & theFeature)
16 : ModelHighAPI_Interface(theFeature)
17 {
18   initialize();
19 }
20
21 SketchAPI_Mirror::SketchAPI_Mirror(
22     const std::shared_ptr<ModelAPI_Feature> & theFeature,
23     const ModelHighAPI_RefAttr & theMirrorLine,
24     const std::list<std::shared_ptr<ModelAPI_Object> > & theObjects)
25 : ModelHighAPI_Interface(theFeature)
26 {
27   if (initialize()) {
28     fillAttribute(theMirrorLine, mirrorLine());
29     fillAttribute(theObjects, mirrorList());
30
31     execute();
32   }
33 }
34
35 SketchAPI_Mirror::~SketchAPI_Mirror()
36 {
37
38 }
39
40 //--------------------------------------------------------------------------------------
41
42 void SketchAPI_Mirror::dump(ModelHighAPI_Dumper& theDumper) const
43 {
44   FeaturePtr aBase = feature();
45   const std::string& aSketchName = theDumper.parentName(aBase);
46
47   AttributeRefAttrPtr aMirrorLine = mirrorLine();
48   AttributeRefListPtr aMirrorObjects = mirrorList();
49   theDumper << aBase << " = " << aSketchName << ".addMirror(" << aMirrorLine << ", "
50             << aMirrorObjects << ")" << std::endl;
51 }