void Triangulation::color_stripes_3() { unsigned int N = triangles_.size(); colors_.clear(); colors_.reserve(N); QColor color; QColor color_1(55, 215, 55); QColor color_2(30, 130, 30); integer_coordinates xy; unsigned int i; for (i=0; i<N; i++) { xy = tiling_coordinates_[triangles_[i][0]]; color = ((xy.first + xy.second/2)%2 == 0) ? color_1 : color_2; colors_.push_back(color); } return; }
void Triangulation::color_stripes_1() { unsigned int N = triangles_.size(); colors_.clear(); colors_.reserve(N); QColor color; QColor color_1(138, 43, 226); QColor color_2(51, 204, 255); integer_coordinates xy; unsigned int i; for (i=0; i<N; i++) { xy = tiling_coordinates_[triangles_[i][0]]; color = (xy.second%2 == 0) ? color_1 : color_2; colors_.push_back(color); } return; }
void Triangulation::color_squares_2() { unsigned int N = triangles_.size(); colors_.clear(); colors_.reserve(N); QColor color; QColor color_1(198, 226, 255); QColor color_2(67, 110, 238); integer_coordinates xy, xy_0, xy_1; unsigned int i; for (i=0; i<N; i++) { xy_0 = tiling_coordinates_[triangles_[i][0]]; xy_1 = tiling_coordinates_[triangles_[i][1]]; xy = (xy_0.second == xy_1.second) ? xy_1 : xy_0; color = ( ((xy.first +3*((xy.second+1)/2))/2 - xy.second/2)%2 == 0 ) ? color_1 : color_2; colors_.push_back(color); } return; }
void Triangulation::color_stripes_2() { unsigned int N = triangles_.size(); colors_.clear(); colors_.reserve(N); QColor color; QColor color_1(255, 130, 0); QColor color_2(255, 210, 10); integer_coordinates xy_0, xy_1, xy; unsigned int i; for (i=0; i<N; i++) { xy_0 = tiling_coordinates_[triangles_[i][0]]; xy_1 = tiling_coordinates_[triangles_[i][1]]; xy = xy_0.second == xy_1.second? xy_1 : xy_0; color = ((xy.first + (xy.second+1)/2)%2==0) ? color_1 : color_2; colors_.push_back(color); } return; }
void network_generator::write_output(){ for(int k=0;k<channel_layer;k++){ BasicExcel xls; // create sheet 1 and get the associated BasicExcelWorksheet pointer xls.New(1); BasicExcelWorksheet* sheet = xls.GetWorksheet(0); XLSFormatManager fmt_mgr(xls); // Create a table containing an header row in bold and four rows below. ExcelFont font_bold; font_bold._weight = FW_BOLD; // 700 CellFormat fmt_bold(fmt_mgr); fmt_bold.set_font(font_bold); ExcelFont font_red_bold; font_red_bold._weight = FW_BOLD; font_red_bold._color_index = EGA_BLACK; CellFormat color_1(fmt_mgr, font_red_bold); color_1.set_color1(COLOR1_PAT_SOLID); color_1.set_color2(MAKE_COLOR2(29,0)); CellFormat color_2(fmt_mgr, font_red_bold); color_2.set_color1(COLOR1_PAT_SOLID); color_2.set_color2(MAKE_COLOR2(16,0)); for (int i=0;i<101;i++){ for(int j=0;j<101;j++){ BasicExcelCell* cell = sheet->Cell(i, j); if(i%2 == 0 && j%2 == 0){ cell->SetFormat(color_2); sheet->Cell(i, j)->Set(-1); } else{ cell->SetFormat(color_1); sheet->Cell(i, j)->Set(liquid_network[k][i][j]); } } } for (int i=0;i<101;i++){ sheet->SetColWidth(i,950); } char layernum = k+48; string test_case_num = "0"; test_case_num += char(chip.case_num+48); string output_name=""; output_name += "cada030_problemA_testcase"; output_name += test_case_num; if(channel_layer > 1){ output_name += "_channellayer"; output_name += layernum; } output_name += ".xls"; xls.SaveAs(&output_name[0]); } }