• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            eryar

            PipeCAD - Plant Piping Design Software.
            RvmTranslator - Translate AVEVA RVM to OBJ, glTF, etc.
            posts - 603, comments - 590, trackbacks - 0, articles - 0

            OpenCascade Draw Test Harness

            Posted on 2014-07-30 20:00 eryar 閱讀(5503) 評論(0)  編輯 收藏 引用 所屬分類: 2.OpenCASCADE

            OpenCascade Draw Test Harness

            eryar@163.com

            Abstract. Draw is a command interpreter based on Tcl/Tk and a graphical system used to test and demonstrate OpenCascade modeling libraries. It provides a flexible and easy to use means of testing and demonstrating the OCCT modeling libraries. By a given command of Tcl, you can find the implentation code for that command by OpenCascade, the code could be as a demo to use of OCC modeling libraries. So this is the most effectively way of use OpenCascade.

            Key words. OpenCascade, Tcl/Tk, Testing, Scripts

            1. Introduction

            Draw Test Harness提供了靈活和易于使用的方式來測試、演示OpenCascade的建模算法。可用來交互的創(chuàng)建、顯示和修改曲線、曲面及拓樸形狀。你也可以自己寫Tcl腳本來自定義Draw或使用腳本來實現(xiàn)自動化測試。也可以為Draw添加新的自定義的命令。

            因為Draw是基于Tcl/Tk腳本的,所以可以根據(jù)OpenCascade自定義的命令名稱來找到相關(guān)的實現(xiàn),這個實現(xiàn)應(yīng)該是使用OpenCascade最有效的方式,也是官方使用OpenCascade的方式,具有很好的參考價值。

            還可在Draw 中使用Tcl腳本來實現(xiàn)概念建模,如果結(jié)果和預期一致,可再把Tcl命令相對應(yīng)的C++代碼寫到程序中,提高編程效率。

            本文主要介紹如何根據(jù)OpenCascade中實現(xiàn)的命令找到相關(guān)的實現(xiàn)代碼,作為編程時的參考,避免了用C++代碼來實現(xiàn)一些功能時自己來摸索,從而浪費不必要的時間。

            2. Using Tcl/Tk

            先給出Draw中使用腳本出來的效果的例子,再介紹找出命令實現(xiàn)代碼的方法。如下圖所示為用腳本在Draw中產(chǎn)生的效果:

            wps_clip_image-14743

            Figure 2.1 A blend test in Draw Test Harness

            其實現(xiàn)的腳本如下所示:

            pload ALL

            vinit
            vgrid

            vsetgradientbg 
            0 0 180 255 255 255 2

            vzbufftrihedron

            # run a test
            source tests/blend/begin
            source tests
            /blend/buildevol/a2

            vsetdispmode 
            1
            vdisplay result
            vfit

            wps_clip_image-23795

            Figure 2.2 Tcl script

            將上述腳本代碼保存到samples/tcl文件夾下,文件名為init.tcl,再啟動Draw,輸入命令:

            wps_clip_image-30471

            Figure 2.3 Use the Tcl file

            3. Find code from Draw Test

            因為Draw是基于Tcl/Tk實現(xiàn)的解釋器,所以根據(jù)Tcl中自定義命令的方法,可以找出OpenCascade中這些命令的實現(xiàn)代碼。更方便的做法是直接輸入命令名稱,再在所有的源代碼中搜索相關(guān)文件即可。如上述腳本中的vgrid命令,是打開、關(guān)閉柵格,可以直接搜索vgrid,得到結(jié)果如下所示:

            wps_clip_image-22146

            Figure 3.1 Find command in Files

            wps_clip_image-16479

            Figure 3.2 Find Result of the Command

            得到相關(guān)的代碼使用方法如下圖所示:

            wps_clip_image-30092

            Figure 3.3 The Command function code

            依此類推,其他Draw中的命令都可以找到相關(guān)的實現(xiàn)代碼,這些代碼都可作為編程的依據(jù),有助于OpenCascade的正確、高效使用。

            4. Conclusion

            從上可知,如果需要OpenCascade的什么功能,可以先在Draw Test Harness中試試看,如果在Draw Test Harness中可以實現(xiàn),再找出其實現(xiàn)那個命令的代碼,再參考代碼實現(xiàn)所需要功能即可。這樣編程使用OpenCascade應(yīng)該是輕松和高效的,因為Tcl是解釋執(zhí)行,不像C++那樣需要編譯時間。

            5. References

            1. Tcl and the Tk Toolkit

            2. Practical Programming in Tcl and Tk

            3. Tcl/Tk A Developer’s Guide

            4. OpenCascade Test Harness User’s Guide 

            5. http://sourceforge.net/projects/tcl/

            5. http://www.tcl.tk/

            久久久中文字幕日本| 久久精品中文闷骚内射| 中文精品久久久久人妻| 一本色综合网久久| 亚洲欧美日韩精品久久| 久久久精品国产| 老司机国内精品久久久久| 香蕉aa三级久久毛片| 97久久综合精品久久久综合| 久久精品亚洲精品国产欧美| 日韩AV无码久久一区二区| 久久久精品人妻无码专区不卡 | 欧美性大战久久久久久| 久久综合88熟人妻| 狠狠色丁香婷婷久久综合 | 久久精品中文字幕无码绿巨人| 国产成人无码精品久久久久免费 | 久久久久国产| 国内精品久久久久影院一蜜桃| 一本大道久久香蕉成人网| 日本免费一区二区久久人人澡| 久久夜色精品国产噜噜麻豆| 久久久91人妻无码精品蜜桃HD| 国产精品久久久久影院色| 久久精品99久久香蕉国产色戒 | 久久人人爽人人人人片av| 亚洲国产精品综合久久网络| 91精品国产综合久久四虎久久无码一级 | 思思久久好好热精品国产| 久久男人AV资源网站| 中文字幕亚洲综合久久2| 精品久久一区二区| 2020久久精品国产免费| 久久综合综合久久综合| 久久久一本精品99久久精品66| 丁香色欲久久久久久综合网| 国产成人精品久久| 久久亚洲精精品中文字幕| 久久精品黄AA片一区二区三区| 久久香蕉超碰97国产精品| 激情伊人五月天久久综合|