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

Method maplnXToCartesian

tests/backend/Datapicker/DatapickerTest.cpp:101–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101void DatapickerTest::maplnXToCartesian() {
102 DatapickerImage::ReferencePoints points;
103 points.type = DatapickerImage::GraphType::LnX;
104 points.logicalPos[0].setX(exp(1));
105 points.logicalPos[0].setY(2);
106 points.logicalPos[1].setX(exp(2));
107 points.logicalPos[1].setY(4);
108 points.logicalPos[2].setX(exp(3));
109 points.logicalPos[2].setY(6);
110 points.scenePos[0].setX(6.21);
111 points.scenePos[0].setY(7.23);
112 points.scenePos[1].setX(-51.2);
113 points.scenePos[1].setY(3234);
114 points.scenePos[2].setX(-23);
115 points.scenePos[2].setY(+5e6);
116
117 Transform t;
118 QCOMPARE(t.mapTypeToCartesian(points), true);
119 VALUES_EQUAL(t.x[0], 1.);
120 VALUES_EQUAL(t.y[0], 2.);
121 VALUES_EQUAL(t.x[1], 2.);
122 VALUES_EQUAL(t.y[1], 4.);
123 VALUES_EQUAL(t.x[2], 3.);
124 VALUES_EQUAL(t.y[2], 6.);
125 VALUES_EQUAL(t.X[0], 6.21);
126 VALUES_EQUAL(t.Y[0], 7.23);
127 VALUES_EQUAL(t.X[1], -51.2);
128 VALUES_EQUAL(t.Y[1], 3234.);
129 VALUES_EQUAL(t.X[2], -23.);
130 VALUES_EQUAL(t.Y[2], +5.e6);
131}
132
133void DatapickerTest::maplnYToCartesian() {
134 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