3 #ifndef _osaOSGCamera_h
4 #define _osaOSGCamera_h
8 #include <sawOpenSceneGraph/sawOpenSceneGraphConfig.h>
10 #ifdef SAW_OPENSCENEGRAPH_SUPPORTS_OPENCV
12 #include <opencv2/core/core.hpp>
15 #include <osgViewer/Viewer>
41 bool offscreenrendering;
49 virtual void UpdateTransform();
50 osg::Matrixd osgtransform;
65 class Data :
public osg::Referenced {
68 osg::ref_ptr<osaOSGCamera> camera;
93 void operator()( osg::Node* node, osg::NodeVisitor* );
100 #ifdef SAW_OPENSCENEGRAPH_SUPPORTS_OPENCV
107 class FinalDrawCallback :
public osg::Camera::DrawCallback {
113 class Data :
public osg::Referenced {
142 Data(
size_t width,
size_t height );
145 void RequestRangeData() { rangerequest =
true; }
146 void RequestDepthImage() { depthrequest =
true; }
147 void RequestRGBImage() { colorrequest =
true; }
149 bool RangeDataRequested()
const {
return rangerequest; }
150 bool DepthImageRequested()
const {
return depthrequest; }
151 bool RGBImageRequested()
const {
return colorrequest; }
158 void SetDepthImage(
const cv::Mat& depthimage );
159 void SetRGBImage(
const cv::Mat& rgbimage );
166 osg::ref_ptr<osg::Image> depthbufferimg;
169 osg::ref_ptr<osg::Image> colorbufferimg;
177 virtual void operator () ( osg::RenderInfo& )
const;
180 void ComputeRangeData( osg::Camera* camera )
const;
183 void ComputeDepthImage( osg::Camera* camera )
const;
186 void ComputeRGBImage( osg::Camera* camera )
const;
198 FinalDrawCallback( osg::Camera* camera );
200 ~FinalDrawCallback();
204 #endif // SAW_OPENSCENEGRAPH_SUPPORTS_OPENCV
206 std::vector< osg::ref_ptr< osaOSGHUD > >
huds;
222 bool trackball =
true,
224 bool offscreenrendering =
false );
231 { getCamera()->setCullMask( mask ); }
233 void SetTransform(
const vctFrm3& Rt );
#define CISST_EXPORT
Definition: cmnExportMacros.h:50
Declaration of vctDynamicMatrix.
Portability across compilers and operating systems tools.
#define CMN_UNUSED(argument)
Definition: cmnPortability.h:479
bool IsOffscreenRenderingEnabled() const
Definition: osaOSGCamera.h:57
Definition: osaOSGCamera.h:33
User data for the camera.
Definition: osaOSGCamera.h:65
Definition: mtsOSGCameraTask.h:28
Definition: osaOSGWorld.h:24
Definition: osaOSGHUD.h:15
Declaration of vctFrame4x4.
Errno
Definition: osaOSGCamera.h:33
osaOSGCamera * GetCamera()
Get the pointer to the camera.
Definition: osaOSGCamera.h:73
Update Callback.
Definition: osaOSGCamera.h:86
std::vector< osg::ref_ptr< osaOSGHUD > > huds
Definition: osaOSGCamera.h:206
std::string Mat
Definition: svlTypes.h:72
Data(osaOSGCamera *camera)
Default constructor.
Definition: osaOSGCamera.h:71
void setCullMask(osg::Node::NodeMask mask)
Definition: osaOSGCamera.h:230
virtual void Initialize(const std::string &CMN_UNUSED(name)=std::string())
Definition: osaOSGCamera.h:228
Definition: osaOSGCamera.h:27