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

Method maplog10XToCartesian

tests/backend/Datapicker/DatapickerTest.cpp:197–227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

195}
196
197void DatapickerTest::maplog10XToCartesian() {
198 DatapickerImage::ReferencePoints points;
199 points.type = DatapickerImage::GraphType::Log10X;
200 points.logicalPos[0].setX(pow(10, 1));
201 points.logicalPos[0].setY(2);
202 points.logicalPos[1].setX(pow(10, 2));
203 points.logicalPos[1].setY(4);
204 points.logicalPos[2].setX(pow(10, 3));
205 points.logicalPos[2].setY(6);
206 points.scenePos[0].setX(6.21);
207 points.scenePos[0].setY(7.23);
208 points.scenePos[1].setX(-51.2);
209 points.scenePos[1].setY(3234);
210 points.scenePos[2].setX(-23);
211 points.scenePos[2].setY(+5e6);
212
213 Transform t;
214 QCOMPARE(t.mapTypeToCartesian(points), true);
215 VALUES_EQUAL(t.x[0], 1.);
216 VALUES_EQUAL(t.y[0], 2.);
217 VALUES_EQUAL(t.x[1], 2.);
218 VALUES_EQUAL(t.y[1], 4.);
219 VALUES_EQUAL(t.x[2], 3.);
220 VALUES_EQUAL(t.y[2], 6.);
221 VALUES_EQUAL(t.X[0], 6.21);
222 VALUES_EQUAL(t.Y[0], 7.23);
223 VALUES_EQUAL(t.X[1], -51.2);
224 VALUES_EQUAL(t.Y[1], 3234.);
225 VALUES_EQUAL(t.X[2], -23.);
226 VALUES_EQUAL(t.Y[2], +5.e6);
227}
228
229void DatapickerTest::maplog10YToCartesian() {
230 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