Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

# Modules/CollisionDetector/CollisionDetectorSelector.h

Go to the documentation of this file.

    00001 /**
    00002 * @file CollisionDetectorSelector.h
    00003 *
    00004 * Definition of class CollisionDetectorSelector
    00005 *
    00006 * @author Daniel Göhring
    00007 */
    00008
    00009 #ifndef __CollisionDetectorSelector_h_
    00010 #define __CollisionDetectorSelector_h_
    00011
    00012 #include "Tools/Module/ModuleSelector.h"
    00013
    00014 #include "GT2005CollisionDetector.h"
    00015
    00016 /**
    00017 * CollisionDetector selection module.
    00018 *
    00019 * A selector for collision detector modules.
    00020 */
    00021 class CollisionDetectorSelector : public ModuleSelector, public CollisionDetectorInterfaces
    00022 {
    00023 public:
    00024 /**
    00025 * Constructor.
    00026 * @param handler The module handler of the process.
    00027 * @param interfaces The paramters of the CollisionDetector module.
    00028   */
    00029   CollisionDetectorSelector(ModuleHandler &handler, const CollisionDetectorInterfaces& interfaces)
    00030     : ModuleSelector(SolutionRequest::collisionDetector),
    00031     CollisionDetectorInterfaces(interfaces)
    00032   {
    00033     handler.setModuleSelector(SolutionRequest::collisionDetector, this);
    00034   }
    00035
    00036   /**
    00037   * Is called on start and when the selected solution changes
    00038   * to create a specific solution.
    00039   * @param id The id of the solution to create
    00040   * @return The created solution or 0
    00041   */
    00042   virtual Module* createSolution(SolutionRequest::ModuleSolutionID id)
    00043   {
    00044     switch(id)
    00045     {
    00046     case SolutionRequest::gt2005CollisionDetector:
    00047       return new GT2005CollisionDetector(*this);
    00048
    00049     default:
    00050       return 0;
    00051     }
    00052   }
    00053 };
    00054
    00055 #endif // CollisionDetectorSelector_h_