+ handling of organized point cloud

This commit is contained in:
wmayer
2016-02-20 22:19:47 +01:00
parent 60e0c447ca
commit 7bdecf9b38
9 changed files with 159 additions and 5 deletions

View File

@@ -104,8 +104,28 @@ private:
reader->read(EncodedName);
App::Document *pcDoc = App::GetApplication().newDocument("Unnamed");
Points::Feature *pcFeature = 0;
if (reader->hasProperties()) {
Points::FeatureCustom *pcFeature = new Points::FeatureCustom();
// is organized in a grid structure?
if (reader->isOrganized()) {
pcFeature = new Points::OrganizedCustom();
App::PropertyInteger* width = static_cast<App::PropertyInteger*>
(pcFeature->getPropertyByName("Width"));
if (width) {
width->setValue(reader->getWidth());
}
App::PropertyInteger* height = static_cast<App::PropertyInteger*>
(pcFeature->getPropertyByName("Height"));
if (height) {
height->setValue(reader->getHeight());
}
}
else {
pcFeature = new Points::FeatureCustom();
}
pcFeature->Points.setValue(reader->getPoints());
// add gray values
if (reader->hasIntensities()) {
@@ -190,8 +210,27 @@ private:
pcDoc = App::GetApplication().newDocument(DocName);
}
Points::Feature *pcFeature = 0;
if (reader->hasProperties()) {
Points::FeatureCustom *pcFeature = new Points::FeatureCustom();
// is organized in a grid structure?
if (reader->isOrganized()) {
pcFeature = new Points::OrganizedCustom();
App::PropertyInteger* width = static_cast<App::PropertyInteger*>
(pcFeature->getPropertyByName("Width"));
if (width) {
width->setValue(reader->getWidth());
}
App::PropertyInteger* height = static_cast<App::PropertyInteger*>
(pcFeature->getPropertyByName("Height"));
if (height) {
height->setValue(reader->getHeight());
}
}
else {
pcFeature = new Points::FeatureCustom();
}
pcFeature->Points.setValue(reader->getPoints());
// add gray values
if (reader->hasIntensities()) {