Revision: 6688 http://playerstage.svn.sourceforge.net/playerstage/?rev=6688&view=rev Author: jeremy_asher Date: 2008-06-25 15:23:57 -0700 (Wed, 25 Jun 2008)
Log Message: ----------- Beginning to implement Option storage at model level Modified Paths: -------------- code/stage/trunk/libstage/model.cc code/stage/trunk/libstage/model_laser.cc code/stage/trunk/libstage/stage.hh Modified: code/stage/trunk/libstage/model.cc =================================================================== --- code/stage/trunk/libstage/model.cc 2008-06-25 22:21:47 UTC (rev 6687) +++ code/stage/trunk/libstage/model.cc 2008-06-25 22:23:57 UTC (rev 6688) @@ -139,6 +139,7 @@ // static members uint32_t StgModel::count = 0; +Option StgModel::ShowFlags( 0, "Show Flags", true ); GHashTable* StgModel::modelsbyid = g_hash_table_new( NULL, NULL ); @@ -1712,3 +1713,12 @@ return mod; } + +const std::vector<Option*> StgModel::getOptions() { + std::vector<Option*> drawOptions; + drawOptions.push_back( &ShowFlags ); + + return drawOptions; +} + + Modified: code/stage/trunk/libstage/model_laser.cc =================================================================== --- code/stage/trunk/libstage/model_laser.cc 2008-06-25 22:21:47 UTC (rev 6687) +++ code/stage/trunk/libstage/model_laser.cc 2008-06-25 22:23:57 UTC (rev 6688) @@ -33,6 +33,8 @@ //const char COLOR[] = "steel blue"; //const char FILL_COLOR[] = "powder blue"; +Option StgModelLaser::ShowLaserData( 0, "Show Laser Data", false ); + /** @ingroup model @defgroup model_laser Laser model @@ -355,5 +357,9 @@ glPopMatrix(); } - - +const std::vector<Option*> StgModelLaser::getOptions() { + std::vector<Option*> drawOptions; + drawOptions.push_back( &ShowLaserData ); + + return drawOptions; +} Modified: code/stage/trunk/libstage/stage.hh =================================================================== --- code/stage/trunk/libstage/stage.hh 2008-06-25 22:21:47 UTC (rev 6687) +++ code/stage/trunk/libstage/stage.hh 2008-06-25 22:23:57 UTC (rev 6688) @@ -1165,6 +1165,9 @@ /** the number of models instatiated - used to assign unique IDs */ static uint32_t count; static GHashTable* modelsbyid; + + // Draw options + static Option ShowFlags; public: @@ -1178,7 +1181,6 @@ uint32_t id; protected: - // basic model static const bool DEFAULT_BLOBRETURN; static const bool DEFAULT_BOUNDARY; @@ -1207,7 +1209,6 @@ static const stg_color_t BUBBLE_BORDER; static const stg_color_t BUBBLE_TEXT; - //const char* typestr; stg_pose_t pose; stg_velocity_t velocity; @@ -1704,6 +1705,8 @@ // iff true, model may output some debugging visualizations and other info bool debug; + + virtual const std::vector<Option*> getOptions(); }; // BLOCKS @@ -2214,6 +2217,9 @@ stg_meters_t range_min, range_max; stg_radians_t fov; uint32_t resolution; + + // Options + static Option ShowLaserData; public: static const char* typestr; @@ -2242,6 +2248,8 @@ // Set the user-tweakable configuration of the laser void SetConfig( stg_laser_cfg_t cfg ); + + virtual const std::vector<Option*> getOptions(); }; // \todo GRIPPER 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 Playerstage-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/playerstage-commit