hpp-manipulation  4.9.0
Classes for manipulation planning.
roadmap-node.hh
Go to the documentation of this file.
1 // Copyright (c) 2014 CNRS
2 // Authors: Joseph Mirabel
3 //
4 //
5 // This file is part of hpp-manipulation.
6 // hpp-manipulation is free software: you can redistribute it
7 // and/or modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation, either version
9 // 3 of the License, or (at your option) any later version.
10 //
11 // hpp-manipulation is distributed in the hope that it will be
12 // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
13 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // General Lesser Public License for more details. You should have
15 // received a copy of the GNU Lesser General Public License along with
16 // hpp-manipulation. If not, see
17 // <http://www.gnu.org/licenses/>.
18 
19 #ifndef HPP_MANIPULATION_ROADMAP_NODE_HH
20 # define HPP_MANIPULATION_ROADMAP_NODE_HH
21 
22 # include <hpp/core/node.hh>
23 
24 # include <hpp/manipulation/fwd.hh>
25 # include <hpp/manipulation/deprecated.hh>
26 # include <hpp/manipulation/config.hh>
29 
30 namespace hpp {
31  namespace manipulation {
32  class HPP_MANIPULATION_DLLAPI RoadmapNode : public core::Node
33  {
34  public:
35  RoadmapNode (const ConfigurationPtr_t& configuration) :
36  core::Node (configuration),
37  cacheSystem_ (defaultCachingSystem),
38  state_ ()
39  {}
40 
41  RoadmapNode (const ConfigurationPtr_t& configuration,
43 
46 
54  CACHE_NEED_UPDATE
55  };
56 
58 
61  {
62  return cacheSystem_;
63  }
64 
68  {
69  return state_.lock();
70  }
71 
74  {
75  return state_.lock();
76  }
77 
80  void graphNode (const graph::StatePtr_t& state)
82  {
83  if (cacheSystem_ != CACHE_DISABLED) cacheSystem_ = CACHE_UP_TO_DATE;
84  state_ = state;
85  }
86 
88  void graphState (const graph::StatePtr_t& state)
89  {
90  if (cacheSystem_ != CACHE_DISABLED) cacheSystem_ = CACHE_UP_TO_DATE;
91  state_ = state;
92  }
94 
96  {
97  leafCC_ = sc;
98  }
99 
101  {
102  return leafCC_;
103  }
104 
105  private:
106  CachingSystem cacheSystem_;
107 
108  graph::StateWkPtr_t state_;
109  LeafConnectedCompPtr_t leafCC_;
110  };
111  } // namespace manipulation
112 } // namespace hpp
113 
114 #endif // HPP_MANIPULATION_ROADMAP_NODE_HH
StateHistogram NodeHistogram HPP_MANIPULATION_DEPRECATED
Definition: statistics.hh:200
void leafConnectedComponent(const LeafConnectedCompPtr_t &sc)
Definition: roadmap-node.hh:95
boost::shared_ptr< ConnectedComponent > ConnectedComponentPtr_t
Definition: fwd.hh:62
boost::shared_ptr< State > StatePtr_t
Definition: fwd.hh:36
graph::StatePtr_t graphNode() const HPP_MANIPULATION_DEPRECATED
Definition: roadmap-node.hh:67
RoadmapNode(const ConfigurationPtr_t &configuration)
Definition: roadmap-node.hh:35
CachingSystem cachingSystem() const
Get the caching system being used.
Definition: roadmap-node.hh:60
graph::StatePtr_t graphState() const
Getter for the graph::State.
Definition: roadmap-node.hh:73
boost::shared_ptr< LeafConnectedComp > LeafConnectedCompPtr_t
Definition: fwd.hh:64
static CachingSystem defaultCachingSystem
Definition: roadmap-node.hh:57
LeafConnectedCompPtr_t leafConnectedComponent() const
Definition: roadmap-node.hh:100
CachingSystem
Definition: roadmap-node.hh:47
The chaching system is enabled and up to date.
Definition: roadmap-node.hh:52
void graphNode(const graph::StatePtr_t &state) HPP_MANIPULATION_DEPRECATED
Definition: roadmap-node.hh:80
void graphState(const graph::StatePtr_t &state)
Setter for the graph::State.
Definition: roadmap-node.hh:88
Definition: roadmap-node.hh:32
core::ConfigurationPtr_t ConfigurationPtr_t
Definition: fwd.hh:40