PovTools.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (c) Jürgen Riegel          (juergen.riegel@web.de) 2005     *
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 _PovTools_h_
00025 #define _PovTools_h_
00026 
00027 #include <gp_Vec.hxx>
00028 #include <vector>
00029 
00030 class TopoDS_Shape;
00031 class TopoDS_Face;
00032 
00033 namespace Data { class ComplexGeoData; }
00034 
00035 namespace Raytracing
00036 {
00037 
00039 class CamDef
00040 {
00041 public:
00042     CamDef(const gp_Vec& cCamPos,
00043            const gp_Vec& cCamDir,
00044            const gp_Vec& cLookAt,
00045            const gp_Vec& cUp)
00046             :
00047             CamPos(cCamPos),
00048             CamDir(cCamDir),
00049             LookAt(cLookAt),
00050             Up(cUp)
00051     {}
00052 
00053     CamDef(const CamDef& copyMe) {
00054         this->operator=(copyMe);
00055     }
00056 
00057     const CamDef& operator=(const CamDef& copyMe)
00058     {
00059         CamPos = copyMe.CamPos;
00060         CamDir = copyMe.CamDir;
00061         LookAt = copyMe.LookAt;
00062         Up     = copyMe.Up;
00063 
00064         return *this;
00065     }
00066 
00067     gp_Vec CamPos;
00068     gp_Vec CamDir;
00069     gp_Vec LookAt;
00070     gp_Vec Up;
00071 };
00072 
00073 
00074 class AppRaytracingExport PovTools
00075 {
00076 public:
00078     static std::string getCamera(const CamDef& Cam);
00079 
00081     static void writeCamera(const char*   FileName,
00082                             const CamDef& Cam);
00083 
00085     static void writeCameraVec(const char*                FileName,
00086                                const std::vector<CamDef>& CamVec);
00087 
00089     static void writeData(const char *FileName,
00090                           const char *PartName,
00091                           const Data::ComplexGeoData*,
00092                           float fMeshDeviation=0.1);
00093 
00095     static void writeShape(const char *FileName,
00096                            const char *PartName,
00097                            const TopoDS_Shape& Shape,
00098                            float fMeshDeviation=0.1);
00099 
00101     static void writeShape(std::ostream &out,
00102                            const char *PartName,
00103                            const TopoDS_Shape& Shape,
00104                            float fMeshDeviation=0.1);
00105 
00107     static void writeShapeCSV(const char *FileName,
00108                               const TopoDS_Shape& Shape,
00109                               float fMeshDeviation,
00110                               float fLength);
00111 
00112 
00113     static void transferToArray(const TopoDS_Face& aFace,gp_Vec** vertices,gp_Vec** vertexnormals, long** cons,int &nbNodesInFace,int &nbTriInFace );
00114 };
00115 
00116 
00117 } // namespace Raytracing
00118 
00119 #endif // _PovTools_h_

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