hpp-manipulation  4.9.0
Classes for manipulation planning.
graph-optimizer.hh
Go to the documentation of this file.
1 // Copyright (c) 2015, LAAS-CNRS
2 // Authors: Joseph Mirabel (joseph.mirabel@laas.fr)
3 //
4 // This file is part of hpp-manipulation.
5 // hpp-manipulation is free software: you can redistribute it
6 // and/or modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation, either version
8 // 3 of the License, or (at your option) any later version.
9 //
10 // hpp-manipulation is distributed in the hope that it will be
11 // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
12 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // General Lesser Public License for more details. You should have
14 // received a copy of the GNU Lesser General Public License along with
15 // hpp-manipulation. If not, see <http://www.gnu.org/licenses/>.
16 
17 
18 #ifndef HPP_MANIPULATION_GRAPHOPTIMIZER_HH
19 # define HPP_MANIPULATION_GRAPHOPTIMIZER_HH
20 
21 # include <hpp/core/path-optimizer.hh>
22 # include <hpp/core/problem-solver.hh> // PathOptimizerBuilder_t
23 
24 # include <hpp/manipulation/fwd.hh>
27 
28 namespace hpp {
29  namespace manipulation {
30  using hpp::core::Path;
31  using hpp::core::PathPtr_t;
32  using hpp::core::PathVector;
33  using hpp::core::PathVectorPtr_t;
34 
37 
44  {
45  public:
46  typedef core::PathOptimizerBuilder_t PathOptimizerBuilder_t;
47 
48  template <typename TraitsOrInnerType>
49  static GraphOptimizerPtr_t create (const core::Problem& problem);
50 
51  virtual PathVectorPtr_t optimize (const PathVectorPtr_t& path);
52 
55  {
56  return pathOptimizer_;
57  }
58 
59  protected:
61  GraphOptimizer (const core::Problem& problem, PathOptimizerBuilder_t factory) :
62  PathOptimizer (problem), factory_ (factory), pathOptimizer_ ()
63  {}
64 
65  private:
66  PathOptimizerBuilder_t factory_;
67 
69  PathOptimizerPtr_t pathOptimizer_;
70  };
72 
74  template <typename TraitsOrInnerType>
76  (const core::Problem& problem)
77  {
78  return GraphOptimizerPtr_t (
79  new GraphOptimizer (problem, TraitsOrInnerType::create)
80  );
81  }
82 
83  } // namespace manipulation
84 } // namespace hpp
85 
86 #endif // HPP_MANIPULATION_GRAPHOPTIMIZER_HH
const PathOptimizerPtr_t & innerOptimizer()
Get the encapsulated optimizer.
Definition: graph-optimizer.hh:54
boost::shared_ptr< GraphOptimizer > GraphOptimizerPtr_t
Definition: fwd.hh:94
Definition: graph-optimizer.hh:43
Definition: main.hh:1
static GraphOptimizerPtr_t create(const core::Problem &problem)
Member function definition.
Definition: graph-optimizer.hh:76
#define HPP_MANIPULATION_DLLAPI
Definition: config.hh:64
core::PathOptimizerPtr_t PathOptimizerPtr_t
Definition: fwd.hh:92
core::PathOptimizerBuilder_t PathOptimizerBuilder_t
Definition: graph-optimizer.hh:46
core::PathOptimizer PathOptimizer
Definition: fwd.hh:91
GraphOptimizer(const core::Problem &problem, PathOptimizerBuilder_t factory)
Constructor.
Definition: graph-optimizer.hh:61