您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ EASValsSetColor函数代码示例

51自学网 2021-06-01 20:30:43
  C++
这篇教程C++ EASValsSetColor函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中EASValsSetColor函数的典型用法代码示例。如果您正苦于以下问题:C++ EASValsSetColor函数的具体用法?C++ EASValsSetColor怎么用?C++ EASValsSetColor使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了EASValsSetColor函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: drawDeformedGeometry

void CohesiveSurface3d :: drawDeformedGeometry(oofegGraphicContext &gc, TimeStep *tStep, UnknownType type){    GraphicObj *go1, *go2;    if ( !gc.testElementGraphicActivity(this) ) {        return;    }    double defScale = gc.getDefScale();    WCRec p [ 2 ];    EASValsSetLineWidth(OOFEG_DEFORMED_GEOMETRY_WIDTH);    EASValsSetColor( gc.getDeformedElementColor() );    EASValsSetLayer(OOFEG_DEFORMED_GEOMETRY_LAYER);    //  get the displaced particle coordinates    Particle *nodeA = ( Particle * ) giveNode(1);    Particle *nodeB = ( Particle * ) giveNode(2);    p [ 0 ].x = nodeA->giveUpdatedCoordinate(1, tStep, defScale);    p [ 0 ].y = nodeA->giveUpdatedCoordinate(2, tStep, defScale);    p [ 0 ].z = nodeA->giveUpdatedCoordinate(3, tStep, defScale);    p [ 1 ].x = nodeB->giveUpdatedCoordinate(1, tStep, defScale);    p [ 1 ].y = nodeB->giveUpdatedCoordinate(2, tStep, defScale);    p [ 1 ].z = nodeB->giveUpdatedCoordinate(3, tStep, defScale);    // plot the displaced particles    EASValsSetMType(FILLED_CIRCLE_MARKER);    EASValsSetColor( gc.getNodeColor() );    EASValsSetMSize(6);    // plot the first particle    go1 = CreateMarker3D(p);    EGWithMaskChangeAttributes(COLOR_MASK | LAYER_MASK | MTYPE_MASK | MSIZE_MASK, go1);    EMAddGraphicsToModel(ESIModel(), go1);    // take into account periodic conditions    if ( giveNumberOfNodes() == 3 ) {        Node *nodeC = ( Particle * ) giveNode(3);        p [ 1 ].x += kxa + kxa * defScale * ( nodeC->giveDofWithID(D_u)->giveUnknown(VM_Total, tStep) ) + kyb * defScale * ( nodeC->giveDofWithID(R_u)->giveUnknown(VM_Total, tStep) );        p [ 1 ].y += kyb + kyb * defScale * ( nodeC->giveDofWithID(D_v)->giveUnknown(VM_Total, tStep) ) + kzc * defScale * ( nodeC->giveDofWithID(R_v)->giveUnknown(VM_Total, tStep) );        p [ 1 ].z += kzc + kzc * defScale * ( nodeC->giveDofWithID(D_w)->giveUnknown(VM_Total, tStep) ) + kxa * defScale * ( nodeC->giveDofWithID(R_w)->giveUnknown(VM_Total, tStep) );        EASValsSetMType(CIRCLE_MARKER);    }    // plot the second particle    go2 = CreateMarker3D(p + 1);    EGWithMaskChangeAttributes(COLOR_MASK | LAYER_MASK | MTYPE_MASK | MSIZE_MASK, go2);    EMAddGraphicsToModel(ESIModel(), go2);}
开发者ID:Benjamin-git,项目名称:OOFEM_Jim,代码行数:49,


示例2: drawRawGeometry

void Brick1_ht :: drawRawGeometry(oofegGraphicContext &gc){    WCRec p [ 8 ];    GraphicObj *go;    if ( !gc.testElementGraphicActivity(this) ) {        return;    }    EASValsSetLineWidth(OOFEG_RAW_GEOMETRY_WIDTH);    EASValsSetColor( gc.getElementColor() );    EASValsSetEdgeColor( gc.getElementEdgeColor() );    EASValsSetEdgeFlag(true);    EASValsSetLayer(OOFEG_RAW_GEOMETRY_LAYER);    EASValsSetFillStyle(FILL_SOLID);    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);    }    go =  CreateHexahedron(p);    EGWithMaskChangeAttributes(WIDTH_MASK | FILL_MASK | COLOR_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK | LAYER_MASK, go);    EGAttachObject(go, ( EObjectP ) this);    EMAddGraphicsToModel(ESIModel(), go);}
开发者ID:JimBrouzoulis,项目名称:OOFEM_LargeDef,代码行数:26,


示例3: drawDeformedGeometry

voidTR_SHELL02 :: drawDeformedGeometry(oofegGraphicContext &gc, TimeStep *tStep, UnknownType type){    WCRec p [ 3 ];    GraphicObj *go;    double defScale = gc.getDefScale();    if ( !gc.testElementGraphicActivity(this) ) {        return;    }    if ( this->giveMaterial()->isActivated(tStep) ) {        EASValsSetLineWidth(OOFEG_DEFORMED_GEOMETRY_WIDTH);        EASValsSetColor( gc.getDeformedElementColor() );        EASValsSetEdgeColor( gc.getElementEdgeColor() );        EASValsSetEdgeFlag(true);        EASValsSetFillStyle(FILL_SOLID);        EASValsSetLayer(OOFEG_DEFORMED_GEOMETRY_LAYER);        p [ 0 ].x = ( FPNum ) this->giveNode(1)->giveUpdatedCoordinate(1, tStep, defScale);        p [ 0 ].y = ( FPNum ) this->giveNode(1)->giveUpdatedCoordinate(2, tStep, defScale);        p [ 0 ].z = ( FPNum ) this->giveNode(1)->giveUpdatedCoordinate(3, tStep, defScale);        p [ 1 ].x = ( FPNum ) this->giveNode(2)->giveUpdatedCoordinate(1, tStep, defScale);        p [ 1 ].y = ( FPNum ) this->giveNode(2)->giveUpdatedCoordinate(2, tStep, defScale);        p [ 1 ].z = ( FPNum ) this->giveNode(2)->giveUpdatedCoordinate(3, tStep, defScale);        p [ 2 ].x = ( FPNum ) this->giveNode(3)->giveUpdatedCoordinate(1, tStep, defScale);        p [ 2 ].y = ( FPNum ) this->giveNode(3)->giveUpdatedCoordinate(2, tStep, defScale);        p [ 2 ].z = ( FPNum ) this->giveNode(3)->giveUpdatedCoordinate(3, tStep, defScale);        go =  CreateTriangle3D(p);        EGWithMaskChangeAttributes(WIDTH_MASK | FILL_MASK | COLOR_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK | LAYER_MASK, go);        EMAddGraphicsToModel(ESIModel(), go);    }}
开发者ID:rainbowlqs,项目名称:oofem,代码行数:33,


