⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 用到的库函数.txt

📁 详细的讲述了CADLIB的绘图流程
💻 TXT
字号:
/*-------------------------------------------------------------------*
 |  drwCreate                                                        |
 |  Inputs:                                                          |
 |      Nothing!                                                     |
 |  Output: Handle to new created drawing ( NULL=Error )             |
 *-------------------------------------------------------------------*/
HDRAWING drwCreate()
Handle to new created drawing
位于CadLib\Drawing\MemDrw.cpp


/*-------------------------------------------------------------------*
 |  drwLoadDataFromFile                                              |
 |  Descriptions:                                                    |
 |      Loads drawing from a drawing data file (DXF file)            |
 |  Inputs:                                                          |
 |      HDRAWING hDrawing = handle to the current DRAWING structure  |
 |      OBJHANDLE BlockObjhandle = handle of block that entities     |
 |                     must be put in it. (NULL = Entity Section)    |
 |      DWORD Reserved = reserved, must be 0                         |
 |      LPCTSTR strFileName = input file name (Can not be NULL)      |
 |      HWND hWndProgress = handle of progress window                |
 |  Output: TRUE if everything is ok                                 |
 *-------------------------------------------------------------------*/
drwLoadDataFromFile( HDRAWING hDrawing, 
			OBJHANDLE BlockObjhandle,
 			DWORD Reserved, LPCTSTR strFileName, 
			HWND hWndProgress )
此函数读入文件各个结构:HEADER,TABLES,BLOCKS,ENTITIES
处理读取进度的进度窗体
位于CadLib\Drawing\DrwIO.cpp


/*-------------------------------------------------------------------*
 |  drwInitView                                                      |
 |  Inputs:                                                          |
 |      HDRAWING hDrawing = handle to the current DRAWING structure  |
 |      int x = horizontal position of drawing window                |
 |      int y = vertical position of drawing window                  |
 |      int Width = width of drawing window                          |
 |      int Height = height of drawing window                        |
 |  Output: TRUE if everything is ok                                 |
 *-------------------------------------------------------------------*/
BOOL drwInitView( HDRAWING hDrawing, int x, int y, int Width, int Height )
此函数根据参数初始化PDRAWING变量各数据域然后以函数UnInitilizePDRAWING(PDRAWING)返回值来返回
位于CadLib\Drawing\View\View.cpp


/*-------------------------------------------------------------------*
 |  drwZoomExtents                                                   |
 |  Inputs:                                                          |
 |      HDRAWING hDrawing = handle to the current DRAWING structure  |
 |  Output: TRUE if everything is ok                                 |
 *-------------------------------------------------------------------*/
BOOL drwZoomExtents( HDRAWING hDrawing )
此函数设置缩放大小以适合视图区域大小
位于CadLib\Drawing\View\View.cpp


/*-------------------------------------------------------------------*
 |  drwPaint                                                         |
 |  Inputs:                                                          |
 |      HDRAWING hDrawing = handle to the current DRAWING structure  |
 |	    HDC hdc	= handle to view window DC                           |
 |  Output: TRUE if everything is ok                                 |
 *-------------------------------------------------------------------*/
BOOL drwPaint( HDRAWING hDrawing, HDC hdc )
此函数依据视图大小画黑色填充色的矩形,然后创建矩形区域,并将区域选入HDC,
再选入HOLLOW_BRUSH,
然后调用drwPlot(HDRAWING,HDC)绘制整体图形.
drwPlot()中调用drwFindEntity_Direct()来写入ENTITYHEADER局部变量和PDRAWING局部变量,然后以这两个局部变量作为参数调用PlotEntity()
位于CadLib\Drawing\View\View.cpp

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -