Procházet zdrojové kódy

0607 反复loaddata

caizm před 2 roky
rodič
revize
7e4d52f6c9
33 změnil soubory, kde provedl 394 přidání a 59 odebrání
  1. 12 11
      CAE_Solution/src/VTK/Manager/ResultMeshManager.cpp
  2. 1 1
      CAE_Solution/src/VTK/Manager/ResultMeshManager.h
  3. 5 10
      CAE_Solution/src/VTK/Manager/meshmanager.cpp
  4. 5 0
      CAE_Solution/src/VTK/Manager/resultmanager.cpp
  5. 3 2
      CAE_Solution/src/VTK/Manager/resultmanager.h
  6. 33 3
      CAE_Solution/src/VTK/Manager/resultvtkmanager.cpp
  7. 2 2
      CAE_Solution/src/VTK/Manager/resultvtkmanager.h
  8. 2 1
      CAE_Solution/src/VTK/QVTKRenderer/qvtkrenderer.h
  9. 1 1
      CAE_Solution/src/VTK/mesh/Mesh_CSDInp.h
  10. 1 1
      CAE_Solution/src/VTK/mesh/Mesh_Frd.h
  11. 1 1
      CAE_Solution/src/VTK/mesh/mesh.cpp
  12. 1 1
      CAE_Solution/src/VTK/mesh/mesh_adi.h
  13. 1 1
      CAE_Solution/src/VTK/mesh/mesh_tecplot.h
  14. 1 1
      CAE_Solution/src/VTK/mesh/mesh_ugrid.h
  15. 1 1
      CAE_Solution/src/VTK/visualization_VTK/vtkVISAddUnGridDataSource.h
  16. 2 2
      CAE_Solution/src/VTK/visualization_VTK/vtkVISMeshToVTKSource.h
  17. 1 1
      CAE_Solution/src/VTK/visualization_VTK/vtkVISUnContour.h
  18. 1 1
      CAE_Solution/src/VTK/visualization_VTK/vtkVISUnGlyph.h
  19. 1 1
      CAE_Solution/src/VTK/visualization_VTK/vtkVISUnSlice.h
  20. 1 1
      CAE_Solution/src/VTK/visualization_VTK/vtkVISUnStreamTrace.h
  21. 1 1
      CAE_Solution/src/VTK/visualization_VTK/vtkviscameramanager.h
  22. 1 1
      CAE_Solution/src/VTK/visualization_VTK/vtkvismanager.cpp
  23. 1 1
      CAE_Solution/src/VTK/visualization_VTK/vtkvismeshbasetovtksource.h
  24. 5 4
      CAE_Solution/src/VTK/visualization_VTK/vtkvisunstructuredgridmanager.cpp
  25. 1 1
      CAE_Solution/src/VTK/visualization_VTK/vtkvisunstructuredgridmanager.h
  26. 1 1
      CAE_Solution/src/VTK/visualization_VTK/vtkvisunstructuredgridsource.h
  27. 206 0
      CAE_Solution/src/VTK/widget/contourinimationw.cpp
  28. 49 0
      CAE_Solution/src/VTK/widget/contourinimationw.h
  29. 4 2
      CAE_Solution/src/VTK/widget/widget.pri
  30. 1 0
      CAE_Solution/src/src.pro
  31. 44 2
      CAE_Solution/src/threadPool_and_statemachine/dealWith/handlepool.cpp
  32. 3 2
      CAE_Solution/src/threadPool_and_statemachine/dealWith/handlepool.h
  33. 1 1
      CAE_Solution/src/threadPool_and_statemachine/dealWith/map_manager.h

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

@@ -37,6 +37,7 @@
 #include "../widget/Sslicewidget.h"
 #include "../widget/streamDisplaywidget.h"
 #include "../widget/vectorDisplaywidget.h"
+#include "../widget/contourinimationw.h"
 
 //ResultMeshManager* ResultMeshManager::m_pInstance = 0;
 
