AnimaL |
Tutorial |
Documentation |
00001 /*************************************************************************** 00002 octree_instanciation.h - description 00003 ------------------- 00004 begin : Wed Mar 24 2004 00005 copyright : (C) 2004 by Mathieu Coquerelle 00006 email : mathieu.coquerelle@imag.fr 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 #ifndef _OCTREE_INSTANCIATION_H 00019 #define _OCTREE_INSTANCIATION_H 00020 00021 #include <deque> 00022 #include <vector> 00023 #include <map> 00024 00025 #include <X3DTK/X3D/scenegraph.h> 00026 #include "fastoctreedeformableconstrained.h" 00027 #include "global.h" 00028 #include "assertions.h" 00029 #include "CellData.h" 00030 00031 #include <animal/array.h> 00032 #include <animal/vec3.h> 00033 #include <animal/vectorVec.h> 00034 #include <animal/matrix.h> 00035 #include <animal/linear.h> 00036 00037 namespace animal 00038 { 00039 namespace octree 00040 { 00041 00042 00043 class ConstrainedVertex; 00044 class SFVec3fCellConstrained; 00045 00046 typedef ConstrainedVertex OctreeVertex; 00047 // typedef std::deque<SFVec3fCellConstrained*> OctreeDataPoints; 00048 00049 // typedef struct 00050 // { 00051 // std::vector< std::map<ConstrainedVertex*,Vec3d> > influenceMaps; 00052 // std::vector<ConstrainedVertex*> vertices; 00053 // std::vector<unsigned short> verticesId; 00054 // std::vector<void*> parents; // Will be Cell* 00055 // std::vector<Vec3d> firstCellVertexParameters; // the parameters of the first vertex in the parent cell 00056 // } 00057 // CellInfluenceData; 00058 00059 00060 /*typedef struct 00061 { 00062 OctreeDataPoints _points; 00063 int _info1; 00064 unsigned int _depth; 00065 Vec3d _initialSize; 00066 CellInfluenceData _influence; 00067 }*/ 00068 typedef CellData OctreeData; 00069 00070 enum { DATA_INSIDE, DATA_OUTSIDE, DATA_MIXED }; 00071 00072 typedef struct 00073 { 00074 // This is to be used only temporarily !! 00075 int _tempData; 00076 } 00077 ConstrainedVertexData; 00078 00079 00080 00081 00082 typedef FastOctree<OctreeVertex,OctreeData,Vec3d> TempOctree; 00083 typedef TempOctree::Cell Cell; 00084 00085 00086 00087 00088 00089 00090 00091 00092 static std::ostream& operator<<(std::ostream& s, const TempOctree::Cell& cell) 00093 { 00094 if( cell.isRoot() ) 00095 { 00096 s << "root->"; 00097 } 00098 else 00099 { 00100 s << *(cell.father()) << cell.fatherPos() << "->"; 00101 } 00102 return s; 00103 } 00104 00105 00106 } 00107 00108 } 00109 00110 #endif 00111 00112