cm_artoolkithandlers.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_LIBAR
00023  
00024 #ifndef ARIDE_ARTOOLKITHANDLERS_H
00025 #define ARIDE_ARTOOLKITHANDLERS_H
00026 
00027 #include "cm_objecthandler.h"
00028 #include "cm_parameter.h"
00029 #include <ardev/artoolkit.h>
00030 
00031 void RegisterARToolKitObjectHandlers();
00032 
00033 
00034 class ARToolKitPreProcessHandler : public PreProcessObjectHandler
00035 {
00036         public:
00037                 ARToolKitPreProcessHandler();
00038                 ~ARToolKitPreProcessHandler();
00039         
00040                 ARToolKitPreProcess & GetObject();
00041                 void RemoveObject();
00042         
00043                 static ObjectHandler * CreateHandler() {return static_cast<ObjectHandler * > (new ARToolKitPreProcessHandler);};
00044         protected:
00045                 ARToolKitPreProcess * Obj;
00046         
00047                 IntParameter Threshold;
00048                 CameraObjectParameter Cam;
00049 };
00050 
00051 // --- ARToolKitPreProcess Parameter ---
00052 class ARToolKitPreProcessParameter : public StringParameter
00053 {
00054 public: 
00055                 ARToolKitPreProcessParameter(QString _Name, QString _Description, QString _DefaultValue="") : StringParameter(_Name,_Description,_DefaultValue) {Type="ARToolKitPreProcess";};
00056                 virtual ~ARToolKitPreProcessParameter() {};
00057 
00058                 ARToolKitPreProcessHandler * GetClass() 
00059                 {
00060                         if (Value == "")
00061                                 throw aride_exception(ARIDE_CLASS_NOT_FOUND, __FILE__, __LINE__);
00062                         aride_object * temp = theMainWindow->GetObjectByName(Value);
00063                         if (temp == NULL)
00064                                 throw aride_exception(ARIDE_CLASS_NOT_FOUND, __FILE__, __LINE__);
00065                         if (temp->Section == ARIDE_PREPROCESS && temp->Type == "ARToolKitPreProcess")
00066                                 return reinterpret_cast<ARToolKitPreProcessHandler *> (temp->Handler);
00067                         throw aride_exception(ARIDE_CLASS_NOT_FOUND, __FILE__, __LINE__);
00068                 };                              
00069 };
00070 
00071 class ARToolKitPositionHandler : public PositionObjectHandler
00072 {
00073         public:
00074                 ARToolKitPositionHandler();
00075                 ~ARToolKitPositionHandler();
00076         
00077                 PositionObject & GetObject();
00078                 void RemoveObject();
00079         
00080                 static ObjectHandler * CreateHandler() {return static_cast<ObjectHandler * > (new ARToolKitPositionHandler);};
00081         protected:
00082                 ARToolKitPosition * Obj;
00083         
00084                 DoubleParameter PattWidth;
00085                 StringParameter PattFile;
00086                 ARToolKitPreProcessParameter Pre;
00087 };
00088 
00089 #endif
00090 #endif 

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