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

Method displaySelf

SRC/element/componentElement/ComponentElement2d.cpp:1069–1154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1067}
1068
1069int
1070ComponentElement2d::displaySelf(Renderer &theViewer, int displayMode, float fact, const char **modes, int numMode)
1071{
1072 static Vector v1(3);
1073 static Vector v2(3);
1074 static Vector vp(3);
1075
1076 theNodes[0]->getDisplayCrds(v1, fact, displayMode);
1077 theNodes[1]->getDisplayCrds(v2, fact, displayMode);
1078
1079 float d1 = 0.0;
1080 float d2 = 0.0;
1081 float d3 = 0.0;
1082
1083 int res = 0;
1084
1085 if (displayMode > 0 && numMode == 0)
1086 res += theViewer.drawLine(v1, v2, d1, d1, this->getTag(), 0);
1087 else if (displayMode < 0)
1088 return theViewer.drawLine(v1, v2, 0.0, 0.0, this->getTag(), 0);
1089
1090 if (numMode > 0) {
1091 // calculate q for potential need below
1092 this->getResistingForce();
1093 vp = theCoordTransf->getBasicTrialDisp();
1094 }
1095
1096 for (int i=0; i<numMode; i++) {
1097
1098 const char *theMode = modes[i];
1099 if (strcmp(theMode, "axialForce") == 0) {
1100 d1 = q(0);
1101 res +=theViewer.drawLine(v1, v2, d1, d1, this->getTag(), i);
1102
1103 } else if (strcmp(theMode, "endMoments") == 0) {
1104
1105 d1 = q(1);
1106 d2 = q(2);
1107 static Vector delta(3); delta = v2-v1; delta/=20.;
1108 res += theViewer.drawPoint(v1+delta, d1, this->getTag(), i);
1109 res += theViewer.drawPoint(v2-delta, d2, this->getTag(), i);
1110
1111 } else if (strcmp(theMode, "localForces") == 0) {
1112 d1 = q(0);
1113 d2 = q(1);
1114 d3 = q(2);
1115 static Vector delta(3); delta = v2-v1; delta/=20;
1116 res += theViewer.drawPoint(v1+delta, d2, this->getTag(), i);
1117 res += theViewer.drawPoint(v2-delta, d3, this->getTag(), i);
1118 res +=theViewer.drawLine(v1, v2, d1, d1, this->getTag(), i);
1119
1120 } else if (strcmp(theMode, "axialDeformation") == 0) {
1121 d1 = vp(0);
1122 res +=theViewer.drawLine(v1, v2, d1, d1, this->getTag(), i);
1123
1124 } else if (strcmp(theMode, "endRotations") == 0) {
1125
1126 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