void ImageShadowNode::updateLocalData() {
  const auto &imageSource = getImageSource();
  const auto &currentLocalData = getLocalData();
  if (currentLocalData) {
    assert(std::dynamic_pointer_cast<const ImageLocalData>(currentLocalData));
    auto currentImageLocalData =
        std::static_pointer_cast<const ImageLocalData>(currentLocalData);
    if (currentImageLocalData->getImageSource() == imageSource) {
      // Same `imageSource` is already in `localData`,
      // no need to (re)request an image resource.
      return;
    }
  }

  // Now we are about to mutate the Shadow Node.
  ensureUnsealed();

  auto imageRequest = imageManager_->requestImage(imageSource);
  auto imageLocalData =
      std::make_shared<ImageLocalData>(imageSource, std::move(imageRequest));
  setLocalData(imageLocalData);
}
void ossimNitfImageHeader::getMetadata(ossimKeywordlist& kwl,
                                       const char* prefix) const
{
   kwl.add(prefix, "source",
           getImageSource().c_str(),
           false);
   kwl.add(prefix,
           "image_date",
           getAcquisitionDateMonthDayYear().c_str(),
           false);
   kwl.add(prefix,
           "image_title",
           getTitle().c_str(),
           false);
}
Exemple #3
0
void BitmapAnnotation::duplicate()
{
  BitmapAnnotation *pBitmapAnnotation = new BitmapAnnotation(mClassFileName, "", false, mpGraphicsView);
  QPointF gridStep(mpGraphicsView->getCoOrdinateSystem()->getHorizontalGridStep(),
                   mpGraphicsView->getCoOrdinateSystem()->getVerticalGridStep());
  pBitmapAnnotation->setOrigin(mOrigin + gridStep);
  pBitmapAnnotation->setRotationAngle(mRotation);
  pBitmapAnnotation->initializeTransformation();
  pBitmapAnnotation->setExtents(getExtents());
  pBitmapAnnotation->setFileName(getFileName());
  pBitmapAnnotation->setImageSource(getImageSource());
  pBitmapAnnotation->setImage(getImage());
  pBitmapAnnotation->drawCornerItems();
  pBitmapAnnotation->setCornerItemsPassive();
  pBitmapAnnotation->update();
  mpGraphicsView->addClassAnnotation();
  mpGraphicsView->setCanAddClassAnnotation(true);
}