Revised Visualization Source Code

    Visualization 模块中部分代码存在 bug,以下修改来自Open Cascade 官方论坛中有人做的patch,及自己修改的(少部分):

1: TKV3d.dll

1.1

File:
Visual3d_TransientManager.cxx

Func:
BeginDraw();
BeginAddDraw();
ClearDraw();

Source:
// after the line
theCiew = *(CALL_DEF_VIEW*)AView->CView();
// add these lines

if( !AView->UnderLayer().ISNull()){
 theCView.ptrUnderLayer = (CALL_DEF_LAYER*) & (AView->UnderLayer()->CLayer());
}

if( !AView->OverLayer().ISNull()){
 theCView.ptrOverLayer = (CALL_DEF_LAYER*) &(AView->OverLayer()->CLayer());
}

//在原来的代码中,每次重绘,Layer没有被绘制,修改后,每次场景重绘,Layer都会刷新。


2: TKOpenGL.dll

2.1

File:
OpenGL_triedron.c

Func:
call_zbuffer_triedron_redraw()

Source:

//ln836

if(!isWithinView) // delete

//ln1168

if(!iswithinView) // delete

// 原代码中,坐标系模型(ZBUFFER模式下)的原点位于视锥体内时,模型永远位于屏幕中央,修改后,位于所//设置的参数所对应的位置


2.2

File:
OpenGL_triedron.c

Func:
call_zbuffer_triedron_redraw()

Source:

// ln 961
// add this line
  glDisable(GL_DEPTH_TEST);

//ln 935
LightOn();// replace this sentence with function: LightOff();

// 关闭深度测试和光照


2.3

File:
OpenGL_togl_begin_layer_mode.c

Func:
call_togl_redraw_layer2d();

Source:
// ln310
glOrtho()// the last two parameters (-1.0,1.0) should be revised to (-10000.0,10000.0)

// 修改后在layer上可以绘制3d图形(原先只能绘制2D,z坐标为0的点)


2.4

File:
OpenGL_txfm.c

Func:
loadTextFont();

Source
// ln 829
// before " return; ", add these sentences
DeleteObject(font);
DeleteObject(hBmp);
DeleteDC(hMenDC);

// 原代码中未释放资源

你可能感兴趣的:(function,File,Parameters,patch,layer,Visualization)