OpenStructure
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
exporter.hh
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 // This file is part of the OpenStructure project <www.openstructure.org>
3 //
4 // Copyright (C) 2008-2011 by the OpenStructure authors
5 //
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License as published by the Free
8 // Software Foundation; either version 3.0 of the License, or (at your option)
9 // any later version.
10 // This library is distributed in the hope that it will be useful, but WITHOUT
11 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13 // details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with this library; if not, write to the Free Software Foundation, Inc.,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 //------------------------------------------------------------------------------
19 #ifndef OST_GFX_EXPORTER_HH
20 #define OST_GFX_EXPORTER_HH
21 
22 #include <ost/gfx/module_config.hh>
23 
24 namespace ost { namespace gfx {
25 
26 class Scene;
27 
29 {
30 public:
31  enum NodeType {
32  ROOT=1,
33  GROUP=2,
34  OBJ=3
35  };
36 
37  virtual ~Exporter() {}
38  virtual void SceneStart(const Scene* scene) {}
39  virtual void SceneEnd(const Scene* scene) {}
40 
41  virtual void NodeStart(const std::string& name, NodeType t) {}
42  virtual void NodeEnd(const std::string& name) {}
43 
44  // this indicates beginning of new data, including a reset of the indices
45  // may occur more than once for a given node
46  virtual void WriteVertexData(const float* v, const float* n, const float* c, const float* t,
47  size_t stride, size_t count) {}
48  virtual void WritePointData(const unsigned int* i, size_t count) {}
49  virtual void WriteLineData(const unsigned int* ij, size_t count) {}
50  virtual void WriteTriData(const unsigned int* ijk, size_t count) {}
51  virtual void WriteQuadData(const unsigned int* ijkl, size_t count) {}
52 };
53 
54 }} // ns
55 
56 #endif