示例4: drawDeformedGeometry

void QTrPlaneStrain :: drawDeformedGeometry(oofegGraphicContext &gc, UnknownType type){    WCRec p [ 3 ];    GraphicObj *go;    TimeStep *tStep = domain->giveEngngModel()->giveCurrentStep();    double defScale = gc.getDefScale();    if ( !gc.testElementGraphicActivity(this) ) {        return;    }    EASValsSetLineWidth(OOFEG_DEFORMED_GEOMETRY_WIDTH);    EASValsSetColor( gc.getDeformedElementColor() );    EASValsSetEdgeColor( gc.getElementEdgeColor() );    EASValsSetEdgeFlag(true);    EASValsSetLayer(OOFEG_DEFORMED_GEOMETRY_LAYER);    p [ 0 ].x = ( FPNum ) this->giveNode(1)->giveUpdatedCoordinate(1, tStep, EID_MomentumBalance, defScale);    p [ 0 ].y = ( FPNum ) this->giveNode(1)->giveUpdatedCoordinate(2, tStep, EID_MomentumBalance, defScale);    p [ 0 ].z = 0.;    p [ 1 ].x = ( FPNum ) this->giveNode(2)->giveUpdatedCoordinate(1, tStep, EID_MomentumBalance, defScale);    p [ 1 ].y = ( FPNum ) this->giveNode(2)->giveUpdatedCoordinate(2, tStep, EID_MomentumBalance, defScale);    p [ 1 ].z = 0.;    p [ 2 ].x = ( FPNum ) this->giveNode(3)->giveUpdatedCoordinate(1, tStep, EID_MomentumBalance, defScale);    p [ 2 ].y = ( FPNum ) this->giveNode(3)->giveUpdatedCoordinate(2, tStep, EID_MomentumBalance, defScale);    p [ 2 ].z = 0.;    go =  CreateTriangle3D(p);    EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK | LAYER_MASK, go);    EMAddGraphicsToModel(ESIModel(), go);}
开发者ID:JimBrouzoulis,项目名称:oofem-1,代码行数:30,


示例5: drawDeformedGeometry

