MCPcopy Create free account
hub / github.com/PDAL/PDAL / WriterImpl

Method WriterImpl

plugins/e57/libE57Format/src/WriterImpl.cpp:128–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126 }
127
128 WriterImpl::WriterImpl( const ustring &filePath, const WriterOptions &options ) :
129 imf_( filePath, "w" ), root_( imf_.root() ), data3D_( imf_, true ), images2D_( imf_, true )
130 {
131 // We are using the E57 v1.0 data format standard field names.
132 // The standard field names are used without an extension prefix (in the default namespace).
133 // We explicitly register it for completeness (the reference implementation would do it for
134 // us, if we didn't).
135 imf_.extensionsAdd( "", e57::VERSION_1_0_URI );
136
137 // Set per-file properties.
138 // Path names: "/formatName", "/majorVersion", "/minorVersion", "/coordinateMetadata"
139 root_.set( "formatName", StringNode( imf_, "ASTM E57 3D Imaging Data File" ) );
140
141 if ( !options.guid.empty() )
142 {
143 root_.set( "guid", StringNode( imf_, options.guid ) );
144 }
145 else
146 {
147 root_.set( "guid", StringNode( imf_, generateRandomGUID() ) );
148 }
149
150 root_.set( "versionMajor", IntegerNode( imf_, Version::astmMajor() ) );
151 root_.set( "versionMinor", IntegerNode( imf_, Version::astmMinor() ) );
152 root_.set( "e57LibraryVersion", StringNode( imf_, Version::library() ) );
153
154 // Save a dummy string for coordinate system.
155 // Really should be a valid WKT string identifying the coordinate reference system (CRS).
156 if ( !options.coordinateMetadata.empty() )
157 {
158 root_.set( "coordinateMetadata", StringNode( imf_, options.coordinateMetadata ) );
159 }
160
161// Create creationDateTime structure
162// Path name: "/creationDateTime
163// TODO currently no support for handling UTC <-> GPS time conversions
164// note that "creationDateTime" is optional in the standard
165#if 0
166 StructureNode creationDateTime = StructureNode(imf_);
167 creationDateTime.set("dateTimeValue", FloatNode(imf_, GetGPSTime()));
168 creationDateTime.set("isAtomicClockReferenced", IntegerNode(imf_,0));
169 root_.set("creationDateTime", creationDateTime);
170#endif
171
172 root_.set( "data3D", data3D_ );
173 root_.set( "images2D", images2D_ );
174 }
175
176 WriterImpl::~WriterImpl()
177 {

Callers

nothing calls this directly

Calls 9

StringNodeClass · 0.85
generateRandomGUIDFunction · 0.85
IntegerNodeClass · 0.85
StructureNodeClass · 0.85
FloatNodeClass · 0.85
rootMethod · 0.45
extensionsAddMethod · 0.45
setMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected