//+ // C++ side of the Tao / C++ structure interface. // // This file is generated as part of the Tao/C++ interface code generation. // The code generation files can be found in cpp_tao_interface. // // DO NOT EDIT THIS FILE DIRECTLY! //- #include #include "converter_templates.h" #include "cpp_tao_classes.h" //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_qp_rect extern "C" void qp_rect_to_c (const Opaque_qp_rect_class*, CPP_qp_rect&); // c_side.to_f2_arg extern "C" void qp_rect_to_f2 (Opaque_qp_rect_class*, c_Real&, c_Real&, c_Real&, c_Real&, c_Char); extern "C" void qp_rect_to_f (const CPP_qp_rect& C, Opaque_qp_rect_class* F) { // c_side.to_f2_call qp_rect_to_f2 (F, C.x1, C.x2, C.y1, C.y2, C.units.c_str()); } // c_side.to_c2_arg extern "C" void qp_rect_to_c2 (CPP_qp_rect& C, c_Real& z_x1, c_Real& z_x2, c_Real& z_y1, c_Real& z_y2, c_Char z_units) { // c_side.to_c2_set[real, 0, NOT] C.x1 = z_x1; // c_side.to_c2_set[real, 0, NOT] C.x2 = z_x2; // c_side.to_c2_set[real, 0, NOT] C.y1 = z_y1; // c_side.to_c2_set[real, 0, NOT] C.y2 = z_y2; // c_side.to_c2_set[character, 0, NOT] C.units = z_units; } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_qp_line extern "C" void qp_line_to_c (const Opaque_qp_line_class*, CPP_qp_line&); // c_side.to_f2_arg extern "C" void qp_line_to_f2 (Opaque_qp_line_class*, c_Int&, c_Int&, c_Int&); extern "C" void qp_line_to_f (const CPP_qp_line& C, Opaque_qp_line_class* F) { // c_side.to_f2_call qp_line_to_f2 (F, C.width, C.color, C.pattern); } // c_side.to_c2_arg extern "C" void qp_line_to_c2 (CPP_qp_line& C, c_Int& z_width, c_Int& z_color, c_Int& z_pattern) { // c_side.to_c2_set[integer, 0, NOT] C.width = z_width; // c_side.to_c2_set[integer, 0, NOT] C.color = z_color; // c_side.to_c2_set[integer, 0, NOT] C.pattern = z_pattern; } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_qp_symbol extern "C" void qp_symbol_to_c (const Opaque_qp_symbol_class*, CPP_qp_symbol&); // c_side.to_f2_arg extern "C" void qp_symbol_to_f2 (Opaque_qp_symbol_class*, c_Int&, c_Real&, c_Int&, c_Int&, c_Int&); extern "C" void qp_symbol_to_f (const CPP_qp_symbol& C, Opaque_qp_symbol_class* F) { // c_side.to_f2_call qp_symbol_to_f2 (F, C.type, C.height, C.color, C.fill_pattern, C.line_width); } // c_side.to_c2_arg extern "C" void qp_symbol_to_c2 (CPP_qp_symbol& C, c_Int& z_type, c_Real& z_height, c_Int& z_color, c_Int& z_fill_pattern, c_Int& z_line_width) { // c_side.to_c2_set[integer, 0, NOT] C.type = z_type; // c_side.to_c2_set[real, 0, NOT] C.height = z_height; // c_side.to_c2_set[integer, 0, NOT] C.color = z_color; // c_side.to_c2_set[integer, 0, NOT] C.fill_pattern = z_fill_pattern; // c_side.to_c2_set[integer, 0, NOT] C.line_width = z_line_width; } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_qp_point extern "C" void qp_point_to_c (const Opaque_qp_point_class*, CPP_qp_point&); // c_side.to_f2_arg extern "C" void qp_point_to_f2 (Opaque_qp_point_class*, c_Real&, c_Real&, c_Char); extern "C" void qp_point_to_f (const CPP_qp_point& C, Opaque_qp_point_class* F) { // c_side.to_f2_call qp_point_to_f2 (F, C.x, C.y, C.units.c_str()); } // c_side.to_c2_arg extern "C" void qp_point_to_c2 (CPP_qp_point& C, c_Real& z_x, c_Real& z_y, c_Char z_units) { // c_side.to_c2_set[real, 0, NOT] C.x = z_x; // c_side.to_c2_set[real, 0, NOT] C.y = z_y; // c_side.to_c2_set[character, 0, NOT] C.units = z_units; } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_qp_axis extern "C" void qp_axis_to_c (const Opaque_qp_axis_class*, CPP_qp_axis&); // c_side.to_f2_arg extern "C" void qp_axis_to_f2 (Opaque_qp_axis_class*, c_Char, c_Real&, c_Real&, c_Real&, c_Real&, c_Real&, c_Real&, c_Int&, c_Int&, c_Int&, c_Int&, c_Int&, c_Int&, c_Char, c_Char, c_Int&, c_Int&, c_Bool&, c_Bool&); extern "C" void qp_axis_to_f (const CPP_qp_axis& C, Opaque_qp_axis_class* F) { // c_side.to_f2_call qp_axis_to_f2 (F, C.label.c_str(), C.min, C.max, C.number_offset, C.label_offset, C.major_tick_len, C.minor_tick_len, C.label_color, C.major_div, C.major_div_nominal, C.minor_div, C.minor_div_max, C.places, C.type.c_str(), C.bounds.c_str(), C.tick_side, C.number_side, C.draw_label, C.draw_numbers); } // c_side.to_c2_arg extern "C" void qp_axis_to_c2 (CPP_qp_axis& C, c_Char z_label, c_Real& z_min, c_Real& z_max, c_Real& z_number_offset, c_Real& z_label_offset, c_Real& z_major_tick_len, c_Real& z_minor_tick_len, c_Int& z_label_color, c_Int& z_major_div, c_Int& z_major_div_nominal, c_Int& z_minor_div, c_Int& z_minor_div_max, c_Int& z_places, c_Char z_type, c_Char z_bounds, c_Int& z_tick_side, c_Int& z_number_side, c_Bool& z_draw_label, c_Bool& z_draw_numbers) { // c_side.to_c2_set[character, 0, NOT] C.label = z_label; // c_side.to_c2_set[real, 0, NOT] C.min = z_min; // c_side.to_c2_set[real, 0, NOT] C.max = z_max; // c_side.to_c2_set[real, 0, NOT] C.number_offset = z_number_offset; // c_side.to_c2_set[real, 0, NOT] C.label_offset = z_label_offset; // c_side.to_c2_set[real, 0, NOT] C.major_tick_len = z_major_tick_len; // c_side.to_c2_set[real, 0, NOT] C.minor_tick_len = z_minor_tick_len; // c_side.to_c2_set[integer, 0, NOT] C.label_color = z_label_color; // c_side.to_c2_set[integer, 0, NOT] C.major_div = z_major_div; // c_side.to_c2_set[integer, 0, NOT] C.major_div_nominal = z_major_div_nominal; // c_side.to_c2_set[integer, 0, NOT] C.minor_div = z_minor_div; // c_side.to_c2_set[integer, 0, NOT] C.minor_div_max = z_minor_div_max; // c_side.to_c2_set[integer, 0, NOT] C.places = z_places; // c_side.to_c2_set[character, 0, NOT] C.type = z_type; // c_side.to_c2_set[character, 0, NOT] C.bounds = z_bounds; // c_side.to_c2_set[integer, 0, NOT] C.tick_side = z_tick_side; // c_side.to_c2_set[integer, 0, NOT] C.number_side = z_number_side; // c_side.to_c2_set[logical, 0, NOT] C.draw_label = z_draw_label; // c_side.to_c2_set[logical, 0, NOT] C.draw_numbers = z_draw_numbers; } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_cmd_history extern "C" void tao_cmd_history_to_c (const Opaque_tao_cmd_history_class*, CPP_tao_cmd_history&); // c_side.to_f2_arg extern "C" void tao_cmd_history_to_f2 (Opaque_tao_cmd_history_class*, c_Char, Int, c_Int&, c_Bool&); extern "C" void tao_cmd_history_to_f (const CPP_tao_cmd_history& C, Opaque_tao_cmd_history_class* F) { // c_side.to_f_setup[character, 0, ALLOC] unsigned int n_cmd = 0; const char* z_cmd = NULL; if (C.cmd != NULL) { z_cmd = C.cmd->c_str(); n_cmd = 1; } // c_side.to_f2_call tao_cmd_history_to_f2 (F, z_cmd, n_cmd, C.ix, C.cmd_file); } // c_side.to_c2_arg extern "C" void tao_cmd_history_to_c2 (CPP_tao_cmd_history& C, c_Char z_cmd, Int n_cmd, c_Int& z_ix, c_Bool& z_cmd_file) { // c_side.to_c2_set[character, 0, ALLOC] if (n_cmd == 0) delete C.cmd; else { C.cmd = new string; *(C.cmd) = z_cmd; } // c_side.to_c2_set[integer, 0, NOT] C.ix = z_ix; // c_side.to_c2_set[logical, 0, NOT] C.cmd_file = z_cmd_file; } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_real_pointer extern "C" void tao_real_pointer_to_c (const Opaque_tao_real_pointer_class*, CPP_tao_real_pointer&); // c_side.to_f2_arg extern "C" void tao_real_pointer_to_f2 (Opaque_tao_real_pointer_class*, c_RealArr, Int, c_BoolArr, Int, c_BoolArr, Int); extern "C" void tao_real_pointer_to_f (const CPP_tao_real_pointer& C, Opaque_tao_real_pointer_class* F) { // c_side.to_f_setup[real, 0, PTR] unsigned int n_r = 0; if (C.r != NULL) n_r = 1; // c_side.to_f_setup[logical, 0, PTR] unsigned int n_good_value = 0; if (C.good_value != NULL) n_good_value = 1; // c_side.to_f_setup[logical, 0, PTR] unsigned int n_good_user = 0; if (C.good_user != NULL) n_good_user = 1; // c_side.to_f2_call tao_real_pointer_to_f2 (F, C.r, n_r, C.good_value, n_good_value, C.good_user, n_good_user); } // c_side.to_c2_arg extern "C" void tao_real_pointer_to_c2 (CPP_tao_real_pointer& C, c_RealArr z_r, Int n_r, c_BoolArr z_good_value, Int n_good_value, c_BoolArr z_good_user, Int n_good_user) { // c_side.to_c2_set[real, 0, PTR] if (n_r == 0) delete C.r; else { C.r = new Real; *C.r = *z_r; } // c_side.to_c2_set[logical, 0, PTR] if (n_good_value == 0) delete C.good_value; else { C.good_value = new Bool; *C.good_value = *z_good_value; } // c_side.to_c2_set[logical, 0, PTR] if (n_good_user == 0) delete C.good_user; else { C.good_user = new Bool; *C.good_user = *z_good_user; } } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_logical_array extern "C" void tao_logical_array_to_c (const Opaque_tao_logical_array_class*, CPP_tao_logical_array&); // c_side.to_f2_arg extern "C" void tao_logical_array_to_f2 (Opaque_tao_logical_array_class*, c_BoolArr, Int); extern "C" void tao_logical_array_to_f (const CPP_tao_logical_array& C, Opaque_tao_logical_array_class* F) { // c_side.to_f_setup[logical, 0, PTR] unsigned int n_l = 0; if (C.l != NULL) n_l = 1; // c_side.to_f2_call tao_logical_array_to_f2 (F, C.l, n_l); } // c_side.to_c2_arg extern "C" void tao_logical_array_to_c2 (CPP_tao_logical_array& C, c_BoolArr z_l, Int n_l) { // c_side.to_c2_set[logical, 0, PTR] if (n_l == 0) delete C.l; else { C.l = new Bool; *C.l = *z_l; } } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_integer_array extern "C" void tao_integer_array_to_c (const Opaque_tao_integer_array_class*, CPP_tao_integer_array&); // c_side.to_f2_arg extern "C" void tao_integer_array_to_f2 (Opaque_tao_integer_array_class*, c_IntArr, Int); extern "C" void tao_integer_array_to_f (const CPP_tao_integer_array& C, Opaque_tao_integer_array_class* F) { // c_side.to_f_setup[integer, 0, PTR] unsigned int n_i = 0; if (C.i != NULL) n_i = 1; // c_side.to_f2_call tao_integer_array_to_f2 (F, C.i, n_i); } // c_side.to_c2_arg extern "C" void tao_integer_array_to_c2 (CPP_tao_integer_array& C, c_IntArr z_i, Int n_i) { // c_side.to_c2_set[integer, 0, PTR] if (n_i == 0) delete C.i; else { C.i = new Int; *C.i = *z_i; } } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_expression_info extern "C" void tao_expression_info_to_c (const Opaque_tao_expression_info_class*, CPP_tao_expression_info&); // c_side.to_f2_arg extern "C" void tao_expression_info_to_f2 (Opaque_tao_expression_info_class*, c_Bool&, c_Int&, c_Real&); extern "C" void tao_expression_info_to_f (const CPP_tao_expression_info& C, Opaque_tao_expression_info_class* F) { // c_side.to_f2_call tao_expression_info_to_f2 (F, C.good, C.ix_ele, C.s); } // c_side.to_c2_arg extern "C" void tao_expression_info_to_c2 (CPP_tao_expression_info& C, c_Bool& z_good, c_Int& z_ix_ele, c_Real& z_s) { // c_side.to_c2_set[logical, 0, NOT] C.good = z_good; // c_side.to_c2_set[integer, 0, NOT] C.ix_ele = z_ix_ele; // c_side.to_c2_set[real, 0, NOT] C.s = z_s; } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_eval_stack1 extern "C" void tao_eval_stack1_to_c (const Opaque_tao_eval_stack1_class*, CPP_tao_eval_stack1&); // c_side.to_f2_arg extern "C" void tao_eval_stack1_to_f2 (Opaque_tao_eval_stack1_class*, c_Int&, c_Char, c_Real&, c_RealArr, Int, const CPP_tao_expression_info**, Int, const CPP_tao_real_pointer**, Int); extern "C" void tao_eval_stack1_to_f (const CPP_tao_eval_stack1& C, Opaque_tao_eval_stack1_class* F) { // c_side.to_f_setup[real, 1, ALLOC] int n1_value = C.value.size(); c_RealArr z_value = NULL; if (n1_value > 0) { z_value = &C.value[0]; } // c_side.to_f_setup[type, 1, ALLOC] int n1_info = C.info.size(); const CPP_tao_expression_info** z_info = NULL; if (n1_info != 0) { z_info = new const CPP_tao_expression_info*[n1_info]; for (int i = 0; i < n1_info; i++) z_info[i] = &C.info[i]; } // c_side.to_f_setup[type, 1, ALLOC] int n1_value_ptr = C.value_ptr.size(); const CPP_tao_real_pointer** z_value_ptr = NULL; if (n1_value_ptr != 0) { z_value_ptr = new const CPP_tao_real_pointer*[n1_value_ptr]; for (int i = 0; i < n1_value_ptr; i++) z_value_ptr[i] = &C.value_ptr[i]; } // c_side.to_f2_call tao_eval_stack1_to_f2 (F, C.type, C.name.c_str(), C.scale, z_value, n1_value, z_info, n1_info, z_value_ptr, n1_value_ptr); // c_side.to_f_cleanup[type, 1, ALLOC] delete[] z_info; // c_side.to_f_cleanup[type, 1, ALLOC] delete[] z_value_ptr; } // c_side.to_c2_arg extern "C" void tao_eval_stack1_to_c2 (CPP_tao_eval_stack1& C, c_Int& z_type, c_Char z_name, c_Real& z_scale, c_RealArr z_value, Int n1_value, Opaque_tao_expression_info_class** z_info, Int n1_info, Opaque_tao_real_pointer_class** z_value_ptr, Int n1_value_ptr) { // c_side.to_c2_set[integer, 0, NOT] C.type = z_type; // c_side.to_c2_set[character, 0, NOT] C.name = z_name; // c_side.to_c2_set[real, 0, NOT] C.scale = z_scale; // c_side.to_c2_set[real, 1, ALLOC] C.value.resize(n1_value); C.value << z_value; // c_side.to_c2_set[type, 1, ALLOC] C.info.resize(n1_info); for (int i = 0; i < n1_info; i++) tao_expression_info_to_c(z_info[i], C.info[i]); // c_side.to_c2_set[type, 1, ALLOC] C.value_ptr.resize(n1_value_ptr); for (int i = 0; i < n1_value_ptr; i++) tao_real_pointer_to_c(z_value_ptr[i], C.value_ptr[i]); } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_ele_shape extern "C" void tao_ele_shape_to_c (const Opaque_tao_ele_shape_class*, CPP_tao_ele_shape&); // c_side.to_f2_arg extern "C" void tao_ele_shape_to_f2 (Opaque_tao_ele_shape_class*, c_Char, c_Char, c_Char, c_Real&, c_Char, c_Bool&, c_Bool&, c_Int&, c_Char); extern "C" void tao_ele_shape_to_f (const CPP_tao_ele_shape& C, Opaque_tao_ele_shape_class* F) { // c_side.to_f2_call tao_ele_shape_to_f2 (F, C.ele_id.c_str(), C.shape.c_str(), C.color.c_str(), C.size, C.label.c_str(), C.draw, C.multi, C.ix_ele_key, C.name_ele.c_str()); } // c_side.to_c2_arg extern "C" void tao_ele_shape_to_c2 (CPP_tao_ele_shape& C, c_Char z_ele_id, c_Char z_shape, c_Char z_color, c_Real& z_size, c_Char z_label, c_Bool& z_draw, c_Bool& z_multi, c_Int& z_ix_ele_key, c_Char z_name_ele) { // c_side.to_c2_set[character, 0, NOT] C.ele_id = z_ele_id; // c_side.to_c2_set[character, 0, NOT] C.shape = z_shape; // c_side.to_c2_set[character, 0, NOT] C.color = z_color; // c_side.to_c2_set[real, 0, NOT] C.size = z_size; // c_side.to_c2_set[character, 0, NOT] C.label = z_label; // c_side.to_c2_set[logical, 0, NOT] C.draw = z_draw; // c_side.to_c2_set[logical, 0, NOT] C.multi = z_multi; // c_side.to_c2_set[integer, 0, NOT] C.ix_ele_key = z_ix_ele_key; // c_side.to_c2_set[character, 0, NOT] C.name_ele = z_name_ele; } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_pattern_point extern "C" void tao_pattern_point_to_c (const Opaque_tao_pattern_point_class*, CPP_tao_pattern_point&); // c_side.to_f2_arg extern "C" void tao_pattern_point_to_f2 (Opaque_tao_pattern_point_class*, c_Real&, c_Real&, c_Real&); extern "C" void tao_pattern_point_to_f (const CPP_tao_pattern_point& C, Opaque_tao_pattern_point_class* F) { // c_side.to_f2_call tao_pattern_point_to_f2 (F, C.s, C.x, C.radius); } // c_side.to_c2_arg extern "C" void tao_pattern_point_to_c2 (CPP_tao_pattern_point& C, c_Real& z_s, c_Real& z_x, c_Real& z_radius) { // c_side.to_c2_set[real, 0, NOT] C.s = z_s; // c_side.to_c2_set[real, 0, NOT] C.x = z_x; // c_side.to_c2_set[real, 0, NOT] C.radius = z_radius; } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_pattern_curve extern "C" void tao_pattern_curve_to_c (const Opaque_tao_pattern_curve_class*, CPP_tao_pattern_curve&); // c_side.to_f2_arg extern "C" void tao_pattern_curve_to_f2 (Opaque_tao_pattern_curve_class*, const CPP_qp_line&, const CPP_tao_pattern_point**, Int, c_Char); extern "C" void tao_pattern_curve_to_f (const CPP_tao_pattern_curve& C, Opaque_tao_pattern_curve_class* F) { // c_side.to_f_setup[type, 1, ALLOC] int n1_pt = C.pt.size(); const CPP_tao_pattern_point** z_pt = NULL; if (n1_pt != 0) { z_pt = new const CPP_tao_pattern_point*[n1_pt]; for (int i = 0; i < n1_pt; i++) z_pt[i] = &C.pt[i]; } // c_side.to_f2_call tao_pattern_curve_to_f2 (F, C.line, z_pt, n1_pt, C.scale.c_str()); // c_side.to_f_cleanup[type, 1, ALLOC] delete[] z_pt; } // c_side.to_c2_arg extern "C" void tao_pattern_curve_to_c2 (CPP_tao_pattern_curve& C, const Opaque_qp_line_class* z_line, Opaque_tao_pattern_point_class** z_pt, Int n1_pt, c_Char z_scale) { // c_side.to_c2_set[type, 0, NOT] qp_line_to_c(z_line, C.line); // c_side.to_c2_set[type, 1, ALLOC] C.pt.resize(n1_pt); for (int i = 0; i < n1_pt; i++) tao_pattern_point_to_c(z_pt[i], C.pt[i]); // c_side.to_c2_set[character, 0, NOT] C.scale = z_scale; } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_shape_pattern extern "C" void tao_shape_pattern_to_c (const Opaque_tao_shape_pattern_class*, CPP_tao_shape_pattern&); // c_side.to_f2_arg extern "C" void tao_shape_pattern_to_f2 (Opaque_tao_shape_pattern_class*, c_Char, const CPP_tao_pattern_curve**, Int); extern "C" void tao_shape_pattern_to_f (const CPP_tao_shape_pattern& C, Opaque_tao_shape_pattern_class* F) { // c_side.to_f_setup[type, 1, ALLOC] int n1_curve = C.curve.size(); const CPP_tao_pattern_curve** z_curve = NULL; if (n1_curve != 0) { z_curve = new const CPP_tao_pattern_curve*[n1_curve]; for (int i = 0; i < n1_curve; i++) z_curve[i] = &C.curve[i]; } // c_side.to_f2_call tao_shape_pattern_to_f2 (F, C.name.c_str(), z_curve, n1_curve); // c_side.to_f_cleanup[type, 1, ALLOC] delete[] z_curve; } // c_side.to_c2_arg extern "C" void tao_shape_pattern_to_c2 (CPP_tao_shape_pattern& C, c_Char z_name, Opaque_tao_pattern_curve_class** z_curve, Int n1_curve) { // c_side.to_c2_set[character, 0, NOT] C.name = z_name; // c_side.to_c2_set[type, 1, ALLOC] C.curve.resize(n1_curve); for (int i = 0; i < n1_curve; i++) tao_pattern_curve_to_c(z_curve[i], C.curve[i]); } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_drawing extern "C" void tao_drawing_to_c (const Opaque_tao_drawing_class*, CPP_tao_drawing&); // c_side.to_f2_arg extern "C" void tao_drawing_to_f2 (Opaque_tao_drawing_class*, const CPP_tao_ele_shape**, Int); extern "C" void tao_drawing_to_f (const CPP_tao_drawing& C, Opaque_tao_drawing_class* F) { // c_side.to_f_setup[type, 1, ALLOC] int n1_ele_shape = C.ele_shape.size(); const CPP_tao_ele_shape** z_ele_shape = NULL; if (n1_ele_shape != 0) { z_ele_shape = new const CPP_tao_ele_shape*[n1_ele_shape]; for (int i = 0; i < n1_ele_shape; i++) z_ele_shape[i] = &C.ele_shape[i]; } // c_side.to_f2_call tao_drawing_to_f2 (F, z_ele_shape, n1_ele_shape); // c_side.to_f_cleanup[type, 1, ALLOC] delete[] z_ele_shape; } // c_side.to_c2_arg extern "C" void tao_drawing_to_c2 (CPP_tao_drawing& C, Opaque_tao_ele_shape_class** z_ele_shape, Int n1_ele_shape) { // c_side.to_c2_set[type, 1, ALLOC] C.ele_shape.resize(n1_ele_shape); for (int i = 0; i < n1_ele_shape; i++) tao_ele_shape_to_c(z_ele_shape[i], C.ele_shape[i]); } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_wave_kick_pt extern "C" void tao_wave_kick_pt_to_c (const Opaque_tao_wave_kick_pt_class*, CPP_tao_wave_kick_pt&); // c_side.to_f2_arg extern "C" void tao_wave_kick_pt_to_f2 (Opaque_tao_wave_kick_pt_class*, c_Real&, c_Real&, c_Real&, c_Real&, c_Int&); extern "C" void tao_wave_kick_pt_to_f (const CPP_tao_wave_kick_pt& C, Opaque_tao_wave_kick_pt_class* F) { // c_side.to_f2_call tao_wave_kick_pt_to_f2 (F, C.phi_s, C.phi_r, C.phi, C.amp, C.ix_dat); } // c_side.to_c2_arg extern "C" void tao_wave_kick_pt_to_c2 (CPP_tao_wave_kick_pt& C, c_Real& z_phi_s, c_Real& z_phi_r, c_Real& z_phi, c_Real& z_amp, c_Int& z_ix_dat) { // c_side.to_c2_set[real, 0, NOT] C.phi_s = z_phi_s; // c_side.to_c2_set[real, 0, NOT] C.phi_r = z_phi_r; // c_side.to_c2_set[real, 0, NOT] C.phi = z_phi; // c_side.to_c2_set[real, 0, NOT] C.amp = z_amp; // c_side.to_c2_set[integer, 0, NOT] C.ix_dat = z_ix_dat; } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_wave extern "C" void tao_wave_to_c (const Opaque_tao_wave_class*, CPP_tao_wave&); // c_side.to_f2_arg extern "C" void tao_wave_to_f2 (Opaque_tao_wave_class*, c_Char, c_Real&, c_Real&, c_Real&, c_Real&, c_Real&, c_Real&, c_Real&, c_Real&, c_Real&, c_Real&, c_Real&, c_Real&, c_Real&, c_Real&, c_Real&, c_Real&, c_Real&, c_RealArr, c_RealArr, c_RealArr, c_RealArr, c_RealArr, c_RealArr, c_Int&, c_Int&, c_Int&, c_Int&, c_Int&, c_Int&, c_Int&, c_Int&, c_Int&, c_Int&, c_Int&, c_Int&, c_IntArr, Int, c_Int&, const CPP_tao_wave_kick_pt**, Int, const CPP_tao_graph&, const CPP_ele&); extern "C" void tao_wave_to_f (const CPP_tao_wave& C, Opaque_tao_wave_class* F) { // c_side.to_f_setup[integer, 1, ALLOC] int n1_ix_data = C.ix_data.size(); c_IntArr z_ix_data = NULL; if (n1_ix_data > 0) { z_ix_data = &C.ix_data[0]; } // c_side.to_f_setup[type, 1, ALLOC] int n1_kick = C.kick.size(); const CPP_tao_wave_kick_pt** z_kick = NULL; if (n1_kick != 0) { z_kick = new const CPP_tao_wave_kick_pt*[n1_kick]; for (int i = 0; i < n1_kick; i++) z_kick[i] = &C.kick[i]; } // c_side.to_f2_call tao_wave_to_f2 (F, C.data_type.c_str(), C.rms_rel_a, C.rms_rel_b, C.rms_rel_as, C.rms_rel_bs, C.rms_rel_ar, C.rms_rel_br, C.rms_rel_k, C.rms_rel_ks, C.rms_rel_kr, C.rms_phi, C.rms_phi_s, C.rms_phi_r, C.amp_ba_s, C.amp_ba_r, C.chi_a, C.chi_c, C.chi_ba, &C.amp_a[0], &C.amp_b[0], &C.amp_ba[0], &C.coef_a[0], &C.coef_b[0], &C.coef_ba[0], C.n_func, C.ix_a1, C.ix_a2, C.ix_b1, C.ix_b2, C.i_a1, C.i_a2, C.i_b1, C.i_b2, C.n_a, C.n_b, C.i_wrap_pt, z_ix_data, n1_ix_data, C.n_kick, z_kick, n1_kick, C.graph, C.ele); // c_side.to_f_cleanup[type, 1, ALLOC] delete[] z_kick; } // c_side.to_c2_arg extern "C" void tao_wave_to_c2 (CPP_tao_wave& C, c_Char z_data_type, c_Real& z_rms_rel_a, c_Real& z_rms_rel_b, c_Real& z_rms_rel_as, c_Real& z_rms_rel_bs, c_Real& z_rms_rel_ar, c_Real& z_rms_rel_br, c_Real& z_rms_rel_k, c_Real& z_rms_rel_ks, c_Real& z_rms_rel_kr, c_Real& z_rms_phi, c_Real& z_rms_phi_s, c_Real& z_rms_phi_r, c_Real& z_amp_ba_s, c_Real& z_amp_ba_r, c_Real& z_chi_a, c_Real& z_chi_c, c_Real& z_chi_ba, c_RealArr z_amp_a, c_RealArr z_amp_b, c_RealArr z_amp_ba, c_RealArr z_coef_a, c_RealArr z_coef_b, c_RealArr z_coef_ba, c_Int& z_n_func, c_Int& z_ix_a1, c_Int& z_ix_a2, c_Int& z_ix_b1, c_Int& z_ix_b2, c_Int& z_i_a1, c_Int& z_i_a2, c_Int& z_i_b1, c_Int& z_i_b2, c_Int& z_n_a, c_Int& z_n_b, c_Int& z_i_wrap_pt, c_IntArr z_ix_data, Int n1_ix_data, c_Int& z_n_kick, Opaque_tao_wave_kick_pt_class** z_kick, Int n1_kick, const Opaque_tao_graph_class* z_graph, const Opaque_ele_class* z_ele) { // c_side.to_c2_set[character, 0, NOT] C.data_type = z_data_type; // c_side.to_c2_set[real, 0, NOT] C.rms_rel_a = z_rms_rel_a; // c_side.to_c2_set[real, 0, NOT] C.rms_rel_b = z_rms_rel_b; // c_side.to_c2_set[real, 0, NOT] C.rms_rel_as = z_rms_rel_as; // c_side.to_c2_set[real, 0, NOT] C.rms_rel_bs = z_rms_rel_bs; // c_side.to_c2_set[real, 0, NOT] C.rms_rel_ar = z_rms_rel_ar; // c_side.to_c2_set[real, 0, NOT] C.rms_rel_br = z_rms_rel_br; // c_side.to_c2_set[real, 0, NOT] C.rms_rel_k = z_rms_rel_k; // c_side.to_c2_set[real, 0, NOT] C.rms_rel_ks = z_rms_rel_ks; // c_side.to_c2_set[real, 0, NOT] C.rms_rel_kr = z_rms_rel_kr; // c_side.to_c2_set[real, 0, NOT] C.rms_phi = z_rms_phi; // c_side.to_c2_set[real, 0, NOT] C.rms_phi_s = z_rms_phi_s; // c_side.to_c2_set[real, 0, NOT] C.rms_phi_r = z_rms_phi_r; // c_side.to_c2_set[real, 0, NOT] C.amp_ba_s = z_amp_ba_s; // c_side.to_c2_set[real, 0, NOT] C.amp_ba_r = z_amp_ba_r; // c_side.to_c2_set[real, 0, NOT] C.chi_a = z_chi_a; // c_side.to_c2_set[real, 0, NOT] C.chi_c = z_chi_c; // c_side.to_c2_set[real, 0, NOT] C.chi_ba = z_chi_ba; // c_side.to_c2_set[real, 1, NOT] C.amp_a << z_amp_a; // c_side.to_c2_set[real, 1, NOT] C.amp_b << z_amp_b; // c_side.to_c2_set[real, 1, NOT] C.amp_ba << z_amp_ba; // c_side.to_c2_set[real, 1, NOT] C.coef_a << z_coef_a; // c_side.to_c2_set[real, 1, NOT] C.coef_b << z_coef_b; // c_side.to_c2_set[real, 1, NOT] C.coef_ba << z_coef_ba; // c_side.to_c2_set[integer, 0, NOT] C.n_func = z_n_func; // c_side.to_c2_set[integer, 0, NOT] C.ix_a1 = z_ix_a1; // c_side.to_c2_set[integer, 0, NOT] C.ix_a2 = z_ix_a2; // c_side.to_c2_set[integer, 0, NOT] C.ix_b1 = z_ix_b1; // c_side.to_c2_set[integer, 0, NOT] C.ix_b2 = z_ix_b2; // c_side.to_c2_set[integer, 0, NOT] C.i_a1 = z_i_a1; // c_side.to_c2_set[integer, 0, NOT] C.i_a2 = z_i_a2; // c_side.to_c2_set[integer, 0, NOT] C.i_b1 = z_i_b1; // c_side.to_c2_set[integer, 0, NOT] C.i_b2 = z_i_b2; // c_side.to_c2_set[integer, 0, NOT] C.n_a = z_n_a; // c_side.to_c2_set[integer, 0, NOT] C.n_b = z_n_b; // c_side.to_c2_set[integer, 0, NOT] C.i_wrap_pt = z_i_wrap_pt; // c_side.to_c2_set[integer, 1, ALLOC] C.ix_data.resize(n1_ix_data); C.ix_data << z_ix_data; // c_side.to_c2_set[integer, 0, NOT] C.n_kick = z_n_kick; // c_side.to_c2_set[type, 1, ALLOC] C.kick.resize(n1_kick); for (int i = 0; i < n1_kick; i++) tao_wave_kick_pt_to_c(z_kick[i], C.kick[i]); // c_side.to_c2_set[type, 0, NOT] tao_graph_to_c(z_graph, C.graph); // c_side.to_c2_set[type, 0, NOT] ele_to_c(z_ele, C.ele); } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_title extern "C" void tao_title_to_c (const Opaque_tao_title_class*, CPP_tao_title&); // c_side.to_f2_arg extern "C" void tao_title_to_f2 (Opaque_tao_title_class*, c_Char, c_Real&, c_Real&, c_Char, c_Char, c_Bool&); extern "C" void tao_title_to_f (const CPP_tao_title& C, Opaque_tao_title_class* F) { // c_side.to_f2_call tao_title_to_f2 (F, C.title.c_str(), C.x, C.y, C.units.c_str(), C.justify.c_str(), C.draw_it); } // c_side.to_c2_arg extern "C" void tao_title_to_c2 (CPP_tao_title& C, c_Char z_title, c_Real& z_x, c_Real& z_y, c_Char z_units, c_Char z_justify, c_Bool& z_draw_it) { // c_side.to_c2_set[character, 0, NOT] C.title = z_title; // c_side.to_c2_set[real, 0, NOT] C.x = z_x; // c_side.to_c2_set[real, 0, NOT] C.y = z_y; // c_side.to_c2_set[character, 0, NOT] C.units = z_units; // c_side.to_c2_set[character, 0, NOT] C.justify = z_justify; // c_side.to_c2_set[logical, 0, NOT] C.draw_it = z_draw_it; } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_data_var_component extern "C" void tao_data_var_component_to_c (const Opaque_tao_data_var_component_class*, CPP_tao_data_var_component&); // c_side.to_f2_arg extern "C" void tao_data_var_component_to_f2 (Opaque_tao_data_var_component_class*, c_Char, c_Real&); extern "C" void tao_data_var_component_to_f (const CPP_tao_data_var_component& C, Opaque_tao_data_var_component_class* F) { // c_side.to_f2_call tao_data_var_component_to_f2 (F, C.name.c_str(), C.sign); } // c_side.to_c2_arg extern "C" void tao_data_var_component_to_c2 (CPP_tao_data_var_component& C, c_Char z_name, c_Real& z_sign) { // c_side.to_c2_set[character, 0, NOT] C.name = z_name; // c_side.to_c2_set[real, 0, NOT] C.sign = z_sign; } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_histogram extern "C" void tao_histogram_to_c (const Opaque_tao_histogram_class*, CPP_tao_histogram&); // c_side.to_f2_arg extern "C" void tao_histogram_to_f2 (Opaque_tao_histogram_class*, c_Bool&, c_Bool&, c_Real&, c_Real&, c_Real&, c_Real&, c_Int&); extern "C" void tao_histogram_to_f (const CPP_tao_histogram& C, Opaque_tao_histogram_class* F) { // c_side.to_f2_call tao_histogram_to_f2 (F, C.density_normalized, C.weight_by_charge, C.minimum, C.maximum, C.width, C.center, C.number); } // c_side.to_c2_arg extern "C" void tao_histogram_to_c2 (CPP_tao_histogram& C, c_Bool& z_density_normalized, c_Bool& z_weight_by_charge, c_Real& z_minimum, c_Real& z_maximum, c_Real& z_width, c_Real& z_center, c_Int& z_number) { // c_side.to_c2_set[logical, 0, NOT] C.density_normalized = z_density_normalized; // c_side.to_c2_set[logical, 0, NOT] C.weight_by_charge = z_weight_by_charge; // c_side.to_c2_set[real, 0, NOT] C.minimum = z_minimum; // c_side.to_c2_set[real, 0, NOT] C.maximum = z_maximum; // c_side.to_c2_set[real, 0, NOT] C.width = z_width; // c_side.to_c2_set[real, 0, NOT] C.center = z_center; // c_side.to_c2_set[integer, 0, NOT] C.number = z_number; } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_curve extern "C" void tao_curve_to_c (const Opaque_tao_curve_class*, CPP_tao_curve&); // c_side.to_f2_arg extern "C" void tao_curve_to_f2 (Opaque_tao_curve_class*, c_Char, c_Char, c_Char, c_Char, c_Char, c_Char, c_Char, c_Char, c_Char, c_Char, c_Char, const CPP_tao_graph&, Int, const CPP_tao_histogram&, c_RealArr, Int, c_RealArr, Int, c_RealArr, Int, c_IntArr, Int, c_RealArr, Int, c_RealArr, Int, c_RealArr, Int, c_RealArr, Int, c_IntArr, Int, c_Real&, c_Real&, c_Real&, c_Real&, const CPP_qp_line&, const CPP_qp_symbol&, c_Int&, c_Int&, c_Int&, c_Int&, c_Int&, c_Int&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&); extern "C" void tao_curve_to_f (const CPP_tao_curve& C, Opaque_tao_curve_class* F) { // c_side.to_f_setup[type, 0, PTR] unsigned int n_g = 0; if (C.g != NULL) n_g = 1; // c_side.to_f_setup[real, 1, ALLOC] int n1_x_line = C.x_line.size(); c_RealArr z_x_line = NULL; if (n1_x_line > 0) { z_x_line = &C.x_line[0]; } // c_side.to_f_setup[real, 1, ALLOC] int n1_y_line = C.y_line.size(); c_RealArr z_y_line = NULL; if (n1_y_line > 0) { z_y_line = &C.y_line[0]; } // c_side.to_f_setup[real, 1, ALLOC] int n1_y2_line = C.y2_line.size(); c_RealArr z_y2_line = NULL; if (n1_y2_line > 0) { z_y2_line = &C.y2_line[0]; } // c_side.to_f_setup[integer, 1, ALLOC] int n1_ix_line = C.ix_line.size(); c_IntArr z_ix_line = NULL; if (n1_ix_line > 0) { z_ix_line = &C.ix_line[0]; } // c_side.to_f_setup[real, 1, ALLOC] int n1_x_symb = C.x_symb.size(); c_RealArr z_x_symb = NULL; if (n1_x_symb > 0) { z_x_symb = &C.x_symb[0]; } // c_side.to_f_setup[real, 1, ALLOC] int n1_y_symb = C.y_symb.size(); c_RealArr z_y_symb = NULL; if (n1_y_symb > 0) { z_y_symb = &C.y_symb[0]; } // c_side.to_f_setup[real, 1, ALLOC] int n1_z_symb = C.z_symb.size(); c_RealArr z_z_symb = NULL; if (n1_z_symb > 0) { z_z_symb = &C.z_symb[0]; } // c_side.to_f_setup[real, 1, ALLOC] int n1_symb_size = C.symb_size.size(); c_RealArr z_symb_size = NULL; if (n1_symb_size > 0) { z_symb_size = &C.symb_size[0]; } // c_side.to_f_setup[integer, 1, ALLOC] int n1_ix_symb = C.ix_symb.size(); c_IntArr z_ix_symb = NULL; if (n1_ix_symb > 0) { z_ix_symb = &C.ix_symb[0]; } // c_side.to_f2_call tao_curve_to_f2 (F, C.name.c_str(), C.data_source.c_str(), C.data_index.c_str(), C.data_type_x.c_str(), C.data_type_z.c_str(), C.data_type.c_str(), C.ele_ref_name.c_str(), C.legend_text.c_str(), C.message_text.c_str(), C.units.c_str(), C.component.c_str(), *C.g, n_g, C.hist, z_x_line, n1_x_line, z_y_line, n1_y_line, z_y2_line, n1_y2_line, z_ix_line, n1_ix_line, z_x_symb, n1_x_symb, z_y_symb, n1_y_symb, z_z_symb, n1_z_symb, z_symb_size, n1_symb_size, z_ix_symb, n1_ix_symb, C.y_axis_scale_factor, C.s, C.z_color0, C.z_color1, C.line, C.symbol, C.ix_universe, C.symbol_every, C.ix_branch, C.ix_ele_ref, C.ix_ele_ref_track, C.ix_bunch, C.use_y2, C.draw_line, C.draw_symbols, C.draw_symbol_index, C.smooth_line_calc, C.use_z_color, C.autoscale_z_color); } // c_side.to_c2_arg extern "C" void tao_curve_to_c2 (CPP_tao_curve& C, c_Char z_name, c_Char z_data_source, c_Char z_data_index, c_Char z_data_type_x, c_Char z_data_type_z, c_Char z_data_type, c_Char z_ele_ref_name, c_Char z_legend_text, c_Char z_message_text, c_Char z_units, c_Char z_component, Opaque_tao_graph_class* z_g, Int n_g, const Opaque_tao_histogram_class* z_hist, c_RealArr z_x_line, Int n1_x_line, c_RealArr z_y_line, Int n1_y_line, c_RealArr z_y2_line, Int n1_y2_line, c_IntArr z_ix_line, Int n1_ix_line, c_RealArr z_x_symb, Int n1_x_symb, c_RealArr z_y_symb, Int n1_y_symb, c_RealArr z_z_symb, Int n1_z_symb, c_RealArr z_symb_size, Int n1_symb_size, c_IntArr z_ix_symb, Int n1_ix_symb, c_Real& z_y_axis_scale_factor, c_Real& z_s, c_Real& z_z_color0, c_Real& z_z_color1, const Opaque_qp_line_class* z_line, const Opaque_qp_symbol_class* z_symbol, c_Int& z_ix_universe, c_Int& z_symbol_every, c_Int& z_ix_branch, c_Int& z_ix_ele_ref, c_Int& z_ix_ele_ref_track, c_Int& z_ix_bunch, c_Bool& z_use_y2, c_Bool& z_draw_line, c_Bool& z_draw_symbols, c_Bool& z_draw_symbol_index, c_Bool& z_smooth_line_calc, c_Bool& z_use_z_color, c_Bool& z_autoscale_z_color) { // c_side.to_c2_set[character, 0, NOT] C.name = z_name; // c_side.to_c2_set[character, 0, NOT] C.data_source = z_data_source; // c_side.to_c2_set[character, 0, NOT] C.data_index = z_data_index; // c_side.to_c2_set[character, 0, NOT] C.data_type_x = z_data_type_x; // c_side.to_c2_set[character, 0, NOT] C.data_type_z = z_data_type_z; // c_side.to_c2_set[character, 0, NOT] C.data_type = z_data_type; // c_side.to_c2_set[character, 0, NOT] C.ele_ref_name = z_ele_ref_name; // c_side.to_c2_set[character, 0, NOT] C.legend_text = z_legend_text; // c_side.to_c2_set[character, 0, NOT] C.message_text = z_message_text; // c_side.to_c2_set[character, 0, NOT] C.units = z_units; // c_side.to_c2_set[character, 0, NOT] C.component = z_component; // c_side.to_c2_set[type, 0, PTR] if (n_g == 0) delete C.g; else { C.g = new CPP_tao_graph; tao_graph_to_c(z_g, *C.g); } // c_side.to_c2_set[type, 0, NOT] tao_histogram_to_c(z_hist, C.hist); // c_side.to_c2_set[real, 1, ALLOC] C.x_line.resize(n1_x_line); C.x_line << z_x_line; // c_side.to_c2_set[real, 1, ALLOC] C.y_line.resize(n1_y_line); C.y_line << z_y_line; // c_side.to_c2_set[real, 1, ALLOC] C.y2_line.resize(n1_y2_line); C.y2_line << z_y2_line; // c_side.to_c2_set[integer, 1, ALLOC] C.ix_line.resize(n1_ix_line); C.ix_line << z_ix_line; // c_side.to_c2_set[real, 1, ALLOC] C.x_symb.resize(n1_x_symb); C.x_symb << z_x_symb; // c_side.to_c2_set[real, 1, ALLOC] C.y_symb.resize(n1_y_symb); C.y_symb << z_y_symb; // c_side.to_c2_set[real, 1, ALLOC] C.z_symb.resize(n1_z_symb); C.z_symb << z_z_symb; // c_side.to_c2_set[real, 1, ALLOC] C.symb_size.resize(n1_symb_size); C.symb_size << z_symb_size; // c_side.to_c2_set[integer, 1, ALLOC] C.ix_symb.resize(n1_ix_symb); C.ix_symb << z_ix_symb; // c_side.to_c2_set[real, 0, NOT] C.y_axis_scale_factor = z_y_axis_scale_factor; // c_side.to_c2_set[real, 0, NOT] C.s = z_s; // c_side.to_c2_set[real, 0, NOT] C.z_color0 = z_z_color0; // c_side.to_c2_set[real, 0, NOT] C.z_color1 = z_z_color1; // c_side.to_c2_set[type, 0, NOT] qp_line_to_c(z_line, C.line); // c_side.to_c2_set[type, 0, NOT] qp_symbol_to_c(z_symbol, C.symbol); // c_side.to_c2_set[integer, 0, NOT] C.ix_universe = z_ix_universe; // c_side.to_c2_set[integer, 0, NOT] C.symbol_every = z_symbol_every; // c_side.to_c2_set[integer, 0, NOT] C.ix_branch = z_ix_branch; // c_side.to_c2_set[integer, 0, NOT] C.ix_ele_ref = z_ix_ele_ref; // c_side.to_c2_set[integer, 0, NOT] C.ix_ele_ref_track = z_ix_ele_ref_track; // c_side.to_c2_set[integer, 0, NOT] C.ix_bunch = z_ix_bunch; // c_side.to_c2_set[logical, 0, NOT] C.use_y2 = z_use_y2; // c_side.to_c2_set[logical, 0, NOT] C.draw_line = z_draw_line; // c_side.to_c2_set[logical, 0, NOT] C.draw_symbols = z_draw_symbols; // c_side.to_c2_set[logical, 0, NOT] C.draw_symbol_index = z_draw_symbol_index; // c_side.to_c2_set[logical, 0, NOT] C.smooth_line_calc = z_smooth_line_calc; // c_side.to_c2_set[logical, 0, NOT] C.use_z_color = z_use_z_color; // c_side.to_c2_set[logical, 0, NOT] C.autoscale_z_color = z_autoscale_z_color; } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_graph extern "C" void tao_graph_to_c (const Opaque_tao_graph_class*, CPP_tao_graph&); // c_side.to_f2_arg extern "C" void tao_graph_to_f2 (Opaque_tao_graph_class*, c_Char, c_Char, c_Char, c_Char, c_Char*, c_Char, c_Char, c_Char, c_Char, const CPP_tao_curve**, Int, const CPP_tao_plot&, Int, const CPP_qp_point&, const CPP_qp_point&, const CPP_qp_axis&, const CPP_qp_axis&, const CPP_qp_axis&, const CPP_qp_rect&, const CPP_qp_rect&, c_Real&, c_Real&, c_Real&, c_Real&, c_IntArr, c_Int&, c_Int&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&); extern "C" void tao_graph_to_f (const CPP_tao_graph& C, Opaque_tao_graph_class* F) { // c_side.to_f_setup[character, 1, NOT] c_Char z_text_legend[10]; for (int i = 0; i < 10; i++) {z_text_legend[i] = C.text_legend[i].c_str();} // c_side.to_f_setup[type, 1, ALLOC] int n1_curve = C.curve.size(); const CPP_tao_curve** z_curve = NULL; if (n1_curve != 0) { z_curve = new const CPP_tao_curve*[n1_curve]; for (int i = 0; i < n1_curve; i++) z_curve[i] = &C.curve[i]; } // c_side.to_f_setup[type, 0, PTR] unsigned int n_p = 0; if (C.p != NULL) n_p = 1; // c_side.to_f2_call tao_graph_to_f2 (F, C.name.c_str(), C.type.c_str(), C.title.c_str(), C.title_suffix.c_str(), z_text_legend, C.component.c_str(), C.why_invalid.c_str(), C.floor_plan_view.c_str(), C.floor_plan_orbit_color.c_str(), z_curve, n1_curve, *C.p, n_p, C.text_legend_origin, C.curve_legend_origin, C.x, C.y, C.y2, C.margin, C.scale_margin, C.x_axis_scale_factor, C.symbol_size_scale, C.floor_plan_rotation, C.floor_plan_orbit_scale, &C.box[0], C.ix_branch, C.ix_universe, C.clip, C.valid, C.y2_mirrors_y, C.limited, C.draw_axes, C.correct_xy_distortion, C.floor_plan_size_is_absolute, C.floor_plan_draw_only_first_pass, C.draw_curve_legend, C.draw_grid, C.allow_wrap_around, C.draw_only_good_user_data_or_vars); // c_side.to_f_cleanup[type, 1, ALLOC] delete[] z_curve; } // c_side.to_c2_arg extern "C" void tao_graph_to_c2 (CPP_tao_graph& C, c_Char z_name, c_Char z_type, c_Char z_title, c_Char z_title_suffix, c_Char* z_text_legend, c_Char z_component, c_Char z_why_invalid, c_Char z_floor_plan_view, c_Char z_floor_plan_orbit_color, Opaque_tao_curve_class** z_curve, Int n1_curve, Opaque_tao_plot_class* z_p, Int n_p, const Opaque_qp_point_class* z_text_legend_origin, const Opaque_qp_point_class* z_curve_legend_origin, const Opaque_qp_axis_class* z_x, const Opaque_qp_axis_class* z_y, const Opaque_qp_axis_class* z_y2, const Opaque_qp_rect_class* z_margin, const Opaque_qp_rect_class* z_scale_margin, c_Real& z_x_axis_scale_factor, c_Real& z_symbol_size_scale, c_Real& z_floor_plan_rotation, c_Real& z_floor_plan_orbit_scale, c_IntArr z_box, c_Int& z_ix_branch, c_Int& z_ix_universe, c_Bool& z_clip, c_Bool& z_valid, c_Bool& z_y2_mirrors_y, c_Bool& z_limited, c_Bool& z_draw_axes, c_Bool& z_correct_xy_distortion, c_Bool& z_floor_plan_size_is_absolute, c_Bool& z_floor_plan_draw_only_first_pass, c_Bool& z_draw_curve_legend, c_Bool& z_draw_grid, c_Bool& z_allow_wrap_around, c_Bool& z_draw_only_good_user_data_or_vars) { // c_side.to_c2_set[character, 0, NOT] C.name = z_name; // c_side.to_c2_set[character, 0, NOT] C.type = z_type; // c_side.to_c2_set[character, 0, NOT] C.title = z_title; // c_side.to_c2_set[character, 0, NOT] C.title_suffix = z_title_suffix; // c_side.to_c2_set[character, 1, NOT] for (unsigned int i = 0; i < C.text_legend.size(); i++) C.text_legend[i] = z_text_legend[i]; // c_side.to_c2_set[character, 0, NOT] C.component = z_component; // c_side.to_c2_set[character, 0, NOT] C.why_invalid = z_why_invalid; // c_side.to_c2_set[character, 0, NOT] C.floor_plan_view = z_floor_plan_view; // c_side.to_c2_set[character, 0, NOT] C.floor_plan_orbit_color = z_floor_plan_orbit_color; // c_side.to_c2_set[type, 1, ALLOC] C.curve.resize(n1_curve); for (int i = 0; i < n1_curve; i++) tao_curve_to_c(z_curve[i], C.curve[i]); // c_side.to_c2_set[type, 0, PTR] if (n_p == 0) delete C.p; else { C.p = new CPP_tao_plot; tao_plot_to_c(z_p, *C.p); } // c_side.to_c2_set[type, 0, NOT] qp_point_to_c(z_text_legend_origin, C.text_legend_origin); // c_side.to_c2_set[type, 0, NOT] qp_point_to_c(z_curve_legend_origin, C.curve_legend_origin); // c_side.to_c2_set[type, 0, NOT] qp_axis_to_c(z_x, C.x); // c_side.to_c2_set[type, 0, NOT] qp_axis_to_c(z_y, C.y); // c_side.to_c2_set[type, 0, NOT] qp_axis_to_c(z_y2, C.y2); // c_side.to_c2_set[type, 0, NOT] qp_rect_to_c(z_margin, C.margin); // c_side.to_c2_set[type, 0, NOT] qp_rect_to_c(z_scale_margin, C.scale_margin); // c_side.to_c2_set[real, 0, NOT] C.x_axis_scale_factor = z_x_axis_scale_factor; // c_side.to_c2_set[real, 0, NOT] C.symbol_size_scale = z_symbol_size_scale; // c_side.to_c2_set[real, 0, NOT] C.floor_plan_rotation = z_floor_plan_rotation; // c_side.to_c2_set[real, 0, NOT] C.floor_plan_orbit_scale = z_floor_plan_orbit_scale; // c_side.to_c2_set[integer, 1, NOT] C.box << z_box; // c_side.to_c2_set[integer, 0, NOT] C.ix_branch = z_ix_branch; // c_side.to_c2_set[integer, 0, NOT] C.ix_universe = z_ix_universe; // c_side.to_c2_set[logical, 0, NOT] C.clip = z_clip; // c_side.to_c2_set[logical, 0, NOT] C.valid = z_valid; // c_side.to_c2_set[logical, 0, NOT] C.y2_mirrors_y = z_y2_mirrors_y; // c_side.to_c2_set[logical, 0, NOT] C.limited = z_limited; // c_side.to_c2_set[logical, 0, NOT] C.draw_axes = z_draw_axes; // c_side.to_c2_set[logical, 0, NOT] C.correct_xy_distortion = z_correct_xy_distortion; // c_side.to_c2_set[logical, 0, NOT] C.floor_plan_size_is_absolute = z_floor_plan_size_is_absolute; // c_side.to_c2_set[logical, 0, NOT] C.floor_plan_draw_only_first_pass = z_floor_plan_draw_only_first_pass; // c_side.to_c2_set[logical, 0, NOT] C.draw_curve_legend = z_draw_curve_legend; // c_side.to_c2_set[logical, 0, NOT] C.draw_grid = z_draw_grid; // c_side.to_c2_set[logical, 0, NOT] C.allow_wrap_around = z_allow_wrap_around; // c_side.to_c2_set[logical, 0, NOT] C.draw_only_good_user_data_or_vars = z_draw_only_good_user_data_or_vars; } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_plot extern "C" void tao_plot_to_c (const Opaque_tao_plot_class*, CPP_tao_plot&); // c_side.to_f2_arg extern "C" void tao_plot_to_f2 (Opaque_tao_plot_class*, c_Char, c_Char, const CPP_tao_graph**, Int, const CPP_qp_axis&, const CPP_tao_plot_region&, Int, c_Int&, c_Char, c_Char, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&); extern "C" void tao_plot_to_f (const CPP_tao_plot& C, Opaque_tao_plot_class* F) { // c_side.to_f_setup[type, 1, ALLOC] int n1_graph = C.graph.size(); const CPP_tao_graph** z_graph = NULL; if (n1_graph != 0) { z_graph = new const CPP_tao_graph*[n1_graph]; for (int i = 0; i < n1_graph; i++) z_graph[i] = &C.graph[i]; } // c_side.to_f_setup[type, 0, PTR] unsigned int n_r = 0; if (C.r != NULL) n_r = 1; // c_side.to_f2_call tao_plot_to_f2 (F, C.name.c_str(), C.description.c_str(), z_graph, n1_graph, C.x, *C.r, n_r, C.n_curve_pts, C.type.c_str(), C.x_axis_type.c_str(), C.autoscale_x, C.autoscale_y, C.autoscale_gang_x, C.autoscale_gang_y, C.list_with_show_plot_command, C.phantom); // c_side.to_f_cleanup[type, 1, ALLOC] delete[] z_graph; } // c_side.to_c2_arg extern "C" void tao_plot_to_c2 (CPP_tao_plot& C, c_Char z_name, c_Char z_description, Opaque_tao_graph_class** z_graph, Int n1_graph, const Opaque_qp_axis_class* z_x, Opaque_tao_plot_region_class* z_r, Int n_r, c_Int& z_n_curve_pts, c_Char z_type, c_Char z_x_axis_type, c_Bool& z_autoscale_x, c_Bool& z_autoscale_y, c_Bool& z_autoscale_gang_x, c_Bool& z_autoscale_gang_y, c_Bool& z_list_with_show_plot_command, c_Bool& z_phantom) { // c_side.to_c2_set[character, 0, NOT] C.name = z_name; // c_side.to_c2_set[character, 0, NOT] C.description = z_description; // c_side.to_c2_set[type, 1, ALLOC] C.graph.resize(n1_graph); for (int i = 0; i < n1_graph; i++) tao_graph_to_c(z_graph[i], C.graph[i]); // c_side.to_c2_set[type, 0, NOT] qp_axis_to_c(z_x, C.x); // c_side.to_c2_set[type, 0, PTR] if (n_r == 0) delete C.r; else { C.r = new CPP_tao_plot_region; tao_plot_region_to_c(z_r, *C.r); } // c_side.to_c2_set[integer, 0, NOT] C.n_curve_pts = z_n_curve_pts; // c_side.to_c2_set[character, 0, NOT] C.type = z_type; // c_side.to_c2_set[character, 0, NOT] C.x_axis_type = z_x_axis_type; // c_side.to_c2_set[logical, 0, NOT] C.autoscale_x = z_autoscale_x; // c_side.to_c2_set[logical, 0, NOT] C.autoscale_y = z_autoscale_y; // c_side.to_c2_set[logical, 0, NOT] C.autoscale_gang_x = z_autoscale_gang_x; // c_side.to_c2_set[logical, 0, NOT] C.autoscale_gang_y = z_autoscale_gang_y; // c_side.to_c2_set[logical, 0, NOT] C.list_with_show_plot_command = z_list_with_show_plot_command; // c_side.to_c2_set[logical, 0, NOT] C.phantom = z_phantom; } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_plot_region extern "C" void tao_plot_region_to_c (const Opaque_tao_plot_region_class*, CPP_tao_plot_region&); // c_side.to_f2_arg extern "C" void tao_plot_region_to_f2 (Opaque_tao_plot_region_class*, c_Char, const CPP_tao_plot&, c_RealArr, c_Bool&, c_Bool&); extern "C" void tao_plot_region_to_f (const CPP_tao_plot_region& C, Opaque_tao_plot_region_class* F) { // c_side.to_f2_call tao_plot_region_to_f2 (F, C.name.c_str(), C.plot, &C.location[0], C.visible, C.list_with_show_plot_command); } // c_side.to_c2_arg extern "C" void tao_plot_region_to_c2 (CPP_tao_plot_region& C, c_Char z_name, const Opaque_tao_plot_class* z_plot, c_RealArr z_location, c_Bool& z_visible, c_Bool& z_list_with_show_plot_command) { // c_side.to_c2_set[character, 0, NOT] C.name = z_name; // c_side.to_c2_set[type, 0, NOT] tao_plot_to_c(z_plot, C.plot); // c_side.to_c2_set[real, 1, NOT] C.location << z_location; // c_side.to_c2_set[logical, 0, NOT] C.visible = z_visible; // c_side.to_c2_set[logical, 0, NOT] C.list_with_show_plot_command = z_list_with_show_plot_command; } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_plot_page extern "C" void tao_plot_page_to_c (const Opaque_tao_plot_page_class*, CPP_tao_plot_page&); // c_side.to_f2_arg extern "C" void tao_plot_page_to_f2 (Opaque_tao_plot_page_class*, const CPP_tao_title**, const CPP_qp_rect&, const CPP_tao_drawing&, const CPP_tao_drawing&, const CPP_tao_shape_pattern**, Int, const CPP_tao_plot**, Int, const CPP_tao_plot_region**, Int, c_Char, c_Char, c_RealArr, c_Real&, c_Real&, c_Real&, c_Real&, c_Real&, c_Real&, c_Real&, c_Real&, c_Real&, c_Real&, c_Real&, c_Int&, c_Int&, c_Bool&); extern "C" void tao_plot_page_to_f (const CPP_tao_plot_page& C, Opaque_tao_plot_page_class* F) { // c_side.to_f_setup[type, 1, NOT] const CPP_tao_title* z_title[2]; for (int i = 0; i < 2; i++) {z_title[i] = &C.title[i];} // c_side.to_f_setup[type, 1, ALLOC] int n1_pattern = C.pattern.size(); const CPP_tao_shape_pattern** z_pattern = NULL; if (n1_pattern != 0) { z_pattern = new const CPP_tao_shape_pattern*[n1_pattern]; for (int i = 0; i < n1_pattern; i++) z_pattern[i] = &C.pattern[i]; } // c_side.to_f_setup[type, 1, ALLOC] int n1_plot_template = C.plot_template.size(); const CPP_tao_plot** z_plot_template = NULL; if (n1_plot_template != 0) { z_plot_template = new const CPP_tao_plot*[n1_plot_template]; for (int i = 0; i < n1_plot_template; i++) z_plot_template[i] = &C.plot_template[i]; } // c_side.to_f_setup[type, 1, ALLOC] int n1_region = C.region.size(); const CPP_tao_plot_region** z_region = NULL; if (n1_region != 0) { z_region = new const CPP_tao_plot_region*[n1_region]; for (int i = 0; i < n1_region; i++) z_region[i] = &C.region[i]; } // c_side.to_f2_call tao_plot_page_to_f2 (F, z_title, C.border, C.floor_plan, C.lat_layout, z_pattern, n1_pattern, z_plot_template, n1_plot_template, z_region, n1_region, C.plot_display_type.c_str(), C.ps_scale.c_str(), &C.size[0], C.text_height, C.main_title_text_scale, C.graph_title_text_scale, C.axis_number_text_scale, C.axis_label_text_scale, C.legend_text_scale, C.key_table_text_scale, C.curve_legend_line_len, C.curve_legend_text_offset, C.floor_plan_shape_scale, C.lat_layout_shape_scale, C.n_curve_pts, C.id_window, C.delete_overlapping_plots); // c_side.to_f_cleanup[type, 1, ALLOC] delete[] z_pattern; // c_side.to_f_cleanup[type, 1, ALLOC] delete[] z_plot_template; // c_side.to_f_cleanup[type, 1, ALLOC] delete[] z_region; } // c_side.to_c2_arg extern "C" void tao_plot_page_to_c2 (CPP_tao_plot_page& C, const Opaque_tao_title_class** z_title, const Opaque_qp_rect_class* z_border, const Opaque_tao_drawing_class* z_floor_plan, const Opaque_tao_drawing_class* z_lat_layout, Opaque_tao_shape_pattern_class** z_pattern, Int n1_pattern, Opaque_tao_plot_class** z_plot_template, Int n1_plot_template, Opaque_tao_plot_region_class** z_region, Int n1_region, c_Char z_plot_display_type, c_Char z_ps_scale, c_RealArr z_size, c_Real& z_text_height, c_Real& z_main_title_text_scale, c_Real& z_graph_title_text_scale, c_Real& z_axis_number_text_scale, c_Real& z_axis_label_text_scale, c_Real& z_legend_text_scale, c_Real& z_key_table_text_scale, c_Real& z_curve_legend_line_len, c_Real& z_curve_legend_text_offset, c_Real& z_floor_plan_shape_scale, c_Real& z_lat_layout_shape_scale, c_Int& z_n_curve_pts, c_Int& z_id_window, c_Bool& z_delete_overlapping_plots) { // c_side.to_c2_set[type, 1, NOT] for (unsigned int i = 0; i < C.title.size(); i++) tao_title_to_c(z_title[i], C.title[i]); // c_side.to_c2_set[type, 0, NOT] qp_rect_to_c(z_border, C.border); // c_side.to_c2_set[type, 0, NOT] tao_drawing_to_c(z_floor_plan, C.floor_plan); // c_side.to_c2_set[type, 0, NOT] tao_drawing_to_c(z_lat_layout, C.lat_layout); // c_side.to_c2_set[type, 1, ALLOC] C.pattern.resize(n1_pattern); for (int i = 0; i < n1_pattern; i++) tao_shape_pattern_to_c(z_pattern[i], C.pattern[i]); // c_side.to_c2_set[type, 1, ALLOC] C.plot_template.resize(n1_plot_template); for (int i = 0; i < n1_plot_template; i++) tao_plot_to_c(z_plot_template[i], C.plot_template[i]); // c_side.to_c2_set[type, 1, ALLOC] C.region.resize(n1_region); for (int i = 0; i < n1_region; i++) tao_plot_region_to_c(z_region[i], C.region[i]); // c_side.to_c2_set[character, 0, NOT] C.plot_display_type = z_plot_display_type; // c_side.to_c2_set[character, 0, NOT] C.ps_scale = z_ps_scale; // c_side.to_c2_set[real, 1, NOT] C.size << z_size; // c_side.to_c2_set[real, 0, NOT] C.text_height = z_text_height; // c_side.to_c2_set[real, 0, NOT] C.main_title_text_scale = z_main_title_text_scale; // c_side.to_c2_set[real, 0, NOT] C.graph_title_text_scale = z_graph_title_text_scale; // c_side.to_c2_set[real, 0, NOT] C.axis_number_text_scale = z_axis_number_text_scale; // c_side.to_c2_set[real, 0, NOT] C.axis_label_text_scale = z_axis_label_text_scale; // c_side.to_c2_set[real, 0, NOT] C.legend_text_scale = z_legend_text_scale; // c_side.to_c2_set[real, 0, NOT] C.key_table_text_scale = z_key_table_text_scale; // c_side.to_c2_set[real, 0, NOT] C.curve_legend_line_len = z_curve_legend_line_len; // c_side.to_c2_set[real, 0, NOT] C.curve_legend_text_offset = z_curve_legend_text_offset; // c_side.to_c2_set[real, 0, NOT] C.floor_plan_shape_scale = z_floor_plan_shape_scale; // c_side.to_c2_set[real, 0, NOT] C.lat_layout_shape_scale = z_lat_layout_shape_scale; // c_side.to_c2_set[integer, 0, NOT] C.n_curve_pts = z_n_curve_pts; // c_side.to_c2_set[integer, 0, NOT] C.id_window = z_id_window; // c_side.to_c2_set[logical, 0, NOT] C.delete_overlapping_plots = z_delete_overlapping_plots; } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_plot_array extern "C" void tao_plot_array_to_c (const Opaque_tao_plot_array_class*, CPP_tao_plot_array&); // c_side.to_f2_arg extern "C" void tao_plot_array_to_f2 (Opaque_tao_plot_array_class*, const CPP_tao_plot&, Int); extern "C" void tao_plot_array_to_f (const CPP_tao_plot_array& C, Opaque_tao_plot_array_class* F) { // c_side.to_f_setup[type, 0, PTR] unsigned int n_p = 0; if (C.p != NULL) n_p = 1; // c_side.to_f2_call tao_plot_array_to_f2 (F, *C.p, n_p); } // c_side.to_c2_arg extern "C" void tao_plot_array_to_c2 (CPP_tao_plot_array& C, Opaque_tao_plot_class* z_p, Int n_p) { // c_side.to_c2_set[type, 0, PTR] if (n_p == 0) delete C.p; else { C.p = new CPP_tao_plot; tao_plot_to_c(z_p, *C.p); } } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_graph_array extern "C" void tao_graph_array_to_c (const Opaque_tao_graph_array_class*, CPP_tao_graph_array&); // c_side.to_f2_arg extern "C" void tao_graph_array_to_f2 (Opaque_tao_graph_array_class*, const CPP_tao_graph&, Int); extern "C" void tao_graph_array_to_f (const CPP_tao_graph_array& C, Opaque_tao_graph_array_class* F) { // c_side.to_f_setup[type, 0, PTR] unsigned int n_g = 0; if (C.g != NULL) n_g = 1; // c_side.to_f2_call tao_graph_array_to_f2 (F, *C.g, n_g); } // c_side.to_c2_arg extern "C" void tao_graph_array_to_c2 (CPP_tao_graph_array& C, Opaque_tao_graph_class* z_g, Int n_g) { // c_side.to_c2_set[type, 0, PTR] if (n_g == 0) delete C.g; else { C.g = new CPP_tao_graph; tao_graph_to_c(z_g, *C.g); } } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_curve_array extern "C" void tao_curve_array_to_c (const Opaque_tao_curve_array_class*, CPP_tao_curve_array&); // c_side.to_f2_arg extern "C" void tao_curve_array_to_f2 (Opaque_tao_curve_array_class*, const CPP_tao_curve&, Int); extern "C" void tao_curve_array_to_f (const CPP_tao_curve_array& C, Opaque_tao_curve_array_class* F) { // c_side.to_f_setup[type, 0, PTR] unsigned int n_c = 0; if (C.c != NULL) n_c = 1; // c_side.to_f2_call tao_curve_array_to_f2 (F, *C.c, n_c); } // c_side.to_c2_arg extern "C" void tao_curve_array_to_c2 (CPP_tao_curve_array& C, Opaque_tao_curve_class* z_c, Int n_c) { // c_side.to_c2_set[type, 0, PTR] if (n_c == 0) delete C.c; else { C.c = new CPP_tao_curve; tao_curve_to_c(z_c, *C.c); } } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_data extern "C" void tao_data_to_c (const Opaque_tao_data_class*, CPP_tao_data&); // c_side.to_f2_arg extern "C" void tao_data_to_f2 (Opaque_tao_data_class*, c_Char, c_Char, c_Char, c_Char, c_Char, c_Char, c_Int&, c_Int&, c_Int&, c_Int&, c_Int&, c_Int&, c_Int&, c_Int&, c_Int&, c_Int&, c_Real&, c_Real&, c_Real&, c_Real&, c_Real&, c_Real&, c_Real&, c_Real&, c_Real&, c_Real&, c_Real&, c_Real&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, const CPP_tao_d1_data&, Int, const CPP_tao_eval_stack1**, Int); extern "C" void tao_data_to_f (const CPP_tao_data& C, Opaque_tao_data_class* F) { // c_side.to_f_setup[type, 0, PTR] unsigned int n_d1 = 0; if (C.d1 != NULL) n_d1 = 1; // c_side.to_f_setup[type, 1, ALLOC] int n1_stack = C.stack.size(); const CPP_tao_eval_stack1** z_stack = NULL; if (n1_stack != 0) { z_stack = new const CPP_tao_eval_stack1*[n1_stack]; for (int i = 0; i < n1_stack; i++) z_stack[i] = &C.stack[i]; } // c_side.to_f2_call tao_data_to_f2 (F, C.ele_name.c_str(), C.ele_start_name.c_str(), C.ele_ref_name.c_str(), C.data_type.c_str(), C.merit_type.c_str(), C.data_source.c_str(), C.ix_bunch, C.ix_branch, C.ix_ele, C.ix_ele_start, C.ix_ele_ref, C.ix_ele_merit, C.ix_d1, C.ix_data, C.ix_dmodel, C.eval_point, C.meas_value, C.ref_value, C.model_value, C.design_value, C.old_value, C.base_value, C.delta_merit, C.weight, C.invalid_value, C.merit, C.s, C.s_offset, C.exists, C.good_model, C.good_base, C.good_design, C.good_meas, C.good_ref, C.good_user, C.good_opt, C.good_plot, C.useit_plot, C.useit_opt, *C.d1, n_d1, z_stack, n1_stack); // c_side.to_f_cleanup[type, 1, ALLOC] delete[] z_stack; } // c_side.to_c2_arg extern "C" void tao_data_to_c2 (CPP_tao_data& C, c_Char z_ele_name, c_Char z_ele_start_name, c_Char z_ele_ref_name, c_Char z_data_type, c_Char z_merit_type, c_Char z_data_source, c_Int& z_ix_bunch, c_Int& z_ix_branch, c_Int& z_ix_ele, c_Int& z_ix_ele_start, c_Int& z_ix_ele_ref, c_Int& z_ix_ele_merit, c_Int& z_ix_d1, c_Int& z_ix_data, c_Int& z_ix_dmodel, c_Int& z_eval_point, c_Real& z_meas_value, c_Real& z_ref_value, c_Real& z_model_value, c_Real& z_design_value, c_Real& z_old_value, c_Real& z_base_value, c_Real& z_delta_merit, c_Real& z_weight, c_Real& z_invalid_value, c_Real& z_merit, c_Real& z_s, c_Real& z_s_offset, c_Bool& z_exists, c_Bool& z_good_model, c_Bool& z_good_base, c_Bool& z_good_design, c_Bool& z_good_meas, c_Bool& z_good_ref, c_Bool& z_good_user, c_Bool& z_good_opt, c_Bool& z_good_plot, c_Bool& z_useit_plot, c_Bool& z_useit_opt, Opaque_tao_d1_data_class* z_d1, Int n_d1, Opaque_tao_eval_stack1_class** z_stack, Int n1_stack) { // c_side.to_c2_set[character, 0, NOT] C.ele_name = z_ele_name; // c_side.to_c2_set[character, 0, NOT] C.ele_start_name = z_ele_start_name; // c_side.to_c2_set[character, 0, NOT] C.ele_ref_name = z_ele_ref_name; // c_side.to_c2_set[character, 0, NOT] C.data_type = z_data_type; // c_side.to_c2_set[character, 0, NOT] C.merit_type = z_merit_type; // c_side.to_c2_set[character, 0, NOT] C.data_source = z_data_source; // c_side.to_c2_set[integer, 0, NOT] C.ix_bunch = z_ix_bunch; // c_side.to_c2_set[integer, 0, NOT] C.ix_branch = z_ix_branch; // c_side.to_c2_set[integer, 0, NOT] C.ix_ele = z_ix_ele; // c_side.to_c2_set[integer, 0, NOT] C.ix_ele_start = z_ix_ele_start; // c_side.to_c2_set[integer, 0, NOT] C.ix_ele_ref = z_ix_ele_ref; // c_side.to_c2_set[integer, 0, NOT] C.ix_ele_merit = z_ix_ele_merit; // c_side.to_c2_set[integer, 0, NOT] C.ix_d1 = z_ix_d1; // c_side.to_c2_set[integer, 0, NOT] C.ix_data = z_ix_data; // c_side.to_c2_set[integer, 0, NOT] C.ix_dmodel = z_ix_dmodel; // c_side.to_c2_set[integer, 0, NOT] C.eval_point = z_eval_point; // c_side.to_c2_set[real, 0, NOT] C.meas_value = z_meas_value; // c_side.to_c2_set[real, 0, NOT] C.ref_value = z_ref_value; // c_side.to_c2_set[real, 0, NOT] C.model_value = z_model_value; // c_side.to_c2_set[real, 0, NOT] C.design_value = z_design_value; // c_side.to_c2_set[real, 0, NOT] C.old_value = z_old_value; // c_side.to_c2_set[real, 0, NOT] C.base_value = z_base_value; // c_side.to_c2_set[real, 0, NOT] C.delta_merit = z_delta_merit; // c_side.to_c2_set[real, 0, NOT] C.weight = z_weight; // c_side.to_c2_set[real, 0, NOT] C.invalid_value = z_invalid_value; // c_side.to_c2_set[real, 0, NOT] C.merit = z_merit; // c_side.to_c2_set[real, 0, NOT] C.s = z_s; // c_side.to_c2_set[real, 0, NOT] C.s_offset = z_s_offset; // c_side.to_c2_set[logical, 0, NOT] C.exists = z_exists; // c_side.to_c2_set[logical, 0, NOT] C.good_model = z_good_model; // c_side.to_c2_set[logical, 0, NOT] C.good_base = z_good_base; // c_side.to_c2_set[logical, 0, NOT] C.good_design = z_good_design; // c_side.to_c2_set[logical, 0, NOT] C.good_meas = z_good_meas; // c_side.to_c2_set[logical, 0, NOT] C.good_ref = z_good_ref; // c_side.to_c2_set[logical, 0, NOT] C.good_user = z_good_user; // c_side.to_c2_set[logical, 0, NOT] C.good_opt = z_good_opt; // c_side.to_c2_set[logical, 0, NOT] C.good_plot = z_good_plot; // c_side.to_c2_set[logical, 0, NOT] C.useit_plot = z_useit_plot; // c_side.to_c2_set[logical, 0, NOT] C.useit_opt = z_useit_opt; // c_side.to_c2_set[type, 0, PTR] if (n_d1 == 0) delete C.d1; else { C.d1 = new CPP_tao_d1_data; tao_d1_data_to_c(z_d1, *C.d1); } // c_side.to_c2_set[type, 1, ALLOC] C.stack.resize(n1_stack); for (int i = 0; i < n1_stack; i++) tao_eval_stack1_to_c(z_stack[i], C.stack[i]); } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_d1_data extern "C" void tao_d1_data_to_c (const Opaque_tao_d1_data_class*, CPP_tao_d1_data&); // c_side.to_f2_arg extern "C" void tao_d1_data_to_f2 (Opaque_tao_d1_data_class*, c_Char, const CPP_tao_d2_data&, Int, const CPP_tao_data**, Int); extern "C" void tao_d1_data_to_f (const CPP_tao_d1_data& C, Opaque_tao_d1_data_class* F) { // c_side.to_f_setup[type, 0, PTR] unsigned int n_d2 = 0; if (C.d2 != NULL) n_d2 = 1; // c_side.to_f_setup[type, 1, PTR] int n1_d = C.d.size(); const CPP_tao_data** z_d = NULL; if (n1_d != 0) { z_d = new const CPP_tao_data*[n1_d]; for (int i = 0; i < n1_d; i++) z_d[i] = &C.d[i]; } // c_side.to_f2_call tao_d1_data_to_f2 (F, C.name.c_str(), *C.d2, n_d2, z_d, n1_d); // c_side.to_f_cleanup[type, 1, PTR] delete[] z_d; } // c_side.to_c2_arg extern "C" void tao_d1_data_to_c2 (CPP_tao_d1_data& C, c_Char z_name, Opaque_tao_d2_data_class* z_d2, Int n_d2, Opaque_tao_data_class** z_d, Int n1_d) { // c_side.to_c2_set[character, 0, NOT] C.name = z_name; // c_side.to_c2_set[type, 0, PTR] if (n_d2 == 0) delete C.d2; else { C.d2 = new CPP_tao_d2_data; tao_d2_data_to_c(z_d2, *C.d2); } // c_side.to_c2_set[type, 1, PTR] C.d.resize(n1_d); for (int i = 0; i < n1_d; i++) tao_data_to_c(z_d[i], C.d[i]); } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_d2_data extern "C" void tao_d2_data_to_c (const Opaque_tao_d2_data_class*, CPP_tao_d2_data&); // c_side.to_f2_arg extern "C" void tao_d2_data_to_f2 (Opaque_tao_d2_data_class*, c_Char, c_Char, c_Char, c_Char, c_Char, c_Char*, const CPP_tao_d1_data**, Int, c_Int&, c_Int&, c_Int&, c_Int&, c_Bool&, c_Bool&); extern "C" void tao_d2_data_to_f (const CPP_tao_d2_data& C, Opaque_tao_d2_data_class* F) { // c_side.to_f_setup[character, 1, NOT] c_Char z_descrip[10]; for (int i = 0; i < 10; i++) {z_descrip[i] = C.descrip[i].c_str();} // c_side.to_f_setup[type, 1, ALLOC] int n1_d1 = C.d1.size(); const CPP_tao_d1_data** z_d1 = NULL; if (n1_d1 != 0) { z_d1 = new const CPP_tao_d1_data*[n1_d1]; for (int i = 0; i < n1_d1; i++) z_d1[i] = &C.d1[i]; } // c_side.to_f2_call tao_d2_data_to_f2 (F, C.name.c_str(), C.data_file_name.c_str(), C.ref_file_name.c_str(), C.data_date.c_str(), C.ref_date.c_str(), z_descrip, z_d1, n1_d1, C.ix_uni, C.ix_d2_data, C.ix_data, C.ix_ref, C.data_read_in, C.ref_read_in); // c_side.to_f_cleanup[type, 1, ALLOC] delete[] z_d1; } // c_side.to_c2_arg extern "C" void tao_d2_data_to_c2 (CPP_tao_d2_data& C, c_Char z_name, c_Char z_data_file_name, c_Char z_ref_file_name, c_Char z_data_date, c_Char z_ref_date, c_Char* z_descrip, Opaque_tao_d1_data_class** z_d1, Int n1_d1, c_Int& z_ix_uni, c_Int& z_ix_d2_data, c_Int& z_ix_data, c_Int& z_ix_ref, c_Bool& z_data_read_in, c_Bool& z_ref_read_in) { // c_side.to_c2_set[character, 0, NOT] C.name = z_name; // c_side.to_c2_set[character, 0, NOT] C.data_file_name = z_data_file_name; // c_side.to_c2_set[character, 0, NOT] C.ref_file_name = z_ref_file_name; // c_side.to_c2_set[character, 0, NOT] C.data_date = z_data_date; // c_side.to_c2_set[character, 0, NOT] C.ref_date = z_ref_date; // c_side.to_c2_set[character, 1, NOT] for (unsigned int i = 0; i < C.descrip.size(); i++) C.descrip[i] = z_descrip[i]; // c_side.to_c2_set[type, 1, ALLOC] C.d1.resize(n1_d1); for (int i = 0; i < n1_d1; i++) tao_d1_data_to_c(z_d1[i], C.d1[i]); // c_side.to_c2_set[integer, 0, NOT] C.ix_uni = z_ix_uni; // c_side.to_c2_set[integer, 0, NOT] C.ix_d2_data = z_ix_d2_data; // c_side.to_c2_set[integer, 0, NOT] C.ix_data = z_ix_data; // c_side.to_c2_set[integer, 0, NOT] C.ix_ref = z_ix_ref; // c_side.to_c2_set[logical, 0, NOT] C.data_read_in = z_data_read_in; // c_side.to_c2_set[logical, 0, NOT] C.ref_read_in = z_ref_read_in; } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_data_array extern "C" void tao_data_array_to_c (const Opaque_tao_data_array_class*, CPP_tao_data_array&); // c_side.to_f2_arg extern "C" void tao_data_array_to_f2 (Opaque_tao_data_array_class*, const CPP_tao_data&, Int); extern "C" void tao_data_array_to_f (const CPP_tao_data_array& C, Opaque_tao_data_array_class* F) { // c_side.to_f_setup[type, 0, PTR] unsigned int n_d = 0; if (C.d != NULL) n_d = 1; // c_side.to_f2_call tao_data_array_to_f2 (F, *C.d, n_d); } // c_side.to_c2_arg extern "C" void tao_data_array_to_c2 (CPP_tao_data_array& C, Opaque_tao_data_class* z_d, Int n_d) { // c_side.to_c2_set[type, 0, PTR] if (n_d == 0) delete C.d; else { C.d = new CPP_tao_data; tao_data_to_c(z_d, *C.d); } } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_d1_data_array extern "C" void tao_d1_data_array_to_c (const Opaque_tao_d1_data_array_class*, CPP_tao_d1_data_array&); // c_side.to_f2_arg extern "C" void tao_d1_data_array_to_f2 (Opaque_tao_d1_data_array_class*, const CPP_tao_d1_data&, Int); extern "C" void tao_d1_data_array_to_f (const CPP_tao_d1_data_array& C, Opaque_tao_d1_data_array_class* F) { // c_side.to_f_setup[type, 0, PTR] unsigned int n_d1 = 0; if (C.d1 != NULL) n_d1 = 1; // c_side.to_f2_call tao_d1_data_array_to_f2 (F, *C.d1, n_d1); } // c_side.to_c2_arg extern "C" void tao_d1_data_array_to_c2 (CPP_tao_d1_data_array& C, Opaque_tao_d1_data_class* z_d1, Int n_d1) { // c_side.to_c2_set[type, 0, PTR] if (n_d1 == 0) delete C.d1; else { C.d1 = new CPP_tao_d1_data; tao_d1_data_to_c(z_d1, *C.d1); } } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_d2_data_array extern "C" void tao_d2_data_array_to_c (const Opaque_tao_d2_data_array_class*, CPP_tao_d2_data_array&); // c_side.to_f2_arg extern "C" void tao_d2_data_array_to_f2 (Opaque_tao_d2_data_array_class*, const CPP_tao_d2_data&, Int); extern "C" void tao_d2_data_array_to_f (const CPP_tao_d2_data_array& C, Opaque_tao_d2_data_array_class* F) { // c_side.to_f_setup[type, 0, PTR] unsigned int n_d2 = 0; if (C.d2 != NULL) n_d2 = 1; // c_side.to_f2_call tao_d2_data_array_to_f2 (F, *C.d2, n_d2); } // c_side.to_c2_arg extern "C" void tao_d2_data_array_to_c2 (CPP_tao_d2_data_array& C, Opaque_tao_d2_data_class* z_d2, Int n_d2) { // c_side.to_c2_set[type, 0, PTR] if (n_d2 == 0) delete C.d2; else { C.d2 = new CPP_tao_d2_data; tao_d2_data_to_c(z_d2, *C.d2); } } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_var_slave extern "C" void tao_var_slave_to_c (const Opaque_tao_var_slave_class*, CPP_tao_var_slave&); // c_side.to_f2_arg extern "C" void tao_var_slave_to_f2 (Opaque_tao_var_slave_class*, c_Int&, c_Int&, c_Int&, c_RealArr, Int, c_RealArr, Int); extern "C" void tao_var_slave_to_f (const CPP_tao_var_slave& C, Opaque_tao_var_slave_class* F) { // c_side.to_f_setup[real, 0, PTR] unsigned int n_model_value = 0; if (C.model_value != NULL) n_model_value = 1; // c_side.to_f_setup[real, 0, PTR] unsigned int n_base_value = 0; if (C.base_value != NULL) n_base_value = 1; // c_side.to_f2_call tao_var_slave_to_f2 (F, C.ix_uni, C.ix_branch, C.ix_ele, C.model_value, n_model_value, C.base_value, n_base_value); } // c_side.to_c2_arg extern "C" void tao_var_slave_to_c2 (CPP_tao_var_slave& C, c_Int& z_ix_uni, c_Int& z_ix_branch, c_Int& z_ix_ele, c_RealArr z_model_value, Int n_model_value, c_RealArr z_base_value, Int n_base_value) { // c_side.to_c2_set[integer, 0, NOT] C.ix_uni = z_ix_uni; // c_side.to_c2_set[integer, 0, NOT] C.ix_branch = z_ix_branch; // c_side.to_c2_set[integer, 0, NOT] C.ix_ele = z_ix_ele; // c_side.to_c2_set[real, 0, PTR] if (n_model_value == 0) delete C.model_value; else { C.model_value = new Real; *C.model_value = *z_model_value; } // c_side.to_c2_set[real, 0, PTR] if (n_base_value == 0) delete C.base_value; else { C.base_value = new Real; *C.base_value = *z_base_value; } } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_var extern "C" void tao_var_to_c (const Opaque_tao_var_class*, CPP_tao_var&); // c_side.to_f2_arg extern "C" void tao_var_to_f2 (Opaque_tao_var_class*, c_Char, c_Char, const CPP_tao_var_slave**, Int, const CPP_tao_var_slave&, c_Int&, c_Int&, c_Int&, c_Int&, c_Int&, c_RealArr, Int, c_RealArr, Int, c_Real&, c_Real&, c_Real&, c_Real&, c_Real&, c_Real&, c_Real&, c_Real&, c_Real&, c_Real&, c_Real&, c_Real&, c_Real&, c_Real&, c_Real&, c_Real&, c_Char, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, const CPP_tao_v1_var&, Int); extern "C" void tao_var_to_f (const CPP_tao_var& C, Opaque_tao_var_class* F) { // c_side.to_f_setup[type, 1, ALLOC] int n1_slave = C.slave.size(); const CPP_tao_var_slave** z_slave = NULL; if (n1_slave != 0) { z_slave = new const CPP_tao_var_slave*[n1_slave]; for (int i = 0; i < n1_slave; i++) z_slave[i] = &C.slave[i]; } // c_side.to_f_setup[real, 0, PTR] unsigned int n_model_value = 0; if (C.model_value != NULL) n_model_value = 1; // c_side.to_f_setup[real, 0, PTR] unsigned int n_base_value = 0; if (C.base_value != NULL) n_base_value = 1; // c_side.to_f_setup[type, 0, PTR] unsigned int n_v1 = 0; if (C.v1 != NULL) n_v1 = 1; // c_side.to_f2_call tao_var_to_f2 (F, C.ele_name.c_str(), C.attrib_name.c_str(), z_slave, n1_slave, C.common_slave, C.ix_v1, C.ix_var, C.ix_dvar, C.ix_attrib, C.ix_key_table, C.model_value, n_model_value, C.base_value, n_base_value, C.design_value, C.scratch_value, C.old_value, C.meas_value, C.ref_value, C.correction_value, C.high_lim, C.low_lim, C.step, C.weight, C.delta_merit, C.merit, C.dmerit_dvar, C.key_val0, C.key_delta, C.s, C.merit_type.c_str(), C.exists, C.good_var, C.good_user, C.good_opt, C.good_plot, C.useit_opt, C.useit_plot, C.key_bound, *C.v1, n_v1); // c_side.to_f_cleanup[type, 1, ALLOC] delete[] z_slave; } // c_side.to_c2_arg extern "C" void tao_var_to_c2 (CPP_tao_var& C, c_Char z_ele_name, c_Char z_attrib_name, Opaque_tao_var_slave_class** z_slave, Int n1_slave, const Opaque_tao_var_slave_class* z_common_slave, c_Int& z_ix_v1, c_Int& z_ix_var, c_Int& z_ix_dvar, c_Int& z_ix_attrib, c_Int& z_ix_key_table, c_RealArr z_model_value, Int n_model_value, c_RealArr z_base_value, Int n_base_value, c_Real& z_design_value, c_Real& z_scratch_value, c_Real& z_old_value, c_Real& z_meas_value, c_Real& z_ref_value, c_Real& z_correction_value, c_Real& z_high_lim, c_Real& z_low_lim, c_Real& z_step, c_Real& z_weight, c_Real& z_delta_merit, c_Real& z_merit, c_Real& z_dmerit_dvar, c_Real& z_key_val0, c_Real& z_key_delta, c_Real& z_s, c_Char z_merit_type, c_Bool& z_exists, c_Bool& z_good_var, c_Bool& z_good_user, c_Bool& z_good_opt, c_Bool& z_good_plot, c_Bool& z_useit_opt, c_Bool& z_useit_plot, c_Bool& z_key_bound, Opaque_tao_v1_var_class* z_v1, Int n_v1) { // c_side.to_c2_set[character, 0, NOT] C.ele_name = z_ele_name; // c_side.to_c2_set[character, 0, NOT] C.attrib_name = z_attrib_name; // c_side.to_c2_set[type, 1, ALLOC] C.slave.resize(n1_slave); for (int i = 0; i < n1_slave; i++) tao_var_slave_to_c(z_slave[i], C.slave[i]); // c_side.to_c2_set[type, 0, NOT] tao_var_slave_to_c(z_common_slave, C.common_slave); // c_side.to_c2_set[integer, 0, NOT] C.ix_v1 = z_ix_v1; // c_side.to_c2_set[integer, 0, NOT] C.ix_var = z_ix_var; // c_side.to_c2_set[integer, 0, NOT] C.ix_dvar = z_ix_dvar; // c_side.to_c2_set[integer, 0, NOT] C.ix_attrib = z_ix_attrib; // c_side.to_c2_set[integer, 0, NOT] C.ix_key_table = z_ix_key_table; // c_side.to_c2_set[real, 0, PTR] if (n_model_value == 0) delete C.model_value; else { C.model_value = new Real; *C.model_value = *z_model_value; } // c_side.to_c2_set[real, 0, PTR] if (n_base_value == 0) delete C.base_value; else { C.base_value = new Real; *C.base_value = *z_base_value; } // c_side.to_c2_set[real, 0, NOT] C.design_value = z_design_value; // c_side.to_c2_set[real, 0, NOT] C.scratch_value = z_scratch_value; // c_side.to_c2_set[real, 0, NOT] C.old_value = z_old_value; // c_side.to_c2_set[real, 0, NOT] C.meas_value = z_meas_value; // c_side.to_c2_set[real, 0, NOT] C.ref_value = z_ref_value; // c_side.to_c2_set[real, 0, NOT] C.correction_value = z_correction_value; // c_side.to_c2_set[real, 0, NOT] C.high_lim = z_high_lim; // c_side.to_c2_set[real, 0, NOT] C.low_lim = z_low_lim; // c_side.to_c2_set[real, 0, NOT] C.step = z_step; // c_side.to_c2_set[real, 0, NOT] C.weight = z_weight; // c_side.to_c2_set[real, 0, NOT] C.delta_merit = z_delta_merit; // c_side.to_c2_set[real, 0, NOT] C.merit = z_merit; // c_side.to_c2_set[real, 0, NOT] C.dmerit_dvar = z_dmerit_dvar; // c_side.to_c2_set[real, 0, NOT] C.key_val0 = z_key_val0; // c_side.to_c2_set[real, 0, NOT] C.key_delta = z_key_delta; // c_side.to_c2_set[real, 0, NOT] C.s = z_s; // c_side.to_c2_set[character, 0, NOT] C.merit_type = z_merit_type; // c_side.to_c2_set[logical, 0, NOT] C.exists = z_exists; // c_side.to_c2_set[logical, 0, NOT] C.good_var = z_good_var; // c_side.to_c2_set[logical, 0, NOT] C.good_user = z_good_user; // c_side.to_c2_set[logical, 0, NOT] C.good_opt = z_good_opt; // c_side.to_c2_set[logical, 0, NOT] C.good_plot = z_good_plot; // c_side.to_c2_set[logical, 0, NOT] C.useit_opt = z_useit_opt; // c_side.to_c2_set[logical, 0, NOT] C.useit_plot = z_useit_plot; // c_side.to_c2_set[logical, 0, NOT] C.key_bound = z_key_bound; // c_side.to_c2_set[type, 0, PTR] if (n_v1 == 0) delete C.v1; else { C.v1 = new CPP_tao_v1_var; tao_v1_var_to_c(z_v1, *C.v1); } } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_v1_var extern "C" void tao_v1_var_to_c (const Opaque_tao_v1_var_class*, CPP_tao_v1_var&); // c_side.to_f2_arg extern "C" void tao_v1_var_to_f2 (Opaque_tao_v1_var_class*, c_Char, c_Int&, const CPP_tao_var**, Int); extern "C" void tao_v1_var_to_f (const CPP_tao_v1_var& C, Opaque_tao_v1_var_class* F) { // c_side.to_f_setup[type, 1, PTR] int n1_v = C.v.size(); const CPP_tao_var** z_v = NULL; if (n1_v != 0) { z_v = new const CPP_tao_var*[n1_v]; for (int i = 0; i < n1_v; i++) z_v[i] = &C.v[i]; } // c_side.to_f2_call tao_v1_var_to_f2 (F, C.name.c_str(), C.ix_v1_var, z_v, n1_v); // c_side.to_f_cleanup[type, 1, PTR] delete[] z_v; } // c_side.to_c2_arg extern "C" void tao_v1_var_to_c2 (CPP_tao_v1_var& C, c_Char z_name, c_Int& z_ix_v1_var, Opaque_tao_var_class** z_v, Int n1_v) { // c_side.to_c2_set[character, 0, NOT] C.name = z_name; // c_side.to_c2_set[integer, 0, NOT] C.ix_v1_var = z_ix_v1_var; // c_side.to_c2_set[type, 1, PTR] C.v.resize(n1_v); for (int i = 0; i < n1_v; i++) tao_var_to_c(z_v[i], C.v[i]); } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_var_array extern "C" void tao_var_array_to_c (const Opaque_tao_var_array_class*, CPP_tao_var_array&); // c_side.to_f2_arg extern "C" void tao_var_array_to_f2 (Opaque_tao_var_array_class*, const CPP_tao_var&, Int); extern "C" void tao_var_array_to_f (const CPP_tao_var_array& C, Opaque_tao_var_array_class* F) { // c_side.to_f_setup[type, 0, PTR] unsigned int n_v = 0; if (C.v != NULL) n_v = 1; // c_side.to_f2_call tao_var_array_to_f2 (F, *C.v, n_v); } // c_side.to_c2_arg extern "C" void tao_var_array_to_c2 (CPP_tao_var_array& C, Opaque_tao_var_class* z_v, Int n_v) { // c_side.to_c2_set[type, 0, PTR] if (n_v == 0) delete C.v; else { C.v = new CPP_tao_var; tao_var_to_c(z_v, *C.v); } } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_v1_var_array extern "C" void tao_v1_var_array_to_c (const Opaque_tao_v1_var_array_class*, CPP_tao_v1_var_array&); // c_side.to_f2_arg extern "C" void tao_v1_var_array_to_f2 (Opaque_tao_v1_var_array_class*, const CPP_tao_v1_var&, Int); extern "C" void tao_v1_var_array_to_f (const CPP_tao_v1_var_array& C, Opaque_tao_v1_var_array_class* F) { // c_side.to_f_setup[type, 0, PTR] unsigned int n_v1 = 0; if (C.v1 != NULL) n_v1 = 1; // c_side.to_f2_call tao_v1_var_array_to_f2 (F, *C.v1, n_v1); } // c_side.to_c2_arg extern "C" void tao_v1_var_array_to_c2 (CPP_tao_v1_var_array& C, Opaque_tao_v1_var_class* z_v1, Int n_v1) { // c_side.to_c2_set[type, 0, PTR] if (n_v1 == 0) delete C.v1; else { C.v1 = new CPP_tao_v1_var; tao_v1_var_to_c(z_v1, *C.v1); } } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_building_wall_point extern "C" void tao_building_wall_point_to_c (const Opaque_tao_building_wall_point_class*, CPP_tao_building_wall_point&); // c_side.to_f2_arg extern "C" void tao_building_wall_point_to_f2 (Opaque_tao_building_wall_point_class*, c_Real&, c_Real&, c_Real&, c_Real&, c_Real&); extern "C" void tao_building_wall_point_to_f (const CPP_tao_building_wall_point& C, Opaque_tao_building_wall_point_class* F) { // c_side.to_f2_call tao_building_wall_point_to_f2 (F, C.z, C.x, C.radius, C.z_center, C.x_center); } // c_side.to_c2_arg extern "C" void tao_building_wall_point_to_c2 (CPP_tao_building_wall_point& C, c_Real& z_z, c_Real& z_x, c_Real& z_radius, c_Real& z_z_center, c_Real& z_x_center) { // c_side.to_c2_set[real, 0, NOT] C.z = z_z; // c_side.to_c2_set[real, 0, NOT] C.x = z_x; // c_side.to_c2_set[real, 0, NOT] C.radius = z_radius; // c_side.to_c2_set[real, 0, NOT] C.z_center = z_z_center; // c_side.to_c2_set[real, 0, NOT] C.x_center = z_x_center; } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_building_wall_section extern "C" void tao_building_wall_section_to_c (const Opaque_tao_building_wall_section_class*, CPP_tao_building_wall_section&); // c_side.to_f2_arg extern "C" void tao_building_wall_section_to_f2 (Opaque_tao_building_wall_section_class*, c_Char, const CPP_tao_building_wall_point**, Int); extern "C" void tao_building_wall_section_to_f (const CPP_tao_building_wall_section& C, Opaque_tao_building_wall_section_class* F) { // c_side.to_f_setup[type, 1, ALLOC] int n1_point = C.point.size(); const CPP_tao_building_wall_point** z_point = NULL; if (n1_point != 0) { z_point = new const CPP_tao_building_wall_point*[n1_point]; for (int i = 0; i < n1_point; i++) z_point[i] = &C.point[i]; } // c_side.to_f2_call tao_building_wall_section_to_f2 (F, C.constraint.c_str(), z_point, n1_point); // c_side.to_f_cleanup[type, 1, ALLOC] delete[] z_point; } // c_side.to_c2_arg extern "C" void tao_building_wall_section_to_c2 (CPP_tao_building_wall_section& C, c_Char z_constraint, Opaque_tao_building_wall_point_class** z_point, Int n1_point) { // c_side.to_c2_set[character, 0, NOT] C.constraint = z_constraint; // c_side.to_c2_set[type, 1, ALLOC] C.point.resize(n1_point); for (int i = 0; i < n1_point; i++) tao_building_wall_point_to_c(z_point[i], C.point[i]); } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_building_wall extern "C" void tao_building_wall_to_c (const Opaque_tao_building_wall_class*, CPP_tao_building_wall&); // c_side.to_f2_arg extern "C" void tao_building_wall_to_f2 (Opaque_tao_building_wall_class*, const CPP_tao_building_wall_section**, Int); extern "C" void tao_building_wall_to_f (const CPP_tao_building_wall& C, Opaque_tao_building_wall_class* F) { // c_side.to_f_setup[type, 1, ALLOC] int n1_section = C.section.size(); const CPP_tao_building_wall_section** z_section = NULL; if (n1_section != 0) { z_section = new const CPP_tao_building_wall_section*[n1_section]; for (int i = 0; i < n1_section; i++) z_section[i] = &C.section[i]; } // c_side.to_f2_call tao_building_wall_to_f2 (F, z_section, n1_section); // c_side.to_f_cleanup[type, 1, ALLOC] delete[] z_section; } // c_side.to_c2_arg extern "C" void tao_building_wall_to_c2 (CPP_tao_building_wall& C, Opaque_tao_building_wall_section_class** z_section, Int n1_section) { // c_side.to_c2_set[type, 1, ALLOC] C.section.resize(n1_section); for (int i = 0; i < n1_section; i++) tao_building_wall_section_to_c(z_section[i], C.section[i]); } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_global extern "C" void tao_global_to_c (const Opaque_tao_global_class*, CPP_tao_global&); // c_side.to_f2_arg extern "C" void tao_global_to_f2 (Opaque_tao_global_class*, c_Real&, c_Real&, c_Real&, c_Real&, c_Real&, c_Real&, c_Real&, c_Real&, c_Real&, c_Real&, c_Int&, c_Int&, c_Int&, c_Int&, c_Int&, c_Int&, c_Char, c_Char, c_Char, c_Char, c_Char, c_Char, c_Char, c_Char, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&); extern "C" void tao_global_to_f (const CPP_tao_global& C, Opaque_tao_global_class* F) { // c_side.to_f2_call tao_global_to_f2 (F, C.y_axis_plot_dmin, C.lm_opt_deriv_reinit, C.de_lm_step_ratio, C.de_var_to_population_factor, C.lmdif_eps, C.svd_cutoff, C.unstable_penalty, C.merit_stop_value, C.random_sigma_cutoff, C.delta_e_chrom, C.n_opti_cycles, C.n_opti_loops, C.phase_units, C.bunch_to_plot, C.random_seed, C.n_top10, C.random_engine.c_str(), C.random_gauss_converter.c_str(), C.track_type.c_str(), C.prompt_string.c_str(), C.prompt_color.c_str(), C.optimizer.c_str(), C.print_command.c_str(), C.var_out_file.c_str(), C.initialized, C.opt_with_ref, C.opt_with_base, C.label_lattice_elements, C.label_keys, C.derivative_recalc, C.derivative_uses_design, C.init_plot_needed, C.orm_analysis, C.plot_on, C.lattice_calc_on, C.svd_retreat_on_merit_increase, C.stop_on_error, C.command_file_print_on, C.box_plots, C.beam_timer_on, C.var_limits_on, C.only_limit_opt_vars, C.optimizer_var_limit_warn, C.rf_on, C.draw_curve_off_scale_warn, C.wait_for_cr_in_single_mode, C.disable_smooth_line_calc, C.debug_on, C.single_step, C.optimizer_allow_user_abort, C.quiet); } // c_side.to_c2_arg extern "C" void tao_global_to_c2 (CPP_tao_global& C, c_Real& z_y_axis_plot_dmin, c_Real& z_lm_opt_deriv_reinit, c_Real& z_de_lm_step_ratio, c_Real& z_de_var_to_population_factor, c_Real& z_lmdif_eps, c_Real& z_svd_cutoff, c_Real& z_unstable_penalty, c_Real& z_merit_stop_value, c_Real& z_random_sigma_cutoff, c_Real& z_delta_e_chrom, c_Int& z_n_opti_cycles, c_Int& z_n_opti_loops, c_Int& z_phase_units, c_Int& z_bunch_to_plot, c_Int& z_random_seed, c_Int& z_n_top10, c_Char z_random_engine, c_Char z_random_gauss_converter, c_Char z_track_type, c_Char z_prompt_string, c_Char z_prompt_color, c_Char z_optimizer, c_Char z_print_command, c_Char z_var_out_file, c_Bool& z_initialized, c_Bool& z_opt_with_ref, c_Bool& z_opt_with_base, c_Bool& z_label_lattice_elements, c_Bool& z_label_keys, c_Bool& z_derivative_recalc, c_Bool& z_derivative_uses_design, c_Bool& z_init_plot_needed, c_Bool& z_orm_analysis, c_Bool& z_plot_on, c_Bool& z_lattice_calc_on, c_Bool& z_svd_retreat_on_merit_increase, c_Bool& z_stop_on_error, c_Bool& z_command_file_print_on, c_Bool& z_box_plots, c_Bool& z_beam_timer_on, c_Bool& z_var_limits_on, c_Bool& z_only_limit_opt_vars, c_Bool& z_optimizer_var_limit_warn, c_Bool& z_rf_on, c_Bool& z_draw_curve_off_scale_warn, c_Bool& z_wait_for_cr_in_single_mode, c_Bool& z_disable_smooth_line_calc, c_Bool& z_debug_on, c_Bool& z_single_step, c_Bool& z_optimizer_allow_user_abort, c_Bool& z_quiet) { // c_side.to_c2_set[real, 0, NOT] C.y_axis_plot_dmin = z_y_axis_plot_dmin; // c_side.to_c2_set[real, 0, NOT] C.lm_opt_deriv_reinit = z_lm_opt_deriv_reinit; // c_side.to_c2_set[real, 0, NOT] C.de_lm_step_ratio = z_de_lm_step_ratio; // c_side.to_c2_set[real, 0, NOT] C.de_var_to_population_factor = z_de_var_to_population_factor; // c_side.to_c2_set[real, 0, NOT] C.lmdif_eps = z_lmdif_eps; // c_side.to_c2_set[real, 0, NOT] C.svd_cutoff = z_svd_cutoff; // c_side.to_c2_set[real, 0, NOT] C.unstable_penalty = z_unstable_penalty; // c_side.to_c2_set[real, 0, NOT] C.merit_stop_value = z_merit_stop_value; // c_side.to_c2_set[real, 0, NOT] C.random_sigma_cutoff = z_random_sigma_cutoff; // c_side.to_c2_set[real, 0, NOT] C.delta_e_chrom = z_delta_e_chrom; // c_side.to_c2_set[integer, 0, NOT] C.n_opti_cycles = z_n_opti_cycles; // c_side.to_c2_set[integer, 0, NOT] C.n_opti_loops = z_n_opti_loops; // c_side.to_c2_set[integer, 0, NOT] C.phase_units = z_phase_units; // c_side.to_c2_set[integer, 0, NOT] C.bunch_to_plot = z_bunch_to_plot; // c_side.to_c2_set[integer, 0, NOT] C.random_seed = z_random_seed; // c_side.to_c2_set[integer, 0, NOT] C.n_top10 = z_n_top10; // c_side.to_c2_set[character, 0, NOT] C.random_engine = z_random_engine; // c_side.to_c2_set[character, 0, NOT] C.random_gauss_converter = z_random_gauss_converter; // c_side.to_c2_set[character, 0, NOT] C.track_type = z_track_type; // c_side.to_c2_set[character, 0, NOT] C.prompt_string = z_prompt_string; // c_side.to_c2_set[character, 0, NOT] C.prompt_color = z_prompt_color; // c_side.to_c2_set[character, 0, NOT] C.optimizer = z_optimizer; // c_side.to_c2_set[character, 0, NOT] C.print_command = z_print_command; // c_side.to_c2_set[character, 0, NOT] C.var_out_file = z_var_out_file; // c_side.to_c2_set[logical, 0, NOT] C.initialized = z_initialized; // c_side.to_c2_set[logical, 0, NOT] C.opt_with_ref = z_opt_with_ref; // c_side.to_c2_set[logical, 0, NOT] C.opt_with_base = z_opt_with_base; // c_side.to_c2_set[logical, 0, NOT] C.label_lattice_elements = z_label_lattice_elements; // c_side.to_c2_set[logical, 0, NOT] C.label_keys = z_label_keys; // c_side.to_c2_set[logical, 0, NOT] C.derivative_recalc = z_derivative_recalc; // c_side.to_c2_set[logical, 0, NOT] C.derivative_uses_design = z_derivative_uses_design; // c_side.to_c2_set[logical, 0, NOT] C.init_plot_needed = z_init_plot_needed; // c_side.to_c2_set[logical, 0, NOT] C.orm_analysis = z_orm_analysis; // c_side.to_c2_set[logical, 0, NOT] C.plot_on = z_plot_on; // c_side.to_c2_set[logical, 0, NOT] C.lattice_calc_on = z_lattice_calc_on; // c_side.to_c2_set[logical, 0, NOT] C.svd_retreat_on_merit_increase = z_svd_retreat_on_merit_increase; // c_side.to_c2_set[logical, 0, NOT] C.stop_on_error = z_stop_on_error; // c_side.to_c2_set[logical, 0, NOT] C.command_file_print_on = z_command_file_print_on; // c_side.to_c2_set[logical, 0, NOT] C.box_plots = z_box_plots; // c_side.to_c2_set[logical, 0, NOT] C.beam_timer_on = z_beam_timer_on; // c_side.to_c2_set[logical, 0, NOT] C.var_limits_on = z_var_limits_on; // c_side.to_c2_set[logical, 0, NOT] C.only_limit_opt_vars = z_only_limit_opt_vars; // c_side.to_c2_set[logical, 0, NOT] C.optimizer_var_limit_warn = z_optimizer_var_limit_warn; // c_side.to_c2_set[logical, 0, NOT] C.rf_on = z_rf_on; // c_side.to_c2_set[logical, 0, NOT] C.draw_curve_off_scale_warn = z_draw_curve_off_scale_warn; // c_side.to_c2_set[logical, 0, NOT] C.wait_for_cr_in_single_mode = z_wait_for_cr_in_single_mode; // c_side.to_c2_set[logical, 0, NOT] C.disable_smooth_line_calc = z_disable_smooth_line_calc; // c_side.to_c2_set[logical, 0, NOT] C.debug_on = z_debug_on; // c_side.to_c2_set[logical, 0, NOT] C.single_step = z_single_step; // c_side.to_c2_set[logical, 0, NOT] C.optimizer_allow_user_abort = z_optimizer_allow_user_abort; // c_side.to_c2_set[logical, 0, NOT] C.quiet = z_quiet; } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_alias extern "C" void tao_alias_to_c (const Opaque_tao_alias_class*, CPP_tao_alias&); // c_side.to_f2_arg extern "C" void tao_alias_to_f2 (Opaque_tao_alias_class*, c_Char, c_Char); extern "C" void tao_alias_to_f (const CPP_tao_alias& C, Opaque_tao_alias_class* F) { // c_side.to_f2_call tao_alias_to_f2 (F, C.name.c_str(), C.expanded_str.c_str()); } // c_side.to_c2_arg extern "C" void tao_alias_to_c2 (CPP_tao_alias& C, c_Char z_name, c_Char z_expanded_str) { // c_side.to_c2_set[character, 0, NOT] C.name = z_name; // c_side.to_c2_set[character, 0, NOT] C.expanded_str = z_expanded_str; } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_command_file extern "C" void tao_command_file_to_c (const Opaque_tao_command_file_class*, CPP_tao_command_file&); // c_side.to_f2_arg extern "C" void tao_command_file_to_f2 (Opaque_tao_command_file_class*, c_Char, c_Int&, c_Char*, c_Bool&, c_Int&); extern "C" void tao_command_file_to_f (const CPP_tao_command_file& C, Opaque_tao_command_file_class* F) { // c_side.to_f_setup[character, 1, NOT] c_Char z_cmd_arg[9]; for (int i = 0; i < 9; i++) {z_cmd_arg[i] = C.cmd_arg[i].c_str();} // c_side.to_f2_call tao_command_file_to_f2 (F, C.name.c_str(), C.ix_unit, z_cmd_arg, C.paused, C.n_line); } // c_side.to_c2_arg extern "C" void tao_command_file_to_c2 (CPP_tao_command_file& C, c_Char z_name, c_Int& z_ix_unit, c_Char* z_cmd_arg, c_Bool& z_paused, c_Int& z_n_line) { // c_side.to_c2_set[character, 0, NOT] C.name = z_name; // c_side.to_c2_set[integer, 0, NOT] C.ix_unit = z_ix_unit; // c_side.to_c2_set[character, 1, NOT] for (unsigned int i = 0; i < C.cmd_arg.size(); i++) C.cmd_arg[i] = z_cmd_arg[i]; // c_side.to_c2_set[logical, 0, NOT] C.paused = z_paused; // c_side.to_c2_set[integer, 0, NOT] C.n_line = z_n_line; } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_common extern "C" void tao_common_to_c (const Opaque_tao_common_class*, CPP_tao_common&); // c_side.to_f2_arg extern "C" void tao_common_to_f2 (Opaque_tao_common_class*, const CPP_tao_alias**, const CPP_tao_alias**, const CPP_tao_universe&, Int, const CPP_tao_command_file**, Int, c_RealArr, Int, Int, c_RealArr, Int, Int, c_Real&, c_Int&, c_Int&, c_Int&, c_Int&, c_Int&, c_Int&, c_Int&, c_Int&, c_Int&, c_Int&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Char, c_Char, c_Char, c_Char, c_Char, c_Char, c_Char, c_Char, c_Char, c_Char, c_Char, c_Char, c_Char, c_Char, c_Char, c_Char, c_Char, c_Char*); extern "C" void tao_common_to_f (const CPP_tao_common& C, Opaque_tao_common_class* F) { // c_side.to_f_setup[type, 1, NOT] const CPP_tao_alias* z_alias[200]; for (int i = 0; i < 200; i++) {z_alias[i] = &C.alias[i];} // c_side.to_f_setup[type, 1, NOT] const CPP_tao_alias* z_key[100]; for (int i = 0; i < 100; i++) {z_key[i] = &C.key[i];} // c_side.to_f_setup[type, 0, PTR] unsigned int n_u_working = 0; if (C.u_working != NULL) n_u_working = 1; // c_side.to_f_setup[type, 1, ALLOC] int n1_cmd_file = C.cmd_file.size(); const CPP_tao_command_file** z_cmd_file = NULL; if (n1_cmd_file != 0) { z_cmd_file = new const CPP_tao_command_file*[n1_cmd_file]; for (int i = 0; i < n1_cmd_file; i++) z_cmd_file[i] = &C.cmd_file[i]; } // c_side.to_f_setup[real, 2, ALLOC] int n1_covar = C.covar.size(), n2_covar = 0; Real* z_covar = NULL; if (n1_covar > 0) { n2_covar = C.covar[0].size(); z_covar = new Real [n1_covar*n2_covar]; matrix_to_vec (C.covar, z_covar); } // c_side.to_f_setup[real, 2, ALLOC] int n1_alpha = C.alpha.size(), n2_alpha = 0; Real* z_alpha = NULL; if (n1_alpha > 0) { n2_alpha = C.alpha[0].size(); z_alpha = new Real [n1_alpha*n2_alpha]; matrix_to_vec (C.alpha, z_alpha); } // c_side.to_f_setup[character, 1, NOT] c_Char z_valid_plot_who[10]; for (int i = 0; i < 10; i++) {z_valid_plot_who[i] = C.valid_plot_who[i].c_str();} // c_side.to_f2_call tao_common_to_f2 (F, z_alias, z_key, *C.u_working, n_u_working, z_cmd_file, n1_cmd_file, z_covar, n1_covar, n2_covar, z_alpha, n1_alpha, n2_alpha, C.dummy_target, C.ix_ref_taylor, C.ix_ele_taylor, C.n_alias, C.cmd_file_level, C.ix_key_bank, C.n_universes, C.default_universe, C.default_branch, C.ix_history, C.n_history, C.cmd_file_paused, C.use_cmd_here, C.multi_commands_here, C.cmd_from_cmd_file, C.use_saved_beam_in_tracking, C.single_mode, C.combine_consecutive_elements_of_like_name, C.common_lattice, C.init_beam, C.init_var, C.init_read_lat_info, C.init_data, C.parse_cmd_args, C.optimizer_running, C.have_datums_using_expressions, C.noplot_arg_set, C.init_tao_file_arg_set, C.log_startup, C.print_to_terminal, C.cmd.c_str(), C.init_name.c_str(), C.lat_file.c_str(), C.init_tao_file.c_str(), C.init_tao_file_path.c_str(), C.beam_file.c_str(), C.beam_all_file.c_str(), C.beam0_file.c_str(), C.data_file.c_str(), C.plot_file.c_str(), C.startup_file.c_str(), C.var_file.c_str(), C.building_wall_file.c_str(), C.hook_init_file.c_str(), C.plot_geometry.c_str(), C.single_mode_buffer.c_str(), C.unique_name_suffix.c_str(), z_valid_plot_who); // c_side.to_f_cleanup[type, 1, ALLOC] delete[] z_cmd_file; // c_side.to_f_cleanup[real, 2, ALLOC] delete[] z_covar; // c_side.to_f_cleanup[real, 2, ALLOC] delete[] z_alpha; } // c_side.to_c2_arg extern "C" void tao_common_to_c2 (CPP_tao_common& C, const Opaque_tao_alias_class** z_alias, const Opaque_tao_alias_class** z_key, Opaque_tao_universe_class* z_u_working, Int n_u_working, Opaque_tao_command_file_class** z_cmd_file, Int n1_cmd_file, c_RealArr z_covar, Int n1_covar, Int n2_covar, c_RealArr z_alpha, Int n1_alpha, Int n2_alpha, c_Real& z_dummy_target, c_Int& z_ix_ref_taylor, c_Int& z_ix_ele_taylor, c_Int& z_n_alias, c_Int& z_cmd_file_level, c_Int& z_ix_key_bank, c_Int& z_n_universes, c_Int& z_default_universe, c_Int& z_default_branch, c_Int& z_ix_history, c_Int& z_n_history, c_Bool& z_cmd_file_paused, c_Bool& z_use_cmd_here, c_Bool& z_multi_commands_here, c_Bool& z_cmd_from_cmd_file, c_Bool& z_use_saved_beam_in_tracking, c_Bool& z_single_mode, c_Bool& z_combine_consecutive_elements_of_like_name, c_Bool& z_common_lattice, c_Bool& z_init_beam, c_Bool& z_init_var, c_Bool& z_init_read_lat_info, c_Bool& z_init_data, c_Bool& z_parse_cmd_args, c_Bool& z_optimizer_running, c_Bool& z_have_datums_using_expressions, c_Bool& z_noplot_arg_set, c_Bool& z_init_tao_file_arg_set, c_Bool& z_log_startup, c_Bool& z_print_to_terminal, c_Char z_cmd, c_Char z_init_name, c_Char z_lat_file, c_Char z_init_tao_file, c_Char z_init_tao_file_path, c_Char z_beam_file, c_Char z_beam_all_file, c_Char z_beam0_file, c_Char z_data_file, c_Char z_plot_file, c_Char z_startup_file, c_Char z_var_file, c_Char z_building_wall_file, c_Char z_hook_init_file, c_Char z_plot_geometry, c_Char z_single_mode_buffer, c_Char z_unique_name_suffix, c_Char* z_valid_plot_who) { // c_side.to_c2_set[type, 1, NOT] for (unsigned int i = 0; i < C.alias.size(); i++) tao_alias_to_c(z_alias[i], C.alias[i]); // c_side.to_c2_set[type, 1, NOT] for (unsigned int i = 0; i < C.key.size(); i++) tao_alias_to_c(z_key[i], C.key[i]); // c_side.to_c2_set[type, 0, PTR] if (n_u_working == 0) delete C.u_working; else { C.u_working = new CPP_tao_universe; tao_universe_to_c(z_u_working, *C.u_working); } // c_side.to_c2_set[type, 1, ALLOC] C.cmd_file.resize(n1_cmd_file); for (int i = 0; i < n1_cmd_file; i++) tao_command_file_to_c(z_cmd_file[i], C.cmd_file[i]); // c_side.to_c2_set[real, 2, ALLOC] C.covar.resize(n1_covar); for (int i = 0; i < n1_covar; i++) C.covar[i].resize(n2_covar); C.covar << z_covar; // c_side.to_c2_set[real, 2, ALLOC] C.alpha.resize(n1_alpha); for (int i = 0; i < n1_alpha; i++) C.alpha[i].resize(n2_alpha); C.alpha << z_alpha; // c_side.to_c2_set[real, 0, NOT] C.dummy_target = z_dummy_target; // c_side.to_c2_set[integer, 0, NOT] C.ix_ref_taylor = z_ix_ref_taylor; // c_side.to_c2_set[integer, 0, NOT] C.ix_ele_taylor = z_ix_ele_taylor; // c_side.to_c2_set[integer, 0, NOT] C.n_alias = z_n_alias; // c_side.to_c2_set[integer, 0, NOT] C.cmd_file_level = z_cmd_file_level; // c_side.to_c2_set[integer, 0, NOT] C.ix_key_bank = z_ix_key_bank; // c_side.to_c2_set[integer, 0, NOT] C.n_universes = z_n_universes; // c_side.to_c2_set[integer, 0, NOT] C.default_universe = z_default_universe; // c_side.to_c2_set[integer, 0, NOT] C.default_branch = z_default_branch; // c_side.to_c2_set[integer, 0, NOT] C.ix_history = z_ix_history; // c_side.to_c2_set[integer, 0, NOT] C.n_history = z_n_history; // c_side.to_c2_set[logical, 0, NOT] C.cmd_file_paused = z_cmd_file_paused; // c_side.to_c2_set[logical, 0, NOT] C.use_cmd_here = z_use_cmd_here; // c_side.to_c2_set[logical, 0, NOT] C.multi_commands_here = z_multi_commands_here; // c_side.to_c2_set[logical, 0, NOT] C.cmd_from_cmd_file = z_cmd_from_cmd_file; // c_side.to_c2_set[logical, 0, NOT] C.use_saved_beam_in_tracking = z_use_saved_beam_in_tracking; // c_side.to_c2_set[logical, 0, NOT] C.single_mode = z_single_mode; // c_side.to_c2_set[logical, 0, NOT] C.combine_consecutive_elements_of_like_name = z_combine_consecutive_elements_of_like_name; // c_side.to_c2_set[logical, 0, NOT] C.common_lattice = z_common_lattice; // c_side.to_c2_set[logical, 0, NOT] C.init_beam = z_init_beam; // c_side.to_c2_set[logical, 0, NOT] C.init_var = z_init_var; // c_side.to_c2_set[logical, 0, NOT] C.init_read_lat_info = z_init_read_lat_info; // c_side.to_c2_set[logical, 0, NOT] C.init_data = z_init_data; // c_side.to_c2_set[logical, 0, NOT] C.parse_cmd_args = z_parse_cmd_args; // c_side.to_c2_set[logical, 0, NOT] C.optimizer_running = z_optimizer_running; // c_side.to_c2_set[logical, 0, NOT] C.have_datums_using_expressions = z_have_datums_using_expressions; // c_side.to_c2_set[logical, 0, NOT] C.noplot_arg_set = z_noplot_arg_set; // c_side.to_c2_set[logical, 0, NOT] C.init_tao_file_arg_set = z_init_tao_file_arg_set; // c_side.to_c2_set[logical, 0, NOT] C.log_startup = z_log_startup; // c_side.to_c2_set[logical, 0, NOT] C.print_to_terminal = z_print_to_terminal; // c_side.to_c2_set[character, 0, NOT] C.cmd = z_cmd; // c_side.to_c2_set[character, 0, NOT] C.init_name = z_init_name; // c_side.to_c2_set[character, 0, NOT] C.lat_file = z_lat_file; // c_side.to_c2_set[character, 0, NOT] C.init_tao_file = z_init_tao_file; // c_side.to_c2_set[character, 0, NOT] C.init_tao_file_path = z_init_tao_file_path; // c_side.to_c2_set[character, 0, NOT] C.beam_file = z_beam_file; // c_side.to_c2_set[character, 0, NOT] C.beam_all_file = z_beam_all_file; // c_side.to_c2_set[character, 0, NOT] C.beam0_file = z_beam0_file; // c_side.to_c2_set[character, 0, NOT] C.data_file = z_data_file; // c_side.to_c2_set[character, 0, NOT] C.plot_file = z_plot_file; // c_side.to_c2_set[character, 0, NOT] C.startup_file = z_startup_file; // c_side.to_c2_set[character, 0, NOT] C.var_file = z_var_file; // c_side.to_c2_set[character, 0, NOT] C.building_wall_file = z_building_wall_file; // c_side.to_c2_set[character, 0, NOT] C.hook_init_file = z_hook_init_file; // c_side.to_c2_set[character, 0, NOT] C.plot_geometry = z_plot_geometry; // c_side.to_c2_set[character, 0, NOT] C.single_mode_buffer = z_single_mode_buffer; // c_side.to_c2_set[character, 0, NOT] C.unique_name_suffix = z_unique_name_suffix; // c_side.to_c2_set[character, 1, NOT] for (unsigned int i = 0; i < C.valid_plot_who.size(); i++) C.valid_plot_who[i] = z_valid_plot_who[i]; } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_lat_mode extern "C" void tao_lat_mode_to_c (const Opaque_tao_lat_mode_class*, CPP_tao_lat_mode&); // c_side.to_f2_arg extern "C" void tao_lat_mode_to_f2 (Opaque_tao_lat_mode_class*, c_Real&, c_Real&); extern "C" void tao_lat_mode_to_f (const CPP_tao_lat_mode& C, Opaque_tao_lat_mode_class* F) { // c_side.to_f2_call tao_lat_mode_to_f2 (F, C.chrom, C.growth_rate); } // c_side.to_c2_arg extern "C" void tao_lat_mode_to_c2 (CPP_tao_lat_mode& C, c_Real& z_chrom, c_Real& z_growth_rate) { // c_side.to_c2_set[real, 0, NOT] C.chrom = z_chrom; // c_side.to_c2_set[real, 0, NOT] C.growth_rate = z_growth_rate; } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_sigma_mat extern "C" void tao_sigma_mat_to_c (const Opaque_tao_sigma_mat_class*, CPP_tao_sigma_mat&); // c_side.to_f2_arg extern "C" void tao_sigma_mat_to_f2 (Opaque_tao_sigma_mat_class*, c_RealArr); extern "C" void tao_sigma_mat_to_f (const CPP_tao_sigma_mat& C, Opaque_tao_sigma_mat_class* F) { // c_side.to_f_setup[real, 2, NOT] Real z_sigma[6*6]; matrix_to_vec(C.sigma, z_sigma); // c_side.to_f2_call tao_sigma_mat_to_f2 (F, z_sigma); } // c_side.to_c2_arg extern "C" void tao_sigma_mat_to_c2 (CPP_tao_sigma_mat& C, c_RealArr z_sigma) { // c_side.to_c2_set[real, 2, NOT] C.sigma << z_sigma; } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_lattice_branch extern "C" void tao_lattice_branch_to_c (const Opaque_tao_lattice_branch_class*, CPP_tao_lattice_branch&); // c_side.to_f2_arg extern "C" void tao_lattice_branch_to_f2 (Opaque_tao_lattice_branch_class*, const CPP_bunch_params**, Int, const CPP_tao_sigma_mat**, Int, const CPP_coord**, Int, const CPP_coord&, const CPP_lat&, const CPP_lat&, c_Int&, c_Bool&, const CPP_normal_modes&, const CPP_rad_int_all_ele&, const CPP_tao_lat_mode&, const CPP_tao_lat_mode&, c_Int&, const CPP_normal_modes&, const CPP_rad_int_all_ele&); extern "C" void tao_lattice_branch_to_f (const CPP_tao_lattice_branch& C, Opaque_tao_lattice_branch_class* F) { // c_side.to_f_setup[type, 1, ALLOC] int n1_bunch_params = C.bunch_params.size(); const CPP_bunch_params** z_bunch_params = NULL; if (n1_bunch_params != 0) { z_bunch_params = new const CPP_bunch_params*[n1_bunch_params]; for (int i = 0; i < n1_bunch_params; i++) z_bunch_params[i] = &C.bunch_params[i]; } // c_side.to_f_setup[type, 1, ALLOC] int n1_linear = C.linear.size(); const CPP_tao_sigma_mat** z_linear = NULL; if (n1_linear != 0) { z_linear = new const CPP_tao_sigma_mat*[n1_linear]; for (int i = 0; i < n1_linear; i++) z_linear[i] = &C.linear[i]; } // c_side.to_f_setup[type, 1, ALLOC] int n1_orbit = C.orbit.size(); const CPP_coord** z_orbit = NULL; if (n1_orbit != 0) { z_orbit = new const CPP_coord*[n1_orbit]; for (int i = 0; i < n1_orbit; i++) z_orbit[i] = &C.orbit[i]; } // c_side.to_f2_call tao_lattice_branch_to_f2 (F, z_bunch_params, n1_bunch_params, z_linear, n1_linear, z_orbit, n1_orbit, C.orb0, C.high_e_lat, C.low_e_lat, C.track_state, C.has_open_match_element, C.modes, C.rad_int, C.a, C.b, C.ix_rad_int_cache, C.modes_rf_on, C.rad_int_rf_on); // c_side.to_f_cleanup[type, 1, ALLOC] delete[] z_bunch_params; // c_side.to_f_cleanup[type, 1, ALLOC] delete[] z_linear; // c_side.to_f_cleanup[type, 1, ALLOC] delete[] z_orbit; } // c_side.to_c2_arg extern "C" void tao_lattice_branch_to_c2 (CPP_tao_lattice_branch& C, Opaque_bunch_params_class** z_bunch_params, Int n1_bunch_params, Opaque_tao_sigma_mat_class** z_linear, Int n1_linear, Opaque_coord_class** z_orbit, Int n1_orbit, const Opaque_coord_class* z_orb0, const Opaque_lat_class* z_high_e_lat, const Opaque_lat_class* z_low_e_lat, c_Int& z_track_state, c_Bool& z_has_open_match_element, const Opaque_normal_modes_class* z_modes, const Opaque_rad_int_all_ele_class* z_rad_int, const Opaque_tao_lat_mode_class* z_a, const Opaque_tao_lat_mode_class* z_b, c_Int& z_ix_rad_int_cache, const Opaque_normal_modes_class* z_modes_rf_on, const Opaque_rad_int_all_ele_class* z_rad_int_rf_on) { // c_side.to_c2_set[type, 1, ALLOC] C.bunch_params.resize(n1_bunch_params); for (int i = 0; i < n1_bunch_params; i++) bunch_params_to_c(z_bunch_params[i], C.bunch_params[i]); // c_side.to_c2_set[type, 1, ALLOC] C.linear.resize(n1_linear); for (int i = 0; i < n1_linear; i++) tao_sigma_mat_to_c(z_linear[i], C.linear[i]); // c_side.to_c2_set[type, 1, ALLOC] C.orbit.resize(n1_orbit); for (int i = 0; i < n1_orbit; i++) coord_to_c(z_orbit[i], C.orbit[i]); // c_side.to_c2_set[type, 0, NOT] coord_to_c(z_orb0, C.orb0); // c_side.to_c2_set[type, 0, NOT] lat_to_c(z_high_e_lat, C.high_e_lat); // c_side.to_c2_set[type, 0, NOT] lat_to_c(z_low_e_lat, C.low_e_lat); // c_side.to_c2_set[integer, 0, NOT] C.track_state = z_track_state; // c_side.to_c2_set[logical, 0, NOT] C.has_open_match_element = z_has_open_match_element; // c_side.to_c2_set[type, 0, NOT] normal_modes_to_c(z_modes, C.modes); // c_side.to_c2_set[type, 0, NOT] rad_int_all_ele_to_c(z_rad_int, C.rad_int); // c_side.to_c2_set[type, 0, NOT] tao_lat_mode_to_c(z_a, C.a); // c_side.to_c2_set[type, 0, NOT] tao_lat_mode_to_c(z_b, C.b); // c_side.to_c2_set[integer, 0, NOT] C.ix_rad_int_cache = z_ix_rad_int_cache; // c_side.to_c2_set[type, 0, NOT] normal_modes_to_c(z_modes_rf_on, C.modes_rf_on); // c_side.to_c2_set[type, 0, NOT] rad_int_all_ele_to_c(z_rad_int_rf_on, C.rad_int_rf_on); } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_lattice extern "C" void tao_lattice_to_c (const Opaque_tao_lattice_class*, CPP_tao_lattice&); // c_side.to_f2_arg extern "C" void tao_lattice_to_f2 (Opaque_tao_lattice_class*, const CPP_lat&, const CPP_tao_lattice_branch**, Int); extern "C" void tao_lattice_to_f (const CPP_tao_lattice& C, Opaque_tao_lattice_class* F) { // c_side.to_f_setup[type, 1, ALLOC] int n1_tao_branch = C.tao_branch.size(); const CPP_tao_lattice_branch** z_tao_branch = NULL; if (n1_tao_branch != 0) { z_tao_branch = new const CPP_tao_lattice_branch*[n1_tao_branch]; for (int i = 0; i < n1_tao_branch; i++) z_tao_branch[i] = &C.tao_branch[i]; } // c_side.to_f2_call tao_lattice_to_f2 (F, C.lat, z_tao_branch, n1_tao_branch); // c_side.to_f_cleanup[type, 1, ALLOC] delete[] z_tao_branch; } // c_side.to_c2_arg extern "C" void tao_lattice_to_c2 (CPP_tao_lattice& C, const Opaque_lat_class* z_lat, Opaque_tao_lattice_branch_class** z_tao_branch, Int n1_tao_branch) { // c_side.to_c2_set[type, 0, NOT] lat_to_c(z_lat, C.lat); // c_side.to_c2_set[type, 1, ALLOC] C.tao_branch.resize(n1_tao_branch); for (int i = 0; i < n1_tao_branch; i++) tao_lattice_branch_to_c(z_tao_branch[i], C.tao_branch[i]); } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_element extern "C" void tao_element_to_c (const Opaque_tao_element_class*, CPP_tao_element&); // c_side.to_f2_arg extern "C" void tao_element_to_f2 (Opaque_tao_element_class*, const CPP_beam&, c_Bool&); extern "C" void tao_element_to_f (const CPP_tao_element& C, Opaque_tao_element_class* F) { // c_side.to_f2_call tao_element_to_f2 (F, C.beam, C.save_beam); } // c_side.to_c2_arg extern "C" void tao_element_to_c2 (CPP_tao_element& C, const Opaque_beam_class* z_beam, c_Bool& z_save_beam) { // c_side.to_c2_set[type, 0, NOT] beam_to_c(z_beam, C.beam); // c_side.to_c2_set[logical, 0, NOT] C.save_beam = z_save_beam; } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_ping_scale extern "C" void tao_ping_scale_to_c (const Opaque_tao_ping_scale_class*, CPP_tao_ping_scale&); // c_side.to_f2_arg extern "C" void tao_ping_scale_to_f2 (Opaque_tao_ping_scale_class*, c_Real&, c_Real&, c_Real&, c_Real&); extern "C" void tao_ping_scale_to_f (const CPP_tao_ping_scale& C, Opaque_tao_ping_scale_class* F) { // c_side.to_f2_call tao_ping_scale_to_f2 (F, C.a_mode_meas, C.a_mode_ref, C.b_mode_meas, C.b_mode_ref); } // c_side.to_c2_arg extern "C" void tao_ping_scale_to_c2 (CPP_tao_ping_scale& C, c_Real& z_a_mode_meas, c_Real& z_a_mode_ref, c_Real& z_b_mode_meas, c_Real& z_b_mode_ref) { // c_side.to_c2_set[real, 0, NOT] C.a_mode_meas = z_a_mode_meas; // c_side.to_c2_set[real, 0, NOT] C.a_mode_ref = z_a_mode_ref; // c_side.to_c2_set[real, 0, NOT] C.b_mode_meas = z_b_mode_meas; // c_side.to_c2_set[real, 0, NOT] C.b_mode_ref = z_b_mode_ref; } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_universe_branch extern "C" void tao_universe_branch_to_c (const Opaque_tao_universe_branch_class*, CPP_tao_universe_branch&); // c_side.to_f2_arg extern "C" void tao_universe_branch_to_f2 (Opaque_tao_universe_branch_class*, const CPP_tao_element**, Int, c_Char, c_Char, c_Int&, c_Int&); extern "C" void tao_universe_branch_to_f (const CPP_tao_universe_branch& C, Opaque_tao_universe_branch_class* F) { // c_side.to_f_setup[type, 1, ALLOC] int n1_ele = C.ele.size(); const CPP_tao_element** z_ele = NULL; if (n1_ele != 0) { z_ele = new const CPP_tao_element*[n1_ele]; for (int i = 0; i < n1_ele; i++) z_ele[i] = &C.ele[i]; } // c_side.to_f2_call tao_universe_branch_to_f2 (F, z_ele, n1_ele, C.track_start.c_str(), C.track_end.c_str(), C.ix_track_start, C.ix_track_end); // c_side.to_f_cleanup[type, 1, ALLOC] delete[] z_ele; } // c_side.to_c2_arg extern "C" void tao_universe_branch_to_c2 (CPP_tao_universe_branch& C, Opaque_tao_element_class** z_ele, Int n1_ele, c_Char z_track_start, c_Char z_track_end, c_Int& z_ix_track_start, c_Int& z_ix_track_end) { // c_side.to_c2_set[type, 1, ALLOC] C.ele.resize(n1_ele); for (int i = 0; i < n1_ele; i++) tao_element_to_c(z_ele[i], C.ele[i]); // c_side.to_c2_set[character, 0, NOT] C.track_start = z_track_start; // c_side.to_c2_set[character, 0, NOT] C.track_end = z_track_end; // c_side.to_c2_set[integer, 0, NOT] C.ix_track_start = z_ix_track_start; // c_side.to_c2_set[integer, 0, NOT] C.ix_track_end = z_ix_track_end; } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_beam extern "C" void tao_beam_to_c (const Opaque_tao_beam_class*, CPP_tao_beam&); // c_side.to_f2_arg extern "C" void tao_beam_to_f2 (Opaque_tao_beam_class*, const CPP_beam_init&, const CPP_beam&, c_Bool&, c_Char, c_Char, c_Char); extern "C" void tao_beam_to_f (const CPP_tao_beam& C, Opaque_tao_beam_class* F) { // c_side.to_f2_call tao_beam_to_f2 (F, C.beam_init, C.start, C.init_beam0, C.beam_all_file.c_str(), C.beam0_file.c_str(), C.saved_at.c_str()); } // c_side.to_c2_arg extern "C" void tao_beam_to_c2 (CPP_tao_beam& C, const Opaque_beam_init_class* z_beam_init, const Opaque_beam_class* z_start, c_Bool& z_init_beam0, c_Char z_beam_all_file, c_Char z_beam0_file, c_Char z_saved_at) { // c_side.to_c2_set[type, 0, NOT] beam_init_to_c(z_beam_init, C.beam_init); // c_side.to_c2_set[type, 0, NOT] beam_to_c(z_start, C.start); // c_side.to_c2_set[logical, 0, NOT] C.init_beam0 = z_init_beam0; // c_side.to_c2_set[character, 0, NOT] C.beam_all_file = z_beam_all_file; // c_side.to_c2_set[character, 0, NOT] C.beam0_file = z_beam0_file; // c_side.to_c2_set[character, 0, NOT] C.saved_at = z_saved_at; } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_universe_calc extern "C" void tao_universe_calc_to_c (const Opaque_tao_universe_calc_class*, CPP_tao_universe_calc&); // c_side.to_f2_arg extern "C" void tao_universe_calc_to_f2 (Opaque_tao_universe_calc_class*, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&, c_Bool&); extern "C" void tao_universe_calc_to_f (const CPP_tao_universe_calc& C, Opaque_tao_universe_calc_class* F) { // c_side.to_f2_call tao_universe_calc_to_f2 (F, C.rad_int_for_data, C.rad_int_for_plotting, C.chrom_for_data, C.chrom_for_plotting, C.beam_sigma_for_data, C.beam_sigma_for_plotting, C.dynamic_aperture, C.one_turn_map, C.lattice, C.mat6, C.track); } // c_side.to_c2_arg extern "C" void tao_universe_calc_to_c2 (CPP_tao_universe_calc& C, c_Bool& z_rad_int_for_data, c_Bool& z_rad_int_for_plotting, c_Bool& z_chrom_for_data, c_Bool& z_chrom_for_plotting, c_Bool& z_beam_sigma_for_data, c_Bool& z_beam_sigma_for_plotting, c_Bool& z_dynamic_aperture, c_Bool& z_one_turn_map, c_Bool& z_lattice, c_Bool& z_mat6, c_Bool& z_track) { // c_side.to_c2_set[logical, 0, NOT] C.rad_int_for_data = z_rad_int_for_data; // c_side.to_c2_set[logical, 0, NOT] C.rad_int_for_plotting = z_rad_int_for_plotting; // c_side.to_c2_set[logical, 0, NOT] C.chrom_for_data = z_chrom_for_data; // c_side.to_c2_set[logical, 0, NOT] C.chrom_for_plotting = z_chrom_for_plotting; // c_side.to_c2_set[logical, 0, NOT] C.beam_sigma_for_data = z_beam_sigma_for_data; // c_side.to_c2_set[logical, 0, NOT] C.beam_sigma_for_plotting = z_beam_sigma_for_plotting; // c_side.to_c2_set[logical, 0, NOT] C.dynamic_aperture = z_dynamic_aperture; // c_side.to_c2_set[logical, 0, NOT] C.one_turn_map = z_one_turn_map; // c_side.to_c2_set[logical, 0, NOT] C.lattice = z_lattice; // c_side.to_c2_set[logical, 0, NOT] C.mat6 = z_mat6; // c_side.to_c2_set[logical, 0, NOT] C.track = z_track; } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_mpi extern "C" void tao_mpi_to_c (const Opaque_tao_mpi_class*, CPP_tao_mpi&); // c_side.to_f2_arg extern "C" void tao_mpi_to_f2 (Opaque_tao_mpi_class*, c_Bool&, c_Bool&, c_Int&, c_Int&, c_Char); extern "C" void tao_mpi_to_f (const CPP_tao_mpi& C, Opaque_tao_mpi_class* F) { // c_side.to_f2_call tao_mpi_to_f2 (F, C.on, C.master, C.rank, C.max_rank, C.host_name.c_str()); } // c_side.to_c2_arg extern "C" void tao_mpi_to_c2 (CPP_tao_mpi& C, c_Bool& z_on, c_Bool& z_master, c_Int& z_rank, c_Int& z_max_rank, c_Char z_host_name) { // c_side.to_c2_set[logical, 0, NOT] C.on = z_on; // c_side.to_c2_set[logical, 0, NOT] C.master = z_master; // c_side.to_c2_set[integer, 0, NOT] C.rank = z_rank; // c_side.to_c2_set[integer, 0, NOT] C.max_rank = z_max_rank; // c_side.to_c2_set[character, 0, NOT] C.host_name = z_host_name; } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_dynamic_aperture extern "C" void tao_dynamic_aperture_to_c (const Opaque_tao_dynamic_aperture_class*, CPP_tao_dynamic_aperture&); // c_side.to_f2_arg extern "C" void tao_dynamic_aperture_to_f2 (Opaque_tao_dynamic_aperture_class*, const CPP_aperture_scan**, Int, c_RealArr, Int); extern "C" void tao_dynamic_aperture_to_f (const CPP_tao_dynamic_aperture& C, Opaque_tao_dynamic_aperture_class* F) { // c_side.to_f_setup[type, 1, ALLOC] int n1_scan = C.scan.size(); const CPP_aperture_scan** z_scan = NULL; if (n1_scan != 0) { z_scan = new const CPP_aperture_scan*[n1_scan]; for (int i = 0; i < n1_scan; i++) z_scan[i] = &C.scan[i]; } // c_side.to_f_setup[real, 1, ALLOC] int n1_pz = C.pz.size(); c_RealArr z_pz = NULL; if (n1_pz > 0) { z_pz = &C.pz[0]; } // c_side.to_f2_call tao_dynamic_aperture_to_f2 (F, z_scan, n1_scan, z_pz, n1_pz); // c_side.to_f_cleanup[type, 1, ALLOC] delete[] z_scan; } // c_side.to_c2_arg extern "C" void tao_dynamic_aperture_to_c2 (CPP_tao_dynamic_aperture& C, Opaque_aperture_scan_class** z_scan, Int n1_scan, c_RealArr z_pz, Int n1_pz) { // c_side.to_c2_set[type, 1, ALLOC] C.scan.resize(n1_scan); for (int i = 0; i < n1_scan; i++) aperture_scan_to_c(z_scan[i], C.scan[i]); // c_side.to_c2_set[real, 1, ALLOC] C.pz.resize(n1_pz); C.pz << z_pz; } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_universe extern "C" void tao_universe_to_c (const Opaque_tao_universe_class*, CPP_tao_universe&); // c_side.to_f2_arg extern "C" void tao_universe_to_f2 (Opaque_tao_universe_class*, const CPP_tao_universe&, Int, const CPP_tao_lattice&, Int, const CPP_tao_lattice&, Int, const CPP_tao_lattice&, Int, const CPP_tao_beam&, const CPP_tao_dynamic_aperture&, const CPP_tao_universe_branch**, Int, const CPP_tao_d2_data**, Int, const CPP_tao_data**, Int, const CPP_tao_ping_scale&, const CPP_lat&, const CPP_tao_universe_calc&, c_RealArr, Int, Int, c_Int&, c_Int&, c_Int&, c_Bool&, c_Bool&, c_Bool&); extern "C" void tao_universe_to_f (const CPP_tao_universe& C, Opaque_tao_universe_class* F) { // c_side.to_f_setup[type, 0, PTR] unsigned int n_common = 0; if (C.common != NULL) n_common = 1; // c_side.to_f_setup[type, 0, PTR] unsigned int n_model = 0; if (C.model != NULL) n_model = 1; // c_side.to_f_setup[type, 0, PTR] unsigned int n_design = 0; if (C.design != NULL) n_design = 1; // c_side.to_f_setup[type, 0, PTR] unsigned int n_base = 0; if (C.base != NULL) n_base = 1; // c_side.to_f_setup[type, 1, PTR] int n1_uni_branch = C.uni_branch.size(); const CPP_tao_universe_branch** z_uni_branch = NULL; if (n1_uni_branch != 0) { z_uni_branch = new const CPP_tao_universe_branch*[n1_uni_branch]; for (int i = 0; i < n1_uni_branch; i++) z_uni_branch[i] = &C.uni_branch[i]; } // c_side.to_f_setup[type, 1, ALLOC] int n1_d2_data = C.d2_data.size(); const CPP_tao_d2_data** z_d2_data = NULL; if (n1_d2_data != 0) { z_d2_data = new const CPP_tao_d2_data*[n1_d2_data]; for (int i = 0; i < n1_d2_data; i++) z_d2_data[i] = &C.d2_data[i]; } // c_side.to_f_setup[type, 1, ALLOC] int n1_data = C.data.size(); const CPP_tao_data** z_data = NULL; if (n1_data != 0) { z_data = new const CPP_tao_data*[n1_data]; for (int i = 0; i < n1_data; i++) z_data[i] = &C.data[i]; } // c_side.to_f_setup[real, 2, ALLOC] int n1_dmodel_dvar = C.dmodel_dvar.size(), n2_dmodel_dvar = 0; Real* z_dmodel_dvar = NULL; if (n1_dmodel_dvar > 0) { n2_dmodel_dvar = C.dmodel_dvar[0].size(); z_dmodel_dvar = new Real [n1_dmodel_dvar*n2_dmodel_dvar]; matrix_to_vec (C.dmodel_dvar, z_dmodel_dvar); } // c_side.to_f2_call tao_universe_to_f2 (F, *C.common, n_common, *C.model, n_model, *C.design, n_design, *C.base, n_base, C.beam, C.dynamic_aperture, z_uni_branch, n1_uni_branch, z_d2_data, n1_d2_data, z_data, n1_data, C.ping_scale, C.scratch_lat, C.calc, z_dmodel_dvar, n1_dmodel_dvar, n2_dmodel_dvar, C.ix_uni, C.n_d2_data_used, C.n_data_used, C.reverse_tracking, C.is_on, C.picked_uni); // c_side.to_f_cleanup[type, 1, PTR] delete[] z_uni_branch; // c_side.to_f_cleanup[type, 1, ALLOC] delete[] z_d2_data; // c_side.to_f_cleanup[type, 1, ALLOC] delete[] z_data; // c_side.to_f_cleanup[real, 2, ALLOC] delete[] z_dmodel_dvar; } // c_side.to_c2_arg extern "C" void tao_universe_to_c2 (CPP_tao_universe& C, Opaque_tao_universe_class* z_common, Int n_common, Opaque_tao_lattice_class* z_model, Int n_model, Opaque_tao_lattice_class* z_design, Int n_design, Opaque_tao_lattice_class* z_base, Int n_base, const Opaque_tao_beam_class* z_beam, const Opaque_tao_dynamic_aperture_class* z_dynamic_aperture, Opaque_tao_universe_branch_class** z_uni_branch, Int n1_uni_branch, Opaque_tao_d2_data_class** z_d2_data, Int n1_d2_data, Opaque_tao_data_class** z_data, Int n1_data, const Opaque_tao_ping_scale_class* z_ping_scale, const Opaque_lat_class* z_scratch_lat, const Opaque_tao_universe_calc_class* z_calc, c_RealArr z_dmodel_dvar, Int n1_dmodel_dvar, Int n2_dmodel_dvar, c_Int& z_ix_uni, c_Int& z_n_d2_data_used, c_Int& z_n_data_used, c_Bool& z_reverse_tracking, c_Bool& z_is_on, c_Bool& z_picked_uni) { // c_side.to_c2_set[type, 0, PTR] if (n_common == 0) delete C.common; else { C.common = new CPP_tao_universe; tao_universe_to_c(z_common, *C.common); } // c_side.to_c2_set[type, 0, PTR] if (n_model == 0) delete C.model; else { C.model = new CPP_tao_lattice; tao_lattice_to_c(z_model, *C.model); } // c_side.to_c2_set[type, 0, PTR] if (n_design == 0) delete C.design; else { C.design = new CPP_tao_lattice; tao_lattice_to_c(z_design, *C.design); } // c_side.to_c2_set[type, 0, PTR] if (n_base == 0) delete C.base; else { C.base = new CPP_tao_lattice; tao_lattice_to_c(z_base, *C.base); } // c_side.to_c2_set[type, 0, NOT] tao_beam_to_c(z_beam, C.beam); // c_side.to_c2_set[type, 0, NOT] tao_dynamic_aperture_to_c(z_dynamic_aperture, C.dynamic_aperture); // c_side.to_c2_set[type, 1, PTR] C.uni_branch.resize(n1_uni_branch); for (int i = 0; i < n1_uni_branch; i++) tao_universe_branch_to_c(z_uni_branch[i], C.uni_branch[i]); // c_side.to_c2_set[type, 1, ALLOC] C.d2_data.resize(n1_d2_data); for (int i = 0; i < n1_d2_data; i++) tao_d2_data_to_c(z_d2_data[i], C.d2_data[i]); // c_side.to_c2_set[type, 1, ALLOC] C.data.resize(n1_data); for (int i = 0; i < n1_data; i++) tao_data_to_c(z_data[i], C.data[i]); // c_side.to_c2_set[type, 0, NOT] tao_ping_scale_to_c(z_ping_scale, C.ping_scale); // c_side.to_c2_set[type, 0, NOT] lat_to_c(z_scratch_lat, C.scratch_lat); // c_side.to_c2_set[type, 0, NOT] tao_universe_calc_to_c(z_calc, C.calc); // c_side.to_c2_set[real, 2, ALLOC] C.dmodel_dvar.resize(n1_dmodel_dvar); for (int i = 0; i < n1_dmodel_dvar; i++) C.dmodel_dvar[i].resize(n2_dmodel_dvar); C.dmodel_dvar << z_dmodel_dvar; // c_side.to_c2_set[integer, 0, NOT] C.ix_uni = z_ix_uni; // c_side.to_c2_set[integer, 0, NOT] C.n_d2_data_used = z_n_d2_data_used; // c_side.to_c2_set[integer, 0, NOT] C.n_data_used = z_n_data_used; // c_side.to_c2_set[logical, 0, NOT] C.reverse_tracking = z_reverse_tracking; // c_side.to_c2_set[logical, 0, NOT] C.is_on = z_is_on; // c_side.to_c2_set[logical, 0, NOT] C.picked_uni = z_picked_uni; } //-------------------------------------------------------------------- //-------------------------------------------------------------------- // CPP_tao_super_universe extern "C" void tao_super_universe_to_c (const Opaque_tao_super_universe_class*, CPP_tao_super_universe&); // c_side.to_f2_arg extern "C" void tao_super_universe_to_f2 (Opaque_tao_super_universe_class*, const CPP_tao_global&, const CPP_tao_common&, const CPP_tao_plot_page&, const CPP_tao_v1_var**, Int, const CPP_tao_var**, Int, const CPP_tao_universe**, Int, const CPP_tao_mpi&, c_IntArr, Int, const CPP_tao_building_wall&, const CPP_tao_wave&, c_Int&, c_Int&, const CPP_tao_cmd_history**); extern "C" void tao_super_universe_to_f (const CPP_tao_super_universe& C, Opaque_tao_super_universe_class* F) { // c_side.to_f_setup[type, 1, ALLOC] int n1_v1_var = C.v1_var.size(); const CPP_tao_v1_var** z_v1_var = NULL; if (n1_v1_var != 0) { z_v1_var = new const CPP_tao_v1_var*[n1_v1_var]; for (int i = 0; i < n1_v1_var; i++) z_v1_var[i] = &C.v1_var[i]; } // c_side.to_f_setup[type, 1, ALLOC] int n1_var = C.var.size(); const CPP_tao_var** z_var = NULL; if (n1_var != 0) { z_var = new const CPP_tao_var*[n1_var]; for (int i = 0; i < n1_var; i++) z_var[i] = &C.var[i]; } // c_side.to_f_setup[type, 1, ALLOC] int n1_u = C.u.size(); const CPP_tao_universe** z_u = NULL; if (n1_u != 0) { z_u = new const CPP_tao_universe*[n1_u]; for (int i = 0; i < n1_u; i++) z_u[i] = &C.u[i]; } // c_side.to_f_setup[integer, 1, ALLOC] int n1_key = C.key.size(); c_IntArr z_key = NULL; if (n1_key > 0) { z_key = &C.key[0]; } // c_side.to_f_setup[type, 1, NOT] const CPP_tao_cmd_history* z_history[1000]; for (int i = 0; i < 1000; i++) {z_history[i] = &C.history[i];} // c_side.to_f2_call tao_super_universe_to_f2 (F, C.global, C.com, C.plot_page, z_v1_var, n1_v1_var, z_var, n1_var, z_u, n1_u, C.mpi, z_key, n1_key, C.building_wall, C.wave, C.n_var_used, C.n_v1_var_used, z_history); // c_side.to_f_cleanup[type, 1, ALLOC] delete[] z_v1_var; // c_side.to_f_cleanup[type, 1, ALLOC] delete[] z_var; // c_side.to_f_cleanup[type, 1, ALLOC] delete[] z_u; } // c_side.to_c2_arg extern "C" void tao_super_universe_to_c2 (CPP_tao_super_universe& C, const Opaque_tao_global_class* z_global, const Opaque_tao_common_class* z_com, const Opaque_tao_plot_page_class* z_plot_page, Opaque_tao_v1_var_class** z_v1_var, Int n1_v1_var, Opaque_tao_var_class** z_var, Int n1_var, Opaque_tao_universe_class** z_u, Int n1_u, const Opaque_tao_mpi_class* z_mpi, c_IntArr z_key, Int n1_key, const Opaque_tao_building_wall_class* z_building_wall, const Opaque_tao_wave_class* z_wave, c_Int& z_n_var_used, c_Int& z_n_v1_var_used, const Opaque_tao_cmd_history_class** z_history) { // c_side.to_c2_set[type, 0, NOT] tao_global_to_c(z_global, C.global); // c_side.to_c2_set[type, 0, NOT] tao_common_to_c(z_com, C.com); // c_side.to_c2_set[type, 0, NOT] tao_plot_page_to_c(z_plot_page, C.plot_page); // c_side.to_c2_set[type, 1, ALLOC] C.v1_var.resize(n1_v1_var); for (int i = 0; i < n1_v1_var; i++) tao_v1_var_to_c(z_v1_var[i], C.v1_var[i]); // c_side.to_c2_set[type, 1, ALLOC] C.var.resize(n1_var); for (int i = 0; i < n1_var; i++) tao_var_to_c(z_var[i], C.var[i]); // c_side.to_c2_set[type, 1, ALLOC] C.u.resize(n1_u); for (int i = 0; i < n1_u; i++) tao_universe_to_c(z_u[i], C.u[i]); // c_side.to_c2_set[type, 0, NOT] tao_mpi_to_c(z_mpi, C.mpi); // c_side.to_c2_set[integer, 1, ALLOC] C.key.resize(n1_key); C.key << z_key; // c_side.to_c2_set[type, 0, NOT] tao_building_wall_to_c(z_building_wall, C.building_wall); // c_side.to_c2_set[type, 0, NOT] tao_wave_to_c(z_wave, C.wave); // c_side.to_c2_set[integer, 0, NOT] C.n_var_used = z_n_var_used; // c_side.to_c2_set[integer, 0, NOT] C.n_v1_var_used = z_n_v1_var_used; // c_side.to_c2_set[type, 1, NOT] for (unsigned int i = 0; i < C.history.size(); i++) tao_cmd_history_to_c(z_history[i], C.history[i]); }