Skip to content

Commit

Permalink
Don't fail if ignore option is unspecified, just use the input PointView
Browse files Browse the repository at this point in the history
  • Loading branch information
chambbj committed Mar 30, 2017
1 parent e8fb59b commit faba4c4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
10 changes: 4 additions & 6 deletions filters/PMFFilter.cpp
Expand Up @@ -80,11 +80,6 @@ void PMFFilter::prepared(PointTableRef table)
const PointLayoutPtr layout(table.layout());

m_ignored.m_id = layout->findDim(m_ignored.m_name);
if (m_ignored.m_id == Dimension::Id::Unknown)
{
throwError("Invalid dimension name in 'ignore' option: '" +
m_ignored.m_name + "'.");
}

if (m_lastOnly)
{
Expand Down Expand Up @@ -377,7 +372,10 @@ PointViewSet PMFFilter::run(PointViewPtr input)
// Segment input view into ignored/kept views.
PointViewPtr ignoredView = input->makeNew();
PointViewPtr keptView = input->makeNew();
Segmentation::ignoreDimRange(m_ignored, input, keptView, ignoredView);
if (m_ignored.m_id == Dimension::Id::Unknown)
keptView->append(*input);
else
Segmentation::ignoreDimRange(m_ignored, input, keptView, ignoredView);

// Segment kept view into last/other-than-last return views.
PointViewPtr lastView = keptView->makeNew();
Expand Down
10 changes: 4 additions & 6 deletions filters/SMRFilter.cpp
Expand Up @@ -99,11 +99,6 @@ void SMRFilter::prepared(PointTableRef table)
const PointLayoutPtr layout(table.layout());

m_ignored.m_id = layout->findDim(m_ignored.m_name);
if (m_ignored.m_id == Dimension::Id::Unknown)
{
throwError("Invalid dimension name in 'ignore' option: '" +
m_ignored.m_name + "'.");
}

if (m_lastOnly)
{
Expand Down Expand Up @@ -132,7 +127,10 @@ PointViewSet SMRFilter::run(PointViewPtr view)
// Segment input view into ignored/kept views.
PointViewPtr ignoredView = view->makeNew();
PointViewPtr keptView = view->makeNew();
Segmentation::ignoreDimRange(m_ignored, view, keptView, ignoredView);
if (m_ignored.m_id == Dimension::Id::Unknown)
keptView->append(*view);
else
Segmentation::ignoreDimRange(m_ignored, view, keptView, ignoredView);

// Segment kept view into last/other-than-last return views.
PointViewPtr lastView = keptView->makeNew();
Expand Down

0 comments on commit faba4c4

Please sign in to comment.