void LIBeam3dNL :: drawDeformedGeometry(oofegGraphicContext &gc, UnknownType type){    GraphicObj *go;    if ( !gc.testElementGraphicActivity(this) ) {        return;    }    TimeStep *tStep = domain->giveEngngModel()->giveCurrentStep();    double defScale = gc.getDefScale();    //  if (!go) { // create new one    WCRec p [ 2 ]; /* poin */    EASValsSetLineWidth(OOFEG_DEFORMED_GEOMETRY_WIDTH);    EASValsSetColor( gc.getDeformedElementColor() );    EASValsSetLayer(OOFEG_DEFORMED_GEOMETRY_LAYER);    p [ 0 ].x = ( FPNum ) this->giveNode(1)->giveUpdatedCoordinate(1, tStep, EID_MomentumBalance, defScale);    p [ 0 ].y = ( FPNum ) this->giveNode(1)->giveUpdatedCoordinate(2, tStep, EID_MomentumBalance, defScale);    p [ 0 ].z = ( FPNum ) this->giveNode(1)->giveUpdatedCoordinate(3, tStep, EID_MomentumBalance, defScale);    p [ 1 ].x = ( FPNum ) this->giveNode(2)->giveUpdatedCoordinate(1, tStep, EID_MomentumBalance, defScale);    p [ 1 ].y = ( FPNum ) this->giveNode(2)->giveUpdatedCoordinate(2, tStep, EID_MomentumBalance, defScale);    p [ 1 ].z = ( FPNum ) this->giveNode(2)->giveUpdatedCoordinate(3, tStep, EID_MomentumBalance, defScale);    go = CreateLine3D(p);    EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | LAYER_MASK, go);    EMAddGraphicsToModel(ESIModel(), go);}
开发者ID:JimBrouzoulis,项目名称:oofem-1,代码行数:26,


示例6: drawRawCrossSections

voidLattice2d :: drawRawCrossSections(oofegGraphicContext &gc, TimeStep *tStep){    GraphicObj *go;    //  if (!go) { // create new one    WCRec p [ 2 ]; /* poin */    if ( !gc.testElementGraphicActivity(this) ) {        return;    }    EASValsSetLineWidth(OOFEG_RAW_GEOMETRY_WIDTH);    EASValsSetColor( gc.getCrossSectionColor() );    EASValsSetLayer(OOFEG_RAW_CROSSSECTION_LAYER);    FloatArray coords;    this->giveCrossSectionCoordinates(coords);    p [ 0 ].x = ( FPNum ) coords.at(1);    p [ 0 ].y = ( FPNum ) coords.at(2);    p [ 0 ].z = ( FPNum ) coords.at(3);    p [ 1 ].x = ( FPNum ) coords.at(4);    p [ 1 ].y = ( FPNum ) coords.at(5);    p [ 1 ].z = ( FPNum ) coords.at(6);    go = CreateLine3D(p);    EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | LAYER_MASK, go);    EGAttachObject(go, ( EObjectP ) this);    EMAddGraphicsToModel(ESIModel(), go);}
开发者ID:Benjamin-git,项目名称:OOFEM_Jim,代码行数:30,


示例7: drawRawGeometry

void InterfaceElem2dQuad :: drawRawGeometry(oofegGraphicContext &gc, TimeStep *tStep){    GraphicObj *go;    //  if (!go) { // create new one    WCRec p [ 2 ]; /* poin */    if ( !gc.testElementGraphicActivity(this) ) {        return;    }    EASValsSetLineWidth(OOFEG_RAW_GEOMETRY_WIDTH);    EASValsSetColor( gc.getElementColor() );    EASValsSetLayer(OOFEG_RAW_GEOMETRY_LAYER);    p [ 0 ].x = ( FPNum ) this->giveNode(1)->giveCoordinate(1);    p [ 0 ].y = ( FPNum ) this->giveNode(1)->giveCoordinate(2);    p [ 0 ].z = 0.0;    p [ 1 ].x = ( FPNum ) this->giveNode(3)->giveCoordinate(1);    p [ 1 ].y = ( FPNum ) this->giveNode(3)->giveCoordinate(2);    p [ 1 ].z = 0.0;    go = CreateLine3D(p);    EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | LAYER_MASK, go);    EGAttachObject(go, ( EObjectP ) this);    EMAddGraphicsToModel(ESIModel(), go);    p [ 0 ].x = ( FPNum ) this->giveNode(3)->giveCoordinate(1);    p [ 0 ].y = ( FPNum ) this->giveNode(3)->giveCoordinate(2);    p [ 0 ].z = 0.0;    p [ 1 ].x = ( FPNum ) this->giveNode(2)->giveCoordinate(1);    p [ 1 ].y = ( FPNum ) this->giveNode(2)->giveCoordinate(2);    p [ 1 ].z = 0.0;    go = CreateLine3D(p);    EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | LAYER_MASK, go);    EGAttachObject(go, ( EObjectP ) this);    EMAddGraphicsToModel(ESIModel(), go);}
开发者ID:rreissnerr,项目名称:oofem,代码行数:33,


示例8: drawDeformedGeometry

void InterfaceElem2dQuad :: drawDeformedGeometry(oofegGraphicContext &gc, TimeStep *tStep, UnknownType type){    GraphicObj *go;    //  if (!go) { // create new one    WCRec p [ 2 ]; /* poin */    if ( !gc.testElementGraphicActivity(this) ) {        return;    }    double defScale = gc.getDefScale();    EASValsSetLineWidth(OOFEG_DEFORMED_GEOMETRY_WIDTH);    EASValsSetColor( gc.getDeformedElementColor() );    EASValsSetLayer(OOFEG_DEFORMED_GEOMETRY_LAYER + 1);    p [ 0 ].x = ( FPNum ) this->giveNode(1)->giveUpdatedCoordinate(1, tStep, defScale);    p [ 0 ].y = ( FPNum ) this->giveNode(1)->giveUpdatedCoordinate(2, tStep, defScale);    p [ 0 ].z = 0.0;    p [ 1 ].x = ( FPNum ) this->giveNode(2)->giveUpdatedCoordinate(1, tStep, defScale);    p [ 1 ].y = ( FPNum ) this->giveNode(2)->giveUpdatedCoordinate(2, tStep, defScale);    p [ 1 ].z = 0.0;    go = CreateLine3D(p);    EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | LAYER_MASK, go);    EMAddGraphicsToModel(ESIModel(), go);    p [ 0 ].x = ( FPNum ) this->giveNode(4)->giveUpdatedCoordinate(1, tStep, defScale);    p [ 0 ].y = ( FPNum ) this->giveNode(4)->giveUpdatedCoordinate(2, tStep, defScale);    p [ 0 ].z = 0.0;    p [ 1 ].x = ( FPNum ) this->giveNode(5)->giveUpdatedCoordinate(1, tStep, defScale);    p [ 1 ].y = ( FPNum ) this->giveNode(5)->giveUpdatedCoordinate(2, tStep, defScale);    p [ 1 ].z = 0.0;    go = CreateLine3D(p);    EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | LAYER_MASK, go);    EMAddGraphicsToModel(ESIModel(), go);}
开发者ID:rreissnerr,项目名称:oofem,代码行数:34,


示例9: drawDeformedGeometry

void LSpace :: drawDeformedGeometry(oofegGraphicContext &gc, TimeStep *tStep, UnknownType type){    int i;    WCRec p [ 8 ];    GraphicObj *go;    double defScale = gc.getDefScale();    if ( !gc.testElementGraphicActivity(this) ) {        return;    }    EASValsSetLineWidth(OOFEG_DEFORMED_GEOMETRY_WIDTH);    EASValsSetColor( gc.getDeformedElementColor() );    EASValsSetEdgeColor( gc.getElementEdgeColor() );    EASValsSetEdgeFlag(true);    EASValsSetLayer(OOFEG_DEFORMED_GEOMETRY_LAYER);    EASValsSetFillStyle(FILL_SOLID);    for ( i = 0; i < 8; i++ ) {        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);    }    go =  CreateHexahedron(p);    EGWithMaskChangeAttributes(WIDTH_MASK | FILL_MASK | COLOR_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK | LAYER_MASK, go);    EMAddGraphicsToModel(ESIModel(), go);}
开发者ID:rreissnerr,项目名称:oofem,代码行数:27,


示例10: drawRawGeometry

void QTrPlaneStrain :: drawRawGeometry(oofegGraphicContext &gc){    WCRec p [ 3 ];    GraphicObj *go;    if ( !gc.testElementGraphicActivity(this) ) {        return;    }    EASValsSetLineWidth(OOFEG_RAW_GEOMETRY_WIDTH);    EASValsSetColor( gc.getElementColor() );    EASValsSetEdgeColor( gc.getElementEdgeColor() );    EASValsSetEdgeFlag(true);    EASValsSetLayer(OOFEG_RAW_GEOMETRY_LAYER);    p [ 0 ].x = ( FPNum ) this->giveNode(1)->giveCoordinate(1);    p [ 0 ].y = ( FPNum ) this->giveNode(1)->giveCoordinate(2);    p [ 0 ].z = 0.;    p [ 1 ].x = ( FPNum ) this->giveNode(2)->giveCoordinate(1);    p [ 1 ].y = ( FPNum ) this->giveNode(2)->giveCoordinate(2);    p [ 1 ].z = 0.;    p [ 2 ].x = ( FPNum ) this->giveNode(3)->giveCoordinate(1);    p [ 2 ].y = ( FPNum ) this->giveNode(3)->giveCoordinate(2);    p [ 2 ].z = 0.;    go =  CreateTriangle3D(p);    EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK | LAYER_MASK, go);    EGAttachObject(go, ( EObjectP ) this);    EMAddGraphicsToModel(ESIModel(), go);}
开发者ID:JimBrouzoulis,项目名称:oofem-1,代码行数:29,


示例11: drawRawGeometry

voidTR_SHELL02 :: drawRawGeometry(oofegGraphicContext &gc, TimeStep *tStep){    WCRec p [ 3 ];    GraphicObj *go;    if ( !gc.testElementGraphicActivity(this) ) {        return;    }    if ( this->giveMaterial()->isActivated(tStep) ) {        EASValsSetLineWidth(OOFEG_RAW_GEOMETRY_WIDTH);        EASValsSetColor( gc.getElementColor() );        EASValsSetEdgeColor( gc.getElementEdgeColor() );        EASValsSetEdgeFlag(true);        EASValsSetFillStyle(FILL_SOLID);        EASValsSetLayer(OOFEG_RAW_GEOMETRY_LAYER);        p [ 0 ].x = ( FPNum ) this->giveNode(1)->giveCoordinate(1);        p [ 0 ].y = ( FPNum ) this->giveNode(1)->giveCoordinate(2);        p [ 0 ].z = ( FPNum ) this->giveNode(1)->giveCoordinate(3);        p [ 1 ].x = ( FPNum ) this->giveNode(2)->giveCoordinate(1);        p [ 1 ].y = ( FPNum ) this->giveNode(2)->giveCoordinate(2);        p [ 1 ].z = ( FPNum ) this->giveNode(2)->giveCoordinate(3);        p [ 2 ].x = ( FPNum ) this->giveNode(3)->giveCoordinate(1);        p [ 2 ].y = ( FPNum ) this->giveNode(3)->giveCoordinate(2);        p [ 2 ].z = ( FPNum ) this->giveNode(3)->giveCoordinate(3);        go =  CreateTriangle3D(p);        EGWithMaskChangeAttributes(WIDTH_MASK | FILL_MASK | COLOR_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK | LAYER_MASK, go);        EGAttachObject(go, ( EObjectP ) this);        EMAddGraphicsToModel(ESIModel(), go);    }}
开发者ID:rainbowlqs,项目名称:oofem,代码行数:33,


示例12: drawSpecial

voidLattice2d :: drawSpecial(oofegGraphicContext &gc, TimeStep *tStep){    WCRec p [ 2 ];    GraphicObj *tr;    GaussPoint *gp;    FloatArray crackStatuses, cf;    if ( !gc.testElementGraphicActivity(this) ) {        return;    }    if ( gc.giveIntVarType() == IST_CrackState ) {        gp = integrationRulesArray [ 0 ]->getIntegrationPoint(0);        this->giveIPValue(crackStatuses, gp, IST_CrackStatuses, tStep);        if ( crackStatuses(0) == 1. || crackStatuses(0) == 2. || crackStatuses(0) == 3 || crackStatuses(0) == 4 ) {	  FloatArray coords;	  this->giveCrossSectionCoordinates(coords);	    p [ 0 ].x = ( FPNum ) coords.at(1);	    p [ 0 ].y = ( FPNum ) coords.at(2);	    p [ 0 ].z = ( FPNum ) coords.at(3);	    p [ 1 ].x = ( FPNum ) coords.at(4);	    p [ 1 ].y = ( FPNum ) coords.at(5);	    p [ 1 ].z = ( FPNum ) coords.at(6);            EASValsSetLayer(OOFEG_CRACK_PATTERN_LAYER);            EASValsSetLineWidth(OOFEG_CRACK_PATTERN_WIDTH);            if ( ( crackStatuses(0) == 1. ) ) {                EASValsSetColor( gc.getActiveCrackColor() );            } else if ( crackStatuses(0) == 2. ) {                EASValsSetColor( gc.getCrackPatternColor() );            } else if ( crackStatuses(0) == 3. ) {                EASValsSetColor( gc.getActiveCrackColor() );            } else if ( crackStatuses(0) == 4. ) {                EASValsSetColor( gc.getActiveCrackColor() );            }            tr = CreateLine3D(p);            EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | LAYER_MASK, tr);	    EGAttachObject(tr, ( EObjectP ) this);            EMAddGraphicsToModel(ESIModel(), tr);        }    }}
开发者ID:Benjamin-git,项目名称:OOFEM_Jim,代码行数:47,


示例13: drawRawGeometry

void IntElPoint :: drawRawGeometry(oofegGraphicContext &gc, TimeStep *tStep){    GraphicObj *go;    //  if (!go) { // create new one    WCRec p [ 1 ]; /* poin */    if ( !gc.testElementGraphicActivity(this) ) {        return;    }    EASValsSetColor( gc.getElementColor() );    EASValsSetLayer(OOFEG_RAW_GEOMETRY_LAYER);    EASValsSetLineWidth(OOFEG_DEFORMED_GEOMETRY_WIDTH);    EASValsSetColor( gc.getDeformedElementColor() );    p [ 0 ].x = ( FPNum ) ( this->giveNode(1)->giveCoordinate(1) );    p [ 0 ].y = ( FPNum ) ( this->giveNode(1)->giveCoordinate(2) );    p [ 0 ].z = ( FPNum ) ( this->giveNode(1)->giveCoordinate(3) );    EASValsSetMType(CIRCLE_MARKER);    go = CreateMarker3D(p);    EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | LAYER_MASK, go);    EMAddGraphicsToModel(ESIModel(), go);}
开发者ID:erisve,项目名称:oofem,代码行数:22,


示例14: drawRawGeometry

void Truss2d :: drawRawGeometry(oofegGraphicContext &gc){    int c1, c2;    resolveCoordIndices(c1, c2);    GraphicObj *go;    //  if (!go) { // create new one    WCRec p [ 2 ]; /* point */    if ( !gc.testElementGraphicActivity(this) ) {        return;    }    EASValsSetLineWidth(OOFEG_RAW_GEOMETRY_WIDTH);    EASValsSetColor( gc.getElementColor() );    EASValsSetLayer(OOFEG_RAW_GEOMETRY_LAYER);    if ( cs_mode == 0 ) {        p [ 0 ].x = ( FPNum ) this->giveNode(1)->giveCoordinate(c1);        p [ 0 ].y = 0.;        p [ 0 ].z = ( FPNum ) this->giveNode(1)->giveCoordinate(c2);        p [ 1 ].x = ( FPNum ) this->giveNode(2)->giveCoordinate(c1);        p [ 1 ].y = 0.;        p [ 1 ].z = ( FPNum ) this->giveNode(2)->giveCoordinate(c2);    } else if ( cs_mode == 1 ) {        p [ 0 ].x = ( FPNum ) this->giveNode(1)->giveCoordinate(c1);        p [ 0 ].y = ( FPNum ) this->giveNode(1)->giveCoordinate(c2);        p [ 0 ].z = 0.;        p [ 1 ].x = ( FPNum ) this->giveNode(2)->giveCoordinate(c1);        p [ 1 ].y = ( FPNum ) this->giveNode(2)->giveCoordinate(c2);        p [ 1 ].z = 0.;    } else if ( cs_mode == 2 ) {        p [ 0 ].x = 0.;        p [ 0 ].y = ( FPNum ) this->giveNode(1)->giveCoordinate(c1);        p [ 0 ].z = ( FPNum ) this->giveNode(1)->giveCoordinate(c2);        p [ 1 ].x = 0.;        p [ 1 ].y = ( FPNum ) this->giveNode(2)->giveCoordinate(c1);        p [ 1 ].z = ( FPNum ) this->giveNode(2)->giveCoordinate(c2);    }    go = CreateLine3D(p);    EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | LAYER_MASK, go);    EGAttachObject(go, ( EObjectP ) this);    EMAddGraphicsToModel(ESIModel(), go);}
开发者ID:MartinFagerstrom,项目名称:oofem,代码行数:43,


示例15: drawRawGeometry

void CohesiveSurface3d :: drawRawGeometry(oofegGraphicContext &gc, TimeStep *tStep){    if ( !gc.testElementGraphicActivity(this) ) {        return;    }    //WCRec p[4];    GraphicObj *go;    Particle *nodeA = ( Particle * ) this->giveNode(1);    Particle *nodeB = ( Particle * ) this->giveNode(2);    //double rA = nodeA -> giveRadius();    //double rB = nodeB -> giveRadius();    //double r = (rA+rB)/4.;    EASValsSetLineWidth(OOFEG_RAW_GEOMETRY_WIDTH);    EASValsSetColor( gc.getElementColor() );    EASValsSetEdgeColor( gc.getElementEdgeColor() );    EASValsSetEdgeFlag(true);    EASValsSetLayer(OOFEG_RAW_GEOMETRY_LAYER);    WCRec pl [ 2 ];    // determine coordinates of the particles connected by this element    pl [ 0 ].x = ( FPNum ) nodeA->giveCoordinate(1);    pl [ 0 ].y = ( FPNum ) nodeA->giveCoordinate(2);    pl [ 0 ].z = ( FPNum ) nodeA->giveCoordinate(3);    pl [ 1 ].x = ( FPNum ) nodeB->giveCoordinate(1);    pl [ 1 ].y = ( FPNum ) nodeB->giveCoordinate(2);    pl [ 1 ].z = ( FPNum ) nodeB->giveCoordinate(3);    if ( giveNumberOfNodes() == 3 ) {        // the second particle should be shifted (periodic arrangement)        Particle *nodeC = ( Particle * ) this->giveNode(3);        pl [ 1 ].x += kx * ( nodeC->giveCoordinate(1) );        pl [ 1 ].y += ky * ( nodeC->giveCoordinate(2) );        pl [ 1 ].z += kz * ( nodeC->giveCoordinate(3) );    }    //  plot a line segment connecting the particles    go = CreateLine3D(pl);    EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | LAYER_MASK, go);    EGAttachObject(go, ( EObjectP ) this);    EMAddGraphicsToModel(ESIModel(), go);}
开发者ID:Benjamin-git,项目名称:OOFEM_Jim,代码行数:43,


示例16: drawRawGeometry

void LumpedMassElement :: drawRawGeometry(oofegGraphicContext &gc){    GraphicObj *go;    WCRec p [ 1 ]; /* point */    if ( !gc.testElementGraphicActivity(this) ) {        return;    }    EASValsSetColor( gc.getElementColor() );    EASValsSetLayer(OOFEG_RAW_GEOMETRY_LAYER);    EASValsSetMType(SQUARE_MARKER);    EASValsSetMSize(8);    p [ 0 ].x = ( FPNum ) this->giveNode(1)->giveCoordinate(1);    p [ 0 ].y = ( FPNum ) this->giveNode(1)->giveCoordinate(2);    p [ 0 ].z = ( FPNum ) this->giveNode(1)->giveCoordinate(3);    go = CreateMarker3D(p);    EGWithMaskChangeAttributes(COLOR_MASK | LAYER_MASK | MTYPE_MASK | MSIZE_MASK, go);    EGAttachObject(go, ( EObjectP ) this);    EMAddGraphicsToModel(ESIModel(), go);}
开发者ID:JimBrouzoulis,项目名称:oofem-1,代码行数:20,


示例17: drawDeformedGeometry

void LumpedMassElement :: drawDeformedGeometry(oofegGraphicContext &gc, TimeStep *tStep, UnknownType type){    GraphicObj *go;    double defScale = gc.getDefScale();    WCRec p [ 1 ]; /* point */    if ( !gc.testElementGraphicActivity(this) ) {        return;    }    EASValsSetColor( gc.getDeformedElementColor() );    EASValsSetLayer(OOFEG_DEFORMED_GEOMETRY_LAYER);    EASValsSetMType(SQUARE_MARKER);    EASValsSetMSize(8);    p [ 0 ].x = ( FPNum ) this->giveNode(1)->giveUpdatedCoordinate(1, tStep, defScale);    p [ 0 ].y = ( FPNum ) this->giveNode(1)->giveUpdatedCoordinate(2, tStep, defScale);    p [ 0 ].z = ( FPNum ) this->giveNode(1)->giveUpdatedCoordinate(3, tStep, defScale);    go = CreateMarker3D(p);    EGWithMaskChangeAttributes(COLOR_MASK | LAYER_MASK | MTYPE_MASK | MSIZE_MASK, go);    EGAttachObject(go, ( EObjectP ) this);    EMAddGraphicsToModel(ESIModel(), go);}
开发者ID:aishugang,项目名称:oofem,代码行数:21,


示例18: 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);//.........这里部分代码省略.........
开发者ID:aishugang,项目名称:oofem,代码行数:101,


示例19: drawTriad

void LSpace :: drawTriad(FloatArray &coords, int isurf){    FloatMatrix jm(3, 3);    FloatArray gc(3);    GraphicObj *go;    WCRec p [ 2 ]; // point    double coeff = 1.0;    int i, succ;    /*     * // version I     * this->interpolation.giveJacobianMatrixAt (jm, domain, nodeArray, coords);     * // determine origin     * this->interpolation.local2global (gc, domain, nodeArray, coords, 0.0);     * // draw triad     *     */    // version II    // determine surface center    IntArray snodes(4);    FloatArray h1(3), h2(3), nn(3), n(3);    int j;    const char *colors[] = {        "red", "green", "blue"    };    this->interpolation.computeSurfaceMapping(snodes, dofManArray, isurf);    for ( i = 1; i <= 4; i++ ) {        gc.add( * ( domain->giveNode( snodes.at(i) )->giveCoordinates() ) );    }    gc.times(1. / 4.);    // determine "average normal"    nn.zero();    for ( i = 1; i <= 4; i++ ) {        j = ( i ) % 4 + 1;        h1 = * domain->giveNode( snodes.at(i) )->giveCoordinates();        h1.subtract(gc);        h2 = * domain->giveNode( snodes.at(j) )->giveCoordinates();        h2.subtract(gc);        n.beVectorProductOf(h1, h2);        if ( n.dotProduct(n, 3) > 1.e-6 ) {            n.normalize();        }        nn.add(n);    }    nn.times(1. / 4.);    if ( nn.dotProduct(nn, 3) < 1.e-6 ) {        return;    }    nn.normalize();    for ( i = 1; i <= 3; i++ ) {        jm.at(i, 3) = nn.at(i);    }    // determine lcs of surface    // local x axis in xy plane    double test = fabs(fabs( nn.at(3) ) - 1.0);    if ( test < 1.e-5 ) {        h1.at(1) = jm.at(1, 1) = 1.0;        h1.at(2) = jm.at(2, 1) = 0.0;    } else {        h1.at(1) = jm.at(1, 1) = jm.at(2, 3);        h1.at(2) = jm.at(2, 1) = -jm.at(1, 3);    }    h1.at(3) = jm.at(3, 1) = 0.0;    // local y axis perpendicular to local x,z axes    h2.beVectorProductOf(nn, h1);    for ( i = 1; i <= 3; i++ ) {        jm.at(i, 2) = h2.at(i);    }    p [ 0 ].x = gc.at(1);    p [ 0 ].y = gc.at(2);    p [ 0 ].z = gc.at(3);    for ( i = 1; i <= 3; i++ ) {        p [ 1 ].x = p [ 0 ].x + coeff *jm.at(1, i);        p [ 1 ].y = p [ 0 ].y + coeff *jm.at(2, i);        p [ 1 ].z = p [ 0 ].z + coeff *jm.at(3, i);        EASValsSetColor( ColorGetPixelFromString(const_cast< char * >(colors [ i - 1 ]), & succ) );        go = CreateLine3D(p);        EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | LAYER_MASK, go);        EMAddGraphicsToModel(ESIModel(), go);    }}
开发者ID:rreissnerr,项目名称:oofem,代码行数:94,


示例20: drawSpecial

voidLSpace :: drawSpecial(oofegGraphicContext &gc, TimeStep *tStep){    int i, j, k;    WCRec q [ 4 ];    GraphicObj *tr;    FloatArray crackStatuses, cf;    if ( !gc.testElementGraphicActivity(this) ) {        return;    }    if ( gc.giveIntVarType() == IST_CrackState ) {        int crackStatus;        FloatArray gpc;        double length;        FloatArray crackDir;        for ( GaussPoint *gp: *this->giveDefaultIntegrationRulePtr() ) {            if ( this->giveIPValue(cf, gp, IST_CrackedFlag, tStep) == 0 ) {                return;            }            if ( ( int ) cf.at(1) == 0 ) {                return;            }            //            // obtain gp global coordinates            this->computeGlobalCoordinates( gpc, * gp->giveNaturalCoordinates() );            length = 0.3333 * cbrt(this->computeVolumeAround(gp));            if ( this->giveIPValue(crackDir, gp, IST_CrackDirs, tStep) ) {                this->giveIPValue(crackStatuses, gp, IST_CrackStatuses, tStep);                for ( i = 1; i <= 3; i++ ) {                    crackStatus = ( int ) crackStatuses.at(i);                    if ( ( crackStatus != pscm_NONE ) && ( crackStatus != pscm_CLOSED ) ) {                        // draw a crack                        // this element is 3d element                        if ( i == 1 ) {                            j = 2;                            k = 3;                        } else if ( i == 2 ) {                            j = 3;                            k = 1;                        } else {                            j = 1;                            k = 2;                        }                        q [ 0 ].x = ( FPNum ) gpc.at(1) + 0.5 * crackDir.at(0 + j) * length + 0.5 * crackDir.at(0 + k) * length;                        q [ 0 ].y = ( FPNum ) gpc.at(2) + 0.5 * crackDir.at(3 + j) * length + 0.5 * crackDir.at(3 + k) * length;                        q [ 0 ].z = ( FPNum ) gpc.at(3) + 0.5 * crackDir.at(6 + j) * length + 0.5 * crackDir.at(6 + k) * length;                        q [ 1 ].x = ( FPNum ) gpc.at(1) + 0.5 * crackDir.at(0 + j) * length - 0.5 * crackDir.at(0 + k) * length;                        q [ 1 ].y = ( FPNum ) gpc.at(2) + 0.5 * crackDir.at(3 + j) * length - 0.5 * crackDir.at(3 + k) * length;                        q [ 1 ].z = ( FPNum ) gpc.at(3) + 0.5 * crackDir.at(6 + j) * length - 0.5 * crackDir.at(6 + k) * length;                        q [ 2 ].x = ( FPNum ) gpc.at(1) - 0.5 * crackDir.at(0 + j) * length - 0.5 * crackDir.at(0 + k) * length;                        q [ 2 ].y = ( FPNum ) gpc.at(2) - 0.5 * crackDir.at(3 + j) * length - 0.5 * crackDir.at(3 + k) * length;                        q [ 2 ].z = ( FPNum ) gpc.at(3) - 0.5 * crackDir.at(6 + j) * length - 0.5 * crackDir.at(6 + k) * length;                        q [ 3 ].x = ( FPNum ) gpc.at(1) - 0.5 * crackDir.at(0 + j) * length + 0.5 * crackDir.at(0 + k) * length;                        q [ 3 ].y = ( FPNum ) gpc.at(2) - 0.5 * crackDir.at(3 + j) * length + 0.5 * crackDir.at(3 + k) * length;                        q [ 3 ].z = ( FPNum ) gpc.at(3) - 0.5 * crackDir.at(6 + j) * length + 0.5 * crackDir.at(6 + k) * length;                        EASValsSetLayer(OOFEG_CRACK_PATTERN_LAYER);                        EASValsSetLineWidth(OOFEG_CRACK_PATTERN_WIDTH);                        if ( ( crackStatus == pscm_SOFTENING ) || ( crackStatus == pscm_OPEN ) ) {                            EASValsSetColor( gc.getActiveCrackColor() );                        } else {                            EASValsSetColor( gc.getCrackPatternColor() );                        }                        //      EASValsSetFillStyle (FILL_HOLLOW);                        tr = CreateQuad3D(q);                        EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | LAYER_MASK, tr);                        EMAddGraphicsToModel(ESIModel(), tr);                    }                }            }        } // end loop over gp    }}
开发者ID:rreissnerr,项目名称:oofem,代码行数:83,


示例21: drawSpecial

voidLTRSpace :: drawSpecial(oofegGraphicContext &gc, TimeStep *tStep){    int i, j, k;    WCRec q [ 4 ];    GraphicObj *tr;    double defScale = gc.getDefScale();    FloatArray crackStatuses, cf;    if ( !gc.testElementGraphicActivity(this) ) {        return;    }    if ( gc.giveIntVarType() == IST_CrackState ) {        int crackStatus;        double xc, yc, zc, length;        FloatArray crackDir;        if ( numberOfGaussPoints != 1 ) {            return;        }        //   for (GaussPoint *gp: *integrationRulesArray [ 0 ] ) {        {            IntegrationRule *iRule = integrationRulesArray [ 0 ];            GaussPoint *gp = iRule->getIntegrationPoint(0);            if ( this->giveIPValue(cf, gp, IST_CrackedFlag, tStep) == 0 ) {                return;            }            if ( ( int ) cf.at(1) == 0 ) {                return;            }            //            // obtain gp global coordinates - here only one exists            // it is in centre of gravity.            xc = yc = zc = 0.;            for ( i = 0; i < 4; i++ ) {                if ( gc.getInternalVarsDefGeoFlag() ) {                    // use deformed geometry                    xc += ( FPNum ) this->giveNode(i + 1)->giveUpdatedCoordinate(1, tStep, defScale);                    yc += ( FPNum ) this->giveNode(i + 1)->giveUpdatedCoordinate(2, tStep, defScale);                    zc += ( FPNum ) this->giveNode(i + 1)->giveUpdatedCoordinate(3, tStep, defScale);                } else {                    xc += ( FPNum ) this->giveNode(i + 1)->giveCoordinate(1);                    yc += ( FPNum ) this->giveNode(i + 1)->giveCoordinate(2);                    zc += ( FPNum ) this->giveNode(i + 1)->giveCoordinate(3);                }            }            xc = xc / 4.;            yc = yc / 4.;            zc = zc / 4.;            length = TR_LENGHT_REDUCT * pow(this->computeVolumeAround(gp), 1. / 3.) / 2.0;            if ( this->giveIPValue(crackDir, gp, IST_CrackDirs, tStep) ) {                this->giveIPValue(crackStatuses, gp, IST_CrackStatuses, tStep);                for ( i = 1; i <= 3; i++ ) {                    crackStatus = ( int ) crackStatuses.at(i);                    if ( ( crackStatus != pscm_NONE ) && ( crackStatus != pscm_CLOSED ) ) {                        // draw a crack                        // this element is 3d element                        if ( i == 1 ) {                            j = 2;                            k = 3;                        } else if ( i == 2 ) {                            j = 3;                            k = 1;                        } else {                            j = 1;                            k = 2;                        }                        q [ 0 ].x = ( FPNum ) xc + 0.5 * crackDir.at(0 + j) * length + 0.5 * crackDir.at(0 + k) * length;                        q [ 0 ].y = ( FPNum ) yc + 0.5 * crackDir.at(3 + j) * length + 0.5 * crackDir.at(3 + k) * length;                        q [ 0 ].z = ( FPNum ) zc + 0.5 * crackDir.at(6 + j) * length + 0.5 * crackDir.at(6 + k) * length;                        q [ 1 ].x = ( FPNum ) xc + 0.5 * crackDir.at(0 + j) * length - 0.5 * crackDir.at(0 + k) * length;                        q [ 1 ].y = ( FPNum ) yc + 0.5 * crackDir.at(3 + j) * length - 0.5 * crackDir.at(3 + k) * length;                        q [ 1 ].z = ( FPNum ) zc + 0.5 * crackDir.at(6 + j) * length - 0.5 * crackDir.at(6 + k) * length;                        q [ 2 ].x = ( FPNum ) xc - 0.5 * crackDir.at(0 + j) * length - 0.5 * crackDir.at(0 + k) * length;                        q [ 2 ].y = ( FPNum ) yc - 0.5 * crackDir.at(3 + j) * length - 0.5 * crackDir.at(3 + k) * length;                        q [ 2 ].z = ( FPNum ) zc - 0.5 * crackDir.at(6 + j) * length - 0.5 * crackDir.at(6 + k) * length;                        q [ 3 ].x = ( FPNum ) xc - 0.5 * crackDir.at(0 + j) * length + 0.5 * crackDir.at(0 + k) * length;                        q [ 3 ].y = ( FPNum ) yc - 0.5 * crackDir.at(3 + j) * length + 0.5 * crackDir.at(3 + k) * length;                        q [ 3 ].z = ( FPNum ) zc - 0.5 * crackDir.at(6 + j) * length + 0.5 * crackDir.at(6 + k) * length;                        EASValsSetLayer(OOFEG_CRACK_PATTERN_LAYER);                        EASValsSetLineWidth(OOFEG_CRACK_PATTERN_WIDTH);                        if ( ( crackStatus == pscm_SOFTENING ) || ( crackStatus == pscm_OPEN ) ) {                            EASValsSetColor( gc.getActiveCrackColor() );                        } else {                            EASValsSetColor( gc.getCrackPatternColor() );                        }                        //      EASValsSetFillStyle (FILL_HOLLOW);                        tr = CreateQuad3D(q);                        EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | LAYER_MASK, tr);//.........这里部分代码省略.........
开发者ID:rreissnerr,项目名称:oofem,代码行数:101,


示例22: drawScalar

//.........这里部分代码省略.........                 * }                 */                //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;                     * } else {                     *    // use initial geometry                     *    p [ i ].x = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(1);                     *    p [ i ].y = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(2);                     *    p [ i ].z = ss [ i ] * landScale;                     * }                     */                    // this fixes a bug in ELIXIR                    if ( fabs(ss [ i ]) < 1.0e-6 ) {                        ss [ i ] = 1.0e-6;                    }                }                if ( context.getScalarAlgo() == SA_ZPROFILE ) {                    EASValsSetColor( context.getDeformedElementColor() );                    EASValsSetLineWidth(OOFEG_DEFORMED_GEOMETRY_WIDTH);                    tr =  CreateQuad3D(p);                    EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | LAYER_MASK, tr);                } else {                    context.updateFringeTableMinMax(s, 4);                    tr =  CreateQuadWD3D(p, ss [ 0 ], ss [ 1 ], ss [ 2 ], ss [ 3 ]);                    EGWithMaskChangeAttributes(LAYER_MASK, tr);                }                EMAddGraphicsToModel(ESIModel(), tr);            }        }    } else if ( context.giveIntVarMode() == ISM_local ) {        // ========== plot the local values (raw data) =====================        if ( numberOfGaussPoints != 4 ) {            return;        }        IntArray ind(4);        FloatArray *gpCoords;        WCRec pp [ 9 ];        for ( i = 0; i < 8; i++ ) {            if ( context.getInternalVarsDefGeoFlag() ) {                // use deformed geometry                defScale = context.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);
开发者ID:Benjamin-git,项目名称:OOFEM_LargeDef,代码行数:67,


示例23: drawSpecial

voidLattice2d :: drawSpecial(oofegGraphicContext &gc, TimeStep *tStep){    WCRec l [ 2 ];    GraphicObj *tr;    GaussPoint *gp;    FloatArray crackStatuses, cf;    if ( !gc.testElementGraphicActivity(this) ) {        return;    }    if ( gc.giveIntVarType() == IST_CrackState ) {        gp = integrationRulesArray [ 0 ]->getIntegrationPoint(0);        this->giveIPValue(crackStatuses, gp, IST_CrackStatuses, tStep);        if ( crackStatuses(0) == 1. || crackStatuses(0) == 2. || crackStatuses(0) == 3 || crackStatuses(0) == 4 ) {            double x1, y1, x2, y2;            x1 = this->giveNode(1)->giveCoordinate(1);            y1 = this->giveNode(1)->giveCoordinate(2);            x2 = this->giveNode(2)->giveCoordinate(1);            y2 = this->giveNode(2)->giveCoordinate(2);            //Compute normal and shear direction            FloatArray normalDirection;            FloatArray shearDirection;            normalDirection.resize(2);            normalDirection.zero();            shearDirection.resize(2);            shearDirection.zero();            normalDirection.at(1) = x2 - x1;            normalDirection.at(2) = y2 - y1;            normalDirection.normalize();            if ( normalDirection.at(2) == 0. ) {                shearDirection.at(1) = 0.;                shearDirection.at(2) = 1.;            } else {                shearDirection.at(1) = 1.0;                shearDirection.at(2) =                    -normalDirection.at(1) / normalDirection.at(2);            }            shearDirection.normalize();            l [ 0 ].x = ( FPNum ) this->gpCoords.at(1) - shearDirection.at(1) * this->width / 2.;            l [ 0 ].y = ( FPNum ) this->gpCoords.at(2) - shearDirection.at(2) * this->width / 2.;            l [ 0 ].z = 0.;            l [ 1 ].x = ( FPNum ) this->gpCoords.at(1) + shearDirection.at(1) * this->width / 2.;            ;            l [ 1 ].y = ( FPNum ) this->gpCoords.at(2) + shearDirection.at(2) * this->width / 2.;            l [ 1 ].z = 0.;            EASValsSetLayer(OOFEG_CRACK_PATTERN_LAYER);            EASValsSetLineWidth(OOFEG_CRACK_PATTERN_WIDTH);            if ( ( crackStatuses(0) == 1. ) ) {                EASValsSetColor( gc.getActiveCrackColor() );            } else if ( crackStatuses(0) == 2. ) {                EASValsSetColor( gc.getCrackPatternColor() );            } else if ( crackStatuses(0) == 3. ) {                EASValsSetColor( gc.getActiveCrackColor() );            } else if ( crackStatuses(0) == 4. ) {                EASValsSetColor( gc.getActiveCrackColor() );            }            tr = CreateLine3D(l);            EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | LAYER_MASK, tr);            EMAddGraphicsToModel(ESIModel(), tr);        }    }}
开发者ID:vivianyw,项目名称:oofem,代码行数:70,


示例24: doInterfaceRemapping

voidLEPlic :: doInterfaceRemapping(TimeStep *atTime){    /*     * Final step: deposition of volume materials truncated on Lagrangian (updated)     * grid to the target grid, which is the original one in our Eulerian case.     */    int in = 0, ie = 0, neighbrNum, nelem = domain->giveNumberOfElements();    double in_vof, total_volume = 0.0, in_vol;    IntArray neighbours, elNum(1);    FloatArray normal;    Polygon matvolpoly, elemPoly;    Graph g;    double matVol = 0.0, matVolSum = 0.0;    LEPlicElementInterface *interface, *neghbrInterface;    // loop over elements    for ( ie = 1; ie <= nelem; ie++ ) {        if ( ( interface = ( LEPlicElementInterface * ) ( domain->giveElement(ie)->giveInterface(LEPlicElementInterfaceType) ) ) ) {            interface->setTempVolumeFraction(0.0);        }    }    // loop over elements    for ( ie = 1; ie <= nelem; ie++ ) {        //fprintf (stderr, "doInterfaceRemapping: processing elem %d/n", ie);        // examine only neighbours -> this is the limit on time step        elNum.at(1) = ie;        domain->giveConnectivityTable()->giveElementNeighbourList(neighbours, elNum);        // form polygon of material volume on Lagrangian element        if ( ( interface = ( LEPlicElementInterface * ) ( domain->giveElement(ie)->giveInterface(LEPlicElementInterfaceType) ) ) ) {            if ( interface->giveVolumeFraction() > LEPLIC_ZERO_VOF ) {                interface->giveTempInterfaceNormal(normal);                interface->formMaterialVolumePoly(matvolpoly, this, normal, interface->giveTempLineConstant(), true);                matVol = matvolpoly.computeVolume();#ifdef __OOFEG                //EASValsSetColor(::gc[OOFEG_DEBUG_LAYER].getElementColor());                //GraphicObj *go = matvolpoly.draw(::gc[OOFEG_DEBUG_LAYER],true);                //EVHiliteGraphics (myview, go);                //ESIEventLoop (YES, "Press Ctrl-p to continue");                //EVFastRedraw(myview);#endif                try {                    matVolSum = 0.0;                    // loop over neighbours to truncate material volume on target (original) grid                    for ( in = 1; in <= neighbours.giveSize(); in++ ) {                        neighbrNum = neighbours.at(in);                        if ( ( neghbrInterface = ( LEPlicElementInterface * )                                                 ( domain->giveElement(neighbrNum)->giveInterface(LEPlicElementInterfaceType) ) ) ) {                            in_vof = neghbrInterface->truncateMatVolume(matvolpoly, in_vol);                            neghbrInterface->addTempVolumeFraction(in_vof);                            total_volume += in_vol;                            matVolSum += in_vol;                        }                    }                } catch(GT_Exception & c) {                    c.print();                    neighbrNum = neighbours.at(in);                    if ( ( neghbrInterface = ( LEPlicElementInterface * )                                             ( domain->giveElement(neighbrNum)->giveInterface(LEPlicElementInterfaceType) ) ) ) {                        in_vof = neghbrInterface->truncateMatVolume(matvolpoly, in_vol);                        neghbrInterface->addTempVolumeFraction(in_vof);                    }                }#ifdef __OOFEG                //ESIEventLoop (YES, "Step Finished; Press Ctrl-p to continue");#endif                double err = fabs(matVol - matVolSum) / matVol;                if ( ( err > 1.e-12 ) && ( fabs(matVol - matVolSum) > 1.e-4 ) && ( matVol > 1.e-6 ) ) {                    OOFEM_WARNING4("LEPlic::doInterfaceRemapping:  volume inconsistency %5.2f%%/n/ttstep %d, element %d/n", err * 100, atTime->giveNumber(), ie);                }#if 0                if ( ( err > 2.e-3 ) && ( fabs(matVol - matVolSum) > 2.e-3 ) ) {                    //debug #ifdef __OOFEG                    //ESIEventLoop (YES, "Press Ctrl-p to continue");                    deleteLayerGraphics(OOFEG_DEBUG_LAYER);                    EASValsSetColor( :: gc [ OOFEG_DEBUG_LAYER ].getElementColor() );                    //GraphicObj *go = matvolpoly.draw(::gc[OOFEG_DEBUG_LAYER],true);                    matvolpoly.draw(:: gc [ OOFEG_DEBUG_LAYER ], true);                    //EVHiliteGraphics (myview, go);                    //ESIEventLoop (YES, "Press Ctrl-p to continue");                    EVFastRedraw(myview); #endif                    matVolSum = 0.0;                    // loop over neighbours to truncate material volume on target (original) grid                    for ( in = 1; in <= neighbours.giveSize(); in++ ) {                        neighbrNum = neighbours.at(in);                        if ( neghbrInterface = ( LEPlicElementInterface * )                                               ( domain->giveElement(neighbrNum)->giveInterface(LEPlicElementInterfaceType) ) ) {//.........这里部分代码省略.........
开发者ID:JimBrouzoulis,项目名称:oofem-1,代码行数:101,


示例25: drawScalar

voidQuad10_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);    }}
开发者ID:rainbowlqs,项目名称:oofem,代码行数:86,



注:本文中的EASValsSetColor函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ EASValsSetLayer函数代码示例
C++ EARGF函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。