File indexing completed on 2024-04-14 03:49:24

0001 /*
0002     SPDX-FileCopyrightText: 2007 Vladimir Kuznetsov <ks.vladimir@gmail.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 /** \file constraintsolver.h
0008  *  \brief ConstraintSolver interface
0009  */
0010 
0011 #ifndef STEPCORE_CONSTRAINTSOLVER_H
0012 #define STEPCORE_CONSTRAINTSOLVER_H
0013 
0014 #include "object.h"
0015 #include "world.h"
0016 #include "vector.h"
0017 #include "types.h"
0018 #include "solver.h"
0019 
0020 namespace StepCore
0021 {
0022 
0023 /** \ingroup contacts
0024  *  \brief Constraint solver interface
0025  *
0026  *  Provides generic interface for constraint solvers.
0027  */
0028 class ConstraintSolver: public Object
0029 {
0030     STEPCORE_OBJECT(ConstraintSolver)
0031 
0032 public:
0033     virtual int solve(ConstraintsInfo* info) = 0;
0034 
0035 public:
0036     enum {
0037         InternalError = Solver::ConstraintError
0038     };
0039 };
0040 
0041 class CGConstraintSolver: public ConstraintSolver
0042 {
0043     STEPCORE_OBJECT(CGConstraintSolver)
0044 
0045 public:
0046     int solve(ConstraintsInfo* info) override;
0047 };
0048 
0049 } // namespace StepCore
0050 
0051 #endif
0052