本文整理汇总了C#中Section.add_entry方法的典型用法代码示例。如果您正苦于以下问题:C# Section.add_entry方法的具体用法?C# Section.add_entry怎么用?C# Section.add_entry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Section
的用法示例。
在下文中一共展示了Section.add_entry方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: createDefault
/// <summary>
/// create a default initialisation file
/// </summary>
/// <param name="initialisation_file"></param>
public void createDefault(String initialisation_file, float target_width_mm, float target_height_mm, float target_distance_mm)
{
Section new_section;
StreamWriter stream = File.CreateText(initialisation_file);
float half_width_metres = target_width_mm / 2000;
float half_height_metres = target_height_mm / 2000;
float target_dist_metres = -target_distance_mm / 1000;
m_sections.Clear();
new_section = new Section("Models");
new_section.add_entry("MotionModel", "IMPULSE_THREED");
new_section.add_entry("NewFeatureMeasurementModel", "CAMERA_WIDE_LINE_INIT");
m_sections.Add(new_section);
new_section = new Section("CAMERA_WIDE_POINT");
new_section.add_entry("Camera", "UNIBRAIN_WIDE_CAMERA");
m_sections.Add(new_section);
new_section = new Section("CAMERA_WIDE_LINE_INIT");
new_section.add_entry("Camera", "UNIBRAIN_WIDE_CAMERA");
m_sections.Add(new_section);
new_section = new Section("UNIBRAIN_WIDE_CAMERA");
new_section.add_entry("CameraParameters", "320,240,162,125,195,195,9e-06,1");
m_sections.Add(new_section);
new_section = new Section("IMPULSE_THREED");
m_sections.Add(new_section);
new_section = new Section("InitialState");
new_section.add_entry("MotionModel", "IMPULSE_THREED");
new_section.add_entry("xv", "0.0,0.0," + Convert.ToString(target_dist_metres) + ",1.0,0.0,0.0,0.0,0.0,0.0,-0.1,0.0,0.0,0.01");
new_section.add_entry("Pxx", "0.0004,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0," +
"0.0,0.0004,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0," +
"0.0,0.0,0.0004,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0," +
"0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0," +
"0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0," +
"0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0," +
"0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0," +
"0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0," +
"0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0," +
"0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0," +
"0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0," +
"0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0," +
"0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0");
m_sections.Add(new_section);
for (int i = 1; i <= 4; i++)
{
new_section = new Section("KnownFeature" + Convert.ToString(i));
new_section.add_entry("FeatureMeasurementModel", "CAMERA_WIDE_POINT");
new_section.add_entry("Identifier", "known_patch" + Convert.ToString(i-1) + ".bmp");
switch (i)
{
case (1):
{
new_section.add_entry("yi", Convert.ToString(half_width_metres) + "," +
Convert.ToString(half_height_metres) + ",0.0");
break;
}
case (2):
{
new_section.add_entry("yi", Convert.ToString(-half_width_metres) + "," +
Convert.ToString(half_height_metres) + ",0.0");
break;
}
case (3):
{
new_section.add_entry("yi", Convert.ToString(half_width_metres) + "," +
Convert.ToString(-half_height_metres) + ",0.0");
break;
}
case (4):
{
new_section.add_entry("yi", Convert.ToString(-half_width_metres) + "," +
Convert.ToString(-half_height_metres) + ",0.0");
break;
}
}
new_section.add_entry("xp_orig", "0.0,0.0," + Convert.ToString(target_dist_metres) + "," +
"1.0,0.0,0.0,0.0");
m_sections.Add(new_section);
}
save(stream);
stream.Close();
}