1 | // This file is a part of Framsticks SDK. http://www.framsticks.com/ |
---|
2 | // Copyright (C) 1999-2015 Maciej Komosinski and Szymon Ulatowski. |
---|
3 | // See LICENSE.txt for details. |
---|
4 | |
---|
5 | #ifndef _GEOMETRYTESTUTILS_H_ |
---|
6 | #define _GEOMETRYTESTUTILS_H_ |
---|
7 | |
---|
8 | #include <frams/model/model.h> |
---|
9 | #include <frams/model/modelparts.h> |
---|
10 | #include <frams/util/3d.h> |
---|
11 | #include <frams/util/sstring.h> |
---|
12 | |
---|
13 | /** |
---|
14 | * @brief Geometry module testing utilities. |
---|
15 | * @details Contains functions frequently used by tests, such as loading or generating random Model, |
---|
16 | * or adding markers of points to a Model. |
---|
17 | * @author Radosław Gołębiewski |
---|
18 | */ |
---|
19 | namespace GeometryTestUtils |
---|
20 | { |
---|
21 | /** |
---|
22 | * @brief Execution entry point for test based on specified input model. |
---|
23 | * @details Parses call arguments and performs one of following tasks: printing usage message; |
---|
24 | * printing list of genotypes in specified file; creating Model from loaded genotype and |
---|
25 | * executing test; creating random Model and executing test. |
---|
26 | * @param[in] header Header of usage message. This text should contain test description. |
---|
27 | * @param[in] argc Number of call arguments. |
---|
28 | * @param[in] argv Call arguments. |
---|
29 | * @param[in] test Pointer to function implementing test. |
---|
30 | * @returns Result code: 0 - no error, 1 - incorrect arguments (usage message printed), |
---|
31 | * 2 - cannot open file, 3 - cannot find genotype, 4 - incorrect genotype. |
---|
32 | */ |
---|
33 | int execute(const SString header, int argc, char *argv[], void (*test)(Model &)); |
---|
34 | |
---|
35 | /** |
---|
36 | * @brief Execution entry point for test based on specified input model and density. |
---|
37 | * @details Parses call arguments and performs one of following tasks: printing usage message; |
---|
38 | * printing list of genotypes in specified file; creating Model from loaded genotype and |
---|
39 | * executing test using specified density; creating random Model and executing test using |
---|
40 | * specified density. |
---|
41 | * @param[in] header Header of usage message. This text should contain test description. |
---|
42 | * @param[in] argc Number of call arguments. |
---|
43 | * @param[in] argv Call arguments. |
---|
44 | * @param[in] test Pointer to function implementing test. |
---|
45 | * @returns Result code: 0 - no error, 1 - incorrect arguments (usage message printed), |
---|
46 | * 2 - cannot open file, 3 - cannot find genotype, 4 - incorrect genotype. |
---|
47 | */ |
---|
48 | int execute(const SString header, int argc, char *argv[], void (*test)(Model &, const double)); |
---|
49 | |
---|
50 | /** |
---|
51 | * @brief Prints description of given Part to specified file. |
---|
52 | * @details Prints shape ("shape"), position ("x", "y", "z"), scale ("sx", "sy", "sz") and |
---|
53 | * rotations ("rx", "ry", "rz") of given Part. Each value is printed in separate line using |
---|
54 | * following syntax: "# NAME=VALUE". |
---|
55 | * @param[in] part Part to be described. |
---|
56 | * @param[in] output Output file. |
---|
57 | */ |
---|
58 | void describePart(const Part *part, FILE *output); |
---|
59 | } |
---|
60 | |
---|
61 | #endif |
---|