OpenFrames
DrawableTrajectory.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_DRAWABLETRAJECTORY_
22 #define _OF_DRAWABLETRAJECTORY_
23 
24 #include <OpenFrames/Export.h>
27 #include <osg/ref_ptr>
28 
29 namespace OpenFrames
30 {
39  class OF_EXPORT DrawableTrajectory : public ReferenceFrame
40  {
41  public:
42  DrawableTrajectory( const std::string &name );
43  DrawableTrajectory( const std::string &name, float r, float g, float b, float a = 1.0);
44 
45  // Show/hide this frame's contents, e.g. everything a frame shows (excluding axes, labels, and children)
46  // Inherited from ReferenceFrame
47  virtual void showContents(bool showContents);
48  virtual bool getContentsShown() const;
49 
51  void addArtist(TrajectoryArtist *artist);
52  void removeArtist(TrajectoryArtist *artist);
53  void removeAllArtists();
54  unsigned int getNumArtists() const;
55  TrajectoryArtist* getArtist(unsigned int index);
56 
58  virtual const osg::BoundingSphere& getBound() const;
59  virtual std::string frameInfo() const;
60 
61  protected:
62  virtual ~DrawableTrajectory();
63 
64  void _init();
65 
66  osg::ref_ptr<osg::Geode> _geode; // Node to hold the artists
67  };
68 
69 }
70 
71 #endif
Abstract class for Trajectory objects.
Definition: TrajectoryArtist.hpp:42
Definition: CoordinateAxes.hpp:29
This class provides a ReferenceFrame for TrajectoryArtists.
Definition: DrawableTrajectory.hpp:39
Definition: ReferenceFrame.hpp:54