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

Method drawCube

DEVELOPER/core/Renderer.cpp:141–228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

139}
140
141int
142Renderer::drawCube(const Matrix &points, const Vector &values, int tag, int mode)
143{
144
145 static Matrix polyData(4,3);
146 static Vector polyValues(4);
147 // draw the 6 faces
148
149 int a,b,c,d;
150
151 a=2; b=3; c=7; d=6;
152 for (int i=0; i<3; i++) {
153 polyData(0,i) = points(a,i);
154 polyData(1,i) = points(b,i);
155 polyData(2,i) = points(c,i);
156 polyData(3,i) = points(d,i);
157 polyValues(0) = values(a);
158 polyValues(1) = values(b);
159 polyValues(2) = values(c);
160 polyValues(3) = values(d);
161 }
162 this->drawPolygon(polyData, polyValues, tag, mode);
163
164 a=5; b=4; c=0; d=1;
165 for (int i=0; i<3; i++) {
166 polyData(0,i) = points(a,i);
167 polyData(1,i) = points(b,i);
168 polyData(2,i) = points(c,i);
169 polyData(3,i) = points(d,i);
170 polyValues(0) = values(a);
171 polyValues(1) = values(b);
172 polyValues(2) = values(c);
173 polyValues(3) = values(d);
174 }
175 this->drawPolygon(polyData, polyValues, tag, mode);
176
177 a=6; b=7; c=4; d=5;
178 for (int i=0; i<3; i++) {
179 polyData(0,i) = points(a,i);
180 polyData(1,i) = points(b,i);
181 polyData(2,i) = points(c,i);
182 polyData(3,i) = points(d,i);
183 polyValues(0) = values(a);
184 polyValues(1) = values(b);
185 polyValues(2) = values(c);
186 polyValues(3) = values(d);
187 }
188 this->drawPolygon(polyData, polyValues, tag, mode);
189
190 a=1; b=0; c=3; d=2;
191 for (int i=0; i<3; i++) {
192 polyData(0,i) = points(a,i);
193 polyData(1,i) = points(b,i);
194 polyData(2,i) = points(c,i);
195 polyData(3,i) = points(d,i);
196 polyValues(0) = values(a);
197 polyValues(1) = values(b);
198 polyValues(2) = values(c);

Callers

nothing calls this directly

Calls 1

drawPolygonMethod · 0.45

Tested by

no test coverage detected