VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DtSenSim.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2013 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvSenSim/vrvSenSim.h>
13 
14 #include <GL/glew.h>
15 
16 #include <osg/Camera>
17 
18 class seSenSim;
19 
20 namespace makVrv
21 {
22  class DtOsgChannel;
23 
24  // Internal utility class to manage SenSim instances per channel/window
25  // Mostly adapted from JRM sample code
26  class DtSenSim
27  {
28  public:
29  //constructor
30  DtSenSim(DtOsgChannel& channel);
31 
32  //destructor
33  ~DtSenSim();
34 
36  void setPostDrawCamera( osg::Camera::DrawCallback* camera);
37  osg::Camera::DrawCallback* postDrawCamera() const;
39 
40  // initialize to default values
41  bool init_sensim(int win_w, int win_h);
42 
47  void applySensorEffects(GLuint inputTextureId, GLuint outputTextureId = 0);
48 
49  // resize the area of the frame buffer that SenSim is applied to
50  void resizeViewports(unsigned int inX, unsigned int inY,
51  unsigned int inWidth, unsigned int inHeight,
52  unsigned int outX, unsigned int outY,
53  unsigned int outWidth, unsigned int outHeight);
54 
55  // percentage of the frame size SenSim is using; should be set to 1.0 always
57 
58  //@name Setters for SenSim attributes
60  void toggleHalo(bool val);
61  void toggleIr(bool val);
62  void toggleFilter(bool val);
63  void toggleGain(bool val);
64  void toggleBlur(bool val);
65  void toggleNoise(bool val);
66  void toggleIrPolarity(bool val);
67  void setGain(float gain);
68  void setLevel(float level);
69  void setFilter(float filter);
70  void setBlur(float blur);
71  void setNoise(float noise);
72  void setFullColor(bool fullColor);
73  void setSampling(float sampling);
75 
76  // Update SenSim rendering according to the current attribute state
77  //
78  // Must be called before changes made in the above setters take effect
79  void updateSettings();
80 
81  private:
82 
83  seSenSim *m_sensorEffects; //pointer to seSenSim object used for changing SenSim settings
84  bool m_filterOn;//is the filter on 'F'
85  bool m_noiseOn;//is noise on 'N'
86  bool m_blurOn;//is blur on
87  bool m_haloOn;//is halo on 'H'
88  bool m_agcOn;//is automatic gain control on 'A'
89  bool m_gainOn;
90  bool m_blackHotOn;//is polarity control on 'P'
91  bool m_IRsensorOn;//is ir/nvg sensor control on 'I'
93  float m_blurLevel;
95  int m_inWidth;
98  int m_inX;
99  int m_inY;
100  int m_outX;
101  int m_outY;
103  osg::Camera::DrawCallback* myCameraCallback;
104  };
105 }

Document ID: Generated on Mon Jul 4 01:00:18 EDT 2016 from SVN revision 166489
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)