Example #1
0
void EditorFileSystem::reimport_files(const Vector<String> &p_files) {

	importing = true;
	EditorProgress pr("reimport", TTR("(Re)Importing Assets"), p_files.size());

	Vector<ImportFile> files;

	for (int i = 0; i < p_files.size(); i++) {
		ImportFile ifile;
		ifile.path = p_files[i];
		ifile.order = ResourceFormatImporter::get_singleton()->get_import_order(p_files[i]);
		files.push_back(ifile);
	}

	files.sort();

	for (int i = 0; i < files.size(); i++) {
		pr.step(files[i].path.get_file(), i);

		_reimport_file(files[i].path);
	}

	_save_filesystem_cache();
	importing = false;
	if (!is_scanning()) {
		emit_signal("filesystem_changed");
	}

	emit_signal("resources_reimported", p_files);
}
Example #2
0
void EditorFileSystem::reimport_files(const Vector<String> &p_files) {

	importing = true;
	EditorProgress pr("reimport", TTR("(Re)Importing Assets"), p_files.size());
	for (int i = 0; i < p_files.size(); i++) {
		pr.step(p_files[i].get_file(), i);

		_reimport_file(p_files[i]);
	}

	_save_filesystem_cache();
	importing = false;
	if (!is_scanning()) {
		emit_signal("filesystem_changed");
	}
}
			bool is_convergent_beam_wave() const
			{
				return is_scanning() || is_CBED_CBEI() || (is_EWFS_EWRS() && ew_fr.convergent_beam) || (is_EWSFS_EWSRS() && ew_fr.convergent_beam);
			}
			void validate_parameters()
			{
				cpu_nthread = max(1, cpu_nthread);
				gpu_nstream = max(1, gpu_nstream);
				nstream = (is_host())?cpu_nthread:gpu_nstream;

				if(!is_float() && !is_double())
					precision = eP_float;

				if(!is_host() && !is_device())
					device = e_host;

				if(!is_gpu_available())
				{
					device = e_host;
				}

				fp_seed = max(0, fp_seed);

				fp_nconf = (!is_frozen_phonon())?1:max(1, fp_nconf);

				fp_iconf_0 = (!is_frozen_phonon() || !fp_single_conf)?1:fp_single_conf;

				tm_nrot = max(1, tm_nrot);
				tm_irot = max(0, tm_irot);
				tm_nrot = max(1, tm_nrot);
				norm_Pos_3d(tm_u0);
				if(tm_rot_point_type == eRPT_geometric_center)
				{
					tm_p0 = Pos_3d<T>(atoms.x_mean, atoms.y_mean, atoms.z_mean);
				}

				if(is_tomography())
				{
					thickness_type = eTT_Whole_Specimen;
					if(potential_slicing == ePS_Planes)
					{
						potential_slicing = ePS_dz_Proj;
					}
				}

				islice = max(0, islice);

				gpu_device = max(0, gpu_device);

				if(isZero(Vrl))
				{
					Vrl = c_Vrl;
				}

				if(isZero(nR))
				{
					nR = c_nR;
				}

				dp_Shift = (is_PED())?true:false;

				if(!is_scanning())
				{
					scanning.set_default();
				}
				scanning.set_grid();

				lens.set_input_data(E_0, grid);

				det_cir.set_input_data(E_0);

				theta = set_incident_angle(theta);
				nrot = max(1, nrot);
				if(!is_PED_HCI())
				{
					nrot = 1;
				}
				//Set beam type
				if(is_user_define_wave())
				{
					beam_type = eBT_User_Define;
				}
				else if(is_convergent_beam_wave())
				{
					beam_type = eBT_Convergent;

					if(is_CBED_CBEI())
					{
						set_beam_position(cbe_fr.x0, cbe_fr.y0);
					}
					else if(is_EWFS_EWRS())
					{
						set_beam_position(ew_fr.x0, ew_fr.y0);
					}
				}
				else if(is_plane_wave())
				{
					beam_type = eBT_Plane_Wave;
				}

				if(is_EELS() || is_EFTEM())
				{
					coherent_contribution = false;
					interaction_model = multem::eESIM_Multislice;
				}

				if(is_EWFS_EWRS())
				{
					coherent_contribution = true;
				}

				slice_storage = false;
				if(is_PED_HCI() || is_EELS_EFTEM()|| is_ISTEM() ||(is_STEM() && !coherent_contribution))
				{
					slice_storage = true;
				}

				if(!is_multislice())
				{
					islice = 0;
					fp_dim.z = false;
					potential_slicing = ePS_Planes;
					thickness_type = eTT_Through_Thickness;
					slice_storage = slice_storage || !is_whole_specimen();
				}

				if(is_subslicing())
				{
					thickness_type = eTT_Whole_Specimen;
				}

				if(is_whole_specimen() || thickness.empty())
				{
					thickness_type = eTT_Whole_Specimen;
					thickness.resize(1);
					thickness[0] = atoms.z_max;
				}
				else if(is_through_thickness())
				{
					// for amorphous specimen it has to be modified
					thickness_type = eTT_Through_Thickness;
					std::sort(thickness.begin(), thickness.end());
					fp_dim.z = false;
					atoms.Sort_by_z();
					atoms.get_z_layer();			
					multem::match_vectors(atoms.z_layer.begin(), atoms.z_layer.end(), thickness);
				}
				else if(is_through_slices())
				{
					std::sort(thickness.begin(), thickness.end());
					atoms.Sort_by_z();
					atoms.get_z_layer();

					Vector<T, e_host> z_slice;
					atoms.get_z_slice(potential_slicing, grid.dz, atoms, z_slice);
					vector<T> z_slicet;
					z_slicet.assign(z_slice.begin(), z_slice.end());
					multem::match_vectors(z_slice.begin()+1, z_slice.end(), thickness);
				}
			}