📄 wztutorial.html
字号:
<TITLE>WZ 1.1: Tutorial</TITLE><H1>Tutorial for WZ 1.1</H1> <P><B>WZ 1.0</B> is a C++ class library which contains useful generalpurpose classes used in COG. They are useful if you want to includeCOG grids, points and geometries into your own code, but some of theclasses may be useful for you even outside the context of COG.<H3><A HREF="mainwzproxytest.html">wzProxy</A></H3> <P>The template <B>wzProxy</B> implements safe pointers - they may beused like pointers, but manage access control (deallocation):<PRE>typedef wzProxy<Something> something;something a = new Something();something b = 0;a = b; // deallocates now</PRE><H3><A HREF="mainwzarraytest.html">wzArray</A></H3> <P>The template <B>wzArray</B> implements infinite arrays withautomatical range test and allocation of additional memory ifnecessary. But it allows to do it in an economic way: if you fill thearray in increasing order, new memory will be allocated more thanactually required, but therefore not in every step but seldom. It alsoallows you to decide if the check should be made or not:<PRE> wzArray<int> x; for(i=0;i<n;i++){ x(i) = n; // tests if x[i] is allocated, reallocates sometimes; y += x[i]; // we already know x[i] is allocated - no need to test again; }</PRE><H3><A HREF="mainwzrangetest.html">wzRange</A></H3> <P>The class <B>wzRange</B> allows to manage loops over variableranges (like the nodes and cells during grid generation) and managesthe allocation of memory for related arrays:<PRE> wzRange range; wzIndex i; wzArray<int> a(range); range.create(100); // allocates memory for a too. wzRangeLoop(range,i){ // loop over the range with index i; a[i] = i; }</PRE><H3><A HREF="mainwzcomponenttest.html">wzComponent</A></H3> <P>allows to replace public components so that external access syntaxto components remains unchanged but internally more complex things canbe done at every read and write access.<H3><A HREF="mainwzsegmenttest.html">wzSegment</A></H3> <P>This class handles region and face identifiers (they can havenames, colors, materials)<H3><A HREF="mainwzpointtest.html">wzPoint</A></H3> <P>A basic class for COG. The point contains coordinates,a segment, and some function values.<H3><A HREF="mainwzoutputtest.html">Formatted Output</A></H3> <P>allows formatted output using C++ type control possibilities (noneed to use C-format things like <I>%d, %f</I> and so on) with asimple <I><></I> as the default placeholder, allows to fix itssize as n with <I><n></I>, and nice syntax:<PRE> wzOutput p(cerr); wzIndex a=1; wzFloat b=1; wzName c = "name"; p("a = <>, b = <>, name = <>") <<a,b,name;</PRE><H3><A HREF="mainwzwarningtest.html">wzWarning</A></H3> <P>This type allows to manage warnings. The default behaviour isthat it will be written out only once, searches explanatory text fromthe documentation, and at the end prints a summary how often it hasbeen called.<H3><A HREF="mainwzpixmaptest.html">Pixmaps</A></H3> <P>A class which allows to read and use pixmaps (currently only PPM).<H3><A HREF="mainwzmaptest.html">Coordinates</A></H3> <P>Describes how coordinates have to be used.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -