Ver código fonte

0530 vtk文件需解决切片和流线

caizm 2 anos atrás
pai
commit
72416f6022
70 arquivos alterados com 3282 adições e 1438 exclusões
  1. 2 2
      CAE_Solution/conf/conf_recv.txt
  2. 2 2
      CAE_Solution/conf/conf_send.txt
  3. 65 11
      CAE_Solution/src/VTK/Manager/ResultMeshManager.cpp
  4. 7 93
      CAE_Solution/src/VTK/Manager/ResultMeshManager.h
  5. 36 4
      CAE_Solution/src/VTK/Manager/meshmanager.cpp
  6. 3 3
      CAE_Solution/src/VTK/Manager/meshmanager.h
  7. 407 0
      CAE_Solution/src/VTK/Manager/resultmanager.cpp
  8. 207 0
      CAE_Solution/src/VTK/Manager/resultmanager.h
  9. 1039 0
      CAE_Solution/src/VTK/Manager/resultvtkmanager.cpp
  10. 111 0
      CAE_Solution/src/VTK/Manager/resultvtkmanager.h
  11. 8 1
      CAE_Solution/src/VTK/QVTKRenderer/qvtkrenderer.cpp
  12. 7 15
      CAE_Solution/src/VTK/display/contourdisplay.cpp
  13. 5 5
      CAE_Solution/src/VTK/display/contourdisplay.h
  14. 5 3
      CAE_Solution/src/VTK/display/linedisplay.cpp
  15. 4 4
      CAE_Solution/src/VTK/display/linedisplay.h
  16. 2 1
      CAE_Solution/src/VTK/display/slicewidget.cpp
  17. 3 3
      CAE_Solution/src/VTK/display/slicewidget.h
  18. 4 3
      CAE_Solution/src/VTK/display/solidsurfacewidget.cpp
  19. 4 4
      CAE_Solution/src/VTK/display/solidsurfacewidget.h
  20. 3 2
      CAE_Solution/src/VTK/display/streamwidget.cpp
  21. 4 5
      CAE_Solution/src/VTK/display/streamwidget.h
  22. 5 3
      CAE_Solution/src/VTK/display/vectordisplay.cpp
  23. 4 4
      CAE_Solution/src/VTK/display/vectordisplay.h
  24. 1 1
      CAE_Solution/src/VTK/mesh/Mesh_CSDInp.h
  25. 1 1
      CAE_Solution/src/VTK/mesh/Mesh_Frd.h
  26. 1 1
      CAE_Solution/src/VTK/mesh/mesh.cpp
  27. 1 1
      CAE_Solution/src/VTK/mesh/mesh_adi.h
  28. 1 1
      CAE_Solution/src/VTK/mesh/mesh_tecplot.h
  29. 1 1
      CAE_Solution/src/VTK/mesh/mesh_ugrid.h
  30. 5 1
      CAE_Solution/src/VTK/visualization_VTK/vtkVISAddUnGridDataSource.cpp
  31. 1 1
      CAE_Solution/src/VTK/visualization_VTK/vtkVISAddUnGridDataSource.h
  32. 2 2
      CAE_Solution/src/VTK/visualization_VTK/vtkVISMeshToVTKSource.h
  33. 9 7
      CAE_Solution/src/VTK/visualization_VTK/vtkVISUnContour.cpp
  34. 1 1
      CAE_Solution/src/VTK/visualization_VTK/vtkVISUnContour.h
  35. 1 1
      CAE_Solution/src/VTK/visualization_VTK/vtkVISUnGlyph.h
  36. 6 0
      CAE_Solution/src/VTK/visualization_VTK/vtkVISUnSlice.cpp
  37. 1 1
      CAE_Solution/src/VTK/visualization_VTK/vtkVISUnSlice.h
  38. 2 5
      CAE_Solution/src/VTK/visualization_VTK/vtkVISUnStreamTrace.cpp
  39. 1 2
      CAE_Solution/src/VTK/visualization_VTK/vtkVISUnStreamTrace.h
  40. 30 25
      CAE_Solution/src/VTK/visualization_VTK/vtkviscameramanager.cpp
  41. 1 1
      CAE_Solution/src/VTK/visualization_VTK/vtkviscameramanager.h
  42. 12 8
      CAE_Solution/src/VTK/visualization_VTK/vtkvismanager.cpp
  43. 4 2
      CAE_Solution/src/VTK/visualization_VTK/vtkvismeshbasetovtksource.cpp
  44. 1 1
      CAE_Solution/src/VTK/visualization_VTK/vtkvismeshbasetovtksource.h
  45. 207 204
      CAE_Solution/src/VTK/visualization_VTK/vtkvisunshademesh.cpp
  46. 44 38
      CAE_Solution/src/VTK/visualization_VTK/vtkvisunstructuredgridmanager.cpp
  47. 1 1
      CAE_Solution/src/VTK/visualization_VTK/vtkvisunstructuredgridmanager.h
  48. 65 62
      CAE_Solution/src/VTK/visualization_VTK/vtkvisunstructuredgridsource.cpp
  49. 1 1
      CAE_Solution/src/VTK/visualization_VTK/vtkvisunstructuredgridsource.h
  50. 6 1
      CAE_Solution/src/VTK/widget/contourdispalyWidget.cpp
  51. 7 1
      CAE_Solution/src/VTK/widget/linedisplayWidget.cpp
  52. 77 79
      CAE_Solution/src/main.cpp
  53. 5 5
      CAE_Solution/src/src.pro
  54. 63 47
      CAE_Solution/src/threadPool_and_statemachine/dealWith/boostjsonobject.cpp
  55. 12 16
      CAE_Solution/src/threadPool_and_statemachine/dealWith/boostjsonobject.h
  56. 3 0
      CAE_Solution/src/threadPool_and_statemachine/dealWith/display_struct.h
  57. 172 102
      CAE_Solution/src/threadPool_and_statemachine/dealWith/handlepool.cpp
  58. 12 6
      CAE_Solution/src/threadPool_and_statemachine/dealWith/handlepool.h
  59. 5 5
      CAE_Solution/src/threadPool_and_statemachine/dealWith/map_manager.h
  60. 0 367
      CAE_Solution/src/threadPool_and_statemachine/dealWith/vtkjsonobject.cpp
  61. 0 81
      CAE_Solution/src/threadPool_and_statemachine/dealWith/vtkjsonobject.h
  62. 0 100
      CAE_Solution/src/threadPool_and_statemachine/dealWith/vtkvisnativewidget.cpp
  63. 0 40
      CAE_Solution/src/threadPool_and_statemachine/dealWith/vtkvisnativewidget.h
  64. 0 43
      CAE_Solution/src/widget.h
  65. 0 3
      CAE_Solution/tests/axes_test/axes_test.pro
  66. 73 0
      CAE_Solution/tests/loadvtkfile/.gitignore
  67. 397 0
      CAE_Solution/tests/loadvtkfile/loadvtkfile.pro
  68. 110 0
      CAE_Solution/tests/loadvtkfile/tst_loadvtkfile_test.cpp
  69. 2 1
      CAE_Solution/tests/tests.pro
  70. 0 3
      CAE_Solution/tests/vtkcamera_test/vtkcamera_test.pro

+ 2 - 2
CAE_Solution/conf/conf_recv.txt

@@ -4,6 +4,6 @@ userName:admin
 password:admin
 
 channel_id:1
-queue_name:BLOCKcaein
+queue_name:BLOCKcaeint
 exchange_name:BLOCKMQ-EXCHANGE
-keys_name:caein
+keys_name:caeint

+ 2 - 2
CAE_Solution/conf/conf_send.txt

@@ -4,6 +4,6 @@ userName:admin
 password:admin
 
 channel_id:1
-queue_name:BLOCKcaeout
+queue_name:BLOCKcaeoutt
 exchange_name:BLOCKMQ-EXCHANGE
-keys_name:caeout
+keys_name:caeoutt

+ 65 - 11
CAE_Solution/src/VTK/Manager/ResultMeshManager.cpp

@@ -3,10 +3,15 @@
 #include <QString>
 #include <QFileInfo>
 #include "../QVTKRenderer/qvtkrenderer.h"
-#include "../mesh/mesh.h"
+#include "../mesh/Mesh.h"
 #include "../MeshDS/MeshBase.h"
 #include "../mesh/mesh_ugrid.h"
-
+#include "../display/contourdisplay.h"
+#include "../display/linedisplay.h"
+#include "../display/slicewidget.h"
+#include "../display/solidsurfacewidget.h"
+#include "../display/streamwidget.h"
+#include "../display/vectordisplay.h"
 #include "../visualization_VTK/vtkVISUnContour.h"
 #include "../visualization_VTK/vtkvisunstructuredgridsource.h"
 #include "ResultMeshManager.h"
@@ -25,7 +30,13 @@
 #include <vtkTextActor.h>
 #include "../visualization_VTK/vtkvismeshbasetovtksource.h"
 #include "vtkPoints.h"
-
+#include "../widget/linedisplayWidget.h"
+#include "../widget/contourdispalyWidget.h"
+#include "../widget/slicedisplaywidget.h"
+#include "../widget/solidsurfaceDisplaywidget.h"
+#include "../widget/Sslicewidget.h"
+#include "../widget/streamDisplaywidget.h"
+#include "../widget/vectorDisplaywidget.h"
 
 //ResultMeshManager* ResultMeshManager::m_pInstance = 0;
 
@@ -107,6 +118,14 @@ ResultMeshManager::ResultMeshManager()
     meshType = 0;
     xyplot2dSlice_ = NULL;
     currentVISGridVec_.clear();
+
+    showHideVec_.clear();
+    vectorScalarIndexVec.clear();
+    TimeMeshVec_.clear();
+    source = NULL;
+    unmesh = NULL;
+    uncontour = NULL;
+    uncontourVec_.clear();
 }
 
 /**
@@ -288,6 +307,19 @@ void ResultMeshManager::Clear()
     dispNameVec.clear();
     HaveModalMeshFlag = false;
     meshType = 0;
+    if(source!=NULL){
+        source->Delete();
+        source = NULL;
+    }
+    if(unmesh != NULL){
+        unmesh->Delete();
+        unmesh = NULL;
+    }
+    if(uncontour != NULL){
+        uncontour->Delete();
+        uncontour = NULL;
+    }
+    qDeleteAll(uncontourVec_);
 }
 
 /**
@@ -370,7 +402,7 @@ void ResultMeshManager::DisplayMesh(QVTKRenderer *qvtkRenderer)
             {
                 if (source->GetVtkUnMesh(i) != NULL)
                 {
-                    map<double, map<string, vtkVISUnContour*>>::iterator contourIt = vtkVisZoneMeshMap_.find(meshObj_->GetSovleTime());
+                    map<double, map<string, vtkVISUnContour*>>::iterator contourIt = vtkVisZoneMeshMap_.find(meshObj_->GetSovleTime());//key sovletime
                     if (contourIt != vtkVisZoneMeshMap_.end())
                     {
                         contourMap = contourIt->second;
@@ -1125,6 +1157,11 @@ void ResultMeshManager::SetStremWidget(StreamDisplayWidget* w)
         streamW_->SetData_w(GetMeshScalarNameVec());
     }
 }
+
+void ResultMeshManager::SetXyplotWidget(XYPlot_2D *w)
+{
+
+}
 /**
   * @brief init xyplot2d Widget pointer
   *
@@ -1814,7 +1851,7 @@ void ResultMeshManager::UpdataCurrUnstructSource()
   * @author zhaoyu
   * @date 20230302
   */
-void ResultMeshManager::CreatVectorSource(string u, string v, string w)
+void ResultMeshManager::CreatVectorSource(string u, string v, string w,double x,double y,double z)
 {
     UpdataCurrUnstructSource();
     char* v1 = (char*)(u.c_str());
@@ -1829,11 +1866,11 @@ void ResultMeshManager::CreatVectorSource(string u, string v, string w)
         streamLine_ = NULL;
     }
 
-    if (currAddDataSource_ != NULL)
-    {
-        streamLine_ = vtkVISUnStreamTrace::New();
-        streamLine_->SetRenderTo(render_->GetRenderer());
-        streamLine_->SetDataSource(currAddDataSource_->GetSource());
+//    if (currAddDataSource_ != NULL)
+//    {
+//        streamLine_ = vtkVISUnStreamTrace::New();
+//        streamLine_->SetRenderTo(render_->GetRenderer());
+//        streamLine_->SetDataSource(currAddDataSource_->GetSource());
         streamLine_->SetStreamTraceSource(v1,v2,v3);
         string type = "line";
         streamLine_->SetSeedsType(type);
@@ -1845,7 +1882,11 @@ void ResultMeshManager::CreatVectorSource(string u, string v, string w)
             streamW_->SetMaxPropgationData(streamLine_->GetMaxPropagation());
             streamW_->SetMinStepData(streamLine_->GetMinimumStep());
         }
-    }
+    //}
+    //create_streamTrace(x,y,z);
+    Q_UNUSED(x);
+    Q_UNUSED(y);
+    Q_UNUSED(z);
 }
 
 /**
@@ -2442,6 +2483,11 @@ void ResultMeshManager::HideXyplot2dSliceActors()
         xyplot2dSlice_->ShowOffCutActor();
     }
 }
+
+void ResultMeshManager::GetExportPictures(QString file)
+{
+
+}
 /**
   * @brief set xyplot2d unslice position
   *
@@ -2491,6 +2537,14 @@ Mesh *ResultMeshManager::getMeshObj_()
 {
     return this->meshObj_;
 }
+
+void ResultMeshManager::create_streamTrace(double x, double y, double z)
+{
+    if(streamLine_!=NULL){
+        streamLine_->SetStreamLineStartPosition(x,y,z);
+        streamLine_->CreateOneStreamLine();
+    }
+}
 /**
   * @brief get xyplot2d unslice data
   *

+ 7 - 93
CAE_Solution/src/VTK/Manager/ResultMeshManager.h

@@ -1,41 +1,9 @@
 #ifndef RESULTMESHMANAGER_H
 #define RESULTMESHMANAGER_H
 
-#include <vector>
-#include <map>
-#include <QStringList>
-#include "../widget/contourdispalyWidget.h"
-#include "../widget/linedisplayWidget.h"
-#include "../widget/slicedisplaywidget.h"
-#include "../widget/solidsurfaceDisplaywidget.h"
-#include "../widget/streamDisplaywidget.h"
-#include "../widget/vectorDisplaywidget.h"
-#include "../QVTKRenderer/qvtkrenderer.h"
-#include "../visualization_VTK/vtkVISAddUnGridDataSource.h"
-#include "../visualization_VTK/vtkVISUnSlice.h"
-#include "../visualization_VTK/vtkVISUnStreamTrace.h"
-
-
-#include "../MeshDS/PointDS.h"
-using namespace std;
-
-#include <set>
-
-class QString;
-class vtkVISUnContour;
-class vtkVISUnGlyph;
-class vtkVISUnShadeMesh;
-
-class Mesh;
-class QVTKRenderer;
-class MeshBase;
-
-class ContourInimationW;
-class SsliceWidget;
-class StreamWidget;
-class XYPlot_2D;
-
-class ResultMeshManager
+#include "resultmanager.h"
+
+class ResultMeshManager : public ResultManager
 {
 public:
     ResultMeshManager();
@@ -112,7 +80,7 @@ public:
 
     //vtkstreamtrace
     void UpdataCurrUnstructSource();
-    void CreatVectorSource(string u, string v, string w);
+    void CreatVectorSource(string u, string v, string w,double x,double y,double z);
     void DisplayStreamLine(string direction, string type, double initStrp, double maxPropgation, double minStep, bool showState, bool ToolState);
     void SetStreamSelectState(bool flag);
     void DeleteAllStream();
@@ -141,63 +109,9 @@ public:
     string getScalarName();
     double* getRange();
     Mesh* getMeshObj_();
-    map<double, map<string, vtkVISUnContour*>>  vtkVisZoneMeshMap_;  //id, <zoneid, mesh>.
-public:
-    int m_currId;
-    Mesh *meshObj_;  //mesh object.
-    //mesh vis objects.  vtk vis functions.
-
-    map<double, map<string, vtkVISUnGlyph*>> vtkVisZoneGlyphMap_; //id, <zoneid, mesh>.
-    map<double, map<string, vtkVISUnShadeMesh*>> vtkVisZoneUnShadeMeshMap_;//solveTime zoneName unShadeMesh
-    set<double> solveTimes_;
-    set<string> currShowZoneNameSet_;
-    vector<string> zoneNameVec_;
-    map<string, int> nameTypeMap_;
-    QVTKRenderer* render_;
-    vector<bool> showHideVec_;
-    vtkVISAddUnGridDataSource* addDataSource_;
-    vtkVISAddUnGridDataSource* currAddDataSource_;
-    double range_[2];
-    int scalarIndex;
-    int scalarLeave;
-    vtkVISUnStreamTrace* streamLine_;
-
-    ContourDisplayW* contourWidget_;
-    LineDisplayW* lineWidget_;
-    VectorW* vectorWidget_;
-    //ContourInimationW* animationWidget_;
-    SolidSurfaceWidget* solidSurfaceW_;
-    SsliceWidget* sliceW_;
-    StreamDisplayWidget* streamW_;
-    //TextWidget* textW_;
-    //XYPlot_2D* xyplot2dW_;
-    double titleSize_;
-    double labelSize_;
-
-    bool changeRangeFlag;
-    bool surfaceHideFlag; //true is hide, false is show
-
-    int displayType;//0 is contour; 2 is line; 3 is vector
-
-    double scaleFactor_;
-    vector<int> vectorScalarIndexVec;
-    vector<double> surfaceActorColor_;
-    double surfaceActorTransparency_;
-    string scalarName_;
-    string allZoneScalarName_;
-    vector<vtkVISUnSlice*> unSliceVec_;
-
-    //vtkVISCaptureFigure *captureF;
-    vtkTextActor *titleText_;
-    vector<Mesh*> MeshVec_;//frd format analys result
-    vector<Mesh*> TimeMeshVec_;
-    vector<Mesh*> ModalMeshVec_;
-    PointsDS* initPointsData;
-    vector<string> dispNameVec;
-    bool HaveModalMeshFlag;
-    int meshType;//0 is time step, 1 is modal step
-    vtkVISUnSlice* xyplot2dSlice_;
-    vector<vtkVISAddUnGridDataSource*> currentVISGridVec_;
+
+    void create_streamTrace(double x,double y,double z);
+
 };
 
 

+ 36 - 4
CAE_Solution/src/VTK/Manager/meshmanager.cpp

@@ -4,11 +4,11 @@
 #include <QFileInfo>
 
 #include "../QVTKRenderer/qvtkrenderer.h"
-#include "../mesh/mesh.h"
+#include "../mesh/Mesh.h"
 #include "../mesh/mesh_ugrid.h"
 #include "../visualization_VTK//vtkvisunshademesh.h"
 #include "../visualization_VTK/vtkvisunstructuredgridsource.h"
-#include "../Manager/meshmanager.h"
+#include "../Manager/MeshManager.h"
 #include "../visualization_VTK/vtkvismeshbasetovtksource.h"
 #include "../mesh/mesh_tecplot.h"
 
@@ -44,6 +44,8 @@
 MeshManager::MeshManager()
 {
     meshObj_ = 0;
+    vtksource = NULL;
+    vtkunshade_ = NULL;
 }
 
 /**
@@ -109,6 +111,15 @@ void MeshManager::Clear()
         }
     }
     vtkVisZonePatchesMap_.clear();
+
+    if(vtksource!=NULL){
+        delete vtksource;
+        vtksource = NULL;
+    }
+    if(vtkunshade_!=NULL){
+        vtkunshade_->Delete();
+        vtkunshade_ = NULL;
+    }
 }
 
 /**
@@ -146,6 +157,19 @@ bool MeshManager::LoadData(const QString &datafile)
     }
     else if (extType == "cgns" || extType == "cgs")
     {
+    }else if(extType == "vtk")
+    {
+        QString datafile_ = datafile;
+#ifdef _WIN32
+        datafile_.replace("/","\\");
+#endif
+        try{      
+            vtksource = vtkVISUnstructuredGridSource::New();
+            vtksource->LoadData((char*)datafile_.toStdString().c_str());
+            return true;
+        }catch(exception ex){
+            return false;
+        }
     }
     else
     {
@@ -165,6 +189,14 @@ bool MeshManager::LoadData(const QString &datafile)
   */
 void MeshManager::DisplayMesh(QVTKRenderer *qvtkRenderer)
 {
+    if(vtksource!=NULL){//渲染vtk
+
+        vtkunshade_ = vtkVISUnShadeMesh::New();
+        vtkunshade_->SetRenderTo(qvtkRenderer->GetRenderer());
+        vtkunshade_->SetDataSource(vtksource);
+        vtkunshade_->CreateShadeMeshDisplay(0);
+        return;
+    }
     if (meshObj_ == 0)  return;
     if (qvtkRenderer == 0)  return;
     size_t nzone = meshObj_->GetZoneNumber();
@@ -203,7 +235,7 @@ void MeshManager::DisplayMesh(QVTKRenderer *qvtkRenderer)
                     vtkVISUnShadeMesh* visobj = vtkVISUnShadeMesh::New();
                     visobj->SetRenderTo(qvtkRenderer->GetRenderer());
                     visobj->SetDataSource(unGrid);
-                    visobj->CreateShadeMeshDisplay(1);
+                    visobj->CreateShadeMeshDisplay(0);//0---线框图  1---实体
                     vtkVisZoneMeshMap_[i] = visobj;
                 }
             }
@@ -239,7 +271,7 @@ void MeshManager::DisplayMesh(QVTKRenderer *qvtkRenderer)
                         vtkVISUnShadeMesh *visobj = vtkVISUnShadeMesh::New();
                         visobj->SetRenderTo(qvtkRenderer->GetRenderer());
                         visobj->SetDataSource(unGrid);
-                        visobj->CreateShadeMeshDisplay(1);
+                        visobj->CreateShadeMeshDisplay(1);//0---线框图  1---实体
                         visPatchMap[*it] = visobj;
                     }
                 }

+ 3 - 3
CAE_Solution/src/VTK/Manager/meshmanager.h

@@ -8,8 +8,7 @@ using namespace std;
 
 class QString;
 class vtkVISUnShadeMesh;
-
-
+class vtkVISUnstructuredGridSource;
 class Mesh;
 
 
@@ -39,9 +38,10 @@ private:
     //mesh vis objects.  hoops vis functions.
 
     //mesh vis objects.  vtk vis functions.
-    //vtkVISUnstructuredGridSource *source;
     map<size_t, vtkVISUnShadeMesh*>   vtkVisZoneMeshMap_;  //zoneid, mesh.
     map<size_t, map<int, vtkVISUnShadeMesh*> >  vtkVisZonePatchesMap_;  //zoneid, <patchtag, mesh>.
+    vtkVISUnShadeMesh* vtkunshade_;
+    vtkVISUnstructuredGridSource* vtksource;
 };
 
 #endif

+ 407 - 0
CAE_Solution/src/VTK/Manager/resultmanager.cpp

@@ -0,0 +1,407 @@
+#include "resultmanager.h"
+
+ResultManager::ResultManager()
+{
+
+}
+
+ResultManager::~ResultManager()
+{
+  cout<<"asdf"<<endl;
+}
+
+bool ResultManager::LoadData(QString name)
+{
+    return true;
+}
+
+void ResultManager::DisplayMesh(QVTKRenderer *qvtkRenderer)
+{
+    Q_UNUSED(qvtkRenderer);
+}
+
+void ResultManager::DisplayMeshByIndex(int index)
+{
+    Q_UNUSED(index);
+}
+
+QVTKRenderer *ResultManager::GetQVtkRender()
+{
+    return this->render_;
+}
+
+string ResultManager::deleteSpaces(string str)
+{
+    return str;
+}
+
+void ResultManager::SetSaveIndex(int index)
+{
+    Q_UNUSED(index);
+}
+
+int ResultManager::GetCurrIndex()
+{
+    return 1;
+}
+
+set<double> ResultManager::GetSolveTime()
+{
+    set<double> set_;
+    return set_;
+}
+
+vector<string> ResultManager::GetZoneNameVec()
+{
+    return zoneNameVec_;
+}
+
+void ResultManager::SetNameTypeMap()
+{
+
+}
+
+map<string, int> ResultManager::GetNameTypeMap()
+{
+    return nameTypeMap_;
+}
+
+void ResultManager::Clear()
+{
+
+}
+
+vector<string> ResultManager::GetMeshScalarNameVec()
+{
+    return dispNameVec;
+}
+
+void ResultManager::SetShowHideState(vector<bool> vec)
+{
+
+}
+
+void ResultManager::ShowAll()
+{
+
+}
+
+void ResultManager::InitRange(int index)
+{
+    Q_UNUSED(index);
+}
+
+double *ResultManager::GetScalarRange()
+{
+    return range_;
+}
+
+void ResultManager::ModifyScalarDisplay(int index)
+{
+    Q_UNUSED(index);
+}
+
+void ResultManager::ModifyScalarDisplay(string name)
+{
+
+}
+
+int ResultManager::GetScalarIndex()
+{
+    return scalarIndex;
+}
+
+void ResultManager::SetContourLevel(int level)
+{
+    Q_UNUSED(level);
+}
+
+int ResultManager::GetContourLevel()
+{
+    return scalarLeave;
+}
+
+void ResultManager::SetCotourWidget(ContourDisplayW *w)
+{
+    contourWidget_ = w;
+}
+
+void ResultManager::SetLineWidget(LineDisplayW *w)
+{
+    lineWidget_ = w;
+}
+
+void ResultManager::SetVectorWidget(VectorW *w)
+{
+    vectorWidget_ = w;
+}
+
+void ResultManager::SetSurfaceSolidWidget(SolidSurfaceWidget *w)
+{
+    solidSurfaceW_ = w;
+}
+
+void ResultManager::SetSliceWidget(SsliceWidget *w)
+{
+    sliceW_ = w;
+}
+
+void ResultManager::SetStremWidget(StreamDisplayWidget *w)
+{
+    streamW_ = w;
+}
+
+void ResultManager::SetXyplotWidget(XYPlot_2D *w)
+{
+    Q_UNUSED(w);
+}
+
+void ResultManager::SetWidgetRange()
+{
+
+}
+
+void ResultManager::SetWidgetScalarName()
+{
+
+}
+
+void ResultManager::SetTitleSize(double size)
+{
+    Q_UNUSED(size);
+}
+
+void ResultManager::SetLabelSize(double size)
+{
+    Q_UNUSED(size);
+}
+
+void ResultManager::SetLevel(int level)
+{
+    Q_UNUSED(level);
+}
+
+void ResultManager::SetWidgetLevel()
+{
+
+}
+
+void ResultManager::SetRange(double *range)
+{
+    Q_UNUSED(range);
+}
+
+void ResultManager::SetDisplayType(int type)
+{
+    Q_UNUSED(type);
+}
+
+void ResultManager::InitWidgetsParameter()
+{
+
+}
+
+vector<int> ResultManager::GetShowZoneId()
+{
+    vector<int> vec_;
+    return vec_;
+}
+
+void ResultManager::SetVectorScalarIndex(vector<int> indexVec)
+{
+
+}
+
+void ResultManager::SetVectorScaleFactor(double factor)
+{
+    Q_UNUSED(factor);
+}
+
+void ResultManager::SetSurfaceColor(vector<double> color)
+{
+
+}
+
+void ResultManager::SetSurfaceTransparency(double value)
+{
+    Q_UNUSED(value);
+}
+
+void ResultManager::SetSurfaceShowHideFlag(bool flag)
+{
+    Q_UNUSED(flag);
+}
+
+void ResultManager::SetScalarName(string name)
+{
+
+}
+
+void ResultManager::MakeVISUnStructGrid()
+{
+
+}
+
+void ResultManager::DisplayUnstructGrid()
+{
+
+}
+
+void ResultManager::InitSliceWidget()
+{
+
+}
+
+vector<double> ResultManager::GetUnslicePosition(int index)
+{
+    Q_UNUSED(index);
+    vector<double> vec_;
+    return vec_;
+}
+
+vector<double> ResultManager::GetUnsliceSourceBounds(int index)
+{
+    Q_UNUSED(index);
+    vector<double> vec_;
+    return vec_;
+}
+
+void ResultManager::SetAllSliceState(vector<int> sliceId, vector<bool> solidState, vector<bool> planeWidgetState, vector<vector<double> > nomal, vector<vector<double> > posision, vector<string> type, vector<string> contourName, vector<int> level, vector<bool> planeState, vector<bool> labelState)
+{
+
+}
+
+void ResultManager::UpdataSliceWidgetParameter()
+{
+
+}
+
+void ResultManager::UpdataCurrUnstructSource()
+{
+
+}
+
+void ResultManager::CreatVectorSource(string u, string v, string w, double x, double y, double z)
+{
+    Q_UNUSED(u);Q_UNUSED(v);Q_UNUSED(w);Q_UNUSED(x);Q_UNUSED(y);Q_UNUSED(z);
+
+}
+
+void ResultManager::DisplayStreamLine(string direction, string type, double initStrp, double maxPropgation, double minStep, bool showState, bool ToolState)
+{
+    Q_UNUSED(direction);Q_UNUSED(type);Q_UNUSED(initStrp);Q_UNUSED(maxPropgation);Q_UNUSED(minStep);Q_UNUSED(showState);Q_UNUSED(ToolState);
+}
+
+void ResultManager::SetStreamSelectState(bool flag)
+{
+    Q_UNUSED(flag);
+}
+
+void ResultManager::DeleteAllStream()
+{
+
+}
+
+void ResultManager::HideAllActors()
+{
+
+}
+
+void ResultManager::HideAllUnshadeMeshActors()
+{
+
+}
+
+void ResultManager::HideAllContourActors()
+{
+
+}
+
+void ResultManager::HideAllGlyphActors()
+{
+
+}
+
+void ResultManager::HideSliceActors()
+{
+
+}
+
+void ResultManager::HideStreamActors()
+{
+
+}
+
+void ResultManager::HideXyplot2dSliceActors()
+{
+
+}
+
+void ResultManager::GetExportPictures(QString file)
+{
+    Q_UNUSED(file);
+}
+
+void ResultManager::GetActorText(string text_, vector<double> position_XY, double fontsize, vector<double> color)
+{
+    Q_UNUSED(text_);Q_UNUSED(position_XY);Q_UNUSED(fontsize);Q_UNUSED(color);
+}
+
+void ResultManager::UpdataZoomModel(double factor)
+{
+    Q_UNUSED(factor);
+}
+
+void ResultManager::ChangeMeshType(int type)
+{
+    Q_UNUSED(type);
+}
+
+void ResultManager::DisplayXyplot2dSlice(int meshIndex, int scalarIndex)
+{
+    Q_UNUSED(meshIndex);
+    Q_UNUSED(scalarIndex);
+}
+
+vector<double> ResultManager::GetXyplot2dUnslicePosition()
+{
+    vector<double> vec_;
+    return vec_;
+}
+
+void ResultManager::SetXyplot2dSliceNormal(int normalIndex)
+{
+    Q_UNUSED(normalIndex);
+}
+
+void ResultManager::SetXyplot2dSliceScalarIndex(int index)
+{
+    Q_UNUSED(index);
+}
+
+void ResultManager::SetXyplot2dSlicePosition(vector<double> p)
+{
+    Q_UNUSED(p);
+}
+
+
+
+string ResultManager::getScalarName()
+{
+    return scalarName_;
+}
+
+double *ResultManager::getRange()
+{
+    return range_;
+}
+
+Mesh *ResultManager::getMeshObj_()
+{
+    return meshObj_;
+}
+
+void ResultManager::create_streamTrace(double x, double y, double z)
+{
+    Q_UNUSED(x);Q_UNUSED(y);Q_UNUSED(z);
+}

