| 19 | ////////////////////////////////////////////////////////////////////// |
| 20 | |
| 21 | YsVisual::YsVisual(Element *theEle, const char *title, double scale, |
| 22 | int xLoc, int yLoc, int width, int height) |
| 23 | :Recorder(RECORDER_TAGS_YsVisual), |
| 24 | pView(0), theMap(0), displayMode(0) |
| 25 | { |
| 26 | const char *argv[1] = {"ysVisual"}; |
| 27 | Information eleInfo(1); |
| 28 | Response *theResponse = 0; |
| 29 | |
| 30 | ysEle = theEle; |
| 31 | |
| 32 | theResponse = theEle->setResponse(argv, 1, eleInfo); |
| 33 | |
| 34 | if(theResponse) |
| 35 | displayMode = theResponse->getResponse(); |
| 36 | else |
| 37 | opserr << "YsVisual only works on elements derived from InelasticYS2DGNL\n"; |
| 38 | |
| 39 | #ifdef _GLX |
| 40 | theMap = new PlainMap(); |
| 41 | pView = new OpenGLRenderer(title, xLoc, yLoc, width, height, *theMap); |
| 42 | #endif |
| 43 | |
| 44 | #ifdef _X11 |
| 45 | if(!pView) //_GLX and _X11 both defined |
| 46 | { |
| 47 | theMap = new PlainMap(); |
| 48 | pView = new X11Renderer(title, xLoc, yLoc, width, height, *theMap); |
| 49 | } |
| 50 | #endif |
| 51 | |
| 52 | if(pView) |
| 53 | { |
| 54 | pView->setVRP(0.0, 0.0, 0.0); |
| 55 | pView->setVPN(0.0, 0.0, 1.0); |
| 56 | pView->setVUP(0.0, 1.0, 0.0); |
| 57 | pView->setFillMode("wire"); // wire mode |
| 58 | pView->setPlaneDist(1.0, -1.0); |
| 59 | pView->setPRP(0.0, 0.0, 10.0); |
| 60 | pView->setPortWindow(-1, 1, -1, 1); // use the whole window |
| 61 | |
| 62 | pView->setViewWindow(-scale, scale, -scale, scale); |
| 63 | |
| 64 | pView->clearImage(); |
| 65 | pView->doneImage(); |
| 66 | } |
| 67 | else |
| 68 | opserr << "WARNING: YsVisual::createView - Renderer not available\n"; |
| 69 | |
| 70 | } |
| 71 | |
| 72 | YsVisual::~YsVisual() |
| 73 | { |
nothing calls this directly
no test coverage detected