MeshAlgos.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (c) Juergen Riegel         <juergen.riegel@web.de>          *
00003  *                                                                         *
00004  *   This file is part of the FreeCAD CAx development system.              *
00005  *                                                                         *
00006  *   This library is free software; you can redistribute it and/or         *
00007  *   modify it under the terms of the GNU Library General Public           *
00008  *   License as published by the Free Software Foundation; either          *
00009  *   version 2 of the License, or (at your option) any later version.      *
00010  *                                                                         *
00011  *   This library  is distributed in the hope that it will be useful,      *
00012  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00014  *   GNU Library General Public License for more details.                  *
00015  *                                                                         *
00016  *   You should have received a copy of the GNU Library General Public     *
00017  *   License along with this library; see the file COPYING.LIB. If not,    *
00018  *   write to the Free Software Foundation, Inc., 59 Temple Place,         *
00019  *   Suite 330, Boston, MA  02111-1307, USA                                *
00020  *                                                                         *
00021  ***************************************************************************/
00022 
00023 
00024 #ifndef _MeshAlgos_h_
00025 #define _MeshAlgos_h_
00026 
00027 #ifdef FC_USE_GTS
00028 #  include <gts.h>
00029 #endif
00030 
00031 #include <vector>
00032 
00033 #include <Base/Vector3D.h>
00034 
00035 #include "CurveProjector.h"
00036 
00037 class TopoDS_Edge;
00038 class TopoDS_Shape;
00039 
00040 namespace MeshCore
00041 {
00042 class MeshKernel;
00043 };
00044 
00045 using MeshCore::MeshKernel;
00046 
00047 namespace MeshPart
00048 {
00049 
00052 class MeshPartExport MeshAlgos
00053 {
00054 public:
00057   static void offset(MeshCore::MeshKernel* Mesh, float fSize);
00058   static void offsetSpecial2(MeshCore::MeshKernel* Mesh, float fSize);
00059   static void offsetSpecial(MeshCore::MeshKernel* Mesh, float fSize, float zmax, float zmin);
00060 
00063   static void coarsen(MeshCore::MeshKernel* Mesh, float f);
00064 
00068   static MeshCore::MeshKernel* boolean(MeshCore::MeshKernel* Mesh1, MeshCore::MeshKernel* Mesh2, MeshCore::MeshKernel* pResult, int Type=0);
00069 
00070 #ifdef FC_USE_GTS
00071 
00074   static GtsSurface* createGTSSurface(MeshCore::MeshKernel* Mesh);
00075 
00079   static void fillMeshFromGTSSurface(MeshCore::MeshKernel* pMesh, GtsSurface* pSurface);
00080 #endif
00081 
00082   static void cutByShape(const TopoDS_Shape &aShape,const MeshCore::MeshKernel* pMesh,MeshCore::MeshKernel* pToolMesh);
00083 
00085   static void GetSampledCurves( const TopoDS_Edge& aEdge, std::vector<Base::Vector3f>& rclPoints, unsigned long ulNbOfPoints = 30);
00086 
00088   static void LoftOnCurve(MeshCore::MeshKernel &ResultMesh,const TopoDS_Shape &Shape, const std::vector<Base::Vector3f> &poly,
00089                           const Base::Vector3f & up = Base::Vector3f(0,0,1),  float MaxSize = 0.1);
00090 
00091   /*
00092   struct FaceSplitEdge
00093   {
00094     unsigned long ulFaceIndex;
00095     Base::Vector3f p1,p2;
00096   };
00097 
00098   static void projectCurve( MeshWithProperty* pMesh,
00099                                        const TopoDS_Edge& aEdge,
00100                                        const std::vector<Base::Vector3f> &rclPoints,
00101                                        std::vector<FaceSplitEdge> &vSplitEdges);
00102 */
00103   static void cutByCurve(MeshCore::MeshKernel* pMesh,const std::vector<CurveProjector::FaceSplitEdge> &vSplitEdges);
00104 /*
00105   static bool projectPointToMesh(MeshKernel &MeshK,const Base::Vector3f &Pnt,Base::Vector3f &Rslt,unsigned long &FaceIndex);
00106 */
00107 
00108 };
00109 
00110 } // namespace MeshPart
00111 
00112 #endif 

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