All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
QCMSMeshReader.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "ChunkedFileFormat.h"
6 #include "Resources.h"
7 #include "Rendering.h"
8 #include "Types.h"
9 #include "BinaryParsing.h"
10 
11 #include <vector>
12 #include <iostream>
13 
14 
15 namespace Eegeo
16 {
17  namespace IO
18  {
19  namespace ChunkedFileFormat
20  {
21  namespace QuantizedMeshSetChunkReader
22  {
24  {
25  public:
26  QCMSMeshReader(const int schemaVersion,
27  const LookUpTableInfo& lookUpTableInfo,
29  );
30 
31  void Read(std::istream& stream,
34  const Rendering::VertexLayouts::VertexLayout& vertexLayout,
35  QCMSReaderContext& readerContext) const;
36 
37  void ReadWithPositionTriListIndices(std::istream& stream,
40  const Rendering::VertexLayouts::VertexLayout& vertexLayout,
41  QCMSReaderContext& readerContext) const;
42 
43  private:
44  void ReadMesh(
45  std::istream& stream,
48  const Rendering::VertexLayouts::VertexLayout& vertexLayout,
49  std::vector<u16>::iterator scratchVertexPositionIndicesStart,
50  std::vector<u16>::iterator scratchVertexPositionIndicesEnd,
51  u16* destVertexBufferStart,
52  const u16* destVertexBufferEnd,
53  std::vector<u16>::iterator destTriListIndicesStart,
54  std::vector<u16>::iterator destTriListIndicesEnd,
55  std::vector<u16>::iterator destPositionTriListIndicesStart,
56  std::vector<u16>::iterator destPositionTriListIndicesEnd) const;
57 
58  const int m_schemaVersion;
59  const LookUpTableInfo& m_lookUpTableInfo;
61  };
62  }
63  }
64  }
65 }