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

Method drawPolygon

SRC/renderer/OpenGlRenderer.cpp:561–598  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

559
560
561int
562OpenGLRenderer::drawPolygon(const Matrix &pos, const Vector &data, int tag, int mode)
563{
564#ifdef _G3DEBUG
565 if (pos.noCols() != 3) {
566 opserr << "OpenGLRenderer::drawPolygon - matrix needs 3 cols\n";
567 return -1;
568 }
569 if (pos.noRows() != data.Size()) {
570 opserr << "OpenGLRenderer::drawPolygon - matrix & vector incompatible\n";
571 return -1;
572 }
573#endif
574
575 double posX, posY, posZ, value;
576 float r,g,b;
577
578 glBegin(GL_POLYGON);
579 int numRows = pos.noRows();
580 for (int i=0; i<numRows; i++) {
581 posX = pos(i,0);
582 posY = pos(i,1);
583 posZ = pos(i,2);
584 value = data(i);
585 theMap->getRGB(value, r, g, b);
586
587 if (theOutputFileName != 0) {
588 theFile << posX << " " << posY << " " << posZ << " " << r
589 << " " << g << " " << b << " " << endln;
590 }
591 glColor3f(r,g,b);
592 glVertex3f(posX, posY, posZ);
593 }
594
595 glEnd();
596
597 return 0;
598}
599
600
601int

Callers

nothing calls this directly

Calls 4

getRGBMethod · 0.80
noColsMethod · 0.45
noRowsMethod · 0.45
SizeMethod · 0.45

Tested by

no test coverage detected