Choreonoid  1.8
LinkPath.h
Go to the documentation of this file.
1 
6 #ifndef CNOID_BODY_LINK_PATH_H
7 #define CNOID_BODY_LINK_PATH_H
8 
9 #include "LinkTraverse.h"
10 #include "exportdecl.h"
11 
12 namespace cnoid {
13 
14 class CNOID_EXPORT LinkPath : public LinkTraverse
15 {
16 public:
17  LinkPath();
18  LinkPath(Link* base, Link* end);
19  LinkPath(Link* end);
20 
21  bool setPath(Link* base, Link* end);
22  void setPath(Link* end);
23 
24  Link* baseLink() const { return links_.front(); }
25  Link* endLink() const { return links_.back(); }
26 
27 #ifdef CNOID_BACKWARD_COMPATIBILITY
28  bool find(Link* base, Link* end) { return setPath(base, end); }
31  void find(Link* end) { return setPath(end); }
32 #endif
33 
34 private:
35  virtual void find(Link* root, bool doUpward, bool doDownward) override;
36 
37  bool findPathSub(Link* link, Link* prev, Link* end, bool isForwardDirection);
38  void findPathFromRootSub(Link* link);
39 };
40 
41 }
42 
43 #endif
cnoid::LinkPath
Definition: LinkPath.h:14
cnoid::LinkPath::endLink
Link * endLink() const
Definition: LinkPath.h:25
LinkTraverse.h
The header file of the LinkTraverse class.
cnoid
Definition: AbstractSceneLoader.h:11
cnoid::LinkTraverse
Definition: LinkTraverse.h:17
cnoid::LinkPath::baseLink
Link * baseLink() const
Definition: LinkPath.h:24