MCPcopy Create free account
hub / github.com/KDE/labplot / maplnYToCartesian

Method maplnYToCartesian

tests/backend/Datapicker/DatapickerTest.cpp:133–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

131}
132
133void DatapickerTest::maplnYToCartesian() {
134 DatapickerImage::ReferencePoints points;
135 points.type = DatapickerImage::GraphType::LnY;
136 points.logicalPos[0].setX(1);
137 points.logicalPos[0].setY(exp(1));
138 points.logicalPos[1].setX(3);
139 points.logicalPos[1].setY(exp(2));
140 points.logicalPos[2].setX(5);
141 points.logicalPos[2].setY(exp(3));
142 points.scenePos[0].setX(6.21);
143 points.scenePos[0].setY(7.23);
144 points.scenePos[1].setX(-51.2);
145 points.scenePos[1].setY(3234);
146 points.scenePos[2].setX(-23);
147 points.scenePos[2].setY(+5e6);
148
149 Transform t;
150 QCOMPARE(t.mapTypeToCartesian(points), true);
151 VALUES_EQUAL(t.x[0], 1.);
152 VALUES_EQUAL(t.y[0], 1.);
153 VALUES_EQUAL(t.x[1], 3.);
154 VALUES_EQUAL(t.y[1], 2.);
155 VALUES_EQUAL(t.x[2], 5.);
156 VALUES_EQUAL(t.y[2], 3.);
157 VALUES_EQUAL(t.X[0], 6.21);
158 VALUES_EQUAL(t.Y[0], 7.23);
159 VALUES_EQUAL(t.X[1], -51.2);
160 VALUES_EQUAL(t.Y[1], 3234.);
161 VALUES_EQUAL(t.X[2], -23.);
162 VALUES_EQUAL(t.Y[2], +5.e6);
163}
164
165void DatapickerTest::maplnXYToCartesian() {
166 DatapickerImage::ReferencePoints points;

Callers

nothing calls this directly

Calls 3

setXMethod · 0.80
setYMethod · 0.80
mapTypeToCartesianMethod · 0.80

Tested by

no test coverage detected