void OSPObjectFile::importAttributeString(const tinyxml2::XMLNode *node, OSPObject parent)
{
  // Get the attribute value.
  const char *value = node->ToElement()->GetText();

  // Error check.
  exitOnCondition(strlen(value) == 0, "malformed XML element '" + std::string(node->ToElement()->Name()) + "'");

  // Set the attribute on the parent object.
  ospSetString(parent, node->ToElement()->Name(), value);
}
Beispiel #2
0
    void FrameBuffer::postCommit(RenderContext &)
    {
      bool removeToneMapper = false;
      bool toneMapperEnabled = false;
      if (hasChild("toneMapper")) {
        toneMapperEnabled = child("toneMapper").child("enabled").valueAs<bool>();
        if (toneMapperActive && !toneMapperEnabled)
          removeToneMapper = true;
      }
      // Avoid clearing the framebuffer when only tonemapping parameters have been changed
      if (lastModified() >= lastCommitted()
          || child("size").lastModified() >= lastCommitted()
          || child("displayWall").lastModified() >= lastCommitted()
          || child("useAccumBuffer").lastModified() >= lastCommitted()
          || child("useVarianceBuffer").lastModified() >= lastCommitted()
#ifdef OSPRAY_APPS_ENABLE_DENOISER
          || child("useDenoiser").lastModified() >= lastCommitted()
#endif
          || child("colorFormat").lastModified() >= lastCommitted()
          || removeToneMapper)
      {
        std::string displayWall = child("displayWall").valueAs<std::string>();
        this->displayWallStream = displayWall;

        updateFB();

        if (displayWall != "") {
          // TODO move into own sg::Node
          ospLoadModule("displayWald");
          OSPPixelOp pixelOp = ospNewPixelOp("display_wald");
          ospSetString(pixelOp, "streamName", displayWall.c_str());
          ospCommit(pixelOp);
          ospSetPixelOp(ospFrameBuffer, pixelOp);
          std::cout << "-------------------------------------------------------"
                    << std::endl;
          std::cout << "this is the display wall framebuffer .. size is "
                    << size() << std::endl;
          std::cout << "added display wall pixel op ..." << std::endl;

          std::cout << "created display wall pixelop, and assigned to frame buffer!"
                  << std::endl;
        }
        ospCommit(ospFrameBuffer);
      }

      if (toneMapperEnabled && !toneMapperActive) {
        ospSetPixelOp(ospFrameBuffer, child("toneMapper").valueAs<OSPPixelOp>());
        toneMapperActive = true;
      }
    }