Visual C++ 写的程序所生成的分形图型,点击小图可见大图
完整源代码过几天上传。。。。
这是部分核心源代码
#include "StdAfx.h"
#include ".\fenxin.h"
#include ".\reference_axis.h"
#include ".\curve.h"
FenXin::FenXin(void)
{
pixel_left.x=550;
this->pixel_left.y=550;
angle=-80;
length=150;
COLOR=RGB(180,255,0);
}
FenXin::~FenXin(void)
{
}
int FenXin::fx1(CPoint pp0, int angle,int length,int depth)
{
CPoint pixel_next;
pixel_next=pp0;
class Cline *cl;
if(depth==0)angle=-90;
cl= new Cline(pixel_next,angle,length,this->COLOR,DIGUI_DEPTH-depth);
pixel_next=cl->p1;
this->curve.append_independence_line_segment(cl);
depth++;
if(depth {
int ttangle="this-">angle;
for(int i="0";i ttangle=ttangle*ANGLE_SCALE;
int xlength="length"* LENGTH_SCALE;
int xangle="ttangle"; //* ANGLE_SCALE;
fx1(pixel_next,angle-xangle,xlength,depth);
xangle=0-ttangle;
fx1(pixel_next,angle-xangle,xlength,depth);
//int xlength="length"* LENGTH_SCALE;
//int xangle="this-">angle; //* ANGLE_SCALE;
//fx1(pixel_next,angle-xangle,xlength,depth);
//xangle=0-this->angle;
//fx1(pixel_next,angle-xangle,xlength,depth);
}
return 0;
}
int FenXin::run(int graphics_type)
{
reference_axis::draw_as_bmp();
switch(graphics_type)
{
case 1:
this->fx1(this->pixel_left,angle,length,0);
break;
case 2:
break;
}
this->curve.gui_draw_datas(this->gui);
return 0;
}
文章评论(0条评论)
登录后参与讨论