コード例 #1
0
   // ----------------------------------------------------------------------
   ConstPropertyHandle
   PropertyConstantVecTask::
   create_property( shawn::SimulationController& sc )
      throw( std::runtime_error )
   {
      double x = sc.environment().required_double_param("x");
      double y = sc.environment().required_double_param("y");
      double z = sc.environment().optional_double_param("z",0.0);

      PropertyConstantVec* pc = new PropertyConstantVec(shawn::Vec(x,y,z));
      try {
         fill_default_params(*pc,sc);
      }
      catch( std::runtime_error& ) {
         delete pc;
         throw;
      }
      return pc;
   }
コード例 #2
0
   // ----------------------------------------------------------------------
   ConstPropertyHandle
   PropertyIndexedTagColorVecTask::
   create_property( shawn::SimulationController& sc )
      throw( std::runtime_error )
   {
      //if( !sc.environment().optional_string_param("node","").empty() )
      //   { ABORT_NOT_IMPLEMENTED; }
      
      std::string tagname = sc.environment().required_string_param("dynamictag");

      PropertyIndexedTagColorVec* rtc = new PropertyIndexedTagColorVec(NULL, tagname);
      try {
         fill_default_params(*rtc,sc);
      }
      catch( std::runtime_error& ) {
         delete rtc;
         throw;
      }
      return rtc;
   }