Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
// Copyright (c) 2014, LAAS-CNRS
// Authors: Joseph Mirabel (joseph.mirabel@laas.fr)
//
// This file is part of hpp-manipulation.
// hpp-manipulation 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
// 3 of the License, or (at your option) any later version.
//
// hpp-manipulation 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
// General Lesser Public License for more details. You should have
// received a copy of the GNU Lesser General Public License along with
// hpp-manipulation. If not, see <http://www.gnu.org/licenses/>.
#ifndef HPP_MANIPULATION_GRAPHPATHVALIDATOR_HH
# define HPP_MANIPULATION_GRAPHPATHVALIDATOR_HH
# include <hpp/core/path.hh>
# include <hpp/core/path-vector.hh>
# include <hpp/core/path-validation.hh>
# include "hpp/manipulation/fwd.hh"
# include "hpp/manipulation/graph/graph.hh"
# include "hpp/manipulation/graph/node.hh"
namespace hpp {
namespace manipulation {
using hpp::core::PathValidation;
using hpp::core::PathValidationPtr_t;
using hpp::core::Path;
using hpp::core::PathPtr_t;
using hpp::core::PathVector;
using hpp::core::PathVectorPtr_t;
using graph::GraphPtr_t;
/// Path validation for a constraint graph
///
/// This class encapsulates another path validation class.
/// The encapsulated path validation is responsible for collision
/// checking, whereas this class checks if a path is valid regarding
/// the constraint graph.
class HPP_MANIPULATION_DLLAPI GraphPathValidation : public PathValidation
{
public:
/// Check that the path is valid regarding the constraint graph and call
/// the encapsulated PathValidation::validate.
bool validate (const PathPtr_t& path, bool reverse, PathPtr_t& validPart);
/// Create a new instance of this class.
/// \param pathValidation a PathValidation that is responsible for collision
// checking.
// \param graph A pointer to the constraint graph.
static GraphPathValidationPtr_t create (const PathValidationPtr_t& pathValidation, const GraphPtr_t& graph);
protected:
/// Constructor
GraphPathValidation (const PathValidationPtr_t& pathValidation, const GraphPtr_t& graph);
private:
/// Do validation regarding the constraint graph for PathVector
bool impl_validate (const PathVectorPtr_t& path, bool reverse, PathPtr_t& validPart);
/// Do validation regarding the constraint graph for Path
bool impl_validate (const PathPtr_t& path, bool reverse, PathPtr_t& validPart);
/// The encapsulated PathValidation.
PathValidationPtr_t pathValidation_;
/// Pointer to the constraint graph.
GraphPtr_t constraintGraph_;
};
} // namespace manipulation
} // namespace hpp
#endif // HPP_MANIPULATION_GRAPHPATHVALIDATOR_HH