/////////////////////////////////////////////////////////////////////////////// // Copyright (C) 2002-2024, Open Design Alliance (the "Alliance"). // All rights reserved. // // This software and its documentation and related materials are owned by // the Alliance. The software may only be incorporated into application // programs owned by members of the Alliance, subject to a signed // Membership Agreement and Supplemental Software License Agreement with the // Alliance. The structure and organization of this software are the valuable // trade secrets of the Alliance and its suppliers. The software is also // protected by copyright law and international treaty provisions. Application // programs incorporating this software must include the following statement // with their copyright notices: // // This application incorporates Open Design Alliance software pursuant to a license // agreement with Open Design Alliance. // Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance. // All rights reserved. // // By use of this software, its documentation or related materials, you // acknowledge and accept the above terms. /////////////////////////////////////////////////////////////////////////////// #ifndef _SCENARIO_RENDER_APP_SERVICES_H_ #define _SCENARIO_RENDER_APP_SERVICES_H_ #include "TestUtility.h" #include "daiHostAppServicesBase.h" #include "scenario/ScenarioEngineIncludes.h" #include "scenario/ScenarioEngineDeclarations.h" #include "scenario/ScenarioEngineUtils.h" #include "scenario/ScenarioEngineAppServices.h" #include "scenario/EngineScenariosForBitmap.h" #include "DbBaseHostAppServices.h" namespace UnitTest { template class CommonTestAppServices : public ScenarioEngine::AppServices { public: virtual OdString findFile(const OdString& filename, OdDbBaseDatabase* pDb = 0, OdDbBaseHostAppServices::FindFileHint hint = OdDbBaseHostAppServices::kDefault) { OdString found = THostAppService::findFile(filename, pDb, hint); if (!found.isEmpty()) return found; if (filename.find(L".exp") >= 0) found = this->formatPathToCurrentDirectory(OD_T("Schemas/") + filename); else found = this->formatPathToBugDirectory(filename); if (odrxSystemServices()->accessFile(found, Oda::kFileRead)) return found; found = this->formatPathToCurrentDirectory(filename); if (odrxSystemServices()->accessFile(found, Oda::kFileRead)) return found; return OdString::kEmpty; } virtual void runApp(const OdString& appName, const OdString& args = OdString::kEmpty) { OdString cmdString(appName + " " + args); odPrintConsoleString(OD_T("Running: %s\n"), cmdString.c_str()); #ifdef ODA_WINDOWS cmdString.replace('/', '\\'); #else cmdString.replace('\\', '/'); #endif #ifdef OD_HAS_SYSTEM_FUNC if (system(cmdString)) { throw L"The process has exited with error"; } odPrintConsoleString(OD_T("system() finished ok!\n")); #else odPrintConsoleString(L"Running system command is not available for Mobile Platforms\n"); #endif } virtual const OdString program() { return OdString::kEmpty; } virtual const OdString product() { return OD_T("ODA SDK"); } virtual const OdString companyName() { return OD_T("Open Design Alliance"); } virtual bool ttfFileNameByDescriptor( const OdTtfDescriptor& description, OdString& filename) { return false; } virtual OdString getAlternateFontName() const { return OdString::kEmpty; } virtual OdString getFontMapFileName() const { return OdString::kEmpty; } virtual OdString getPreferableFont( const OdString& fontName, OdFontType fontType) { return OdString::kEmpty; } virtual OdString getSubstituteFont( const OdString& fontName, OdFontType fontType) { return OdString::kEmpty; } }; } #endif // _IGES_UNIT_TEST_ENGINE_H_