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

Method maplog10YToCartesian

tests/backend/Datapicker/DatapickerTest.cpp:229–259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

227}
228
229void DatapickerTest::maplog10YToCartesian() {
230 DatapickerImage::ReferencePoints points;
231 points.type = DatapickerImage::GraphType::Log10Y;
232 points.logicalPos[0].setX(1);
233 points.logicalPos[0].setY(pow(10, 1));
234 points.logicalPos[1].setX(3);
235 points.logicalPos[1].setY(pow(10, 2));
236 points.logicalPos[2].setX(5);
237 points.logicalPos[2].setY(pow(10, 3));
238 points.scenePos[0].setX(6.21);
239 points.scenePos[0].setY(7.23);
240 points.scenePos[1].setX(-51.2);
241 points.scenePos[1].setY(3234);
242 points.scenePos[2].setX(-23);
243 points.scenePos[2].setY(+5e6);
244
245 Transform t;
246 QCOMPARE(t.mapTypeToCartesian(points), true);
247 VALUES_EQUAL(t.x[0], 1.);
248 VALUES_EQUAL(t.y[0], 1.);
249 VALUES_EQUAL(t.x[1], 3.);
250 VALUES_EQUAL(t.y[1], 2.);
251 VALUES_EQUAL(t.x[2], 5.);
252 VALUES_EQUAL(t.y[2], 3.);
253 VALUES_EQUAL(t.X[0], 6.21);
254 VALUES_EQUAL(t.Y[0], 7.23);
255 VALUES_EQUAL(t.X[1], -51.2);
256 VALUES_EQUAL(t.Y[1], 3234.);
257 VALUES_EQUAL(t.X[2], -23.);
258 VALUES_EQUAL(t.Y[2], +5.e6);
259}
260
261void DatapickerTest::maplog10XYToCartesian() {
262 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