gwnavruntime/utils/objfilewriter.h Source File

objfilewriter.h
Go to the documentation of this file.
1 /*
2 * Copyright 2016 Autodesk, Inc. All rights reserved.
3 * Use of this software is subject to the terms of the Autodesk license agreement and any attachments or Appendices thereto provided at the time of installation or download,
4 * or which otherwise accompanies this software in either electronic or hard copy form, or which is signed by you and accepted by Autodesk.
5 */
6 
7 #pragma once
8 
11 
12 namespace Kaim
13 {
14 
15 class VisualGeometryPrimitiveCounts;
16 
17 // construct a .obj file
18 class ObjFileWriter
19 {
20 public:
21  ObjFileWriter(File* file) : m_file(file) , m_vertexCount(0) {}
22 
23  ~ObjFileWriter() {}
24 
25  void PushTriangle(const Vec3f& clientA, const Vec3f& clientB, const Vec3f& clientC);
26 
27  File* m_file;
28  KyUInt32 m_vertexCount;
29 };
30 
31 
32 // Writes only triangles. Used in LabCore::WriteCurrentDatabaseInObjFile()
33 class ObjFileWriterVisualGeometry : public IVisualGeometry
34 {
35 public:
36  ObjFileWriterVisualGeometry(File* file) : m_objFileWriter(file) {}
37 
38 public:
39  virtual void DoBegin(const VisualGeometryPrimitiveCounts&) {}
40 
41  virtual void DoEnd() {}
42 
43  virtual void DoPushTriangle(const VisualTriangle& triangle)
44  {
45  m_objFileWriter.PushTriangle(triangle.A,triangle.B, triangle.C);
46  }
47 
48 public:
49  ObjFileWriter m_objFileWriter;
50 };
51 
52 
53 
54 } // namespace LabEngine
55 
std::uint32_t KyUInt32
uint32_t
Definition: types.h:29
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17