MCPcopy Create free account
hub / github.com/OpenSees/OpenSees / displaySelf

Method displaySelf

SRC/element/componentElement/ComponentElement3d.cpp:1449–1534  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1447}
1448
1449int
1450ComponentElement3d::displaySelf(Renderer &theViewer, int displayMode, float fact, const char **modes, int numMode)
1451{
1452 static Vector v1(3);
1453 static Vector v2(3);
1454 static Vector vp(3);
1455
1456 theNodes[0]->getDisplayCrds(v1, fact, displayMode);
1457 theNodes[1]->getDisplayCrds(v2, fact, displayMode);
1458
1459 float d1 = 0.0;
1460 float d2 = 0.0;
1461 float d3 = 0.0;
1462
1463 int res = 0;
1464
1465 if (displayMode > 0 && numMode == 0)
1466 res += theViewer.drawLine(v1, v2, d1, d1, this->getTag(), 0);
1467 else if (displayMode < 0)
1468 return theViewer.drawLine(v1, v2, 0.0, 0.0, this->getTag(), 0);
1469
1470 if (numMode > 0) {
1471 // calculate q for potential need below
1472 this->getResistingForce();
1473 vp = theCoordTransf->getBasicTrialDisp();
1474 }
1475
1476 for (int i=0; i<numMode; i++) {
1477
1478 const char *theMode = modes[i];
1479 if (strcmp(theMode, "axialForce") == 0) {
1480 d1 = q(0);
1481 res +=theViewer.drawLine(v1, v2, d1, d1, this->getTag(), i);
1482
1483 } else if (strcmp(theMode, "endMoments") == 0) {
1484
1485 d1 = q(1);
1486 d2 = q(2);
1487 static Vector delta(3); delta = v2-v1; delta/=20.;
1488 res += theViewer.drawPoint(v1+delta, d1, this->getTag(), i);
1489 res += theViewer.drawPoint(v2-delta, d2, this->getTag(), i);
1490
1491 } else if (strcmp(theMode, "localForces") == 0) {
1492 d1 = q(0);
1493 d2 = q(1);
1494 d3 = q(2);
1495 static Vector delta(3); delta = v2-v1; delta/=20;
1496 res += theViewer.drawPoint(v1+delta, d2, this->getTag(), i);
1497 res += theViewer.drawPoint(v2-delta, d3, this->getTag(), i);
1498 res +=theViewer.drawLine(v1, v2, d1, d1, this->getTag(), i);
1499
1500 } else if (strcmp(theMode, "axialDeformation") == 0) {
1501 d1 = vp(0);
1502 res +=theViewer.drawLine(v1, v2, d1, d1, this->getTag(), i);
1503
1504 } else if (strcmp(theMode, "endRotations") == 0) {
1505
1506 d1 = vp(1);

Callers

nothing calls this directly

Calls 6

getResistingForceMethod · 0.80
getBasicTrialDispMethod · 0.80
getDisplayCrdsMethod · 0.45
drawLineMethod · 0.45
getTagMethod · 0.45
drawPointMethod · 0.45

Tested by

no test coverage detected