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

Method drawTriangle

SRC/renderer/VrmlViewer.cpp:160–244  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

158
159
160int
161VrmlViewer::drawTriangle(const Vector &pos1, const Vector &pos2,
162 const Vector &pos3,
163 float V1, float V2, float V3)
164{
165 int size;
166 float x,y,z, r, g, b;
167
168 (*vrmlFile) << "Shape { geometry IndexedFaceSet ";
169 (*vrmlFile) << "{ coord Coordinate { \n\t\t point [\n";
170
171 size = pos1.Size();
172 if (size == 1) {
173 x = pos1(0);
174 y = 0;
175 z = 0;
176 } else if (size == 2) {
177 x = pos1(0);
178 y = pos1(1);
179 z = 0;
180 } else {
181 x = pos1(0);
182 y = pos1(1);
183 z = pos1(2);
184 }
185
186 (*vrmlFile) << "\t\t\t " << x << " " << y << " " << z << ",\n";
187
188 size = pos2.Size();
189 if (size == 1) {
190 x = pos2(0);
191 y = 0;
192 z = 0;
193 } else if (size == 2) {
194 x = pos2(0);
195 y = pos2(1);
196 z = 0;
197 } else {
198 x = pos2(0);
199 y = pos2(1);
200 z = pos2(2);
201 }
202
203 (*vrmlFile) << "\t\t\t " << x << " " << y << " " << z << ",\n";
204
205 size = pos3.Size();
206 if (size == 1) {
207 x = pos3(0);
208 y = 0;
209 z = 0;
210 } else if (size == 2) {
211 x = pos3(0);
212 y = pos3(1);
213 z = 0;
214 } else {
215 x = pos3(0);
216 y = pos3(1);
217 z = pos3(2);

Callers

nothing calls this directly

Calls 4

SizeMethod · 0.45
getRedMethod · 0.45
getGreenMethod · 0.45
getBlueMethod · 0.45

Tested by

no test coverage detected