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

Method displaySelf

SRC/element/elasticBeamColumn/ModElasticBeam3d.cpp:930–973  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

928}
929
930int ModElasticBeam3d::displaySelf(Renderer &theViewer, int displayMode,
931 float fact, const char **modes, int numMode) {
932 static Vector v1(3);
933 static Vector v2(3);
934
935 theNodes[0]->getDisplayCrds(v1, fact, displayMode);
936 theNodes[1]->getDisplayCrds(v2, fact, displayMode);
937 float d1 = 0.0;
938 float d2 = 0.0;
939 int res = 0;
940
941 if (displayMode > 0 && numMode == 0)
942 res += theViewer.drawLine(v1, v2, d1, d1, this->getTag(), 0);
943 else if (displayMode < 0)
944 return theViewer.drawLine(v1, v2, 0.0, 0.0, this->getTag(), 0);
945
946 if (numMode > 0) {
947 // calculate q for potential need below
948 this->getResistingForce();
949 }
950
951 for (int i = 0; i < numMode; i++) {
952
953 const char *theMode = modes[i];
954 if (strcmp(theMode, "axialForce") == 0) {
955 d1 = q(0);
956 d2 = q(0);
957 ;
958
959 res += theViewer.drawLine(v1, v2, d1, d1, this->getTag(), i);
960
961 } else if (strcmp(theMode, "endMoments") == 0) {
962 d1 = q(1);
963 d2 = q(2);
964 static Vector delta(3);
965 delta = v2 - v1;
966 delta /= 10;
967 res += theViewer.drawPoint(v1 + delta, d1, this->getTag(), i);
968 res += theViewer.drawPoint(v2 - delta, d2, this->getTag(), i);
969 }
970 }
971
972 return res;
973}
974
975Response *ModElasticBeam3d::setResponse(const char **argv, int argc,
976 OPS_Stream &output) {

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected