本文整理汇总了C++中GridType::get_point方法的典型用法代码示例。如果您正苦于以下问题:C++ GridType::get_point方法的具体用法?C++ GridType::get_point怎么用?C++ GridType::get_point使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GridType
的用法示例。
在下文中一共展示了GridType::get_point方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, const char **argv){
if (argc != 3 && argc != 5){
printf("Usage: prog sides num_blanks [wid hei]\n");
return 1;
}
size_t blanks = atol(argv[2]);
size_t sides = atol(argv[1]);
size_t wid = DEFAULT_WIDTH;
size_t hei = DEFAULT_HEIGHT;
if (argc == 5){
wid = atol(argv[3]);
hei = atol(argv[4]);
}
sierp2d::Model<double, ModelType, GridType> model;
for (int blank=0; blank < blanks; ++blank){
model.points.push_back(sierp2d::Point<double>(wid/2, hei/2));
}
model.add_regular(wid, hei, sides);
GridType * front = new GridType( {wid, hei} );
GridType * back = new GridType( {wid, hei} );
GridType * temp = NULL;
front->get_point({wid/2, hei/2}) = INITIAL;
while (true){
bool hit_max = model.next(*front, *back);
if (hit_max) break;
temp = back;
back = front;
front = temp;
}
temp = NULL;
delete back;
ModelType maxval = front->max();
double scale = UIMAX(ModelType) / ((double)maxval);
for (ModelType &val : *front){
val *= scale;
}
front->invert();
char file_name[255];
sprintf(file_name, "out-%zu-%zu.png", blanks, sides);
png::write(*front, file_name);
delete front;
}