Compare commits

...

3 Commits
main ... v4.5

1
.gitignore vendored

@ -40,6 +40,7 @@ MSBUILD_Logs/
*.recipe *.recipe
*.zip *.zip
*.7z *.7z
*.tmp
# --- 4. 调试符号说明 --- # --- 4. 调试符号说明 ---
# 如果你们需要保留调试符号(用于崩溃分析),请注释掉下面这一行 # 如果你们需要保留调试符号(用于崩溃分析),请注释掉下面这一行

28
Drawer/.gitignore vendored

@ -0,0 +1,28 @@
packages
# 忽略中间文件
obj/*
# 忽略自己能够生成的 dll
ColorPicker.dll
CursorUtil.dll
DrawerInterface.dll
FlexenabledLic.dll
GeoSigmaDraw.dll
GeoSigmaDrawLib.dll
KepGridEditor.exe
KEVisualization.exe
SigmaDrawerStyle.dll
SigmaDrawerUtil.dll
SymbolLibInterface.dll
SymbolLibManager.exe
licenses.licx
SigmaDrawerUtil.csproj.FileListAbsolute.txt
SymbolLibManager.csproj.FileListAbsolute.txt
SymbolLibManager.exe.config
WellGroupEditor.exe.config
MLMicroStructure.dll
MLMicroStructure.pdb
MicroStructurePP.dll
MicroStructurePP.pdb
*.FileListAbsolute.txt

@ -1,116 +1,120 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')"/>
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{DE7A91F6-260B-4C8F-A2C0-4F080EE09BFE}</ProjectGuid> <ProjectGuid>{DE7A91F6-260B-4C8F-A2C0-4F080EE09BFE}</ProjectGuid>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>GeoSigma</RootNamespace> <RootNamespace>GeoSigma</RootNamespace>
<AssemblyName>ColorPicker</AssemblyName> <AssemblyName>ColorPicker</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic> <Deterministic>true</Deterministic>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
<OutputPath>..\bin\Debug\</OutputPath> <OutputPath>..\bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet /> <CodeAnalysisRuleSet/>
<UseVSHostingProcess>true</UseVSHostingProcess> <UseVSHostingProcess>true</UseVSHostingProcess>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<OutputPath>..\bin\Release\</OutputPath> <OutputPath>..\bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet /> <CodeAnalysisRuleSet/>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath> <OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget> <PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath> <OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget> <PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="DevExpress.Data.v20.1, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.Data.v20.1, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL"/>
<Reference Include="DevExpress.Utils.v20.1, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.Utils.v20.1, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL"/>
<Reference Include="DevExpress.XtraEditors.v20.1, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.XtraEditors.v20.1, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL"/>
<Reference Include="DevExpress.XtraVerticalGrid.v20.1, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.XtraVerticalGrid.v20.1, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL"/>
<Reference Include="System" /> <Reference Include="System"/>
<Reference Include="System.Core" /> <Reference Include="System.Core"/>
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing"/>
<Reference Include="System.Drawing.Design" /> <Reference Include="System.Drawing.Design"/>
<Reference Include="System.Windows.Forms" /> <Reference Include="System.Windows.Forms"/>
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq"/>
<Reference Include="System.Data.DataSetExtensions" /> <Reference Include="System.Data.DataSetExtensions"/>
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp"/>
<Reference Include="System.Data" /> <Reference Include="System.Data"/>
<Reference Include="System.Net.Http" /> <Reference Include="System.Net.Http"/>
<Reference Include="System.Xml" /> <Reference Include="System.Xml"/>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="CustomPropertyGridControl.cs"> <Compile Include="CustomPropertyGridControl.cs">
<SubType>Component</SubType> <SubType>Component</SubType>
</Compile> </Compile>
<Compile Include="FrmPicker.cs"> <Compile Include="FrmPicker.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="FrmPicker.Designer.cs"> <Compile Include="FrmPicker.Designer.cs">
<DependentUpon>FrmPicker.cs</DependentUpon> <DependentUpon>FrmPicker.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="FrmSigmaColor.cs"> <Compile Include="FrmSigmaColor.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="FrmSigmaColor.Designer.cs"> <Compile Include="FrmSigmaColor.Designer.cs">
<DependentUpon>FrmSigmaColor.cs</DependentUpon> <DependentUpon>FrmSigmaColor.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="PopPropertyEditorColor.cs" /> <Compile Include="PopPropertyEditorColor.cs"/>
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs"/>
<Compile Include="PropertyColorIndicatorConvert.cs" /> <Compile Include="PropertyColorIndicatorConvert.cs"/>
<Compile Include="PropertyEditorColor.cs" /> <Compile Include="PropertyEditorColor.cs"/>
<Compile Include="UCColorDialog.cs"> <Compile Include="UCColorDialog.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
</Compile> </Compile>
<Compile Include="UCColorDialog.Designer.cs"> <Compile Include="UCColorDialog.Designer.cs">
<DependentUpon>UCColorDialog.cs</DependentUpon> <DependentUpon>UCColorDialog.cs</DependentUpon>
</Compile> </Compile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<EmbeddedResource Include="FrmPicker.resx"> <EmbeddedResource Include="FrmPicker.resx">
<DependentUpon>FrmPicker.cs</DependentUpon> <DependentUpon>FrmPicker.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="FrmSigmaColor.resx"> <EmbeddedResource Include="FrmSigmaColor.resx">
<DependentUpon>FrmSigmaColor.cs</DependentUpon> <DependentUpon>FrmSigmaColor.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="UCColorDialog.resx"> <EmbeddedResource Include="UCColorDialog.resx">
<DependentUpon>UCColorDialog.cs</DependentUpon> <DependentUpon>UCColorDialog.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\UCDraw\SigmaDrawerUtil\SigmaDrawerUtil.csproj"> <ProjectReference Include="..\UCDraw\SigmaDrawerUtil\SigmaDrawerUtil.csproj">
<Project>{9a9ebfa1-819d-4a2f-9dbd-cf01c7994951}</Project> <Project>{9a9ebfa1-819d-4a2f-9dbd-cf01c7994951}</Project>
<Name>SigmaDrawerUtil</Name> <Name>SigmaDrawerUtil</Name>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets"/>
<Target Name="CustomClean" AfterTargets="Clean">
<RemoveDir Directories="$(BaseIntermediateOutputPath)"/>
<!-- 删除obj -->
</Target>
</Project> </Project>

Binary file not shown.

Binary file not shown.

@ -102,4 +102,8 @@
<None Include="App.config" /> <None Include="App.config" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="CustomClean" AfterTargets="Clean">
<RemoveDir Directories="$(BaseIntermediateOutputPath)"/>
<!-- 删除obj -->
</Target>
</Project> </Project>

@ -0,0 +1,26 @@
QMAKE_CXX.INCDIRS = \
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.16.27023\\include" \
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.16.27023\\atlmfc\\include" \
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Auxiliary\\VS\\include" \
"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.17763.0\\ucrt" \
"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.17763.0\\um" \
"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.17763.0\\shared" \
"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.17763.0\\winrt" \
"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.17763.0\\cppwinrt" \
"C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.6.1\\Include\\um" \
"C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.6.1\\Include\\um"
QMAKE_CXX.LIBDIRS = \
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.16.27023\\lib\\x64" \
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.16.27023\\atlmfc\\lib\\x64" \
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Auxiliary\\VS\\lib\\x64" \
"C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.17763.0\\ucrt\\x64" \
"C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.17763.0\\um\\x64" \
"C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.6.1\\lib\\um\\x64" \
"C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.6.1\\Lib\\um\\x64"
QMAKE_CXX.QT_COMPILER_STDCXX = 199711L
QMAKE_CXX.QMAKE_MSC_VER = 1916
QMAKE_CXX.QMAKE_MSC_FULL_VER = 191627051
QMAKE_CXX.COMPILER_MACROS = \
QT_COMPILER_STDCXX \
QMAKE_MSC_VER \
QMAKE_MSC_FULL_VER

@ -0,0 +1 @@
This is a dummy file needed to create ./moc_predefs.h

@ -0,0 +1,25 @@
QT_SYSROOT:
QT_INSTALL_PREFIX:D:/Qt/Qt5.9.4/5.9.4/msvc2017_64
QT_INSTALL_ARCHDATA:D:/Qt/Qt5.9.4/5.9.4/msvc2017_64
QT_INSTALL_DATA:D:/Qt/Qt5.9.4/5.9.4/msvc2017_64
QT_INSTALL_DOCS:D:/Qt/Qt5.9.4/Docs/Qt-5.9.4
QT_INSTALL_HEADERS:D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/include
QT_INSTALL_LIBS:D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/lib
QT_INSTALL_LIBEXECS:D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/bin
QT_INSTALL_BINS:D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/bin
QT_INSTALL_TESTS:D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/tests
QT_INSTALL_PLUGINS:D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/plugins
QT_INSTALL_IMPORTS:D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/imports
QT_INSTALL_QML:D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/qml
QT_INSTALL_TRANSLATIONS:D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/translations
QT_INSTALL_CONFIGURATION:
QT_INSTALL_EXAMPLES:D:/Qt/Qt5.9.4/Examples/Qt-5.9.4
QT_INSTALL_DEMOS:D:/Qt/Qt5.9.4/Examples/Qt-5.9.4
QT_HOST_PREFIX:D:/Qt/Qt5.9.4/5.9.4/msvc2017_64
QT_HOST_DATA:D:/Qt/Qt5.9.4/5.9.4/msvc2017_64
QT_HOST_BINS:D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/bin
QT_HOST_LIBS:D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/lib
QMAKE_SPEC:win32-msvc
QMAKE_XSPEC:win32-msvc
QMAKE_VERSION:3.1
QT_VERSION:5.9.4

@ -0,0 +1,6 @@
CONFIG += no_fixpath
QT = core gui widgets printsupport
DEFINES -= UNICODE _UNICODE

@ -0,0 +1,86 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid></ProjectGuid>
<RootNamespace>qtvars</RootNamespace>
<Keyword>Qt4VSv1.0</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="&apos;$(Configuration)|$(Platform)&apos;==&apos;Release|x64&apos;" Label="Configuration">
<PlatformToolset>v141</PlatformToolset>
<OutputDirectory>.\</OutputDirectory>
<ATLMinimizesCRunTimeLibraryUsage>false</ATLMinimizesCRunTimeLibraryUsage>
<CharacterSet>NotSet</CharacterSet>
<ConfigurationType>Application</ConfigurationType>
<PrimaryOutput>qtvars</PrimaryOutput>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings" />
<ImportGroup Condition="&apos;$(Configuration)|$(Platform)&apos;==&apos;Release|x64&apos;" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists(&apos;$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props&apos;)" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<OutDir Condition="&apos;$(Configuration)|$(Platform)&apos;==&apos;Release|x64&apos;">.\</OutDir>
<TargetName Condition="&apos;$(Configuration)|$(Platform)&apos;==&apos;Release|x64&apos;">qtvars</TargetName>
<IgnoreImportLibrary Condition="&apos;$(Configuration)|$(Platform)&apos;==&apos;Release|x64&apos;">true</IgnoreImportLibrary>
<LinkIncremental Condition="&apos;$(Configuration)|$(Platform)&apos;==&apos;Release|x64&apos;">false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="&apos;$(Configuration)|$(Platform)&apos;==&apos;Release|x64&apos;">
<ClCompile>
<AdditionalIncludeDirectories>C:\GeoIntelligent\Drawer\Drawer\FaciesOutline\FaciesOutlineLib\x64\Release\qt\qmake;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtPrintSupport;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtWidgets;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtGui;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtANGLE;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtCore;C:\GeoIntelligent\Drawer\Drawer\FaciesOutline\FaciesOutlineLib\x64\Release\qt\qmake;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\mkspecs\win32-msvc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>-Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding %(AdditionalOptions)</AdditionalOptions>
<AssemblerListingLocation>.\</AssemblerListingLocation>
<BrowseInformation>false</BrowseInformation>
<DebugInformationFormat>None</DebugInformationFormat>
<ExceptionHandling>Sync</ExceptionHandling>
<ObjectFileName>.\</ObjectFileName>
<Optimization>MaxSpeed</Optimization>
<PreprocessorDefinitions>_WINDOWS;WIN32;WIN64;QT_NO_DEBUG;QT_PRINTSUPPORT_LIB;QT_WIDGETS_LIB;QT_GUI_LIB;QT_CORE_LIB;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessToFile>false</PreprocessToFile>
<ProgramDataBaseFileName></ProgramDataBaseFileName>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<WarningLevel>TurnOffAllWarnings</WarningLevel>
</ClCompile>
<Link>
<AdditionalDependencies>D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\lib\qtmain.lib;shell32.lib;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\lib\Qt5PrintSupport.lib;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\lib\Qt5Widgets.lib;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\lib\Qt5Gui.lib;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\lib\Qt5Core.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\lib;C:\utils\my_sql\my_sql\lib;C:\utils\postgresql\pgsql\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>&quot;/MANIFESTDEPENDENCY:type=&apos;win32&apos; name=&apos;Microsoft.Windows.Common-Controls&apos; version=&apos;6.0.0.0&apos; publicKeyToken=&apos;6595b64144ccf1df&apos; language=&apos;*&apos; processorArchitecture=&apos;*&apos;&quot; %(AdditionalOptions)</AdditionalOptions>
<DataExecutionPrevention>true</DataExecutionPrevention>
<GenerateDebugInformation>false</GenerateDebugInformation>
<IgnoreImportLibrary>true</IgnoreImportLibrary>
<LinkIncremental>false</LinkIncremental>
<OutputFile>$(OutDir)\qtvars.exe</OutputFile>
<RandomizedBaseAddress>true</RandomizedBaseAddress>
<SubSystem>Windows</SubSystem>
<SuppressStartupBanner>true</SuppressStartupBanner>
</Link>
<Midl>
<DefaultCharType>Unsigned</DefaultCharType>
<EnableErrorChecks>None</EnableErrorChecks>
<WarningLevel>0</WarningLevel>
</Midl>
<ResourceCompile>
<PreprocessorDefinitions>_WINDOWS;WIN32;WIN64;QT_NO_DEBUG;QT_PRINTSUPPORT_LIB;QT_WIDGETS_LIB;QT_GUI_LIB;QT_CORE_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
</ItemDefinitionGroup>
<ItemGroup>
<CustomBuild Include="moc_predefs.h.cbt">
<FileType>Document</FileType>
<AdditionalInputs Condition="&apos;$(Configuration)|$(Platform)&apos;==&apos;Release|x64&apos;">D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\mkspecs\features\data\dummy.cpp;%(AdditionalInputs)</AdditionalInputs>
<Command Condition="&apos;$(Configuration)|$(Platform)&apos;==&apos;Release|x64&apos;">cl -BxD:\Qt\Qt5.9.4\5.9.4\msvc2017_64\bin\qmake.exe -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -O2 -MD -W0 -E D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\mkspecs\features\data\dummy.cpp 2>NUL >moc_predefs.h</Command>
<Message Condition="&apos;$(Configuration)|$(Platform)&apos;==&apos;Release|x64&apos;">Generate moc_predefs.h</Message>
<Outputs Condition="&apos;$(Configuration)|$(Platform)&apos;==&apos;Release|x64&apos;">moc_predefs.h;%(Outputs)</Outputs>
</CustomBuild>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets" />
</Project>

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Generated Files">
<UniqueIdentifier>{71ED8ED8-ACB9-4CE9-BBE1-E00B30144E11}</UniqueIdentifier>
<Extensions>cpp;c;cxx;moc;h;def;odl;idl;res;</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="moc_predefs.h.cbt">
<Filter>Generated Files</Filter>
</CustomBuild>
</ItemGroup>
</Project>

@ -0,0 +1,41 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Qt_DEFINES_>_WINDOWS;WIN32;WIN64;QT_NO_DEBUG;QT_PRINTSUPPORT_LIB;QT_WIDGETS_LIB;QT_GUI_LIB;QT_CORE_LIB;NDEBUG</Qt_DEFINES_>
<Qt_INCLUDEPATH_>D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtPrintSupport;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtWidgets;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtGui;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtANGLE;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtCore;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\mkspecs\win32-msvc</Qt_INCLUDEPATH_>
<Qt_STDCPP_></Qt_STDCPP_>
<Qt_RUNTIME_>MultiThreadedDLL</Qt_RUNTIME_>
<Qt_CL_OPTIONS_>-Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding</Qt_CL_OPTIONS_>
<Qt_LIBS_>D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\lib\qtmain.lib;shell32.lib;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\lib\Qt5PrintSupport.lib;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\lib\Qt5Widgets.lib;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\lib\Qt5Gui.lib;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\lib\Qt5Core.lib</Qt_LIBS_>
<Qt_LINK_OPTIONS_>"/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'"</Qt_LINK_OPTIONS_>
<QMake_QT_SYSROOT_></QMake_QT_SYSROOT_>
<QMake_QT_INSTALL_PREFIX_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64</QMake_QT_INSTALL_PREFIX_>
<QMake_QT_INSTALL_ARCHDATA_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64</QMake_QT_INSTALL_ARCHDATA_>
<QMake_QT_INSTALL_DATA_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64</QMake_QT_INSTALL_DATA_>
<QMake_QT_INSTALL_DOCS_>D:/Qt/Qt5.9.4/Docs/Qt-5.9.4</QMake_QT_INSTALL_DOCS_>
<QMake_QT_INSTALL_HEADERS_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/include</QMake_QT_INSTALL_HEADERS_>
<QMake_QT_INSTALL_LIBS_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/lib</QMake_QT_INSTALL_LIBS_>
<QMake_QT_INSTALL_LIBEXECS_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/bin</QMake_QT_INSTALL_LIBEXECS_>
<QMake_QT_INSTALL_BINS_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/bin</QMake_QT_INSTALL_BINS_>
<QMake_QT_INSTALL_TESTS_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/tests</QMake_QT_INSTALL_TESTS_>
<QMake_QT_INSTALL_PLUGINS_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/plugins</QMake_QT_INSTALL_PLUGINS_>
<QMake_QT_INSTALL_IMPORTS_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/imports</QMake_QT_INSTALL_IMPORTS_>
<QMake_QT_INSTALL_QML_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/qml</QMake_QT_INSTALL_QML_>
<QMake_QT_INSTALL_TRANSLATIONS_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/translations</QMake_QT_INSTALL_TRANSLATIONS_>
<QMake_QT_INSTALL_CONFIGURATION_></QMake_QT_INSTALL_CONFIGURATION_>
<QMake_QT_INSTALL_EXAMPLES_>D:/Qt/Qt5.9.4/Examples/Qt-5.9.4</QMake_QT_INSTALL_EXAMPLES_>
<QMake_QT_INSTALL_DEMOS_>D:/Qt/Qt5.9.4/Examples/Qt-5.9.4</QMake_QT_INSTALL_DEMOS_>
<QMake_QT_HOST_PREFIX_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64</QMake_QT_HOST_PREFIX_>
<QMake_QT_HOST_DATA_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64</QMake_QT_HOST_DATA_>
<QMake_QT_HOST_BINS_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/bin</QMake_QT_HOST_BINS_>
<QMake_QT_HOST_LIBS_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/lib</QMake_QT_HOST_LIBS_>
<QMake_QMAKE_SPEC_>win32-msvc</QMake_QMAKE_SPEC_>
<QMake_QMAKE_XSPEC_>win32-msvc</QMake_QMAKE_XSPEC_>
<QMake_QMAKE_VERSION_>3.1</QMake_QMAKE_VERSION_>
<QMake_QT_VERSION_>5.9.4</QMake_QT_VERSION_>
<QtBkup_QtHash>jZFBTsQwDEWv4hNMAQ0gFrPIxJ5iSBPLdgaNEOr9bzFpVVSJDVlkk/z37f/zzUjZ2W+n58Pb4ThPdo1PD4+v88sRYlGCsTJ8MY7kBqKc3apIUYcz5/UgXTiTnQbR8kHRB3aa1kt2LnnUUmWIKZZJOFFTURNGMiu6qww4x1SRJPh7r1VAXEeEtMHI2hYoymRgjlGk1yqFPNYwknnIGBRBa2tlol5+kyc+a9AbxDQXWdJ317Jn2UBoXv/QLfbnsIOtPMrtN+MSf3nr2+GPy+94pUTB6OcO</QtBkup_QtHash>
<QtVersion>5.9.4</QtVersion>
<QtVersionMajor>5</QtVersionMajor>
<QtVersionMinor>9</QtVersionMinor>
<QtVersionPatch>4</QtVersionPatch>
</PropertyGroup>
</Project>

@ -0,0 +1,41 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Qt_DEFINES_>_WINDOWS;WIN32;WIN64;QT_NO_DEBUG;QT_PRINTSUPPORT_LIB;QT_WIDGETS_LIB;QT_GUI_LIB;QT_CORE_LIB;NDEBUG</Qt_DEFINES_>
<Qt_INCLUDEPATH_>D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtPrintSupport;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtWidgets;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtGui;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtANGLE;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtCore;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\mkspecs\win32-msvc</Qt_INCLUDEPATH_>
<Qt_STDCPP_></Qt_STDCPP_>
<Qt_RUNTIME_>MultiThreadedDLL</Qt_RUNTIME_>
<Qt_CL_OPTIONS_>-Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding</Qt_CL_OPTIONS_>
<Qt_LIBS_>D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\lib\qtmain.lib;shell32.lib;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\lib\Qt5PrintSupport.lib;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\lib\Qt5Widgets.lib;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\lib\Qt5Gui.lib;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\lib\Qt5Core.lib</Qt_LIBS_>
<Qt_LINK_OPTIONS_>"/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'"</Qt_LINK_OPTIONS_>
<QMake_QT_SYSROOT_></QMake_QT_SYSROOT_>
<QMake_QT_INSTALL_PREFIX_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64</QMake_QT_INSTALL_PREFIX_>
<QMake_QT_INSTALL_ARCHDATA_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64</QMake_QT_INSTALL_ARCHDATA_>
<QMake_QT_INSTALL_DATA_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64</QMake_QT_INSTALL_DATA_>
<QMake_QT_INSTALL_DOCS_>D:/Qt/Qt5.9.4/Docs/Qt-5.9.4</QMake_QT_INSTALL_DOCS_>
<QMake_QT_INSTALL_HEADERS_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/include</QMake_QT_INSTALL_HEADERS_>
<QMake_QT_INSTALL_LIBS_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/lib</QMake_QT_INSTALL_LIBS_>
<QMake_QT_INSTALL_LIBEXECS_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/bin</QMake_QT_INSTALL_LIBEXECS_>
<QMake_QT_INSTALL_BINS_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/bin</QMake_QT_INSTALL_BINS_>
<QMake_QT_INSTALL_TESTS_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/tests</QMake_QT_INSTALL_TESTS_>
<QMake_QT_INSTALL_PLUGINS_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/plugins</QMake_QT_INSTALL_PLUGINS_>
<QMake_QT_INSTALL_IMPORTS_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/imports</QMake_QT_INSTALL_IMPORTS_>
<QMake_QT_INSTALL_QML_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/qml</QMake_QT_INSTALL_QML_>
<QMake_QT_INSTALL_TRANSLATIONS_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/translations</QMake_QT_INSTALL_TRANSLATIONS_>
<QMake_QT_INSTALL_CONFIGURATION_></QMake_QT_INSTALL_CONFIGURATION_>
<QMake_QT_INSTALL_EXAMPLES_>D:/Qt/Qt5.9.4/Examples/Qt-5.9.4</QMake_QT_INSTALL_EXAMPLES_>
<QMake_QT_INSTALL_DEMOS_>D:/Qt/Qt5.9.4/Examples/Qt-5.9.4</QMake_QT_INSTALL_DEMOS_>
<QMake_QT_HOST_PREFIX_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64</QMake_QT_HOST_PREFIX_>
<QMake_QT_HOST_DATA_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64</QMake_QT_HOST_DATA_>
<QMake_QT_HOST_BINS_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/bin</QMake_QT_HOST_BINS_>
<QMake_QT_HOST_LIBS_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/lib</QMake_QT_HOST_LIBS_>
<QMake_QMAKE_SPEC_>win32-msvc</QMake_QMAKE_SPEC_>
<QMake_QMAKE_XSPEC_>win32-msvc</QMake_QMAKE_XSPEC_>
<QMake_QMAKE_VERSION_>3.1</QMake_QMAKE_VERSION_>
<QMake_QT_VERSION_>5.9.4</QMake_QT_VERSION_>
<QtBkup_QtHash>jZFBTsQwDEWv4hNMAQ0gFrPIxJ5iSBPLdgaNEOr9bzFpVVSJDVlkk/z37f/zzUjZ2W+n58Pb4ThPdo1PD4+v88sRYlGCsTJ8MY7kBqKc3apIUYcz5/UgXTiTnQbR8kHRB3aa1kt2LnnUUmWIKZZJOFFTURNGMiu6qww4x1SRJPh7r1VAXEeEtMHI2hYoymRgjlGk1yqFPNYwknnIGBRBa2tlol5+kyc+a9AbxDQXWdJ317Jn2UBoXv/QLfbnsIOtPMrtN+MSf3nr2+GPy+94pUTB6OcO</QtBkup_QtHash>
<QtVersion>5.9.4</QtVersion>
<QtVersionMajor>5</QtVersionMajor>
<QtVersionMinor>9</QtVersionMinor>
<QtVersionPatch>4</QtVersionPatch>
</PropertyGroup>
</Project>

@ -107,4 +107,8 @@
</BootstrapperPackage> </BootstrapperPackage>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="CustomClean" AfterTargets="Clean">
<RemoveDir Directories="$(BaseIntermediateOutputPath)"/>
<!-- 删除obj -->
</Target>
</Project> </Project>

@ -1,7 +1,9 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.IO;
using System.Linq; using System.Linq;
using System.Runtime.ExceptionServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
@ -22,6 +24,12 @@ namespace FlexenabledLic
/// </summary> /// </summary>
public class LicHelp public class LicHelp
{ {
private LoginResult result;
public LoginResult Result
{
get { return result; }
private set { result = value; }
}
public LoginResultEventHandler LoginResultEvent; public LoginResultEventHandler LoginResultEvent;
private BackgroundWorker backgroundWorker1; private BackgroundWorker backgroundWorker1;
private string AppName; private string AppName;
@ -41,8 +49,11 @@ namespace FlexenabledLic
/// <param name="e">The e.</param> /// <param name="e">The e.</param>
private void loginWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) private void loginWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{ {
LoginResult loginResult = (LoginResult)e.Result; result = (LoginResult)e.Result;
LoginResultEvent?.Invoke(loginResult); //if (result.Status != 2)
//{
LoginResultEvent?.Invoke(result);
//}
} }
/// <summary> /// <summary>
@ -50,33 +61,54 @@ namespace FlexenabledLic
/// </summary> /// </summary>
/// <param name="sender">The sender.</param> /// <param name="sender">The sender.</param>
/// <param name="e">The e.</param> /// <param name="e">The e.</param>
[HandleProcessCorruptedStateExceptions]
private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
{ {
LoginResult loginResult; LoginResult loginResult = new LoginResult();
loginResult.Status = -1; loginResult.Status = 1;
loginResult.AppName = AppName; loginResult.AppName = AppName;
BackgroundWorker worker = sender as BackgroundWorker; BackgroundWorker worker = sender as BackgroundWorker;
try try
{ {
LicHelp.Initialize(); if (!File.Exists("FlexDll.dll"))
{
loginResult.Status = 2; // 该状态表示不需要使用FlexDll.dll进行登录
loginResult.Message = "FlexDll.dll未找到";
e.Result = loginResult;
return;
}
else
{
LicHelp.Initialize();
}
} }
catch (Exception ex) catch (Exception ex)
{ {
loginResult.Status = -1; string strMsg = ex.Message;
loginResult.Status = 1;
if (strMsg.Contains("FlexDll.dll"))
{
loginResult.Status = 2;// 该状态表示不需要使用FlexDll.dll进行登录
}
loginResult.Message = ex.Message; loginResult.Message = ex.Message;
e.Result = loginResult; e.Result = loginResult;
return; return;
} }
StringBuilder strLogResult = new StringBuilder(200); StringBuilder strLogResult = new StringBuilder(200);
int nStat = LicHelp.CheckOut(AppName, strLogResult); int nStat = 2;
if (nStat != 0) try
{
loginResult.Message = "登录失败";
}
else
{ {
loginResult.Message = "登录成功"; nStat = LicHelp.CheckOut(AppName, strLogResult);
if (nStat != 0)
{
loginResult.Message = "登录失败";
}
else
{
loginResult.Message = "登录成功";
}
} }
catch { }
loginResult.Status = nStat; loginResult.Status = nStat;
// 将结果传递给 RunWorkerCompleted 事件 // 将结果传递给 RunWorkerCompleted 事件
e.Result = loginResult; e.Result = loginResult;
@ -86,7 +118,7 @@ namespace FlexenabledLic
/// Initializes a new instance of the <see cref="LicHelp"/> class. /// Initializes a new instance of the <see cref="LicHelp"/> class.
/// </summary> /// </summary>
/// <param name="appName">The app name.</param> /// <param name="appName">The app name.</param>
public LicHelp(string appName) : this() public LicHelp(string appName):this()
{ {
AppName = appName; AppName = appName;
} }

@ -33,9 +33,9 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="DfdIO"> <Reference Include="DfdIO, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\Project-devemf\Drawer\Drawer\bin\Debug\DfdIO.dll</HintPath> <SpecificVersion>False</SpecificVersion>
<Private>False</Private> <HintPath>..\..\bin\Debug\DfdIO.dll</HintPath>
</Reference> </Reference>
<Reference Include="INIFileParser, Version=2.5.2.0, Culture=neutral, PublicKeyToken=79af7b307b65cf3c, processorArchitecture=MSIL"> <Reference Include="INIFileParser, Version=2.5.2.0, Culture=neutral, PublicKeyToken=79af7b307b65cf3c, processorArchitecture=MSIL">
<HintPath>packages\ini-parser.2.5.2\lib\net20\INIFileParser.dll</HintPath> <HintPath>packages\ini-parser.2.5.2\lib\net20\INIFileParser.dll</HintPath>
@ -76,7 +76,7 @@
<Reference Include="System.Net.Http" /> <Reference Include="System.Net.Http" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="UtfUnknown, Version=2.0.0.0, Culture=neutral, PublicKeyToken=90217ce7a23260d4, processorArchitecture=MSIL"> <Reference Include="UtfUnknown, Version=2.0.0.0, Culture=neutral, PublicKeyToken=90217ce7a23260d4, processorArchitecture=MSIL">
<HintPath>packages\UTF.Unknown.2.5.1\lib\net40\UtfUnknown.dll</HintPath> <HintPath>..\packages\UTF.Unknown.2.5.1\lib\net40\UtfUnknown.dll</HintPath>
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@ -114,5 +114,8 @@
<None Include="app.config" /> <None Include="app.config" />
<None Include="packages.config" /> <None Include="packages.config" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<WCFMetadata Include="Connected Services\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project> </Project>

@ -714,6 +714,10 @@ void CFaultAmplitudeCreator::CalcAmplitudeWithStep(GPline* flt, std::vector<FAmp
if (info.amplitude < dTotal) { // 明确条件:保留振幅 < 总和80%的元素 if (info.amplitude < dTotal) { // 明确条件:保留振幅 < 总和80%的元素
target.push_back(info); target.push_back(info);
} }
else if ((info.amplitude > dTotal) && (infos.size() == 1))
{
target.push_back(info);
}
} }

@ -17,7 +17,7 @@ bool CreateFaultRoseImage(LPCTSTR inputDataFile, LPCTSTR outputDrawFile
double centerY = 0; double centerY = 0;
double radius = 100; double radius = 100;
CFaultRosesCreator fc; CFaultRosesCreator fc;
fc.m_iRotateAngle = 0;
fc.m_fBarInterval = barInterval; // 花瓣条间隔, 度数 fc.m_fBarInterval = barInterval; // 花瓣条间隔, 度数
fc.m_nBarMaxNumber = barCount; // 花瓣刻度最大值 fc.m_nBarMaxNumber = barCount; // 花瓣刻度最大值
fc.m_bAutoCalc = barCountAuto; // 自动计算花瓣最大值 fc.m_bAutoCalc = barCountAuto; // 自动计算花瓣最大值

@ -4,7 +4,7 @@
const double PI = 3.1415926535897932384626433832795; const double PI = 3.1415926535897932384626433832795;
CFaultRosesCreator::CFaultRosesCreator() CFaultRosesCreator::CFaultRosesCreator()
:m_iRotateAngle(90) :m_iRotateAngle(0)
, m_fBarInterval(6) , m_fBarInterval(6)
, m_nBarMaxNumber(200) , m_nBarMaxNumber(200)
, m_bAutoCalc(FALSE) , m_bAutoCalc(FALSE)
@ -153,12 +153,15 @@ bool CFaultRosesCreator::ReadFile(CString strInput, int TargetColumn, int iRowSt
{ {
if (line.GetLength() < 3) if (line.GetLength() < 3)
continue; continue;
if (!::isdigit(line[0])) //if (!::isdigit(line[0]))
continue; //{
// continue;
//}
/*strvec.clear(); /*strvec.clear();
SplitCString(line, seps, SEPNUMBER, strvec); SplitCString(line, seps, SEPNUMBER, strvec);
if (strvec.size() < TargetColumn) if (strvec.size() < TargetColumn)
continue;*/CString csTemp; continue;*/
CString csTemp;
AfxExtractSubString(csTemp, (LPCTSTR)line, TargetColumn, ','); AfxExtractSubString(csTemp, (LPCTSTR)line, TargetColumn, ',');
double v = atof((LPSTR)(LPCTSTR)csTemp); double v = atof((LPSTR)(LPCTSTR)csTemp);

