Revision: 6700
          http://playerstage.svn.sourceforge.net/playerstage/?rev=6700&view=rev
Author:   jeremy_asher
Date:     2008-06-26 16:32:16 -0700 (Thu, 26 Jun 2008)

Log Message:
-----------
Added Option for Camera data

Modified Paths:
--------------
    code/stage/trunk/libstage/model_camera.cc
    code/stage/trunk/libstage/stage.hh

Modified: code/stage/trunk/libstage/model_camera.cc
===================================================================
--- code/stage/trunk/libstage/model_camera.cc   2008-06-26 23:03:15 UTC (rev 
6699)
+++ code/stage/trunk/libstage/model_camera.cc   2008-06-26 23:32:16 UTC (rev 
6700)
@@ -15,6 +15,8 @@
 #include <sstream>
 #include <iomanip>
 
+Option StgModelCamera::ShowCamera( "Show Camera", true );
+
 //caclulate the corss product, and store results in the first vertex
 void cross( float& x1, float& y1, float& z1, float x2, float y2, float z2 )
 {      
@@ -165,10 +167,10 @@
        return true;
 }
 
-//TODO create lines outlineing camera frustrum, then iterate over each depth 
measurement and create a square
+//TODO create lines outlining camera frustrum, then iterate over each depth 
measurement and create a square
 void StgModelCamera::DataVisualize( void )
 {
-       if( _frame_data == NULL )
+       if( _frame_data == NULL || !ShowCamera )
                return;
        
        float w_fov = _camera.horizFov();
@@ -282,3 +284,10 @@
        StgModel::Draw( flags, canvas );
 }
 
+
+const std::vector<Option*> StgModelCamera::getOptions() {
+       std::vector<Option*> drawOptions;
+       drawOptions.push_back( &ShowCamera );
+       
+       return drawOptions;
+}
\ No newline at end of file

Modified: code/stage/trunk/libstage/stage.hh
===================================================================
--- code/stage/trunk/libstage/stage.hh  2008-06-26 23:03:15 UTC (rev 6699)
+++ code/stage/trunk/libstage/stage.hh  2008-06-26 23:32:16 UTC (rev 6700)
@@ -2502,6 +2502,8 @@
                GLfloat* _camera_quads;
                GLubyte* _camera_colors;
        
+               static Option ShowCamera;
+       
                StgPerspectiveCamera _camera;
                int _yaw_offset; //position camera is mounted at
                
@@ -2539,6 +2541,8 @@
        
                ///get a reference to camera color image. 3 bytes (RGB) per 
pixel
                inline const GLubyte* FrameColor() const { return 
_frame_color_data; }
+       
+               virtual const std::vector<Option*> getOptions();
 };
 
 // POSITION MODEL --------------------------------------------------------


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to