@@ -375,7 +376,7 @@ bool ResultMeshManager::LoadData(QString name)
   */
 void ResultMeshManager::DisplayMesh(QVTKRenderer *qvtkRenderer)
 {
-    if (MeshVec_.size() == 0)
+    if (MeshVec_.size() == 0)//frd
     {
         render_ = qvtkRenderer;
         if (meshObj_ == 0)  return;
@@ -1104,16 +1105,16 @@ void ResultMeshManager::SetVectorWidget(VectorW* w)
     }
 }
 
-//void ResultMeshManager::SetAnimationWidget(ContourInimationW *w)
-//{
-//    animationWidget_ = w;
-//    if (meshObj_ != NULL)
-//    {
-//        w->SetTypeEnable(HaveModalMeshFlag);
-//        animationWidget_->SetSolveTime(GetSolveTime());
-//        animationWidget_->SetZoneNameVector(zoneNameVec_);
-//    }
-//}
+void ResultMeshManager::SetAnimationWidget(ContourInimationW *w)
+{
+    animationWidget_ = w;
+    if (meshObj_ != NULL)
+    {
+        //w->SetTypeEnable(HaveModalMeshFlag);
+        animationWidget_->SetSolveTime(GetSolveTime());
+        animationWidget_->SetZoneNameVector(zoneNameVec_);
+    }
+}
 
 void ResultMeshManager::SetSurfaceSolidWidget(SolidSurfaceWidget* w)
 {

+ 1 - 1
CAE_Solution/src/VTK/Manager/ResultMeshManager.h

@@ -40,7 +40,7 @@ public:
     void SetCotourWidget(ContourDisplayW* w);
     void SetLineWidget(LineDisplayW* w);
     void SetVectorWidget(VectorW* w);
-    //void SetAnimationWidget(ContourInimationW* w);
+    void SetAnimationWidget(ContourInimationW* w);
     void SetSurfaceSolidWidget(SolidSurfaceWidget* w);
     void SetSliceWidget(SsliceWidget* w);
     void SetStremWidget(StreamDisplayWidget* w);

+ 5 - 10
CAE_Solution/src/VTK/Manager/meshmanager.cpp

@@ -8,7 +8,7 @@
 #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"
 
@@ -99,6 +99,7 @@ void MeshManager::Clear()
     for(map<size_t, vtkVISUnShadeMesh*>::iterator it = vtkVisZoneMeshMap_.begin(); it != vtkVisZoneMeshMap_.end(); ++it)
     {
        it->second->Delete();
+       it->second = NULL;
     }
     vtkVisZoneMeshMap_.clear();
 
@@ -113,7 +114,7 @@ void MeshManager::Clear()
     vtkVisZonePatchesMap_.clear();
 
     if(vtksource!=NULL){
-        delete vtksource;
+        vtksource->Delete();
         vtksource = NULL;
     }
     if(vtkunshade_!=NULL){
@@ -267,11 +268,11 @@ void MeshManager::DisplayMesh(QVTKRenderer *qvtkRenderer)
                 {
                     if (source->GetVtkUnMesh() != 0)
                     {
-                        vtkVISUnstructuredGridSource* unGrid = source->GetVtkUnMesh();
+                        vtkVISUnstructuredGridSource* unGrid = source->GetVtkUnMesh();//ugrid
                         vtkVISUnShadeMesh *visobj = vtkVISUnShadeMesh::New();
                         visobj->SetRenderTo(qvtkRenderer->GetRenderer());
                         visobj->SetDataSource(unGrid);
-                        visobj->CreateShadeMeshDisplay(1);//0---线框图  1---实体
+                        visobj->CreateShadeMeshDisplay(0);//0---线框图  1---实体
                         visPatchMap[*it] = visobj;
                     }
                 }
@@ -280,9 +281,3 @@ void MeshManager::DisplayMesh(QVTKRenderer *qvtkRenderer)
         }
     }
 }
-
-
-
-
-
-

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

@@ -136,6 +136,11 @@ void ResultManager::SetVectorWidget(VectorW *w)
     vectorWidget_ = w;
 }
 
+void ResultManager::SetAnimationWidget(ContourInimationW *w)
+{
+    animationWidget_ = w;
+}
+
 void ResultManager::SetSurfaceSolidWidget(SolidSurfaceWidget *w)
 {
     solidSurfaceW_ = w;

+ 3 - 2
CAE_Solution/src/VTK/Manager/resultmanager.h

@@ -27,6 +27,7 @@ class StreamDisplayWidget;
 class VectorW;
 class SsliceWidget;
 class StreamDisplayWidget;
+class ContourInimationW;
 
 class ResultManager
 {
@@ -62,7 +63,7 @@ public:
     virtual void SetCotourWidget(ContourDisplayW* w);
     virtual void SetLineWidget(LineDisplayW* w);
     virtual void SetVectorWidget(VectorW* w);
-    //virtual void SetAnimationWidget(ContourInimationW* w);
+    virtual void SetAnimationWidget(ContourInimationW* w);
     virtual void SetSurfaceSolidWidget(SolidSurfaceWidget* w);
     virtual void SetSliceWidget(SsliceWidget* w);
     virtual void SetStremWidget(StreamDisplayWidget* w);
@@ -160,7 +161,7 @@ public:
     ContourDisplayW* contourWidget_;
     LineDisplayW* lineWidget_;
     VectorW* vectorWidget_;
-    //ContourInimationW* animationWidget_;
+    ContourInimationW* animationWidget_;
     SolidSurfaceWidget* solidSurfaceW_;
     SsliceWidget* sliceW_;
     StreamDisplayWidget* streamW_;

+ 33 - 3
CAE_Solution/src/VTK/Manager/resultvtkmanager.cpp

@@ -20,6 +20,7 @@
 #include "../widget/streamDisplaywidget.h"
 #include "../widget/vectorDisplaywidget.h"
 #include "../visualization_VTK/vtkVISUnGlyph.h"
+#include "../widget/contourinimationw.h"
 
 /*
  * @brief: the constructor
@@ -165,6 +166,9 @@ void ResultVTKManager::DisplayMeshByIndex(int index)
     }else{
         unmesh->ShowOff();
     }
+    if(uncontour!=NULL){
+        uncontour->ShowOffScalarBar();
+    }
     if(displayType == 0 || displayType == 2){//contour
         HideAllGlyphActors();
         InitRange(index);
@@ -506,7 +510,7 @@ int ResultVTKManager::GetScalarIndex()
 
 void ResultVTKManager::SetContourLevel(int level)
 {
-
+    scalarLeave = level;
 }
 
 int ResultVTKManager::GetContourLevel()
@@ -547,6 +551,18 @@ void ResultVTKManager::SetVectorWidget(VectorW *w)
     vectorWidget_->SetScaleFactor(scaleFactor_);
 }
 
+
+void ResultVTKManager::SetAnimationWidget(ContourInimationW *w)
+{
+    animationWidget_ = w;
+    if (meshObj_ != NULL)
+    {
+        //w->SetTypeEnable(HaveModalMeshFlag);
+        animationWidget_->SetSolveTime(GetSolveTime());
+        animationWidget_->SetZoneNameVector(zoneNameVec_);
+    }
+}
+
 void ResultVTKManager::SetSurfaceSolidWidget(SolidSurfaceWidget *w)
 {
     solidSurfaceW_ = w;
@@ -690,7 +706,7 @@ void ResultVTKManager::SetSurfaceShowHideFlag(bool flag)
 
 void ResultVTKManager::SetScalarName(string name)
 {
-
+    scalarName_ = name;
 }
 
 void ResultVTKManager::MakeVISUnStructGrid()
@@ -1006,7 +1022,21 @@ void ResultVTKManager::HideAllGlyphActors()
 
 void ResultVTKManager::HideSliceActors()
 {
-
+    if (!unSliceVec_.empty())
+    {
+        for (int i = 0; i < unSliceVec_.size(); i ++)
+        {
+            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();
+            }
+        }
+    }
 }
 
 void ResultVTKManager::HideStreamActors()

+ 2 - 2
CAE_Solution/src/VTK/Manager/resultvtkmanager.h

@@ -3,7 +3,7 @@
 #include "resultmanager.h"
 #include "../visualization_VTK/vtkvisunstructuredgridsource.h"
 #include "../visualization_VTK/vtkvisunstructuredgridmanager.h"
-#include "../visualization_VTK/vtkVISManager.h"
+#include "../visualization_VTK/vtkvismanager.h"
 #include "../QVTKRenderer/qvtkrenderer.h"
 #include <QFileInfo>
 
@@ -38,7 +38,7 @@ public:
     void SetCotourWidget(ContourDisplayW* w);
     void SetLineWidget(LineDisplayW* w);
     void SetVectorWidget(VectorW* w);
-    //void SetAnimationWidget(ContourInimationW* w);
+    void SetAnimationWidget(ContourInimationW* w);
     void SetSurfaceSolidWidget(SolidSurfaceWidget* w);
     void SetSliceWidget(SsliceWidget* w);
     void SetStremWidget(StreamDisplayWidget* w);

+ 2 - 1
CAE_Solution/src/VTK/QVTKRenderer/qvtkrenderer.h

@@ -104,7 +104,8 @@ public:
     {
         NoModel = 0,
         UgridModel,
-        ResultModel
+        ResultModel,
+        VTKModel
     };
     WidgetModel widgetFlag;
 };

+ 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"
 
 
 

+ 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>

+ 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>

+ 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"
 
 

+ 1 - 1
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"

+ 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;
 

+ 1 - 1
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)
 

+ 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>

+ 5 - 4
CAE_Solution/src/VTK/visualization_VTK/vtkvisunstructuredgridmanager.cpp

@@ -59,11 +59,12 @@ vtkVISUnstructuredGridManager::~vtkVISUnstructuredGridManager()
 //        }
 
 //        ErrorInfo(0, "destructure func 2");
+
+//    if(this->_source!=NULL){
+//        this->_source->Delete();
+//        this->_source = NULL;
+//    }
     DeleteObjects();
-    if(this->_source){
-        this->_source->Delete();
-        this->_source = NULL;
-    }
 }
 
 void vtkVISUnstructuredGridManager::SetDataSource(vtkVISUnstructuredGridSource *object)

+ 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;
 

+ 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;

+ 206 - 0
CAE_Solution/src/VTK/widget/contourinimationw.cpp

@@ -0,0 +1,206 @@
+#include "contourinimationw.h"
+
+/*
+ * @brief: the constructor
+ * @param:
+ * @ret:
+ * @birth: created by czm in 20230605
+ */
+ContourInimationW::ContourInimationW()
+{
+    max = 0;
+    flag = true;
+    m_time.clear();
+    ZoneNameVec.clear();
+    m_speed = 25.0;
+}
+
+/*
+ * @brief: the destructor
+ * @param:
+ * @ret:
+ * @birth: created by czm in 20230605
+ */
+ContourInimationW::~ContourInimationW(){
+    m_time.clear();
+}
+
+/*
+ * @brief: set solve time
+ * @param: time
+ * @ret: void
+ * @birth: created by czm in 20230605
+ */
+void ContourInimationW::SetSolveTime(set<double> time)
+{
+    //slider->setSingleStep(1);
+   // slider->setMinimum(0);
+    max = time.size();
+    //slider->setMaximum(max - 1);
+    m_time.clear();
+    for (set<double>::iterator it = time.begin(); it != time.end(); it ++)
+    {
+        m_time.append(*it);
+    }
+    le_firstStep = 1;
+    le_endStep = max;
+    SetLeText();
+}
+
+void ContourInimationW::SetScaleFactor(double factor)
+{
+    ldt_scale = factor;
+}
+
+double ContourInimationW::GetScaleFactor()
+{
+    return ldt_scale;
+}
+
+/*
+ * @brief: slot start
+ * @param: void
+ * @ret: void
+ * @birth: created by czm in 20230605
+ */
+void ContourInimationW::SlotStart()
+{
+    slider = 0;
+}
+
+/*
+ * @brief: slot end
+ * @param: void
+ * @ret: void
+ * @birth: created by czm in 20230605
+ */
+void ContourInimationW::SlotEnd()
+{
+    slider = max-1;
+}
+
+/*
+ * @brief: slot last
+ * @param: void
+ * @ret: void
+ * @birth: created by czm in 20230605
+ */
+void ContourInimationW::SlotLast()
+{
+    slider = slider - 1;
+}
+
+/*
+ * @brief: slot next
+ * @param: void
+ * @ret: void
+ * @birth: created by czm in 20230605
+ */
+void ContourInimationW::SlotNext()
+{
+    slider = slider + 1;
+}
+
+/*
+ * @brief: slot quick
+ * @param: void
+ * @ret: void
+ * @birth: created by czm in 20230605
+ */
+void ContourInimationW::SlotQuick()
+{
+    m_speed /= 2;
+    le_time = 1000.0/m_speed;
+}
+
+/*
+ * @brief: slot low
+ * @param: void
+ * @ret: void
+ * @birth: created by czm in 20230605
+ */
+void ContourInimationW::SlotLow()
+{
+    m_speed *= 2;
+    le_time = 1000.0/m_speed;
+}
+
+void ContourInimationW::SlotChange()
+{
+    if(!m_time.isEmpty()){
+        SetLeText();
+        if(slider ==0){
+            pb_start = true;
+            pb_last = true;
+            pb_end = false;
+            pb_next = false;
+        }else if(slider == (max-1)){
+            pb_start = false;
+            pb_last = false;
+            pb_end = true;
+            pb_next = true;
+            flag = false;
+
+        }
+    }
+}
+
+/*
+ * @brief: set letext
+ * @param: void
+ * @ret: void
+ * @birth: created by czm in 20230605
+ */
+void ContourInimationW::SetLeText()
+{
+    if(!m_time.isEmpty()){
+        le_currStep=slider+1;
+        lb_solveTime=m_time.at(slider);
+    }
+}
+
+/*
+ * @brief: get index
+ * @param: void
+ * @ret: index
+ * @birth: created by czm in 20230605
+ */
+int ContourInimationW::GetIndex()
+{
+    return le_currStep-1;
+}
+
+void ContourInimationW::InitScaleFactor(double factor)
+{
+    if(factor == 1.0){
+        ldt_scale = 1;
+    }else{
+        ldt_scale =factor;
+    }
+}
+
+/*
+ * @brief: set frame number
+ * @param: void
+ * @ret: void
+ * @birth: created by czm in 20230605
+ */
+void ContourInimationW::SetFrameNumber()
+{
+    m_speed = 1000/le_time;
+}
+
+/*
+ * @brief: set zone name vector
+ * @param: vector
+ * @ret: void
+ * @birth: created by czm in 20230605
+ */
+void ContourInimationW::SetZoneNameVector(vector<string> Zone)
+{
+    ZoneNameVec.clear();
+    for (vector<string>::iterator it = Zone.begin(); it != Zone.end(); it ++)
+    {
+        ZoneNameVec.push_back(*it);
+    }
+}

+ 49 - 0
CAE_Solution/src/VTK/widget/contourinimationw.h

@@ -0,0 +1,49 @@
+#ifndef CONTOURINIMATIONW_H
+#define CONTOURINIMATIONW_H
+#include <vector>
+#include <set>
+#include <QVector>
+using namespace std;
+
+class ContourInimationW
+{
+public:
+    ContourInimationW();
+    ~ContourInimationW();
+
+    void SetSolveTime(set<double> time);
+    void SetScaleFactor(double factor);
+    double GetScaleFactor();
+    void SetZoneNameVector(vector<string> Zone);
+    void SetLeText();
+    int GetIndex();
+    void InitScaleFactor(double factor = 1);
+    void SlotStart();
+    void SlotEnd();
+    void SlotLast();
+    void SlotNext();
+    void SlotQuick();
+    void SlotLow();
+    void SlotChange();
+    void SetFrameNumber();
+private:
+    QVector<double> m_time;
+    int max;
+    bool flag;
+    double m_speed;
+    vector<string> ZoneNameVec;
+    int le_firstStep;
+    int le_endStep;
+    int slider;
+    int le_time;
+    int le_currStep;
+    int lb_solveTime;
+    int ldt_scale;
+    bool pb_start;
+    bool pb_end;
+    bool pb_last;
+    bool pb_next;
+
+};
+
+#endif // CONTOURINIMATIONW_H

+ 4 - 2
CAE_Solution/src/VTK/widget/widget.pri

@@ -1,7 +1,9 @@
 HEADERS += \
-     $$PWD/*.h
+     $$PWD/*.h \
+    $$PWD/contourinimationw.h
 
 
 SOURCES += \
-     $$PWD/*.cpp
+     $$PWD/*.cpp \
+    $$PWD/contourinimationw.cpp
 

+ 1 - 0
CAE_Solution/src/src.pro

@@ -40,6 +40,7 @@ include( ./threadPool_and_statemachine/threadPool_and_statemachine.pri)
 #########################################################################
 #自动拷贝配置文件
 conf_.files += $$PWD/../conf/*.txt
+conf_.files += $$PWD/../conf/dynamicResponse-transient36.vtk
 conf_.path = $${OUT_PWD}/../conf/
 
 

+ 44 - 2
CAE_Solution/src/threadPool_and_statemachine/dealWith/handlepool.cpp

@@ -201,6 +201,11 @@ void handlePool::operateRender(boostJsonObject* object,QVTKRenderer* render_)
             cout<<"please import tecplot result first!"<<endl;
         }
         return;
+    }else if(object->action == ""){
+        if(!result_contourinimationdisplay(object,render_,"")){
+            cout<<"please import tecplot result forst!"<<endl;
+        }
+        return;
     }
     send_picture(object,render_);//发送图片
 }
@@ -232,10 +237,22 @@ void handlePool::judgeLoaddata(boostJsonObject *object, QVTKRenderer *render_)
         }else if(flag == QVTKRenderer::WidgetModel::ResultModel){
             render_->HideAllActors();
             render_->RemoveAllActors();
+        }else if(flag == QVTKRenderer::WidgetModel::VTKModel){//判断窗口当前模型
+            if(qmapManager.value(object->proId)->filePath == object->filePath){
+                send_picture(object,render_);
+                return;
+            }
+            render_->HideAllActors();
+            render_->RemoveAllActors();
         }
     }
     QString m_filePath = QString::fromStdString(object->filePath);//测试路径
     //QString m_filePath = "F:\\czm\\vtkfile\\tfg.ugrid";
+//    if(object->solverConfigid=="b867ebb4a49d4c7a8ce66d6b07b6f333"){
+//        m_filePath = "F:\\czm\\vtkfile\\f.vtk";
+//        //m_filePath = "F:\\czm\\vtkfile\\forward.ugrid";
+//    }
+
     //QString m_filePath = "C:\\Users\\Administrator\\Desktop\\VTK\\f.vtk";
     QFileInfo fileinfo_(m_filePath);
     if(!fileinfo_.isFile()){
@@ -309,6 +326,10 @@ bool handlePool::resultImport(boostJsonObject *object_, QVTKRenderer *renderer_)
             //qmapResultmanager.value(object_->proId)->resultMeshManager_->HideAllActors();
             //            renderer_->HideAllActors();
             //            renderer_->RemoveAllActors();
+        }else if(flag_==QVTKRenderer::WidgetModel::VTKModel){
+            renderer_ = qmapRender.value(object_->proId);
+            renderer_->HideAllActors();//to do 有bug 先导入结果,在loaddata,再导入,会报错
+            renderer_->RemoveAllActors();
         }
     }
     //object_->filePath = "C:\\Users\\Administrator\\Desktop\\Postprocess_Binary";//测试路径
@@ -360,7 +381,7 @@ bool handlePool::resultImport(boostJsonObject *object_, QVTKRenderer *renderer_)
             return false;
         }
     }else if(type_ == "vtkfile"){
-        object_->fileName = "dynamicResponse-transient36.vtk";
+        //object_->fileName = "dynamicResponse-transient36.vtk";//测试
         rsManager = new ResultVTKManager();
         rsManager->Clear();
         rsManager->fileType = "VTK";
@@ -552,6 +573,9 @@ bool handlePool::result_slicedisplay(boostJsonObject *object_, QVTKRenderer *ren
     }
     if(type == "addpage"){
         int tmp_index = object_->sd_struct->index;
+        if(resultmm->uncontour!=NULL&&resultmm->fileType=="VTK"){
+            resultmm->uncontour->ShowOffScalarBar();
+        }
         resultmm->sliceW_->setIndex(tmp_index);
         resultmm->InitSliceWidget();
         resultmm->MakeVISUnStructGrid();
@@ -602,6 +626,9 @@ bool handlePool::result_streamdisplay(boostJsonObject *object_, QVTKRenderer *re
             string u = resultmm->streamW_->GetUData();
             string v = resultmm->streamW_->GetVData();
             string w = resultmm->streamW_->GetWData();
+            if(resultmm->uncontour!=NULL&&resultmm->fileType=="VTK"){
+                resultmm->uncontour->ShowOffScalarBar();
+            }
             resultmm->CreatVectorSource(u,v,w);
             if((resultmm->fileType=="plt")&&(resultmm->currAddDataSource_))
             {
@@ -626,6 +653,17 @@ bool handlePool::result_streamdisplay(boostJsonObject *object_, QVTKRenderer *re
     return true;
 }
 
+/*
+ * @brief: analysis msg about contourinimationdisplay
+ * @param: object and render
+ * @ret: bool
+ * @birth: created by czm in 20230606
+ */
+bool handlePool::result_contourinimationdisplay(boostJsonObject *, QVTKRenderer *, QString)
+{
+    return true;
+}
+
 
 /*
  * @brief: build result file mash which need to be sent to java
@@ -781,7 +819,11 @@ QMap<QString, string> handlePool::buildResultImport_msg(QString type, ResultMana
         map_tmp.insert("min_position_z",to_string(sdwidget->GetPositionRange()[4]));
         map_tmp.insert("max_position_z",to_string(sdwidget->GetPositionRange()[5]));
         for(int i =0; i<sdwidget->GetVariableName_vector().size();i++){
-            msg+= removeSpaces(sdwidget->GetVariableName_vector()[i]);
+            if(cmanager->fileType!="VTK"){
+               msg+= removeSpaces(sdwidget->GetVariableName_vector()[i]);
+            }else{
+               msg+= sdwidget->GetVariableName_vector()[i];
+            }
             msg+=",";
         }
         msg = msg.erase(msg.size()-1);

+ 3 - 2
CAE_Solution/src/threadPool_and_statemachine/dealWith/handlepool.h

@@ -10,7 +10,7 @@
 #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"
@@ -30,7 +30,7 @@
 #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 "../../VTK/visualization_VTK/vtkvismanager.h"
 #include <map>
 #include <QMap>
 #include <string>
@@ -57,6 +57,7 @@ public:
     bool result_solidsurfacedisplay(boostJsonObject*, QVTKRenderer *);
     bool result_slicedisplay(boostJsonObject*, QVTKRenderer *,QString);
     bool result_streamdisplay(boostJsonObject*, QVTKRenderer *,QString);
+    bool result_contourinimationdisplay(boostJsonObject*,QVTKRenderer*,QString);
     QMap<QString,string> buildResultImport_msg(QString,ResultManager*);
     QMap<QString,string> buildResultImport_msg(QString,ResultManager*,boostJsonObject*);
     QMap<QString,string> buildError_msg(string);

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

@@ -28,7 +28,7 @@ public:
 
     }
     ~pid_meshManager(){
-        if(meshManager_){
+        if(meshManager_!=NULL){
             delete meshManager_;
             meshManager_ = NULL;
         }