Esempio n. 1
0
bool ColorAttribute::compute() {

   //std::cerr << "ColorAttribute: compute: execcount=" << m_executionCount << std::endl;

   auto color = p_color->getValue();
   Object::const_ptr obj = expect<Object>("data_in");
   if (!obj)
      return false;

   Object::ptr out = obj->clone();
   out->addAttribute("_color", color);
   addObject("data_out", out);

   return true;
}
Esempio n. 2
0
bool AddAttribute::compute() {

   Object::const_ptr obj = expect<Object>("data_in");
   if (!obj)
      return true;

   Object::ptr out = obj->clone();

   for (int i=0; i<NumAttributes; ++i) {
      if (!p_name[i]->getValue().empty()) {
         out->addAttribute(p_name[i]->getValue(), p_value[i]->getValue());
      }
   }

   addObject("data_out", out);

   return true;
}