@ -3,7 +3,7 @@
#include <numeric> #include <numeric>
const double PI = 3.1415926535897932384626433832795028841971; const double PI = 3.1415926535897932384626433832795028841971;
CFaultStatisticsCreator::CFaultStatisticsCreator() CFaultStatisticsCreator::CFaultStatisticsCreator()
{ this->m_pillarStep = 100; { this->m_pillarStep = 20;//原来时100 有些无法计算断距
this->m_iCalcMethod = 0; this->m_iCalcMethod = 0;
this->m_bLocalFltDirect = true; this->m_bLocalFltDirect = true;
@ -40,7 +40,7 @@ bool CFaultStatisticsCreator::Execute()
////begin test ////begin test
//gfw = fopen("f:/testsegs.dfd", "w"); //gfw = fopen("f:/testsegs.dfd", "w");
////end test ////end test
#pragma omp parallel for private(finfo, pFlt)
for (int j = 0; j < m_candidateFlts.size(); j++) for (int j = 0; j < m_candidateFlts.size(); j++)
{ {
pFlt = m_candidateFlts[j]; pFlt = m_candidateFlts[j];
@ -49,7 +49,12 @@ bool CFaultStatisticsCreator::Execute()
finfo.SetPosition(pFlt->GetPosition().c_str()); finfo.SetPosition(pFlt->GetPosition().c_str());
CalcAmplitudeWithStep(pFlt,&finfo.m_ampResults); CalcAmplitudeWithStep(pFlt,&finfo.m_ampResults);
if (finfo.GetParameters()) if (finfo.GetParameters())
m_lstFltInfo.push_back(finfo); {
#pragma omp critical
{
m_lstFltInfo.push_back(std::move(finfo));
}
}
} }
if (!WriteResult()) if (!WriteResult())

@ -1,7 +1,7 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<Qt_DEFINES_>_WINDOWS;UNICODE;_UNICODE;WIN32;WIN64;QT_NO_DEBUG;QT_GUI_LIB;QT_CONCURRENT_LIB;QT_CORE_LIB;NDEBUG</Qt_DEFINES_> <Qt_DEFINES_>_WINDOWS;UNICODE;_UNICODE;WIN32;WIN64;QT_NO_DEBUG;QT_GUI_LIB;QT_CONCURRENT_LIB;QT_CORE_LIB;NDEBUG</Qt_DEFINES_>
<Qt_INCLUDEPATH_>C:\Users\gch_l\AppData\Local\Temp\4k3a155b.yhw;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtGui;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtANGLE;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtConcurrent;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtCore;C:\Users\gch_l\AppData\Local\Temp\4k3a155b.yhw;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\mkspecs\win32-msvc</Qt_INCLUDEPATH_> <Qt_INCLUDEPATH_>C:\Users\gch_l\AppData\Local\Temp\zpqrovqn.5vf;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtGui;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtANGLE;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtConcurrent;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtCore;C:\Users\gch_l\AppData\Local\Temp\zpqrovqn.5vf;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\mkspecs\win32-msvc</Qt_INCLUDEPATH_>
<Qt_STDCPP_></Qt_STDCPP_> <Qt_STDCPP_></Qt_STDCPP_>
<Qt_RUNTIME_>MultiThreadedDLL</Qt_RUNTIME_> <Qt_RUNTIME_>MultiThreadedDLL</Qt_RUNTIME_>
<Qt_CL_OPTIONS_>-Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding</Qt_CL_OPTIONS_> <Qt_CL_OPTIONS_>-Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding</Qt_CL_OPTIONS_>

@ -1,24 +1,3 @@
QMAKE_CXX.INCDIRS = \
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.16.27023\\include" \
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.16.27023\\atlmfc\\include" \
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Auxiliary\\VS\\include" \
"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.17763.0\\ucrt" \
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Auxiliary\\VS\\UnitTest\\include" \
"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.17763.0\\um" \
"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.17763.0\\shared" \
"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.17763.0\\winrt" \
"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.17763.0\\cppwinrt" \
"C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.6.1\\Include\\um" \
"C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.6.1\\Include\\um"
QMAKE_CXX.LIBDIRS = \
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.16.27023\\lib\\x64" \
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.16.27023\\atlmfc\\lib\\x64" \
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Auxiliary\\VS\\lib\\x64" \
"C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.17763.0\\ucrt\\x64" \
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Auxiliary\\VS\\UnitTest\\lib" \
"C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.17763.0\\um\\x64" \
"C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.6.1\\lib\\um\\x64" \
"C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.6.1\\Lib\\um\\x64"
QMAKE_CXX.QT_COMPILER_STDCXX = 199711L QMAKE_CXX.QT_COMPILER_STDCXX = 199711L
QMAKE_CXX.QMAKE_MSC_VER = 1916 QMAKE_CXX.QMAKE_MSC_VER = 1916
QMAKE_CXX.QMAKE_MSC_FULL_VER = 191627051 QMAKE_CXX.QMAKE_MSC_FULL_VER = 191627051

@ -34,7 +34,7 @@
</PropertyGroup> </PropertyGroup>
<ItemDefinitionGroup Condition="&apos;$(Configuration)|$(Platform)&apos;==&apos;Release|x64&apos;"> <ItemDefinitionGroup Condition="&apos;$(Configuration)|$(Platform)&apos;==&apos;Release|x64&apos;">
<ClCompile> <ClCompile>
<AdditionalIncludeDirectories>C:\Users\gch_l\AppData\Local\Temp\4k3a155b.yhw;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtGui;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtANGLE;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtConcurrent;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtCore;C:\Users\gch_l\AppData\Local\Temp\4k3a155b.yhw;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\mkspecs\win32-msvc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>C:\Users\gch_l\AppData\Local\Temp\zpqrovqn.5vf;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtGui;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtANGLE;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtConcurrent;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtCore;C:\Users\gch_l\AppData\Local\Temp\zpqrovqn.5vf;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\mkspecs\win32-msvc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>-Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>-Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding %(AdditionalOptions)</AdditionalOptions>
<AssemblerListingLocation>.\</AssemblerListingLocation> <AssemblerListingLocation>.\</AssemblerListingLocation>
<BrowseInformation>false</BrowseInformation> <BrowseInformation>false</BrowseInformation>

@ -1,7 +1,7 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<Qt_DEFINES_>_WINDOWS;UNICODE;_UNICODE;WIN32;WIN64;QT_NO_DEBUG;QT_GUI_LIB;QT_CONCURRENT_LIB;QT_CORE_LIB;NDEBUG</Qt_DEFINES_> <Qt_DEFINES_>_WINDOWS;UNICODE;_UNICODE;WIN32;WIN64;QT_NO_DEBUG;QT_GUI_LIB;QT_CONCURRENT_LIB;QT_CORE_LIB;NDEBUG</Qt_DEFINES_>
<Qt_INCLUDEPATH_>C:\Users\gch_l\AppData\Local\Temp\4k3a155b.yhw;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtGui;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtANGLE;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtConcurrent;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtCore;C:\Users\gch_l\AppData\Local\Temp\4k3a155b.yhw;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\mkspecs\win32-msvc</Qt_INCLUDEPATH_> <Qt_INCLUDEPATH_>C:\Users\gch_l\AppData\Local\Temp\zpqrovqn.5vf;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtGui;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtANGLE;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtConcurrent;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtCore;C:\Users\gch_l\AppData\Local\Temp\zpqrovqn.5vf;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\mkspecs\win32-msvc</Qt_INCLUDEPATH_>
<Qt_STDCPP_></Qt_STDCPP_> <Qt_STDCPP_></Qt_STDCPP_>
<Qt_RUNTIME_>MultiThreadedDLL</Qt_RUNTIME_> <Qt_RUNTIME_>MultiThreadedDLL</Qt_RUNTIME_>
<Qt_CL_OPTIONS_>-Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding</Qt_CL_OPTIONS_> <Qt_CL_OPTIONS_>-Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding</Qt_CL_OPTIONS_>

@ -0,0 +1,28 @@
QMAKE_CXX.QT_COMPILER_STDCXX = 199711L
QMAKE_CXX.QMAKE_MSC_VER = 1916
QMAKE_CXX.QMAKE_MSC_FULL_VER = 191627051
QMAKE_CXX.COMPILER_MACROS = \
QT_COMPILER_STDCXX \
QMAKE_MSC_VER \
QMAKE_MSC_FULL_VER
QMAKE_CXX.INCDIRS = \
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.16.27023\\include" \
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.16.27023\\atlmfc\\include" \
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Auxiliary\\VS\\include" \
"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.17763.0\\ucrt" \
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Auxiliary\\VS\\UnitTest\\include" \
"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.17763.0\\um" \
"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.17763.0\\shared" \
"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.17763.0\\winrt" \
"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.17763.0\\cppwinrt" \
"C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.6.1\\Include\\um" \
"C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.6.1\\Include\\um"
QMAKE_CXX.LIBDIRS = \
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.16.27023\\lib\\x64" \
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.16.27023\\atlmfc\\lib\\x64" \
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Auxiliary\\VS\\lib\\x64" \
"C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.17763.0\\ucrt\\x64" \
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Auxiliary\\VS\\UnitTest\\lib" \
"C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.17763.0\\um\\x64" \
"C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.6.1\\lib\\um\\x64" \
"C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.6.1\\Lib\\um\\x64"

@ -0,0 +1 @@
This is a dummy file needed to create ./moc_predefs.h

@ -0,0 +1,25 @@
QT_SYSROOT:
QT_INSTALL_PREFIX:D:/Qt/Qt5.9.4/5.9.4/msvc2017_64
QT_INSTALL_ARCHDATA:D:/Qt/Qt5.9.4/5.9.4/msvc2017_64
QT_INSTALL_DATA:D:/Qt/Qt5.9.4/5.9.4/msvc2017_64
QT_INSTALL_DOCS:D:/Qt/Qt5.9.4/Docs/Qt-5.9.4
QT_INSTALL_HEADERS:D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/include
QT_INSTALL_LIBS:D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/lib
QT_INSTALL_LIBEXECS:D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/bin
QT_INSTALL_BINS:D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/bin
QT_INSTALL_TESTS:D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/tests
QT_INSTALL_PLUGINS:D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/plugins
QT_INSTALL_IMPORTS:D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/imports
QT_INSTALL_QML:D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/qml
QT_INSTALL_TRANSLATIONS:D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/translations
QT_INSTALL_CONFIGURATION:
QT_INSTALL_EXAMPLES:D:/Qt/Qt5.9.4/Examples/Qt-5.9.4
QT_INSTALL_DEMOS:D:/Qt/Qt5.9.4/Examples/Qt-5.9.4
QT_HOST_PREFIX:D:/Qt/Qt5.9.4/5.9.4/msvc2017_64
QT_HOST_DATA:D:/Qt/Qt5.9.4/5.9.4/msvc2017_64
QT_HOST_BINS:D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/bin
QT_HOST_LIBS:D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/lib
QMAKE_SPEC:win32-msvc
QMAKE_XSPEC:win32-msvc
QMAKE_VERSION:3.1
QT_VERSION:5.9.4

@ -0,0 +1,6 @@
CONFIG += no_fixpath
QT = core gui concurrent
DEFINES -= UNICODE _UNICODE

@ -0,0 +1,86 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid></ProjectGuid>
<RootNamespace>qtvars</RootNamespace>
<Keyword>Qt4VSv1.0</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="&apos;$(Configuration)|$(Platform)&apos;==&apos;Release|x64&apos;" Label="Configuration">
<PlatformToolset>v141</PlatformToolset>
<OutputDirectory>.\</OutputDirectory>
<ATLMinimizesCRunTimeLibraryUsage>false</ATLMinimizesCRunTimeLibraryUsage>
<CharacterSet>NotSet</CharacterSet>
<ConfigurationType>Application</ConfigurationType>
<PrimaryOutput>qtvars</PrimaryOutput>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings" />
<ImportGroup Condition="&apos;$(Configuration)|$(Platform)&apos;==&apos;Release|x64&apos;" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists(&apos;$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props&apos;)" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<OutDir Condition="&apos;$(Configuration)|$(Platform)&apos;==&apos;Release|x64&apos;">.\</OutDir>
<TargetName Condition="&apos;$(Configuration)|$(Platform)&apos;==&apos;Release|x64&apos;">qtvars</TargetName>
<IgnoreImportLibrary Condition="&apos;$(Configuration)|$(Platform)&apos;==&apos;Release|x64&apos;">true</IgnoreImportLibrary>
<LinkIncremental Condition="&apos;$(Configuration)|$(Platform)&apos;==&apos;Release|x64&apos;">false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="&apos;$(Configuration)|$(Platform)&apos;==&apos;Release|x64&apos;">
<ClCompile>
<AdditionalIncludeDirectories>C:\GeoIntelligent\Drawer\Drawer\GVision\MLMicroStructure\x64\Release\qt\qmake;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtGui;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtANGLE;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtConcurrent;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtCore;C:\GeoIntelligent\Drawer\Drawer\GVision\MLMicroStructure\x64\Release\qt\qmake;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\mkspecs\win32-msvc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>-Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding %(AdditionalOptions)</AdditionalOptions>
<AssemblerListingLocation>.\</AssemblerListingLocation>
<BrowseInformation>false</BrowseInformation>
<DebugInformationFormat>None</DebugInformationFormat>
<ExceptionHandling>Sync</ExceptionHandling>
<ObjectFileName>.\</ObjectFileName>
<Optimization>MaxSpeed</Optimization>
<PreprocessorDefinitions>_WINDOWS;WIN32;WIN64;QT_NO_DEBUG;QT_GUI_LIB;QT_CONCURRENT_LIB;QT_CORE_LIB;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessToFile>false</PreprocessToFile>
<ProgramDataBaseFileName></ProgramDataBaseFileName>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<WarningLevel>TurnOffAllWarnings</WarningLevel>
</ClCompile>
<Link>
<AdditionalDependencies>D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\lib\qtmain.lib;shell32.lib;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\lib\Qt5Gui.lib;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\lib\Qt5Concurrent.lib;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\lib\Qt5Core.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\lib;C:\utils\my_sql\my_sql\lib;C:\utils\postgresql\pgsql\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>&quot;/MANIFESTDEPENDENCY:type=&apos;win32&apos; name=&apos;Microsoft.Windows.Common-Controls&apos; version=&apos;6.0.0.0&apos; publicKeyToken=&apos;6595b64144ccf1df&apos; language=&apos;*&apos; processorArchitecture=&apos;*&apos;&quot; %(AdditionalOptions)</AdditionalOptions>
<DataExecutionPrevention>true</DataExecutionPrevention>
<GenerateDebugInformation>false</GenerateDebugInformation>
<IgnoreImportLibrary>true</IgnoreImportLibrary>
<LinkIncremental>false</LinkIncremental>
<OutputFile>$(OutDir)\qtvars.exe</OutputFile>
<RandomizedBaseAddress>true</RandomizedBaseAddress>
<SubSystem>Windows</SubSystem>
<SuppressStartupBanner>true</SuppressStartupBanner>
</Link>
<Midl>
<DefaultCharType>Unsigned</DefaultCharType>
<EnableErrorChecks>None</EnableErrorChecks>
<WarningLevel>0</WarningLevel>
</Midl>
<ResourceCompile>
<PreprocessorDefinitions>_WINDOWS;WIN32;WIN64;QT_NO_DEBUG;QT_GUI_LIB;QT_CONCURRENT_LIB;QT_CORE_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
</ItemDefinitionGroup>
<ItemGroup>
<CustomBuild Include="moc_predefs.h.cbt">
<FileType>Document</FileType>
<AdditionalInputs Condition="&apos;$(Configuration)|$(Platform)&apos;==&apos;Release|x64&apos;">D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\mkspecs\features\data\dummy.cpp;%(AdditionalInputs)</AdditionalInputs>
<Command Condition="&apos;$(Configuration)|$(Platform)&apos;==&apos;Release|x64&apos;">cl -BxD:\Qt\Qt5.9.4\5.9.4\msvc2017_64\bin\qmake.exe -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -O2 -MD -W0 -E D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\mkspecs\features\data\dummy.cpp 2>NUL >moc_predefs.h</Command>
<Message Condition="&apos;$(Configuration)|$(Platform)&apos;==&apos;Release|x64&apos;">Generate moc_predefs.h</Message>
<Outputs Condition="&apos;$(Configuration)|$(Platform)&apos;==&apos;Release|x64&apos;">moc_predefs.h;%(Outputs)</Outputs>
</CustomBuild>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets" />
</Project>

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Generated Files">
<UniqueIdentifier>{71ED8ED8-ACB9-4CE9-BBE1-E00B30144E11}</UniqueIdentifier>
<Extensions>cpp;c;cxx;moc;h;def;odl;idl;res;</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="moc_predefs.h.cbt">
<Filter>Generated Files</Filter>
</CustomBuild>
</ItemGroup>
</Project>

@ -0,0 +1,41 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Qt_DEFINES_>_WINDOWS;WIN32;WIN64;QT_NO_DEBUG;QT_GUI_LIB;QT_CONCURRENT_LIB;QT_CORE_LIB;NDEBUG</Qt_DEFINES_>
<Qt_INCLUDEPATH_>D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtGui;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtANGLE;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtConcurrent;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtCore;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\mkspecs\win32-msvc</Qt_INCLUDEPATH_>
<Qt_STDCPP_></Qt_STDCPP_>
<Qt_RUNTIME_>MultiThreadedDLL</Qt_RUNTIME_>
<Qt_CL_OPTIONS_>-Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding</Qt_CL_OPTIONS_>
<Qt_LIBS_>D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\lib\qtmain.lib;shell32.lib;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\lib\Qt5Gui.lib;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\lib\Qt5Concurrent.lib;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\lib\Qt5Core.lib</Qt_LIBS_>
<Qt_LINK_OPTIONS_>"/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'"</Qt_LINK_OPTIONS_>
<QMake_QT_SYSROOT_></QMake_QT_SYSROOT_>
<QMake_QT_INSTALL_PREFIX_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64</QMake_QT_INSTALL_PREFIX_>
<QMake_QT_INSTALL_ARCHDATA_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64</QMake_QT_INSTALL_ARCHDATA_>
<QMake_QT_INSTALL_DATA_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64</QMake_QT_INSTALL_DATA_>
<QMake_QT_INSTALL_DOCS_>D:/Qt/Qt5.9.4/Docs/Qt-5.9.4</QMake_QT_INSTALL_DOCS_>
<QMake_QT_INSTALL_HEADERS_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/include</QMake_QT_INSTALL_HEADERS_>
<QMake_QT_INSTALL_LIBS_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/lib</QMake_QT_INSTALL_LIBS_>
<QMake_QT_INSTALL_LIBEXECS_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/bin</QMake_QT_INSTALL_LIBEXECS_>
<QMake_QT_INSTALL_BINS_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/bin</QMake_QT_INSTALL_BINS_>
<QMake_QT_INSTALL_TESTS_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/tests</QMake_QT_INSTALL_TESTS_>
<QMake_QT_INSTALL_PLUGINS_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/plugins</QMake_QT_INSTALL_PLUGINS_>
<QMake_QT_INSTALL_IMPORTS_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/imports</QMake_QT_INSTALL_IMPORTS_>
<QMake_QT_INSTALL_QML_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/qml</QMake_QT_INSTALL_QML_>
<QMake_QT_INSTALL_TRANSLATIONS_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/translations</QMake_QT_INSTALL_TRANSLATIONS_>
<QMake_QT_INSTALL_CONFIGURATION_></QMake_QT_INSTALL_CONFIGURATION_>
<QMake_QT_INSTALL_EXAMPLES_>D:/Qt/Qt5.9.4/Examples/Qt-5.9.4</QMake_QT_INSTALL_EXAMPLES_>
<QMake_QT_INSTALL_DEMOS_>D:/Qt/Qt5.9.4/Examples/Qt-5.9.4</QMake_QT_INSTALL_DEMOS_>
<QMake_QT_HOST_PREFIX_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64</QMake_QT_HOST_PREFIX_>
<QMake_QT_HOST_DATA_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64</QMake_QT_HOST_DATA_>
<QMake_QT_HOST_BINS_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/bin</QMake_QT_HOST_BINS_>
<QMake_QT_HOST_LIBS_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/lib</QMake_QT_HOST_LIBS_>
<QMake_QMAKE_SPEC_>win32-msvc</QMake_QMAKE_SPEC_>
<QMake_QMAKE_XSPEC_>win32-msvc</QMake_QMAKE_XSPEC_>
<QMake_QMAKE_VERSION_>3.1</QMake_QMAKE_VERSION_>
<QMake_QT_VERSION_>5.9.4</QMake_QT_VERSION_>
<QtBkup_QtHash>jVFBagMxDPyKX5BtQtrSQw6OpG6VemUj2YVQyv7/F9UuWxZ6iQ8GYc2MNKNvRpLK9X55PrwdzvNkX3B6Or7OL+cAWSmMjb0QaKoODFeW9SG9s5BdhqL5RlAHrjStn1w5y6i5lQES5KlwIkeRA4HMsu4oCyyQGlKJ9aNXKiKuI2LayMjqC2RlsmAVoZReqRRlbHEkq1EwKgZtnsVEvfwNnviqUe8B0pzL4r47lt3LRgyu9YDttj+HnejhkfgNYbG/9Pp2+KfyN14pUTT6+QU=</QtBkup_QtHash>
<QtVersion>5.9.4</QtVersion>
<QtVersionMajor>5</QtVersionMajor>
<QtVersionMinor>9</QtVersionMinor>
<QtVersionPatch>4</QtVersionPatch>
</PropertyGroup>
</Project>

@ -0,0 +1,41 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Qt_DEFINES_>_WINDOWS;WIN32;WIN64;QT_NO_DEBUG;QT_GUI_LIB;QT_CONCURRENT_LIB;QT_CORE_LIB;NDEBUG</Qt_DEFINES_>
<Qt_INCLUDEPATH_>D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtGui;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtANGLE;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtConcurrent;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\include\QtCore;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\mkspecs\win32-msvc</Qt_INCLUDEPATH_>
<Qt_STDCPP_></Qt_STDCPP_>
<Qt_RUNTIME_>MultiThreadedDLL</Qt_RUNTIME_>
<Qt_CL_OPTIONS_>-Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding</Qt_CL_OPTIONS_>
<Qt_LIBS_>D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\lib\qtmain.lib;shell32.lib;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\lib\Qt5Gui.lib;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\lib\Qt5Concurrent.lib;D:\Qt\Qt5.9.4\5.9.4\msvc2017_64\lib\Qt5Core.lib</Qt_LIBS_>
<Qt_LINK_OPTIONS_>"/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'"</Qt_LINK_OPTIONS_>
<QMake_QT_SYSROOT_></QMake_QT_SYSROOT_>
<QMake_QT_INSTALL_PREFIX_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64</QMake_QT_INSTALL_PREFIX_>
<QMake_QT_INSTALL_ARCHDATA_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64</QMake_QT_INSTALL_ARCHDATA_>
<QMake_QT_INSTALL_DATA_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64</QMake_QT_INSTALL_DATA_>
<QMake_QT_INSTALL_DOCS_>D:/Qt/Qt5.9.4/Docs/Qt-5.9.4</QMake_QT_INSTALL_DOCS_>
<QMake_QT_INSTALL_HEADERS_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/include</QMake_QT_INSTALL_HEADERS_>
<QMake_QT_INSTALL_LIBS_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/lib</QMake_QT_INSTALL_LIBS_>
<QMake_QT_INSTALL_LIBEXECS_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/bin</QMake_QT_INSTALL_LIBEXECS_>
<QMake_QT_INSTALL_BINS_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/bin</QMake_QT_INSTALL_BINS_>
<QMake_QT_INSTALL_TESTS_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/tests</QMake_QT_INSTALL_TESTS_>
<QMake_QT_INSTALL_PLUGINS_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/plugins</QMake_QT_INSTALL_PLUGINS_>
<QMake_QT_INSTALL_IMPORTS_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/imports</QMake_QT_INSTALL_IMPORTS_>
<QMake_QT_INSTALL_QML_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/qml</QMake_QT_INSTALL_QML_>
<QMake_QT_INSTALL_TRANSLATIONS_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/translations</QMake_QT_INSTALL_TRANSLATIONS_>
<QMake_QT_INSTALL_CONFIGURATION_></QMake_QT_INSTALL_CONFIGURATION_>
<QMake_QT_INSTALL_EXAMPLES_>D:/Qt/Qt5.9.4/Examples/Qt-5.9.4</QMake_QT_INSTALL_EXAMPLES_>
<QMake_QT_INSTALL_DEMOS_>D:/Qt/Qt5.9.4/Examples/Qt-5.9.4</QMake_QT_INSTALL_DEMOS_>
<QMake_QT_HOST_PREFIX_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64</QMake_QT_HOST_PREFIX_>
<QMake_QT_HOST_DATA_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64</QMake_QT_HOST_DATA_>
<QMake_QT_HOST_BINS_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/bin</QMake_QT_HOST_BINS_>
<QMake_QT_HOST_LIBS_>D:/Qt/Qt5.9.4/5.9.4/msvc2017_64/lib</QMake_QT_HOST_LIBS_>
<QMake_QMAKE_SPEC_>win32-msvc</QMake_QMAKE_SPEC_>
<QMake_QMAKE_XSPEC_>win32-msvc</QMake_QMAKE_XSPEC_>
<QMake_QMAKE_VERSION_>3.1</QMake_QMAKE_VERSION_>
<QMake_QT_VERSION_>5.9.4</QMake_QT_VERSION_>
<QtBkup_QtHash>jVFBagMxDPyKX5BtQtrSQw6OpG6VemUj2YVQyv7/F9UuWxZ6iQ8GYc2MNKNvRpLK9X55PrwdzvNkX3B6Or7OL+cAWSmMjb0QaKoODFeW9SG9s5BdhqL5RlAHrjStn1w5y6i5lQES5KlwIkeRA4HMsu4oCyyQGlKJ9aNXKiKuI2LayMjqC2RlsmAVoZReqRRlbHEkq1EwKgZtnsVEvfwNnviqUe8B0pzL4r47lt3LRgyu9YDttj+HnejhkfgNYbG/9Pp2+KfyN14pUTT6+QU=</QtBkup_QtHash>
<QtVersion>5.9.4</QtVersion>
<QtVersionMajor>5</QtVersionMajor>
<QtVersionMinor>9</QtVersionMinor>
<QtVersionPatch>4</QtVersionPatch>
</PropertyGroup>
</Project>

@ -0,0 +1,9 @@
.vscode
build
.ipynb_checkpoints
*.a
*.so
*.lib
*.dll
*.grd
core.*

@ -59,15 +59,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StyleLibManager", "StyleLib
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KevDrawServer", "KevDrawerServer-New\KevDrawServer.csproj", "{91F4F741-193C-4EF1-9324-4D509A16DC1C}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KevDrawServer", "KevDrawerServer-New\KevDrawServer.csproj", "{91F4F741-193C-4EF1-9324-4D509A16DC1C}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KevDrawServer-old", "KevServer\KevDrawServer-old.csproj", "{6932D4C3-9FE1-41D5-9768-193EEF234FB9}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestDrawerDll", "TestDrawerDll\TestDrawerDll.vcxproj", "{32F4D270-F7D0-4939-9A25-79426E9620BC}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestDrawerDll", "TestDrawerDll\TestDrawerDll.vcxproj", "{32F4D270-F7D0-4939-9A25-79426E9620BC}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
{B13C222D-81C0-4ECC-AA24-26713BFF6050} = {B13C222D-81C0-4ECC-AA24-26713BFF6050} {B13C222D-81C0-4ECC-AA24-26713BFF6050} = {B13C222D-81C0-4ECC-AA24-26713BFF6050}
{D9FF7748-99EF-4F5F-91B3-C39F1D74A400} = {D9FF7748-99EF-4F5F-91B3-C39F1D74A400}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PcgDrawR_wellPole", "UCDraw\PcgDrawR_wellPole\PcgDrawR_wellPole.csproj", "{2A755BD1-7A6E-4273-8F60-0D52B77C6646}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -306,18 +303,6 @@ Global
{91F4F741-193C-4EF1-9324-4D509A16DC1C}.Release|x64.Build.0 = Release|Any CPU {91F4F741-193C-4EF1-9324-4D509A16DC1C}.Release|x64.Build.0 = Release|Any CPU
{91F4F741-193C-4EF1-9324-4D509A16DC1C}.Release|x86.ActiveCfg = Release|Any CPU {91F4F741-193C-4EF1-9324-4D509A16DC1C}.Release|x86.ActiveCfg = Release|Any CPU
{91F4F741-193C-4EF1-9324-4D509A16DC1C}.Release|x86.Build.0 = Release|Any CPU {91F4F741-193C-4EF1-9324-4D509A16DC1C}.Release|x86.Build.0 = Release|Any CPU
{6932D4C3-9FE1-41D5-9768-193EEF234FB9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6932D4C3-9FE1-41D5-9768-193EEF234FB9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6932D4C3-9FE1-41D5-9768-193EEF234FB9}.Debug|x64.ActiveCfg = Debug|Any CPU
{6932D4C3-9FE1-41D5-9768-193EEF234FB9}.Debug|x64.Build.0 = Debug|Any CPU
{6932D4C3-9FE1-41D5-9768-193EEF234FB9}.Debug|x86.ActiveCfg = Debug|Any CPU
{6932D4C3-9FE1-41D5-9768-193EEF234FB9}.Debug|x86.Build.0 = Debug|Any CPU
{6932D4C3-9FE1-41D5-9768-193EEF234FB9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6932D4C3-9FE1-41D5-9768-193EEF234FB9}.Release|Any CPU.Build.0 = Release|Any CPU
{6932D4C3-9FE1-41D5-9768-193EEF234FB9}.Release|x64.ActiveCfg = Release|Any CPU
{6932D4C3-9FE1-41D5-9768-193EEF234FB9}.Release|x64.Build.0 = Release|Any CPU
{6932D4C3-9FE1-41D5-9768-193EEF234FB9}.Release|x86.ActiveCfg = Release|Any CPU
{6932D4C3-9FE1-41D5-9768-193EEF234FB9}.Release|x86.Build.0 = Release|Any CPU
{32F4D270-F7D0-4939-9A25-79426E9620BC}.Debug|Any CPU.ActiveCfg = Debug|x64 {32F4D270-F7D0-4939-9A25-79426E9620BC}.Debug|Any CPU.ActiveCfg = Debug|x64
{32F4D270-F7D0-4939-9A25-79426E9620BC}.Debug|Any CPU.Build.0 = Debug|x64 {32F4D270-F7D0-4939-9A25-79426E9620BC}.Debug|Any CPU.Build.0 = Debug|x64
{32F4D270-F7D0-4939-9A25-79426E9620BC}.Debug|x64.ActiveCfg = Debug|x64 {32F4D270-F7D0-4939-9A25-79426E9620BC}.Debug|x64.ActiveCfg = Debug|x64
@ -330,18 +315,6 @@ Global
{32F4D270-F7D0-4939-9A25-79426E9620BC}.Release|x64.Build.0 = Release|x64 {32F4D270-F7D0-4939-9A25-79426E9620BC}.Release|x64.Build.0 = Release|x64
{32F4D270-F7D0-4939-9A25-79426E9620BC}.Release|x86.ActiveCfg = Release|Win32 {32F4D270-F7D0-4939-9A25-79426E9620BC}.Release|x86.ActiveCfg = Release|Win32
{32F4D270-F7D0-4939-9A25-79426E9620BC}.Release|x86.Build.0 = Release|Win32 {32F4D270-F7D0-4939-9A25-79426E9620BC}.Release|x86.Build.0 = Release|Win32
{2A755BD1-7A6E-4273-8F60-0D52B77C6646}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2A755BD1-7A6E-4273-8F60-0D52B77C6646}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2A755BD1-7A6E-4273-8F60-0D52B77C6646}.Debug|x64.ActiveCfg = Debug|x64
{2A755BD1-7A6E-4273-8F60-0D52B77C6646}.Debug|x64.Build.0 = Debug|x64
{2A755BD1-7A6E-4273-8F60-0D52B77C6646}.Debug|x86.ActiveCfg = Debug|Any CPU
{2A755BD1-7A6E-4273-8F60-0D52B77C6646}.Debug|x86.Build.0 = Debug|Any CPU
{2A755BD1-7A6E-4273-8F60-0D52B77C6646}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2A755BD1-7A6E-4273-8F60-0D52B77C6646}.Release|Any CPU.Build.0 = Release|Any CPU
{2A755BD1-7A6E-4273-8F60-0D52B77C6646}.Release|x64.ActiveCfg = Release|x64
{2A755BD1-7A6E-4273-8F60-0D52B77C6646}.Release|x64.Build.0 = Release|x64
{2A755BD1-7A6E-4273-8F60-0D52B77C6646}.Release|x86.ActiveCfg = Release|Any CPU
{2A755BD1-7A6E-4273-8F60-0D52B77C6646}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

@ -379,6 +379,7 @@
:height="viewSize.height +'px'" :height="viewSize.height +'px'"
:style="{ cursor: GetCursor(), width:viewSize.width+'px', height:viewSize.height+'px' }" :style="{ cursor: GetCursor(), width:viewSize.width+'px', height:viewSize.height+'px' }"
style="position:absolute; margin: 0px;left: 0px; top:0px; padding: 0px; background-color: rgb(255, 255, 255);image-rendering: crisp-edges;" @contextmenu="handleWellContextMenu"> style="position:absolute; margin: 0px;left: 0px; top:0px; padding: 0px; background-color: rgb(255, 255, 255);image-rendering: crisp-edges;" @contextmenu="handleWellContextMenu">
</canvas>
<div v-show="showContextMenu" class="custom-context-menu" :style="{ <div v-show="showContextMenu" class="custom-context-menu" :style="{
top: `${contextMenuY}px`, top: `${contextMenuY}px`,
left: `${contextMenuX}px`, left: `${contextMenuX}px`,
@ -660,8 +661,8 @@
case 'edit': case 'edit':
if (window.parent && window.parent.postMessage) { if (window.parent && window.parent.postMessage) {
/* console.log('编辑井组:', this.selectedElementId, this.selectedElement); */ /* console.log('编辑井组:', this.selectedElementId, this.selectedElement); */
window.parent.postMessage({action:'editWellGroup',data:this.selectedElement,dataid:this.selectedElementId, parenttoken:this.drawerToken},'*'); window.parent.postMessage({action:'editWellGroup',data:this.selectedElement,dataid:this.selectedElementId},'*');
} }
break; break;
default: default:
console.warn('未知操作:', action); console.warn('未知操作:', action);
@ -734,9 +735,9 @@
}, },
setupWebSocket() { setupWebSocket() {
//this.websocket = new WebSocket("ws://kep.kepoil.com:8000/event", "json"); // 创建WebSocket连接(外网) //this.websocket = new WebSocket("ws://kep.kepoil.com:8000/event", "json"); // 创建WebSocket连接(外网)
// this.websocket = new WebSocket("ws://192.168.31.45:8000/event", "json"); // 创建WebSocket连接 this.websocket = new WebSocket("ws://192.168.31.45:8000/event", "json"); // 创建WebSocket连接
//this.websocket = new WebSocket("ws://192.168.31.113:8080/event", "json"); // 创建WebSocket连接 //this.websocket = new WebSocket("ws://192.168.31.113:8080/event", "json"); // 创建WebSocket连接
this.websocket = new WebSocket("ws://localhost:8080/event", "json"); // 创建WebSocket连接 // this.websocket = new WebSocket("ws://localhost:8080/event", "json"); // 创建WebSocket连接
this.websocket.onopen = this.onWebSocketOpen; // WebSocket连接打开时的处理函数 this.websocket.onopen = this.onWebSocketOpen; // WebSocket连接打开时的处理函数
this.websocket.onmessage = this.onWebSocketMessage; // 收到WebSocket消息时的处理函数 this.websocket.onmessage = this.onWebSocketMessage; // 收到WebSocket消息时的处理函数
this.websocket.onclose = this.onWebSocketClose; // WebSocket连接关闭时的处理函数 this.websocket.onclose = this.onWebSocketClose; // WebSocket连接关闭时的处理函数
@ -819,12 +820,11 @@
return; return;
} }
this.imgVisible = true; this.imgVisible = true;
this.imgPosition = { x: imgContent.ImgLeft, y: imgContent.ImgTop };
this.$nextTick(() => { this.$nextTick(() => {
let imgTmp = this.$refs.image; let imgTmp = this.$refs.image;
imgTmp.src = imgContent.Data; imgTmp.src = imgContent.Data;
}); });
// this.redrawCanvas(this.imageSrc); this.redrawCanvas(this.imageSrc);
} }
else if (evtType === "ElementProperty") { else if (evtType === "ElementProperty") {
let imgContent = json.data; let imgContent = json.data;
@ -1112,7 +1112,7 @@
this.isDragFirst = true; this.isDragFirst = true;
this.imgVisible = true; this.imgVisible = true;
//this.imgPosition = { x: 0, y: 0 }; this.imgPosition = { x: 0, y: 0 };
const rect = this.$refs.canvas.getBoundingClientRect(); const rect = this.$refs.canvas.getBoundingClientRect();
this.mouseStartX = event.clientX - rect.left; this.mouseStartX = event.clientX - rect.left;
@ -1242,12 +1242,9 @@
else if (this.drawerToolType == canvasToolType.ITEM_SELECT) { else if (this.drawerToolType == canvasToolType.ITEM_SELECT) {
let offsetX = event.offsetX - this.lastX; let offsetX = event.offsetX - this.lastX;
let offsetY = event.offsetY - this.lastY; let offsetY = event.offsetY - this.lastY;
if(offsetX>0||offsetY>0) this.imgPosition = { x: this.imgPosition.x + offsetX, y: this.imgPosition.y + offsetY };
{ this.lastX = event.offsetX;
this.imgPosition = { x: this.imgPosition.x + offsetX, y: this.imgPosition.y + offsetY }; this.lastY = event.offsetY;
this.lastX = event.offsetX;
this.lastY = event.offsetY;
}
} }
} }
}, },
@ -1365,6 +1362,7 @@
window.addEventListener('resize', this.handleResize); window.addEventListener('resize', this.handleResize);
this.initCanvas(); this.initCanvas();
this.image = new Image();
this.setupWebSocket(); // 创建WebSocket连接 this.setupWebSocket(); // 创建WebSocket连接
// 全局监听 mousedown 和 mouseup 事件 // 全局监听 mousedown 和 mouseup 事件

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" /> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup> </startup>
<runtime> <runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
@ -23,10 +23,6 @@
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> <assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" /> <bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Text.Encodings.Web" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.4" newVersion="9.0.0.4" />
</dependentAssembly>
</assemblyBinding> </assemblyBinding>
</runtime> </runtime>
</configuration> </configuration>

