Commit 3da00663 authored by Håkan Wennlöf's avatar Håkan Wennlöf
Browse files

Fixed (hacked) it so that rotations of scalar fields work even if the x...

Fixed (hacked) it so that rotations of scalar fields work even if the x coordinate is taken to be TCAD y or z.

This is a quick fix, will see if I can make it more elegant. It currently duplicates the field value to always have it in the x-position. The issue appears when the final scalar value ends up in a position different from x in the final Point object, as only the x-value of the point is used to save scalar fields after parsing.
parent 0790e3e4
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -246,15 +246,19 @@ int main(int argc, char** argv) {
        if(rot.at(0) == "-y" || rot.at(0) == "y") {
            for(size_t i = 0; i < points.size(); ++i) {
                points_temp[i].x = points[i].y;
                if(vector_field) {
                    field_temp[i].x = field[i].y;
                }
            }
        }
        if(rot.at(0) == "-z" || rot.at(0) == "z") {
            for(size_t i = 0; i < points.size(); ++i) {
                points_temp[i].x = points[i].z;
                if(vector_field) {
                    field_temp[i].x = field[i].z;
                }
            }
        }
        if(rot.at(1) == "-x" || rot.at(1) == "x") {
            for(size_t i = 0; i < points.size(); ++i) {
                points_temp[i].y = points[i].x;
@@ -499,6 +503,7 @@ int main(int argc, char** argv) {
                    // We need to convert to framework-internal units:
                    data->push_back(Units::get(point.x, units));
                    // For a vector field, we push three values:
                    LOG(DEBUG) << "Values of data point (" << i << ", " << j << ", " << k << "): " << point;
                    if(quantity == FieldQuantity::VECTOR) {
                        data->push_back(Units::get(point.y, units));
                        data->push_back(Units::get(point.z, units));