本文整理汇总了C++中oofegGraphicContext::getScalarAlgo方法的典型用法代码示例。如果您正苦于以下问题:C++ oofegGraphicContext::getScalarAlgo方法的具体用法?C++ oofegGraphicContext::getScalarAlgo怎么用?C++ oofegGraphicContext::getScalarAlgo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oofegGraphicContext
的用法示例。
在下文中一共展示了oofegGraphicContext::getScalarAlgo方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: drawScalar
void LSpace :: drawScalar(oofegGraphicContext &gc, TimeStep *tStep)
{
int i, indx, result = 0;
WCRec p [ 8 ];
GraphicObj *tr;
FloatArray v [ 8 ];
double s [ 8 ], defScale = 0.0;
if ( !gc.testElementGraphicActivity(this) ) {
return;
}
if ( gc.giveIntVarMode() == ISM_recovered ) {
for ( i = 1; i <= 8; i++ ) {
result += this->giveInternalStateAtNode(v [ i - 1 ], gc.giveIntVarType(), gc.giveIntVarMode(), i, tStep);
}
if ( result != 8 ) {
return;
}
} else if ( gc.giveIntVarMode() == ISM_local ) {
return;
}
indx = gc.giveIntVarIndx();
for ( i = 1; i <= 8; i++ ) {
s [ i - 1 ] = v [ i - 1 ].at(indx);
}
EASValsSetEdgeColor( gc.getElementEdgeColor() );
EASValsSetEdgeFlag(true);
EASValsSetLayer(OOFEG_VARPLOT_PATTERN_LAYER);
if ( gc.getScalarAlgo() == SA_ISO_SURF ) {
for ( i = 0; i < 8; i++ ) {
if ( gc.getInternalVarsDefGeoFlag() ) {
// use deformed geometry
defScale = gc.getDefScale();
p [ i ].x = ( FPNum ) this->giveNode(i + 1)->giveUpdatedCoordinate(1, tStep, defScale);
p [ i ].y = ( FPNum ) this->giveNode(i + 1)->giveUpdatedCoordinate(2, tStep, defScale);
p [ i ].z = ( FPNum ) this->giveNode(i + 1)->giveUpdatedCoordinate(3, tStep, defScale);
} else {
p [ i ].x = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(1);
p [ i ].y = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(2);
p [ i ].z = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(3);
}
}
gc.updateFringeTableMinMax(s, 8);
tr = CreateHexahedronWD(p, s);
EGWithMaskChangeAttributes(LAYER_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK, tr);
EMAddGraphicsToModel(ESIModel(), tr);
}
}
示例2: drawScalar
void
Tetrah1_ht :: drawScalar(oofegGraphicContext &gc, TimeStep *tStep)
{
int i, indx, result = 0;
WCRec p [ 4 ];
GraphicObj *tr;
FloatArray v [ 4 ];
double s [ 4 ];
if ( !gc.testElementGraphicActivity(this) ) {
return;
}
if ( gc.giveIntVarMode() == ISM_recovered ) {
for ( i = 1; i <= 4; i++ ) {
result += this->giveInternalStateAtNode(v [ i - 1 ], gc.giveIntVarType(), gc.giveIntVarMode(), i, tStep);
}
if ( result != 4 ) {
return;
}
} else if ( gc.giveIntVarMode() == ISM_local ) {
return;
}
indx = gc.giveIntVarIndx();
for ( i = 1; i <= 4; i++ ) {
s [ i - 1 ] = v [ i - 1 ].at(indx);
}
EASValsSetEdgeColor( gc.getElementEdgeColor() );
EASValsSetEdgeFlag(true);
EASValsSetLayer(OOFEG_VARPLOT_PATTERN_LAYER);
if ( gc.getScalarAlgo() == SA_ISO_SURF ) {
for ( i = 0; i < 4; i++ ) {
p [ i ].x = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(1);
p [ i ].y = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(2);
p [ i ].z = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(3);
}
gc.updateFringeTableMinMax(s, 4);
tr = CreateTetraWD(p, s);
EGWithMaskChangeAttributes(LAYER_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK, tr);
EMAddGraphicsToModel(ESIModel(), tr);
}
}
示例3: drawScalar
void Brick1_ht :: drawScalar(oofegGraphicContext &context)
{
int indx, result = 0;
WCRec p [ 8 ];
GraphicObj *tr;
TimeStep *tStep = this->giveDomain()->giveEngngModel()->giveCurrentStep();
FloatArray v [ 8 ];
double s [ 8 ];
if ( !context.testElementGraphicActivity(this) ) {
return;
}
if ( context.giveIntVarMode() == ISM_recovered ) {
for ( int i = 1; i <= 8; i++ ) {
result += this->giveInternalStateAtNode(v [ i - 1 ], context.giveIntVarType(), context.giveIntVarMode(), i, tStep);
}
if ( result != 8 ) {
return;
}
} else if ( context.giveIntVarMode() == ISM_local ) {
return;
}
indx = context.giveIntVarIndx();
for ( int i = 1; i <= 8; i++ ) {
s [ i - 1 ] = v [ i - 1 ].at(indx);
}
EASValsSetEdgeColor( context.getElementEdgeColor() );
EASValsSetEdgeFlag(true);
EASValsSetLayer(OOFEG_VARPLOT_PATTERN_LAYER);
if ( context.getScalarAlgo() == SA_ISO_SURF ) {
for ( int i = 0; i < 8; i++ ) {
p [ i ].x = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(1);
p [ i ].y = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(2);
p [ i ].z = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(3);
}
context.updateFringeTableMinMax(s, 8);
tr = CreateHexahedronWD(p, s);
EGWithMaskChangeAttributes(LAYER_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK, tr);
EMAddGraphicsToModel(ESIModel(), tr);
}
}
示例4: drawScalar
void
TR_SHELL02 :: drawScalar(oofegGraphicContext &gc, TimeStep *tStep)
{
int i, indx, result = 0;
WCRec p [ 3 ];
GraphicObj *tr;
FloatArray v1, v2, v3;
double s [ 3 ], defScale;
if ( !gc.testElementGraphicActivity(this) ) {
return;
}
if ( !this->giveMaterial()->isActivated(tStep) ) {
return;
}
if ( gc.giveIntVarMode() == ISM_recovered ) {
result += this->giveInternalStateAtNode(v1, gc.giveIntVarType(), gc.giveIntVarMode(), 1, tStep);
result += this->giveInternalStateAtNode(v2, gc.giveIntVarType(), gc.giveIntVarMode(), 2, tStep);
result += this->giveInternalStateAtNode(v3, gc.giveIntVarType(), gc.giveIntVarMode(), 3, tStep);
} else if ( gc.giveIntVarMode() == ISM_local ) {
double tot_w = 0.;
FloatArray a, v;
for ( GaussPoint *gp: *plate->giveDefaultIntegrationRulePtr() ) {
this->giveIPValue(a, gp, IST_ShellMomentumTensor, tStep);
v.add(gp->giveWeight(), a);
tot_w += gp->giveWeight();
}
v.times(1. / tot_w);
v1 = v;
v2 = v;
v3 = v;
}
indx = gc.giveIntVarIndx();
s [ 0 ] = v1.at(indx);
s [ 1 ] = v2.at(indx);
s [ 2 ] = v3.at(indx);
EASValsSetLayer(OOFEG_VARPLOT_PATTERN_LAYER);
if ( gc.getScalarAlgo() == SA_ISO_SURF ) {
for ( i = 0; i < 3; i++ ) {
if ( gc.getInternalVarsDefGeoFlag() ) {
// use deformed geometry
defScale = gc.getDefScale();
p [ i ].x = ( FPNum ) this->giveNode(i + 1)->giveUpdatedCoordinate(1, tStep, defScale);
p [ i ].y = ( FPNum ) this->giveNode(i + 1)->giveUpdatedCoordinate(2, tStep, defScale);
p [ i ].z = ( FPNum ) this->giveNode(i + 1)->giveUpdatedCoordinate(3, tStep, defScale);
} else {
p [ i ].x = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(1);
p [ i ].y = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(2);
p [ i ].z = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(3);
}
}
// //EASValsSetColor(gc.getYieldPlotColor(ratio));
gc.updateFringeTableMinMax(s, 3);
tr = CreateTriangleWD3D(p, s [ 0 ], s [ 1 ], s [ 2 ]);
EGWithMaskChangeAttributes(LAYER_MASK, tr);
EMAddGraphicsToModel(ESIModel(), tr);
}
}
示例5: ind
void L4Axisymm :: drawScalar(oofegGraphicContext &gc, TimeStep *tStep)
{
int i, indx, result = 0;
WCRec p [ 4 ];
GraphicObj *tr;
FloatArray v [ 4 ];
double s [ 4 ], defScale;
if ( !gc.testElementGraphicActivity(this) ) {
return;
}
EASValsSetLayer(OOFEG_VARPLOT_PATTERN_LAYER);
if ( gc.giveIntVarMode() == ISM_recovered ) {
for ( i = 1; i <= 4; i++ ) {
result += this->giveInternalStateAtNode(v [ i - 1 ], gc.giveIntVarType(), gc.giveIntVarMode(), i, tStep);
}
if ( result != 4 ) {
return;
}
indx = gc.giveIntVarIndx();
for ( i = 1; i <= 4; i++ ) {
s [ i - 1 ] = v [ i - 1 ].at(indx);
}
if ( gc.getScalarAlgo() == SA_ISO_SURF ) {
for ( i = 0; i < 4; i++ ) {
if ( gc.getInternalVarsDefGeoFlag() ) {
// use deformed geometry
defScale = gc.getDefScale();
p [ i ].x = ( FPNum ) this->giveNode(i + 1)->giveUpdatedCoordinate(1, tStep, defScale);
p [ i ].y = ( FPNum ) this->giveNode(i + 1)->giveUpdatedCoordinate(2, tStep, defScale);
p [ i ].z = 0.;
} else {
p [ i ].x = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(1);
p [ i ].y = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(2);
p [ i ].z = 0.;
}
}
//EASValsSetColor(gc.getYieldPlotColor(ratio));
gc.updateFringeTableMinMax(s, 4);
tr = CreateQuadWD3D(p, s [ 0 ], s [ 1 ], s [ 2 ], s [ 3 ]);
EGWithMaskChangeAttributes(LAYER_MASK, tr);
EMAddGraphicsToModel(ESIModel(), tr);
/*
* } else if (gc.getScalarAlgo() == SA_ISO_LINE) {
*
* EASValsSetColor(context.getActiveCrackColor());
* EASValsSetLineWidth(OOFEG_ISO_LINE_WIDTH);
*
* for (i=0; i< 4; i++) {
* if (gc.getInternalVarsDefGeoFlag()) {
* // use deformed geometry
* defScale = gc.getDefScale();
* p[i].x = (FPNum) this->giveNode(i+1)->giveUpdatedCoordinate(1,tStep,defScale);
* p[i].y = (FPNum) this->giveNode(i+1)->giveUpdatedCoordinate(2,tStep,defScale);
* p[i].z = 0.;
*
* } else {
* p[i].x = (FPNum) this->giveNode(i+1)->giveCoordinate(1);
* p[i].y = (FPNum) this->giveNode(i+1)->giveCoordinate(2);
* p[i].z = 0.;
* }
* }
*
* // isoline implementation
* oofeg_drawIsoLinesOnQuad (p, s);
*
*/
}
} else if ( gc.giveIntVarMode() == ISM_local ) {
if ( numberOfGaussPoints != 4 ) {
return;
}
IntArray ind(4);
FloatArray *gpCoords;
WCRec pp [ 9 ];
for ( i = 0; i < 4; i++ ) {
if ( gc.getInternalVarsDefGeoFlag() ) {
// use deformed geometry
defScale = gc.getDefScale();
pp [ i ].x = ( FPNum ) this->giveNode(i + 1)->giveUpdatedCoordinate(1, tStep, defScale);
pp [ i ].y = ( FPNum ) this->giveNode(i + 1)->giveUpdatedCoordinate(2, tStep, defScale);
pp [ i ].z = 0.;
} else {
pp [ i ].x = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(1);
pp [ i ].y = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(2);
pp [ i ].z = 0.;
}
}
for ( i = 0; i < 3; i++ ) {
pp [ i + 4 ].x = 0.5 * ( pp [ i ].x + pp [ i + 1 ].x );
//.........这里部分代码省略.........
示例6: drawScalar
void QTrPlaneStrain :: drawScalar(oofegGraphicContext &context)
{
int t, n [ 3 ], i, indx, result = 0;
WCRec p [ 3 ];
GraphicObj *tr;
TimeStep *tStep = this->giveDomain()->giveEngngModel()->giveCurrentStep();
FloatArray v [ 6 ];
double s [ 6 ], ss [ 3 ], defScale;
IntArray map;
if ( !context.testElementGraphicActivity(this) ) {
return;
}
if ( context.giveIntVarMode() == ISM_recovered ) {
for ( i = 1; i <= 6; i++ ) {
result += this->giveInternalStateAtNode(v [ i - 1 ], context.giveIntVarType(), context.giveIntVarMode(), i, tStep);
}
} else if ( context.giveIntVarMode() == ISM_local ) {
return;
}
if ( result != 6 ) {
return;
}
result = this->giveIntVarCompFullIndx( map, context.giveIntVarType() );
if ( ( !result ) || ( indx = map.at( context.giveIntVarIndx() ) ) == 0 ) {
return;
}
for ( i = 1; i <= 6; i++ ) {
s [ i - 1 ] = v [ i - 1 ].at(indx);
}
EASValsSetLayer(OOFEG_VARPLOT_PATTERN_LAYER);
if ( context.getScalarAlgo() == SA_ISO_SURF ) {
for ( t = 1; t <= 4; t++ ) {
if ( t == 1 ) {
n [ 0 ] = 1;
n [ 1 ] = 4;
n [ 2 ] = 6;
} else if ( t == 2 ) {
n [ 0 ] = 2;
n [ 1 ] = 5;
n [ 2 ] = 4;
} else if ( t == 3 ) {
n [ 0 ] = 3;
n [ 1 ] = 6;
n [ 2 ] = 5;
} else {
n [ 0 ] = 4;
n [ 1 ] = 5;
n [ 2 ] = 6;
}
for ( i = 0; i < 3; i++ ) {
if ( context.getInternalVarsDefGeoFlag() ) {
// use deformed geometry
defScale = context.getDefScale();
p [ i ].x = ( FPNum ) this->giveNode(n [ i ])->giveUpdatedCoordinate(1, tStep, EID_MomentumBalance, defScale);
p [ i ].y = ( FPNum ) this->giveNode(n [ i ])->giveUpdatedCoordinate(2, tStep, EID_MomentumBalance, defScale);
p [ i ].z = 0.;
} else {
p [ i ].x = ( FPNum ) this->giveNode(n [ i ])->giveCoordinate(1);
p [ i ].y = ( FPNum ) this->giveNode(n [ i ])->giveCoordinate(2);
p [ i ].z = 0.;
}
}
//EASValsSetColor(gc.getYieldPlotColor(ratio));
ss [ 0 ] = s [ n [ 0 ] - 1 ];
ss [ 1 ] = s [ n [ 1 ] - 1 ];
ss [ 2 ] = s [ n [ 2 ] - 1 ];
context.updateFringeTableMinMax(ss, 3);
tr = CreateTriangleWD3D(p, ss [ 0 ], ss [ 1 ], ss [ 2 ]);
EGWithMaskChangeAttributes(LAYER_MASK, tr);
EMAddGraphicsToModel(ESIModel(), tr);
}
/* } else if (context.getScalarAlgo() == SA_ISO_LINE) {
*
* EASValsSetColor(context.getActiveCrackColor());
* EASValsSetLineWidth(OOFEG_ISO_LINE_WIDTH);
*
* for (t=1; t<=4; t++) {
* if (t==1) {n[0] = 1; n[1]=4; n[2]=6;}
* else if (t==2) {n[0]=2; n[1]=5; n[2]=4;}
* else if (t==3) {n[0]=3; n[1]=6; n[2]=5;}
* else {n[0]=4; n[1]=5; n[2]=6;}
*
*
* for (i=0; i< 3; i++) {
* if (context.getInternalVarsDefGeoFlag()) {
* // use deformed geometry
* defScale = context.getDefScale();
* p[i].x = (FPNum) this->giveNode(n[i])->giveUpdatedCoordinate(1,tStep,EID_MomentumBalance,defScale);
* p[i].y = (FPNum) this->giveNode(n[i])->giveUpdatedCoordinate(2,tStep,EID_MomentumBalance,defScale);
//.........这里部分代码省略.........
示例7: drawScalar
void
Quad10_2D_SUPG :: drawScalar(oofegGraphicContext &gc, TimeStep *tStep)
{
int i, indx, result = 0;
WCRec p [ 3 ];
GraphicObj *tr;
FloatArray v1, v2, v3;
double s [ 3 ];
if ( !gc.testElementGraphicActivity(this) ) {
return;
}
EASValsSetLayer(OOFEG_VARPLOT_PATTERN_LAYER);
// if ((gc.giveIntVarMode() == ISM_local) && (gc.giveIntVarType() == IST_VOFFraction)) {
if ( ( gc.giveIntVarType() == IST_VOFFraction ) && ( gc.giveIntVarMode() == ISM_local ) ) {
Polygon matvolpoly;
//this->formMaterialVolumePoly(matvolpoly, NULL, temp_normal, temp_p, false);
EASValsSetColor( gc.getStandardSparseProfileColor() );
//GraphicObj *go = matvolpoly.draw(gc,true,OOFEG_VARPLOT_PATTERN_LAYER);
matvolpoly.draw(gc, true, OOFEG_VARPLOT_PATTERN_LAYER);
return;
}
if ( gc.giveIntVarMode() == ISM_recovered ) {
result += this->giveInternalStateAtNode(v1, gc.giveIntVarType(), gc.giveIntVarMode(), 1, tStep);
result += this->giveInternalStateAtNode(v2, gc.giveIntVarType(), gc.giveIntVarMode(), 2, tStep);
result += this->giveInternalStateAtNode(v3, gc.giveIntVarType(), gc.giveIntVarMode(), 3, tStep);
} else if ( gc.giveIntVarMode() == ISM_local ) {
GaussPoint *gp = integrationRulesArray [ 0 ]->getIntegrationPoint(0);
result += giveIPValue(v1, gp, gc.giveIntVarType(), tStep);
v2 = v1;
v3 = v1;
result *= 3;
}
if ( result != 3 ) {
return;
}
indx = gc.giveIntVarIndx();
s [ 0 ] = v1.at(indx);
s [ 1 ] = v2.at(indx);
s [ 2 ] = v3.at(indx);
EASValsSetLayer(OOFEG_VARPLOT_PATTERN_LAYER);
if ( gc.getScalarAlgo() == SA_ISO_SURF ) {
for ( i = 0; i < 3; i++ ) {
p [ i ].x = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(1);
p [ i ].y = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(2);
p [ i ].z = 0.;
}
//EASValsSetColor(gc.getYieldPlotColor(ratio));
gc.updateFringeTableMinMax(s, 3);
tr = CreateTriangleWD3D(p, s [ 0 ], s [ 1 ], s [ 2 ]);
EGWithMaskChangeAttributes(LAYER_MASK, tr);
EMAddGraphicsToModel(ESIModel(), tr);
} else if ( ( gc.getScalarAlgo() == SA_ZPROFILE ) || ( gc.getScalarAlgo() == SA_COLORZPROFILE ) ) {
double landScale = gc.getLandScale();
for ( i = 0; i < 3; i++ ) {
p [ i ].x = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(1);
p [ i ].y = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(2);
p [ i ].z = s [ i ] * landScale;
}
if ( gc.getScalarAlgo() == SA_ZPROFILE ) {
EASValsSetColor( gc.getDeformedElementColor() );
EASValsSetLineWidth(OOFEG_DEFORMED_GEOMETRY_WIDTH);
EASValsSetFillStyle(FILL_SOLID);
tr = CreateTriangle3D(p);
EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | FILL_MASK | LAYER_MASK, tr);
} else {
gc.updateFringeTableMinMax(s, 3);
EASValsSetFillStyle(FILL_SOLID);
tr = CreateTriangleWD3D(p, s [ 0 ], s [ 1 ], s [ 2 ]);
EGWithMaskChangeAttributes(FILL_MASK | LAYER_MASK, tr);
}
EMAddGraphicsToModel(ESIModel(), tr);
}
}
示例8: drawScalar
void Truss1d :: drawScalar(oofegGraphicContext &gc, TimeStep *tStep)
{
int i, indx, result = 0;
WCRec p [ 2 ];
GraphicObj *tr;
FloatArray v1, v2;
double s [ 2 ], defScale;
if ( !gc.testElementGraphicActivity(this) ) {
return;
}
if ( gc.giveIntVarMode() == ISM_recovered ) {
result += this->giveInternalStateAtNode(v1, gc.giveIntVarType(), gc.giveIntVarMode(), 1, tStep);
result += this->giveInternalStateAtNode(v2, gc.giveIntVarType(), gc.giveIntVarMode(), 2, tStep);
} else if ( gc.giveIntVarMode() == ISM_local ) {
GaussPoint *gp = integrationRulesArray [ 0 ]->getIntegrationPoint(0);
result += giveIPValue(v1, gp, gc.giveIntVarType(), tStep);
v2 = v1;
result *= 2;
}
if ( result != 2 ) {
return;
}
indx = gc.giveIntVarIndx();
s [ 0 ] = v1.at(indx);
s [ 1 ] = v2.at(indx);
EASValsSetLayer(OOFEG_VARPLOT_PATTERN_LAYER);
if ( ( gc.getScalarAlgo() == SA_ISO_SURF ) || ( gc.getScalarAlgo() == SA_ISO_LINE ) ) {
for ( i = 0; i < 2; i++ ) {
if ( gc.getInternalVarsDefGeoFlag() ) {
// use deformed geometry
defScale = gc.getDefScale();
p [ i ].x = ( FPNum ) this->giveNode(i + 1)->giveUpdatedCoordinate(1, tStep, defScale);
p [ i ].y = 0.;
p [ i ].z = 0.;
} else {
p [ i ].x = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(1);
p [ i ].y = 0.;
p [ i ].z = 0.;
}
}
//EASValsSetColor(gc.getYieldPlotColor(ratio));
tr = CreateLine3D(p);
EGWithMaskChangeAttributes(LAYER_MASK, tr);
EMAddGraphicsToModel(ESIModel(), tr);
} else if ( ( gc.getScalarAlgo() == SA_ZPROFILE ) || ( gc.getScalarAlgo() == SA_COLORZPROFILE ) ) {
double landScale = gc.getLandScale();
for ( i = 0; i < 2; i++ ) {
if ( gc.getInternalVarsDefGeoFlag() ) {
// use deformed geometry
defScale = gc.getDefScale();
p [ i ].x = ( FPNum ) this->giveNode(i + 1)->giveUpdatedCoordinate(1, tStep, defScale);
p [ i ].y = 0.0;
p [ i ].z = s [ i ] * landScale;
} else {
p [ i ].x = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(1);
p [ i ].y = 0.0;
p [ i ].z = s [ i ] * landScale;
}
}
if ( gc.getScalarAlgo() == SA_ZPROFILE ) {
/*
* EASValsSetColor(gc.getDeformedElementColor());
* EASValsSetLineWidth(OOFEG_DEFORMED_GEOMETRY_WIDTH);
* tr = CreateLine3D(p);
* EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | LAYER_MASK, tr);
*/
WCRec pp [ 4 ];
pp [ 0 ].x = p [ 0 ].x;
pp [ 0 ].y = 0.0;
pp [ 0 ].z = 0.0;
pp [ 1 ].x = p [ 0 ].x;
pp [ 1 ].y = 0.0;
pp [ 1 ].z = p [ 0 ].z;
pp [ 2 ].x = p [ 1 ].x;
pp [ 2 ].y = 0.0;
pp [ 2 ].z = p [ 1 ].z;
pp [ 3 ].x = p [ 1 ].x;
pp [ 3 ].y = 0.0;
pp [ 3 ].z = 0.0;
tr = CreateQuad3D(pp);
EASValsSetLineWidth(OOFEG_DEFORMED_GEOMETRY_WIDTH);
EASValsSetColor( gc.getDeformedElementColor() );
//EASValsSetLayer(OOFEG_DEFORMED_GEOMETRY_LAYER);
EASValsSetFillStyle(FILL_HOLLOW);
EGWithMaskChangeAttributes(WIDTH_MASK | FILL_MASK | COLOR_MASK | LAYER_MASK, tr);
EMAddGraphicsToModel(ESIModel(), tr);
} else {
//tr = CreateTriangleWD3D(p, s[0], s[1], s[2]);
EASValsSetColor( gc.getDeformedElementColor() );
tr = CreateLine3D(p);
//.........这里部分代码省略.........
示例9: ind
//.........这里部分代码省略.........
n [ 0 ] = 0;
n [ 1 ] = 4;
n [ 2 ] = 8;
n [ 3 ] = 7;
} else if ( t == 2 ) {
n [ 0 ] = 4;
n [ 1 ] = 1;
n [ 2 ] = 5;
n [ 3 ] = 8;
} else if ( t == 3 ) {
n [ 0 ] = 5;
n [ 1 ] = 2;
n [ 2 ] = 6;
n [ 3 ] = 8;
} else {
n [ 0 ] = 6;
n [ 1 ] = 3;
n [ 2 ] = 7;
n [ 3 ] = 8;
}
ss [ 0 ] = s [ n [ 0 ] ];
ss [ 1 ] = s [ n [ 1 ] ];
ss [ 2 ] = s [ n [ 2 ] ];
ss [ 3 ] = s [ n [ 3 ] ];
for ( i = 0; i < 4; i++ ) {
p [ i ].x = pp [ n [ i ] ].x;
p [ i ].y = pp [ n [ i ] ].y;
p [ i ].z = 0.;
}
if ( context.getScalarAlgo() == SA_ISO_SURF ) {
/*
* for ( i = 0; i < 4; i++ ) {
* if ( context.getInternalVarsDefGeoFlag() ) {
* // use deformed geometry
* defScale = context.getDefScale();
* p [ i ].x = ( FPNum ) this->giveNode(n[i] + 1)->giveUpdatedCoordinate(1, tStep, defScale);
* p [ i ].y = ( FPNum ) this->giveNode(n[i] + 1)->giveUpdatedCoordinate(2, tStep, defScale);
* p [ i ].z = 0.;
* } else {
* // use initial geometry
* p [ i ].x = ( FPNum ) this->giveNode(n[i] + 1)->giveCoordinate(1);
* p [ i ].y = ( FPNum ) this->giveNode(n[i] + 1)->giveCoordinate(2);
* p [ i ].z = 0.;
* }
* }
*/
//EASValsSetColor(gc.getYieldPlotColor(ratio));
context.updateFringeTableMinMax(ss, 4);
tr = CreateQuadWD3D(p, ss [ 0 ], ss [ 1 ], ss [ 2 ], ss [ 3 ]);
EGWithMaskChangeAttributes(LAYER_MASK, tr);
EMAddGraphicsToModel(ESIModel(), tr);
} else if ( ( context.getScalarAlgo() == SA_ZPROFILE ) || ( context.getScalarAlgo() == SA_COLORZPROFILE ) ) {
//double landScale = context.getLandScale();
for ( i = 0; i < 4; i++ ) {
/*
* if ( context.getInternalVarsDefGeoFlag() ) {
* // use deformed geometry
* defScale = context.getDefScale();
* p [ i ].x = ( FPNum ) this->giveNode(i + 1)->giveUpdatedCoordinate(1, tStep, defScale);
* p [ i ].y = ( FPNum ) this->giveNode(i + 1)->giveUpdatedCoordinate(2, tStep, defScale);
* p [ i ].z = ss [ i ] * landScale;
示例10: dofMask
void Quad1_ht :: drawScalar(oofegGraphicContext &context)
{
int i, indx, result = 0;
WCRec p [ 4 ];
GraphicObj *tr;
TimeStep *tStep = this->giveDomain()->giveEngngModel()->giveCurrentStep();
double s [ 4 ];
FloatArray v [ 4 ];
InternalStateType itype = context.giveIntVarType();
if ( !context.testElementGraphicActivity(this) ) {
return;
}
EASValsSetLayer(OOFEG_VARPLOT_PATTERN_LAYER);
if ( itype == IST_HydrationDegree ) {
for ( i = 1; i <= 4; i++ ) {
result += this->giveInternalStateAtNode(v [ i - 1 ], context.giveIntVarType(), context.giveIntVarMode(), i, tStep);
}
if ( result != 4 ) {
return;
}
indx = context.giveIntVarIndx();
for ( i = 1; i <= 4; i++ ) {
s [ i - 1 ] = v [ i - 1 ].at(indx);
}
if ( context.getScalarAlgo() == SA_ISO_SURF ) {
for ( i = 0; i < 4; i++ ) {
p [ i ].x = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(1);
p [ i ].y = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(2);
p [ i ].z = 0.;
}
context.updateFringeTableMinMax(s, 4);
tr = CreateQuadWD3D(p, s [ 0 ], s [ 1 ], s [ 2 ], s [ 3 ]);
EGWithMaskChangeAttributes(LAYER_MASK, tr);
EMAddGraphicsToModel(ESIModel(), tr);
}
} else if ( ( ( ( emode == HeatTransferEM ) || ( emode == HeatMass1TransferEM ) ) && ( itype == IST_Temperature ) ) ||
( ( emode == HeatMass1TransferEM ) && ( itype == IST_MassConcentration_1 ) ) ) {
IntArray dofMask(1);
if ( itype == IST_Temperature ) {
dofMask.at(1) = T_f;
} else {
dofMask.at(1) = C_1;
}
FloatArray r;
for ( i = 0; i < 4; i++ ) {
this->giveNode(i + 1)->giveUnknownVector(r, dofMask, VM_Total, tStep);
s [ i ] = r.at(1);
p [ i ].x = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(1);
p [ i ].y = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(2);
p [ i ].z = 0.;
}
context.updateFringeTableMinMax(s, 4);
tr = CreateQuadWD3D(p, s [ 0 ], s [ 1 ], s [ 2 ], s [ 3 ]);
EGWithMaskChangeAttributes(LAYER_MASK, tr);
EMAddGraphicsToModel(ESIModel(), tr);
}
}
示例11: ind
void QTrPlaneStress2d :: drawScalar(oofegGraphicContext &gc, TimeStep *tStep)
{
int t, n [ 3 ], i, indx, result = 0;
WCRec p [ 3 ];
GraphicObj *tr;
FloatArray v [ 6 ];
double s [ 6 ], ss [ 3 ], defScale;
if ( !gc.testElementGraphicActivity(this) ) {
return;
}
if ( gc.giveIntVarMode() == ISM_recovered ) {
// ========= plot recovered values =========
for ( i = 1; i <= 6; i++ ) {
result += this->giveInternalStateAtNode(v [ i - 1 ], gc.giveIntVarType(), gc.giveIntVarMode(), i, tStep);
}
if ( result != 6 ) {
return;
}
indx = gc.giveIntVarIndx();
for ( i = 1; i <= 6; i++ ) {
s [ i - 1 ] = v [ i - 1 ].at(indx);
}
EASValsSetLayer(OOFEG_VARPLOT_PATTERN_LAYER);
if ( gc.getScalarAlgo() == SA_ISO_SURF ) {
for ( t = 1; t <= 4; t++ ) {
if ( t == 1 ) {
n [ 0 ] = 1;
n [ 1 ] = 4;
n [ 2 ] = 6;
} else if ( t == 2 ) {
n [ 0 ] = 2;
n [ 1 ] = 5;
n [ 2 ] = 4;
} else if ( t == 3 ) {
n [ 0 ] = 3;
n [ 1 ] = 6;
n [ 2 ] = 5;
} else {
n [ 0 ] = 4;
n [ 1 ] = 5;
n [ 2 ] = 6;
}
for ( i = 0; i < 3; i++ ) {
if ( gc.getInternalVarsDefGeoFlag() ) {
// use deformed geometry
defScale = gc.getDefScale();
p [ i ].x = ( FPNum ) this->giveNode(n [ i ])->giveUpdatedCoordinate(1, tStep, defScale);
p [ i ].y = ( FPNum ) this->giveNode(n [ i ])->giveUpdatedCoordinate(2, tStep, defScale);
p [ i ].z = 0.;
} else {
// use initial geometry
p [ i ].x = ( FPNum ) this->giveNode(n [ i ])->giveCoordinate(1);
p [ i ].y = ( FPNum ) this->giveNode(n [ i ])->giveCoordinate(2);
p [ i ].z = 0.;
}
}
//EASValsSetColor(gc.getYieldPlotColor(ratio));
ss [ 0 ] = s [ n [ 0 ] - 1 ];
ss [ 1 ] = s [ n [ 1 ] - 1 ];
ss [ 2 ] = s [ n [ 2 ] - 1 ];
gc.updateFringeTableMinMax(ss, 3);
tr = CreateTriangleWD3D(p, ss [ 0 ], ss [ 1 ], ss [ 2 ]);
EGWithMaskChangeAttributes(LAYER_MASK, tr);
EMAddGraphicsToModel(ESIModel(), tr);
}
/* } else if (gc.getScalarAlgo() == SA_ISO_LINE) {
*
* EASValsSetColor(context.getActiveCrackColor());
* EASValsSetLineWidth(OOFEG_ISO_LINE_WIDTH);
*
* for (t=1; t<=4; t++) {
* if (t==1) {n[0] = 1; n[1]=4; n[2]=6;}
* else if (t==2) {n[0]=2; n[1]=5; n[2]=4;}
* else if (t==3) {n[0]=3; n[1]=6; n[2]=5;}
* else {n[0]=4; n[1]=5; n[2]=6;}
*
*
* for (i=0; i< 3; i++) {
* if (gc.getInternalVarsDefGeoFlag()) {
* // use deformed geometry
* defScale = gc.getDefScale();
* p[i].x = (FPNum) this->giveNode(n[i])->giveUpdatedCoordinate(1,tStep,defScale);
* p[i].y = (FPNum) this->giveNode(n[i])->giveUpdatedCoordinate(2,tStep,defScale);
* p[i].z = 0.;
*
* } else {
* p[i].x = (FPNum) this->giveNode(n[i])->giveCoordinate(1);
* p[i].y = (FPNum) this->giveNode(n[i])->giveCoordinate(2);
* p[i].z = 0.;
//.........这里部分代码省略.........
示例12: drawScalar
void
TR_SHELL01 :: drawScalar(oofegGraphicContext &context)
{
int i, indx, result = 0;
WCRec p [ 3 ];
GraphicObj *tr;
TimeStep *tStep = this->giveDomain()->giveEngngModel()->giveCurrentStep();
FloatArray v1, v2, v3;
double s [ 3 ], defScale;
if ( !context.testElementGraphicActivity(this) ) {
return;
}
if ( !this->giveMaterial()->isActivated(tStep) ) {
return;
}
if ( context.giveIntVarMode() == ISM_recovered ) {
result += this->giveInternalStateAtNode(v1, context.giveIntVarType(), context.giveIntVarMode(), 1, tStep);
result += this->giveInternalStateAtNode(v2, context.giveIntVarType(), context.giveIntVarMode(), 2, tStep);
result += this->giveInternalStateAtNode(v3, context.giveIntVarType(), context.giveIntVarMode(), 3, tStep);
} else if ( context.giveIntVarMode() == ISM_local ) {
int nip = plate->giveDefaultIntegrationRulePtr()->giveNumberOfIntegrationPoints();
FloatArray a, v(12);
v.zero();
for (int _i=1; _i<= nip; _i++) {
this->giveIPValue(a, plate->giveDefaultIntegrationRulePtr()->getIntegrationPoint(_i-1), IST_ShellForceMomentumTensor, tStep);
v += a;
}
v.times(1./nip);
v1 = v;
v2 =v;
v3 =v;
}
indx = context.giveIntVarIndx();
s [ 0 ] = v1.at(indx);
s [ 1 ] = v2.at(indx);
s [ 2 ] = v3.at(indx);
EASValsSetLayer(OOFEG_VARPLOT_PATTERN_LAYER);
if ( context.getScalarAlgo() == SA_ISO_SURF ) {
for ( i = 0; i < 3; i++ ) {
if ( context.getInternalVarsDefGeoFlag() ) {
// use deformed geometry
defScale = context.getDefScale();
p [ i ].x = ( FPNum ) this->giveNode(i + 1)->giveUpdatedCoordinate(1, tStep, defScale);
p [ i ].y = ( FPNum ) this->giveNode(i + 1)->giveUpdatedCoordinate(2, tStep, defScale);
p [ i ].z = ( FPNum ) this->giveNode(i + 1)->giveUpdatedCoordinate(3, tStep, defScale);
} else {
p [ i ].x = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(1);
p [ i ].y = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(2);
p [ i ].z = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(3);
}
}
// //EASValsSetColor(gc.getYieldPlotColor(ratio));
context.updateFringeTableMinMax(s, 3);
tr = CreateTriangleWD3D(p, s [ 0 ], s [ 1 ], s [ 2 ]);
EGWithMaskChangeAttributes(LAYER_MASK, tr);
EMAddGraphicsToModel(ESIModel(), tr);
}
}