+ 207 - 0
CAE_Solution/src/VTK/Manager/resultmanager.h

@@ -0,0 +1,207 @@
+#ifndef RESULTMANAGER_H
+#define RESULTMANAGER_H
+#include <vector>
+#include <set>
+#include <map>
+#include <string>
+#include <QStringList>
+#include "../visualization_VTK/vtkVISAddUnGridDataSource.h"
+#include "../visualization_VTK/vtkVISUnSlice.h"
+#include "../visualization_VTK/vtkVISUnStreamTrace.h"
+#include "../MeshDS/PointDS.h"
+using namespace std;
+class QString;
+class vtkVISUnContour;
+class vtkVISUnGlyph;
+class vtkVISUnShadeMesh;
+class Mesh;
+class QVTKRenderer;
+class MeshBase;
+class ContourInimationW;
+class XYPlot_2D;
+class ContourDisplayW;
+class LineDisplayW;
+class SliceDisplayWidget;
+class SolidSurfaceWidget;
+class StreamDisplayWidget;
+class VectorW;
+class SsliceWidget;
+class StreamDisplayWidget;
+
+class ResultManager
+{
+public:
+    ResultManager();
+    ~ResultManager();
+    virtual bool LoadData(QString name);
+
+    //vtk vis functions.
+    virtual void DisplayMesh(QVTKRenderer *qvtkRenderer = 0);
+    virtual void DisplayMeshByIndex(int index = 0);
+    virtual QVTKRenderer *GetQVtkRender();
+    virtual string deleteSpaces(string);
+
+    virtual void SetSaveIndex(int index);
+    virtual int GetCurrIndex();
+    virtual set<double> GetSolveTime();
+    virtual vector<string> GetZoneNameVec();
+    virtual void SetNameTypeMap();
+    virtual map<string, int> GetNameTypeMap();
+    virtual void Clear();
+    virtual vector<string> GetMeshScalarNameVec();
+    virtual void SetShowHideState(vector<bool> vec);
+    virtual void ShowAll();
+    virtual void InitRange(int index);
+    virtual double* GetScalarRange();
+    virtual void ModifyScalarDisplay(int index);
+    virtual void ModifyScalarDisplay(string name);
+    virtual int GetScalarIndex();
+    virtual void SetContourLevel(int level);
+    virtual int GetContourLevel();
+
+    virtual void SetCotourWidget(ContourDisplayW* w);
+    virtual void SetLineWidget(LineDisplayW* w);
+    virtual void SetVectorWidget(VectorW* w);
+    //virtual void SetAnimationWidget(ContourInimationW* w);
+    virtual void SetSurfaceSolidWidget(SolidSurfaceWidget* w);
+    virtual void SetSliceWidget(SsliceWidget* w);
+    virtual void SetStremWidget(StreamDisplayWidget* w);
+    //virtual void SetTextWidget(TextWidget* w);
+    virtual void SetXyplotWidget(XYPlot_2D* w);
+    virtual void SetWidgetRange();
+    virtual void SetWidgetScalarName();
+    virtual void SetTitleSize(double size);
+    //virtual void SetWidgetTitleSize();
+    virtual void SetLabelSize(double size);
+    //virtual void SetWidgetLabelSize();
+    virtual void SetLevel(int level);
+    virtual void SetWidgetLevel();
+    virtual void SetRange(double* range);
+    virtual void SetDisplayType(int type);
+    virtual void InitWidgetsParameter();
+    virtual vector<int> GetShowZoneId();
+
+    virtual void SetVectorScalarIndex(vector<int> indexVec);
+    virtual void SetVectorScaleFactor(double factor);
+
+    virtual void SetSurfaceColor(vector<double> color);
+    virtual void SetSurfaceTransparency(double value);
+    virtual void SetSurfaceShowHideFlag(bool flag);
+
+    virtual void SetScalarName(string name);
+    //vtkunslice
+    virtual void MakeVISUnStructGrid();
+    virtual void DisplayUnstructGrid();
+    virtual void InitSliceWidget();
+    virtual vector<double> GetUnslicePosition(int index);
+    virtual vector<double> GetUnsliceSourceBounds(int index);
+    virtual void SetAllSliceState(vector<int> sliceId, vector<bool> solidState, vector<bool> planeWidgetState, vector<vector<double>> nomal,
+                          vector<vector<double>> posision, vector<string> type, vector<string> contourName, vector<int> level,
+                          vector<bool> planeState, vector<bool>labelState);
+    virtual void UpdataSliceWidgetParameter();
+
+    //vtkstreamtrace
+    virtual void UpdataCurrUnstructSource();
+    virtual void CreatVectorSource(string u, string v, string w,double x,double y,double z);
+    virtual void DisplayStreamLine(string direction, string type, double initStrp, double maxPropgation, double minStep, bool showState, bool ToolState);
+    virtual void SetStreamSelectState(bool flag);
+    virtual void DeleteAllStream();
+
+    ///hide actors
+    virtual void HideAllActors();
+    virtual void HideAllUnshadeMeshActors();
+    virtual void HideAllContourActors();
+    virtual void HideAllGlyphActors();
+    virtual void HideSliceActors();
+    virtual void HideStreamActors();
+    virtual void HideXyplot2dSliceActors();
+
+    virtual void GetExportPictures(QString file);
+    virtual void GetActorText(string text_,vector<double> position_XY,double fontsize,vector<double> color);
+    virtual void UpdataZoomModel(double factor);
+    virtual void ChangeMeshType(int type);
+    virtual void DisplayXyplot2dSlice(int meshIndex, int scalarIndex);
+    virtual vector<double> GetXyplot2dUnslicePosition();
+    virtual void SetXyplot2dSliceNormal(int normalIndex);
+    virtual void SetXyplot2dSliceScalarIndex(int index);
+    virtual void SetXyplot2dSlicePosition(vector<double> p);
+    //virtual vector<vector<double>> GetXyplot2dUnsliceData();
+    //virtual vector<string> GetXyplot2dAxisName();
+
+    virtual string getScalarName();
+    virtual double* getRange();
+    virtual Mesh* getMeshObj_();
+
+    //virtual Mesh* getMeshObj_();
+
+
+    virtual void create_streamTrace(double x,double y,double z);
+public:
+    map<double, map<string, vtkVISUnContour*>>  vtkVisZoneMeshMap_;  //id, <zoneid, mesh>.
+    int m_currId;
+    Mesh *meshObj_;  //mesh object.
+    //mesh vis objects.  vtk vis functions.
+
+    map<double, map<string, vtkVISUnGlyph*>> vtkVisZoneGlyphMap_; //id, <zoneid, mesh>.
+    map<double, map<string, vtkVISUnShadeMesh*>> vtkVisZoneUnShadeMeshMap_;//solveTime zoneName unShadeMesh
+    set<double> solveTimes_;
+    set<string> currShowZoneNameSet_;
+    vector<string> zoneNameVec_;
+    map<string, int> nameTypeMap_;
+    QVTKRenderer* render_;
+    vector<bool> showHideVec_;
+    vtkVISAddUnGridDataSource* addDataSource_;
+    vtkVISAddUnGridDataSource* currAddDataSource_;
+    double range_[2];
+    int scalarIndex;
+    int scalarLeave;
+    vtkVISUnStreamTrace* streamLine_;
+
+    ContourDisplayW* contourWidget_;
+    LineDisplayW* lineWidget_;
+    VectorW* vectorWidget_;
+    //ContourInimationW* animationWidget_;
+    SolidSurfaceWidget* solidSurfaceW_;
+    SsliceWidget* sliceW_;
+    StreamDisplayWidget* streamW_;
+    //TextWidget* textW_;
+    //XYPlot_2D* xyplot2dW_;
+    double titleSize_;
+    double labelSize_;
+
+    bool changeRangeFlag;
+    bool surfaceHideFlag; //true is hide, false is show
+
+    int displayType;//0 is contour; 2 is line; 3 is vector
+
+    double scaleFactor_;
+    vector<int> vectorScalarIndexVec;
+    vector<double> surfaceActorColor_;
+    double surfaceActorTransparency_;
+    string scalarName_;
+    string allZoneScalarName_;
+    vector<vtkVISUnSlice*> unSliceVec_;
+
+    //vtkVISCaptureFigure *captureF;
+    vtkTextActor *titleText_;
+    vector<Mesh*> MeshVec_;//frd format analys result
+    vector<Mesh*> TimeMeshVec_;
+    vector<Mesh*> ModalMeshVec_;
+    PointsDS* initPointsData;
+    vector<string> dispNameVec;
+    bool HaveModalMeshFlag;
+    int meshType;//0 is time step, 1 is modal step
+    vtkVISUnSlice* xyplot2dSlice_;
+    vector<vtkVISAddUnGridDataSource*> currentVISGridVec_;
+
+    vtkVISUnstructuredGridSource* source;
+    vtkVISUnShadeMesh* unmesh;
+    vtkVISUnContour* uncontour;
+    vector<vtkVISUnContour*> uncontourVec_;
+    vtkVISUnGlyph* unglyph;
+    vtkVISUnShadeMesh* solidSurfaceMesh;
+
+    string fileType;
+};
+
+#endif // RESULTMANAGER_H

+ 1039 - 0
CAE_Solution/src/VTK/Manager/resultvtkmanager.cpp

@@ -0,0 +1,1039 @@
+#include "resultvtkmanager.h"
+#include <string>
+#include <QString>
+#include <QFileInfo>
+#include "../visualization_VTK/vtkVISUnContour.h"
+#include "../visualization_VTK/vtkvisunshademesh.h"
+#include "../visualization_VTK/vtkVISAddUnGridDataSource.h"
+#include "../visualization_VTK/vtkvisunstructuredgridsource.h"
+#include "../display/contourdisplay.h"
+#include "../display/linedisplay.h"
+#include "../display/slicewidget.h"
+#include "../display/solidsurfacewidget.h"
+#include "../display/streamwidget.h"
+#include "../display/vectordisplay.h"
+#include "../widget/contourdispalyWidget.h"
+#include "../widget/linedisplayWidget.h"
+#include "../widget/slicedisplaywidget.h"
+#include "../widget/solidsurfaceDisplaywidget.h"
+#include "../widget/Sslicewidget.h"
+#include "../widget/streamDisplaywidget.h"
+#include "../widget/vectorDisplaywidget.h"
+#include "../visualization_VTK/vtkVISUnGlyph.h"
+
+/*
+ * @brief: the constructor
+ * @param:
+ * @ret:
+ * @birth: created by czm in 20230519
+ */
+ResultVTKManager::ResultVTKManager()
+{
+    meshObj_ = 0;
+    m_currId = -1;
+    scalarIndex = -1;
+    range_[0] = 0;
+    range_[1] = 0;
+    scalarLeave = 10;
+    titleSize_ = 6;
+    labelSize_ = 5;
+
+//    animationWidget_ = NULL;
+    contourWidget_ = NULL;
+    lineWidget_ = NULL;
+    vectorWidget_ = NULL;
+    solidSurfaceW_ = NULL;
+    sliceW_ = NULL;
+    streamW_ = NULL;
+//    xyplot2dW_ = NULL;
+
+    changeRangeFlag = false;
+    surfaceHideFlag = true;
+    displayType = -1;
+    scaleFactor_ = 0.02;
+
+    solveTimes_.clear();
+    zoneNameVec_.clear();
+    currShowZoneNameSet_.clear();
+    surfaceActorColor_.clear();
+    scalarName_.clear();
+    allZoneScalarName_.clear();
+
+    surfaceActorColor_.push_back(0);
+    surfaceActorColor_.push_back(0);
+    surfaceActorColor_.push_back(1);
+    surfaceActorTransparency_ = 1;
+
+    addDataSource_ = NULL;
+    currAddDataSource_ = NULL;
+    unSliceVec_.clear();
+
+    streamLine_ = NULL;
+    render_ = NULL;
+    titleText_ = NULL;
+    MeshVec_.clear();
+    ModalMeshVec_.clear();
+    initPointsData = NULL;
+    dispNameVec.clear();
+    HaveModalMeshFlag = false;
+    meshType = 0;
+    xyplot2dSlice_ = NULL;
+    currentVISGridVec_.clear();
+
+    showHideVec_.clear();
+    vectorScalarIndexVec.clear();
+    TimeMeshVec_.clear();
+    source = NULL;
+    unmesh = NULL;
+    uncontour = NULL;
+    uncontourVec_.clear();
+}
+
+/*
+ * @brief: the destructor
+ * @param:
+ * @ret:
+ * @birth: created by czm in 20230519
+ */
+ResultVTKManager::~ResultVTKManager()
+{
+    this->Clear();
+}
+
+/*
+ * @brief: load vtk file
+ * @param: path
+ * @ret: bool
+ * @birth: created by czm in 20230519
+ */
+bool ResultVTKManager::LoadData(QString name)
+{
+    QFileInfo fileinfo_(name);
+    if(!fileinfo_.isFile()){
+        return false;
+    }
+    source =vtkVISUnstructuredGridSource::New();
+    source->LoadData((char*)name.toStdString().c_str());
+    return true;
+}
+
+/*
+ * @brief: render mesh
+ * @param: renderer
+ * @ret: void
+ * @birth: created by czm in 20230519
+ */
+void ResultVTKManager::DisplayMesh(QVTKRenderer *qvtkRenderer)
+{
+    unmesh = vtkVISUnShadeMesh::New();
+    this->render_ = qvtkRenderer;
+    unmesh->SetRenderTo(qvtkRenderer->GetRenderer());
+    unmesh->SetDataSource(source);
+    //unmesh->CreateShadeMeshDisplay(false);//线框图
+    unmesh->CreateShadeMeshDisplay(true);//阴影图
+    uncontour = vtkVISUnContour::New();
+    uncontour->SetDataSource(source);
+    uncontour->SetRenderTo(qvtkRenderer->GetRenderer());
+    uncontourVec_.push_back(uncontour);
+    unglyph = vtkVISUnGlyph::New();
+    unglyph->SetDataSource(source);
+    unglyph->SetRenderTo(qvtkRenderer->GetRenderer());
+//    solidSurfaceMesh = vtkVISUnShadeMesh::New();
+//    solidSurfaceMesh->SetDataSource(source);
+//    solidSurfaceMesh->SetRenderTo(qvtkRenderer->GetRenderer());
+    streamLine_ = vtkVISUnStreamTrace::New();
+    streamLine_->SetDataSource(source);
+    streamLine_->SetRenderTo(qvtkRenderer->GetRenderer());
+}
+
+/*
+ * @brief: display mesh by index
+ * @param: index
+ * @ret: void
+ * @birth: created by czm in 20230522
+ */
+void ResultVTKManager::DisplayMeshByIndex(int index)
+{
+    bool scalarBarState = true;
+    m_currId = index;
+    HideSliceActors();
+    HideXyplot2dSliceActors();
+    if(surfaceHideFlag)
+    {
+        if(unmesh!=NULL){
+            unmesh->SetColor(surfaceActorColor_[0],surfaceActorColor_[1],surfaceActorColor_[2]);
+            unmesh->SetOpacity(surfaceActorTransparency_);
+            unmesh->ShowOn();
+        }
+    }else{
+        unmesh->ShowOff();
+    }
+    if(displayType == 0 || displayType == 2){//contour
+        HideAllGlyphActors();
+        InitRange(index);
+        if(uncontour!=NULL){
+            uncontour->SetContourType(displayType);
+            uncontour->SetContourLevel(scalarLeave);
+            uncontour->ModifyContourDisplay((char*)scalarName_.c_str());
+            uncontour->DeleteScalarBar();
+            uncontour->CreateScalarBar();
+            uncontour->ModifyDisplayScalarRange(range_[0],range_[1]);
+            //uncontour->ShowOffScalarBar();
+            uncontour->ShowOn();
+            if(scalarBarState)       // to do
+            {
+                scalarBarState != uncontour->UpdataScalarBar();
+                if(!scalarBarState)
+                {
+                    uncontour->ShowOnScalarBar();
+                }
+            }
+        }
+    }else if(displayType == 3)
+    {
+        HideAllContourActors();
+        if(unglyph!=NULL){
+            unglyph->InitGlyphDisplay(vectorScalarIndexVec[0],vectorScalarIndexVec[1],vectorScalarIndexVec[2]);
+            unglyph->SetGlyphScaleFactor(scaleFactor_);
+            unglyph->ShowOn();
+        }
+    }
+    render_->ZoomToExtents();
+}
+
+QVTKRenderer *ResultVTKManager::GetQVtkRender()
+{
+    return this->render_;
+}
+
+string ResultVTKManager::deleteSpaces(string str)
+{
+    QChar h0 = 0x00;
+    QString str_;
+    if(QString::fromStdString(str).contains(h0)){
+        str_=QString::fromStdString(str).replace(h0,"");
+    }
+    return str_.toStdString();
+}
+
+void ResultVTKManager::SetSaveIndex(int index)
+{
+
+}
+
+int ResultVTKManager::GetCurrIndex()
+{
+    return m_currId;
+}
+
+/*
+ * @brief: set name type map
+ * @param: void
+ * @ret: void
+ * @birth: created by czm in 20230519
+ */
+void ResultVTKManager::SetNameTypeMap()
+{
+    source->LoadScalarData();
+    for(int i = 0;i<source->GetScalarNumber();i++){
+       string name = source->GetScalarName(i);
+       if(source->scalarSource[i]->GetDataSize()>0){//判断是cell还是point
+           nameTypeMap_[name] = 0;
+       }else{
+            nameTypeMap_[name] = 1;
+       }
+    }
+}
+
+/*
+ * @brief: get name type map
+ * @param: void
+ * @ret: map
+ * @birth: created by czm in 20230519
+ */
+map<string, int> ResultVTKManager::GetNameTypeMap()
+{
+    return nameTypeMap_;
+}
+
+void ResultVTKManager::Clear()
+{
+    if (meshObj_)
+    {
+        //delete meshObj_;
+        meshObj_ = NULL;
+    }
+    m_currId = -1;
+    scalarIndex = -1;
+    range_[0] = 0;
+    range_[1] = 0;
+    scalarLeave = 10;
+    titleSize_ = 6;
+    labelSize_ = 5;
+    changeRangeFlag = false;
+    surfaceHideFlag = true;
+    displayType = -1;
+    scaleFactor_ = 0.02;
+
+    solveTimes_.clear();
+    zoneNameVec_.clear();
+    currShowZoneNameSet_.clear();
+    nameTypeMap_.clear();
+    showHideVec_.clear();
+    surfaceActorColor_.clear();
+    scalarName_.clear();
+    allZoneScalarName_.clear();
+
+    //vtk vis procs.
+    for(map<double, map<string, vtkVISUnContour*>>::iterator it = vtkVisZoneMeshMap_.begin(); it != vtkVisZoneMeshMap_.end(); ++it)
+    {
+        for(map<string, vtkVISUnContour*>::iterator itin = it->second.begin(); itin != it->second.end(); ++itin)
+        {
+            itin->second->Delete();
+        }
+        it->second.clear();
+    }
+    vtkVisZoneMeshMap_.clear();
+
+    for(map<double, map<string, vtkVISUnShadeMesh*>>::iterator it = vtkVisZoneUnShadeMeshMap_.begin(); it != vtkVisZoneUnShadeMeshMap_.end(); ++it)
+    {
+        for(map<string, vtkVISUnShadeMesh*>::iterator itin = it->second.begin(); itin != it->second.end(); ++itin)
+        {
+            itin->second->Delete();
+        }
+        it->second.clear();
+    }
+    vtkVisZoneUnShadeMeshMap_.clear();
+    for(map<double, map<string, vtkVISUnGlyph*>>::iterator it = vtkVisZoneGlyphMap_.begin(); it != vtkVisZoneGlyphMap_.end(); ++it)
+    {
+        for(map<string, vtkVISUnGlyph*>::iterator itin = it->second.begin(); itin != it->second.end(); ++itin)
+        {
+            itin->second->Delete();
+        }
+        it->second.clear();
+    }
+    vtkVisZoneGlyphMap_.clear();
+
+    if (!unSliceVec_.empty())
+    {
+        for (int i = 0; i < unSliceVec_.size(); i ++)
+        {
+            if(unSliceVec_.at(i) != NULL)
+            {
+                unSliceVec_.at(i)->Delete();
+                unSliceVec_.at(i) = NULL;
+            }
+        }
+        unSliceVec_.clear();
+    }
+
+    if (currentVISGridVec_.size() != 0)
+    {
+        /*for (int i = 0; i < currentVISGridVec_.size(); i ++)
+        {
+            delete currentVISGridVec_.at(i);
+        }*/
+        currentVISGridVec_.clear();
+    }
+
+    if (addDataSource_ != NULL)
+    {
+
+        delete addDataSource_;
+        addDataSource_ = NULL;
+    }
+
+    if (currAddDataSource_ != NULL)
+    {
+        delete currAddDataSource_;
+        currAddDataSource_ = NULL;
+    }
+
+    DeleteAllStream();
+    if (streamLine_ != NULL)
+    {
+        streamLine_->Delete();
+        streamLine_ = NULL;
+    }
+
+    if (xyplot2dSlice_ != NULL)
+    {
+        xyplot2dSlice_->Delete();
+        xyplot2dSlice_ = NULL;
+    }
+
+    surfaceActorColor_.push_back(0);
+    surfaceActorColor_.push_back(0);
+    surfaceActorColor_.push_back(1);
+    surfaceActorTransparency_ = 1;
+
+//    if (animationWidget_ != NULL)
+//    {
+//        animationWidget_->RestoreWidget();
+//    }
+    if (contourWidget_ != NULL)
+    {
+        contourWidget_->RestoreWidget();
+    }
+    if (lineWidget_ != NULL)
+    {
+        lineWidget_->RestoreWidget();
+    }
+    if (vectorWidget_ != NULL)
+    {
+        //vectorWidget_->RestoreWidget();
+    }
+    if (solidSurfaceW_ != NULL)
+    {
+        //solidSurfaceW_->RestoreWidget();
+    }
+//    if (sliceW_ != NULL)
+//    {
+//        sliceW_->RestoreWidget();
+//    }
+    if (streamW_ != NULL)
+    {
+        //streamW_->RestoreWidget();
+    }
+//    if (xyplot2dW_ != NULL)
+//    {
+//        xyplot2dW_->RestoreWidget();
+//    }
+    if (render_ != NULL)
+    {
+        render_->HideAllActors();
+        render_ = NULL;
+    }
+    MeshVec_.clear();
+    TimeMeshVec_.clear();
+    ModalMeshVec_.clear();
+    if (initPointsData != NULL)
+    {
+        delete initPointsData;
+    }
+    initPointsData = NULL;
+    dispNameVec.clear();
+    HaveModalMeshFlag = false;
+    meshType = 0;
+    if(source!=NULL){
+        source->Delete();
+        source = NULL;
+    }
+    if(unmesh!=NULL){
+        unmesh->Delete();
+        unmesh = NULL;
+    }
+    if(uncontour!=NULL){
+        uncontour->Delete();
+        uncontour = NULL;
+    }
+    qDeleteAll(uncontourVec_);
+}
+
+/*
+ * @brief: get mesh scalar name vector
+ * @param: void
+ * @ret: vector
+ * @birth: created by czm in 20230519
+ */
+vector<string> ResultVTKManager::GetMeshScalarNameVec()
+{
+    vector<string> scalar_vec;
+    for(int i =0;i<source->scalarNumber_;i++){
+        scalar_vec.push_back(source->scalarName[i]);
+    }
+    return scalar_vec;
+}
+
+void ResultVTKManager::SetShowHideState(vector<bool> vec)
+{
+
+}
+
+void ResultVTKManager::ShowAll()
+{
+
+}
+
+/*
+ * @brief: init widget  scalar range
+ * @param: void
+ * @ret: void
+ * @birth: created by czm in 20230519
+ */
+void ResultVTKManager::InitRange(int index)
+{
+    Q_UNUSED(index);
+   int index_ = source->GetScalarIndex(scalarName_.data());
+   source->LoadOneScalarData(scalarName_.c_str());
+   range_[0] = source->scalarRange[index_][0];
+   range_[1] = source->scalarRange[index_][1];
+}
+
+/*
+ * @brief: get private range
+ * @param: void
+ * @ret: range
+ * @birth: created by czm in 20230421
+ */
+double *ResultVTKManager::GetScalarRange()
+{
+    return range_;
+}
+
+void ResultVTKManager::ModifyScalarDisplay(int index)
+{
+
+}
+
+/*
+ * @brief: change scalar display
+ * @param: scalarname
+ * @ret: void
+ * @birth: created by czm in 20230519
+ */
+void ResultVTKManager::ModifyScalarDisplay(string name)
+{
+    if(scalarName_!=name && !(name.empty()))
+    {
+        scalarName_ = name;
+        SetWidgetScalarName();
+        InitRange(m_currId);
+    }
+}
+
+int ResultVTKManager::GetScalarIndex()
+{
+    return scalarIndex;
+}
+
+void ResultVTKManager::SetContourLevel(int level)
+{
+
+}
+
+int ResultVTKManager::GetContourLevel()
+{
+    return scalarLeave;
+}
+
+/*
+ * @brief: init contourwidget pointer
+ * @param: contourwidget
+ * @ret: void
+ * @birth: created by czm in 20230519
+ */
+void ResultVTKManager::SetCotourWidget(ContourDisplayW *w)
+{
+    contourWidget_ = w;
+    contourWidget_->SetNameTypeMap(GetNameTypeMap());
+    contourWidget_->SetScalarNameVec(GetMeshScalarNameVec());
+//    SetWidgetRange();
+//    SetWidgetScalarName();
+}
+
+void ResultVTKManager::SetLineWidget(LineDisplayW *w)
+{
+    lineWidget_ = w;
+    lineWidget_->SetNameTypeMap(GetNameTypeMap());
+    lineWidget_->SetScalarNameVec(GetMeshScalarNameVec());
+    SetWidgetRange();
+    SetWidgetScalarName();
+}
+
+void ResultVTKManager::SetVectorWidget(VectorW *w)
+{
+    vectorWidget_ = w;
+    vectorWidget_->GetData_u(GetMeshScalarNameVec());
+    vectorWidget_->GetData_v(GetMeshScalarNameVec());
+    vectorWidget_->GetData_w(GetMeshScalarNameVec());
+    vectorWidget_->SetScaleFactor(scaleFactor_);
+}
+
+void ResultVTKManager::SetSurfaceSolidWidget(SolidSurfaceWidget *w)
+{
+    solidSurfaceW_ = w;
+}
+
+void ResultVTKManager::SetSliceWidget(SsliceWidget *w)
+{
+    sliceW_ = w;
+    sliceW_->GetScalarName(GetMeshScalarNameVec());
+}
+
+void ResultVTKManager::SetStremWidget(StreamDisplayWidget *w)
+{
+    streamW_ = w;
+    streamW_->SetData_u(GetMeshScalarNameVec());
+    streamW_->SetData_v(GetMeshScalarNameVec());
+    streamW_->SetData_w(GetMeshScalarNameVec());
+}
+
+void ResultVTKManager::SetXyplotWidget(XYPlot_2D *w)
+{
+
+}
+
+/*
+ * @brief: init widgets range parameter
+ * @param: void
+ * @ret: void
+ * @birth: created by czm in 20230519
+ */
+void ResultVTKManager::SetWidgetRange()
+{
+    if(contourWidget_){
+        contourWidget_->SetRange(range_);
+    }
+    if(lineWidget_){
+        lineWidget_->SetRange(range_);
+    }
+}
+
+/*
+ * @brief: init widget scalar name
+ * @param: void
+ * @ret: void
+ * @birth: created by czm in 20230519
+ */
+void ResultVTKManager::SetWidgetScalarName()
+{
+    if(!scalarName_.empty()){
+        string name = scalarName_;
+        if(contourWidget_){
+            contourWidget_->SetCurrScalar(name);
+        }
+        if(lineWidget_){
+            lineWidget_->SetCurrScalar(name);
+        }
+    }
+}
+
+void ResultVTKManager::SetLevel(int level)
+{
+    scalarLeave = level;
+    SetWidgetLevel();
+}
+
+void ResultVTKManager::SetWidgetLevel()
+{
+    if (contourWidget_ != NULL)
+    {
+        contourWidget_->SetLevel(scalarLeave);
+    }
+    if (lineWidget_ != NULL)
+    {
+        lineWidget_->SetLevel(scalarLeave);
+    }
+}
+
+void ResultVTKManager::SetRange(double *range)
+{
+    range_[0] = range[0];
+    range_[1] = range[1];
+    changeRangeFlag = true;
+}
+
+void ResultVTKManager::SetDisplayType(int type)
+{
+    displayType = type;
+}
+
+/*
+ * @brief: init widgets param
+ * @param: void
+ * @ret: void
+ * @birth: created by czm in 20230519
+ */
+void ResultVTKManager::InitWidgetsParameter()
+{
+    if(contourWidget_){
+
+        contourWidget_->SetScalarNameVec(GetMeshScalarNameVec());
+        SetWidgetRange();
+        SetWidgetScalarName();
+    }
+}
+
+void ResultVTKManager::SetVectorScalarIndex(vector<int> indexVec)
+{
+    vectorScalarIndexVec.clear();
+    if (indexVec.at(0) == -1 ||
+            indexVec.at(1) == -1 ||
+            indexVec.at(2) == -1)
+    {
+        return;
+    }else
+    {
+        vectorScalarIndexVec = indexVec;
+        DisplayMeshByIndex(m_currId);
+        unmesh->ShowOff();
+    }
+}
+
+void ResultVTKManager::SetVectorScaleFactor(double factor)
+{
+    scaleFactor_ = factor;
+}
+
+void ResultVTKManager::SetSurfaceColor(vector<double> color)
+{
+    surfaceActorColor_ = color;
+}
+
+void ResultVTKManager::SetSurfaceTransparency(double value)
+{
+    surfaceActorTransparency_ = value;
+}
+
+void ResultVTKManager::SetSurfaceShowHideFlag(bool flag)
+{
+    surfaceHideFlag = flag;
+}
+
+void ResultVTKManager::SetScalarName(string name)
+{
+
+}
+
+void ResultVTKManager::MakeVISUnStructGrid()
+{
+
+}
+
+void ResultVTKManager::DisplayUnstructGrid()
+{
+
+}
+
+void ResultVTKManager::InitSliceWidget()
+{
+    HideAllUnshadeMeshActors();
+    HideAllGlyphActors();
+    HideAllContourActors();
+    HideStreamActors();
+    HideXyplot2dSliceActors();
+
+    if (solidSurfaceW_ != NULL)
+    {
+        solidSurfaceW_->SetShowHideState(true);
+    }
+}
+
+vector<double> ResultVTKManager::GetUnslicePosition(int index)
+{
+    double* data2;
+    data2 = unSliceVec_.at(index)->GetSlicePlaneOrigin();
+    vector<double> origin;
+    origin.push_back(data2[0]);
+    origin.push_back(data2[1]);
+    origin.push_back(data2[2]);
+    return origin;
+}
+
+vector<double> ResultVTKManager::GetUnsliceSourceBounds(int index)
+{
+    vector<double> bounds;
+
+    if (unSliceVec_.at(index) != NULL)
+    {
+        double b[6];
+        unSliceVec_.at(index)->GetSourceBounds_FD(b);
+        for (int i = 0; i < 6; i ++)
+        {
+            bounds.push_back(b[i]);
+        }
+    }
+    return bounds;
+}
+
+void ResultVTKManager::SetAllSliceState(vector<int> sliceId, vector<bool> solidState, vector<bool> planeWidgetState, vector<vector<double> > nomal, vector<vector<double> > posision, vector<string> type, vector<string> contourName, vector<int> level, vector<bool> planeState, vector<bool> labelState)
+{
+    for (int i = 0; i < sliceId.size(); i ++)
+    {
+        if (solidState.at(i))
+        {
+            unSliceVec_.at(sliceId.at(i))->ShowOnUnshadeMesh();
+        }else
+        {
+            unSliceVec_.at(sliceId.at(i))->ShowOffUnShadeMesh();
+        }
+
+        if (planeWidgetState.at(i))
+        {
+            unSliceVec_.at(sliceId.at(i))->ShowOnSlicePlane();
+            unSliceVec_.at(sliceId.at(i))->ShowOnSlicePlaneWidget();
+        }else
+        {
+            unSliceVec_.at(sliceId.at(i))->ShowOffSlicePlane();
+            unSliceVec_.at(sliceId.at(i))->ShowOffSlicePlaneWidget();
+        }
+        unSliceVec_.at(sliceId.at(i))->SetSlicePlaneNormal(nomal.at(i).at(0), nomal.at(i).at(1),nomal.at(i).at(2));
+        unSliceVec_.at(sliceId.at(i))->SetSlicePlaneOrigin(posision.at(i).at(0), posision.at(i).at(1),posision.at(i).at(2));
+
+        if (type.at(i) == "contour")
+        {
+            unSliceVec_.at(sliceId.at(i))->ShowOnUnSliceContourDisplay();
+            unSliceVec_.at(sliceId.at(i))->ShowOffUnSliceContourLinesDisplay();
+        }else if(type.at(i) == "line")
+        {
+            unSliceVec_.at(sliceId.at(i))->ShowOnUnSliceContourLinesDisplay();
+            unSliceVec_.at(sliceId.at(i))->ShowOffUnSliceContourDisplay();
+        }
+
+        char* name = (char*)(contourName.at(i).c_str());
+        unSliceVec_.at(sliceId.at(i))->ModifySliceSourceScalar_FD(name);
+
+        unSliceVec_.at(sliceId.at(i))->ModifyUnSliceContourLevel(level.at(i));
+
+        if (planeState.at(i))
+        {
+            //unSliceVec_.at(sliceId.at(i))->ShowOnSlicePlane();
+        }else
+        {
+            unSliceVec_.at(sliceId.at(i))->ShowOffCutActor();
+        }
+
+        if (labelState.at(i))
+        {
+            unSliceVec_.at(sliceId.at(i))->ShowOnUnSliceContourLinesLabelDisplay();
+        }else
+        {
+            unSliceVec_.at(sliceId.at(i))->ShowOffUnSliceContourLinesLabelDisplay();
+        }
+    }
+
+    for (int i = 0; i < unSliceVec_.size(); i ++)
+    {
+        if (find(sliceId.begin(), sliceId.end(), i) == sliceId.end())
+        {
+            if (unSliceVec_.at(i) != NULL)
+            {
+                unSliceVec_.at(i)->ShowOffSlicePlane();
+                unSliceVec_.at(i)->ShowOffSlicePlaneWidget();
+                unSliceVec_.at(i)->ShowOffUnShadeMesh();
+                unSliceVec_.at(i)->ShowOffUnSliceMesh();
+                unSliceVec_.at(i)->ShowOffUnSliceShade();
+                unSliceVec_.at(i)->ShowOffCutActor();
+                unSliceVec_.at(i)->Delete();
+                unSliceVec_.at(i) = NULL;
+            }
+        }
+    }
+    render_->Update();
+}
+
+void ResultVTKManager::UpdataSliceWidgetParameter()
+{
+
+}
+
+void ResultVTKManager::UpdataCurrUnstructSource()
+{
+
+}
+
+void ResultVTKManager::CreatVectorSource(string u, string v, string w, double x, double y, double z)
+{
+    char* v1 = (char*)(u.c_str());
+    char* v2 = (char*)(v.c_str());
+    char* v3 = (char*)(w.c_str());
+
+    if (streamLine_ != NULL)
+    {
+        streamLine_->ShowOffStreamWidget();
+        streamLine_->ShowOffStreamTraceLines();
+        streamLine_->Delete();
+        streamLine_ = NULL;
+    }
+
+    if (currAddDataSource_ != NULL)
+    {
+        streamLine_ = vtkVISUnStreamTrace::New();
+        streamLine_->SetRenderTo(render_->GetRenderer());
+        streamLine_->SetDataSource(currAddDataSource_->GetSource());
+        streamLine_->SetStreamTraceSource(v1,v2,v3);
+        string type = "line";
+        streamLine_->SetSeedsType(type);
+        streamLine_->CreateStreamTraceDisplayByVector();
+
+        if (streamW_ != NULL)
+        {
+            streamW_->SetInitStepData(streamLine_->GetInitialStep());
+            streamW_->SetMaxPropgationData(streamLine_->GetMaxPropagation());
+            streamW_->SetMinStepData(streamLine_->GetMinimumStep());
+        }
+    }
+    Q_UNUSED(x);
+    Q_UNUSED(y);
+    Q_UNUSED(z);
+}
+
+void ResultVTKManager::DisplayStreamLine(string direction, string type, double initStrp, double maxPropgation, double minStep, bool showState, bool ToolState)
+{
+    if(streamLine_!=NULL)
+    {
+        char* direc = (char*)(direction.c_str());
+        streamLine_->ModifyIntegraDirection(direc);
+
+        //type
+        streamLine_->ShowOffStreamTraceLines();
+        char* streamType = (char*)type.c_str();
+        streamLine_->ModifyStreamStyle(streamType);
+
+
+        streamLine_->ModifyInitialStep(initStrp);
+        streamLine_->ModifyMaxPropagation(maxPropgation);
+        streamLine_->ModifyMinimumStep(minStep);
+
+        if (showState)
+        {
+            streamLine_->ShowOnStreamTraceLines();
+        }else
+        {
+            streamLine_->ShowOffStreamTraceLines();
+        }
+
+        if (ToolState)
+        {
+            streamLine_->ShowOnStreamWidget();
+        }else
+        {
+            streamLine_->ShowOffStreamWidget();
+        }
+    }
+    render_->Update();
+}
+
+void ResultVTKManager::SetStreamSelectState(bool flag)
+{
+
+}
+
+void ResultVTKManager::DeleteAllStream()
+{
+
+}
+
+/*
+ * @brief: hide all actors in th renderer
+ * @param: void
+ * @ret: void
+ * @birth: created by czm in 20230519
+ */
+void ResultVTKManager::HideAllActors()
+{
+    render_->HideAllActors();
+}
+
+void ResultVTKManager::HideAllUnshadeMeshActors()
+{
+    if(unmesh!=NULL){
+        unmesh->ShowOff();
+    }
+}
+
+void ResultVTKManager::HideAllContourActors()
+{
+    if(uncontour!=NULL){
+        uncontour->ShowOff();
+    }
+}
+
+void ResultVTKManager::HideAllGlyphActors()
+{
+    if(unglyph!=NULL)
+    {
+        unglyph->ShowOff();
+    }
+}
+
+void ResultVTKManager::HideSliceActors()
+{
+
+}
+
+void ResultVTKManager::HideStreamActors()
+{
+    if(streamLine_!=NULL)
+    {
+        streamLine_->ShowOff();
+    }
+}
+
+void ResultVTKManager::HideXyplot2dSliceActors()
+{
+
+}
+
+void ResultVTKManager::GetActorText(string text_, vector<double> position_XY, double fontsize, vector<double> color)
+{
+
+}
+
+void ResultVTKManager::UpdataZoomModel(double factor)
+{
+
+}
+
+void ResultVTKManager::ChangeMeshType(int type)
+{
+
+}
+
+void ResultVTKManager::DisplayXyplot2dSlice(int meshIndex, int scalarIndex)
+{
+
+}
+
+vector<double> ResultVTKManager::GetXyplot2dUnslicePosition()
+{
+    double* data2;
+    vector<double> origin;
+    if (xyplot2dSlice_ != NULL)
+    {
+        data2 = xyplot2dSlice_->GetSlicePlaneOrigin();
+        origin.push_back(data2[0]);
+        origin.push_back(data2[1]);
+        origin.push_back(data2[2]);
+    }else
+    {
+        origin.push_back(0);
+        origin.push_back(0);
+        origin.push_back(0);
+    }
+    return origin;
+}
+
+void ResultVTKManager::SetXyplot2dSliceNormal(int normalIndex)
+{
+
+}
+
+void ResultVTKManager::SetXyplot2dSliceScalarIndex(int index)
+{
+
+}
+
+void ResultVTKManager::SetXyplot2dSlicePosition(vector<double> p)
+{
+
+}
+
+
+
+/*
+ *@brief: get private scalar name
+ * @param: void
+ * @ret: scalarName
+ * @birth: created by czm in 20230519
+ */
+string ResultVTKManager::getScalarName()
+{
+    return this->scalarName_;
+}
+
+void ResultVTKManager::create_streamTrace(double x, double y, double z)
+{
+
+}

