Initial working version Face Centerline

This commit is contained in:
wandererfan
2019-05-25 19:56:58 -04:00
committed by WandererFan
parent 58ebf3cbd2
commit 656e1654ff
20 changed files with 2026 additions and 22 deletions

430
CMakeLists.txt.user Normal file
View File

@@ -0,0 +1,430 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.5.2, 2019-05-26T13:34:38. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
<value type="QByteArray">{2bb8d980-59c2-4103-9ad9-f84df3b67da6}</value>
</data>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
<value type="int">0</value>
</data>
<data>
<variable>ProjectExplorer.Project.EditorSettings</variable>
<valuemap type="QVariantMap">
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
<value type="QString" key="language">Cpp</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
</valuemap>
</valuemap>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
<value type="QString" key="language">QmlJS</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
</valuemap>
</valuemap>
<value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
<value type="int" key="EditorConfiguration.IndentSize">4</value>
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
<value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value>
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
<value type="int" key="EditorConfiguration.TabSize">8</value>
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.PluginSettings</variable>
<valuemap type="QVariantMap"/>
</data>
<data>
<variable>ProjectExplorer.Project.Target.0</variable>
<valuemap type="QVariantMap">
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{6576b0bd-ff13-47bd-97c2-c8159848c669}</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">3</value>
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<valuelist type="QVariantList" key="CMake.Configuration"/>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/huxster/Target/freecad-qtc-build</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">all</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">CMake Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">all</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">CMake Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Default</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Default</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
<valuelist type="QVariantList" key="CMake.Configuration">
<value type="QString">CMAKE_BUILD_TYPE:STRING=Debug</value>
</valuelist>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/huxster/Source/build-FreeCAD-src-Desktop-Debug</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">all</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">CMake Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">all</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">CMake Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
<valuelist type="QVariantList" key="CMake.Configuration">
<value type="QString">CMAKE_BUILD_TYPE:STRING=Release</value>
</valuelist>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/huxster/Source/build-FreeCAD-src-Desktop-Release</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">all</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">CMake Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">all</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">CMake Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Release</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.3">
<valuelist type="QVariantList" key="CMake.Configuration">
<value type="QString">CMAKE_BUILD_TYPE:STRING=debug</value>
<value type="QString">CMAKE_CXX_COMPILER:FILEPATH=/usr/bin/c++</value>
<value type="QString">CMAKE_C_COMPILER:FILEPATH=/usr/bin/cc</value>
</valuelist>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/huxster/Target/freecad-qtc-build</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments">jobs=3</value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">all</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">CMake Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">all</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">CMake Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release with Debug Information</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Release with Debug Information</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.4">
<valuelist type="QVariantList" key="CMake.Configuration">
<value type="QString">CMAKE_BUILD_TYPE:STRING=MinSizeRel</value>
</valuelist>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/huxster/Source/build-FreeCAD-src-Desktop-Minimum Size Release</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">all</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">CMake Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">all</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">CMake Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Minimum Size Release</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Minimum Size Release</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">5</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy locally</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
<value type="bool" key="Analyzer.QmlProfiler.AggregateTraces">false</value>
<value type="bool" key="Analyzer.QmlProfiler.FlushEnabled">false</value>
<value type="uint" key="Analyzer.QmlProfiler.FlushInterval">1000</value>
<value type="QString" key="Analyzer.QmlProfiler.LastTraceFile"></value>
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
<value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
<value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
<value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
<value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
<value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
<value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
<value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
<value type="int">0</value>
<value type="int">1</value>
<value type="int">2</value>
<value type="int">3</value>
<value type="int">4</value>
<value type="int">5</value>
<value type="int">6</value>
<value type="int">7</value>
<value type="int">8</value>
<value type="int">9</value>
<value type="int">10</value>
<value type="int">11</value>
<value type="int">12</value>
<value type="int">13</value>
<value type="int">14</value>
</valuelist>
<value type="QString" key="CMakeProjectManager.CMakeRunConfiguation.Title">FreeCADMainCmd</value>
<value type="QString" key="CMakeProjectManager.CMakeRunConfiguration.Arguments"></value>
<value type="QString" key="CMakeProjectManager.CMakeRunConfiguration.UserWorkingDirectory"></value>
<value type="QString" key="CMakeProjectManager.CMakeRunConfiguration.UserWorkingDirectory.default">/home/huxster/Target/freecad-qtc-build/bin</value>
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">FreeCADMainCmd</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeRunConfiguration.FreeCADMainCmd</value>
<value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
<value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.1">
<value type="bool" key="Analyzer.QmlProfiler.AggregateTraces">false</value>
<value type="bool" key="Analyzer.QmlProfiler.FlushEnabled">false</value>
<value type="uint" key="Analyzer.QmlProfiler.FlushInterval">1000</value>
<value type="QString" key="Analyzer.QmlProfiler.LastTraceFile"></value>
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
<value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
<value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
<value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
<value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
<value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
<value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
<value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
<value type="int">0</value>
<value type="int">1</value>
<value type="int">2</value>
<value type="int">3</value>
<value type="int">4</value>
<value type="int">5</value>
<value type="int">6</value>
<value type="int">7</value>
<value type="int">8</value>
<value type="int">9</value>
<value type="int">10</value>
<value type="int">11</value>
<value type="int">12</value>
<value type="int">13</value>
<value type="int">14</value>
</valuelist>
<value type="QString" key="CMakeProjectManager.CMakeRunConfiguation.Title">FreeCADMain</value>
<value type="QString" key="CMakeProjectManager.CMakeRunConfiguration.Arguments"></value>
<value type="QString" key="CMakeProjectManager.CMakeRunConfiguration.UserWorkingDirectory"></value>
<value type="QString" key="CMakeProjectManager.CMakeRunConfiguration.UserWorkingDirectory.default">/home/huxster/Target/freecad-qtc-build/bin</value>
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">FreeCADMain</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeRunConfiguration.FreeCADMain</value>
<value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
<value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">2</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.TargetCount</variable>
<value type="int">1</value>
</data>
<data>
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
<value type="int">18</value>
</data>
<data>
<variable>Version</variable>
<value type="int">18</value>
</data>
</qtcreator>

View File

