Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00013
00050
00051 #include "stage.hh"
00052 #include "worldfile.hh"
00053 #include "option.hh"
00054 using namespace Stg;
00055
00056
00057 Option ModelBlinkenlight::showBlinkenData( "Show Blink", "show_blinken", "", true, NULL );
00058
00059
00060 ModelBlinkenlight::ModelBlinkenlight( World* world,
00061 Model* parent,
00062 const std::string& type ) :
00063 Model( world, parent, type ),
00064 dutycycle( 1.0 ),
00065 enabled( true ),
00066 period( 1000 ),
00067 on( true )
00068 {
00069 PRINT_DEBUG2( "Constructing ModelBlinkenlight %d (%s)\n",
00070 id, typestr );
00071
00072
00073
00074 this->SetColor( Color( "green" ) );
00075
00076
00077 Geom geom;
00078 memset( &geom, 0, sizeof(geom));
00079 geom.size.x = 0.02;
00080 geom.size.y = 0.02;
00081 geom.size.z = 0.02;
00082 this->SetGeom( geom );
00083
00084
00085 this->Startup();
00086
00087 RegisterOption( &showBlinkenData );
00088 }
00089
00090 ModelBlinkenlight::~ModelBlinkenlight()
00091 {
00092 }
00093
00094 void ModelBlinkenlight::Load( void )
00095 {
00096 Model::Load();
00097
00098 this->dutycycle = wf->ReadFloat( wf_entity, "dutycycle", this->dutycycle );
00099 this->period = wf->ReadInt( wf_entity, "period", this->period );
00100 this->enabled = wf->ReadInt( wf_entity, "dutycycle", this->enabled );
00101 }
00102
00103
00104 void ModelBlinkenlight::Update( void )
00105 {
00106
00107 this->on = ! this->on;
00108 Model::Update();
00109 }
00110
00111
00112 void ModelBlinkenlight::DataVisualize( Camera* cam )
00113 {
00114 (void)cam;
00115
00116
00117 if( on && showBlinkenData )
00118 {
00119
00120 }
00121 }
00122