+ 111 - 0
CAE_Solution/src/VTK/Manager/resultvtkmanager.h

@@ -0,0 +1,111 @@
+#ifndef RESULTVTKMANAGER_H
+#define RESULTVTKMANAGER_H
+#include "resultmanager.h"
+#include "../visualization_VTK/vtkvisunstructuredgridsource.h"
+#include "../visualization_VTK/vtkvisunstructuredgridmanager.h"
+#include "../visualization_VTK/vtkVISManager.h"
+#include "../QVTKRenderer/qvtkrenderer.h"
+#include <QFileInfo>
+
+class ResultVTKManager : public ResultManager
+{
+public:
+    ResultVTKManager();
+    ~ResultVTKManager();
+    bool LoadData(QString name);
+    void DisplayMesh(QVTKRenderer *qvtkRenderer = 0);
+    void DisplayMeshByIndex(int index = 0);
+    QVTKRenderer *GetQVtkRender();
+    string deleteSpaces(string);
+
+    void SetSaveIndex(int index);
+    int GetCurrIndex();
+    //vector<string> GetZoneNameVec();
+    void SetNameTypeMap();
+    map<string, int> GetNameTypeMap();
+    void Clear();
+    vector<string> GetMeshScalarNameVec();
+    void SetShowHideState(vector<bool> vec);
+    void ShowAll();
+    void InitRange(int index);
+    double* GetScalarRange();
+    void ModifyScalarDisplay(int index);
+    void ModifyScalarDisplay(string name);
+    int GetScalarIndex();
+    void SetContourLevel(int level);
+    int GetContourLevel();
+
+    void SetCotourWidget(ContourDisplayW* w);
+    void SetLineWidget(LineDisplayW* w);
+    void SetVectorWidget(VectorW* w);
+    //void SetAnimationWidget(ContourInimationW* w);
+    void SetSurfaceSolidWidget(SolidSurfaceWidget* w);
+    void SetSliceWidget(SsliceWidget* w);
+    void SetStremWidget(StreamDisplayWidget* w);
+    //void SetTextWidget(TextWidget* w);
+    void SetXyplotWidget(XYPlot_2D* w);
+    void SetWidgetRange();
+    void SetWidgetScalarName();
+    //void SetWidgetTitleSize();
+    //void SetWidgetLabelSize();
+    void SetLevel(int level);
+    void SetWidgetLevel();
+    void SetRange(double* range);
+    void SetDisplayType(int type);
+    void InitWidgetsParameter();
+
+    void SetVectorScalarIndex(vector<int> indexVec);
+    void SetVectorScaleFactor(double factor);
+
+    void SetSurfaceColor(vector<double> color);
+    void SetSurfaceTransparency(double value);
+    void SetSurfaceShowHideFlag(bool flag);
+
+    void SetScalarName(string name);
+    //vtkunslice
+    void MakeVISUnStructGrid();
+    void DisplayUnstructGrid();
+    void InitSliceWidget();
+    vector<double> GetUnslicePosition(int index);
+    vector<double> GetUnsliceSourceBounds(int index);
+    void SetAllSliceState(vector<int> sliceId, vector<bool> solidState, vector<bool> planeWidgetState, vector<vector<double>> nomal,
+                          vector<vector<double>> posision, vector<string> type, vector<string> contourName, vector<int> level,
+                          vector<bool> planeState, vector<bool>labelState);
+    void UpdataSliceWidgetParameter();
+
+    //vtkstreamtrace
+    void UpdataCurrUnstructSource();
+    void CreatVectorSource(string u, string v, string w,double x,double y,double z);
+    void DisplayStreamLine(string direction, string type, double initStrp, double maxPropgation, double minStep, bool showState, bool ToolState);
+    void SetStreamSelectState(bool flag);
+    void DeleteAllStream();
+
+    ///hide actors
+    void HideAllActors();
+    void HideAllUnshadeMeshActors();
+    void HideAllContourActors();
+    void HideAllGlyphActors();
+    void HideSliceActors();
+    void HideStreamActors();
+    void HideXyplot2dSliceActors();
+
+    void GetActorText(string text_,vector<double> position_XY,double fontsize,vector<double> color);
+    void UpdataZoomModel(double factor);
+    void ChangeMeshType(int type);
+    void DisplayXyplot2dSlice(int meshIndex, int scalarIndex);
+    vector<double> GetXyplot2dUnslicePosition();
+    void SetXyplot2dSliceNormal(int normalIndex);
+    void SetXyplot2dSliceScalarIndex(int index);
+    void SetXyplot2dSlicePosition(vector<double> p);
+    //vector<vector<double>> GetXyplot2dUnsliceData();
+    //vector<string> GetXyplot2dAxisName();
+
+    string getScalarName();
+    // Mesh* getMeshObj_();
+
+    void create_streamTrace(double x,double y,double z);
+protected:
+
+};
+
+#endif // RESULTVTKMANAGER_H

+ 8 - 1
CAE_Solution/src/VTK/QVTKRenderer/qvtkrenderer.cpp

@@ -8,7 +8,14 @@
  */
 QVTKRenderer::QVTKRenderer()
 {
-
+    qvtkWidget = NULL;
+    renderWin = NULL;
+    renderer = NULL;
+    camera_ = NULL;
+    curRenderMode_ = 1;
+    surfaceVisible_ = false;
+    axes = NULL;
+    omWidget = NULL;
 }
 
 /*

+ 7 - 15
CAE_Solution/src/VTK/display/contourdisplay.cpp

@@ -1,13 +1,14 @@
 #include "contourdisplay.h"
 #include <QDebug>
-
+#include "../Manager/ResultMeshManager.h"
+#include "../Manager/resultvtkmanager.h"
 /*
  * @brief: the constructor
  * @param:
  * @ret:
  * @birth: created by czm in 20230420
  */
-ContourDisplay::ContourDisplay(ResultMeshManager* rs)
+ContourDisplay::ContourDisplay(ResultManager* rs)
 {
     //ResultMeshManager::getInstance()->SetCotourWidget(static_cast<ContourDisplayW*>(m_pWidget));
     //ResultMeshManager::getInstance()->SetWidgetRange();       //设置从页面获取的范围 range maxrange minrange
@@ -39,18 +40,9 @@ ContourDisplay::~ContourDisplay()
  */
 void ContourDisplay::contourdisplay_execute(boostJsonObject* jsonObj_)
 {
-
-    //apply setting data.
-    //ResultMeshManager::getInstance()->ModifyScalarDisplay(static_cast<ContourDisplayW*>(m_pWidget)->GetScalarName());//传入参数combox的current text(scalar name)
-    //ResultMeshManager::getInstance()->SetLevel(static_cast<ContourDisplayW*>(m_pWidget)->GetLevel());//传level的值,初始默认值为10
-    //ResultMeshManager::getInstance()->SetRange(static_cast<ContourDisplayW*>(m_pWidget)->GetRange());//
-
-    //ResultMeshManager::getInstance()->SetDisplayType(0);
-    //ResultMeshManager::getInstance()->DisplayMeshByIndex(ResultMeshManager::getInstance()->GetCurrIndex());
-
-//    Cmanager->HideAllActors();
     Cmanager->ShowAll();
     string tmp_scalarname = jsonObj_->cd_struct->scalarName;
+
     Cmanager->contourWidget_->SetCurrScalar(tmp_scalarname);
     Cmanager->contourWidget_->SetLevel(jsonObj_->cd_struct->level);
     Cmanager->contourWidget_->SetRange(jsonObj_->cd_struct->range);
@@ -59,14 +51,14 @@ void ContourDisplay::contourdisplay_execute(boostJsonObject* jsonObj_)
 
     this->range[0] = Cmanager->contourWidget_->GetRange()[0];
     this->range[1] = Cmanager->contourWidget_->GetRange()[1];
-
     Cmanager->SetLevel(Cmanager->contourWidget_->GetLevel());//传level的值,初始默认值为10
 
     Cmanager->SetRange(jsonObj_->cd_struct->range);//传入云图的maxrange和minrange
 
     Cmanager->SetDisplayType(0);//0 is contour; 2 is line; 3 is vector  判断显示
+    Cmanager->HideAllUnshadeMeshActors();//隐藏实体调hideallunshademeshactors接口
     Cmanager->DisplayMeshByIndex(0);//只显示实体、云图、等值线、矢量
-    //Cmanager->HideAllUnshadeMeshActors();//隐藏实体调hideallunshademeshactors接口
+
     Cmanager->SetNameTypeMap();
 }
 
@@ -76,7 +68,7 @@ void ContourDisplay::contourdisplay_execute(boostJsonObject* jsonObj_)
  * @ret: ResultMeshManager*
  * @birth: created by czm in 20230420
  */
-ResultMeshManager* ContourDisplay::getResultMeshManager()
+ResultManager* ContourDisplay::getResultManager()
 {
     return this->Cmanager;
 }

+ 5 - 5
CAE_Solution/src/VTK/display/contourdisplay.h

@@ -4,26 +4,26 @@
 #include <QObject>
 #include <map>
 #include <string>
-#include "../Manager/ResultMeshManager.h"
+class ResultManager;
 #include "../../threadPool_and_statemachine/dealWith/boostjsonobject.h"
 #include "../widget/contourdispalyWidget.h"
 
 
+
 class ContourDisplay
 {
 public:
-    ContourDisplay(ResultMeshManager* rs);
+    ContourDisplay(ResultManager* rs);
     ~ContourDisplay();
     QString getName() {
         return QObject::tr("Contour");
     }
     virtual void contourdisplay_execute(boostJsonObject*);
 
-    ResultMeshManager* getResultMeshManager();
+    ResultManager* getResultManager();
     double* getRange();
 private:
-    ResultMeshManager* Cmanager;
-    //ContourDisplayW* m_pWidget;
+    ResultManager* Cmanager;//多态
     double range[2];
 };
 

+ 5 - 3
CAE_Solution/src/VTK/display/linedisplay.cpp

@@ -1,5 +1,7 @@
 #include "linedisplay.h"
-
+#include "../Manager/ResultMeshManager.h"
+#include "../Manager/resultvtkmanager.h"
+#include "../widget/linedisplayWidget.h"
 
 /*
  * @brief: the constructor
@@ -7,7 +9,7 @@
  * @ret:
  * @birth: created by czm in 20230422
  */
-LineDisplay::LineDisplay(ResultMeshManager* rs)
+LineDisplay::LineDisplay(ResultManager* rs)
 {
     //ResultMeshManager::getInstance()->SetLineWidget(static_cast<LineDisplayW*>(m_pWidget));
     this->Cmanager = rs;
@@ -75,7 +77,7 @@ void LineDisplay::linedisplay_execute(boostJsonObject* jsonObj_)
  * @ret: resultmeshmanager
  * @birth: created by czm in 20230422
  */
-ResultMeshManager *LineDisplay::getResultMeshManager()
+ResultManager *LineDisplay::getResultManager()
 {
     return this->Cmanager;
 }

+ 4 - 4
CAE_Solution/src/VTK/display/linedisplay.h

@@ -3,24 +3,24 @@
 #include <QObject>
 #include <map>
 #include <string>
-#include "../Manager/ResultMeshManager.h"
+class ResultManager;
 #include "../../threadPool_and_statemachine/dealWith/boostjsonobject.h"
 
 
 class LineDisplay
 {
 public:
-    LineDisplay(ResultMeshManager* rs);
+    LineDisplay(ResultManager* rs);
     virtual ~LineDisplay();
     virtual QString getName() {
         return QObject::tr("Line");
     }
     virtual void linedisplay_execute(boostJsonObject*);
 
-    ResultMeshManager* getResultMeshManager();
+    ResultManager* getResultManager();
     double* getRange();
 private:
-    ResultMeshManager* Cmanager;
+    ResultManager* Cmanager;
     double range[2];
 };
 

+ 2 - 1
CAE_Solution/src/VTK/display/slicewidget.cpp

@@ -1,5 +1,6 @@
 #include "slicewidget.h"
 #include "../Manager/ResultMeshManager.h"
+#include "../Manager/resultvtkmanager.h"
 
 /*
  * @brief: the constructor
@@ -7,7 +8,7 @@
  * @ret:
  * @birth: created by czm in 20230424
  */
-SliceWidget::SliceWidget(ResultMeshManager* rs)
+SliceWidget::SliceWidget(ResultManager* rs)
 {
     this->Cmanager = rs;
 }

+ 3 - 3
CAE_Solution/src/VTK/display/slicewidget.h

@@ -1,6 +1,6 @@
 #pragma once
 #include <QObject>
-#include "../Manager/ResultMeshManager.h"
+class ResultManager;
 #include "../../threadPool_and_statemachine/dealWith/boostjsonobject.h"
 #include "../widget/Sslicewidget.h"
 #include "../widget/slicedisplaywidget.h"
@@ -8,11 +8,11 @@
 class SliceWidget
 {
 public:
-    SliceWidget(ResultMeshManager* rs);
+    SliceWidget(ResultManager* rs);
     virtual ~SliceWidget();
     virtual QString getName() { return QObject::tr("Slice"); }
 
     virtual void slicewidget_execute(boostJsonObject*);
 private:
-    ResultMeshManager* Cmanager;
+    ResultManager* Cmanager;
 };

+ 4 - 3
CAE_Solution/src/VTK/display/solidsurfacewidget.cpp

@@ -1,12 +1,13 @@
 #include "solidsurfacewidget.h"
-
+#include "../Manager/ResultMeshManager.h"
+#include "../Manager/resultvtkmanager.h"
 /*
  * @brief: the constructor
  * @param:
  * @ret:
  * @birth: created by czm in 20230505
  */
-SolidSurface::SolidSurface(ResultMeshManager* rs)
+SolidSurface::SolidSurface(ResultManager* rs)
 {
     this->Cmanager = rs;
 }
@@ -54,7 +55,7 @@ void SolidSurface::solidsurfce_execute(boostJsonObject* jsonObj_)
  * @ret: ResultMeshManager*
  * @birth: created by czm in 20230505
  */
-ResultMeshManager *SolidSurface::getResultMeshManager()
+ResultManager *SolidSurface::getResultManager()
 {
     return this->Cmanager;
 }

+ 4 - 4
CAE_Solution/src/VTK/display/solidsurfacewidget.h

@@ -1,20 +1,20 @@
 #pragma once
 #include <QObject>
-#include "../Manager/ResultMeshManager.h"
+class ResultManager;
 #include "../../threadPool_and_statemachine/dealWith/boostjsonobject.h"
 #include "../widget/solidsurfaceDisplaywidget.h"
 
 class SolidSurface
 {
 public:
-    SolidSurface(ResultMeshManager* rs);
+    SolidSurface(ResultManager* rs);
     virtual ~SolidSurface();
     virtual QString getName() { return QObject::tr("SolidSurface"); }
 
     virtual void solidsurfce_execute(boostJsonObject*);
 
-    ResultMeshManager* getResultMeshManager();
+    ResultManager* getResultManager();
 private:
-    ResultMeshManager* Cmanager;
+    ResultManager* Cmanager;
 };
 

+ 3 - 2
CAE_Solution/src/VTK/display/streamwidget.cpp

@@ -1,7 +1,8 @@
 #include "streamwidget.h"
 #include "../Manager/ResultMeshManager.h"
+#include "../Manager/resultvtkmanager.h"
 
-StreamWidget::StreamWidget(ResultMeshManager* rs)
+StreamWidget::StreamWidget(ResultManager* rs)
 {
     this->Cmanager = rs;
    // ResultMeshManager::getInstance()->SetStremWidget(static_cast<StreamWidget*>(m_pWidget));
@@ -11,7 +12,7 @@ StreamWidget::~StreamWidget()
     this->Cmanager = NULL;
 }
 
-ResultMeshManager *StreamWidget::getResultMeshManager()
+ResultManager *StreamWidget::getResultManager()
 {
     return this->Cmanager;
 }

+ 4 - 5
CAE_Solution/src/VTK/display/streamwidget.h

@@ -1,7 +1,6 @@
 #pragma once
-
 #include <QObject>
-#include "../Manager/ResultMeshManager.h"
+class ResultManager;
 #include "../../threadPool_and_statemachine/dealWith/boostjsonobject.h"
 #include "../widget/streamDisplaywidget.h"
 
@@ -10,13 +9,13 @@
 class StreamWidget
 {
 public:
-    StreamWidget(ResultMeshManager* rs);
+    StreamWidget(ResultManager* rs);
     virtual ~StreamWidget();
     virtual QString getName() { return QObject::tr("Stream"); }
     virtual void StreamWidget_execute(boostJsonObject*);
-    ResultMeshManager* getResultMeshManager();
+    ResultManager* getResultManager();
 private:
-    ResultMeshManager* Cmanager;
+    ResultManager* Cmanager;
 
 };
 

+ 5 - 3
CAE_Solution/src/VTK/display/vectordisplay.cpp

@@ -1,12 +1,14 @@
 #include "vectordisplay.h"
-
+#include "../Manager/ResultMeshManager.h"
+#include "../Manager/resultvtkmanager.h"
+#include "../widget/vectorDisplaywidget.h"
 /*
  * @brief: the constructor
  * @param:
  * @ret:
  * @birth: created by czm in 20230504
  */
-Vectordisplay::Vectordisplay(ResultMeshManager* rs)
+Vectordisplay::Vectordisplay(ResultManager* rs)
 {
     //ResultMeshManager::getInstance()->SetVectorWidget(static_cast<VectorW*>(m_pWidget));
     this->Cmanager = rs;
@@ -61,7 +63,7 @@ void Vectordisplay::vectordisplay_execute(boostJsonObject* object)
  * @ret: resultmeshmanager
  * @birth: created by czm in 20230504
  */
-ResultMeshManager *Vectordisplay::getResultMeshManager()
+ResultManager *Vectordisplay::getResultManager()
 {
     return this->Cmanager;
 }

+ 4 - 4
CAE_Solution/src/VTK/display/vectordisplay.h

@@ -1,20 +1,20 @@
 #pragma once
 #include <QObject>
 #include <vector>
-#include "../Manager/ResultMeshManager.h"
+class ResultManager;
 #include "../../threadPool_and_statemachine/dealWith/boostjsonobject.h"
 
 class Vectordisplay
 {
 public:
-    Vectordisplay(ResultMeshManager* rs);
+    Vectordisplay(ResultManager* rs);
     virtual ~Vectordisplay();
     virtual QString getName() { return QObject::tr("vector"); }
 
     virtual void vectordisplay_execute(boostJsonObject*);
 
-    ResultMeshManager* getResultMeshManager();
+    ResultManager* getResultManager();
 private:
-    ResultMeshManager* Cmanager;
+    ResultManager* Cmanager;
 };
 

+ 1 - 1
CAE_Solution/src/VTK/mesh/Mesh_CSDInp.h

@@ -4,7 +4,7 @@
 #include <fstream>
 #include <map>
 using namespace std;
-#include "mesh.h"
+#include "Mesh.h"
 
 
 

+ 1 - 1
CAE_Solution/src/VTK/mesh/Mesh_Frd.h

@@ -4,7 +4,7 @@
 #include <fstream>
 #include <iostream>
 using namespace std;
-#include "mesh.h"
+#include "Mesh.h"
 #include <vector>
 #include <map>
 #include <set>

+ 1 - 1
CAE_Solution/src/VTK/mesh/mesh.cpp

@@ -2,7 +2,7 @@
 #include "../MeshDS/MeshBase.h"
 #include "../MeshDS/meshstructured.h"
 #include "../MeshDS/meshunstructured.h"
-#include "mesh.h"
+#include "Mesh.h"
 #include <iostream>
 
 

+ 1 - 1
CAE_Solution/src/VTK/mesh/mesh_adi.h

@@ -1,7 +1,7 @@
 #ifndef MESH_ADI_H
 #define MESH_ADI_H
 
-#include "mesh.h"
+#include "Mesh.h"
 
 
 

+ 1 - 1
CAE_Solution/src/VTK/mesh/mesh_tecplot.h

@@ -4,7 +4,7 @@
 #include <fstream>
 #include <iostream>
 using namespace std;
-#include "mesh.h"
+#include "Mesh.h"
 
 class vtkDoubleArray;
 

+ 1 - 1
CAE_Solution/src/VTK/mesh/mesh_ugrid.h

@@ -2,7 +2,7 @@
 #define MESH_UGRID_H
 #include <fstream>
 using namespace std;
-#include "mesh.h"
+#include "Mesh.h"
 
 
 

+ 5 - 1
CAE_Solution/src/VTK/visualization_VTK/vtkVISAddUnGridDataSource.cpp

@@ -16,7 +16,11 @@ vtkVISAddUnGridDataSource::vtkVISAddUnGridDataSource()
 }
 vtkVISAddUnGridDataSource::~vtkVISAddUnGridDataSource()
 {
-    source_->Delete();
+    if(source_!=NULL){//0525
+        source_->Delete();
+        source_ = NULL;
+    }
+
 }
 
 void vtkVISAddUnGridDataSource::SetVISUnGridDataSource(vector<vtkVISUnstructuredGridSource*> vec)

+ 1 - 1
CAE_Solution/src/VTK/visualization_VTK/vtkVISAddUnGridDataSource.h

@@ -5,7 +5,7 @@
 #include <iostream>
 using namespace std;
 
-#include "vtkvismanager.h"
+#include "vtkVISManager.h"
 #include "vtkvisunstructuredgridsource.h"
 #include "vtkUnstructuredGridReader.h"
 #include "vtkPointData.h"

+ 2 - 2
CAE_Solution/src/VTK/visualization_VTK/vtkVISMeshToVTKSource.h

@@ -2,9 +2,9 @@
 #define VTKVISMESHTOVTKSOURCE_H
 
 
-#include "vtkvismanager.h"
+#include "vtkVISManager.h"
 #include "../MeshDS/MeshBase.h"
-#include "../mesh/mesh.h"
+#include "../mesh/Mesh.h"
 #include "vtkvisunstructuredgridsource.h"
 #include <iostream>
 #include <vector>

+ 9 - 7
CAE_Solution/src/VTK/visualization_VTK/vtkVISUnContour.cpp

@@ -50,6 +50,8 @@ vtkVISUnContour::~vtkVISUnContour()
         conFilter_ = NULL;
     }
     //delete [] _vtkObjects;
+
+    contourLookupTable_ = NULL;//0525
 }
 
 void vtkVISUnContour::CreateContourDisplay(char* scalarName)
