// Author: Artem ZHIDKOV
#include "SketchSolver_Builder.h"
+#include <SketchPlugin_ConstraintAngle.h>
+#include <SketchSolver_ConstraintAngle.h>
#include <SketchSolver_ConstraintCoincidence.h>
#include <SketchSolver_ConstraintDistance.h>
#include <SketchSolver_ConstraintEqual.h>
#include <SketchSolver_ConstraintMirror.h>
#include <SketchSolver_ConstraintRigid.h>
#include <SketchSolver_ConstraintTangent.h>
+#include <SketchSolver_ConstraintMultiRotation.h>
#include <SketchSolver_ConstraintMultiTranslation.h>
+#include <SketchSolver_ConstraintMovement.h>
+#include <SketchSolver_ConstraintParametric.h>
#include <SketchSolver_Error.h>
#include <GeomAPI_Edge.h>
#include <SketchPlugin_ConstraintRigid.h>
#include <SketchPlugin_ConstraintTangent.h>
#include <SketchPlugin_ConstraintVertical.h>
+#include <SketchPlugin_MultiRotation.h>
#include <SketchPlugin_MultiTranslation.h>
#include <math.h>
return SolverConstraintPtr(new SketchSolver_ConstraintRigid(theConstraint));
} else if (theConstraint->getKind() == SketchPlugin_MultiTranslation::ID()) {
return SolverConstraintPtr(new SketchSolver_ConstraintMultiTranslation(theConstraint));
+ } else if (theConstraint->getKind() == SketchPlugin_MultiRotation::ID()) {
+ return SolverConstraintPtr(new SketchSolver_ConstraintMultiRotation(theConstraint));
+ } else if (theConstraint->getKind() == SketchPlugin_ConstraintAngle::ID()) {
+ return SolverConstraintPtr(new SketchSolver_ConstraintAngle(theConstraint));
}
return aResult;
}
return SolverConstraintPtr(new SketchSolver_ConstraintRigid(theFixedFeature));
}
+SolverConstraintPtr SketchSolver_Builder::createMovementConstraint(FeaturePtr theFixedFeature)
+{
+ DataPtr aData = theFixedFeature->data();
+ if (!aData || !aData->isValid())
+ return SolverConstraintPtr();
+ return SolverConstraintPtr(new SketchSolver_ConstraintMovement(theFixedFeature));
+}
+
+SolverConstraintPtr SketchSolver_Builder::createParametricConstraint(AttributePtr theAttribute)
+{
+ return SolverConstraintPtr(new SketchSolver_ConstraintParametric(theAttribute));
+}
+
bool SketchSolver_Builder::createWorkplane(
{
std::shared_ptr<GeomDataAPI_Dir> aNorm = std::dynamic_pointer_cast<GeomDataAPI_Dir>(theNormal);
std::shared_ptr<GeomDataAPI_Dir> aDirX = std::dynamic_pointer_cast<GeomDataAPI_Dir>(theDirX);
- if (!aDirX || (fabs(aDirX->x()) + fabs(aDirX->y()) + fabs(aDirX->z()) < tolerance))
+ if (!aDirX || (fabs(aDirX->x()) + fabs(aDirX->y()) + fabs(aDirX->z()) < tolerance) ||
+ !aNorm->isInitialized())
return false;
// calculate Y direction
std::shared_ptr<GeomAPI_Dir> aDirY(new GeomAPI_Dir(aNorm->dir()->cross(aDirX->dir())));