同步内网代码
commit
1ef051c650
|
@ -0,0 +1,178 @@
|
|||
#
|
||||
# clang-format configuration file. Intended for clang-format >= 4.
|
||||
#
|
||||
# For more information, see:
|
||||
#
|
||||
# https://clang.llvm.org/docs/ClangFormat.html
|
||||
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
|
||||
#
|
||||
# 语言: None, Cpp, Java, JavaScript, ObjC, Proto, TableGen, TextProto
|
||||
Language: Cpp
|
||||
BasedOnStyle: Google
|
||||
# 访问说明符(public、private等)的偏移
|
||||
AccessModifierOffset: -4
|
||||
# 开括号(开圆括号、开尖括号、开方括号)后的对齐: Align, DontAlign, AlwaysBreak(总是在开括号后换行)
|
||||
AlignAfterOpenBracket: Align
|
||||
# 连续赋值时,对齐所有等号
|
||||
AlignConsecutiveAssignments: AcrossEmptyLinesAndComments
|
||||
# 连续声明时,对齐所有声明的变量名
|
||||
AlignConsecutiveDeclarations: AcrossEmptyLinesAndComments
|
||||
# 水平对齐二元和三元表达式的操作数
|
||||
AlignOperands: AlignAfterOperator
|
||||
# 对齐连续的尾随的注释
|
||||
AlignTrailingComments: true
|
||||
# 允许函数声明的所有参数在放在下一行
|
||||
AllowAllParametersOfDeclarationOnNextLine: false
|
||||
# 允许短的块放在同一行
|
||||
AllowShortBlocksOnASingleLine: Never
|
||||
# 允许短的case标签放在同一行
|
||||
AllowShortCaseLabelsOnASingleLine: false
|
||||
# 允许短的函数放在同一行: None, InlineOnly(定义在类中), Empty(空函数), Inline(定义在类中,空函数), All
|
||||
AllowShortFunctionsOnASingleLine: Empty
|
||||
# 允许短的if语句保持在同一行
|
||||
AllowShortIfStatementsOnASingleLine: false
|
||||
# 允许短的循环保持在同一行
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
# 总是在定义返回类型后换行(deprecated)
|
||||
AlwaysBreakAfterDefinitionReturnType: None
|
||||
# 总是在返回类型后换行: None, All, TopLevel(顶级函数,不包括在类中的函数),
|
||||
# AllDefinitions(所有的定义,不包括声明), TopLevelDefinitions(所有的顶级函数的定义)
|
||||
AlwaysBreakAfterReturnType: None
|
||||
# 总是在多行string字面量前换行
|
||||
AlwaysBreakBeforeMultilineStrings: false
|
||||
# 总是在template声明后换行
|
||||
AlwaysBreakTemplateDeclarations: Yes
|
||||
# false表示函数实参要么都在同一行,要么都各自一行
|
||||
BinPackArguments: true
|
||||
# false表示所有形参要么都在同一行,要么都各自一行
|
||||
BinPackParameters: true
|
||||
# 大括号换行,只有当BreakBeforeBraces设置为Custom时才有效
|
||||
BraceWrapping:
|
||||
# class定义后面
|
||||
AfterClass: false
|
||||
# 控制语句后面
|
||||
AfterControlStatement: Never
|
||||
# enum定义后面
|
||||
AfterEnum: false
|
||||
# 函数定义后面
|
||||
AfterFunction: true
|
||||
# 命名空间定义后面
|
||||
AfterNamespace: false
|
||||
# ObjC定义后面
|
||||
AfterObjCDeclaration: false
|
||||
# struct定义后面
|
||||
AfterStruct: false
|
||||
# union定义后面
|
||||
AfterUnion: false
|
||||
# catch之前
|
||||
BeforeCatch: false
|
||||
# else之前
|
||||
BeforeElse: false
|
||||
# 缩进大括号
|
||||
IndentBraces: false
|
||||
# 在二元运算符前换行: None(在操作符后换行), NonAssignment(在非赋值的操作符前换行), All(在操作符前换行)
|
||||
BreakBeforeBinaryOperators: NonAssignment
|
||||
# 在大括号前换行: Attach(始终将大括号附加到周围的上下文), Linux(除函数、命名空间和类定义,与Attach类似),
|
||||
# Mozilla(除枚举、函数、记录定义,与Attach类似), Stroustrup(除函数定义、catch、else,与Attach类似),
|
||||
# Allman(总是在大括号前换行), GNU(总是在大括号前换行,并对于控制语句的大括号增加额外的缩进), WebKit(在函数前换行), Custom
|
||||
# 注:这里认为语句块也属于函数
|
||||
BreakBeforeBraces: Custom
|
||||
# 在三元运算符前换行
|
||||
BreakBeforeTernaryOperators: true
|
||||
# 在构造函数的初始化列表的逗号前换行
|
||||
BreakConstructorInitializersBeforeComma: true
|
||||
# 每行字符的限制,0表示没有限制
|
||||
ColumnLimit: 100
|
||||
# 描述具有特殊意义的注释的正则表达式,它不应该被分割为多行或以其它方式改变
|
||||
CommentPragmas: '^ IWYU pragma:'
|
||||
# 构造函数的初始化列表要么都在同一行,要么都各自一行
|
||||
ConstructorInitializerAllOnOneLineOrOnePerLine: false
|
||||
# 构造函数的初始化列表的缩进宽度
|
||||
ConstructorInitializerIndentWidth: 4
|
||||
# 延续的行的缩进宽度
|
||||
ContinuationIndentWidth: 4
|
||||
# 去除C++11的列表初始化的大括号{后和}前的空格
|
||||
Cpp11BracedListStyle: false
|
||||
# 继承最常用的指针和引用的对齐方式
|
||||
DerivePointerAlignment: false
|
||||
# 关闭格式化
|
||||
DisableFormat: false
|
||||
# 自动检测函数的调用和定义是否被格式为每行一个参数(Experimental)
|
||||
ExperimentalAutoDetectBinPacking: false
|
||||
# 需要被解读为foreach循环而不是函数调用的宏
|
||||
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
|
||||
# 对#include进行排序,匹配了某正则表达式的#include拥有对应的优先级,匹配不到的则默认优先级为INT_MAX(优先级越小排序越靠前),
|
||||
# 可以定义负数优先级从而保证某些#include永远在最前面
|
||||
IncludeCategories:
|
||||
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
|
||||
Priority: 2
|
||||
- Regex: '^(<|"(gtest|isl|json)/)'
|
||||
Priority: 3
|
||||
- Regex: '.*'
|
||||
Priority: 1
|
||||
# 缩进case标签
|
||||
IndentCaseLabels: true
|
||||
# 缩进宽度
|
||||
IndentWidth: 4
|
||||
# 函数返回类型换行时,缩进函数声明或函数定义的函数名
|
||||
IndentWrappedFunctionNames: false
|
||||
# 保留在块开始处的空行
|
||||
KeepEmptyLinesAtTheStartOfBlocks: false
|
||||
# 开始一个块的宏的正则表达式
|
||||
MacroBlockBegin: ''
|
||||
# 结束一个块的宏的正则表达式
|
||||
MacroBlockEnd: ''
|
||||
# 连续空行的最大数量
|
||||
MaxEmptyLinesToKeep: 1
|
||||
# 命名空间的缩进: None, Inner(缩进嵌套的命名空间中的内容), All
|
||||
NamespaceIndentation: All
|
||||
# 使用ObjC块时缩进宽度
|
||||
ObjCBlockIndentWidth: 4
|
||||
# 在ObjC的@property后添加一个空格
|
||||
ObjCSpaceAfterProperty: false
|
||||
# 在ObjC的protocol列表前添加一个空格
|
||||
ObjCSpaceBeforeProtocolList: true
|
||||
# 在call(后对函数调用换行的penalty
|
||||
PenaltyBreakBeforeFirstCallParameter: 19
|
||||
# 在一个注释中引入换行的penalty
|
||||
PenaltyBreakComment: 300
|
||||
# 第一次在<<前换行的penalty
|
||||
PenaltyBreakFirstLessLess: 120
|
||||
# 在一个字符串字面量中引入换行的penalty
|
||||
PenaltyBreakString: 1000
|
||||
# 对于每个在行字符数限制之外的字符的penalty
|
||||
PenaltyExcessCharacter: 1000000
|
||||
# 将函数的返回类型放到它自己的行的penalty
|
||||
PenaltyReturnTypeOnItsOwnLine: 60
|
||||
# 指针和引用的对齐: Left, Right, Middle
|
||||
PointerAlignment: Left
|
||||
# 允许重新排版注释
|
||||
ReflowComments: true
|
||||
# 允许排序#include
|
||||
SortIncludes: CaseInsensitive
|
||||
# 在C风格类型转换后添加空格
|
||||
SpaceAfterCStyleCast: false
|
||||
# 在赋值运算符之前添加空格
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
# 开圆括号之前添加一个空格: Never, ControlStatements, Always
|
||||
SpaceBeforeParens: Never
|
||||
# 在空的圆括号中添加空格
|
||||
SpaceInEmptyParentheses: false
|
||||
# 在尾随的评论前添加的空格数(只适用于//)
|
||||
SpacesBeforeTrailingComments: 1
|
||||
# 在尖括号的<后和>前添加空格
|
||||
SpacesInAngles: false
|
||||
# 在容器(ObjC和JavaScript的数组和字典等)字面量中添加空格
|
||||
SpacesInContainerLiterals: false
|
||||
# 在C风格类型转换的括号中添加空格
|
||||
SpacesInCStyleCastParentheses: false
|
||||
# 在圆括号的(后和)前添加空格
|
||||
SpacesInParentheses: false
|
||||
# 在方括号的[后和]前添加空格,lamda表达式和未指明大小的数组的声明不受影响
|
||||
SpacesInSquareBrackets: false
|
||||
# 标准: Cpp03, Cpp11, Auto
|
||||
Standard: c++11
|
||||
# tab宽度
|
||||
TabWidth: 4
|
||||
# 使用tab字符: Never, ForIndentation, ForContinuationAndIndentation, Always
|
||||
UseTab: Always
|
|
@ -0,0 +1,199 @@
|
|||
# Prerequisites
|
||||
*.d
|
||||
|
||||
# Compiled Object files
|
||||
*.slo
|
||||
*.lo
|
||||
*.o
|
||||
*.obj
|
||||
|
||||
# Precompiled Headers
|
||||
*.gch
|
||||
*.pch
|
||||
|
||||
# Compiled Dynamic libraries
|
||||
*.so
|
||||
*.dylib
|
||||
*.dll
|
||||
|
||||
# Fortran module files
|
||||
*.mod
|
||||
*.smod
|
||||
|
||||
# Compiled Static libraries
|
||||
*.lai
|
||||
*.la
|
||||
*.a
|
||||
*.lib
|
||||
|
||||
# Executables
|
||||
*.exe
|
||||
*.out
|
||||
*.app
|
||||
python37
|
||||
Build
|
||||
Code/.vs
|
||||
|
||||
output/*
|
||||
Code/*/debug
|
||||
Code/*/release
|
||||
Code/*/Makefile*
|
||||
Code/Makefile*
|
||||
Code/PluginFluent/*
|
||||
cgns/*
|
||||
cgns00/*
|
||||
*.vcxproj
|
||||
*.vcxproj.filters
|
||||
*.vcxproj.user
|
||||
*.stash
|
||||
*.bat
|
||||
/Doxygen
|
||||
/DoxyConfig
|
||||
/*.nsi
|
||||
/.vscode
|
||||
/Code/*.user
|
||||
/Code/*.sln
|
||||
/build-FastCAE-Desktop_Qt_5_14_2_MSVC2017_64bit-Debug
|
||||
Code/FastCAE.pro.user.4f627ea
|
||||
/src/Copy_Pys.bat
|
||||
/src/Copy_Pys.sh
|
||||
/src/Copy_SOs.sh
|
||||
/src/Create_Linux64_Project.sh
|
||||
/src/Create_X64_Project.bat
|
||||
/src/FastCAE.pro
|
||||
/src/hdf5.pri
|
||||
/src/occ.pri
|
||||
/src/python.pri
|
||||
/src/qwt.pri
|
||||
/src/Run_MSVC.bat
|
||||
/src/tecio.pri
|
||||
/src/Translate.bat
|
||||
/src/vtk.pri
|
||||
/src/cgns.pri
|
||||
/src/Copy_DLLs.bat
|
||||
/src/BCBase/BCBase.pro
|
||||
/src/BCBase/_Create_Project.bat
|
||||
/src/BCBase/_Create_project.sh
|
||||
/src/BCBase/BCBase.pri
|
||||
/src/ConfigOptions/ConfigOptions.pro
|
||||
/src/ConfigOptions/_Create_Project.bat
|
||||
/src/ConfigOptions/_Create_project.sh
|
||||
/src/ConfigOptions/ConfigOptions.pri
|
||||
/src/DataProperty/DataProperty.pro
|
||||
/src/DataProperty/_Create_Project.bat
|
||||
/src/DataProperty/_Create_project.sh
|
||||
/src/DataProperty/DataProperty.pri
|
||||
/src/geometry/geometry.pro
|
||||
/src/geometry/_Create_Project.bat
|
||||
/src/geometry/_Create_project.sh
|
||||
/src/geometry/geometry.pri
|
||||
/src/GeometryCommand/GeometryCommand.pro
|
||||
/src/GeometryCommand/_Create_Project.bat
|
||||
/src/GeometryCommand/_Create_project.sh
|
||||
/src/GeometryCommand/GeometryCommand.pri
|
||||
/src/GeometryDataExchange/GeometryDataExchange.pro
|
||||
/src/GeometryDataExchange/_Create_Project.bat
|
||||
/src/GeometryDataExchange/_Create_project.sh
|
||||
/src/GeometryDataExchange/GeometryDataExchange.pri
|
||||
/src/GeometryWidgets/GeometryWidgets.pri
|
||||
/src/GeometryWidgets/GeometryWidgets.pro
|
||||
/src/GeometryWidgets/_Create_project.sh
|
||||
/src/GeometryWidgets/_Create_Project.bat
|
||||
/src/GmshModule/GmshModule.pri
|
||||
/src/GmshModule/GmshModule.pro
|
||||
/src/GmshModule/_Create_Project.bat
|
||||
/src/GmshModule/_Create_project.sh
|
||||
/src/IO/IO.pri
|
||||
/src/IO/IO.pro
|
||||
/src/IO/_Create_Project.bat
|
||||
/src/IO/_Create_project.sh
|
||||
/src/License/License.pri
|
||||
/src/License/License.pro
|
||||
/src/License/_Create_Project.bat
|
||||
/src/License/_Create_project.sh
|
||||
/src/MainWidgets/MainWidgets.pri
|
||||
/src/MainWidgets/MainWidgets.pro
|
||||
/src/MainWidgets/_Create_Project.bat
|
||||
/src/MainWidgets/_Create_project.sh
|
||||
/src/mainWindow/mainWindow.pri
|
||||
/src/mainWindow/mainWindow.pro
|
||||
/src/mainWindow/_Create_Project.bat
|
||||
/src/mainWindow/_Create_project.sh
|
||||
/src/Material/Material.pri
|
||||
/src/Material/Material.pro
|
||||
/src/Material/_Create_Project.bat
|
||||
/src/Material/_Create_project.sh
|
||||
/src/meshData/meshData.pro
|
||||
/src/meshData/_Create_Project.bat
|
||||
/src/meshData/_Create_project.sh
|
||||
/src/meshData/meshData.pri
|
||||
/src/ModelData/ModelData.pri
|
||||
/src/ModelData/ModelData.pro
|
||||
/src/ModelData/_Create_Project.bat
|
||||
/src/ModelData/_Create_project.sh
|
||||
/src/moduleBase/moduleBase.pri
|
||||
/src/moduleBase/moduleBase.pro
|
||||
/src/moduleBase/_Create_Project.bat
|
||||
/src/moduleBase/_Create_project.sh
|
||||
/src/ParaClassFactory/ParaClassFactory.pro
|
||||
/src/ParaClassFactory/_Create_Project.bat
|
||||
/src/ParaClassFactory/_Create_project.sh
|
||||
/src/ParaClassFactory/ParaClassFactory.pri
|
||||
/src/PluginCustomizer/PluginCustomizer.pri
|
||||
/src/PluginCustomizer/PluginCustomizer.pro
|
||||
/src/PluginCustomizer/_Create_Project.bat
|
||||
/src/PluginCustomizer/_Create_project.sh
|
||||
/src/PluginManager/PluginManager.pri
|
||||
/src/PluginManager/PluginManager.pro
|
||||
/src/PluginManager/_Create_Project.bat
|
||||
/src/PluginManager/_Create_project.sh
|
||||
/src/PluginMeshDataExchange/PluginMeshDataExchange.pro
|
||||
/src/PluginMeshDataExchange/_Create_Project.bat
|
||||
/src/PluginMeshDataExchange/_Create_project.sh
|
||||
/src/PluginMeshDataExchange/PluginMeshDataExchange.pri
|
||||
/src/PostAlgorithm/PostAlgorithm.pri
|
||||
/src/PostAlgorithm/PostAlgorithm.pro
|
||||
/src/PostAlgorithm/_Create_Project.bat
|
||||
/src/PostCurveDataManager/PostCurveDataManager.pri
|
||||
/src/PostCurveDataManager/PostCurveDataManager.pro
|
||||
/src/PostInterface/PostInterface.pri
|
||||
/src/PostInterface/PostInterface.pro
|
||||
/src/PostInterface/_Create_Project.bat
|
||||
/src/PostPlotWidget/PostPlotWidget.pri
|
||||
/src/PostPlotWidget/PostPlotWidget.pro
|
||||
/src/PostRenderData/PostRenderData.pri
|
||||
/src/PostRenderData/PostRenderData.pro
|
||||
/src/PostRenderData/_Create_Project.bat
|
||||
/src/PostWidgets/PostWidgets.pri
|
||||
/src/PostWidgets/PostWidgets.pro
|
||||
/src/PostWidgets/_Create_Project.bat
|
||||
/src/PostWidgets/_Create_project.sh
|
||||
/src/ProjectTree/ProjectTree.pri
|
||||
/src/ProjectTree/ProjectTree.pro
|
||||
/src/ProjectTree/_Create_Project.bat
|
||||
/src/ProjectTree/_Create_project.sh
|
||||
/src/ProjectTreeExtend/ProjectTreeExtend.pro
|
||||
/src/ProjectTreeExtend/_Create_Project.bat
|
||||
/src/ProjectTreeExtend/_Create_project.sh
|
||||
/src/ProjectTreeExtend/ProjectTreeExtend.pri
|
||||
/src/SARibbonBar/_Create_Project.bat
|
||||
/src/SelfDefObject/SelfDefObject.pri
|
||||
/src/SelfDefObject/SelfDefObject.pro
|
||||
/src/SelfDefObject/_Create_Project.bat
|
||||
/src/SelfDefObject/_Create_project.sh
|
||||
/src/settings/settings.pro
|
||||
/src/settings/_Create_Project.bat
|
||||
/src/settings/_Create_project.sh
|
||||
/src/settings/settings.pri
|
||||
/src/SolverControl/SolverControl.pri
|
||||
/src/SolverControl/SolverControl.pro
|
||||
/src/SolverControl/_Create_Project.bat
|
||||
/src/SolverControl/_Create_project.sh
|
||||
/src/UserGuidence/UserGuidence.pro
|
||||
/src/UserGuidence/_Create_Project.bat
|
||||
/src/UserGuidence/_Create_project.sh
|
||||
/src/UserGuidence/UserGuidence.pri
|
||||
/src/XGenerateReport/XGenerateReport.pri
|
||||
/src/XGenerateReport/XGenerateReport.pro
|
||||
/src/XGenerateReport/_Create_Project.bat
|
||||
/src/XGenerateReport/_Create_project.sh
|
|
@ -0,0 +1,321 @@
|
|||
#-----------------------------------------------------------------------------
|
||||
# 工程属性设置
|
||||
#-----------------------------------------------------------------------------
|
||||
# 指定所需cmake的最低版本
|
||||
cmake_minimum_required(VERSION 3.21 FATAL_ERROR)
|
||||
# 设置项目名称 语言
|
||||
project(FastCAE
|
||||
VERSION 2.5.0
|
||||
LANGUAGES CXX
|
||||
DESCRIPTION "FastCAE,一款免费的CAE仿真软件研发支撑平台。"
|
||||
HOMEPAGE_URL "http://www.fastcae.com/"
|
||||
)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 编译系统设置
|
||||
#-----------------------------------------------------------------------------
|
||||
# c++语言标准
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
# 指定是否使用编译器特定的扩展
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
# 是否强制要求C++标准为${CMAKE_CXX_STANDARD},如果为OFF则可能使用旧的标准
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
# 默认编译动态库
|
||||
set(BUILD_SHARED_LIBS ON)
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 检测操作系统
|
||||
#-----------------------------------------------------------------------------
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
set(FASTCAE_LINUX True)
|
||||
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||
set(CMAKE_INSTALL_PREFIX "/opt/${PROJECT_NAME}" CACHE PATH "${PROJECT_NAME}的安装路径" FORCE)
|
||||
endif()
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||
set(FASTCAE_WIN True)
|
||||
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||
set(CMAKE_INSTALL_PREFIX "c:/Program Files/${PROJECT_NAME}" CACHE PATH "${PROJECT_NAME}的安装路径" FORCE)
|
||||
endif()
|
||||
else()
|
||||
message(SEND_ERROR "No Support System!")
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 测试环境定义,发布的时候需要删除
|
||||
#-----------------------------------------------------------------------------
|
||||
set(CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/install")
|
||||
message(STATUS "${PROJECT_NAME} will be installed to ${CMAKE_INSTALL_PREFIX}")
|
||||
|
||||
if (NOT DEFINED Qt5_DIR)
|
||||
if(FASTCAE_LINUX)
|
||||
set(Qt5_DIR "/opt/Qt5.14.2/5.14.2/gcc_64/lib/cmake/Qt5" CACHE PATH "Qt5Config.cmake所在目录" FORCE)
|
||||
elseif(FASTCAE_WIN)
|
||||
set(Qt5_DIR "D:/software/Qt/Qt5.14.2/5.14.2/msvc2017_64/lib/cmake/Qt5" CACHE PATH "Qt5Config.cmake所在目录" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 编译选项设置
|
||||
#-----------------------------------------------------------------------------
|
||||
# 是否需要编译调试程序
|
||||
option(FASTCAE_ENABLE_DEV "ON:开启代码调试,OFF:仅安装程序" ON)
|
||||
# 是否自动下载依赖库
|
||||
option(FASTCAE_AUTO_DOWNLOAD "如果extlib不存在,则自动下载(git)依赖库" ON)
|
||||
option(FASTCAE_ENABLE_OPENMP "使用OpenMP" OFF)
|
||||
option(FASTCAE_ENABLE_MPI "使用MPI" OFF)
|
||||
option(FASTCAE_DOXYGEN_DOC "生成Doxygen文档" OFF)
|
||||
option(FASTCAE_INSTALLATION_PACKAGE "生成${PROJECT_NAME}安装包" ON)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 指定编译选项
|
||||
#-----------------------------------------------------------------------------
|
||||
# 仅对单配制编译器(Makefile Generators or Ninja)生效
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE "Release")
|
||||
endif()
|
||||
if (POLICY CMP0091)
|
||||
cmake_policy(SET CMP0091 NEW)
|
||||
endif (POLICY CMP0091)
|
||||
if(MSVC)
|
||||
add_definitions(-DUNICODE -D_UNICODE)
|
||||
add_compile_options("$<$<C_COMPILER_ID:MSVC>:/utf-8>")
|
||||
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")
|
||||
add_compile_options(
|
||||
$<$<CONFIG:>:/MD>
|
||||
$<$<CONFIG:Debug>:/MDd>
|
||||
$<$<CONFIG:Release>:/MD>
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 从系统查找OpenMP(动态库引入使用:OpenMP::OpenMP_CXX)
|
||||
#-----------------------------------------------------------------------------
|
||||
if(FASTCAE_ENABLE_OPENMP)
|
||||
find_package(OpenMP)
|
||||
if(OpenMP_CXX_FOUND)
|
||||
add_definitions(-DFASTCAE_HAS_OPENMP)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 从系统查找MPI(头文件路径:${MPI_CXX_INCLUDE_DIRS} 动态库引入使用:MPI::MPI_CXX)
|
||||
#-----------------------------------------------------------------------------
|
||||
if(FASTCAE_ENABLE_MPI)
|
||||
find_package(MPI)
|
||||
if(MPI_CXX_FOUND)
|
||||
add_definitions(-DFASTCAE_HAS_MPI)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 从系统查找Qt模块,开启Qt中间文件的自动生成
|
||||
#-----------------------------------------------------------------------------
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
|
||||
list(APPEND QtNeededModules
|
||||
Core
|
||||
Widgets
|
||||
Gui
|
||||
Xml
|
||||
Svg # Qwt
|
||||
OpenGL # Qwt
|
||||
PrintSupport # QwtPolar
|
||||
DBus
|
||||
)
|
||||
if(FASTCAE_LINUX)
|
||||
list(APPEND QtNeededModules XcbQpa)
|
||||
endif()
|
||||
|
||||
find_package(Qt5 COMPONENTS ${QtNeededModules} REQUIRED)
|
||||
if(Qt5_FOUND)
|
||||
message(STATUS "Found Qt5: ${Qt5_DIR}")
|
||||
if(Qt5_POSITION_INDEPENDENT_CODE)
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
endif()
|
||||
else()
|
||||
set(Qt5_DIR "Qt5_DIR-NOTFOUND" CACHE PATH "Qt5_DIR")
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 从远程检索依赖库
|
||||
#-----------------------------------------------------------------------------
|
||||
if(FASTCAE_AUTO_DOWNLOAD AND NOT EXISTS ${CMAKE_SOURCE_DIR}/extlib)
|
||||
if(FASTCAE_WIN)
|
||||
set(_extlibGitAddr "https://gitee.com/DISOGitee/FastCAEWinExtlib.git")
|
||||
elseif(FASTCAE_LINUX)
|
||||
set(_extlibGitAddr "https://gitee.com/DISOGitee/FastCAELinuxExtlib.git")
|
||||
endif()
|
||||
|
||||
find_package(Git REQUIRED)
|
||||
if(Git_FOUND)
|
||||
execute_process(
|
||||
COMMAND
|
||||
${GIT_EXECUTABLE} clone ${_extlibGitAddr} extlib
|
||||
WORKING_DIRECTORY
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
RESULT_VARIABLE _status
|
||||
)
|
||||
else()
|
||||
message(FATAL_ERROR "Not Found Git")
|
||||
message(STATUS "Please execute the command[git clone ${_extlibGitAddr} extlib] under the directory ${CMAKE_SOURCE_DIR}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 引入FastCAE的依赖库
|
||||
#-----------------------------------------------------------------------------
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
|
||||
|
||||
# VTK
|
||||
find_package(VTK REQUIRED)
|
||||
|
||||
# OpenCASCADE
|
||||
find_package(OpenCASCADE REQUIRED)
|
||||
|
||||
# Qwt
|
||||
find_package(Qwt REQUIRED)
|
||||
|
||||
# HDF5
|
||||
find_package(HDF5 REQUIRED)
|
||||
|
||||
# CGNS
|
||||
find_package(CGNS REQUIRED)
|
||||
|
||||
# TecIO
|
||||
find_package(TecIO REQUIRED)
|
||||
|
||||
# QuaZIP
|
||||
find_package(QuaZIP REQUIRED)
|
||||
|
||||
# Gmsh
|
||||
find_package(Gmsh REQUIRED)
|
||||
|
||||
# Python
|
||||
find_package(Python REQUIRED)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 检索系统python(需要修改cmake搜索路径)
|
||||
#-----------------------------------------------------------------------------
|
||||
#find_package(PythonInterp REQUIRED)
|
||||
#find_package(Python COMPONENTS Interpreter Development REQUIRED)
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 开启项目分组
|
||||
#-----------------------------------------------------------------------------
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
# 可以修改cmake预定义的target分组名称
|
||||
#set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "Predefined")
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 定义GNU标准的安装目录(GNUInstallDirs.cmake)
|
||||
#-----------------------------------------------------------------------------
|
||||
include(GNUInstallDirs)
|
||||
set(CMAKE_INSTALL_LIBDIR "lib")
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 定义项目构建中间文件的生成目录
|
||||
#-----------------------------------------------------------------------------
|
||||
if(FASTCAE_WIN)
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/Debug)
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/Debug)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/Debug)
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/Release)
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/Release)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/Release)
|
||||
if(FASTCAE_ENABLE_DEV)
|
||||
set(DEVRUNTIME_BINDIR_DEBUG ${CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG})
|
||||
set(DEVRUNTIME_BINDIR_RELEASE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE})
|
||||
endif()
|
||||
elseif(FASTCAE_LINUX)
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR})
|
||||
if(FASTCAE_ENABLE_DEV)
|
||||
set(DEVRUNTIME_BINDIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
|
||||
set(DEVRUNTIME_LIBDIR ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 定义变量作为项目的安装路径
|
||||
#-----------------------------------------------------------------------------
|
||||
set(INSTALL_BINDIR ${CMAKE_INSTALL_BINDIR})
|
||||
if(FASTCAE_WIN)
|
||||
set(INSTALL_LIBDIR ${CMAKE_INSTALL_BINDIR})
|
||||
else()
|
||||
set(INSTALL_LIBDIR ${CMAKE_INSTALL_LIBDIR})
|
||||
endif()
|
||||
#set(INSTALL_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR})
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 编译位置无关的代码
|
||||
#-----------------------------------------------------------------------------
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
# 定义源码路径
|
||||
add_subdirectory(src)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 单元测试Ctest
|
||||
#-----------------------------------------------------------------------------
|
||||
option(FASTCAE_ENABLE_TEST "开启单元测试(尚未开发完成)" OFF)
|
||||
if(FASTCAE_ENABLE_TEST)
|
||||
# 开启测试
|
||||
enable_testing()
|
||||
#添加测试项目
|
||||
add_subdirectory(test)
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 生成文档(Doxygen + Breathe + Sphinx)
|
||||
#-----------------------------------------------------------------------------
|
||||
if(FASTCAE_DOXYGEN_DOC)
|
||||
find_package(Doxygen REQUIRED)
|
||||
if(DOXYGEN_FOUND)
|
||||
message(STATUS "Found doc generate Tool: Doxygen")
|
||||
include(UseDoxygen)
|
||||
# 文档生成依赖Python解释器、Sphinx
|
||||
#[[find_package(PythonInterp)
|
||||
find_package(Sphinx)
|
||||
|
||||
if(PYTHONINTERP_FOUND AND SPHINX_FOUND)
|
||||
message(STATUS "Found doc generate Tool: Sphinx")
|
||||
include(FindPythonModule)
|
||||
# Python的breathe模块负责协调Doxygen和Sphinx
|
||||
find_python_module(breathe REQUIRED)
|
||||
if(breathe_FOUND)
|
||||
message(STATUS "Python module(breathe) version: ${breathe_VERSION}")
|
||||
include(UseSphinx)
|
||||
else()
|
||||
message(STATUS "Generate sphinx documentation need python module: breathe")
|
||||
endif()
|
||||
|
||||
endif()]]
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 安装包生成(windows环境光需要NSIS 3.03+)
|
||||
#-----------------------------------------------------------------------------
|
||||
if(FASTCAE_INSTALLATION_PACKAGE)
|
||||
if (FASTCAE_WIN)
|
||||
find_program(NSIS_EXECUTABLE NSIS.exe)
|
||||
# WIX尚未调试,暂时取消
|
||||
#find_program(WIX_EXECUTABLE candle.exe)
|
||||
#if(NSIS_EXECUTABLE OR WIX_EXECUTABLE)
|
||||
if(NSIS_EXECUTABLE)
|
||||
include(${CMAKE_SOURCE_DIR}/cmake/CMakePack.cmake)
|
||||
endif()
|
||||
else()
|
||||
include(${CMAKE_SOURCE_DIR}/cmake/CMakePack.cmake)
|
||||
endif ()
|
||||
# 以下include必须放在主CMakeLists.txt文件最后面,否则在Visual Studio中不会生成PACKAGE(打包)目标
|
||||
include(CPack)
|
||||
endif()
|
|
@ -0,0 +1,29 @@
|
|||
# 产品更新日志
|
||||
|
||||
Version:2.5.x
|
||||
|
||||
---
|
||||
更新时间:2020-05-08
|
||||
|
||||
**新增功能**
|
||||
- 后处理增加tecplot文件(szplt)的读取。
|
||||
- 加入OpenGL版本检测函数,当环境OPenGL版本低于3.3时,给出错误提示。
|
||||
- 新增自动打包功能,Windows需要NSIS 3.03+、Linux需要dpkg-deb或者rpmbuild(需要python3)。
|
||||
- 新增文档自动生成功能,需要安装Doxygen和Graphviz。
|
||||
|
||||
**功能优化**
|
||||
- 代码全部采用cmake进行管理,可任意选择vscode、Visual Studio、Clion、Qtcreator等支持cmake系统的IDE。
|
||||
- 后处理代码重构。
|
||||
- 删除Qt浏览器组建及相关依赖(Qt安装不再需要QWebEngine组件)。
|
||||
- 优化Python调用,不再依赖系统配置,简化操作。
|
||||
- 从依赖库中移除未使用的VTK、OpenCASCADE模块。
|
||||
|
||||
**功能修复**
|
||||
- 修复linux环境卸载插件时崩溃的问题
|
||||
- 修复单个窗口下视图控制不正常的问题
|
||||
- 修复几何绘制线段失败的问题
|
||||
|
||||
**其他**
|
||||
- OpenCASCADE的版本变更(7.5.0->7.6.0)。
|
||||
- gmsh的版本变更(4.5.4->4.8.0)。
|
||||
- linux环境下的依赖库基于GLIBC2.17编译,基本满足现有linux操作系统要求。
|
|
@ -0,0 +1,29 @@
|
|||
BSD 3-Clause License
|
||||
|
||||
Copyright (c) 2020, LiBaojun
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@ -0,0 +1,142 @@
|
|||
|
||||
# 说明
|
||||
|
||||
|
||||
## 源码文件夹结构
|
||||
- cmake: cmake相关的脚本
|
||||
- doc: 生成文档需要的模板及配置文件
|
||||
- extlib: 第三方依赖库(见下文extlib获取方式)
|
||||
- src: FastCAE源码
|
||||
- test: 包含单元测试代码(待整理)
|
||||
|
||||
|
||||
### extlib目录结构
|
||||
|
||||
```
|
||||
extlib
|
||||
├─CGNS(version:4.3.0)
|
||||
│
|
||||
├─Gmsh(version:4.8.0)
|
||||
│
|
||||
├─HDF5(version:1.13.1)
|
||||
│
|
||||
├─OCC(version:7.6.0)
|
||||
│
|
||||
├─Python(version:3.7.0)
|
||||
│
|
||||
├─QuaZIP(version:0.7.3)
|
||||
│
|
||||
├─Qwt(version: Qwt:6.1.6 QwtPolar:1.1.1)
|
||||
│
|
||||
├─TecIO(version:1.4.2)
|
||||
│
|
||||
└─VTK(version:9.0.1)
|
||||
|
||||
```
|
||||
|
||||
|
||||
### extlib获取方式
|
||||
|
||||
### Linux系统
|
||||
|
||||
```bash
|
||||
git clone https://gitee.com/DISOGitee/FastCAELinuxExtlib.git extlib
|
||||
```
|
||||
|
||||
### windows系统
|
||||
|
||||
```bash
|
||||
git clone https://gitee.com/DISOGitee/FastCAEWinExtlib.git extlib
|
||||
```
|
||||
|
||||
|
||||
|
||||
## 编译打包
|
||||
|
||||
项目采用cmake构建系统组织代码,可以直接使用cmake转换visual studio 2017工程或者生成Makefile文件,或者可以直接使用支持cmake系统的IDE(比如:vscode、clion、visual studio、qtcreator等)打开项目文件夹进行构建、编译。
|
||||
|
||||
> 项目依赖文件会在构建阶段根据系统自动克隆对应的依赖库到本地extlib文件夹,如果需要离线部署,可以在“extlib获取方式”中离线下载依赖库。
|
||||
|
||||
构建项目:
|
||||
|
||||
```
|
||||
cmake -DCMAKE_INSTALL_PREFIX:PATH=/path_to_install -DQt5_DIR:PATH=/path_of_Qt5Config.cmake -B build -S .
|
||||
```
|
||||
|
||||
> 如果在windows环境下使用命令行构建项目需要增加参数`-G "Visual Studio 15 2017 Win64"`,具体参数需要根据自己的Visual Studio的版本确定,
|
||||
|
||||
安装:
|
||||
|
||||
```
|
||||
cmake --build build --target install
|
||||
```
|
||||
|
||||
源码(`.tar.gz` and `.zip`)打包:
|
||||
|
||||
```
|
||||
cmake --build build --target package_source
|
||||
```
|
||||
|
||||
制作安装包(`.deb` `.rpm` `.exe`):
|
||||
|
||||
```
|
||||
cmake --build build --target package
|
||||
```
|
||||
|
||||
**备注:**
|
||||
> 1、如果构建系统是Makefile、Ninja、Xcode,则生成`package`目标,如果是MVSC构建系统,则生成大写的`PACKAGE`目标。
|
||||
>
|
||||
> > `cmake --build . --target package` 或者 `make package` 或者 `ninja package`
|
||||
|
||||
> 2、如果构建系统是Makefile、Ninja,还会则生成`package_source`目标用于打包源码。
|
||||
>
|
||||
> > `cmake --build . --target package_source` 或者 `make package_source` 或者 `ninja package_source`
|
||||
|
||||
|
||||
|
||||
## 特别说明
|
||||
|
||||
- 源码绝对路径中不要出现中文字符、空格以及特殊字符:(){}*/?|\等
|
||||
- 要求cmake的最低版本为3.21
|
||||
- windows环境制作安装包要求NSIS版本为3.03+
|
||||
- linux环境制作安装包需要安装`dpkg-deb`或者`rpmbuild`
|
||||
- linux的其他系统依赖包`OpenGL`、`fontconfig`、`xkbcommon`
|
||||
|
||||
|
||||
## 测试平台
|
||||
| 序号 | 操作系统 | GLIBC版本 | 编译器 | Qt | 测试结果 | 备注 |
|
||||
| :--: | :-----------: | :-------: | :---------: | :--: | :--: | :--: |
|
||||
| 1 | Ubuntu18.04 | 2.27 | GNU GCC 7.5.0 | Qt5.14.2 | 通过 | |
|
||||
| 2 | Ubuntu20.04 | 2.31 | GNU GCC 9.4.0 | Qt5.14.2 | 通过 | |
|
||||
| 3 | Ubuntu22.04 | 2.35 | GNU GCC 11.2.0 | Qt5.14.2 | 通过 | deb成功打包 |
|
||||
| 4 | CentOS 7.0.1406 | 2.17 | GNU GCC 8.3.1 | Qt5.14.2 | 通过 | 借助devtoolset-8升级GCC |
|
||||
| 5 | CentOS 7.9.2009 | 2.17 | GNU GCC 7.5.0 | Qt5.14.2 | 通过 | |
|
||||
| 6 | CentOS 8.5.2111 | 2.28 | GNU GCC 8.5.0 | Qt5.14.2 | 通过 | rpm成功打包 |
|
||||
| 7 | RedHat Server 7.0 | | | | | 待测试 |
|
||||
| 8 | RedHat 8.1 | 2.28 | GNU GCC 8.5.0 | Qt5.14.2 | 通过 | |
|
||||
| 9 | RedHat 9.0 | | | | | 待测试 |
|
||||
| 10 | Windows7 X64 | 无 | Visual Studio 2017 Community | Qt5.14.2 | 通过 | VS附带安装Windows 8.1SDK |
|
||||
| 11 | Windows10 X64 | 无 | Visual Studio 2017 Community | Qt5.14.2 | 通过 | SDK 10.0.17763.0,NSIS成功打包 |
|
||||
| 12 | deepin 20.7社区版 | | | | | 待测试 |
|
||||
| 13 | ubuntukylin 22.04 | 2.35 | GNU GCC 11.2.0 | Qt5.14.2 | 通过 | 基于Ubuntu22.04 |
|
||||
|
||||
|
||||
## 相关链接
|
||||
|
||||
- 帮助文档:http://www.fastcae.com/index.php?mod=document
|
||||
- 社区论坛:http://disc.fastcae.com/
|
||||
|
||||
|
||||
## 感谢开源贡献者
|
||||
|
||||
- 陈宗衍 czy.t@163.com(Ribbon风格组件)
|
||||
- 张立春 zhang.lichun@foxmail.com(远程任务提交插件)
|
||||
- 赵德祥 zhao.dexiang@foxmail.com(远程任务提交插件)
|
||||
- 万义钊 wanyizhao@mail.cgs.gov.cn (Tecplot后处理文件格式szplt解析)
|
||||
|
||||
|
||||
## 使用交流
|
||||
|
||||
技术交流QQ群:671925863
|
||||
|
||||
官方微信号:FastCAE-DISO
|
|
@ -0,0 +1,93 @@
|
|||
# 声明包的名称
|
||||
set(CPACK_PACKAGE_NAME "${PROJECT_NAME}")
|
||||
# 声明包的供应商
|
||||
set(CPACK_PACKAGE_VENDOR "青岛数智船海科技有限公司")
|
||||
# 打包的源代码将包括一个描述文件。这是带有安装说明的纯文本文件
|
||||
set(CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/README.md")
|
||||
# 添加包的描述
|
||||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PROJCT_DESCRIPTION}")
|
||||
# 许可证文件
|
||||
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
|
||||
# site
|
||||
set(CPACK_SITE "${PROJECT_HOMEPAGE_URL}")
|
||||
# 从发布包中安装时,文件将放在/opt/${PROJECT_NAME}目录下
|
||||
#[[if(FASTCAE_WIN)
|
||||
set(CPACK_PACKAGING_INSTALL_PREFIX "C:\\Program Files\\${PROJECT_NAME}")
|
||||
else()
|
||||
set(CPACK_PACKAGING_INSTALL_PREFIX "/opt/${PROJECT_NAME}")
|
||||
endif()]]
|
||||
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME}")
|
||||
# CPack所需的主要、次要和补丁版本:
|
||||
set(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}")
|
||||
set(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}")
|
||||
set(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}")
|
||||
# 设置了在包装的时候需要忽略的文件列表和目录
|
||||
set(CPACK_SOURCE_IGNORE_FILES "${PROJECT_BINARY_DIR};/install/;/.git/;/.vscode/;.gitignore")
|
||||
# 列出了源代码归档的打包生成器
|
||||
set(CPACK_SOURCE_GENERATOR "ZIP;TGZ")
|
||||
# 二进制存档生成器
|
||||
set(CPACK_GENERATOR "ZIP;TGZ")
|
||||
# 声明平台原生二进制安装程序,从DEB和RPM包生成器开始,不过只适用于GNU/Linux
|
||||
if(UNIX)
|
||||
if(CMAKE_SYSTEM_NAME MATCHES Linux)
|
||||
find_program(_deb dpkg-deb)
|
||||
string(FIND ${_deb} "dpkg-deb" _result)
|
||||
if(NOT _result STREQUAL "-1")
|
||||
list(APPEND CPACK_GENERATOR "DEB")
|
||||
set(CPACK_DEBIAN_PACKAGE_NAME ${CPACK_PACKAGE_NAME})
|
||||
set(CPACK_DEBIAN_PACKAGE_VERSION ${PROJECT_VERSION})
|
||||
set(CPACK_DEBIAN_PACKAGE_MAINTAINER ${CPACK_PACKAGE_VENDOR})
|
||||
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE ${CPACK_SITE})
|
||||
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
|
||||
set(CPACK_DEBIAN_PACKAGE_RELEASE "1")
|
||||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libfontconfig-dev")
|
||||
endif()
|
||||
find_program(_rpm rpmbuild)
|
||||
string(FIND ${_rpm} "rpmbuild" _result)
|
||||
if(NOT _result STREQUAL "-1")
|
||||
list(APPEND CPACK_GENERATOR "RPM")
|
||||
set(CPACK_RPM_PACKAGE_SUMMARY ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
|
||||
set(CPACK_RPM_PACKAGE_NAME ${CPACK_PACKAGE_NAME})
|
||||
set(CPACK_RPM_PACKAGE_VERSION ${PROJECT_VERSION})
|
||||
set(CPACK_RPM_PACKAGE_VENDOR ${CPACK_PACKAGE_VENDOR})
|
||||
set(CPACK_RPM_PACKAGE_URL ${CPACK_SITE})
|
||||
set(CPACK_RPM_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
|
||||
set(CPACK_RPM_PACKAGE_RELEASE "1")
|
||||
set(CPACK_RPM_PACKAGE_LICENSE "BSD 3-Clause")
|
||||
set(CPACK_RPM_PACKAGE_REQUIRES "fontconfig-devel")
|
||||
set(CPACK_RPM_PACKAGE_AUTOREQ NO)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
# 在windows上生成一个NSIS安装程序
|
||||
# NSIS相关的变量https://cmake.org/cmake/help/latest/cpack_gen/nsis.html#cpack_gen:CPack%20NSIS%20Generator
|
||||
if(WIN32 OR MINGW)
|
||||
if (NSIS_EXECUTABLE)
|
||||
list(APPEND CPACK_GENERATOR "NSIS")
|
||||
#set(CPACK_NSIS_PACKAGE_NAME "${PROJECT_NAME}")
|
||||
#set(CPACK_NSIS_INSTALL_ROOT "C:\\Program Files")
|
||||
set(CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}/src/qrc/QUI/main.ico")
|
||||
set(CPACK_NSIS_MUI_UNIICON "${CMAKE_SOURCE_DIR}/src/qrc/QUI/uninstall.ico")
|
||||
#set(CPACK_NSIS_MUI_WELCOMEFINISHPAGE_BITMAP "${CMAKE_SOURCE_DIR}/src/qrc/QUI/WELCOMEFINISHPAGE.bmp")
|
||||
#set(CPACK_NSIS_MUI_UNWELCOMEFINISHPAGE_BITMAP "${CMAKE_SOURCE_DIR}/src/qrc/QUI/UNWELCOMEFINISHPAGE.bmp")
|
||||
#set(CPACK_NSIS_MUI_HEADERIMAGE "${CMAKE_SOURCE_DIR}/src/qrc/QUI/HEADERIMAGE.bmp")
|
||||
set(CPACK_NSIS_MODIFY_PATH ON)
|
||||
set(CPACK_NSIS_MUI_FINISHPAGE_RUN ON)
|
||||
set(CPACK_NSIS_HELP_LINK "http://www.fastcae.com/index.php?mod=document")
|
||||
set(CPACK_NSIS_URL_INFO_ABOUT "http://www.fastcae.com/index.php?mod=product")
|
||||
set(CPACK_NSIS_MENU_LINKS
|
||||
"http://www.fastcae.com/index.php?mod=document" "FastCAE文档"
|
||||
"http://www.fastcae.com/index.php?mod=product" "FastCAE介绍"
|
||||
"CMake Help" "http://www.fastcae.com/" "FastCAE网站"
|
||||
)
|
||||
set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
|
||||
elseif(WIX_EXECUTABLE)
|
||||
list(APPEND CPACK_GENERATOR "WIX")
|
||||
set(CPACK_WIX_PROPERTY_ARPCOMMENTS ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
|
||||
set(CPACK_WIX_PROPERTY_ARPURLINFOABOUT "http://www.fastcae.com/index.php?mod=product")
|
||||
set(CPACK_WIX_PROPERTY_ARPHELPLINK "http://www.fastcae.com/")
|
||||
endif ()
|
||||
endif()
|
||||
|
||||
# 向用户打印一条信息
|
||||
message(STATUS "CPack generators: ${CPACK_GENERATOR}")
|
|
@ -0,0 +1,81 @@
|
|||
# Deployqt
|
||||
# --------
|
||||
#
|
||||
# Define a function which can find the Qt dependent library and copy them to the bin directory
|
||||
#
|
||||
# Usage
|
||||
# ^^^^^^^^^^^^^^^^
|
||||
#
|
||||
# deployqt(target dir)
|
||||
#
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 获取windeployqt程序路径WINDEPLOYQT_EXECUTABLE
|
||||
#-----------------------------------------------------------------------------
|
||||
if(NOT WINDEPLOYQT_EXECUTABLE)
|
||||
get_target_property(_qmake_executable Qt5::qmake IMPORTED_LOCATION)
|
||||
get_filename_component(_qt_bin_dir "${_qmake_executable}" DIRECTORY)
|
||||
find_program(WINDEPLOYQT_EXECUTABLE windeployqt HINTS "${_qt_bin_dir}")
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 函数定义deployqt(target dir)
|
||||
#-----------------------------------------------------------------------------
|
||||
function(deployqt target directory)
|
||||
# 在构建完执行命令,拷贝文件到构建目录
|
||||
add_custom_command(TARGET ${target} POST_BUILD
|
||||
COMMAND "${CMAKE_COMMAND}" -E
|
||||
env PATH="${_qt_bin_dir}" "${WINDEPLOYQT_EXECUTABLE}"
|
||||
--verbose 0
|
||||
--no-compiler-runtime
|
||||
--release
|
||||
\"$<TARGET_FILE:${target}>\"
|
||||
)
|
||||
|
||||
# 生成路径保存到文件
|
||||
file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${target}_$<CONFIG>_path"
|
||||
CONTENT "$<TARGET_FILE:${target}>"
|
||||
)
|
||||
|
||||
install(CODE
|
||||
"
|
||||
file(READ \"${CMAKE_CURRENT_BINARY_DIR}/${target}_${CMAKE_BUILD_TYPE}_path\" _file)
|
||||
execute_process(
|
||||
COMMAND \"${CMAKE_COMMAND}\" -E
|
||||
env PATH=\"${_qt_bin_dir}\" \"${WINDEPLOYQT_EXECUTABLE}\"
|
||||
--dry-run
|
||||
--no-compiler-runtime
|
||||
--release
|
||||
--list mapping
|
||||
\${_file}
|
||||
OUTPUT_VARIABLE _output
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
separate_arguments(_files WINDOWS_COMMAND \${_output})
|
||||
while(_files)
|
||||
list(GET _files 0 _src)
|
||||
list(GET _files 1 _dest)
|
||||
execute_process(
|
||||
COMMAND \"${CMAKE_COMMAND}\" -E
|
||||
copy \${_src} \"\${CMAKE_INSTALL_PREFIX}/${directory}/\${_dest}\"
|
||||
)
|
||||
list(REMOVE_AT _files 0 1)
|
||||
endwhile()
|
||||
"
|
||||
)
|
||||
|
||||
# windeployqt doesn't work correctly with the system runtime libraries,
|
||||
# so we fall back to one of CMake's own modules for copying them over
|
||||
set(CMAKE_INSTALL_UCRT_LIBRARIES TRUE)
|
||||
include(InstallRequiredSystemLibraries)
|
||||
foreach(lib ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS})
|
||||
get_filename_component(filename "${lib}" NAME)
|
||||
add_custom_command(TARGET ${target} POST_BUILD
|
||||
COMMAND "${CMAKE_COMMAND}" -E
|
||||
copy_if_different "${lib}" \"$<TARGET_FILE_DIR:${target}>\"
|
||||
)
|
||||
endforeach()
|
||||
|
||||
endfunction()
|
||||
|
||||
mark_as_advanced(WINDEPLOYQT_EXECUTABLE)
|
|
@ -0,0 +1,99 @@
|
|||
# FindCGNS
|
||||
# --------
|
||||
#
|
||||
# Find the CGNS libraries(Only for CGNS provided by FastCAE)
|
||||
#
|
||||
# Result Variables
|
||||
# ^^^^^^^^^^^^^^^^
|
||||
#
|
||||
# The following variables will be defined:
|
||||
#
|
||||
# ``CGNS_FOUND`` True if CGNS found on the local system
|
||||
#
|
||||
# ``CGNS_VERSION`` CGNS Version(x.x.x)
|
||||
#
|
||||
# ``CGNS_VERSION_MAJOR`` CGNS Major Version
|
||||
#
|
||||
# ``CGNS_VERSION_MINOR`` CGNS Minor Version
|
||||
#
|
||||
# ``CGNS_VERSION_PATCH`` CGNS Patch Version
|
||||
#
|
||||
# ``CGNS_DIRS`` Location of CGNS(root dir)
|
||||
#
|
||||
# ``CGNS_INCLUDE_DIRS`` Location of CGNS header files
|
||||
#
|
||||
# ``CGNS_LIBRARY_DIRS`` Location of CGNS libraries
|
||||
#
|
||||
# ``CGNS_LIBRARIES`` List of the CGNS libraries found
|
||||
#
|
||||
|
||||
# 防止重复引入
|
||||
if(FASTCAE_CGNS_ALREADY_INCLUDED)
|
||||
return()
|
||||
endif()
|
||||
set(FASTCAE_CGNS_ALREADY_INCLUDED 1)
|
||||
|
||||
# find_path 搜索包含某个文件的路径
|
||||
# 如果在某个路径下发现了该文件,该结果会被存储到该变量中;如果没有找到,存储的结果将会是<VAR>-NOTFOUND
|
||||
find_path(CGNS_DIRS
|
||||
NAMES
|
||||
include/cgnslib.h
|
||||
PATHS
|
||||
${CMAKE_SOURCE_DIR}/extlib/CGNS
|
||||
NO_SYSTEM_ENVIRONMENT_PATH
|
||||
NO_CMAKE_SYSTEM_PATH
|
||||
)
|
||||
|
||||
set(CGNS_VERSION_MAJOR 4)
|
||||
set(CGNS_VERSION_MINOR 3)
|
||||
set(CGNS_VERSION_PATCH 0)
|
||||
|
||||
set(CGNS_VERSION "${CGNS_VERSION_MAJOR}.${CGNS_VERSION_MINOR}.${CGNS_VERSION_PATCH}")
|
||||
|
||||
find_path(CGNS_INCLUDE_DIRS
|
||||
NAMES
|
||||
cgnslib.h
|
||||
HINTS
|
||||
${CGNS_DIRS}/include
|
||||
)
|
||||
|
||||
find_path(CGNS_LIBRARY_DIRS
|
||||
NAMES
|
||||
cgnsdll.lib libcgns.so
|
||||
HINTS
|
||||
${CGNS_DIRS}/lib
|
||||
)
|
||||
|
||||
set(CGNS_LIBRARIES FASTCAE::CGNS)
|
||||
|
||||
add_library(FASTCAE::CGNS SHARED IMPORTED)
|
||||
set_property(TARGET FASTCAE::CGNS PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${CGNS_INCLUDE_DIRS})
|
||||
set_property(TARGET FASTCAE::CGNS APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
||||
set_property(TARGET FASTCAE::CGNS PROPERTY INTERFACE_LINK_LIBRARIES FASTCAE::HDF5)
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
set_target_properties(FASTCAE::CGNS PROPERTIES
|
||||
IMPORTED_LOCATION_RELEASE "${CGNS_LIBRARY_DIRS}/libcgns.so.${CGNS_VERSION_MAJOR}.${CGNS_VERSION_MINOR}"
|
||||
IMPORTED_SONAME_RELEASE "libcgns.so"
|
||||
)
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||
set_target_properties(FASTCAE::CGNS PROPERTIES
|
||||
IMPORTED_IMPLIB_RELEASE "${CGNS_LIBRARY_DIRS}/cgnsdll.lib"
|
||||
IMPORTED_LOCATION_RELEASE "${CGNS_DIRS}/bin/cgnsdll.dll"
|
||||
)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
# 如果找到所有需要的变量,并且版本匹配,则将CGNS_FOUND变量设置为TRUE
|
||||
find_package_handle_standard_args(CGNS
|
||||
FOUND_VAR
|
||||
CGNS_FOUND
|
||||
REQUIRED_VARS
|
||||
CGNS_DIRS
|
||||
CGNS_INCLUDE_DIRS
|
||||
CGNS_LIBRARY_DIRS
|
||||
CGNS_LIBRARIES
|
||||
VERSION_VAR
|
||||
CGNS_VERSION
|
||||
)
|
|
@ -0,0 +1,66 @@
|
|||
# FindGmsh
|
||||
# --------
|
||||
#
|
||||
# Find the Gmsh exe (Only for Gmsh provided by FastCAE)
|
||||
#
|
||||
# Result Variables
|
||||
# ^^^^^^^^^^^^^^^^
|
||||
#
|
||||
# The following variables will be defined:
|
||||
#
|
||||
# ``Gmsh_FOUND`` True if Gmsh found on the local system
|
||||
#
|
||||
# ``Gmsh_VERSION`` Gmsh Version(x.x.x)
|
||||
#
|
||||
# ``Gmsh_VERSION_MAJOR`` Gmsh Major Version
|
||||
#
|
||||
# ``Gmsh_VERSION_MINOR`` Gmsh Minor Version
|
||||
#
|
||||
# ``Gmsh_VERSION_PATCH`` Gmsh Patch Version
|
||||
#
|
||||
# ``Gmsh_DIRS`` Location of Gmsh(root dir)
|
||||
#
|
||||
# ``Gmsh_EXECUTABLE`` Location of Gmsh program
|
||||
#
|
||||
|
||||
# 防止重复引入
|
||||
if(Gmsh_ALREADY_INCLUDED)
|
||||
return()
|
||||
endif()
|
||||
set(Gmsh_ALREADY_INCLUDED 1)
|
||||
|
||||
# find_path 搜索包含某个文件的路径
|
||||
# 如果在某个路径下发现了该文件,该结果会被存储到该变量中;如果没有找到,存储的结果将会是<VAR>-NOTFOUND
|
||||
find_path(Gmsh_DIRS
|
||||
NAMES
|
||||
gmsh.exe gmsh
|
||||
PATHS
|
||||
${CMAKE_SOURCE_DIR}/extlib/Gmsh
|
||||
NO_SYSTEM_ENVIRONMENT_PATH
|
||||
NO_CMAKE_SYSTEM_PATH
|
||||
)
|
||||
|
||||
set(Gmsh_VERSION_MAJOR 4)
|
||||
set(Gmsh_VERSION_MINOR 8)
|
||||
set(Gmsh_VERSION_PATCH 0)
|
||||
|
||||
set(Gmsh_VERSION "${Gmsh_VERSION_MAJOR}.${Gmsh_VERSION_MINOR}.${Gmsh_VERSION_PATCH}")
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||
set(Gmsh_EXECUTABLE "${Gmsh_DIRS}/gmsh.exe")
|
||||
else()
|
||||
set(Gmsh_EXECUTABLE "${Gmsh_DIRS}/gmsh")
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
# 如果找到所有需要的变量,并且版本匹配,则将Gmsh_FOUND变量设置为TRUE
|
||||
find_package_handle_standard_args(Gmsh
|
||||
FOUND_VAR
|
||||
Gmsh_FOUND
|
||||
REQUIRED_VARS
|
||||
Gmsh_DIRS
|
||||
Gmsh_EXECUTABLE
|
||||
VERSION_VAR
|
||||
Gmsh_VERSION
|
||||
)
|
|
@ -0,0 +1,151 @@
|
|||
# FindHDF5
|
||||
# --------
|
||||
#
|
||||
# Find the HDF5 libraries(Only for HDF5 provided by FastCAE)
|
||||
#
|
||||
# Result Variables
|
||||
# ^^^^^^^^^^^^^^^^
|
||||
#
|
||||
# The following variables will be defined:
|
||||
#
|
||||
# ``HDF5_FOUND`` True if HDF5 found on the local system
|
||||
#
|
||||
# ``HDF5_VERSION`` HDF5 Version(x.x.x)
|
||||
#
|
||||
# ``HDF5_VERSION_MAJOR`` HDF5 Major Version
|
||||
#
|
||||
# ``HDF5_VERSION_MINOR`` HDF5 Minor Version
|
||||
#
|
||||
# ``HDF5_VERSION_PATCH`` HDF5 Patch Version
|
||||
#
|
||||
# ``HDF5_DIRS`` Location of HDF5(root dir)
|
||||
#
|
||||
# ``HDF5_INCLUDE_DIRS`` Location of HDF5 header files
|
||||
#
|
||||
# ``HDF5_LIBRARY_DIRS`` Location of HDF5 libraries
|
||||
#
|
||||
# ``HDF5_LIBRARIES`` List of the HDF5 libraries found
|
||||
#
|
||||
|
||||
# 防止重复引入
|
||||
if(FASTCAE_HDF5_ALREADY_INCLUDED)
|
||||
return()
|
||||
endif()
|
||||
set(FASTCAE_HDF5_ALREADY_INCLUDED 1)
|
||||
|
||||
# find_path 搜索包含某个文件的路径
|
||||
# 如果在某个路径下发现了该文件,该结果会被存储到该变量中;如果没有找到,存储的结果将会是<VAR>-NOTFOUND
|
||||
find_path(HDF5_DIRS
|
||||
NAMES
|
||||
include/hdf5.h
|
||||
PATHS
|
||||
${CMAKE_SOURCE_DIR}/extlib/HDF5
|
||||
NO_SYSTEM_ENVIRONMENT_PATH
|
||||
NO_CMAKE_SYSTEM_PATH
|
||||
)
|
||||
|
||||
set(HDF5_VERSION_MAJOR 1)
|
||||
set(HDF5_VERSION_MINOR 13)
|
||||
set(HDF5_VERSION_PATCH 1)
|
||||
|
||||
set(HDF5_VERSION "${HDF5_VERSION_MAJOR}.${HDF5_VERSION_MINOR}.${HDF5_VERSION_PATCH}")
|
||||
|
||||
find_path(HDF5_INCLUDE_DIRS
|
||||
NAMES
|
||||
hdf5.h
|
||||
HINTS
|
||||
${HDF5_DIRS}/include
|
||||
)
|
||||
|
||||
find_path(HDF5_LIBRARY_DIRS
|
||||
NAMES
|
||||
hdf5.lib libhdf5.so
|
||||
HINTS
|
||||
${HDF5_DIRS}/lib
|
||||
)
|
||||
|
||||
set(HDF5_LIBRARIES FASTCAE::HDF5;FASTCAE::HDF5CPP;FASTCAE::HDF5HL;FASTCAE::HDF5HLCPP;FASTCAE::HDF5TOOLS)
|
||||
|
||||
add_library(FASTCAE::HDF5 SHARED IMPORTED)
|
||||
add_library(FASTCAE::HDF5CPP SHARED IMPORTED)
|
||||
add_library(FASTCAE::HDF5HL SHARED IMPORTED)
|
||||
add_library(FASTCAE::HDF5HLCPP SHARED IMPORTED)
|
||||
add_library(FASTCAE::HDF5TOOLS SHARED IMPORTED)
|
||||
|
||||
set_property(TARGET FASTCAE::HDF5 PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${HDF5_INCLUDE_DIRS})
|
||||
set_property(TARGET FASTCAE::HDF5 APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
||||
|
||||
set_property(TARGET FASTCAE::HDF5CPP PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${HDF5_INCLUDE_DIRS})
|
||||
set_property(TARGET FASTCAE::HDF5CPP APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
||||
set_property(TARGET FASTCAE::HDF5CPP PROPERTY INTERFACE_LINK_LIBRARIES FASTCAE::HDF5)
|
||||
|
||||
set_property(TARGET FASTCAE::HDF5HL PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${HDF5_INCLUDE_DIRS})
|
||||
set_property(TARGET FASTCAE::HDF5HL APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
||||
set_property(TARGET FASTCAE::HDF5HL PROPERTY INTERFACE_LINK_LIBRARIES FASTCAE::HDF5)
|
||||
|
||||
set_property(TARGET FASTCAE::HDF5HLCPP PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${HDF5_INCLUDE_DIRS})
|
||||
set_property(TARGET FASTCAE::HDF5HLCPP APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
||||
set_property(TARGET FASTCAE::HDF5HLCPP PROPERTY INTERFACE_LINK_LIBRARIES FASTCAE::HDF5HL)
|
||||
|
||||
set_property(TARGET FASTCAE::HDF5TOOLS PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${HDF5_INCLUDE_DIRS})
|
||||
set_property(TARGET FASTCAE::HDF5TOOLS APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
||||
set_property(TARGET FASTCAE::HDF5TOOLS PROPERTY INTERFACE_LINK_LIBRARIES FASTCAE::HDF5)
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
set_target_properties(FASTCAE::HDF5 PROPERTIES
|
||||
IMPORTED_LOCATION_RELEASE "${HDF5_LIBRARY_DIRS}/libhdf5.so.300.1.0"
|
||||
IMPORTED_SONAME_RELEASE "libhdf5.so.300"
|
||||
)
|
||||
set_target_properties(FASTCAE::HDF5CPP PROPERTIES
|
||||
IMPORTED_LOCATION_RELEASE "${HDF5_LIBRARY_DIRS}/libhdf5_cpp.so.300.0.1"
|
||||
IMPORTED_SONAME_RELEASE "libhdf5_cpp.so.300"
|
||||
)
|
||||
set_target_properties(FASTCAE::HDF5HL PROPERTIES
|
||||
IMPORTED_LOCATION_RELEASE "${HDF5_LIBRARY_DIRS}/libhdf5_hl.so.300.0.1"
|
||||
IMPORTED_SONAME_RELEASE "libhdf5_hl.so.300"
|
||||
)
|
||||
set_target_properties(FASTCAE::HDF5HLCPP PROPERTIES
|
||||
IMPORTED_LOCATION_RELEASE "${HDF5_LIBRARY_DIRS}/libhdf5_hl_cpp.so.300.0.1"
|
||||
IMPORTED_SONAME_RELEASE "libhdf5_hl_cpp.so.300"
|
||||
)
|
||||
set_target_properties(FASTCAE::HDF5TOOLS PROPERTIES
|
||||
IMPORTED_LOCATION_RELEASE "${HDF5_LIBRARY_DIRS}/libhdf5_tools.so.300.0.1"
|
||||
IMPORTED_SONAME_RELEASE "libhdf5_tools.so.300"
|
||||
)
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||
set_target_properties(FASTCAE::HDF5 PROPERTIES
|
||||
IMPORTED_IMPLIB_RELEASE "${HDF5_LIBRARY_DIRS}/hdf5.lib"
|
||||
IMPORTED_LOCATION_RELEASE "${HDF5_DIRS}/bin/hdf5.dll"
|
||||
)
|
||||
set_target_properties(FASTCAE::HDF5CPP PROPERTIES
|
||||
IMPORTED_IMPLIB_RELEASE "${HDF5_LIBRARY_DIRS}/hdf5_cpp.lib"
|
||||
IMPORTED_LOCATION_RELEASE "${HDF5_DIRS}/bin/hdf5_cpp.dll"
|
||||
)
|
||||
set_target_properties(FASTCAE::HDF5HL PROPERTIES
|
||||
IMPORTED_IMPLIB_RELEASE "${HDF5_LIBRARY_DIRS}/hdf5_hl.lib"
|
||||
IMPORTED_LOCATION_RELEASE "${HDF5_DIRS}/bin/hdf5_hl.dll"
|
||||
)
|
||||
set_target_properties(FASTCAE::HDF5HLCPP PROPERTIES
|
||||
IMPORTED_IMPLIB_RELEASE "${HDF5_LIBRARY_DIRS}/hdf5_hl_cpp.lib"
|
||||
IMPORTED_LOCATION_RELEASE "${HDF5_DIRS}/bin/hdf5_hl_cpp.dll"
|
||||
)
|
||||
set_target_properties(FASTCAE::HDF5TOOLS PROPERTIES
|
||||
IMPORTED_IMPLIB_RELEASE "${HDF5_LIBRARY_DIRS}/hdf5_tools.lib"
|
||||
IMPORTED_LOCATION_RELEASE "${HDF5_DIRS}/bin/hdf5_tools.dll"
|
||||
)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
# 如果找到所有需要的变量,并且版本匹配,则将HDF5_FOUND变量设置为TRUE
|
||||
find_package_handle_standard_args(HDF5
|
||||
FOUND_VAR
|
||||
HDF5_FOUND
|
||||
REQUIRED_VARS
|
||||
HDF5_DIRS
|
||||
HDF5_INCLUDE_DIRS
|
||||
HDF5_LIBRARY_DIRS
|
||||
HDF5_LIBRARIES
|
||||
VERSION_VAR
|
||||
HDF5_VERSION
|
||||
)
|
|
@ -0,0 +1,214 @@
|
|||
# FindOpenCASCADE
|
||||
# --------
|
||||
#
|
||||
# Find the OpenCASCADE libraries(Only for OpenCASCADE provided by FastCAE)
|
||||
#
|
||||
# Result Variables
|
||||
# ^^^^^^^^^^^^^^^^
|
||||
#
|
||||
# The following variables will be defined:
|
||||
#
|
||||
# ``OpenCASCADE_FOUND`` True if OpenCASCADE found on the local system
|
||||
#
|
||||
# ``OpenCASCADE_VERSION`` OpenCASCADE Version(x.x.x)
|
||||
#
|
||||
# ``OpenCASCADE_VERSION_MAJOR`` OpenCASCADE Major Version
|
||||
#
|
||||
# ``OpenCASCADE_VERSION_MINOR`` OpenCASCADE Minor Version
|
||||
#
|
||||
# ``OpenCASCADE_VERSION_PATCH`` OpenCASCADE Patch Version
|
||||
#
|
||||
# ``OpenCASCADE_DIRS`` Location of OpenCASCADE(root dir)
|
||||
#
|
||||
# ``OpenCASCADE_INCLUDE_DIRS`` Location of OpenCASCADE header files
|
||||
#
|
||||
# ``OpenCASCADE_LIBRARY_DIRS`` Location of OpenCASCADE libraries
|
||||
#
|
||||
# ``OpenCASCADE_LIBRARIES`` List of the OpenCASCADE libraries found
|
||||
#
|
||||
# ``OpenCASCADE_BINARY_DIRS`` Location of OpenCASCADE binary
|
||||
#
|
||||
|
||||
# 防止重复引入
|
||||
if(FASTCAE_OpenCASCADE_ALREADY_INCLUDED)
|
||||
return()
|
||||
endif()
|
||||
set(FASTCAE_OpenCASCADE_ALREADY_INCLUDED 1)
|
||||
|
||||
set(OpenCASCADE_DIRS "${CMAKE_SOURCE_DIR}/extlib/OpenCASCADE")
|
||||
|
||||
set(OpenCASCADE_VERSION_MAJOR 7)
|
||||
set(OpenCASCADE_VERSION_MINOR 6)
|
||||
set(OpenCASCADE_VERSION_PATCH 0)
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||
set(OpenCASCADE_INCLUDE_DIRS "${OpenCASCADE_DIRS}/inc")
|
||||
set(OpenCASCADE_LIBRARY_DIRS "${OpenCASCADE_DIRS}/win64/vc14/lib")
|
||||
set(OpenCASCADE_BINARY_DIRS "${OpenCASCADE_DIRS}/win64/vc14/bin")
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
set(OpenCASCADE_INCLUDE_DIRS "${OpenCASCADE_DIRS}/include/opencascade")
|
||||
set(OpenCASCADE_LIBRARY_DIRS "${OpenCASCADE_DIRS}/lib")
|
||||
set(OpenCASCADE_BINARY_DIRS "${OpenCASCADE_DIRS}/bin")
|
||||
endif()
|
||||
|
||||
set(OpenCASCADE_VERSION "${OpenCASCADE_VERSION_MAJOR}.${OpenCASCADE_VERSION_MINOR}.${OpenCASCADE_VERSION_PATCH}")
|
||||
|
||||
macro(_populate_target_properties _target)
|
||||
add_library(${_target} SHARED IMPORTED)
|
||||
set_property(TARGET ${_target} PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${OpenCASCADE_INCLUDE_DIRS})
|
||||
set_property(TARGET ${_target} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
||||
if(ARGC GREATER 1)
|
||||
set_property(TARGET ${_target} PROPERTY INTERFACE_LINK_LIBRARIES ARGN)
|
||||
endif()
|
||||
string(SUBSTRING ${_target} 13 -1 _target_name)
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
set_target_properties(${_target} PROPERTIES
|
||||
IMPORTED_LOCATION_RELEASE "${OpenCASCADE_LIBRARY_DIRS}/lib${_target_name}.so.${OpenCASCADE_VERSION_MAJOR}.${OpenCASCADE_VERSION_MINOR}.${OpenCASCADE_VERSION_PATCH}"
|
||||
IMPORTED_SONAME_RELEASE "lib${_target_name}.so.${OpenCASCADE_VERSION_MAJOR}"
|
||||
)
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||
set_property(TARGET ${_target} APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
|
||||
set_target_properties(${_target} PROPERTIES
|
||||
IMPORTED_IMPLIB_RELEASE "${OpenCASCADE_LIBRARY_DIRS}/${_target_name}.lib"
|
||||
IMPORTED_LOCATION_RELEASE "${OpenCASCADE_BINARY_DIRS}/${_target_name}.dll"
|
||||
IMPORTED_IMPLIB_DEBUG "${OpenCASCADE_LIBRARY_DIRS}d/${_target_name}.lib"
|
||||
IMPORTED_LOCATION_DEBUG "${OpenCASCADE_BINARY_DIRS}d/${_target_name}.dll"
|
||||
)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
add_library(OpenCASCADE::Freetype SHARED IMPORTED)
|
||||
add_library(OpenCASCADE::Tcl86 SHARED IMPORTED)
|
||||
add_library(OpenCASCADE::Tk86 SHARED IMPORTED)
|
||||
set_property(TARGET OpenCASCADE::Freetype APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
||||
set_property(TARGET OpenCASCADE::Tcl86 APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
||||
set_property(TARGET OpenCASCADE::Tk86 APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
set_target_properties(OpenCASCADE::Freetype PROPERTIES
|
||||
IMPORTED_LOCATION_RELEASE "${OpenCASCADE_LIBRARY_DIRS}/libfreetype.so.6"
|
||||
)
|
||||
set_target_properties(OpenCASCADE::Tcl86 PROPERTIES
|
||||
IMPORTED_LOCATION_RELEASE "${OpenCASCADE_LIBRARY_DIRS}/libtcl8.6.so"
|
||||
)
|
||||
set_target_properties(OpenCASCADE::Tk86 PROPERTIES
|
||||
IMPORTED_LOCATION_RELEASE "${OpenCASCADE_LIBRARY_DIRS}/libtk8.6.so"
|
||||
)
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||
set_property(TARGET OpenCASCADE::Freetype APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
|
||||
set_property(TARGET OpenCASCADE::Tcl86 APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
|
||||
set_property(TARGET OpenCASCADE::Tk86 APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
|
||||
set_target_properties(OpenCASCADE::Freetype PROPERTIES
|
||||
IMPORTED_IMPLIB_RELEASE "${OpenCASCADE_LIBRARY_DIRS}/freetype.lib"
|
||||
IMPORTED_LOCATION_RELEASE "${OpenCASCADE_BINARY_DIRS}/freetype.dll"
|
||||
IMPORTED_IMPLIB_DEBUG "${OpenCASCADE_LIBRARY_DIRS}d/freetype.lib"
|
||||
IMPORTED_LOCATION_DEBUG "${OpenCASCADE_BINARY_DIRS}d/freetype.dll"
|
||||
)
|
||||
set_target_properties(OpenCASCADE::Tcl86 PROPERTIES
|
||||
IMPORTED_IMPLIB_RELEASE "${OpenCASCADE_LIBRARY_DIRS}/tcl86.lib"
|
||||
IMPORTED_LOCATION_RELEASE "${OpenCASCADE_BINARY_DIRS}/tcl86.dll"
|
||||
IMPORTED_IMPLIB_DEBUG "${OpenCASCADE_LIBRARY_DIRS}d/tcl86.lib"
|
||||
IMPORTED_LOCATION_DEBUG "${OpenCASCADE_BINARY_DIRS}d/tcl86.dll"
|
||||
)
|
||||
set_target_properties(OpenCASCADE::Tk86 PROPERTIES
|
||||
IMPORTED_IMPLIB_RELEASE "${OpenCASCADE_LIBRARY_DIRS}/tk86.lib"
|
||||
IMPORTED_LOCATION_RELEASE "${OpenCASCADE_BINARY_DIRS}/tk86.dll"
|
||||
IMPORTED_IMPLIB_DEBUG "${OpenCASCADE_LIBRARY_DIRS}d/tk86.lib"
|
||||
IMPORTED_LOCATION_DEBUG "${OpenCASCADE_BINARY_DIRS}d/tk86.dll"
|
||||
)
|
||||
endif()
|
||||
|
||||
# List of available OpenCASCADE libraries for each module
|
||||
set (OpenCASCADE_FoundationClasses_LIBRARIES OpenCASCADE::TKernel OpenCASCADE::TKMath)
|
||||
set (OpenCASCADE_ModelingData_LIBRARIES OpenCASCADE::TKG2d OpenCASCADE::TKG3d OpenCASCADE::TKGeomBase OpenCASCADE::TKBRep)
|
||||
set (OpenCASCADE_ModelingAlgorithms_LIBRARIES OpenCASCADE::TKGeomAlgo OpenCASCADE::TKTopAlgo OpenCASCADE::TKPrim OpenCASCADE::TKBO OpenCASCADE::TKShHealing OpenCASCADE::TKBool OpenCASCADE::TKHLR OpenCASCADE::TKFillet OpenCASCADE::TKOffset OpenCASCADE::TKFeat OpenCASCADE::TKMesh OpenCASCADE::TKXMesh)
|
||||
set (OpenCASCADE_Visualization_LIBRARIES OpenCASCADE::TKService OpenCASCADE::TKV3d OpenCASCADE::TKOpenGl OpenCASCADE::TKMeshVS OpenCASCADE::TKIVtk)
|
||||
set (OpenCASCADE_ApplicationFramework_LIBRARIES OpenCASCADE::TKCDF OpenCASCADE::TKLCAF OpenCASCADE::TKCAF OpenCASCADE::TKBinL OpenCASCADE::TKXmlL OpenCASCADE::TKBin OpenCASCADE::TKXml OpenCASCADE::TKStdL OpenCASCADE::TKStd OpenCASCADE::TKTObj OpenCASCADE::TKBinTObj OpenCASCADE::TKXmlTObj OpenCASCADE::TKVCAF)
|
||||
set (OpenCASCADE_DataExchange_LIBRARIES OpenCASCADE::TKXSBase OpenCASCADE::TKSTEPBase OpenCASCADE::TKSTEPAttr OpenCASCADE::TKSTEP209 OpenCASCADE::TKSTEP OpenCASCADE::TKIGES OpenCASCADE::TKXCAF OpenCASCADE::TKXDEIGES OpenCASCADE::TKXDESTEP OpenCASCADE::TKSTL OpenCASCADE::TKVRML OpenCASCADE::TKXmlXCAF OpenCASCADE::TKBinXCAF OpenCASCADE::TKRWMesh)
|
||||
set (OpenCASCADE_Draw_LIBRARIES OpenCASCADE::TKDraw OpenCASCADE::TKTopTest OpenCASCADE::TKOpenGlTest OpenCASCADE::TKViewerTest OpenCASCADE::TKXSDRAW OpenCASCADE::TKDCAF OpenCASCADE::TKXDEDRAW OpenCASCADE::TKTObjDRAW OpenCASCADE::TKQADraw OpenCASCADE::TKIVtkDraw)
|
||||
|
||||
# List of available OpenCASCADE libraries.
|
||||
set (OpenCASCADE_LIBRARIES OpenCASCADE::Freetype OpenCASCADE::Tcl86 OpenCASCADE::Tk86 OpenCASCADE::TKernel OpenCASCADE::TKMath OpenCASCADE::TKG2d OpenCASCADE::TKG3d OpenCASCADE::TKGeomBase OpenCASCADE::TKBRep OpenCASCADE::TKGeomAlgo OpenCASCADE::TKTopAlgo OpenCASCADE::TKPrim OpenCASCADE::TKBO OpenCASCADE::TKShHealing OpenCASCADE::TKBool OpenCASCADE::TKHLR OpenCASCADE::TKFillet OpenCASCADE::TKOffset OpenCASCADE::TKFeat OpenCASCADE::TKMesh OpenCASCADE::TKXMesh OpenCASCADE::TKService OpenCASCADE::TKV3d OpenCASCADE::TKOpenGl OpenCASCADE::TKMeshVS OpenCASCADE::TKIVtk OpenCASCADE::TKCDF OpenCASCADE::TKLCAF OpenCASCADE::TKCAF OpenCASCADE::TKBinL OpenCASCADE::TKXmlL OpenCASCADE::TKBin OpenCASCADE::TKXml OpenCASCADE::TKStdL OpenCASCADE::TKStd OpenCASCADE::TKTObj OpenCASCADE::TKBinTObj OpenCASCADE::TKXmlTObj OpenCASCADE::TKVCAF OpenCASCADE::TKXSBase OpenCASCADE::TKSTEPBase OpenCASCADE::TKSTEPAttr OpenCASCADE::TKSTEP209 OpenCASCADE::TKSTEP OpenCASCADE::TKIGES OpenCASCADE::TKXCAF OpenCASCADE::TKXDEIGES OpenCASCADE::TKXDESTEP OpenCASCADE::TKSTL OpenCASCADE::TKVRML OpenCASCADE::TKXmlXCAF OpenCASCADE::TKBinXCAF OpenCASCADE::TKRWMesh OpenCASCADE::TKDraw OpenCASCADE::TKTopTest OpenCASCADE::TKOpenGlTest OpenCASCADE::TKViewerTest OpenCASCADE::TKXSDRAW OpenCASCADE::TKDCAF OpenCASCADE::TKXDEDRAW OpenCASCADE::TKTObjDRAW OpenCASCADE::TKQADraw OpenCASCADE::TKIVtkDraw)
|
||||
|
||||
_populate_target_properties(OpenCASCADE::TKernel)
|
||||
_populate_target_properties(OpenCASCADE::TKMath OpenCASCADE::TKernel)
|
||||
|
||||
_populate_target_properties(OpenCASCADE::TKG2d OpenCASCADE::TKernel OpenCASCADE::TKMath)
|
||||
_populate_target_properties(OpenCASCADE::TKG3d OpenCASCADE::TKMath OpenCASCADE::TKernel OpenCASCADE::TKG2d)
|
||||
_populate_target_properties(OpenCASCADE::TKGeomBase OpenCASCADE::TKernel OpenCASCADE::TKMath OpenCASCADE::TKG2d OpenCASCADE::TKG3d)
|
||||
_populate_target_properties(OpenCASCADE::TKBRep OpenCASCADE::TKMath OpenCASCADE::TKernel OpenCASCADE::TKG2d OpenCASCADE::TKG3d OpenCASCADE::TKGeomBase)
|
||||
|
||||
_populate_target_properties(OpenCASCADE::TKGeomAlgo OpenCASCADE::TKernel OpenCASCADE::TKMath OpenCASCADE::TKG3d OpenCASCADE::TKG2d OpenCASCADE::TKGeomBase OpenCASCADE::TKBRep)
|
||||
_populate_target_properties(OpenCASCADE::TKTopAlgo OpenCASCADE::TKMath OpenCASCADE::TKernel OpenCASCADE::TKG2d OpenCASCADE::TKG3d OpenCASCADE::TKGeomBase OpenCASCADE::TKBRep OpenCASCADE::TKGeomAlgo)
|
||||
_populate_target_properties(OpenCASCADE::TKPrim OpenCASCADE::TKBRep OpenCASCADE::TKernel OpenCASCADE::TKMath OpenCASCADE::TKG2d OpenCASCADE::TKGeomBase OpenCASCADE::TKG3d OpenCASCADE::TKTopAlgo)
|
||||
_populate_target_properties(OpenCASCADE::TKBO OpenCASCADE::TKBRep OpenCASCADE::TKTopAlgo OpenCASCADE::TKMath OpenCASCADE::TKernel OpenCASCADE::TKG2d OpenCASCADE::TKG3d OpenCASCADE::TKGeomAlgo OpenCASCADE::TKGeomBase OpenCASCADE::TKPrim OpenCASCADE::TKShHealing)
|
||||
_populate_target_properties(OpenCASCADE::TKShHealing OpenCASCADE::TKBRep OpenCASCADE::TKernel OpenCASCADE::TKMath OpenCASCADE::TKG2d OpenCASCADE::TKTopAlgo OpenCASCADE::TKG3d OpenCASCADE::TKGeomBase OpenCASCADE::TKGeomAlgo)
|
||||
_populate_target_properties(OpenCASCADE::TKBool OpenCASCADE::TKBRep OpenCASCADE::TKTopAlgo OpenCASCADE::TKMath OpenCASCADE::TKernel OpenCASCADE::TKPrim OpenCASCADE::TKG2d OpenCASCADE::TKG3d OpenCASCADE::TKShHealing OpenCASCADE::TKGeomBase OpenCASCADE::TKGeomAlgo OpenCASCADE::TKBO)
|
||||
_populate_target_properties(OpenCASCADE::TKHLR OpenCASCADE::TKBRep OpenCASCADE::TKernel OpenCASCADE::TKMath OpenCASCADE::TKGeomBase OpenCASCADE::TKG2d OpenCASCADE::TKG3d OpenCASCADE::TKGeomAlgo OpenCASCADE::TKTopAlgo)
|
||||
_populate_target_properties(OpenCASCADE::TKFillet OpenCASCADE::TKBRep OpenCASCADE::TKernel OpenCASCADE::TKMath OpenCASCADE::TKGeomBase OpenCASCADE::TKGeomAlgo OpenCASCADE::TKG2d OpenCASCADE::TKTopAlgo OpenCASCADE::TKG3d OpenCASCADE::TKBool OpenCASCADE::TKShHealing OpenCASCADE::TKBO)
|
||||
_populate_target_properties(OpenCASCADE::TKOffset OpenCASCADE::TKFillet OpenCASCADE::TKBRep OpenCASCADE::TKTopAlgo OpenCASCADE::TKMath OpenCASCADE::TKernel OpenCASCADE::TKGeomBase OpenCASCADE::TKG2d OpenCASCADE::TKG3d OpenCASCADE::TKGeomAlgo OpenCASCADE::TKShHealing OpenCASCADE::TKBO OpenCASCADE::TKPrim OpenCASCADE::TKBool)
|
||||
_populate_target_properties(OpenCASCADE::TKFeat OpenCASCADE::TKBRep OpenCASCADE::TKTopAlgo OpenCASCADE::TKGeomAlgo OpenCASCADE::TKMath OpenCASCADE::TKernel OpenCASCADE::TKGeomBase OpenCASCADE::TKPrim OpenCASCADE::TKG2d OpenCASCADE::TKBO OpenCASCADE::TKG3d OpenCASCADE::TKBool OpenCASCADE::TKShHealing)
|
||||
_populate_target_properties(OpenCASCADE::TKMesh OpenCASCADE::TKernel OpenCASCADE::TKMath OpenCASCADE::TKBRep OpenCASCADE::TKTopAlgo OpenCASCADE::TKShHealing OpenCASCADE::TKGeomBase OpenCASCADE::TKG3d OpenCASCADE::TKG2d)
|
||||
_populate_target_properties(OpenCASCADE::TKXMesh OpenCASCADE::TKBRep OpenCASCADE::TKMath OpenCASCADE::TKernel OpenCASCADE::TKG2d OpenCASCADE::TKG3d OpenCASCADE::TKMesh)
|
||||
|
||||
_populate_target_properties(OpenCASCADE::TKService OpenCASCADE::TKernel OpenCASCADE::TKMath OpenCASCADE::Freetype)
|
||||
_populate_target_properties(OpenCASCADE::TKV3d OpenCASCADE::TKBRep OpenCASCADE::TKMath OpenCASCADE::TKernel OpenCASCADE::TKService OpenCASCADE::TKShHealing OpenCASCADE::TKTopAlgo OpenCASCADE::TKG2d OpenCASCADE::TKG3d OpenCASCADE::TKGeomBase OpenCASCADE::TKMesh OpenCASCADE::TKGeomAlgo OpenCASCADE::TKHLR OpenCASCADE::Freetype)
|
||||
_populate_target_properties(OpenCASCADE::TKOpenGl OpenCASCADE::TKernel OpenCASCADE::TKService OpenCASCADE::TKMath)
|
||||
_populate_target_properties(OpenCASCADE::TKMeshVS OpenCASCADE::TKV3d OpenCASCADE::TKMath OpenCASCADE::TKService OpenCASCADE::TKernel OpenCASCADE::TKG3d OpenCASCADE::TKG2d)
|
||||
_populate_target_properties(OpenCASCADE::TKIVtk OpenCASCADE::TKernel OpenCASCADE::TKBRep OpenCASCADE::TKG2d OpenCASCADE::TKG3d OpenCASCADE::TKGeomAlgo OpenCASCADE::TKGeomBase OpenCASCADE::TKMath OpenCASCADE::TKMesh OpenCASCADE::TKService OpenCASCADE::TKTopAlgo OpenCASCADE::TKV3d VTK::CommonCore VTK::RenderingCore VTK::RenderingFreeType VTK::FiltersGeneral VTK::InteractionStyle VTK::RenderingOpenGL2 VTK::RenderingGL2PSOpenGL2)
|
||||
|
||||
_populate_target_properties(OpenCASCADE::TKCDF OpenCASCADE::TKernel)
|
||||
_populate_target_properties(OpenCASCADE::TKLCAF OpenCASCADE::TKCDF OpenCASCADE::TKernel)
|
||||
_populate_target_properties(OpenCASCADE::TKCAF OpenCASCADE::TKernel OpenCASCADE::TKGeomBase OpenCASCADE::TKBRep OpenCASCADE::TKTopAlgo OpenCASCADE::TKMath OpenCASCADE::TKG2d OpenCASCADE::TKG3d OpenCASCADE::TKCDF OpenCASCADE::TKLCAF OpenCASCADE::TKBO)
|
||||
_populate_target_properties(OpenCASCADE::TKBinL OpenCASCADE::TKCDF OpenCASCADE::TKernel OpenCASCADE::TKLCAF)
|
||||
_populate_target_properties(OpenCASCADE::TKXmlL OpenCASCADE::TKCDF OpenCASCADE::TKernel OpenCASCADE::TKMath OpenCASCADE::TKLCAF)
|
||||
_populate_target_properties(OpenCASCADE::TKBin OpenCASCADE::TKBRep OpenCASCADE::TKMath OpenCASCADE::TKernel OpenCASCADE::TKG2d OpenCASCADE::TKG3d OpenCASCADE::TKCAF OpenCASCADE::TKCDF OpenCASCADE::TKLCAF OpenCASCADE::TKBinL)
|
||||
_populate_target_properties(OpenCASCADE::TKXml OpenCASCADE::TKCDF OpenCASCADE::TKernel OpenCASCADE::TKMath OpenCASCADE::TKBRep OpenCASCADE::TKG2d OpenCASCADE::TKGeomBase OpenCASCADE::TKG3d OpenCASCADE::TKLCAF OpenCASCADE::TKCAF OpenCASCADE::TKXmlL)
|
||||
_populate_target_properties(OpenCASCADE::TKStdL OpenCASCADE::TKernel OpenCASCADE::TKCDF OpenCASCADE::TKLCAF)
|
||||
_populate_target_properties(OpenCASCADE::TKStd OpenCASCADE::TKernel OpenCASCADE::TKCDF OpenCASCADE::TKCAF OpenCASCADE::TKLCAF OpenCASCADE::TKBRep OpenCASCADE::TKMath OpenCASCADE::TKG2d OpenCASCADE::TKG3d OpenCASCADE::TKStdL)
|
||||
_populate_target_properties(OpenCASCADE::TKTObj OpenCASCADE::TKCDF OpenCASCADE::TKernel OpenCASCADE::TKMath OpenCASCADE::TKLCAF)
|
||||
_populate_target_properties(OpenCASCADE::TKBinTObj OpenCASCADE::TKCDF OpenCASCADE::TKernel OpenCASCADE::TKTObj OpenCASCADE::TKMath OpenCASCADE::TKLCAF OpenCASCADE::TKBinL)
|
||||
_populate_target_properties(OpenCASCADE::TKXmlTObj OpenCASCADE::TKCDF OpenCASCADE::TKernel OpenCASCADE::TKTObj OpenCASCADE::TKMath OpenCASCADE::TKLCAF OpenCASCADE::TKXmlL)
|
||||
_populate_target_properties(OpenCASCADE::TKVCAF OpenCASCADE::TKernel OpenCASCADE::TKGeomBase OpenCASCADE::TKBRep OpenCASCADE::TKTopAlgo OpenCASCADE::TKMath OpenCASCADE::TKService OpenCASCADE::TKG2d OpenCASCADE::TKG3d OpenCASCADE::TKCDF OpenCASCADE::TKLCAF OpenCASCADE::TKBO OpenCASCADE::TKCAF OpenCASCADE::TKV3d)
|
||||
|
||||
_populate_target_properties(OpenCASCADE::TKXSBase OpenCASCADE::TKBRep OpenCASCADE::TKernel OpenCASCADE::TKMath OpenCASCADE::TKG2d OpenCASCADE::TKG3d OpenCASCADE::TKTopAlgo OpenCASCADE::TKGeomBase OpenCASCADE::TKShHealing)
|
||||
_populate_target_properties(OpenCASCADE::TKSTEPBase OpenCASCADE::TKernel OpenCASCADE::TKXSBase OpenCASCADE::TKMath)
|
||||
_populate_target_properties(OpenCASCADE::TKSTEPAttr OpenCASCADE::TKernel OpenCASCADE::TKXSBase OpenCASCADE::TKSTEPBase)
|
||||
_populate_target_properties(OpenCASCADE::TKSTEP209 OpenCASCADE::TKernel OpenCASCADE::TKXSBase OpenCASCADE::TKSTEPBase)
|
||||
_populate_target_properties(OpenCASCADE::TKSTEP OpenCASCADE::TKernel OpenCASCADE::TKSTEPAttr OpenCASCADE::TKSTEP209 OpenCASCADE::TKSTEPBase OpenCASCADE::TKBRep OpenCASCADE::TKMath OpenCASCADE::TKG2d OpenCASCADE::TKShHealing OpenCASCADE::TKTopAlgo OpenCASCADE::TKG3d OpenCASCADE::TKGeomBase OpenCASCADE::TKGeomAlgo OpenCASCADE::TKXSBase)
|
||||
_populate_target_properties(OpenCASCADE::TKIGES OpenCASCADE::TKBRep OpenCASCADE::TKernel OpenCASCADE::TKMath OpenCASCADE::TKTopAlgo OpenCASCADE::TKShHealing OpenCASCADE::TKG2d OpenCASCADE::TKG3d OpenCASCADE::TKGeomBase OpenCASCADE::TKGeomAlgo OpenCASCADE::TKPrim OpenCASCADE::TKBool OpenCASCADE::TKXSBase)
|
||||
_populate_target_properties(OpenCASCADE::TKXCAF OpenCASCADE::TKBRep OpenCASCADE::TKernel OpenCASCADE::TKMath OpenCASCADE::TKService OpenCASCADE::TKG2d OpenCASCADE::TKTopAlgo OpenCASCADE::TKV3d OpenCASCADE::TKCDF OpenCASCADE::TKLCAF OpenCASCADE::TKG3d OpenCASCADE::TKCAF OpenCASCADE::TKVCAF)
|
||||
_populate_target_properties(OpenCASCADE::TKXDEIGES OpenCASCADE::TKBRep OpenCASCADE::TKernel OpenCASCADE::TKMath OpenCASCADE::TKXSBase OpenCASCADE::TKCDF OpenCASCADE::TKLCAF OpenCASCADE::TKG2d OpenCASCADE::TKG3d OpenCASCADE::TKXCAF OpenCASCADE::TKIGES)
|
||||
_populate_target_properties(OpenCASCADE::TKXDESTEP OpenCASCADE::TKBRep OpenCASCADE::TKSTEPAttr OpenCASCADE::TKernel OpenCASCADE::TKMath OpenCASCADE::TKXSBase OpenCASCADE::TKTopAlgo OpenCASCADE::TKG2d OpenCASCADE::TKCAF OpenCASCADE::TKSTEPBase OpenCASCADE::TKCDF OpenCASCADE::TKLCAF OpenCASCADE::TKG3d OpenCASCADE::TKXCAF OpenCASCADE::TKSTEP OpenCASCADE::TKShHealing)
|
||||
_populate_target_properties(OpenCASCADE::TKSTL OpenCASCADE::TKernel OpenCASCADE::TKMath OpenCASCADE::TKBRep OpenCASCADE::TKG2d OpenCASCADE::TKG3d OpenCASCADE::TKTopAlgo)
|
||||
_populate_target_properties(OpenCASCADE::TKVRML OpenCASCADE::TKBRep OpenCASCADE::TKTopAlgo OpenCASCADE::TKMath OpenCASCADE::TKGeomBase OpenCASCADE::TKernel OpenCASCADE::TKPrim OpenCASCADE::TKG2d OpenCASCADE::TKG3d OpenCASCADE::TKMesh OpenCASCADE::TKHLR OpenCASCADE::TKService OpenCASCADE::TKGeomAlgo OpenCASCADE::TKV3d OpenCASCADE::TKLCAF OpenCASCADE::TKXCAF)
|
||||
_populate_target_properties(OpenCASCADE::TKXmlXCAF OpenCASCADE::TKXmlL OpenCASCADE::TKBRep OpenCASCADE::TKCDF OpenCASCADE::TKMath OpenCASCADE::TKernel OpenCASCADE::TKService OpenCASCADE::TKG2d OpenCASCADE::TKGeomBase OpenCASCADE::TKCAF OpenCASCADE::TKG3d OpenCASCADE::TKLCAF OpenCASCADE::TKXCAF OpenCASCADE::TKXml)
|
||||
_populate_target_properties(OpenCASCADE::TKBinXCAF OpenCASCADE::TKBRep OpenCASCADE::TKXCAF OpenCASCADE::TKMath OpenCASCADE::TKService OpenCASCADE::TKernel OpenCASCADE::TKBinL OpenCASCADE::TKG2d OpenCASCADE::TKCAF OpenCASCADE::TKCDF OpenCASCADE::TKG3d OpenCASCADE::TKLCAF OpenCASCADE::TKBin)
|
||||
_populate_target_properties(OpenCASCADE::TKRWMesh OpenCASCADE::TKernel OpenCASCADE::TKMath OpenCASCADE::TKMesh OpenCASCADE::TKXCAF OpenCASCADE::TKLCAF OpenCASCADE::TKV3d OpenCASCADE::TKBRep OpenCASCADE::TKG3d OpenCASCADE::TKService)
|
||||
|
||||
_populate_target_properties(OpenCASCADE::TKDraw OpenCASCADE::TKernel OpenCASCADE::TKG2d OpenCASCADE::TKGeomBase OpenCASCADE::TKG3d OpenCASCADE::TKMath OpenCASCADE::TKBRep OpenCASCADE::TKGeomAlgo OpenCASCADE::TKTopAlgo OpenCASCADE::TKShHealing OpenCASCADE::TKMesh OpenCASCADE::TKService OpenCASCADE::TKHLR OpenCASCADE::Tcl86 OpenCASCADE::Tk86)
|
||||
_populate_target_properties(OpenCASCADE::TKTopTest OpenCASCADE::TKBRep OpenCASCADE::TKGeomAlgo OpenCASCADE::TKTopAlgo OpenCASCADE::TKernel OpenCASCADE::TKMath OpenCASCADE::TKBO OpenCASCADE::TKG2d OpenCASCADE::TKG3d OpenCASCADE::TKDraw OpenCASCADE::TKHLR OpenCASCADE::TKGeomBase OpenCASCADE::TKMesh OpenCASCADE::TKService OpenCASCADE::TKV3d OpenCASCADE::TKFillet OpenCASCADE::TKPrim OpenCASCADE::TKBool OpenCASCADE::TKOffset OpenCASCADE::TKFeat OpenCASCADE::TKShHealing)
|
||||
_populate_target_properties(OpenCASCADE::TKOpenGlTest OpenCASCADE::TKernel OpenCASCADE::TKMath OpenCASCADE::TKDraw OpenCASCADE::TKOpenGl OpenCASCADE::TKService OpenCASCADE::TKV3d OpenCASCADE::TKViewerTest)
|
||||
_populate_target_properties(OpenCASCADE::TKViewerTest OpenCASCADE::TKGeomBase OpenCASCADE::TKFillet OpenCASCADE::TKBRep OpenCASCADE::TKTopAlgo OpenCASCADE::TKHLR OpenCASCADE::TKernel OpenCASCADE::TKMath OpenCASCADE::TKService OpenCASCADE::TKShHealing OpenCASCADE::TKBool OpenCASCADE::TKPrim OpenCASCADE::TKGeomAlgo OpenCASCADE::TKG2d OpenCASCADE::TKTopTest OpenCASCADE::TKG3d OpenCASCADE::TKOffset OpenCASCADE::TKMesh OpenCASCADE::TKV3d OpenCASCADE::TKDraw OpenCASCADE::Tcl86 OpenCASCADE::Freetype)
|
||||
_populate_target_properties(OpenCASCADE::TKXSDRAW OpenCASCADE::TKBRep OpenCASCADE::TKV3d OpenCASCADE::TKMath OpenCASCADE::TKernel OpenCASCADE::TKService OpenCASCADE::TKXSBase OpenCASCADE::TKMeshVS OpenCASCADE::TKG3d OpenCASCADE::TKViewerTest OpenCASCADE::TKG2d OpenCASCADE::TKSTEPBase OpenCASCADE::TKTopAlgo OpenCASCADE::TKGeomBase OpenCASCADE::TKGeomAlgo OpenCASCADE::TKMesh OpenCASCADE::TKDraw OpenCASCADE::TKSTEP OpenCASCADE::TKIGES OpenCASCADE::TKSTL OpenCASCADE::TKVRML OpenCASCADE::TKLCAF OpenCASCADE::TKDCAF OpenCASCADE::TKXCAF OpenCASCADE::TKRWMesh)
|
||||
_populate_target_properties(OpenCASCADE::TKDCAF OpenCASCADE::TKGeomBase OpenCASCADE::TKBRep OpenCASCADE::TKGeomAlgo OpenCASCADE::TKernel OpenCASCADE::TKMath OpenCASCADE::TKG2d OpenCASCADE::TKG3d OpenCASCADE::TKDraw OpenCASCADE::TKCDF OpenCASCADE::TKV3d OpenCASCADE::TKService OpenCASCADE::TKLCAF OpenCASCADE::TKFillet OpenCASCADE::TKTopAlgo OpenCASCADE::TKPrim OpenCASCADE::TKBool OpenCASCADE::TKBO OpenCASCADE::TKCAF OpenCASCADE::TKVCAF OpenCASCADE::TKViewerTest OpenCASCADE::TKStd OpenCASCADE::TKStdL OpenCASCADE::TKBin OpenCASCADE::TKBinL OpenCASCADE::TKXml OpenCASCADE::TKXmlL)
|
||||
_populate_target_properties(OpenCASCADE::TKXDEDRAW OpenCASCADE::TKCDF OpenCASCADE::TKBRep OpenCASCADE::TKXCAF OpenCASCADE::TKernel OpenCASCADE::TKIGES OpenCASCADE::TKV3d OpenCASCADE::TKMath OpenCASCADE::TKService OpenCASCADE::TKXSBase OpenCASCADE::TKG2d OpenCASCADE::TKCAF OpenCASCADE::TKVCAF OpenCASCADE::TKDraw OpenCASCADE::TKTopAlgo OpenCASCADE::TKLCAF OpenCASCADE::TKG3d OpenCASCADE::TKSTEPBase OpenCASCADE::TKSTEP OpenCASCADE::TKMesh OpenCASCADE::TKXSDRAW OpenCASCADE::TKXDEIGES OpenCASCADE::TKXDESTEP OpenCASCADE::TKDCAF OpenCASCADE::TKViewerTest OpenCASCADE::TKBinXCAF OpenCASCADE::TKXmlXCAF OpenCASCADE::TKVRML)
|
||||
_populate_target_properties(OpenCASCADE::TKTObjDRAW OpenCASCADE::TKernel OpenCASCADE::TKCDF OpenCASCADE::TKLCAF OpenCASCADE::TKTObj OpenCASCADE::TKMath OpenCASCADE::TKDraw OpenCASCADE::TKDCAF OpenCASCADE::TKBinTObj OpenCASCADE::TKXmlTObj)
|
||||
_populate_target_properties(OpenCASCADE::TKQADraw OpenCASCADE::TKBRep OpenCASCADE::TKMath OpenCASCADE::TKernel OpenCASCADE::TKService OpenCASCADE::TKG2d OpenCASCADE::TKDraw OpenCASCADE::TKV3d OpenCASCADE::TKGeomBase OpenCASCADE::TKG3d OpenCASCADE::TKViewerTest OpenCASCADE::TKCDF OpenCASCADE::TKDCAF OpenCASCADE::TKLCAF OpenCASCADE::TKFillet OpenCASCADE::TKTopAlgo OpenCASCADE::TKHLR OpenCASCADE::TKBool OpenCASCADE::TKGeomAlgo OpenCASCADE::TKPrim OpenCASCADE::TKBO OpenCASCADE::TKShHealing OpenCASCADE::TKOffset OpenCASCADE::TKFeat OpenCASCADE::TKCAF OpenCASCADE::TKVCAF OpenCASCADE::TKIGES OpenCASCADE::TKXSBase OpenCASCADE::TKMesh OpenCASCADE::TKXCAF OpenCASCADE::TKBinXCAF OpenCASCADE::TKSTEP OpenCASCADE::TKSTEPBase OpenCASCADE::TKXDESTEP OpenCASCADE::TKXSDRAW OpenCASCADE::TKSTL OpenCASCADE::TKXml OpenCASCADE::TKTObj OpenCASCADE::TKXmlL OpenCASCADE::TKBin OpenCASCADE::TKBinL OpenCASCADE::TKStd OpenCASCADE::TKStdL)
|
||||
_populate_target_properties(OpenCASCADE::TKIVtkDraw OpenCASCADE::TKernel OpenCASCADE::TKBRep OpenCASCADE::TKDraw OpenCASCADE::TKG2d OpenCASCADE::TKG3d OpenCASCADE::TKGeomAlgo OpenCASCADE::TKGeomBase OpenCASCADE::TKMath OpenCASCADE::TKMesh OpenCASCADE::TKService OpenCASCADE::TKTopAlgo OpenCASCADE::TKV3d OpenCASCADE::TKOpenGl OpenCASCADE::TKIVtk VTK::IOImage VTK::ImagingCore VTK::InteractionStyle VTK::RenderingOpenGL2 VTK::RenderingGL2PSOpenGL2 OpenCASCADE::Tcl86)
|
||||
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
# 如果找到所有需要的变量,并且版本匹配,则将OpenCASCADE_FOUND变量设置为TRUE
|
||||
find_package_handle_standard_args(OpenCASCADE
|
||||
FOUND_VAR
|
||||
OpenCASCADE_FOUND
|
||||
REQUIRED_VARS
|
||||
OpenCASCADE_DIRS
|
||||
OpenCASCADE_INCLUDE_DIRS
|
||||
OpenCASCADE_LIBRARY_DIRS
|
||||
OpenCASCADE_LIBRARIES
|
||||
OpenCASCADE_BINARY_DIRS
|
||||
VERSION_VAR
|
||||
OpenCASCADE_VERSION
|
||||
)
|
|
@ -0,0 +1,152 @@
|
|||
# FindPython
|
||||
# --------
|
||||
#
|
||||
# Find the Python libraries(Only for Python provided by FastCAE)
|
||||
#
|
||||
# Result Variables
|
||||
# ^^^^^^^^^^^^^^^^
|
||||
#
|
||||
# The following variables will be defined:
|
||||
#
|
||||
# ``Python_FOUND`` True if Python found on the local system
|
||||
#
|
||||
# ``Python_VERSION`` Python Version(x.x.x)
|
||||
#
|
||||
# ``Python_VERSION_MAJOR`` Python Major Version
|
||||
#
|
||||
# ``Python_VERSION_MINOR`` Python Minor Version
|
||||
#
|
||||
# ``Python_VERSION_PATCH`` Python Patch Version
|
||||
#
|
||||
# ``Python_DIRS`` Location of Python(root dir)
|
||||
#
|
||||
# ``Python_INCLUDE_DIRS`` Location of Python header files
|
||||
#
|
||||
# ``Python_LIBRARY_DIRS`` Location of Python libraries
|
||||
#
|
||||
# ``Python_LIBRARIES`` List of the Python libraries found
|
||||
#
|
||||
# ``Python_EXECUTABLE`` Location of Python program
|
||||
#
|
||||
|
||||
# 防止重复引入
|
||||
if(FASTCAE_Python_ALREADY_INCLUDED)
|
||||
return()
|
||||
endif()
|
||||
set(FASTCAE_Python_ALREADY_INCLUDED 1)
|
||||
|
||||
set(Python_VERSION_MAJOR 3)
|
||||
set(Python_VERSION_MINOR 7)
|
||||
set(Python_VERSION_PATCH 0)
|
||||
# find_path 搜索包含某个文件的路径
|
||||
# 如果在某个路径下发现了该文件,该结果会被存储到该变量中;如果没有找到,存储的结果将会是<VAR>-NOTFOUND
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
set(_python_h_dir "include/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}m")
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||
set(_python_h_dir "include")
|
||||
endif()
|
||||
|
||||
find_path(Python_DIRS
|
||||
NAMES
|
||||
"${_python_h_dir}/Python.h"
|
||||
PATHS
|
||||
${CMAKE_SOURCE_DIR}/extlib/Python
|
||||
NO_SYSTEM_ENVIRONMENT_PATH
|
||||
NO_CMAKE_SYSTEM_PATH
|
||||
)
|
||||
|
||||
find_path(Python_INCLUDE_DIRS
|
||||
NAMES
|
||||
Python.h
|
||||
HINTS
|
||||
${Python_DIRS}/${_python_h_dir}
|
||||
)
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||
set(Python_EXECUTABLE "${Python_DIRS}/python.exe")
|
||||
else()
|
||||
set(Python_EXECUTABLE "${Python_DIRS}/bin/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}")
|
||||
endif()
|
||||
|
||||
#[[if(EXISTS ${Python_EXECUTABLE})
|
||||
message(STATUS "Python_EXECUTABLE: ${Python_EXECUTABLE}")
|
||||
else()
|
||||
set(Python_EXECUTABLE "Python_EXECUTABLE-NOTFOUND")
|
||||
endif()]]
|
||||
|
||||
#[[execute_process(
|
||||
COMMAND
|
||||
${Python_EXECUTABLE} "-c" "import sys\nprint(sys.version_info)"
|
||||
RESULT_VARIABLE _status
|
||||
OUTPUT_VARIABLE _version
|
||||
ERROR_QUIET
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
function(_findPythonVersion _key _output)
|
||||
# 初始化
|
||||
set(CMAKE_MATCH_1 "0")
|
||||
# 定义正则
|
||||
set(_version_expr "${_key}=([0-9]+),")
|
||||
# 匹配
|
||||
string(REGEX MATCH "${_version_expr}" Python_ver "${_version}")
|
||||
# PARENT_SCOPE选项,意味着该变量的作用域会传递到上一层(函数的调用者)
|
||||
set(${_output} "${CMAKE_MATCH_1}" PARENT_SCOPE)
|
||||
endfunction(_findPythonVersion)
|
||||
|
||||
_findPythonVersion("major" Python_VERSION_MAJOR)
|
||||
_findPythonVersion("minor" Python_VERSION_MINOR)
|
||||
_findPythonVersion("micro" Python_VERSION_PATCH)]]
|
||||
|
||||
set(Python_VERSION "${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}.${Python_VERSION_PATCH}")
|
||||
|
||||
find_path(Python_LIBRARY_DIRS
|
||||
NAMES
|
||||
python${Python_VERSION_MAJOR}${Python_VERSION_MINOR}.lib libpython${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}m.so
|
||||
HINTS
|
||||
${Python_DIRS}/libs ${Python_DIRS}/lib
|
||||
)
|
||||
|
||||
set(Python_LIBRARIES FASTCAE::PYTHON)
|
||||
|
||||
add_library(FASTCAE::PYTHON SHARED IMPORTED)
|
||||
|
||||
set_property(TARGET FASTCAE::PYTHON PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${Python_INCLUDE_DIRS})
|
||||
set_property(TARGET FASTCAE::PYTHON APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
||||
|
||||
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
add_library(FASTCAE::FFI SHARED IMPORTED)
|
||||
set_property(TARGET FASTCAE::FFI APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
||||
set_target_properties(FASTCAE::FFI PROPERTIES
|
||||
IMPORTED_LOCATION_RELEASE "${Python_LIBRARY_DIRS}/libffi.so.8.1.0"
|
||||
IMPORTED_SONAME_RELEASE "libffi.so.8"
|
||||
)
|
||||
set_target_properties(FASTCAE::PYTHON PROPERTIES
|
||||
IMPORTED_LOCATION_RELEASE "${Python_LIBRARY_DIRS}/libpython${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}m.so.1.0"
|
||||
IMPORTED_SONAME_RELEASE "libpython${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}m.so"
|
||||
)
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||
set_target_properties(FASTCAE::PYTHON PROPERTIES
|
||||
IMPORTED_IMPLIB_RELEASE "${Python_LIBRARY_DIRS}/python${Python_VERSION_MAJOR}${Python_VERSION_MINOR}.lib"
|
||||
IMPORTED_LOCATION_RELEASE "${Python_DIRS}/python${Python_VERSION_MAJOR}${Python_VERSION_MINOR}.dll"
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
# 如果找到所有需要的变量,并且版本匹配,则将Python_FOUND变量设置为TRUE
|
||||
find_package_handle_standard_args(Python
|
||||
FOUND_VAR
|
||||
Python_FOUND
|
||||
REQUIRED_VARS
|
||||
Python_DIRS
|
||||
Python_INCLUDE_DIRS
|
||||
Python_LIBRARY_DIRS
|
||||
Python_LIBRARIES
|
||||
Python_EXECUTABLE
|
||||
VERSION_VAR
|
||||
Python_VERSION
|
||||
)
|
|
@ -0,0 +1,49 @@
|
|||
# Find a Python module
|
||||
# Found at http://www.cmake.org/pipermail/cmake/2011-January/041666.html
|
||||
# To use do: find_python_module(NumPy REQUIRED)
|
||||
# Reports also version of package, but you can't currently enforce a specific version to be
|
||||
# searched for...
|
||||
|
||||
macro(find_python_module module)
|
||||
# Fail if Python interpreter not known
|
||||
if(NOT PYTHON_EXECUTABLE)
|
||||
message(FATAL_ERROR "Use find_package(PythonInterp) first!")
|
||||
endif()
|
||||
string(TOLOWER ${module} _module_lower)
|
||||
|
||||
if(NOT ${_module_lower})
|
||||
if(ARGC GREATER 1 AND ARGV1 STREQUAL "REQUIRED")
|
||||
set(${module}_FIND_REQUIRED TRUE)
|
||||
endif()
|
||||
# Find module location
|
||||
execute_process(
|
||||
COMMAND
|
||||
${PYTHON_EXECUTABLE} "-c" "import re, ${_module_lower}; print(re.compile('/__init__.py.*').sub('',${_module_lower}.__file__))"
|
||||
RESULT_VARIABLE ${module}_STATUS
|
||||
OUTPUT_VARIABLE ${module}_LOCATION
|
||||
ERROR_QUIET
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
if(NOT ${module}_STATUS)
|
||||
set(${module} ${${module}_LOCATION} CACHE STRING "Location of Python module ${module}")
|
||||
endif()
|
||||
# Find module version
|
||||
execute_process(
|
||||
COMMAND
|
||||
${PYTHON_EXECUTABLE} "-c" "import re, ${_module_lower}; print(re.compile('/__init__.py.*').sub('',${_module_lower}.__version__))"
|
||||
OUTPUT_VARIABLE ${module}_VERSION
|
||||
ERROR_QUIET
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(${module}
|
||||
FOUND_VAR
|
||||
${module}_FOUND
|
||||
REQUIRED_VARS
|
||||
${module}_LOCATION
|
||||
VERSION_VAR
|
||||
${module}_VERSION
|
||||
)
|
||||
endmacro()
|
|
@ -0,0 +1,110 @@
|
|||
# FindQuaZIP
|
||||
# --------
|
||||
#
|
||||
# Find the QuaZIP libraries(Only for QuaZIP provided by FastCAE)
|
||||
#
|
||||
# Result Variables
|
||||
# ^^^^^^^^^^^^^^^^
|
||||
#
|
||||
# The following variables will be defined:
|
||||
#
|
||||
# ``QuaZIP_FOUND`` True if QuaZIP found on the local system
|
||||
#
|
||||
# ``QuaZIP_VERSION`` QuaZIP Version(x.x.x)
|
||||
#
|
||||
# ``QuaZIP_VERSION_MAJOR`` QuaZIP Major Version
|
||||
#
|
||||
# ``QuaZIP_VERSION_MINOR`` QuaZIP Minor Version
|
||||
#
|
||||
# ``QuaZIP_VERSION_PATCH`` QuaZIP Patch Version
|
||||
#
|
||||
# ``QuaZIP_DIRS`` Location of QuaZIP(root dir)
|
||||
#
|
||||
# ``QuaZIP_INCLUDE_DIRS`` Location of QuaZIP header files
|
||||
#
|
||||
# ``QuaZIP_LIBRARY_DIRS`` Location of QuaZIP libraries
|
||||
#
|
||||
# ``QuaZIP_LIBRARIES`` List of the QuaZIP libraries found
|
||||
#
|
||||
# ``QuaZIP_BINARY_DIRS`` Location of VTK binary
|
||||
#
|
||||
|
||||
# 防止重复引入
|
||||
if(FASTCAE_QuaZIP_ALREADY_INCLUDED)
|
||||
return()
|
||||
endif()
|
||||
set(FASTCAE_QuaZIP_ALREADY_INCLUDED 1)
|
||||
|
||||
# find_path 搜索包含某个文件的路径
|
||||
# 如果在某个路径下发现了该文件,该结果会被存储到该变量中;如果没有找到,存储的结果将会是<VAR>-NOTFOUND
|
||||
find_path(QuaZIP_DIRS
|
||||
NAMES
|
||||
include/quazip5/quazip.h
|
||||
PATHS
|
||||
${CMAKE_SOURCE_DIR}/extlib/QuaZIP
|
||||
NO_SYSTEM_ENVIRONMENT_PATH
|
||||
NO_CMAKE_SYSTEM_PATH
|
||||
)
|
||||
|
||||
set(QuaZIP_VERSION_MAJOR 0)
|
||||
set(QuaZIP_VERSION_MINOR 7)
|
||||
set(QuaZIP_VERSION_PATCH 3)
|
||||
|
||||
set(QuaZIP_VERSION "${QuaZIP_VERSION_MAJOR}.${QuaZIP_VERSION_MINOR}.${QuaZIP_VERSION_PATCH}")
|
||||
|
||||
find_path(QuaZIP_INCLUDE_DIRS
|
||||
NAMES
|
||||
quazip.h
|
||||
HINTS
|
||||
${QuaZIP_DIRS}/include/quazip5
|
||||
)
|
||||
|
||||
find_path(QuaZIP_LIBRARY_DIRS
|
||||
NAMES
|
||||
quazip5.lib libquazip5.so
|
||||
HINTS
|
||||
${QuaZIP_DIRS}/lib
|
||||
)
|
||||
|
||||
find_path(QuaZIP_BINARY_DIRS
|
||||
NAMES
|
||||
quazip5.dll libquazip5.so
|
||||
HINTS
|
||||
${QuaZIP_DIRS}/lib
|
||||
)
|
||||
|
||||
set(QuaZIP_LIBRARIES FASTCAE::QUAZIP)
|
||||
|
||||
add_library(FASTCAE::QUAZIP SHARED IMPORTED)
|
||||
set_property(TARGET FASTCAE::QUAZIP PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${QuaZIP_INCLUDE_DIRS})
|
||||
set_property(TARGET FASTCAE::QUAZIP APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
set_target_properties(FASTCAE::QUAZIP PROPERTIES
|
||||
IMPORTED_LOCATION_RELEASE "${QuaZIP_LIBRARY_DIRS}/libquazip5.so.1.0.0"
|
||||
IMPORTED_SONAME_RELEASE "libquazip5.so.1"
|
||||
)
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||
set_property(TARGET FASTCAE::QUAZIP APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
|
||||
set_target_properties(FASTCAE::QUAZIP PROPERTIES
|
||||
IMPORTED_IMPLIB_RELEASE "${QuaZIP_LIBRARY_DIRS}/quazip5.lib"
|
||||
IMPORTED_LOCATION_RELEASE "${QuaZIP_BINARY_DIRS}/quazip5.dll"
|
||||
IMPORTED_IMPLIB_DEBUG "${QuaZIP_LIBRARY_DIRS}/quazip5d.lib"
|
||||
IMPORTED_LOCATION_DEBUG "${QuaZIP_BINARY_DIRS}/quazip5d.dll"
|
||||
)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
# 如果找到所有需要的变量,并且版本匹配,则将QuaZIP_FOUND变量设置为TRUE
|
||||
find_package_handle_standard_args(QuaZIP
|
||||
FOUND_VAR
|
||||
QuaZIP_FOUND
|
||||
REQUIRED_VARS
|
||||
QuaZIP_DIRS
|
||||
QuaZIP_INCLUDE_DIRS
|
||||
QuaZIP_LIBRARY_DIRS
|
||||
QuaZIP_LIBRARIES
|
||||
QuaZIP_BINARY_DIRS
|
||||
VERSION_VAR
|
||||
QuaZIP_VERSION
|
||||
)
|
|
@ -0,0 +1,142 @@
|
|||
# FindQwt
|
||||
# --------
|
||||
#
|
||||
# Find the Qwt libraries(Only for Qwt provided by FastCAE)
|
||||
#
|
||||
# Result Variables
|
||||
# ^^^^^^^^^^^^^^^^
|
||||
#
|
||||
# The following variables will be defined:
|
||||
#
|
||||
# ``Qwt_FOUND`` True if Qwt found on the local system
|
||||
#
|
||||
# ``Qwt_VERSION`` Qwt Version(x.x.x)
|
||||
#
|
||||
# ``Qwt_VERSION_MAJOR`` Qwt Major Version
|
||||
#
|
||||
# ``Qwt_VERSION_MINOR`` Qwt Minor Version
|
||||
#
|
||||
# ``Qwt_VERSION_PATCH`` Qwt Patch Version
|
||||
#
|
||||
# ``QwtPolar_VERSION`` QwtPolar Version(x.x.x)
|
||||
#
|
||||
# ``QwtPolar_VERSION_MAJOR`` QwtPolar Major Version
|
||||
#
|
||||
# ``QwtPolar_VERSION_MINOR`` QwtPolar Minor Version
|
||||
#
|
||||
# ``QwtPolar_VERSION_PATCH`` QwtPolar Patch Version
|
||||
#
|
||||
# ``Qwt_DIRS`` Location of Qwt(root dir)
|
||||
#
|
||||
# ``Qwt_INCLUDE_DIRS`` Location of Qwt(QwtPolar) header files
|
||||
#
|
||||
# ``Qwt_LIBRARY_DIRS`` Location of Qwt(QwtPolar) libraries
|
||||
#
|
||||
# ``Qwt_LIBRARIES`` List of the Qwt libraries(with QwtPolar libraries) found
|
||||
#
|
||||
# ``Qwt_BINARY_DIRS`` Location of VTK binary
|
||||
#
|
||||
|
||||
# 防止重复引入
|
||||
if(FASTCAE_Qwt_ALREADY_INCLUDED)
|
||||
return()
|
||||
endif()
|
||||
set(FASTCAE_Qwt_ALREADY_INCLUDED 1)
|
||||
|
||||
# find_path 搜索包含某个文件的路径
|
||||
# 如果在某个路径下发现了该文件,该结果会被存储到该变量中;如果没有找到,存储的结果将会是<VAR>-NOTFOUND
|
||||
find_path(Qwt_DIRS
|
||||
NAMES
|
||||
include/qwt.h
|
||||
PATHS
|
||||
${CMAKE_SOURCE_DIR}/extlib/Qwt
|
||||
NO_SYSTEM_ENVIRONMENT_PATH
|
||||
NO_CMAKE_SYSTEM_PATH
|
||||
)
|
||||
|
||||
set(Qwt_VERSION_MAJOR 6)
|
||||
set(Qwt_VERSION_MINOR 1)
|
||||
set(Qwt_VERSION_PATCH 6)
|
||||
set(QwtPolar_VERSION_MAJOR 1)
|
||||
set(QwtPolar_VERSION_MINOR 1)
|
||||
set(QwtPolar_VERSION_PATCH 1)
|
||||
|
||||
set(Qwt_VERSION "${Qwt_VERSION_MAJOR}.${Qwt_VERSION_MINOR}.${Qwt_VERSION_PATCH}")
|
||||
set(QwtPolar_VERSION "${QwtPolar_VERSION_MAJOR}.${QwtPolar_VERSION_MINOR}.${QwtPolar_VERSION_PATCH}")
|
||||
|
||||
find_path(Qwt_INCLUDE_DIRS
|
||||
NAMES
|
||||
qwt.h
|
||||
HINTS
|
||||
${Qwt_DIRS}/include
|
||||
)
|
||||
|
||||
find_path(Qwt_LIBRARY_DIRS
|
||||
NAMES
|
||||
qwt.lib libqwt.so
|
||||
HINTS
|
||||
${Qwt_DIRS}/lib
|
||||
)
|
||||
|
||||
find_path(Qwt_BINARY_DIRS
|
||||
NAMES
|
||||
qwt.dll libqwt.so
|
||||
HINTS
|
||||
${Qwt_DIRS}/lib
|
||||
)
|
||||
|
||||
set(Qwt_LIBRARIES FASTCAE::QWT;FASTCAE::QWTPOLAR)
|
||||
|
||||
add_library(FASTCAE::QWT SHARED IMPORTED)
|
||||
add_library(FASTCAE::QWTPOLAR SHARED IMPORTED)
|
||||
set_property(TARGET FASTCAE::QWT PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${Qwt_INCLUDE_DIRS})
|
||||
set_property(TARGET FASTCAE::QWT APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
||||
set_property(TARGET FASTCAE::QWT PROPERTY INTERFACE_LINK_LIBRARIES Qt5::Svg Qt5::OpenGL)
|
||||
set_property(TARGET FASTCAE::QWT PROPERTY INTERFACE_COMPILE_DEFINITIONS "QWT_DLL")
|
||||
|
||||
set_property(TARGET FASTCAE::QWTPOLAR PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${Qwt_INCLUDE_DIRS})
|
||||
set_property(TARGET FASTCAE::QWTPOLAR APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
||||
set_property(TARGET FASTCAE::QWTPOLAR PROPERTY INTERFACE_LINK_LIBRARIES FASTCAE::QWT Qt5::PrintSupport)
|
||||
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
set_target_properties(FASTCAE::QWT PROPERTIES
|
||||
IMPORTED_LOCATION_RELEASE "${Qwt_LIBRARY_DIRS}/libqwt.so.${Qwt_VERSION_MAJOR}.${Qwt_VERSION_MINOR}.${Qwt_VERSION_PATCH}"
|
||||
IMPORTED_SONAME_RELEASE "libqwt.so.${Qwt_VERSION_MAJOR}"
|
||||
)
|
||||
set_target_properties(FASTCAE::QWTPOLAR PROPERTIES
|
||||
IMPORTED_LOCATION_RELEASE "${Qwt_LIBRARY_DIRS}/libqwtpolar.so.${QwtPolar_VERSION_MAJOR}.${QwtPolar_VERSION_MINOR}.${QwtPolar_VERSION_PATCH}"
|
||||
IMPORTED_SONAME_RELEASE "libqwtpolar.so.${QwtPolar_VERSION_MAJOR}"
|
||||
)
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||
set_property(TARGET FASTCAE::QWT APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
|
||||
set_property(TARGET FASTCAE::QWTPOLAR APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
|
||||
set_target_properties(FASTCAE::QWT PROPERTIES
|
||||
IMPORTED_IMPLIB_RELEASE "${Qwt_LIBRARY_DIRS}/qwt.lib"
|
||||
IMPORTED_LOCATION_RELEASE "${Qwt_BINARY_DIRS}/qwt.dll"
|
||||
IMPORTED_IMPLIB_DEBUG "${Qwt_LIBRARY_DIRS}/qwtd.lib"
|
||||
IMPORTED_LOCATION_DEBUG "${Qwt_BINARY_DIRS}/qwtd.dll"
|
||||
)
|
||||
set_target_properties(FASTCAE::QWTPOLAR PROPERTIES
|
||||
IMPORTED_IMPLIB_RELEASE "${Qwt_LIBRARY_DIRS}/qwtpolar.lib"
|
||||
IMPORTED_LOCATION_RELEASE "${Qwt_BINARY_DIRS}/qwtpolar.dll"
|
||||
IMPORTED_IMPLIB_DEBUG "${Qwt_LIBRARY_DIRS}/qwtpolard.lib"
|
||||
IMPORTED_LOCATION_DEBUG "${Qwt_BINARY_DIRS}/qwtpolard.dll"
|
||||
)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
# 如果找到所有需要的变量,并且版本匹配,则将Qwt_FOUND变量设置为TRUE
|
||||
find_package_handle_standard_args(Qwt
|
||||
FOUND_VAR
|
||||
Qwt_FOUND
|
||||
REQUIRED_VARS
|
||||
Qwt_DIRS
|
||||
Qwt_INCLUDE_DIRS
|
||||
Qwt_LIBRARY_DIRS
|
||||
Qwt_LIBRARIES
|
||||
Qwt_BINARY_DIRS
|
||||
VERSION_VAR
|
||||
Qwt_VERSION
|
||||
)
|
|
@ -0,0 +1,38 @@
|
|||
# - This module looks for Sphinx
|
||||
# Find the Sphinx documentation generator
|
||||
#
|
||||
# This modules defines
|
||||
# SPHINX_EXECUTABLE
|
||||
# SPHINX_FOUND
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2002-2009 Kitware, Inc.
|
||||
# Copyright 2009-2011 Peter Colberg
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file COPYING-CMAKE-SCRIPTS for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
find_program(SPHINX_EXECUTABLE NAMES sphinx-build
|
||||
HINTS
|
||||
$ENV{SPHINX_DIR}
|
||||
HINTS ${SPHINX_ROOT}/bin
|
||||
PATH_SUFFIXES bin
|
||||
DOC "Sphinx documentation generator"
|
||||
)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package_handle_standard_args(Sphinx DEFAULT_MSG
|
||||
SPHINX_EXECUTABLE
|
||||
)
|
||||
|
||||
mark_as_advanced(
|
||||
SPHINX_EXECUTABLE
|
||||
)
|
|
@ -0,0 +1,98 @@
|
|||
# FindTecIO
|
||||
# --------
|
||||
#
|
||||
# Find the TecIO libraries(Only for TecIO provided by FastCAE)
|
||||
#
|
||||
# Result Variables
|
||||
# ^^^^^^^^^^^^^^^^
|
||||
#
|
||||
# The following variables will be defined:
|
||||
#
|
||||
# ``TecIO_FOUND`` True if TecIO found on the local system
|
||||
#
|
||||
# ``TecIO_VERSION`` TecIO Version(x.x.x)
|
||||
#
|
||||
# ``TecIO_VERSION_MAJOR`` TecIO Major Version
|
||||
#
|
||||
# ``TecIO_VERSION_MINOR`` TecIO Minor Version
|
||||
#
|
||||
# ``TecIO_VERSION_PATCH`` TecIO Patch Version
|
||||
#
|
||||
# ``TecIO_DIRS`` Location of TecIO(root dir)
|
||||
#
|
||||
# ``TecIO_INCLUDE_DIRS`` Location of TecIO header files
|
||||
#
|
||||
# ``TecIO_LIBRARY_DIRS`` Location of TecIO libraries
|
||||
#
|
||||
# ``TecIO_LIBRARIES`` List of the TecIO libraries found
|
||||
#
|
||||
|
||||
# 防止重复引入
|
||||
if(FASTCAE_TecIO_ALREADY_INCLUDED)
|
||||
return()
|
||||
endif()
|
||||
set(FASTCAE_TecIO_ALREADY_INCLUDED 1)
|
||||
|
||||
# find_path 搜索包含某个文件的路径
|
||||
# 如果在某个路径下发现了该文件,该结果会被存储到该变量中;如果没有找到,存储的结果将会是<VAR>-NOTFOUND
|
||||
find_path(TecIO_DIRS
|
||||
NAMES
|
||||
include/TECIO.h
|
||||
PATHS
|
||||
${CMAKE_SOURCE_DIR}/extlib/TecIO
|
||||
NO_SYSTEM_ENVIRONMENT_PATH
|
||||
NO_CMAKE_SYSTEM_PATH
|
||||
)
|
||||
|
||||
set(TecIO_VERSION_MAJOR 1)
|
||||
set(TecIO_VERSION_MINOR 4)
|
||||
set(TecIO_VERSION_PATCH 2)
|
||||
|
||||
set(TecIO_VERSION "${TecIO_VERSION_MAJOR}.${TecIO_VERSION_MINOR}.${TecIO_VERSION_PATCH}")
|
||||
|
||||
find_path(TecIO_INCLUDE_DIRS
|
||||
NAMES
|
||||
TECIO.h
|
||||
HINTS
|
||||
${TecIO_DIRS}/include
|
||||
)
|
||||
|
||||
find_path(TecIO_LIBRARY_DIRS
|
||||
NAMES
|
||||
tecio.lib libtecio.so
|
||||
HINTS
|
||||
${TecIO_DIRS}/lib
|
||||
)
|
||||
|
||||
set(TecIO_LIBRARIES FASTCAE::TECIO)
|
||||
|
||||
add_library(FASTCAE::TECIO SHARED IMPORTED)
|
||||
set_property(TARGET FASTCAE::TECIO PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${TecIO_INCLUDE_DIRS})
|
||||
set_property(TARGET FASTCAE::TECIO APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
set_target_properties(FASTCAE::TECIO PROPERTIES
|
||||
IMPORTED_LOCATION_RELEASE "${TecIO_LIBRARY_DIRS}/libtecio.so"
|
||||
#IMPORTED_SONAME_RELEASE "${TecIO_LIBRARY_DIRS}/libtecio.so"
|
||||
)
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||
set_target_properties(FASTCAE::TECIO PROPERTIES
|
||||
IMPORTED_IMPLIB_RELEASE "${TecIO_LIBRARY_DIRS}/tecio.lib"
|
||||
IMPORTED_LOCATION_RELEASE "${TecIO_DIRS}/bin/tecio.dll"
|
||||
)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
# 如果找到所有需要的变量,并且版本匹配,则将TecIO_FOUND变量设置为TRUE
|
||||
find_package_handle_standard_args(TecIO
|
||||
FOUND_VAR
|
||||
TecIO_FOUND
|
||||
REQUIRED_VARS
|
||||
TecIO_DIRS
|
||||
TecIO_INCLUDE_DIRS
|
||||
TecIO_LIBRARY_DIRS
|
||||
TecIO_LIBRARIES
|
||||
VERSION_VAR
|
||||
TecIO_VERSION
|
||||
)
|
|
@ -0,0 +1,215 @@
|
|||
# FindVTK
|
||||
# --------
|
||||
#
|
||||
# Find the VTK libraries(Only for VTK provided by FastCAE)
|
||||
#
|
||||
# Result Variables
|
||||
# ^^^^^^^^^^^^^^^^
|
||||
#
|
||||
# The following variables will be defined:
|
||||
#
|
||||
# ``VTK_FOUND`` True if VTK found on the local system
|
||||
#
|
||||
# ``VTK_VERSION`` VTK Version(x.x.x)
|
||||
#
|
||||
# ``VTK_VERSION_MAJOR`` VTK Major Version
|
||||
#
|
||||
# ``VTK_VERSION_MINOR`` VTK Minor Version
|
||||
#
|
||||
# ``VTK_VERSION_PATCH`` VTK Patch Version
|
||||
#
|
||||
# ``VTK_DIRS`` Location of VTK(root dir)
|
||||
#
|
||||
# ``VTK_INCLUDE_DIRS`` Location of VTK header files
|
||||
#
|
||||
# ``VTK_LIBRARY_DIRS`` Location of VTK libraries
|
||||
#
|
||||
# ``VTK_LIBRARIES`` List of the VTK libraries found
|
||||
#
|
||||
# ``VTK_BINARY_DIRS`` Location of VTK binary
|
||||
#
|
||||
|
||||
# 防止重复引入
|
||||
if(FASTCAE_VTK_ALREADY_INCLUDED)
|
||||
return()
|
||||
endif()
|
||||
set(FASTCAE_VTK_ALREADY_INCLUDED 1)
|
||||
|
||||
set(VTK_DIRS "${CMAKE_SOURCE_DIR}/extlib/VTK")
|
||||
|
||||
set(VTK_VERSION_MAJOR 9)
|
||||
set(VTK_VERSION_MINOR 0)
|
||||
set(VTK_VERSION_PATCH 1)
|
||||
|
||||
set(VTK_INCLUDE_DIRS "${VTK_DIRS}/include/vtk-${VTK_VERSION_MAJOR}.${VTK_VERSION_MINOR}")
|
||||
set(VTK_LIBRARY_DIRS "${VTK_DIRS}/lib")
|
||||
set(VTK_BINARY_DIRS "${VTK_DIRS}/bin")
|
||||
|
||||
set(VTK_VERSION "${VTK_VERSION_MAJOR}.${VTK_VERSION_MINOR}.${VTK_VERSION_PATCH}")
|
||||
|
||||
macro(_populate_target_properties _target)
|
||||
add_library(${_target} SHARED IMPORTED)
|
||||
set_property(TARGET ${_target} PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${VTK_INCLUDE_DIRS})
|
||||
set_property(TARGET ${_target} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
||||
if(ARGC GREATER 1)
|
||||
set_property(TARGET ${_target} PROPERTY INTERFACE_LINK_LIBRARIES ARGN)
|
||||
endif()
|
||||
string(SUBSTRING ${_target} 5 -1 _target_name)
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
set_target_properties(${_target} PROPERTIES
|
||||
IMPORTED_LOCATION_RELEASE "${VTK_LIBRARY_DIRS}/libvtk${_target_name}-${VTK_VERSION_MAJOR}.${VTK_VERSION_MINOR}.so.${VTK_VERSION_MAJOR}.${VTK_VERSION_MINOR}.${VTK_VERSION_PATCH}"
|
||||
IMPORTED_SONAME_RELEASE "libvtk${_target_name}-${VTK_VERSION_MAJOR}.${VTK_VERSION_MINOR}.so.${VTK_VERSION_PATCH}"
|
||||
)
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||
set_property(TARGET ${_target} APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
|
||||
set_target_properties(${_target} PROPERTIES
|
||||
IMPORTED_IMPLIB_RELEASE "${VTK_LIBRARY_DIRS}/vtk${_target_name}-${VTK_VERSION_MAJOR}.${VTK_VERSION_MINOR}.lib"
|
||||
IMPORTED_LOCATION_RELEASE "${VTK_BINARY_DIRS}/vtk${_target_name}-${VTK_VERSION_MAJOR}.${VTK_VERSION_MINOR}.dll"
|
||||
IMPORTED_IMPLIB_DEBUG "${VTK_LIBRARY_DIRS}/vtk${_target_name}-${VTK_VERSION_MAJOR}.${VTK_VERSION_MINOR}d.lib"
|
||||
IMPORTED_LOCATION_DEBUG "${VTK_BINARY_DIRS}/vtk${_target_name}-${VTK_VERSION_MAJOR}.${VTK_VERSION_MINOR}d.dll"
|
||||
)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
set(VTK_LIBRARIES VTK::ChartsCore;VTK::CommonColor;VTK::CommonComputationalGeometry;VTK::CommonCore;VTK::CommonDataModel;VTK::CommonExecutionModel;VTK::CommonMath;VTK::CommonMisc;VTK::CommonSystem;VTK::CommonTransforms;VTK::DomainsChemistry;VTK::FiltersAMR;VTK::FiltersCore;VTK::FiltersExtraction;VTK::FiltersFlowPaths;VTK::FiltersGeneral;VTK::FiltersGeneric;VTK::FiltersGeometry;VTK::FiltersHybrid;VTK::FiltersHyperTree;VTK::FiltersImaging;VTK::FiltersModeling;VTK::FiltersParallel;VTK::FiltersParallelImaging;VTK::FiltersPoints;VTK::FiltersProgrammable;VTK::FiltersSelection;VTK::FiltersSMP;VTK::FiltersSources;VTK::FiltersStatistics;VTK::FiltersTexture;VTK::FiltersTopology;VTK::FiltersVerdict;VTK::GeovisCore;VTK::GUISupportQt;VTK::GUISupportQtSQL;VTK::ImagingColor;VTK::ImagingCore;VTK::ImagingFourier;VTK::ImagingGeneral;VTK::ImagingHybrid;VTK::ImagingMath;VTK::ImagingMorphological;VTK::ImagingSources;VTK::ImagingStatistics;VTK::ImagingStencil;VTK::InfovisCore;VTK::InfovisLayout;VTK::InteractionImage;VTK::InteractionStyle;VTK::InteractionWidgets;VTK::IOAsynchronous;VTK::IOCityGML;VTK::IOCore;VTK::IOEnSight;VTK::IOExport;VTK::IOExportGL2PS;VTK::IOExportPDF;VTK::IOGeometry;VTK::IOImage;VTK::IOImport;VTK::IOInfovis;VTK::IOLegacy;VTK::IOLSDyna;VTK::IOMotionFX;VTK::IOMovie;VTK::IOOggTheora;VTK::IOParallel;VTK::IOParallelXML;VTK::IOPLY;VTK::IOSegY;VTK::IOSQL;VTK::IOTecplotTable;VTK::IOVideo;VTK::IOXML;VTK::IOXMLParser;VTK::ParallelCore;VTK::ParallelDIY;VTK::RenderingAnnotation;VTK::RenderingContext2D;VTK::RenderingCore;VTK::RenderingFreeType;VTK::RenderingGL2PSOpenGL2;VTK::RenderingImage;VTK::RenderingLabel;VTK::RenderingLOD;VTK::RenderingOpenGL2;VTK::RenderingQt;VTK::RenderingSceneGraph;VTK::RenderingUI;VTK::RenderingVolume;VTK::RenderingVolumeOpenGL2;VTK::RenderingVtkJS;VTK::TestingRendering;VTK::doubleconversion;VTK::expat;VTK::freetype;VTK::gl2ps;VTK::glew;VTK::jpeg;VTK::jsoncpp;VTK::libharu;VTK::libproj;VTK::libxml2;VTK::loguru;VTK::lz4;VTK::lzma;VTK::ogg;VTK::png;VTK::pugixml;VTK::sqlite;VTK::theora;VTK::tiff;VTK::verdict;VTK::zlib;VTK::DICOMParser;VTK::sys;VTK::metaio;VTK::ViewsContext2D;VTK::ViewsCore;VTK::ViewsInfovis;VTK::ViewsQt;VTK::WrappingTools)
|
||||
|
||||
_populate_target_properties(VTK::ChartsCore VTK::CommonCore VTK::CommonDataModel VTK::FiltersGeneral VTK::RenderingContext2D VTK::RenderingCore VTK::sys VTK::CommonColor VTK::CommonExecutionModel VTK::CommonTransforms VTK::InfovisCore)
|
||||
_populate_target_properties(VTK::CommonColor VTK::CommonCore VTK::CommonDataModel)
|
||||
_populate_target_properties(VTK::CommonComputationalGeometry VTK::CommonCore VTK::CommonDataModel)
|
||||
_populate_target_properties(VTK::CommonCore VTK::sys)
|
||||
_populate_target_properties(VTK::CommonDataModel VTK::CommonCore VTK::CommonMath VTK::CommonTransforms VTK::CommonMisc VTK::CommonSystem VTK::sys)
|
||||
_populate_target_properties(VTK::CommonExecutionModel VTK::CommonCore VTK::CommonDataModel VTK::CommonMisc VTK::CommonSystem)
|
||||
_populate_target_properties(VTK::CommonMath VTK::CommonCore)
|
||||
_populate_target_properties(VTK::CommonMisc VTK::CommonCore VTK::CommonMath VTK::sys)
|
||||
_populate_target_properties(VTK::CommonSystem VTK::CommonCore VTK::sys)
|
||||
_populate_target_properties(VTK::CommonTransforms VTK::CommonCore VTK::CommonMath VTK::sys)
|
||||
_populate_target_properties(VTK::DomainsChemistry VTK::CommonCore VTK::CommonDataModel VTK::CommonExecutionModel VTK::IOLegacy VTK::IOXMLParser VTK::RenderingCore VTK::CommonTransforms VTK::FiltersCore VTK::FiltersGeneral VTK::FiltersSources VTK::sys)
|
||||
_populate_target_properties(VTK::FiltersAMR VTK::CommonDataModel VTK::CommonExecutionModel VTK::CommonCore VTK::CommonMath VTK::CommonSystem VTK::FiltersCore VTK::IOXML VTK::ParallelCore)
|
||||
_populate_target_properties(VTK::FiltersCore VTK::CommonCore VTK::CommonDataModel VTK::CommonExecutionModel VTK::CommonMisc VTK::CommonMath VTK::CommonSystem VTK::CommonTransforms VTK::sys)
|
||||
_populate_target_properties(VTK::FiltersExtraction VTK::CommonCore VTK::CommonExecutionModel VTK::FiltersGeneral VTK::CommonDataModel VTK::FiltersCore VTK::FiltersStatistics VTK::ParallelDIY)
|
||||
_populate_target_properties(VTK::FiltersFlowPaths VTK::CommonCore VTK::CommonComputationalGeometry VTK::CommonDataModel VTK::CommonExecutionModel VTK::CommonMath VTK::FiltersCore VTK::FiltersGeometry VTK::FiltersSources VTK::IOCore)
|
||||
_populate_target_properties(VTK::FiltersGeneral VTK::CommonCore VTK::CommonDataModel VTK::CommonExecutionModel VTK::CommonMisc VTK::FiltersCore VTK::CommonComputationalGeometry VTK::CommonMath VTK::CommonSystem VTK::CommonTransforms)
|
||||
_populate_target_properties(VTK::FiltersGeneric VTK::CommonExecutionModel VTK::CommonMath VTK::CommonCore VTK::CommonDataModel VTK::CommonMisc VTK::CommonSystem VTK::CommonTransforms VTK::FiltersCore VTK::FiltersSources)
|
||||
_populate_target_properties(VTK::FiltersGeometry VTK::CommonCore VTK::CommonDataModel VTK::CommonExecutionModel VTK::FiltersCore VTK::sys)
|
||||
_populate_target_properties(VTK::FiltersHybrid VTK::CommonCore VTK::CommonDataModel VTK::CommonExecutionModel VTK::CommonTransforms VTK::FiltersGeometry VTK::CommonMath VTK::CommonMisc VTK::FiltersCore VTK::FiltersGeneral VTK::ImagingCore VTK::ImagingSources VTK::RenderingCore VTK::sys)
|
||||
_populate_target_properties(VTK::FiltersHyperTree VTK::CommonDataModel VTK::CommonExecutionModel VTK::CommonMisc VTK::FiltersCore VTK::FiltersGeneral VTK::CommonCore VTK::CommonSystem)
|
||||
_populate_target_properties(VTK::FiltersImaging VTK::CommonCore VTK::CommonExecutionModel VTK::FiltersStatistics VTK::CommonDataModel VTK::CommonSystem VTK::ImagingGeneral)
|
||||
_populate_target_properties(VTK::FiltersModeling VTK::CommonExecutionModel VTK::CommonMisc VTK::FiltersGeneral VTK::CommonCore VTK::CommonDataModel VTK::CommonTransforms VTK::FiltersCore VTK::FiltersSources)
|
||||
_populate_target_properties(VTK::FiltersParallel VTK::CommonCore VTK::CommonDataModel VTK::CommonExecutionModel VTK::FiltersCore VTK::FiltersExtraction VTK::FiltersGeneral VTK::FiltersGeometry VTK::FiltersHybrid VTK::FiltersModeling VTK::FiltersSources VTK::FiltersTexture VTK::CommonSystem VTK::CommonTransforms VTK::IOLegacy VTK::ParallelCore)
|
||||
_populate_target_properties(VTK::FiltersParallelImaging VTK::CommonExecutionModel VTK::FiltersImaging VTK::FiltersParallel VTK::ImagingCore VTK::CommonCore VTK::CommonDataModel VTK::CommonSystem VTK::FiltersExtraction VTK::FiltersStatistics VTK::ImagingGeneral VTK::ParallelCore)
|
||||
_populate_target_properties(VTK::FiltersPoints VTK::CommonCore VTK::CommonExecutionModel VTK::CommonMisc VTK::FiltersModeling)
|
||||
_populate_target_properties(VTK::FiltersProgrammable VTK::CommonExecutionModel VTK::CommonCore VTK::CommonDataModel VTK::CommonTransforms)
|
||||
_populate_target_properties(VTK::FiltersSelection VTK::CommonCore VTK::CommonExecutionModel VTK::CommonDataModel)
|
||||
_populate_target_properties(VTK::FiltersSMP VTK::CommonCore VTK::CommonDataModel VTK::CommonExecutionModel VTK::CommonMisc VTK::CommonTransforms VTK::FiltersCore VTK::FiltersGeneral VTK::CommonMath VTK::CommonSystem)
|
||||
_populate_target_properties(VTK::FiltersSources VTK::CommonDataModel VTK::CommonExecutionModel VTK::CommonComputationalGeometry VTK::CommonCore VTK::CommonTransforms VTK::FiltersCore VTK::FiltersGeneral)
|
||||
_populate_target_properties(VTK::FiltersStatistics VTK::CommonCore VTK::CommonExecutionModel VTK::CommonDataModel VTK::CommonMisc VTK::ImagingFourier)
|
||||
_populate_target_properties(VTK::FiltersTexture VTK::CommonExecutionModel VTK::CommonCore VTK::CommonDataModel VTK::CommonTransforms VTK::FiltersGeneral)
|
||||
_populate_target_properties(VTK::FiltersTopology VTK::CommonCore VTK::CommonDataModel VTK::CommonExecutionModel)
|
||||
_populate_target_properties(VTK::FiltersVerdict VTK::CommonExecutionModel VTK::verdict VTK::CommonCore VTK::CommonDataModel)
|
||||
_populate_target_properties(VTK::GeovisCore VTK::CommonCore VTK::CommonDataModel VTK::CommonExecutionModel VTK::CommonTransforms VTK::InfovisCore VTK::InteractionStyle VTK::InteractionWidgets VTK::RenderingCore VTK::ViewsCore VTK::libproj VTK::CommonSystem VTK::FiltersCore VTK::FiltersGeneral VTK::IOImage VTK::IOXML VTK::ImagingCore VTK::ImagingSources VTK::InfovisLayout)
|
||||
_populate_target_properties(VTK::GUISupportQt VTK::CommonCore VTK::RenderingCore VTK::RenderingOpenGL2 VTK::InteractionWidgets VTK::CommonDataModel VTK::FiltersExtraction VTK::InteractionStyle)
|
||||
_populate_target_properties(VTK::GUISupportQtSQL VTK::CommonCore VTK::GUISupportQt VTK::IOSQL VTK::sys)
|
||||
_populate_target_properties(VTK::ImagingColor VTK::CommonExecutionModel VTK::ImagingCore VTK::CommonCore VTK::CommonDataModel VTK::CommonSystem)
|
||||
_populate_target_properties(VTK::ImagingCore VTK::CommonCore VTK::CommonDataModel VTK::CommonExecutionModel VTK::CommonMath VTK::CommonTransforms)
|
||||
_populate_target_properties(VTK::ImagingFourier VTK::CommonCore VTK::CommonExecutionModel VTK::ImagingCore VTK::CommonDataModel VTK::sys)
|
||||
_populate_target_properties(VTK::ImagingGeneral VTK::CommonExecutionModel VTK::ImagingCore VTK::CommonCore VTK::CommonDataModel VTK::ImagingSources)
|
||||
_populate_target_properties(VTK::ImagingHybrid VTK::CommonCore VTK::CommonExecutionModel VTK::CommonDataModel VTK::IOImage VTK::ImagingCore)
|
||||
_populate_target_properties(VTK::ImagingMath VTK::CommonExecutionModel VTK::CommonCore VTK::CommonDataModel)
|
||||
_populate_target_properties(VTK::ImagingMorphological VTK::CommonCore VTK::CommonDataModel VTK::CommonExecutionModel VTK::ImagingCore VTK::ImagingGeneral VTK::ImagingSources)
|
||||
_populate_target_properties(VTK::ImagingSources VTK::CommonExecutionModel VTK::CommonCore VTK::CommonDataModel VTK::ImagingCore)
|
||||
_populate_target_properties(VTK::ImagingStatistics VTK::CommonExecutionModel VTK::CommonCore VTK::CommonDataModel VTK::ImagingCore)
|
||||
_populate_target_properties(VTK::ImagingStencil VTK::CommonExecutionModel VTK::ImagingCore VTK::CommonComputationalGeometry VTK::CommonCore VTK::CommonDataModel)
|
||||
_populate_target_properties(VTK::InfovisCore VTK::CommonCore VTK::CommonDataModel VTK::CommonExecutionModel VTK::CommonColor VTK::IOImage VTK::ImagingCore VTK::ImagingSources VTK::RenderingFreeType VTK::FiltersExtraction VTK::FiltersGeneral)
|
||||
_populate_target_properties(VTK::InfovisLayout VTK::CommonCore VTK::CommonDataModel VTK::CommonExecutionModel VTK::CommonComputationalGeometry VTK::CommonSystem VTK::CommonTransforms VTK::FiltersCore VTK::FiltersGeneral VTK::FiltersModeling VTK::FiltersSources VTK::ImagingHybrid VTK::InfovisCore)
|
||||
_populate_target_properties(VTK::InteractionImage VTK::CommonCore VTK::RenderingCore VTK::CommonDataModel VTK::CommonExecutionModel VTK::ImagingColor VTK::ImagingCore VTK::InteractionStyle VTK::InteractionWidgets)
|
||||
_populate_target_properties(VTK::InteractionStyle VTK::CommonDataModel VTK::RenderingCore VTK::CommonCore VTK::CommonMath VTK::CommonTransforms VTK::FiltersExtraction VTK::FiltersSources)
|
||||
_populate_target_properties(VTK::InteractionWidgets VTK::CommonCore VTK::CommonExecutionModel VTK::FiltersGeneral VTK::FiltersSources VTK::RenderingCore VTK::CommonComputationalGeometry VTK::CommonDataModel VTK::CommonMath VTK::CommonSystem VTK::CommonTransforms VTK::FiltersCore VTK::FiltersHybrid VTK::FiltersModeling VTK::ImagingColor VTK::ImagingCore VTK::ImagingGeneral VTK::ImagingHybrid VTK::InteractionStyle VTK::RenderingAnnotation VTK::RenderingFreeType VTK::RenderingVolume)
|
||||
_populate_target_properties(VTK::IOAsynchronous VTK::CommonCore VTK::CommonExecutionModel VTK::IOCore VTK::IOImage VTK::IOXML VTK::CommonDataModel VTK::CommonMath VTK::CommonMisc VTK::CommonSystem VTK::ParallelCore)
|
||||
_populate_target_properties(VTK::IOCityGML VTK::CommonExecutionModel VTK::CommonCore VTK::CommonDataModel VTK::FiltersGeneral VTK::FiltersModeling VTK::pugixml VTK::sys)
|
||||
_populate_target_properties(VTK::IOCore VTK::CommonCore VTK::CommonExecutionModel VTK::CommonDataModel VTK::CommonMisc VTK::doubleconversion VTK::lz4 VTK::lzma VTK::sys VTK::zlib)
|
||||
_populate_target_properties(VTK::IOEnSight VTK::CommonExecutionModel VTK::CommonCore VTK::CommonDataModel)
|
||||
_populate_target_properties(VTK::IOExport VTK::CommonCore VTK::IOCore VTK::IOImage VTK::IOXML VTK::RenderingContext2D VTK::RenderingCore VTK::RenderingFreeType VTK::RenderingVtkJS VTK::CommonDataModel VTK::CommonMath VTK::CommonTransforms VTK::FiltersGeometry VTK::IOImage VTK::ImagingCore VTK::jsoncpp VTK::libharu)
|
||||
_populate_target_properties(VTK::IOExportGL2PS VTK::IOExport VTK::RenderingGL2PSOpenGL2 VTK::CommonCore VTK::CommonDataModel VTK::ImagingCore VTK::RenderingCore VTK::gl2ps)
|
||||
_populate_target_properties(VTK::IOExportPDF VTK::IOExport VTK::RenderingContext2D VTK::CommonCore VTK::ImagingCore VTK::libharu)
|
||||
_populate_target_properties(VTK::IOGeometry VTK::CommonCore VTK::CommonDataModel VTK::CommonExecutionModel VTK::IOCore VTK::IOLegacy VTK::CommonMisc VTK::CommonSystem VTK::CommonTransforms VTK::FiltersGeneral VTK::FiltersHybrid VTK::ImagingCore VTK::IOImage VTK::RenderingCore VTK::jsoncpp VTK::sys VTK::zlib)
|
||||
_populate_target_properties(VTK::IOImage VTK::CommonCore VTK::CommonExecutionModel VTK::ImagingCore VTK::CommonDataModel VTK::CommonMath VTK::CommonMisc VTK::CommonSystem VTK::CommonTransforms VTK::DICOMParser VTK::jpeg VTK::metaio VTK::png VTK::pugixml VTK::tiff VTK::sys VTK::zlib)
|
||||
_populate_target_properties(VTK::IOImport VTK::CommonCore VTK::CommonExecutionModel VTK::CommonMisc VTK::RenderingCore VTK::sys VTK::CommonDataModel VTK::CommonTransforms VTK::FiltersCore VTK::FiltersSources VTK::ImagingCore VTK::IOGeometry VTK::IOImage VTK::jsoncpp)
|
||||
_populate_target_properties(VTK::IOInfovis VTK::CommonCore VTK::CommonExecutionModel VTK::IOLegacy VTK::IOXML VTK::CommonDataModel VTK::CommonMisc VTK::IOCore VTK::IOXMLParser VTK::InfovisCore VTK::libxml2 VTK::sys)
|
||||
_populate_target_properties(VTK::IOLegacy VTK::CommonCore VTK::CommonDataModel VTK::CommonExecutionModel VTK::IOCore VTK::CommonMisc VTK::sys)
|
||||
_populate_target_properties(VTK::IOLSDyna VTK::CommonCore VTK::CommonExecutionModel VTK::IOXMLParser VTK::CommonDataModel VTK::sys)
|
||||
_populate_target_properties(VTK::IOMotionFX VTK::CommonExecutionModel VTK::CommonDataModel VTK::CommonMisc VTK::IOGeometry VTK::sys)
|
||||
_populate_target_properties(VTK::IOMovie VTK::CommonExecutionModel VTK::CommonCore VTK::CommonDataModel VTK::CommonMisc VTK::CommonSystem)
|
||||
_populate_target_properties(VTK::IOOggTheora VTK::CommonExecutionModel VTK::IOMovie VTK::CommonCore VTK::CommonDataModel VTK::CommonMisc VTK::CommonSystem VTK::theora)
|
||||
_populate_target_properties(VTK::IOParallel VTK::CommonCore VTK::CommonDataModel VTK::CommonExecutionModel VTK::IOCore VTK::IOGeometry VTK::IOImage VTK::IOLegacy VTK::jsoncpp VTK::CommonMisc VTK::CommonSystem VTK::FiltersCore VTK::FiltersExtraction VTK::FiltersParallel VTK::ParallelCore VTK::sys)
|
||||
_populate_target_properties(VTK::IOParallelXML VTK::IOXML VTK::CommonCore VTK::CommonDataModel VTK::CommonExecutionModel VTK::CommonMisc VTK::ParallelCore VTK::sys)
|
||||
_populate_target_properties(VTK::IOPLY VTK::CommonCore VTK::IOCore VTK::CommonDataModel VTK::CommonMisc VTK::sys)
|
||||
_populate_target_properties(VTK::IOSegY VTK::CommonDataModel VTK::CommonExecutionModel VTK::IOImage VTK::CommonCore)
|
||||
_populate_target_properties(VTK::IOSQL VTK::CommonCore VTK::CommonExecutionModel VTK::IOCore VTK::sqlite VTK::sys)
|
||||
_populate_target_properties(VTK::IOTecplotTable VTK::CommonCore VTK::CommonExecutionModel VTK::CommonDataModel VTK::IOCore VTK::sys)
|
||||
_populate_target_properties(VTK::IOVideo VTK::CommonExecutionModel VTK::CommonCore VTK::CommonDataModel VTK::CommonSystem VTK::sys)
|
||||
_populate_target_properties(VTK::IOXML VTK::CommonCore VTK::CommonExecutionModel VTK::IOXMLParser VTK::CommonDataModel VTK::CommonMisc VTK::CommonSystem VTK::IOCore VTK::sys)
|
||||
_populate_target_properties(VTK::IOXMLParser VTK::CommonCore VTK::CommonDataModel VTK::IOCore VTK::expat VTK::sys)
|
||||
_populate_target_properties(VTK::ParallelCore VTK::CommonCore VTK::CommonDataModel VTK::CommonSystem VTK::IOLegacy VTK::sys)
|
||||
_populate_target_properties(VTK::ParallelDIY VTK::CommonCore VTK::CommonDataModel VTK::ParallelCore VTK::FiltersGeneral VTK::IOXML)
|
||||
_populate_target_properties(VTK::RenderingAnnotation VTK::CommonCore VTK::CommonDataModel VTK::CommonExecutionModel VTK::RenderingCore VTK::CommonMath VTK::CommonTransforms VTK::FiltersCore VTK::FiltersGeneral VTK::FiltersSources VTK::ImagingColor VTK::RenderingFreeType)
|
||||
_populate_target_properties(VTK::RenderingContext2D VTK::CommonCore VTK::CommonDataModel VTK::CommonExecutionModel VTK::RenderingCore VTK::CommonMath VTK::CommonSystem VTK::CommonTransforms VTK::FiltersGeneral VTK::RenderingFreeType)
|
||||
_populate_target_properties(VTK::RenderingCore VTK::CommonCore VTK::CommonDataModel VTK::CommonExecutionModel VTK::CommonMath VTK::FiltersCore VTK::CommonColor VTK::CommonComputationalGeometry VTK::CommonSystem VTK::CommonTransforms VTK::FiltersGeneral VTK::FiltersGeometry VTK::FiltersSources VTK::sys)
|
||||
_populate_target_properties(VTK::RenderingFreeType VTK::CommonCore VTK::CommonExecutionModel VTK::RenderingCore VTK::freetype VTK::CommonDataModel VTK::FiltersGeneral)
|
||||
_populate_target_properties(VTK::RenderingGL2PSOpenGL2 VTK::RenderingOpenGL2 VTK::CommonCore VTK::CommonDataModel VTK::CommonMath VTK::RenderingCore VTK::RenderingOpenGL2 VTK::gl2ps)
|
||||
_populate_target_properties(VTK::RenderingImage VTK::CommonExecutionModel VTK::RenderingCore VTK::CommonCore VTK::CommonDataModel VTK::CommonMath VTK::CommonTransforms VTK::ImagingCore)
|
||||
_populate_target_properties(VTK::RenderingLabel VTK::CommonCore VTK::CommonDataModel VTK::CommonExecutionModel VTK::RenderingCore VTK::RenderingFreeType VTK::CommonMath VTK::CommonSystem VTK::CommonTransforms VTK::FiltersGeneral)
|
||||
_populate_target_properties(VTK::RenderingLOD VTK::RenderingCore VTK::CommonCore VTK::CommonDataModel VTK::CommonExecutionModel VTK::CommonMath VTK::CommonSystem VTK::FiltersCore VTK::FiltersModeling)
|
||||
_populate_target_properties(VTK::RenderingOpenGL2 VTK::CommonCore VTK::CommonDataModel VTK::RenderingCore VTK::RenderingUI VTK::glew VTK::CommonExecutionModel VTK::CommonMath VTK::CommonSystem VTK::CommonTransforms VTK::sys)
|
||||
_populate_target_properties(VTK::RenderingQt VTK::CommonCore VTK::CommonExecutionModel VTK::RenderingCore VTK::RenderingLabel VTK::CommonDataModel VTK::CommonSystem VTK::FiltersSources VTK::FiltersTexture VTK::GUISupportQt)
|
||||
_populate_target_properties(VTK::RenderingSceneGraph VTK::CommonCore VTK::CommonDataModel VTK::CommonMath VTK::RenderingCore)
|
||||
_populate_target_properties(VTK::RenderingUI VTK::RenderingCore)
|
||||
_populate_target_properties(VTK::RenderingVolume VTK::CommonCore VTK::CommonExecutionModel VTK::RenderingCore VTK::CommonDataModel VTK::CommonMath VTK::CommonMisc VTK::CommonSystem VTK::CommonTransforms VTK::ImagingCore)
|
||||
_populate_target_properties(VTK::RenderingVolumeOpenGL2 VTK::CommonCore VTK::CommonDataModel VTK::ImagingCore VTK::ImagingMath VTK::RenderingCore VTK::RenderingOpenGL2 VTK::RenderingVolume VTK::CommonMath VTK::CommonSystem VTK::CommonTransforms VTK::FiltersCore VTK::FiltersGeneral VTK::FiltersSources VTK::glew VTK::sys)
|
||||
_populate_target_properties(VTK::RenderingVtkJS VTK::CommonCore VTK::RenderingSceneGraph VTK::jsoncpp VTK::CommonDataModel VTK::CommonExecutionModel VTK::RenderingCore)
|
||||
_populate_target_properties(VTK::TestingRendering VTK::CommonCore VTK::RenderingCore VTK::CommonDataModel VTK::CommonExecutionModel VTK::CommonSystem VTK::IOImage VTK::ImagingCore VTK::sys)
|
||||
_populate_target_properties(VTK::doubleconversion)
|
||||
_populate_target_properties(VTK::expat)
|
||||
_populate_target_properties(VTK::freetype VTK::zlib)
|
||||
_populate_target_properties(VTK::gl2ps VTK::png VTK::zlib)
|
||||
_populate_target_properties(VTK::glew)
|
||||
_populate_target_properties(VTK::jpeg)
|
||||
_populate_target_properties(VTK::jsoncpp)
|
||||
_populate_target_properties(VTK::libharu VTK::png VTK::zlib)
|
||||
_populate_target_properties(VTK::libproj)
|
||||
_populate_target_properties(VTK::libxml2 VTK::zlib)
|
||||
_populate_target_properties(VTK::loguru)
|
||||
_populate_target_properties(VTK::lz4)
|
||||
_populate_target_properties(VTK::lzma)
|
||||
_populate_target_properties(VTK::ogg)
|
||||
_populate_target_properties(VTK::png VTK::zlib)
|
||||
_populate_target_properties(VTK::pugixml)
|
||||
_populate_target_properties(VTK::sqlite)
|
||||
_populate_target_properties(VTK::theora VTK::ogg)
|
||||
_populate_target_properties(VTK::tiff VTK::jpeg VTK::zlib)
|
||||
_populate_target_properties(VTK::verdict)
|
||||
_populate_target_properties(VTK::zlib)
|
||||
_populate_target_properties(VTK::DICOMParser VTK::sys)
|
||||
_populate_target_properties(VTK::sys)
|
||||
_populate_target_properties(VTK::metaio VTK::zlib)
|
||||
_populate_target_properties(VTK::ViewsContext2D VTK::CommonCore VTK::RenderingCore VTK::ViewsCore VTK::RenderingContext2D)
|
||||
_populate_target_properties(VTK::ViewsCore VTK::CommonCore VTK::CommonExecutionModel VTK::InteractionWidgets VTK::CommonDataModel VTK::FiltersGeneral VTK::RenderingCore VTK::RenderingUI)
|
||||
_populate_target_properties(VTK::ViewsInfovis VTK::CommonCore VTK::CommonDataModel VTK::CommonExecutionModel VTK::InteractionStyle VTK::RenderingContext2D VTK::ViewsCore VTK::ChartsCore VTK::CommonColor VTK::CommonTransforms VTK::FiltersCore VTK::FiltersExtraction VTK::FiltersGeneral VTK::FiltersGeometry VTK::FiltersImaging VTK::FiltersModeling VTK::FiltersSources VTK::FiltersStatistics VTK::ImagingGeneral VTK::InfovisCore VTK::InfovisLayout VTK::InteractionWidgets VTK::RenderingAnnotation VTK::RenderingCore VTK::RenderingLabel)
|
||||
_populate_target_properties(VTK::ViewsQt VTK::CommonCore VTK::GUISupportQt VTK::ViewsCore VTK::ViewsInfovis VTK::CommonDataModel VTK::CommonExecutionModel VTK::FiltersExtraction VTK::FiltersGeneral VTK::InfovisCore)
|
||||
_populate_target_properties(VTK::WrappingTools)
|
||||
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
# 如果找到所有需要的变量,并且版本匹配,则将VTK_FOUND变量设置为TRUE
|
||||
find_package_handle_standard_args(VTK
|
||||
FOUND_VAR
|
||||
VTK_FOUND
|
||||
REQUIRED_VARS
|
||||
VTK_DIRS
|
||||
VTK_INCLUDE_DIRS
|
||||
VTK_LIBRARY_DIRS
|
||||
VTK_LIBRARIES
|
||||
VTK_BINARY_DIRS
|
||||
VERSION_VAR
|
||||
VTK_VERSION
|
||||
)
|
|
@ -0,0 +1,129 @@
|
|||
if(FASTCAE_ENABLE_DEV)
|
||||
|
||||
if(FASTCAE_WIN)
|
||||
if(NOT EXISTS "$<TARGET_FILE_DIR:${PROJECT_NAME}>/FastCAE.ini")
|
||||
get_target_property(_qmake_executable Qt5::qmake IMPORTED_LOCATION)
|
||||
get_filename_component(_qt_bin_dir "${_qmake_executable}" DIRECTORY)
|
||||
|
||||
foreach(_lib ${FastCAE_Runtimes_Libraries})
|
||||
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:${_lib}>
|
||||
$<TARGET_FILE_DIR:${PROJECT_NAME}>
|
||||
)
|
||||
endforeach()
|
||||
|
||||
# 在windows环境需要拷贝所有依赖库的dll到构建目录
|
||||
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
|
||||
#[[COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_RUNTIME_DLLS:${PROJECT_NAME}>
|
||||
$<TARGET_FILE_DIR:${PROJECT_NAME}>
|
||||
COMMAND_EXPAND_LISTS]]
|
||||
|
||||
COMMAND ${CMAKE_COMMAND} -E copy
|
||||
# 拷贝Gmsh执行程序
|
||||
${Gmsh_EXECUTABLE}
|
||||
$<TARGET_FILE_DIR:${PROJECT_NAME}>
|
||||
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
# 拷贝python的Lib文件夹
|
||||
${Python_DIRS}/Lib
|
||||
$<TARGET_FILE_DIR:${PROJECT_NAME}>/Lib
|
||||
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
# 拷贝python的DLLs文件夹
|
||||
${Python_DIRS}/DLLs
|
||||
$<TARGET_FILE_DIR:${PROJECT_NAME}>/DLLs
|
||||
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
# 拷贝Qt图片格式支持文件
|
||||
${_qt_bin_dir}/../plugins/imageformats
|
||||
$<TARGET_FILE_DIR:${PROJECT_NAME}>/imageformats
|
||||
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
# 拷贝Qt平台支持文件
|
||||
${_qt_bin_dir}/../plugins/platforms
|
||||
$<TARGET_FILE_DIR:${PROJECT_NAME}>/platforms
|
||||
)
|
||||
endif()
|
||||
else()
|
||||
if(NOT EXISTS "$<TARGET_FILE_DIR:${PROJECT_NAME}>/FastCAE.ini")
|
||||
get_target_property(_qmake_executable Qt5::qmake IMPORTED_LOCATION)
|
||||
get_filename_component(_qt_bin_dir "${_qmake_executable}" DIRECTORY)
|
||||
|
||||
foreach(_lib ${FastCAE_Runtimes_Libraries})
|
||||
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_LINKER_FILE:${_lib}>
|
||||
$<TARGET_SONAME_FILE:${_lib}>
|
||||
$<TARGET_FILE_DIR:PythonModule>
|
||||
)
|
||||
endforeach()
|
||||
|
||||
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
|
||||
|
||||
COMMAND ${CMAKE_COMMAND} -E copy
|
||||
${Gmsh_EXECUTABLE}
|
||||
$<TARGET_FILE_DIR:${PROJECT_NAME}>
|
||||
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
# 拷贝python的python3.7文件夹
|
||||
${Python_DIRS}/lib/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}
|
||||
$<TARGET_FILE_DIR:PythonModule>/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}
|
||||
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
# 拷贝Qt图片格式支持文件
|
||||
${_qt_bin_dir}/../plugins/imageformats
|
||||
$<TARGET_FILE_DIR:${PROJECT_NAME}>/imageformats
|
||||
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
${_qt_bin_dir}/../plugins/platforms
|
||||
$<TARGET_FILE_DIR:${PROJECT_NAME}>/platforms
|
||||
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
${_qt_bin_dir}/../plugins/platforminputcontexts
|
||||
$<TARGET_FILE_DIR:${PROJECT_NAME}>/platforminputcontexts
|
||||
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
${_qt_bin_dir}/../plugins/xcbglintegrations
|
||||
$<TARGET_FILE_DIR:${PROJECT_NAME}>/xcbglintegrations
|
||||
|
||||
COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_LINKER_FILE:Qt5::XcbQpa>
|
||||
$<TARGET_SONAME_FILE:Qt5::XcbQpa>
|
||||
$<TARGET_FILE_DIR:PythonModule>
|
||||
)
|
||||
|
||||
file(
|
||||
COPY
|
||||
# 拷贝Qt多国语言支持文件
|
||||
${_qt_bin_dir}/../lib
|
||||
DESTINATION ${DEVRUNTIME_LIBDIR}/..
|
||||
USE_SOURCE_PERMISSIONS
|
||||
FILES_MATCHING
|
||||
PATTERN "cmake*" EXCLUDE
|
||||
PATTERN "pkgconfig*" EXCLUDE
|
||||
PATTERN "libicu*.so*"
|
||||
)
|
||||
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# FastCAE的配置文件,python脚本,有可能会修改,每次构建都会拷贝
|
||||
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
${CMAKE_SOURCE_DIR}/src/PythonModule/py/FastCAE.ini
|
||||
${CMAKE_SOURCE_DIR}/src/PythonModule/py/CAD.py
|
||||
${CMAKE_SOURCE_DIR}/src/PythonModule/py/Case.py
|
||||
${CMAKE_SOURCE_DIR}/src/PythonModule/py/ControlPanel.py
|
||||
${CMAKE_SOURCE_DIR}/src/PythonModule/py/Geometry.py
|
||||
${CMAKE_SOURCE_DIR}/src/PythonModule/py/MainWindow.py
|
||||
${CMAKE_SOURCE_DIR}/src/PythonModule/py/Material.py
|
||||
${CMAKE_SOURCE_DIR}/src/PythonModule/py/Mesh.py
|
||||
${CMAKE_SOURCE_DIR}/src/PythonModule/py/Mesher.py
|
||||
${CMAKE_SOURCE_DIR}/src/PythonModule/py/Post.py
|
||||
${CMAKE_SOURCE_DIR}/src/PythonModule/py/PostProcess.py
|
||||
$<TARGET_FILE_DIR:${PROJECT_NAME}>
|
||||
)
|
||||
|
||||
endif()
|
|
@ -0,0 +1,29 @@
|
|||
macro(buildDoxygenDoc)
|
||||
if (DOXYGEN_FOUND)
|
||||
# set input and output files
|
||||
set(DOXYGEN_IN ${CMAKE_SOURCE_DIR}/docs/Doxyfile.in)
|
||||
set(DOXYGEN_OUT ${CMAKE_BINARY_DIR}/Documentation/Doxygen/Doxyfile)
|
||||
|
||||
# request to configure the file
|
||||
configure_file(
|
||||
${DOXYGEN_IN}
|
||||
${DOXYGEN_OUT}
|
||||
@ONLY
|
||||
)
|
||||
|
||||
# note the option ALL which allows to build the docs together with the application
|
||||
add_custom_target(Doxygen ALL
|
||||
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/Documentation/Doxygen
|
||||
COMMENT "Generating API documentation(html) with Doxygen"
|
||||
VERBATIM )
|
||||
set_target_properties(Doxygen
|
||||
PROPERTIES
|
||||
FOLDER Documentation
|
||||
)
|
||||
else (DOXYGEN_FOUND)
|
||||
message("Doxygen need to be installed to generate the doxygen documentation")
|
||||
endif (DOXYGEN_FOUND)
|
||||
endmacro()
|
||||
|
||||
buildDoxygenDoc()
|
|
@ -0,0 +1,34 @@
|
|||
macro(buildSphinxDoc)
|
||||
if(DOXYGEN_FOUND AND breathe_FOUND)
|
||||
|
||||
set(SPHINX_IN ${CMAKE_SOURCE_DIR}/docs/conf.py.in)
|
||||
set(SPHINX_OUT ${CMAKE_BINARY_DIR}/Documentation/Sphinx/_build/conf.py)
|
||||
|
||||
# BREATHE_DOC_CONF_FILE中的Sphinx模板文件,会通过conf.py配置到的BREATHE_DOC_BUILD_DIR目录下
|
||||
configure_file(
|
||||
${SPHINX_IN}
|
||||
${SPHINX_OUT}
|
||||
@ONLY
|
||||
)
|
||||
|
||||
# note the option ALL which allows to build the docs together with the application
|
||||
add_custom_target(Sphinx ALL
|
||||
COMMAND
|
||||
${SPHINX_EXECUTABLE}
|
||||
-q
|
||||
-b html
|
||||
-c ${CMAKE_BINARY_DIR}/Documentation/Sphinx/_build
|
||||
${CMAKE_SOURCE_DIR}/docs
|
||||
${CMAKE_BINARY_DIR}/Documentation/Sphinx/html
|
||||
COMMENT
|
||||
"Building Sphinx documentation with Breathe, Sphinx and Doxygen"
|
||||
VERBATIM
|
||||
)
|
||||
set_target_properties(Sphinx
|
||||
PROPERTIES
|
||||
FOLDER Documentation
|
||||
)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
buildSphinxDoc()
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,7 @@
|
|||
===============================
|
||||
Classes and functions reference
|
||||
===============================
|
||||
|
||||
.. toctree::
|
||||
|
||||
mainwindow
|
|
@ -0,0 +1,10 @@
|
|||
MainWindow classes
|
||||
==================
|
||||
|
||||
MainWindow
|
||||
----------
|
||||
.. doxygenclass:: GUI::MainWindow
|
||||
:project: FastCAE
|
||||
:members:
|
||||
:protected-members:
|
||||
:private-members:
|
|
@ -0,0 +1,181 @@
|
|||
#!@PYTHON_EXECUTABLE@
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# recipe-03 documentation build configuration file, created by
|
||||
# sphinx-quickstart on Thu Feb 15 17:02:41 2018.
|
||||
#
|
||||
# This file is execfile()d with the current directory set to its
|
||||
# containing dir.
|
||||
#
|
||||
# Note that not all possible configuration values are present in this
|
||||
# autogenerated file.
|
||||
#
|
||||
# All configuration values have a default; values that are commented out
|
||||
# serve to show the default.
|
||||
|
||||
# If extensions (or modules to document with autodoc) are in another directory,
|
||||
# add these directories to sys.path here. If the directory is relative to the
|
||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||
#
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
# -- General configuration ------------------------------------------------
|
||||
|
||||
# If your documentation needs a minimal Sphinx version, state it here.
|
||||
#
|
||||
# needs_sphinx = '1.0'
|
||||
|
||||
# Add any Sphinx extension module names here, as strings. They can be
|
||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||
# ones.
|
||||
extensions = ['breathe']
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['_templates']
|
||||
|
||||
# The suffix(es) of source filenames.
|
||||
# You can specify multiple suffix as a list of string:
|
||||
#
|
||||
source_suffix = ['.rst', '.md']
|
||||
|
||||
# The master toctree document.
|
||||
master_doc = 'index'
|
||||
|
||||
# General information about the project.
|
||||
project = '@PROJECT_NAME@'
|
||||
copyright = 'Since 2018, fastcae.com'
|
||||
author = 'FastCAE团队'
|
||||
|
||||
# The version info for the project you're documenting, acts as replacement for
|
||||
# |version| and |release|, also used in various other places throughout the
|
||||
# built documents.
|
||||
#
|
||||
# The short X.Y version.
|
||||
version = '@PROJECT_VERSION@'
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = '@PROJECT_VERSION@'
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
#
|
||||
# This is also used if you do content translation via gettext catalogs.
|
||||
# Usually you set "language" from the command line for these cases.
|
||||
language = 'zh_CN'
|
||||
|
||||
# List of patterns, relative to source directory, that match files and
|
||||
# directories to ignore when looking for source files.
|
||||
# This patterns also effect to html_static_path and html_extra_path
|
||||
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
|
||||
|
||||
# The name of the Pygments (syntax highlighting) style to use.
|
||||
pygments_style = 'sphinx'
|
||||
|
||||
# If true, `todo` and `todoList` produce output, else they produce nothing.
|
||||
todo_include_todos = False
|
||||
|
||||
# -- Options for HTML output ----------------------------------------------
|
||||
|
||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||
# a list of builtin themes.
|
||||
#
|
||||
html_theme = 'sphinx_rtd_theme'
|
||||
html_theme_options = {
|
||||
# 如果出现 ,则版本号将显示在边栏的顶部
|
||||
'display_version': True,
|
||||
# 仅显示徽标图像,不在侧边栏顶部显示项目名称
|
||||
'logo_only': False,
|
||||
# 显示“下一个”和“上一个”按钮的位置。这可以是 、 、 或 。bottomtopbothNone
|
||||
'prev_next_buttons_location': 'bottom',
|
||||
# 在外部链接旁边添加一个图标
|
||||
'style_external_links': True,
|
||||
# 更改导航栏中搜索区域的背景。该值可以是 CSS 背景属性中有效的任何值
|
||||
#'style_nav_header_background': 'white',
|
||||
# 启用此功能后,导航条目不可展开
|
||||
'collapse_navigation': True,
|
||||
# 滚动页面时,滚动包含主页内容的导航
|
||||
'sticky_navigation': True,
|
||||
# 目录树的最大深度。将此设置为允许无限深度
|
||||
'navigation_depth': 4,
|
||||
# 指定导航是否包括隐藏的内容表,即使用该选项标记的任何 toctree 指令
|
||||
'includehidden': True,
|
||||
# 启用后,导航中不包括页面副标题。
|
||||
'titles_only': True
|
||||
}
|
||||
|
||||
# Theme options are theme-specific and customize the look and feel of a theme
|
||||
# further. For a list of options available for each theme, see the
|
||||
# documentation.
|
||||
#
|
||||
# html_theme_options = {}
|
||||
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||
html_static_path = []
|
||||
|
||||
# Custom sidebar templates, must be a dictionary that maps document names
|
||||
# to template names.
|
||||
#
|
||||
# This is required for the alabaster theme
|
||||
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
|
||||
html_sidebars = {
|
||||
'**': [
|
||||
'relations.html', # needs 'show_related': True theme option to display
|
||||
'searchbox.html',
|
||||
]
|
||||
}
|
||||
|
||||
# -- Options for HTMLHelp output ------------------------------------------
|
||||
|
||||
# Output file base name for HTML help builder.
|
||||
htmlhelp_basename = '@PROJECT_NAME@ Documentation'
|
||||
|
||||
# -- Options for LaTeX output ---------------------------------------------
|
||||
|
||||
latex_elements = {
|
||||
# The paper size ('letterpaper' or 'a4paper').
|
||||
#
|
||||
# 'papersize': 'letterpaper',
|
||||
|
||||
# The font size ('10pt', '11pt' or '12pt').
|
||||
#
|
||||
# 'pointsize': '10pt',
|
||||
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
#
|
||||
# 'preamble': '',
|
||||
|
||||
# Latex figure (float) alignment
|
||||
#
|
||||
# 'figure_align': 'htbp',
|
||||
}
|
||||
|
||||
# Grouping the document tree into LaTeX files. List of tuples
|
||||
# (source start file, target name, title,
|
||||
# author, documentclass [howto, manual, or own class]).
|
||||
latex_documents = [
|
||||
(master_doc, '@PROJECT_NAME@.tex', '@PROJECT_NAME@ Documentation',
|
||||
'Radovan Bast, Roberto Di Remigio', 'manual'),
|
||||
]
|
||||
|
||||
# -- Options for manual page output ---------------------------------------
|
||||
|
||||
# One entry per manual page. List of tuples
|
||||
# (source start file, name, description, authors, manual section).
|
||||
man_pages = [(master_doc, '@PROJECT_NAME@', '@PROJECT_NAME@ Documentation', [author], 1)]
|
||||
|
||||
# -- Options for Texinfo output -------------------------------------------
|
||||
|
||||
# Grouping the document tree into Texinfo files. List of tuples
|
||||
# (source start file, target name, title, author,
|
||||
# dir menu entry, description, category)
|
||||
texinfo_documents = [
|
||||
(master_doc, '@PROJECT_NAME@', '@PROJECT_NAME@ Documentation', author, '@PROJECT_NAME@',
|
||||
'One line description of project.', 'Miscellaneous'),
|
||||
]
|
||||
|
||||
breathe_projects = {'@PROJECT_NAME@': '@CMAKE_BINARY_DIR@/Documentation/Doxygen/xml'}
|
||||
breathe_default_project = "@PROJECT_NAME@"
|
|
@ -0,0 +1,20 @@
|
|||
.. recipe-03 documentation master file, created by
|
||||
sphinx-quickstart on Thu Feb 15 17:02:41 2018.
|
||||
You can adapt this file completely to your liking, but it should at least
|
||||
contain the root `toctree` directive.
|
||||
|
||||
Welcome to FastCAE's documentation!
|
||||
=====================================
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:caption: Contents:
|
||||
|
||||
code-reference/classes-and-functions
|
||||
|
||||
Indices and tables
|
||||
==================
|
||||
|
||||
* :ref:`genindex`
|
||||
* :ref:`modindex`
|
||||
* :ref:`search`
|
|
@ -0,0 +1,102 @@
|
|||
#include "BCBase.h"
|
||||
#include "MeshData/meshSingleton.h"
|
||||
#include "MeshData/meshSet.h"
|
||||
#include "Geometry/GeoComponent.h"
|
||||
#include "Geometry/geometryData.h"
|
||||
#include <QDomElement>
|
||||
#include <QDomDocument>
|
||||
#include <QDomAttr>
|
||||
#include <QObject>
|
||||
#include <QDebug>
|
||||
|
||||
namespace BCBase
|
||||
{
|
||||
BCBase::BCBase()
|
||||
{
|
||||
// setID(++BCID);
|
||||
_mesh = MeshData::MeshData::getInstance();
|
||||
this->setModuleType(DataProperty::Module_BC);
|
||||
}
|
||||
void BCBase::bingdingComponentID(int id)
|
||||
{
|
||||
QString qType{};
|
||||
auto set = _mesh->getMeshSetByID(id);
|
||||
if (set)
|
||||
{
|
||||
_component = set;
|
||||
qType = MeshData::MeshSet::setTypeToString(set->getSetType());
|
||||
appendProperty("MeshSetID", id);
|
||||
appendProperty("MeshSetType", qType);
|
||||
}
|
||||
else
|
||||
{
|
||||
auto gc = Geometry::GeometryData::getInstance()->getGeoComponentByID(id);
|
||||
if (gc == nullptr)
|
||||
return;
|
||||
_component = gc;
|
||||
qType = Geometry::GeoComponent::gcTypeToString(gc->getGCType());
|
||||
appendProperty("GeoComponentID", id);
|
||||
appendProperty("GeoComponentType", qType);
|
||||
}
|
||||
_ComponentID = id;
|
||||
}
|
||||
int BCBase::getComponentID()
|
||||
{
|
||||
return _ComponentID;
|
||||
}
|
||||
DataProperty::ComponentBase *BCBase::getComponent()
|
||||
{
|
||||
return _component;
|
||||
}
|
||||
QString BCBase::getComponentName()
|
||||
{
|
||||
if (_component == nullptr)
|
||||
return "FFFFFF";
|
||||
else
|
||||
return _component->getName();
|
||||
}
|
||||
void BCBase::setBCType(BCType t)
|
||||
{
|
||||
_BCtype = t;
|
||||
appendProperty(QObject::tr("BCType"), BCTypeToString(t));
|
||||
}
|
||||
BCType BCBase::getBCType()
|
||||
{
|
||||
return _BCtype;
|
||||
}
|
||||
QDomElement &BCBase::writeToProjectFile(QDomDocument *doc, QDomElement *parent)
|
||||
{
|
||||
Q_UNUSED(doc)
|
||||
QString st = BCTypeToString(_BCtype);
|
||||
parent->setAttribute("Type", st);
|
||||
// QDomElement cpIDEle = doc->createElement("BCComponentInfo");
|
||||
// cpIDEle.setAttribute("ComponentID", _ComponentID);
|
||||
// parent->appendChild(cpIDEle);
|
||||
parent->setAttribute("SetID", QString::number(_ComponentID));
|
||||
return *parent;
|
||||
}
|
||||
void BCBase::readDataFromProjectFile(QDomElement *bcele)
|
||||
{
|
||||
QString stype = bcele->attribute("Type");
|
||||
BCType type = StringToBCType(stype);
|
||||
setBCType(type);
|
||||
// QDomElement cpInfoEle = bcele->elementsByTagName("BCComponentInfo").at(0).toElement();
|
||||
// QString sID = cpInfoEle.attribute("ComponentID");
|
||||
// bingdingComponentID(sID.toInt());
|
||||
QString sID = bcele->attribute("SetID");
|
||||
int id = sID.toInt();
|
||||
bingdingComponentID(id);
|
||||
}
|
||||
void BCBase::copy(DataBase *d)
|
||||
{
|
||||
BCBase *data = (BCBase *)d;
|
||||
this->setBCType(data->getBCType());
|
||||
this->bingdingComponentID(data->getComponentID());
|
||||
DataBase::copy(d);
|
||||
}
|
||||
|
||||
void BCBase::setComponent(DataProperty::ComponentBase *cp)
|
||||
{
|
||||
_component = cp;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,113 @@
|
|||
/**
|
||||
* @file BCBase.h
|
||||
* @brief 边界条件基类,包含组件绑定、边界类型设置、xml文件相关内容读写
|
||||
* @author FastCAE研发小组(fastcae@diso.cn)
|
||||
* @version 2.5.0
|
||||
* @date 2022-07-06 09:12
|
||||
* @copyright Copyright (c) Since 2020 青岛数智船海科技有限公司 All rights reserved.
|
||||
*
|
||||
* ============================================================================
|
||||
* Program: FastCAE
|
||||
*
|
||||
* Copyright (c) Since 2020 青岛数智船海科技有限公司 All rights reserved.
|
||||
* See License or http://www.fastcae.com/ for details.
|
||||
*
|
||||
* BSD 3-Clause License
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED.
|
||||
* ==================================================================================
|
||||
*/
|
||||
#ifndef _BCBASE_H_
|
||||
#define _BCBASE_H_
|
||||
|
||||
#include "BCBaseAPI.h"
|
||||
#include "DataProperty/DataBase.h"
|
||||
#include "DataProperty/ComponentBase.h"
|
||||
#include "BCType.h"
|
||||
|
||||
namespace MeshData
|
||||
{
|
||||
class MeshData;
|
||||
class MeshSet;
|
||||
}
|
||||
|
||||
namespace Geometry
|
||||
{
|
||||
class GeoComponent;
|
||||
}
|
||||
|
||||
namespace BCBase
|
||||
{
|
||||
/**
|
||||
* @brief 边界条件基类
|
||||
* @since 2.5.0
|
||||
*/
|
||||
class BCBASEAPI BCBase : public DataProperty::DataBase
|
||||
{
|
||||
public:
|
||||
BCBase();
|
||||
~BCBase() = default;
|
||||
/**
|
||||
* @brief 拷贝数据
|
||||
* @param data 要拷贝的源数据
|
||||
* @since 2.5.0
|
||||
*/
|
||||
virtual void copy(DataBase *data) override;
|
||||
/**
|
||||
* @brief 绑定组件ID
|
||||
* @param id 组件ID
|
||||
* @since 2.5.0
|
||||
*/
|
||||
void bingdingComponentID(int id);
|
||||
/**
|
||||
* @brief 获取绑定组件的ID
|
||||
* @return int 组件ID
|
||||
* @since 2.5.0
|
||||
*/
|
||||
int getComponentID();
|
||||
/**
|
||||
* @brief 获取绑定组件的名称
|
||||
* @return QString 组件名称
|
||||
* @since 2.5.0
|
||||
*/
|
||||
QString getComponentName();
|
||||
/**
|
||||
* @brief 获取绑定的组件对象(几何组件或网格组件)
|
||||
* @return DataProperty::ComponentBase* 组件对象指针
|
||||
* @since 2.5.0
|
||||
*/
|
||||
DataProperty::ComponentBase *getComponent();
|
||||
/**
|
||||
* @brief 设置组件
|
||||
* @since 2.5.0
|
||||
*/
|
||||
void setComponent(DataProperty::ComponentBase *);
|
||||
/**
|
||||
* @brief 设置边界条件类型
|
||||
* @param t 边界条件类型
|
||||
* @since 2.5.0
|
||||
*/
|
||||
void setBCType(BCType t);
|
||||
/**
|
||||
* @brief 获取边界条件类型
|
||||
* @return BCType 边界条件类型
|
||||
* @since 2.5.0
|
||||
*/
|
||||
BCType getBCType();
|
||||
|
||||
virtual QDomElement &writeToProjectFile(QDomDocument *doc, QDomElement *parent) override;
|
||||
virtual void readDataFromProjectFile(QDomElement *ele) override;
|
||||
|
||||
protected:
|
||||
BCType _BCtype{None};
|
||||
int _ComponentID{-1};
|
||||
|
||||
DataProperty::ComponentBase *_component{};
|
||||
MeshData::MeshData *_mesh{};
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
|
@ -0,0 +1,13 @@
|
|||
#ifndef _BCBASEAPI_H_
|
||||
#define _BCBASEAPI_H_
|
||||
|
||||
#include <QtCore/QtGlobal>
|
||||
|
||||
|
||||
#if defined(BCBASE_API)
|
||||
#define BCBASEAPI Q_DECL_EXPORT
|
||||
#else
|
||||
#define BCBASEAPI Q_DECL_IMPORT
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -0,0 +1,13 @@
|
|||
#include "BCDisplacement.h"
|
||||
#include "DataProperty/ParameterDouble.h"
|
||||
#include <QObject>
|
||||
|
||||
namespace BCBase
|
||||
{
|
||||
BCDisplacement::BCDisplacement() : BCVectorBase()
|
||||
{
|
||||
_valueX->setDescribe(QObject::tr("Displacement X"));
|
||||
_valueY->setDescribe(QObject::tr("Displacement Y"));
|
||||
_valueZ->setDescribe(QObject::tr("Displacement Z"));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
#ifndef _BCDISPLACEMENT_H_
|
||||
#define _BCDISPLACEMENT_H_
|
||||
|
||||
#include "BCVectorBase.h"
|
||||
|
||||
namespace BCBase
|
||||
{
|
||||
/**
|
||||
* @brief 位移边界条件
|
||||
* @since 2.5.0
|
||||
*/
|
||||
class BCBASEAPI BCDisplacement : public BCVectorBase
|
||||
{
|
||||
public:
|
||||
BCDisplacement();
|
||||
~BCDisplacement() = default;
|
||||
|
||||
protected:
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
|
@ -0,0 +1,15 @@
|
|||
#include "BCPressure.h"
|
||||
#include "DataProperty/ParameterDouble.h"
|
||||
#include <QObject>
|
||||
|
||||
namespace BCBase
|
||||
{
|
||||
BCPressure::BCPressure() : BCVectorBase()
|
||||
{
|
||||
_valueX->setDescribe(QObject::tr("Pressure X"));
|
||||
_valueY->setDescribe(QObject::tr("Pressure Y"));
|
||||
_valueZ->setDescribe(QObject::tr("Pressure Z"));
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
#ifndef _BCPRESSURE_H_
|
||||
#define _BCPRESSURE_H_
|
||||
|
||||
#include "BCVectorBase.h"
|
||||
|
||||
namespace BCBase
|
||||
{
|
||||
/**
|
||||
* @brief 压力边界条件
|
||||
* @since 2.5.0
|
||||
*/
|
||||
class BCBASEAPI BCPressure : public BCVectorBase
|
||||
{
|
||||
public:
|
||||
BCPressure();
|
||||
~BCPressure() = default;
|
||||
|
||||
protected:
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
|
@ -0,0 +1,54 @@
|
|||
#include "BCScalarBase.h"
|
||||
#include "DataProperty/ParameterDouble.h"
|
||||
#include <QDomElement>
|
||||
#include <QDomDocument>
|
||||
#include <QDomText>
|
||||
#include <QDomNodeList>
|
||||
#include <QString>
|
||||
|
||||
namespace BCBase
|
||||
{
|
||||
BCScalarBase::BCScalarBase(BCType type)
|
||||
{
|
||||
setBCType(type);
|
||||
DataProperty::ParameterBase* p = this->appendParameter(DataProperty::Para_Double);
|
||||
_value = (DataProperty::ParameterDouble*)p;
|
||||
}
|
||||
|
||||
BCScalarBase::BCScalarBase()
|
||||
{
|
||||
DataProperty::ParameterBase* p = this->appendParameter(DataProperty::Para_Double);
|
||||
_value = (DataProperty::ParameterDouble*)p;
|
||||
}
|
||||
void BCScalarBase::setVariableName(QString s)
|
||||
{
|
||||
_value->setDescribe(s);
|
||||
}
|
||||
void BCScalarBase::setValue(double v)
|
||||
{
|
||||
_value->setValue(v);
|
||||
}
|
||||
|
||||
double BCScalarBase::getValue()
|
||||
{
|
||||
return _value->getValue();
|
||||
}
|
||||
QDomElement& BCScalarBase::writeToProjectFile(QDomDocument* doc, QDomElement* parent)
|
||||
{
|
||||
BCBase::writeToProjectFile(doc, parent);
|
||||
QDomElement valueele = doc->createElement("Value");
|
||||
_value->writeParameter(doc, &valueele);
|
||||
parent->appendChild(valueele);
|
||||
|
||||
return *parent;
|
||||
}
|
||||
void BCScalarBase::readDataFromProjectFile(QDomElement* ele)
|
||||
{
|
||||
BCBase::readDataFromProjectFile(ele);
|
||||
QDomNodeList vlist = ele->elementsByTagName("Value");
|
||||
if (vlist.size() != 1) return;
|
||||
QDomElement vele = vlist.at(0).toElement();
|
||||
_value->readParameter(&vele);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
#ifndef _BCSCALARBASE_H_
|
||||
#define _BCSCALARBASE_H_
|
||||
|
||||
#include "BCBaseAPI.h"
|
||||
#include "BCBase.h"
|
||||
|
||||
namespace DataProperty
|
||||
{
|
||||
class ParameterDouble;
|
||||
}
|
||||
|
||||
namespace BCBase
|
||||
{
|
||||
/**
|
||||
* @brief 标量边界条件
|
||||
* @since 2.5.0
|
||||
*/
|
||||
class BCBASEAPI BCScalarBase : public BCBase
|
||||
{
|
||||
public:
|
||||
BCScalarBase();
|
||||
BCScalarBase(BCType type);
|
||||
~BCScalarBase() = default;
|
||||
//设置值
|
||||
void setValue(double v);
|
||||
//获取值
|
||||
double getValue();
|
||||
//设置变量名称
|
||||
void setVariableName(QString s);
|
||||
|
||||
virtual QDomElement &writeToProjectFile(QDomDocument *doc, QDomElement *parent) override;
|
||||
virtual void readDataFromProjectFile(QDomElement *ele) override;
|
||||
|
||||
protected:
|
||||
DataProperty::ParameterDouble *_value{};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
|
@ -0,0 +1,13 @@
|
|||
#include "BCTemperature.h"
|
||||
#include "DataProperty/ParameterDouble.h"
|
||||
#include <QObject>
|
||||
|
||||
namespace BCBase
|
||||
{
|
||||
BCTemperature::BCTemperature() : BCScalarBase(BCType::Temperature)
|
||||
{
|
||||
_value->setDescribe(QObject::tr("Temperature"));
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
#ifndef _BCTEMPERATURE_H_
|
||||
#define _BCTEMPERATURE_H_
|
||||
|
||||
#include "BCScalarBase.h"
|
||||
|
||||
namespace BCBase
|
||||
{
|
||||
/**
|
||||
* @brief 温度边界条件
|
||||
* @since 2.5.0
|
||||
*/
|
||||
class BCBASEAPI BCTemperature : public BCScalarBase
|
||||
{
|
||||
public:
|
||||
BCTemperature();
|
||||
~BCTemperature() = default;
|
||||
|
||||
protected:
|
||||
private:
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
|
@ -0,0 +1,108 @@
|
|||
#include "BCType.h"
|
||||
|
||||
namespace BCBase
|
||||
{
|
||||
QString BCTypeToString(BCType t)
|
||||
{
|
||||
QString s = "None";
|
||||
switch (t)
|
||||
{
|
||||
case BCBase::Pressure:
|
||||
s = "Pressure"; break;
|
||||
case BCBase::Velocity:
|
||||
s = "Velocity"; break;
|
||||
case BCBase::Temperature:
|
||||
s = "Temperature"; break;
|
||||
case BCBase::FixSupport:
|
||||
s = "FixSupport"; break;
|
||||
case BCBase::Displacement:
|
||||
s = "Displacement"; break;
|
||||
case BCBase::AngleVelocity:
|
||||
s = "AngleVelocity"; break;
|
||||
case BCBase::Rotation:
|
||||
s = "Rotation"; break;
|
||||
case BCBase::Acceleration:
|
||||
s = "Acceleration"; break;
|
||||
case BCBase::AngleAcceleration:
|
||||
s = "AngleAcceleration"; break;
|
||||
case BCBase::Inlet:
|
||||
s = "Inlet"; break;
|
||||
case BCBase::Outlet:
|
||||
s = "Outlet"; break;
|
||||
case BCBase::Symmetry:
|
||||
s = "Symmetry"; break;
|
||||
case BCBase::Wall:
|
||||
s = "Wall"; break;
|
||||
case BCBase::UserDef:
|
||||
s = "UserDefine"; break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
BCType StringToBCType(QString s)
|
||||
{
|
||||
BCType t = None;
|
||||
|
||||
if (s == "Pressure") t = Pressure;
|
||||
else if (s == "Temperature") t = Temperature;
|
||||
else if (s == "Velocity") t = Velocity;
|
||||
else if (s == "FixSupport") t = FixSupport;
|
||||
else if (s == "Displacement") t = Displacement;
|
||||
else if (s == "AngleVelocity") t = AngleVelocity;
|
||||
else if (s == "Rotation") t = Rotation;
|
||||
else if (s == "Acceleration") t = Acceleration;
|
||||
else if (s == "AngleAcceleration") t = AngleAcceleration;
|
||||
else if (s == "Inlet") t = Inlet;
|
||||
else if (s == "Outlet") t = Outlet;
|
||||
else if (s == "Symmetry") t = Symmetry;
|
||||
else if (s == "Wall") t = Wall;
|
||||
else if (s == "UserDefine") t = UserDef;
|
||||
else t = UserDef;
|
||||
return t;
|
||||
}
|
||||
|
||||
QString BCBASEAPI BCIconByType(BCType t)
|
||||
{
|
||||
QString s;
|
||||
switch (t)
|
||||
{
|
||||
case BCBase::Pressure:
|
||||
s = "://QUI/icon/press.png"; break;
|
||||
case BCBase::Velocity:
|
||||
s = "://QUI/icon/speed.png"; break;
|
||||
case BCBase::Temperature:
|
||||
s = "://QUI/icon/tempure.png"; break;
|
||||
case BCBase::FixSupport:
|
||||
s = "://QUI/icon/fix.png"; break;
|
||||
case BCBase::Displacement:
|
||||
s = "Displacement"; break;
|
||||
case BCBase::AngleVelocity:
|
||||
s = "AngleVelocity"; break;
|
||||
case BCBase::Rotation:
|
||||
s = "://QUI/icon/angle.png"; break;
|
||||
case BCBase::Acceleration:
|
||||
s = "://QUI/icon/acce.png"; break;
|
||||
case BCBase::AngleAcceleration:
|
||||
s = "AngleAcceleration"; break;
|
||||
case BCBase::Inlet:
|
||||
s = "://QUI/icon/inlet.png"; break;
|
||||
case BCBase::Outlet:
|
||||
s = "://QUI/icon/outlet.png"; break;
|
||||
case BCBase::Symmetry:
|
||||
s = "://QUI/icon/symmetry.png"; break;
|
||||
case BCBase::Wall:
|
||||
s = "://QUI/icon/wall.png"; break;
|
||||
case BCBase::UserDef:
|
||||
// s = "UserDefine"; break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
/**
|
||||
* @file BCType.h
|
||||
* @brief 边界条件类型
|
||||
* @author FastCAE研发小组(fastcae@diso.cn)
|
||||
* @version 2.5.0
|
||||
* @date 2022-07-06 08:53
|
||||
* @copyright Copyright (c) Since 2020 青岛数智船海科技有限公司 All rights reserved.
|
||||
*
|
||||
* ============================================================================
|
||||
* Program: FastCAE
|
||||
*
|
||||
* Copyright (c) Since 2020 青岛数智船海科技有限公司 All rights reserved.
|
||||
* See License or http://www.fastcae.com/ for details.
|
||||
*
|
||||
* BSD 3-Clause License
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED.
|
||||
* ==================================================================================
|
||||
*/
|
||||
#ifndef _BCTYPE_H_
|
||||
#define _BCTYPE_H_
|
||||
|
||||
#include <QString>
|
||||
#include "BCBaseAPI.h"
|
||||
|
||||
namespace BCBase
|
||||
{
|
||||
/**
|
||||
* @brief 边界条件类型枚举类型
|
||||
* @since 2.5.0
|
||||
*/
|
||||
enum BCType
|
||||
{
|
||||
None = 0, ///< 无
|
||||
|
||||
Pressure, ///< 压力
|
||||
Velocity, ///< 速度
|
||||
Temperature, ///< 温度
|
||||
FixSupport, ///< 固定支撑
|
||||
Displacement, ///< 位移
|
||||
AngleVelocity, ///< 角速度
|
||||
Rotation, ///< 转角
|
||||
Acceleration, ///< 加速度
|
||||
AngleAcceleration, ///< 角加速度
|
||||
Inlet, ///< 入口
|
||||
Outlet, ///< 出口
|
||||
Symmetry, ///< 对称面
|
||||
Wall, ///< 壁面
|
||||
End, ///< 标记位(当枚举值作为int处理时,从None到End为内置边界条件类型)
|
||||
UserDef, ///< 用户自定义
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief 边界条件枚举值转换为字符串
|
||||
* @param t 枚举值
|
||||
* @return QString 返回转换后的字符串
|
||||
* @since 2.5.0
|
||||
*/
|
||||
extern QString BCBASEAPI BCTypeToString(BCType t);
|
||||
|
||||
extern QString BCBASEAPI BCIconByType(BCType t);
|
||||
|
||||
extern BCType BCBASEAPI StringToBCType(QString s);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
|
@ -0,0 +1,77 @@
|
|||
#include "BCUserDef.h"
|
||||
#include <QDomDocument>
|
||||
#include <QDomElement>
|
||||
#include <QDomAttr>
|
||||
#include <QDir>
|
||||
#include <QDebug>
|
||||
|
||||
namespace BCBase
|
||||
{
|
||||
BCUserDef::BCUserDef()
|
||||
{
|
||||
this->setBCType(UserDef);
|
||||
}
|
||||
|
||||
QString BCUserDef::getName()
|
||||
{
|
||||
return _name;
|
||||
}
|
||||
void BCUserDef::setName(QString s)
|
||||
{
|
||||
_name = s;
|
||||
// appendProperty(QObject::tr("Name"), _name);
|
||||
}
|
||||
|
||||
QString BCUserDef::getChinese()
|
||||
{
|
||||
return _chinese;
|
||||
}
|
||||
|
||||
void BCUserDef::setChinese(QString s)
|
||||
{
|
||||
_chinese = s;
|
||||
}
|
||||
|
||||
QDomElement& BCUserDef::writeToProjectFile(QDomDocument* doc, QDomElement* parent)
|
||||
{
|
||||
BCBase::writeToProjectFile(doc, parent);
|
||||
QDomAttr attr = doc->createAttribute("Name");
|
||||
attr.setValue(_name);
|
||||
parent->setAttributeNode(attr);
|
||||
QDomAttr cattr = doc->createAttribute("Chinese");
|
||||
cattr.setValue(_chinese);
|
||||
parent->setAttributeNode(cattr);
|
||||
// QString icon = _icon.name();
|
||||
// qDebug() << icon;
|
||||
BCBase::writeParameters(doc, parent);
|
||||
|
||||
return *parent;
|
||||
}
|
||||
void BCUserDef::setIcon(QString icon)
|
||||
{
|
||||
// QString path = QDir::currentPath();
|
||||
_icon = icon;
|
||||
|
||||
}
|
||||
QString BCUserDef::getIcon()
|
||||
{
|
||||
return _icon;
|
||||
}
|
||||
void BCUserDef::readDataFromProjectFile(QDomElement*e)
|
||||
{
|
||||
BCBase::readDataFromProjectFile(e);
|
||||
_name = e->attribute("Name");
|
||||
_chinese = e->attribute("Chinese");
|
||||
QString icon = e->attribute("Icon");
|
||||
this->setIcon(icon);
|
||||
DataBase::readParameters(e);
|
||||
}
|
||||
void BCUserDef::copy(DataBase* data)
|
||||
{
|
||||
_name = ((BCUserDef*)data)->getName();
|
||||
_chinese = ((BCUserDef*)data)->getChinese();
|
||||
_icon = ((BCUserDef*)data)->getIcon();
|
||||
BCBase::copy(data);
|
||||
// setName(_name);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
#ifndef _BCUSERDEF_H_
|
||||
#define _BCUSERDEF_H_
|
||||
|
||||
#include "BCBase.h"
|
||||
#include <QString>
|
||||
#include <QIcon>
|
||||
|
||||
class QDomElement;
|
||||
class QDomDocument;
|
||||
|
||||
namespace BCBase
|
||||
{
|
||||
/**
|
||||
* @brief 用户自定义的边界条件
|
||||
* @since 2.5.0
|
||||
*/
|
||||
class BCBASEAPI BCUserDef : public BCBase
|
||||
{
|
||||
public:
|
||||
BCUserDef();
|
||||
~BCUserDef() = default;
|
||||
|
||||
void copy(DataBase *data) override;
|
||||
|
||||
QString getName();
|
||||
void setName(QString s);
|
||||
QString getChinese();
|
||||
void setChinese(QString s);
|
||||
void setIcon(QString icon);
|
||||
QString getIcon();
|
||||
|
||||
QDomElement &writeToProjectFile(QDomDocument *doc, QDomElement *parent) override;
|
||||
void readDataFromProjectFile(QDomElement *ele) override;
|
||||
|
||||
private:
|
||||
QString _name{};
|
||||
QString _chinese{};
|
||||
QString _icon{};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
|
@ -0,0 +1,114 @@
|
|||
#include "BCVectorBase.h"
|
||||
#include "DataProperty/ParameterDouble.h"
|
||||
#include <QDomElement>
|
||||
#include <QDomDocument>
|
||||
#include <QDomText>
|
||||
#include <QDomNodeList>
|
||||
#include <QString>
|
||||
|
||||
namespace BCBase
|
||||
{
|
||||
BCVectorBase::BCVectorBase()
|
||||
{
|
||||
_valueX = new DataProperty::ParameterDouble;
|
||||
_valueY = new DataProperty::ParameterDouble;
|
||||
_valueZ = new DataProperty::ParameterDouble;
|
||||
appendParameter(_valueX);
|
||||
appendParameter(_valueY);
|
||||
appendParameter(_valueZ);
|
||||
_valueX->setAccuracy(4);
|
||||
_valueY->setAccuracy(4);
|
||||
_valueZ->setAccuracy(4);
|
||||
}
|
||||
BCVectorBase::BCVectorBase(BCType type,double x, double y, double z)
|
||||
{
|
||||
_valueX = new DataProperty::ParameterDouble;
|
||||
_valueY = new DataProperty::ParameterDouble;
|
||||
_valueZ = new DataProperty::ParameterDouble;
|
||||
appendParameter(_valueX);
|
||||
appendParameter(_valueY);
|
||||
appendParameter(_valueZ);
|
||||
_valueX->setAccuracy(4);
|
||||
_valueY->setAccuracy(4);
|
||||
_valueZ->setAccuracy(4);
|
||||
setBCType(type);
|
||||
setValue(x, y, z);
|
||||
}
|
||||
BCVectorBase::BCVectorBase(BCType type, double* v)
|
||||
{
|
||||
_valueX = new DataProperty::ParameterDouble;
|
||||
_valueY = new DataProperty::ParameterDouble;
|
||||
_valueZ = new DataProperty::ParameterDouble;
|
||||
appendParameter(_valueX);
|
||||
appendParameter(_valueY);
|
||||
appendParameter(_valueZ);
|
||||
_valueX->setAccuracy(4);
|
||||
_valueY->setAccuracy(4);
|
||||
_valueZ->setAccuracy(4);
|
||||
setBCType(type);
|
||||
setValue(v);
|
||||
}
|
||||
void BCVectorBase::setVariableName(QString x, QString y, QString z)
|
||||
{
|
||||
_valueX->setDescribe(x);
|
||||
_valueY->setDescribe(y);
|
||||
_valueZ->setDescribe(z);
|
||||
}
|
||||
void BCVectorBase::setValue(double* v)
|
||||
{
|
||||
_valueX->setValue(v[0]);
|
||||
_valueY->setValue(v[1]);
|
||||
_valueZ->setValue(v[2]);
|
||||
}
|
||||
void BCVectorBase::setValue(double x, double y, double z)
|
||||
{
|
||||
_valueX->setValue(x);
|
||||
_valueY->setValue(y);
|
||||
_valueZ->setValue(z);
|
||||
}
|
||||
void BCVectorBase::getValue(double* v)
|
||||
{
|
||||
v[0] = _valueX->getValue();
|
||||
v[1] = _valueY->getValue();
|
||||
v[2] = _valueZ->getValue();
|
||||
}
|
||||
QDomElement& BCVectorBase::writeToProjectFile(QDomDocument* doc, QDomElement* parent)
|
||||
{
|
||||
BCBase::writeToProjectFile(doc, parent);
|
||||
QDomElement xele = doc->createElement("ValueX");
|
||||
QDomElement yele = doc->createElement("ValueY");
|
||||
QDomElement zele = doc->createElement("ValueZ");
|
||||
_valueX->writeParameter(doc, &xele);
|
||||
_valueY->writeParameter(doc, &yele);
|
||||
_valueZ->writeParameter(doc, &zele);
|
||||
|
||||
parent->appendChild(xele);
|
||||
parent->appendChild(yele);
|
||||
parent->appendChild(zele);
|
||||
|
||||
return *parent;
|
||||
}
|
||||
void BCVectorBase::readDataFromProjectFile(QDomElement* ele)
|
||||
{
|
||||
BCBase::readDataFromProjectFile(ele);
|
||||
QDomNodeList xlist = ele->elementsByTagName("ValueX");
|
||||
if (xlist.size() == 1)
|
||||
{
|
||||
QDomElement xele = xlist.at(0).toElement();
|
||||
_valueX->readParameter(&xele);
|
||||
}
|
||||
QDomNodeList ylist = ele->elementsByTagName("ValueY");
|
||||
if (xlist.size() == 1)
|
||||
{
|
||||
QDomElement yele = ylist.at(0).toElement();
|
||||
_valueY->readParameter(&yele);
|
||||
}
|
||||
QDomNodeList zlist = ele->elementsByTagName("ValueZ");
|
||||
if (zlist.size() == 1)
|
||||
{
|
||||
QDomElement zele = zlist.at(0).toElement();
|
||||
_valueZ->readParameter(&zele);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
#ifndef _BCVECTORBASE_H_
|
||||
#define _BCVECTORBASE_H_
|
||||
|
||||
#include "BCBase.h"
|
||||
#include "BCBaseAPI.h"
|
||||
|
||||
namespace DataProperty
|
||||
{
|
||||
class ParameterDouble;
|
||||
}
|
||||
|
||||
namespace BCBase
|
||||
{
|
||||
/**
|
||||
* @brief 矢量边界条件
|
||||
* @since 2.5.0
|
||||
*/
|
||||
class BCBASEAPI BCVectorBase : public BCBase
|
||||
{
|
||||
public:
|
||||
BCVectorBase();
|
||||
BCVectorBase(BCType type, double *v);
|
||||
BCVectorBase(BCType type, double x, double y, double z);
|
||||
~BCVectorBase() = default;
|
||||
//设置三个变量名称
|
||||
void setVariableName(QString x, QString y, QString z);
|
||||
//设置值
|
||||
void setValue(double *v);
|
||||
void setValue(double x, double y, double z);
|
||||
//获取值
|
||||
void getValue(double *v);
|
||||
|
||||
virtual QDomElement &writeToProjectFile(QDomDocument *doc, QDomElement *parent) override;
|
||||
virtual void readDataFromProjectFile(QDomElement *ele) override;
|
||||
|
||||
protected:
|
||||
DataProperty::ParameterDouble *_valueX{};
|
||||
DataProperty::ParameterDouble *_valueY{};
|
||||
DataProperty::ParameterDouble *_valueZ{};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
|
@ -0,0 +1,52 @@
|
|||
#-----------------------------------------------------------------------------
|
||||
# 头文件搜索路径
|
||||
#-----------------------------------------------------------------------------
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 自动添加include目录
|
||||
#-----------------------------------------------------------------------------
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 源码扫描
|
||||
#-----------------------------------------------------------------------------
|
||||
file(GLOB _header "*.h")
|
||||
file(GLOB _source "*.cpp")
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 添加动态库目标
|
||||
#-----------------------------------------------------------------------------
|
||||
add_library(BCBase
|
||||
${_header}
|
||||
${_source}
|
||||
)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 添加接口声明宏
|
||||
#-----------------------------------------------------------------------------
|
||||
target_compile_definitions(BCBase PRIVATE "BCBASE_API")
|
||||
|
||||
list(APPEND _depend_library DataProperty MeshData Geometry)
|
||||
|
||||
list(APPEND _runtimes_libraries
|
||||
Qt5::Xml Qt5::Widgets
|
||||
)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 链接依赖库
|
||||
#-----------------------------------------------------------------------------
|
||||
target_link_libraries(BCBase PRIVATE
|
||||
${_runtimes_libraries}
|
||||
${_depend_library}
|
||||
)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 添加依赖关系
|
||||
#-----------------------------------------------------------------------------
|
||||
set(FastCAE_BCBase_Runtimes_Libraries ${_runtimes_libraries} PARENT_SCOPE)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 添加依赖关系
|
||||
#-----------------------------------------------------------------------------
|
||||
add_dependencies(BCBase ${_depend_library})
|
|
@ -0,0 +1,91 @@
|
|||
set(SOVERSION ${PROJECT_VERSION} ${PROJECT_VERSION_MAJOR} ${PROJECT_VERSION_MINOR} ${PROJECT_VERSION_PATCH})
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 所有项目
|
||||
#-----------------------------------------------------------------------------
|
||||
list(APPEND _libraries Common PythonModule SARibbonBar Settings DataProperty MeshData SelfDefObject Material Geometry BCBase ConfigOptions ParaClassFactory ModelData ModuleBase PostAlgorithm PostRenderData PostInterface PostCurveDataManager PostPlotWidget PostWidgets GeometryDataExchange ProjectTree ProjectTreeExtend GeometryCommand GeometryWidgets PluginManager GmshModule IO SolverControl MainWidgets UserGuidence)
|
||||
|
||||
#[[if(_WIN_)
|
||||
list(APPEND _libraries XGenerateReport License)
|
||||
endif()]]
|
||||
|
||||
list(APPEND _libraries MainWindow ${PROJECT_NAME})
|
||||
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 处理FastCAE程序的RPATH
|
||||
#-----------------------------------------------------------------------------
|
||||
file(RELATIVE_PATH _rel ${CMAKE_INSTALL_PREFIX}/${INSTALL_BINDIR} ${CMAKE_INSTALL_PREFIX})
|
||||
|
||||
if(_APPLE_)
|
||||
set(_rpath "@loader_path/${_rel}")
|
||||
else()
|
||||
set(_rpath "\$ORIGIN:\$ORIGIN/${_rel}")
|
||||
endif()
|
||||
|
||||
file(TO_NATIVE_PATH "${_rpath}/${INSTALL_LIBDIR}" _lib_rpath)
|
||||
|
||||
# 遗漏两个,临时解决方案
|
||||
list(APPEND FastCAE_Runtimes_Libraries VTK::loguru VTK::gl2ps Qt5::DBus)
|
||||
|
||||
foreach(_library ${_libraries})
|
||||
|
||||
add_subdirectory(${_library})
|
||||
|
||||
set_target_properties(${_library}
|
||||
PROPERTIES
|
||||
MACOSX_RPATH ON
|
||||
SKIP_BUILD_RPATH OFF
|
||||
BUILD_WITH_INSTALL_RPATH ON
|
||||
INSTALL_RPATH "${_lib_rpath}"
|
||||
INSTALL_RPATH_USE_LINK_PATH ON
|
||||
#POSITION_INDEPENDENT_CODE 1
|
||||
#OUTPUT_NAME $<LOWER_CASE:${_library}>
|
||||
#DEBUG_POSTFIX "_d"
|
||||
VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR}
|
||||
FOLDER Modules
|
||||
)
|
||||
|
||||
list(APPEND FastCAE_Runtimes_Libraries ${FastCAE_${_library}_Runtimes_Libraries})
|
||||
|
||||
endforeach()
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 安装FastCAE,定义项目的安装目录
|
||||
#-----------------------------------------------------------------------------
|
||||
install(
|
||||
TARGETS ${_libraries} ${PROJECT_NAME}
|
||||
#ARCHIVE DESTINATION ${INSTALL_LIBDIR} COMPONENT lib
|
||||
RUNTIME DESTINATION ${INSTALL_BINDIR} COMPONENT bin
|
||||
LIBRARY DESTINATION ${INSTALL_LIBDIR} COMPONENT lib
|
||||
)
|
||||
|
||||
list(APPEND _plugins PluginCustomizer PluginMeshDataExchange)
|
||||
|
||||
foreach(_plugin ${_plugins})
|
||||
list(APPEND FastCAE_Runtimes_Libraries ${FastCAE_${_plugin}_Runtimes_Libraries})
|
||||
add_subdirectory(${_plugin})
|
||||
set_target_properties(${_plugin} PROPERTIES
|
||||
FOLDER Plugins
|
||||
)
|
||||
endforeach()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 安装插件到plugins目录
|
||||
#-----------------------------------------------------------------------------
|
||||
install(
|
||||
TARGETS ${_plugins}
|
||||
RUNTIME DESTINATION ${INSTALL_BINDIR}/plugins
|
||||
LIBRARY DESTINATION ${INSTALL_BINDIR}/plugins
|
||||
)
|
||||
|
||||
|
||||
list(REMOVE_DUPLICATES FastCAE_Runtimes_Libraries)
|
||||
|
||||
install(IMPORTED_RUNTIME_ARTIFACTS
|
||||
${FastCAE_Runtimes_Libraries}
|
||||
DESTINATION ${INSTALL_LIBDIR}
|
||||
COMPONENT lib
|
||||
)
|
|
@ -0,0 +1,39 @@
|
|||
#-----------------------------------------------------------------------------
|
||||
# 自动添加include目录
|
||||
#-----------------------------------------------------------------------------
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 源码扫描
|
||||
#-----------------------------------------------------------------------------
|
||||
file(GLOB _headers "*.h")
|
||||
file(GLOB _cpp "*.cpp")
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 添加动态库目标
|
||||
#-----------------------------------------------------------------------------
|
||||
add_library(Common
|
||||
${_headers}
|
||||
${_cpp}
|
||||
)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 添加接口声明宏
|
||||
#-----------------------------------------------------------------------------
|
||||
target_compile_definitions(Common PRIVATE "COMMON_API")
|
||||
|
||||
list(APPEND _runtimes_libraries
|
||||
Qt5::Core
|
||||
)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 链接依赖库
|
||||
#-----------------------------------------------------------------------------
|
||||
target_link_libraries(Common PRIVATE
|
||||
${_runtimes_libraries}
|
||||
)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 添加依赖关系
|
||||
#-----------------------------------------------------------------------------
|
||||
set(FastCAE_Common_Runtimes_Libraries ${_runtimes_libraries} PARENT_SCOPE)
|
|
@ -0,0 +1,12 @@
|
|||
#ifndef COMMONAPI_H
|
||||
#define COMMONAPI_H
|
||||
|
||||
#include <QtCore/QtGlobal>
|
||||
|
||||
#ifdef COMMON_API
|
||||
#define COMMONAPI Q_DECL_EXPORT
|
||||
#else
|
||||
#define COMMONAPI Q_DECL_IMPORT
|
||||
#endif
|
||||
|
||||
#endif // PYTHONMODULEAPI_H
|
|
@ -0,0 +1,11 @@
|
|||
#include "FakeClass.h"
|
||||
|
||||
namespace Common
|
||||
{
|
||||
|
||||
int FakeClass::getNoUsedField()
|
||||
{
|
||||
return m_NoUsedField;
|
||||
}
|
||||
|
||||
} // namespace Common
|
|
@ -0,0 +1,16 @@
|
|||
#include "CommonAPI.h"
|
||||
|
||||
namespace Common
|
||||
{
|
||||
class COMMONAPI FakeClass
|
||||
{
|
||||
public:
|
||||
FakeClass() = delete;
|
||||
~FakeClass() = default;
|
||||
int getNoUsedField();
|
||||
|
||||
private:
|
||||
int m_NoUsedField = 0;
|
||||
};
|
||||
|
||||
} // namespace Common
|
|
@ -0,0 +1,23 @@
|
|||
template <typename T>
|
||||
class Singleton
|
||||
{
|
||||
public:
|
||||
static T *&instance()
|
||||
{
|
||||
return m_Instance;
|
||||
}
|
||||
|
||||
Singleton(T &&) = delete;
|
||||
Singleton(const T &) = delete;
|
||||
void operator=(const T &) = delete;
|
||||
|
||||
protected:
|
||||
Singleton() = default;
|
||||
virtual ~Singleton() = default;
|
||||
|
||||
private:
|
||||
static T *m_Instance;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
T *Singleton<T>::m_Instance = new T;
|
|
@ -0,0 +1,16 @@
|
|||
#ifndef COMMONTYPES_H
|
||||
#define COMMONTYPES_H
|
||||
|
||||
#include "CommonAPI.h"
|
||||
namespace Common
|
||||
{
|
||||
enum class Message : int
|
||||
{
|
||||
Unknown = 0,
|
||||
Normal,
|
||||
Warning,
|
||||
Error,
|
||||
Python
|
||||
};
|
||||
}
|
||||
#endif // !COMMONTYPES_H
|
|
@ -0,0 +1,92 @@
|
|||
#include "BCConfig.h"
|
||||
#include "BCBase/BCUserDef.h"
|
||||
#include <QDebug>
|
||||
|
||||
namespace ConfigOption
|
||||
{
|
||||
BCConfig::~BCConfig()
|
||||
{
|
||||
clearData();
|
||||
}
|
||||
void BCConfig::clearData()
|
||||
{
|
||||
QList<ProjectTreeType> types = _bcList.keys();
|
||||
for (int j = 0; j < types.size(); ++j)
|
||||
{
|
||||
QList<BCBase::BCUserDef*> bcList = _bcList.value(types.at(j));
|
||||
const int n = bcList.size();
|
||||
for (int i = 0; i < n; ++i)
|
||||
{
|
||||
BCBase::BCUserDef* b = bcList.at(i);
|
||||
delete b;
|
||||
}
|
||||
}
|
||||
_bcList.clear();
|
||||
_enableType.clear();
|
||||
|
||||
}
|
||||
|
||||
BCBase::BCUserDef* BCConfig::getBCByName(QString name, ProjectTreeType t)
|
||||
{
|
||||
|
||||
BCBase::BCUserDef* bc = nullptr;
|
||||
if (!_bcList.contains(t)) return bc;
|
||||
|
||||
QList<BCBase::BCUserDef*> bcList = _bcList.value(t);
|
||||
const int n = bcList.size();
|
||||
|
||||
for (int i = 0; i < n; ++i)
|
||||
{
|
||||
BCBase::BCUserDef* b = bcList.at(i);
|
||||
if (b->getName() == name)
|
||||
{
|
||||
bc = b;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return bc;
|
||||
}
|
||||
|
||||
void BCConfig::appendBC(BCBase::BCUserDef* bc, ProjectTreeType t)
|
||||
{
|
||||
if (bc != nullptr)
|
||||
_bcList[t].append(bc);
|
||||
}
|
||||
int BCConfig::getBCCount(ProjectTreeType t)
|
||||
{
|
||||
if (!_bcList.contains(t)) return 0;
|
||||
QList<BCBase::BCUserDef*> bcList = _bcList.value(t);
|
||||
return bcList.size();
|
||||
}
|
||||
BCBase::BCUserDef* BCConfig::getBCAt(const int index, ProjectTreeType t)
|
||||
{
|
||||
if (!_bcList.contains(t)) return nullptr;
|
||||
QList<BCBase::BCUserDef*> bcList = _bcList.value(t);
|
||||
if (index < 0 || index >= bcList.size()) return nullptr;
|
||||
return bcList.at(index);
|
||||
|
||||
}
|
||||
bool BCConfig::isEnable(QString type, ProjectTreeType t)
|
||||
{
|
||||
bool s = false;
|
||||
if (!_enableType.contains(t)) return false;
|
||||
QStringList enableType = _enableType.value(t);
|
||||
if (enableType.contains(type.toLower()))
|
||||
s = true;
|
||||
return s;
|
||||
}
|
||||
void BCConfig::appendEnableType(QString s, ProjectTreeType t)
|
||||
{
|
||||
if (this->isEnable(s, t)) return;
|
||||
_enableType[t].append(s.toLower());
|
||||
// qDebug() << t << " , " << s;
|
||||
}
|
||||
|
||||
QStringList BCConfig::getEnabledType(ProjectTreeType t)
|
||||
{
|
||||
if (_enableType.contains(t))
|
||||
return _enableType.value(t);
|
||||
return QStringList();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
/**
|
||||
* @file BCConfig.h
|
||||
* @brief 边界条件设置选项(为可视化定制提供接口)
|
||||
* @author FastCAE研发小组(fastcae@diso.cn)
|
||||
* @version 2.5.0
|
||||
* @date 2022-07-06 10:06
|
||||
* @copyright Copyright (c) Since 2020 青岛数智船海科技有限公司 All rights reserved.
|
||||
*
|
||||
* ============================================================================
|
||||
* Program: FastCAE
|
||||
*
|
||||
* Copyright (c) Since 2020 青岛数智船海科技有限公司 All rights reserved.
|
||||
* See License or http://www.fastcae.com/ for details.
|
||||
*
|
||||
* BSD 3-Clause License
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED.
|
||||
* ==================================================================================
|
||||
*/
|
||||
#ifndef _BCCONFIG_H_
|
||||
#define _BCCONFIG_H_
|
||||
|
||||
#include "ConfigOptionsAPI.h"
|
||||
#include <QStringList>
|
||||
#include <QString>
|
||||
#include <QList>
|
||||
#include "DataProperty/modelTreeItemType.h"
|
||||
#include <QHash>
|
||||
|
||||
namespace BCBase
|
||||
{
|
||||
class BCUserDef;
|
||||
}
|
||||
|
||||
namespace ConfigOption
|
||||
{
|
||||
/**
|
||||
* @brief 边界条件设置选项
|
||||
* @since 2.5.0
|
||||
*/
|
||||
class CONFIGOPTIONSAPI BCConfig
|
||||
{
|
||||
public:
|
||||
BCConfig() = default;
|
||||
~BCConfig();
|
||||
|
||||
void clearData();
|
||||
|
||||
BCBase::BCUserDef *getBCByName(QString name, ProjectTreeType t);
|
||||
void appendBC(BCBase::BCUserDef *bc, ProjectTreeType t);
|
||||
int getBCCount(ProjectTreeType t);
|
||||
BCBase::BCUserDef *getBCAt(const int index, ProjectTreeType t);
|
||||
void appendEnableType(QString t, ProjectTreeType type);
|
||||
bool isEnable(QString type, ProjectTreeType t);
|
||||
QStringList getEnabledType(ProjectTreeType t);
|
||||
|
||||
private:
|
||||
QHash<ProjectTreeType, QList<BCBase::BCUserDef *>> _bcList{};
|
||||
/**
|
||||
* @brief 可用的边界列表(通过定制功能实现变更)
|
||||
* @since 2.5.0
|
||||
*/
|
||||
QHash<ProjectTreeType, QStringList> _enableType{};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
|
@ -0,0 +1,81 @@
|
|||
#include "BCConfigReader.h"
|
||||
#include "ConfigOptions.h"
|
||||
#include "BCConfig.h"
|
||||
#include "BCBase/BCUserDef.h"
|
||||
#include <QDomElement>
|
||||
#include <QDomDocument>
|
||||
#include <QDomNodeList>
|
||||
#include <QDebug>
|
||||
|
||||
namespace ConfigOption
|
||||
{
|
||||
BCConfigReader::BCConfigReader(const QString fileName, BCConfig* bcconfig) /*:IOBase(fileName)*/
|
||||
{
|
||||
// _bcconfig = ConfigOption::getInstance()->getBCConfig();
|
||||
_file.setFileName(fileName);
|
||||
_bcconfig = bcconfig;
|
||||
}
|
||||
BCConfigReader::~BCConfigReader()
|
||||
{
|
||||
if (_doc != nullptr)
|
||||
{
|
||||
delete _doc;
|
||||
}
|
||||
}
|
||||
bool BCConfigReader::read()
|
||||
{
|
||||
if (!_file.open(QFile::ReadOnly | QFile::Text)) return false;
|
||||
_doc = new QDomDocument();
|
||||
if (!_doc->setContent(&_file))
|
||||
{
|
||||
_file.close();
|
||||
return false;
|
||||
}
|
||||
|
||||
QDomNodeList bclist = _doc->elementsByTagName("BCList");
|
||||
for (int i = 0; i < bclist.size(); ++i)
|
||||
{
|
||||
QDomElement bclistele = bclist.at(i).toElement();
|
||||
QString stype = bclistele.attribute("Type");
|
||||
ProjectTreeType type = getTreeTypeByString(stype);
|
||||
if (type == UnDefined) continue;
|
||||
this->readBCType(&bclistele, type);
|
||||
}
|
||||
// qDebug() << bclist.size();
|
||||
|
||||
return true;
|
||||
}
|
||||
void BCConfigReader::readBCType(QDomElement* ele, ProjectTreeType t)
|
||||
{
|
||||
QDomNodeList bclist = ele->elementsByTagName("BC");
|
||||
|
||||
for (int i = 0; i < bclist.size(); ++i)
|
||||
{
|
||||
QDomElement ele = bclist.at(i).toElement();
|
||||
this->readBC(&ele,t);
|
||||
}
|
||||
QDomNodeList enabletypelist = ele->elementsByTagName("EnableDefaultType");
|
||||
for (int i = 0; i < enabletypelist.size(); ++i)
|
||||
{
|
||||
QDomElement eleable = enabletypelist.at(i).toElement();
|
||||
QString text = eleable.text().toLower();
|
||||
QStringList enablelist = text.split(",");
|
||||
for (int j = 0; j < enablelist.size(); ++j)
|
||||
{
|
||||
QString s = enablelist.at(j).toLower();
|
||||
if (s.isEmpty()) continue;
|
||||
_bcconfig->appendEnableType(s,t);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void BCConfigReader::readBC(QDomElement* ele, ProjectTreeType t)
|
||||
{
|
||||
BCBase::BCUserDef* bc = new BCBase::BCUserDef;
|
||||
bc->readDataFromProjectFile(ele);
|
||||
_bcconfig->appendBC(bc, t);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
/**
|
||||
* @file BCConfigReader.h
|
||||
* @brief 边界条件配置读取类,用于读取可视化定制生成的BCConfig.config文件
|
||||
* @author FastCAE研发小组(fastcae@diso.cn)
|
||||
* @version 2.5.0
|
||||
* @date 2022-07-06 10:23
|
||||
* @copyright Copyright (c) Since 2020 青岛数智船海科技有限公司 All rights reserved.
|
||||
*
|
||||
* ============================================================================
|
||||
* Program: FastCAE
|
||||
*
|
||||
* Copyright (c) Since 2020 青岛数智船海科技有限公司 All rights reserved.
|
||||
* See License or http://www.fastcae.com/ for details.
|
||||
*
|
||||
* BSD 3-Clause License
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED.
|
||||
* ==================================================================================
|
||||
*/
|
||||
#ifndef _BCCONFIGREADER_H_
|
||||
#define _BCCONFIGREADER_H_
|
||||
|
||||
#include <QFile>
|
||||
#include <QString>
|
||||
//#include "ModuleBase/IOBase.h"
|
||||
#include "DataProperty/modelTreeItemType.h"
|
||||
|
||||
class QDomDocument;
|
||||
class QDomElement;
|
||||
|
||||
namespace ConfigOption
|
||||
{
|
||||
class BCConfig;
|
||||
|
||||
/**
|
||||
* @brief 边界条件读取类
|
||||
* @since 2.5.0
|
||||
*/
|
||||
class BCConfigReader //: public ModuleBase::IOBase
|
||||
{
|
||||
public:
|
||||
BCConfigReader(const QString fileName, BCConfig *bcconfig);
|
||||
~BCConfigReader();
|
||||
|
||||
bool read() /* override*/;
|
||||
|
||||
private:
|
||||
void readBCType(QDomElement *ele, ProjectTreeType t);
|
||||
void readBC(QDomElement *ele, ProjectTreeType t);
|
||||
|
||||
private:
|
||||
/**
|
||||
* @brief 边界条件配置
|
||||
* @since 2.5.0
|
||||
*/
|
||||
BCConfig *_bcconfig{};
|
||||
/**
|
||||
* @brief xml文件对象(QDomDocument)
|
||||
* @since 2.5.0
|
||||
*/
|
||||
QDomDocument *_doc{};
|
||||
/**
|
||||
* @brief 要读取的文件(BCConfig.config)
|
||||
* @since 2.5.0
|
||||
*/
|
||||
QFile _file;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
|
@ -0,0 +1,52 @@
|
|||
#-----------------------------------------------------------------------------
|
||||
# 头文件搜索路径
|
||||
#-----------------------------------------------------------------------------
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 自动添加include目录
|
||||
#-----------------------------------------------------------------------------
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 源码扫描
|
||||
#-----------------------------------------------------------------------------
|
||||
file(GLOB _header "*.h")
|
||||
file(GLOB _source "*.cpp")
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 添加动态库目标
|
||||
#-----------------------------------------------------------------------------
|
||||
add_library(ConfigOptions
|
||||
${_header}
|
||||
${_source}
|
||||
)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 添加接口声明宏
|
||||
#-----------------------------------------------------------------------------
|
||||
target_compile_definitions(ConfigOptions PRIVATE "CONFIGOPTIONS_API")
|
||||
|
||||
list(APPEND _depend_library PythonModule Settings DataProperty Material BCBase)
|
||||
|
||||
list(APPEND _runtimes_libraries
|
||||
Qt5::Core Qt5::Xml Qt5::Widgets
|
||||
)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 链接依赖库
|
||||
#-----------------------------------------------------------------------------
|
||||
target_link_libraries(ConfigOptions PRIVATE
|
||||
${_runtimes_libraries}
|
||||
${_depend_library}
|
||||
)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 添加依赖关系
|
||||
#-----------------------------------------------------------------------------
|
||||
add_dependencies(ConfigOptions ${_depend_library})
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 添加运行时依赖关系
|
||||
#-----------------------------------------------------------------------------
|
||||
set(FastCAE_ConfigOptions_Runtimes_Libraries ${_runtimes_libraries} PARENT_SCOPE)
|
|
@ -0,0 +1 @@
|
|||
|
|
@ -0,0 +1,65 @@
|
|||
/**
|
||||
* @file ConfigDataBase.h
|
||||
* @brief 可视化定制信息基类
|
||||
* @author FastCAE研发小组(fastcae@diso.cn)
|
||||
* @version 2.5.0
|
||||
* @date 2022-07-06 10:27
|
||||
* @copyright Copyright (c) Since 2020 青岛数智船海科技有限公司 All rights reserved.
|
||||
*
|
||||
* ============================================================================
|
||||
* Program: FastCAE
|
||||
*
|
||||
* Copyright (c) Since 2020 青岛数智船海科技有限公司 All rights reserved.
|
||||
* See License or http://www.fastcae.com/ for details.
|
||||
*
|
||||
* BSD 3-Clause License
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED.
|
||||
* ==================================================================================
|
||||
*/
|
||||
#ifndef CONFIGDATABASE_H
|
||||
#define CONFIGDATABASE_H
|
||||
|
||||
#include "ConfigOptionsAPI.h"
|
||||
|
||||
namespace ConfigOption
|
||||
{
|
||||
class BCConfig;
|
||||
class DataConfig;
|
||||
class GlobalConfig;
|
||||
class GeometryConfig;
|
||||
class MeshConfig;
|
||||
class PostConfig;
|
||||
class SolverOption;
|
||||
class ObserverConfig;
|
||||
class MaterialConfig;
|
||||
class ProjectTreeConfig;
|
||||
// class NodeFormConfig;
|
||||
|
||||
class CONFIGOPTIONSAPI ConfigDataBase
|
||||
{
|
||||
public:
|
||||
ConfigDataBase() = default;
|
||||
~ConfigDataBase() = default;
|
||||
|
||||
virtual BCConfig *getBCConfig() = 0;
|
||||
virtual DataConfig *getDataConfig() = 0;
|
||||
virtual GeometryConfig *getGeometryConfig() = 0;
|
||||
virtual GlobalConfig *getGlobalConfig() = 0;
|
||||
virtual MeshConfig *getMeshConfig() = 0;
|
||||
virtual PostConfig *getPostConfig() = 0;
|
||||
virtual SolverOption *getSolverOption() = 0;
|
||||
virtual ObserverConfig *getObseverConfig() = 0;
|
||||
virtual MaterialConfig *getMaterialConfig() = 0;
|
||||
virtual ProjectTreeConfig *getProjectTreeConfig() = 0;
|
||||
// virtual NodeFormConfig* getNodeFormConfig() = 0;
|
||||
|
||||
virtual void clearAllConfig() = 0;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
|
@ -0,0 +1,63 @@
|
|||
#include "ConfigDataReader.h"
|
||||
#include "ConfigDataBase.h"
|
||||
#include "BCConfigReader.h"
|
||||
#include "DataConfigReader.h"
|
||||
#include "GlobalConfigReader.h"
|
||||
#include "ObserverConfigReader.h"
|
||||
#include "TreeConfigReader.h"
|
||||
#include "SolverConfig.h"
|
||||
#include "MaterialConfig.h"
|
||||
//#include "NodeFormConfigReader.h"
|
||||
|
||||
namespace ConfigOption
|
||||
{
|
||||
ConfigDataReader::ConfigDataReader(QString path, ConfigDataBase* data) :
|
||||
_path(path), _data(data)
|
||||
{
|
||||
}
|
||||
|
||||
QString ConfigDataReader::read()
|
||||
{
|
||||
QString error;
|
||||
bool ok = false;
|
||||
_data->clearAllConfig();
|
||||
|
||||
BCConfigReader bcreader(_path + "/BCConfig.config", _data->getBCConfig());
|
||||
ok = bcreader.read();
|
||||
if (!ok) error.append("BCConfig,");
|
||||
|
||||
DataConfigReader datareader(_path + "/DataConfig.config", _data->getDataConfig(), _data->getPostConfig());
|
||||
ok = datareader.read();
|
||||
if (!ok) error.append("DataConfig,");
|
||||
|
||||
GlobalConfigReader golbalreader(_path + "/GlobalConfig.config",_data);
|
||||
ok = golbalreader.read();
|
||||
if (!ok) error.append("GlobalConfig,");
|
||||
|
||||
ObserverConfigReader observerreader(_path + "/ObserverConfig.config",_data->getObseverConfig());
|
||||
ok = observerreader.read();
|
||||
if (!ok) error.append("ObserverConfig,");
|
||||
|
||||
TreeConfigReader reader(_path + "/treeConfig.config", _data->getProjectTreeConfig());
|
||||
ok = reader.read();
|
||||
if (!ok) error.append("treeConfig,");
|
||||
|
||||
ok = _data->getSolverOption()->read(_path + "/SolverConfig.config");
|
||||
if (!ok) error.append("SolverConfig,");
|
||||
|
||||
ok = _data->getMaterialConfig()->readConfig(_path + "MaterialConfig.config");
|
||||
if (!ok) error.append("MaterialConfig,");
|
||||
|
||||
// NodeFormConfigReader formReader("C:\\Users\\Administrator\\Desktop\\FastCAEWidget.ui",
|
||||
// _data->getNodeFormConfig());
|
||||
// ok = formReader.read();
|
||||
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
/**
|
||||
* @file ConfigDataReader.h
|
||||
* @brief 定制信息读取类(该类会调用其它reader,算是一个总的reader)
|
||||
* @author FastCAE研发小组(fastcae@diso.cn)
|
||||
* @version 2.5.0
|
||||
* @date 2022-07-06 14:35
|
||||
* @copyright Copyright (c) Since 2020 青岛数智船海科技有限公司 All rights reserved.
|
||||
*
|
||||
* ============================================================================
|
||||
* Program: FastCAE
|
||||
*
|
||||
* Copyright (c) Since 2020 青岛数智船海科技有限公司 All rights reserved.
|
||||
* See License or http://www.fastcae.com/ for details.
|
||||
*
|
||||
* BSD 3-Clause License
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED.
|
||||
* ==================================================================================
|
||||
*/
|
||||
#ifndef CONFIGGATAREADER_H_
|
||||
#define CONFIGGATAREADER_H_
|
||||
|
||||
#include "ConfigOptionsAPI.h"
|
||||
#include <QString>
|
||||
|
||||
namespace ConfigOption
|
||||
{
|
||||
class ConfigDataBase;
|
||||
/**
|
||||
* @brief 定制信息读取类
|
||||
* @since 2.5.0
|
||||
*/
|
||||
class CONFIGOPTIONSAPI ConfigDataReader
|
||||
{
|
||||
public:
|
||||
ConfigDataReader(QString path, ConfigDataBase *data);
|
||||
~ConfigDataReader() = default;
|
||||
|
||||
QString read();
|
||||
|
||||
private:
|
||||
QString _path{};
|
||||
ConfigDataBase *_data{};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // !CONFIGGATAREADER_H_
|
|
@ -0,0 +1,150 @@
|
|||
#include "ConfigOptions.h"
|
||||
#include "BCConfig.h"
|
||||
#include "BCConfigReader.h"
|
||||
#include "DataConfig.h"
|
||||
#include "DataConfigReader.h"
|
||||
#include "GlobalConfig.h"
|
||||
#include "GeometryConfig.h"
|
||||
#include "MeshConfig.h"
|
||||
#include "SolverConfig.h"
|
||||
#include "GlobalConfigReader.h"
|
||||
#include "PostConfig.h"
|
||||
#include "ObserverConfig.h"
|
||||
#include "ObserverConfigReader.h"
|
||||
#include "MaterialConfig.h"
|
||||
#include "ProjectTreeConfig.h"
|
||||
//#include "NodeFormConfig.h"
|
||||
#include "TreeConfigReader.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
namespace ConfigOption
|
||||
{
|
||||
ConfigOption* ConfigOption::_instance = nullptr;
|
||||
|
||||
ConfigOption* ConfigOption::getInstance()
|
||||
{
|
||||
if (_instance == nullptr)
|
||||
{
|
||||
_instance = new ConfigOption;
|
||||
}
|
||||
return _instance;
|
||||
}
|
||||
|
||||
ConfigOption::ConfigOption()
|
||||
{
|
||||
// _treeConfig = new ProjectTreeConfig;
|
||||
_bcConfig = new BCConfig;
|
||||
_dataConfig = new DataConfig;
|
||||
_globalConfig = new GlobalConfig;
|
||||
_geoConfig = new GeometryConfig;
|
||||
_meshConfig = new MeshConfig;
|
||||
_postConfig = new PostConfig;
|
||||
_solverOption = new SolverOption;
|
||||
_observerConfig = new ObserverConfig;
|
||||
_materialConfig = new MaterialConfig;
|
||||
_projectTreeConfig = new ProjectTreeConfig;
|
||||
// _nodeFormConfig = new NodeFormConfig;
|
||||
}
|
||||
|
||||
ConfigOption::~ConfigOption()
|
||||
{
|
||||
// if (_treeConfig != nullptr ) delete _treeConfig;
|
||||
if (_bcConfig != nullptr) delete _bcConfig;
|
||||
if (_dataConfig != nullptr) delete _dataConfig;
|
||||
if (_globalConfig != nullptr) delete _globalConfig;
|
||||
if (_geoConfig != nullptr) delete _geoConfig;
|
||||
if (_meshConfig != nullptr) delete _meshConfig;
|
||||
if (_postConfig != nullptr) delete _postConfig;
|
||||
if (_solverOption != nullptr) delete _solverOption;
|
||||
if (_materialConfig != nullptr) delete _materialConfig;
|
||||
if (_projectTreeConfig != nullptr) delete _projectTreeConfig;
|
||||
// if (_nodeFormConfig != nullptr) delete _nodeFormConfig;
|
||||
}
|
||||
|
||||
void ConfigOption::clearAllConfig()
|
||||
{
|
||||
// _treeConfig->clearData();
|
||||
_bcConfig->clearData();
|
||||
_dataConfig->clearData();
|
||||
_globalConfig->clearData();
|
||||
_geoConfig->clearData();
|
||||
_meshConfig->clearData();
|
||||
_postConfig->clearData();
|
||||
_solverOption->clearData();
|
||||
_observerConfig->clearData();
|
||||
_materialConfig->clearData();
|
||||
_projectTreeConfig->clearData();
|
||||
//_nodeFormConfig->clearData();
|
||||
}
|
||||
|
||||
BCConfig* ConfigOption::getBCConfig()
|
||||
{
|
||||
return _bcConfig;
|
||||
}
|
||||
|
||||
DataConfig* ConfigOption::getDataConfig()
|
||||
{
|
||||
return _dataConfig;
|
||||
}
|
||||
|
||||
GeometryConfig* ConfigOption::getGeometryConfig()
|
||||
{
|
||||
return _geoConfig;
|
||||
}
|
||||
|
||||
GlobalConfig* ConfigOption::getGlobalConfig()
|
||||
{
|
||||
return _globalConfig;
|
||||
}
|
||||
|
||||
MeshConfig* ConfigOption::getMeshConfig()
|
||||
{
|
||||
return _meshConfig;
|
||||
}
|
||||
|
||||
PostConfig* ConfigOption::getPostConfig()
|
||||
{
|
||||
return _postConfig;
|
||||
}
|
||||
|
||||
SolverOption* ConfigOption::getSolverOption()
|
||||
{
|
||||
return _solverOption;
|
||||
}
|
||||
|
||||
bool ConfigOption::isGeometryEnabled()
|
||||
{
|
||||
return _geoConfig->isGeometryEnabled();
|
||||
}
|
||||
|
||||
bool ConfigOption::isMeshEnabled()
|
||||
{
|
||||
return _meshConfig->isMeshEnabled();
|
||||
}
|
||||
|
||||
bool ConfigOption::isPostEnabled()
|
||||
{
|
||||
return _postConfig->isPostEnabled();
|
||||
}
|
||||
|
||||
ObserverConfig* ConfigOption::getObseverConfig()
|
||||
{
|
||||
return _observerConfig;
|
||||
}
|
||||
|
||||
MaterialConfig* ConfigOption::getMaterialConfig()
|
||||
{
|
||||
return _materialConfig;
|
||||
}
|
||||
|
||||
ProjectTreeConfig* ConfigOption::getProjectTreeConfig()
|
||||
{
|
||||
return _projectTreeConfig;
|
||||
}
|
||||
|
||||
// NodeFormConfig* ConfigOption::getNodeFormConfig()
|
||||
// {
|
||||
// return _nodeFormConfig;
|
||||
// }
|
||||
}
|
|
@ -0,0 +1,115 @@
|
|||
/**
|
||||
* @file ConfigOptions.h
|
||||
* @brief 可视化定制配置信息读取单例类
|
||||
* @author FastCAE研发小组(fastcae@diso.cn)
|
||||
* @version 2.5.0
|
||||
* @date 2022-07-06 10:27
|
||||
* @copyright Copyright (c) Since 2020 青岛数智船海科技有限公司 All rights reserved.
|
||||
*
|
||||
* ============================================================================
|
||||
* Program: FastCAE
|
||||
*
|
||||
* Copyright (c) Since 2020 青岛数智船海科技有限公司 All rights reserved.
|
||||
* See License or http://www.fastcae.com/ for details.
|
||||
*
|
||||
* BSD 3-Clause License
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED.
|
||||
* ==================================================================================
|
||||
*/
|
||||
#ifndef _CONFIGOPTIONS_H_
|
||||
#define _CONFIGOPTIONS_H_
|
||||
|
||||
#include "ConfigDataBase.h"
|
||||
|
||||
namespace ConfigOption
|
||||
{
|
||||
/**
|
||||
* @brief 可视化定制配置信息读取单例类
|
||||
* @since 2.5.0
|
||||
*/
|
||||
class CONFIGOPTIONSAPI ConfigOption : public ConfigDataBase
|
||||
{
|
||||
public:
|
||||
static ConfigOption *getInstance();
|
||||
|
||||
bool isGeometryEnabled();
|
||||
bool isMeshEnabled();
|
||||
bool isPostEnabled();
|
||||
|
||||
BCConfig *getBCConfig() override;
|
||||
DataConfig *getDataConfig() override;
|
||||
GeometryConfig *getGeometryConfig() override;
|
||||
GlobalConfig *getGlobalConfig() override;
|
||||
MeshConfig *getMeshConfig() override;
|
||||
PostConfig *getPostConfig() override;
|
||||
SolverOption *getSolverOption() override;
|
||||
ObserverConfig *getObseverConfig() override;
|
||||
MaterialConfig *getMaterialConfig() override;
|
||||
ProjectTreeConfig *getProjectTreeConfig() override;
|
||||
// NodeFormConfig* getNodeFormConfig()override;
|
||||
|
||||
void clearAllConfig() override;
|
||||
// QString readConfig();
|
||||
|
||||
private:
|
||||
ConfigOption();
|
||||
~ConfigOption();
|
||||
|
||||
private:
|
||||
static ConfigOption *_instance;
|
||||
/**
|
||||
* @brief 边界配置(BCConfig.config)
|
||||
* @since 2.5.0
|
||||
*/
|
||||
BCConfig *_bcConfig{};
|
||||
/**
|
||||
* @brief 算例数据配置(DataConfig.config)
|
||||
* @since 2.5.0
|
||||
*/
|
||||
DataConfig *_dataConfig{};
|
||||
/**
|
||||
* @brief 全局配置(GlobalConfig.config)
|
||||
* @since 2.5.0
|
||||
*/
|
||||
GlobalConfig *_globalConfig{};
|
||||
/**
|
||||
* @brief 几何配置(GlobalConfig.config)
|
||||
* @since 2.5.0
|
||||
*/
|
||||
GeometryConfig *_geoConfig{};
|
||||
/**
|
||||
* @brief 网格配置(GlobalConfig.config)
|
||||
* @since 2.5.0
|
||||
*/
|
||||
MeshConfig *_meshConfig{};
|
||||
/**
|
||||
* @brief 后处理配置(GlobalConfig.config)
|
||||
* @since 2.5.0
|
||||
*/
|
||||
PostConfig *_postConfig{};
|
||||
/**
|
||||
* @brief 求解器配置(SolverConfig.config)
|
||||
* @since 2.5.0
|
||||
*/
|
||||
SolverOption *_solverOption{};
|
||||
ObserverConfig *_observerConfig{};
|
||||
/**
|
||||
* @brief 材料配置(MaterialConfig.config)
|
||||
* @since 2.5.0
|
||||
*/
|
||||
MaterialConfig *_materialConfig{};
|
||||
/**
|
||||
* @brief 工程树配置(treeConfig.config)
|
||||
* @since 2.5.0
|
||||
*/
|
||||
ProjectTreeConfig *_projectTreeConfig{};
|
||||
// NodeFormConfig* _nodeFormConfig{};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
|
@ -0,0 +1,13 @@
|
|||
#ifndef _CONFIGOPTIONSAPI_H_
|
||||
#define _CONFIGOPTIONSAPI_H_
|
||||
|
||||
#include <QtCore/QtGlobal>
|
||||
|
||||
|
||||
#if defined(CONFIGOPTIONS_API)
|
||||
#define CONFIGOPTIONSAPI Q_DECL_EXPORT
|
||||
#else
|
||||
#define CONFIGOPTIONSAPI Q_DECL_IMPORT
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -0,0 +1,157 @@
|
|||
#include "DataConfig.h"
|
||||
#include "PostCurve.h"
|
||||
#include <QList>
|
||||
|
||||
namespace ConfigOption
|
||||
{
|
||||
DataConfig::~DataConfig()
|
||||
{
|
||||
|
||||
}
|
||||
void DataConfig::clearData()
|
||||
{
|
||||
QList<DataProperty::DataBase*> simlist = _simlutationDataHash.values();
|
||||
for (int i = 0; i < simlist.size(); ++i)
|
||||
{
|
||||
DataProperty::DataBase* data = simlist.at(i);
|
||||
delete data;
|
||||
}
|
||||
_simlutationDataHash.clear();
|
||||
|
||||
QList<DataProperty::DataBase*> solList = _solverSettingHash.values();
|
||||
for (int i = 0; i < solList.size(); ++i)
|
||||
{
|
||||
DataProperty::DataBase* d = solList.at(i);
|
||||
delete d;
|
||||
}
|
||||
_solverSettingHash.clear();
|
||||
|
||||
QList<QHash<int, DataProperty::DataBase*>> alldata = _configData.values();
|
||||
for (int i = 0; i < alldata.size(); ++i)
|
||||
{
|
||||
QHash<int, DataProperty::DataBase*> data = alldata.at(i);
|
||||
QList<DataProperty::DataBase*> dlist = data.values();
|
||||
for (int j = 0; j < dlist.size(); ++j)
|
||||
{
|
||||
DataProperty::DataBase* d = dlist.at(j);
|
||||
if(d != nullptr) delete d;
|
||||
}
|
||||
}
|
||||
_configData.clear();
|
||||
|
||||
QList<QList<PostCurve*>> curveList = _monitorCurves.values();
|
||||
for (QList<PostCurve*> pl : curveList)
|
||||
{
|
||||
for (PostCurve* c : pl)
|
||||
delete c;
|
||||
}
|
||||
_monitorCurves.clear();
|
||||
}
|
||||
void DataConfig::appendSimlutationData(ProjectTreeType t, DataProperty::DataBase* data)
|
||||
{
|
||||
if (_simlutationDataHash.contains(t))
|
||||
{
|
||||
DataProperty::DataBase* d = _simlutationDataHash.value(t);
|
||||
delete d;
|
||||
_simlutationDataHash.remove(t);
|
||||
}
|
||||
_simlutationDataHash[t] = data;
|
||||
}
|
||||
DataProperty::DataBase* DataConfig::getSimlutationData(ProjectTreeType t)
|
||||
{
|
||||
return _simlutationDataHash.value(t);
|
||||
}
|
||||
void DataConfig::appendSolverSettingData(ProjectTreeType t, DataProperty::DataBase* data)
|
||||
{
|
||||
if (_solverSettingHash.contains(t))
|
||||
{
|
||||
DataProperty::DataBase* d = _solverSettingHash.value(t);
|
||||
delete d;
|
||||
_solverSettingHash.remove(t);
|
||||
}
|
||||
_solverSettingHash[t] = data;
|
||||
}
|
||||
DataProperty::DataBase* DataConfig::getSolverSettingData(ProjectTreeType t)
|
||||
{
|
||||
return _solverSettingHash.value(t);
|
||||
}
|
||||
void DataConfig::appendConfigData(ProjectTreeType type, int id, DataProperty::DataBase* d)
|
||||
{
|
||||
if (d == nullptr) return;
|
||||
DataProperty::DataBase* data = this->getConfigData(type, id);
|
||||
if (data != nullptr) delete data;
|
||||
|
||||
_configData[type][id] = d;
|
||||
}
|
||||
DataProperty::DataBase* DataConfig::getConfigData(ProjectTreeType t, int id)
|
||||
{
|
||||
if (!_configData.contains(t)) return nullptr;
|
||||
QHash<int, DataProperty::DataBase*> proplist = _configData.value(t);
|
||||
if (!proplist.contains(id)) return nullptr;
|
||||
|
||||
return proplist.value(id);
|
||||
}
|
||||
QHash<int, DataProperty::DataBase*> DataConfig::getConfigData(ProjectTreeType t)
|
||||
{
|
||||
if (_configData.contains(t))
|
||||
return _configData.value(t);
|
||||
return QHash<int, DataProperty::DataBase*>();
|
||||
}
|
||||
// void DataConfig::appendMonitorFile(ProjectTreeType type, QString file)
|
||||
// {
|
||||
// if (_monitorFile.contains(type))
|
||||
// {
|
||||
// QList<DataProperty::DataBase*> monitorlist = _monitorFile.value(type);
|
||||
// for (int i = 0; i < monitorlist.size(); ++i)
|
||||
// {
|
||||
// DataProperty::DataBase* d = monitorlist.at(i);
|
||||
// delete d;
|
||||
// }
|
||||
// _monitorFile.remove(type);
|
||||
// }
|
||||
// _monitorFile.insert(type, monitor);
|
||||
// _monitorFile[type].append(file);
|
||||
// }
|
||||
QStringList DataConfig::getMonitorFile(ProjectTreeType type)
|
||||
{
|
||||
if (_monitorCurves.contains(type))
|
||||
{
|
||||
QStringList files;
|
||||
QList<PostCurve*> curvelist = _monitorCurves.value(type);
|
||||
for (int i = 0; i < curvelist.size(); ++i)
|
||||
{
|
||||
PostCurve* c = curvelist.at(i);
|
||||
QString fileName = c->getFile();
|
||||
if (!files.contains(fileName))
|
||||
files.append(fileName);
|
||||
}
|
||||
return files;
|
||||
}
|
||||
else
|
||||
return QStringList();
|
||||
}
|
||||
void DataConfig::appendMonitorCurves(ProjectTreeType type, PostCurve* curve)
|
||||
{
|
||||
// if (_monitorCurves.contains(type))
|
||||
// {
|
||||
// QList<PostCurve*> curves = _monitorCurves.value(type);
|
||||
// for (int i = 0; i < curves.size(); ++i)
|
||||
// {
|
||||
// PostCurve* c = curves.at(i);
|
||||
// delete c;
|
||||
// }
|
||||
// _monitorCurves.remove(type);
|
||||
// }
|
||||
_monitorCurves[type].append(curve);
|
||||
}
|
||||
QList<PostCurve*> DataConfig::getMonitorCurves(ProjectTreeType type)
|
||||
{
|
||||
if (_monitorCurves.contains(type))
|
||||
{
|
||||
return _monitorCurves.value(type);
|
||||
}
|
||||
else
|
||||
return QList<PostCurve*>();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
/**
|
||||
* @file DataConfig.h
|
||||
* @brief 算例数据配置类(包括跟特定算例相关的信息)
|
||||
* @author FastCAE研发小组(fastcae@diso.cn)
|
||||
* @version 2.5.0
|
||||
* @date 2022-07-06 10:36
|
||||
* @copyright Copyright (c) Since 2020 青岛数智船海科技有限公司 All rights reserved.
|
||||
*
|
||||
* ============================================================================
|
||||
* Program: FastCAE
|
||||
*
|
||||
* Copyright (c) Since 2020 青岛数智船海科技有限公司 All rights reserved.
|
||||
* See License or http://www.fastcae.com/ for details.
|
||||
*
|
||||
* BSD 3-Clause License
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED.
|
||||
* ==================================================================================
|
||||
*/
|
||||
#ifndef _DATACONFIG_H_
|
||||
#define _DATACONFIG_H_
|
||||
|
||||
#include "ConfigOptionsAPI.h"
|
||||
#include "DataProperty/DataBase.h"
|
||||
#include "DataProperty/modelTreeItemType.h"
|
||||
#include <QHash>
|
||||
|
||||
namespace DataProperty
|
||||
{
|
||||
class DataBase;
|
||||
}
|
||||
|
||||
namespace ConfigOption
|
||||
{
|
||||
class PostCurve;
|
||||
/**
|
||||
* @brief 算例数据配置类
|
||||
* @since 2.5.0
|
||||
*/
|
||||
class CONFIGOPTIONSAPI DataConfig
|
||||
{
|
||||
public:
|
||||
DataConfig() = default;
|
||||
~DataConfig();
|
||||
|
||||
void appendSimlutationData(ProjectTreeType t, DataProperty::DataBase *data);
|
||||
DataProperty::DataBase *getSimlutationData(ProjectTreeType t);
|
||||
|
||||
void appendSolverSettingData(ProjectTreeType t, DataProperty::DataBase *data);
|
||||
DataProperty::DataBase *getSolverSettingData(ProjectTreeType t);
|
||||
void appendConfigData(ProjectTreeType type, const int id, DataProperty::DataBase *d);
|
||||
DataProperty::DataBase *getConfigData(ProjectTreeType type, int id);
|
||||
QHash<int, DataProperty::DataBase *> getConfigData(ProjectTreeType t);
|
||||
|
||||
// void appendMonitorFile(ProjectTreeType type);
|
||||
QStringList getMonitorFile(ProjectTreeType type);
|
||||
void appendMonitorCurves(ProjectTreeType type, PostCurve *curves);
|
||||
QList<PostCurve *> getMonitorCurves(ProjectTreeType type);
|
||||
|
||||
void clearData();
|
||||
|
||||
private:
|
||||
QHash<ProjectTreeType, DataProperty::DataBase *> _simlutationDataHash{};
|
||||
QHash<ProjectTreeType, DataProperty::DataBase *> _solverSettingHash{};
|
||||
QHash<ProjectTreeType, QHash<int, DataProperty::DataBase *>> _configData{};
|
||||
// QHash<ProjectTreeType, q> _monitorFile{};
|
||||
QHash<ProjectTreeType, QList<PostCurve *>> _monitorCurves{};
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
|
@ -0,0 +1,201 @@
|
|||
#include "DataConfigReader.h"
|
||||
#include "ConfigOptions.h"
|
||||
#include "DataConfig.h"
|
||||
#include "PostConfig.h"
|
||||
#include "PostConfigInfo.h"
|
||||
#include "PostCurve.h"
|
||||
#include <QDomDocument>
|
||||
#include <QDomElement>
|
||||
#include <QDebug>
|
||||
|
||||
namespace ConfigOption
|
||||
{
|
||||
DataConfigReader::DataConfigReader(const QString fileName, DataConfig* dataconfig, PostConfig* postconfig)
|
||||
//: IOBase(fileName)
|
||||
{
|
||||
// _dataConfig = ConfigOption::getInstance()->getDataConfig();
|
||||
// _postConfig = ConfigOption::getInstance()->getPostConfig();
|
||||
|
||||
_dataConfig = dataconfig;
|
||||
_postConfig = postconfig;
|
||||
|
||||
_file.setFileName(fileName);
|
||||
}
|
||||
DataConfigReader::~DataConfigReader()
|
||||
{
|
||||
if (_doc != nullptr) delete _doc;
|
||||
}
|
||||
bool DataConfigReader::read()
|
||||
{
|
||||
if (!_file.open(QFile::ReadOnly | QFile::Text)) return false;
|
||||
_doc = new QDomDocument();
|
||||
if (!_doc->setContent(&_file))
|
||||
{
|
||||
_file.close();
|
||||
return false;
|
||||
}
|
||||
|
||||
QDomNodeList simlist = _doc->elementsByTagName("SimlutationData");
|
||||
for (int i = 0; i < simlist.size(); ++i)
|
||||
{
|
||||
QDomElement simele = simlist.at(i).toElement();
|
||||
QString stype = simele.attribute("TreeType");
|
||||
ProjectTreeType type = getTreeTypeByString(stype);
|
||||
if (type == UnDefined) continue;
|
||||
|
||||
DataProperty::DataBase* data = new DataProperty::DataBase;
|
||||
data->readParameters(&simele);
|
||||
_dataConfig->appendSimlutationData(type, data);
|
||||
}
|
||||
|
||||
QDomNodeList solverlist = _doc->elementsByTagName("SolverSetting");
|
||||
for (int i = 0; i < solverlist.size(); ++i)
|
||||
{
|
||||
QDomElement solverele = solverlist.at(i).toElement();
|
||||
QString stype = solverele.attribute("TreeType");
|
||||
ProjectTreeType type = getTreeTypeByString(stype);
|
||||
if (type == UnDefined) continue;
|
||||
|
||||
DataProperty::DataBase* data = new DataProperty::DataBase;
|
||||
data->readParameters(&solverele);
|
||||
_dataConfig->appendSolverSettingData(type, data);
|
||||
}
|
||||
|
||||
QDomNodeList datablocklist = _doc->elementsByTagName("DataBlock");
|
||||
for (int i = 0; i < datablocklist.size(); ++i)
|
||||
{
|
||||
QDomElement datablock = datablocklist.at(i).toElement();
|
||||
QString stype = datablock.attribute("TreeType");
|
||||
ProjectTreeType type = getTreeTypeByString(stype);
|
||||
if (type == UnDefined) continue;
|
||||
|
||||
this->readDataBlock(type, &datablock);
|
||||
}
|
||||
|
||||
QDomNodeList monitorList = _doc->elementsByTagName("Monitor");
|
||||
for (int i = 0; i < monitorList.size(); ++i)
|
||||
{
|
||||
QDomElement monitorblock = monitorList.at(i).toElement();
|
||||
QString stype = monitorblock.attribute("TreeType");
|
||||
ProjectTreeType type = getTreeTypeByString(stype);
|
||||
if (type == UnDefined) continue;
|
||||
|
||||
QDomNodeList filenodeList = monitorblock.elementsByTagName("File");
|
||||
for (int j = 0; j < filenodeList.size(); ++j)
|
||||
{
|
||||
QDomElement fileele = filenodeList.at(j).toElement();
|
||||
QString fileName = fileele.attribute("Name");
|
||||
// _dataConfig->appendMonitorFile(type, fileName);
|
||||
|
||||
QDomNodeList curvenodelist = fileele.elementsByTagName("Curve");
|
||||
for (int k = 0; k < curvenodelist.size(); ++k)
|
||||
{
|
||||
QDomElement curveele = curvenodelist.at(k).toElement();
|
||||
PostCurve* c = new PostCurve;
|
||||
QString desattr = curveele.attribute("Describe");
|
||||
QString xvariable = curveele.attribute("XVariable");
|
||||
QString yvariable = curveele.attribute("YVariable");
|
||||
c->setDescribe(desattr);
|
||||
c->setXVariable(xvariable);
|
||||
c->setYVariable(yvariable);
|
||||
c->setFile(fileName);
|
||||
_dataConfig->appendMonitorCurves(type, c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QDomNodeList postlist = _doc->elementsByTagName("PostConfig");
|
||||
for (int i = 0; i < postlist.size(); ++i)
|
||||
{
|
||||
QDomElement postele = postlist.at(i).toElement();
|
||||
QString stype = postele.attribute("TreeType");
|
||||
ProjectTreeType type = getTreeTypeByString(stype);
|
||||
if (type == UnDefined) continue;
|
||||
this->readPostConfig(type, &postele);
|
||||
}
|
||||
|
||||
_file.close();
|
||||
return true;
|
||||
}
|
||||
|
||||
void DataConfigReader::readDataBlock(ProjectTreeType t, QDomElement* e)
|
||||
{
|
||||
QDomNodeList blocklist = e->elementsByTagName("Block");
|
||||
for (int i = 0; i < blocklist.size(); ++i)
|
||||
{
|
||||
QDomElement ele = blocklist.at(i).toElement();
|
||||
QString sid = ele.attribute("ID");
|
||||
QString sname = ele.attribute("TreeNode");
|
||||
const int id = sid.toInt();
|
||||
DataProperty::DataBase* data = new DataProperty::DataBase;
|
||||
data->setName(sname);
|
||||
data->readParameters(&ele);
|
||||
_dataConfig->appendConfigData(t, id, data);
|
||||
}
|
||||
}
|
||||
|
||||
void DataConfigReader::readPostConfig(ProjectTreeType t, QDomElement* e)
|
||||
{
|
||||
PostConfigInfo* info = new PostConfigInfo;
|
||||
QDomNodeList d2file = e->elementsByTagName("Post2DFile");
|
||||
for (int i = 0; i < d2file.size(); ++i)
|
||||
{
|
||||
QDomElement element = d2file.at(i).toElement();
|
||||
QString fileName = element.attribute("Name");
|
||||
QDomNodeList curvelist = element.elementsByTagName("Curve");
|
||||
for (int j = 0; j < curvelist.size(); ++j)
|
||||
{
|
||||
QDomElement cele = curvelist.at(j).toElement();
|
||||
QString des = cele.attribute("Describe");
|
||||
// qDebug() << des;
|
||||
QString xv = cele.attribute("XVariable");
|
||||
QString yv = cele.attribute("YVariable");
|
||||
PostCurve* c = new PostCurve;
|
||||
c->setDescribe(des);
|
||||
c->setXVariable(xv);
|
||||
c->setYVariable(yv);
|
||||
c->setFile(fileName);
|
||||
info->appendPostCurve(c);
|
||||
}
|
||||
}
|
||||
|
||||
QDomNodeList d3file = e->elementsByTagName("Post3DFile");
|
||||
if (d3file.size() == 1)
|
||||
{
|
||||
QString sd3file = d3file.at(0).toElement().text();
|
||||
info->setPost3DFile(sd3file);
|
||||
}
|
||||
QDomNodeList d3nscalar = e->elementsByTagName("Post3DNodeScalar");
|
||||
if (d3nscalar.size() == 1)
|
||||
{
|
||||
QString sd3scalar = d3nscalar.at(0).toElement().text();
|
||||
info->setNodeScalarVariable(sd3scalar.split(","));
|
||||
// qDebug() << info->getScalarVariable();
|
||||
}
|
||||
QDomNodeList d3nvector = e->elementsByTagName("Post3DNodeVector");
|
||||
if (d3nvector.size() == 1)
|
||||
{
|
||||
QString sd3nvector = d3nvector.at(0).toElement().text();
|
||||
info->setNodeVectorVariable(sd3nvector.split(","));
|
||||
// qDebug() << info->getVectorVariable();
|
||||
}
|
||||
|
||||
QDomNodeList d3cscalar = e->elementsByTagName("Post3DCellScalar");
|
||||
if (d3cscalar.size() == 1)
|
||||
{
|
||||
QString sd3scalar = d3cscalar.at(0).toElement().text();
|
||||
info->setCellScalarVariable(sd3scalar.split(","));
|
||||
// qDebug() << info->getScalarVariable();
|
||||
}
|
||||
QDomNodeList d3cvector = e->elementsByTagName("Post3DCellVector");
|
||||
if (d3cvector.size() == 1)
|
||||
{
|
||||
QString sd3nvector = d3cvector.at(0).toElement().text();
|
||||
info->setCellVectorVariable(sd3nvector.split(","));
|
||||
// qDebug() << info->getVectorVariable();
|
||||
}
|
||||
|
||||
_postConfig->setPostConfigInfo(t, info);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
/**
|
||||
* @file DataConfigReader.h
|
||||
* @brief 算例数据配置信息读取类
|
||||
* @author FastCAE研发小组(fastcae@diso.cn)
|
||||
* @version 2.5.0
|
||||
* @date 2022-07-06 10:43
|
||||
* @copyright Copyright (c) Since 2020 青岛数智船海科技有限公司 All rights reserved.
|
||||
*
|
||||
* ============================================================================
|
||||
* Program: FastCAE
|
||||
*
|
||||
* Copyright (c) Since 2020 青岛数智船海科技有限公司 All rights reserved.
|
||||
* See License or http://www.fastcae.com/ for details.
|
||||
*
|
||||
* BSD 3-Clause License
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED.
|
||||
* ==================================================================================
|
||||
*/
|
||||
#ifndef _DATACONFIGREADER_H_
|
||||
#define _DATACONFIGREADER_H_
|
||||
|
||||
#include <QString>
|
||||
//#include "ModuleBase/IOBase.h"
|
||||
#include <QFile>
|
||||
#include "DataProperty/modelTreeItemType.h"
|
||||
|
||||
class QDomElement;
|
||||
class QDomDocument;
|
||||
|
||||
namespace ConfigOption
|
||||
{
|
||||
class DataConfig;
|
||||
class PostConfig;
|
||||
/**
|
||||
* @brief 算例数据配置信息读取类
|
||||
* @since 2.5.0
|
||||
*/
|
||||
class DataConfigReader //: public ModuleBase::IOBase
|
||||
{
|
||||
public:
|
||||
DataConfigReader(const QString fileName, DataConfig *dataconfig, PostConfig *postconfig);
|
||||
~DataConfigReader();
|
||||
|
||||
bool read() /*override*/;
|
||||
|
||||
private:
|
||||
void readDataBlock(ProjectTreeType t, QDomElement *e);
|
||||
void readPostConfig(ProjectTreeType t, QDomElement *e);
|
||||
|
||||
private:
|
||||
DataConfig *_dataConfig{};
|
||||
PostConfig *_postConfig{};
|
||||
QDomDocument *_doc{};
|
||||
QFile _file{};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
|
@ -0,0 +1,126 @@
|
|||
#include "GeometryConfig.h"
|
||||
|
||||
#define GEOON true;
|
||||
#define GEOOFF false;
|
||||
#define GEOIMPORT "stp;step;igs;iges;brep"
|
||||
#define GEOEXPORT "stp;step;igs;iges;brep"
|
||||
|
||||
namespace ConfigOption
|
||||
{
|
||||
GeometryConfig::GeometryConfig()
|
||||
{
|
||||
this->clearData();
|
||||
}
|
||||
|
||||
//2019.11.20 xvxinwei Geometry modeling operations sketch
|
||||
void GeometryConfig::enableGeometryModeling(bool on)
|
||||
{
|
||||
_isGeoModeling = on;
|
||||
}
|
||||
bool GeometryConfig::isGeometryModelingEnabled()
|
||||
{
|
||||
return _isGeoModeling;
|
||||
}
|
||||
void GeometryConfig::enableGeometryOperations(bool on)
|
||||
{
|
||||
_isGeoOperations = on;
|
||||
}
|
||||
bool GeometryConfig::isGeometryOperationsEnabled()
|
||||
{
|
||||
return _isGeoOperations;
|
||||
}
|
||||
void GeometryConfig::enableCreateSketch(bool on)
|
||||
{
|
||||
_isCreateSketch = on;
|
||||
}
|
||||
bool GeometryConfig::isCreateSketchEnabled()
|
||||
{
|
||||
return _isCreateSketch;
|
||||
}
|
||||
//设置导入几何格式
|
||||
void GeometryConfig::setImportSuffix(QString s)
|
||||
{
|
||||
_importSuffix = s;
|
||||
}
|
||||
//获取导入几何格式
|
||||
QString GeometryConfig::getImportSuffix()
|
||||
{
|
||||
return _importSuffix;
|
||||
}
|
||||
//设置导出几何格式
|
||||
void GeometryConfig::setExportSuffix(QString s)
|
||||
{
|
||||
_exportSuffix = s;
|
||||
}
|
||||
//获取导出几何格式
|
||||
QString GeometryConfig::getExportSuffix()
|
||||
{
|
||||
return _exportSuffix;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void GeometryConfig::enableGeometryEdit(bool on)
|
||||
{
|
||||
_isGeometryEdit = on;
|
||||
}
|
||||
|
||||
bool GeometryConfig::isGeometryEditEnabled()
|
||||
{
|
||||
return _isGeometryEdit;
|
||||
}
|
||||
|
||||
void GeometryConfig::enableGeometryCreateSet(bool on)
|
||||
{
|
||||
_isGeoCreateSet = on;
|
||||
}
|
||||
|
||||
bool GeometryConfig::isGeometryCreateSetEnabled()
|
||||
{
|
||||
return _isGeoCreateSet;
|
||||
}
|
||||
|
||||
void GeometryConfig::enableMeasureDsitance(bool on)
|
||||
{
|
||||
_isMeasureDistance = on;
|
||||
}
|
||||
|
||||
bool GeometryConfig::isMeasureDistanceEnabled()
|
||||
{
|
||||
return _isMeasureDistance;
|
||||
}
|
||||
|
||||
void GeometryConfig::clearData()
|
||||
{
|
||||
_importSuffix = GEOIMPORT;
|
||||
_exportSuffix = GEOEXPORT;
|
||||
_isGeoModeling = GEOON;
|
||||
_isGeoOperations = GEOON;
|
||||
_isCreateSketch = GEOON;
|
||||
_isGeometryEdit = GEOON;
|
||||
_isGeoCreateSet = GEOON;
|
||||
_isMeasureDistance = GEOON;
|
||||
|
||||
}
|
||||
|
||||
bool GeometryConfig::isGeometryEnabled()
|
||||
{
|
||||
bool in = this->isImportGeometryEnabled();
|
||||
bool ex = this->isExportGeometryEnabled();
|
||||
|
||||
bool op = _isCreateSketch || _isGeoModeling || _isGeoOperations || _isGeometryEdit || _isGeoCreateSet || _isMeasureDistance;
|
||||
|
||||
return in || ex || op;
|
||||
}
|
||||
|
||||
bool GeometryConfig::isImportGeometryEnabled()
|
||||
{
|
||||
return !_importSuffix.isEmpty();
|
||||
}
|
||||
|
||||
bool GeometryConfig::isExportGeometryEnabled()
|
||||
{
|
||||
return !_exportSuffix.isEmpty();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,85 @@
|
|||
/**
|
||||
* @file GeometryConfig.h
|
||||
* @brief 全局几何功能相关配置类
|
||||
* @author FastCAE研发小组(fastcae@diso.cn)
|
||||
* @version 2.5.0
|
||||
* @date 2022-07-06 10:42
|
||||
* @copyright Copyright (c) Since 2020 青岛数智船海科技有限公司 All rights reserved.
|
||||
*
|
||||
* ============================================================================
|
||||
* Program: FastCAE
|
||||
*
|
||||
* Copyright (c) Since 2020 青岛数智船海科技有限公司 All rights reserved.
|
||||
* See License or http://www.fastcae.com/ for details.
|
||||
*
|
||||
* BSD 3-Clause License
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED.
|
||||
* ==================================================================================
|
||||
*/
|
||||
#ifndef _GEOMETRYCONFIGDATA_H_
|
||||
#define _GEOMETRYCONFIGDATA_H_
|
||||
|
||||
#include "ConfigOptionsAPI.h"
|
||||
#include <QString>
|
||||
|
||||
namespace ConfigOption
|
||||
{
|
||||
/**
|
||||
* @brief 全局几何功能相关配置类
|
||||
* @since 2.5.0
|
||||
*/
|
||||
class CONFIGOPTIONSAPI GeometryConfig
|
||||
{
|
||||
public:
|
||||
GeometryConfig();
|
||||
~GeometryConfig() = default;
|
||||
|
||||
void clearData();
|
||||
|
||||
bool isGeometryEnabled();
|
||||
bool isImportGeometryEnabled();
|
||||
bool isExportGeometryEnabled();
|
||||
// Geometry modeling operations sketch
|
||||
void enableGeometryModeling(bool on); //设置Geometry modeling是否可用
|
||||
bool isGeometryModelingEnabled(); //获取Geometry modeling是否可用
|
||||
void enableGeometryOperations(bool on); //设置Geometry operations是否可用
|
||||
bool isGeometryOperationsEnabled(); //获取Geometry operations是否可用
|
||||
void enableCreateSketch(bool on); //设置Geometry sketch是否可用
|
||||
bool isCreateSketchEnabled(); //获取Geometry sketch是否可用
|
||||
void setImportSuffix(QString s); //设置导入几何格式
|
||||
QString getImportSuffix(); //获取导入几何格式
|
||||
void setExportSuffix(QString s); //设置导出几何格式
|
||||
QString getExportSuffix(); //获取导出几何格式
|
||||
|
||||
void enableGeometryEdit(bool on); //设置geometry edit是否可用
|
||||
bool isGeometryEditEnabled(); //获取geometry edit是否可用
|
||||
void enableGeometryCreateSet(bool on); //设置geometry create set是否可用
|
||||
bool isGeometryCreateSetEnabled(); //获取geometry create set是否可用
|
||||
void enableMeasureDsitance(bool on); //设置measure distance是否可用
|
||||
bool isMeasureDistanceEnabled(); //获取measure distance是否可用
|
||||
|
||||
protected:
|
||||
private:
|
||||
// bool _isGeoOn{ false };
|
||||
// bool _isimportGeo{ false };
|
||||
// QString _suffix{};
|
||||
// bool _isCreateGeo{ false };
|
||||
|
||||
bool _isGeoModeling{false}; // Geometry modeling
|
||||
bool _isGeoOperations{false}; // Geometry operations
|
||||
bool _isCreateSketch{false}; // Create Sketch
|
||||
bool _isGeometryEdit{false}; // geometry edit
|
||||
bool _isGeoCreateSet{false}; // geometry create set
|
||||
bool _isMeasureDistance{false}; // measure distance
|
||||
|
||||
QString _importSuffix{}; // importSuffix
|
||||
QString _exportSuffix{}; // exportSuffix
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
|
@ -0,0 +1,126 @@
|
|||
#include "GlobalConfig.h"
|
||||
|
||||
namespace ConfigOption
|
||||
{
|
||||
GlobalConfig::GlobalConfig(GlobalConfig* old)
|
||||
{
|
||||
_softName = old->getSoftName();
|
||||
_chineseName = old->getChineseName();
|
||||
_corporation = old->getCorporation();
|
||||
_website = old->getWebsite();
|
||||
_logo = old->getLogo();
|
||||
_welcome = old->getWelcome();
|
||||
_version = old->getVersion();
|
||||
_email = old->getEMail();
|
||||
_material = old->isMaterialEnabled();
|
||||
_userManual = old->GetUserManual();//Added xvdongming
|
||||
}
|
||||
|
||||
void GlobalConfig::setSoftName(QString name)
|
||||
{
|
||||
_softName = name;
|
||||
}
|
||||
QString GlobalConfig::getSoftName()
|
||||
{
|
||||
return _softName;
|
||||
}
|
||||
void GlobalConfig::setChineseName(QString n)
|
||||
{
|
||||
_chineseName = n;
|
||||
}
|
||||
QString GlobalConfig::getChineseName()
|
||||
{
|
||||
return _chineseName;
|
||||
}
|
||||
void GlobalConfig::setCorporation(QString c)
|
||||
{
|
||||
_corporation = c;
|
||||
}
|
||||
QString GlobalConfig::getCorporation()
|
||||
{
|
||||
return _corporation;
|
||||
}
|
||||
void GlobalConfig::setWebsite(QString c)
|
||||
{
|
||||
_website = c;
|
||||
}
|
||||
QString GlobalConfig::getWebsite()
|
||||
{
|
||||
return _website;
|
||||
}
|
||||
void GlobalConfig::setLogo(QString logo)
|
||||
{
|
||||
_logo = logo;
|
||||
}
|
||||
QString GlobalConfig::getLogo()
|
||||
{
|
||||
return _logo;
|
||||
}
|
||||
void GlobalConfig::setWelcome(QString w)
|
||||
{
|
||||
_welcome = w;
|
||||
}
|
||||
QString GlobalConfig::getWelcome()
|
||||
{
|
||||
return _welcome;
|
||||
}
|
||||
void GlobalConfig::setVersion(QString v)
|
||||
{
|
||||
_version = v;
|
||||
}
|
||||
QString GlobalConfig::getVersion()
|
||||
{
|
||||
return _version;
|
||||
}
|
||||
void GlobalConfig::setEMail(QString m)
|
||||
{
|
||||
_email = m;
|
||||
}
|
||||
QString GlobalConfig::getEMail()
|
||||
{
|
||||
return _email;
|
||||
}
|
||||
void GlobalConfig::enableMaterial(bool m)
|
||||
{
|
||||
_material = m;
|
||||
}
|
||||
bool GlobalConfig::isMaterialEnabled()
|
||||
{
|
||||
return _material;
|
||||
}
|
||||
|
||||
QString GlobalConfig::GetUserManual()
|
||||
{
|
||||
return _userManual;
|
||||
}
|
||||
|
||||
void GlobalConfig::SetUserManual(QString userManual)
|
||||
{
|
||||
_userManual = userManual;
|
||||
}
|
||||
|
||||
// void GlobalConfig::setUseRibbon(const QString& str)
|
||||
// {
|
||||
// _useRibbon = str;
|
||||
// }
|
||||
|
||||
// const QString GlobalConfig::getUseRibbon() const
|
||||
// {
|
||||
// return _useRibbon;
|
||||
// }
|
||||
|
||||
void GlobalConfig::clearData()
|
||||
{
|
||||
_softName.clear();
|
||||
_chineseName.clear();
|
||||
_corporation.clear();
|
||||
_website.clear();
|
||||
_logo.clear();
|
||||
_welcome.clear();
|
||||
_version.clear();
|
||||
_email.clear();
|
||||
_userManual.clear();//Added xvdongming
|
||||
_material = false;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,85 @@
|
|||
/**
|
||||
* @file GlobalConfig.h
|
||||
* @brief 软件信息全局配置类
|
||||
* @author FastCAE研发小组(fastcae@diso.cn)
|
||||
* @version 2.5.0
|
||||
* @date 2022-07-06 10:42
|
||||
* @copyright Copyright (c) Since 2020 青岛数智船海科技有限公司 All rights reserved.
|
||||
*
|
||||
* ============================================================================
|
||||
* Program: FastCAE
|
||||
*
|
||||
* Copyright (c) Since 2020 青岛数智船海科技有限公司 All rights reserved.
|
||||
* See License or http://www.fastcae.com/ for details.
|
||||
*
|
||||
* BSD 3-Clause License
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED.
|
||||
* ==================================================================================
|
||||
*/
|
||||
#ifndef _GOLBALCONFIG_H_
|
||||
#define _GOLBALCONFIG_H_
|
||||
|
||||
#include "ConfigOptionsAPI.h"
|
||||
#include <QString>
|
||||
|
||||
namespace ConfigOption
|
||||
{
|
||||
/**
|
||||
* @brief 软件信息全局配置类
|
||||
* @since 2.5.0
|
||||
*/
|
||||
class CONFIGOPTIONSAPI GlobalConfig
|
||||
{
|
||||
public:
|
||||
GlobalConfig() = default;
|
||||
~GlobalConfig() = default;
|
||||
GlobalConfig(GlobalConfig *old);
|
||||
|
||||
void setSoftName(QString name);
|
||||
QString getSoftName();
|
||||
void setChineseName(QString name);
|
||||
QString getChineseName();
|
||||
void setCorporation(QString c);
|
||||
QString getCorporation();
|
||||
void setWebsite(QString w);
|
||||
QString getWebsite();
|
||||
void setLogo(QString logo);
|
||||
QString getLogo();
|
||||
void setWelcome(QString w);
|
||||
QString getWelcome();
|
||||
void enableMaterial(bool m);
|
||||
void setVersion(QString v);
|
||||
QString getVersion();
|
||||
void setEMail(QString m);
|
||||
QString getEMail();
|
||||
bool isMaterialEnabled();
|
||||
void clearData();
|
||||
|
||||
QString GetUserManual(); // Added xvdongming 2019-11-22
|
||||
void SetUserManual(QString userManual); // Added xvdongming 2019-11-22
|
||||
|
||||
// void setUseRibbon(const QString& str);
|
||||
// const QString getUseRibbon() const;
|
||||
|
||||
private:
|
||||
QString _softName{};
|
||||
QString _chineseName{};
|
||||
QString _corporation{};
|
||||
QString _website{};
|
||||
QString _logo{};
|
||||
QString _welcome{};
|
||||
QString _version{};
|
||||
QString _email{};
|
||||
QString _userManual{}; // Added xvdongming 2019-11-22
|
||||
bool _material{false};
|
||||
|
||||
// QString _useRibbon{};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
|
@ -0,0 +1,284 @@
|
|||
#include "GlobalConfigReader.h"
|
||||
#include "ConfigOptions.h"
|
||||
#include "GlobalConfig.h"
|
||||
#include "GeometryConfig.h"
|
||||
#include "MeshConfig.h"
|
||||
#include "PostConfig.h"
|
||||
#include "ConfigDataBase.h"
|
||||
#include <QDomDocument>
|
||||
#include <QDomElement>
|
||||
#include <QDomNodeList>
|
||||
#include <QDebug>
|
||||
|
||||
namespace ConfigOption
|
||||
{
|
||||
GlobalConfigReader::GlobalConfigReader(QString fileName, ConfigDataBase* data)
|
||||
{
|
||||
_file.setFileName(fileName);
|
||||
_globalConfig = data->getGlobalConfig();
|
||||
_geoConfig = data->getGeometryConfig();
|
||||
_meshConfig = data->getMeshConfig();
|
||||
_postConfig = data->getPostConfig();
|
||||
// _globalConfig = ConfigOption::getInstance()->getGlobalConfig();
|
||||
// _geoConfig = ConfigOption::getInstance()->getGeometryConfig();
|
||||
// _meshConfig = ConfigOption::getInstance()->getMeshConfig();
|
||||
// _postConfig = ConfigOption::getInstance()->getPostConfig();
|
||||
}
|
||||
|
||||
GlobalConfigReader::~GlobalConfigReader()
|
||||
{
|
||||
if (_doc != nullptr) delete _doc;
|
||||
}
|
||||
|
||||
bool GlobalConfigReader::read()
|
||||
{
|
||||
if (!_file.open(QFile::ReadOnly | QFile::Text)) return false;
|
||||
_doc = new QDomDocument();
|
||||
if (!_doc->setContent(&_file))
|
||||
{
|
||||
_file.close();
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ok = false;
|
||||
|
||||
QDomNodeList globallist = _doc->elementsByTagName("Global");
|
||||
if (globallist.size() != 1) return false;
|
||||
QDomElement gele = globallist.at(0).toElement();
|
||||
ok = readGlobal(&gele);
|
||||
if (!ok) return false;
|
||||
|
||||
QDomNodeList geolist = _doc->elementsByTagName("Geometry");
|
||||
if (geolist.size() != 1) return false;
|
||||
QDomElement geoele = geolist.at(0).toElement();
|
||||
ok = readGeometry(&geoele);
|
||||
if (!ok) return false;
|
||||
|
||||
QDomNodeList meshlist = _doc->elementsByTagName("Mesh");
|
||||
if (meshlist.size() != 1) return false;
|
||||
QDomElement meshele = meshlist.at(0).toElement();
|
||||
ok = readMesh(&meshele);
|
||||
if (!ok) return false;
|
||||
|
||||
QDomNodeList postlist = _doc->elementsByTagName("Post");
|
||||
if (postlist.size() != 1) return false;
|
||||
QDomElement postele = postlist.at(0).toElement();
|
||||
ok = readPost(&postele);
|
||||
if (!ok) return false;
|
||||
|
||||
QDomNodeList materiallist = _doc->elementsByTagName("Material");
|
||||
if (materiallist.size() != 1) return false;
|
||||
QDomElement materialele = materiallist.at(0).toElement();
|
||||
QString s = materialele.attribute("Enable");
|
||||
if (s.toLower() == "true")
|
||||
_globalConfig->enableMaterial(true);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GlobalConfigReader::readGlobal(QDomElement* e)
|
||||
{
|
||||
QDomNodeList softnamelist = e->elementsByTagName("SoftName");
|
||||
if (softnamelist.size() == 1)
|
||||
{
|
||||
QDomElement nameele = softnamelist.at(0).toElement();
|
||||
QString name = nameele.attribute("name");
|
||||
QString chinese = nameele.attribute("Chinese");
|
||||
_globalConfig->setSoftName(name);
|
||||
_globalConfig->setChineseName(chinese);
|
||||
}
|
||||
QDomNodeList corlist = e->elementsByTagName("Corporation");
|
||||
if (corlist.size() == 1)
|
||||
{
|
||||
QDomElement corele = corlist.at(0).toElement();
|
||||
QString text = corele.text();
|
||||
_globalConfig->setCorporation(text);
|
||||
}
|
||||
QDomNodeList weblist = e->elementsByTagName("Website");
|
||||
if (weblist.size() == 1)
|
||||
{
|
||||
QDomElement webele = weblist.at(0).toElement();
|
||||
QString w = webele.text();
|
||||
_globalConfig->setWebsite(w);
|
||||
}
|
||||
QDomNodeList logolist = e->elementsByTagName("Logo");
|
||||
if (logolist.size() == 1)
|
||||
{
|
||||
QDomElement logoele = logolist.at(0).toElement();
|
||||
QString l = logoele.text();
|
||||
_globalConfig->setLogo(l);
|
||||
}
|
||||
QDomNodeList wellist = e->elementsByTagName("Welcome");
|
||||
if (wellist.size() == 1)
|
||||
{
|
||||
QDomElement welele = wellist.at(0).toElement();
|
||||
QString w = welele.text();
|
||||
_globalConfig->setWelcome(w);
|
||||
}
|
||||
QDomNodeList verlist = e->elementsByTagName("Version");
|
||||
if (verlist.size() == 1)
|
||||
{
|
||||
QDomElement verele = verlist.at(0).toElement();
|
||||
QString w = verele.text();
|
||||
_globalConfig->setVersion(w);
|
||||
}
|
||||
QDomNodeList maillist = e->elementsByTagName("Mail");
|
||||
if (maillist.size() == 1)
|
||||
{
|
||||
QDomElement verele = maillist.at(0).toElement();
|
||||
QString w = verele.text();
|
||||
_globalConfig->setEMail(w);
|
||||
}
|
||||
QDomNodeList helpFileList = e->elementsByTagName("HelpFile");
|
||||
if (helpFileList.size() == 1)
|
||||
{
|
||||
QDomElement verele = helpFileList.at(0).toElement();
|
||||
QString w = verele.text();
|
||||
_globalConfig->SetUserManual(w);
|
||||
}
|
||||
// QDomNodeList useRibbons = e->elementsByTagName("UseRibbon");
|
||||
// if (useRibbons.size() == 1)
|
||||
// {
|
||||
// QDomElement useRibbon = useRibbons.at(0).toElement();
|
||||
// QString text = useRibbon.text();
|
||||
// _globalConfig->setUseRibbon(text);
|
||||
// }
|
||||
return true;
|
||||
}
|
||||
bool GlobalConfigReader::readGeometry(QDomElement* e)
|
||||
{
|
||||
QDomNodeList importlist = e->elementsByTagName("ImportSuffix");
|
||||
QDomElement importele = importlist.at(0).toElement();
|
||||
QString importsuffix = importele.text();
|
||||
_geoConfig->setImportSuffix(importsuffix);
|
||||
|
||||
QDomNodeList exportlist = e->elementsByTagName("ExportSuffix");
|
||||
QDomElement exportele = exportlist.at(0).toElement();
|
||||
QString exportsuffix = exportele.text();
|
||||
_geoConfig->setExportSuffix(exportsuffix);
|
||||
|
||||
QDomNodeList sketchlist = e->elementsByTagName("CreateSketch");
|
||||
QDomElement sketchele = sketchlist.at(0).toElement();
|
||||
bool on = false;
|
||||
QString son = sketchele.attribute("Enable");
|
||||
if (son.toLower() == "true") on = true;
|
||||
_geoConfig->enableCreateSketch(on);
|
||||
|
||||
QDomNodeList fmodelList = e->elementsByTagName("FeatureModeling");
|
||||
QDomElement fmodelele = fmodelList.at(0).toElement();
|
||||
on = false;
|
||||
son = fmodelele.attribute("Enable");
|
||||
if (son.toLower() == "true") on = true;
|
||||
_geoConfig->enableGeometryModeling(on);
|
||||
|
||||
QDomNodeList foplList = e->elementsByTagName("FeatureOperations");
|
||||
QDomElement fopele = foplList.at(0).toElement();
|
||||
on = false;
|
||||
son = fopele.attribute("Enable");
|
||||
if (son.toLower() == "true") on = true;
|
||||
_geoConfig->enableGeometryOperations(on);
|
||||
|
||||
QDomNodeList geditList = e->elementsByTagName("GeometryEdit");
|
||||
QDomElement geditele = geditList.at(0).toElement();
|
||||
on = false;
|
||||
son = geditele.attribute("Enable");
|
||||
if (son.toLower() == "true") on = true;
|
||||
_geoConfig->enableGeometryEdit(on);
|
||||
|
||||
QDomNodeList csetList = e->elementsByTagName("CreateSet");
|
||||
QDomElement csetele = csetList.at(0).toElement();
|
||||
on = false;
|
||||
son = csetele.attribute("Enable");
|
||||
if (son.toLower() == "true") on = true;
|
||||
_geoConfig->enableGeometryCreateSet(on);
|
||||
|
||||
QDomNodeList mdisList = e->elementsByTagName("MeasureDistance");
|
||||
QDomElement mdisele = mdisList.at(0).toElement();
|
||||
on = false;
|
||||
son = mdisele.attribute("Enable");
|
||||
if (son.toLower() == "true") on = true;
|
||||
_geoConfig->enableMeasureDsitance(on);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GlobalConfigReader::readMesh(QDomElement* e)
|
||||
{
|
||||
QDomNodeList nodeList{};
|
||||
QDomElement ele{};
|
||||
QString text{};
|
||||
|
||||
nodeList = e->elementsByTagName("ImportSuffix");
|
||||
ele = nodeList.at(0).toElement();
|
||||
text = ele.text();
|
||||
_meshConfig->setImportSuffix(text);
|
||||
|
||||
nodeList = e->elementsByTagName("ExportSuffix");
|
||||
ele = nodeList.at(0).toElement();
|
||||
text = ele.text();
|
||||
_meshConfig->setExportSuffix(text);
|
||||
|
||||
nodeList = e->elementsByTagName("SurfaceMesh");
|
||||
ele = nodeList.at(0).toElement();
|
||||
text = ele.attribute("Enable");
|
||||
if (text.toLower() != "true")
|
||||
_meshConfig->enableSurfaceMesh(false);
|
||||
|
||||
nodeList = e->elementsByTagName("SolidMesh");
|
||||
ele = nodeList.at(0).toElement();
|
||||
text = ele.attribute("Enable");
|
||||
if (text.toLower() != "true")
|
||||
_meshConfig->enableSolidMesh(false);
|
||||
|
||||
nodeList = e->elementsByTagName("Component");
|
||||
ele = nodeList.at(0).toElement();
|
||||
text = ele.attribute("Enable");
|
||||
if (text.toLower() != "true")
|
||||
_meshConfig->enableComponent(false);
|
||||
|
||||
nodeList = e->elementsByTagName("CheckMesh");
|
||||
ele = nodeList.at(0).toElement();
|
||||
text = ele.attribute("Enable");
|
||||
if (text.toLower() != "true")
|
||||
_meshConfig->setCheckMesh(false);
|
||||
|
||||
nodeList = e->elementsByTagName("FluidMesh");
|
||||
ele = nodeList.at(0).toElement();
|
||||
text = ele.attribute("Enable");
|
||||
if (text.toLower() != "true")
|
||||
_meshConfig->enableFluidMesh(false);
|
||||
|
||||
nodeList = e->elementsByTagName("FilterMesh");
|
||||
ele = nodeList.at(0).toElement();
|
||||
text = ele.attribute("Enable");
|
||||
if (text.toLower() != "true")
|
||||
_meshConfig->enableFilterMesh(false);
|
||||
|
||||
nodeList = e->elementsByTagName("MeshModeling");
|
||||
ele = nodeList.at(0).toElement();
|
||||
text = ele.attribute("Enable");
|
||||
if (text.toLower() != "true")
|
||||
_meshConfig->enableMeshModeling(false);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GlobalConfigReader::readPost(QDomElement* e)
|
||||
{
|
||||
QString postattr = e->attribute("Enable");
|
||||
if (postattr.toLower() == "true")
|
||||
_postConfig->enablePost(true);
|
||||
QDomNodeList d2list = e->elementsByTagName("Post2D");
|
||||
QDomElement d2ele = d2list.at(0).toElement();
|
||||
QString post2dattr = d2ele.attribute("Enable");
|
||||
if (post2dattr.toLower() == "true")
|
||||
_postConfig->enablePost2D(true);
|
||||
QDomNodeList d3list = e->elementsByTagName("Post3D");
|
||||
QDomElement d3ele = d3list.at(0).toElement();
|
||||
QString post3dattr = d3ele.attribute("Enable");
|
||||
if (post3dattr.toLower() == "true")
|
||||
_postConfig->enablePost3D(true);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,65 @@
|
|||
/**
|
||||
* @file GlobalConfigReader.h
|
||||
* @brief 全局配置信息读取类
|
||||
* @author FastCAE研发小组(fastcae@diso.cn)
|
||||
* @version 2.5.0
|
||||
* @date 2022-07-06 10:42
|
||||
* @copyright Copyright (c) Since 2020 青岛数智船海科技有限公司 All rights reserved.
|
||||
*
|
||||
* ============================================================================
|
||||
* Program: FastCAE
|
||||
*
|
||||
* Copyright (c) Since 2020 青岛数智船海科技有限公司 All rights reserved.
|
||||
* See License or http://www.fastcae.com/ for details.
|
||||
*
|
||||
* BSD 3-Clause License
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED.
|
||||
* ==================================================================================
|
||||
*/
|
||||
#include "ModuleBase/IOBase.h"
|
||||
#include <QString>
|
||||
#include <QFile>
|
||||
|
||||
class QDomElement;
|
||||
class QDomDocument;
|
||||
|
||||
namespace ConfigOption
|
||||
{
|
||||
class GeometryConfig;
|
||||
class GlobalConfig;
|
||||
class MeshConfig;
|
||||
class PostConfig;
|
||||
class ConfigDataBase;
|
||||
/**
|
||||
* @brief 全局配置信息读取类
|
||||
* @since 2.5.0
|
||||
*/
|
||||
class GlobalConfigReader
|
||||
{
|
||||
public:
|
||||
GlobalConfigReader(QString fileName, ConfigDataBase *data);
|
||||
~GlobalConfigReader();
|
||||
|
||||
bool read();
|
||||
|
||||
private:
|
||||
bool readGlobal(QDomElement *e);
|
||||
bool readGeometry(QDomElement *e);
|
||||
bool readMesh(QDomElement *e);
|
||||
bool readPost(QDomElement *e);
|
||||
|
||||
private:
|
||||
GlobalConfig *_globalConfig{};
|
||||
GeometryConfig *_geoConfig{};
|
||||
MeshConfig *_meshConfig{};
|
||||
PostConfig *_postConfig{};
|
||||
|
||||
QFile _file{};
|
||||
QDomDocument *_doc{};
|
||||
};
|
||||
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
#include "MaterialConfig.h"
|
||||
#include "Material/Material.h"
|
||||
#include <QStringList>
|
||||
#include <QFile>
|
||||
#include <QDomDocument>
|
||||
#include <QDomNodeList>
|
||||
#include <QDomElement>
|
||||
|
||||
namespace ConfigOption
|
||||
{
|
||||
MaterialConfig::~MaterialConfig()
|
||||
{
|
||||
clearData();
|
||||
}
|
||||
|
||||
QStringList MaterialConfig::getMaterialTypes()
|
||||
{
|
||||
return _materialHash.keys();
|
||||
}
|
||||
|
||||
Material::Material* MaterialConfig::getMaterialByType(QString t)
|
||||
{
|
||||
return _materialHash.value(t);
|
||||
}
|
||||
|
||||
bool MaterialConfig::readConfig(QString fileName)
|
||||
{
|
||||
QFile file(fileName);
|
||||
if (!file.open(QFile::ReadOnly | QFile::Text)) return false;
|
||||
QDomDocument doc;
|
||||
if (!doc.setContent(&file))
|
||||
{
|
||||
file.close();
|
||||
return false;
|
||||
}
|
||||
QDomNodeList materiallist = doc.elementsByTagName("Material");
|
||||
const int n = materiallist.size();
|
||||
for (int i = 0; i < n; ++i)
|
||||
{
|
||||
QDomElement maele = materiallist.at(i).toElement();
|
||||
Material::Material* m = new Material::Material(false);
|
||||
m->readDataFromProjectFile(&maele);
|
||||
QString type = m->getType();
|
||||
if (_materialHash.contains(type))
|
||||
{
|
||||
auto ma = _materialHash.value(type);
|
||||
delete ma;
|
||||
}
|
||||
_materialHash[type] = m;
|
||||
}
|
||||
|
||||
file.close();
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
void MaterialConfig::clearData()
|
||||
{
|
||||
QList<Material::Material*> materials = _materialHash.values();
|
||||
for (int i = 0; i < materials.size(); ++i)
|
||||
{
|
||||
Material::Material* m = materials.at(i);
|
||||
delete m;
|
||||
}
|
||||
_materialHash.clear();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
/**
|
||||
* @file MaterialConfig.h
|
||||
* @brief 材料配置信息类
|
||||
* @author FastCAE研发小组(fastcae@diso.cn)
|
||||
* @version 2.5.0
|
||||
* @date 2022-07-06 10:45
|
||||
* @copyright Copyright (c) Since 2020 青岛数智船海科技有限公司 All rights reserved.
|
||||
*
|
||||
* ============================================================================
|
||||
* Program: FastCAE
|
||||
*
|
||||
* Copyright (c) Since 2020 青岛数智船海科技有限公司 All rights reserved.
|
||||
* See License or http://www.fastcae.com/ for details.
|
||||
*
|
||||
* BSD 3-Clause License
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED.
|
||||
* ==================================================================================
|
||||
*/
|
||||
#ifndef _MATERIALCONFIG_H
|
||||
#define _MATERIALCONFIG_H_
|
||||
|
||||
#include "ConfigOptionsAPI.h"
|
||||
#include <QHash>
|
||||
#include <QStringList>
|
||||
|
||||
namespace Material
|
||||
{
|
||||
class Material;
|
||||
}
|
||||
|
||||
namespace ConfigOption
|
||||
{
|
||||
/**
|
||||
* @brief 材料配置信息类
|
||||
* @since 2.5.0
|
||||
*/
|
||||
class CONFIGOPTIONSAPI MaterialConfig
|
||||
{
|
||||
public:
|
||||
MaterialConfig() = default;
|
||||
~MaterialConfig();
|
||||
|
||||
QStringList getMaterialTypes();
|
||||
Material::Material *getMaterialByType(QString t);
|
||||
void clearData();
|
||||
|
||||
bool readConfig(QString file);
|
||||
|
||||
private:
|
||||
QHash<QString, Material::Material *> _materialHash{};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
|
@ -0,0 +1,143 @@
|
|||
#include "MeshConfig.h"
|
||||
#include <QDebug>
|
||||
|
||||
#define MESHON true;
|
||||
#define MESHOFF false;
|
||||
#define MESHIMPORT "cgns;msh;neu;stl;dat;vtk;inp"
|
||||
#define MESHEXPORT "vtk;neu"
|
||||
|
||||
|
||||
namespace ConfigOption
|
||||
{
|
||||
MeshConfig::MeshConfig()
|
||||
{
|
||||
this->clearData();
|
||||
|
||||
}
|
||||
|
||||
bool MeshConfig::isMeshEnabled()
|
||||
{
|
||||
bool in = this->isImportMeshEnabled();
|
||||
bool ex = this->isExportMeshEnabled();
|
||||
|
||||
bool gen = _enableSurfaceMesh || _enableSolidMesh || _fluidMesh;
|
||||
|
||||
return in || ex || gen ;
|
||||
}
|
||||
|
||||
bool MeshConfig::isImportMeshEnabled()
|
||||
{
|
||||
return !_importSuffix.isEmpty();
|
||||
}
|
||||
|
||||
bool MeshConfig::isExportMeshEnabled()
|
||||
{
|
||||
return !_exportSuffix.isEmpty();
|
||||
}
|
||||
|
||||
void MeshConfig::setImportSuffix(QString s)
|
||||
{
|
||||
_importSuffix = s;
|
||||
}
|
||||
|
||||
QString MeshConfig::getImportSuffix()
|
||||
{
|
||||
return _importSuffix;
|
||||
}
|
||||
|
||||
void MeshConfig::setExportSuffix(QString s)
|
||||
{
|
||||
_exportSuffix = s;
|
||||
}
|
||||
|
||||
QString MeshConfig::getExportSuffix()
|
||||
{
|
||||
return _exportSuffix;
|
||||
}
|
||||
|
||||
bool MeshConfig::isMeshGenerationEnabled()
|
||||
{
|
||||
return _enableSolidMesh || _enableSurfaceMesh || _fluidMesh;
|
||||
}
|
||||
void MeshConfig::enableSurfaceMesh(bool on)
|
||||
{
|
||||
_enableSurfaceMesh = on;
|
||||
}
|
||||
bool MeshConfig::isSurfaceMeshEnabled()
|
||||
{
|
||||
return _enableSurfaceMesh;
|
||||
}
|
||||
void MeshConfig::enableSolidMesh(bool on)
|
||||
{
|
||||
_enableSolidMesh = on;
|
||||
}
|
||||
bool MeshConfig::isSolidMeshEnabled()
|
||||
{
|
||||
return _enableSolidMesh;
|
||||
}
|
||||
void MeshConfig::enableComponent(bool on)
|
||||
{
|
||||
_enableComponent = on;
|
||||
}
|
||||
bool MeshConfig::isComponentEnabled()
|
||||
{
|
||||
return _enableComponent;
|
||||
}
|
||||
|
||||
void MeshConfig::clearData()
|
||||
{
|
||||
|
||||
_exportSuffix = MESHEXPORT;
|
||||
_importSuffix = MESHIMPORT;
|
||||
|
||||
_enableSurfaceMesh = MESHON;
|
||||
_enableSolidMesh = MESHON;
|
||||
_enableComponent = MESHON;
|
||||
_checkMesh = MESHON;
|
||||
_fluidMesh = MESHON;
|
||||
_filterMesh = MESHON;
|
||||
_meshModeling = MESHON;
|
||||
}
|
||||
|
||||
//设置检测网格质量
|
||||
void MeshConfig::setCheckMesh(bool on)
|
||||
{
|
||||
_checkMesh = on;
|
||||
}
|
||||
//获取检测网格质量状态
|
||||
bool MeshConfig::getCheckMeshEnabled()
|
||||
{
|
||||
return _checkMesh;
|
||||
}
|
||||
|
||||
void MeshConfig::enableFluidMesh(bool on)
|
||||
{
|
||||
_fluidMesh = on;
|
||||
}
|
||||
|
||||
bool MeshConfig::isFluidMeshEnabled()
|
||||
{
|
||||
return _fluidMesh;
|
||||
}
|
||||
|
||||
void MeshConfig::enableFilterMesh(bool on)
|
||||
{
|
||||
_filterMesh = on;
|
||||
}
|
||||
|
||||
bool MeshConfig::isFilterMeshEnabled()
|
||||
{
|
||||
return _filterMesh;
|
||||
}
|
||||
|
||||
void MeshConfig::enableMeshModeling(bool on)
|
||||
{
|
||||
_meshModeling = on;
|
||||
}
|
||||
|
||||
bool MeshConfig::isMeshModelingEnabled()
|
||||
{
|
||||
return _meshModeling;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,96 @@
|
|||
/**
|
||||
* @file MeshConfig.h
|
||||
* @brief 网格配置信息类
|
||||
* @author FastCAE研发小组(fastcae@diso.cn)
|
||||
* @version 2.5.0
|
||||
* @date 2022-07-06 10:45
|
||||
* @copyright Copyright (c) Since 2020 青岛数智船海科技有限公司 All rights reserved.
|
||||
*
|
||||
* ============================================================================
|
||||
* Program: FastCAE
|
||||
*
|
||||
* Copyright (c) Since 2020 青岛数智船海科技有限公司 All rights reserved.
|
||||
* See License or http://www.fastcae.com/ for details.
|
||||
*
|
||||
* BSD 3-Clause License
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED.
|
||||
* ==================================================================================
|
||||
*/
|
||||
#ifndef _MESHCONFIG_H_
|
||||
#define _MESHCONFIG_H_
|
||||
|
||||
#include "ConfigOptionsAPI.h"
|
||||
#include <QString>
|
||||
|
||||
namespace ConfigOption
|
||||
{
|
||||
/**
|
||||
* @brief 网格配置信息类
|
||||
* @since 2.5.0
|
||||
*/
|
||||
class CONFIGOPTIONSAPI MeshConfig
|
||||
{
|
||||
public:
|
||||
MeshConfig();
|
||||
~MeshConfig() = default;
|
||||
void clearData();
|
||||
|
||||
bool isMeshEnabled();
|
||||
|
||||
bool isImportMeshEnabled();
|
||||
void setImportSuffix(QString s);
|
||||
QString getImportSuffix();
|
||||
|
||||
bool isExportMeshEnabled();
|
||||
void setExportSuffix(QString s);
|
||||
QString getExportSuffix();
|
||||
|
||||
bool isMeshGenerationEnabled();
|
||||
void enableSurfaceMesh(bool on);
|
||||
bool isSurfaceMeshEnabled();
|
||||
void enableSolidMesh(bool on);
|
||||
bool isSolidMeshEnabled();
|
||||
|
||||
void enableComponent(bool on);
|
||||
bool isComponentEnabled();
|
||||
|
||||
void setCheckMesh(bool on); //设置检测网格质量
|
||||
bool getCheckMeshEnabled(); //获取检测网格质量状态
|
||||
|
||||
void enableFluidMesh(bool on);
|
||||
bool isFluidMeshEnabled();
|
||||
|
||||
void enableFilterMesh(bool on);
|
||||
bool isFilterMeshEnabled();
|
||||
|
||||
void enableMeshModeling(bool on);
|
||||
bool isMeshModelingEnabled();
|
||||
|
||||
private:
|
||||
// bool _enableMesh{ false };
|
||||
// bool _importMesh{ false };
|
||||
QString _importSuffix{};
|
||||
// bool _exportMesh{ false };
|
||||
QString _exportSuffix{};
|
||||
|
||||
// bool _enableMeshGeneration{ false };
|
||||
// bool _isGmsher{ false };
|
||||
bool _enableSurfaceMesh{false};
|
||||
bool _enableSolidMesh{false};
|
||||
// bool _enableFluidMesh{ false };
|
||||
bool _enableComponent{false};
|
||||
|
||||
bool _checkMesh{false}; // check mesh
|
||||
|
||||
bool _fluidMesh{false};
|
||||
bool _filterMesh{false};
|
||||
bool _meshModeling{false};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
|
@ -0,0 +1,70 @@
|
|||
/**
|
||||
* @file MesherInfo.cpp
|
||||
* @brief 网格剖分器信息类源文件
|
||||
* @author FastCAE研发小组(fastcae@diso.cn)
|
||||
* @version 2.5.0
|
||||
* @date 2022-03-08 16:45
|
||||
* @copyright Copyright (c) Since 2020 青岛数智船海科技有限公司 All rights reserved.
|
||||
*
|
||||
* ============================================================================
|
||||
* Program: FastCAE
|
||||
*
|
||||
* Copyright (c) Since 2020 青岛数智船海科技有限公司 All rights reserved.
|
||||
* See License or http://www.fastcae.com/ for details.
|
||||
*
|
||||
* BSD 3-Clause License
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED.
|
||||
* ==================================================================================
|
||||
*/
|
||||
#include "MesherInfo.h"
|
||||
#include <QDomElement>
|
||||
#include <QDomAttr>
|
||||
#include <QDebug>
|
||||
|
||||
namespace ConfigOption
|
||||
{
|
||||
MesherInfo::MesherInfo()
|
||||
{
|
||||
this->setModuleType(DataProperty::Module_Mesher);
|
||||
}
|
||||
|
||||
QString MesherInfo::getMesherName()
|
||||
{
|
||||
return _mesherName;
|
||||
}
|
||||
|
||||
void MesherInfo::readParameters(QDomElement *ele)
|
||||
{
|
||||
_mesherName = ele->attribute("Name");
|
||||
this->appendProperty("Mesher", _mesherName);
|
||||
_template = ele->attribute("Template");
|
||||
_output = ele->attribute("Output");
|
||||
DataBase::readParameters(ele);
|
||||
}
|
||||
|
||||
QString MesherInfo::getTemplate()
|
||||
{
|
||||
return _template;
|
||||
}
|
||||
|
||||
QString MesherInfo::getOutput()
|
||||
{
|
||||
return _output;
|
||||
}
|
||||
|
||||
void MesherInfo::writeParameters(QDomDocument *doc, QDomElement *parent)
|
||||
{
|
||||
QDomElement mesherEle = doc->createElement("Mesher");
|
||||
mesherEle.setAttribute("Name", _mesherName);
|
||||
mesherEle.setAttribute("Template", _template);
|
||||
mesherEle.setAttribute("Output", _output);
|
||||
|
||||
DataBase::writeParameters(doc, &mesherEle);
|
||||
parent->appendChild(mesherEle);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,107 @@
|
|||
/**
|
||||
* @file MesherInfo.h
|
||||
* @brief 网格剖分器信息类头文件
|
||||
* @author FastCAE研发小组(fastcae@diso.cn)
|
||||
* @version 2.5.0
|
||||
* @date 2022-03-08 16:45
|
||||
* @copyright Copyright (c) Since 2020 青岛数智船海科技有限公司 All rights reserved.
|
||||
*
|
||||
* ============================================================================
|
||||
* Program: FastCAE
|
||||
*
|
||||
* Copyright (c) Since 2020 青岛数智船海科技有限公司 All rights reserved.
|
||||
* See License or http://www.fastcae.com/ for details.
|
||||
*
|
||||
* BSD 3-Clause License
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED.
|
||||
* ==================================================================================
|
||||
*/
|
||||
#ifndef _MESHERINFO_H_
|
||||
#define _MESHERINFO_H_
|
||||
|
||||
#include "ConfigOptionsAPI.h"
|
||||
#include "DataProperty/DataBase.h"
|
||||
#include <QString>
|
||||
|
||||
namespace ConfigOption
|
||||
{
|
||||
/**
|
||||
* @brief 网格剖分器信息类
|
||||
* @since 2.5.0
|
||||
*/
|
||||
class CONFIGOPTIONSAPI MesherInfo: public DataProperty::DataBase
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief 构造函数
|
||||
* @since 2.5.0
|
||||
*/
|
||||
MesherInfo();
|
||||
/**
|
||||
* @brief 析构函数
|
||||
* @since 2.5.0
|
||||
*/
|
||||
~MesherInfo() = default;
|
||||
/**
|
||||
* @brief 获取网格剖分器的名称
|
||||
* @return QString 网格剖分器的名称
|
||||
* @since 2.5.0
|
||||
*/
|
||||
QString getMesherName();
|
||||
/**
|
||||
* @brief 获取网格剖分器的模板文件
|
||||
* @return QString 网格剖分器的模板文件
|
||||
* @since 2.5.0
|
||||
*/
|
||||
QString getTemplate();
|
||||
/**
|
||||
* @brief 获取网格剖分器的输出文件
|
||||
* @return QString 网格剖分器的输出文件
|
||||
* @since 2.5.0
|
||||
*/
|
||||
QString getOutput();
|
||||
/**
|
||||
* @brief 从xml文件节点处读取网格剖分器的信息
|
||||
* @param ele xml文件的节点对象
|
||||
* @since 2.5.0
|
||||
*/
|
||||
void readParameters(QDomElement* ele) override;
|
||||
/**
|
||||
* @brief 将网格剖分器的信息写入到xml配置文件
|
||||
* @param doc xml配置文件对象
|
||||
* @param parent 要追加当前网格剖分器信息的父节点
|
||||
* @since 2.5.0
|
||||
*/
|
||||
void writeParameters(QDomDocument* doc, QDomElement* parent) override;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
private:
|
||||
/**
|
||||
* @brief 网格剖分器的名称
|
||||
* @since 2.5.0
|
||||
*/
|
||||
QString _mesherName{};
|
||||
/**
|
||||
* @brief 网格剖分器的模板文件
|
||||
* @since 2.5.0
|
||||
*/
|
||||
QString _template{};
|
||||
/**
|
||||
* @brief 网格剖分器的输出文件
|
||||
* @since 2.5.0
|
||||
*/
|
||||
QString _output{};
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif
|
|
@ -0,0 +1,40 @@
|
|||
#include "MesherPy.h"
|
||||
#include <QString>
|
||||
#include "ConfigOptions.h"
|
||||
#include "ConfigOptions/MeshConfig.h"
|
||||
#include "ConfigOptions/SolverConfig.h"
|
||||
#include "ConfigOptions/ConfigOptions.h"
|
||||
#include "ConfigOptions/MesherInfo.h"
|
||||
#include "DataProperty/ParameterBase.h"
|
||||
#include "PythonModule/PyAgent.h"
|
||||
#include <QDebug>
|
||||
namespace ConfigOption
|
||||
{
|
||||
|
||||
void MesherPy::setValue(int index, char *name, char *stype, char *svalue)
|
||||
{
|
||||
|
||||
QString sname(name);
|
||||
QString type(stype);
|
||||
QString value(svalue);
|
||||
SolverOption *solvers = ConfigOption::getInstance()->getSolverOption();
|
||||
if (solvers == nullptr)
|
||||
return;
|
||||
MesherInfo *info = solvers->getMesherAt(index);
|
||||
if (info == nullptr)
|
||||
return;
|
||||
DataProperty::ParameterBase *para = info->getParameterByName(sname);
|
||||
if (para == nullptr)
|
||||
return;
|
||||
DataProperty::ParaType t = DataProperty::ParameterBase::StringToParaType(type);
|
||||
if (t != para->getParaType())
|
||||
return;
|
||||
para->setValueFromString(value);
|
||||
Py::PythonAgent::getInstance()->unLock();
|
||||
}
|
||||
}
|
||||
|
||||
void CONFIGOPTIONSAPI setValue(int index, char *name, char *stype, char *svalue)
|
||||
{
|
||||
ConfigOption::MesherPy::setValue(index, name, stype, svalue);
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
/**
|
||||
* @file MesherPy.h
|
||||
* @brief 网格剖分器python接口封装类
|
||||
* @author FastCAE研发小组(fastcae@diso.cn)
|
||||
* @version 2.5.0
|
||||
* @date 2022-07-06 10:46
|
||||
* @copyright Copyright (c) Since 2020 青岛数智船海科技有限公司 All rights reserved.
|
||||
*
|
||||
* ============================================================================
|
||||
* Program: FastCAE
|
||||
*
|
||||
* Copyright (c) Since 2020 青岛数智船海科技有限公司 All rights reserved.
|
||||
* See License or http://www.fastcae.com/ for details.
|
||||
*
|
||||
* BSD 3-Clause License
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED.
|
||||
* ==================================================================================
|
||||
*/
|
||||
#ifndef MESHERPY_H_
|
||||
#define MESHERPY_H_
|
||||
#include "ConfigOptionsAPI.h"
|
||||
|
||||
namespace ConfigOption
|
||||
{
|
||||
/**
|
||||
* @brief 网格剖分器python接口封装类
|
||||
* @since 2.5.0
|
||||
*/
|
||||
class MesherPy
|
||||
{
|
||||
public:
|
||||
void static setValue(int index, char *name, char *stype, char *svalue);
|
||||
|
||||
protected:
|
||||
private:
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
extern "C"
|
||||
{
|
||||
void CONFIGOPTIONSAPI setValue(int index, char *name, char *stype, char *svalue);
|
||||
}
|
||||
|
||||
#endif
|
|
@ -0,0 +1,33 @@
|
|||
#include "ObserverConfig.h"
|
||||
#include "ParameterObserver.h"
|
||||
|
||||
namespace ConfigOption
|
||||
{
|
||||
void ObserverConfig::clearData()
|
||||
{
|
||||
QList<ProjectTreeType> typelist = _observerList.keys();
|
||||
for (int i = 0; i < typelist.size(); ++i)
|
||||
{
|
||||
ProjectTreeType type = typelist.at(i);
|
||||
QList<ParameterObserver*> observerlist = _observerList.value(type);
|
||||
for (int j = 0; j < observerlist.size(); ++j)
|
||||
{
|
||||
ParameterObserver* p = observerlist.at(j);
|
||||
delete p;
|
||||
}
|
||||
}
|
||||
_observerList.clear();
|
||||
}
|
||||
|
||||
void ObserverConfig::appendObserver(ProjectTreeType type, ParameterObserver* observer)
|
||||
{
|
||||
if (observer == nullptr) return;
|
||||
_observerList[type].append(observer);
|
||||
}
|
||||
|
||||
QList<ParameterObserver*> ObserverConfig::getObserverList(ProjectTreeType t)
|
||||
{
|
||||
return _observerList.value(t);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
#ifndef _OBSERVERCONFIG_H_
|
||||
#define _OBSERVERCONFIG_H_
|
||||
|
||||
#include <QHash>
|
||||
#include "ConfigOptionsAPI.h"
|
||||
#include "DataProperty/modelTreeItemType.h"
|
||||
|
||||
namespace ConfigOption
|
||||
{
|
||||
class ParameterObserver;
|
||||
|
||||
class CONFIGOPTIONSAPI ObserverConfig
|
||||
{
|
||||
public:
|
||||
ObserverConfig() = default;
|
||||
~ObserverConfig() = default;
|
||||
|
||||
void clearData();
|
||||
void appendObserver(ProjectTreeType type, ParameterObserver* observer);
|
||||
QList<ParameterObserver*> getObserverList(ProjectTreeType type);
|
||||
|
||||
private:
|
||||
QHash<ProjectTreeType, QList<ParameterObserver*>> _observerList{};
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -0,0 +1,107 @@
|
|||
#include "ObserverConfigReader.h"
|
||||
#include "ConfigOptions.h"
|
||||
#include "ObserverConfig.h"
|
||||
#include "ParameterObserver.h"
|
||||
#include "DataProperty/ParameterBase.h"
|
||||
#include "DataProperty/ParameterList.h"
|
||||
#include "DataProperty/ParameterGroup.h"
|
||||
#include <QDomDocument>
|
||||
#include <QDomElement>
|
||||
#include <QDomAttr>
|
||||
#include <QFile>
|
||||
#include <QDebug>
|
||||
|
||||
namespace ConfigOption
|
||||
{
|
||||
ObserverConfigReader::ObserverConfigReader(QString f,ObserverConfig* oc)
|
||||
{
|
||||
_filename = f;
|
||||
_observerConfig = oc;
|
||||
}
|
||||
|
||||
bool ObserverConfigReader::read()
|
||||
{
|
||||
QFile file(_filename);
|
||||
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) return false;
|
||||
QDomDocument doc;
|
||||
if (!doc.setContent(&file))
|
||||
{
|
||||
file.close();
|
||||
return false;
|
||||
}
|
||||
QDomNodeList obslist = doc.elementsByTagName("ObserverList");
|
||||
for (int i = 0; i < obslist.size(); ++i)
|
||||
{
|
||||
QDomElement obslistele = obslist.at(i).toElement();
|
||||
QString stype = obslistele.attribute("Type");
|
||||
ProjectTreeType type = getTreeTypeByString(stype);
|
||||
if (type == UnDefined) continue;
|
||||
// this->readBCType(&bclistele, type);
|
||||
this->readObserverList(&obslistele, type);
|
||||
}
|
||||
file.close();
|
||||
return true;
|
||||
}
|
||||
|
||||
void ObserverConfigReader::readObserverList(QDomElement* ele, ProjectTreeType type)
|
||||
{
|
||||
if (ele == nullptr) return;
|
||||
QDomNodeList observerlist = ele->elementsByTagName("Observer");
|
||||
for (int i = 0; i < observerlist.size(); ++i)
|
||||
{
|
||||
QDomElement obserele = observerlist.at(i).toElement();
|
||||
this->readObserver(&obserele, type);
|
||||
}
|
||||
}
|
||||
|
||||
void ObserverConfigReader::readObserver(QDomElement* ele, ProjectTreeType type)
|
||||
{
|
||||
if (ele == nullptr) return;
|
||||
ParameterObserver* obs = new ParameterObserver;
|
||||
QDomNodeList activelist = ele->elementsByTagName("Active");
|
||||
if (activelist.size() != 1) return;
|
||||
QDomElement domelement = activelist.at(0).toElement();
|
||||
QDomNodeList activeParaList = domelement.elementsByTagName("Parameter");
|
||||
int npara = activeParaList.size();
|
||||
for (int i = 0; i < npara; ++i)
|
||||
{
|
||||
QDomElement paraele = activeParaList.at(i).toElement();
|
||||
QString stype = paraele.attribute("Type");
|
||||
DataProperty::ParameterBase* p = DataProperty::ParameterList::createParameterByType(stype);
|
||||
if (p == nullptr) continue;
|
||||
p->readParameter(¶ele);
|
||||
obs->appendCofigActive(p->getDescribe(), p);
|
||||
}
|
||||
QDomNodeList followlist = ele->elementsByTagName("Follow");
|
||||
if (followlist.size() != 1) return;
|
||||
domelement = followlist.at(0).toElement();
|
||||
QDomNodeList followgroupList = domelement.elementsByTagName("ParameterGroup");
|
||||
npara = followgroupList.size();
|
||||
|
||||
for (int j = 0; j < npara; j++)
|
||||
{
|
||||
QDomElement paragroupele = followgroupList.at(j).toElement();
|
||||
DataProperty::ParameterGroup* g = new DataProperty::ParameterGroup;
|
||||
g->readParameters(¶groupele);
|
||||
obs->appendConfigFollowGroup(g->getDescribe(), g);
|
||||
// domelement.removeChild(paragroupele);
|
||||
}
|
||||
|
||||
QDomNodeList followParaList = domelement.elementsByTagName("Parameter");
|
||||
npara = followParaList.size();
|
||||
for (int i = 0; i < npara; ++i)
|
||||
{
|
||||
QDomElement paraele = followParaList.at(i).toElement();
|
||||
QString stype = paraele.attribute("Type");
|
||||
DataProperty::ParameterBase* p = DataProperty::ParameterList::createParameterByType(stype);
|
||||
if (p == nullptr) continue;
|
||||
p->readParameter(¶ele);
|
||||
obs->appendConfigFollow(p->getDescribe(), p);
|
||||
}
|
||||
|
||||
|
||||
_observerConfig->appendObserver(type, obs);
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
#ifndef _OBSERVERCONFIGREADER_H_
|
||||
#define _OBSERVERCONFIGREADER_H_
|
||||
|
||||
#include <QString>
|
||||
#include "DataProperty/modelTreeItemType.h"
|
||||
|
||||
class QDomElement;
|
||||
|
||||
namespace ConfigOption
|
||||
{
|
||||
class ObserverConfig;
|
||||
|
||||
class ObserverConfigReader
|
||||
{
|
||||
public:
|
||||
ObserverConfigReader(QString file, ObserverConfig* oc);
|
||||
~ObserverConfigReader() = default;
|
||||
|
||||
bool read();
|
||||
|
||||
private:
|
||||
void readObserverList(QDomElement* ele, ProjectTreeType type);
|
||||
void readObserver(QDomElement* ele, ProjectTreeType type);
|
||||
|
||||
private:
|
||||
ObserverConfig* _observerConfig{};
|
||||
QString _filename{};
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif
|
|
@ -0,0 +1,222 @@
|
|||
#include "ParameterObserver.h"
|
||||
#include "DataProperty/ParameterBase.h"
|
||||
#include "DataProperty/ParameterGroup.h"
|
||||
#include "DataProperty/ParameterList.h"
|
||||
#include <QDebug>
|
||||
|
||||
namespace ConfigOption
|
||||
{
|
||||
|
||||
ParameterObserver::~ParameterObserver()
|
||||
{
|
||||
QList<DataProperty::ParameterBase*> plist = _configActive.values();
|
||||
for (int i = 0; i < plist.size(); ++i)
|
||||
{
|
||||
auto p = plist.at(i);
|
||||
delete p;
|
||||
}
|
||||
_configActive.clear();
|
||||
plist = _configfollow.values();
|
||||
for (int i = 0; i < plist.size(); ++i)
|
||||
{
|
||||
auto p = plist.at(i);
|
||||
delete p;
|
||||
}
|
||||
_configfollow.clear();
|
||||
QList<DataProperty::ParameterGroup*> gplist = _configfollowGroup.values();
|
||||
for (int i = 0; i < gplist.size(); ++i)
|
||||
{
|
||||
auto p = gplist.at(i);
|
||||
delete p;
|
||||
}
|
||||
_configfollowGroup.clear();
|
||||
|
||||
_dataActive.clear();
|
||||
_datafollow.clear();
|
||||
}
|
||||
|
||||
void ParameterObserver::appendCofigActive(QString name, DataProperty::ParameterBase* p)
|
||||
{
|
||||
if (_configActive.contains(name))
|
||||
{
|
||||
DataProperty::ParameterBase* o = _configActive.value(name);
|
||||
delete o;
|
||||
}
|
||||
_configActive[name] = p;
|
||||
}
|
||||
|
||||
void ParameterObserver::appendConfigFollow(QString name, DataProperty::ParameterBase* p)
|
||||
{
|
||||
if (_configfollow.contains(name))
|
||||
{
|
||||
DataProperty::ParameterBase* o = _configfollow.value(name);
|
||||
delete o;
|
||||
}
|
||||
_configfollow[name] = p;
|
||||
}
|
||||
|
||||
void ParameterObserver::appendConfigFollowGroup(QString name, DataProperty::ParameterGroup* p)
|
||||
{
|
||||
if (_configfollowGroup.contains(name))
|
||||
{
|
||||
auto g = _configfollowGroup.value(name);
|
||||
delete g;
|
||||
}
|
||||
_configfollowGroup[name] = p;
|
||||
}
|
||||
|
||||
ParameterObserver* ParameterObserver::copy()
|
||||
{
|
||||
ParameterObserver* observer = new ParameterObserver;
|
||||
QList<QString> names = _configActive.keys();
|
||||
for (int i = 0; i < names.size(); ++i)
|
||||
{
|
||||
QString name = names.at(i);
|
||||
auto p = _configActive.value(name);
|
||||
auto cp = DataProperty::ParameterList::copyParameter(p);
|
||||
if (cp != nullptr)
|
||||
observer->appendCofigActive(name,cp);
|
||||
}
|
||||
names = _configfollow.keys();
|
||||
for (int i = 0; i < names.size(); ++i)
|
||||
{
|
||||
QString name = names.at(i);
|
||||
auto p = _configfollow.value(name);
|
||||
auto cp = DataProperty::ParameterList::copyParameter(p);
|
||||
if (cp != nullptr)
|
||||
observer->appendConfigFollow(name, cp);
|
||||
}
|
||||
names = _configfollowGroup.keys();
|
||||
for (int i = 0; i < names.size(); ++i)
|
||||
{
|
||||
QString name = names.at(i);
|
||||
auto g = _configfollowGroup.value(name);
|
||||
if (g == nullptr) continue;
|
||||
DataProperty::ParameterGroup* cg = new DataProperty::ParameterGroup;
|
||||
cg->copy(g);
|
||||
observer->appendConfigFollowGroup(name, cg);
|
||||
}
|
||||
return observer;
|
||||
}
|
||||
|
||||
void ParameterObserver::appendDataActive(QString name, DataProperty::ParameterBase*p)
|
||||
{
|
||||
_dataActive[name] = p;
|
||||
connect(p, SIGNAL(dataChanged()), this, SLOT(observe()));
|
||||
}
|
||||
|
||||
void ParameterObserver::appendDataFollow(QString name, DataProperty::ParameterBase*p)
|
||||
{
|
||||
_datafollow[name] = p;
|
||||
}
|
||||
|
||||
void ParameterObserver::appendDataFollowGroup(QString name, DataProperty::ParameterGroup* p)
|
||||
{
|
||||
_datafollowGroup[name] = p;
|
||||
}
|
||||
|
||||
|
||||
QStringList ParameterObserver::getActiveParameterNames()
|
||||
{
|
||||
return _configActive.keys();
|
||||
}
|
||||
|
||||
QStringList ParameterObserver::getFollowParameterNames()
|
||||
{
|
||||
return _configfollow.keys();
|
||||
}
|
||||
|
||||
QStringList ParameterObserver::getFollowGroupNames()
|
||||
{
|
||||
// qDebug() << _configfollowGroup.keys();
|
||||
return _configfollowGroup.keys();
|
||||
}
|
||||
|
||||
void ParameterObserver::removeConfigActive(QString name)
|
||||
{
|
||||
auto para = _configActive.value(name);
|
||||
if (para != nullptr)
|
||||
{
|
||||
delete para;
|
||||
_configActive.remove(name);
|
||||
}
|
||||
}
|
||||
void ParameterObserver::removeConfigFollow(QString name)
|
||||
{
|
||||
auto para = _configfollow.value(name);
|
||||
if (para != nullptr)
|
||||
{
|
||||
delete para;
|
||||
_configfollow.remove(name);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void ParameterObserver::removeConfigFollowGroup(QString name)
|
||||
{
|
||||
auto pg = _configfollowGroup.value(name);
|
||||
if (pg != nullptr)
|
||||
{
|
||||
delete pg;
|
||||
_configfollowGroup.remove(name);
|
||||
}
|
||||
}
|
||||
|
||||
void ParameterObserver::observe()
|
||||
{
|
||||
if (check())
|
||||
{
|
||||
changeStates();
|
||||
emit updateDisplay();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
bool ParameterObserver::check()
|
||||
{
|
||||
bool same = true;
|
||||
QStringList activenames = _configActive.keys();
|
||||
for (int i = 0; i < activenames.size(); ++i)
|
||||
{
|
||||
QString name = activenames.at(i);
|
||||
auto cp = _configActive.value(name);
|
||||
auto dp = _dataActive.value(name);
|
||||
if ((cp == nullptr) || (dp == nullptr)) continue;
|
||||
if (!cp->isSameValueWith(dp))
|
||||
{
|
||||
same = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return same;
|
||||
}
|
||||
|
||||
void ParameterObserver::changeStates()
|
||||
{
|
||||
QStringList follolwnames = _configfollow.keys();
|
||||
for (int i = 0; i < follolwnames.size(); ++i)
|
||||
{
|
||||
QString name = follolwnames.at(i);
|
||||
auto cp = _configfollow.value(name);
|
||||
auto dp = _datafollow.value(name);
|
||||
if ((cp == nullptr) || (dp == nullptr)) continue;
|
||||
dp->copy(cp, true);
|
||||
dp->copyStatus(cp);
|
||||
}
|
||||
follolwnames = _configfollowGroup.keys();
|
||||
for (int i = 0; i < follolwnames.size(); ++i)
|
||||
{
|
||||
QString name = follolwnames.at(i);
|
||||
auto cg = _configfollowGroup.value(name);
|
||||
auto dg = _datafollowGroup.value(name);
|
||||
if ((cg == nullptr) || (dg == nullptr)) continue;
|
||||
dg->copyStates(cg);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,69 @@
|
|||
#ifndef _PARAMETEROBSERVER_H_
|
||||
#define _PARAMETEROBSERVER_H_
|
||||
|
||||
#include "ConfigOptionsAPI.h"
|
||||
#include <QHash>
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include <QObject>
|
||||
|
||||
namespace DataProperty
|
||||
{
|
||||
class ParameterBase;
|
||||
class ParameterGroup;
|
||||
}
|
||||
|
||||
namespace ConfigOption
|
||||
{
|
||||
|
||||
class CONFIGOPTIONSAPI ParameterObserver : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ParameterObserver() = default;
|
||||
~ParameterObserver();
|
||||
|
||||
ParameterObserver* copy();
|
||||
|
||||
void appendCofigActive(QString name, DataProperty::ParameterBase* p);
|
||||
void appendConfigFollow(QString name, DataProperty::ParameterBase* p);
|
||||
void appendConfigFollowGroup(QString name, DataProperty::ParameterGroup* p);
|
||||
|
||||
void removeConfigActive(QString name);
|
||||
void removeConfigFollow(QString name);
|
||||
void removeConfigFollowGroup(QString name);
|
||||
|
||||
QStringList getActiveParameterNames();
|
||||
QStringList getFollowParameterNames();
|
||||
QStringList getFollowGroupNames();
|
||||
|
||||
void appendDataActive(QString name, DataProperty::ParameterBase*p);
|
||||
void appendDataFollow(QString name, DataProperty::ParameterBase*p);
|
||||
void appendDataFollowGroup(QString name, DataProperty::ParameterGroup* p);
|
||||
|
||||
signals:
|
||||
void updateDisplay();
|
||||
|
||||
public slots:
|
||||
void observe();
|
||||
|
||||
private:
|
||||
bool check();
|
||||
void changeStates();
|
||||
|
||||
private:
|
||||
QHash<QString, DataProperty::ParameterBase*> _configActive{};
|
||||
QHash<QString, DataProperty::ParameterBase*> _configfollow{};
|
||||
QHash<QString, DataProperty::ParameterGroup*> _configfollowGroup{};
|
||||
|
||||
QHash<QString, DataProperty::ParameterBase*> _dataActive{};
|
||||
QHash<QString, DataProperty::ParameterBase*> _datafollow{};
|
||||
QHash<QString, DataProperty::ParameterGroup*> _datafollowGroup{};
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif
|
|
@ -0,0 +1,70 @@
|
|||
#include "PostConfig.h"
|
||||
|
||||
#define POSTON true;
|
||||
#define POSTOFF false;
|
||||
|
||||
#include "PostConfigInfo.h"
|
||||
|
||||
namespace ConfigOption
|
||||
{
|
||||
|
||||
PostConfig::PostConfig()
|
||||
{
|
||||
this->clearData();
|
||||
}
|
||||
|
||||
void PostConfig::enablePost(bool on)
|
||||
{
|
||||
_enablePost = on;
|
||||
}
|
||||
bool PostConfig::isPostEnabled()
|
||||
{
|
||||
return _enablePost;
|
||||
}
|
||||
void PostConfig::enablePost2D(bool on)
|
||||
{
|
||||
_enablePost2D = on;
|
||||
}
|
||||
bool PostConfig::isPost2DEnabled()
|
||||
{
|
||||
return _enablePost2D;
|
||||
}
|
||||
void PostConfig::enablePost3D(bool on)
|
||||
{
|
||||
_enablePost3D = on;
|
||||
}
|
||||
bool PostConfig::isPost3DEnabled()
|
||||
{
|
||||
return _enablePost3D;
|
||||
}
|
||||
void PostConfig::setPostConfigInfo(ProjectTreeType type, PostConfigInfo* info)
|
||||
{
|
||||
if (_postConfigInfo.contains(type))
|
||||
{
|
||||
PostConfigInfo* f = _postConfigInfo.value(type);
|
||||
delete f;
|
||||
_postConfigInfo.remove(type);
|
||||
}
|
||||
_postConfigInfo[type] = info;
|
||||
}
|
||||
PostConfigInfo* PostConfig::getPostConfigInfo(ProjectTreeType type)
|
||||
{
|
||||
if (_postConfigInfo.contains(type))
|
||||
{
|
||||
return _postConfigInfo.value(type);
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void PostConfig::clearData()
|
||||
{
|
||||
_enablePost = POSTON;
|
||||
_enablePost2D = POSTON;
|
||||
_enablePost3D = POSTON;
|
||||
QList<PostConfigInfo*> infos = _postConfigInfo.values();
|
||||
for (auto info : infos)
|
||||
delete info;
|
||||
_postConfigInfo.clear();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
/**
|
||||
* @file PostConfig.h
|
||||
* @brief 后处理配置信息类
|
||||
* @author FastCAE研发小组(fastcae@diso.cn)
|
||||
* @version 2.5.0
|
||||
* @date 2022-07-06 10:49
|
||||
* @copyright Copyright (c) Since 2020 青岛数智船海科技有限公司 All rights reserved.
|
||||
*
|
||||
* ============================================================================
|
||||
* Program: FastCAE
|
||||
*
|
||||
* Copyright (c) Since 2020 青岛数智船海科技有限公司 All rights reserved.
|
||||
* See License or http://www.fastcae.com/ for details.
|
||||
*
|
||||
* BSD 3-Clause License
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED.
|
||||
* ==================================================================================
|
||||
*/
|
||||
#ifndef _POSTCONFIG_H_
|
||||
#define _POSTCONFIG_H_
|
||||
|
||||
#include "ConfigOptionsAPI.h"
|
||||
#include "DataProperty/modelTreeItemType.h"
|
||||
#include <QHash>
|
||||
|
||||
namespace ConfigOption
|
||||
{
|
||||
class PostConfigInfo;
|
||||
/**
|
||||
* @brief 后处理配置信息类
|
||||
* @since 2.5.0
|
||||
*/
|
||||
class CONFIGOPTIONSAPI PostConfig
|
||||
{
|
||||
public:
|
||||
PostConfig();
|
||||
~PostConfig() = default;
|
||||
|
||||
void enablePost(bool on);
|
||||
bool isPostEnabled();
|
||||
void enablePost2D(bool on);
|
||||
bool isPost2DEnabled();
|
||||
void enablePost3D(bool on);
|
||||
bool isPost3DEnabled();
|
||||
void setPostConfigInfo(ProjectTreeType type, PostConfigInfo *info);
|
||||
PostConfigInfo *getPostConfigInfo(ProjectTreeType type);
|
||||
void clearData();
|
||||
|
||||
private:
|
||||
bool _enablePost{false};
|
||||
bool _enablePost2D{false};
|
||||
bool _enablePost3D{false};
|
||||
|
||||
QHash<ProjectTreeType, PostConfigInfo *> _postConfigInfo{};
|
||||
// QHash<ProjectTreeType, double> _post3DConfig{};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
|
@ -0,0 +1,105 @@
|
|||
#include "PostConfigInfo.h"
|
||||
#include "PostCurve.h"
|
||||
|
||||
namespace ConfigOption
|
||||
{
|
||||
// void PostConfigInfo::setPost2DFile(QStringList name)
|
||||
// {
|
||||
// _post2DFile = name;
|
||||
// }
|
||||
QStringList PostConfigInfo::getPost2DFile()
|
||||
{
|
||||
QStringList s;
|
||||
for (int i = 0; i < _curves.size(); ++i)
|
||||
{
|
||||
PostCurve* c = _curves.at(i);
|
||||
QString f = c->getFile();
|
||||
if (!s.contains(f))
|
||||
s.append(f);
|
||||
}
|
||||
return s;
|
||||
}
|
||||
QStringList PostConfigInfo::get2DVariables(QString f)
|
||||
{
|
||||
QStringList v;
|
||||
for (int i = 0; i < _curves.size(); ++i)
|
||||
{
|
||||
PostCurve* c = _curves.at(i);
|
||||
QString file = c->getFile();
|
||||
if (!f.endsWith(file)) continue;
|
||||
QString x = c->getXVariable();
|
||||
QString y = c->getYVariable();
|
||||
if (!v.contains(x)) v.append(x);
|
||||
if (!v.contains(y)) v.append(y);
|
||||
}
|
||||
return v;
|
||||
|
||||
}
|
||||
|
||||
void PostConfigInfo::setPost3DFile(QString f)
|
||||
{
|
||||
_post3DFile = f;
|
||||
}
|
||||
QString PostConfigInfo::getPost3DFile()
|
||||
{
|
||||
return _post3DFile;
|
||||
}
|
||||
// void PostConfigInfo::set2DVariable(QStringList v)
|
||||
// {
|
||||
// _post2DVariable = v;
|
||||
// }
|
||||
// QStringList PostConfigInfo::get2DVariable()
|
||||
// {
|
||||
// return _post2DVariable;
|
||||
// }
|
||||
void PostConfigInfo::appendPostCurve(PostCurve* c)
|
||||
{
|
||||
_curves.append(c);
|
||||
}
|
||||
QList<PostCurve*> PostConfigInfo::getCurveList(/*QString f*/)
|
||||
{
|
||||
return _curves;
|
||||
}
|
||||
void PostConfigInfo::setNodeScalarVariable(QStringList sca)
|
||||
{
|
||||
_postNodeScalarVariable = sca;
|
||||
}
|
||||
QStringList PostConfigInfo::getNodeScalarVariable()
|
||||
{
|
||||
return _postNodeScalarVariable;
|
||||
}
|
||||
void PostConfigInfo::setNodeVectorVariable(QStringList s)
|
||||
{
|
||||
_postNodeVectorVariable = s;
|
||||
}
|
||||
QStringList PostConfigInfo::getNodeVectorVariable()
|
||||
{
|
||||
return _postNodeVectorVariable;
|
||||
}
|
||||
void PostConfigInfo::setCellScalarVariable(QStringList sca)
|
||||
{
|
||||
_postCellScalarVariable = sca;
|
||||
}
|
||||
QStringList PostConfigInfo::getCellScalarVariable()
|
||||
{
|
||||
return _postCellScalarVariable;
|
||||
}
|
||||
void PostConfigInfo::setCellVectorVariable(QStringList s)
|
||||
{
|
||||
_postCellVectorVariable = s;
|
||||
}
|
||||
QStringList PostConfigInfo::getCellVectorVariable()
|
||||
{
|
||||
return _postCellVectorVariable;
|
||||
}
|
||||
PostCurve* PostConfigInfo::getCurveByName(QString name)
|
||||
{
|
||||
for (int i = 0; i < _curves.size(); ++i)
|
||||
{
|
||||
PostCurve* curve = _curves.at(i);
|
||||
QString n = curve->getDescribe();
|
||||
if (name == n) return curve;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,76 @@
|
|||
/**
|
||||
* @file PostConfigInfo.h
|
||||
* @brief 后处理配置信息类
|
||||
* @author FastCAE研发小组(fastcae@diso.cn)
|
||||
* @version 2.5.0
|
||||
* @date 2022-07-06 10:54
|
||||
* @copyright Copyright (c) Since 2020 青岛数智船海科技有限公司 All rights reserved.
|
||||
*
|
||||
* ============================================================================
|
||||
* Program: FastCAE
|
||||
*
|
||||
* Copyright (c) Since 2020 青岛数智船海科技有限公司 All rights reserved.
|
||||
* See License or http://www.fastcae.com/ for details.
|
||||
*
|
||||
* BSD 3-Clause License
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED.
|
||||
* ==================================================================================
|
||||
*/
|
||||
#ifndef _POST2DCONFIG_H_
|
||||
#define _POST2DCONFIG_H_
|
||||
|
||||
#include "DataProperty/DataBase.h"
|
||||
#include "ConfigOptionsAPI.h"
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include <QHash>
|
||||
|
||||
namespace ConfigOption
|
||||
{
|
||||
class PostCurve;
|
||||
/**
|
||||
* @brief 后处理配置信息类
|
||||
* @since 2.5.0
|
||||
*/
|
||||
class CONFIGOPTIONSAPI PostConfigInfo : public DataProperty::DataBase
|
||||
{
|
||||
public:
|
||||
PostConfigInfo() = default;
|
||||
~PostConfigInfo() = default;
|
||||
|
||||
// void setPost2DFile(QStringList name);
|
||||
QStringList getPost2DFile();
|
||||
QStringList get2DVariables(QString f);
|
||||
void setPost3DFile(QString f);
|
||||
QString getPost3DFile();
|
||||
// void set2DVariable(QStringList v);
|
||||
// QStringList get2DVariable();
|
||||
void setNodeScalarVariable(QStringList sca);
|
||||
QStringList getNodeScalarVariable();
|
||||
void setNodeVectorVariable(QStringList s);
|
||||
QStringList getNodeVectorVariable();
|
||||
void setCellScalarVariable(QStringList sca);
|
||||
QStringList getCellScalarVariable();
|
||||
void setCellVectorVariable(QStringList s);
|
||||
QStringList getCellVectorVariable();
|
||||
void appendPostCurve(PostCurve *c);
|
||||
QList<PostCurve *> getCurveList();
|
||||
PostCurve *getCurveByName(QString name);
|
||||
|
||||
private:
|
||||
QList<PostCurve *> _curves{};
|
||||
QString _post3DFile{};
|
||||
// QStringList _post2DVariable{};
|
||||
QStringList _postNodeScalarVariable{};
|
||||
QStringList _postCellScalarVariable{};
|
||||
QStringList _postNodeVectorVariable{};
|
||||
QStringList _postCellVectorVariable{};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
|
@ -0,0 +1,56 @@
|
|||
#include "PostCurve.h"
|
||||
|
||||
namespace ConfigOption
|
||||
{
|
||||
|
||||
void PostCurve::setDescribe(QString d)
|
||||
{
|
||||
_describe = d;
|
||||
this->appendProperty("Name",d);
|
||||
}
|
||||
QString PostCurve::getDescribe()
|
||||
{
|
||||
return _describe;
|
||||
}
|
||||
void PostCurve::setXVariable(QString x)
|
||||
{
|
||||
_xVariable = x;
|
||||
this->appendProperty("X Axis", x);
|
||||
}
|
||||
QString PostCurve::getXVariable()
|
||||
{
|
||||
return _xVariable;
|
||||
}
|
||||
void PostCurve::setYVariable(QString y)
|
||||
{
|
||||
_yVariable = y;
|
||||
this->appendProperty("Y Axis", y);
|
||||
}
|
||||
QString PostCurve::getYVariable()
|
||||
{
|
||||
return _yVariable;
|
||||
}
|
||||
void PostCurve::setFile(QString f)
|
||||
{
|
||||
_file = f;
|
||||
this->appendProperty("File", f);
|
||||
}
|
||||
QString PostCurve::getFile()
|
||||
{
|
||||
return _file;
|
||||
}
|
||||
void PostCurve::copy(DataBase* data)
|
||||
{
|
||||
PostCurve* d = dynamic_cast<PostCurve*>(data);
|
||||
if (d == nullptr) return;
|
||||
QString des = d->getDescribe();
|
||||
QString x = d->getXVariable();
|
||||
QString y = d->getYVariable();
|
||||
QString f = d->getFile();
|
||||
this->setDescribe(des);
|
||||
this->setXVariable(x);
|
||||
this->setYVariable(y);
|
||||
this->setFile(f);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
/**
|
||||
* @file PostCurve.h
|
||||
* @brief 二维曲线配置信息类
|
||||
* @author FastCAE研发小组(fastcae@diso.cn)
|
||||
* @version 2.5.0
|
||||
* @date 2022-07-06 10:54
|
||||
* @copyright Copyright (c) Since 2020 青岛数智船海科技有限公司 All rights reserved.
|
||||
*
|
||||
* ============================================================================
|
||||
* Program: FastCAE
|
||||
*
|
||||
* Copyright (c) Since 2020 青岛数智船海科技有限公司 All rights reserved.
|
||||
* See License or http://www.fastcae.com/ for details.
|
||||
*
|
||||
* BSD 3-Clause License
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED.
|
||||
* ==================================================================================
|
||||
*/
|
||||
#ifndef _POSTCURVE_H_
|
||||
#define _POSTCURVE_H_
|
||||
|
||||
#include "DataProperty/DataBase.h"
|
||||
#include "ConfigOptions/ConfigOptionsAPI.h"
|
||||
#include <QString>
|
||||
|
||||
namespace ConfigOption
|
||||
{
|
||||
/**
|
||||
* @brief 二维曲线配置信息类
|
||||
* @since 2.5.0
|
||||
*/
|
||||
class CONFIGOPTIONSAPI PostCurve : public DataProperty::DataBase
|
||||
{
|
||||
public:
|
||||
PostCurve() = default;
|
||||
~PostCurve() = default;
|
||||
virtual void copy(DataBase *data) override;
|
||||
|
||||
void setDescribe(QString d);
|
||||
QString getDescribe();
|
||||
void setXVariable(QString x);
|
||||
QString getXVariable();
|
||||
void setYVariable(QString y);
|
||||
QString getYVariable();
|
||||
void setFile(QString f);
|
||||
QString getFile();
|
||||
|
||||
private:
|
||||
QString _describe{};
|
||||
QString _xVariable{};
|
||||
QString _yVariable{};
|
||||
QString _file{};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
|
@ -0,0 +1,87 @@
|
|||
#include "ProjectTreeConfig.h"
|
||||
#include "ProjectTreeInfo.h"
|
||||
|
||||
|
||||
namespace ConfigOption
|
||||
{
|
||||
|
||||
ProjectTreeConfig::~ProjectTreeConfig()
|
||||
{
|
||||
clearData();
|
||||
}
|
||||
void ProjectTreeConfig::appendTree(ProjectTreeType type, ProjectTreeInfo* ptree)
|
||||
{
|
||||
if (!_treeHash.contains(type))
|
||||
{
|
||||
_treeHash[type] = ptree;
|
||||
}
|
||||
}
|
||||
ProjectTreeInfo* ProjectTreeConfig::getProjectTree(ProjectTreeType type)
|
||||
{
|
||||
if (_treeHash.contains(type))
|
||||
{
|
||||
return _treeHash.value(type);
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
QStringList ProjectTreeConfig::getTreeNames()
|
||||
{
|
||||
QList<ProjectTreeInfo*> trees = _treeHash.values();
|
||||
QStringList names;
|
||||
for (int i = 0; i < trees.size();++i)
|
||||
{
|
||||
names.append(trees.at(i)->getName());
|
||||
}
|
||||
return names;
|
||||
}
|
||||
bool ProjectTreeConfig::isContains(ProjectTreeType type)
|
||||
{
|
||||
return _treeHash.contains(type);
|
||||
}
|
||||
|
||||
QList<ProjectTreeType> ProjectTreeConfig::getTreeTypes()
|
||||
{
|
||||
return _treeHash.keys();
|
||||
}
|
||||
void ProjectTreeConfig::clearData()
|
||||
{
|
||||
QList<ProjectTreeInfo*> values = _treeHash.values();
|
||||
const int n = values.size();
|
||||
for (int i = 0; i < n; ++i)
|
||||
{
|
||||
ProjectTreeInfo* tree = values.at(i);
|
||||
tree->clearTreeItems();
|
||||
delete tree;
|
||||
}
|
||||
_treeHash.clear();
|
||||
}
|
||||
|
||||
QString ProjectTreeConfig::getNameByType(ProjectTreeType t)
|
||||
{
|
||||
QString name;
|
||||
ProjectTreeInfo* tree = _treeHash.value(t);
|
||||
if (tree != nullptr)
|
||||
{
|
||||
name = tree->getName();
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
ProjectTreeType ProjectTreeConfig::getTypeByName(QString name)
|
||||
{
|
||||
QList<ProjectTreeInfo*> trees = _treeHash.values();
|
||||
ProjectTreeType t = UnDefined;
|
||||
for (int i = 0; i < trees.size(); ++i)
|
||||
{
|
||||
auto tree = trees.at(i);
|
||||
QString tname = tree->getName();
|
||||
if (name == tname)
|
||||
{
|
||||
t = _treeHash.key(tree);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return t;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
/**
|
||||
* @file ProjectTreeConfig.h
|
||||
* @brief 工程树配置信息类
|
||||
* @author FastCAE研发小组(fastcae@diso.cn)
|
||||
* @version 2.5.0
|
||||
* @date 2022-07-06 10:55
|
||||
* @copyright Copyright (c) Since 2020 青岛数智船海科技有限公司 All rights reserved.
|
||||
*
|
||||
* ============================================================================
|
||||
* Program: FastCAE
|
||||
*
|
||||
* Copyright (c) Since 2020 青岛数智船海科技有限公司 All rights reserved.
|
||||
* See License or http://www.fastcae.com/ for details.
|
||||
*
|
||||
* BSD 3-Clause License
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED.
|
||||
* ==================================================================================
|
||||
*/
|
||||
#ifndef _PROJECTTREECONFIG_H_
|
||||
#define _PROJECTTREECONFIG_H_
|
||||
|
||||
#include <QMap>
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include "DataProperty/modelTreeItemType.h"
|
||||
#include "ConfigOptionsAPI.h"
|
||||
|
||||
namespace ConfigOption
|
||||
{
|
||||
class ProjectTreeInfo;
|
||||
/**
|
||||
* @brief 工程树配置信息类
|
||||
* @since 2.5.0
|
||||
*/
|
||||
class CONFIGOPTIONSAPI ProjectTreeConfig
|
||||
{
|
||||
public:
|
||||
ProjectTreeConfig() = default;
|
||||
~ProjectTreeConfig();
|
||||
|
||||
void appendTree(ProjectTreeType type, ProjectTreeInfo *ptree);
|
||||
ProjectTreeInfo *getProjectTree(ProjectTreeType type);
|
||||
QList<ProjectTreeType> getTreeTypes();
|
||||
QStringList getTreeNames();
|
||||
bool isContains(ProjectTreeType type);
|
||||
void clearData();
|
||||
QString getNameByType(ProjectTreeType t);
|
||||
ProjectTreeType getTypeByName(QString name);
|
||||
|
||||
private:
|
||||
QMap<ProjectTreeType, ProjectTreeInfo *> _treeHash{};
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
|
@ -0,0 +1,323 @@
|
|||
#include "ProjectTreeInfo.h"
|
||||
#include <QTreeWidgetItem>
|
||||
#include <QTreeWidget>
|
||||
#include <QMenu>
|
||||
#include <QAction>
|
||||
#include <QTime>
|
||||
#include "TreeItemData.h"
|
||||
#include <QDebug>
|
||||
|
||||
namespace ConfigOption
|
||||
{
|
||||
|
||||
void ProjectTreeInfo::clearTreeItems()
|
||||
{
|
||||
const int n = _itemList.size();
|
||||
for (int i = 0; i < n; ++i)
|
||||
{
|
||||
delete _itemList[i];
|
||||
}
|
||||
_itemList.clear();
|
||||
}
|
||||
void ProjectTreeInfo::setName(const QString &fileName)
|
||||
{
|
||||
_name = fileName;
|
||||
}
|
||||
QString ProjectTreeInfo::getName()
|
||||
{
|
||||
return _name;
|
||||
}
|
||||
void ProjectTreeInfo::setType(ProjectTreeType type)
|
||||
{
|
||||
_treeType = type;
|
||||
}
|
||||
void ProjectTreeInfo::appendItem(TreeItem* item)
|
||||
{
|
||||
_itemList.append(item);
|
||||
}
|
||||
// void ProjectTreeInfo::createTree(QTreeWidgetItem* phyroot, GUI::MainWindow* mainwindow)
|
||||
// {
|
||||
// #ifndef CONFIGOPTIONS_API
|
||||
// if (_data == nullptr) return;
|
||||
// _mainWindow = mainwindow;
|
||||
// // QTreeWidgetItem* root = new QTreeWidgetItem(phyroot, TreeItemType::ProjectRoot);
|
||||
//
|
||||
// initBasicNode(phyroot);
|
||||
// QString lang = Setting::BusAPI::instance()->getLanguage();
|
||||
// double time = _data->getSolveTime();
|
||||
// if (time > 0) _solveStatus = Finished;
|
||||
// _data->setOutputFileName(_outputFile);
|
||||
//
|
||||
// int n = _itemList.size();
|
||||
// for (int i = 0; i < n; ++i)
|
||||
// {
|
||||
// QTreeWidgetItem* parent = _root;
|
||||
// TreeItem* item = _itemList.at(i);
|
||||
// if (item == nullptr) continue;
|
||||
// QString sparent = item->getParent();
|
||||
// if (_textItemHash.contains(sparent)) parent = _textItemHash.value(sparent);
|
||||
// QTreeWidgetItem* treeitem = new QTreeWidgetItem(parent, item->getType());
|
||||
// treeitem->setData(0, Qt::UserRole + 1, i + 1); //留空0,标记为不是配置文件创建
|
||||
// treeitem->setData(1, Qt::UserRole, item->getText()); //英文
|
||||
// treeitem->setData(1, Qt::UserRole + 1, item->getChinese());//中文
|
||||
// QString text = item->getText();
|
||||
// if (lang == "Chinese")
|
||||
// text = item->getChinese();
|
||||
// if (text.isEmpty()) text = item->getText();
|
||||
//
|
||||
// treeitem->setText(0,text);
|
||||
// QString sicon = item->getIcon();
|
||||
// QString icon = qApp->applicationDirPath() + "/../ConfigFiles/Icon/" + sicon;
|
||||
// treeitem->setIcon(0, QIcon(icon));
|
||||
// // qDebug() << text << item->getType();
|
||||
// _textItemHash[item->getText()] = treeitem;
|
||||
// }
|
||||
// for (int i = 0; i < _disableItems.size(); ++i)
|
||||
// {
|
||||
// QString s = _disableItems.at(i);
|
||||
// auto item = _textItemHash.value(s);
|
||||
// if (item == nullptr) continue;
|
||||
// item->setHidden(true);
|
||||
// }
|
||||
// #endif
|
||||
// }
|
||||
// void ProjectTreeInfo::initBasicNode(QTreeWidgetItem* phyroot)
|
||||
// {
|
||||
// #ifndef CONFIGOPTIONS_API
|
||||
// _root = new QTreeWidgetItem(phyroot, TreeItemType::ProjectRoot);
|
||||
// _root->setFlags(_root->flags() | Qt::ItemIsEditable);
|
||||
// _root->setIcon(0, QIcon(":/QUI/icon/physics.png"));
|
||||
// int id = _data->getID();
|
||||
// _root->setText(0, _data->getName()); //根据项目名称确定
|
||||
// _root->setData(0, Qt::UserRole, _data->getID());
|
||||
// _root->setExpanded(true);
|
||||
// #endif
|
||||
// }
|
||||
// void ProjectTreeInfo::on_MouseEvent(int eventType, QTreeWidgetItem* item)
|
||||
// {
|
||||
// _currentItem = item;
|
||||
// // TreeItemType type = (TreeItemType)item->type();
|
||||
// // if (type == Undefined) return;
|
||||
//
|
||||
// switch (eventType)
|
||||
// {
|
||||
// case 0: singleClicked();break;
|
||||
// case 1:createContextMenu();break;
|
||||
// case 2:doubleClicked();break;
|
||||
// default:break;
|
||||
// }
|
||||
// }
|
||||
void ProjectTreeInfo::copy(ProjectTreeInfo* tree)
|
||||
{
|
||||
// ProjectTree* tree = new ProjectTree;
|
||||
tree->setType(_treeType);
|
||||
tree->setName(_name);
|
||||
for (int i = 0; i < _itemList.size(); ++i)
|
||||
{
|
||||
TreeItem* item = _itemList.at(i);
|
||||
TreeItem* newitem = new TreeItem;
|
||||
newitem->copy(item);
|
||||
tree->appendItem(newitem);
|
||||
}
|
||||
tree->setOutputFileName(_outputFile);
|
||||
tree->setDisableItems(_disableItems);
|
||||
// _disableItems = tree->getDisableItems();
|
||||
qDebug() << _disableItems;
|
||||
// return tree;
|
||||
}
|
||||
// void ProjectTreeInfo::setData(ModelData::ModelDataBase* data)
|
||||
// {
|
||||
// _data = data;
|
||||
// }
|
||||
// ModelData::ModelDataBase* ProjectTreeInfo::getData()
|
||||
// {
|
||||
// return _data;
|
||||
// }
|
||||
void ProjectTreeInfo::setDisableItems(QStringList s)
|
||||
{
|
||||
_disableItems = s;
|
||||
}
|
||||
QStringList ProjectTreeInfo::getDisableItems()
|
||||
{
|
||||
return _disableItems;
|
||||
}
|
||||
// void ProjectTreeInfo::singleClicked()
|
||||
// {
|
||||
// qDebug() << "parent s";
|
||||
//
|
||||
// }
|
||||
// void ProjectTreeInfo::doubleClicked()
|
||||
// {
|
||||
// qDebug() << "parent d";
|
||||
// }
|
||||
// void ProjectTreeInfo::createContextMenu()
|
||||
// {
|
||||
// // qDebug() << "parent c";
|
||||
// QMenu pop_menu;
|
||||
// contextMenu(&pop_menu);
|
||||
// pop_menu.exec(QCursor::pos());
|
||||
// }
|
||||
// void ProjectTreeInfo::contextMenu(QMenu* menu)
|
||||
// {
|
||||
// QAction* action = nullptr;
|
||||
// int itemindex = _currentItem->data(0, Qt::UserRole + 1).toInt();
|
||||
// TreeItemType type = (TreeItemType)_currentItem->type();
|
||||
// if (itemindex > 0)
|
||||
// {
|
||||
// TreeItem* treeItem = _itemList.at(itemindex - 1);
|
||||
// const int n = treeItem->getContextMenuCount();
|
||||
// if (n < 1) return;
|
||||
// for (int i = 0; i < n; ++i)
|
||||
// {
|
||||
// QString menuText = treeItem->getContextMenuAt(i);
|
||||
// action = menu->addAction(menuText);
|
||||
// switch (type)
|
||||
// {
|
||||
// case ProjectPostSetting:
|
||||
// if (0 == i) connect(action, SIGNAL(triggered()), this, SLOT(openPostWindow()));
|
||||
//
|
||||
// break;
|
||||
// case ProjectMesh:
|
||||
// break;
|
||||
// case ProjectSolver:
|
||||
// break;
|
||||
// default: break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// void ProjectTreeInfo::updateTree()
|
||||
// {
|
||||
//
|
||||
// }
|
||||
// void ProjectTreeInfo::updateTreeByType(const TreeItemType type)
|
||||
// {
|
||||
//
|
||||
// }
|
||||
// QList<QTreeWidgetItem*> ProjectTreeInfo::getItemByType(const TreeItemType type,QTreeWidgetItem* root)
|
||||
// {
|
||||
// QList<QTreeWidgetItem*> items;
|
||||
// if (root == nullptr) root = _root;
|
||||
// if (root->type() == type) items.append(root);
|
||||
// const int n = root->childCount();
|
||||
// for (int i = 0; i < n; ++i)
|
||||
// {
|
||||
// QTreeWidgetItem* cc = root->child(i);
|
||||
// // qDebug() << cc->text(0);
|
||||
// if (cc->type() == type)
|
||||
// items.append(cc);
|
||||
// if (cc->childCount() > 0)
|
||||
// {
|
||||
// QList<QTreeWidgetItem*> il = getItemByType(type, cc);
|
||||
// items.append(il);
|
||||
// }
|
||||
// }
|
||||
// return items;
|
||||
// }
|
||||
// SolveStatus ProjectTreeInfo::getSolveStatus()
|
||||
// {
|
||||
// return _solveStatus;
|
||||
// }
|
||||
// void ProjectTreeInfo::solveBegin(int proIndex)
|
||||
// {
|
||||
// #ifndef CONFIGOPTIONS_API
|
||||
// ModelData::ModelDataSingleton* s = ModelData::ModelDataSingleton::getinstance();
|
||||
// int id = s->getModelIDByIndex(proIndex);
|
||||
// if (id < 0) return;
|
||||
// if (id != _data->getID()) return;
|
||||
// _solveStatus = Solving;
|
||||
// if (_timer == nullptr) _timer = new QTime;
|
||||
// _timer->start();
|
||||
// emit solveStatusChanged();
|
||||
// #endif
|
||||
// }
|
||||
// void ProjectTreeInfo::solveFinished(int proid)
|
||||
// {
|
||||
// #ifndef CONFIGOPTIONS_API
|
||||
// if (proid != _data->getID()) return;
|
||||
// _solveStatus = Finished;
|
||||
// if (_timer == nullptr) return;
|
||||
// double time = _timer->elapsed();
|
||||
// // qDebug() << time;
|
||||
// delete _timer; _timer = nullptr;
|
||||
// _data->setSolveTime(time);
|
||||
// emit solveStatusChanged();
|
||||
// #endif
|
||||
// }
|
||||
void ProjectTreeInfo::setOutputFileName(QString fileName)
|
||||
{
|
||||
_outputFile = fileName;
|
||||
}
|
||||
// void ProjectTreeInfo::reTranslate()
|
||||
// {
|
||||
// QString lang = Setting::BusAPI::instance()->getLanguage();
|
||||
// QList<QTreeWidgetItem*> itemList = _textItemHash.values();
|
||||
// const int n = itemList.size();
|
||||
// if (lang == "Chinese")
|
||||
// {
|
||||
// for (int i = 0; i < n; ++i)
|
||||
// {
|
||||
// QTreeWidgetItem* item = itemList.at(i);
|
||||
// if (item == nullptr) continue;
|
||||
// QString text = item->data(1, Qt::UserRole + 1).toString();
|
||||
// if (text.isEmpty()) continue;
|
||||
// item->setText(0, text);
|
||||
// }
|
||||
// }
|
||||
// else if (lang == "English")
|
||||
// {
|
||||
// for (int i = 0; i < n; ++i)
|
||||
// {
|
||||
// QTreeWidgetItem* item = itemList.at(i);
|
||||
// if (item == nullptr) continue;
|
||||
// QString text = item->data(1, Qt::UserRole).toString();
|
||||
// if (text.isEmpty()) continue;
|
||||
// item->setText(0, text);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
void ProjectTreeInfo::setChinese(QString s)
|
||||
{
|
||||
_chinese = s;
|
||||
}
|
||||
QString ProjectTreeInfo::getChinese()
|
||||
{
|
||||
return _chinese;
|
||||
}
|
||||
|
||||
QList<TreeItem*> ProjectTreeInfo::getItemList()
|
||||
{
|
||||
return _itemList;
|
||||
}
|
||||
|
||||
QString ProjectTreeInfo::getOutputFileName()
|
||||
{
|
||||
return _outputFile;
|
||||
}
|
||||
|
||||
// void ProjectTreeInfo::realTimeWindowOpened(Post::RealTimeWindowBase* w, int id)
|
||||
// {
|
||||
// #ifndef CONFIGOPTIONS_API
|
||||
// if (id == _data->getID())
|
||||
// _realTimeWin = w;
|
||||
// #endif
|
||||
//
|
||||
// }
|
||||
// void ProjectTreeInfo::realTimeWindowClosed(Post::RealTimeWindowBase* w)
|
||||
// {
|
||||
// if (_realTimeWin == w)
|
||||
// _realTimeWin = nullptr;
|
||||
// }
|
||||
// bool ProjectTreeInfo::isFileExist(QString fileName)
|
||||
// {
|
||||
// QFile f(fileName);
|
||||
// if (!f.exists())
|
||||
// {
|
||||
// QMessageBox::warning(nullptr, tr("Warning"), tr("File %1 is not exist!").arg(fileName));
|
||||
// return false;
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,105 @@
|
|||
/******************
|
||||
ProjectTreeBase操作
|
||||
***************** */
|
||||
|
||||
#ifndef PROJECTTREEINFO_H
|
||||
#define PROJECTTREEINFO_H
|
||||
|
||||
#include <QList>
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include <QHash>
|
||||
#include <QObject>
|
||||
#include "DataProperty/modelTreeItemType.h"
|
||||
#include "ConfigOptionsAPI.h"
|
||||
|
||||
|
||||
namespace ConfigOption
|
||||
{
|
||||
class TreeItem;
|
||||
|
||||
class CONFIGOPTIONSAPI ProjectTreeInfo /*: public QObject*/
|
||||
{
|
||||
// Q_OBJECT
|
||||
public:
|
||||
ProjectTreeInfo(/*GUI::MainWindow *mainwindow*/) = default;
|
||||
virtual ~ProjectTreeInfo()=default;
|
||||
//ProjectTree* copy();
|
||||
void copy(ProjectTreeInfo* tree);
|
||||
void setOutputFileName(QString fileName);
|
||||
QString getOutputFileName();
|
||||
void setName(const QString &name);
|
||||
QString getName();
|
||||
void setType(ProjectTreeType type);
|
||||
ProjectTreeType type() const { return _treeType; }
|
||||
void appendItem(TreeItem* item);
|
||||
// inline void createTree(QTreeWidgetItem* root, GUI::MainWindow* mainwindow);
|
||||
// virtual void setData(ModelData::ModelDataBase* data);
|
||||
// ModelData::ModelDataBase* getData();
|
||||
///清空QList<TreeItem*> _itemList{} 会产生严重后果,慎重调用
|
||||
void clearTreeItems();
|
||||
|
||||
// void on_MouseEvent(int eventType, QTreeWidgetItem* item);
|
||||
// virtual void updateTree();
|
||||
// virtual void updateTreeByType(const TreeItemType type);
|
||||
// SolveStatus getSolveStatus();
|
||||
// virtual void reTranslate();
|
||||
void setChinese(QString c);
|
||||
QString getChinese();
|
||||
void setDisableItems(QStringList s);
|
||||
QStringList getDisableItems();
|
||||
QList<TreeItem*> getItemList();
|
||||
// static bool isFileExist(QString fileName);
|
||||
|
||||
// protected slots:
|
||||
// //mainwindow 发送的求解模型信号
|
||||
// void solveBegin(int proIndex);
|
||||
// virtual void solveFinished(int proid);
|
||||
// void realTimeWindowOpened(Post::RealTimeWindowBase* w, int id);
|
||||
// void realTimeWindowClosed(Post::RealTimeWindowBase* w);
|
||||
//
|
||||
// signals:
|
||||
// /*显示属性 */
|
||||
// void disPlayProp(DataProperty::DataBase* pops);
|
||||
// //显示参数widget
|
||||
// void dispalyParaWidget(QWidget* w);
|
||||
// ///打开后处理窗口
|
||||
// void openPostWindowSig(Post::PostWindowBase* w);
|
||||
// ///展示PostWindow,根据ID和类型过滤
|
||||
// void showPostWindowInfo(int id, int type);
|
||||
// //求解状态改变
|
||||
// void solveStatusChanged();
|
||||
//
|
||||
//
|
||||
// protected:
|
||||
// virtual void initBasicNode(QTreeWidgetItem* root);
|
||||
//
|
||||
// virtual void singleClicked(/*QTreeWidgetItem* item, TreeItemType type */);
|
||||
// virtual void doubleClicked(/*QTreeWidgetItem* item, TreeItemType type */);
|
||||
// virtual void createContextMenu(/*QTreeWidgetItem* item, TreeItemType type */);
|
||||
// virtual void contextMenu(QMenu* menu);
|
||||
// ///根据类型获取树节点,根节点为nullptr时遍历全树
|
||||
// QList<QTreeWidgetItem*> getItemByType(const TreeItemType type,QTreeWidgetItem *root = nullptr);
|
||||
|
||||
protected:
|
||||
QString _name{};
|
||||
ProjectTreeType _treeType{ ProjectTreeType::UnDefined };
|
||||
QList<TreeItem*> _itemList{};
|
||||
|
||||
// QTreeWidgetItem *_root{};
|
||||
// QTreeWidgetItem* _currentItem{};
|
||||
// GUI::MainWindow* _mainWindow{};
|
||||
// QHash<QString, QTreeWidgetItem*> _textItemHash{};
|
||||
// ModelData::ModelDataBase* _data{};
|
||||
// SolveStatus _solveStatus{ UnSolved };
|
||||
// QTime* _timer{};
|
||||
QString _outputFile{};
|
||||
QString _chinese{};
|
||||
QStringList _disableItems{};
|
||||
|
||||
// Post::RealTimeWindowBase* _realTimeWin{};
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
#endif
|
|
@ -0,0 +1,172 @@
|
|||
/**
|
||||
* @file SolverConfig.cpp
|
||||
* @brief 求解器、网格剖分器管理类源文件
|
||||
* @author FastCAE研发小组(fastcae@diso.cn)
|
||||
* @version 2.5.0
|
||||
* @date 2022-03-08 16:30
|
||||
* @copyright Copyright (c) Since 2020 青岛数智船海科技有限公司 All rights reserved.
|
||||
*
|
||||
* ============================================================================
|
||||
* Program: FastCAE
|
||||
*
|
||||
* Copyright (c) Since 2020 青岛数智船海科技有限公司 All rights reserved.
|
||||
* See License or http://www.fastcae.com/ for details.
|
||||
*
|
||||
* BSD 3-Clause License
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED.
|
||||
* ==================================================================================
|
||||
*/
|
||||
#include "SolverConfig.h"
|
||||
#include "SolverInfo.h"
|
||||
#include "MesherInfo.h"
|
||||
#include <QFile>
|
||||
#include <QDomElement>
|
||||
#include <QDomDocument>
|
||||
#include <QTextStream>
|
||||
|
||||
namespace ConfigOption
|
||||
{
|
||||
void SolverOption::appendSolver(SolverInfo* s)
|
||||
{
|
||||
_solverlist.append(s);
|
||||
}
|
||||
SolverInfo* SolverOption::getSolverAt(int index)
|
||||
{
|
||||
SolverInfo* info = nullptr;
|
||||
if (index >= 0 && index < getSolverCount())
|
||||
info = _solverlist.at(index);
|
||||
return info;
|
||||
}
|
||||
int SolverOption::getSolverCount()
|
||||
{
|
||||
return _solverlist.count();
|
||||
}
|
||||
void SolverOption::clearData()
|
||||
{
|
||||
for (int i = 0; i < _solverlist.size(); ++i)
|
||||
{
|
||||
SolverInfo* d = _solverlist.at(i);
|
||||
delete d;
|
||||
}
|
||||
_solverlist.clear();
|
||||
|
||||
for (int i = 0; i < _mesherList.size(); ++i)
|
||||
{
|
||||
MesherInfo* d = _mesherList.at(i);
|
||||
delete d;
|
||||
}
|
||||
_mesherList.clear();
|
||||
}
|
||||
bool SolverOption::read(QString f)
|
||||
{
|
||||
QFile file(f);
|
||||
if (!file.open(QFile::ReadOnly | QFile::Text)) return false;
|
||||
QDomDocument doc;
|
||||
if (!doc.setContent(&file))
|
||||
{
|
||||
file.close();
|
||||
return false;
|
||||
}
|
||||
QDomNodeList solvernodelist = doc.elementsByTagName("Solver");
|
||||
for (int i = 0; i < solvernodelist.size(); ++i)
|
||||
{
|
||||
QDomElement ele = solvernodelist.at(i).toElement();
|
||||
SolverInfo* info = new SolverInfo;
|
||||
info->readXML(&ele);
|
||||
this->appendSolver(info);
|
||||
}
|
||||
QDomNodeList meshernodelist = doc.elementsByTagName("Mesher");
|
||||
for (int i = 0; i < meshernodelist.size(); ++i)
|
||||
{
|
||||
QDomElement ele = meshernodelist.at(i).toElement();
|
||||
MesherInfo* info = new MesherInfo;
|
||||
info->readParameters(&ele);
|
||||
this->appendMesher(info);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void SolverOption::write(QString f)
|
||||
{
|
||||
QDomDocument *doc = new QDomDocument;
|
||||
QDomProcessingInstruction instruction = doc->createProcessingInstruction("xml", "version=\"1.0\" encoding=\"UTF-8\"");
|
||||
doc->appendChild(instruction);
|
||||
QDomElement root = doc->createElement("DISO_CONFIG_FILE_1.0");
|
||||
doc->appendChild(root);
|
||||
|
||||
const int n = _solverlist.size();
|
||||
for (int i = 0; i < n; ++i)
|
||||
{
|
||||
auto s = _solverlist.at(i);
|
||||
s->writeXML(doc,&root);
|
||||
}
|
||||
|
||||
const int nm = _mesherList.size();
|
||||
for (int i = 0; i < nm; ++i)
|
||||
{
|
||||
auto m = _mesherList.at(i);
|
||||
m->writeParameters(doc, &root);
|
||||
}
|
||||
|
||||
QFile file(f);
|
||||
if (!file.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text)) return;
|
||||
QTextStream* stream = new QTextStream(&file);
|
||||
doc->save(*stream, 4);
|
||||
file.close();
|
||||
|
||||
delete stream;
|
||||
delete doc;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SolverOption::appendMesher(MesherInfo* m)
|
||||
{
|
||||
m->setIndex(_mesherList.size());
|
||||
_mesherList.append(m);
|
||||
m->generateParaInfo();
|
||||
}
|
||||
|
||||
MesherInfo* SolverOption::getMesherAt(int index)
|
||||
{
|
||||
MesherInfo* m = nullptr;
|
||||
if (index >= 0 && index < _mesherList.size())
|
||||
m = _mesherList.at(index);
|
||||
return m;
|
||||
}
|
||||
|
||||
int SolverOption::getMesherCount()
|
||||
{
|
||||
return _mesherList.size();
|
||||
}
|
||||
|
||||
MesherInfo* SolverOption::getMesherByName(QString name)
|
||||
{
|
||||
MesherInfo* mesher = nullptr;
|
||||
for (int i = 0; i < _mesherList.size(); ++i)
|
||||
{
|
||||
MesherInfo* f = _mesherList.at(i);
|
||||
if (name == f->getMesherName())
|
||||
{
|
||||
mesher = f;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return mesher;
|
||||
}
|
||||
|
||||
void SolverOption::removeSolver(int index)
|
||||
{
|
||||
if (index < 0 || index >= _solverlist.size()) return;
|
||||
auto s = _solverlist.at(index);
|
||||
_solverlist.removeAt(index);
|
||||
delete s;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,139 @@
|
|||
/**
|
||||
* @file SolverConfig.h
|
||||
* @brief 求解器、网格剖分器配置信息类
|
||||
* @author FastCAE研发小组(fastcae@diso.cn)
|
||||
* @version 2.5.0
|
||||
* @date 2022-03-08 16:28
|
||||
* @copyright Copyright (c) Since 2020 青岛数智船海科技有限公司 All rights reserved.
|
||||
*
|
||||
* ============================================================================
|
||||
* Program: FastCAE
|
||||
*
|
||||
* Copyright (c) Since 2020 青岛数智船海科技有限公司 All rights reserved.
|
||||
* See License or http://www.fastcae.com/ for details.
|
||||
*
|
||||
* BSD 3-Clause License
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED.
|
||||
* ==================================================================================
|
||||
*/
|
||||
#ifndef _SOLVERCONFIG_H_
|
||||
#define _SOLVERCONFIG_H_
|
||||
|
||||
#include "ConfigOptionsAPI.h"
|
||||
#include <QList>
|
||||
#include <QString>
|
||||
|
||||
namespace ConfigOption
|
||||
{
|
||||
class SolverInfo;
|
||||
class MesherInfo;
|
||||
/**
|
||||
* @brief 求解器、网格剖分器配置信息类
|
||||
* @since 2.5.0
|
||||
*/
|
||||
class CONFIGOPTIONSAPI SolverOption
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief 构造函数
|
||||
* @since 2.5.0
|
||||
*/
|
||||
SolverOption() = default;
|
||||
/**
|
||||
* @brief 析构函数
|
||||
* @since 2.5.0
|
||||
*/
|
||||
~SolverOption() = default;
|
||||
/**
|
||||
* @brief 清除求解器、网格剖分器列表
|
||||
* @since 2.5.0
|
||||
*/
|
||||
void clearData();
|
||||
/**
|
||||
* @brief 向求解器列表增加求解器
|
||||
* @param s 要增加的求解器对象
|
||||
* @since 2.5.0
|
||||
*/
|
||||
void appendSolver(SolverInfo *s);
|
||||
/**
|
||||
* @brief 向网格剖分器列表增加网格剖分器
|
||||
* @param s 要增加的网格剖分器对象
|
||||
* @since 2.5.0
|
||||
*/
|
||||
void appendMesher(MesherInfo *m);
|
||||
/**
|
||||
* @brief 获取索引位置为index的求解器
|
||||
* @param index 索引位置(从0开始)
|
||||
* @return SolverInfo* 求解器对象
|
||||
* @attention 索引超出范围会返回nullptr
|
||||
* @since 2.5.0
|
||||
*/
|
||||
SolverInfo *getSolverAt(int index);
|
||||
/**
|
||||
* @brief 获取索引位置为index的网格剖分器
|
||||
* @param index 索引位置(从0开始)
|
||||
* @return SolverInfo* 网格剖分器对象
|
||||
* @attention 索引超出范围会返回nullptr
|
||||
* @since 2.5.0
|
||||
*/
|
||||
MesherInfo *getMesherAt(int index);
|
||||
/**
|
||||
* @brief 获取名为name的网格剖分器
|
||||
* @param name 要获取网格剖分器的名称
|
||||
* @return MesherInfo* 网格剖分器对象
|
||||
* @attention 如果网格剖分器列表不存在名为name的对象,则返回nullptr
|
||||
* @since 2.5.0
|
||||
*/
|
||||
MesherInfo *getMesherByName(QString name);
|
||||
/**
|
||||
* @brief 获取求解器列表中的对象数量
|
||||
* @return int 求解器列表中的对象数量
|
||||
* @since 2.5.0
|
||||
*/
|
||||
int getSolverCount();
|
||||
/**
|
||||
* @brief 获取网格剖分器列表中的对象数量
|
||||
* @return int 网格剖分器列表中的对象数量
|
||||
* @since 2.5.0
|
||||
*/
|
||||
int getMesherCount();
|
||||
/**
|
||||
* @brief 移除索引位置index处的求解器
|
||||
* @param index 索引位置(从0开始)
|
||||
* @since 2.5.0
|
||||
*/
|
||||
void removeSolver(int index);
|
||||
/**
|
||||
* @brief 从配置文件(xml)中获取求解器、网格剖分器的列表
|
||||
* @param f xml配置文件的路径
|
||||
* @return bool 返回执行结果
|
||||
* @since 2.5.0
|
||||
*/
|
||||
bool read(QString f);
|
||||
/**
|
||||
* @brief 将求解器、网格剖分器的列表写入xml配置文件
|
||||
* @param f 要写入信息的xml配置文件的路径
|
||||
* @return bool 返回执行结果
|
||||
* @since 2.5.0
|
||||
*/
|
||||
void write(QString f);
|
||||
|
||||
private:
|
||||
/**
|
||||
* @brief 求解器列表
|
||||
* @since 2.5.0
|
||||
*/
|
||||
QList<SolverInfo *> _solverlist{};
|
||||
/**
|
||||
* @brief 网格剖分器列表
|
||||
* @since 2.5.0
|
||||
*/
|
||||
QList<MesherInfo *> _mesherList{};
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue