1 // Name : SketchAPI_Rotation.cpp
5 // 16/06/16 - Sergey POKHODENKO - Creation of the file
7 //--------------------------------------------------------------------------------------
8 #include "SketchAPI_Rotation.h"
9 //--------------------------------------------------------------------------------------
10 #include <ModelHighAPI_Dumper.h>
11 #include <ModelHighAPI_Tools.h>
12 //--------------------------------------------------------------------------------------
13 SketchAPI_Rotation::SketchAPI_Rotation(
14 const std::shared_ptr<ModelAPI_Feature> & theFeature)
15 : ModelHighAPI_Interface(theFeature)
20 SketchAPI_Rotation::SketchAPI_Rotation(
21 const std::shared_ptr<ModelAPI_Feature> & theFeature,
22 const std::list<std::shared_ptr<ModelAPI_Object> > & theObjects,
23 const ModelHighAPI_RefAttr & theCenter,
24 const ModelHighAPI_Double & theAngle,
25 const ModelHighAPI_Integer & theNumberOfObjects,
27 : ModelHighAPI_Interface(theFeature)
30 fillAttribute(theObjects, rotationList());
31 fillAttribute(theCenter, center());
32 fillAttribute(theAngle, angle());
33 fillAttribute(theNumberOfObjects, numberOfObjects());
34 fillAttribute(theFullValue ? "FullAngle" : "SingleAngle", valueType());
40 SketchAPI_Rotation::~SketchAPI_Rotation()
45 //--------------------------------------------------------------------------------------
47 void SketchAPI_Rotation::dump(ModelHighAPI_Dumper& theDumper) const
49 FeaturePtr aBase = feature();
50 const std::string& aSketchName = theDumper.parentName(aBase);
52 AttributeRefListPtr aRotObjects = rotationList();
53 AttributeRefAttrPtr aCenter = center();
54 AttributeDoublePtr anAngle = angle();
55 AttributeIntegerPtr aNbCopies = numberOfObjects();
56 bool isFullValue = valueType()->value() != "SingleAngle";
58 theDumper << aBase << " = " << aSketchName << ".addRotation("
59 << aRotObjects << ", " << aCenter << ", " << anAngle << ", " << aNbCopies;
61 theDumper << ", " << isFullValue;
62 theDumper << ")" << std::endl;