// std::list -> []
%template(InterfaceList) std::list<std::shared_ptr<ModelHighAPI_Interface> >;
+%template(EntityList) std::list<std::shared_ptr<SketchAPI_SketchEntity> >;
%typecheck(SWIG_TYPECHECK_POINTER) std::shared_ptr<ModelAPI_Feature>, const std::shared_ptr<ModelAPI_Feature> & {
std::shared_ptr<ModelAPI_Feature> * temp_feature;
}
-std::list<std::shared_ptr<ModelHighAPI_Interface> > SketchAPI_Mirror::mirrored() const
+std::list<std::shared_ptr<SketchAPI_SketchEntity> > SketchAPI_Mirror::mirrored() const
{
std::list<ObjectPtr> aList = mirroredObjects()->list();
std::list<FeaturePtr> anIntermediate;
// Dump variables for a list of mirrored features
theDumper << "[";
- std::list<std::shared_ptr<ModelHighAPI_Interface> > aList = mirrored();
- std::list<std::shared_ptr<ModelHighAPI_Interface> >::const_iterator anIt = aList.begin();
+ std::list<std::shared_ptr<SketchAPI_SketchEntity> > aList = mirrored();
+ std::list<std::shared_ptr<SketchAPI_SketchEntity> >::const_iterator anIt = aList.begin();
for (; anIt != aList.end(); ++anIt) {
if (anIt != aList.begin())
theDumper << ", ";
theDumper << theDumper.name((*anIt)->feature(), false);
}
theDumper << "] = " << theDumper.name(aBase) << ".mirrored()" << std::endl;
+
+ // Set necessary "auxiliary" flag for mirrored features
+ // (flag is set if it differs to base entity)
+ std::list<ObjectPtr> aMirList = aMirrorObjects->list();
+ std::list<ObjectPtr>::const_iterator aMIt = aMirList.begin();
+ for (anIt = aList.begin(); aMIt != aMirList.end(); ++aMIt, ++anIt) {
+ FeaturePtr aFeature = ModelAPI_Feature::feature(*aMIt);
+ if (!aFeature)
+ continue;
+ bool aBaseAux = aFeature->boolean(SketchPlugin_SketchEntity::AUXILIARY_ID())->value();
+
+ aFeature = (*anIt)->feature();
+ bool aFeatAux = aFeature->boolean(SketchPlugin_SketchEntity::AUXILIARY_ID())->value();
+ if (aFeatAux != aBaseAux)
+ theDumper << theDumper.name((*anIt)->feature(), false)
+ << ".setAuxiliary(" << aFeatAux << ")" <<std::endl;
+ }
}
//--------------------------------------------------------------------------------------
#include "SketchAPI.h"
+#include "SketchAPI_SketchEntity.h"
#include <list>
/// List of mirrored objects
SKETCHAPI_EXPORT
- std::list<std::shared_ptr<ModelHighAPI_Interface> > mirrored() const;
+ std::list<std::shared_ptr<SketchAPI_SketchEntity> > mirrored() const;
/// Dump wrapped feature
virtual void dump(ModelHighAPI_Dumper& theDumper) const;
}
-std::list<std::shared_ptr<ModelHighAPI_Interface> > SketchAPI_Rotation::rotated() const
+std::list<std::shared_ptr<SketchAPI_SketchEntity> > SketchAPI_Rotation::rotated() const
{
std::list<ObjectPtr> aList = rotatedObjects()->list();
// remove all initial features
// Dump variables for a list of rotated features
theDumper << "[";
- std::list<std::shared_ptr<ModelHighAPI_Interface> > aList = rotated();
- std::list<std::shared_ptr<ModelHighAPI_Interface> >::const_iterator anIt = aList.begin();
+ std::list<std::shared_ptr<SketchAPI_SketchEntity> > aList = rotated();
+ std::list<std::shared_ptr<SketchAPI_SketchEntity> >::const_iterator anIt = aList.begin();
for (; anIt != aList.end(); ++anIt) {
if (anIt != aList.begin())
theDumper << ", ";
theDumper << theDumper.name((*anIt)->feature(), false);
}
theDumper << "] = " << theDumper.name(aBase) << ".rotated()" << std::endl;
+
+ // Set necessary "auxiliary" flag for rotated features
+ // (flag is set if it differs to base entity)
+ std::list<ObjectPtr> aRotList = aRotObjects->list();
+ std::list<ObjectPtr>::const_iterator aRIt = aRotList.begin();
+ anIt = aList.begin();
+ for (; aRIt != aRotList.end(); ++aRIt) {
+ FeaturePtr aFeature = ModelAPI_Feature::feature(*aRIt);
+ if (!aFeature)
+ continue;
+ bool aBaseAux = aFeature->boolean(SketchPlugin_SketchEntity::AUXILIARY_ID())->value();
+
+ for (int i = 1; i < aNbCopies->value(); ++i, ++anIt) {
+ aFeature = (*anIt)->feature();
+ bool aFeatAux = aFeature->boolean(SketchPlugin_SketchEntity::AUXILIARY_ID())->value();
+ if (aFeatAux != aBaseAux)
+ theDumper << theDumper.name((*anIt)->feature(), false)
+ << ".setAuxiliary(" << aFeatAux << ")" <<std::endl;
+ }
+ }
}
//--------------------------------------------------------------------------------------
#include "SketchAPI.h"
+#include "SketchAPI_SketchEntity.h"
#include <list>
/// List of rotated objects
SKETCHAPI_EXPORT
- std::list<std::shared_ptr<ModelHighAPI_Interface> > rotated() const;
+ std::list<std::shared_ptr<SketchAPI_SketchEntity> > rotated() const;
/// Dump wrapped feature
virtual void dump(ModelHighAPI_Dumper& theDumper) const;
compositeFeature()->addFeature(SketchPlugin_ConstraintAngle::ID());
fillAttribute(SketcherPrs_Tools::ANGLE_DIRECT,
aFeature->integer(SketchPlugin_ConstraintAngle::TYPE_ID()));
+ // fill the value before llines to avoid calculation of angle value by the Angle feature
+ fillAttribute(theValue, aFeature->real(SketchPlugin_Constraint::VALUE()));
fillAttribute(theLine1, aFeature->refattr(SketchPlugin_Constraint::ENTITY_A()));
fillAttribute(theLine2, aFeature->refattr(SketchPlugin_Constraint::ENTITY_B()));
- fillAttribute(theValue, aFeature->real(SketchPlugin_Constraint::VALUE()));
aFeature->execute();
return InterfacePtr(new ModelHighAPI_Interface(aFeature));
}
return isCopy.get() && isCopy->value();
}
-std::list<std::shared_ptr<ModelHighAPI_Interface> >
+std::list<std::shared_ptr<SketchAPI_SketchEntity> >
SketchAPI_SketchEntity::wrap(const std::list<std::shared_ptr<ModelAPI_Feature> >& theFeatures)
{
- std::list<std::shared_ptr<ModelHighAPI_Interface> > aResult;
+ std::list<std::shared_ptr<SketchAPI_SketchEntity> > aResult;
std::list<std::shared_ptr<ModelAPI_Feature> >::const_iterator anIt = theFeatures.begin();
for (; anIt != theFeatures.end(); ++anIt) {
if ((*anIt)->getKind() == SketchPlugin_Line::ID())
- aResult.push_back(std::shared_ptr<ModelHighAPI_Interface>(new SketchAPI_Line(*anIt)));
+ aResult.push_back(std::shared_ptr<SketchAPI_SketchEntity>(new SketchAPI_Line(*anIt)));
else if ((*anIt)->getKind() == SketchPlugin_Arc::ID())
- aResult.push_back(std::shared_ptr<ModelHighAPI_Interface>(new SketchAPI_Arc(*anIt)));
+ aResult.push_back(std::shared_ptr<SketchAPI_SketchEntity>(new SketchAPI_Arc(*anIt)));
else if ((*anIt)->getKind() == SketchPlugin_Circle::ID())
- aResult.push_back(std::shared_ptr<ModelHighAPI_Interface>(new SketchAPI_Circle(*anIt)));
+ aResult.push_back(std::shared_ptr<SketchAPI_SketchEntity>(new SketchAPI_Circle(*anIt)));
else if ((*anIt)->getKind() == SketchPlugin_Point::ID())
- aResult.push_back(std::shared_ptr<ModelHighAPI_Interface>(new SketchAPI_Point(*anIt)));
+ aResult.push_back(std::shared_ptr<SketchAPI_SketchEntity>(new SketchAPI_Point(*anIt)));
else if ((*anIt)->getKind() == SketchPlugin_IntersectionPoint::ID())
- aResult.push_back(std::shared_ptr<ModelHighAPI_Interface>(
+ aResult.push_back(std::shared_ptr<SketchAPI_SketchEntity>(
new SketchAPI_IntersectionPoint(*anIt)));
}
return aResult;
/// Convert list of features to list of appropriate wrappers
SKETCHAPI_EXPORT
- static std::list<std::shared_ptr<ModelHighAPI_Interface> >
+ static std::list<std::shared_ptr<SketchAPI_SketchEntity> >
wrap(const std::list<std::shared_ptr<ModelAPI_Feature> >& theFeatures);
protected:
}
-std::list<std::shared_ptr<ModelHighAPI_Interface> > SketchAPI_Translation::translated() const
+std::list<std::shared_ptr<SketchAPI_SketchEntity> > SketchAPI_Translation::translated() const
{
std::list<ObjectPtr> aList = translatedObjects()->list();
// remove all initial features
// Dump variables for a list of translated features
theDumper << "[";
- std::list<std::shared_ptr<ModelHighAPI_Interface> > aList = translated();
- std::list<std::shared_ptr<ModelHighAPI_Interface> >::const_iterator anIt = aList.begin();
+ std::list<std::shared_ptr<SketchAPI_SketchEntity> > aList = translated();
+ std::list<std::shared_ptr<SketchAPI_SketchEntity> >::const_iterator anIt = aList.begin();
for (; anIt != aList.end(); ++anIt) {
if (anIt != aList.begin())
theDumper << ", ";
theDumper << theDumper.name((*anIt)->feature(), false);
}
theDumper << "] = " << theDumper.name(aBase) << ".translated()" << std::endl;
+
+ // Set necessary "auxiliary" flag for translated features
+ // (flag is set if it differs to base entity)
+ std::list<ObjectPtr> aTransList = aTransObjects->list();
+ std::list<ObjectPtr>::const_iterator aTrIt = aTransList.begin();
+ anIt = aList.begin();
+ for (; aTrIt != aTransList.end(); ++aTrIt) {
+ FeaturePtr aFeature = ModelAPI_Feature::feature(*aTrIt);
+ if (!aFeature)
+ continue;
+ bool aBaseAux = aFeature->boolean(SketchPlugin_SketchEntity::AUXILIARY_ID())->value();
+
+ for (int i = 1; i < aNbCopies->value(); ++i, ++anIt) {
+ aFeature = (*anIt)->feature();
+ bool aFeatAux = aFeature->boolean(SketchPlugin_SketchEntity::AUXILIARY_ID())->value();
+ if (aFeatAux != aBaseAux)
+ theDumper << theDumper.name((*anIt)->feature(), false)
+ << ".setAuxiliary(" << aFeatAux << ")" <<std::endl;
+ }
+ }
}
//--------------------------------------------------------------------------------------
#include "SketchAPI.h"
+#include "SketchAPI_SketchEntity.h"
#include <list>
/// List of translated objects
SKETCHAPI_EXPORT
- std::list<std::shared_ptr<ModelHighAPI_Interface> > translated() const;
+ std::list<std::shared_ptr<SketchAPI_SketchEntity> > translated() const;
/// Dump wrapped feature
virtual void dump(ModelHighAPI_Dumper& theDumper) const;