本文整理汇总了C++中Nodes::node方法的典型用法代码示例。如果您正苦于以下问题:C++ Nodes::node方法的具体用法?C++ Nodes::node怎么用?C++ Nodes::node使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Nodes
的用法示例。
在下文中一共展示了Nodes::node方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: buildElements
Elements Region::buildElements(Nodes& Base)
{
Elements Result;
if(typ==1)
{
if(numofrows<=numofcols)
{
for(int i=0;i<numofcols;i++)
for(int j=0;j<numofrows;j++)
{
Result.push_back(Triangle(Base,i*(numofrows+1)+j,i*(numofrows+1)+j+1,(i+1)*(numofrows+1)+j),Element(i*(numofrows+1)+j,i*(numofrows+1)+j+1,(i+1)*(numofrows+1)+j));
Result.push_back(Triangle(Base,i*(numofrows+1)+j+1,(i+1)*(numofrows+1)+j+1,(i+1)*(numofrows+1)+j),Element(i*(numofrows+1)+j+1,(i+1)*(numofrows+1)+j+1,(i+1)*(numofrows+1)+j));
if(i==0&&CONDLEFT) Result.addcondition(Border(true,j,j+1,Base.node(j),Base.node(j+1),ENV_TEMPLEFT));
if(i==numofcols-1&&CONDRIGHT) Result.addcondition(Border(true,(numofcols)*(numofrows+1)+j,(numofcols)*(numofrows+1)+j+1,Base.node((numofcols)*(numofrows+1)+j),Base.node((numofcols)*(numofrows+1)+j+1),ENV_TEMPRIGHT));
if(j==0&&CONDDOWN) Result.addcondition(Border(true,(i)*(numofrows+1)+j,(i+1)*(numofrows+1)+j,Base.node((i)*(numofrows+1)+j),Base.node((i+1)*(numofrows+1)+j),ENV_TEMPDOWN));
if(j==numofrows-1&&CONDUP) Result.addcondition(Border(true,(i)*(numofrows+1)+j+1,(i+1)*(numofrows+1)+j+1,Base.node((i)*(numofrows+1)+j+1),Base.node((i+1)*(numofrows+1)+j+1),ENV_TEMPUP));
}
}
else
{
for(int j=0;j<numofrows;j++)
for(int i=0;i<numofcols;i++)
{
Result.push_back(Triangle(Base,j*(numofcols+1)+i,j*(numofcols+1)+i+1,(j+1)*(numofcols+1)+i),Element(j*(numofcols+1)+i,j*(numofcols+1)+i+1,(j+1)*(numofcols+1)+i));
Result.push_back(Triangle(Base,j*(numofcols+1)+i+1,(j+1)*(numofcols+1)+i+1,(j+1)*(numofcols+1)+i),Element(j*(numofcols+1)+i+1,(j+1)*(numofcols+1)+i+1,(j+1)*(numofcols+1)+i));
if(j==0&&CONDDOWN) Result.addcondition(Border(true,i,i+1,Base.node(i),Base.node(i+1),ENV_TEMPDOWN));
if(j==numofrows-1&&CONDUP) Result.addcondition(Border(true,(numofrows)*(numofcols+1)+i,(numofrows)*(numofcols+1)+i+1,Base.node((numofrows)*(numofcols+1)+i),Base.node((numofrows)*(numofcols+1)+i+1),ENV_TEMPUP));
if(i==0&&CONDLEFT) Result.addcondition(Border(true,(j)*(numofcols+1)+i,(j+1)*(numofcols+1)+i,Base.node((j)*(numofcols+1)+i),Base.node((j+1)*(numofcols+1)+i),ENV_TEMPLEFT));
if(i==numofcols-1&&CONDRIGHT) Result.addcondition(Border(true,(j)*(numofcols+1)+i+1,(j+1)*(numofcols+1)+i+1,Base.node((j)*(numofcols+1)+i+1),Base.node((j+1)*(numofcols+1)+i+1),ENV_TEMPRIGHT));
}
}
}
return Result;
}
示例2:
Triangle::Triangle(Nodes& Base, int _X, int _Y, int _Z):X(Base.node(_X)),Xt(Base.temperature(_X)),Y(Base.node(_Y)),Yt(Base.temperature(_Y)),Z(Base.node(_Z)),Zt(Base.temperature(_Z))
{
countcoef();
}