@@ -42,6 +42,7 @@
#include "Cosmetic.h"
using namespace TechDraw;
using namespace TechDrawGeometry;
CosmeticVertex::CosmeticVertex()
{
@@ -147,9 +148,15 @@ void CosmeticVertex::dump(char* title)
//******************************************
//note this ctor has no occEdge or first/last point for geometry!
CosmeticEdge::CosmeticEdge()
{
geometry = new TechDrawGeometry::BaseGeom();
geometry->geomType = GENERIC;
geometry->classOfEdge = ecHARD;
geometry->visible = true;
geometry->cosmetic = true;
linkGeom = -1;
color = getDefEdgeColor();
width = getDefEdgeWidth();
@@ -163,6 +170,11 @@ CosmeticEdge::CosmeticEdge(Base::Vector3d p1, Base::Vector3d p2)
gp_Pnt gp2(p2.x,p2.y,p2.z);
TopoDS_Edge e = BRepBuilderAPI_MakeEdge(gp1, gp2);
geometry = TechDrawGeometry::BaseGeom::baseFactory(e);
geometry->geomType = GENERIC;
geometry->classOfEdge = ecHARD;
geometry->visible = true;
geometry->cosmetic = true;
linkGeom = -1;
color = getDefEdgeColor();
width = getDefEdgeWidth();
@@ -173,6 +185,11 @@ CosmeticEdge::CosmeticEdge(Base::Vector3d p1, Base::Vector3d p2)
CosmeticEdge::CosmeticEdge(TopoDS_Edge e)
{
geometry = TechDrawGeometry::BaseGeom::baseFactory(e);
geometry->geomType = GENERIC;
geometry->classOfEdge = ecHARD;
geometry->visible = true;
geometry->cosmetic = true;
linkGeom = -1;
color = getDefEdgeColor();
width = getDefEdgeWidth();
@@ -259,6 +276,17 @@ bool CosmeticEdge::fromCSV(std::string& lineSpec)
width = atof(values[8].c_str());
style = atoi(values[9].c_str());
visible = atoi(values[10].c_str());
//dupl of ctor(p1,p2)
gp_Pnt gp1(start.x,start.y,start.z);
gp_Pnt gp2(end.x,end.y,end.z);
TopoDS_Edge e = BRepBuilderAPI_MakeEdge(gp1, gp2);
geometry = TechDrawGeometry::BaseGeom::baseFactory(e);
geometry->geomType = GENERIC;
geometry->classOfEdge = ecHARD;
geometry->visible = true;
geometry->cosmetic = true;
return true;
}

View File

@@ -72,6 +72,8 @@ public:
TechDrawGeometry::BaseGeom* geometry;
Base::Vector3d start;
Base::Vector3d end;
int linkGeom; //connection to corresponding "real" Edge
App::Color color;
double width;

View File

@@ -151,6 +151,7 @@ DrawViewPart::DrawViewPart(void) :
ADD_PROPERTY_TYPE(IsoCount ,(0),sgroup,App::Prop_None,"Number of isoparameters");
ADD_PROPERTY_TYPE(CosmeticVertexList ,(""),sgroup,App::Prop_None,"CosmeticVertex Save/Restore");
ADD_PROPERTY_TYPE(CosmeticEdgeList ,(""),sgroup,App::Prop_None,"CosmeticEdge Save/Restore");
geometryObject = nullptr;
getRunControl();
@@ -293,6 +294,7 @@ App::DocumentObjectExecReturn *DrawViewPart::execute(void)
//this is ghastly! but no convenient method for "object ready"
if (on1) {
rebuildCosmoVertex();
rebuildCosmoEdge();
on1 = false;
}
@@ -341,11 +343,6 @@ App::DocumentObjectExecReturn *DrawViewPart::execute(void)
Rotation.getValue());
}
geometryObject = buildGeometryObject(mirroredShape,viewAxis);
//add back the cosmetic vertices
for (auto& v: cosmoVertex) {
int idx = geometryObject->addRandomVertex(v->pageLocation * getScale());
v->linkGeom = idx;
}
#if MOD_TECHDRAW_HANDLE_FACES
auto start = chrono::high_resolution_clock::now();
@@ -358,6 +355,19 @@ App::DocumentObjectExecReturn *DrawViewPart::execute(void)
return new App::DocumentObjectExecReturn(e4.GetMessageString());
}
}
//add back the cosmetic vertices
for (auto& v: cosmoVertex) {
int idx = geometryObject->addRandomVertex(v->pageLocation * getScale());
v->linkGeom = idx;
}
//add back the cosmetic Edges
for (auto& e: cosmoEdge) {
int idx = geometryObject->addRandomEdge(e->geometry);
e->linkGeom = idx;
}
auto end = chrono::high_resolution_clock::now();
auto diff = end - start;
double diffOut = chrono::duration <double, milli> (diff).count();
@@ -698,18 +708,18 @@ TechDrawGeometry::Vertex* DrawViewPart::getProjVertexByIndex(int idx) const
return geoms.at(idx);
}
//this is never used!!
//! returns existing geometry of 2D Face(idx)
//version 1 Face has 1 wire
std::vector<TechDrawGeometry::BaseGeom*> DrawViewPart::getProjFaceByIndex(int idx) const
std::vector<TechDrawGeometry::BaseGeom*> DrawViewPart::getFaceEdgesByIndex(int idx) const
{
(void) idx;
std::vector<TechDrawGeometry::BaseGeom*> result;
const std::vector<TechDrawGeometry::Face *>& faces = getFaceGeometry();
for (auto& f:faces) {
for (auto& w:f->wires) {
if (idx < (int) faces.size()) {
TechDrawGeometry::Face* projFace = faces.at(idx);
for (auto& w: projFace->wires) {
for (auto& g:w->geoms) {
if (g->cosmetic) {
Base::Console().Message("DVP::getFaceEdgesByIndex - found cosmetic edge\n");
}
result.push_back(g);
}
}
@@ -907,11 +917,30 @@ void DrawViewPart::rebuildCosmoVertex(void)
}
}
//build cosmoEdge from CosmeticEdgeList
void DrawViewPart::rebuildCosmoEdge(void)
{
// Base::Console().Message("DVP::rebuildCosmoEdge()\n");
cosmoEdge.clear();
std::vector<std::string> restoreEdges = CosmeticEdgeList.getValues();
for (auto& re: restoreEdges) {
if (!re.empty()) {
CosmeticEdge* ce = new CosmeticEdge();
bool rc = ce->fromCSV(re);
if (rc) {
cosmoEdge.push_back(ce);
} else {
delete ce;
}
}
}
}
//! remove features that are useless without this DVP
//! hatches, geomhatches, dimensions,...
void DrawViewPart::unsetupObject()
{
Base::Console().Message("DVP::unsetupObject()\n");
// Base::Console().Message("DVP::unsetupObject()\n");
nowUnsetting = true;
App::Document* doc = getDocument();
std::string docName = doc->getName();
@@ -1038,6 +1067,98 @@ void DrawViewPart::clearCV(void)
CosmeticVertexList.setValues(noVerts);
}
// adds a cosmetic edge to cosmoEdge and CosmeticEdgeList
int DrawViewPart::addRandomEdge(Base::Vector3d p1, Base::Vector3d p2)
{
// Base::Console().Message("DVP::addRandomEdge(%s, %s)\n",
// DrawUtil::formatVector(p1).c_str(),
// DrawUtil::formatVector(p2).c_str());
int newIdx = -1;
TechDraw::CosmeticEdge* rEdge = new TechDraw::CosmeticEdge(p1, p2);
cosmoEdge.push_back(rEdge);
//stuff stringList
std::vector<std::string> saveEdges;
const std::vector<TechDraw::CosmeticEdge*> cosEdges = getCosmeticEdge();
for (auto& ce: cosEdges) {
std::string csv = ce->toCSV();
saveEdges.push_back(csv);
}
CosmeticEdgeList.setValues(saveEdges);
return newIdx;
}
int DrawViewPart::addRandomEdge(TopoDS_Edge e)
{
// Base::Console().Message("DVP::addRandomEdge(TopoDS_Edge)\n");
int newIdx = -1;
TechDraw::CosmeticEdge* rEdge = new TechDraw::CosmeticEdge(e);
cosmoEdge.push_back(rEdge);
//stuff stringList
std::vector<std::string> saveEdges;
const std::vector<TechDraw::CosmeticEdge*> cosEdges = getCosmeticEdge();
for (auto& ce: cosEdges) {
std::string csv = ce->toCSV();
saveEdges.push_back(csv);
}
CosmeticEdgeList.setValues(saveEdges);
return newIdx;
}
int DrawViewPart::addRandomEdge(CosmeticEdge* ce)
{
// Base::Console().Message("DVP::addRandomEdge(CosmeticEdge)\n");
int newIdx = -1;
cosmoEdge.push_back(ce);
//stuff stringList
std::vector<std::string> saveEdges;
const std::vector<TechDraw::CosmeticEdge*> cosEdges = getCosmeticEdge();
for (auto& ce: cosEdges) {
std::string csv = ce->toCSV();
saveEdges.push_back(csv);
}
CosmeticEdgeList.setValues(saveEdges);
return newIdx;
}
TechDraw::CosmeticEdge* DrawViewPart::getCosmeticEdgeByIndex(int idx) const
{
// Base::Console().Message("DVP::getCosmeticEdgeByIndex(%d)\n", idx);
int cosmoOffset = 1000;
int realIdx = idx - cosmoOffset;
CosmeticEdge* result = nullptr;
const std::vector<TechDraw::CosmeticEdge*> edges = getCosmeticEdge();
if ((unsigned) realIdx < edges.size()) {
result = edges.at(realIdx);
}
return result;
}
//find the cosmetic edge corresponding to geometry edge idx
TechDraw::CosmeticEdge* DrawViewPart::getCosmeticEdgeByLink(int idx) const
{
// Base::Console().Message("DVP::getCosmeticEdgeByLinkIndex(%d)\n", idx);
CosmeticEdge* result = nullptr;
const std::vector<TechDraw::CosmeticEdge*> edges = getCosmeticEdge();
for (auto& ce: edges) {
if (ce->linkGeom == idx) {
result = ce;
break;
}
}
return result;
}
void DrawViewPart::clearCE(void)
{
// Base::Console().Message("DVP::clearCE()\n");
cosmoEdge.clear();
std::vector<std::string> noEdges;
CosmeticEdgeList.setValues(noEdges);
}
PyObject *DrawViewPart::getPyObject(void)
{
if (PythonObject.is(Py::_None())) {

View File

@@ -69,6 +69,7 @@ class DrawViewSection;
class DrawViewDetail;
class DrawViewBalloon;
class CosmeticVertex;
class CosmeticEdge;
}
namespace TechDraw
@@ -103,6 +104,7 @@ public:
App::PropertyInteger IsoCount;
App::PropertyStringList CosmeticVertexList;
App::PropertyStringList CosmeticEdgeList;
std::vector<TechDraw::DrawHatch*> getHatches(void) const;
std::vector<TechDraw::DrawGeomHatch*> getGeomHatches(void) const;
@@ -121,7 +123,7 @@ public:
TechDrawGeometry::BaseGeom* getProjEdgeByIndex(int idx) const; //get existing geom for edge idx in projection
TechDrawGeometry::Vertex* getProjVertexByIndex(int idx) const; //get existing geom for vertex idx in projection
std::vector<TechDrawGeometry::BaseGeom*> getProjFaceByIndex(int idx) const; //get edges for face idx in projection
std::vector<TechDrawGeometry::BaseGeom*> getFaceEdgesByIndex(int idx) const; //get edges for face idx in projection
virtual Base::BoundBox3d getBoundingBox() const;
double getBoxX(void) const;
@@ -171,6 +173,14 @@ public:
TechDraw::CosmeticVertex* getCosmeticVertexByLink(int idx) const;
void clearCV(void);
virtual int addRandomEdge(Base::Vector3d start, Base::Vector3d end);
virtual int addRandomEdge(TopoDS_Edge e);
virtual int addRandomEdge(TechDraw::CosmeticEdge*);
const std::vector<TechDraw::CosmeticEdge*> & getCosmeticEdge(void) const { return cosmoEdge; }
TechDraw::CosmeticEdge* getCosmeticEdgeByIndex(int idx) const;
TechDraw::CosmeticEdge* getCosmeticEdgeByLink(int idx) const;
void clearCE(void);
protected:
TechDrawGeometry::GeometryObject *geometryObject;
Base::BoundBox3d bbox;
@@ -196,6 +206,9 @@ protected:
std::vector<TechDraw::CosmeticVertex*> cosmoVertex;
void rebuildCosmoVertex(void);
std::vector<TechDraw::CosmeticEdge*> cosmoEdge;
void rebuildCosmoEdge(void);
private:
bool nowUnsetting;
bool on1;

View File

@@ -116,7 +116,8 @@ BaseGeom::BaseGeom() :
classOfEdge(ecNONE),
visible(true),
reversed(false),
ref3D(-1) //obs?
ref3D(-1), //obs?
cosmetic(false)
{
}

View File

@@ -73,6 +73,7 @@ class TechDrawExport BaseGeom
bool reversed;
int ref3D; //obs?
TopoDS_Edge occEdge; //projected Edge
bool cosmetic;
std::vector<Base::Vector2d> findEndPoints();
Base::Vector2d getStartPoint();

View File

@@ -481,6 +481,15 @@ int GeometryObject::addRandomVertex(Base::Vector3d pos)
return idx;
}
int GeometryObject::addRandomEdge(TechDrawGeometry::BaseGeom* base)
{
// Base::Console().Message("GO::addRandomEdge() - cosmetic: %d\n", base->cosmetic);
edgeGeom.push_back(base);
int idx = edgeGeom.size() - 1;
return idx;
}
//! empty Face geometry
void GeometryObject::clearFaceGeom()
{

View File

@@ -41,6 +41,8 @@ namespace TechDraw
class DrawViewPart;
class DrawViewDetail;
class DrawView;
class CosmeticVertex;
class CosmeticEdge;
}
namespace TechDrawGeometry
@@ -126,7 +128,7 @@ public:
TopoDS_Shape getHidIso(void) { return hidIso; }
int addRandomVertex(Base::Vector3d pos);
int addRandomEdge(TechDrawGeometry::BaseGeom* bg);
protected:
//HLR output

View File

@@ -42,6 +42,7 @@ set(TechDrawGui_MOC_HDRS
TaskLeaderLine.h
TaskRichAnno.h
TaskCosVertex.h
TaskCenterLine.h
QGEPath.h
QGTracker.h
QGILeaderLine.h
@@ -74,6 +75,7 @@ set(TechDrawGui_UIC_SRCS
mrichtextedit.ui
TaskBalloon.ui
TaskCosVertex.ui
TaskCenterLine.ui
)
if(BUILD_QT5)
@@ -143,6 +145,9 @@ SET(TechDrawGui_SRCS
TaskCosVertex.ui
TaskCosVertex.cpp
TaskCosVertex.h
TaskCenterLine.ui
TaskCenterLine.cpp
TaskCenterLine.h
DrawGuiUtil.cpp
DrawGuiUtil.h
Rez.cpp
@@ -294,6 +299,7 @@ SET(TechDrawGuiTaskDlgs_SRCS
TaskCosVertex.ui
mrichtextedit.ui
TaskBalloon.ui
TaskCenterLine.ui
)
SOURCE_GROUP("TaskDialogs" FILES ${TechDrawGuiTaskDlgs_SRCS})

View File

@@ -58,6 +58,7 @@
#include "TaskLeaderLine.h"
#include "TaskRichAnno.h"
#include "TaskCosVertex.h"
#include "TaskCenterLine.h"
#include "ViewProviderPage.h"
using namespace TechDrawGui;
@@ -582,6 +583,83 @@ bool CmdTechDrawAnnotation::isActive(void)
return DrawGuiUtil::needPage(this);
}
//===========================================================================
// TechDraw_Centerline
//===========================================================================
DEF_STD_CMD_A(CmdTechDrawCenterLine);
CmdTechDrawCenterLine::CmdTechDrawCenterLine()
: Command("TechDraw_CenterLine")
{
sAppModule = "TechDraw";
sGroup = QT_TR_NOOP("TechDraw");
sMenuText = QT_TR_NOOP("Add a centerline to a Face");
sToolTipText = QT_TR_NOOP("Add a centerline to a Face");
sWhatsThis = "TechDraw_CenterLine";
sStatusTip = sToolTipText;
sPixmap = "actions/techdraw-centerline";
}
void CmdTechDrawCenterLine::activated(int iMsg)
{
Q_UNUSED(iMsg);
Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog();
if (dlg != nullptr) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Task In Progress"),
QObject::tr("Close active task dialog and try again."));
return;
}
TechDraw::DrawPage* page = DrawGuiUtil::findPage(this);
if (!page) {
return;
}
std::vector<Gui::SelectionObject> selection = getSelection().getSelectionEx();
TechDraw::DrawViewPart* baseFeat = nullptr;
if (!selection.empty()) {
baseFeat = dynamic_cast<TechDraw::DrawViewPart *>(selection[0].getObject());
if( baseFeat == nullptr ) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Selection Error"),
QObject::tr("No base View in Selection."));
return;
}
} else {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Selection Error"),
QObject::tr("You must select a base View for the line."));
return;
}
std::vector<std::string> SubNames;
std::vector<Gui::SelectionObject>::iterator itSel = selection.begin();
for (; itSel != selection.end(); itSel++) {
if ((*itSel).getObject()->isDerivedFrom(TechDraw::DrawViewPart::getClassTypeId())) {
baseFeat = static_cast<TechDraw::DrawViewPart*> ((*itSel).getObject());
SubNames = (*itSel).getSubNames();
}
}
if (SubNames.empty()) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Selection Error"),
QObject::tr("You must select a Face for the center line."));
return;
}
Gui::Control().showDialog(new TaskDlgCenterLine(baseFeat,
page,
SubNames));
}
bool CmdTechDrawCenterLine::isActive(void)
{
bool havePage = DrawGuiUtil::needPage(this);
bool haveView = DrawGuiUtil::needView(this, false);
return (havePage && haveView);
}
void CreateTechDrawCommandsAnnotate(void)
{
Gui::CommandManager &rcCmdMgr = Gui::Application::Instance->commandManager();
@@ -593,6 +671,7 @@ void CreateTechDrawCommandsAnnotate(void)
rcCmdMgr.addCommand(new CmdTechDrawMidpoints());
rcCmdMgr.addCommand(new CmdTechDrawQuadrant());
rcCmdMgr.addCommand(new CmdTechDrawAnnotation());
rcCmdMgr.addCommand(new CmdTechDrawCenterLine());
}
//===========================================================================

