Beispiel #1
0
void Bundle::loadProperties()
{
	Path localPath(false);
	localPath.pushDirectory(_language.primaryTag());
	localPath.pushDirectory(_language.subTags());
	while (localPath.depth() > 0)
	{
		Path resPath(localPath, PROPERTIES_FILE);
		addProperties(resPath.toString(Path::PATH_UNIX));
		localPath.popDirectory();
	}
	addProperties(PROPERTIES_FILE);
}
Beispiel #2
0
        void setSource (ValueTree& newSource)
        {
            clear();

            tree = newSource;

            const int maxChars = 200;

            Array<PropertyComponent*> pc;

            for (int i = 0; i < tree.getNumProperties(); ++i)
            {
                const Identifier name = tree.getPropertyName (i).toString();
                Value v = tree.getPropertyAsValue (name, nullptr);
                TextPropertyComponent* tpc;

                if (v.getValue().isObject())
                {
                    tpc = new TextPropertyComponent (noEditValue, name.toString(), maxChars, false);
                    tpc->setEnabled (false);
                }
                else
                {
                    tpc = new TextPropertyComponent (v, name.toString(), maxChars, false);
                }

                pc.add (tpc);
            }

            addProperties (pc);
        }
Beispiel #3
0
void pix_video :: getPropertyMess(int argc, t_atom*argv)
{
  if(argc) {
    int i=0;
    m_readprops.clear();

    for(i=0; i<argc; i++) {
      addProperties(m_readprops, 1, argv+i);
    }

  } else {
    /* LATER: read all properties */
  }

  t_atom ap[4];
  if(m_videoHandle) {
    m_videoHandle->getProperties(m_readprops);
    std::vector<std::string>keys=m_readprops.keys();
    unsigned int i=0;
    for(i=0; i<keys.size(); i++) {
      std::string key=keys[i];
      SETSYMBOL(ap+0, gensym(key.c_str()));
      int ac=0;
      switch(m_readprops.type(key)) {
      default:
      case gem::Properties::UNSET: 
        ac=0; 
        break;
      case gem::Properties::NONE:  
        ac=1; 
        break;
      case gem::Properties::DOUBLE:
        do {
          double d=0;
          if(m_readprops.get(key, d)) {
            ac=2;
            SETFLOAT(ap+1, d);
          }
        } while(0);
        break;
      case gem::Properties::STRING:
        do {
          std::string s;
          if(m_readprops.get(key, s)) {
            ac=2;
            SETSYMBOL(ap+1, gensym(s.c_str()));
          }
        } while(0);
        break;
      }	    
      if(ac) {
        outlet_anything(m_infoOut, gensym("prop"), ac, ap);
      } else {
        post("oops: %s", key.c_str());
      }
    }
  } else {
    logpost(NULL, 5, "no open videodevice...remembering properties...");
  }
}
Beispiel #4
0
void Mesh2Cloud::init() {
	//m_mesh->request_vertex_status();
	//m_mesh->request_face_status();
	//m_mesh->request_vertex_normals();
	//m_mesh->request_face_normals();
	SingleMesh::init();
	m_mesh->update_face_normals();
	MultiPointCloud::init();
	addProperties();
	registerEvents();
}
Beispiel #5
0
void pix_video :: setPropertyMess(int argc, t_atom*argv)
{
  if(!argc) {
    error("no property specified!");
    return;
  }
  addProperties(m_writeprops, argc, argv);

  if(m_videoHandle) {
    m_videoHandle->setProperties(m_writeprops);
  }
}
Beispiel #6
0
      // construction based on clip instance
      Image::Image(ClipInstance& instance,
                   double renderScaleX, 
                   double renderScaleY,
                   void* data,
                   const OfxRectI &bounds,
                   const OfxRectI &rod,
                   int rowBytes,
                   std::string field,
                   std::string uniqueIdentifier) 
        : ImageBase(instance, renderScaleX, renderScaleY, bounds, rod, rowBytes, field, uniqueIdentifier)
      {
        addProperties(imageStuffs);

        // set other data
        setPointerProperty(kOfxImagePropData,data);
      }
Beispiel #7
0
      // construction based on clip instance
      Texture::Texture(ClipInstance& instance,
                   double renderScaleX, 
                   double renderScaleY,
                   int index,
                   int target,
                   const OfxRectI &bounds,
                   const OfxRectI &rod,
                   int rowBytes,
                   std::string field,
                   std::string uniqueIdentifier) 
        : ImageBase(instance, renderScaleX, renderScaleY, bounds, rod, rowBytes, field, uniqueIdentifier)
      {
        addProperties(textureStuffs);

        // set other data
        setIntProperty(kOfxImageEffectPropOpenGLTextureIndex, index);
        setIntProperty(kOfxImageEffectPropOpenGLTextureTarget, target);
      }
