cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mtsOSGCameraTask.h
Go to the documentation of this file.
1 /*
2 
3  Author(s): Simon Leonard
4  Created on: Dec 02 2009
5 
6  (C) Copyright 2009 Johns Hopkins University (JHU), All Rights
7  Reserved.
8 
9 --- begin cisst license - do not edit ---
10 
11 This software is provided "as is" under an open source license, with
12 no warranty. The complete license can be found in license.txt and
13 http://www.cisst.org/cisst/license.txt.
14 
15 --- end cisst license ---
16 */
17 
18 
19 #ifndef _mtsOSGCamera_h
20 #define _mtsOSGCamera_h
21 
24 
27 
29 
30  friend class osaOSGHUD;
31 
32  protected:
33 
34  osg::ref_ptr<osaOSGCamera> camera;
35 
36  private:
37 
39  mtsInterfaceRequired* input;
40  mtsFunctionRead GetPosition;
41 
42 
44 
49  class Data : public osg::Referenced {
50  private:
52  mtsOSGCameraTask* mtsCamera;
53  public:
55  Data( mtsOSGCameraTask* camera ) : mtsCamera( camera ){}
57  mtsOSGCameraTask* GetCameraTask() { return mtsCamera; }
58  };
59 
60 
62 
66  class UpdateCallback : public osg::NodeCallback {
68 
73  void operator()( osg::Node* node, osg::NodeVisitor* );
74  };
75 
77  virtual void UpdateTransform();
78 
79  public:
80 
81  // Main constructor
82  mtsOSGCameraTask( const std::string& name, osaOSGCamera* camera );
83 
84 
85  void setCullMask( osg::Node::NodeMask mask );
86 
88 
89  void Startup();
90  void Run();
91  void Cleanup();
92 
93  inline osg::ref_ptr<osaOSGCamera> GetCamera(void)
94  { return camera; }
95 
96  void addEventHandler( osgGA::GUIEventHandler *eventHandler )
97  { camera->addEventHandler( eventHandler ); }
98 
99 };
100 
101 #endif
#define CISST_EXPORT
Definition: cmnExportMacros.h:50
Definition: mtsFunctionRead.h:37
Declaration of mtsInterfaceRequired.
void addEventHandler(osgGA::GUIEventHandler *eventHandler)
Definition: mtsOSGCameraTask.h:96
~mtsOSGCameraTask()
Definition: mtsOSGCameraTask.h:87
Definition: mtsInterfaceRequired.h:85
Defines a continuously executing task.
virtual void Startup(void)
Definition: mtsComponent.h:262
Definition: mtsOSGCameraTask.h:28
Definition: osaOSGHUD.h:15
osg::ref_ptr< osaOSGCamera > GetCamera(void)
Definition: mtsOSGCameraTask.h:93
osg::ref_ptr< osaOSGCamera > camera
Definition: mtsOSGCameraTask.h:34
virtual void Run(void)=0
Definition: mtsTaskContinuous.h:77
virtual void Cleanup(void)
Definition: mtsComponent.h:267
Definition: osaOSGCamera.h:27