OpenFrames
TrajectoryArtist.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_TRAJECTORYARTIST_
22 #define _OF_TRAJECTORYARTIST_
23 
24 #include <OpenFrames/Export.h>
26 #include <osg/Drawable>
27 #include <osg/ref_ptr>
28 #include <vector>
29 
30 namespace OpenFrames
31 {
42  class OF_EXPORT TrajectoryArtist : public osg::Drawable, public OpenFrames::TrajectorySubscriber
43  {
44  public:
46 
47  // Copy constructor
49  const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY );
50 
52  virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const TrajectoryArtist*>(obj) != NULL; }
53  virtual const char* libraryName() const { return "OpenFrames"; }
54  virtual const char* className() const { return "TrajectoryArtist"; }
55 
57  virtual void setTrajectory(const Trajectory *traj);
58  inline const Trajectory* getTrajectory() const {return _traj.get();}
59 
62  virtual void dataCleared(Trajectory* traj) = 0;
63 
66  virtual void dataAdded(Trajectory* traj) = 0;
67 
68  protected:
69  virtual ~TrajectoryArtist();
70 
72  virtual osg::BoundingBox computeBoundingBox() const;
73 
76  void RTE_glVertex(osg::Vec3d &point, osg::GLExtensions &glext) const;
77 
78  osg::ref_ptr<const Trajectory> _traj; // Trajectory to be drawn
79 
80  osg::ref_ptr<osg::Program> _program; // GLSL program
81  };
82 
83 }
84 
85 #endif
Abstract base class that is informed of changes to Trajectory objects.
Definition: Trajectory.hpp:261
Abstract class for Trajectory objects.
Definition: TrajectoryArtist.hpp:42
Definition: CoordinateAxes.hpp:29
virtual bool isSameKindAs(const Object *obj) const
Definition: TrajectoryArtist.hpp:52