ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
WriterImpl.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010 Stan Coleby (scoleby@intelisum.com)
3  * Copyright (c) 2020 PTC Inc.
4  *
5  * Permission is hereby granted, free of charge, to any person or organization
6  * obtaining a copy of the software and accompanying documentation covered by
7  * this license (the "Software") to use, reproduce, display, distribute,
8  * execute, and transmit the Software, and to prepare derivative works of the
9  * Software, and to permit third-parties to whom the Software is furnished to
10  * do so, all subject to the following:
11  *
12  * The copyright notices in the Software and this entire statement, including
13  * the above license grant, this restriction and the following disclaimer,
14  * must be included in all copies of the Software, in whole or in part, and
15  * all derivative works of the Software, unless such copies or derivative
16  * works are solely in the form of machine-executable object code generated by
17  * a source language processor.
18  *
19  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21  * FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
22  * SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
23  * FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
24  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25  * DEALINGS IN THE SOFTWARE.
26  */
27 
28 #pragma once
29 
30 #include "E57SimpleData.h"
31 
32 namespace e57
33 {
34 
36  class WriterImpl
37  {
38  public:
39  WriterImpl( const ustring &filePath, const ustring &coordinateMetaData );
40 
41  ~WriterImpl();
42 
43  bool IsOpen() const;
44 
45  bool Close();
46 
47  int64_t NewImage2D( Image2D &image2DHeader );
48 
49  int64_t WriteImage2DData( int64_t imageIndex, Image2DType imageType, Image2DProjection imageProjection,
50  void *pBuffer, int64_t start, int64_t count );
51 
52  int64_t NewData3D( Data3D &data3DHeader );
53 
54  template <typename COORDTYPE>
55  CompressedVectorWriter SetUpData3DPointsData( int64_t dataIndex, size_t pointCount,
56  const Data3DPointsData_t<COORDTYPE> &buffers );
57 
58  bool WriteData3DGroupsData( int64_t dataIndex, int64_t groupCount, int64_t *idElementValue,
59  int64_t *startPointIndex, int64_t *pointCount );
60 
62 
64 
66 
68 
69  private:
70  ImageFile imf_;
71  StructureNode root_;
72 
73  VectorNode data3D_;
74 
75  VectorNode images2D_;
76 
83  int64_t WriteImage2DNode( StructureNode image, Image2DType imageType, void *pBuffer, int64_t start,
84  int64_t count );
85  }; // end Writer class
86 
87 } // end namespace e57
Data structures for E57 Simple API.
std::shared_ptr< core::Tensor > image
int count
most of the functions follows Writer
Definition: WriterImpl.h:37
ImageFile GetRawIMF()
Definition: WriterImpl.cpp:120
CompressedVectorWriter SetUpData3DPointsData(int64_t dataIndex, size_t pointCount, const Data3DPointsData_t< COORDTYPE > &buffers)
Definition: WriterImpl.cpp:945
int64_t NewData3D(Data3D &data3DHeader)
Definition: WriterImpl.cpp:416
VectorNode GetRawData3D()
Definition: WriterImpl.cpp:110
bool IsOpen() const
Definition: WriterImpl.cpp:89
bool WriteData3DGroupsData(int64_t dataIndex, int64_t groupCount, int64_t *idElementValue, int64_t *startPointIndex, int64_t *pointCount)
int64_t NewImage2D(Image2D &image2DHeader)
Definition: WriterImpl.cpp:125
int64_t WriteImage2DData(int64_t imageIndex, Image2DType imageType, Image2DProjection imageProjection, void *pBuffer, int64_t start, int64_t count)
Definition: WriterImpl.cpp:369
VectorNode GetRawImages2D()
Definition: WriterImpl.cpp:115
WriterImpl(const ustring &filePath, const ustring &coordinateMetaData)
Definition: WriterImpl.cpp:36
StructureNode GetRawE57Root()
Definition: WriterImpl.cpp:105
Image2DProjection
Identifies the representation for the image data.
Image2DType
Identifies the format representation for the image data.
std::string ustring
UTF-8 encodeded Unicode string.
Definition: E57Format.h:54
Stores pointers to user-provided buffers.
Stores the top-level information for a single lidar scan.
Stores an image from a camera.