1 // Name : SketchAPI_SketchEntity.cpp
5 // 07/06/16 - Sergey POKHODENKO - Creation of the file
7 //--------------------------------------------------------------------------------------
8 #include "SketchAPI_SketchEntity.h"
9 //--------------------------------------------------------------------------------------
10 #include <ModelHighAPI_Dumper.h>
11 #include <ModelHighAPI_Tools.h>
12 //--------------------------------------------------------------------------------------
13 SketchAPI_SketchEntity::SketchAPI_SketchEntity(
14 const std::shared_ptr<ModelAPI_Feature> & theFeature)
15 : ModelHighAPI_Interface(theFeature)
20 SketchAPI_SketchEntity::~SketchAPI_SketchEntity()
25 //--------------------------------------------------------------------------------------
26 bool SketchAPI_SketchEntity::initialize()
28 SET_ATTRIBUTE(Auxiliary, ModelAPI_AttributeBoolean, SketchPlugin_SketchEntity::AUXILIARY_ID())
33 //--------------------------------------------------------------------------------------
34 std::shared_ptr<ModelAPI_AttributeBoolean> SketchAPI_SketchEntity::auxiliary() const
39 void SketchAPI_SketchEntity::setAuxiliary(bool theAuxiliary)
41 fillAttribute(theAuxiliary, myAuxiliary);
46 //--------------------------------------------------------------------------------------
47 void SketchAPI_SketchEntity::dump(ModelHighAPI_Dumper& theDumper) const
49 FeaturePtr aBase = feature();
50 AttributeBooleanPtr anAux = aBase->boolean(SketchPlugin_SketchEntity::AUXILIARY_ID());
52 const std::string& aName = theDumper.name(aBase);
53 theDumper << aName << ".setAuxiliary(" << anAux << ")" <<std::endl;
57 bool SketchAPI_SketchEntity::isCopy() const
59 // check the feature is a copy of another entity
60 AttributeBooleanPtr isCopy = feature()->boolean(SketchPlugin_SketchEntity::COPY_ID());
61 return isCopy.get() && isCopy->value();