ConvertDyna.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (c) 2007                                                    *
00003  *   Joachim Zettler <Joachim.Zettler@gmx.de>                              *
00004  *                                                                         *
00005  *   This file is part of the FreeCAD CAx development system.              *
00006  *                                                                         *
00007  *   This library is free software; you can redistribute it and/or         *
00008  *   modify it under the terms of the GNU Library General Public           *
00009  *   License as published by the Free Software Foundation; either          *
00010  *   version 2 of the License, or (at your option) any later version.      *
00011  *                                                                         *
00012  *   This library  is distributed in the hope that it will be useful,      *
00013  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00014  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00015  *   GNU Library General Public License for more details.                  *
00016  *                                                                         *
00017  *   You should have received a copy of the GNU Library General Public     *
00018  *   License along with this library; see the file COPYING.LIB. If not,    *
00019  *   write to the Free Software Foundation, Inc., 59 Temple Place,         *
00020  *   Suite 330, Boston, MA  02111-1307, USA                                *
00021  *                                                                         *
00022  ***************************************************************************/
00023 
00024 /******CONVERTDYNA.H******/
00025 #ifndef CONVERTDYNA_H
00026 #define CONVERTDYNA_H
00027 
00028 /******MAIN INCLUDES******/
00029 #include <fstream>
00030 #include <vector>
00031 #include <map>
00032 #include <string>
00033 
00034 /******MESH INCLUDES******/
00035 #include <Mod/Mesh/App/Core/MeshKernel.h>
00036 #include <Mod/Mesh/App/Core/Builder.h>
00037 #include <Mod/Mesh/App/Core/TopoAlgorithm.h>
00038 #include <Mod/Mesh/App/Core/Iterator.h>
00039 #include <Mod/Mesh/App/MeshPy.h>
00040 #include <Mod/Mesh/App/Mesh.h>
00041 
00042 /******STRUCTS******/
00043 //This structure will be used internally in this routine without any affects of outside variable
00044 typedef struct
00045 {
00046     unsigned int PointIndex;
00047     std::vector<double> Coords;
00048     bool Constrained;       //Another pair of points constraining this point...?
00049     bool Constrain;        //This point constraining another point...?
00050     std::vector<unsigned int> ConstrainedBy;
00051     std::vector<unsigned int> Constraining;
00052     std::vector<unsigned int> FacetRef;
00053 
00054 }VERTICES;   
00056 typedef struct
00057 {
00058     unsigned int FaceIndex;
00059     std::vector<unsigned int> PointIndex;
00060 
00061 }FACE; 
00065 typedef struct
00066 {
00067     std::vector<unsigned int> PointIndex;
00068 }STLINDEX;  
00087 class ReadDyna
00088 {
00089 public:
00090     ReadDyna(MeshCore::MeshKernel &m,const char* &inputname);
00091 protected:
00092     void ReadNode(std::ifstream &inputfile);
00093     void ReadConstraints(std::ifstream &inputfile);
00094     void ReadShellThickness(std::ifstream &inputfile);
00095     void Convert();
00096     void PutInMesh(MeshCore::MeshKernel &mesh);
00097 private:
00098     std::map<unsigned int, VERTICES> Pointlist;
00099     std::map<unsigned int, FACE> Facelist;
00100     std::vector<STLINDEX> Stllist;
00101 
00102 };
00103 #endif  /*CONVERTDYNA_H DEFINED*/
00104 

Generated on Wed Nov 23 19:00:04 2011 for FreeCAD by  doxygen 1.6.1