Fawkes API
Fawkes Development Version
|
00001 00002 /*************************************************************************** 00003 * openni.cpp - OpenNI aspect for Fawkes 00004 * 00005 * Created: Sat Feb 26 15:36:58 2011 00006 * Copyright 2006-2011 Tim Niemueller [www.niemueller.de] 00007 * 00008 ****************************************************************************/ 00009 00010 /* This program is free software; you can redistribute it and/or modify 00011 * it under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation; either version 2 of the License, or 00013 * (at your option) any later version. A runtime exception applies to 00014 * this software (see LICENSE.GPL_WRE file mentioned below for details). 00015 * 00016 * This program is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 * GNU Library General Public License for more details. 00020 * 00021 * Read the full text in the LICENSE.GPL_WRE file in the doc directory. 00022 */ 00023 00024 #include <plugins/openni/aspect/openni.h> 00025 #include <XnCppWrapper.h> 00026 00027 namespace fawkes { 00028 #if 0 /* just to make Emacs auto-indent happy */ 00029 } 00030 #endif 00031 00032 /** @class OpenNiAspect <plugins/openni/aspect/openni.h> 00033 * Thread aspect to get access to the OpenNI context. 00034 * Give this aspect to your thread to interact with the central OpenNI 00035 * context. Use this as a last resort, first check if the desired information 00036 * is available via the blackboard (e.g. user skeleton data) or via 00037 * FireVision (camera images). 00038 * 00039 * @ingroup Aspects 00040 * @author Tim Niemueller 00041 */ 00042 00043 /** @var fawkes:LockPtr<xn::Context> OpenNiAspect::openni 00044 * Central OpenNI context. Make sure you use proper locking in your application 00045 * when using the class, or chaos and havoc will come upon you. 00046 */ 00047 00048 /** Constructor. */ 00049 OpenNiAspect::OpenNiAspect() 00050 { 00051 add_aspect("OpenNiAspect"); 00052 } 00053 00054 00055 /** Virtual empty destructor. */ 00056 OpenNiAspect::~OpenNiAspect() 00057 { 00058 } 00059 00060 00061 /** Init OpenNI aspect. 00062 * This set the OpenNI context. 00063 * It is guaranteed that this is called for an OpenNI Thread before start 00064 * is called (when running regularly inside Fawkes). 00065 * @param openni_context OpenNI context to use 00066 */ 00067 void 00068 OpenNiAspect::init_OpenNiAspect(LockPtr<xn::Context> openni_context) 00069 { 00070 this->openni = openni_context; 00071 } 00072 00073 } // end namespace fawkes