@@ -58,7 +60,7 @@ void vtkVISUnContour::CreateContourDisplay(char* scalarName)
     bool pointOrCell = true;
 
     int scalarIndex = _source->GetScalarIndex(scalarName);
-
+    //int scalarIndex =0;
     if (scalarIndex == -1)
     {
         ErrorInfo(1, "Scalar not exists, can't create contour.");
@@ -1310,7 +1312,7 @@ void vtkVISUnContour::SetWarpScaleFactor(double value)
 
 void vtkVISUnContour::DeleteObjects()
 {
-    if (_unActor != 0)
+    /*if (_unActor != 0)
     {
         if(_renderer != 0)
         {
@@ -1318,25 +1320,25 @@ void vtkVISUnContour::DeleteObjects()
         }
         _unActor->Delete();
         _unActor = 0;
-    }
+    }*/
     if (_vtkObjects != 0)
     {
-        if (_vtkObjects[0] != 0)
+        if (_vtkObjects[0] != 0)//vtkunstructuregrid
         {
             _vtkObjects[0]->Delete();
             _vtkObjects[0] = 0;
         }
-        if (_vtkObjects[2] != 0)
+        if (_vtkObjects[2] != 0)//vtkcontourFilter
         {
             _vtkObjects[2]->Delete();
             _vtkObjects[2] = 0;
         }
-        if (_vtkObjects[4] != 0)
+        if (_vtkObjects[4] != 0)//vtkdatasetmapper
         {
             _vtkObjects[4]->Delete();
             _vtkObjects[4] = 0;
         }
-        if (_vtkObjects[5] != 0)
+        if (_vtkObjects[5] != 0)//vtkwarpvector
         {
             _vtkObjects[5]->Delete();
             _vtkObjects[5] = 0;

+ 1 - 1
CAE_Solution/src/VTK/visualization_VTK/vtkVISUnContour.h

@@ -5,7 +5,7 @@
 #include <iostream>
 #include <string>
 
-#include "vtkvismanager.h"
+#include "vtkVISManager.h"
 #include "vtkvisunstructuredgridmanager.h"
 #include <vtkGeometryFilter.h>
 #include <vtkPolyDataNormals.h>

+ 1 - 1
CAE_Solution/src/VTK/visualization_VTK/vtkVISUnGlyph.h

@@ -3,7 +3,7 @@
 
 
 #include <iostream>
-#include "vtkvismanager.h"
+#include "vtkVISManager.h"
 #include "vtkvisunstructuredgridmanager.h"
 #include <vtkGeometryFilter.h>
 #include <vtkPolyDataNormals.h>

+ 6 - 0
CAE_Solution/src/VTK/visualization_VTK/vtkVISUnSlice.cpp

@@ -209,6 +209,12 @@ vtkVISUnSlice::~vtkVISUnSlice()
         scalarSource_->Delete();
         scalarSource_ = 0;
     }
+
+    if(bandedContourFilter_!=NULL)
+    {
+        bandedContourFilter_->Delete();
+        bandedContourFilter_ = NULL;
+    }
     ErrorInfo(0, "destructure func 7 end.");
 }
 // --------------------------------------------------------------------------

+ 1 - 1
CAE_Solution/src/VTK/visualization_VTK/vtkVISUnSlice.h

@@ -3,7 +3,7 @@
 #include <iostream>
 using namespace std;
 
-#include "vtkvismanager.h"
+#include "vtkVISManager.h"
 #include "vtkvisunstructuredgridmanager.h"
 
 

+ 2 - 5
CAE_Solution/src/VTK/visualization_VTK/vtkVISUnStreamTrace.cpp

@@ -105,6 +105,7 @@ vtkVISUnStreamTrace::~vtkVISUnStreamTrace()
         if (actor != NULL)
         {
             actor->Delete ();
+            actor = NULL;
         }
 
         oneStreamActor_->Delete ();
@@ -136,22 +137,18 @@ vtkVISUnStreamTrace::~vtkVISUnStreamTrace()
     }
     if (pointWidget_ != NULL)
     {
-
-        pointWidget_->Delete();
+       pointWidget_->Delete();
     }
     if (lineWidget_ != NULL)
     {
-
         lineWidget_->Delete();
     }
     if (planeWidget_ != NULL)
     {
-
         planeWidget_->Delete();
     }
     if (sphereWidget_ != NULL)
     {
-
         sphereWidget_->Delete();
     }
     if (streamSource_ != NULL)

+ 1 - 2
CAE_Solution/src/VTK/visualization_VTK/vtkVISUnStreamTrace.h

@@ -4,7 +4,7 @@
 using namespace std;
 
 
-#include "vtkvismanager.h"
+#include "vtkVISManager.h"
 #include "vtkvisunstructuredgridmanager.h"
 
 #include "vtkLineWidget.h"
@@ -103,7 +103,6 @@ public:
 
     void ModifyDispalyScalarRange(double min, double max);
     int SelectState_;
-
 protected:
     int lineSeedsNumber;
 

+ 30 - 25
CAE_Solution/src/VTK/visualization_VTK/vtkviscameramanager.cpp

@@ -20,9 +20,14 @@ vtkVISCameraManager::vtkVISCameraManager()
 
 vtkVISCameraManager::~vtkVISCameraManager()
 {
+    if(trans_!=NULL)//0525
+    {
+        trans_->Delete();
+        trans_ = NULL;
+    }
 }
 
-void vtkVISCameraManager::GetCamera()//获取摄像机
+void vtkVISCameraManager::GetCamera()//鑾峰彇鎽勫儚鏈�
 {
 	if (_renderer == NULL) {
 		ErrorInfo(1, "Set render window first!");
@@ -31,7 +36,7 @@ void vtkVISCameraManager::GetCamera()//
 	camera_ = _renderer->GetActiveCamera();
 }
 
-void vtkVISCameraManager::ZoomOut()//缩小
+void vtkVISCameraManager::ZoomOut()//缂╁皬
 {
 	if (camera_ == NULL)
 	{
@@ -42,7 +47,7 @@ void vtkVISCameraManager::ZoomOut()//
 	_renWin->Render();
 }
 
-void vtkVISCameraManager::ZoomIn()//放大
+void vtkVISCameraManager::ZoomIn()//鏀惧ぇ
 {
 	if (camera_ == NULL)
 	{
@@ -53,7 +58,7 @@ void vtkVISCameraManager::ZoomIn()//
 	_renWin->Render();
 }
 
-void vtkVISCameraManager::Relocate()//自适应
+void vtkVISCameraManager::Relocate()//鑷�€傚簲
 {
 	if (_renderer == NULL)
 	{
@@ -64,7 +69,7 @@ void vtkVISCameraManager::Relocate()//
 	_renWin->Render();
 }
 
-void vtkVISCameraManager::RelocateToCenter()//回到中心
+void vtkVISCameraManager::RelocateToCenter()//鍥炲埌涓�績
 {
 	if (camera_ == NULL)
 	{
@@ -205,7 +210,7 @@ void vtkVISCameraManager::TransformToIsometric()
     _renWin->Render();
 }
 
-void vtkVISCameraManager::TransformToLeft()//向左平移
+void vtkVISCameraManager::TransformToLeft()//鍚戝乏骞崇Щ
 {
 	if (camera_ == NULL)
 	{
@@ -221,7 +226,7 @@ void vtkVISCameraManager::TransformToLeft()//
 	_renWin->Render();
 }
 
-void vtkVISCameraManager::TransformToRight()//向右平移
+void vtkVISCameraManager::TransformToRight()//鍚戝彸骞崇Щ
 {
 	if (camera_ == NULL)
 	{
@@ -237,7 +242,7 @@ void vtkVISCameraManager::TransformToRight()//
 	_renWin->Render();
 }
 
-void vtkVISCameraManager::TransformToUp()//上移
+void vtkVISCameraManager::TransformToUp()//涓婄Щ
 {
 	if (camera_ == NULL)
 	{
@@ -253,7 +258,7 @@ void vtkVISCameraManager::TransformToUp()//
 	_renWin->Render();
 }
 
-void vtkVISCameraManager::TransformToDown()//下移
+void vtkVISCameraManager::TransformToDown()//涓嬬Щ
 {
 	if (camera_ == NULL)
 	{
@@ -269,46 +274,46 @@ void vtkVISCameraManager::TransformToDown()//
 	_renWin->Render();
 }
 
-void vtkVISCameraManager::InteractorOn()//交互器开
+void vtkVISCameraManager::InteractorOn()//浜や簰鍣ㄥ紑
 {
 	_renWin->GetInteractor()->Enable();
 }
 
-void vtkVISCameraManager::InteractorOff()//交互器关
+void vtkVISCameraManager::InteractorOff()//浜や簰鍣ㄥ叧
 {
 	_renWin->GetInteractor()->Disable();
 }
 
-int vtkVISCameraManager::GetInteractorStatus()//获取交互器状态
+int vtkVISCameraManager::GetInteractorStatus()//鑾峰彇浜や簰鍣ㄧ姸鎬�
 {
 	return _renWin->GetInteractor()->GetEnabled();
 }
 
-void vtkVISCameraManager::SetInteractorStyleToJoystickCamera()//摄像机操纵杆
+void vtkVISCameraManager::SetInteractorStyleToJoystickCamera()//鎽勫儚鏈烘搷绾垫潌
 {
 	vtkInteractorStyleSwitch *iass = vtkInteractorStyleSwitch::SafeDownCast(_renWin->GetInteractor()->GetInteractorStyle());
 	iass->SetCurrentStyleToJoystickCamera();
 }
 
-void vtkVISCameraManager::SetInteractorStyleToJoystickActor()//演员操纵杆
+void vtkVISCameraManager::SetInteractorStyleToJoystickActor()//婕斿憳鎿嶇旱鏉�
 {
 	vtkInteractorStyleSwitch *iass = vtkInteractorStyleSwitch::SafeDownCast(_renWin->GetInteractor()->GetInteractorStyle());
 	iass->SetCurrentStyleToJoystickActor();
 }
 
-void vtkVISCameraManager::SetInteractorStyleToTrackballCamera()//摄像机轨迹球
+void vtkVISCameraManager::SetInteractorStyleToTrackballCamera()//鎽勫儚鏈鸿建杩圭悆
 {
 	vtkInteractorStyleSwitch *iass = vtkInteractorStyleSwitch::SafeDownCast(_renWin->GetInteractor()->GetInteractorStyle());
 	iass->SetCurrentStyleToTrackballCamera();
 }
 
-void vtkVISCameraManager::SetInteractorStyleToTrackballActor()//演员轨迹球
+void vtkVISCameraManager::SetInteractorStyleToTrackballActor()//婕斿憳杞ㄨ抗鐞�
 {
 	vtkInteractorStyleSwitch *iass = vtkInteractorStyleSwitch::SafeDownCast(_renWin->GetInteractor()->GetInteractorStyle());
 	iass->SetCurrentStyleToTrackballActor();
 }
 
-void vtkVISCameraManager::ParallelProjectionOn()//平行投影开
+void vtkVISCameraManager::ParallelProjectionOn()//骞宠�鎶曞奖寮€
 {
 	if (camera_ == NULL)
 	{
@@ -322,7 +327,7 @@ void vtkVISCameraManager::ParallelProjectionOn()//平
 	_renWin->Render();
 }
 
-void vtkVISCameraManager::ParallelProjectionOff()//平行投影关
+void vtkVISCameraManager::ParallelProjectionOff()//骞宠�鎶曞奖鍏�
 {
 	if (camera_ == NULL)
 	{
@@ -336,7 +341,7 @@ void vtkVISCameraManager::ParallelProjectionOff()//平
 	_renWin->Render();
 }
 
-int vtkVISCameraManager::GetProjectionMethod()//获取投影方法
+int vtkVISCameraManager::GetProjectionMethod()//鑾峰彇鎶曞奖鏂规硶
 {
 	if (camera_ == NULL)
 	{
@@ -346,7 +351,7 @@ int vtkVISCameraManager::GetProjectionMethod()//
 	return camera_->GetParallelProjection();
 }
 
-void vtkVISCameraManager::TransformByXYZ(double x, double y, double z)//平移
+void vtkVISCameraManager::TransformByXYZ(double x, double y, double z)//骞崇Щ
 {
 	if (camera_ == NULL)
 	{
@@ -363,7 +368,7 @@ void vtkVISCameraManager::TransformByXYZ(double x, double y, double z)//平
 	_renWin->Render();
 }
 
-void vtkVISCameraManager::ScaleByXYZ(double x, double y, double z)//比例缩放
+void vtkVISCameraManager::ScaleByXYZ(double x, double y, double z)//姣斾緥缂╂斁
 {
 	if (camera_ == NULL)
 	{
@@ -381,7 +386,7 @@ void vtkVISCameraManager::ScaleByXYZ(double x, double y, double z)//
 	_renWin->Render();
 }
 
-void vtkVISCameraManager::RotateWXYZ(double angle, double x, double y, double z)//旋转
+void vtkVISCameraManager::RotateWXYZ(double angle, double x, double y, double z)//鏃嬭浆
 {
 	if (camera_ == NULL)
 	{
@@ -399,7 +404,7 @@ void vtkVISCameraManager::RotateWXYZ(double angle, double x, double y, double z)
 	_renWin->Render();
 }
 
-void vtkVISCameraManager::RotateX(double angle)//绕x轴旋转
+void vtkVISCameraManager::RotateX(double angle)//缁晉杞存棆杞�
 {
 	if (camera_ == NULL)
 	{
@@ -418,7 +423,7 @@ void vtkVISCameraManager::RotateX(double angle)//
 	_renWin->Render();
 }
 
-void vtkVISCameraManager::RotateY(double angle)//绕y轴旋转
+void vtkVISCameraManager::RotateY(double angle)//缁晊杞存棆杞�
 {
 	if (camera_ == NULL)
 	{
@@ -437,7 +442,7 @@ void vtkVISCameraManager::RotateY(double angle)//
 	_renWin->Render();
 }
 
-void vtkVISCameraManager::RotateZ(double angle)//绕z轴旋转
+void vtkVISCameraManager::RotateZ(double angle)//缁晍杞存棆杞�
 {
 	if (camera_ == NULL)
 	{

+ 1 - 1
CAE_Solution/src/VTK/visualization_VTK/vtkviscameramanager.h

@@ -2,7 +2,7 @@
 #define vtkVISCameraManager_h
 
 
-#include "vtkvismanager.h"
+#include "vtkVISManager.h"
 class vtkCamera;
 class vtkTransform;
 

+ 12 - 8
CAE_Solution/src/VTK/visualization_VTK/vtkvismanager.cpp

@@ -8,7 +8,7 @@ VTK_MODULE_INIT(vtkInteractionStyle)
 VTK_MODULE_INIT(vtkRenderingVolumeOpenGL2)
 VTK_MODULE_INIT(vtkRenderingFreeType)
 
-#include "vtkvismanager.h"
+#include "vtkVISManager.h"
 
 vtkStandardNewMacro(vtkVISManager)
 
@@ -61,6 +61,10 @@ vtkVISManager::~vtkVISManager()
 {
 	ErrorInfo(0, "VIS object Destructure func ended here");
 
+    delete scalarNumber;
+    delete vectorName;
+    delete scalarName;
+    delete vectorName;
 	scalarName = NULL;
 	vectorName = NULL;
 
@@ -99,7 +103,7 @@ void vtkVISManager::Update()
     if (_renWin)  _renWin->Render();
 }
 
-void vtkVISManager::Translate_TkColorCode_To_VTKColorCode_All()//填充调色板
+void vtkVISManager::Translate_TkColorCode_To_VTKColorCode_All()//濉�厖璋冭壊鏉�
 {
 	for (int k = 0; k < 20; ++k)
 	{
@@ -153,7 +157,7 @@ void vtkVISManager::Translate_TkColorCode_To_VTKColorCode_All()//
 	}
 }
 
-int vtkVISManager::GetScalarIndex(const char* scalar)//通过标量名获取标量索引
+int vtkVISManager::GetScalarIndex(const char* scalar)//閫氳繃鏍囬噺鍚嶈幏鍙栨爣閲忕储寮�
 {
 	for (int i = 0; i < scalarNumber_; ++i)
 	{
@@ -166,7 +170,7 @@ int vtkVISManager::GetScalarIndex(const char* scalar)//通
 	return -1;
 }
 
-int vtkVISManager::GetVectorIndex(const char* vector)//通过矢量名获取矢量索引
+int vtkVISManager::GetVectorIndex(const char* vector)//閫氳繃鐭㈤噺鍚嶈幏鍙栫煝閲忕储寮�
 {
 	for (int i = 0; i < vectorNumber_; ++i)
 	{
@@ -179,7 +183,7 @@ int vtkVISManager::GetVectorIndex(const char* vector)//通
 	return -1;
 }
 
-const char* vtkVISManager::GetScalarName(int i)//通过标量索引获取标量名
+const char* vtkVISManager::GetScalarName(int i)//閫氳繃鏍囬噺绱㈠紩鑾峰彇鏍囬噺鍚�
 {
 	if (i < 0 || i >= scalarNumber_)
 	{
@@ -190,7 +194,7 @@ const char* vtkVISManager::GetScalarName(int i)//通
 	return this->scalarName[i];
 }
 
-const char* vtkVISManager::GetVectorName(int i)//通过矢量索引获取矢量名
+const char* vtkVISManager::GetVectorName(int i)//閫氳繃鐭㈤噺绱㈠紩鑾峰彇鐭㈤噺鍚�
 {
 	if (i < 0 || i >= vectorNumber_)
 	{
@@ -200,12 +204,12 @@ const char* vtkVISManager::GetVectorName(int i)//通
 	ErrorInfo(0, vectorName[i]);
 	return this->vectorName[i];
 }
-int vtkVISManager::GetScalarNumber()//获取标量数量
+int vtkVISManager::GetScalarNumber()//鑾峰彇鏍囬噺鏁伴噺
 {
 	return this->scalarNumber_;
 }
 
-int vtkVISManager::GetVectorNumber()//获取矢量数量
+int vtkVISManager::GetVectorNumber()//鑾峰彇鐭㈤噺鏁伴噺
 {
 	return this->vectorNumber_;
 }

+ 4 - 2
CAE_Solution/src/VTK/visualization_VTK/vtkvismeshbasetovtksource.cpp

@@ -1,4 +1,4 @@
-#include <vtkObjectFactory.h>
+#include <vtkObjectFactory.h>
 #include "vtkvismeshbasetovtksource.h"
 #include "../MeshDS/MeshBase.h"
 #include "../MeshDS/meshunstructured.h"
@@ -42,7 +42,9 @@ vtkVISMeshBaseToVTKSource::~vtkVISMeshBaseToVTKSource()
 {
     if (unGrid != 0)
     {
-        delete unGrid;
+        //delete unGrid;
+        unGrid->Delete();
+        unGrid = NULL;//0525
     }
 }
 

+ 1 - 1
CAE_Solution/src/VTK/visualization_VTK/vtkvismeshbasetovtksource.h

@@ -2,7 +2,7 @@
 #define VTKVISMESHBASETOVTKSOURCE_H
 
 
-#include "vtkvismanager.h"
+#include "vtkVISManager.h"
 #include "../MeshDS/MeshBase.h"
 #include "vtkvisunstructuredgridsource.h"
 #include <iostream>

+ 207 - 204
CAE_Solution/src/VTK/visualization_VTK/vtkvisunshademesh.cpp

@@ -16,259 +16,262 @@ vtkStandardNewMacro(vtkVISUnShadeMesh)
 
 vtkVISUnShadeMesh::vtkVISUnShadeMesh()
 {
-	meshLineWidth_ = 1.0;
-	shadeFlag_ = true;
+    meshLineWidth_ = 1.0;
+    shadeFlag_ = true;
 
-	cellActor_ = NULL;
+    cellActor_ = NULL;
 }
 vtkVISUnShadeMesh::~vtkVISUnShadeMesh()
 {
     if(cellActor_)
     {
-         cellActor_->Delete();
-     }
+        cellActor_->Delete();
+        cellActor_ = NULL;
+    }
 }
 
-void vtkVISUnShadeMesh::CreateShadeMeshDisplay(bool flag)//真则阴影图,假则线框图
+void vtkVISUnShadeMesh::CreateShadeMeshDisplay(bool flag)//鐪熷垯闃村奖鍥撅紝鍋囧垯绾挎�鍥�
 {
-	shadeFlag_ = flag;
+    shadeFlag_ = flag;
 
-	cout<< "shade mesh: " << _source->unstruGrid->GetNumberOfPoints()<<" "<<_source->unstruGrid->GetNumberOfCells()<<endl;
+    cout<< "shade mesh: " << _source->unstruGrid->GetNumberOfPoints()<<" "<<_source->unstruGrid->GetNumberOfCells()<<endl;
 
-	vtkExtractEdges *edge = vtkExtractEdges::New();
-	edge->SetInputData(_source->unstruGrid);
-	edge->Update();
+    vtkExtractEdges *edge = vtkExtractEdges::New();
+    edge->SetInputData(_source->unstruGrid);
+    edge->Update();
 
-	vtkDataSetMapper *mapper = vtkDataSetMapper::New();
-	if (flag == 1)
-	{
-		mapper->SetInputData(_source->unstruGrid);
-		cout << "shade mesh" << endl;
-	}
-	else
-	{
-		mapper->SetInputData(edge->GetOutput());
-	}
-	mapper->ScalarVisibilityOff();
+    vtkDataSetMapper *mapper = vtkDataSetMapper::New();
+    if (flag == 1)
+    {
+        mapper->SetInputData(_source->unstruGrid);
+        cout << "shade mesh" << endl;
+    }
+    else
+    {
+        mapper->SetInputData(edge->GetOutput());
+    }
+    mapper->ScalarVisibilityOff();
 
-	vtkActor *actor = vtkActor::New();
-	actor->SetMapper(mapper);
-	(actor->GetProperty())->SetColor(0,0,1);
+    vtkActor *actor = vtkActor::New();
+    actor->SetMapper(mapper);
+    (actor->GetProperty())->SetColor(0,0,1);
 
 
-//    if(flag == 0)
-//    {
-    (actor->GetProperty())->SetRepresentationToWireframe();//渲染线框图
-   // }
+    if(flag == 0)
+    {
+        (actor->GetProperty())->SetRepresentationToWireframe();//娓叉煋绾挎�鍥�
+    }else{
+        (actor->GetProperty())->SetRepresentationToSurface();//娓叉煋涓洪槾褰�
+   }
 
 
-	if (_renderer != NULL)
-	{
-		_renderer->AddActor(actor);
-	}
+    if (_renderer != NULL)
+    {
+        _renderer->AddActor(actor);
+    }
 
-	_unActor = actor;
+    _unActor = actor;
 
-	_vtkObjectsNum = 1;
-	_vtkObjects = new vtkObject*[_vtkObjectsNum];
-	_vtkObjects[0] = mapper;
+    _vtkObjectsNum = 1;
+    _vtkObjects = new vtkObject*[_vtkObjectsNum];
+    _vtkObjects[0] = mapper;
 }
 
-void vtkVISUnShadeMesh::CreateShadeMeshSurfaceDisplay(bool flag)//和第一个有何区别?
+void vtkVISUnShadeMesh::CreateShadeMeshSurfaceDisplay(bool flag)//鍜岀�涓€涓�湁浣曞尯鍒�紵
 {
-	shadeFlag_ = flag;
+    shadeFlag_ = flag;
 
-	vtkDataSetMapper *mapper = vtkDataSetMapper::New();
-	mapper->SetInputData(_source->unstruGrid);
+    vtkDataSetMapper *mapper = vtkDataSetMapper::New();
+    mapper->SetInputData(_source->unstruGrid);
 
-	mapper->ScalarVisibilityOff();
+    mapper->ScalarVisibilityOff();
 
-	vtkActor *actor = vtkActor::New();
-	actor->SetMapper(mapper);
-	(actor->GetProperty())->SetColor(0,0,1);
+    vtkActor *actor = vtkActor::New();
+    actor->SetMapper(mapper);
+    (actor->GetProperty())->SetColor(0,0,1);
 
-	if (flag == 0)
-	{
-		(actor->GetProperty())->SetRepresentationToWireframe();
-	}
+    if (flag == 0)
+    {
+        (actor->GetProperty())->SetRepresentationToWireframe();
+    }
 
-	if (_renderer != NULL)
-	{
-		_renderer->AddActor(actor);
-	}
+    if (_renderer != NULL)
+    {
+        _renderer->AddActor(actor);
+    }
 
-	_unActor = actor;
+    _unActor = actor;
 
-	_vtkObjectsNum = 1;
-	_vtkObjects = new vtkObject*[_vtkObjectsNum];
-	_vtkObjects[0] = mapper;
+    _vtkObjectsNum = 1;
+    _vtkObjects = new vtkObject*[_vtkObjectsNum];
+    _vtkObjects[0] = mapper;
 }
 
 void vtkVISUnShadeMesh::SetMeshLineWidth(double widthValue)
 {
-	if (_unActor != NULL)
-	{
-		(_unActor->GetProperty())->SetLineWidth(widthValue);
-		meshLineWidth_ = widthValue;
-	}
+    if (_unActor != NULL)
+    {
+        (_unActor->GetProperty())->SetLineWidth(widthValue);
+        meshLineWidth_ = widthValue;
+    }
 }
 
 void vtkVISUnShadeMesh::SetMeshEdgeVisibility(bool flag)
 {
-	if (_unActor != NULL)
-	{
-		if (flag)
-		{
-			(_unActor->GetProperty())->EdgeVisibilityOn();
-		}
-		else
-		{
-			(_unActor->GetProperty())->EdgeVisibilityOff();
-		}
-		
-	}
+    if (_unActor != NULL)
+    {
+        if (flag)
+        {
+            (_unActor->GetProperty())->EdgeVisibilityOn();
+        }
+        else
+        {
+            (_unActor->GetProperty())->EdgeVisibilityOff();
+        }
+
+    }
 }
 
 double vtkVISUnShadeMesh::GetMeshLineWidth()
 {
-	if (_unActor != NULL)
-	{
-		return (_unActor->GetProperty())->GetLineWidth();
-	}
-	else
-	{
-		return -1;
-	}
+    if (_unActor != NULL)
+    {
+        return (_unActor->GetProperty())->GetLineWidth();
+    }
+    else
+    {
+        return -1;
+    }
 }
- 
-void vtkVISUnShadeMesh::ChangeMeshLinePattern(char* pattern)//设置line的点画模式,1为像素打开,0为关闭,只针对openGL实现,openGL2无效
+
+void vtkVISUnShadeMesh::ChangeMeshLinePattern(char* pattern)//璁剧疆line鐨勭偣鐢绘ā寮忥紝1涓哄儚绱犳墦寮€锛�0涓哄叧闂�紝鍙�拡瀵筼penGL瀹炵幇锛宱penGL2鏃犳晥
 {
-	if (_unActor != NULL)
-	{
-		if (strcmp(pattern, "Dotted") == 0)
-		{
-			(_unActor->GetProperty())->SetLineStipplePattern(1);
-		}
-		else
-		{
-			(_unActor->GetProperty())->SetLineStipplePattern(0XFFFF);
-		}
-	}
+    if (_unActor != NULL)
+    {
+        if (strcmp(pattern, "Dotted") == 0)
+        {
+            (_unActor->GetProperty())->SetLineStipplePattern(1);
+        }
+        else
+        {
+            (_unActor->GetProperty())->SetLineStipplePattern(0XFFFF);
+        }
+    }
 }
 
 vtkActor* vtkVISUnShadeMesh::CreateCellIdDisplay(int id)
 {
-	//vtkIdType vid = (vtkIdType)id;
-	//ostringstream os;
-	//os<<id;
-	//string s = os.str();
-	//const char* cid = s.c_str();
-
-	if (_unActor != NULL)
-	{
-		cout << id << endl;
-
-		vtkCell* cell = _source->unstruGrid->GetCell(id);
-
-		vtkPoints* points = vtkPoints::New();
-		points->DeepCopy(cell->GetPoints());
-
-		int num = 0;
-		num = points->GetNumberOfPoints();
-
-		vtkIdList* idList = vtkIdList::New();
-		idList->SetNumberOfIds(num);
-		for (int i = 0; i<num; i++)
-		{
-			idList->InsertId(i, i);
-		}
-
-		vtkUnstructuredGrid *unGrid = vtkUnstructuredGrid::New();
-		unGrid->Allocate(1, 1);
-		unGrid->InsertNextCell(cell->GetCellType(), idList);
-		unGrid->SetPoints(points);
-
-		vtkDataSetMapper* mapper = vtkDataSetMapper::New();
-		mapper->SetInputData(unGrid);
-
-		cellActor_ = vtkActor::New();
-		cellActor_->SetMapper(mapper);
-		(cellActor_->GetProperty())->SetColor(0, 1, 0);
-		(cellActor_->GetProperty())->SetRepresentationToWireframe();
-
-		return cellActor_;
-	}
-
-	return NULL;
-
-	//_renderer->AddActor(actor);
-
-	//int num = 0;
-	//num = points->GetNumberOfPoints();
-
-	//double pos[3];
-	//pos[0] = 0;
-	//pos[1] = 0;
-	//pos[2] = 0;
-
-	//double* p;
-	//for(int i=0; i<num; i++)
-	//{
-	// p = points->GetPoint(i);
-	//pos[0] += p[0];
-	//pos[1] += p[1];
-	//pos[2] += p[2];
-	//}    
-
-	//pos[0] = pos[0]/num;
-	//pos[1] = pos[1]/num;
-	//pos[2] = pos[2]/num;
-
-	//char* ptr;
-	//int decpt, sign;
-	// ptr = ecvt(id, 2, &decpt, &sign);
-
-	//vtkTextActor3D* textActor = vtkTextActor3D::New();
-	//textActor->SetInput(ptr);
-	//textActor->SetPosition(pos[0], pos[1], pos[2]);
-	//(textActor->GetTextProperty())->SetColor(0, 1, 0);
-	//(textActor->GetTextProperty())->SetFontFamilyToArial();
-	//(textActor->GetTextProperty())->SetFontSize(1);
-
-	//vtkTextSource* text = vtkTextSource::New();
-	//text->SetText(cid);
-	//vtkPolyDataMapper* mapper = vtkPolyDataMapper::New();
-	//mapper->SetInputConnection(text->GetOutputPort());
-	//mapper->ScalarVisibilityOn();
-	//vtkActor* actor = vtkActor::New();
-	//actor->SetMapper(mapper);
-	//actor->AddPosition(cell->GetPoints()->GetPoint(0));
-	//actor->SetScale(.05,.05,.05);
-
-	//vtkIdFilter* idf = vtkIdFilter::New();
-	//idf->SetInput(_source->unstruGrid);
-	//idf->PointIdsOff();
-	//idf->FieldDataOff();
-	//idf->CellIdsOn();
-	//vtkCellCenters* cc = vtkCellCenters::New();
-	//cc->SetInputConnection(idf->GetOutputPort());
-	//cc->SetInput(_source->unstruGrid);
-	//vtkLabeledDataMapper* mapper = vtkLabeledDataMapper::New();
-	//mapper->SetInputConnection(cc->GetOutputPort());
-	//mapper->SetLabelModeToLabelIds();
-	//mapper->GetLabelTextProperty()->SetColor(0,1,0);
-	//vtkActor2D* actor = vtkActor2D::New();
-	//actor->SetMapper(mapper);
+    //vtkIdType vid = (vtkIdType)id;
+    //ostringstream os;
+    //os<<id;
+    //string s = os.str();
+    //const char* cid = s.c_str();
+
+    if (_unActor != NULL)
+    {
+        cout << id << endl;
+
+        vtkCell* cell = _source->unstruGrid->GetCell(id);
+
+        vtkPoints* points = vtkPoints::New();
+        points->DeepCopy(cell->GetPoints());
+
+        int num = 0;
+        num = points->GetNumberOfPoints();
+
+        vtkIdList* idList = vtkIdList::New();
+        idList->SetNumberOfIds(num);
+        for (int i = 0; i<num; i++)
+        {
+            idList->InsertId(i, i);
+        }
+
+        vtkUnstructuredGrid *unGrid = vtkUnstructuredGrid::New();
+        unGrid->Allocate(1, 1);
+        unGrid->InsertNextCell(cell->GetCellType(), idList);
+        unGrid->SetPoints(points);
+
+        vtkDataSetMapper* mapper = vtkDataSetMapper::New();
+        mapper->SetInputData(unGrid);
+
+        cellActor_ = vtkActor::New();
+        cellActor_->SetMapper(mapper);
+        (cellActor_->GetProperty())->SetColor(0, 1, 0);
+        (cellActor_->GetProperty())->SetRepresentationToWireframe();
+
+        return cellActor_;
+    }
+
+    return NULL;
+
+    //_renderer->AddActor(actor);
+
+    //int num = 0;
+    //num = points->GetNumberOfPoints();
+
+    //double pos[3];
+    //pos[0] = 0;
+    //pos[1] = 0;
+    //pos[2] = 0;
+
+    //double* p;
+    //for(int i=0; i<num; i++)
+    //{
+    // p = points->GetPoint(i);
+    //pos[0] += p[0];
+    //pos[1] += p[1];
+    //pos[2] += p[2];
+    //}
+
+    //pos[0] = pos[0]/num;
+    //pos[1] = pos[1]/num;
+    //pos[2] = pos[2]/num;
+
+    //char* ptr;
+    //int decpt, sign;
+    // ptr = ecvt(id, 2, &decpt, &sign);
+
+    //vtkTextActor3D* textActor = vtkTextActor3D::New();
+    //textActor->SetInput(ptr);
+    //textActor->SetPosition(pos[0], pos[1], pos[2]);
+    //(textActor->GetTextProperty())->SetColor(0, 1, 0);
+    //(textActor->GetTextProperty())->SetFontFamilyToArial();
+    //(textActor->GetTextProperty())->SetFontSize(1);
+
+    //vtkTextSource* text = vtkTextSource::New();
+    //text->SetText(cid);
+    //vtkPolyDataMapper* mapper = vtkPolyDataMapper::New();
+    //mapper->SetInputConnection(text->GetOutputPort());
+    //mapper->ScalarVisibilityOn();
+    //vtkActor* actor = vtkActor::New();
+    //actor->SetMapper(mapper);
+    //actor->AddPosition(cell->GetPoints()->GetPoint(0));
+    //actor->SetScale(.05,.05,.05);
+
+    //vtkIdFilter* idf = vtkIdFilter::New();
+    //idf->SetInput(_source->unstruGrid);
+    //idf->PointIdsOff();
+    //idf->FieldDataOff();
+    //idf->CellIdsOn();
+    //vtkCellCenters* cc = vtkCellCenters::New();
+    //cc->SetInputConnection(idf->GetOutputPort());
+    //cc->SetInput(_source->unstruGrid);
+    //vtkLabeledDataMapper* mapper = vtkLabeledDataMapper::New();
+    //mapper->SetInputConnection(cc->GetOutputPort());
+    //mapper->SetLabelModeToLabelIds();
+    //mapper->GetLabelTextProperty()->SetColor(0,1,0);
+    //vtkActor2D* actor = vtkActor2D::New();
+    //actor->SetMapper(mapper);
 }
 
 void vtkVISUnShadeMesh::ModifiedCellDisplayColor(double r, double g, double b)
 {
-	if (cellActor_ != NULL)
-	{
-		(cellActor_->GetProperty())->SetColor(r, g, b);
-	}
-	else
-	{
-		ErrorInfo(1, "No Cell Actor!");
-	}
+    if (cellActor_ != NULL)
+    {
+        (cellActor_->GetProperty())->SetColor(r, g, b);
+    }
+    else
+    {
+        ErrorInfo(1, "No Cell Actor!");
+    }
 }

+ 44 - 38
CAE_Solution/src/VTK/visualization_VTK/vtkvisunstructuredgridmanager.cpp

@@ -19,42 +19,42 @@ vtkVISUnstructuredGridManager::vtkVISUnstructuredGridManager()
 }
 vtkVISUnstructuredGridManager::~vtkVISUnstructuredGridManager()
 {
-	//    //delete _source;
-	//    
-	//    ErrorInfo(0, "destructure func 0");
-	//	
-	//	if (_unActor != NULL)
-	//	{  
-	//		if(_renderer != NULL)
-	//	    {
-	//	        //_renderer->RemoveActor(_unActor);
-	//        }
-	//		_unActor->Delete();
-	//		_unActor = NULL;
-	//	}
-	//
-	//	ErrorInfo(0, "destructure func 1");
-	//
-	//	if (_vtkObjects != NULL)
-	//	{
-	//#ifndef NDEBUG
-	//		cout<<_vtkObjectsNum<<endl;
-	//#endif
-	//		if(_vtkObjectsNum > 0)
-	//		{		    
-	//			for (int j=0; j<_vtkObjectsNum; j++)
-	//			{			    
-	//				if (_vtkObjects[j] != NULL)
-	//				{				    
-	//					//_vtkObjects[j]->Delete();
-	//				}
-	//			}
-	//		}
-	//		delete [] _vtkObjects;
-	//		_vtkObjects = NULL;
-	//	}
-	//	
-	//	ErrorInfo(0, "destructure func 2");
+        //delete _source;
+
+        ErrorInfo(0, "destructure func 0");
+
+        if (_unActor != NULL)
+        {
+            if(_renderer != NULL)
+            {
+                //_renderer->RemoveActor(_unActor);
+            }
+            _unActor->Delete();
+            _unActor = NULL;
+        }
+
+        ErrorInfo(0, "destructure func 1");
+
+        if (_vtkObjects != NULL)
+        {
+    #ifndef NDEBUG
+            cout<<_vtkObjectsNum<<endl;
+    #endif
+            if(_vtkObjectsNum > 0)
+            {
+                for (int j=0; j<_vtkObjectsNum; j++)
+                {
+                    if (_vtkObjects[j] != NULL)
+                    {
+                        //_vtkObjects[j]->Delete();
+                    }
+                }
+            }
+            delete [] _vtkObjects;
+            _vtkObjects = NULL;
+        }
+
+        ErrorInfo(0, "destructure func 2");
     DeleteObjects();
     if(this->_source){
         this->_source->Delete();
@@ -80,7 +80,11 @@ void vtkVISUnstructuredGridManager::ShowOff()
 	if (_unActor != NULL)
 	{
 		_unActor->VisibilityOff();
-	}
+    }else{
+        cout<<"------------------------------------------------"<<endl;
+        cout<<"actor == NULL"<<endl;
+        cout<<"________________________________________________"<<endl;
+    }
 }
 
 void vtkVISUnstructuredGridManager::ChangeRepresentation(char* style)
@@ -102,7 +106,7 @@ void vtkVISUnstructuredGridManager::ChangeRepresentation(char* style)
 	}
 }
 
-void vtkVISUnstructuredGridManager::SetOpacity(double value)//ÉèÖÃ͸Ã÷¶È
+void vtkVISUnstructuredGridManager::SetOpacity(double value)//设置�明度
 {
 	if (_unActor != NULL)
 	{
@@ -148,6 +152,7 @@ void vtkVISUnstructuredGridManager::DeleteObjects()
 			_renderer->RemoveActor(_unActor);
 		}
 		_unActor->Delete();
+        _unActor = NULL;
 	}
 
 	for (int i = 0; i < _vtkObjectsNum; i++)
@@ -155,6 +160,7 @@ void vtkVISUnstructuredGridManager::DeleteObjects()
 		if (_vtkObjects[i] != NULL)
 		{
 			_vtkObjects[i]->Delete();
+            _vtkObjects[i] = NULL;
 		}
 	}
 }

+ 1 - 1
CAE_Solution/src/VTK/visualization_VTK/vtkvisunstructuredgridmanager.h

@@ -2,7 +2,7 @@
 #define vtkVISUnstructuredGridManager_h
 
 
-#include "vtkvismanager.h"
+#include "vtkVISManager.h"
 class vtkActor;
 class vtkVISUnstructuredGridSource;
 

+ 65 - 62
CAE_Solution/src/VTK/visualization_VTK/vtkvisunstructuredgridsource.cpp

@@ -24,74 +24,75 @@ vtkVISUnstructuredGridSource::vtkVISUnstructuredGridSource()
 }
 vtkVISUnstructuredGridSource::~vtkVISUnstructuredGridSource()
 {
-	//ErrorInfo(0, "destructure func 0");
-	//       
-	//   for (int i=0; i<scalarNumber_; ++i)
-	//   {
-	//    ErrorInfo(0, "destructure func 1");
-	//    
-	//	if (scalarSource[i] != NULL)
-	//	{   
-	//		scalarSource[i]->Delete();   
-	//	}
-	//	//if (cellScalarSource_[i] != NULL)
-	//	//{
-	//		//cellScalarSource_[i]->Delete(); //zhuqin note 2012.10.26
-	//	//}
-	//	//if (scalarRange[i] != NULL)
-	//	//{
-	//		//delete [] scalarRange[i]; //zhuqin note 2012.10.29
-	//	//}
-	//   }
-	//ErrorInfo(0, "destructure func 2");
-	//   delete [] scalarSource;
-	//   delete [] scalarRange;
-	//   delete [] cellScalarSource_;
-	//   
-	//ErrorInfo(0, "destructure func 3");
-	//   for (int i=0; i<vectorNumber_; i++)
-	//   {
-	//	if (vectorSource[i] != NULL)
-	//	{
-	//		vectorSource[i]->Delete();
-	//	}
-	//	//if (cellVectorSource_[i] != NULL)
-	//	//{
-	//		//cellVectorSource_[i]->Delete(); //zhuqin note 2012.10.26
-	//	//}
-	//   }
-	//ErrorInfo(0, "destructure func 4");
-	//   delete [] vectorSource;
-	//   delete [] cellVectorSource_;
-	//   
-	//   delete [] scalarName;
-	//   delete [] vectorName;
-
-	//ErrorInfo(0, "destructure func 5");
-	//
-	///*
-	//if(unstruGrid != NULL)
-	//   {
-	//       unstruGrid->Delete();
-	//       unstruGrid = NULL;
-	//   }
-	//   ErrorInfo(0, "destructure func 6");
-	//   
-	//if(unstruReader_ != NULL)
-	//   {
-	//       unstruReader_->Delete();
-	//       unstruReader_ = NULL;
-	//   }*/
-	//   
-	//   ErrorInfo(0, "destructure func 7 end.");
-
+    ErrorInfo(0, "destructure func 0");
+
+       for (int i=0; i<scalarNumber_; ++i)
+       {
+        ErrorInfo(0, "destructure func 1");
+
+        if (scalarSource[i] != NULL)
+        {
+            scalarSource[i]->Delete();
+            scalarSource[i] = NULL;
+        }
+        if (cellScalarSource_[i] != NULL)
+        {
+            cellScalarSource_[i]->Delete(); //zhuqin note 2012.10.26
+            cellScalarSource_[i] = NULL;
+        }
+        if (scalarRange[i] != NULL)
+        {
+            delete [] scalarRange[i]; //zhuqin note 2012.10.29
+            scalarRange[i] = NULL;
+        }
+       }
+    ErrorInfo(0, "destructure func 2");
+       delete [] scalarSource;
+       delete [] scalarRange;
+       delete [] cellScalarSource_;
+    scalarSource = NULL;
+    scalarRange = NULL;
+    cellScalarSource_ = NULL;
+
+    ErrorInfo(0, "destructure func 3");
+       for (int i=0; i<vectorNumber_; i++)
+       {
+        if (vectorSource[i] != NULL)
+        {
+            vectorSource[i]->Delete();
+            vectorSource[i] = NULL;
+        }
+        if (cellVectorSource_[i] != NULL)
+        {
+            cellVectorSource_[i]->Delete(); //zhuqin note 2012.10.26
+            cellVectorSource_[i] = NULL;
+        }
+       }
+    ErrorInfo(0, "destructure func 4");
+       delete [] vectorSource;
+       delete [] cellVectorSource_;
+    vectorSource = NULL;
+    cellVectorSource_ = NULL;
+
+    ErrorInfo(0, "destructure func 5");
+
+    if(unstruGrid != NULL)
+       {
+           unstruGrid->Delete();
+           unstruGrid = NULL;
+       }
+       ErrorInfo(0, "destructure func 6");
+
+    if(unstruReader_!=NULL){//0517append
+        unstruReader_->Delete();
+        unstruReader_ = NULL;
+    }
 }
 
 void vtkVISUnstructuredGridSource::LoadData(char* fileName)
 {
     vtkUnstructuredGridReader* reader = vtkUnstructuredGridReader::New();
 	reader->SetFileName(fileName);
-
 	if (!(reader->IsFileUnstructuredGrid()))
 	{
 		ErrorInfo(1, "Please check you loaded data, it is not Unstructured Grid!");
@@ -208,8 +209,10 @@ void vtkVISUnstructuredGridSource::LoadOneScalarData(const char* scalar)
 	scalarSource[index]->DeepCopy(((unstruReader_->GetOutput())->GetPointData())->GetScalars());
 
 	scalarSource[index]->GetRange(range);
+
 	scalarRange[index][0] = range[0];
 	scalarRange[index][1] = range[1];
+    cout << scalarRange[index][0] << " " << scalarRange[index][1] << endl;
 
 }
 

+ 1 - 1
CAE_Solution/src/VTK/visualization_VTK/vtkvisunstructuredgridsource.h

@@ -2,7 +2,7 @@
 #define vtkVISUnstructuredGridSource_h
 
 
-#include "vtkvismanager.h"
+#include "vtkVISManager.h"
 
 class vtkUnstructuredGridReader;
 class vtkUnstructuredGrid;

+ 6 - 1
CAE_Solution/src/VTK/widget/contourdispalyWidget.cpp

@@ -12,7 +12,12 @@ ContourDisplayW::ContourDisplayW()
 * @date 20221130
 */
 {
-
+    scalarIndex = 0;
+    ScalarName.clear();
+    range[0]=0;
+    range[1] =0 ;
+    nameTypeMap.clear();
+    scalarNameVec.clear();
 }
 
 /**

+ 7 - 1
CAE_Solution/src/VTK/widget/linedisplayWidget.cpp

@@ -12,7 +12,13 @@ LineDisplayW::LineDisplayW()
      * @date 20221201
      */
 {
-
+    range_[0] = 0;
+    range_[1] = 0;
+    nameTypeMap_.clear();
+    ScalarNameVec.clear();
+    scalar_index = 0;
+    level = 10;
+    scalarName.clear();
 }
 
 /**

+ 77 - 79
CAE_Solution/src/main.cpp

@@ -39,103 +39,101 @@ int main(int argc, char *argv[])
     Widget w;
 
     w.resize(QApplication::desktop()->availableGeometry().size());//最大化
-    //w.resize(1750,620);
     w.move(0,0);
     w.show();
-    //    //初始化状态机
-            stateMachine* recvstate= new stateMachine("recvClient");
-            QThread *thread_recvsate = new QThread();
-            QThread *thread_sendstate = new QThread();
+    //初始化状态机
+    stateMachine* recvstate= new stateMachine("recvClient");
+    QThread *thread_recvsate = new QThread();
+    QThread *thread_sendstate = new QThread();
 
-            stateMachine* sendstate= new stateMachine("sendClient") ;
-            handlePool *handle = new handlePool(&w);
+    stateMachine* sendstate= new stateMachine("sendClient") ;
+    handlePool *handle = new handlePool(&w);
 
-            recvstate->moveToThread(thread_recvsate);
-            thread_recvsate->start();
-            sendstate->moveToThread(thread_sendstate);
-            thread_sendstate->start();
+    recvstate->moveToThread(thread_recvsate);
+    thread_recvsate->start();
+    sendstate->moveToThread(thread_sendstate);
+    thread_sendstate->start();
 
 
-
-            QObject::connect(handle,SIGNAL(sendImg_handlePoolToSendstate(std::string)),sendstate,SLOT(getImg_handlePoolToSendstate(std::string)));
-            QObject::connect(recvstate,SIGNAL(sendmsg_recvstateTohandlePool(std::string)),handle,SLOT(getmsg_recvstateTohandlePool(std::string)));
+    QObject::connect(handle,SIGNAL(sendImg_handlePoolToSendstate(std::string)),sendstate,SLOT(getImg_handlePoolToSendstate(std::string)));
+    QObject::connect(recvstate,SIGNAL(sendmsg_recvstateTohandlePool(std::string)),handle,SLOT(getmsg_recvstateTohandlePool(std::string)));
     /*******************************************************************************/
-    //        QVTKRenderer* render_ = new QVTKRenderer();
-    //        render_->init();
+            /*QVTKRenderer* render_ = new QVTKRenderer();
+            render_->init();
 
-    //        QString m_filePath="F:\\czm\\vtkfile\\tfg.ugrid";
+            QString m_filePath="F:\\czm\\vtkfile\\tfg.ugrid";
 
-    //        MeshManager *meshmanager = new MeshManager();
+            MeshManager *meshmanager = new MeshManager();
 
-    //        bool f = meshmanager->LoadData(m_filePath);
+            bool f = meshmanager->LoadData(m_filePath);
 
-    //        cout<<"f:"<<f<<endl;
-    //        if(f){
-    //            if(render_){
-    //                meshmanager->DisplayMesh(render_);
-    //                render_->ZoomToExtents();
-    //            }
-    //        }
-    //        w.addTab(render_->GetWidget(),"test");
-    //        w.SetMeshManager(meshmanager);
-    //        w.SetQVTKRenderer(render_);
+            cout<<"f:"<<f<<endl;
+            if(f){
+                if(render_){
+                    meshmanager->DisplayMesh(render_);
+                    render_->ZoomToExtents();
+                }
+            }
+            w.addTab(render_->GetWidget(),"test");
+            w.SetMeshManager(meshmanager);
+            w.SetQVTKRenderer(render_);*/
     /************************************************************************************/
-//    QVTKRenderer* render_ = new QVTKRenderer();
-//    render_->init();
-//    QString filePath = "C:\\Users\\Administrator\\Desktop\\Postprocess_Binary\\";
-//    QDir dir("C:\\Users\\Administrator\\Desktop\\Postprocess_Binary");
-//    dir.setFilter(QDir::Files);
-//    QStringList list = dir.entryList(QDir::Files);
-//    QStringList string_list;
-//    foreach (QFileInfo file, list) {
-//        if(file.fileName().split(".").back() == "plt"){
-//            string_list.append(file.fileName());
-//        }
-//    }
+    /*QVTKRenderer* render_ = new QVTKRenderer();
+    render_->init();
+    QString filePath = "C:\\Users\\Administrator\\Desktop\\Postprocess_Binary\\";
+    QDir dir("C:\\Users\\Administrator\\Desktop\\Postprocess_Binary");
+    dir.setFilter(QDir::Files);
+    QStringList list = dir.entryList(QDir::Files);
+    QStringList string_list;
+    foreach (QFileInfo file, list) {
+        if(file.fileName().split(".").back() == "plt"){
+            string_list.append(file.fileName());
+        }
+    }
 
-//    ResultMeshManager* meshmanager =new ResultMeshManager();
-//    //for(int i =0;i<string_list.size();i++){
-//    for(int i =0;i<4;i++){
-//        meshmanager->LoadData(filePath+string_list[i]);
-//        meshmanager->SetSaveIndex(i);
-//        meshmanager->DisplayMesh(render_);
-//    }
+    ResultMeshManager* meshmanager =new ResultMeshManager();
+    //for(int i =0;i<string_list.size();i++){
+    for(int i =0;i<4;i++){
+        meshmanager->LoadData(filePath+string_list[i]);
+        meshmanager->SetSaveIndex(i);
+        meshmanager->DisplayMesh(render_);
+    }
 
 
-//    meshmanager->HideAllActors();
-//    meshmanager->ShowAll();
-//    double t =0.001;
-//    meshmanager->SetLevel(10);
-//    meshmanager->SetRange(&t);
-//    meshmanager->ModifyScalarDisplay("r");
-//    meshmanager->SetDisplayType(2); //0----contour 2----line 3----vector
+    meshmanager->HideAllActors();
+    meshmanager->ShowAll();
+    double t =0.001;
+    meshmanager->SetLevel(10);
+    meshmanager->SetRange(&t);
+    meshmanager->ModifyScalarDisplay("r");
+    meshmanager->SetDisplayType(2); //0----contour 2----line 3----vector
 
 
-//    meshmanager->DisplayMeshByIndex(0);
-//    meshmanager->SetNameTypeMap();
-//    w.addTab(render_->GetWidget(),"test");
+    meshmanager->DisplayMeshByIndex(0);
+    meshmanager->SetNameTypeMap();
+    w.addTab(render_->GetWidget(),"test");*/
     ///////////////////////////////////////////////////////////////////////////////////
     ///加载tecplot
-    //      QVTKRenderer* render_ = new QVTKRenderer();
-    //     render_->init();
-    //    handlePool* hand = new handlePool();
-    //    QString filePath = "C:\\Users\\Administrator\\Desktop\\Postprocess_Binary\\";
-    //    QStringList fileName_list = hand->getFileNameList(filePath);
-    //    ResultMeshManager *rsMeshManager = new ResultMeshManager();
-    //    w.addTab(render_->GetWidget(),"test");
-
-    //    for(int i =0;i<fileName_list.size();i++){
-    //        bool f =rsMeshManager->LoadData(filePath+fileName_list[i]);
-    //        if(f){
-    //            rsMeshManager->SetSaveIndex(i);
-    //            if(render_){
-    //                rsMeshManager->DisplayMesh(render_);
-    //            }
-    //        }
-    //    }
-    //    rsMeshManager->ShowAll();
-    //    rsMeshManager->DisplayMeshByIndex(0);
-    //    rsMeshManager->SetNameTypeMap();
-    //    render_->ZoomToExtents();
+//          QVTKRenderer* render_ = new QVTKRenderer();
+//         render_->init();
+//        handlePool* hand = new handlePool();
+//        QString filePath = "C:\\Users\\Administrator\\Desktop\\Postprocess_Binary\\";
+//        QStringList fileName_list = hand->getFileNameList(filePath);
+//        ResultMeshManager *rsMeshManager = new ResultMeshManager();
+//        w.addTab(render_->GetWidget(),"test");
+
+//        for(int i =0;i<fileName_list.size();i++){
+//            bool f =rsMeshManager->LoadData(filePath+fileName_list[i]);
+//            if(f){
+//                rsMeshManager->SetSaveIndex(i);
+//                if(render_){
+//                    rsMeshManager->DisplayMesh(render_);
+//                }
+//            }
+//        }
+//        rsMeshManager->ShowAll();
+//        rsMeshManager->DisplayMeshByIndex(0);
+//        rsMeshManager->SetNameTypeMap();
+//        render_->ZoomToExtents();
     return a.exec();
 }

+ 5 - 5
CAE_Solution/src/src.pro

@@ -453,14 +453,14 @@ unix:!macx: LIBS += -L$$PWD/../Libs/vtk8.2/centos8/lib64/    -lvtkChartsCore-8.2
 
 
 ############################################################################
-#添加外部库rabbitmq-c(msvc2015 64位)
+#添加外部库rabbitmq-c(msvc2015 64位)
 CONFIG(release, debug|release):{
 win32: LIBS += -L$$PWD/../Libs/rabbitmq/win/debug/lib/ -lrabbitmq.4
 
-win32:INCLUDEPATH += $$PWD/../Libs/rabbitmq/win/debug/include
-win32:DEPENDPATH += $$PWD/../Libs/rabbitmq/win/debug/include
-win32:INCLUDEPATH += $$PWD/../Libs/rabbitmq/win/debug/include/rabbitmq-c
-win32:DEPENDPATH += $$PWD/../Libs/rabbitmq/win/debug/include/rabbitmq-c
+win32:INCLUDEPATH += $$PWD/../Libs/rabbitmq/win/include
+win32:DEPENDPATH += $$PWD/../Libs/rabbitmq/win/include
+win32:INCLUDEPATH += $$PWD/../Libs/rabbitmq/win/include/rabbitmq-c
+win32:DEPENDPATH += $$PWD/../Libs/rabbitmq/win/include/rabbitmq-c
 
 
 

+ 63 - 47
CAE_Solution/src/threadPool_and_statemachine/dealWith/boostjsonobject.cpp

@@ -13,6 +13,16 @@ boostJsonObject::boostJsonObject()
     vc_struct = NULL;
     sf_struct = NULL;
     sd_struct = NULL;
+    sm_struct = NULL;
+    usrId.clear();
+    solverConfigid.clear();
+    proId.clear();
+    paramJson.clear();
+    filePath.clear();
+    fileType.clear();
+    fileName.clear();
+    action.clear();
+    vec_sd_struct.clear();
 }
 
 /*
@@ -43,6 +53,10 @@ boostJsonObject::~boostJsonObject()
         delete sd_struct;
         sd_struct = NULL;
     }
+    if(sm_struct){
+        delete sm_struct;
+        sm_struct = NULL;
+    }
     qDeleteAll(vec_sd_struct);
 }
 
@@ -52,25 +66,24 @@ boostJsonObject::~boostJsonObject()
  * @brief: void
  * @birth: created by czm in 20230508
  */
-void boostJsonObject::FromJson(string msg)
+void boostJsonObject::FromJson(std::string msg)
 {
-    //qDebug()<<QString::fromStdString(msg);
     stringstream msgs(msg);
-    ptree root;
-    read_json(msgs,root);//boost 方法
+    boost::property_tree::ptree root;
+    boost::property_tree::read_json(msgs,root);//boost 方法
 
-    this->usrId = root.get<string>("usrId");
-    this->solverConfigid = root.get<string>("solverConfigid");
-    this->proId = root.get<string>("proId");
-    this->paramJson = root.get<string>("paramJson");
-    this->action = root.get<string>("action");
+    this->usrId = root.get<std::string>("usrId");
+    this->solverConfigid = root.get<std::string>("solverConfigid");
+    this->proId = root.get<std::string>("proId");
+    this->paramJson = root.get<std::string>("paramJson");
+    this->action = root.get<std::string>("action");
 
     if(this->action == "SliceDisplayApply"){
-        ptree items_arr;
-        ptree items = root.get_child("paramJson");
-        for(ptree::iterator it = items.begin();it!= items.end();++it){
+        boost::property_tree::ptree items_arr;
+        boost::property_tree::ptree items = root.get_child("paramJson");
+        for(boost::property_tree::ptree::iterator it = items.begin();it!= items.end();++it){
             items_arr = it->second;
-            ptree::iterator it1 = items_arr.begin();
+            boost::property_tree::ptree::iterator it1 = items_arr.begin();
             for(it1;it1!=items_arr.end();it1++){
                 sliceDisplay_struct *sd_struct_ = new sliceDisplay_struct();
                 sd_struct_->index = it1->second.get<int>("index");
@@ -118,6 +131,7 @@ boostJsonObject *boostJsonObject::operator=(boostJsonObject *object)
     this->sf_struct = object->sf_struct;
     this->sd_struct = object->sd_struct;
     this->vec_sd_struct = object->vec_sd_struct;
+    this->sm_struct = object->sm_struct;
     return this;
 }
 
@@ -127,9 +141,9 @@ boostJsonObject *boostJsonObject::operator=(boostJsonObject *object)
  * @brief: josn msg
  * @birth: created by czm in 20230508
  */
-string boostJsonObject::ToJson(string type, QMap<QString, string> map_)
+std::string boostJsonObject::ToJson(std::string type, QMap<QString, std::string> map_)
 {
-    ptree root,item;
+    boost::property_tree::ptree root,item;
     root.put("usrId",this->usrId);
     root.put("solverConfigid",this->solverConfigid);
     root.put("proId",this->proId);
@@ -173,15 +187,15 @@ string boostJsonObject::ToJson(string type, QMap<QString, string> map_)
         item.put("position_x",map_["position_x"]);
         item.put("position_y",map_["position_y"]);
         item.put("position_z",map_["position_z"]);
-        string xrange = map_["min_position_x"];
+        std::string xrange = map_["min_position_x"];
         xrange +=",";
         xrange+=(map_["max_position_x"]);
         item.put("xrange",xrange);
-        string yrange = map_["min_position_y"];
+        std::string yrange = map_["min_position_y"];
         yrange+=",";
         yrange+=(map_["max_position_y"]);
         item.put("yrange",yrange);
-        string zrange = map_["min_position_z"];
+        std::string zrange = map_["min_position_z"];
         zrange += ",";
         zrange+=(map_["max_position_z"]);
         item.put("zrange",zrange);
@@ -198,13 +212,13 @@ string boostJsonObject::ToJson(string type, QMap<QString, string> map_)
         item.put("dataV",map_["dataV"]);
         item.put("dataW",map_["dataW"]);
     }else if(type == "exception"){
-        item.put("Error",map_["exception"]);
+        item.put("Error",map_["Error"]);
     }
     stringstream tmp;
-    json_parser::write_json(tmp,item);
+    boost::property_tree::json_parser::write_json(tmp,item);
     root.put("paramJson",tmp.str());
     stringstream mmsg;
-    json_parser::write_json (mmsg,root);
+    boost::property_tree::json_parser::write_json (mmsg,root);
     return mmsg.str();
 }
 
@@ -219,38 +233,38 @@ void boostJsonObject::FromParamJson(string param)
     if(param.empty())return;
     stringstream params;
     params<<param;
-    ptree root;
-    read_json(params,root);
+    boost::property_tree::ptree root;
+    boost::property_tree::read_json(params,root);
 
     if(this->action == "loaddata"){
-        this->filePath = root.get<string>("filePath");
+        this->filePath = root.get<std::string>("filePath");
     }
     if(this->action == "ResultImport"){
-        this->filePath = root.get<string>("filePath");
-        this->fileType = root.get<string>("fileType");
-        this->fileName = root.get<string>("fileName");
+        this->filePath = root.get<std::string>("filePath");
+        this->fileType = root.get<std::string>("fileType");
+        this->fileName = root.get<std::string>("fileName");
     }
     if(this->action == "ContourDisplay"){
         this->cd_struct = new contourDisplay_struct();
         cd_struct->level = root.get<int>("level");
-        QString range = QString::fromStdString(root.get<string>("range"));
+        QString range = QString::fromStdString(root.get<std::string>("range"));
         QStringList range_list = range.split(",");
         cd_struct->range[0] = range_list[0].toDouble();
         cd_struct->range[1] = range_list[1].toDouble();
-        cd_struct->scalarName = root.get<string>("scalarName");
+        cd_struct->scalarName = root.get<std::string>("scalarName");
     }else if(this->action == "LineDisplay"){
         this->ld_struct = new contourDisplay_struct();
         ld_struct->level = root.get<int>("level");
-        QString range = QString::fromStdString(root.get<string>("range"));
+        QString range = QString::fromStdString(root.get<std::string>("range"));
         QStringList range_list = range.split(",");
         ld_struct->range[0] = range_list[0].toDouble();
         ld_struct->range[1] = range_list[1].toDouble();
-        ld_struct->scalarName = root.get<string>("scalarName");
+        ld_struct->scalarName = root.get<std::string>("scalarName");
     }else if(this->action == "VectorDisplay"){
         vc_struct = new vectorDisplay_struct();
-        vc_struct->dataU = root.get<string>("dataU");
-        vc_struct->dataV = root.get<string>("dataV");
-        vc_struct->dataW = root.get<string>("dataW");
+        vc_struct->dataU = root.get<std::string>("dataU");
+        vc_struct->dataV = root.get<std::string>("dataV");
+        vc_struct->dataW = root.get<std::string>("dataW");
         vc_struct->scaleFactor = root.get<double>("scaleFactor");
     }else if(this->action == "SolidSurfaceDisplay"){
         sf_struct = new solidsurfaceDisplay_struct();
@@ -276,26 +290,28 @@ void boostJsonObject::FromParamJson(string param)
         sd_struct->index = sd_struct->index - 1;
     }else if(this->action == "StreamDisplayCreate"){
         sm_struct = new streamDisplay_struct();
-        sm_struct->u = root.get<string>("u");
-        sm_struct->v = root.get<string>("v");
-        sm_struct->w = root.get<string>("w");
+        sm_struct->u = root.get<std::string>("u");
+        sm_struct->v = root.get<std::string>("v");
+        sm_struct->w = root.get<std::string>("w");
+        sm_struct->x = root.get<double>("x");//未使用xyz
+        sm_struct->y = root.get<double>("y");
+        sm_struct->z = root.get<double>("z");
     }else if(this->action == "StreamDisplaySelect"){
         //do nothing
     }else if(this->action == "StreamDisplayDeleteLast"){
         //do nothing
     }else if(this->action == "StreamDisplayDeleteAll"){
         //do nothing
-    }else if(this->action == "StreamDisplayApply"){
+    }else if(this->action == "StreamDisplayApply"){//没有使用
         sm_struct = new streamDisplay_struct();
-        sm_struct->direction = root.get<string>("direction");
-        sm_struct->streamstyle = root.get<string>("streamstyle");
+        sm_struct->direction = root.get<std::string>("direction");
+        sm_struct->streamstyle = root.get<std::string>("streamstyle");
         sm_struct->initialstep = root.get<double>("initialstep");
         sm_struct->maxpropagation = root.get<double>("maxpropagation");
         sm_struct->minimumstep = root.get<double>("minimumstep");
         sm_struct->showstate = root.get<bool>("showstate");
         sm_struct->toolstate = root.get<bool>("toolstate");
     }
-
 }
 
 /*
@@ -306,14 +322,14 @@ void boostJsonObject::FromParamJson(string param)
  */
 string boostJsonObject::ToJson_updateslice(QMap<int, SliceDisplayWidget *>map_)
 {
-    ptree root;
+    boost::property_tree::ptree root;
     root.put("usrId",this->usrId);
     root.put("solverConfigid",this->solverConfigid);
     root.put("proId",this->proId);
     root.put("action",this->action);
-    ptree children;
+    boost::property_tree::ptree children;
     for(auto iter = map_.begin();iter!=map_.end();iter++){
-        ptree child;
+        boost::property_tree::ptree child;
         child.put("index",iter.key()+1);
         child.put("normal_x",iter.value()->GetNormal()[0]);
         child.put("normal_y",iter.value()->GetNormal()[1]);
@@ -323,14 +339,14 @@ string boostJsonObject::ToJson_updateslice(QMap<int, SliceDisplayWidget *>map_)
         child.put("position_z",iter.value()->GetPosition()[2]);
         children.push_back(make_pair("",child));
     }
-    ptree pt;
+    boost::property_tree::ptree pt;
     pt.add_child("update_param", children);
     stringstream tmp_;
-    json_parser::write_json(tmp_,pt);
+    boost::property_tree::json_parser::write_json(tmp_,pt);
     root.put("paramJson",tmp_.str());
 
     stringstream mmsg;
-    json_parser::write_json (mmsg,root);
+    boost::property_tree::json_parser::write_json (mmsg,root);
     return mmsg.str();
 }
 

+ 12 - 16
CAE_Solution/src/threadPool_and_statemachine/dealWith/boostjsonobject.h

@@ -13,29 +13,25 @@
 #include <QDebug>
 
 
-
-using namespace std;
-using namespace boost::property_tree;
-
 class boostJsonObject
 {
 public:
     boostJsonObject();
     ~boostJsonObject();
-    void FromJson(string msg);
+    void FromJson(std::string msg);
     boostJsonObject* operator=(boostJsonObject* object);
-    string ToJson(string type,QMap<QString,string> map_);
-    void FromParamJson(string);
-    string ToJson_updateslice(QMap<int,SliceDisplayWidget*>);
+    std::string ToJson(std::string type,QMap<QString,std::string> map_);
+    void FromParamJson(std::string);
+    std::string ToJson_updateslice(QMap<int,SliceDisplayWidget*>);
 public:
-    string usrId;
-    string solverConfigid;
-    string proId;
-    string paramJson;
-    string filePath;
-    string fileType;
-    string fileName;
-    string action;
+    std::string usrId;
+    std::string solverConfigid;
+    std::string proId;
+    std::string paramJson;
+    std::string filePath;
+    std::string fileType;
+    std::string fileName;
+    std::string action;
     contourDisplay_struct* cd_struct;//contour
     contourDisplay_struct* ld_struct;//line
     vectorDisplay_struct*  vc_struct;//vector

+ 3 - 0
CAE_Solution/src/threadPool_and_statemachine/dealWith/display_struct.h

@@ -72,6 +72,9 @@ public:
     string u;
     string v;
     string w;
+    double x;
+    double y;
+    double z;
     string direction;
     string streamstyle;
     double initialstep;

+ 172 - 102
CAE_Solution/src/threadPool_and_statemachine/dealWith/handlepool.cpp

@@ -50,8 +50,11 @@ handlePool::~handlePool()
     qDeleteAll(map_vectordisplay);
     qDeleteAll(map_solidsdisplay);
     qDeleteAll(qmapResultmanager);
+    qDeleteAll(map_slicedisplay);
+    qDeleteAll(map_streamdisplay);
     contour_sendrange_flag = false;
     line_sendrange_flag = false;
+    w = NULL;
 }
 
 /*
@@ -68,17 +71,13 @@ void handlePool::getmsg_recvstateTohandlePool(std::string recvmsg)
     try{//处理异常
         json_object->FromJson(recvmsg);
     }catch(exception ex){
-        QMap<QString,string> map_;
-        map_.insert("exception",ex.what());
-        emit sendImg_handlePoolToSendstate(json_object->ToJson("exception",map_));
+        emit sendImg_handlePoolToSendstate(json_object->ToJson("exception",buildError_msg(ex.what())));
         return;
     }
     try{
         operateRender(json_object,render_);//解析命令
     }catch(exception ex){
-        QMap<QString,string> map_2;
-        map_2.insert("exception",ex.what());
-        emit sendImg_handlePoolToSendstate(json_object->ToJson("exception",map_2));
+        emit sendImg_handlePoolToSendstate(json_object->ToJson("exception",buildError_msg(ex.what())));
         return;
     }
 }
@@ -235,8 +234,9 @@ void handlePool::judgeLoaddata(boostJsonObject *object, QVTKRenderer *render_)
             render_->RemoveAllActors();
         }
     }
-     QString m_filePath = object->filePath;//测试路径
+    //QString m_filePath = object->filePath;//测试路径
     //QString m_filePath = "F:\\czm\\vtkfile\\tfg.ugrid";
+    QString m_filePath = "C:\\Users\\Administrator\\Desktop\\VTK\\f.vtk";
     QFileInfo fileinfo_(m_filePath);
     if(!fileinfo_.isFile()){
         cout<<"file path is Empty!"<<endl;
@@ -273,15 +273,20 @@ void handlePool::judgeLoaddata(boostJsonObject *object, QVTKRenderer *render_)
  */
 bool handlePool::resultImport(boostJsonObject *object_, QVTKRenderer *renderer_)
 {
-    vector<string> tmp = stringSplit(object_->fileName,',');
-    QStringList fileName_list;
-    for(auto & x:tmp){
-        fileName_list.append(QString::fromStdString(x));
-    }
-    if(fileName_list.isEmpty()){
-        cout<< "No Tecplot file is ready to read!"<<endl;
-        return false;
+    string type_;
+    //object_->fileName = "whole_part1.plt,whole_part2.plt";
+    size_t found = object_->fileName.find_first_of(',');
+    if(found==string::npos){//单个文件
+        vector<string> tmp = stringSplit(object_->fileName,'.');
+        if(tmp[1]!="vtk"){
+            emit sendImg_handlePoolToSendstate(object_->ToJson("exception",buildError_msg("please open vtk file")));
+            return false;
+        }
+        type_ = "vtkfile";
+    }else{
+        type_ = "notvtkfile";
     }
+
     //判断有无窗口
     if(!qmapRender.contains(object_->proId)){
         renderer_ = new QVTKRenderer();
@@ -291,12 +296,12 @@ bool handlePool::resultImport(boostJsonObject *object_, QVTKRenderer *renderer_)
         renderer_->widgetFlag = QVTKRenderer::WidgetModel::NoModel;
     }else{
         renderer_ = qmapRender[object_->proId];
-        auto flag = renderer_->widgetFlag;
-        if(flag==QVTKRenderer::WidgetModel::UgridModel){
+        auto flag_ = renderer_->widgetFlag;
+        if(flag_==QVTKRenderer::WidgetModel::UgridModel){
             renderer_ = qmapRender.value(object_->proId);
             renderer_->HideAllActors();//to do 有bug 先导入结果,在loaddata,再导入,会报错
             renderer_->RemoveAllActors();
-        }else if(flag ==QVTKRenderer::WidgetModel::ResultModel){
+        }else if(flag_ ==QVTKRenderer::WidgetModel::ResultModel){
             if(qmapResultmanager.value(object_->proId)->fileName == (object_->fileName)){//to do 详细比对文件名
                 send_picture(object_,renderer_);
                 return true;
@@ -307,72 +312,118 @@ bool handlePool::resultImport(boostJsonObject *object_, QVTKRenderer *renderer_)
         }
     }
     //object_->filePath = "C:\\Users\\Administrator\\Desktop\\Postprocess_Binary";//测试路径
+    object_->filePath = "C:\\Users\\Administrator\\Desktop\\VTK";//测试路径
     QDir dir(QString::fromStdString(object_->filePath));
     if(!dir.exists()){
         return false;
     }
 
 
-    ResultMeshManager* rsMeshManager = new ResultMeshManager();
-    rsMeshManager->Clear();
-    bool flag = true;
-    for(int i =0;i<fileName_list.size();i++){
-        bool f =rsMeshManager->LoadData(QString::fromStdString(object_->filePath)+"/"+fileName_list[i]);
+    ResultManager* rsManager = NULL;
+    //rsManager->Clear();
+    if(type_ == "notvtkfile"){
+
+        vector<string> tmp = stringSplit(object_->fileName,',');
+        QStringList fileName_list;
+        for(auto & x:tmp){
+            fileName_list.append(QString::fromStdString(x));
+        }
+        if(fileName_list.isEmpty()){
+            cout<< "No Tecplot file is ready to read!"<<endl;
+            return false;
+        }
+        bool flag = true;
+        rsManager = new ResultMeshManager();
+        rsManager->Clear();
+        rsManager->fileType = "plt";
+        for(int i =0;i<fileName_list.size();i++){
+            bool f =rsManager->LoadData(QString::fromStdString(object_->filePath)+"/"+fileName_list[i]);//加载
+            if(f){
+                rsManager->SetSaveIndex(i);
+                if(renderer_){
+                    rsManager->DisplayMesh(renderer_);
+                }
+            }else{
+                flag = false;
+                break;
+            }
+        }
+        if(flag)
+        {
+            rsManager->HideAllActors();
+            rsManager->ShowAll();
+            rsManager->DisplayMeshByIndex(0);
+            rsManager->SetNameTypeMap();
+            rsManager->InitWidgetsParameter();
+            renderer_->ZoomToExtents();
+        }else {
+            return false;
+        }
+    }else if(type_ == "vtkfile"){
+        object_->fileName = "dynamicResponse-transient36.vtk";
+        rsManager = new ResultVTKManager();
+        rsManager->Clear();
+        rsManager->fileType = "VTK";
+        bool flag = true;
+#ifdef _WIN32
+        QString filename = QString::fromStdString(object_->filePath)+"\\"+QString::fromStdString(object_->fileName);
+#else
+        QString filename = QString::fromStdString(object_->filePath)+"/"+QString::fromStdString(object_->fileName);
+#endif
+        bool f = rsManager->LoadData(filename);//加载
+        rsManager->uncontourVec_.clear();
         if(f){
-            rsMeshManager->SetSaveIndex(i);
             if(renderer_){
-                rsMeshManager->DisplayMesh(renderer_);
+                rsManager->DisplayMesh(renderer_);
             }
         }else{
             flag = false;
-            break;
         }
-    }
-    if(flag)
-    {
-        rsMeshManager->HideAllActors();
-        rsMeshManager->ShowAll();
-        rsMeshManager->DisplayMeshByIndex(0);
-        rsMeshManager->SetNameTypeMap();
-        rsMeshManager->InitWidgetsParameter();
-        renderer_->ZoomToExtents();
+        if(flag){
+            //rsManager->HideAllActors();
+            rsManager->InitWidgetsParameter();
+            rsManager->SetNameTypeMap();
+            renderer_->ZoomToExtents();
+        }else{
+            return false;
+        }
     }
     /*********************************************/
     ContourDisplayW *contourdw = new ContourDisplayW();//云图窗口参数初始化
-    rsMeshManager->SetCotourWidget(contourdw);
-    rsMeshManager->SetWidgetRange();
-    rsMeshManager->SetWidgetScalarName();
+    rsManager->SetCotourWidget(contourdw);
+    rsManager->SetWidgetRange();
+    rsManager->SetWidgetScalarName();
 
     LineDisplayW *linedw = new LineDisplayW();//等值线窗口初始化参数
-    rsMeshManager->SetLineWidget(linedw);
+    rsManager->SetLineWidget(linedw);
 
     VectorW *vecdW = new VectorW();//矢量窗口初始化参数
-    rsMeshManager->SetVectorWidget(vecdW);
+    rsManager->SetVectorWidget(vecdW);
 
 
     SolidSurfaceWidget* solidfW = new SolidSurfaceWidget();//实体表面窗口初始化参数
-    rsMeshManager->SetSurfaceSolidWidget(solidfW);
+    rsManager->SetSurfaceSolidWidget(solidfW);
 
-    SsliceWidget * ssliceW = new SsliceWidget();//切片窗口初始化参数
-    rsMeshManager->SetSliceWidget(ssliceW);
+    //SsliceWidget * ssliceW = new SsliceWidget();//切片窗口初始化参数
+    //rsManager->SetSliceWidget(ssliceW);
 
     StreamDisplayWidget* streamW = new StreamDisplayWidget();//流线窗口初始化参数
-    rsMeshManager->SetStremWidget(streamW);
+    rsManager->SetStremWidget(streamW);
     /********************************************/
     renderer_->widgetFlag = QVTKRenderer::WidgetModel::ResultModel;//设置当前窗口模型状态
     if(qmapResultmanager.contains(object_->proId)){//加载不同的结果文件
         delete qmapResultmanager.value(object_->proId);
     }
-    qmapResultmanager[object_->proId]=(set_map_resultManager(object_,rsMeshManager));
+    qmapResultmanager[object_->proId]=(set_map_resultManager(object_,rsManager));
 
     contour_sendrange_flag = true;//标志位,第一次加载result,即为真,云图发送range
     line_sendrange_flag = true;//标志位,第一次加载result,即为真,等值线发送range
 
-    emit sendImg_handlePoolToSendstate(object_->ToJson("importResult_contour",buildResultImport_msg("Contour",rsMeshManager)));//发送云图结果数据
-    emit sendImg_handlePoolToSendstate(object_->ToJson("importResult_line",buildResultImport_msg("Line",rsMeshManager)));//发送等值线结果数据
-    emit sendImg_handlePoolToSendstate(object_->ToJson("importResult_vector",buildResultImport_msg("Vector",rsMeshManager)));//发送矢量结果数据
-    emit sendImg_handlePoolToSendstate(object_->ToJson("importResult_solidsurface",buildResultImport_msg("Solidsurface",rsMeshManager)));//发送矢量结果数据
-    emit sendImg_handlePoolToSendstate(object_->ToJson("importResult_stream",buildResultImport_msg("Stream",rsMeshManager)));//发送流线结果数据
+    emit sendImg_handlePoolToSendstate(object_->ToJson("importResult_contour",buildResultImport_msg("Contour",rsManager)));//发送云图结果数据
+    emit sendImg_handlePoolToSendstate(object_->ToJson("importResult_line",buildResultImport_msg("Line",rsManager)));//发送等值线结果数据
+    emit sendImg_handlePoolToSendstate(object_->ToJson("importResult_vector",buildResultImport_msg("Vector",rsManager)));//发送矢量结果数据
+    emit sendImg_handlePoolToSendstate(object_->ToJson("importResult_solidsurface",buildResultImport_msg("Solidsurface",rsManager)));//发送实体表面结果数据
+    emit sendImg_handlePoolToSendstate(object_->ToJson("importResult_stream",buildResultImport_msg("Stream",rsManager)));//发送流线结果数据
     send_picture(object_,renderer_);
     return true;
 }
@@ -385,13 +436,12 @@ bool handlePool::resultImport(boostJsonObject *object_, QVTKRenderer *renderer_)
 bool handlePool::result_contourdisplay(boostJsonObject *object_,QVTKRenderer* render_)
 {
     ContourDisplay* condis = NULL;
-
     if(!qmapResultmanager.contains(object_->proId)) return false;
     render_ = qmapRender[object_->proId];
     if(map_contourdisplay.contains(object_->proId)){
         condis = map_contourdisplay.value(object_->proId);//to do
     }else{
-        condis = new ContourDisplay(qmapResultmanager[object_->proId]->resultMeshManager_);
+        condis = new ContourDisplay(qmapResultmanager[object_->proId]->resultManager_);
         map_contourdisplay.insert(object_->proId,condis);
     }
     condis->contourdisplay_execute(object_);
@@ -420,7 +470,7 @@ bool handlePool::result_linedisplay(boostJsonObject *object_,QVTKRenderer* rende
     if(map_linedisplay.contains(object_->proId)){
         linedis = map_linedisplay.value(object_->proId);//to do
     }else{
-        linedis = new LineDisplay(qmapResultmanager[object_->proId]->resultMeshManager_);
+        linedis = new LineDisplay(qmapResultmanager[object_->proId]->resultManager_);
         map_linedisplay.insert(object_->proId,linedis);
     }
     linedis->linedisplay_execute(object_);
@@ -450,7 +500,7 @@ bool handlePool::result_vectordisplay(boostJsonObject *object_, QVTKRenderer *re
     if(map_vectordisplay.contains(object_->proId)){
         vecdis = map_vectordisplay[object_->proId];//to do
     }else{
-        vecdis = new Vectordisplay(qmapResultmanager[object_->proId]->resultMeshManager_);
+        vecdis = new Vectordisplay(qmapResultmanager[object_->proId]->resultManager_);
         map_vectordisplay.insert(object_->proId,vecdis);
     }
     vecdis->vectordisplay_execute(object_);
@@ -473,7 +523,7 @@ bool handlePool::result_solidsurfacedisplay(boostJsonObject *object_, QVTKRender
     if(map_solidsdisplay.contains(object_->proId)){
         solidfdis = map_solidsdisplay[object_->proId];//to do
     }else{
-        solidfdis = new SolidSurface(qmapResultmanager[object_->proId]->resultMeshManager_);
+        solidfdis = new SolidSurface(qmapResultmanager[object_->proId]->resultManager_);
         map_solidsdisplay.insert(object_->proId,solidfdis);
     }
     solidfdis->solidsurfce_execute(object_);
@@ -493,7 +543,7 @@ bool handlePool::result_slicedisplay(boostJsonObject *object_, QVTKRenderer *ren
     SliceWidget *slicedis = NULL;
     if(!qmapResultmanager.contains(object_->proId))return false;
     render_ = qmapRender[object_->proId];
-    ResultMeshManager* resultmm = qmapResultmanager[object_->proId]->resultMeshManager_;
+    ResultManager* resultmm = qmapResultmanager[object_->proId]->resultManager_;
     if(map_slicedisplay.contains(object_->proId)){
         slicedis = map_slicedisplay[object_->proId];//to do
     }else{
@@ -536,7 +586,7 @@ bool handlePool::result_streamdisplay(boostJsonObject *object_, QVTKRenderer *re
     StreamWidget* streamdis = NULL;
     if(!qmapResultmanager.contains(object_->proId))return false;
     render_ = qmapRender[object_->proId];
-    ResultMeshManager* resultmm = qmapResultmanager[object_->proId]->resultMeshManager_;
+    ResultManager* resultmm = qmapResultmanager[object_->proId]->resultManager_;
     if(map_streamdisplay.contains(object_->proId)){
         streamdis = map_streamdisplay[object_->proId];
     }else{
@@ -544,20 +594,26 @@ bool handlePool::result_streamdisplay(boostJsonObject *object_, QVTKRenderer *re
         map_streamdisplay.insert(object_->proId,streamdis);
     }
     if(type == "create"){
-        resultmm->streamW_->current_u = stoi(object_->sm_struct->u.c_str());
-        resultmm->streamW_->current_v = stoi(object_->sm_struct->v.c_str());
-        resultmm->streamW_->current_w = stoi(object_->sm_struct->w.c_str());
-        string u = resultmm->streamW_->GetUData();
-        string v = resultmm->streamW_->GetVData();
-        string w = resultmm->streamW_->GetWData();
-        resultmm->CreatVectorSource(u,v,w);
-        if(resultmm->currAddDataSource_){
-            emit sendImg_handlePoolToSendstate(object_->ToJson("create_stream",buildResultImport_msg("create_stream",resultmm,object_)));//发送流线数据
-        }
-    }else if(type == "select"){
+        if(((!(object_->sm_struct->u).empty()) && (!(object_->sm_struct->v).empty() )&& (!(object_->sm_struct->w).empty() ))&& ((object_->sm_struct->u)!=
+                                                                                                                                (object_->sm_struct->v))&&((object_->sm_struct->u)!= (object_->sm_struct->w))&&((object_->sm_struct->w)!=(object_->sm_struct->v))){
+            resultmm->streamW_->value_u = object_->sm_struct->u;
+            resultmm->streamW_->value_v = object_->sm_struct->v;
+            resultmm->streamW_->value_w = object_->sm_struct->w;
+            string u = resultmm->streamW_->GetUData();
+            string v = resultmm->streamW_->GetVData();
+            string w = resultmm->streamW_->GetWData();
+            resultmm->CreatVectorSource(u,v,w,object_->sm_struct->x,object_->sm_struct->y,object_->sm_struct->z);
+            if(resultmm->currAddDataSource_){
+                emit sendImg_handlePoolToSendstate(object_->ToJson("create_stream",buildResultImport_msg("create_stream",resultmm,object_)));//发送流线数据
+            }
+
+        }else{
+            //抛出异常
+        }
+        //}else if(type == "select"){
         resultmm->SetStreamSelectState(true);
-    }else if(type == "deletelast"){
-        resultmm->SetStreamSelectState(false);
+        //}else if(type == "deletelast"){
+        //resultmm->SetStreamSelectState(false);
     }else if(type == "deleteall"){
         resultmm->DeleteAllStream();
     }else if(type == "apply"){
@@ -567,29 +623,6 @@ bool handlePool::result_streamdisplay(boostJsonObject *object_, QVTKRenderer *re
     return true;
 }
 
-/*
- * @brief: save the tecplot filename into QStringList
- * @param: filePath
- * @ret: QStringList
- * @birth: created by czm in 20230420
- */
-//QStringList handlePool::getFileNameList(QString filePath)
-//{
-//    QStringList string_list;
-//    QDir dir(filePath); //需不需要加"\\"?
-//    if(!dir.exists()){
-//       cout <<"filePath error!please check again!"<<endl;
-//       return string_list;
-//    }
-//    dir.setFilter(QDir::Files);
-//    QStringList list = dir.entryList(QDir::Files);
-//    foreach (QFileInfo file, list) {
-//        if(file.fileName().split(".").back() == "plt"){
-//            string_list.append(file.fileName());
-//        }
-//    }
-//    return string_list;
-//}
 
 /*
  * @brief: build result file mash which need to be sent to java
@@ -597,7 +630,7 @@ bool handlePool::result_streamdisplay(boostJsonObject *object_, QVTKRenderer *re
  * @ret: msg(QString)
  * @birth: created by czm in 20230424
  */
-QMap<QString,string> handlePool::buildResultImport_msg(QString type,ResultMeshManager *cmanager)
+QMap<QString,string> handlePool::buildResultImport_msg(QString type,ResultManager *cmanager)
 {
     QMap<QString,string> map_tmp;
     cmanager->SetNameTypeMap();
@@ -606,7 +639,11 @@ QMap<QString,string> handlePool::buildResultImport_msg(QString type,ResultMeshMa
         map<string,int> map_ = cmanager->GetNameTypeMap();
         string msg;
         for(map<string,int>::iterator it=map_.begin();it!=map_.end();it++){
-            msg+=removeSpaces(it->first);
+            if(cmanager->fileType!="VTK"){
+               msg+=removeSpaces(it->first);
+            }else{
+               msg+=it->first;
+            }
             msg+="#";
             msg+=to_string(it->second);//0-point scalar 1-cell scalar
             msg+=",";
@@ -615,7 +652,11 @@ QMap<QString,string> handlePool::buildResultImport_msg(QString type,ResultMeshMa
         map_tmp.insert("nameTypes",msg);
         msg.clear();
         for(int i=0;i<cmanager->GetMeshScalarNameVec().size();i++){
-            msg += removeSpaces(cmanager->GetMeshScalarNameVec()[i]);
+            if(cmanager->fileType!="VTK"){
+                msg += removeSpaces(cmanager->GetMeshScalarNameVec()[i]);
+            }else{
+                msg+=cmanager->GetMeshScalarNameVec()[i];
+            }
             msg += ",";
         }
         msg = msg.erase(msg.size()-1);
@@ -629,7 +670,11 @@ QMap<QString,string> handlePool::buildResultImport_msg(QString type,ResultMeshMa
         map_tmp.insert("range1",msg);
         msg.clear();
         msg = cmanager->GetMeshScalarNameVec()[0];
-        map_tmp.insert("scalarName",removeSpaces(msg));
+        if(cmanager->fileType!="VTK"){
+            map_tmp.insert("scalarName",removeSpaces(msg));
+        }else{
+            map_tmp.insert("scalarName",msg);
+        }
     }else if(type == "Vector"){
         string msg;
         vector<string> vec_u = cmanager->vectorWidget_->dataU;
@@ -673,21 +718,33 @@ QMap<QString,string> handlePool::buildResultImport_msg(QString type,ResultMeshMa
         string msg;
         StreamDisplayWidget* smdW = cmanager->streamW_;
         for(int i = 0; i<smdW->dataU.size();i++){
+        if(cmanager->fileType!="VTK"){
             msg+=removeSpaces(smdW->dataU[i]);
+        }else{
+            msg+=smdW->dataU[i];
+        }
             msg+=",";
         }
         msg = msg.erase(msg.size()-1);
         map_tmp.insert("dataU",msg);
         msg.clear();
         for(int j = 0;j<smdW->dataV.size();j++){
-            msg+=removeSpaces(smdW->dataV[j]);
+            if(cmanager->fileType!="VTK"){
+                msg+=removeSpaces(smdW->dataV[j]);
+            }else{
+                msg+=smdW->dataV[j];
+            }
             msg+=",";
         }
         msg=msg.erase(msg.size()-1);
         map_tmp.insert("dataV",msg);
         msg.clear();
         for(int k = 0; k <smdW->dataW.size();k++){
-            msg+=removeSpaces(smdW->dataW[k]);
+            if(cmanager->fileType!="VTK"){
+                msg+=removeSpaces(smdW->dataW[k]);
+            }else{
+                msg+=smdW->dataW[k];
+            }
             msg+=",";
         }
         msg = msg.erase(msg.size()-1);
@@ -703,7 +760,7 @@ QMap<QString,string> handlePool::buildResultImport_msg(QString type,ResultMeshMa
  * @ret: msg(QString)
  * @birth: created by czm in 20230506
  */
-QMap<QString, string> handlePool::buildResultImport_msg(QString type, ResultMeshManager *cmanager, boostJsonObject *object)
+QMap<QString, string> handlePool::buildResultImport_msg(QString type, ResultManager *cmanager, boostJsonObject *object)
 {
     QMap<QString,string> map_tmp;
     if(type == "addpage_slice"){
@@ -748,6 +805,19 @@ QMap<QString, string> handlePool::buildResultImport_msg(QString type, ResultMesh
     return map_tmp;
 }
 
+/*
+ * @brief: build error msg to send java
+ * @param: QString
+ * @ret: map
+ * @birth: created by czm in 20230517
+ */
+QMap<QString, string> handlePool::buildError_msg(string msg)
+{
+    QMap<QString,string> map;
+    map.insert("Error",msg);
+    return map;
+}
+
 /*
  * @brief: send picture
  * @param: boostJsonObject QVTKRenderer
@@ -827,10 +897,10 @@ pid_meshManager *handlePool::set_map_meshManager(boostJsonObject *object, MeshMa
  * @ret: pid_resultManager
  * @birth: created by czm in 20230425
  */
-pid_resultManager *handlePool::set_map_resultManager(boostJsonObject *object, ResultMeshManager *rmanager_)
+pid_resultManager *handlePool::set_map_resultManager(boostJsonObject *object, ResultManager *rmanager_)
 {
     pid_resultManager *resultManager_p = new pid_resultManager();
-    resultManager_p->resultMeshManager_ = rmanager_;
+    resultManager_p->resultManager_ = rmanager_;
     resultManager_p->fileName = object->fileName;
     resultManager_p->filePath = object->filePath;
     return resultManager_p;

+ 12 - 6
CAE_Solution/src/threadPool_and_statemachine/dealWith/handlepool.h

@@ -10,15 +10,15 @@
 #include <QStringList>
 #include <QString>
 #include "../../VTK/QVTKRenderer/qvtkrenderer.h"
-#include "../../VTK/Manager/meshmanager.h"
+#include "../../VTK/Manager/MeshManager.h"
 #include "../../VTK/Manager/ResultMeshManager.h"
+#include "../../VTK/Manager/resultvtkmanager.h"
 #include "../../VTK/display/contourdisplay.h"
 #include "../../VTK/display/linedisplay.h"
 #include "../../VTK/display/vectordisplay.h"
 #include "../../VTK/display/solidsurfacewidget.h"
 #include "../../VTK/display/slicewidget.h"
 #include "../../VTK/display/streamwidget.h"
-#include "../../VTK/visualization_VTK/vtkVISUnContour.h"
 #include "../../VTK/widget/contourdispalyWidget.h"
 #include "../../VTK/widget/linedisplayWidget.h"
 #include "../../VTK/widget/slicedisplaywidget.h"
@@ -26,12 +26,18 @@
 #include "../../VTK/widget/streamDisplaywidget.h"
 #include "../../VTK/widget/vectorDisplaywidget.h"
 #include "../../VTK/widget/Sslicewidget.h"
+#include "../../VTK/visualization_VTK/vtkVISUnContour.h"
+#include "../../VTK/visualization_VTK/vtkvisunshademesh.h"
+#include "../../VTK/visualization_VTK/vtkvisunstructuredgridsource.h"
+#include "../../VTK/visualization_VTK/vtkvisunstructuredgridmanager.h"
+#include "../../VTK/visualization_VTK/vtkVISManager.h"
 #include <map>
 #include <QMap>
 #include <string>
 #include <QDebug>
 #include "boostjsonobject.h"
 #include "map_manager.h"
+
 using namespace std;
 
 class handlePool : public QObject
@@ -51,9 +57,9 @@ public:
     bool result_solidsurfacedisplay(boostJsonObject*, QVTKRenderer *);
     bool result_slicedisplay(boostJsonObject*, QVTKRenderer *,QString);
     bool result_streamdisplay(boostJsonObject*, QVTKRenderer *,QString);
-    //QStringList getFileNameList(QString);
-    QMap<QString,string> buildResultImport_msg(QString,ResultMeshManager*);
-    QMap<QString,string> buildResultImport_msg(QString,ResultMeshManager*,boostJsonObject*);
+    QMap<QString,string> buildResultImport_msg(QString,ResultManager*);
+    QMap<QString,string> buildResultImport_msg(QString,ResultManager*,boostJsonObject*);
+    QMap<QString,string> buildError_msg(string);
     void send_picture(boostJsonObject*,QVTKRenderer*);
     string removeSpaces(string);
     vector<string> stringSplit(const string& str, char delim);
@@ -62,7 +68,7 @@ public:
     QMap<string,pid_meshManager*> getMapManager();
     QMap<string,pid_resultManager*> getMapResultManager();
     pid_meshManager* set_map_meshManager(boostJsonObject*,MeshManager*);
-    pid_resultManager* set_map_resultManager(boostJsonObject*,ResultMeshManager*);
+    pid_resultManager* set_map_resultManager(boostJsonObject*,ResultManager*);
 
 
 private:

+ 5 - 5
CAE_Solution/src/threadPool_and_statemachine/dealWith/map_manager.h

@@ -2,7 +2,7 @@
 #define MAP_MANAGER_H
 
 #include <QString>
-#include "../../VTK/Manager/meshmanager.h"
+#include "../../VTK/Manager/MeshManager.h"
 #include "../../VTK/Manager/ResultMeshManager.h"
 #include "../../VTK/QVTKRenderer/qvtkrenderer.h"
 
@@ -43,13 +43,13 @@ class pid_resultManager : public pid_manager
 public:
     pid_resultManager(){}
     ~pid_resultManager(){
-        if(resultMeshManager_){
-            delete resultMeshManager_;
-            resultMeshManager_ = NULL;
+        if(resultManager_){
+            delete resultManager_;
+            resultManager_ = NULL;
         }
     }
 public:
-    ResultMeshManager* resultMeshManager_;
+    ResultManager* resultManager_;
 };
 
 #endif // MAP_MANAGER_H

+ 0 - 367
CAE_Solution/src/threadPool_and_statemachine/dealWith/vtkjsonobject.cpp

@@ -1,367 +0,0 @@
-#include "vtkjsonobject.h"
-
-/*
- * @brief: the constructor
- * @param:
- * @brief:
- * @birth: created by czm in 20230404
- */
-vtkJsonObject::vtkJsonObject()
-{
-    cd_struct = NULL;
-    ld_struct = NULL;
-    vc_struct = NULL;
-}
-
-/*
- * @brief: the destructor
- * @param:
- * @brief:
- * @birth: created by czm in 20230404
- */
-vtkJsonObject::~vtkJsonObject()
-{
-    if(cd_struct){
-        free(cd_struct);
-        cd_struct = NULL;
-    }
-    if(ld_struct){
-        free(ld_struct);
-        ld_struct = NULL;
-    }
-    if(vc_struct){
-        free(vc_struct);
-        vc_struct = NULL;
-    }
-}
-
-/*
- * @brief: parsing json msg(解析json数据)
- * @param: json msg
- * @brief: void
- * @birth: created by czm in 20230404
- */
-void vtkJsonObject::FromJSON(std::string msg)
-{
-    //QByteArray byteArray(msg.c_str(),msg.length());
-
-    QJsonParseError jsonError;
-    QJsonDocument doucment = QJsonDocument::fromJson(msg.c_str(), &jsonError);  // 转化为 JSON 文档
-    if(jsonError.error!=QJsonParseError::NoError)qDebug()<<"error!"<<jsonError.errorString();
-    if (!doucment.isNull() && (jsonError.error == QJsonParseError::NoError)) {  // 解析未发生错误
-        if (doucment.isObject()) {  // JSON 文档为对象
-            QJsonObject object = doucment.object();  // 转化为对象
-            if (object.contains("usrId")) {
-                QJsonValue value = object.value("usrId");
-                if (value.isString()) {
-                    this->usrId = value.toString();
-                    qDebug()<<"usrId:"<<this->usrId;
-                }
-            }
-            if (object.contains("solverConfigid")) {
-                QJsonValue value = object.value("solverConfigid");
-                if (value.isString()) {
-                    this->solverConfigid = value.toString();
-                    qDebug()<<"solverConfigid:"<<this->solverConfigid;
-                }
-            }
-            if (object.contains("proId")) {
-                QJsonValue value = object.value("proId");
-                if (value.isString()) {
-                    this->proId = value.toString();
-                    qDebug()<<"proid:"<<this->proId;
-                }
-            }
-            if (object.contains("paramJson")) {
-                QJsonValue value = object.value("paramJson");
-                if (value.isString()) {
-                    this->paramJson = value.toString();
-                    qDebug()<<"paramJson:"<<this->paramJson;
-                }
-            }
-            if (object.contains("action")) {
-                QJsonValue value = object.value("action");
-                if (value.isString()) {
-                    this->action = value.toString();
-                    qDebug()<<"action:"<<this->action;
-                }
-            }
-
-        }
-    }
-    FromParamJson(this->paramJson.toStdString());//进一步解析paramjson
-}
-
-
-/*
- * @brief: operator =(重载=符号)
- * @param: vtkJsonObject
- * @brief: this pointer
- * @birth: created by czm in 20230406
- */
-vtkJsonObject *vtkJsonObject::operator=(vtkJsonObject *object)
-{
-    this->usrId = object->usrId;
-    this->solverConfigid = object->solverConfigid;
-    this->proId = object->proId;
-    this->filePath = object->filePath;
-    this->fileType = object->fileType;
-    this->action = object->action;
-    this->paramJson = object->paramJson;
-    this->fileName = object->getFileName();
-    this->cd_struct = object->cd_struct;
-    this->vc_struct = object->vc_struct;
-    return this;
-}
-
-/*
- * @brief: Build JSON message(组成json数据)
- * @param: img file
- * @brief: josn msg
- * @birth: created by czm in 20230404
- */
-std::string vtkJsonObject::ToJson(std::string type,QMap<QString,string> file)
-{
-    //qDebug()<<"imgfile"<<QString::fromStdString(file);
-    QJsonObject pageObject;
-    pageObject.insert("filePath",this->filePath);
-    pageObject.insert("fileType",this->fileType);
-
-    QJsonObject json;
-    json.insert("usrId",this->usrId);
-    json.insert("solverConfigid",this->solverConfigid);
-    json.insert("proId",this->proId);
-    if(this->paramJson.isEmpty()){
-        json.insert("paramJson",this->paramJson);
-    }else{
-        json.insert("paramJson","");
-    }
-    json.insert("action",this->action);
-    if(type == "img"){
-        json.insert("img",QString::fromStdString(file["img"]));
-    }else if(type == "importResult_contour"){
-        json.insert("msgType","contour_param");
-        json.insert("scalarName",QString::fromStdString(file["scalarName"]));
-        json.insert("scalarNames",QString::fromStdString(file["scalarNames"]));
-        json.insert("nameTypes",QString::fromStdString(file["nameTypes"]));
-        json.insert("range0",QString::fromStdString(file["range0"]));
-        json.insert("range1",QString::fromStdString(file["range1"]));
-    }else if(type == "importResult_line"){
-        json.insert("msgType","line_param");
-        json.insert("scalarName",QString::fromStdString(file["scalarName"]));
-        json.insert("scalarNames",QString::fromStdString(file["scalarNames"]));
-        json.insert("nameTypes",QString::fromStdString(file["nameTypes"]));
-        json.insert("range0",QString::fromStdString(file["range0"]));
-        json.insert("range1",QString::fromStdString(file["range1"]));
-    }else if(type == "contourDisplay"){
-        json.insert("msgType","contourDisplay_range");
-        json.insert("minRange",QString::fromStdString(file["minRange"]));
-        json.insert("maxRange",QString::fromStdString(file["maxRange"]));
-    }else if(type == "importResult_vector"){
-        json.insert("msgType","vector_param");
-        json.insert("dataU",QString::fromStdString(file["dataU"]));
-        json.insert("dataV",QString::fromStdString(file["dataV"]));
-        json.insert("dataW",QString::fromStdString(file["dataW"]));
-        json.insert("scaleFactor",QString::fromStdString(file["scaleFactor"]));
-    }else if(type == "importResult_solidsurface"){
-        json.insert("msgType","solidsurface_param");
-        json.insert("r",QString::fromStdString(file["r"]));
-        json.insert("g",QString::fromStdString(file["g"]));
-        json.insert("b",QString::fromStdString(file["b"]));
-        json.insert("transparency",QString::fromStdString(file["transparency"]));
-        json.insert("showHideState",QString::fromStdString(file["showHideState"]));
-    }
-
-    QJsonDocument document;
-    document.setObject(json);
-    QByteArray byteArray = document.toJson(QJsonDocument::Compact);
-    QString strJson(byteArray);
-    qDebug()<<"strJson:"<<strJson;
-    return strJson.toStdString();
-}
-
-/*
- * @brief: analysis paramjson
- * @param: paramjson
- * @ret: void
- * @birth: created by czm in 20230427
- */
-void vtkJsonObject::FromParamJson(string param)
-{
-    if(!param.empty()){
-        QJsonParseError jsonError;
-        std::cout<<"std::string paramjson:"<<param<<std::endl;
-        QJsonDocument doucment = QJsonDocument::fromJson(param.c_str(),&jsonError);
-        if(jsonError.error!=QJsonParseError::NoError)qDebug()<<"error!"<<jsonError.errorString();
-        if (!doucment.isNull() && (jsonError.error == QJsonParseError::NoError)) {
-            if(doucment.isObject()){
-                QJsonObject object_ = doucment.object();
-                if(object_.contains("filePath")){
-                    QJsonValue value = object_.value("filePath");
-                    if (value.isString()) {
-                        this->filePath = value.toString();
-                        qDebug() << "filePath:" << this->filePath;
-                    }
-                }
-                if(object_.contains("fileType")){
-                    QJsonValue value = object_.value("fileType");
-                    if (value.isString()) {
-                        this->fileType = value.toString();
-                        qDebug() << "fileType:" << this->fileType;
-                    }
-                }//0424 append
-                if(object_.contains("fileName")){
-                    QJsonValue value = object_.value("fileName");
-                    if (value.isString()) {
-                        this->fileName = value.toString();
-                        qDebug() << "fileName:" << this->fileName;
-                    }
-                }
-                if(this->action == "ContourDisplay"){
-                    this->cd_struct = (struct contourDisplay_struct*)malloc(sizeof(struct contourDisplay_struct));
-                    if(object_.contains("level")){
-                        QJsonValue value = object_.value("level");
-                        if (value.isString()) {
-                            QString level_ = value.toString();
-                            cd_struct->level = level_.toInt();
-                        }
-                    }
-                    if(object_.contains("range")){
-                        QJsonValue value = object_.value("range");
-                        if (value.isString()) {
-                            QString range_= value.toString();
-                            QStringList range_list= range_.split(",");
-                            cd_struct->range[0] = range_list[0].toDouble();
-                            cd_struct->range[1] = range_list[1].toDouble();
-                        }
-                    }
-                    if(object_.contains("scalarName")){
-                        QJsonValue value = object_.value("scalarName");
-                        if (value.isString()) {
-                            QString scalar= value.toString();
-                            //cd_struct->scalarName = scalar.toLatin1().data();
-                            strcpy(cd_struct->scalarName,scalar.toStdString().c_str());
-                        }
-                    }
-                }
-                if(this->action == "LineDisplay"){
-                    this->ld_struct = (struct contourDisplay_struct*)malloc(sizeof(struct contourDisplay_struct));
-                    if(object_.contains("level")){
-                        QJsonValue value = object_.value("level");
-                        if (value.isString()) {
-                            QString level = value.toString();
-                            ld_struct->level = level.toInt();
-                        }
-                    }
-                    if(object_.contains("range")){
-                        QJsonValue value = object_.value("range");
-                        if (value.isString()) {
-                            QString range_= value.toString();
-                            QStringList range_list= range_.split(",");
-                            ld_struct->range[0] = range_list[0].toDouble();
-                            ld_struct->range[1] = range_list[1].toDouble();
-                        }
-                    }
-                    if(object_.contains("scalarName")){
-                        QJsonValue value = object_.value("scalarName");
-                        if (value.isString()) {
-                            QString scalar= value.toString();
-                            //ld_struct->scalarName = scalar.toStdString();
-                            strcpy(ld_struct->scalarName,scalar.toStdString().c_str());
-                        }
-                    }
-                }
-                if(this->action == "VectorDisplay"){
-                    this->vc_struct = (struct vectorDisplay_struct*)malloc(sizeof(struct vectorDisplay_struct));
-                    if(object_.contains("dataU")){
-                        QJsonValue value = object_.value("dataU");
-                        if(value.isString()){
-                            QString value_U = value.toString();
-                            strcpy(vc_struct->dataU,value_U.toStdString().c_str());
-                        }
-                    }
-                    if(object_.contains("dataV")){
-                        QJsonValue value = object_.value("dataV");
-                        if(value.isString()){
-                            QString value_V = value.toString();
-                            strcpy(vc_struct->dataV,value_V.toStdString().c_str());
-                        }
-                    }
-                    if(object_.contains("dataW")){
-                        QJsonValue value = object_.value("dataW");
-                        if(value.isString()){
-                            QString value_W = value.toString();
-                            strcpy(vc_struct->dataW,value_W.toStdString().c_str());
-                        }
-                    }
-                    if(object_.contains("scaleFactor")){
-                        QJsonValue value = object_.value("scaleFactor");
-                        if(value.isString()){
-                            QString scalefactor = value.toString();
-                            this->vc_struct->scaleFactor = scalefactor.toDouble();
-                        }
-                    }
-                }
-                if(this->action == "SolidSurfaceDisplay"){
-                    this->sf_struct = (struct solidsurfaceDisplay_struct*)malloc(sizeof(struct solidsurfaceDisplay_struct));
-                    if(object_.contains("r")){
-                        QJsonValue value = object_.value("r");
-                        if(value.isString()){
-                            QString r = value.toString();
-                            this->sf_struct->r= r.toDouble();
-                        }
-                    }
-                    if(object_.contains("g")){
-                        QJsonValue value = object_.value("g");
-                        if(value.isString()){
-                            QString g = value.toString();
-                            this->sf_struct->g= g.toDouble();
-                        }
-                    }
-                    if(object_.contains("b")){
-                        QJsonValue value = object_.value("b");
-                        if(value.isString()){
-                            QString b = value.toString();
-                            this->sf_struct->b= b.toDouble();
-                        }
-                    }
-                    if(object_.contains("transparency")){
-                        QJsonValue value = object_.value("transparency");
-                        if(value.isString()){
-                            QString transparency = value.toString();
-                            this->sf_struct->transparency= transparency.toDouble();
-                        }
-                    }
-                    if(object_.contains("showHideState")){
-                        QJsonValue value = object_.value("showHideState");
-                        if(value.isBool()){
-                            bool showHideState = value.toBool();
-                            if(showHideState){
-                                this->sf_struct->showhidestate = true;
-                            }else{
-                                this->sf_struct->showhidestate = false;
-                            }
-                        }
-                    }
-                }
-            }
-        }
-    }
-}
-
-/*
- * @brief: get filename
- * @param: void
- * @ret: filename
- * @birth: created by czm in 20230424
- */
-QString vtkJsonObject::getFileName()
-{
-    return this->fileName;
-}
-
-
-
-
-
-

+ 0 - 81
CAE_Solution/src/threadPool_and_statemachine/dealWith/vtkjsonobject.h

@@ -1,81 +0,0 @@
-#ifndef VTKJSONOBJECT_H
-#define VTKJSONOBJECT_H
-
-#include <QObject>
-#include <QJsonDocument>
-#include <QJsonParseError>
-#include <QJsonObject>
-#include <QJsonValue>
-#include <QJsonArray>
-#include <string>
-#include <iostream>
-#include <QDebug>
-#include <QStringList>
-#include <string>
-
-using namespace std;
-struct contourDisplay_struct;
-struct vectorDisplay_struct;
-struct solidsurfaceDisplay_struct;
-class vtkJsonObject
-{
-public:
-    vtkJsonObject();
-    ~vtkJsonObject();
-    void FromJSON(std::string msg);
-    vtkJsonObject* operator=(vtkJsonObject* object);
-    std::string ToJson(std::string type,QMap<QString,string> file);
-    void FromParamJson(std::string);
-
-    QString getFileName();
-
-public:
-    QString usrId;
-    QString solverConfigid;
-    QString proId;
-    QString paramJson;
-    QString filePath;
-    QString fileType;
-    QString action;
-    struct contourDisplay_struct *cd_struct;//contour
-    struct contourDisplay_struct *ld_struct;//line
-    struct vectorDisplay_struct *vc_struct;//vector
-    struct solidsurfaceDisplay_struct *sf_struct;//solidsurface
-private:
-    QString fileName;
-};
-
-//云图/等值线msg结构体
-struct contourDisplay_struct
-//typedef struct contourDisplay_struct_
-{
-public:
-    int level;
-    //string scalarName;
-    char scalarName[6];
-    double range[2];
-//}contourDisplay_struct,lineDisplay_struct;
-};
-
-//矢量msg结构体
-struct vectorDisplay_struct
-{
-public:
-    double scaleFactor;
-    char dataU[5];
-    char dataV[5];
-    char dataW[5];
-};
-
-//实体表面msg结构体
-struct solidsurfaceDisplay_struct
-{
-public:
-    double r;
-    double g;
-    double b;
-    double transparency;
-    bool showhidestate;
-};
-
-#endif // VTKJSONOBJECT_H

+ 0 - 100
CAE_Solution/src/threadPool_and_statemachine/dealWith/vtkvisnativewidget.cpp

@@ -1,100 +0,0 @@
-#include "vtkvisnativewidget.h"
-#include <QVTKOpenGLNativeWidget.h>
-
-vtkVisNativeWidget::vtkVisNativeWidget()
-{
-
-
-}
-
-vtkVisNativeWidget::~vtkVisNativeWidget()
-{
-
-}
-
-void vtkVisNativeWidget::createGeometry(QString tmp)
-{
-    if(tmp=="sphere"){
-        printf("---------------deal with creatGemotry-------------------------\n"
-               "");
-//        vtkNew<vtkSphereSource> sphereSource;
-//        sphereSource->SetCenter(0.0, 0.0, 0.0);
-//        sphereSource->SetRadius(5.0);
-//        //mapper
-//        vtkNew<vtkPolyDataMapper> mapper;
-//        mapper->SetInputConnection(sphereSource->GetOutputPort());
-//        //actor
-//        vtkNew<vtkActor> actor;
-//        actor->SetMapper(mapper);
-//        //renderer ,renderWindow, renderWindowInteractor.
-//        vtkNew<vtkRenderer> renderer;
-//        vtkNew<vtkGenericOpenGLRenderWindow> renderWindow;
-//        renderer->AddActor(actor);
-//        renderWindow->AddRenderer(renderer);
-//        renderWindow->FullScreenOn();
-//        renderWindow->BordersOn();
-//        QVTKOpenGLNativeWidget* widget = new QVTKOpenGLNativeWidget();
-//        widget->SetRenderWindow(renderWindow);
-//        widget->show();
-        //w.addTab(widget,"sphere");
-        emit sendImgFile("img2.png");
-        //this->getCaptureFigure(widget);
-    }else if(tmp == "cylinder"){
-        vtkNew<vtkCylinderSource> cylinder;
-        vtkNew<vtkPolyDataMapper> mapper;
-        cylinder->SetResolution(8);
-        mapper->SetInputConnection(cylinder->GetOutputPort());
-        vtkNew<vtkActor> actor;
-        actor->SetMapper(mapper);
-
-        vtkNew<vtkGenericOpenGLRenderWindow> renWin;
-        QVTKOpenGLNativeWidget* widget = new QVTKOpenGLNativeWidget();
-        widget->SetRenderWindow(renWin);
-        vtkNew<vtkRenderer> renderer;
-        renWin->AddRenderer(renderer);
-        renderer->AddActor(actor);
-        renWin->FullScreenOn();
-        renWin->BordersOn();
-        widget->show();
-        //w.addTab(widget,"cylinder");
-        this->getCaptureFigure(widget);
-    }else if(tmp == "cone"){
-        vtkConeSource *cone = vtkConeSource::New();
-        cone->SetHeight(3.0);
-        cone->SetRadius(1.0);
-        cone->SetResolution(10);
-
-        vtkPolyDataMapper *coneMapper = vtkPolyDataMapper::New();
-        coneMapper->SetInputConnection(cone->GetOutputPort());
-
-        vtkActor *coneActor = vtkActor::New();
-        coneActor->SetMapper(coneMapper);
-
-        vtkRenderer *ren1 = vtkRenderer::New();
-        ren1->AddActor(coneActor);
-        ren1->SetBackground(0.1, 0.2, 0.4);
-        vtkSmartPointer<vtkGenericOpenGLRenderWindow> renderWindow =
-                vtkSmartPointer<vtkGenericOpenGLRenderWindow>::New();
-        renderWindow->AddRenderer(ren1);
-
-        renderWindow->FullScreenOn();
-        renderWindow->BordersOn();
-
-        QVTKOpenGLNativeWidget* widget = new QVTKOpenGLNativeWidget();
-        widget->SetRenderWindow(renderWindow);
-        widget->show();
-        //w.addTab(widget,"cone");
-        this->getCaptureFigure(widget);
-    }else{
-        std::cout<<tmp.toStdString()<<std::endl;
-    }
-}
-
-void vtkVisNativeWidget::getCaptureFigure(QWidget* w)
-{
-    //QPixmap::setDevicePixelRatio(1);
-    QPixmap pix = QPixmap::grabWidget(w);
-    pix.save("img2.png","png");
-    emit sendImgFile("img2.png");
-    cout<<"---------img2.png---------"<<endl;
-}

+ 0 - 40
CAE_Solution/src/threadPool_and_statemachine/dealWith/vtkvisnativewidget.h

@@ -1,40 +0,0 @@
-#ifndef VTKVISNATIVEWIDGET_H
-#define VTKVISNATIVEWIDGET_H
-
-#include <QObject>
-#include <vtkNew.h>
-#include <QVTKOpenGLNativeWidget.h>
-#include <QPixmap>
-#include <QScreen>
-#include <QGuiApplication>
-#include <vtkSmartPointer.h>
-#include <vtkSphereSource.h>
-#include <vtkPolyDataMapper.h>
-#include <vtkCylinderSource.h>
-#include <vtkActor.h>
-#include <vtkRenderer.h>
-#include <vtkGenericOpenGLRenderWindow.h>
-#include <QVTKOpenGLNativeWidget.h>
-#include <QTabWidget>
-#include <vtkConeSource.h>
-#include <vtkTecplotReader.h>
-#include <vtkAppendFilter.h>
-#include <vtkUnstructuredGrid.h>
-#include <vtkNew.h>
-#include <vtkMultiBlockDataSet.h>
-
-class vtkVisNativeWidget : public QObject
-{
-    Q_OBJECT
-public:
-    vtkVisNativeWidget();
-    ~vtkVisNativeWidget();
-    void createGeometry(QString tmp);
-    void getCaptureFigure(QWidget* w);
-
-    QPixmap *fullScreen;
-signals:
-    void sendImgFile(QString);
-};
-
-#endif // VTKVISNATIVEWIDGET_H

+ 0 - 43
CAE_Solution/src/widget.h

@@ -8,8 +8,6 @@
 #include <QThread>
 #include <iostream>
 using namespace std;
-#include "VTK/Manager/meshmanager.h"
-#include "VTK/QVTKRenderer/qvtkrenderer.h"
 
 class Widget :public QTabWidget
 {
@@ -17,47 +15,6 @@ class Widget :public QTabWidget
 public:
     Widget(QTabWidget *parent = 0);
     ~Widget();
-
-//    void mousePressEvent(QMouseEvent* event){
-//        if(event->button() == Qt::LeftButton){
-//            qDebug()<<"mousePress!";
-//            render->HideAllActors();
-//            mesh->Clear();
-//            delete mesh;
-//            mesh = NULL;
-//            qDebug()<<"____________load data again_____________";
-
-//            mesh = new MeshManager();
-//            bool f = mesh->LoadData("F:\\czm\\vtkfile\\tfg.ugrid");
-
-//            qDebug()<<"f:"<<f;
-//            if(f){
-//               if(render){
-//                    mesh->DisplayMesh(render);
-//                    render->ZoomToExtents();
-//                }
-//            }
-//        }
-
-//    }
-
-//    void mouseDoubleClickEvent(QMouseEvent* event){
-//        if(event->button() == Qt::LeftButton){
-//            qDebug()<<"mouseDoubleClick";
-
-//        }
-//    }
-
-//    void SetMeshManager(MeshManager* mesh_){
-//        mesh = mesh_;
-//    }
-
-//    void SetQVTKRenderer(QVTKRenderer* render_){
-//        render = render_;
-//    }
-//private:
-//    MeshManager* mesh;
-//    QVTKRenderer* render;
 };
 
 #endif // WIDGET_H

+ 0 - 3
CAE_Solution/tests/axes_test/axes_test.pro

@@ -263,9 +263,6 @@ else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../Libs/vtk8.2/win/l
 win32:INCLUDEPATH += $$PWD/../../Libs/vtk8.2/win/include/vtk-8.2
 win32:DEPENDPATH += $$PWD/../../Libs/vtk8.2/win/include/vtk-8.2
 
-HEADERS += \
-    tst_vtk.h
-
 
 unix:!macx: LIBS += -L$$PWD/../../Libs/vtk8.2/centos8/lib64/ -lvtkChartsCore-8.2 \
                                                              -lvtkCommonColor-8.2 \

+ 73 - 0
CAE_Solution/tests/loadvtkfile/.gitignore

@@ -0,0 +1,73 @@
+# This file is used to ignore files which are generated
+# ----------------------------------------------------------------------------
+
+*~
+*.autosave
+*.a
+*.core
+*.moc
+*.o
+*.obj
+*.orig
+*.rej
+*.so
+*.so.*
+*_pch.h.cpp
+*_resource.rc
+*.qm
+.#*
+*.*#
+core
+!core/
+tags
+.DS_Store
+.directory
+*.debug
+Makefile*
+*.prl
+*.app
+moc_*.cpp
+ui_*.h
+qrc_*.cpp
+Thumbs.db
+*.res
+*.rc
+/.qmake.cache
+/.qmake.stash
+
+# qtcreator generated files
+*.pro.user*
+
+# xemacs temporary files
+*.flc
+
+# Vim temporary files
+.*.swp
+
+# Visual Studio generated files
+*.ib_pdb_index
+*.idb
+*.ilk
+*.pdb
+*.sln
+*.suo
+*.vcproj
+*vcproj.*.*.user
+*.ncb
+*.sdf
+*.opensdf
+*.vcxproj
+*vcxproj.*
+
+# MinGW generated files
+*.Debug
+*.Release
+
+# Python byte code
+*.pyc
+
+# Binaries
+# --------
+*.dll
+*.exe
+

+ 397 - 0
CAE_Solution/tests/loadvtkfile/loadvtkfile.pro

@@ -0,0 +1,397 @@
+QT += testlib
+QT -= gui
+
+CONFIG += qt console warn_on depend_includepath testcase
+CONFIG -= app_bundle
+
+TEMPLATE = app
+
+SOURCES +=  tst_loadvtkfile_test.cpp
+
+win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkChartsCore-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkCommonColor-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkCommonComputationalGeometry-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkCommonCore-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkCommonDataModel-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkCommonExecutionModel-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkCommonMath-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkCommonMisc-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkCommonSystem-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkCommonTransforms-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkDICOMParser-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkDomainsChemistry-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkDomainsChemistryOpenGL2-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkdoubleconversion-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkexodusII-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkexpat-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkFiltersAMR-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkFiltersCore-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkFiltersExtraction-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkFiltersFlowPaths-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkFiltersGeneral-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkFiltersGeneric-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkFiltersGeometry-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkFiltersHybrid-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkFiltersHyperTree-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkFiltersImaging-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkFiltersModeling-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkFiltersParallel-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkFiltersParallelImaging-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkFiltersPoints-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkFiltersProgrammable-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkFiltersSelection-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkFiltersSMP-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkFiltersSources-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkFiltersStatistics-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkFiltersTexture-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkFiltersTopology-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkFiltersVerdict-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkfreetype-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkGeovisCore-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkgl2ps-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkglew-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkGUISupportQt-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkGUISupportQtSQL-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkhdf5-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkhdf5_hl-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkImagingColor-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkImagingCore-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkImagingFourier-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkImagingGeneral-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkImagingHybrid-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkImagingMath-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkImagingMorphological-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkImagingSources-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkImagingStatistics-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkImagingStencil-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkInfovisCore-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkInfovisLayout-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkInteractionImage-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkInteractionStyle-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkInteractionWidgets-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOAMR-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOAsynchronous-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOCityGML-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOCore-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOEnSight-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOExodus-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOExport-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOExportOpenGL2-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOExportPDF-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOGeometry-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOImage-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOImport-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOInfovis-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOLegacy-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOLSDyna-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOMINC-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOMovie-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIONetCDF-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOParallel-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOParallelXML-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOPLY-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOSegY-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOSQL-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOTecplotTable-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOVeraOut-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOVideo-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOXML-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOXMLParser-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkjpeg-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkjsoncpp-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtklibharu-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtklibxml2-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkLocalExample-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtklz4-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtklzma-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkmetaio-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkNetCDF-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkogg-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkParallelCore-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkpng-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkproj-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkpugixml-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkRenderingAnnotation-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkRenderingContext2D-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkRenderingContextOpenGL2-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkRenderingCore-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkRenderingFreeType-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkRenderingGL2PSOpenGL2-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkRenderingImage-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkRenderingLabel-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkRenderingLOD-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkRenderingOpenGL2-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkRenderingQt-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkRenderingVolume-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkRenderingVolumeOpenGL2-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtksqlite-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtksys-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtktheora-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtktiff-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkverdict-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkViewsContext2D-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkViewsCore-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkViewsInfovis-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkViewsQt-8.2 \
+                                              -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkzlib-8.2
+else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkChartsCore-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkCommonColor-8.2_d \
+                                                 -L$$PWD/../../../Libs/vtk8.2/win/lib/ -lvtkCommonComputationalGeometry-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkCommonCore-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkCommonDataModel-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkCommonExecutionModel-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkCommonMath-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkCommonMisc-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkCommonSystem-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkCommonTransforms-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkDICOMParser-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkDomainsChemistry-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkDomainsChemistryOpenGL2-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkdoubleconversion-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkexodusII-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkexpat-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkFiltersAMR-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkFiltersCore-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkFiltersExtraction-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkFiltersFlowPaths-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkFiltersGeneral-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkFiltersGeneric-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkFiltersGeometry-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkFiltersHybrid-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkFiltersHyperTree-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkFiltersImaging-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkFiltersModeling-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkFiltersParallel-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkFiltersParallelImaging-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkFiltersPoints-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkFiltersProgrammable-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkFiltersSelection-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkFiltersSMP-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkFiltersSources-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkFiltersStatistics-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkFiltersTexture-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkFiltersTopology-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkFiltersVerdict-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkfreetype-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkGeovisCore-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkgl2ps-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkglew-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkGUISupportQt-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkGUISupportQtSQL-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkhdf5-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkhdf5_hl-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkImagingColor-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkImagingCore-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkImagingFourier-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkImagingGeneral-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkImagingHybrid-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkImagingMath-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkImagingMorphological-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkImagingSources-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkImagingStatistics-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkImagingStencil-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkInfovisCore-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkInfovisLayout-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkInteractionImage-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkInteractionStyle-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkInteractionWidgets-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOAMR-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOAsynchronous-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOCityGML-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOCore-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOEnSight-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOExodus-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOExport-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOExportOpenGL2-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOExportPDF-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOGeometry-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOImage-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOImport-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOInfovis-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOLegacy-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOLSDyna-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOMINC-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOMovie-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIONetCDF-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOParallel-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOParallelXML-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOPLY-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOSegY-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOSQL-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOTecplotTable-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOVeraOut-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOVideo-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOXML-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkIOXMLParser-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkjpeg-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkjsoncpp-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtklibharu-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtklibxml2-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkLocalExample-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtklz4-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtklzma-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkmetaio-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkNetCDF-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkogg-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkParallelCore-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkpng-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkproj-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkpugixml-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkRenderingAnnotation-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkRenderingContext2D-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkRenderingContextOpenGL2-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkRenderingCore-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkRenderingFreeType-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkRenderingGL2PSOpenGL2-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkRenderingImage-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkRenderingLabel-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkRenderingLOD-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkRenderingOpenGL2-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkRenderingQt-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkRenderingVolume-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkRenderingVolumeOpenGL2-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtksqlite-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtksys-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtktheora-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtktiff-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkverdict-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkViewsContext2D-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkViewsCore-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkViewsInfovis-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkViewsQt-8.2_d \
+                                                 -L$$PWD/../../Libs/vtk8.2/win/lib/ -lvtkzlib-8.2_d
+win32:INCLUDEPATH += $$PWD/../../Libs/vtk8.2/win/include/vtk-8.2
+win32:DEPENDPATH += $$PWD/../../Libs/vtk8.2/win/include/vtk-8.2
+
+
+
+unix:!macx: LIBS += -L$$PWD/../../Libs/vtk8.2/centos8/lib64/ -lvtkChartsCore-8.2 \
+                                                             -lvtkCommonColor-8.2 \
+                                                             -lvtkCommonComputationalGeometry-8.2 \
+                                                             -lvtkCommonCore-8.2 \
+                                                             -lvtkCommonDataModel-8.2 \
+                                                             -lvtkCommonExecutionModel-8.2 \
+                                                             -lvtkCommonMath-8.2 \
+                                                             -lvtkCommonMisc-8.2 \
+                                                             -lvtkCommonSystem-8.2 \
+                                                             -lvtkCommonTransforms-8.2 \
+                                                             -lvtkDICOMParser-8.2 \
+                                                             -lvtkDomainsChemistry-8.2 \
+                                                             -lvtkDomainsChemistryOpenGL2-8.2 \
+                                                             -lvtkdoubleconversion-8.2 \
+                                                             -lvtkexodusII-8.2 \
+                                                             -lvtkexpat-8.2 \
+                                                             -lvtkFiltersAMR-8.2 \
+                                                             -lvtkFiltersCore-8.2 \
+                                                             -lvtkFiltersExtraction-8.2 \
+                                                             -lvtkFiltersFlowPaths-8.2 \
+                                                             -lvtkFiltersGeneral-8.2 \
+                                                             -lvtkFiltersGeneric-8.2 \
+                                                             -lvtkFiltersGeometry-8.2 \
+                                                             -lvtkFiltersHybrid-8.2 \
+                                                             -lvtkFiltersHyperTree-8.2 \
+                                                             -lvtkFiltersImaging-8.2 \
+                                                             -lvtkFiltersModeling-8.2 \
+                                                             -lvtkFiltersParallel-8.2 \
+                                                             -lvtkFiltersParallelImaging-8.2 \
+                                                             -lvtkFiltersPoints-8.2 \
+                                                             -lvtkFiltersProgrammable-8.2 \
+                                                             -lvtkFiltersSelection-8.2 \
+                                                             -lvtkFiltersSMP-8.2 \
+                                                             -lvtkFiltersSources-8.2 \
+                                                             -lvtkFiltersStatistics-8.2 \
+                                                             -lvtkFiltersTexture-8.2 \
+                                                             -lvtkFiltersTopology-8.2 \
+                                                             -lvtkFiltersVerdict-8.2 \
+                                                             -lvtkfreetype-8.2 \
+                                                             -lvtkGeovisCore-8.2 \
+                                                             -lvtkgl2ps-8.2 \
+                                                             -lvtkglew-8.2 \
+                                                             -lvtkGUISupportQt-8.2 \
+                                                             -lvtkGUISupportQtOpenGL-8.2 \
+                                                             -lvtkGUISupportQtSQL-8.2 \
+                                                             -lvtkhdf5-8.2 \
+                                                             -lvtkhdf5_hl-8.2 \
+                                                             -lvtkImagingColor-8.2 \
+                                                             -lvtkImagingCore-8.2 \
+                                                             -lvtkImagingFourier-8.2 \
+                                                             -lvtkImagingGeneral-8.2 \
+                                                             -lvtkImagingHybrid-8.2 \
+                                                             -lvtkImagingMath-8.2 \
+                                                             -lvtkImagingMorphological-8.2 \
+                                                             -lvtkImagingSources-8.2 \
+                                                             -lvtkImagingStatistics-8.2 \
+                                                             -lvtkImagingStencil-8.2 \
+                                                             -lvtkInfovisCore-8.2 \
+                                                             -lvtkInfovisLayout-8.2 \
+                                                             -lvtkInteractionImage-8.2 \
+                                                             -lvtkInteractionStyle-8.2 \
+                                                             -lvtkInteractionWidgets-8.2 \
+                                                             -lvtkIOAMR-8.2 \
+                                                             -lvtkIOAsynchronous-8.2 \
+                                                             -lvtkIOCityGML-8.2 \
+                                                             -lvtkIOCore-8.2 \
+                                                             -lvtkIOEnSight-8.2 \
+                                                             -lvtkIOExodus-8.2 \
+                                                             -lvtkIOExport-8.2 \
+                                                             -lvtkIOExportOpenGL2-8.2 \
+                                                             -lvtkIOExportPDF-8.2 \
+                                                             -lvtkIOGeometry-8.2 \
+                                                             -lvtkIOImage-8.2 \
+                                                             -lvtkIOImport-8.2 \
+                                                             -lvtkIOInfovis-8.2 \
+                                                             -lvtkIOLegacy-8.2 \
+                                                             -lvtkIOLSDyna-8.2 \
+                                                             -lvtkIOMINC-8.2 \
+                                                             -lvtkIOMovie-8.2 \
+                                                             -lvtkIONetCDF-8.2 \
+                                                             -lvtkIOParallel-8.2 \
+                                                             -lvtkIOParallelXML-8.2 \
+                                                             -lvtkIOPLY-8.2 \
+                                                             -lvtkIOSegY-8.2 \
+                                                             -lvtkIOSQL-8.2 \
+                                                             -lvtkIOTecplotTable-8.2 \
+                                                             -lvtkIOVeraOut-8.2 \
+                                                             -lvtkIOVideo-8.2 \
+                                                             -lvtkIOXML-8.2 \
+                                                             -lvtkIOXMLParser-8.2 \
+                                                             -lvtkjpeg-8.2 \
+                                                             -lvtkjsoncpp-8.2 \
+                                                             -lvtklibharu-8.2 \
+                                                             -lvtklibxml2-8.2 \
+                                                             -lvtklz4-8.2 \
+                                                             -lvtklzma-8.2 \
+                                                             -lvtkmetaio-8.2 \
+                                                             -lvtkNetCDF-8.2 \
+                                                             -lvtkogg-8.2 \
+                                                             -lvtkParallelCore-8.2 \
+                                                             -lvtkpng-8.2 \
+                                                             -lvtkproj-8.2 \
+                                                             -lvtkpugixml-8.2 \
+                                                             -lvtkRenderingAnnotation-8.2 \
+                                                             -lvtkRenderingContext2D-8.2 \
+                                                             -lvtkRenderingContextOpenGL2-8.2 \
+                                                             -lvtkRenderingCore-8.2 \
+                                                             -lvtkRenderingFreeType-8.2 \
+                                                             -lvtkRenderingGL2PSOpenGL2-8.2 \
+                                                             -lvtkRenderingImage-8.2 \
+                                                             -lvtkRenderingLabel-8.2 \
+                                                             -lvtkRenderingLOD-8.2 \
+                                                             -lvtkRenderingOpenGL2-8.2 \
+                                                             -lvtkRenderingQt-8.2 \
+                                                             -lvtkRenderingVolume-8.2 \
+                                                             -lvtkRenderingVolumeOpenGL2-8.2 \
+                                                             -lvtksqlite-8.2 \
+                                                             -lvtksys-8.2 \
+                                                             -lvtktheora-8.2 \
+                                                             -lvtktiff-8.2 \
+                                                             -lvtkverdict-8.2 \
+                                                             -lvtkViewsContext2D-8.2 \
+                                                             -lvtkViewsCore-8.2 \
+                                                             -lvtkViewsInfovis-8.2 \
+                                                             -lvtkViewsQt-8.2 \
+                                                             -lvtkzlib-8.2
+
+
+unix:INCLUDEPATH += $$PWD/../../Libs/vtk8.2/centos8/include/vtk-8.2
+unix:DEPENDPATH += $$PWD/../../Libs/vtk8.2/centos8/include/vtk-8.2

+ 110 - 0
CAE_Solution/tests/loadvtkfile/tst_loadvtkfile_test.cpp

@@ -0,0 +1,110 @@
+#include <QtTest>
+#include <qdebug.h>
+#include <vtkAutoInit.h>
+VTK_MODULE_INIT(vtkRenderingOpenGL2)
+VTK_MODULE_INIT(vtkRenderingFreeType)
+VTK_MODULE_INIT(vtkInteractionStyle)
+#include <string>
+#include <vector>
+#include <vtkSmartPointer.h>
+#include <vtkDataArray.h>
+#include <vtkUnstructuredGrid.h>
+#include <vtkUnstructuredGridReader.h>
+#include <vtkDataSetMapper.h>
+#include <vtkActor.h>
+#include <vtkRenderWindow.h>
+#include <vtkRenderWindowInteractor.h>
+#include <vtkProperty.h>
+#include <vtkRenderer.h>
+#include <iostream>
+#include <vtkDoubleArray.h>
+#include <vtkPolyDataMapper.h>
+#include <vtkPointData.h>
+using namespace std;
+// add necessary includes here
+
+class loadVTKFile_test : public QObject
+{
+    Q_OBJECT
+
+public:
+    loadVTKFile_test();
+    ~loadVTKFile_test();
+
+private slots:
+    void test_case1();
+
+};
+
+loadVTKFile_test::loadVTKFile_test()
+{
+
+}
+
+loadVTKFile_test::~loadVTKFile_test()
+{
+
+}
+/****************************************
+ * 测试:测试加载标准vtk格式文件
+ *     并显示单个标量
+ * 结果:成功
+ ***************************************/
+void loadVTKFile_test::test_case1()
+{
+    vtkSmartPointer<vtkUnstructuredGridReader> unReader = vtkSmartPointer<vtkUnstructuredGridReader>::New();
+    vtkSmartPointer<vtkDataSetMapper> mapper = vtkSmartPointer<vtkDataSetMapper>::New();
+    vtkSmartPointer<vtkActor> actor = vtkSmartPointer<vtkActor>::New();
+    vtkSmartPointer<vtkRenderer> renderer = vtkSmartPointer<vtkRenderer>::New();
+    vtkSmartPointer<vtkRenderWindow> renderWindow = vtkSmartPointer<vtkRenderWindow>::New();
+    string filename = QDir::currentPath().toStdString()+"/../../conf/dynamicResponse-transient36.vtk";
+    qDebug()<<QString::fromStdString(filename);
+    unReader->SetFileName(filename.c_str());
+    unReader->ReadAllVectorsOn();
+    unReader->ReadAllScalarsOn();
+    unReader->ReadAllFieldsOn();
+    unReader->Update();
+    vtkUnstructuredGrid *ugrid = vtkUnstructuredGrid::New();
+    ugrid = unReader->GetOutput();
+    int num1 = unReader->GetNumberOfScalarsInFile();
+    int num2 = unReader->GetNumberOfVectorsInFile();
+    vector<string> scalarname_;
+    for(int i =0 ;i< num1;i++){
+        string scalarname = unReader->GetScalarsNameInFile(i);
+        scalarname_.push_back(scalarname);
+    }
+    vector<string> vectorname_;
+    for(int i =0;i<num2;i++){
+        string vectorname = unReader->GetVectorsNameInFile(i);
+        vectorname_.push_back(vectorname);
+    }
+    cout<<"------------scalarname---------"<<endl;
+    for(auto a: scalarname_){
+        cout<<"name: "<<a<<endl;
+    }
+    cout<<"------------vectorname----------"<<endl;
+    for(auto b:vectorname_){
+        cout<<"name: "<<b<<endl;
+    }
+    mapper->SetInputData(ugrid);
+    actor->SetMapper(mapper);
+    //actor->GetProperty()->SetRepresentationToWireframe();;
+    renderer->AddActor(actor);
+    renderWindow->AddRenderer(renderer);
+    unReader->SetScalarsName(scalarname_[2].c_str());
+    unReader->Update();
+    vtkDoubleArray* array = vtkDoubleArray::New();
+    array->DeepCopy(((unReader->GetOutput())->GetPointData())->GetScalars());
+    array->Modified();
+    double range[2];
+    array->GetRange(range);
+    mapper->SetScalarRange(range[0],range[1]);
+    renderWindow->Render();
+    auto interactor = vtkSmartPointer<vtkRenderWindowInteractor>::New();
+    interactor->SetRenderWindow(renderWindow);
+    interactor->Start();
+}
+
+QTEST_APPLESS_MAIN(loadVTKFile_test)
+
+#include "tst_loadvtkfile_test.moc"

+ 2 - 1
CAE_Solution/tests/tests.pro

@@ -9,6 +9,7 @@ SUBDIRS += \
     captureFigure_test \
     jsonToQt_Test \
     axes_test \
-    vtkcamera_test
+    vtkcamera_test \
+    loadvtkfile
 
 

+ 0 - 3
CAE_Solution/tests/vtkcamera_test/vtkcamera_test.pro

@@ -263,9 +263,6 @@ else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../Libs/vtk8.2/win/l
 win32:INCLUDEPATH += $$PWD/../../Libs/vtk8.2/win/include/vtk-8.2
 win32:DEPENDPATH += $$PWD/../../Libs/vtk8.2/win/include/vtk-8.2
 
-HEADERS += \
-    tst_vtk.h
-
 
 unix:!macx: LIBS += -L$$PWD/../../Libs/vtk8.2/centos8/lib64/ -lvtkChartsCore-8.2 \
                                                              -lvtkCommonColor-8.2 \