📄 wzpointtest.html
字号:
<TITLE>WZ 1.0 - Points</TITLE>
<H1>Points</H1>
<P>Points are often used: in WZ for the definition of a wzeometry,
in IBG for refinement criteria.
<PRE>
#include "<A HREF="wzpoint.hxx">wzpoint.hxx</A>"
</PRE>
<P>An interesting property of the class <B>wzPoint</B> is that after
construction only the coordinates of the point are defined, but the
point itself is still invalid. To make the point valid, the <A
HREF="wzsegmenttest.html">segment</A> of the point should be defined.
<PRE>
void test()
{
wzPoint p0,p1(0.1),p2(0.1,0,2),p3(0.1,0.2,0.3);
now(p0.invalid()); now(p1.invalid()); now(p2.invalid()); now(p3.invalid());
p0.segment()=wzRegion(2);
p1.segment()=wzFace(1);
p2.segment()=wzEdge(1);
p3.segment()=wzVertex(1);
now(p0.valid()); now(p0.inRegion()); now(p0.region()==2); now(p0.codim()==0);
now(p1.valid()); now(p1.onFace()); now(p1.face()==1); now(p1.codim()==1);
now(p2.valid()); now(p2.onEdge()); now(p2.edge()==1); now(p2.codim()==2);
now(p3.valid()); now(p3.isVertex()); now(p3.vertex()==1); now(p3.codim()==3);
</PRE>
<P>The reason for this choice was that this definition is the result
of a nontrivial operation - geometry description.
<H3>Coordinates</H3>
<P>For every point, <B>wzPoint::Dim</B> coordinates are defined.
There are various syntactic possibilities to access them:
<PRE>
p0.x() = 0.1; now(p0[0]==0.1); now(p0.X[0]==0.1);
p0.y() = 0.1; now(p0[1]==0.1); now(p0.X[1]==0.1);
p0.z() = 0.1; now(p0[2]==0.1); now(p0.X[2]==0.1);
</PRE>
<P>There are also <B>wzPoint::DimFloat</B> additional floating point
values. Again, there are various syntactic access possibilities:
<PRE>
p0.f() = 0.1; now(p0.f(0)==0.1);
if(p0.floatValues()>2){
p0.g() = 0.2; now(p0.f(1)==0.2);
p0.h() = 0.3; now(p0.f(2)==0.3);
}
</PRE>
<P>There are also <B>wzPoint::DimIndex</B> additional index
values. Again, there are various syntactic access possibilities:
<PRE>
p0.i() = 1; now(p0.i(0)==1);
if(p0.indexValues()>2){
p0.j() = 2; now(p0.i(1)==2);
p0.k() = 2; now(p0.i(2)==2);
}
</PRE>
<A NAME="baddim"> <hr></A>
<H3>About the dimensions</H3>
<P>The standard values of the parameters (initialized in <A
HREF="wzpoint.cxx"> wzpoint.cxx</A> are the constants
<B>wzPointDim</B>, <B>wzPointDimFloat</B>, <B>wzPointDimIndex</B>
defined in <A HREF="wzpoint.hxx"> wzpoint.hxx</A>. They may be
changed during runtime with <B>setSpaceDimension</B>,
<B>setFloatValues</B> and <B>setIndexValues</B>. But they should not
become greater than the constants:
<PRE>
p0.setSpaceDimension(2);
p0.setFloatValues(0);
p0.setIndexValues(0);
try{
p0.setSpaceDimension(4); should_fail();
p0.setFloatValues(2); should_fail();
p0.setIndexValues(2); should_fail();
}catch(wzError e){;}
</PRE>
<P>The designed purpose of making them smaller is to make some
functions like copy-operations and scalar products faster. To allow
more function values, you should modify the constants
<B>wzPointDim</B>, <B>wzPointDimFloat</B>, <B>wzPointDimIndex</B>
defined in <A HREF="wzpoint.hxx"> wzpoint.hxx</A> and recompile the
whole package.
<PRE>
}
</PRE>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -