CHARMMParameters* get_all_atom_CHARMM_parameters() {
  static IMP::Pointer<CHARMMParameters> ret
    =new CHARMMParameters(get_data_path("top.lib"),
                          get_data_path("par.lib"));
  ret->set_log_level(SILENT);
  return ret;
}
Beispiel #2
0
CHARMMParameters *get_all_atom_CHARMM_parameters() {
  if (!all_atom_CHARMM_parameters) {
    all_atom_CHARMM_parameters = new CHARMMParameters(get_data_path("top.lib"),
                                                      get_data_path("par.lib"));
    all_atom_CHARMM_parameters->set_log_level(base::SILENT);
  }
  return all_atom_CHARMM_parameters;
}
Beispiel #3
0
CHARMMParameters *get_heavy_atom_CHARMM_parameters() {
  if (!heavy_atom_CHARMM_parameters) {
    heavy_atom_CHARMM_parameters = new CHARMMParameters(
        get_data_path("top_heav.lib"), get_data_path("par.lib"));
    heavy_atom_CHARMM_parameters->set_log_level(base::SILENT);
  }
  return heavy_atom_CHARMM_parameters;
}
Beispiel #4
0
String OS_Unix::get_user_data_dir() const {

	String appname = get_safe_application_name();
	if (appname != "") {
		bool use_godot_dir = ProjectSettings::get_singleton()->get("application/config/use_shared_user_dir");
		if (use_godot_dir) {
			return get_data_path().plus_file(get_godot_dir_name()).plus_file("app_userdata").plus_file(appname);
		} else {
			return get_data_path().plus_file(appname);
		}
	}

	return ProjectSettings::get_singleton()->get_resource_path();
}
Beispiel #5
0
int _CreateFile(char* path,u32 perm,int mode)
{   
	/* 1) create cache file
	 * 2) create data_center file
	 * 3) init_file
	 * 4) open cache file with 'mode' 
	 * */
	int fd;
	char dst_path[MAX_PATH];
	get_cache_path(path,dst_path);
	if((fd = creat(dst_path,perm)) == -1){
		perror("create cache file");
		return fd;
	}
	close(fd);
	get_data_path(path,dst_path);
	if((fd = creat(dst_path,perm)) == -1){
		perror("create data center file");
		return fd;
	}
	close(fd);
	/* init file */
	if(init_file(path) != 0){
		fprintf(stderr,"init_file fail!\n");
		return -1;
	}
	fd = open(dst_path,mode);
	return fd;
}
	TriangleObjectRobot::TriangleObjectRobot(): TrisTriangleObject(){
		std::string prefix = get_data_path();
		std::string robot_file = get_robot_str();
		Geometry robot_pos;
		robot_pos.setX(-2);
		robot_pos.setY(0);
		robot_pos.setRPYRadian(0,0,0);
		this->init_object(robot_file, robot_pos);
	}
Beispiel #7
0
String OS_Unix::get_user_data_dir() const {

	String appname = get_safe_dir_name(ProjectSettings::get_singleton()->get("application/config/name"));
	if (appname != "") {
		bool use_custom_dir = ProjectSettings::get_singleton()->get("application/config/use_custom_user_dir");
		if (use_custom_dir) {
			String custom_dir = get_safe_dir_name(ProjectSettings::get_singleton()->get("application/config/custom_user_dir_name"), true);
			if (custom_dir == "") {
				custom_dir = appname;
			}
			return get_data_path().plus_file(custom_dir);
		} else {
			return get_data_path().plus_file(get_godot_dir_name()).plus_file("app_userdata").plus_file(appname);
		}
	}

	return ProjectSettings::get_singleton()->get_resource_path();
}
Beispiel #8
0
int Credits::init(Config conf, std::string arg)
{
	/*
	 * Load image texture:
	*/
	if (!m_img_texture.loadFromFile(get_data_path(DATALOADER_TYPE_IMG, "credits.png")))
		return 1;
	m_img_texture.setSmooth(true);
	m_img.setTexture(m_img_texture);
	/*
	 * Load fonts:
	*/
	if (!m_font1.loadFromFile(get_data_path(DATALOADER_TYPE_FONT, "Vollkorn-Bold.ttf")))
		return 1;
	if (!m_font2.loadFromFile(get_data_path(DATALOADER_TYPE_FONT, "Vollkorn-Regular.ttf")))
		return 1;
	/*
	 * Init header:
	*/
	m_header.setFont(m_font1);
	m_header.setColor(sf::Color::Red);
	/*
	 * Init text:
	*/
	m_text.setFont(m_font2);
	m_text.setColor(sf::Color::Red);
	/*
	 * Init sign:
	*/
	m_sign.setFont(m_font1);
	m_sign.setColor(sf::Color(254, 42, 53));
	/*
	 * Load standard text:
	*/
	load_item(-1);
	/*
	 * Load capsaicin dev logo texture:
	*/
	if (!m_cdev_texture.loadFromFile(get_data_path(DATALOADER_TYPE_IMG, "cdev.png")))
		return 1;
	m_cdev_texture.setSmooth(true);
	m_cdev.setTexture(m_cdev_texture);
	return 0;
}
	TriangleObjectChair::TriangleObjectChair(): TrisTriangleObject(){
		std::string prefix = get_data_path();
		std::string chair_file = get_chair_str();
		Geometry chair_pos;
		chair_pos.setX(0.49);
		chair_pos.setY(-0.1);
		chair_pos.setZ(0.0);
		chair_pos.setRPYRadian(0,0,0);
		this->init_object(chair_file, chair_pos);
	}
