Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

CommandSet Class Reference

#include <command.h>

Inheritance diagram for CommandSet:

Inheritance graph
Collaboration diagram for CommandSet:

Collaboration graph
List of all members.

Public Member Functions

 CommandSet (const std::string &, double)
void process (ExecutionEnvironment &)

Private Attributes

std::string name
double value

Constructor & Destructor Documentation

CommandSet::CommandSet const std::string ,
double 
 

Definition at line 567 of file command.cpp.

00567                                                             :
00568     name(_name), value(_value)
00569 {
00570 }


Member Function Documentation

void CommandSet::process ExecutionEnvironment  )  [virtual]
 

Implements InstantaneousCommand.

Definition at line 572 of file command.cpp.

References compareIgnoringCase(), degToRad(), name, Renderer::setAmbientLightLevel(), Renderer::setDistanceLimit(), Renderer::setMinimumOrbitSize(), Renderer::setStarStyle(), and value.

00573 {
00574     if (compareIgnoringCase(name, "MinOrbitSize") == 0)
00575     {
00576         if (env.getRenderer() != NULL)
00577             env.getRenderer()->setMinimumOrbitSize((float) value);
00578     }
00579     else if (compareIgnoringCase(name, "AmbientLightLevel") == 0)
00580     {
00581         if (env.getRenderer() != NULL)
00582             env.getRenderer()->setAmbientLightLevel((float) value);
00583     }
00584     else if (compareIgnoringCase(name, "FOV") == 0)
00585     {
00586         if (env.getRenderer() != NULL)
00587             env.getSimulation()->getActiveObserver()->setFOV(degToRad((float) value));
00588     }
00589     else if (compareIgnoringCase(name, "StarDistanceLimit") == 0)
00590     {
00591         if (env.getRenderer() != NULL)
00592             env.getRenderer()->setDistanceLimit((float) value);
00593     }
00594     else if (compareIgnoringCase(name, "StarStyle") == 0)
00595     {
00596         // The cast from double to an enum requires an intermediate cast to int
00597         // Probably shouldn't be doing this at all, but other alternatives
00598         // are more trouble than they're worth.
00599         if (env.getRenderer() != NULL)
00600             env.getRenderer()->setStarStyle((Renderer::StarStyle) (int) value);
00601     }
00602 }


Member Data Documentation

std::string CommandSet::name [private]
 

Definition at line 453 of file command.h.

Referenced by process().

double CommandSet::value [private]
 

Definition at line 454 of file command.h.

Referenced by process().


The documentation for this class was generated from the following files:
Generated on Sat Jan 14 22:33:14 2006 for Celestia by  doxygen 1.4.1