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

Method ReadData3DGroupsData

plugins/e57/libE57Format/src/ReaderImpl.cpp:1500–1560  ·  view source on GitHub ↗

Reads the group data

Source from the content-addressed store, hash-verified

1498
1499 // Reads the group data
1500 bool ReaderImpl::ReadData3DGroupsData( int64_t dataIndex, size_t groupCount,
1501 int64_t *idElementValue, int64_t *startPointIndex,
1502 int64_t *pointCount ) const
1503 {
1504 if ( ( dataIndex < 0 ) || ( dataIndex >= data3D_.childCount() ) )
1505 {
1506 return false;
1507 }
1508
1509 const StructureNode scan( data3D_.get( dataIndex ) );
1510
1511 if ( !scan.isDefined( "pointGroupingSchemes" ) )
1512 {
1513 return false;
1514 }
1515
1516 const StructureNode pointGroupingSchemes( scan.get( "pointGroupingSchemes" ) );
1517
1518 if ( !pointGroupingSchemes.isDefined( "groupingByLine" ) )
1519 {
1520 return false;
1521 }
1522
1523 const StructureNode groupingByLine( pointGroupingSchemes.get( "groupingByLine" ) );
1524 const StringNode idElementName( groupingByLine.get( "idElementName" ) );
1525 CompressedVectorNode groups( groupingByLine.get( "groups" ) );
1526 const StructureNode lineGroupRecord( groups.prototype() );
1527 const int64_t protoCount = lineGroupRecord.childCount();
1528 std::vector<SourceDestBuffer> groupSDBuffers;
1529
1530 for ( int64_t protoIndex = 0; protoIndex < protoCount; protoIndex++ )
1531 {
1532 const ustring name = lineGroupRecord.get( protoIndex ).elementName();
1533
1534 if ( ( name == "idElementValue" ) && lineGroupRecord.isDefined( "idElementValue" ) &&
1535 ( idElementValue != nullptr ) )
1536 {
1537 groupSDBuffers.emplace_back( imf_, "idElementValue", idElementValue, groupCount, true );
1538 }
1539
1540 if ( ( name == "startPointIndex" ) && lineGroupRecord.isDefined( "startPointIndex" ) &&
1541 ( startPointIndex != nullptr ) )
1542 {
1543 groupSDBuffers.emplace_back( imf_, "startPointIndex", startPointIndex, groupCount,
1544 true );
1545 }
1546
1547 if ( ( name == "pointCount" ) && lineGroupRecord.isDefined( "pointCount" ) &&
1548 ( pointCount != nullptr ) )
1549 {
1550 groupSDBuffers.emplace_back( imf_, "pointCount", pointCount, groupCount, true );
1551 }
1552 }
1553
1554 CompressedVectorReader reader = groups.reader( groupSDBuffers );
1555
1556 reader.read();
1557 reader.close();

Callers

nothing calls this directly

Calls 8

prototypeMethod · 0.80
childCountMethod · 0.45
getMethod · 0.45
isDefinedMethod · 0.45
elementNameMethod · 0.45
readerMethod · 0.45
readMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected