-// Copyright (C) 2014-2019 CEA/DEN, EDF R&D
+// Copyright (C) 2014-2021 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
#include <SketchSolver_ConstraintMovement.h>
#include <SketchPlugin_Constraint.h>
+class GeomAPI_BSpline2d;
class GeomAPI_Circ2d;
class GeomAPI_Ellipse2d;
class GeomAPI_Lin2d;
class GeomAPI_Pnt2d;
+class ModelAPI_AttributeDoubleArray;
+class ModelAPI_AttributeIntArray;
+
/** \namespace PlaneGCSSolver_Tools
* \ingroup Plugins
* \brief Converter tools
const EntityWrapperPtr& theEntity3 = EntityWrapperPtr(),
const EntityWrapperPtr& theEntity4 = EntityWrapperPtr());
+ /// \brief Return \c true if the attribute is used in PlaneGCS solver
+ /// \param[in] theAttrName name of the attribute
+ /// \param[in] theOwnerName name of the parent feature
+ bool isAttributeApplicable(const std::string& theAttrName,
+ const std::string& theOwnerName);
+
/// \brief Convert entity to point
/// \return empty pointer if the entity is not a point
std::shared_ptr<GeomAPI_Pnt2d> point(EntityWrapperPtr theEntity);
/// \brief Convert entity to ellipse
/// \return empty pointer if the entity is not an ellipse
std::shared_ptr<GeomAPI_Ellipse2d> ellipse(EntityWrapperPtr theEntity);
+ /// \brief Convert entity to Bs-pline
+ /// \return empty pointer if the entity is not an ellipse
+ std::shared_ptr<GeomAPI_BSpline2d> bspline(EntityWrapperPtr theEntity);
/// \brief Convert entity to line
/// \return empty pointer if the entity is not a line
/// brief Return list of parameters for the given entity
GCS::SET_pD parameters(const EntityWrapperPtr& theEntity);
+
+ /// \brief Update value in theDest if theSource is differ more than theTolerance
+ /// \return \c true if the value was updated.
+ bool updateValue(const double& theSource, double& theDest,
+ const double theTolerance = 1.e4 * tolerance);
+
+ double distance(const GCS::Point& thePnt1, const GCS::Point& thePnt2);
+
+ /// \brief Provide an interface to access values in attribute which is an array of values
+ class AttributeArray
+ {
+ public:
+ AttributeArray(AttributePtr theAttribute);
+
+ bool isInitialized() const;
+
+ int size() const;
+
+ double value(const int theIndex) const;
+
+ private:
+ std::shared_ptr<ModelAPI_AttributeDoubleArray> myDouble;
+ std::shared_ptr<ModelAPI_AttributeIntArray> myInteger;
+ };
};
#endif