//==== Read Fuse Cross Section File ====// void FuselageXSec::read(xmlNodePtr node) { num_pnts = xmlFindInt( node, "Num_Pnts", num_pnts ); location = xmlFindDouble( node, "Spine_Location", location() ); y_offset = xmlFindDouble( node, "Y_Offset", y_offset() ); z_offset = xmlFindDouble( node, "Z_Offset", z_offset() ); //==== Profile Stuff ====// topTanAng = xmlFindDouble( node, "Top_Tan_Ang", topTanAng() ); topTanStr1 = xmlFindDouble( node, "Top_Tan_Str_1", topTanStr1() ); topTanStr2 = xmlFindDouble( node, "Top_Tan_Str_2", topTanStr2() ); botTanAng = xmlFindDouble( node, "Bot_Tan_Ang", botTanAng() ); botTanStr1 = xmlFindDouble( node, "Bot_Tan_Str_1", botTanStr1() ); botTanStr2 = xmlFindDouble( node, "Bot_Tan_Str_2", botTanStr2() ); leftTanAng = xmlFindDouble( node, "Left_Tan_Ang", leftTanAng() ); leftTanStr1 = xmlFindDouble( node, "Left_Tan_Str_1", leftTanStr1() ); leftTanStr2 = xmlFindDouble( node, "Left_Tan_Str_2", leftTanStr2() ); rightTanAng = xmlFindDouble( node, "Right_Tan_Ang", rightTanAng() ); rightTanStr1 = xmlFindDouble( node, "Right_Tan_Str_1", rightTanStr1() ); rightTanStr2 = xmlFindDouble( node, "Right_Tan_Str_2", rightTanStr2() ); numSectInterp1 = xmlFindInt( node, "Num_Sect_Interp_1", numSectInterp1 ); numSectInterp2 = xmlFindInt( node, "Num_Sect_Interp_2", numSectInterp2 ); topSymFlag = xmlFindInt( node, "Top_Sym_Flag", topSymFlag ); sideSymFlag = xmlFindInt( node, "Side_Sym_Flag", sideSymFlag ); read_parms( node ); }
//==== Write Fuse Cross Section File ====// void FuselageXSec::write(xmlNodePtr root) { xmlAddIntNode( root, "Num_Pnts", num_pnts); xmlAddDoubleNode( root, "Spine_Location", location() ); xmlAddDoubleNode( root, "Y_Offset", y_offset()); xmlAddDoubleNode( root, "Z_Offset", z_offset()); //==== Profile Stuff ====// xmlAddDoubleNode( root, "Top_Tan_Ang", topTanAng()); xmlAddDoubleNode( root, "Top_Tan_Str_1", topTanStr1()); xmlAddDoubleNode( root, "Top_Tan_Str_2", topTanStr2()); xmlAddDoubleNode( root, "Bot_Tan_Ang", botTanAng()); xmlAddDoubleNode( root, "Bot_Tan_Str_1", botTanStr1()); xmlAddDoubleNode( root, "Bot_Tan_Str_2", botTanStr2()); xmlAddDoubleNode( root, "Left_Tan_Ang", leftTanAng()); xmlAddDoubleNode( root, "Left_Tan_Str_1", leftTanStr1()); xmlAddDoubleNode( root, "Left_Tan_Str_2", leftTanStr2()); xmlAddDoubleNode( root, "Right_Tan_Ang", rightTanAng()); xmlAddDoubleNode( root, "Right_Tan_Str_1", rightTanStr1()); xmlAddDoubleNode( root, "Right_Tan_Str_2", rightTanStr2()); xmlAddIntNode( root, "Num_Sect_Interp_1", numSectInterp1); xmlAddIntNode( root, "Num_Sect_Interp_2", numSectInterp2); xmlAddIntNode( root, "Top_Sym_Flag", topSymFlag); xmlAddIntNode( root, "Side_Sym_Flag", sideSymFlag); write_parms( root ); }
const Options InPlaceReprojection::getDefaultOptions() const { Options options; Option in_srs("in_srs", std::string(""),"Input SRS to use to override -- fetched from previous stage if not present"); Option out_srs("out_srs", std::string(""), "Output SRS to reproject to"); Option x("x_dim", std::string("X"), "Dimension name to use for 'X' data"); Option y("y_dim", std::string("Y"), "Dimension name to use for 'Y' data"); Option z("z_dim", std::string("Z"), "Dimension name to use for 'Z' data"); Option x_scale("scale_x", 1.0f, "Scale for output X data in the case when 'X' dimension data are to be scaled. Defaults to '1.0'. If not set, the Dimensions's scale will be used"); Option y_scale("scale_y", 1.0f, "Scale for output Y data in the case when 'Y' dimension data are to be scaled. Defaults to '1.0'. If not set, the Dimensions's scale will be used"); Option z_scale("scale_z", 1.0f, "Scale for output Z data in the case when 'Z' dimension data are to be scaled. Defaults to '1.0'. If not set, the Dimensions's scale will be used"); Option x_offset("offset_x", 0.0f, "Offset for output X data in the case when 'X' dimension data are to be scaled. Defaults to '0.0'. If not set, the Dimensions's scale will be used"); Option y_offset("offset_y", 0.0f, "Offset for output Y data in the case when 'Y' dimension data are to be scaled. Defaults to '0.0'. If not set, the Dimensions's scale will be used"); Option z_offset("offset_z", 0.0f, "Offset for output Z data in the case when 'Z' dimension data are to be scaled. Defaults to '0.0'. If not set, the Dimensions's scale will be used"); Option ignore_old_dimensions("ignore_old_dimensions", true, "Mark old, unprojected dimensions as ignored"); Option do_offset_z("do_offset_z", false, "Should we re-offset Z data"); options.add(in_srs); options.add(out_srs); options.add(x); options.add(y); options.add(z); options.add(x_scale); options.add(y_scale); options.add(z_scale); options.add(x_offset); options.add(y_offset); options.add(z_offset); options.add(ignore_old_dimensions); options.add(do_offset_z); return options; }
void soil_generator::generate(chunk_coordinates pos, chunk& dest) { if (!w_.is_area_data_available(pos, surfacemap_)) { std::cout << "No area data available for soil" << std::endl; return; } auto sm (w_.get_area_data(pos, surfacemap_)); chunk_coordinates bot (); auto region (w_.lock_region({pos + world_vector(0, 0, -1), pos}, *this)); int16_t z_offset (convert_height_16bit(pos.z * chunk_size)); for (uint32_t x (pos.x * chunk_size); x < (pos.x + 1) * chunk_size; ++x) { for (uint32_t y (pos.x * chunk_size); y < (pos.x + 1) * chunk_size; ++y) { int16_t lz ((*sm)(x, y)); if (lz < z_offset || lz >= z_offset + chunk_size) continue; uint32_t z (water_level + lz); if (region(x,y,z) == (uint16_t)16) { if (lz >= 5) { region(x,y,lz ) = grass_; region(x,y,lz-1) = dirt_; region(x,y,lz-2) = rock_; } else { region(x,y,lz ) = sand_; region(x,y,lz-1) = sand_; region(x,y,lz-2) = rock_; } } } } }
//==== Set Point On Span Offset by ZOffset ====// void FuselageXSec::set_pnt_on_spine(const vec3d& offset) { pnt_on_spine = offset; pnt_on_spine.offset_y(y_offset() ); pnt_on_spine.offset_z(z_offset() ); }