EmbodiedArticulatedTree.h

00001 // -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*-
00002 /* 
00003  * Copyright (C) 2008 Micha Hersch, EPFL
00004  * RobotCub Consortium, European Commission FP6 Project IST-004370
00005  * email:   micha.hersch@robotcub.org
00006  * website: www.robotcub.org
00007  * Permission is granted to copy, distribute, and/or modify this program
00008  * under the terms of the GNU General Public License, version 2 or any
00009  * later version published by the Free Software Foundation.
00010  *
00011  * A copy of the license can be found at
00012  * http://www.robotcub.org/icub/license/gpl.txt
00013  *
00014  * This program is distributed in the hope that it will be useful, but
00015  * WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
00017  * Public License for more details
00018  */
00019 #ifndef __EMBODIED_ARTICULATED_TREE_H__
00020 #define __EMBODIED_ARTICULATED_TREE_H__
00021 
00022 #include "TreeParser.h"
00023 #include "Shape.h"
00024 #include "KinematicTree.h"
00025 
00026 
00030 class EmbodiedArticulatedTree : public ArticulatedTree
00031 {
00032  protected:
00033   Shape *solid;
00034 
00035  protected:
00036   void RenderBegin();
00037   void RenderEnd();
00038 
00039  public:
00040     EmbodiedArticulatedTree();
00041     EmbodiedArticulatedTree(const pTree tree);
00042     virtual ~EmbodiedArticulatedTree();
00043     void SetShape(Shape *sol);
00044     void UpdateShape();  
00045     Shape *GetShape(){return solid;};
00046     int SetAllShapes(pTree shape_tree);
00050  void Render();
00051   void Highlight(){solid->Highlight();};
00052   virtual void StreamTree(ostream& out)const;
00053 };
00054 
00055 
00056 class EmbodiedKinematicTree : public KinematicTree
00057 {
00058  protected:
00059   EmbodiedArticulatedTree *e_root;
00060   
00061 public:
00062     EmbodiedKinematicTree();
00063     EmbodiedKinematicTree(char *filename1, char *filename2);
00064     void Render(){e_root->Render();};
00065     void UpdateShape(){e_root->UpdateShape();};
00066     int CheckAllCollisions(KinematicTree *update_tree);
00067     static int CollisionDetection(pArticulatedTree_t t1,
00068                                   pArticulatedTree_t t2, void *arg);
00069 };
00070 
00071 
00072 #endif
 All Data Structures Functions Variables

Generated on Wed Sep 22 16:51:25 2010 for Body_Schema_Learning by  doxygen 1.6.1