// This file is a part of Framsticks SDK. http://www.framsticks.com/ // Copyright (C) 1999-2015 Maciej Komosinski and Szymon Ulatowski. // See LICENSE.txt for details. #ifndef _GEOMETRYTESTUTILS_H_ #define _GEOMETRYTESTUTILS_H_ #include #include #include #include /** * @brief Geometry module testing utilities. * @details Contains functions frequently used by tests, such as loading or generating random Model, * or adding markers of points to a Model. * @author Radosław Gołębiewski */ namespace GeometryTestUtils { /** * @brief Execution entry point for test based on specified input model. * @details Parses call arguments and performs one of following tasks: printing usage message; * printing list of genotypes in specified file; creating Model from loaded genotype and * executing test; creating random Model and executing test. * @param[in] header Header of usage message. This text should contain test description. * @param[in] argc Number of call arguments. * @param[in] argv Call arguments. * @param[in] test Pointer to function implementing test. * @returns Result code: 0 - no error, 1 - incorrect arguments (usage message printed), * 2 - cannot open file, 3 - cannot find genotype, 4 - incorrect genotype. */ int execute(const SString header, int argc, char *argv[], void (*test)(Model &)); /** * @brief Execution entry point for test based on specified input model and density. * @details Parses call arguments and performs one of following tasks: printing usage message; * printing list of genotypes in specified file; creating Model from loaded genotype and * executing test using specified density; creating random Model and executing test using * specified density. * @param[in] header Header of usage message. This text should contain test description. * @param[in] argc Number of call arguments. * @param[in] argv Call arguments. * @param[in] test Pointer to function implementing test. * @returns Result code: 0 - no error, 1 - incorrect arguments (usage message printed), * 2 - cannot open file, 3 - cannot find genotype, 4 - incorrect genotype. */ int execute(const SString header, int argc, char *argv[], void (*test)(Model &, const double)); /** * @brief Prints description of given Part to specified file. * @details Prints shape ("shape"), position ("x", "y", "z"), scale ("sx", "sy", "sz") and * rotations ("rx", "ry", "rz") of given Part. Each value is printed in separate line using * following syntax: "# NAME=VALUE". * @param[in] part Part to be described. * @param[in] output Output file. */ void describePart(const Part *part, FILE *output); } #endif