00001 #ifndef _INSTRUCTIONS_NV_INSTRUCTIONS_H_
00002 #define _INSTRUCTIONS_NV_INSTRUCTIONS_H_
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00030 #include "../../IPSA.h"
00031 #include "Instruction.h"
00032 #include "GetBodyForce.h"
00033 #include "GetBodyPosition.h"
00034 #include "GetBodyRotation.h"
00035 #include "GetBodyTorque.h"
00036 #include "GetJointAngle.h"
00037 #include "GetJointAngleRate.h"
00038 #include "GetJointForce.h"
00039 #include "GetJointPosition.h"
00040 #include "GetJointPositionRate.h"
00041 #include "GetJointTorque.h"
00042 #include "RemoveJoint.h"
00043 #include "ListAllBodies.h"
00044 #include "ListAllJoints.h"
00045 #include "ListBody2BodyContacts.h"
00046 #include "ListBodyContacts.h"
00047 #include "QuitViewer.h"
00048 #include "ResetIPSA.h"
00049 #include "ResetViewer.h"
00050 #include "SaveIVFile.h"
00051 #include "ScheduleIPSA.h"
00052 #include "SetBodyForce.h"
00053 #include "SetBodyRelForce.h"
00054 #include "SetBodyVelocity.h"
00055 #include "SetDrawShape.h"
00056 #include "SetJointForce.h"
00057 #include "SetJointMaxForce.h"
00058 #include "SetJointMaxForce2.h"
00059 #include "SetJointSpeed.h"
00060 #include "SetJointSpeed2.h"
00061 #include "SetJointTorque.h"
00062 #include "SetJointTorque2.h"
00063 #include "SetStepsizeIPSA.h"
00064 #include "SetVerbosity.h"
00065 #include "ShowJoints.h"
00066 #include "StepIPSA.h"
00067 #include "UnscheduleIPSA.h"
00068 #include "ViewerHelp.h"
00069 #include "NVInstructionAnswerParsing.h"
00070
00071 #include <map>
00072
00073 class IpsaViewerWidget;
00074
00079 class IPSA_VIEWER_IMPORT_EXPORT NVInstructions
00080 {
00081 public:
00082 static std::map<std::string, Instruction*> CreateInstructionMap(IpsaSimulator* simulator)
00083 {
00084 std::map<std::string, Instruction*> newInstructionMap;
00085 newInstructionMap.clear();
00086
00087 NVInstructions::AddEntry(newInstructionMap, new ListAllBodies(simulator));
00088 NVInstructions::AddEntry(newInstructionMap, new ListAllJoints(simulator));
00089 NVInstructions::AddEntry(newInstructionMap, new ListBodyContacts());
00090 NVInstructions::AddEntry(newInstructionMap, new ListBody2BodyContacts());
00091 NVInstructions::AddEntry(newInstructionMap, new SetJointForce());
00092 NVInstructions::AddEntry(newInstructionMap, new SetJointMaxForce());
00093 NVInstructions::AddEntry(newInstructionMap, new SetJointMaxForce2());
00094 NVInstructions::AddEntry(newInstructionMap, new SetJointTorque());
00095 NVInstructions::AddEntry(newInstructionMap, new SetJointTorque2());
00096 NVInstructions::AddEntry(newInstructionMap, new SetJointSpeed());
00097 NVInstructions::AddEntry(newInstructionMap, new SetJointSpeed2());
00098 NVInstructions::AddEntry(newInstructionMap, new SetBodyForce());
00099 NVInstructions::AddEntry(newInstructionMap, new SetBodyRelForce());
00100 NVInstructions::AddEntry(newInstructionMap, new SetBodyVelocity());
00101 NVInstructions::AddEntry(newInstructionMap, new SetVerbosity(simulator));
00102 NVInstructions::AddEntry(newInstructionMap, new ShowJoints(simulator));
00103 NVInstructions::AddEntry(newInstructionMap, new GetBodyForce());
00104 NVInstructions::AddEntry(newInstructionMap, new GetBodyTorque());
00105 NVInstructions::AddEntry(newInstructionMap, new GetBodyPosition());
00106 NVInstructions::AddEntry(newInstructionMap, new GetBodyRotation());
00107 NVInstructions::AddEntry(newInstructionMap, new GetJointAngle());
00108 NVInstructions::AddEntry(newInstructionMap, new GetJointAngleRate());
00109 NVInstructions::AddEntry(newInstructionMap, new GetJointPosition());
00110 NVInstructions::AddEntry(newInstructionMap, new GetJointPositionRate());
00111 NVInstructions::AddEntry(newInstructionMap, new GetJointTorque());
00112 NVInstructions::AddEntry(newInstructionMap, new GetJointForce());
00113 NVInstructions::AddEntry(newInstructionMap, new RemoveJoint());
00114 NVInstructions::AddEntry(newInstructionMap, new ScheduleIPSA(simulator));
00115 NVInstructions::AddEntry(newInstructionMap, new UnscheduleIPSA(simulator));
00116 NVInstructions::AddEntry(newInstructionMap, new StepIPSA(simulator));
00117 NVInstructions::AddEntry(newInstructionMap, new SetDrawShape());
00118 NVInstructions::AddEntry(newInstructionMap, new SetStepsizeIPSA(simulator));
00119 NVInstructions::AddEntry(newInstructionMap, new SaveIVFile(simulator));
00120 NVInstructions::AddEntry(newInstructionMap, new QuitViewer());
00121 NVInstructions::AddEntry(newInstructionMap, new ResetViewer(simulator));
00122 NVInstructions::AddEntry(newInstructionMap, new ResetIPSA(simulator));
00123
00124
00125 NVInstructions::AddEntry(newInstructionMap, new ViewerHelp(newInstructionMap));
00126
00127 return newInstructionMap;
00128 }
00129
00130 static void AddEntry(std::map<std::string, Instruction*>& instructionMap, Instruction* newInstruction)
00131 {
00132
00133 instructionMap[newInstruction->getCmdString()] = newInstruction;
00134 }
00135 };
00136
00137 #endif