OpenFrames
FramePathVerifier.hpp
Go to the documentation of this file.
1 /***********************************
2  Copyright 2018 Ravishankar Mathur
3 
4  Licensed under the Apache License, Version 2.0 (the "License");
5  you may not use this file except in compliance with the License.
6  You may obtain a copy of the License at
7 
8  http://www.apache.org/licenses/LICENSE-2.0
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 ***********************************/
16 
21 #ifndef _OF_FRAMEPATHVERIFIER_
22 #define _OF_FRAMEPATHVERIFIER_
23 
24 #include <OpenFrames/Export.h>
26 #include <vector>
27 
28 namespace OpenFrames
29 {
30 
31 class ReferenceFrame;
32 typedef std::vector<ReferenceFrame*> FramePath;
33 
48  class OF_EXPORT FramePathVerifier : public FrameTracker
49  {
50  public:
52 
53  // Called when a frame is added to or removed from a tracked frame
54  virtual void childAdded(ReferenceFrame* child, ReferenceFrame* parent) {};
55  virtual void childRemoved(ReferenceFrame* child, ReferenceFrame* parent);
56 
57  // Does not apply to this type of FrameTracker
58  virtual void setRoot( ReferenceFrame* frame ) {}
59 
60  void setFramePath(const FramePath &path);
61  inline bool isFramePathValid() {return _valid;}
62  protected:
63  virtual ~FramePathVerifier();
64  void _clearPath();
65 
66  FramePath _framePath;
67  bool _valid;
68  };
69 
70 } // !namespace OpenFrames
71 
72 #endif
This class tracks children of a reference frame.
Definition: FrameTracker.hpp:41
This class determines whether a FramePath is valid.
Definition: FramePathVerifier.hpp:48
Definition: CoordinateAxes.hpp:29
Definition: ReferenceFrame.hpp:54