View File

@@ -213,6 +213,12 @@ void QGIPrimPath::setStyle(Qt::PenStyle s)
m_styleCurrent = s;
}
void QGIPrimPath::setStyle(int s)
{
m_styleCurrent = (Qt::PenStyle) s;
}
void QGIPrimPath::setNormalColor(QColor c)
{
m_colNormal = c;

View File

@@ -55,6 +55,7 @@ public:
virtual double getWidth() { return m_width;}
Qt::PenStyle getStyle() { return m_styleCurrent; }
void setStyle(Qt::PenStyle s);
void setStyle(int s);
virtual void setNormalColor(QColor c);
protected:

View File

@@ -441,10 +441,20 @@ void QGIViewPart::drawViewPart()
}
if (showEdge) {
item = new QGIEdge(i);
addToGroup(item); //item is at scene(0,0), not group(0,0)
item->setPos(0.0,0.0); //now at group(0,0)
item->setPath(drawPainterPath(*itEdge));
item->setWidth(lineWidth);
if ((*itEdge)->cosmetic == true) {
TechDraw::CosmeticEdge* ce = viewPart->getCosmeticEdgeByLink(i);
if (ce != nullptr) {
item->setNormalColor(ce->color.asValue<QColor>());
item->setWidth(ce->width * lineScaleFactor);
// item->setStyle((Qt::PenStyle)ce->style);
item->setStyle(ce->style);
}
}
addToGroup(item); //item is at scene(0,0), not group(0,0)
item->setPos(0.0,0.0); //now at group(0,0)
item->setPath(drawPainterPath(*itEdge));
// item->setWidth(lineWidth);
item->setZValue(ZVALUE::EDGE);
if(!(*itEdge)->visible) {
item->setWidth(lineWidthHid);
@@ -1057,7 +1067,6 @@ QRectF QGIViewPart::boundingRect() const
// return customChildrenBoundingRect();
return QGIView::boundingRect();
}
void QGIViewPart::paint ( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget) {
QStyleOptionGraphicsItem myOption(*option);
myOption.state &= ~QStyle::State_Selected;
@@ -1067,7 +1076,6 @@ void QGIViewPart::paint ( QPainter * painter, const QStyleOptionGraphicsItem * o
QGIView::paint (painter, &myOption, widget);
}
//QGIViewPart derived classes do not need a rotate view method as rotation is handled on App side.
void QGIViewPart::rotateView(void)
{

View File

@@ -66,6 +66,7 @@
<file>icons/actions/techdraw-point.svg</file>
<file>icons/actions/techdraw-midpoint.svg</file>
<file>icons/actions/techdraw-quadrant.svg</file>
<file>icons/actions/techdraw-centerline.svg</file>
<file>icons/actions/section-up.svg</file>
<file>icons/actions/section-down.svg</file>
<file>icons/actions/section-left.svg</file>
@@ -143,4 +144,4 @@
<file>translations/TechDraw_ar.qm</file>
<file>translations/TechDraw_vi.qm</file>
</qresource>
</RCC>
</RCC>

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -0,0 +1,486 @@
/***************************************************************************
* Copyright (c) 2019 Wandererfan <wandererfan@gmail.com *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
#include <cmath>
#include <BRepBndLib.hxx>
#include <Bnd_Box.hxx>
#endif // #ifndef _PreComp_
#include <QStatusBar>
#include <QGraphicsScene>
#include <Base/Console.h>
#include <Base/Tools.h>
#include <Gui/Application.h>
#include <Gui/BitmapFactory.h>
#include <Gui/Command.h>
#include <Gui/Control.h>
#include <Gui/Document.h>
#include <Gui/MainWindow.h>
#include <Gui/Selection.h>
#include <Gui/ViewProvider.h>
#include <Gui/WaitCursor.h>
#include <Mod/TechDraw/App/DrawPage.h>
#include <Mod/TechDraw/App/DrawUtil.h>
#include <Mod/TechDraw/App/DrawView.h>
#include <Mod/TechDraw/App/DrawViewPart.h>
#include <Mod/TechDraw/App/Geometry.h>
#include <Mod/TechDraw/App/Cosmetic.h>
#include <Mod/TechDraw/Gui/ui_TaskCenterLine.h>
#include "DrawGuiStd.h"
#include "QGVPage.h"
#include "QGIView.h"
#include "QGIPrimPath.h"
#include "MDIViewPage.h"
#include "ViewProviderPage.h"
#include "ViewProviderViewPart.h"
#include "Rez.h"
#include "TaskCenterLine.h"
using namespace Gui;
using namespace TechDraw;
using namespace TechDrawGui;
//ctor for edit
//TaskCenterLine::TaskCenterLine(TechDrawGui::ViewProviderViewPart* partVP) :
// ui(new Ui_TaskCenterLine),
// m_partVP(partVp),
// m_partFeat(nullptr),
// m_basePage(nullptr),
// m_createMode(false),
// m_inProgressLock(false)
//{
// if (m_partVP == nullptr) {
// //should be caught in CMD caller
// Base::Console().Error("TaskCenterLine - bad parameters. Can not proceed.\n");
// return;
// }
// ui->setupUi(this);
//
// m_partFeat = m_partVP->getFeature();
// m_basePage = m_partFeat->findParentPage();
// //TODO: when/if leaders are allowed to be parented to Page, check for m_partFeat will be removed
// if ( (m_partFeat == nullptr) ||
// (m_basePage == nullptr) ) {
// Base::Console().Error("TaskCenterLine - bad parameters (2). Can not proceed.\n");
// return;
// }
// //m_subNames = m_partFeat->get?????();
// setUiEdit();
//// m_mdi = m_partVP->getMDIViewPage();
//// m_scene = m_mdi->m_scene;
//// m_view = m_mdi->getQGVPage();
//// connect(ui->pbTracker, SIGNAL(clicked(bool)),
//// this, SLOT(onTrackerClicked(bool)));
//// connect(ui->pbCancelEdit, SIGNAL(clicked(bool)),
//// this, SLOT(onCancelEditClicked(bool)));
//// ui->pbCancelEdit->setEnabled(false);
// saveState();
//}
//ctor for creation
TaskCenterLine::TaskCenterLine(TechDraw::DrawViewPart* partFeat,
TechDraw::DrawPage* page,
std::vector<std::string> subNames) :
ui(new Ui_TaskCenterLine),
m_partVP(nullptr),
m_partFeat(partFeat),
m_basePage(page),
m_createMode(true),
m_subNames(subNames)
{
if ( (m_basePage == nullptr) ||
(m_partFeat == nullptr) ) {
//should be caught in CMD caller
Base::Console().Error("TaskCenterLine - bad parameters. Can not proceed.\n");
return;
}
ui->setupUi(this);
Gui::Document* activeGui = Gui::Application::Instance->getDocument(m_basePage->getDocument());
Gui::ViewProvider* vp = activeGui->getViewProvider(m_basePage);
ViewProviderPage* vpp = static_cast<ViewProviderPage*>(vp);
m_mdi = vpp->getMDIViewPage();
m_scene = m_mdi->m_scene;
m_view = m_mdi->getQGVPage();
setUiPrimary();
// connect(ui->pbTracker, SIGNAL(clicked(bool)),
// this, SLOT(onTrackerClicked(bool)));
// connect(ui->pbCancelEdit, SIGNAL(clicked(bool)),
// this, SLOT(onCancelEditClicked(bool)));
}
TaskCenterLine::~TaskCenterLine()
{
delete ui;
}
void TaskCenterLine::saveState()
{
if (m_partFeat != nullptr) {
}
}
void TaskCenterLine::restoreState()
{
if (m_partFeat != nullptr) {
}
}
void TaskCenterLine::updateTask()
{
// blockUpdate = true;
// blockUpdate = false;
}
void TaskCenterLine::changeEvent(QEvent *e)
{
if (e->type() == QEvent::LanguageChange) {
ui->retranslateUi(this);
}
}
void TaskCenterLine::setUiPrimary()
{
// Base::Console().Message("TCL::setUiPrimary()\n");
// enableVPUi(false);
setWindowTitle(QObject::tr("New Center Line"));
if (m_partFeat != nullptr) {
std::string baseName = m_partFeat->getNameInDocument();
ui->leBaseView->setText(Base::Tools::fromStdString(baseName));
for (auto& s: m_subNames) {
QString listItem = Base::Tools::fromStdString(s);
ui->lstSubList->addItem(listItem);
}
}
ui->cpLineColor->setColor(getCenterColor());
ui->dsbWeight->setValue(getCenterWidth());
ui->cboxStyle->setCurrentIndex(getCenterStyle());
ui->qsbExtend->setValue(getExtendBy());
}
//void TaskCenterLine::enableVPUi(bool b)
//{
//}
//void TaskCenterLine::setUiEdit()
//{
//// Base::Console().Message("TCL::setUiEdit()\n");
// enableVPUi(true);
// setWindowTitle(QObject::tr("Edit Center Line"));
//}
void TaskCenterLine::addCenterLine(void)
{
// TechDraw::CosmeticEdge* ce = new TechDrawCosmeticEdge();
}
//******************************************************************************
void TaskCenterLine::createCenterLine(void)
{
// Base::Console().Message("TCL::createCenterLine()\n");
Gui::Command::openCommand("Create CenterLine");
bool vertical = false;
if (ui->rbVertical->isChecked()) {
vertical = true;
}
m_extendBy = ui->qsbExtend->rawValue();
//TODO: (if m_partFeat->getGeomTypeFromName(m_subNames.at(0)) == "Face") {
TechDraw::CosmeticEdge* ce = makeMidLine(m_subNames.at(0),vertical,m_extendBy);
m_partFeat->addRandomEdge(ce);
m_partFeat->requestPaint();
Gui::Command::updateActive();
Gui::Command::commitCommand();
}
void TaskCenterLine::updateCenterLine(void)
{
// Base::Console().Message("TCL::updateCenterLine()\n");
Gui::Command::openCommand("Edit CenterLine");
Gui::Command::updateActive();
Gui::Command::commitCommand();
}
void TaskCenterLine::removeCenterLine(void)
{
// Base::Console().Message("TCL::removeCenterLine()\n");
if (m_partFeat != nullptr) {
if (m_createMode) {
//don't know!
} else {
if (Gui::Command::hasPendingCommand()) {
std::vector<std::string> undos = Gui::Application::Instance->activeDocument()->getUndoVector();
Gui::Application::Instance->activeDocument()->undo(1);
} else {
Base::Console().Log("TaskCenterLine: Edit mode - NO command is active\n");
}
}
}
}
QGIView* TaskCenterLine::findParentQGIV()
{
QGIView* result = nullptr;
if (m_partFeat != nullptr) {
Gui::ViewProvider* gvp = QGIView::getViewProvider(m_partFeat);
ViewProviderDrawingView* vpdv = dynamic_cast<ViewProviderDrawingView*>(gvp);
if (vpdv != nullptr) {
result = vpdv->getQView();
}
}
return result;
}
void TaskCenterLine::saveButtons(QPushButton* btnOK,
QPushButton* btnCancel)
{
m_btnOK = btnOK;
m_btnCancel = btnCancel;
}
void TaskCenterLine::enableTaskButtons(bool b)
{
m_btnOK->setEnabled(b);
m_btnCancel->setEnabled(b);
}
TechDraw::CosmeticEdge* TaskCenterLine::makeMidLine(std::string faceName, bool vert, double ext)
{
// Base::Console().Message("TCL::makeMidLine(%s, %d) \n",faceName.c_str(), vert);
TechDraw::CosmeticEdge* result = nullptr;
double scale = m_partFeat->getScale();
Base::Vector3d p1, p2;
int idx = TechDraw::DrawUtil::getIndexFromName(faceName);
std::vector<TechDrawGeometry::BaseGeom*> faceEdges =
m_partFeat->getFaceEdgesByIndex(idx);
Bnd_Box faceBox;
faceBox.SetGap(0.0);
for (auto& fe: faceEdges) {
if (!fe->cosmetic) {
BRepBndLib::Add(fe->occEdge, faceBox);
}
}
double Xmin,Ymin,Zmin,Xmax,Ymax,Zmax;
faceBox.Get(Xmin,Ymin,Zmin,Xmax,Ymax,Zmax);
double Xspan = fabs(Xmax - Xmin);
Xspan = (Xspan / 2.0) + (ext * scale);
double Xmid = Xmin + fabs(Xmax - Xmin) / 2.0;
double Yspan = fabs(Ymax - Ymin);
Yspan = (Yspan / 2.0) + (ext * scale);
double Ymid = Ymin + fabs(Ymax - Ymin) / 2.0;
Base::Vector3d bbxCenter(Xmid, Ymid, 0.0);
if (vert) {
Base::Vector3d top(Xmid, Ymid - Yspan, 0.0);
Base::Vector3d bottom(Xmid, Ymid + Yspan, 0.0);
p1 = top;
p2 = bottom;
} else {
Base::Vector3d left(Xmid - Xspan, Ymid, 0.0);
Base::Vector3d right(Xmid + Xspan, Ymid, 0.0);
p1 = left;
p2 = right;
}
result = new TechDraw::CosmeticEdge(p1,p2);
App::Color ac;
ac.setValue<QColor>(ui->cpLineColor->color());
result->color = ac;
result->width = ui->dsbWeight->value();
result->style = ui->cboxStyle->currentIndex();
result->visible = true;
return result;
}
double TaskCenterLine::getCenterWidth()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter().GetGroup("BaseApp")->
GetGroup("Preferences")->GetGroup("Mod/TechDraw/Decorations");
std::string lgName = hGrp->GetASCII("LineGroup","FC 0.70mm");
auto lg = TechDraw::LineGroup::lineGroupFactory(lgName);
double width = lg->getWeight("Graphic");
delete lg;
return width;
}
Qt::PenStyle TaskCenterLine::getCenterStyle()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter().GetGroup("BaseApp")->
GetGroup("Preferences")->GetGroup("Mod/TechDraw/Decorations");
Qt::PenStyle centerStyle = static_cast<Qt::PenStyle> (hGrp->GetInt("CenterLine", 2));
return centerStyle;
}
QColor TaskCenterLine::getCenterColor()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Decorations");
App::Color fcColor = App::Color((uint32_t) hGrp->GetUnsigned("CenterColor", 0x00000000));
return fcColor.asValue<QColor>();
}
double TaskCenterLine::getExtendBy(void)
{
return 3.0;
}
//******************************************************************************
bool TaskCenterLine::accept()
{
// Base::Console().Message("TCL::accept()\n");
Gui::Document* doc = Gui::Application::Instance->getDocument(m_basePage->getDocument());
if (!doc) return false;
if (!getCreateMode()) {
//
} else {
createCenterLine();
}
// m_mdi->setContextMenuPolicy(m_saveContextPolicy);
Gui::Command::doCommand(Gui::Command::Gui,"Gui.ActiveDocument.resetEdit()");
return true;
}
bool TaskCenterLine::reject()
{
if (m_inProgressLock) {
// Base::Console().Message("TCL::reject - edit in progress!!\n");
return false;
}
Gui::Document* doc = Gui::Application::Instance->getDocument(m_basePage->getDocument());
if (!doc) return false;
if (m_mdi != nullptr) {
// m_mdi->setContextMenuPolicy(m_saveContextPolicy);
}
if (getCreateMode() &&
(m_partFeat != nullptr) ) {
//
}
if (!getCreateMode() &&
(m_partFeat != nullptr) ) {
//
}
//make sure any dangling objects are cleaned up
Gui::Command::doCommand(Gui::Command::Gui,"App.activeDocument().recompute()");
Gui::Command::doCommand(Gui::Command::Gui,"Gui.ActiveDocument.resetEdit()");
return false;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
TaskDlgCenterLine::TaskDlgCenterLine(TechDraw::DrawViewPart* partFeat,
TechDraw::DrawPage* page,
std::vector<std::string> subNames)
: TaskDialog()
{
widget = new TaskCenterLine(partFeat,page,subNames);
taskbox = new Gui::TaskView::TaskBox(Gui::BitmapFactory().pixmap("actions/techdraw-centerline"),
widget->windowTitle(), true, 0);
taskbox->groupLayout()->addWidget(widget);
Content.push_back(taskbox);
}
//TaskDlgCenterLine::TaskDlgCenterLine(TechDrawGui::ViewProviderViewPart* partVP)
// : TaskDialog()
//{
// widget = new TaskCenterLine(partVP);
// taskbox = new Gui::TaskView::TaskBox(Gui::BitmapFactory().pixmap("actions/techdraw-centerline"),
// widget->windowTitle(), true, 0);
// taskbox->groupLayout()->addWidget(widget);
// Content.push_back(taskbox);
//}
TaskDlgCenterLine::~TaskDlgCenterLine()
{
}
void TaskDlgCenterLine::update()
{
// widget->updateTask();
}
void TaskDlgCenterLine::modifyStandardButtons(QDialogButtonBox* box)
{
QPushButton* btnOK = box->button(QDialogButtonBox::Ok);
QPushButton* btnCancel = box->button(QDialogButtonBox::Cancel);
widget->saveButtons(btnOK, btnCancel);
}
//==== calls from the TaskView ===============================================================
void TaskDlgCenterLine::open()
{
}
void TaskDlgCenterLine::clicked(int)
{
}
bool TaskDlgCenterLine::accept()
{
widget->accept();
return true;
}
bool TaskDlgCenterLine::reject()
{
widget->reject();
return true;
}
#include <Mod/TechDraw/Gui/moc_TaskCenterLine.cpp>

View File

@@ -0,0 +1,181 @@
/***************************************************************************
* Copyright (c) 2019 WandererFan <wandererfan@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#ifndef TECHDRAWGUI_TASKCENTERLINE_H
#define TECHDRAWGUI_TASKCENTERLINE_H
#include <App/DocumentObject.h>
#include <Base/Vector3D.h>
#include <Gui/TaskView/TaskView.h>
#include <Gui/TaskView/TaskDialog.h>
/*#include <Mod/TechDraw/Gui/ui_TaskCenterLine.h>*/
/*#include "QGTracker.h"*/
//TODO: make this a proper enum
#define TRACKERPICK 0
#define TRACKEREDIT 1
#define TRACKERCANCEL 2
#define TRACKERCANCELEDIT 3
#define TRACKERFINISHED 4
#define TRACKERSAVE 5
class Ui_TaskCenterLine;
namespace App {
class DocumentObject;
}
namespace TechDraw
{
class DrawPage;
class DrawView;
class DrawViewPart;
}
namespace TechDrawGeometry
{
class Face;
}
namespace TechDrawGui
{
class QGVPage;
class QGIView;
class QGIPrimPath;
class MDIViewPage;
class ViewProviderViewPart;
class TaskCenterLine : public QWidget
{
Q_OBJECT
public:
TaskCenterLine(TechDraw::DrawViewPart* baseFeat,
TechDraw::DrawPage* page,
std::vector<std::string> subNames);
/* TaskCenterLine(TechDrawGui::ViewProviderViewPart* partVP);*/
~TaskCenterLine();
public Q_SLOTS:
public:
virtual bool accept();
virtual bool reject();
virtual void setCreateMode(bool b) { m_createMode = b; }
virtual bool getCreateMode(void) { return m_createMode; }
void updateTask();
void saveButtons(QPushButton* btnOK,
QPushButton* btnCancel);
void enableTaskButtons(bool b);
protected Q_SLOTS:
protected:
void changeEvent(QEvent *e);
void blockButtons(bool b);
void setUiPrimary(void);
/* void setUiEdit(void);*/
/* void enableVPUi(bool b);*/
/* void setEditCursor(QCursor c);*/
void addCenterLine(void);
void createCenterLine(void);
QGIView* findParentQGIV();
void updateCenterLine(void);
void removeCenterLine(void);
TechDraw::CosmeticEdge* makeMidLine(std::string subName, bool vert, double ext);
void saveState(void);
void restoreState(void);
double getCenterWidth();
QColor getCenterColor();
Qt::PenStyle getCenterStyle();
double getExtendBy();
private:
Ui_TaskCenterLine * ui;
bool blockUpdate;
MDIViewPage* m_mdi;
QGraphicsScene* m_scene;
QGVPage* m_view;
ViewProviderViewPart* m_partVP;
TechDraw::DrawViewPart* m_partFeat;
TechDraw::DrawPage* m_basePage;
bool m_createMode;
Qt::ContextMenuPolicy m_saveContextPolicy;
bool m_inProgressLock;
QPushButton* m_btnOK;
QPushButton* m_btnCancel;
std::vector<std::string> m_subNames;
double m_extendBy;
};
class TaskDlgCenterLine : public Gui::TaskView::TaskDialog
{
Q_OBJECT
public:
TaskDlgCenterLine(TechDraw::DrawViewPart* baseFeat,
TechDraw::DrawPage* page,
std::vector<std::string> subNames);
/* TaskDlgCenterLine(TechDrawGui::ViewProviderLeader* partVP);*/
~TaskDlgCenterLine();
public:
/// is called the TaskView when the dialog is opened
virtual void open();
/// is called by the framework if an button is clicked which has no accept or reject role
virtual void clicked(int);
/// is called by the framework if the dialog is accepted (Ok)
virtual bool accept();
/// is called by the framework if the dialog is rejected (Cancel)
virtual bool reject();
/// is called by the framework if the user presses the help button
virtual void helpRequested() { return;}
virtual bool isAllowedAlterDocument(void) const
{ return false; }
void update();
void modifyStandardButtons(QDialogButtonBox* box);
protected:
private:
TaskCenterLine * widget;
Gui::TaskView::TaskBox* taskbox;
};
} //namespace TechDrawGui
#endif // #ifndef TECHDRAWGUI_TASKCENTERLINE_H

View File

@@ -0,0 +1,277 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>TechDrawGui::TaskCenterLine</class>
<widget class="QWidget" name="TechDrawGui::TaskCenterLine">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>409</width>
<height>405</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>250</width>
<height>0</height>
</size>
</property>
<property name="windowTitle">
<string>Center Line</string>
</property>
<property name="windowIcon">
<iconset resource="Resources/TechDraw.qrc">
<normaloff>:/icons/actions/techdraw-centerline.svg</normaloff>:/icons/actions/techdraw-centerline.svg</iconset>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QFrame" name="frame">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="1">
<widget class="QLineEdit" name="leBaseView">
<property name="enabled">
<bool>false</bool>
</property>
<property name="mouseTracking">
<bool>false</bool>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="acceptDrops">
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Base View</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Elements</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QListWidget" name="lstSubList">
<property name="enabled">
<bool>false</bool>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>100</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QRadioButton" name="rbVertical">
<property name="text">
<string>Vertical</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QRadioButton" name="rbHorizontal">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Horizontal</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QRadioButton" name="rbAligned">
<property name="text">
<string>Aligned</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property>
<item row="2" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Color</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="Gui::ColorButton" name="cpLineColor">
<property name="color">
<color>
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Weight</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QDoubleSpinBox" name="dsbWeight">
<property name="singleStep">
<double>0.100000000000000</double>
</property>
<property name="value">
<double>0.500000000000000</double>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Style</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QComboBox" name="cboxStyle">
<property name="currentIndex">
<number>1</number>
</property>
<item>
<property name="text">
<string>NoLine</string>
</property>
</item>
<item>
<property name="text">
<string>Solid</string>
</property>
</item>
<item>
<property name="text">
<string>Dash</string>
</property>
</item>
<item>
<property name="text">
<string>Dot</string>
</property>
</item>
<item>
<property name="text">
<string>DashDot</string>
</property>
</item>
<item>
<property name="text">
<string>DashDotDot</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Extend By</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="Gui::QuantitySpinBox" name="qsbExtend">
<property name="toolTip">
<string>Make the line a little longer.</string>
</property>
<property name="unit" stdset="0">
<string>mm</string>
</property>
<property name="value">
<double>3.000000000000000</double>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>Gui::QuantitySpinBox</class>
<extends>QWidget</extends>
<header>Gui/QuantitySpinBox.h</header>
</customwidget>
<customwidget>
<class>Gui::ColorButton</class>
<extends>QPushButton</extends>
<header>Gui/Widgets.h</header>
</customwidget>
</customwidgets>
<resources>
<include location="Resources/TechDraw.qrc"/>
</resources>
<connections/>
</ui>

View File

@@ -156,6 +156,7 @@ Gui::ToolBarItem* Workbench::setupToolBars() const
*anno << "TechDraw_LeaderLine";
*anno << "TechDraw_RichAnno";
*anno << "TechDraw_CosmeticVertexGrp";
*anno << "TechDraw_CenterLine";
// *anno << "TechDraw_CosmeticVertex";
// *anno << "TechDraw_Midpoints";
// *anno << "TechDraw_Quadrant";
@@ -223,6 +224,7 @@ Gui::ToolBarItem* Workbench::setupCommandBars() const
*anno << "TechDraw_LeaderLine";
*anno << "TechDraw_RichAnno";
*anno << "TechDraw_CosmeticVertexGrp";
*anno << "TechDraw_CenterLine";
// *anno << "TechDraw_CosmeticVertex";
// *anno << "TechDraw_Midpoints";
// *anno << "TechDraw_Quadrant";