- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- File List
- File Members

# Core/IO/exporter/BaseExporter.hh

    00001 /*===========================================================================*\
    00002  *                                                                           *
    00003  *                               OpenMesh                                    *
    00004  *      Copyright (C) 2001-2005 by Computer Graphics Group, RWTH Aachen      *
    00005  *                           www.openmesh.org                                *
    00006  *                                                                           *
    00007  *---------------------------------------------------------------------------*
    00008  *                                                                           *
    00009  *                                License                                    *
    00010  *                                                                           *
    00011  *  This library is free software; you can redistribute it and/or modify it  *
    00012  *  under the terms of the GNU Library General Public License as published   *
    00013  *  by the Free Software Foundation, version 2.                              *
    00014  *                                                                           *
    00015  *  This library is distributed in the hope that it will be useful, but      *
    00016  *  WITHOUT ANY WARRANTY; without even the implied warranty of               *
    00017  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU        *
    00018  *  Library General Public License for more details.                         *
    00019  *                                                                           *
    00020  *  You should have received a copy of the GNU Library General Public        *
    00021  *  License along with this library; if not, write to the Free Software      *
    00022  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                *
    00023  *                                                                           *
    00024 \*===========================================================================*/
    00025
    00026
    00027 //=============================================================================
    00028 //
    00029 //  Implements the baseclass for MeshWriter exporter modules
    00030 //
    00031 //=============================================================================
    00032
    00033
    00034 #ifndef __BASEEXPORTER_HH__
    00035 #define __BASEEXPORTER_HH__
    00036
    00037
    00038 //=== INCLUDES ================================================================
    00039
    00040
    00041 // STL
    00042 #include <vector>
    00043
    00044 // OpenMesh
    00045 #include <OpenMesh/Core/System/config.hh>
    00046 #include <OpenMesh/Core/Math/VectorT.hh>
    00047 #include <OpenMesh/Core/Mesh/Kernels/Common/BaseKernel.hh>
    00048
    00049
    00050 //=== NAMESPACES ==============================================================
    00051
    00052
    00053 namespace OpenMesh {
    00054 namespace IO {
    00055
    00056
    00057 //=== EXPORTER ================================================================
    00058
    00059
    00066 class BaseExporter
    00067 {
    00068 public:
    00069
    00070   virtual ~BaseExporter() { }
    00071
    00072
    00073   // get vertex data
    00074   virtual Vec3f  point(VertexHandle _vh)    const = 0;
    00075   virtual Vec3f  normal(VertexHandle _vh)   const = 0;
    00076   virtual Vec3uc color(VertexHandle _vh)    const = 0;
    00077   virtual Vec2f  texcoord(VertexHandle _vh) const = 0;
    00078
    00079
    00080   // get face data
    00081   virtual unsigned int
    00082   get_vhandles(FaceHandle _fh,
    00083                std::vector<VertexHandle>& _vhandles) const=0;
    00084   virtual Vec3f  normal(FaceHandle _fh)     const = 0;
    00085   virtual Vec3uc color(FaceHandle _fh)      const = 0;
    00086
    00087
    00088   // get reference to base kernel
    00089   virtual const BaseKernel* kernel() { return 0; }
    00090
    00091
    00092   // query number of faces, vertices, normals, texcoords
    00093   virtual size_t n_vertices()   const = 0;
    00094   virtual size_t n_faces()      const = 0;
    00095   virtual size_t n_edges()      const = 0;
    00096
    00097
    00098   // property information
    00099   virtual bool is_triangle_mesh()     const { return false; }
    00100   virtual bool has_vertex_normals()   const { return false; }
    00101   virtual bool has_vertex_colors()    const { return false; }
    00102   virtual bool has_vertex_texcoords() const { return false; }
    00103   virtual bool has_face_normals()     const { return false; }
    00104   virtual bool has_face_colors()      const { return false; }
    00105 };
    00106
    00107
    00108 //=============================================================================
    00109 } // namespace IO
    00110 } // namespace OpenMesh
    00111 //=============================================================================
    00112 #endif
    00113 //=============================================================================