📄 mainstarttest.html
字号:
<TITLE>COG 2.1: Startup File</TITLE><A HREF="mainoctreetest.html">next</A><H1>COG 2.1: Startup File</H1> <P>Let's start with the simplest 3D grid example - a cube,consisting of six tetrahedra. We need, of course, an include file:<PRE>#include "<A HREF="coglib.hxx">cog/coglib.hxx</A>"int main(){</PRE> <P>We also need a grid generator - an object of the abstract class<B>Cogenerator</B>. For the first example, we use the grid generatorfrom the derived class <B><A HREF="cogenoctree.html">CogenOctree</A></B>. The related pointertype is <B>cogenOctree</B> (don't use CogenOctree* for pointers).<PRE> cogenOctree gen = new CogenOctree();</PRE> <P>Then, we define the bounding box for grid generation:<PRE> gen->setBorder(0.0,1.0, 0.0,1.0, 0.0,1.0); // 3D unit cube // gen->setBorder(0.0,1.0, 0.0,1.0); // 2D unit square // gen->setBorder(0.0,1.0); // 1D unit segment</PRE> <P>That's all we need for our first test example. Now, we can callthe grid generator:<PRE> wzgrid grid = (*gen)();</PRE> <P>Now we can use the grid, for example, write it into a file:<PRE> grid->write("test.sg");}</PRE> <P>The grid is now written into a file "test.sg" in <A HREF="simplexgrid.html">SimplexGrid 2.0</A> format. Using the <A HREF="maingridviewtest.html">OpenGL Grid Interface</A> you canhave a look at the grid:<P><IMG SRC="starttest.gif"> <P>Now, in our tutorial we continue with <A HREF="mainoctreetest.html">other possibilities of the classCogenOctree</A>.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -