📄 wzsegment.cxx
字号:
#include "wzsegment.hxx"
#include "wzoutput.hxx"
wzSegmentDescription *wzSegment::s=0;
wzSegmentDescription *wzRegion::s=0;
wzSegmentDescription *wzFace::s=0;
wzSegmentDescription *wzEdge::s=0;
wzSegmentDescription *wzVertex::s=0;
void wzSegment::print() const
{
if(isRegion()){
region().print();
}else if(isFace()){
face().print();
}
}
void wzRegion::print() const
{
wzOutput& pout = wzOutput::Default;
if(I == material().I){
pout("material <>: <>\n"),I, name();
}else{
pout("region <>: <> (material <>)\n"),I, name(),material().name();
}
}
void wzFace::print() const
{
wzOutput& pout = wzOutput::Default;
pout("face <>: <>\n"),I,name();
}
wzBadSegment::wzBadSegment(wzDimension d,wzIndex i)
:wzFailure("segment range error"),D(d),I(i)
{;}
wzSegmentDescription::wzSegmentDescription()
:Region(),Face(),Edge(),Vertex()
,RName(Region),RColor(Region),RType(Region)
,FName(Face),FColor(Face),FType(Face)
,EName(Edge),EColor(Edge),EType(Edge)
,VName(Vertex),VColor(Vertex),VType(Vertex)
{use();}
void wzSegmentDescription::print()
{
wzIndex r;
wzOutput& pout = wzOutput::Default;
wzRangeLoop(Region,r){
pout("Region <> (<>)\n")<<wzRegion(r).name(),wzRegion(r).color();
}
}
void wzSegmentDescription::use()
{wzSegment::s = wzRegion::s = wzFace::s = wzEdge::s = wzVertex::s = this;}
wzRegion::wzRegion(wzName name, wzColor color)
{
s->control();
I=s->Region.create();s->RName[I] = name; s->RColor[I] = color;
s->RType[I] = I;
}
wzRegion::wzRegion(wzName name, wzRegion mat, wzColor color)
{
s->control();
I=s->Region.create();s->RName[I] = name; s->RColor[I] = color;
s->RType[I] = s->RType[mat];
}
wzRegion::wzRegion(wzName name, wzRegion mat)
{
s->control();
I=s->Region.create(); s->RName[I] = name; s->RColor[I] = mat.color();
s->RType[I] = s->RType[mat];
}
wzFace::wzFace(wzName name, wzColor color)
{
s->control();
I=s->Face.create();s->FName[I] = name; s->FColor[I] = color;
s->FType[I] = I;
}
wzFace::wzFace(wzName name, wzFace cond, wzColor color)
{
s->control();
I=s->Face.create();s->FName[I] = name; s->FColor[I] = color;
s->FType[I] = s->FType[cond];
}
wzFace::wzFace(wzName name, wzFace cond)
{
s->control();
I=s->Face.create(); s->FName[I] = name; s->FColor[I] = cond.color();
s->FType[I] = s->FType[cond];
}
wzEdge::wzEdge(wzName name, wzColor color)
{
s->control();
I=s->Edge.create();s->EName[I] = name; s->EColor[I] = color;
s->EType[I] = I;
}
wzEdge::wzEdge(wzName name, wzEdge cond, wzColor color)
{
s->control();
I=s->Edge.create();s->EName[I] = name; s->EColor[I] = color;
s->EType[I] = s->EType[cond];
}
wzEdge::wzEdge(wzName name, wzEdge cond)
{
s->control();
I=s->Edge.create(); s->EName[I] = name; s->EColor[I] = cond.color();
s->EType[I] = s->EType[cond];
}
wzVertex::wzVertex(wzName name, wzColor color)
{
s->control();
I=s->Vertex.create();s->VName[I] = name; s->VColor[I] = color;
s->VType[I] = I;
}
wzVertex::wzVertex(wzName name, wzVertex cond, wzColor color)
{
s->control();
I=s->Vertex.create();s->VName[I] = name; s->VColor[I] = color;
s->VType[I] = s->VType[cond];
}
wzVertex::wzVertex(wzName name, wzVertex cond)
{
s->control();
I=s->Vertex.create(); s->VName[I] = name; s->VColor[I] = cond.color();
s->VType[I] = s->VType[cond];
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -