hxx il y a 3 ans
commit
8849d76519
13 fichiers modifiés avec 1576 ajouts et 0 suppressions
  1. 88 0
      ADI_ACIS.pro
  2. 328 0
      ADI_ACIS.pro.user
  3. 35 0
      WebsocketServer.h
  4. 60 0
      app.cpp
  5. 27 0
      app.h
  6. 350 0
      appmodel.cpp
  7. 51 0
      appmodel.h
  8. 336 0
      appselectionset.cpp
  9. 40 0
      appselectionset.h
  10. 90 0
      appview.cpp
  11. 29 0
      appview.h
  12. 16 0
      main.cpp
  13. 126 0
      websocketserver.cpp

+ 88 - 0
ADI_ACIS.pro

@@ -0,0 +1,88 @@
+QT       += core websockets
+TEMPLATE = app
+CONFIG += console c++11
+CONFIG -= app_bundle
+SOURCES += \
+    WebsocketServer.cpp \
+    main.cpp \
+    app.cpp \
+    appview.cpp \
+    appmodel.cpp \
+    appselectionset.cpp
+
+HEADERS += \
+    WebsocketServer.h \
+    app.h \
+    appview.h \
+    appmodel.h \
+    appselectionset.h
+
+
+
+win32:CONFIG(release, debug|release): LIBS += -LD:/Spatial/ACIS_2021.1.0.1/NT_VC14_64_DLL/code/lib/ -lSpaHBridge
+else:win32:CONFIG(debug, debug|release): LIBS += -LD:/Spatial/ACIS_2021.1.0.1/NT_VC14_64_DLLD/code/lib/ -lSpaHBridged
+else:unix: LIBS += -LD:/Spatial/ACIS_2021.1.0.1/NT_VC14_64_DLL/code/lib/ -lSpaHBridge
+
+win32:CONFIG(release, debug|release): LIBS += -LD:/Spatial/ACIS_2021.1.0.1/NT_VC14_64_DLL/code/lib/ -lSpaACIS
+else:win32:CONFIG(debug, debug|release): LIBS += -LD:/Spatial/ACIS_2021.1.0.1/NT_VC14_64_DLLD/code/lib/ -lSpaACISd
+else:unix: LIBS += -LD:/Spatial/ACIS_2021.1.0.1/NT_VC14_64_DLL/code/lib/ -lSpaACIS
+
+win32:CONFIG(release, debug|release): LIBS += -LD:/Spatial/ACIS_2021.1.0.1/NT_VC14_64_DLL/code/lib/ -lSpaHPart
+else:win32:CONFIG(debug, debug|release): LIBS += -LD:/Spatial/ACIS_2021.1.0.1/NT_VC14_64_DLLD/code/lib/ -lSpaHPartd
+else:unix: LIBS += -LD:/Spatial/ACIS_2021.1.0.1/NT_VC14_64_DLL/code/lib/ -lSpaHPart
+
+
+INCLUDEPATH += D:/Spatial/ACIS_2021.1.0.1/include
+DEPENDPATH += D:/Spatial/ACIS_2021.1.0.1/include
+
+win32:CONFIG(release, debug|release): LIBS += -LD:/Spatial/HOOPS_3DF_2600/Dev_Tools/hoops_3dgs/lib/nt_x64_v140/ -lhoops
+else:win32:CONFIG(debug, debug|release): LIBS += -LD:/Spatial/HOOPS_3DF_2600/Dev_Tools/hoops_3dgs/lib/nt_x64_v140/ -lhoopsd
+else:unix: LIBS += -LD:/Spatial/HOOPS_3DF_2600/Dev_Tools/hoops_3dgs/lib/nt_x64_v140/ -lhoops
+
+
+INCLUDEPATH += D:/Spatial/HOOPS_3DF_2600/Dev_Tools/hoops_3dgs/source
+DEPENDPATH += D:/Spatial/HOOPS_3DF_2600/Dev_Tools/hoops_3dgs/source
+
+win32:CONFIG(release, debug|release): LIBS += -LD:/Spatial/HOOPS_3DF_2600/Dev_Tools/hoops_stream/lib/nt_x64_v140/ -lhoops_stream
+else:win32:CONFIG(debug, debug|release): LIBS += -LD:/Spatial/HOOPS_3DF_2600/Dev_Tools/hoops_stream/lib/nt_x64_v140/ -lhoops_streamd
+else:unix: LIBS += -LD:/Spatial/HOOPS_3DF_2600/Dev_Tools/hoops_stream/lib/nt_x64_v140/ -lhoops_stream
+
+
+INCLUDEPATH += D:/Spatial/HOOPS_3DF_2600/Dev_Tools/hoops_stream/source
+DEPENDPATH += D:/Spatial/HOOPS_3DF_2600/Dev_Tools/hoops_stream/source
+
+INCLUDEPATH += D:/Spatial/HOOPS_3DF_2600/Dev_Tools/hoops_stream/source/stream_common
+DEPENDPATH += D:/Spatial/HOOPS_3DF_2600/Dev_Tools/hoops_stream/source/stream_common
+
+
+win32:CONFIG(release, debug|release): LIBS += -LD:/Spatial/HOOPS_3DF_2600/Dev_Tools/hoops_mvo/lib/nt_x64_v140/ -lhoops_mvo_mgk
+else:win32:CONFIG(debug, debug|release): LIBS += -LD:/Spatial/HOOPS_3DF_2600/Dev_Tools/hoops_mvo/lib/nt_x64_v140/ -lhoops_mvo_mgkd
+else:unix: LIBS += -LD:/Spatial/HOOPS_3DF_2600/Dev_Tools/hoops_mvo/lib/nt_x64_v140/ -lhoops_mvo_mgk
+
+INCLUDEPATH += D:/Spatial/HOOPS_3DF_2600/Dev_Tools/hoops_mvo/source
+DEPENDPATH += D:/Spatial/HOOPS_3DF_2600/Dev_Tools/hoops_mvo/source
+
+
+win32:CONFIG(release, debug|release): LIBS += -LD:/Spatial/HOOPS_3DF_2600/Dev_Tools/utility/lib/nt_x64_v140/ -lhoops_utilsstat_md
+else:win32:CONFIG(debug, debug|release): LIBS += -LD:/Spatial/HOOPS_3DF_2600/Dev_Tools/utility/lib/nt_x64_v140/ -lhoops_utilsstat_md
+else:unix: LIBS += -LD:/Spatial/HOOPS_3DF_2600/Dev_Tools/utility/lib/nt_x64_v140/ -lhoops_utilsstat_md
+
+INCLUDEPATH += D:/Spatial/HOOPS_3DF_2600/Dev_Tools/utility/source
+DEPENDPATH += D:/Spatial/HOOPS_3DF_2600/Dev_Tools/utility/source
+
+win32:CONFIG(release, debug|release): LIBS += -LD:/Spatial/HOOPS_3DF_2600/Dev_Tools/hoops_mfc/lib/nt_x64_v140/ -lhoops_mfcu_mgk
+else:win32:CONFIG(debug, debug|release): LIBS += -LD:/Spatial/HOOPS_3DF_2600/Dev_Tools/hoops_mfc/lib/nt_x64_v140/ -lhoops_mfcu_mgkd
+else:unix: LIBS += -LD:/Spatial/HOOPS_3DF_2600/Dev_Tools/hoops_mfc/lib/nt_x64_v140/ -lhoops_mfcu_mgk
+
+INCLUDEPATH += D:/Spatial/HOOPS_3DF_2600/Dev_Tools/hoops_mfc/source
+DEPENDPATH += D:/Spatial/HOOPS_3DF_2600/Dev_Tools/hoops_mfc/source
+
+win32:CONFIG(release, debug|release): LIBS += -LD:/Spatial/HOOPS_3DF_2600/Dev_Tools/base_stream/lib/nt_x64_v140/ -lbase_stream
+else:win32:CONFIG(debug, debug|release): LIBS += -LD:/Spatial/HOOPS_3DF_2600/Dev_Tools/base_stream/lib/nt_x64_v140/ -lbase_streamd
+else:unix: LIBS += -LD:/Spatial/HOOPS_3DF_2600/Dev_Tools/base_stream/lib/nt_x64_v140/ -lbase_stream
+
+INCLUDEPATH += D:/Spatial/HOOPS_3DF_2600/Dev_Tools/base_stream/source/stream_common
+DEPENDPATH += D:/Spatial/HOOPS_3DF_2600/Dev_Tools/base_stream/source/stream_common
+
+
+

+ 328 - 0
ADI_ACIS.pro.user

@@ -0,0 +1,328 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE QtCreatorProject>
+<!-- Written by QtCreator 4.8.0, 2022-09-30T18:01:10. -->
+<qtcreator>
+ <data>
+  <variable>EnvironmentId</variable>
+  <value type="QByteArray">{2ca1090c-1ac6-431b-b85a-5395a2486c0b}</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">0</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">
+   <valuelist type="QVariantList" key="ClangCodeModel.CustomCommandLineKey">
+    <value type="QString">-fno-delayed-template-parsing</value>
+   </valuelist>
+   <value type="bool" key="ClangCodeModel.UseGlobalConfig">true</value>
+  </valuemap>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.Target.0</variable>
+  <valuemap type="QVariantMap">
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.12.0 MSVC2015 64bit</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.12.0 MSVC2015 64bit</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt5.5120.win64_msvc2015_64_kit</value>
+   <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</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">
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">F:/webcae/code/build-ADI_ACIS-Desktop_Qt_5_12_0_MSVC2015_64bit-Debug</value>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value>
+      <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
+     </valuemap>
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</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="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</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">Qt4ProjectManager.Qt4BuildConfiguration</value>
+    <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
+    <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
+   </valuemap>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">F:/webcae/code/build-ADI_ACIS-Desktop_Qt_5_12_0_MSVC2015_64bit-Release</value>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
+      <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">true</value>
+     </valuemap>
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</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="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</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">Qt4ProjectManager.Qt4BuildConfiguration</value>
+    <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
+    <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
+   </valuemap>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">F:/webcae/code/build-ADI_ACIS-Desktop_Qt_5_12_0_MSVC2015_64bit-Profile</value>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value>
+      <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">true</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">true</value>
+     </valuemap>
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</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="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</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">Profile</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Profile</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
+    <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
+    <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
+   </valuemap>
+   <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">3</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">部署</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 Configuration</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="int" key="PE.EnvironmentAspect.Base">2</value>
+    <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">ADI_ACIS</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:F:/webcae/code/ADI_ACIS/ADI_ACIS.pro</value>
+    <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">ADI_ACIS.pro</value>
+    <value type="QString" key="RunConfiguration.Arguments"></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.UseLibrarySearchPath">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>
+    <value type="QString" key="RunConfiguration.WorkingDirectory"></value>
+    <value type="QString" key="RunConfiguration.WorkingDirectory.default">F:/webcae/code/build-ADI_ACIS-Desktop_Qt_5_12_0_MSVC2015_64bit-Debug</value>
+   </valuemap>
+   <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</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">20</value>
+ </data>
+ <data>
+  <variable>Version</variable>
+  <value type="int">20</value>
+ </data>
+</qtcreator>

+ 35 - 0
WebsocketServer.h

@@ -0,0 +1,35 @@
+#ifndef WEBSOCKETSERVER_H
+#define WEBSOCKETSERVER_H
+#include <QtCore/QObject>
+#include <QtCore/QList>
+#include <QtCore/QByteArray>
+#include <QtCore/QMap>
+#include "appmodel.h"
+#include "appview.h"
+QT_FORWARD_DECLARE_CLASS(QWebSocketServer)
+QT_FORWARD_DECLARE_CLASS(QWebSocket)
+
+class WebsocketServer : public QObject
+{
+    Q_OBJECT
+public:
+    explicit WebsocketServer(quint16 port, QObject *parent = Q_NULLPTR);
+    virtual ~WebsocketServer();
+
+private Q_SLOTS:
+    void onNewConnection();
+    void processMessage(QString message);
+    void socketDisconnected();
+    //文本消息接收
+    void textFrameReceived(const QString &frame);
+    // 发送二进制消息
+    void binaryMessageReceived(const QByteArray &message);
+
+private:
+    QWebSocketServer *m_pWebSocketServer;
+    QMap<int,AppView *> m_clientMap;
+    AppModel * model =NULL;
+    AppModel * model2 =NULL;
+};
+
+#endif // WEBSOCKETSERVER_H

+ 60 - 0
app.cpp

@@ -0,0 +1,60 @@
+#include "app.h"
+#include "ha_part.h"
+App::App()
+{
+    m_pHoopsDB = NULL;
+}
+BOOL App::InitInstance()
+{
+    HC_Define_System_Options("license = `" VISUALIZE_LICENSE "`");
+    m_pHoopsDB = new HDB;
+    m_pHoopsDB->Init();
+    m_pHoopsDB->SetIsolatedDrivers(true);
+
+
+
+    base_configuration base_config;
+    initialize_base( &base_config);
+    spa_unlock_result out = spa_unlock_products("3VKKZ85TA8QRNSJT3HK3EC5NE82UJE5XPRLDVETLKCJUKNJZTCEUJH5EKRMKKQTVKCVCGEJQ9A8UJN5HRR8DDSHHK8JCMA57HX2ZMEJ7QRACJZJWW8M3KGMLRCUDD85RR85ZMD5WQLZUJJPUS8PUNDPWACP7V8HXTLPUJ8JC98MRGG5L7ALDVZTV3LLZGCMAR3K3AZH8VRRZAZM7A8S7EJN7QH2CSS2JKERDFE2B3HJKZ85NQR3FWN2H7V8FFQDFA3D3A8JUVGJLDAHNN8Q7VA5SJ8CNEQDQ3GNMMZ22PEQREZ5NHAHCDWDRTVVFPY87VVCAEQD8TECFFHXLPEDFWD2B7VQ7EZ5TN8Q3JHBBKEGCSU2DKRRFWAXNA8QRGJNSW8QRMYHZPAECKHP6TA5CD8P6PR6ZKYHTH8N3A85Z3CVUBZHZTANZPJNSW8Q7EAHAPR4UNZHZVCPDJEJ67APZMSHTHXQ7EAHAPR4ZDCHETACAE85NE8HZJUJ63R7DNYTHPASCNJNSN8Q7EAHAPR4ZDDT39LJCKATRTACAEQ5NE8HZJUJ6KCTZPHPQR3K3VQD7NANCMYTCPAJDJZJ63RNUNJQ7Q8QRDWHCPADUMQP6KARDJCJ3KC4UJCPHKCTDZQ5NACTF7EH29EQKKJQSQHTZYQX5KVX5AEHTS8QRKNXSKA359C8NA8N3EQMBQ8K7LQMSA3D3AQPUREELU82TPE75AZMSA8Q7EETC78P7D85LRAXDKAMCKCSKJNPRV8NCMSH57RZZGEMR7ATDMCJZVAPZ2N53P83C2WJ8P8MRPZHFNRGUJSJ3TAMCVHHV3XHDEJH3VRCCPAM5PCTCPSH3KAAUPCH5VRKCNGJ8PA8UPAHWEC3UDG5US8AZPEJWNCUUKNM57AUZA85LV8KCJJTTH8QRNS2M7CTMW8BJ9VG5AQ5TH8QRNSJT7CTMW8BJ9VG5AQ5T");
+    if (out.get_state() == SPA_UNLOCK_PASS_WARN)
+    { /* insert your warning notification code here */;
+    }
+    else if (out.get_state() != SPA_UNLOCK_PASS)
+    { /* insert your error handling code here */;
+    }
+    api_start_modeller();
+    api_initialize_hoops_acis_bridge();
+    api_initialize_part_manager();
+    api_set_int_option("annotations", false);
+    api_set_int_option("cell_recompute", 8);
+    //	HA_Set_Rendering_Options("merge faces");
+    #ifdef HOOPS_QA
+        HC_Define_System_Options("no warnings, no info, errors=on, no message limit");
+    #elif defined( _DEBUG )
+        HC_Define_System_Options("errors, info, no message limit");
+    #else
+        HC_Define_System_Options("no warnings, no info, no errors, no fatal errors, no message limit");
+    #endif
+        //this is overridden later and could be removed
+        HC_Define_System_Options("multi-threading = full");
+
+    initialize_ha_part();
+    return TRUE;
+}
+
+int App::ExitInstance(){
+    //m_pCTDriver must be deleted before m_pHoopsDB
+
+
+        if (m_pHoopsDB)
+        {
+            delete m_pHoopsDB;
+            m_pHoopsDB = 0;
+            terminate_ha_part();
+            api_terminate_part_manager();
+            api_terminate_hoops_acis_bridge();
+            api_stop_modeller();
+            terminate_base();
+        }
+        return 1;
+}

+ 27 - 0
app.h

@@ -0,0 +1,27 @@
+#ifndef APP_H
+#define APP_H
+
+#include "HDB.h"
+#include "license.hxx"
+#include "spa_unlock_result.hxx"
+#include "hoops_license.h"
+
+#include "ha_bridge.h"
+#include "part_api.hxx"
+#include "spa_unlock_result.hxx"
+#include "kernapi.hxx"
+class App
+{
+protected:
+
+    /*! Pointer to the HOOPS/MVO HDB object associated with this instance of the application */
+    HDB*	m_pHoopsDB;
+
+public:
+    App();
+public:
+    virtual BOOL InitInstance();
+    virtual int ExitInstance();
+};
+
+#endif // APP_H

+ 350 - 0
appmodel.cpp

@@ -0,0 +1,350 @@
+#include "appmodel.h"
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "ha_part.h"
+#include "ha_part_util.h"
+#include "roll_hm.hxx"
+// HOOPS includes
+#include "hc.h"
+#include "HStream.h"
+#include "HOpcodeShell.h"
+#include "HUtility.h"
+#include <part_api.hxx>
+#include "HTools.h"
+#include "ha_rend_options.h"
+#include "HIOManager.h"
+#include "varray.h"
+#include "HBaseView.h"
+#include "kernapi.hxx"
+AppModel::AppModel()
+{
+        m_bSolidModel = true;
+        SetBRepGeometry(true);
+        m_mi=0;
+
+       // initialize_ha_part();
+        m_pHAPart = ACIS_NEW HA_Part();
+
+        api_part_set_distribution_mode( TRUE );
+    //	distributed_history(TRUE,TRUE);
+
+        char buffer[1024];
+        char pbuffer[POINTER_BUFFER_SIZE];
+        PART* pPart = m_pHAPart->GetPart();
+        sprintf(buffer,"?Include Library/%s",ptoax(pPart->history_stream(), pbuffer));
+        m_ModelKey = HA_KCreate_Segment(0, buffer);
+        HA_Set_Rendering_Options("segment pattern = ?Include Library/history/entity");
+}
+AppModel::~AppModel()
+{
+    // Model cleanup : delete all the entities from the
+    // partition associated with this model
+    DeleteAllEntities();
+
+    if(m_pHAPart)
+    {
+        ACIS_DELETE m_pHAPart;
+        m_pHAPart = NULL;
+    }
+   // terminate_ha_part();
+
+    if(m_mi)
+    {
+        delete m_mi;
+        m_mi = 0;
+    }
+}
+// Delete all the entities in the current model from the
+// modeler and associated HOOPS geometry
+void AppModel::DeleteAllEntities()
+{
+// 	HA_Delete_Entity_Geometry(m_entityList);
+// 	api_del_entity_list(m_entityList);
+// 	m_entityList.clear();
+    ENTITY_LIST elist;
+    m_pHAPart->GetPart()->get_entities(elist);
+    elist.init();
+    ENTITY* pEnt = NULL;
+    while((pEnt= elist.next())!= NULL)
+    {
+        m_pHAPart->RemoveEntity(pEnt);
+    }
+    api_del_entity_list(elist);
+    elist.clear();
+}
+void AppModel::AddAcisEntity( ENTITY* entity )
+{
+    if(m_pHAPart)
+    {
+       api_facet_entity( entity);
+       m_pHAPart->AddEntity(entity);
+    }
+}
+void AppModel::AddAcisEntitiesToPart( ENTITY_LIST& list)
+{
+    if(m_pHAPart)
+    {
+        api_facet_bodies( list);
+        ENTITY* entity = list.first();
+        while (entity)
+        {
+            m_pHAPart->AddEntity(entity);
+            entity = list.next();
+        }
+    }
+}
+void AppModel::RemoveAcisEntity( ENTITY* entity )
+{
+    if(m_pHAPart)
+    {
+        m_pHAPart->RemoveEntity(entity);
+    }
+}
+
+void AppModel::UpdateAcisEntity( ENTITY* entity )
+{
+    if(m_pHAPart)
+    {
+        m_pHAPart->UpdateEntity(entity);
+    }
+}
+
+void AppModel::AddAcisEntities( const ENTITY_LIST& entityList )
+{
+    if(m_pHAPart)
+    {
+        m_pHAPart->AddEntities(entityList);
+    }
+}
+
+void AppModel::DeleteAcisEntity( ENTITY* entity)
+{
+    // delete from ACIS
+    if (m_pHAPart)
+    {
+        m_pHAPart->RemoveEntity(entity);
+    }
+    api_del_entity(entity);
+}
+
+void AppModel::DeleteAcisEntities( ENTITY_LIST& elist)
+{
+    // delete from HOOPS
+//	HA_Delete_Entity_Geometry(elist);
+    // delete from ACIS
+    elist.init();
+    ENTITY* pEnt = NULL;
+    while((pEnt = elist.next()) != NULL)
+    {
+        m_pHAPart->RemoveEntity(pEnt);
+    }
+
+    api_del_entity_list(elist);
+}
+
+// our application-specific read function
+HFileInputResult AppModel::Read(const char * FileName)
+{
+
+    unsigned int i;
+    HFileInputResult success = InputOK;
+
+    // get the file extension
+    char extension[120];
+    HUtility::FindFileNameExtension(FileName, extension);
+    // read the file into the model object's model segment
+    HC_Open_Segment_By_Key(m_ModelKey);
+        HC_Open_Segment("main");
+
+            if  (streq(extension,"sat"))
+            {
+                m_bSolidModel = true;
+                SetBRepGeometry(true);
+//				m_pHAPart->LoadFile(FileName,true);
+
+                int depth = 0;
+                outcome result;
+                api_part_start_state(depth);
+                {
+                    API_BEGIN
+                    {
+                        ENTITY_LIST elist;
+                        FILE * fp = NULL;
+                        logical res = TRUE;
+                        fp = fopen(FileName, "r");
+                        res = (fp != NULL);
+                        if (res)
+                        {
+                            result = api_restore_entity_list(fp, TRUE, elist);
+                            res = result.ok();
+                        }
+                        if (fp)
+                            fclose(fp);
+
+                        if (res)
+                        {
+                            ENTITY* entity = 0;
+                            elist.init();
+                            while ((entity = elist.next()) != 0)
+                                AddAcisEntity(entity);
+                        }
+                    }
+                    API_END
+                }
+                api_part_note_state(result, depth);
+            }
+            else if  (streq(extension,"sab"))
+            {
+                m_bSolidModel = true;
+                SetBRepGeometry(true);
+//				m_pHAPart->LoadFile(FileName,false);
+
+                int depth = 0;
+                outcome result;
+                api_part_start_state(depth);
+                {
+                    API_BEGIN
+                    {
+                        ENTITY_LIST elist;
+                        FILE * fp = NULL;
+                        logical res = TRUE;
+                        fp = fopen(FileName, "r");
+                        res = (fp != NULL);
+                        if (res)
+                        {
+                            result = api_restore_entity_list(fp, FALSE, elist);
+                            res = result.ok();
+                        }
+                        if (fp)
+                            fclose(fp);
+
+                        if (res)
+                        {
+                            ENTITY* entity = 0;
+                            elist.init();
+                            while ((entity = elist.next()) != 0)
+                                AddAcisEntity(entity);
+                        }
+                    }
+                    API_END
+                }
+                api_part_note_state(result, depth);
+            }
+            else if (streq(extension,"asf"))
+            {
+                m_bSolidModel = true;
+                SetBRepGeometry(true);
+
+                HStreamFileToolkit tk;
+               // tk.SetOpcodeHandler (TKE_Comment, new TK_PSComment(this));
+                TK_Status status = HTK_Read_Stream_File( FileName, &tk );
+                if( status != TK_Complete )
+                    success = InputFail;
+            }
+            else
+            {
+                // No special read - let the base class handle
+                m_bSolidModel = false;
+                success = HBaseModel::Read(FileName);
+            }
+
+        HC_Close_Segment();
+    HC_Close_Segment();
+
+    return success;
+}
+
+// our application-specific write function
+bool AppModel::Write(const char * FileName, HBaseView * view,
+                                    int version, int width, int height)
+{
+
+
+    unsigned int i;
+    bool success = true;
+
+    // get the file extension
+    char extension[120];
+    HUtility::FindFileNameExtension(FileName, extension);
+
+    if (streq(extension,"sat"))
+    {
+        ENTITY_LIST savelist;
+        GetEntityList(savelist);
+
+        if (savelist.count() > 0)
+            HA_Write_Sat_File(FileName, savelist);
+    }
+    else if (streq(extension,"png"))
+    {
+        HOutputHandlerOptions options;
+        VCharArray width_str(128), height_str(128), temp(128), xpixels_str(128);
+        HC_Open_Segment_By_Key(view->GetViewKey());
+            /* Get the size in milimeters. */
+            HC_Show_Device_Info(".", "size", temp);
+            HC_Parse_String(temp, ",", 0, width_str);
+            HC_Parse_String(temp, ",", 1, height_str);
+
+            /* Get the pixels in the x direction so we can find DPI. */
+            HC_Show_Device_Info(".", "pixels", temp);
+            HC_Parse_String(temp, ",", 0, xpixels_str);
+        HC_Close_Segment();
+
+        /* Save off the window width and height in inches. */
+        options.WindowWidth(atof(width_str)/2.54f);
+        options.WindowHeight(atof(height_str)/2.54f);
+
+        /* DPI = xpixels / width in inches; */
+        options.ImageDpi(atoi(xpixels_str) / options.WindowWidth());
+
+        HBaseModel::WriteWithOptions(FileName, view, &options);
+    }
+    else
+    {
+        if(!HBaseModel::Write(FileName, view, width, height))
+            success = false;
+    }
+
+    return success;
+}
+
+logical AppModel::Undo()
+{
+    return m_pHAPart->RollBack();
+}
+
+logical AppModel::Redo()
+{
+    return m_pHAPart->RollForward();
+}
+
+logical AppModel::CanUndo()
+{
+    PART* pPart = m_pHAPart->GetPart();
+    HISTORY_STREAM* hs = pPart->history_stream();
+    if (hs)
+        return (hs->can_roll_back()!=0);
+    return false;
+}
+
+logical AppModel::CanRedo()
+{
+    PART* pPart = m_pHAPart->GetPart();
+    HISTORY_STREAM* hs = pPart->history_stream();
+    if (hs)
+        return (hs->can_roll_forward()!=0);
+    return false;
+}
+
+void AppModel::GetEntityList(ENTITY_LIST& elist)
+{
+    if (m_pHAPart != NULL)
+    {
+        PART* pPart = m_pHAPart->GetPart();
+        if(pPart != NULL)
+        {
+            pPart->get_entities(elist);
+        }
+    }
+}

+ 51 - 0
appmodel.h

@@ -0,0 +1,51 @@
+#ifndef APPMODEL_H
+#define APPMODEL_H
+
+#include "HDB.h"
+#include "HBaseModel.h"
+#include "HTools.h"
+
+#include "ha_bridge.h"
+
+class CModellerInfo;
+
+class HA_Part;
+
+class ENTITY_LIST;
+class AppModel : public HBaseModel
+{
+public:
+    AppModel();
+    virtual ~AppModel();
+    HFileInputResult Read(const char * FileName);
+    bool Write(const char * FileName, HBaseView * pHView, int version, int width = 0, int height = 0);
+
+    void	DeleteAllEntities();
+
+    bool	IsSolidModel(){ return m_bSolidModel; };
+    void	SetSolidModel(bool brep){ m_bSolidModel = brep;};
+    HA_Part* GetHAPart() {return m_pHAPart; };
+
+    void DeleteAcisEntity( ENTITY* entity);
+    void DeleteAcisEntities( ENTITY_LIST& elist);
+
+    void AddAcisEntity( ENTITY* entity);
+    void AddAcisEntitiesToPart( ENTITY_LIST& list);
+    void RemoveAcisEntity( ENTITY* entity);
+    void UpdateAcisEntity( ENTITY* entity);
+    void AddAcisEntities( const ENTITY_LIST& entityList);
+    void GetEntityList(ENTITY_LIST& elist);
+
+    logical Undo();
+    logical Redo();
+    logical CanUndo();
+    logical CanRedo();
+        CModellerInfo *m_mi;
+protected:
+
+    HA_Part* m_pHAPart;
+    // do we have any solid modeler entities
+    bool	m_bSolidModel;
+};
+
+#endif // APPMODEL_H

+ 336 - 0
appselectionset.cpp

@@ -0,0 +1,336 @@
+#include "appselectionset.h"
+
+#include "appmodel.h"
+#include "appview.h"
+#include "vlist.h"
+#include "body.hxx"
+#include "face.hxx"
+#include "edge.hxx"
+AppSelectionSet::AppSelectionSet(HBaseView* view) : HSelectionSet(view)
+{
+    m_SelectLevel = BODY_TYPE;	// set default level to body  BODY_TYPE
+    SetAllowEntitySelection(true);
+}
+
+AppSelectionSet::~AppSelectionSet()
+{
+    if( m_pSolidSelection )
+    {
+        delete_vlist(m_pSolidSelection);
+        m_pSolidSelection = 0;
+    }
+}
+
+// create a new list  object
+void AppSelectionSet::Init()
+{
+    m_pSolidSelection = new_vlist(malloc, free);
+    HSelectionSet::Init();
+}
+
+int AppSelectionSet::GetSolidListSize()
+{
+    return vlist_count( m_pSolidSelection );
+}
+
+long long AppSelectionSet::GetAtSolidEntity(int index)
+{
+    return (long long) vlist_nth_item( m_pSolidSelection, index );
+}
+
+void AppSelectionSet::Reset()
+{
+    if( m_pSolidSelection )
+    {
+        delete_vlist(m_pSolidSelection);
+        m_pSolidSelection = new_vlist(malloc, free);
+    }
+
+    HSelectionSet::Reset();
+}
+
+// deselect all items as in DeSelect
+void AppSelectionSet::DeSelectAll()
+{
+    if( m_pSolidSelection )
+    {
+        delete_vlist(m_pSolidSelection);
+        m_pSolidSelection = new_vlist(malloc, free);
+    }
+
+    HSelectionSet::DeSelectAll();
+    m_pView->EmitDeSelectAllMessage();
+}
+
+
+void AppSelectionSet::Select( HC_KEY key, int num_include_keys, HC_KEY * include_keys, bool emit_message)
+{
+    HC_KEY* sel_keys = 0;
+    int		count = 0;
+
+    ENTITY* entity = 0;
+
+    if (((AppModel *) HSelectionSet::m_pView->GetModel())->IsSolidModel() != true)
+    {
+        char	type[64];
+        HC_KEY	segkey;
+
+        HC_Show_Key_Type(key, type);
+        if (!streq(type, "segment"))
+            segkey = HC_KShow_Owner_By_Key(key);
+        else
+            segkey = key;
+
+        HSelectionSet::Select( segkey, num_include_keys, include_keys, emit_message);
+    }
+    else
+    {
+        entity = HA_Compute_Entity_Pointer(key, m_SelectLevel);//FACE_TYPE? BODY_TYPE?
+        if (entity)
+        {
+            bool bFind = false;
+            for (int i = 0; i < vlist_count(m_pSolidSelection); i++)
+            {
+                if ((void*)entity == vlist_nth_item(m_pSolidSelection, i))
+                {
+                    bFind = true;
+                }
+            }
+
+            if (!bFind)
+            {
+                vlist_add_last(m_pSolidSelection, (void*)entity);
+                if (m_SelectLevel == BODY_TYPE)  // && body segments is true
+                {
+                    sel_keys = new HC_KEY[1];
+                    count = HA_Compute_Geometry_Keys(entity, 1, sel_keys, "bodies");
+                }
+                else if (m_SelectLevel == FACE_TYPE)
+                {
+                    count = HA_Compute_Geometry_Key_Count(entity, "faces");
+                    if (count > 0)
+                    {
+                        sel_keys = new HC_KEY[count];
+                        HA_Compute_Geometry_Keys(entity, count, sel_keys, "faces");
+                    }
+                }
+                else if (m_SelectLevel == EDGE_TYPE)
+                {
+                    count = HA_Compute_Geometry_Key_Count(entity, "edges");
+                    if (count > 0)
+                    {
+                        sel_keys = new HC_KEY[count];
+                        HA_Compute_Geometry_Keys(entity, count, sel_keys, "edges");
+                    }
+                }
+            }
+
+        }
+        for (int c = 0; c < count; c++)
+            HSelectionSet::Select(sel_keys[c],  num_include_keys, include_keys, emit_message);  // call base class fcn for each key
+
+        if( sel_keys )
+            delete [] sel_keys;
+    }
+}
+
+
+void AppSelectionSet::Select(ENTITY* entity, bool emit_message)
+{
+    HC_KEY*	sel_keys = 0;
+    int		count = 0;
+    int eclass;
+    eclass = entity->identity();
+    if (entity)
+    {
+        bool bFind = false;
+        for (int i = 0; i < vlist_count(m_pSolidSelection); i++)
+        {
+            if ((void*)entity == vlist_nth_item(m_pSolidSelection, i))
+            {
+                bFind = true;
+            }
+        }
+
+        if (!bFind)
+        {
+            vlist_add_last(m_pSolidSelection, (void*)entity);
+            if (m_SelectLevel == BODY_TYPE)  // && body segments is true
+            {
+                sel_keys = new HC_KEY[1];
+                count = HA_Compute_Geometry_Keys(entity, 1, sel_keys, "bodies");
+            }
+            else if (m_SelectLevel == FACE_TYPE)
+            {
+                count = HA_Compute_Geometry_Key_Count(entity, "faces");
+                if (count > 0)
+                {
+                    sel_keys = new HC_KEY[count];
+                    HA_Compute_Geometry_Keys(entity, count, sel_keys, "faces");
+                }
+            }
+            else if (m_SelectLevel == EDGE_TYPE)
+            {
+                count = HA_Compute_Geometry_Key_Count(entity, "edges");
+                if (count > 0)
+                {
+                    sel_keys = new HC_KEY[count];
+                    HA_Compute_Geometry_Keys(entity, count, sel_keys, "edges");
+                }
+            }
+        }
+    }
+
+    for (int c = 0; c < count; c++)
+        HSelectionSet::Select(sel_keys[c], "", INVALID_KEY, INVALID_KEY, emit_message);  // call base class fcn for each key
+
+    if( sel_keys )
+        delete [] sel_keys;
+
+}
+
+void AppSelectionSet::DeSelect( HC_KEY key, bool emit_message )
+{
+    HC_KEY* sel_keys = 0;
+    int		count = 0;
+    if (((AppModel *) m_pView->GetModel())->IsSolidModel() != true)
+    {
+        char	type[1024];
+        HC_KEY	segkey;
+
+        HC_Show_Key_Type(key, type);
+        if (!streq(type, "segment"))
+            segkey = HC_KShow_Owner_By_Key(key);
+        else
+            segkey = key;
+
+        HSelectionSet::DeSelect(segkey, emit_message);
+    }
+    else
+    {
+        ENTITY*	entity = 0;
+        entity = HA_Compute_Entity_Pointer(key, m_SelectLevel);
+        if (entity)
+        {
+            vlist_remove(m_pSolidSelection, (void*)entity);
+            if (m_SelectLevel == BODY_TYPE)  // && body segments is true
+            {
+                sel_keys = new HC_KEY[1];
+                count = HA_Compute_Geometry_Keys(entity, 1, sel_keys, "bodies");
+            }
+            else if (m_SelectLevel == FACE_TYPE)
+            {
+                count = HA_Compute_Geometry_Key_Count(entity, "faces");
+                if( count > 0 )
+                {
+                    sel_keys = new HC_KEY[count];
+                    HA_Compute_Geometry_Keys(entity, count, sel_keys, "faces");
+                }
+            }
+            else if (m_SelectLevel == EDGE_TYPE)
+            {
+                count = HA_Compute_Geometry_Key_Count(entity, "edges");
+                if( count > 0 )
+                {
+                    sel_keys = new HC_KEY[count];
+                    HA_Compute_Geometry_Keys(entity, count, sel_keys, "edges");
+                }
+            }
+        }
+        if (count > 0)
+        {
+            for( int c = 0; c < count; c++)
+                HSelectionSet::DeSelect(sel_keys[c], emit_message);	// call base class fcn for each key
+        }
+        else
+            HSelectionSet::DeSelect(key, emit_message);
+    }
+    if( sel_keys )
+        delete[] sel_keys;
+}
+
+
+void AppSelectionSet::DeSelectEntity(ENTITY* entity, bool emit_message )
+{
+    HC_KEY*	sel_keys = 0;
+    int		count = 0;
+
+    if (entity)
+    {
+        vlist_remove(m_pSolidSelection, (void*) entity);
+        if (m_SelectLevel == BODY_TYPE)  // && body segments is true
+        {
+            sel_keys = new HC_KEY[1];
+            count = HA_Compute_Geometry_Keys(entity, 1, sel_keys, "bodies");
+        }
+        else if (m_SelectLevel == FACE_TYPE)
+        {
+            count = HA_Compute_Geometry_Key_Count(entity, "faces");
+            if( count > 0 )
+            {
+                sel_keys = new HC_KEY[count];
+                HA_Compute_Geometry_Keys(entity, count, sel_keys, "faces");
+            }
+        }
+        else if (m_SelectLevel == EDGE_TYPE)
+        {
+            count = HA_Compute_Geometry_Key_Count(entity, "edges");
+            if( count > 0 )
+            {
+                sel_keys = new HC_KEY[count];
+                HA_Compute_Geometry_Keys(entity, count, sel_keys, "edges");
+            }
+        }
+    }
+
+    if (count > 0)
+    {
+        for( int c = 0; c < count; c++)
+            HSelectionSet::DeSelect(sel_keys[c], emit_message);	// call base class fcn for each key
+    }
+    if( sel_keys )
+        delete[] sel_keys;
+}
+
+bool AppSelectionSet::IsSelected(HC_KEY key)
+{
+    if (((AppModel *) m_pView->GetModel())->IsSolidModel() != true)
+    {
+        char	type[1024];
+        HC_Show_Key_Type(key, type);
+        if (!streq(type, "segment"))
+            key = HC_KShow_Owner_By_Key(key);
+    }
+    else
+    {
+        int count;
+        if (m_SelectLevel == BODY_TYPE)  // && body segments is true
+        {
+            ENTITY* entity = 0;
+            entity = HA_Compute_Entity_Pointer(key, m_SelectLevel);
+            if (entity)
+                count = HA_Compute_Geometry_Keys(entity, 1, &key, "bodies");
+            assert(count == 1);
+        }
+    }
+    // call base class function with the computed key
+    return HSelectionSet::IsSelected(key);
+}
+
+
+// If it is a call to select something from HNet message,
+// by pass our selection functionality and just call the
+// vanilla Select. JUST SELECT THIS KEY!
+// This is to work around the case where the master client
+// is in some selection mode (face) and slave is in some (body)
+void AppSelectionSet::SelectFromMessage(HC_KEY key, int num_include_keys, HC_KEY * include_keys, bool emit_message)
+{
+    HSelectionSet::Select( key, num_include_keys, include_keys,  emit_message);
+}
+
+//	See the Description for SelectFromMessage
+void AppSelectionSet::DeSelectFromMessage(HC_KEY key, bool emit_message)
+{
+    HSelectionSet::DeSelect(key, emit_message);
+}
+

+ 40 - 0
appselectionset.h

@@ -0,0 +1,40 @@
+#ifndef APPSELECTIONSET_H
+#define APPSELECTIONSET_H
+
+
+#include "HSelectionSet.h"
+#include "entity.hxx"
+class AppSelectionSet:  public HSelectionSet
+{
+  public:
+    AppSelectionSet(HBaseView* view);
+    virtual ~AppSelectionSet();
+
+    virtual void Select( HC_KEY key, int num_include_keys, HC_KEY * include_keys, bool emit_message = true);
+    virtual void DeSelect(HC_KEY key, bool emit_message = true);
+
+    virtual void SelectFromMessage( HC_KEY key, int num_include_keys, HC_KEY * include_keys, bool emit_message = false);
+    virtual void DeSelectFromMessage(HC_KEY key, bool emit_message = false);
+
+    virtual void Init();
+    virtual void Reset();
+
+    virtual void DeSelectAll ();
+    virtual bool IsSelected(HC_KEY key);
+    virtual long long GetAtSolidEntity(int index);
+    virtual int  GetSolidListSize();
+
+    void Select(ENTITY* entity, bool emit_message = true);
+    void DeSelectEntity(ENTITY* entity, bool emit_message = true);
+
+    void SetSelectLevel(int new_level) { m_SelectLevel = new_level; }
+    int GetSelectLevel() { return (m_SelectLevel);}
+
+
+protected:
+    int				m_SelectLevel;
+    struct vlist_s *m_pSolidSelection;
+
+};
+
+#endif // APPSELECTIONSET_H

+ 90 - 0
appview.cpp

@@ -0,0 +1,90 @@
+#include "appview.h"
+#include "appmodel.h"
+#include "appselectionset.h"
+#include "ha_bridge.h"
+#include "part_api.hxx"
+
+#include "HSharedKey.h"
+#include "body.hxx"
+#include "face.hxx"
+#include "edge.hxx"
+AppView:: AppView(HBaseModel *model,
+                  const char * 	alias ,
+                  const char *	driver_type ,
+                  const char *	instance_name ,
+                  void *			window_handle ,
+                  void *			colormap ):HBaseView(model, alias, driver_type, instance_name, window_handle, colormap){
+
+}
+
+AppView::~AppView()
+{
+}
+void AppView::Init()
+{
+    HBaseView::Init();
+    m_pSelection = new AppSelectionSet(this);
+    m_pSelection->Init();
+}
+
+void AppView::DeleteSelectionList( bool emit_message )
+{
+    int				i, numSolidSelections, numHoopsSelections;
+    char			type[4096];
+    AppSelectionSet* selection = (AppSelectionSet *)GetSelection();;
+    ENTITY*			current = 0;
+    numHoopsSelections = selection->GetSize();
+    numSolidSelections = selection->GetSolidListSize();
+    if (numHoopsSelections == 0)
+        return;
+
+    // loop through the list of selected HOOPS primitives, filtering
+    // out the ones associated with solid model entities, and deleting
+    // the non-solid model primitives directly using Delete_By_Key
+    // The primitives associated with solid model entities need to be
+    // deleted using the HOOPS/GM deletion functions so that the HOOPS<->GM
+    // mapping tables will remain in sync
+    for (i = numHoopsSelections; i > 0; i--)
+    {
+        HC_KEY key = selection->GetAt(i-1);
+
+        // if it's a HOOPS primitive that is not associated with a solid model entity,
+        // deselect and delete it
+        current = HA_Compute_Entity_Pointer(key, BODY_TYPE);
+        if (current == 0)
+        {
+            selection->DeSelect(key, false);
+            HC_Delete_By_Key(key);
+        }
+    }
+
+    int depth = 0;
+    outcome result;
+    api_part_start_state(depth);
+    {
+        API_BEGIN
+            // loop through the list of selected solid model entities,
+            // delete the HOOPS geometry associated with each
+            // and then delete the entity
+            for (i = numSolidSelections; i > 0; i--)
+            {
+                current = (ENTITY*)selection->GetAtSolidEntity(i-1);
+                if (current)
+                {
+                    selection->DeSelectEntity(current);
+                    ((AppModel*)GetModel())->DeleteAcisEntity(current);
+                }
+            }
+        API_END
+    }
+    api_part_note_state(result, depth);
+    ((AppModel*)GetModel())->Update();
+
+    if( emit_message )
+        EmitDeleteSelectionListMessage();
+
+    // Reset the selection set lists since we've deleted all the entities that
+    // were in them  (we can't DeSelect the entities because they no longer exist)
+    selection->Reset();
+    SetGeometryChanged();
+}

+ 29 - 0
appview.h

@@ -0,0 +1,29 @@
+#ifndef APPVIEW_H
+#define APPVIEW_H
+
+#include <QtCore/QObject>
+#include "HBaseView.h"
+#include "HUtility.h"
+
+#include "ha_bridge.h"
+#include <assert.h>
+#include <math.h>
+#include "ha_bridge.h"
+
+class HSelectionSet;
+
+class AppView : public HBaseView
+{
+public:
+    AppView(HBaseModel *model,
+                                const char * 	alias = 0,
+                                const char *	driver_type = 0,
+                                const char *	instance_name = 0,
+                                void *			window_handle = 0,
+                                void *			colormap = 0);
+    virtual ~AppView();
+    void	Init();
+    void	DeleteSelectionList(bool emit_message=false);
+};
+
+#endif // APPVIEW_H

+ 16 - 0
main.cpp

@@ -0,0 +1,16 @@
+#include <iostream>
+#include <QtCore>
+#include "WebsocketServer.h"
+#include "app.h"
+using namespace std;
+
+int main(int argc, char *argv[])
+{
+    cout << "Hello World!" << endl;
+    QCoreApplication a(argc, argv);
+    WebsocketServer server(1234);
+    App* app =new App();
+    app->InitInstance();
+
+    return a.exec();
+}

+ 126 - 0
websocketserver.cpp

@@ -0,0 +1,126 @@
+#include "WebsocketServer.h"
+#include "QtWebSockets/QWebSocketServer"
+#include "QtWebSockets/QWebSocket"
+#include <QtCore/QDebug>
+#include "cstrapi.hxx"
+//! constructor
+WebsocketServer::WebsocketServer(quint16 port, QObject *parent) :
+    QObject(parent),
+    m_pWebSocketServer(Q_NULLPTR)
+{
+    m_pWebSocketServer = new QWebSocketServer(QStringLiteral("Chat Server"),
+                                              QWebSocketServer::NonSecureMode,
+                                              this);
+    if (m_pWebSocketServer->listen(QHostAddress::Any, port))
+    {
+        qDebug() << "Chat Server listening on port" << port;
+        connect(m_pWebSocketServer, &QWebSocketServer::newConnection,
+                this, &WebsocketServer::onNewConnection);
+    }
+}
+//! 关闭服务
+WebsocketServer::~WebsocketServer()
+{
+    m_pWebSocketServer->close();
+    delete model;
+    model =0;
+    qDeleteAll(m_clientMap);
+}
+//! 创建连接
+void WebsocketServer::onNewConnection()
+{
+    QWebSocket *pSocket = m_pWebSocketServer->nextPendingConnection();
+
+    connect(pSocket, &QWebSocket::textMessageReceived, this, &WebsocketServer::processMessage);
+    connect(pSocket, &QWebSocket:: textFrameReceived, this, &WebsocketServer::textFrameReceived);
+    connect(pSocket, &QWebSocket::disconnected, this, &WebsocketServer::socketDisconnected);
+    connect(pSocket, &QWebSocket::binaryMessageReceived, this, &WebsocketServer::binaryMessageReceived);
+    if(model == NULL){
+        model =new AppModel();
+        model->Init();
+    }
+    AppView  *view = new AppView(model,NULL,"opengl");
+    view->Init();
+    view->Update();
+
+    if(model2 == NULL){
+        model2 =new AppModel();
+        model2->Init();
+    }
+    AppView  *view2 = new AppView(model2,NULL,"opengl");
+    view2->Init();
+    view2->Update();
+    m_clientMap.insert(1,view);
+    m_clientMap.insert(2,view2);
+}
+//! textFrameReceived
+void WebsocketServer::textFrameReceived(const QString &frame)
+{
+
+    qDebug() << u8"收到消息" << frame;
+
+    QWebSocket *pClient = qobject_cast<QWebSocket *>(sender());
+    AppView *view = (AppView *)m_clientMap.value(1);
+    AppModel* model= ((AppModel*)(view->GetModel()));
+    HC_KEY model_key = view->GetModel()->GetModelKey();
+    HC_Open_Segment_By_Key(model_key);
+        HC_Open_Segment("");
+            ENTITY_LIST entityList;
+            BODY* sphere = NULL;
+            api_solid_sphere(SPAposition(0, 0, 0), 1, sphere, NULL);
+            entityList.add(sphere);
+            HA_Render_Entities(entityList);
+            model->AddAcisEntity(sphere);
+        HC_Close_Segment();
+    HC_Close_Segment();
+    model->Write("E://1.png",view,1,400, 400);
+
+
+    AppView *view2 = (AppView *)m_clientMap.value(2);
+    AppModel* model2= ((AppModel*)(view2->GetModel()));
+    HC_KEY model_key2 = view2->GetModel()->GetModelKey();
+    HC_Open_Segment_By_Key(model_key2);
+        HC_Open_Segment("");
+            ENTITY_LIST entityList2;
+            BODY* sphere2 = NULL;
+            api_solid_sphere(SPAposition(1, 0, 0), 1, sphere2, NULL);
+            entityList2.add(sphere2);
+            HA_Render_Entities(entityList2);
+            model2->AddAcisEntity(sphere2);
+        HC_Close_Segment();
+    HC_Close_Segment();
+    model2->Write("E://2.png",view,1,400, 400);
+
+
+}
+//! 发送二进制消息  发送给消息来源方
+void WebsocketServer::binaryMessageReceived(const QByteArray &message)
+{
+    QWebSocket *pSender = qobject_cast<QWebSocket *>(sender());
+    pSender->sendBinaryMessage(message);
+}
+//! 发送文本消息 发送给消息来源方
+void WebsocketServer::processMessage(QString message)
+{
+    //获取当前信号槽 对应连接 sender()
+    QWebSocket *pSender = qobject_cast<QWebSocket *>(sender());
+    pSender->sendTextMessage(message);
+}
+
+//! 连接断开
+void WebsocketServer::socketDisconnected()
+{
+    QWebSocket *pClient = qobject_cast<QWebSocket *>(sender());
+    if (pClient)
+    {
+        AppView *view = m_clientMap.value(1);
+       // AppModel* model= ((AppModel*)(view->GetModel()));
+      //  delete model;
+     //   model =0;
+        delete view;
+        view = 0;
+        m_clientMap.remove(1);
+        pClient->deleteLater();
+    }
+}
+