X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FSketchSolver%2FSketchSolver_ConstraintCollinear.h;h=725e9bbc568a312c70914024418deab8259eae01;hb=97c9be632393af43d33a6af12b400e95bb69acb5;hp=7ab635581472b64ca4dc746795bd168ff00f8696;hpb=83e4015d7099a1f87aae13a2811590dac27a6344;p=modules%2Fshaper.git diff --git a/src/SketchSolver/SketchSolver_ConstraintCollinear.h b/src/SketchSolver/SketchSolver_ConstraintCollinear.h index 7ab635581..725e9bbc5 100644 --- a/src/SketchSolver/SketchSolver_ConstraintCollinear.h +++ b/src/SketchSolver/SketchSolver_ConstraintCollinear.h @@ -1,8 +1,21 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D - -// File: SketchSolver_ConstraintCollinear.h -// Created: 27 May 2014 -// Author: Artem ZHIDKOV +// Copyright (C) 2014-2019 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 +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// #ifndef SketchSolver_ConstraintCollinear_H_ #define SketchSolver_ConstraintCollinear_H_ @@ -17,13 +30,26 @@ class SketchSolver_ConstraintCollinear : public SketchSolver_Constraint { public: /// Constructor based on SketchPlugin constraint - SketchSolver_ConstraintCollinear(ConstraintPtr theConstraint); + SketchSolver_ConstraintCollinear(ConstraintPtr theConstraint) + : SketchSolver_Constraint(theConstraint), + myInSolver(false) + { + for (int i = 0; i < 4; ++i) + myIsConstraintApplied[i] = false; + } + + /// \brief Notify this object about the feature is changed somewhere + virtual void notify(const FeaturePtr& theFeature, + PlaneGCSSolver_Update* theUpdater); - virtual ~SketchSolver_ConstraintCollinear() {} +protected: + /// \brief Converts SketchPlugin constraint to a list of solver constraints + virtual void process(); -//// /// \brief Notify constraint, that coincidence appears or removed -//// virtual void notifyCoincidenceChanged(EntityWrapperPtr theCoincAttr1, -//// EntityWrapperPtr theCoincAttr2); +private: + EntityWrapperPtr myPoints[4]; ///< extremities on collinear lines + bool myIsConstraintApplied[4]; ///< set \c true if point on opposite line + bool myInSolver; ///< the constraint is added to the solver }; #endif