Example #1
0
void TLens::set_thickness(double thickness, unsigned int index)
{
    double diff = thickness - get_thickness(index);

    for (unsigned int i = index; i < _surfaces.size(); i++)
    {
        Math::Vector3 p = _surfaces[i].get_local_position();
        p.z() += diff;
        _surfaces[i].set_local_position(p);
    }

    _last_pos += diff;
}
  void Logo::create_x(const Point2f &upper_left, const float &height) {
    const Point2f p00 = get_p00(upper_left, height);
    const Point2f p20 = get_p20(upper_left, height);
    const Point2f p02 = get_p02(upper_left, height);
    const Point2f p22 = get_p22(upper_left, height);
    const float thickness = get_thickness(height);

    create_thick_line(p00, p22, thickness, m_text_color);
    create_thick_line(p02, p20, thickness, m_text_color);
    create_circle(p00, thickness, m_text_color, 12);
    create_circle(p20, thickness, m_text_color, 12);
    create_circle(p02, thickness, m_text_color, 12);
    create_circle(p22, thickness, m_text_color, 12);
  }
  void Logo::create_p(const Point2f &upper_left, const float &height) {
    const Point2f p00 = get_p00(upper_left, height);
    const Point2f p10 = get_p10(upper_left, height);
    const Point2f p01 = get_p01(upper_left, height);
    const Point2f p11 = get_p11(upper_left, height);
    const Point2f p02 = get_p02(upper_left, height);
    const Point2f phc(p10.x, 0.5f * (p10.y + p11.y));
    const float thickness = get_thickness(height);

    create_thick_line(p00, p10, thickness, m_text_color);
    create_thick_line(p00, p02, thickness, m_text_color);
    create_thick_line(p01, p11, thickness, m_text_color);
    create_circle(p00, thickness, m_text_color, 12);
    create_circle(p02, thickness, m_text_color, 12);
    create_hollow_ellipse(phc, Point2f(0.167f * m_height - thickness, 0.125f * m_height - thickness), Point2f(0.167f * m_height + thickness, 0.125f * m_height + thickness), m_text_color, 36, 18);
  }
Example #4
0
vector< Parm* > Af::GetLinkableParms()
{
	vector< Parm* > pVec;
	pVec.push_back( get_camber() );
	pVec.push_back( get_camber_loc() );
	pVec.push_back( get_thickness() );
	pVec.push_back( get_thickness_loc() );
	pVec.push_back( get_ideal_cl() );
	pVec.push_back( get_a() );
	pVec.push_back( get_leading_edge_radius() );
	pVec.push_back( get_trailing_edge_radius() );
	pVec.push_back( get_slat_chord() );
	pVec.push_back( get_slat_angle() );
	pVec.push_back( get_flap_chord() );
	pVec.push_back( get_flap_angle() );

	return pVec;
}
Example #5
0
void Af::init_script(Stringc s)
{
	char str[255];

	sprintf(str, "%s camber", s());
	get_camber()->set_script(Stringc(str), 0);

	sprintf(str, "%s camberloc", s());
	get_camber_loc()->set_script(Stringc(str), 0);
	
	sprintf(str, "%s thick", s());
	get_thickness()->set_script(Stringc(str), 0);
	
	sprintf(str, "%s thickloc", s());
	get_thickness_loc()->set_script(Stringc(str), 0);
	
	sprintf(str, "%s idealcl", s());
	get_ideal_cl()->set_script(Stringc(str), 0);
	
	sprintf(str, "%s a", s());
	get_a()->set_script(Stringc(str), 0);
}
Example #6
0
			// Slicing
			void get_slicing(Slice<T, e_host> &slice)
			{				
				
				atoms_u.get_z_slice(input_multislice->potential_slicing, input_multislice->grid.dz, atoms, z_slice);
				get_thickness(z_slice, thickness);

				if(input_multislice->interaction_model != eESIM_Multislice){
					slice.resize(thickness.size());
					std::fill(slice.ithk.begin(), slice.ithk.end(), -1);

					for(auto islice=0; islice<slice.size(); islice++)
					{
						thickness.islice[islice] = islice;
						thickness.z_back_prop[islice] = thickness.z_zero_def_plane[islice] - thickness.z[islice];
						slice.z_0[islice] = (islice==0)?atoms.z_Int_min:thickness.z[islice-1]; 
						slice.z_e[islice] = thickness.z[islice]; 
						slice.z_int_0[islice] = slice.z_0[islice];
						slice.z_int_e[islice] = slice.z_e[islice];
						slice.iatom_0[islice] = (islice==0)?0:thickness.iatom_e[islice-1]+1;
						slice.iatom_e[islice] = thickness.iatom_e[islice];
						slice.ithk[islice] = islice;
					}
					return;
				}

				slice.resize(z_slice.size()-1);
				std::fill(slice.ithk.begin(), slice.ithk.end(), -1);
				for(auto ithk=0; ithk<thickness.size(); ithk++)
				{
					slice.ithk[thickness.islice[ithk]] = ithk;
				}

				for(auto islice=0; islice<slice.size(); islice++)
				{
					slice.z_0[islice] = z_slice[islice]; 
					slice.z_e[islice] = z_slice[islice + 1];
					switch(input_multislice->potential_slicing)
					{
						case ePS_Planes:
						{
							slice.z_int_0[islice] = slice.z_0[islice];
							slice.z_int_e[islice] = slice.z_e[islice];

							atoms.find_by_z(slice.z_int_0[islice], slice.z_int_e[islice], slice.iatom_0[islice], slice.iatom_e[islice], false);
						}
						break;
						case ePS_dz_Proj:
						{
							slice.z_int_0[islice] = slice.z_0[islice] ;
							slice.z_int_e[islice] = slice.z_e[islice] ;

							atoms.find_by_z(slice.z_int_0[islice], slice.z_int_e[islice], slice.iatom_0[islice], slice.iatom_e[islice], false);
						}
						break;
						case ePS_dz_Sub:
						{
							T zm = 0.5*(slice.z_0[islice]+ slice.z_e[islice]);

							slice.z_int_0[islice] = min(zm - atoms.R_Int_max, slice.z_0[islice]);
							slice.z_int_e[islice] = max(zm + atoms.R_Int_max, slice.z_e[islice]);

							atoms.find_by_z(slice.z_int_0[islice], slice.z_int_e[islice], slice.iatom_0[islice], slice.iatom_e[islice]);
						}
						break;
					}
				}
			}