Line |
Branch |
Exec |
Source |
1 |
|
|
// |
2 |
|
|
// Copyright (c) 2023 INRIA |
3 |
|
|
// |
4 |
|
|
|
5 |
|
|
#ifndef __pinocchio_algorithm_constraint_model_generic_hpp__ |
6 |
|
|
#define __pinocchio_algorithm_constraint_model_generic_hpp__ |
7 |
|
|
|
8 |
|
|
#include "pinocchio/algorithm/constraints/fwd.hpp" |
9 |
|
|
#include "pinocchio/algorithm/constraints/constraint-model-base.hpp" |
10 |
|
|
#include "pinocchio/algorithm/constraints/constraint-data-generic.hpp" |
11 |
|
|
#include "pinocchio/algorithm/constraints/visitors/constraint-model-visitor.hpp" |
12 |
|
|
|
13 |
|
|
namespace pinocchio |
14 |
|
|
{ |
15 |
|
|
|
16 |
|
|
template< |
17 |
|
|
typename _Scalar, |
18 |
|
|
int _Options, |
19 |
|
|
template<typename S, int O> |
20 |
|
|
class ConstraintCollectionTpl> |
21 |
|
|
struct traits<ConstraintModelTpl<_Scalar, _Options, ConstraintCollectionTpl>> |
22 |
|
|
{ |
23 |
|
|
typedef _Scalar Scalar; |
24 |
|
|
enum |
25 |
|
|
{ |
26 |
|
|
Options = _Options |
27 |
|
|
}; |
28 |
|
|
typedef ConstraintDataTpl<Scalar, Options, ConstraintCollectionTpl> ConstraintData; |
29 |
|
|
}; |
30 |
|
|
|
31 |
|
|
template< |
32 |
|
|
typename _Scalar, |
33 |
|
|
int _Options, |
34 |
|
|
template<typename S, int O> |
35 |
|
|
class ConstraintCollectionTpl> |
36 |
|
|
struct ConstraintModelTpl |
37 |
|
|
: ConstraintModelBase<ConstraintModelTpl<_Scalar, _Options, ConstraintCollectionTpl>> |
38 |
|
|
, ConstraintCollectionTpl<_Scalar, _Options>::ConstraintModelVariant |
39 |
|
|
{ |
40 |
|
|
typedef _Scalar Scalar; |
41 |
|
|
enum |
42 |
|
|
{ |
43 |
|
|
Options = _Options |
44 |
|
|
}; |
45 |
|
|
|
46 |
|
|
typedef ConstraintModelBase<ConstraintModelTpl<_Scalar, _Options, ConstraintCollectionTpl>> |
47 |
|
|
Base; |
48 |
|
|
typedef ConstraintDataTpl<Scalar, Options, ConstraintCollectionTpl> ConstraintData; |
49 |
|
|
typedef ConstraintCollectionTpl<Scalar, Options> ConstraintCollection; |
50 |
|
|
typedef typename ConstraintCollection::ConstraintDataVariant ConstraintDataVariant; |
51 |
|
|
typedef typename ConstraintCollection::ConstraintModelVariant ConstraintModelVariant; |
52 |
|
|
|
53 |
|
|
ConstraintModelTpl() |
54 |
|
|
: ConstraintModelVariant() |
55 |
|
|
{ |
56 |
|
|
} |
57 |
|
|
|
58 |
|
|
ConstraintModelTpl(const ConstraintModelVariant & cmodel_variant) |
59 |
|
|
: ConstraintModelVariant(cmodel_variant) |
60 |
|
|
{ |
61 |
|
|
} |
62 |
|
|
|
63 |
|
|
template<typename ContraintModelDerived> |
64 |
|
✗ |
ConstraintModelTpl(const ConstraintModelBase<ContraintModelDerived> & cmodel) |
65 |
|
✗ |
: ConstraintModelVariant((ConstraintModelVariant)cmodel.derived()) |
66 |
|
|
{ |
67 |
|
|
BOOST_MPL_ASSERT( |
68 |
|
|
(boost::mpl::contains<typename ConstraintModelVariant::types, ContraintModelDerived>)); |
69 |
|
|
} |
70 |
|
|
|
71 |
|
|
ConstraintData createData() const |
72 |
|
|
{ |
73 |
|
|
return ::pinocchio::createData<Scalar, Options, ConstraintCollectionTpl>(*this); |
74 |
|
|
} |
75 |
|
|
}; |
76 |
|
|
|
77 |
|
|
} // namespace pinocchio |
78 |
|
|
|
79 |
|
|
#endif // ifndef __pinocchio_algorithm_constraint_model_generic_hpp__ |
80 |
|
|
|