ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
E57SimpleWriter.cpp
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 #include "E57SimpleWriter.h"
29 #include "WriterImpl.h"
30 
31 namespace e57
32 {
33 
34  Writer::Writer( const ustring &filePath, const ustring &coordinateMetaData ) :
35  impl_( new WriterImpl( filePath, coordinateMetaData ) )
36  {
37  }
38 
39  bool Writer::IsOpen() const
40  {
41  return impl_->IsOpen();
42  };
43 
45  {
46  return impl_->Close();
47  };
48 
50  {
51  return impl_->GetRawIMF();
52  }
53 
55  {
56  return impl_->GetRawE57Root();
57  };
58 
60  {
61  return impl_->GetRawData3D();
62  };
63 
65  {
66  return impl_->GetRawImages2D();
67  };
68 
69  int64_t Writer::NewImage2D( Image2D &image2DHeader )
70  {
71  return impl_->NewImage2D( image2DHeader );
72  };
73 
74  int64_t Writer::WriteImage2DData( int64_t imageIndex, Image2DType imageType, Image2DProjection imageProjection,
75  void *pBuffer, int64_t start, int64_t count )
76  {
77  return impl_->WriteImage2DData( imageIndex, imageType, imageProjection, pBuffer, start, count );
78  };
79 
80  int64_t Writer::NewData3D( Data3D &data3DHeader )
81  {
82  return impl_->NewData3D( data3DHeader );
83  };
84 
85  CompressedVectorWriter Writer::SetUpData3DPointsData( int64_t dataIndex, size_t pointCount,
86  const Data3DPointsData &buffers )
87  {
88  return impl_->SetUpData3DPointsData( dataIndex, pointCount, buffers );
89  }
90 
91  CompressedVectorWriter Writer::SetUpData3DPointsData( int64_t dataIndex, size_t pointCount,
92  const Data3DPointsData_d &buffers )
93  {
94  return impl_->SetUpData3DPointsData( dataIndex, pointCount, buffers );
95  }
96 
97  bool Writer::WriteData3DGroupsData( int64_t dataIndex, int64_t groupCount, int64_t *idElementValue,
98  int64_t *startPointIndex, int64_t *pointCount )
99  {
100  return impl_->WriteData3DGroupsData( dataIndex, groupCount, idElementValue, startPointIndex, pointCount );
101  }
102 
103 } // end namespace e57
E57 Simple API for writing E57.
int count
most of the functions follows Writer
Definition: WriterImpl.h:37
VectorNode GetRawImages2D()
This function returns the raw Image2D Vector Node.
Writer(const ustring &filePath, const ustring &coordinateMetaData={})
This function is the constructor for the writer class.
bool WriteData3DGroupsData(int64_t dataIndex, int64_t groupCount, int64_t *idElementValue, int64_t *startPointIndex, int64_t *pointCount)
This function writes out the group data.
VectorNode GetRawData3D()
This function returns the raw Data3D Vector Node.
int64_t NewImage2D(Image2D &image2DHeader)
This function writes a new Image2D header.
bool IsOpen() const
This function returns true if the file is open.
int64_t WriteImage2DData(int64_t imageIndex, Image2DType imageType, Image2DProjection imageProjection, void *buffer, int64_t start, int64_t count)
This function writes the actual image data.
CompressedVectorWriter SetUpData3DPointsData(int64_t dataIndex, size_t pointCount, const Data3DPointsData &buffers)
This function setups a writer to write the actual scan data.
int64_t NewData3D(Data3D &data3DHeader)
This function writes new Data3D header.
bool Close()
This function closes the file.
StructureNode GetRawE57Root()
This function returns the file raw E57Root Structure Node.
ImageFile GetRawIMF()
This function returns the ram ImageFile Node which is need to add enhancements.
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.