@ -2,10 +2,13 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Text.Encodings.Web;
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Threading.Tasks; using System.Threading.Tasks;
using Newtonsoft.Json; using Newtonsoft.Json;
//using Swan; using Swan;
//using Swan.Formatters; using Swan.Formatters;
namespace KevDrawServer.Drawer namespace KevDrawServer.Drawer
{ {
@ -22,37 +25,37 @@ namespace KevDrawServer.Drawer
/// <summary> /// <summary>
/// 层位ID /// 层位ID
/// </summary> /// </summary>
[JsonProperty("id")] [JsonPropertyName("id")]
public int Id { get; set; } public int Id { get; set; }
/// <summary> /// <summary>
/// 层位父ID /// 层位父ID
/// </summary> /// </summary>
[JsonProperty("pId")] [JsonPropertyName("pId")]
public int ParentId { get; set; } public int ParentId { get; set; }
/// <summary> /// <summary>
/// 层位状态 /// 层位状态
/// </summary> /// </summary>
[JsonProperty("status")] [JsonPropertyName("status")]
public int Status { get; set; } public int Status { get; set; }
/// <summary> /// <summary>
/// 层位名称 /// 层位名称
/// </summary> /// </summary>
[JsonProperty("name")] [JsonPropertyName("name")]
public string Name { get; set; } public string Name { get; set; }
/// <summary> /// <summary>
/// 层位全路径 /// 层位全路径
/// </summary> /// </summary>
[JsonProperty("fullPath")] [JsonPropertyName("fullPath")]
public string FullPath { get; set; } public string FullPath { get; set; }
/// <summary> /// <summary>
/// layer子项列表 /// layer子项列表
/// </summary> /// </summary>
[JsonProperty("children")] [JsonPropertyName("children")]
public List<GeoLayersModel> Children { get; set; } = new List<GeoLayersModel>(); public List<GeoLayersModel> Children { get; set; } = new List<GeoLayersModel>();
/// <summary> /// <summary>

@ -81,30 +81,6 @@ namespace KevDrawServer.Drawer
} }
return bmpBack; return bmpBack;
} }
public int OnMouseMove(MouseEventArgs e)
{
//Trace.WriteLine($"{e.X}, {e.Y}");
if (e.X == pointPrev.X && e.Y == pointPrev.Y)
{
return -2;
}
// Trace.WriteLine($"{DateTime.Now}:{e.X},{e.Y}--{pointPrev.X},{pointPrev.Y}");
//if (cursorType == -1)
//{
// drawArea.Cursor = ToolCursor;
//}
int handleType = -2;
handleType = Geo.SelectSetCursor(e.X, e.Y);
//bool shiftPressed = (Control.ModifierKeys & Keys.Shift) == Keys.Shift;
//if (shiftPressed == true && handleType == 5)
//{
// handleType = -1;
//}
pointPrev.X = e.X;
pointPrev.Y = e.Y;
return handleType;
}
public bool OnLButtonUp(MouseEventArgs e, Keys key = Keys.None) public bool OnLButtonUp(MouseEventArgs e, Keys key = Keys.None)
{ {
//Bitmap bmp = (Bitmap)drawArea.Bmp.Clone(); //Bitmap bmp = (Bitmap)drawArea.Bmp.Clone();
@ -120,12 +96,10 @@ namespace KevDrawServer.Drawer
// drawArea.PaintingImage = null; // drawArea.PaintingImage = null;
//} //}
// 判断选中数量和是否移动状态 // 判断选中数量和是否移动状态
int nSelectedCount = Geo.SelectGetCount(); if (Geo.SelectStatusChanged() == false && Geo.SelectGetCount() == 0)
if (Geo.SelectStatusChanged() == false && nSelectedCount == 0)
{ {
return false; return false;
} }
return true; return true;
} }
/// <summary> /// <summary>
@ -212,7 +186,30 @@ namespace KevDrawServer.Drawer
this.Geo.SelectMoveElementsTo(x, y); this.Geo.SelectMoveElementsTo(x, y);
return true; return true;
} }
public int OnMouseMove(MouseEventArgs e)
{
//Trace.WriteLine($"{e.X}, {e.Y}");
if (e.X == pointPrev.X && e.Y == pointPrev.Y)
{
return -2;
}
// Trace.WriteLine($"{DateTime.Now}:{e.X},{e.Y}--{pointPrev.X},{pointPrev.Y}");
//if (cursorType == -1)
//{
// drawArea.Cursor = ToolCursor;
//}
int handleType = -2;
handleType = Geo.SelectSetCursor(e.X, e.Y);
//bool shiftPressed = (Control.ModifierKeys & Keys.Shift) == Keys.Shift;
//if (shiftPressed == true && handleType == 5)
//{
// handleType = -1;
//}
pointPrev.X = e.X;
pointPrev.Y = e.Y;
return handleType;
}
public void SelectAll() public void SelectAll()
{ {
Geo.Select_SelectAll(); Geo.Select_SelectAll();

@ -1,6 +1,5 @@
using GeoSigma.SigmaDrawerUtil; using GeoSigma.SigmaDrawerUtil;
using GeoSigmaDrawLib; using GeoSigmaDrawLib;
using SigmaDrawerElement;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
@ -50,8 +49,7 @@ namespace KevDrawServer.Drawer
Geo?.SetViewBackcolor(viewBackColor.R, viewBackColor.G, viewBackColor.B); Geo?.SetViewBackcolor(viewBackColor.R, viewBackColor.G, viewBackColor.B);
} }
} }
public DrawerElementMovedEventHandler ElementMovedEvent { get; set; }
public EventHandler<ElementArgs> SelectedElementChanged { get; set; }
/// <summary> /// <summary>
/// Gets or sets the cache img location. /// Gets or sets the cache img location.
/// </summary> /// </summary>
@ -63,7 +61,6 @@ namespace KevDrawServer.Drawer
private WebDrawViewOperator viewOperator; private WebDrawViewOperator viewOperator;
private bool isNewFile = true; private bool isNewFile = true;
private WebDrawTool[] tools; // array of tools private WebDrawTool[] tools; // array of tools
public WebDrawTool[] Tools { get { return tools; } }
public WebDrawer() public WebDrawer()
{ {
tools = new WebDrawTool[(int)DrawToolType.NumberOfDrawTools]; tools = new WebDrawTool[(int)DrawToolType.NumberOfDrawTools];
@ -142,7 +139,7 @@ namespace KevDrawServer.Drawer
//tools[(int)DrawToolType.RangeToImageEx] = new DrawToolCopyRangeAsImageEx(); //tools[(int)DrawToolType.RangeToImageEx] = new DrawToolCopyRangeAsImageEx();
//tools[(int)DrawToolType.PolygonToImage] = new DrawToolCopyPolygonAsImage(); //tools[(int)DrawToolType.PolygonToImage] = new DrawToolCopyPolygonAsImage();
//tools[(int)DrawToolType.WellGroup] = new DrawToolWellGroup(); //tools[(int)DrawToolType.WellGroup] = new DrawToolWellGroup();
tools[(int)DrawToolType.WellGroupEdit] = new WebDrawToolWellGroupEdit(); //tools[(int)DrawToolType.WellGroupEdit] = new DrawToolWellGroupEdit();
//tools[(int)DrawToolType.EditWellGroupBranchCurveNode] = new DrawToolEditWellBranchCurve(); //tools[(int)DrawToolType.EditWellGroupBranchCurveNode] = new DrawToolEditWellBranchCurve();
} }
public WebDrawer(int width, int height) public WebDrawer(int width, int height)
@ -177,7 +174,6 @@ namespace KevDrawServer.Drawer
Geo.SetGridStep(xStep, yStep); Geo.SetGridStep(xStep, yStep);
} }
private DrawToolType defaultTool = DrawToolType.Select;
private DrawToolType activeTool; // active drawing tool private DrawToolType activeTool; // active drawing tool
public DrawToolType ActiveTool public DrawToolType ActiveTool
{ {
@ -199,6 +195,7 @@ namespace KevDrawServer.Drawer
if (activeTool == DrawToolType.PolygonToImage) if (activeTool == DrawToolType.PolygonToImage)
{ {
long pos = Geo.SelectGetPolygon(); long pos = Geo.SelectGetPolygon();
//(tools[(int)activeTool] as DrawToolCopyPolygonAsImage).PolygonPosition = pos;
} }
tools[(int)oldTool]?.End(); tools[(int)oldTool]?.End();
@ -211,16 +208,17 @@ namespace KevDrawServer.Drawer
|| value == DrawToolType.Default || value == DrawToolType.Default
|| value == DrawToolType.WellGroupEdit) || value == DrawToolType.WellGroupEdit)
{ {
defaultTool = value; //defaultTool = value;
} }
if (value == DrawToolType.Finsih) if (value == DrawToolType.Finsih)
{ {
activeTool = defaultTool; //activeTool = defaultTool;
} }
//activeTool = value; //activeTool = value;
DrawItemType itemType = tools[(int)activeTool].ItemType; DrawItemType itemType = tools[(int)activeTool].ItemType;
// ChangeContextMenu(activeTool);
if (Geo == null) if (Geo == null)
{ {
return; return;
@ -228,15 +226,16 @@ namespace KevDrawServer.Drawer
if (itemType == DrawItemType.ITEM_VIEW_PAN || itemType == DrawItemType.ITEM_VIEW_WINDOW) if (itemType == DrawItemType.ITEM_VIEW_PAN || itemType == DrawItemType.ITEM_VIEW_WINDOW)
{ {
// Geo.SetViewPan();
// this.Invalidate();
} }
else else
{ {
Geo.SetItem((int)itemType); //Geo.SetItem((int)itemType);
//tools[(int)activeTool].SigmaDrawer = this; //tools[(int)activeTool].SigmaDrawer = this;
tools[(int)activeTool].Start(); //tools[(int)activeTool].Start();
if (oldTool == DrawToolType.Select && activeTool != DrawToolType.RangeToImage) if (oldTool == DrawToolType.Select && activeTool != DrawToolType.RangeToImage)
{ {
} }
} }
} }
@ -288,42 +287,10 @@ namespace KevDrawServer.Drawer
return Geo; return Geo;
} }
/// <summary> /// <summary>
/// 新建文件.
/// </summary>
/// <param name="fileName">The file name.</param>
/// <returns>A GeoSigmaXY.</returns>
public GeoSigmaXY NewFile(string fileName)
{
if (Geo != null)
{
Geo.Dispose();
}
Geo = null;
Geo = new GeoSigmaXY();
foreach (WebDrawTool t in tools)
{
if (t != null)
{
t.Geo = Geo;
//t.Init();
}
}
DrawFileName = fileName;
Geo.NewDocument(fileName);
Geo.SetViewBackcolor(ViewBackColor.R, ViewBackColor.G, ViewBackColor.B);
isNewFile = true;
EnableRedraw = true;
InitGlobaVariable();
viewOperator = new WebDrawViewOperator(Geo);
return Geo;
}
/// <summary>
/// 保存文件. /// 保存文件.
/// </summary> /// </summary>
/// <returns>A bool.</returns> /// <returns>A bool.</returns>
public virtual bool SaveFile() public bool SaveFile()
{ {
if(this.Geo == null) if(this.Geo == null)
{ {
@ -434,7 +401,7 @@ namespace KevDrawServer.Drawer
return OutOfRange(left) || OutOfRange(top) || OutOfRange(right) || OutOfRange(bottom); return OutOfRange(left) || OutOfRange(top) || OutOfRange(right) || OutOfRange(bottom);
} }
public virtual Bitmap LButtonDown(double x, double y) public Bitmap OnLButtonDown(double x, double y)
{ {
if (this.activeTool != DrawToolType.Select) if (this.activeTool != DrawToolType.Select)
{ {
@ -453,7 +420,7 @@ namespace KevDrawServer.Drawer
/// <param name="y">The y.</param> /// <param name="y">The y.</param>
/// <param name="keyCode"></param> /// <param name="keyCode"></param>
/// <returns>A Bitmap.</returns> /// <returns>A Bitmap.</returns>
public virtual Bitmap LButtonUp(double x, double y, int keyCode) public Bitmap LButtonUp(double x, double y, int keyCode)
{ {
if (this.activeTool == DrawToolType.Select) if (this.activeTool == DrawToolType.Select)
{ {
@ -465,17 +432,6 @@ namespace KevDrawServer.Drawer
this.OnPaint(g); this.OnPaint(g);
return bmp; return bmp;
} }
else
{
if (Geo.SelectStatusChanged())
{
string strElementData = string.Empty;
long lPosition = 0;
bool isElementFind = Geo.SelectGetElement(ref strElementData, ref lPosition);
DrawerElementProperty property = DrawerElementHelp.Deserialize(strElementData);
this.SelectedElementChanged?.Invoke(null, new ElementArgs(property, lPosition));
}
}
} }
return null; return null;
} }
@ -533,14 +489,13 @@ namespace KevDrawServer.Drawer
string strData = this.Geo.WellGroupStatistic(); string strData = this.Geo.WellGroupStatistic();
return strData; return strData;
} }
/// <summary> /// <summary>
/// 移动选择的图元到指定位置. /// 移动选择的图元到指定位置.
/// </summary> /// </summary>
/// <param name="x">The x像素坐标.</param> /// <param name="x">The x像素坐标.</param>
/// <param name="y">The y像素坐标.</param> /// <param name="y">The y像素坐标.</param>
/// <returns>A Bitmap.</returns> /// <returns>A Bitmap.</returns>
public virtual Bitmap TranslateElements(double x,double y) public Bitmap TranslateElements(double x,double y)
{ {
if (this.activeTool != DrawToolType.Select) if (this.activeTool != DrawToolType.Select)
{ {
@ -548,14 +503,6 @@ namespace KevDrawServer.Drawer
} }
WebDrawToolSelect drawToolSelect = (tools[(int)DrawToolType.Select]) as WebDrawToolSelect; WebDrawToolSelect drawToolSelect = (tools[(int)DrawToolType.Select]) as WebDrawToolSelect;
drawToolSelect.MoveElementsTo((int)x, (int)y); drawToolSelect.MoveElementsTo((int)x, (int)y);
if (this.ElementMovedEvent != null)
{
string strElementData = string.Empty;
long lPosition = 0;
bool isElementFind = this.Geo.SelectGetElement(ref strElementData, ref lPosition);
this.ElementMovedEvent.Invoke(lPosition);
}
Bitmap bmp = new Bitmap(this.DrawerSize.Width, this.DrawerSize.Height); Bitmap bmp = new Bitmap(this.DrawerSize.Width, this.DrawerSize.Height);
Graphics g = Graphics.FromImage(bmp); Graphics g = Graphics.FromImage(bmp);
this.OnPaint(g); this.OnPaint(g);
@ -567,7 +514,7 @@ namespace KevDrawServer.Drawer
/// <param name="x">The x.</param> /// <param name="x">The x.</param>
/// <param name="y">The y.</param> /// <param name="y">The y.</param>
/// <returns>An int.</returns> /// <returns>An int.</returns>
public virtual int MouseMove(double x,double y) public int MouseMove(double x,double y)
{ {
if (this.activeTool != DrawToolType.Select) if (this.activeTool != DrawToolType.Select)
{ {

@ -74,9 +74,6 @@ namespace KevDrawServer
case "OpenFile": case "OpenFile":
evtResult = ShowImg(); evtResult = ShowImg();
break; break;
case "EditWellGroup":
evtResult = ShowImg();
break;
case "ZoomIn": case "ZoomIn":
evtResult = ZoomIn(keyValues); evtResult = ZoomIn(keyValues);
break; break;
@ -246,7 +243,6 @@ namespace KevDrawServer
strFileName = $"{ keyValues["fileName"]}"; strFileName = $"{ keyValues["fileName"]}";
evtResult = MergeFavorableArea(dir, filename, strFileName); evtResult = MergeFavorableArea(dir, filename, strFileName);
break; break;
default: default:
break; break;
} }
@ -402,7 +398,7 @@ namespace KevDrawServer
{ {
return null; return null;
} }
Bitmap bmp = this.Drawer.LButtonDown(x, y); Bitmap bmp = this.Drawer.OnLButtonDown(x, y);
if (bmp != null) if (bmp != null)
{ {
@ -466,7 +462,6 @@ namespace KevDrawServer
responseEvent.Data = strWellGroupData; responseEvent.Data = strWellGroupData;
return responseEvent; return responseEvent;
} }
/// <summary> /// <summary>
/// 设置选中图元的属性 /// 设置选中图元的属性
/// </summary> /// </summary>
@ -519,11 +514,6 @@ namespace KevDrawServer
if (sendContent == false) if (sendContent == false)
{ {
strFile = Path.Combine(WebConfig.HtmlRoot, imageFile); strFile = Path.Combine(WebConfig.HtmlRoot, imageFile);
string strPath = Path.GetDirectoryName(strFile);
if(!Directory.Exists(strPath))
{
Directory.CreateDirectory(strPath);
}
bmp.Save(strFile); bmp.Save(strFile);
} }
else else
@ -853,30 +843,8 @@ namespace KevDrawServer
} }
#endregion #endregion
/// <summary>
/// 创建井组编辑模型
/// </summary>
/// <param name="wellGroupData">井组数据</param>
/// <param name="w">默认显示宽度</param>
/// <param name="h">默认显示高度</param>
/// <param name="context">网络请求上下文</param>
/// <param name="token">模型的Token</param>
/// <param name="parentToken">父图形的Token</param>
/// <returns></returns>
public async static Task<string> CreateWellGroupDrawerAsync(string wellGroupData, int w, int h, IWebSocketContext context, string token, string parentToken)
{
WebDrawer drawer = (WebDrawer)GlobalSession.GetData(parentToken);
WellGroupDrawer wellGroupDrawer = new WellGroupDrawer(wellGroupData, w, h, drawer.Geo);
string strToken = wellGroupDrawer.Geo.GetDrawerXy().ToInt64().ToString();
if (!string.IsNullOrEmpty(strToken))
{
GlobalSession.StoreData(token, wellGroupDrawer);
GlobalSession.StoreData($"Lock_{token}", new SemaphoreSlim(1, 1));
}
Logger.Info("CreateWellGroupDrawerAsync:" + token);
await Task.CompletedTask;
return strToken;
}
/// <summary> /// <summary>
/// Creates the drawer. /// Creates the drawer.
/// </summary> /// </summary>

@ -20,7 +20,7 @@ namespace KevDrawServer
public string MapFile { get; set; } = string.Empty; public string MapFile { get; set; } = string.Empty;
private static readonly Object locker = new Object(); private static readonly Object locker = new Object();
//private WebDrawer drawer = null; private WebDrawer drawer = null;
//IWebSocketContext socketContex; //IWebSocketContext socketContex;
public EventSocketModule() : public EventSocketModule() :
base("/event", true) base("/event", true)
@ -52,7 +52,6 @@ namespace KevDrawServer
// 取消之前的发送任务 // 取消之前的发送任务
//_cts.Cancel(); //_cts.Cancel();
//_cts = new CancellationTokenSource(); //_cts = new CancellationTokenSource();
return SendAsync(context, JsonUtils.SerializeToJson(jsEvent)); return SendAsync(context, JsonUtils.SerializeToJson(jsEvent));
} }
@ -143,51 +142,10 @@ namespace KevDrawServer
return; return;
} }
} }
if(strEventType== "EditWellGroup")
{
if (!dictionary.ContainsKey("token"))
{
return;
}
strToken = $"{dictionary["token"]}";
string strParentToken = $"{dictionary["parentToken"]}";
string strWellGroupData = $"{dictionary["data"]}";
double dWidth = Convert.ToDouble(dictionary["width"]);
double dHeight = Convert.ToDouble(dictionary["height"]);
string strResult = await EventResponse.CreateWellGroupDrawerAsync(strWellGroupData, (int)dWidth, (int)dHeight, context, strToken, strParentToken).ConfigureAwait(true);
if (!string.IsNullOrEmpty(strResult))
{
if (this.findError(context, strToken) != null)
{
return;
}
// 发送Token
var jsEvent = new JsEvent("NewToken");
jsEvent.Token = strToken;
jsEvent.CmdID = evt.CmdID;
await SendTargetedEvent(context, jsEvent).ConfigureAwait(false);
}
else
{
// 发送打开错误信息
var jsEvent = new JsEvent("OpenError");
jsEvent.Token = strToken;
jsEvent.CmdID = evt.CmdID;
// 记录错误
GlobalSession.StoreData($"Error_{strToken}", strToken);
await SendTargetedEvent(context, jsEvent).ConfigureAwait(false);
return;
}
}
else if (strEventType == "CloseDrawer") else if (strEventType == "CloseDrawer")
{ {
await EventResponse.CloseDrawerAsync(strToken, context); await EventResponse.CloseDrawerAsync(strToken, context);
return; return;
}else if(strEventType == "CreateFavorableArea")
{
// FIXME: 下面的获取有利区需要知道原始文件名,所以需要知道 token在这里扩充了一下
dictionary["token"] = strToken;
} }
//Logger.Info("OnMessageReceivedAsync:" + strToken); //Logger.Info("OnMessageReceivedAsync:" + strToken);
@ -199,7 +157,9 @@ namespace KevDrawServer
{ {
WebDrawer drawerCur = GetCurrentDrawer(strToken, context); WebDrawer drawerCur = GetCurrentDrawer(strToken, context);
EventResponse response = new EventResponse(drawerCur, context); EventResponse response = new EventResponse(drawerCur, context);
// FIXME: 下面的获取有利区需要知道原始文件名,所以需要知道 token在这里扩充了一下
dictionary["token"] = strToken;
JsEvent responseEvent = await Task.Run(() => response.ExcuteOperator(evt.Type, dictionary)); JsEvent responseEvent = await Task.Run(() => response.ExcuteOperator(evt.Type, dictionary));
if (responseEvent != null) if (responseEvent != null)
{ {
@ -296,7 +256,7 @@ namespace KevDrawServer
/// <returns>A WebDrawer.</returns> /// <returns>A WebDrawer.</returns>
private WebDrawer GetCurrentDrawer(string token, IWebSocketContext context) private WebDrawer GetCurrentDrawer(string token, IWebSocketContext context)
{ {
WebDrawer drawer = (WebDrawer)GlobalSession.GetData(token); drawer = (WebDrawer)GlobalSession.GetData(token);
return drawer; return drawer;
} }
///// <summary> ///// <summary>

@ -22,12 +22,6 @@ namespace KevDrawServer
public string Type { get; private set; } public string Type { get; private set; }
[Newtonsoft.Json.JsonProperty("data")] [Newtonsoft.Json.JsonProperty("data")]
public object Data { get; set; } public object Data { get; set; }
[Newtonsoft.Json.JsonProperty("dateTime")]
public object DateTime
{
get { return DateTimeOffset.UtcNow.ToUnixTimeSeconds(); }
set { }
}
/// <summary> /// <summary>
/// Gets or sets 是否执行成功. /// Gets or sets 是否执行成功.
@ -35,8 +29,8 @@ namespace KevDrawServer
[Newtonsoft.Json.JsonProperty("success")] [Newtonsoft.Json.JsonProperty("success")]
public bool Success { get; set; } = false; public bool Success { get; set; } = false;
} }
//public class JsDataRow //public class JsDataRow
//{ //{
// [Newtonsoft.Json.JsonProperty("columns")] // [Newtonsoft.Json.JsonProperty("columns")]

@ -8,8 +8,7 @@ namespace KevDrawServer
{ {
public class JsonUtils public class JsonUtils
{ {
private static readonly JsonSerializerSettings JsonSerializerSettings = new JsonSerializerSettings private static readonly JsonSerializerSettings JsonSerializerSettings = new JsonSerializerSettings {
{
DateTimeZoneHandling = DateTimeZoneHandling.Utc DateTimeZoneHandling = DateTimeZoneHandling.Utc
}; };

@ -8,7 +8,7 @@
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<RootNamespace>KevDrawServer</RootNamespace> <RootNamespace>KevDrawServer</RootNamespace>
<AssemblyName>KevDrawServer</AssemblyName> <AssemblyName>KevDrawServer</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic> <Deterministic>true</Deterministic>
@ -40,14 +40,16 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="EmbedIO, Version=3.5.2.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="EmbedIO, Version=3.5.2.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <HintPath>..\packages\EmbedIO.3.5.2\lib\netstandard2.0\EmbedIO.dll</HintPath>
<HintPath>..\bin\Debug\EmbedIO.dll</HintPath> </Reference>
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=9.0.0.4, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.9.0.4\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
</Reference> </Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath> <HintPath>packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference> </Reference>
<Reference Include="Swan.Lite, Version=3.1.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Swan.Lite, Version=3.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\Unosquare.Swan.Lite.3.1.0\lib\net461\Swan.Lite.dll</HintPath> <HintPath>..\packages\Unosquare.Swan.Lite.3.1.0\lib\net461\Swan.Lite.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> <Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
@ -68,9 +70,13 @@
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath> <HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.ServiceProcess" />
<Reference Include="System.Text.Encodings.Web, Version=9.0.0.4, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> <Reference Include="System.Text.Encodings.Web, Version=9.0.0.4, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Text.Encodings.Web.9.0.4\lib\net462\System.Text.Encodings.Web.dll</HintPath> <HintPath>..\packages\System.Text.Encodings.Web.9.0.4\lib\net462\System.Text.Encodings.Web.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Text.Json, Version=9.0.0.4, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Text.Json.9.0.4\lib\net462\System.Text.Json.dll</HintPath>
</Reference>
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> <Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath> <HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference> </Reference>
@ -87,8 +93,6 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Drawer\GeoLayersModel.cs" /> <Compile Include="Drawer\GeoLayersModel.cs" />
<Compile Include="Drawer\WebDrawToolWellGroupEdit.cs" />
<Compile Include="Drawer\WellGroupDrawer.cs" />
<Compile Include="EventResponse.cs" /> <Compile Include="EventResponse.cs" />
<Compile Include="EventSocketModule.cs" /> <Compile Include="EventSocketModule.cs" />
<Compile Include="GlobalSession.cs" /> <Compile Include="GlobalSession.cs" />
@ -121,6 +125,7 @@
<ProjectReference Include="..\UCDraw\GeoSigmaDrawLib\GeoSigmaDrawLib.csproj"> <ProjectReference Include="..\UCDraw\GeoSigmaDrawLib\GeoSigmaDrawLib.csproj">
<Project>{b13c222d-81c0-4ecc-aa24-26713bff6050}</Project> <Project>{b13c222d-81c0-4ecc-aa24-26713bff6050}</Project>
<Name>GeoSigmaDrawLib</Name> <Name>GeoSigmaDrawLib</Name>
<Private>False</Private>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\UCDraw\SigmaDrawerElement\SigmaDrawerElement.csproj"> <ProjectReference Include="..\UCDraw\SigmaDrawerElement\SigmaDrawerElement.csproj">
<Project>{0CDD53C3-AA2A-4500-9E45-5299D792A52D}</Project> <Project>{0CDD53C3-AA2A-4500-9E45-5299D792A52D}</Project>
@ -142,4 +147,8 @@
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="CustomClean" AfterTargets="Clean">
<RemoveDir Directories="$(BaseIntermediateOutputPath)" />
<!-- 删除obj -->
</Target>
</Project> </Project>

@ -1,5 +1,4 @@
using GeoSigmaDrawLib; using Swan;
using Swan;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net; using System.Net;
@ -44,16 +43,6 @@ namespace KevDrawServer
private void RunServer() private void RunServer()
{ {
try
{
Security security = new Security();
security.CheckLicense(null);
}
catch
{
return;
}
string strPort = WebConfig.ServicePort; string strPort = WebConfig.ServicePort;
List<string> lstUrl = new List<string>(); List<string> lstUrl = new List<string>();
// 获取本地主机名 // 获取本地主机名

@ -1,12 +1,15 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net461" /> <package id="EmbedIO" version="3.5.2" targetFramework="net472" />
<package id="Microsoft.Bcl.AsyncInterfaces" version="9.0.4" targetFramework="net472" />
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net472" />
<package id="System.Buffers" version="4.5.1" targetFramework="net472" /> <package id="System.Buffers" version="4.5.1" targetFramework="net472" />
<package id="System.IO.Pipelines" version="9.0.4" targetFramework="net472" /> <package id="System.IO.Pipelines" version="9.0.4" targetFramework="net472" />
<package id="System.Memory" version="4.5.5" targetFramework="net472" /> <package id="System.Memory" version="4.5.5" targetFramework="net472" />
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net472" /> <package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net472" />
<package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net472" /> <package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net472" />
<package id="System.Text.Encodings.Web" version="9.0.4" targetFramework="net472" /> <package id="System.Text.Encodings.Web" version="9.0.4" targetFramework="net472" />
<package id="System.Text.Json" version="9.0.4" targetFramework="net472" />
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" /> <package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net472" /> <package id="System.ValueTuple" version="4.5.0" targetFramework="net472" />
<package id="Unosquare.Swan.Lite" version="3.1.0" targetFramework="net472" /> <package id="Unosquare.Swan.Lite" version="3.1.0" targetFramework="net472" />

@ -283,6 +283,17 @@ namespace MeshProcess
} }
#endregion #endregion
/// <summary>
/// 表达式检测
/// </summary>
/// <param name="expressionString"></param>
/// <returns></returns>
public bool CompileExpressionZ(string expressionString)
{
bool state = Editor_CompileExpressionZ(expressionString);
return state;
}
/// <summary> /// <summary>
/// z值运算 /// z值运算
/// </summary> /// </summary>
@ -499,6 +510,9 @@ namespace MeshProcess
public static extern void Editor_SetMousePos(double px, double py); public static extern void Editor_SetMousePos(double px, double py);
#endregion #endregion
[DllImport(PROCESSLIB, EntryPoint = "Editor_CompileExpressionZ", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
public static extern bool Editor_CompileExpressionZ(string expressionString);
[DllImport(PROCESSLIB, EntryPoint = "Editor_CalculateZByExpression", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)] [DllImport(PROCESSLIB, EntryPoint = "Editor_CalculateZByExpression", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
public static extern bool Editor_CalculateZByExpression(string expressionString); public static extern bool Editor_CalculateZByExpression(string expressionString);
[DllImport(PROCESSLIB, EntryPoint = "Editor_GetZMin", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)] [DllImport(PROCESSLIB, EntryPoint = "Editor_GetZMin", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]

@ -44,7 +44,6 @@
<HintPath>..\..\bin\Debug\GeoSigmaDrawLib.dll</HintPath> <HintPath>..\..\bin\Debug\GeoSigmaDrawLib.dll</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="PresentationCore" />
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />

@ -441,6 +441,13 @@ namespace MeshProcess
updateEditorParProperty(); updateEditorParProperty();
return IsSaved; return IsSaved;
} }
[DllImport("user32.dll")]
static extern short GetAsyncKeyState(int vKey);
public static bool IsSpacePressed()
{
return (GetAsyncKeyState(0x20) & 0x8000) != 0; // 0x20 是空格键的虚拟键码
}
/// <summary> /// <summary>
/// US the c mesh editor_ mouse down. /// US the c mesh editor_ mouse down.
/// </summary> /// </summary>
@ -448,7 +455,8 @@ namespace MeshProcess
/// <param name="e">The e.</param> /// <param name="e">The e.</param>
private void UCMeshEditor_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) private void UCMeshEditor_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{ {
if(Keyboard.IsKeyDown(Key.Space)) //if(Keyboard.IsKeyDown(Key.Space))
if(IsSpacePressed())
{ {
return; return;
} }
@ -469,7 +477,8 @@ namespace MeshProcess
/// <param name="e">The e.</param> /// <param name="e">The e.</param>
private void UCMeshEditor_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e) private void UCMeshEditor_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
{ {
if (Keyboard.IsKeyDown(Key.Space)) //if (Keyboard.IsKeyDown(Key.Space))
if (IsSpacePressed())
{ {
return; return;
} }
@ -523,7 +532,8 @@ namespace MeshProcess
mousePositionY = e.Y; mousePositionY = e.Y;
editor?.DrawCircle(e.X, e.Y, (float)EditorParameter.OperatorRadius); editor?.DrawCircle(e.X, e.Y, (float)EditorParameter.OperatorRadius);
if (Keyboard.IsKeyDown(Key.Space)) //if (Keyboard.IsKeyDown(Key.Space))
if (IsSpacePressed())
{ {
return; return;
} }
@ -704,6 +714,21 @@ namespace MeshProcess
editor?.DrawCircle(mousePositionX, mousePositionY, (float)EditorParameter.OperatorRadius); editor?.DrawCircle(mousePositionX, mousePositionY, (float)EditorParameter.OperatorRadius);
} }
/// <summary>
/// 表达式检测
/// </summary>
/// <param name="expressionString"></param>
/// <returns></returns>
public bool CompileExpressionZ(string expressionString)
{
if (editor == null)
{
return false;
}
bool state = editor.CompileExpressionZ(expressionString);
return state;
}
/// <summary> /// <summary>
/// z值运算 /// z值运算
/// </summary> /// </summary>

@ -269,20 +269,33 @@ bool Editor_PushbackData(CXy * pXy, LPCTSTR curveLayer, int64_t** destroyArray,
pMesh->SetM(zMin, zMax); pMesh->SetM(zMin, zMax);
// ÉèÖÃÑÕÉ« // ÉèÖÃÑÕÉ«
//double dZMinOld = 0;
//double dZMaxOld = 0;
//pMesh->color.GetZRange(dZMinOld, dZMaxOld);
//CArray<CColorItem, CColorItem> ColorList;
//vector<ColorItem> colors;
//int nColorCount = pMesh->color.GetCount();
//for (int i = 0; i < nColorCount; i++) {
// CColorItem colorMesh = pMesh->color.GetColorItem(i);
// colorMesh.z = zMin + ((zMax - zMin) * (colorMesh.z - dZMinOld) / (dZMaxOld - dZMinOld));
// ColorList.Add(colorMesh);
//}
//pMesh->color.SetZRange(zMin, zMax);
//pMesh->color.SetColor(ColorList);
//pMesh->UpdateColorRuler();
//pMesh->GetBitmap();
// 获取旧的颜色范围
double dZMinOld = 0; double dZMinOld = 0;
double dZMaxOld = 0; double dZMaxOld = 0;
pMesh->color.GetZRange(dZMinOld, dZMaxOld); pMesh->color.GetZRange(dZMinOld, dZMaxOld);
CArray<CColorItem, CColorItem> ColorList;
vector<ColorItem> colors; // 如果旧范围和新范围不同,只更新范围,不重分配颜色
int nColorCount = pMesh->color.GetCount(); if (fabs(dZMinOld - zMin) > 1e-6 || fabs(dZMaxOld - zMax) > 1e-6)
for (int i = 0; i < nColorCount; i++) { {
CColorItem colorMesh = pMesh->color.GetColorItem(i); pMesh->color.SetZRange(zMin, zMax);
colorMesh.z = zMin + ((zMax - zMin) * (colorMesh.z - dZMinOld) / (dZMaxOld - dZMinOld)); //pMesh->UpdateColorRuler();
ColorList.Add(colorMesh);
} }
pMesh->color.SetZRange(zMin, zMax);
pMesh->color.SetColor(ColorList);
pMesh->UpdateColorRuler();
pMesh->GetBitmap(); pMesh->GetBitmap();
// µÈÖµÏß // µÈÖµÏß
@ -654,6 +667,22 @@ void Editor_SetMousePos(double px, double py)
} }
#pragma endregion #pragma endregion
//表达式检测
extern "C" __declspec(dllexport)
bool Editor_CompileExpressionZ(LPCTSTR expressionString)
{
char expressionStr[256];
memset(expressionStr, 0, sizeof(char) * 256);
CString str(expressionString);
if (!str.IsEmpty()) {
strncpy_s(expressionStr, expressionString, str.GetLength());
}
bool state = Func_CompileExpressionZ(expressionStr);
return state;
}
//ZÖµÔËËã //ZÖµÔËËã
extern "C" __declspec(dllexport) extern "C" __declspec(dllexport)
bool Editor_CalculateZByExpression(LPCTSTR expressionString) bool Editor_CalculateZByExpression(LPCTSTR expressionString)

@ -130,7 +130,8 @@
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>%(PreprocessorDefinitions);WIN32;_WINDOWS;NDEBUG;UNICODE;_UNICODE;_AFXDLL;CMAKE_INTDIR="Release"</PreprocessorDefinitions> <PreprocessorDefinitions>%(PreprocessorDefinitions);WIN32;_WINDOWS;NDEBUG;UNICODE;_UNICODE;_AFXDLL;CMAKE_INTDIR="Release"</PreprocessorDefinitions>
<ObjectFileName>$(IntDir)</ObjectFileName> <ObjectFileName>$(IntDir)</ObjectFileName>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>
</DebugInformationFormat>
</ClCompile> </ClCompile>
<ResourceCompile> <ResourceCompile>
<PreprocessorDefinitions>%(PreprocessorDefinitions);WIN32;_WINDOWS;NDEBUG;UNICODE;_UNICODE;_AFXDLL;CMAKE_INTDIR=\"Release\"</PreprocessorDefinitions> <PreprocessorDefinitions>%(PreprocessorDefinitions);WIN32;_WINDOWS;NDEBUG;UNICODE;_UNICODE;_AFXDLL;CMAKE_INTDIR=\"Release\"</PreprocessorDefinitions>

@ -500,6 +500,13 @@ void Func_SetMousePos(double px, double py)
osgView->ShowMouse(cx, cy); osgView->ShowMouse(cx, cy);
} }
bool Func_CompileExpressionZ(char * expressionStr)
{
OMPeriodicLattice* pMesh = GetObjectManager()->GetPeriodicLattice();
bool state = pMesh->CompileExpressionZ(expressionStr);
return state;
}
bool Func_CalculateZByExpression(char* expressionStr) bool Func_CalculateZByExpression(char* expressionStr)
{ {
OMPeriodicLattice* pMesh = GetObjectManager()->GetPeriodicLattice(); OMPeriodicLattice* pMesh = GetObjectManager()->GetPeriodicLattice();

@ -171,6 +171,9 @@ extern "C" FUNC_EXPORT void Func_GetMousePos(double& px, double& py);
//譜崔報炎了崔 //譜崔報炎了崔
extern "C" FUNC_EXPORT void Func_SetMousePos(double px, double py); extern "C" FUNC_EXPORT void Func_SetMousePos(double px, double py);
//检测表达式合法性
extern "C" FUNC_EXPORT bool Func_CompileExpressionZ(char* expressionStr);
//Z峙塰麻 //Z峙塰麻
extern "C" FUNC_EXPORT bool Func_CalculateZByExpression(char* expressionStr); extern "C" FUNC_EXPORT bool Func_CalculateZByExpression(char* expressionStr);

@ -357,6 +357,13 @@ void AlgoPeriodicLattice::SetInvalidColor(int r, int g, int b)
m_pl->SetInvalidColor(r, g, b); m_pl->SetInvalidColor(r, g, b);
} }
bool AlgoPeriodicLattice::CompileExpressionZ(const char * expression)
{
std::string str(expression);
bool state = m_pl->CompileExpressionZ(str);
return state;
}
bool AlgoPeriodicLattice::CalculateZByExpression(const char* expression) bool AlgoPeriodicLattice::CalculateZByExpression(const char* expression)
{ {
std::string str(expression); std::string str(expression);

@ -124,6 +124,8 @@ public:
void SetInvalidColor(int r, int g, int b); void SetInvalidColor(int r, int g, int b);
bool CompileExpressionZ(const char* expression);
bool CalculateZByExpression(const char* expression); bool CalculateZByExpression(const char* expression);
//更新等值线 //更新等值线

@ -2536,6 +2536,30 @@ void PeriodicLattice::Smooth5x5(const Point2D& cen, float rad, float per, int ty
UpdateWellPoints(); UpdateWellPoints();
} }
bool PeriodicLattice::CompileExpressionZ(const std::string & expressionString)
{
double z = 0.0;
exprtk::symbol_table<double> symbolTable;
if (!symbolTable.add_variable("z", z))
{
return false;
}
exprtk::expression<double> expression;
if (!expression.register_symbol_table(symbolTable))
{
return false;
}
exprtk::parser<double> parser;
if (!parser.compile(expressionString, expression))
{
return false;
}
return true;
}
void PeriodicLattice::addFaultPolyline() void PeriodicLattice::addFaultPolyline()
{ {
double len = std::min(m_stepX, m_stepY) * 0.49; double len = std::min(m_stepX, m_stepY) * 0.49;

@ -82,6 +82,13 @@ public:
void Smooth3x3(const Point2D& cen, float rad, float per, int type, float wellrad); void Smooth3x3(const Point2D& cen, float rad, float per, int type, float wellrad);
void Smooth5x5(const Point2D& cen, float rad, float per, int type, float wellrad); void Smooth5x5(const Point2D& cen, float rad, float per, int type, float wellrad);
/**
*
*
* \param expression exprtk https://github.com/ArashPartow/exprtk
*/
bool CompileExpressionZ(const std::string& expressionString);
/** /**
* z * z
* *

@ -346,6 +346,15 @@ void CXJOSGViewInternal::InitCameraConfig(void)
// Create the viewer for this window // Create the viewer for this window
m_viewer = new XJV3D_Viewer(); m_viewer = new XJV3D_Viewer();
//osg::setNotifyLevel(osg::DEBUG_INFO);
int samples = 8;
//win7 需要设置下面的方式主要是Win7 上常见的问题是 集显 + 独显切换不成功OSG 默认跑在集显上导致卡死
if (IsWindows7())
{
osg::DisplaySettings::instance()->setNumMultiSamples(4); // 强制独显激活
m_viewer->setThreadingModel(osgViewer::ViewerBase::SingleThreaded);//避免多线程渲染在 Win7 驱动下死锁
}
//设置视景体的线程模型 //设置视景体的线程模型
//m_viewer->setThreadingModel(osgViewer::ViewerBase::CullThreadPerCameraDrawThreadPerContext); //m_viewer->setThreadingModel(osgViewer::ViewerBase::CullThreadPerCameraDrawThreadPerContext);
m_viewer->setLightingMode(osg::View::HEADLIGHT); m_viewer->setLightingMode(osg::View::HEADLIGHT);
@ -362,7 +371,6 @@ void CXJOSGViewInternal::InitCameraConfig(void)
// Init the Windata Variable that holds the handle for the Window to display OSG in. // Init the Windata Variable that holds the handle for the Window to display OSG in.
osg::ref_ptr<osg::Referenced> windata = new osgViewer::GraphicsWindowWin32::WindowData(m_hWnd); osg::ref_ptr<osg::Referenced> windata = new osgViewer::GraphicsWindowWin32::WindowData(m_hWnd);
int samples = 8;
//图形设备上下文参数信息 //图形设备上下文参数信息
traits->x = 0; traits->x = 0;
traits->y = 0; traits->y = 0;
@ -377,14 +385,14 @@ void CXJOSGViewInternal::InitCameraConfig(void)
// Create the Graphics Context // Create the Graphics Context
osg::GraphicsContext* gc = osg::GraphicsContext::createGraphicsContext(traits.get()); osg::GraphicsContext* gc = osg::GraphicsContext::createGraphicsContext(traits.get());
while (!gc || !gc->valid()) //如果创建失败,就逐步降低 samples
while ((!gc || !gc->valid()) && samples > 0)
{ {
samples /= 2; samples /= 2;
traits->samples = samples; traits->samples = samples;
gc = osg::GraphicsContext::createGraphicsContext(traits.get()); gc = osg::GraphicsContext::createGraphicsContext(traits.get());
if (samples == 0)
break;
} }
// osgViewer::GraphicsWindowWin32* win32 = dynamic_cast<osgViewer::GraphicsWindowWin32*>(gc); // osgViewer::GraphicsWindowWin32* win32 = dynamic_cast<osgViewer::GraphicsWindowWin32*>(gc);
// if(win32) // if(win32)
// win32->setCursor(osgViewer::GraphicsWindow::InheritCursor); // win32->setCursor(osgViewer::GraphicsWindow::InheritCursor);
@ -2815,4 +2823,24 @@ void CXJOSGViewInternal::GetMousePos(int& px, int& py)
px = pt.x(); px = pt.x();
py = pt.y(); py = pt.y();
} }
} }
typedef LONG(WINAPI* RtlGetVersionPtr)(PRTL_OSVERSIONINFOW);
bool CXJOSGViewInternal::IsWindows7()
{
HMODULE hMod = ::GetModuleHandleW(L"ntdll.dll");
if (hMod)
{
RtlGetVersionPtr fxPtr = (RtlGetVersionPtr)::GetProcAddress(hMod, "RtlGetVersion");
if (fxPtr != nullptr)
{
RTL_OSVERSIONINFOW rovi = { 0 };
rovi.dwOSVersionInfoSize = sizeof(rovi);
if (fxPtr(&rovi) == 0) // STATUS_SUCCESS
{
return (rovi.dwMajorVersion == 6 && rovi.dwMinorVersion == 1);
}
}
}
return false;
}

@ -374,6 +374,8 @@ public:
void ShowMouse(int px, int py); void ShowMouse(int px, int py);
void GetMousePos(int& px, int& py); void GetMousePos(int& px, int& py);
bool IsWindows7();
protected: protected:
//根据指定路径的图片纹理来创建背景色 //根据指定路径的图片纹理来创建背景色
osg::ref_ptr<osg::Camera> CreateBackGround(std::string BmpPath); osg::ref_ptr<osg::Camera> CreateBackGround(std::string BmpPath);

@ -342,6 +342,12 @@ void OMPeriodicLattice::SetIsoplethProperty(double isopStep, int markStep, doubl
zMin, zMax); zMin, zMax);
} }
bool OMPeriodicLattice::CompileExpressionZ(const char * expression)
{
bool state = m_periodicLattice->CompileExpressionZ(expression);
return state;
}
bool OMPeriodicLattice::CalculateZByExpression(const char* expression) bool OMPeriodicLattice::CalculateZByExpression(const char* expression)
{ {
bool state = m_periodicLattice->CalculateZByExpression(expression); bool state = m_periodicLattice->CalculateZByExpression(expression);

@ -92,6 +92,9 @@ public:
void SetIsoplethProperty(double isopStep, int markStep, double minIsop, double maxIsop, void SetIsoplethProperty(double isopStep, int markStep, double minIsop, double maxIsop,
double zMin, double zMax); double zMin, double zMax);
//表达式合法检测
bool CompileExpressionZ(const char* expression);
//¼ÆËãZÖµ //¼ÆËãZÖµ
bool CalculateZByExpression(const char* expression); bool CalculateZByExpression(const char* expression);

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -171,6 +171,9 @@ extern "C" FUNC_EXPORT void Func_GetMousePos(double& px, double& py);
//譜崔報炎了崔 //譜崔報炎了崔
extern "C" FUNC_EXPORT void Func_SetMousePos(double px, double py); extern "C" FUNC_EXPORT void Func_SetMousePos(double px, double py);
//检测表达式合法性
extern "C" FUNC_EXPORT bool Func_CompileExpressionZ(char* expressionStr);
//Z峙塰麻 //Z峙塰麻
extern "C" FUNC_EXPORT bool Func_CalculateZByExpression(char* expressionStr); extern "C" FUNC_EXPORT bool Func_CalculateZByExpression(char* expressionStr);

@ -124,6 +124,8 @@ public:
void SetInvalidColor(int r, int g, int b); void SetInvalidColor(int r, int g, int b);
bool CompileExpressionZ(const char* expression);
bool CalculateZByExpression(const char* expression); bool CalculateZByExpression(const char* expression);
//更新等值线 //更新等值线

@ -82,6 +82,13 @@ public:
void Smooth3x3(const Point2D& cen, float rad, float per, int type, float wellrad); void Smooth3x3(const Point2D& cen, float rad, float per, int type, float wellrad);
void Smooth5x5(const Point2D& cen, float rad, float per, int type, float wellrad); void Smooth5x5(const Point2D& cen, float rad, float per, int type, float wellrad);
/**
*
*
* \param expression exprtk https://github.com/ArashPartow/exprtk
*/
bool CompileExpressionZ(const std::string& expressionString);
/** /**
* z * z
* *

@ -374,6 +374,8 @@ public:
void ShowMouse(int px, int py); void ShowMouse(int px, int py);
void GetMousePos(int& px, int& py); void GetMousePos(int& px, int& py);
bool IsWindows7();
protected: protected:
//根据指定路径的图片纹理来创建背景色 //根据指定路径的图片纹理来创建背景色
osg::ref_ptr<osg::Camera> CreateBackGround(std::string BmpPath); osg::ref_ptr<osg::Camera> CreateBackGround(std::string BmpPath);

@ -92,6 +92,9 @@ public:
void SetIsoplethProperty(double isopStep, int markStep, double minIsop, double maxIsop, void SetIsoplethProperty(double isopStep, int markStep, double minIsop, double maxIsop,
double zMin, double zMax); double zMin, double zMax);
//表达式合法检测
bool CompileExpressionZ(const char* expression);
//¼ÆËãZÖµ //¼ÆËãZÖµ
bool CalculateZByExpression(const char* expression); bool CalculateZByExpression(const char* expression);

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -0,0 +1,616 @@
#include "StdAfx.h"
#include "ActionBackupItem.h"
#include "ActionCurveEdit.h"
#include "ActionCurveEditAddPoint.h"
#include "ActionCurveEditDeletePoint.h"
#include "ActionModifiedItem.h"
#include "DrawOperator/TypeDefine.h"
#include "HandleDrawer.h"
#include "SigmaDoc.h"
#include "SigmaView.h"
#include "CurveEditorBase.h"
namespace NItem {
CurveEditorBase::CurveEditorBase(CSigmaDoc *pDoc)
: CItemCurve(pDoc), m_bLButtonDownWhenMouseMove(false),
m_nHandleDrawMode(TRACKER_CIRCLE),
m_handleDrawer(std::make_unique<HandleDrawer>(pDoc)), m_nModeX(-1),
m_nModeY(-1) {}
CurveEditorBase::~CurveEditorBase(void) {}
void CurveEditorBase::OnDraw(CXyDC *pDC) {
POSITION pos = GetPos();
if (pos == 0)
return;
// ?????????????????
CCurveEx *pCurve = (CCurveEx *)GetDoc()->GetDraw()->GetAtValue(GetPos());
}
void CurveEditorBase::DrawAssistant(CDC *pDC, int mouseX, int mouseY) {
CCurveEx *pCurve = GetControlCurve();
if (pCurve == nullptr)
return;
m_handleDrawer->Init(pCurve);
m_handleDrawer->DrawAll(pDC);
}
void CurveEditorBase::OnLButtonDown(CDC *pDC, UINT nFlags, CPoint point,
int vk) {
SetScreenDC(pDC);
// ??ï“????????§ß????????????????
if (this->GetHandleIndex() < 0) {
if (!IsCanAddHandle(point))
return;
}
// ?????¦Å???????§Ò?
if (NewPointList.GetCount() > 0)
NewPointList.RemoveAll();
// ????????¦Ë???????????????????
m_nLButtonDownPoint = point;
c_down = GetDC()->GetReal(point);
c_last = c_down;
// ????????????????
this->OnDrawDragPreview();
}
int CurveEditorBase::OnMouseMove(CDC *dc, UINT nFlags, CPoint point) {
SetScreenDC(dc);
POSITION pos = GetPos();
if (pos == 0)
return 1;
CXyDC *pDC = GetDC();
if (IsDragging(nFlags)) // ??????????
{
HandleMouseDrag(pDC, point);
} else {
HandleMouseHover(dc, point);
}
m_handleDrawer->DrawFocusHandle(dc, GetHandleIndex());
return 1;
}
void CurveEditorBase::OnLButtonUp(CDC *pDC, UINT nFlags, CPoint point, int vk) {
SetScreenDC(pDC);
if (m_bLButtonDownWhenMouseMove == false)
return;
m_bLButtonDownWhenMouseMove = false;
if (this->GetHandleIndex() < 0) {
CPoint2D pt = GetDC()->GetReal(point);
POSITION pos = GetDoc()->GetSelectedItem(pt);
if (pos == GetPos())
return;
EndEdit();
return;
}
c_last = GetDC()->GetReal(point);
// ?????????
OnDrawDragPreview();
if (c_last == c_down)
return;
// ??????
OnCalculateDragEffect(nullptr);
SetModifiedFlag(TRUE);
GetDoc()->Modified();
SetHandleIndex(-1);
ReleaseCapture();
}
void CurveEditorBase::OnLButtonDblClk(UINT nFlags, CPoint point) {
POSITION pos = GetPos();
if (pos == nullptr)
return;
COne *pOne = GetDoc()->GetDraw()->GetAt(pos);
if (pOne == nullptr)
return;
std::unique_ptr<CActionModifiedItem> pAction =
std::make_unique<CActionModifiedItem>(GetDoc(), 0);
pAction->BackupOldItem(pos, pOne);
if (GetHandleIndex() >= 0) {
if (IsCaptureState())
ReleaseCapture();
int index = GetHandleIndex();
CCurveEx *pcurve = GetControlCurve();
CRect8 range(1e300, -1e300, -1e300, 1e300);
for (int i = index - 1; i <= index + 1; i++) {
if (i < 0 || i > pcurve->num - 1)
continue;
range.CombinRect(pcurve->x[i], pcurve->y[i], pcurve->x[i], pcurve->y[i]);
}
DeleteHandle(GetHandleIndex());
SetHandleIndex(-1);
CRect rt = GetDC()->GetScreen(range);
CSize8 sz = GetDoc()->GetSelectSize();
CSize size((int)sz.cx + 1, (int)sz.cy + 1);
rt.InflateRect(size);
} else if (IsCanAddHandle(point)) {
int ret = AddHandle(point);
if (ret < 0)
return;
}
pAction->BackupNewItem();
GetDoc()->SetActionItem(pAction.release());
GetDoc()->Modified();
if (GetDoc()->GetItem()->GetType() == ITEM_CURVE_EDIT) {
EndEdit();
}
}
BOOL CurveEditorBase::OnSetCursor(CWnd *pWnd, UINT nHitTest, UINT message) {
return TRUE;
}
BOOL CurveEditorBase::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) {
switch (nChar) {
case VK_ESCAPE:
if (!IsCaptureState())
break;
OnDrawDragPreview();
DrawSelectHandle(GetHandleIndex());
SetHandleIndex(-1);
ReleaseCapture();
return TRUE;
}
return FALSE;
}
BOOL CurveEditorBase::OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags) {
switch (nChar) {
case VK_ESCAPE:
EndEdit();
return TRUE;
}
return FALSE;
}
int CurveEditorBase::GetSubMenu() { return 6; }
void CurveEditorBase::SetPos(POSITION pos) {
CItem::SetPos(pos);
m_pBakOne.reset(); // ????????
if (pos) {
COne *pOne = GetDoc()->GetDraw()->GetAt(GetPos());
m_pBakOne = std::make_unique<COne>();
*m_pBakOne = *pOne;
// ???¨´????????????????????????????m_pMarkCurve??
OnModeInitialize();
}
}
void CurveEditorBase::Clear(void) {
m_pBakOne.reset(); // ???????
if (GetPos() != nullptr) {
COne *pOne = GetDoc()->GetDraw()->GetAt(GetPos());
CRect8 range(1e100, -1e100, -1e100, 1e100);
pOne->GetRange(range);
CRect rt = GetDC()->GetScreen(range);
rt.NormalizeRect();
rt.InflateRect(GetDoc()->GetHandleSize());
rt.InflateRect(1, 1);
}
}
void CurveEditorBase::Draw(CDC *pDC) {
POSITION pos = GetPos();
if (pos == 0)
return;
CCurveEx *pValue = GetControlCurve();
DrawHandlesByCDC(pDC, pValue);
}
int CurveEditorBase::GetNumberOfNode() {
CCurveEx *pc = GetControlCurve();
if (pc == 0)
return -1;
return pc->num;
}
void CurveEditorBase::EreaseHandles(CDC *pDC) { m_handleDrawer->ClearAll(pDC); }
// ========== ????????????????==========
void CurveEditorBase::EndEdit(void) {
if (GetPos() == nullptr)
return;
COne *pOne = GetDoc()->GetDraw()->GetAt(GetPos());
CRect8 range(1e100, -1e100, -1e100, 1e100);
pOne->GetRange(range);
CRect rt = GetDC()->GetScreen(range);
rt.NormalizeRect();
rt.InflateRect(GetDoc()->GetHandleSize());
rt.InflateRect(1, 1);
if (((CCurveEx *)pOne->GetValue())->num < 2) {
if (::AfxMessageBox(IDS_STRING_CURVE_ONLY_ONE_POINT,
MB_YESNO | MB_ICONQUESTION) == IDYES) {
*pOne = *m_pBakOne;
CPositionList list;
list.AddTail(GetPos());
CItem::SetPos(nullptr);
GetDoc()->InvalidateDelete(list);
return;
}
}
if (IsModified()) {
CActionItem *pAction =
new CActionModifiedItem(GetDoc(), IDS_STRING_TOOLBAR_EDIT);
((CActionModifiedItem *)pAction)->BackupOldItem(GetPos(), m_pBakOne.get());
GetDoc()->SetActionItem(pAction);
}
}
void CurveEditorBase::CancelAll(void) {
if (m_pBakOne) {
COne *pOne = GetDoc()->GetDraw()->GetAt(GetPos());
*pOne = *m_pBakOne;
GetMarkCurve();
}
}
BOOL CurveEditorBase::IsCanCancelAll(void) {
return m_pBakOne != nullptr ? TRUE : FALSE;
}
void CurveEditorBase::GetXY(CCurveEx *pValue, int nIndex, dfPoint &point) {
pValue->GetPoint(nIndex, point);
}
CCurveEx *CurveEditorBase::GetControlCurve(void) {
POSITION pos = GetPos();
if (pos == nullptr)
return nullptr;
return (CCurveEx *)GetDoc()->GetDraw()->GetAtValue(pos);
}
int CurveEditorBase::HitTestHandle(CPoint point) {
return HitTestHandle(GetControlCurve(), point);
}
int CurveEditorBase::HitTestHandle(CCurveEx *pValue, CPoint point) {
if (pValue == nullptr)
return -1;
CRect rt;
for (int i = 0; i < pValue->num; i++) {
rt = GetDoc()->m_itemTracker.GetHandleRect(GetDC()->GetSX(pValue->x[i]),
GetDC()->GetSY(pValue->y[i]));
if (rt.PtInRect(point))
return i;
}
return -1;
}
bool CurveEditorBase::IsDragging(int nFlags) const { return nFlags & 1; }
int CurveEditorBase::HandleMouseDrag(CXyDC *pDC, CPoint point) {
m_bLButtonDownWhenMouseMove = true;
// ?????????????????????????????????????????????????
int i = GetHandleIndex();
if (i < 0) {
CSize8 sz = GetDoc()->GetSelectSize();
if (AfxGetPublicFunction()->Distance(m_nLButtonDownPoint.x,
m_nLButtonDownPoint.y, point.x,
point.y) > sz.cx) {
i = AddHandle(m_nLButtonDownPoint);
if (i < 0)
return 1;
SetHandleIndex(i);
c_down = GetDC()->GetReal(m_nLButtonDownPoint);
c_last = c_down;
// ????¦Ë????????
OnDrawDragPreview();
} else
return 1;
}
// ????????¦Å????
OnDrawDragPreview();
// ????¦Ë??
c_last = pDC->GetReal(point);
CPointList list;
OnCalculateDragEffect(&list);
// ?????¦Ì???????????o?? NewPointList??
OnDrawDragPreview();
CString str, string;
auto curve = std::make_unique<CCurveEx>();
curve->SetPoints(list, 2);
COne *pOne = GetDoc()->GetDraw()->GetAt(GetPos());
CCurveEx *pValue = (CCurveEx *)pOne->GetValue();
OnDragMove(GetHandleIndex(), c_last);
return 1;
}
int CurveEditorBase::HandleMouseHover(CDC *dc, CPoint point) {
// ???????????????????
CCurveEx *pValue = GetControlCurve();
if (pValue == 0) {
SetHandleIndex(-1);
int handleIndex = m_handleDrawer->EreaseFocusHandle(dc);
m_handleDrawer->DrawOneHandle(dc, handleIndex);
} else {
int i = HitTestHandle(pValue, point);
if (i >= 0) {
SetHandleIndex(i);
} else {
SetHandleIndex(-1);
int handleIndex = m_handleDrawer->EreaseFocusHandle(dc);
m_handleDrawer->DrawOneHandle(dc, handleIndex);
}
}
return 1;
}
void CurveEditorBase::DeleteHandle(int nIndex) {
CCurveEx *pValue = GetControlCurve();
BOOL bAttachProcess = TRUE;
CPointList oldPoints;
CPointList newPoints;
if (bAttachProcess) {
dfPoint pt;
if (nIndex != 0) {
pValue->GetPoint(nIndex - 1, pt);
oldPoints.AddTail(pt);
newPoints.AddTail(pt);
}
pValue->GetPoint(nIndex, pt);
oldPoints.AddTail(pt);
if (nIndex < pValue->num - 1) {
pValue->GetPoint(nIndex + 1, pt);
oldPoints.AddTail(pt);
newPoints.AddTail(pt);
}
}
PointList.RemoveAll();
dfPoint dd;
for (int i = 0; i < pValue->num; i++) {
dd.x0 = pValue->x[i];
dd.y0 = pValue->y[i];
dd.z0 = pValue->z[i];
dd.l = pValue->l[i];
if (i == nIndex)
continue;
PointList.AddTail(dd);
}
pValue->SetPoints(PointList, pValue->nPoint, pValue->bAutoLocation);
PointList.RemoveAll();
SetModifiedFlag(TRUE);
this->SetHandleIndex(-1);
if (bAttachProcess) {
if (oldPoints.GetCount() > 0)
AttachProcess(oldPoints, newPoints);
}
}
int CurveEditorBase::AddHandle(double l0) {
CCurveEx *pValue = (CCurveEx *)GetDoc()->GetDraw()->GetAtValue(GetPos());
dfPoint add;
add.l = l0;
pValue->GetCoordinate(add.l, add.x0, add.y0, add.z0);
return AddHandle(pValue, add);
}
int CurveEditorBase::AddHandle(CCurveEx *pValue, dfPoint add) {
if (pValue == nullptr)
return -1;
int nIndex = -1;
PointList.RemoveAll();
if (add.l < pValue->l[0]) {
pValue->GetPoint(PointList);
PointList.AddHead(add);
nIndex = 0;
} else if (add.l > pValue->l[pValue->num - 1]) {
pValue->GetPoint(PointList);
PointList.AddTail(add);
nIndex = (int)PointList.GetCount() - 1;
} else {
dfPoint dd;
for (int i = 0; i < pValue->num; i++) {
dd.x0 = pValue->x[i];
dd.y0 = pValue->y[i];
dd.z0 = pValue->z[i];
dd.l = pValue->l[i];
PointList.AddTail(dd);
if (i == pValue->num - 1)
break;
if (add.l > pValue->l[i] && add.l < pValue->l[i + 1]) {
PointList.AddTail(add);
nIndex = i + 1;
}
}
}
pValue->SetPoints(PointList, pValue->nPoint, pValue->bAutoLocation);
PointList.RemoveAll();
GetDoc()->Modified();
SetModifiedFlag(TRUE);
return nIndex;
}
int CurveEditorBase::AddHandle(CPoint point) {
double l0;
if (!IsCanAddHandle(point, &l0))
return -1;
return AddHandle(l0);
}
BOOL CurveEditorBase::IsCanAddHandle(CPoint point, double *pl0) {
POSITION pos = GetPos();
if (pos == nullptr)
return FALSE;
CCurveEx *pValue = (CCurveEx *)GetDoc()->GetDraw()->GetAtValue(pos);
if (pValue == nullptr)
return FALSE;
CPoint2D pt = GetDC()->GetReal(point);
double l0;
double dis = pValue->PointDistance(pt.x0, pt.y0, l0);
CSize8 sz = GetDoc()->GetSelectSize();
int dx = GetDC()->GetScreenWidth(dis);
int dy = GetDC()->GetScreenHeight(dis);
if (pl0)
*pl0 = l0;
if (dx > sz.cx || dy > sz.cy)
return FALSE;
return TRUE;
}
void CurveEditorBase::AttachProcess(CPointList &oldPoints,
CPointList &newPoints) {}
void CurveEditorBase::DrawMoveLine(void) { OnDrawDragPreview(); }
void CurveEditorBase::GetMarkCurve(void) {}
CPoint2D CurveEditorBase::GetCDown() const { return c_down; }
CPoint2D CurveEditorBase::GetCLast() const { return c_last; }
void CurveEditorBase::DrawHandle(CXyDC *pDC, CCurveEx *pCurve) {
if (pCurve == nullptr)
return;
CPoint ptPrev;
CRect rt;
dfPoint pt;
CPoint point;
for (int i = 0; i < pCurve->num; i++) {
GetXY(pCurve, i, pt);
point.x = pDC->GetSX(pt.x0);
point.y = pDC->GetSY(pt.y0);
if (i > 0) {
if (point.x == ptPrev.x && point.y == ptPrev.y && i != GetHandleIndex())
continue;
}
if (i == GetHandleIndex()) {
if (i == 0)
rt = GetFirstNodeHandleRectFocus(point);
else
rt = GetDoc()->m_itemTracker.GetHandleRectFocus(point);
} else {
if (i == 0)
rt = GetDoc()->m_itemTracker.GetHandleRectFocus(point);
else
rt = GetDoc()->m_itemTracker.GetHandleRect(point);
}
GetDoc()->m_itemTracker.DrawHandle(m_pScreenDC, rt, TRACKER_CIRCLE);
ptPrev = point;
}
}
void CurveEditorBase::DrawHandlesByCDC(CDC *pDC, CCurveEx *pCurve) {
if (pCurve == nullptr)
return;
m_handleDrawer->ClearAll(pDC);
m_handleDrawer->Init(pCurve);
m_handleDrawer->DrawAll(pDC);
}
void CurveEditorBase::DrawSelectHandle(int nHandle) {
CCurveEx *pValue = GetControlCurve();
if (pValue == nullptr)
return;
if (nHandle < 0 || nHandle >= pValue->num)
return;
CPoint point;
point.x = GetDC()->GetSX(pValue->x[nHandle]);
point.y = GetDC()->GetSY(pValue->y[nHandle]);
CRect rt;
if (nHandle == 0)
rt = GetDoc()->m_itemTracker.GetHandleRectFocus(point);
else
rt = GetDoc()->m_itemTracker.GetHandleRect(point);
GetDoc()->m_itemTracker.DrawHandle(m_pScreenDC, rt, m_nHandleDrawMode);
if (nHandle == 0)
rt = GetFirstNodeHandleRectFocus(point);
else
rt = GetDoc()->m_itemTracker.GetHandleRectFocus(point);
GetDoc()->m_itemTracker.DrawHandle(m_pScreenDC, rt, m_nHandleDrawMode);
}
CRect CurveEditorBase::GetRangeWidthIndex(int nIndex) {
CCurveEx *pValue = GetControlCurve();
if (pValue == nullptr || nIndex < 0 || nIndex >= pValue->num) {
return CRect(0, 0, 0, 0);
}
CRect8 rt(pValue->x[nIndex], pValue->y[nIndex], pValue->x[nIndex],
pValue->y[nIndex]);
if (nIndex > 0)
rt.CombinRect(pValue->x[nIndex - 1], pValue->y[nIndex - 1],
pValue->x[nIndex - 1], pValue->y[nIndex - 1]);
if (nIndex < pValue->num - 1)
rt.CombinRect(pValue->x[nIndex + 1], pValue->y[nIndex + 1],
pValue->x[nIndex + 1], pValue->y[nIndex + 1]);
CRect rect = GetDC()->GetScreen(rt);
rect.InflateRect(GetDoc()->GetHandleSize());
return rect;
}
CRect CurveEditorBase::GetFirstNodeHandleRectFocus(CPoint point) {
CRect rt = GetDoc()->m_itemTracker.GetHandleRectFocus(point);
rt.InflateRect(1, 1);
return rt;
}
void CurveEditorBase::SetDrawMode(int nModeX, int nModeY) {
m_nModeX = nModeX;
m_nModeY = nModeY;
}
int CurveEditorBase::GetOffsetMode(void) {
return GetDoc()->GetEditLineStatus() % 4;
}
}; // namespace NItem

@ -0,0 +1,126 @@
#pragma once
#include <memory>
#include "HandleDrawer.h"
#include "itemcurve.h"
namespace NItem {
#define DRAG_NODE_DEFAULT 0 // 直接移动当前节点
#define DRAG_NODE_LINE 1 // 线性移动节点
#define DRAG_NODE_COS 2 // 余弦移动节点
#define DRAG_NODE_SPLINE 3 // 三次样条移动节点
#define DRAG_LINE_COLOR RGB(0, 153, 255)
// #define TRACKER_SOLID 1
// #define TRACKER_RECT 2
// #define TRACKER_CIRCLE 4
// #define TRACKER_NO_EDIT TRACKER_SOLID | TRACKER_CIRCLE
class CurveEditorBase : public CItemCurve {
public:
CurveEditorBase(CSigmaDoc *pDoc);
virtual ~CurveEditorBase(void);
void OnDraw(CXyDC *pDC) override final;
void OnLButtonDblClk(UINT nFlags, CPoint point) override final;
void OnLButtonDown(CDC *pDC, UINT nFlags, CPoint point,
int vk) override final;
int OnMouseMove(CDC *pDC, UINT nFlags, CPoint point) override final;
void OnLButtonUp(CDC *pDC, UINT nFlags, CPoint point, int vk) override final;
BOOL OnSetCursor(CWnd *pWnd, UINT nHitTest, UINT message) override final;
BOOL OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) override final;
BOOL OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags) override final;
int GetSubMenu() override final;
void SetPos(POSITION pos) override final;
void Clear(void);
void Draw(CDC *pDC);
void DrawAssistant(CDC *pDC, int mouseX, int mouseY) override;
int GetNumberOfNode();
void EreaseHandles(CDC *pDC);
void EndEdit(void);
void CancelAll(void);
BOOL IsCanCancelAll(void);
// 控制点操作
int HitTestHandle(CPoint point);
void DeleteHandle(int nIndex);
int AddHandle(CPoint point);
BOOL IsCanAddHandle(CPoint point, double *pl0 = nullptr);
// 虚函数:样条模式需重写为返回冗余曲线
virtual CCurveEx *GetControlCurve(void);
void GetXY(CCurveEx *pValue, int nIndex, dfPoint &point);
void AttachProcess(CPointList &oldPoints, CPointList &newPoints);
void DrawMoveLine(void);
void GetMarkCurve(void);
CPoint2D GetCDown() const;
CPoint2D GetCLast() const;
protected:
// 默认:绘制两条线段
// 线性/余弦/样条:绘制整条受影响的曲线
virtual void OnDrawDragPreview() = 0;
virtual void OnCalculateDragEffect(CPointList *pList) = 0;
// 在SetPos后调用样条模式用于计算m_pMarkCurve
virtual void OnModeInitialize() {}
// 在OnMouseMove中调用
virtual void OnDragMove(int nIndex, CPoint2D pt) {}
// 获取当前偏移模式Linear/Cosine模式使用
int GetOffsetMode(void);
// 虚函数:样条模式需重写
virtual int AddHandle(double l0);
// 辅助方法:向指定曲线添加点
int AddHandle(CCurveEx *pValue, dfPoint add);
// 鼠标位置(世界坐标)
CPoint2D c_down, c_last;
// 拖动标志
bool m_bLButtonDownWhenMouseMove;
// 备份原始曲线(用于撤销)
std::unique_ptr<COne> m_pBakOne;
// 控制点绘制器
std::unique_ptr<HandleDrawer> m_handleDrawer;
// 鼠标按下点(屏幕坐标)
CPoint m_nLButtonDownPoint;
// 新点列表(用于预览)
CPointList NewPointList;
// 临时点列表
CPointList PointList;
// 控制点绘制模式
DWORD m_nHandleDrawMode;
int m_nModeX;
int m_nModeY; // 绘制模式
private:
void DrawHandle(CXyDC *pDC, CCurveEx *pCurve);
void DrawHandlesByCDC(CDC *pDC, CCurveEx *pCurve);
void DrawSelectHandle(int nHandle);
CRect GetRangeWidthIndex(int nIndex);
CRect GetFirstNodeHandleRectFocus(CPoint point);
void SetDrawMode(int nModeX, int nModeY);
int HitTestHandle(CCurveEx *pValue, CPoint point);
bool IsDragging(int nFlags) const;
int HandleMouseDrag(CXyDC *pDC, CPoint point);
int HandleMouseHover(CDC *dc, CPoint point);
};
}; // namespace NItem

@ -0,0 +1,163 @@
#include "StdAfx.h"
#include "CurveEditorCosine.h"
#include "SigmaDoc.h"
namespace NItem
{
void CurveEditorCosine::OnDrawDragPreview()
{
if (NewPointList.IsEmpty()) return;
CXyDC* pDC = GetDC();
CPen pen(PS_SOLID, 0, DRAG_LINE_COLOR);
CPen* op = m_pScreenDC->SelectObject(&pen);
int od = m_pScreenDC->SetROP2(R2_NOTXORPEN);
dfPoint dp1, dp2;
POSITION pos;
dp1 = NewPointList.GetHead();
pos = NewPointList.GetHeadPosition();
if (pos) NewPointList.GetNext(pos);
while (pos)
{
dp2 = NewPointList.GetNext(pos);
CPoint ptS1 = pDC->GetScreen(dp1);
m_pScreenDC->MoveTo(ptS1);
CPoint ptS2 = pDC->GetScreen(dp2);
m_pScreenDC->LineTo(ptS2);
dp1 = dp2;
}
m_pScreenDC->SetROP2(od);
m_pScreenDC->SelectObject(op);
}
void CurveEditorCosine::OnCalculateDragEffect(CPointList* pList)
{
BOOL bRedraw = TRUE;
BOOL bAttachProcess = TRUE;
CCurveEx* pValue = (CCurveEx*)GetDoc()->GetDraw()->GetAtValue(GetPos());
if (pList)
{
CCurveEx* pc = new CCurveEx;
*pc = *pValue;
pValue = pc;
bRedraw = FALSE;
bAttachProcess = FALSE;
}
CPointList oldPoints;
CPointList newPoints;
dfPoint pt;
// ?????????????????§ß??
int begin, end;
GetDragPoint(c_last, NewPointList, begin, end);
// ???????????????????
POSITION pos = NewPointList.GetHeadPosition();
for (int i = begin; i <= end && pos; i++)
{
dfPoint dp = NewPointList.GetNext(pos);
// ?????????
if (bAttachProcess)
{
pValue->GetPoint(i, pt);
oldPoints.AddTail(pt);
}
// ????????
pValue->x[i] = dp.x0;
pValue->y[i] = dp.y0;
// ?????????
if (bAttachProcess)
{
pValue->GetPoint(i, pt);
newPoints.AddTail(pt);
}
}
if (pValue->bAutoLocation) pValue->GetLocation();
// ??????
if (bAttachProcess)
{
if (oldPoints.GetCount() > 0)
AttachProcess(oldPoints, newPoints);
}
if (pList)
{
pValue->GetPoint(*pList);
delete pValue;
}
}
double CurveEditorCosine::GetPointOffset(double offset)
{
// ????????????????????§³??????????????
offset = 1.0 + cos(PI * offset);
offset *= offset * 0.25;
return offset;
}
void CurveEditorCosine::GetDragPoint(CPoint2D& dp, CPointList& NewPointList, int& begin, int& end)
{
int i = GetHandleIndex();
if (i < 0) return;
NewPointList.RemoveAll();
CCurveEx* pValue = (CCurveEx*)GetDoc()->GetDraw()->GetAtValue(GetPos());
dfPoint cp, t;
double distance, x0, y0, d;
int j;
begin = i;
end = i;
distance = 9; // ??????9????¦Ë
GetXY(pValue, i, cp);
// ????????????????????
for (j = i; j >= 0; j--)
{
GetXY(pValue, j, t);
d = fabs(t.l - cp.l);
begin = j;
if (d >= distance)
{
NewPointList.AddHead(t);
break;
}
// ??????????
x0 = GetPointOffset(d / distance);
y0 = (x0) * (dp.y0 - cp.y0);
x0 = (x0) * (dp.x0 - cp.x0);
t.Offset(x0, y0);
NewPointList.AddHead(t);
}
// ????????????????????????????
for (j = i + 1; j < pValue->num; j++)
{
GetXY(pValue, j, t);
d = fabs(t.l - cp.l);
end = j;
if (d >= distance)
{
NewPointList.AddTail(t);
break;
}
// ??????????
x0 = GetPointOffset(d / distance);
y0 = (x0) * (dp.y0 - cp.y0);
x0 = (x0) * (dp.x0 - cp.x0);
t.Offset(x0, y0);
NewPointList.AddTail(t);
}
}
}; // namespace

@ -0,0 +1,36 @@
#pragma once
#include "CurveEditorBase.h"
namespace NItem
{
/*
* ???????????????????¦??????????
*
* ???????
* 1. ???????????¦??????????????????????????
* 2. ????????????????????????
* 3. ?????????????????Default?????
*/
class CurveEditorCosine : public CurveEditorBase
{
public:
CurveEditorCosine(CSigmaDoc* pDoc)
: CurveEditorBase(pDoc) {}
virtual ~CurveEditorCosine(void) {}
protected:
// ??????????????????????????
void OnDrawDragPreview() override;
// ???????????????????¦¶???????????????
void OnCalculateDragEffect(CPointList* pList) override;
private:
// ???????????????
double GetPointOffset(double offset); // ??????????
void GetDragPoint(CPoint2D& dp, CPointList& NewPointList, int& begin, int& end);
};
};

@ -0,0 +1,151 @@
#include "StdAfx.h"
#include "CurveEditorDefault.h"
#include "SigmaDoc.h"
#include "ActionCurveEdit.h"
namespace NItem
{
void CurveEditorDefault::OnDrawDragPreview()
{
// ========== ??????????????????? ==========
int i = GetHandleIndex();
if (i < 0) return;
CCurveEx* pValue = GetControlCurve();
if (pValue == nullptr || i >= pValue->num)
{
return;
}
CXyDC* pDC = GetDC();
CPen pen(PS_SOLID, 0, DRAG_LINE_COLOR);
CPen* op = (CPen*)m_pScreenDC->SelectObject(&pen);
int od = m_pScreenDC->SetROP2(R2_NOTXORPEN);
double dx = c_last.x0 - c_down.x0;
double dy = c_last.y0 - c_down.y0;
dfPoint pt;
// ????????????????????????
if (i > 0)
{
GetXY(pValue, i - 1, pt);
CPoint ptS1 = pDC->GetScreen(pt);
m_pScreenDC->MoveTo(ptS1);
GetXY(pValue, i, pt);
pt.x0 += dx;
pt.y0 += dy;
CPoint ptS2 = pDC->GetScreen(pt);
m_pScreenDC->LineTo(ptS2.x, ptS2.y);
}
// ?????????????????????????
if (i < pValue->num - 1)
{
GetXY(pValue, i + 1, pt);
CPoint ptS1 = pDC->GetScreen(pt);
m_pScreenDC->MoveTo(ptS1);
GetXY(pValue, i, pt);
pt.x0 += dx;
pt.y0 += dy;
CPoint ptS2 = pDC->GetScreen(pt);
m_pScreenDC->LineTo(ptS2.x, ptS2.y);
}
m_pScreenDC->SetROP2(od);
m_pScreenDC->SelectObject(op);
}
void CurveEditorDefault::OnCalculateDragEffect(CPointList* pList)
{
// pList != nullptr???????????????????????????????????
// pList == nullptr???????????????? Undo/Redo ??????
BOOL bRedraw = TRUE;
BOOL bAttachProcess = TRUE; // ??????????
CCurveEx* pValue = (CCurveEx*)GetDoc()->GetDraw()->GetAtValue(GetPos());
if (pList)
{
// ??????????????????
CCurveEx* pc = new CCurveEx;
*pc = *pValue;
pValue = pc;
bRedraw = FALSE;
bAttachProcess = FALSE;
}
CPointList oldPoints; // ???????????????????????
CPointList newPoints; // ???????????????????????
dfPoint pt;
CRect rt;
// ========== ??????????????????? ==========
int i = GetHandleIndex();
if (bRedraw)
{
// ??????????? GetRangeWidthIndex????????????????
// rt = GetRangeWidthIndex(i);
}
// ??????????????????
if (bAttachProcess)
{
if (i - 1 >= 0)
{
pValue->GetPoint(i - 1, pt); oldPoints.AddTail(pt);
}
pValue->GetPoint(i, pt); oldPoints.AddTail(pt);
if (i + 1 <= pValue->num - 1)
{
pValue->GetPoint(i + 1, pt); oldPoints.AddTail(pt);
}
}
CActionCurveEdit* pAction = 0;
if (pList == nullptr)
{
pAction = new CActionCurveEdit(GetDoc(), 0, GetPos());
pAction->BackupUndoNode(i, pValue->x[i], pValue->y[i]);
}
pValue->x[i] += (c_last.x0 - c_down.x0);
pValue->y[i] += (c_last.y0 - c_down.y0);
if (pValue->bAutoLocation) pValue->GetLocation();
if (pList == nullptr)
{
pAction->BackupRedoNode(i, pValue->x[i], pValue->y[i]);
GetDoc()->SetActionItem(pAction);
}
if (bAttachProcess)
{
// ???????????????????
if (i - 1 >= 0)
{
pValue->GetPoint(i - 1, pt); newPoints.AddTail(pt);
}
pValue->GetPoint(i, pt); newPoints.AddTail(pt);
if (i + 1 <= pValue->num - 1)
{
pValue->GetPoint(i + 1, pt); newPoints.AddTail(pt);
}
AttachProcess(oldPoints, newPoints);
}
if (bRedraw)
{
// rt = GetRangeWidthIndex(i);
}
if (pList)
{
pValue->GetPoint(*pList);
delete pValue;
}
}
}; // namespace

@ -0,0 +1,33 @@
#pragma once
#include "CurveEditorBase.h"
namespace NItem
{
/*
* ???????????????????
*
* ???????
* 1. ???????????????????Śś???
* 2. ???????????ŚĹ???????????????
* 3. ???????????????
*/
class CurveEditorDefault : public CurveEditorBase
{
public:
CurveEditorDefault(CSigmaDoc* pDoc)
: CurveEditorBase(pDoc) {}
virtual ~CurveEditorDefault(void) {}
protected:
// ========== ?????2???????????? ==========
// ??????????????????ڞ?????????????????
void OnDrawDragPreview() override;
// ========== ?????3?????????§š?? ==========
// ???????????????????
void OnCalculateDragEffect(CPointList* pList) override;
};
};

@ -0,0 +1,174 @@
#include "StdAfx.h"
#include "CurveEditorLinear.h"
#include "SigmaDoc.h"
namespace NItem
{
void CurveEditorLinear::OnDrawDragPreview()
{
if (NewPointList.IsEmpty()) return;
CXyDC* pDC = GetDC();
CPen pen(PS_SOLID, 0, DRAG_LINE_COLOR);
CPen* op = m_pScreenDC->SelectObject(&pen);
int od = m_pScreenDC->SetROP2(R2_NOTXORPEN);
dfPoint dp1, dp2;
POSITION pos;
dp1 = NewPointList.GetHead();
pos = NewPointList.GetHeadPosition();
if (pos) NewPointList.GetNext(pos);
while (pos)
{
dp2 = NewPointList.GetNext(pos);
CPoint ptS1 = pDC->GetScreen(dp1);
m_pScreenDC->MoveTo(ptS1);
CPoint ptS2 = pDC->GetScreen(dp2);
m_pScreenDC->LineTo(ptS2);
dp1 = dp2;
}
m_pScreenDC->SetROP2(od);
m_pScreenDC->SelectObject(op);
}
void CurveEditorLinear::OnCalculateDragEffect(CPointList* pList)
{
// ========== ???????????????????¦¶??? ==========
BOOL bRedraw = TRUE;
BOOL bAttachProcess = TRUE;
CCurveEx* pValue = (CCurveEx*)GetDoc()->GetDraw()->GetAtValue(GetPos());
if (pList)
{
CCurveEx* pc = new CCurveEx;
*pc = *pValue;
pValue = pc;
bRedraw = FALSE;
bAttachProcess = FALSE;
}
CPointList oldPoints;
CPointList newPoints;
dfPoint pt;
// ?????????????????§ß??
int begin, end;
GetDragPoint(c_last, NewPointList, begin, end);
// ???????????????????
POSITION pos = NewPointList.GetHeadPosition();
for (int i = begin; i <= end && pos; i++)
{
dfPoint dp = NewPointList.GetNext(pos);
// ?????????
if (bAttachProcess)
{
pValue->GetPoint(i, pt);
oldPoints.AddTail(pt);
}
// ????????
pValue->x[i] = dp.x0;
pValue->y[i] = dp.y0;
// ?????????
if (bAttachProcess)
{
pValue->GetPoint(i, pt);
newPoints.AddTail(pt);
}
}
if (pValue->bAutoLocation) pValue->GetLocation();
// ??????
if (bAttachProcess)
{
if (oldPoints.GetCount() > 0)
AttachProcess(oldPoints, newPoints);
}
if (pList)
{
pValue->GetPoint(*pList);
delete pValue;
}
}
double CurveEditorLinear::GetPointOffset(double offset, int nMode)
{
// ????????????????????§³
switch (nMode)
{
case DRAG_NODE_LINE:
offset = 1.0 - offset; // ???????
break;
case DRAG_NODE_COS:
// ?????????????????????????????????????????
offset = 1.0 + cos(PI * offset);
offset *= offset * 0.25;
break;
}
return offset;
}
void CurveEditorLinear::GetDragPoint(CPoint2D& dp, CPointList& NewPointList, int& begin, int& end)
{
int i = GetHandleIndex();
if (i < 0) return;
NewPointList.RemoveAll();
CCurveEx* pValue = (CCurveEx*)GetDoc()->GetDraw()->GetAtValue(GetPos());
dfPoint cp, t;
double distance, x0, y0, d;
int j;
begin = i;
end = i;
distance = 9; // ??????9????¦Ë
GetXY(pValue, i, cp);
// ????????????????????
for (j = i; j >= 0; j--)
{
GetXY(pValue, j, t);
d = fabs(t.l - cp.l);
begin = j;
if (d >= distance)
{
NewPointList.AddHead(t);
break;
}
// ??????????
x0 = GetPointOffset(d / distance, GetOffsetMode());
y0 = (x0) * (dp.y0 - cp.y0);
x0 = (x0) * (dp.x0 - cp.x0);
t.Offset(x0, y0);
NewPointList.AddHead(t);
}
// ????????????????????????????
for (j = i + 1; j < pValue->num; j++)
{
GetXY(pValue, j, t);
d = fabs(t.l - cp.l);
end = j;
if (d >= distance)
{
NewPointList.AddTail(t);
break;
}
// ??????????
x0 = GetPointOffset(d / distance, GetOffsetMode());
y0 = (x0) * (dp.y0 - cp.y0);
x0 = (x0) * (dp.x0 - cp.x0);
t.Offset(x0, y0);
NewPointList.AddTail(t);
}
}
}; // namespace

@ -0,0 +1,36 @@
#pragma once
#include "CurveEditorBase.h"
namespace NItem
{
/*
* ???????????????????¦???
*
* ???????
* 1. ???????????¦???????????????????9????¦Ë??
* 2. ????????????????????????
* 3. ?????????????????Default?????
*/
class CurveEditorLinear : public CurveEditorBase
{
public:
CurveEditorLinear(CSigmaDoc* pDoc) : CurveEditorBase(pDoc) {}
virtual ~CurveEditorLinear(void) {}
protected:
// ??????????????????????????.
// ??§Õ???? virtual void OnDrawDragPreview()
void OnDrawDragPreview() override;
// ???????????????????¦¶???
void OnCalculateDragEffect(CPointList* pList) override;
private:
// ???????????????
double GetPointOffset(double offset, int nMode);
void GetDragPoint(CPoint2D& dp, CPointList& NewPointList, int& begin,
int& end);
};
}; // namespace NItem

@ -0,0 +1,452 @@
#include "StdAfx.h"
#include "CurveEditorSpline.h"
#include "SigmaDoc.h"
#include "ActionCurveEdit.h"
namespace NItem
{
CurveEditorSpline::~CurveEditorSpline(void)
{
}
void CurveEditorSpline::OnModeInitialize()
{
GetMarkCurve();
}
void CurveEditorSpline::OnDragMove(int nIndex, CPoint2D pt)
{
TRACE("nIndex = %d, %lf, %lf\n", nIndex, pt.x0, pt.y0);
if (m_pControlCurve == nullptr || nIndex < 0 || nIndex >= m_pControlCurve->num)
{
return;
}
CPoint2D realPoint = GetDoc()->GetDC().GetReal(pt);
// ????????????
m_pControlCurve->x[nIndex] = pt.x0;
m_pControlCurve->y[nIndex] = pt.y0;
}
void CurveEditorSpline::DrawAssistant(CDC* pDC, int mouseX, int mouseY)
{
if (m_pControlCurve == nullptr)
{
return;
}
TRACE("num = %d\n", m_pControlCurve->num);
m_handleDrawer->Init(m_pControlCurve.get());
m_handleDrawer->DrawAll(pDC);
}
void CurveEditorSpline::OnDrawDragPreview()
{
if (NewPointList.IsEmpty())
{
return;
}
CXyDC* pDC = GetDC();
CPen pen(PS_SOLID, 0, DRAG_LINE_COLOR);
CPen* op = m_pScreenDC->SelectObject(&pen);
int od = m_pScreenDC->SetROP2(R2_NOTXORPEN);
dfPoint dp1, dp2;
POSITION pos;
dp1 = NewPointList.GetHead();
pos = NewPointList.GetHeadPosition();
if (pos) NewPointList.GetNext(pos);
while (pos)
{
dp2 = NewPointList.GetNext(pos);
CPoint ptS1 = pDC->GetScreen(dp1);
m_pScreenDC->MoveTo(ptS1);
CPoint ptS2 = pDC->GetScreen(dp2);
m_pScreenDC->LineTo(ptS2);
dp1 = dp2;
}
m_pScreenDC->SetROP2(od);
m_pScreenDC->SelectObject(op);
}
void CurveEditorSpline::OnCalculateDragEffect(CPointList* pList)
{
BOOL bRedraw = TRUE;
BOOL bAttachProcess = TRUE;
CCurveEx* pValue = (CCurveEx*)GetDoc()->GetDraw()->GetAtValue(GetPos());
if (pList)
{
CCurveEx* pc = new CCurveEx;
*pc = *pValue;
pValue = pc;
bRedraw = FALSE;
bAttachProcess = FALSE;
}
CPointList oldPoints;
CPointList newPoints;
dfPoint pt;
int i = GetHandleIndex();
if (i < 0 || m_pMarkCurve == nullptr)
{
if (pList)
{
pValue->GetPoint(*pList);
delete pValue;
}
return;
}
int begin, end;
GetDragSplinePoint(c_last, NewPointList, begin, end);
if (bAttachProcess)
{
for (int j = begin; j <= end; j++)
{
pValue->GetPoint(j, pt);
oldPoints.AddTail(pt);
}
}
PointList.RemoveAll();
// 1. ????????????0 ?? begin-1??
for (int j = 0; j < begin; j++)
{
pValue->GetPoint(j, pt);
PointList.AddTail(pt);
}
// 2. ???????????????????<3F>I begin ?? end ??????
POSITION pos = NewPointList.GetHeadPosition();
while (pos)
{
pt = NewPointList.GetNext(pos);
PointList.AddTail(pt);
// ???????????????????
if (bAttachProcess)
newPoints.AddTail(pt);
}
// 3. ????????????? end ?????
// ?????????????¡ê??? end ???????
if (end < pValue->num - 1)
{
for (int j = end; j < pValue->num; j++)
{
pValue->GetPoint(j, pt);
PointList.AddTail(pt);
}
}
if (bRedraw)
Invalidate();
// ???????????????????????
if (pValue->nPoint == 4)
pValue->nPoint = 3;
if (!pValue->bAutoLocation)
pValue->bAutoLocation = TRUE;
// ?<3F>I????????
pValue->SetPoints(PointList, pValue->nPoint, pValue->bAutoLocation);
PointList.RemoveAll();
if (bRedraw && m_pMarkCurve)
{
// ???????????????????????????
int oldMarkCount = m_pMarkCurve->num;
// ????????????????
GetMarkCurve();
Invalidate();
}
// ??????
if (bAttachProcess)
{
if (oldPoints.GetCount() > 0)
AttachProcess(oldPoints, newPoints);
}
if (pList)
{
pValue->GetPoint(*pList);
delete pValue;
}
}
CCurveEx* CurveEditorSpline::GetControlCurve(void)
{
// ???????????§á?????????HitTest??Add??Delete??Draw???????????????????
return m_pControlCurve ? m_pControlCurve.get() : nullptr;
}
int CurveEditorSpline::AddHandle(double l0)
{
// ?????????????????????????????????????
CCurveEx* pValue = (CCurveEx*)GetDoc()->GetDraw()->GetAtValue(GetPos());
if (pValue == nullptr || m_pMarkCurve == nullptr)
{
return -1;
}
dfPoint add;
add.l = l0;
pValue->GetCoordinate(add.l, add.x0, add.y0, add.z0); // ??????????????
// ?????????????m_pMarkCurve??
return CurveEditorBase::AddHandle(m_pMarkCurve.get(), add);
}
void CurveEditorSpline::GetMarkCurve()
{
// ?????????????????????????????????
if (GetPos() == nullptr)
{
return;
}
// ??1?????????????
COne* pOne = GetDoc()->GetDraw()->GetAt(GetPos());
CCurveEx* pOriginalCurve = (CCurveEx*)pOne->GetValue();
if (!m_pMarkCurve)
m_pMarkCurve = std::make_unique<CCurveEx>();
int oldHandleCount = m_pMarkCurve->num;
// ??2?????????????????????????
CCurveRedundant redundant;
redundant.SetCurve(*pOriginalCurve);
double baseErr = GetDC()->GetMiniSmoothStep() * 3;
double errorThreshold = baseErr;
// ??3??????????????????
bool isFirstGeneration = (oldHandleCount == 0);
if (isFirstGeneration)
{
// ?????????????????????
redundant.Execute(errorThreshold);
redundant.GetRedundantCurve(*m_pMarkCurve);
}
else
{
// ?????????????????????????????????
// 3.1 ?????????????????
redundant.Execute(errorThreshold);
CCurveEx tempCurve;
redundant.GetRedundantCurve(tempCurve);
// 3.2 ?????????????????????
double maxGrowthRatio = 1.2; // ????20%??????
bool isTooManyHandles = (tempCurve.num > oldHandleCount * maxGrowthRatio);
if (isTooManyHandles)
{
// 3.3 ??????????????????????????
double actualGrowthRatio = (double)tempCurve.num / oldHandleCount;
errorThreshold = baseErr * actualGrowthRatio;
// 3.4 ????????????????
redundant.Execute(errorThreshold);
redundant.GetRedundantCurve(*m_pMarkCurve);
TRACE("???????????????????????? %d ?? %d (??????? %d)\n",
oldHandleCount, m_pMarkCurve->num, tempCurve.num);
}
else
{
// 3.5 ??????????¦¶?????????
*m_pMarkCurve = tempCurve;
}
}
// ??4????????????????????
m_pMarkCurve->nPoint = 4;
m_pMarkCurve->bAutoLocation = FALSE;
if (m_pControlCurve == nullptr)
{
m_pControlCurve = std::make_unique<CCurveEx>();
*m_pControlCurve = *m_pMarkCurve;
}
}
void CurveEditorSpline::GetDragSplinePoint(CPoint2D& dp, CPointList& NewPointList, int& begin, int& end)
{
// ????????????????????????????????§Ò?????¦¶
int handleIndex = GetHandleIndex();
if (handleIndex < 0 || m_pMarkCurve == nullptr)
{
return;
}
CCurveEx* pOriginalCurve = (CCurveEx*)GetDoc()->GetDraw()->GetAtValue(GetPos());
if (pOriginalCurve == nullptr)
{
return;
}
// ??1???????????????????¦¶??????????????? - ????? - ?????????????
int prevHandleIndex = max(0, handleIndex - 1);
int nextHandleIndex = min(m_pControlCurve->num -1, handleIndex + 1);
// ??2??????????????????????????????
// ??????????????<3F>I???????????????????<3F>I?????¦Ë???begin ?? end ???????????????????¦Ë??
begin = GetOriginalIndex(prevHandleIndex);
end = GetOriginalIndex(nextHandleIndex);
// ??3?????????????????§Þ?????
// ?????????????§Þ???????????????????
// ???? begin ?? end ?????????????????????????????
pOriginalCurve->GetLocation(); // ??????????????????
int currentOriginalIndex = GetOriginalIndex(handleIndex);
double lBegin = pOriginalCurve->l[begin]; // ??????????????
double lEnd = pOriginalCurve->l[end]; // ??????????????
double lCurrent = pOriginalCurve->l[currentOriginalIndex]; // ?????????????????????????
const double SMOOTH_FACTOR = 0.001; // ????????0.1%
lBegin += (lCurrent - lBegin) * SMOOTH_FACTOR;
lEnd -= (lEnd - lCurrent) * SMOOTH_FACTOR;
// ??4??????????????????????§Ò?
NewPointList.RemoveAll();
bool isFirstHandle = (handleIndex == 0);
bool isLastHandle = (handleIndex == m_pControlCurve->num - 1);
if (isFirstHandle)
{
BuildFirstHandlePoints(dp, lEnd, nextHandleIndex, NewPointList);
}
else if (isLastHandle)
{
BuildLastHandlePoints(dp, lBegin, prevHandleIndex, NewPointList);
}
else
{
BuildMiddleHandlePoints(dp, lBegin, lEnd, prevHandleIndex, nextHandleIndex, NewPointList);
}
// ??5?????????????????????????????????§Ò?
CCurveEx splineCurve;
splineCurve.SetPoints(NewPointList, 2);
NewPointList.RemoveAll();
double splineStep = GetDC()->GetMiniSmoothStep() * 3;
splineCurve.CurveToSpline(NewPointList, splineStep, 0);
}
void CurveEditorSpline::BuildFirstHandlePoints(const CPoint2D& dp, double lEnd, int nextHandleIndex, CPointList& list)
{
// ??????3???????????????? + ????? + ??????????
dfPoint draggedPoint;
draggedPoint.x0 = dp.x0;
draggedPoint.y0 = dp.y0;
list.AddTail(draggedPoint);
CCurveEx* pOriginalCurve = (CCurveEx*)GetDoc()->GetDraw()->GetAtValue(GetPos());
pOriginalCurve->GetCoordinate(lEnd, draggedPoint.x0, draggedPoint.y0, draggedPoint.z0);
list.AddTail(draggedPoint);
draggedPoint.x0 = m_pControlCurve->x[nextHandleIndex];
draggedPoint.y0 = m_pControlCurve->y[nextHandleIndex];
list.AddTail(draggedPoint);
}
void CurveEditorSpline::BuildLastHandlePoints(const CPoint2D& dp, double lBegin, int prveHandleInex, CPointList& list)
{
dfPoint draggedPoint;
CCurveEx* pOriginalCurve = (CCurveEx*)GetDoc()->GetDraw()->GetAtValue(GetPos());
// 1. ????????????
draggedPoint.x0 = m_pControlCurve->x[prveHandleInex]; draggedPoint.y0 = m_pControlCurve->y[prveHandleInex];
list.AddTail(draggedPoint);
// 2. ???????????
pOriginalCurve->GetCoordinate(lBegin, draggedPoint.x0, draggedPoint.y0, draggedPoint.z0);
list.AddTail(draggedPoint);
// 3. ?????????
draggedPoint.x0 = dp.x0; draggedPoint.y0 = dp.y0;
list.AddTail(draggedPoint);
}
void CurveEditorSpline::BuildMiddleHandlePoints(const CPoint2D& dp, double lBegin, double lEnd, int prveHandleIndex, int nextHandleIndex, CPointList& list)
{
dfPoint draggedPoint;
CCurveEx* pOriginalCurve = (CCurveEx*)GetDoc()->GetDraw()->GetAtValue(GetPos());
// 1. ??????
draggedPoint.x0 = m_pControlCurve->x[prveHandleIndex];
draggedPoint.y0 = m_pControlCurve->y[prveHandleIndex];
list.AddTail(draggedPoint);
// 2. ??????
pOriginalCurve->GetCoordinate(lBegin, draggedPoint.x0, draggedPoint.y0, draggedPoint.z0);
list.AddTail(draggedPoint);
// 3. ????????????
draggedPoint.x0 = dp.x0; draggedPoint.y0 = dp.y0;
list.AddTail(draggedPoint);
// 4. ??????
pOriginalCurve->GetCoordinate(lEnd, draggedPoint.x0, draggedPoint.y0, draggedPoint.z0);
list.AddTail(draggedPoint);
// 5. ??????
draggedPoint.x0 = m_pControlCurve->x[nextHandleIndex];
draggedPoint.y0 = m_pControlCurve->y[nextHandleIndex];
list.AddTail(draggedPoint);
}
int CurveEditorSpline::GetOriginalIndex(int handleIndex)
{
CCurveEx* pOriginalCurve = (CCurveEx*)GetDoc()->GetDraw()->GetAtValue(GetPos());
assert(pOriginalCurve != nullptr);
// 1. ??»_??????? handleIndex ?????
int clampedIndex = std::clamp(handleIndex, 0, m_pControlCurve->num - 1);
// 2. ????????????????????????????????????????????????????
if (clampedIndex == 0)
{
return 0;
}
if (clampedIndex == m_pControlCurve->num - 1)
{
return pOriginalCurve->num - 1;
}
// 3. ?§Þ????????????
return pOriginalCurve->FindIndex(
m_pControlCurve->x[clampedIndex],
m_pControlCurve->y[clampedIndex],
-1
);
}
}; // namespace

@ -0,0 +1,65 @@
#pragma once
#include "CurveEditorBase.h"
#include <memory>
namespace NItem {
/*
* ????????????????????????????
*
*/
class CurveEditorSpline : public CurveEditorBase {
public:
CurveEditorSpline(CSigmaDoc *pDoc)
: CurveEditorBase(pDoc), m_pMarkCurve(nullptr)
{
}
virtual ~CurveEditorSpline(void);
protected:
// ????????????????????????
void OnDrawDragPreview() override;
// ????????????????????????
void OnCalculateDragEffect(CPointList *pList) override;
void OnModeInitialize() override; // ???? m_pMarkCurve
void OnDragMove(int nIndex,
CPoint2D pt) override; // ???? m_pControlCurve ?§á????¦Ë??
void DrawAssistant(CDC *pDC, int mouseX, int mouseY) override;
CCurveEx *GetControlCurve(void) override;
// ??§Õ???? virtual int AddHandle(double l0)
int AddHandle(double l0) override;
private:
// ?????????§Ö?????????????
std::unique_ptr<CCurveEx> m_pMarkCurve;
std::unique_ptr<CCurveEx> m_pControlCurve;
// ???????????????
void GetMarkCurve(); // ????????????
void GetDragSplinePoint(CPoint2D &dp, CPointList &NewPointList, int &begin,
int &end);
/**
* ??????????????????????
*
* \param handleInex ?????????
* \return ???????????????
*/
int GetOriginalIndex(int handleInex);
void BuildFirstHandlePoints(const CPoint2D &dp, double lEnd,
int nextHandleInex, CPointList &list);
void BuildLastHandlePoints(const CPoint2D &dp, double lBegin,
int prevHandleInex, CPointList &list);
void BuildMiddleHandlePoints(const CPoint2D &dp, double lBegin, double lEnd,
int prevHandleInex, int nextHandleIndex,
CPointList &list);
};
}; // namespace NItem

File diff suppressed because it is too large Load Diff

@ -667,6 +667,21 @@
<ClCompile Include="InterfaceFavorableArea.cpp"> <ClCompile Include="InterfaceFavorableArea.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="CurveEditorBase.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="CurveEditorCosine.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="CurveEditorDefault.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="CurveEditorLinear.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="CurveEditorSpline.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="UndoManager\Action.H"> <ClInclude Include="UndoManager\Action.H">
@ -1215,6 +1230,21 @@
<ClInclude Include="WellAndSection\ItemViewWellPole.h"> <ClInclude Include="WellAndSection\ItemViewWellPole.h">
<Filter>Header Files\WellAndSection</Filter> <Filter>Header Files\WellAndSection</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="CurveEditorBase.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="CurveEditorCosine.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="CurveEditorDefault.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="CurveEditorLinear.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="CurveEditorSpline.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="GeoSigmaDraw.def"> <None Include="GeoSigmaDraw.def">

@ -3865,12 +3865,32 @@ extern "C" __declspec(dllexport)
void* GetKevFirstMesh(CSigmaView *pView) void* GetKevFirstMesh(CSigmaView *pView)
{ {
CXy* pXy = pView->m_pDoc->m_pXy; CXy* pXy = pView->m_pDoc->m_pXy;
POSITION pt = pXy->FindFirstElement(DOUBLEFOX_MESH); NBase::CPositionList positionList;
if (pt == nullptr) // 获取所有网格对象,包括不可编辑的元素
pXy->GetElement(DOUBLEFOX_MESH, positionList, true);
POSITION posCurrent = positionList.GetHeadPosition();
POSITION posFirstFind = nullptr;
while (posCurrent != NULL)
{
// 步骤 3: 使用 GetNext 获取当前迭代器位置的元素,并让迭代器步进到下一个位置
// 注意:这里 GetNext 返回的是链表存储的 POSITION 元素,其参数 posCurrent 会被自动更新
POSITION posElement = positionList.GetNext(posCurrent);
COne* tempOne = pXy->GetAt(posElement);
CLayer* layer = tempOne->GetLayer();
BYTE state = layer->GetState();
if (state != 12)
{
posFirstFind = posElement;
break;
}
}
//直接找第一个元素,可能找到的是非编辑不可见元素
//POSITION posFirstFind = pXy->FindFirstElement(DOUBLEFOX_MESH);
if (posFirstFind == nullptr)
{ {
return nullptr; return nullptr;
} }
COne* pOne = pXy->GetAt(pt); COne* pOne = pXy->GetAt(posFirstFind);
CString layerStr = pOne->GetLayerName(); CString layerStr = pOne->GetLayerName();
CMesh* pMesh = (CMesh*)pOne->GetValue(); CMesh* pMesh = (CMesh*)pOne->GetValue();
@ -4134,7 +4154,7 @@ void PreProcessMeshData(CSigmaView *pView, void *pKevMeshData, const char *fault
} }
extern "C" __declspec(dllexport) extern "C" __declspec(dllexport)
void* GetLayerData(CSigmaView *pView, LPCTSTR layerName, bool bFaultLayer, bool bBoundaryLayer, bool bWellLayer) void* GetLayerData(CSigmaView *pView, LPCTSTR layerName, bool bBoundaryLayer, bool bFaultLayer, bool bWellLayer)
{ {
KevVtkDataNode *pData = new KevVtkDataNode(); KevVtkDataNode *pData = new KevVtkDataNode();
pData->m_layerName = layerName; pData->m_layerName = layerName;
@ -4202,6 +4222,7 @@ void* GetLayerData(CSigmaView *pView, LPCTSTR layerName, bool bFaultLayer, bool
{ {
if (pCurve->IsClosed()) if (pCurve->IsClosed())
{ {
pData->m_closedBoundaryVtkCurveList.push_back(pKevVtkCurve);
pData->m_closedBoundaryList.push_back(pCurve); pData->m_closedBoundaryList.push_back(pCurve);
} }
} }
@ -4532,24 +4553,55 @@ static NBase::CRect8 GetIntersectRect8(const NBase::CRect8& r1, const NBase::CRe
return CRect8(0, 0, 0, 0); return CRect8(0, 0, 0, 0);
} }
static bool IsRectInside(const NBase::CRect8& r1, const NBase::CRect8& r2)
{
// 检查 r1 是否有效(可选,防止 r1 本身就是错误的矩形)
if (r1.left > r1.right || r1.top < r1.bottom)
{
return false;
}
// 包含判断逻辑 (Y轴向上坐标系)
// r1 的左边界 >= r2 的左边界
// r1 的右边界 <= r2 的右边界
// r1 的下边界 >= r2 的下边界 (因为是Y轴向上内部的底边应该比外部的底边高)
// r1 的上边界 <= r2 的上边界 (因为是Y轴向上内部的顶边应该比外部的顶边低)
if (r1.left >= r2.left &&
r1.right <= r2.right &&
r1.bottom >= r2.bottom &&
r1.top <= r2.top)
{
return true;
}
return false;
}
typedef void(__stdcall* MapDownloadProgressCallback)(int done, int total);
/** /**
* Ìí¼ÓµØÍ¼ *
* *
* \param zoom * \param zoom
* \param urlStr * \param urlStr
* \param borderLayer * \param borderLayer
* \param dirPath * \param dirPath
* \param strPath * \param strPath
* \return * \return MapViewLayer
*/ */
#include <thread>
#include <future>
#include <memory>
static std::future<bool> g_future; // 保存任务结果
static std::shared_ptr<MapViewLayer> g_maplayer; // 全局保存,防止销毁
extern "C" __declspec(dllexport) extern "C" __declspec(dllexport)
bool AddSigmaViewItemMapView(CSigmaView* pView, int zoom, const wchar_t* urlStr, const wchar_t* borderLayer, MapViewLayer * DownloadSigmaViewItemMapView(CSigmaView* pView, int zoom, const wchar_t* urlStr, const wchar_t* borderLayer,
const wchar_t* dirPath, const wchar_t* strPath) const wchar_t* dirPath, const wchar_t* strPath, int type, MapDownloadProgressCallback progressCallback)
{ {
if (pView == nullptr || pView->m_pDoc == nullptr) if (pView == nullptr || pView->m_pDoc == nullptr)
{ {
TRACE("pView 和 pView->m_pDoc 不能为 nullptr\n"); TRACE("pView 和 pView->m_pDoc 不能为 nullptr\n");
return false; return nullptr;
} }
CString mapUrl = CString(urlStr); CString mapUrl = CString(urlStr);
@ -4598,21 +4650,143 @@ bool AddSigmaViewItemMapView(CSigmaView* pView, int zoom, const wchar_t* urlStr,
} }
rect = GetIntersectRect8(rect, rect1); rect = GetIntersectRect8(rect, rect1);
MapViewLayer maplayer; bool isGaodeTarget = false;
if (!maplayer.MapProjection(pXyCurrent, rect)) if (type == 1)
{
//gcj02
isGaodeTarget = true;
}
g_maplayer = std::make_shared<MapViewLayer>();
if (!g_maplayer->MapProjection(pXyCurrent, rect, isGaodeTarget))
return nullptr;
// 异步执行下载任务
g_future = std::async(std::launch::async, [=]() {
return g_maplayer->SaveTDTMapCroppedParallel(
zoom,
mapUrl,
mapImageDir,
imagePath,
12,
progressCallback
);
});
return g_maplayer.get();
}
extern "C" __declspec(dllexport)
bool IsSigmaViewMapView(CSigmaView* pView, const wchar_t* borderLayer)
{
if (pView == nullptr || pView->m_pDoc == nullptr)
{ {
TRACE("pView 和 pView->m_pDoc 不能为 nullptr\n");
return false; return false;
} }
if (!maplayer.SaveTDTMapCroppedParallel(zoom, CXy* pXyCurrent = pView->m_pDoc->GetDraw();
mapUrl,
mapImageDir, //显示窗口范围
imagePath, CRect8 rect1;
8)) CRect r1 = pView->GetClientRect();
rect1 = pView->m_pDoc->m_xyDC.GetReal(r1);
NBase::CRect8 rect(1e100, -1e100, -1e100, 1e100);
CString strLayer = CString(borderLayer);
if (!strLayer.IsEmpty())
{
CPositionList list;
if (pXyCurrent->GetElement(strLayer, list) > 0)
{
for (POSITION pos = list.GetHeadPosition(); pos != NULL; list.GetNext(pos))
{
POSITION pt = list.GetAt(pos);
COne* pOne = pXyCurrent->GetAt(pt);
if (pOne->GetType() == DOUBLEFOX_CURVE)
{
pOne->GetRange(rect);
break;
}
}
}
}
if (strLayer.IsEmpty() || (rect.left == 1e100))
{ {
CMesh* pMesh = GetMesh(pView);
if (pMesh != nullptr)
{
rect = pMesh->GetRect();
}
else
{
rect = pXyCurrent->m_range;
}
}
return IsRectInside(rect, rect1);
}
/**
*
*
* \param borderLayer
* \param strPath
* \return
*/
extern "C" __declspec(dllexport)
bool AddSigmaViewItemMapImage(CSigmaView* pView, const wchar_t* borderLayer,
const wchar_t* strPath)
{
if (pView == nullptr || pView->m_pDoc == nullptr)
{
TRACE("pView 和 pView->m_pDoc 不能为 nullptr\n");
return false; return false;
} }
CString imagePath = CString(strPath);
CXy* pXyCurrent = pView->m_pDoc->GetDraw();
//显示窗口范围
CRect8 rect1;
CRect r1 = pView->GetClientRect();
rect1 = pView->m_pDoc->m_xyDC.GetReal(r1);
NBase::CRect8 rect(1e100, -1e100, -1e100, 1e100);
CString strLayer = CString(borderLayer);
if (!strLayer.IsEmpty())
{
CPositionList list;
if (pXyCurrent->GetElement(strLayer, list) > 0)
{
for (POSITION pos = list.GetHeadPosition(); pos != NULL; list.GetNext(pos))
{
POSITION pt = list.GetAt(pos);
COne* pOne = pXyCurrent->GetAt(pt);
if (pOne->GetType() == DOUBLEFOX_CURVE)
{
pOne->GetRange(rect);
break;
}
}
}
}
if (strLayer.IsEmpty() || (rect.left == 1e100))
{
CMesh* pMesh = GetMesh(pView);
if (pMesh != nullptr)
{
rect = pMesh->GetRect();
}
else
{
rect = pXyCurrent->m_range;
}
}
rect = GetIntersectRect8(rect, rect1);
//处理完成后 将图片插入 //处理完成后 将图片插入
CImageInsert* pImage = new CImageInsert(); CImageInsert* pImage = new CImageInsert();
if (!pImage->LoadImage(imagePath)) if (!pImage->LoadImage(imagePath))
@ -4626,6 +4800,23 @@ bool AddSigmaViewItemMapView(CSigmaView* pView, int zoom, const wchar_t* urlStr,
CLayer* pLayer = pXyCurrent->FindAddLayer("卫星地图"); CLayer* pLayer = pXyCurrent->FindAddLayer("卫星地图");
pOne->SetLayer(pLayer); pOne->SetLayer(pLayer);
//最下显示
pXyCurrent->MoveToBack(pos);
return true; return true;
} }
/**
*
*
* \param borderLayer
* \param strPath
* \return
*/
extern "C" __declspec(dllexport)
void StopDownloadMaplayer(MapViewLayer *pMap)
{
if (pMap == nullptr)
return;
pMap->StopTask();
}

@ -46,7 +46,8 @@ bool XyCreateFaultStatistic(CXy* pXy, LPCTSTR statisticFile,
{ {
pt = lstFault.GetNext(pos); pt = lstFault.GetNext(pos);
pOne = pXy->GetAt(pt); pOne = pXy->GetAt(pt);
if (pOne->GetType() != DOUBLEFOX_CURVE) continue; if (pOne->GetType() != DOUBLEFOX_CURVE)
continue;
pCurve = (CCurveEx*)pOne->GetValue(); pCurve = (CCurveEx*)pOne->GetValue();
GPline* pc = new GPline(); GPline* pc = new GPline();

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save