cm_artoolkitplushandlers.h

00001 /* -- 2007-05-07 -- 
00002  *  ardev - an augmented reality library for robot developers
00003  *  Copyright 2005-2007 - Toby Collett (ardev _at_ plan9.net.nz)
00004  *
00005  *  This library is free software; you can redistribute it and/or
00006  *  modify it under the terms of the GNU Lesser General Public
00007  *  License as published by the Free Software Foundation; either
00008  *  version 2.1 of the License, or (at your option) any later version.
00009  *
00010  *  This library is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00013  *  Lesser General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU Lesser General Public
00016  *  License along with this library; if not, write to the Free Software
00017  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 
00018  *
00019  */
00020  
00021 #include <ardev/ardevconfig.h>
00022 #ifdef HAVE_ARTOOLKITPLUS
00023  
00024 #ifndef ARIDE_ARTOOLKITPLUSHANDLERS_H
00025 #define ARIDE_ARTOOLKITPLUSHANDLERS_H
00026 
00027 #include "cm_objecthandler.h"
00028 #include "cm_parameter.h"
00029 #include <ardev/artoolkitplus.h>
00030 
00031 void RegisterARToolKitPlusObjectHandlers();
00032 
00033 
00034 class ARToolKitPlusPreProcessHandler : public FrameProcessObjectHandler
00035 {
00036         public:
00037                 ARToolKitPlusPreProcessHandler();
00038                 ~ARToolKitPlusPreProcessHandler();
00039         
00040                 ARToolKitPlusPreProcess & GetObject();
00041                 void RemoveObject();
00042         
00043                 static ObjectHandler * CreateHandler() {return reinterpret_cast<ObjectHandler * > (new ARToolKitPlusPreProcessHandler);};
00044         protected:
00045                 ARToolKitPlusPreProcess * Obj;
00046         
00047                 CameraObjectParameter Cam;
00048 };
00049 
00050 // --- ARToolKitPreProcess Parameter ---
00051 class ARToolKitPlusPreProcessParameter : public ARObjectParameterBase
00052 {
00053 public: 
00054                 ARToolKitPlusPreProcessParameter(QString _Name, QString _Description, QString _DefaultValue="") : ARObjectParameterBase(_Name,_Description,_DefaultValue) {Type="ARToolKitPlusPreProcess";};
00055                 virtual ~ARToolKitPlusPreProcessParameter() {};
00056 
00057                 ARToolKitPlusPreProcessHandler * GetClass() 
00058                 {
00059                         if (Value == "")
00060                                 throw aride_exception(ARDEV_CLASS_NOT_FOUND, __FILE__, __LINE__);
00061                         aride_object * temp = CurrentProject->GetObjectByGUID(Value);
00062                         if (temp == NULL)
00063                                 throw aride_exception(ARDEV_CLASS_NOT_FOUND, __FILE__, __LINE__);
00064                         if (temp->Section == ARIDE_PREPROCESS && temp->Type == "ARToolKitPlusPreProcess")
00065                                 return reinterpret_cast<ARToolKitPlusPreProcessHandler *> (temp->Handler);
00066                         throw aride_exception(ARDEV_CLASS_NOT_FOUND, __FILE__, __LINE__);
00067                 };                              
00068 };
00069 
00070 class ARToolKitPlusPositionHandler : public PositionObjectHandler
00071 {
00072         public:
00073                 ARToolKitPlusPositionHandler();
00074                 ~ARToolKitPlusPositionHandler();
00075         
00076                 PositionObject & GetObject();
00077                 void RemoveObject();
00078         
00079                 static ObjectHandler * CreateHandler() {return static_cast<ObjectHandler * > (new ARToolKitPlusPositionHandler);};
00080         protected:
00081                 ARToolKitPlusPosition * Obj;
00082         
00083                 IntParameter MarkerID;
00084                 DoubleParameter Height;
00085                 ARToolKitPlusPreProcessParameter Pre;
00086 };
00087 
00088 #endif
00089 #endif 

SourceForge.net Logo Generated on Sat May 12 15:25:43 2007 for ardev by doxygen 1.5.1