22 return "Plugin(LongituteLatitude) projects the view `View' "
23 "in longitude-latitude.\n\n"
24 "If `View' < 0, the plugin is run on the current view.\n\n"
25 "Plugin(LongituteLatitude) is executed in place.";
52 for(
int nod = 0; nod < data1->
getNumNodes(step, ent, ele); nod++)
53 data1->
tagNode(step, ent, ele, nod, 0);
58 double gxmin = 180, gxmax = -180, gymin = 90, gymax = -90;
65 double vin[3], vout[3];
66 double xmin = M_PI, xmax = -M_PI;
67 for(
int nod = 0; nod < data1->
getNumNodes(step, ent, ele); nod++) {
69 int tag = data1->
getNode(step, ent, ele, nod, x, y,
z);
72 z2 = sqrt(x * x + y * y +
z *
z);
75 xmin = std::min(x2, xmin);
76 xmax = std::max(x2, xmax);
77 gxmin = std::min(x2 * 180 / M_PI, gxmin);
78 gxmax = std::max(x2 * 180 / M_PI, gxmax);
79 gymin = std::min(y2 * 180 / M_PI, gymin);
80 gymax = std::max(y2 * 180 / M_PI, gymax);
81 data1->
setNode(step, ent, ele, nod, x2 * 180 / M_PI, y2 * 180 / M_PI,
85 for(
int i = 0; i < 3; i++)
86 data1->
getValue(step, ent, ele, nod, i, vin[i]);
87 vout[0] = -sin(x2) * vin[0] + cos(x2) * vin[1];
88 vout[1] = -sin(y2) * (cos(x2) * vin[0] + sin(x2) * vin[1]) +
90 vout[2] = cos(y2) * (cos(x2) * vin[0] + sin(x2) * vin[1]) +
92 for(
int i = 0; i < 3; i++)
93 data1->
setValue(step, ent, ele, nod, i, vout[i]);
98 for(
int nod = 0; nod < data1->
getNumNodes(step, ent, ele); nod++) {
100 data1->
getNode(step, ent, ele, nod, x, y,
z);
101 if(xmax * 180 / M_PI - x > 180) x += 360;
102 data1->
setNode(step, ent, ele, nod, x, y,
z);