Lines Matching refs:path
42 * @tc.desc: Test for checking if a path is closed using normal parameters.
48 // 1. Create a path object using OH_Drawing_PathCreate
49 OH_Drawing_Path *path = OH_Drawing_PathCreate();
50 // 2. Set the starting point of the path using OH_Drawing_PathMoveTo
51 OH_Drawing_PathMoveTo(path, 0, 0);
53 OH_Drawing_PathLineTo(path, 100, 100);
54 // 4. Add a line segment from the last point of the path to the target point using OH_Drawing_PathLineTo
55 OH_Drawing_PathLineTo(path, 0, 100);
56 // 5. Add a line segment from the last point of the path to the target point using OH_Drawing_PathLineTo
57 OH_Drawing_PathLineTo(path, 0, 0);
58 // 6. Close the path using OH_Drawing_PathClose
59 OH_Drawing_PathClose(path);
60 // 7. Check if the path is closed using OH_Drawing_PathIsClosed
61 bool isClosed = OH_Drawing_PathIsClosed(path, false);
64 OH_Drawing_PathDestroy(path);
70 * @tc.desc: Test for checking if a path is closed without closing it.
76 // 1. Create a path object using OH_Drawing_PathCreate
77 OH_Drawing_Path *path = OH_Drawing_PathCreate();
78 // 2. Set the starting point of the path using OH_Drawing_PathMoveTo
79 OH_Drawing_PathMoveTo(path, 0, 0);
81 OH_Drawing_PathLineTo(path, 100, 100);
82 // 4. Check if the path is closed using OH_Drawing_PathIsClosed
83 bool isClosed = OH_Drawing_PathIsClosed(path, false);
86 OH_Drawing_PathDestroy(path);
92 * @tc.desc: Test for checking if a path is closed with NULL or invalid parameters.
98 // 1. Create a path object using OH_Drawing_PathCreate
99 OH_Drawing_Path *path = OH_Drawing_PathCreate();
100 // 2. Check if the path is closed using OH_Drawing_PathIsClosed with nullptr as the parameter, should return
105 OH_Drawing_PathDestroy(path);
111 * @tc.desc: Test for getting position and tangent of a path using normal parameters with tangent flag set to true.
117 // 1. Create a path object using OH_Drawing_PathCreate
118 OH_Drawing_Path *path = OH_Drawing_PathCreate();
119 // 2. Set the starting point of the path using OH_Drawing_PathMoveTo
120 OH_Drawing_PathMoveTo(path, 0, 0);
122 OH_Drawing_PathLineTo(path, 100, 100);
123 // 4. Get the position and tangent of a point at a specified distance from the starting point of the path. Set the
127 OH_Drawing_PathGetPositionTangent(path, true, 50, &position, &tangent);
129 OH_Drawing_PathDestroy(path);
135 * @tc.desc: Test for getting position and tangent of a path using normal parameters with tangent flag set to false.
141 // 1. Create a path object using OH_Drawing_PathCreate
142 OH_Drawing_Path *path = OH_Drawing_PathCreate();
143 // 2. Set the starting point of the path using OH_Drawing_PathMoveTo
144 OH_Drawing_PathMoveTo(path, 0, 0);
146 OH_Drawing_PathLineTo(path, 100, 100);
147 // 4. Get the position and tangent of a point at a specified distance from the starting point of the path. Set the
151 OH_Drawing_PathGetPositionTangent(path, false, 50, &position, &tangent);
153 OH_Drawing_PathDestroy(path);
159 * @tc.desc: Test for getting position and tangent of a path using NULL or invalid parameters.
165 // 1. Create a path object using OH_Drawing_PathCreate
166 OH_Drawing_Path *path = OH_Drawing_PathCreate();
174 OH_Drawing_PathGetPositionTangent(path, true, 0.00, &position, &tangent);
177 OH_Drawing_PathGetPositionTangent(path, true, 50, nullptr, &tangent);
181 OH_Drawing_PathGetPositionTangent(path, true, 50, &position, nullptr);
184 OH_Drawing_PathDestroy(path);
190 * @tc.desc: Test for getting position and tangent of a path with abnormal parameters (non-float values).
196 // 1. Create a path object using OH_Drawing_PathCreate
197 OH_Drawing_Path *path = OH_Drawing_PathCreate();
198 // 2. Set the starting point of the path using OH_Drawing_PathMoveTo
199 OH_Drawing_PathMoveTo(path, 0, 0);
201 OH_Drawing_PathLineTo(path, 100, 100);
205 OH_Drawing_PathGetPositionTangent(path, true, 50, &position, &tangent);
209 OH_Drawing_PathGetPositionTangent(path, true, 50, &position, &tangent);
213 OH_Drawing_PathGetPositionTangent(path, true, 50, &position, &tangent);
217 OH_Drawing_PathGetPositionTangent(path, true, 50, &position, &tangent);
221 OH_Drawing_PathGetPositionTangent(path, true, 50, &position, &tangent);
223 OH_Drawing_PathDestroy(path);
229 * @tc.desc: Test for getting position and tangent of a path with maximal values.
235 // 1. Create a path object using OH_Drawing_PathCreate
236 OH_Drawing_Path *path = OH_Drawing_PathCreate();
237 // 2. Set the starting point of the path using OH_Drawing_PathMoveTo
238 OH_Drawing_PathMoveTo(path, 0, 0);
240 OH_Drawing_PathLineTo(path, 100, 100);
241 // 4. Get the position and tangent of a point at a specified distance from the starting point of the path. Set the
245 OH_Drawing_PathGetPositionTangent(path, true, FLT_MAX + 1, &position, &tangent);
246 // 5. Get the position and tangent of a point at a specified distance from the starting point of the path. Set the x
249 OH_Drawing_PathGetPositionTangent(path, true, 50, &position, &tangent);
250 // 6. Get the position and tangent of a point at a specified distance from the starting point of the path. Set the y
253 OH_Drawing_PathGetPositionTangent(path, true, 50, &position, &tangent);
254 // 7. Get the position and tangent of a point at a specified distance from the starting point of the path. Set the x
257 OH_Drawing_PathGetPositionTangent(path, true, 50, &position, &tangent);
258 // 8. Get the position and tangent of a point at a specified distance from the starting point of the path. Set the y
261 OH_Drawing_PathGetPositionTangent(path, true, 50, &position, &tangent);
263 OH_Drawing_PathDestroy(path);
269 * @tc.desc: Test for performing path operations using normal parameters.
275 // 1. Create a path object using OH_Drawing_PathCreate
276 OH_Drawing_Path *path = OH_Drawing_PathCreate();
277 // 2. Set the starting point of the path using OH_Drawing_PathMoveTo
278 OH_Drawing_PathMoveTo(path, 0, 0);
280 OH_Drawing_PathLineTo(path, 100, 100);
281 // 4. Create a path object using OH_Drawing_PathCreate
283 // 5. Set the starting point of the path using OH_Drawing_PathMoveTo
287 // 7. Perform a path operation on the two paths according to the specified path operation mode. The third parameter
288 // enumerates the possible path operation modes.
289 OH_Drawing_PathOp(path, src, OH_Drawing_PathOpMode::PATH_OP_MODE_INTERSECT);
290 OH_Drawing_PathOp(path, src, OH_Drawing_PathOpMode::PATH_OP_MODE_DIFFERENCE);
291 OH_Drawing_PathOp(path, src, OH_Drawing_PathOpMode::PATH_OP_MODE_UNION);
292 OH_Drawing_PathOp(path, src, OH_Drawing_PathOpMode::PATH_OP_MODE_XOR);
293 OH_Drawing_PathOp(path, src, OH_Drawing_PathOpMode::PATH_OP_MODE_REVERSE_DIFFERENCE);
295 OH_Drawing_PathDestroy(path);
301 * @tc.desc: Test for performing path operations with NULL or invalid parameters.
307 // 1. Create a path object using OH_Drawing_PathCreate
308 OH_Drawing_Path *path = OH_Drawing_PathCreate();
309 // 2. Create a path object using OH_Drawing_PathCreate
314 OH_Drawing_PathOp(path, nullptr, OH_Drawing_PathOpMode::PATH_OP_MODE_INTERSECT);
316 OH_Drawing_PathDestroy(path);
322 * @tc.desc: Test for getting transformation matrix of a path using normal parameters with matrix flag set to true.
328 // 1. Create a path object using OH_Drawing_PathCreate
329 OH_Drawing_Path *path = OH_Drawing_PathCreate();
333 // 3. Set the starting point of the path using OH_Drawing_PathMoveTo
334 OH_Drawing_PathMoveTo(path, 0, 0);
336 OH_Drawing_PathLineTo(path, 100, 100);
337 // 5. Get the transformation matrix of a point at a specified distance from the starting point of the path. Set the
345 OH_Drawing_PathGetMatrix(path, true, 50, matrix, flags[i]);
348 OH_Drawing_PathDestroy(path);
355 * @tc.desc: Test for getting transformation matrix of a path using normal parameters with matrix flag set to false.
361 // 1. Create a path object using OH_Drawing_PathCreate
362 OH_Drawing_Path *path = OH_Drawing_PathCreate();
366 // 3. Set the starting point of the path using OH_Drawing_PathMoveTo
367 OH_Drawing_PathMoveTo(path, 0, 0);
369 OH_Drawing_PathLineTo(path, 100, 100);
370 // 5. Get the transformation matrix of a point at a specified distance from the starting point of the path. Set the
378 OH_Drawing_PathGetMatrix(path, false, 50, matrix, flags[i]);
381 OH_Drawing_PathDestroy(path);
388 * @tc.desc: Test for getting transformation matrix of a path using NULL or invalid parameters.
394 // 1. Create a path object using OH_Drawing_PathCreate
395 OH_Drawing_Path *path = OH_Drawing_PathCreate();
403 OH_Drawing_PathGetMatrix(path, true, 0.00, matrix, GET_POSITION_MATRIX);
405 OH_Drawing_PathGetMatrix(path, true, 50, nullptr, GET_POSITION_MATRIX);
408 OH_Drawing_PathDestroy(path);
414 * @tc.desc: Test for getting transformation matrix of a path with abnormal parameters (non-float values).
420 // 1. Create a path object using OH_Drawing_PathCreate
421 OH_Drawing_Path *path = OH_Drawing_PathCreate();
425 // 3. Set the starting point of the path using OH_Drawing_PathMoveTo
426 OH_Drawing_PathMoveTo(path, 0, 0);
428 OH_Drawing_PathLineTo(path, 100, 100);
429 // 5. Get the transformation matrix of a point at a specified distance from the starting point of the path. Set the
431 OH_Drawing_PathGetMatrix(path, true, 50, matrix, GET_POSITION_MATRIX);
433 OH_Drawing_PathDestroy(path);
439 * @tc.desc: Test for getting transformation matrix of a path with maximal values.
445 // 1. Create a path object using OH_Drawing_PathCreate
446 OH_Drawing_Path *path = OH_Drawing_PathCreate();
450 // 3. Set the starting point of the path using OH_Drawing_PathMoveTo
451 OH_Drawing_PathMoveTo(path, 0, 0);
453 OH_Drawing_PathLineTo(path, 100, 100);
454 // 5. Get the transformation matrix of a point at a specified distance from the starting point of the path. Set the
456 OH_Drawing_PathGetMatrix(path, true, FLT_MAX + 1, matrix, GET_POSITION_MATRIX);
458 OH_Drawing_PathDestroy(path);