bool UploadItemReader::is_exist_item(apr_size_t item_id) const
{
    const char *uitem_file_path;
    apr_finfo_t info;
    TemporaryPool temp_pool;

    uitem_file_path = get_data_path(temp_pool.get(), item_id);

    return !APR_STATUS_IS_ENOENT(apr_stat(&info, uitem_file_path,
                                          APR_FINFO_MIN, temp_pool.get()));
}
Beispiel #11
0
int Intro::init(Config conf, std::string arg)
{
	/*
	 * Init logo:
	*/
	if (!m_logo_texture.loadFromFile(get_data_path(DATALOADER_TYPE_IMG, "cdev_glowing.png")))
		return 1;
	m_logo_texture.setSmooth(true);
	m_logo.setTexture(m_logo_texture);
	/*
	 * Init menu image:
	*/
	if (!m_menu_texture.loadFromFile(get_data_path(DATALOADER_TYPE_IMG, "mainmenu.png")))
		return 1;
	m_menu_texture.setSmooth(true);
	m_menu.setTexture(m_menu_texture);
	/*
	 * Init background:
	*/
	m_bg.setFillColor(sf::Color::Black);
	return 0;
}
MotionPlannerPerrin::MotionPlannerPerrin(Environment *env, int &argc, char** &argv): MotionPlanner(env){
	ros::Geometry start_loc = env->getStart();
	tv = new TrajectoryVisualizer(start_loc.x, start_loc.y);

	std::string prefix = get_data_path();
	ROS_INFO("%s", prefix.c_str());

	planner = fastreplanning::fastReplanningInterfaceFactory(prefix, argc, argv);

	planner->setVerboseLevel(10); //0 5 15
	setStart(start_loc);
	planner->initStep(); //init

	step_finished_=false;
}
Beispiel #13
0
FireAnimation::FireAnimation() : m_backwards(false)
{
	/*
	 * Variable declaration:
	*/
	unsigned int i;
	std::stringstream tmp;
	/*
	 * Init background:
	*/
	m_fire.loadFromFile(get_data_path(DATALOADER_TYPE_IMG, "fire.png"));
	m_fireframe = 0;
	m_fireclock.restart();
	m_fire_sprite.setTexture(m_fire);
	m_fire_sprite.setTextureRect(sf::IntRect(0, 0, m_fire.getSize().x, m_fire.getSize().y));
}
Beispiel #14
0
int _OpenFile(char* path,int mode)
{
	/* 1) open cache first,if ok,return opened fd 
	 * 2) if cache file open fail,open dtc file instead*/
	int fd;
	char dst_path[MAX_PATH];
	get_cache_path(path,dst_path);
	if((fd = open(dst_path,mode)) == -1){
		/* open dtc file */
		perror("Open cache_file");
		get_data_path(path,dst_path);
		if((fd = open(dst_path,mode)) == -1){
			perror("Open dtc_file");
		}
	}
	return fd;
}
void UploadItemReader::read(apr_size_t item_id, UploadItem *uitem)
{
    const char *uitem_file_path;
    apr_mmap_t *uitem_file_map;
    apr_size_t version;

    TemporaryPool temp_pool(pool_);
    uitem_file_path = get_data_path(temp_pool.get(), item_id);
    File uitem_file(temp_pool.get(), uitem_file_path);

    version = read_and_check(&uitem_file, &uitem_file_map);
    switch (version) {
    case 3:
        memcpy(uitem, uitem_file_map->mm, sizeof(UploadItem::header_t));
        break;
    case 2:
        // フォーマット変換
        UploadItem::header_t *header;
        UploadItem::header_ver2x_t *header_ver2x;

        header = AS_UITEM_H(uitem);
        header_ver2x = AS_UITEM_H_VER2x(uitem_file_map->mm);

        new(header) UploadItem::header_t;
        header->id             = header_ver2x->id;
        header->index          = header_ver2x->index;
        header->download_count = header_ver2x->download_count;
        header->flags          = header_ver2x->flags;
        header->file_size      = header_ver2x->file_size;
        header->mtime          = header_ver2x->mtime;
        strncpy(header->date, header_ver2x->date, ITM_MAX_DATE_SIZE);
        strncpy(header->ip_address, header_ver2x->ip_address, ITM_MAX_IP_ADDRESS_SIZE);
        strncpy(header->file_name, header_ver2x->file_name, ITM_MAX_FILE_NAME_SIZE);
        strncpy(header->file_mime, header_ver2x->file_mime, ITM_MAX_FILE_MIME_SIZE);
        strncpy(header->file_ext, header_ver2x->file_ext, ITM_MAX_FILE_EXT_SIZE);
        strncpy(header->file_digest, header_ver2x->file_digest, ITM_MAX_FILE_DIGEST_SIZE);
        strncpy(header->remove_pass, header_ver2x->remove_pass, ITM_MAX_REMOVE_PASS_SIZE);
        strncpy(header->download_pass, header_ver2x->download_pass, ITM_MAX_DOWNLOAD_PASS_SIZE);
        strncpy(header->comment, header_ver2x->comment, ITM_MAX_COMMENT_SIZE);
        break;
    default:
        THROW(MESSAGE_BUG_FOUND);
    }
}
Beispiel #16
0
BadMother::BadMother(std::string name, int age, int x, int y, char repr) : Person(name, age, x, y, repr)
{
    this->xp_value = 100;
    this->cls_name = "BadMother";
    // this->name = name;
    // this->age = age;
    // this->x = x;
    // this->y = y;

    //set its representation, aka color and char
    // Representation * new_repr =   new Representation;
    // this->representation = new_repr;
    // this->representation->repr = repr;
    TCODRandom* rnd = TCODRandom::getInstance();
    float variant = rnd->getFloat(5.0f, 10.0f);
    //std::cout << (variant/10.0f) << std::endl;
    this->representation->setFGColor(TCODColor::blue * (variant/10.0f), true, true, true);
    this->representation->setBGColor(TCODColor::white , true, true, true);
    this->img_path = get_data_path()+"img/badmother20x20.png";

    // Inventory* inventory =   new Inventory;
    // this->inventory = inventory;
    // this->equipment = new Equipment;
    // this->equipment->master = this;

    // is_fighter = true;

    // combat = new Combat("temp name", 50, this, 't' );
    // combat->assign_to_master(this);
    // has_live_combat = true;

    // my_tile = NULL;
    // this->pack_size = 10;

    this->attrs->health->max_val = 600;
    this->attrs->health->current_val = 600;

    this->attrs->damage->max_val = 50;
    this->attrs->damage->current_val = 50;

};
Beispiel #17
0
int _Remove(char* path)
{
	/* 1) remove cache file 
	 * 2) remove dtc file 
	 * 3) remove md */
	int rt = 0;
	char dst_path[MAX_PATH];
	get_cache_path(path,dst_path);
	if((rt = remove(dst_path)) != 0){
		perror("Remove cache file");
		goto ret;
	}
	get_data_path(path,dst_path);
	if((rt = remove(dst_path)) != 0){
		perror("Remove data center file");
		goto ret;
	}
	if(de_init_file(path) != 0){
		rt = 1;
	}
ret:
	return rt;
}
Beispiel #18
0
GtkWidget *
do_data_model_dir (GtkWidget *do_widget)
{
    if (!window) {
        GtkWidget *vbox;
        GtkWidget *label;
        GdaDataModel *model;
        GtkWidget *form, *grid, *nb;
        GdaSet *data_set;
        GdaHolder *param;
        gchar *path;
        GValue *value;

        window = gtk_dialog_new_with_buttons ("GdaDataModelDir data model",
                                              GTK_WINDOW (do_widget),
                                              0,
                                              GTK_STOCK_CLOSE,
                                              GTK_RESPONSE_NONE,
                                              NULL);

        g_signal_connect (window, "response",
                          G_CALLBACK (gtk_widget_destroy), NULL);
        g_signal_connect (window, "destroy",
                          G_CALLBACK (gtk_widget_destroyed), &window);

        vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
        gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (window))),
                            vbox, TRUE, TRUE, 0);
        gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);

        label = gtk_label_new ("The following GdauiForm widget displays data from a GdaDataModelDir "
                               "data model which lists the files contained in the selected directory.\n\n"
                               "Each file contents is then displayed using the 'picture' plugin \n"
                               "(right click to open a menu, or double click to load an image).");
        gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);

        /* GdaDataModelDir object */
        path = get_data_path ();
        model = gda_data_model_dir_new (path);
        g_free (path);

        /* Create the demo widget */
        nb = gtk_notebook_new ();
        gtk_box_pack_start (GTK_BOX (vbox), nb, TRUE, TRUE, 0);

        form = gdaui_form_new (model);
        gtk_notebook_append_page (GTK_NOTEBOOK (nb), form, gtk_label_new ("Form"));

        grid = gdaui_grid_new (model);
        gtk_notebook_append_page (GTK_NOTEBOOK (nb), grid, gtk_label_new ("Grid"));
        g_object_unref (model);

        /* specify that we want to use the 'picture' plugin */
        data_set = GDA_SET (gdaui_data_selector_get_data_set (GDAUI_DATA_SELECTOR (grid)));
        param = gda_set_get_holder (data_set, "data");

        value = gda_value_new_from_string ("picture", G_TYPE_STRING);
        gda_holder_set_attribute_static (param, GDAUI_ATTRIBUTE_PLUGIN, value);
        gdaui_data_proxy_column_show_actions (GDAUI_DATA_PROXY (grid), -1, TRUE);
        gda_value_free (value);
    }

    gboolean visible;
    g_object_get (G_OBJECT (window), "visible", &visible, NULL);
    if (!visible)
        gtk_widget_show_all (window);
    else {
        gtk_widget_destroy (window);
        window = NULL;
    }

    return window;
}
ConstraintsCheckerSweptVolume::ConstraintsCheckerSweptVolume(){
  std::string pkg_path = get_data_path(std::string("feasibility"));
  std::string svfn = pkg_path + "/model/fullBodyApprox/";
  this->loadSweptVolumesToHashMap(svfn.c_str());
}
Beispiel #20
0
ProteinLigandAtomPairScore::ProteinLigandAtomPairScore(double threshold)
    : P(get_protein_ligand_type_key(), threshold,
        get_data_path("protein_ligand_rank_score.lib"), ni + 1),
      threshold_(threshold) {}