Skip to content

Commit

Permalink
Removed the cuttern and placed it at the end. The cutter was not bein…
Browse files Browse the repository at this point in the history
…g updated properly. We probably better off cutting at the end after the view.
  • Loading branch information
Garrett Potts committed Jun 5, 2019
1 parent ee8b472 commit 2b2933b
Showing 1 changed file with 27 additions and 18 deletions.
45 changes: 27 additions & 18 deletions src/util/ossimChipperUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1164,6 +1164,9 @@ ossimRefPtr<ossimImageSource> ossimChipperUtil::initializeChain(ossimIrect &aoi)
source->initialize();
}

// GP 2019: we will add cutters at the end
// Will remove temporarily bt leave the code hear just in
// case I messed something up
if (source.valid() && !aoi.hasNans())
{
//---
Expand All @@ -1172,29 +1175,29 @@ ossimRefPtr<ossimImageSource> ossimChipperUtil::initializeChain(ossimIrect &aoi)
// 2) Speed up by not propagating get tile request outside the cut or "aoi"
// to the left hand side(input).
//---
ossimRefPtr<ossimRectangleCutFilter> cutter = new ossimRectangleCutFilter();
// ossimRefPtr<ossimRectangleCutFilter> cutter = new ossimRectangleCutFilter();

// Set the cut rectangle:
cutter->setRectangle(aoi);
// // Set the cut rectangle:
// cutter->setRectangle(aoi);

// Null outside.
cutter->setCutType(ossimRectangleCutFilter::OSSIM_RECTANGLE_NULL_OUTSIDE);
// // Null outside.
// cutter->setCutType(ossimRectangleCutFilter::OSSIM_RECTANGLE_NULL_OUTSIDE);

// Connect cutter input to source chain.
cutter->connectMyInputTo(0, source.get());
// // Connect cutter input to source chain.
// cutter->connectMyInputTo(0, source.get());

source = cutter.get();
// source = cutter.get();

// Dependent on correct aoi so place after the cutter.
if (hasAnnotations())
{
// Put annotations after scalar remapper.
ossimRefPtr<ossimImageSource> result = addAnnotations(source);
if (result.valid())
{
source = result.get();
}
}
// // Dependent on correct aoi so place after the cutter.
// if (hasAnnotations())
// {
// // Put annotations after scalar remapper.
// ossimRefPtr<ossimImageSource> result = addAnnotations(source);
// if (result.valid())
// {
// source = result.get();
// }
// }
}
}

Expand Down Expand Up @@ -1652,6 +1655,7 @@ ossimRefPtr<ossimImageData> ossimChipperUtil::getChip(const ossimKeywordlist &op
{
m_kwl->addList(optionsKwl, true);
}


// (GP)
// Until we add more ellaborate code to check for scale changes
Expand All @@ -1668,6 +1672,7 @@ ossimRefPtr<ossimImageData> ossimChipperUtil::getChip(const ossimKeywordlist &op

if (optionsKwl.getSize() > 0)
{

//---
// Only do this if new options were passed in. This was causing an off by
// one error when now options were passed in using thumbnail option.
Expand All @@ -1679,6 +1684,10 @@ ossimRefPtr<ossimImageData> ossimChipperUtil::getChip(const ossimKeywordlist &op

m_geom->setImageSize(aoi.size());
}
else
{
getAreaOfInterest(m_source.get(), aoi);
}

if (m_source.valid())
{
Expand Down

0 comments on commit 2b2933b

Please sign in to comment.