Beispiel #8
0
//*************************************************************
void MINDsetup::init(bhep::gstore pstore, bhep::prlevel level) {
//*************************************************************
    
  _msetup=bhep::messenger(level);
  
  _msetup.message("++MINDsetup Messenger generated++",bhep::VERBOSE);
  
  _pstore=pstore;
  
  readParam();

  //--------------- generate recpack setup -----------//
    
  _gsetup.set_name("main");
  
  // create volumes and surfaces
  
  createGeom();
  
  // define detector resolutions

  setResolution();
  
  // add properties to volumes and surfaces
  
  addProperties();

  // std::cout << _gsetup.volume("Detector").parameter("BField") << std::endl;
  // dict::mixdictionary smell = _gsetup.volume_properties("IRON_plane0");
  
  // const double XX = _gsetup.volume_properties("IRON_plane0").retrieve(thing_name);
  // std::cout << _gsetup.volume_properties("IRON_plane0").retrieve(thing_name) << std::endl;
  
  //     std::cout << _gsetup << std::endl;
  
  _msetup.message("++ Setup has been generated !! ++",bhep::VERBOSE);
  
  //_msetup.message("MIND Setup:", _gsetup,bhep::VERBOSE);
}
Beispiel #9
0
void MainWindow::openScenario(std::string filename) {
	clearLayout(ui->widget_seismic->layout());
	clearLayout(ui->widget_sensibilizar->layout());
	clearLayout(ui->widget_materials->layout());
	ui->generalPropertiesContainer->layout()->takeAt(0); //Save general material config
	clearLayout(ui->materialsTab->layout());
	clearLayout(ui->strengthFunctionsTab->layout()); // Strength functions
	materials_ui.clear();
	strength_functions_ui.clear();
	custom_seismic_schenarios_ui.clear();
	qcheckbox_property_index.clear();
	qcheckbox_material_scenario_index.clear();
	index_qcheckbox_material_scenario.clear();
	general_material_config.clearScenarios();
	try {
		main_scenario = EscenarioFile(filename);
		addProperties();
		addMaterials();
		addStrengthFunctions();
		scenarios_config.setScenarioFile(&main_scenario);
		result_process_ui.setEscenarioFile(main_scenario);
	}
	catch (std::exception& e) {
		std::cout << "Standard exception: " << e.what() << std::endl;
		QMessageBox messageBox;
		messageBox.critical(
			0,
			"Error trying to load SLI file",
			QString::fromStdString(
				std::string("There is a problem with the format of the file.\n") +
				std::string(e.what())
			)
		);
		messageBox.setFixedSize(500, 200);
	}
}
Beispiel #10
0
 /// make an image from a clip instance
 Texture::Texture(ClipInstance& instance)
   : ImageBase(instance)
 {
   addProperties(textureStuffs);
 }
Beispiel #11
0
 Texture::Texture()
   : ImageBase()
 {
   addProperties(textureStuffs);
 }
Beispiel #12
0
 /// make an image from a clip instance
 Image::Image(ClipInstance& instance)
   : ImageBase(instance)
 {
   addProperties(imageStuffs);
 }
Beispiel #13
0
 Image::Image()
   : ImageBase()
 {
   addProperties(imageStuffs);
 }
Beispiel #14
0
void pix_video :: setPropertiesMess(int argc, t_atom*argv)
{
  addProperties(m_writeprops, argc, argv);
}
Beispiel #15
0
 Set::Set(const PropSpec spec[])
   : _magic(kMagic)
   , _chainedSet(NULL) 
 {
   addProperties(spec);
 }
Beispiel #16
0
bool generateFileContents(QStringList &header, QStringList &source,
    const QString &originalClassName, const QString &className,
    const QStringList &dependencyIncludes, const QStringList &buildIncludes,
    const QString &headerName, const ClassParserInformation &info)
{
    // Add header and source file contents to strings.
    QString upper = className.toUpper() + "_H";
    header << "#if !defined(" + upper + ")";
    header << "#define " + upper;
    // Add necessary includes.
    // Trick so that qmake finds dependences but files are not included.
    header << "#if !defined(_QMCTYPELIBBUILD)";
    foreach (const QString &inc, dependencyIncludes)
        header << "#include \"" + inc + "\"";
    // Takes care of class name appearing in parameters and return types.
    header << "#else";
    header << "#define " + originalClassName + " " + className;
    header << "#endif";
    // Some of these could be in <> but as long as it works...
    foreach (const QString &inc, buildIncludes)
        header << "#include \"" + inc + "\"";
    source << "#include \"" + headerName + "\"";
    // Add all parent classes.
    QString parents;
    if (!info.m_listChildClass.isEmpty())
        parents = " : ";
    EClassParserMemberType previous = FUNCTION_TYPE_NONE;
    if (info.m_strClassType == "class")
        previous = FUNCTION_TYPE_PRIVATE;
    else if (info.m_strClassType == "struct")
        previous = FUNCTION_TYPE_PUBLIC;
    else {
        qWarning() << "Do not know how to handle:" << info.m_strClassType;
        return false;
    }
    // In plain "class Foo : Bar" what is the type listed as?
    for (int k = 0; k < info.m_listChildClass.size(); ++k) {
        const SClassParserChildClass &parent = info.m_listChildClass[k];
        if (previous != parent.m_pType) {
            switch (parent.m_pType) {
            case FUNCTION_TYPE_PUBLIC:
                parents += "public ";
                break;
            case FUNCTION_TYPE_PRIVATE:
                parents += "private ";
                break;
            case FUNCTION_TYPE_PROTECTED:
                parents += "protected ";
                break;
            default:
                // What is the type for Bar in "public Foo, Bar"?
                qWarning() << "Unexpected class inheritance type:" << parent.m_pType;
                continue;
            }
            previous = parent.m_pType;
        } else if (k && k < info.m_listChildClass.size() - 1) {
            // Uses same inheritance as previous (or default if first).
            parents += ", ";
        }
        parents += parent.m_strName;
        if (k != info.m_listChildClass.size() - 1)
            parents += ", ";
    }
    header << info.m_strClassType + " " + className + parents + " {";
    if (!addProperties(header, info))
        return false;
    // Anything seemingly recognized as macros is probably needed.
    // This includes Q_CLASSINFO, for example.
    foreach (const SClassParserPossibleMacroWithoutKnownledge& m, info.m_listPossibleMacroWithoutKnownledge) {
        header << m.m_strMacroLine;
    }
    if (!addFunctions(header, source, originalClassName, className, info))
        return false;
    header << "};";
    header << "#endif";
    return true;
}