Skip to content

Commit 4767a56

Browse files
author
gaoxing
committed
handle offset with a new slot
1 parent 6b11d4e commit 4767a56

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

src/core/include/core.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,6 @@ namespace seed
4545

4646
bool Generate3mxMetadata(const std::string& output);
4747

48-
bool Generate3mx(const std::string& srs, osg::Vec3d srsOrigin, const std::string& outputDataRootRelative, const std::string& output);
48+
bool Generate3mx(const std::string& srs, osg::Vec3d srsOrigin, osg::Vec3d offset, const std::string& outputDataRootRelative, const std::string& output);
4949
}
5050
}

src/core/src/core.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ namespace seed
374374
return true;
375375
}
376376

377-
bool Generate3mx(const std::string& srs, osg::Vec3d srsOrigin, const std::string& outputDataRootRelative, const std::string& output)
377+
bool Generate3mx(const std::string& srs, osg::Vec3d srsOrigin, osg::Vec3d offset, const std::string& outputDataRootRelative, const std::string& output)
378378
{
379379
neb::CJsonObject oJson;
380380
oJson.Add("3mxVersion", 1);
@@ -397,6 +397,10 @@ namespace seed
397397
oJsonLayer["SRSOrigin"].Add(srsOrigin.x());
398398
oJsonLayer["SRSOrigin"].Add(srsOrigin.y());
399399
oJsonLayer["SRSOrigin"].Add(srsOrigin.z());
400+
oJsonLayer.AddEmptySubArray("offset");
401+
oJsonLayer["offset"].Add(offset.x());
402+
oJsonLayer["offset"].Add(offset.y());
403+
oJsonLayer["offset"].Add(offset.z());
400404
oJsonLayer.Add("root", outputDataRootRelative);
401405
oJson.AddEmptySubArray("layers");
402406
oJson["layers"].Add(oJsonLayer);

src/osgbTo3mx/osgTo3mx.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ namespace seed
121121
{
122122
seed::log::DumpLog(seed::log::Warning, "Can NOT open file %s!", input.c_str());
123123
}
124-
return Generate3mx(srs, srsOrigin, outputDataRootRelative, output);
124+
return Generate3mx(srs, srsOrigin, osg::Vec3d(0, 0, 0), outputDataRootRelative, output);
125125
}
126126

127127
bool OsgTo3mx::ConvertTile(const std::string& inputData, const std::string& outputData, const std::string& tileName, osg::BoundingBox& bb)

src/pointcloudToLod/pointcloudToLod.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ namespace seed
197197
return false;
198198
}
199199

200-
if (!Generate3mx(m_oPointVisitor->GetSRSName(), m_oPointVisitor->GetOffset(), outputDataRootRelative, output3mx))
200+
if (!Generate3mx(m_oPointVisitor->GetSRSName(), osg::Vec3d(0, 0, 0), m_oPointVisitor->GetOffset(), outputDataRootRelative, output3mx))
201201
{
202202
seed::log::DumpLog(seed::log::Critical, "Generate %s failed!", outputMetadata.c_str());
203203
return false;

0 commit comments

Comments
 (0)