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

Method drawLine

SRC/renderer/VrmlViewer.cpp:93–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91}
92
93int
94VrmlViewer::drawLine(const Vector &pos1, const Vector &pos2,
95 float V1, float V2)
96{
97 float x,y,z, r, g, b;
98
99
100 (*vrmlFile) << "Shape { geometry IndexedLineSet ";
101 (*vrmlFile) << "{ coord Coordinate { \n\t\t point [\n";
102
103 int size = pos1.Size();
104 if (size == 1) {
105 x = pos1(0);
106 y = 0;
107 z = 0;
108 } else if (size == 2) {
109 x = pos1(0);
110 y = pos1(1);
111 z = 0;
112 } else {
113 x = pos1(0);
114 y = pos1(1);
115 z = pos1(2);
116 }
117 (*vrmlFile) << "\t\t\t " << x << " " << y << " " << z << ",\n";
118
119
120
121 size = pos2.Size();
122 if (size == 1) {
123 x = pos2(0);
124 y = 0;
125 z = 0;
126 } else if (size == 2) {
127 x = pos2(0);
128 y = pos2(1);
129 z = 0;
130 } else {
131 x = pos2(0);
132 y = pos2(1);
133 z = pos2(2);
134 }
135
136 (*vrmlFile) << "\t\t\t " << x << " " << y << " " << z << " ] }\n";
137 (*vrmlFile) << " coordIndex [ 0 1 ]\n";
138 (*vrmlFile) << " colorPerVertex TRUE\n ";
139 (*vrmlFile) << " color Color { \n\t color [\n";
140
141 r = theMap->getRed(V1);
142 g = theMap->getGreen(V1);
143 b = theMap->getBlue(V1);
144
145 (*vrmlFile) << "\t\t\t " << r << " " << g << " " << b << ",\n";
146
147 r = theMap->getRed(V2);
148 g = theMap->getGreen(V2);
149 b = theMap->getBlue(V2);
150

Callers 15

displaySelfMethod · 0.45
displaySelfMethod · 0.45
displaySelfMethod · 0.45
displaySelfMethod · 0.45
displaySelfMethod · 0.45
displaySelfMethod · 0.45
displaySelfMethod · 0.45
displaySelfMethod · 0.45
displaySelfMethod · 0.45
displaySelfMethod · 0.45
displaySelfMethod · 0.45
displaySelfMethod · 0.45

Calls 4

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

Tested by

no test coverage detected