瀏覽代碼

0411 编译centos

caizm 2 年之前
父節點
當前提交
8b0e1c1f97

+ 126 - 0
CAE_Solution/Libs/vtk8.2/win/lib/debug.txt

@@ -0,0 +1,126 @@
+vtkChartsCore-8.2_d.lib
+vtkCommonColor-8.2_d.lib
+vtkCommonComputationalGeometry-8.2_d.lib
+vtkCommonCore-8.2_d.lib
+vtkCommonDataModel-8.2_d.lib
+vtkCommonExecutionModel-8.2_d.lib
+vtkCommonMath-8.2_d.lib
+vtkCommonMisc-8.2_d.lib
+vtkCommonSystem-8.2_d.lib
+vtkCommonTransforms-8.2_d.lib
+vtkDICOMParser-8.2_d.lib
+vtkDomainsChemistry-8.2_d.lib
+vtkDomainsChemistryOpenGL2-8.2_d.lib
+vtkdoubleconversion-8.2_d.lib
+vtkexodusII-8.2_d.lib
+vtkexpat-8.2_d.lib
+vtkFiltersAMR-8.2_d.lib
+vtkFiltersCore-8.2_d.lib
+vtkFiltersExtraction-8.2_d.lib
+vtkFiltersFlowPaths-8.2_d.lib
+vtkFiltersGeneral-8.2_d.lib
+vtkFiltersGeneric-8.2_d.lib
+vtkFiltersGeometry-8.2_d.lib
+vtkFiltersHybrid-8.2_d.lib
+vtkFiltersHyperTree-8.2_d.lib
+vtkFiltersImaging-8.2_d.lib
+vtkFiltersModeling-8.2_d.lib
+vtkFiltersParallel-8.2_d.lib
+vtkFiltersParallelImaging-8.2_d.lib
+vtkFiltersPoints-8.2_d.lib
+vtkFiltersProgrammable-8.2_d.lib
+vtkFiltersSelection-8.2_d.lib
+vtkFiltersSMP-8.2_d.lib
+vtkFiltersSources-8.2_d.lib
+vtkFiltersStatistics-8.2_d.lib
+vtkFiltersTexture-8.2_d.lib
+vtkFiltersTopology-8.2_d.lib
+vtkFiltersVerdict-8.2_d.lib
+vtkfreetype-8.2_d.lib
+vtkGeovisCore-8.2_d.lib
+vtkgl2ps-8.2_d.lib
+vtkglew-8.2_d.lib
+vtkGUISupportQt-8.2_d.lib
+vtkGUISupportQtSQL-8.2_d.lib
+vtkhdf5-8.2_d.lib
+vtkhdf5_hl-8.2_d.lib
+vtkImagingColor-8.2_d.lib
+vtkImagingCore-8.2_d.lib
+vtkImagingFourier-8.2_d.lib
+vtkImagingGeneral-8.2_d.lib
+vtkImagingHybrid-8.2_d.lib
+vtkImagingMath-8.2_d.lib
+vtkImagingMorphological-8.2_d.lib
+vtkImagingSources-8.2_d.lib
+vtkImagingStatistics-8.2_d.lib
+vtkImagingStencil-8.2_d.lib
+vtkInfovisCore-8.2_d.lib
+vtkInfovisLayout-8.2_d.lib
+vtkInteractionImage-8.2_d.lib
+vtkInteractionStyle-8.2_d.lib
+vtkInteractionWidgets-8.2_d.lib
+vtkIOAMR-8.2_d.lib
+vtkIOAsynchronous-8.2_d.lib
+vtkIOCityGML-8.2_d.lib
+vtkIOCore-8.2_d.lib
+vtkIOEnSight-8.2_d.lib
+vtkIOExodus-8.2_d.lib
+vtkIOExport-8.2_d.lib
+vtkIOExportOpenGL2-8.2_d.lib
+vtkIOExportPDF-8.2_d.lib
+vtkIOGeometry-8.2_d.lib
+vtkIOImage-8.2_d.lib
+vtkIOImport-8.2_d.lib
+vtkIOInfovis-8.2_d.lib
+vtkIOLegacy-8.2_d.lib
+vtkIOLSDyna-8.2_d.lib
+vtkIOMINC-8.2_d.lib
+vtkIOMovie-8.2_d.lib
+vtkIONetCDF-8.2_d.lib
+vtkIOParallel-8.2_d.lib
+vtkIOParallelXML-8.2_d.lib
+vtkIOPLY-8.2_d.lib
+vtkIOSegY-8.2_d.lib
+vtkIOSQL-8.2_d.lib
+vtkIOTecplotTable-8.2_d.lib
+vtkIOVeraOut-8.2_d.lib
+vtkIOVideo-8.2_d.lib
+vtkIOXML-8.2_d.lib
+vtkIOXMLParser-8.2_d.lib
+vtkjpeg-8.2_d.lib
+vtkjsoncpp-8.2_d.lib
+vtklibharu-8.2_d.lib
+vtklibxml2-8.2_d.lib
+vtkLocalExample-8.2_d.lib
+vtklz4-8.2_d.lib
+vtklzma-8.2_d.lib
+vtkmetaio-8.2_d.lib
+vtkNetCDF-8.2_d.lib
+vtkogg-8.2_d.lib
+vtkParallelCore-8.2_d.lib
+vtkpng-8.2_d.lib
+vtkproj-8.2_d.lib
+vtkpugixml-8.2_d.lib
+vtkRenderingAnnotation-8.2_d.lib
+vtkRenderingContext2D-8.2_d.lib
+vtkRenderingContextOpenGL2-8.2_d.lib
+vtkRenderingCore-8.2_d.lib
+vtkRenderingFreeType-8.2_d.lib
+vtkRenderingGL2PSOpenGL2-8.2_d.lib
+vtkRenderingImage-8.2_d.lib
+vtkRenderingLabel-8.2_d.lib
+vtkRenderingLOD-8.2_d.lib
+vtkRenderingOpenGL2-8.2_d.lib
+vtkRenderingQt-8.2_d.lib
+vtkRenderingVolume-8.2_d.lib
+vtkRenderingVolumeOpenGL2-8.2_d.lib
+vtksqlite-8.2_d.lib
+vtksys-8.2_d.lib
+vtktheora-8.2_d.lib
+vtktiff-8.2_d.lib
+vtkverdict-8.2_d.lib
+vtkViewsContext2D-8.2_d.lib
+vtkViewsCore-8.2_d.lib
+vtkViewsInfovis-8.2_d.lib
+vtkViewsQt-8.2_d.lib
+vtkzlib-8.2_d.lib

+ 126 - 0
CAE_Solution/Libs/vtk8.2/win/lib/release.txt

@@ -0,0 +1,126 @@
+vtkChartsCore-8.2.lib
+vtkCommonColor-8.2.lib
+vtkCommonComputationalGeometry-8.2.lib
+vtkCommonCore-8.2.lib
+vtkCommonDataModel-8.2.lib
+vtkCommonExecutionModel-8.2.lib
+vtkCommonMath-8.2.lib
+vtkCommonMisc-8.2.lib
+vtkCommonSystem-8.2.lib
+vtkCommonTransforms-8.2.lib
+vtkDICOMParser-8.2.lib
+vtkDomainsChemistry-8.2.lib
+vtkDomainsChemistryOpenGL2-8.2.lib
+vtkdoubleconversion-8.2.lib
+vtkexodusII-8.2.lib
+vtkexpat-8.2.lib
+vtkFiltersAMR-8.2.lib
+vtkFiltersCore-8.2.lib
+vtkFiltersExtraction-8.2.lib
+vtkFiltersFlowPaths-8.2.lib
+vtkFiltersGeneral-8.2.lib
+vtkFiltersGeneric-8.2.lib
+vtkFiltersGeometry-8.2.lib
+vtkFiltersHybrid-8.2.lib
+vtkFiltersHyperTree-8.2.lib
+vtkFiltersImaging-8.2.lib
+vtkFiltersModeling-8.2.lib
+vtkFiltersParallel-8.2.lib
+vtkFiltersParallelImaging-8.2.lib
+vtkFiltersPoints-8.2.lib
+vtkFiltersProgrammable-8.2.lib
+vtkFiltersSelection-8.2.lib
+vtkFiltersSMP-8.2.lib
+vtkFiltersSources-8.2.lib
+vtkFiltersStatistics-8.2.lib
+vtkFiltersTexture-8.2.lib
+vtkFiltersTopology-8.2.lib
+vtkFiltersVerdict-8.2.lib
+vtkfreetype-8.2.lib
+vtkGeovisCore-8.2.lib
+vtkgl2ps-8.2.lib
+vtkglew-8.2.lib
+vtkGUISupportQt-8.2.lib
+vtkGUISupportQtSQL-8.2.lib
+vtkhdf5-8.2.lib
+vtkhdf5_hl-8.2.lib
+vtkImagingColor-8.2.lib
+vtkImagingCore-8.2.lib
+vtkImagingFourier-8.2.lib
+vtkImagingGeneral-8.2.lib
+vtkImagingHybrid-8.2.lib
+vtkImagingMath-8.2.lib
+vtkImagingMorphological-8.2.lib
+vtkImagingSources-8.2.lib
+vtkImagingStatistics-8.2.lib
+vtkImagingStencil-8.2.lib
+vtkInfovisCore-8.2.lib
+vtkInfovisLayout-8.2.lib
+vtkInteractionImage-8.2.lib
+vtkInteractionStyle-8.2.lib
+vtkInteractionWidgets-8.2.lib
+vtkIOAMR-8.2.lib
+vtkIOAsynchronous-8.2.lib
+vtkIOCityGML-8.2.lib
+vtkIOCore-8.2.lib
+vtkIOEnSight-8.2.lib
+vtkIOExodus-8.2.lib
+vtkIOExport-8.2.lib
+vtkIOExportOpenGL2-8.2.lib
+vtkIOExportPDF-8.2.lib
+vtkIOGeometry-8.2.lib
+vtkIOImage-8.2.lib
+vtkIOImport-8.2.lib
+vtkIOInfovis-8.2.lib
+vtkIOLegacy-8.2.lib
+vtkIOLSDyna-8.2.lib
+vtkIOMINC-8.2.lib
+vtkIOMovie-8.2.lib
+vtkIONetCDF-8.2.lib
+vtkIOParallel-8.2.lib
+vtkIOParallelXML-8.2.lib
+vtkIOPLY-8.2.lib
+vtkIOSegY-8.2.lib
+vtkIOSQL-8.2.lib
+vtkIOTecplotTable-8.2.lib
+vtkIOVeraOut-8.2.lib
+vtkIOVideo-8.2.lib
+vtkIOXML-8.2.lib
+vtkIOXMLParser-8.2.lib
+vtkjpeg-8.2.lib
+vtkjsoncpp-8.2.lib
+vtklibharu-8.2.lib
+vtklibxml2-8.2.lib
+vtkLocalExample-8.2.lib
+vtklz4-8.2.lib
+vtklzma-8.2.lib
+vtkmetaio-8.2.lib
+vtkNetCDF-8.2.lib
+vtkogg-8.2.lib
+vtkParallelCore-8.2.lib
+vtkpng-8.2.lib
+vtkproj-8.2.lib
+vtkpugixml-8.2.lib
+vtkRenderingAnnotation-8.2.lib
+vtkRenderingContext2D-8.2.lib
+vtkRenderingContextOpenGL2-8.2.lib
+vtkRenderingCore-8.2.lib
+vtkRenderingFreeType-8.2.lib
+vtkRenderingGL2PSOpenGL2-8.2.lib
+vtkRenderingImage-8.2.lib
+vtkRenderingLabel-8.2.lib
+vtkRenderingLOD-8.2.lib
+vtkRenderingOpenGL2-8.2.lib
+vtkRenderingQt-8.2.lib
+vtkRenderingVolume-8.2.lib
+vtkRenderingVolumeOpenGL2-8.2.lib
+vtksqlite-8.2.lib
+vtksys-8.2.lib
+vtktheora-8.2.lib
+vtktiff-8.2.lib
+vtkverdict-8.2.lib
+vtkViewsContext2D-8.2.lib
+vtkViewsCore-8.2.lib
+vtkViewsInfovis-8.2.lib
+vtkViewsQt-8.2.lib
+vtkzlib-8.2.lib

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

@@ -1,9 +1,11 @@
 HEADERS += \ 
     $$PWD/meshmanager.h \
-    $$PWD/resultmeshmanager.h
+    $$PWD/resultmeshmanager.h \
+    $$PWD/xyplotmanager.h
 
 		
 		
 SOURCES += \ 
     $$PWD/meshmanager.cpp \
-    $$PWD/resultmeshmanager.cpp
+    $$PWD/resultmeshmanager.cpp \
+    $$PWD/xyplotmanager.cpp

+ 720 - 0
CAE_Solution/src/VTK/Manager/resultmeshmanager.cpp

@@ -1,6 +1,726 @@
 #include "resultmeshmanager.h"
+#include "../mesh/mesh_ugrid.h"
+#include "../mesh/mesh_tecplot.h"
+
+#include <QFileInfo>
+#include <algorithm>
+#include <QString>
+#include <vtkAppendFilter.h>
+
 
 ResultMeshManager::ResultMeshManager()
 {
+    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;
+
+    changeRangeFlag = false;
+    surfaceHideFlag = true;
+    displayType = -1;
+    scaleFactor_ = 0.02;
+
+    solveTimes_.clear();
+    zoneNameSet_.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;
+    unSlice_ = NULL;
+}
+
+
+ResultMeshManager::~ResultMeshManager()
+{
+    this->Clear();
+}
+
+void ResultMeshManager::Clear()
+{
+    if (meshObj_)
+    {
+        delete meshObj_;
+        meshObj_ = 0;
+    }
+
+    //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)
+        {
+            delete itin->second;
+        }
+        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)
+        {
+            delete itin->second;
+        }
+        it->second.clear();
+    }
+    vtkVisZoneMeshMap_.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)
+        {
+            delete itin->second;
+        }
+        it->second.clear();
+    }
+    vtkVisZoneGlyphMap_.clear();
+
+    if (addDataSource_ != NULL)
+    {
+        delete addDataSource_;
+        addDataSource_ = NULL;
+    }
+
+    if (unSlice_ != NULL)
+    {
+        unSlice_->Delete();
+        unSlice_ = NULL;
+    }
+
+
+    changeRangeFlag = false;
+    solveTimes_.clear();
+    zoneNameSet_.clear();
+    currShowZoneNameSet_.clear();
+    surfaceActorColor_.clear();
+    displayType = -1;
+
+    scalarName_.clear();
+    allZoneScalarName_.clear();
+
+    surfaceActorColor_.push_back(0);
+    surfaceActorColor_.push_back(0);
+    surfaceActorColor_.push_back(1);
+    surfaceActorTransparency_ = 1;
+}
+
+bool ResultMeshManager::LoadData(QString name)
+{
+    bool loadstate = false;
+    QFileInfo meshinfo(name);
+    QString extType(meshinfo.completeSuffix().toLower());
+
+    if (extType == "tec" || extType == "plt")
+    {
+        meshObj_ = new Mesh_Tecplot;
+        if (extType == "tec")
+            ;
+        else if (extType == "plt")
+            loadstate = meshObj_->Load_Binary(name.toStdString());
+    }
+    else
+    {
+
+    }
+    return loadstate;
+}
+
+void ResultMeshManager::DisplayMesh(QVTKRenderer *qvtkRenderer)
+{
+    render_ = qvtkRenderer;
+    if (meshObj_ == 0)  return;
+    if (qvtkRenderer == 0)  return;
+    solveTimes_.insert(meshObj_->GetSovleTime());
+    size_t nzone = meshObj_->GetZoneNumber();
+    vtkVISMeshToVTKSource* source = new vtkVISMeshToVTKSource;
+    map<string, vtkVISUnContour*> contourMap;
+    map<string, vtkVISUnGlyph*> glyphMap;
+    map<string, vtkVISUnShadeMesh*> unMeshMap;
+
+    source->MeshToVTK(meshObj_);
+    int type = source->GetType();
+    if (type == -1)//unKnow
+    {
+
+    }else if (type == 0)//structured
+    {
+
+    }else if (type == 1)//unstructured
+    {
+        for (int i = 0; i < nzone; i ++)
+        {
+            if (source->GetVtkUnMesh(i) != NULL)
+            {
+                map<double, map<string, vtkVISUnContour*>>::iterator contourIt = vtkVisZoneMeshMap_.find(meshObj_->GetSovleTime());
+                if (contourIt != vtkVisZoneMeshMap_.end())
+                {
+                    contourMap = contourIt->second;
+                }
+                map<double, map<string, vtkVISUnShadeMesh*>>::iterator unMeshIt = vtkVisZoneUnShadeMeshMap_.find(meshObj_->GetSovleTime());
+                if (unMeshIt != vtkVisZoneUnShadeMeshMap_.end())
+                {
+                    unMeshMap = unMeshIt->second;
+                }
+                map<double, map<string, vtkVISUnGlyph*>>::iterator glyphIt = vtkVisZoneGlyphMap_.find(meshObj_->GetSovleTime());
+                if (glyphIt != vtkVisZoneGlyphMap_.end())
+                {
+                    glyphMap = glyphIt->second;
+                }
+                vtkVISUnstructuredGridSource* unGrid = source->GetVtkUnMesh(i);
+                vtkVISUnContour* visobj = vtkVISUnContour::New();//contour
+                visobj->SetRenderTo(qvtkRenderer->GetRenderer());
+                vtkVISUnGlyph* unGlyph = vtkVISUnGlyph::New();//glyph3d
+                unGlyph->SetRenderTo(qvtkRenderer->GetRenderer());
+                vtkVISUnShadeMesh* unMesh = vtkVISUnShadeMesh::New();//unShadeMesh
+                unMesh->SetRenderTo(qvtkRenderer->GetRenderer());
+                visobj->SetDataSource(unGrid);
+                unGlyph->SetDataSource(unGrid);
+                unMesh->SetDataSource(unGrid);
+                unMesh->CreateShadeMeshSurfaceDisplay(true);
+                string zoneName = meshObj_->GetZoneName().at(i);
+                zoneNameSet_.insert(zoneName);
+                contourMap[zoneName] = visobj;
+                glyphMap[zoneName] = unGlyph;
+                unMeshMap[zoneName] = unMesh;
+            }
+        }
+    }
+    vtkVisZoneMeshMap_[meshObj_->GetSovleTime()] = contourMap;
+    vtkVisZoneGlyphMap_[meshObj_->GetSovleTime()] = glyphMap;
+    vtkVisZoneUnShadeMeshMap_[meshObj_->GetSovleTime()] = unMeshMap;
+}
+
+void ResultMeshManager::SetShowHideState(vector<bool> vec)
+{
+    currShowZoneNameSet_.clear();
+    int i = 0;
+    for (set<string>::iterator it = zoneNameSet_.begin(); it != zoneNameSet_.end(); it ++)
+    {
+        if (vec.at(i))
+        {
+            currShowZoneNameSet_.insert(*it);
+        }
+        i ++;
+    }
+}
+
+void ResultMeshManager::ShowAll()
+{
+    if (meshObj_ == 0)  return;
+    currShowZoneNameSet_.clear();
+    currShowZoneNameSet_ = zoneNameSet_;
+}
+
+void ResultMeshManager::DisplayMeshByIndex(int index)
+{
+    bool scalarBarState = true;
+    m_currId = index;
+    render_->HideAllActors();
+
+    int num = 0;
+    double time = 0.0;
+    for(set<double>::iterator it = solveTimes_.begin(); it != solveTimes_.end(); it ++)
+    {
+        if (num == m_currId)
+        {
+            time = *it;
+            break;
+        }
+        num ++;
+    }
+
+    map<double, map<string, vtkVISUnShadeMesh*>>::iterator it5 = vtkVisZoneUnShadeMeshMap_.begin();
+    if (index >= 0 && index <= vtkVisZoneUnShadeMeshMap_.size())
+    {
+        if (surfaceHideFlag)
+        {
+            for (map<double, map<string, vtkVISUnShadeMesh*>>::iterator it = vtkVisZoneUnShadeMeshMap_.begin();
+                 it != vtkVisZoneUnShadeMeshMap_.end(); it ++)
+            {
+                if (it->first == time)
+                {
+                    for (map<string, vtkVISUnShadeMesh*>::iterator it2= it->second.begin();
+                         it2 != it->second.end(); it2 ++)
+                    {
+                        if (currShowZoneNameSet_.count(it2->first))
+                        {
+                            it2->second->SetColor(surfaceActorColor_[0], surfaceActorColor_[1], surfaceActorColor_[2]);
+                            it2->second->SetOpacity(surfaceActorTransparency_);
+                            it2->second->ShowOn();
+                        }
+                    }
+                }
+            }
+        }
+        if (displayType == 0 || displayType == 2)//contour or line
+        {
+            InitRange(index);
+            for (map<double, map<string, vtkVISUnContour*>>::iterator it = vtkVisZoneMeshMap_.begin();
+                 it != vtkVisZoneMeshMap_.end(); it ++)
+            {
+                if (it->first == time)
+                {
+                    for (map<string, vtkVISUnContour*>::iterator it2= it->second.begin();
+                         it2 != it->second.end(); it2 ++)
+                    {
+                        if (currShowZoneNameSet_.count(it2->first))
+                        {
+                            it2->second->SetContourType(displayType);
+                            it2->second->SetContourLevel(scalarLeave);
+                            if (scalarName_ != it2->second->GetScalarName())
+                            {
+                                char* name = (char*)scalarName_.c_str();
+                                it2->second->ModifyContourDisplay(name);
+                                it2->second->DeleteScalarBar();
+                                it2->second->CreateScalarBar();
+                            }
+                            it2->second->ModifyDisplayScalarRange(range_[0], range_[1]);
+                            it2->second->ShowOffScalarBar();
+                            it2->second->ShowOn();
+                            if (scalarBarState)
+                            {
+                                it2->second->ShowOnScalarBar();
+                                scalarBarState = false;
+                            }
+                        }
+                    }
+                }
+            }
+        }else if (displayType == 3)//unglyph
+        {
+            for (map<double, map<string, vtkVISUnGlyph*>>::iterator it = vtkVisZoneGlyphMap_.begin();
+                 it != vtkVisZoneGlyphMap_.end(); it ++)
+            {
+                if (it->first == time)
+                {
+                    for (map<string, vtkVISUnGlyph*>::iterator it2= it->second.begin();
+                         it2 != it->second.end(); it2 ++)
+                    {
+                        if (currShowZoneNameSet_.count(it2->first))
+                        {
+                            it2->second->CreateGlyphDisplay(vectorScalarIndexVec.at(0),
+                                    vectorScalarIndexVec.at(1),
+                                    vectorScalarIndexVec.at(2));
+                            it2->second->SetGlyphScaleFactor(scaleFactor_);
+                        }
+                    }
+                }
+            }
+        }
+
+    }
+    render_->ZoomToExtents();
+}
+
+void ResultMeshManager::SetSaveIndex(int index)
+{
+    m_currId = index;
+}
+
+int ResultMeshManager::GetCurrIndex()
+{
+    return m_currId;
+}
+
+set<string> ResultMeshManager::GetZoneNameVec()
+{
+    return zoneNameSet_;
+}
+
+set<double> ResultMeshManager::GetSolveTime()
+{
+    return solveTimes_;
+}
+
+void ResultMeshManager::SetNameTypeMap()
+{
+    if (meshObj_ == 0)  return;
+    for (int i = 0; i < meshObj_->GetScalarNumber(); i ++)
+    {
+        string name = meshObj_->GetScalarName().at(i);
+        nameTypeMap_[name] = meshObj_->GetZoneScalarType().at(0).at(i + 3);
+        //cout << name << ",  " << meshObj_->GetZoneScalarType().at(0).at(i + 3) << endl;
+    }
+}
+
+map<string, int> ResultMeshManager::GetNameTypeMap()
+{
+    return nameTypeMap_;
+}
+
+vector<string> ResultMeshManager::GetMeshScalarNameVec()
+{
+    if (meshObj_ == 0)
+    {
+        vector<string> nullVec;
+        return nullVec;
+    }
+    return meshObj_->GetScalarName();
+}
+
+void ResultMeshManager::InitRange(int index)
+{
+    if(changeRangeFlag)//user set range
+    {
+        changeRangeFlag = false;
+    }else// program calculated range
+    {
+        set<double> set_;
+
+        int num = 0;
+        double time = 0.0;
+        for(set<double>::iterator it = solveTimes_.begin(); it != solveTimes_.end(); it ++)
+        {
+            if (num == index)
+            {
+                time = *it;
+                break;
+            }
+            num ++;
+        }
+
+        map<double, map<string, vtkVISUnContour*>>::iterator it1 = vtkVisZoneMeshMap_.find(time);
+        set<double>::iterator it3;
+        for (map<string, vtkVISUnContour*>::iterator unIt = it1->second.begin(); unIt != it1->second.end(); unIt ++)
+        {
+            if (currShowZoneNameSet_.count(unIt->first))
+            {cout << scalarName_<< endl;
+                double range[2];
+                //string str = meshObj_->GetScalarName().at(scalarIndex);
+                char* scalarName = (char*)scalarName_.c_str();
+                unIt->second->GetScalarRange(range, scalarName);
+                set_.insert(range[0]);
+                set_.insert(range[1]);
+            }
+        }
+        if (set_.size() == 0)
+        {
+            range_[0] = 0;
+            range_[1] = 0;
+        }else
+        {
+            it3 = set_.begin();
+            range_[0] = *it3;
+            it3 = --set_.end();
+            range_[1] = *it3;
+            //cout << range_[0] << ",   " << range_[1] << endl;
+        }
+    }
+
+    //SetWidgetRange();//init widget range parameter*/
+}
+
+double* ResultMeshManager::GetScalarRange()
+{
+    return range_;
+}
+
+void ResultMeshManager::ModifyScalarDisplay(int index)
+{
+    if (scalarIndex != index)
+    {
+        scalarIndex = index;
+    }
+}
+
+void ResultMeshManager::ModifyScalarDisplay(string name)
+{
+    if (scalarName_ != name)
+    {
+        scalarName_ = name;
+        InitRange(m_currId);
+    }
+}
+
+int ResultMeshManager::GetScalarIndex()
+{
+    return scalarIndex;
+}
+
+void ResultMeshManager::SetContourLevel(int level)
+{
+    scalarLeave = level;
+}
+
+int ResultMeshManager::GetContourLevel()
+{
+    return scalarLeave;
+}
+
+//void ResultMeshManager::SetCotourWidget(ContourDisplayW* w)
+//{
+//    contourWidget_ = w;
+//    if (meshObj_ != NULL)
+//    {
+//        contourWidget_->SetNameTypeMap(GetNameTypeMap());
+//        contourWidget_->SetScalarNameVec(GetMeshScalarNameVec());
+//        SetWidgetRange();
+//        SetWidgetScalarName();
+//    }
+//}
+
+//void ResultMeshManager::SetLineWidget(LineDisplayW* w)
+//{
+//    lineWidget_ = w;
+//    if (meshObj_ != NULL)
+//    {
+//        lineWidget_->SetNameTypeMap(GetNameTypeMap());
+//        lineWidget_->SetScalarNameVec(GetMeshScalarNameVec());
+//        SetWidgetRange();
+//        SetWidgetScalarName();
+//    }
+//}
+
+//void ResultMeshManager::SetVectorWidget(VectorW* w)
+//{
+//    vectorWidget_ = w;
+//    if (meshObj_ != NULL)
+//    {
+//        vectorWidget_->GetData_u(GetMeshScalarNameVec());
+//        vectorWidget_->GetData_v(GetMeshScalarNameVec());
+//        vectorWidget_->GetData_w(GetMeshScalarNameVec());
+//        vectorWidget_->SetScaleFactor(scaleFactor_);
+//    }
+//}
+
+//void ResultMeshManager::SetAnimationWidget(ContourInimationW *w)
+//{
+//    animationWidget_ = w;
+//    if (meshObj_ != NULL)
+//    {
+//        animationWidget_->SetSolveTime(GetSolveTime());
+//        animationWidget_->SetZoneNameVector(zoneNameSet_);
+//    }
+//}
+
+//void ResultMeshManager::SetWidgetRange()
+//{
+//    if (contourWidget_ != NULL)
+//    {
+//        contourWidget_->SetRange(range_);
+//    }
+//    if (lineWidget_ != NULL)
+//    {
+//        lineWidget_->SetRange(range_);
+//    }
+//}
+
+//void ResultMeshManager::SetWidgetScalarName()
+//{
+//    if (meshObj_ != NULL && scalarIndex != -1)
+//    {
+//        string name = meshObj_->GetScalarName().at(scalarIndex);
+//        if (contourWidget_ != NULL)
+//        {
+//            contourWidget_->SetCurrScalar(name);
+//        }
+//        if (lineWidget_ != NULL)
+//        {
+//            lineWidget_->SetCurrScalar(name);
+//        }
+//    }
+//}
+
+void ResultMeshManager::SetTitleSize(double size)
+{
+    titleSize_ = size;
+    //SetWidgetTitleSize();
+}
+
+//void ResultMeshManager::SetWidgetTitleSize()
+//{
+//    if (contourWidget_ != NULL)
+//    {
+//        contourWidget_->SetTitleFont(titleSize_);
+//    }
+//}
+
+void ResultMeshManager::SetLabelSize(double size)
+{
+    labelSize_ = size;
+    //SetWidgetLabelSize();
+}
+
+//void ResultMeshManager::SetWidgetLabelSize()
+//{
+//    if (contourWidget_ != NULL)
+//    {
+//        contourWidget_->SetLabelFont(labelSize_);
+//    }
+//}
+
+void ResultMeshManager::SetLevel(int level)
+{
+    scalarLeave = level;
+    //SetWidgetLevel();
+}
+
+//void ResultMeshManager::SetWidgetLevel()
+//{
+//    if (contourWidget_ != NULL)
+//    {
+//        contourWidget_->SetLevel(scalarLeave);
+//    }
+//    if (lineWidget_ != NULL)
+//    {
+//        lineWidget_->SetLevel(scalarLeave);
+//    }
+//}
+
+void ResultMeshManager::SetRange(double* range)
+{
+    range_[0] = range[0];
+    range_[1] = range[1];
+    changeRangeFlag = true;
+}
+
+void ResultMeshManager::SetDisplayType(int type)
+{
+    displayType = type;
+}
+
+//void ResultMeshManager::InitWidgetsParameter()
+//{
+//    if (animationWidget_ != NULL)
+//    {
+//        animationWidget_->SetSolveTime(GetSolveTime());
+//        animationWidget_->SetZoneNameVector(zoneNameSet_);
+//    }
+//    if (contourWidget_ != NULL)
+//    {
+//        contourWidget_->SetNameTypeMap(GetNameTypeMap());
+//        contourWidget_->SetScalarNameVec(GetMeshScalarNameVec());
+//        SetWidgetRange();
+//        SetWidgetScalarName();
+//    }
+//    if (lineWidget_ != NULL)
+//    {
+//        lineWidget_->SetNameTypeMap(GetNameTypeMap());
+//        lineWidget_->SetScalarNameVec(GetMeshScalarNameVec());
+//        SetWidgetRange();
+//        SetWidgetScalarName();
+//    }
+//    if (vectorWidget_ != NULL)
+//    {
+//        vectorWidget_->GetData_u(GetMeshScalarNameVec());
+//        vectorWidget_->GetData_v(GetMeshScalarNameVec());
+//        vectorWidget_->GetData_w(GetMeshScalarNameVec());
+//        vectorWidget_->SetScaleFactor(scaleFactor_);
+//    }
+//}
+
+void ResultMeshManager::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);
+    }
+}
 
+void ResultMeshManager::SetVectorScaleFactor(double factor)
+{
+    scaleFactor_ = factor;
+}
+
+void ResultMeshManager::SetSurfaceColor(vector<double> color)
+{
+    surfaceActorColor_ = color;
 }
+
+void ResultMeshManager::SetSurfaceTransparency(double value)
+{
+    surfaceActorTransparency_ = value;
+}
+
+void ResultMeshManager::SetSurfaceShowHideFlag(bool flag)
+{
+    surfaceHideFlag = flag;
+}
+
+void ResultMeshManager::SetScalarName(string name)
+{
+    scalarName_ = name;
+}
+
+void ResultMeshManager::MakeVISUnStructGrid(int index)
+{
+    if (meshObj_ == 0)  return;
+    int num = 0;
+    double time = 0.0;
+    for(set<double>::iterator it = solveTimes_.begin(); it != solveTimes_.end(); it ++)
+    {
+        if (num == index)
+        {
+            time = *it;
+            break;
+        }
+        num ++;
+    }
+
+    vector<vtkVISUnstructuredGridSource*> vec;
+    map<double, map<string, vtkVISUnContour*>>::iterator it = vtkVisZoneMeshMap_.find(time);
+    if (it != vtkVisZoneMeshMap_.end())
+    {
+        for (map<string, vtkVISUnContour*>::iterator it2= it->second.begin();
+             it2 != it->second.end(); it2 ++)
+        {
+            if (currShowZoneNameSet_.count(it2->first))
+            {
+                vtkVISUnstructuredGridSource* unGrid = vtkVISUnstructuredGridSource::New();
+                unGrid = it2->second->GetDatSource();
+                vec.push_back(unGrid);
+            }
+        }
+        if (addDataSource_ != NULL)
+        {
+            delete addDataSource_;
+            addDataSource_ = NULL;
+        }
+        addDataSource_ = new vtkVISAddUnGridDataSource();
+        addDataSource_->SetVISUnGridDataSource(vec);
+    }
+}
+
+void ResultMeshManager::DisplayUnstructGrid()
+{
+    if (render_ == NULL)
+    {
+        return;
+    }
+    if (unSlice_ != NULL)
+    {
+        unSlice_->Delete();
+        unSlice_ = NULL;
+    }
+    unSlice_ = vtkVISUnSlice::New();
+    unSlice_->SetRenderTo(render_->GetRenderer());
+    string name = GetMeshScalarNameVec().at(0);
+    unSlice_->SetDataSource(addDataSource_->GetSource());
+    char* s = (char*)(name.c_str());
+    char* v = NULL;
+    unSlice_->SetSliceSource(s, v);
+    unSlice_->CreateUnSliceContourDisplay();
+    unSlice_->CreateSliceWidget();
+}
+

+ 108 - 1
CAE_Solution/src/VTK/Manager/resultmeshmanager.h

@@ -1,11 +1,118 @@
 #ifndef RESULTMESHMANAGER_H
 #define RESULTMESHMANAGER_H
+#include <vector>
+#include <map>
+#include <QStringList>
+#include <QString>
+#include "../QVTKRenderer/QVTKRenderer.h"
+#include "../visualization_VTK/vtkVISAddUnGridDataSource.h"
+#include "../visualization_VTK/vtkVISUnSlice.h"
+#include "../visualization_VTK/vtkvisuncontour.h"
+#include "../visualization_VTK/vtkvisunglyph.h"
+#include "../visualization_VTK/vtkvisunshademesh.h"
+#include "../visualization_VTK/vtkvismeshtovtksource.h"
+#include "../mesh/mesh.h"
 
+using namespace std;
+#include <set>
 
 class ResultMeshManager
 {
 public:
     ResultMeshManager();
+    ~ResultMeshManager();
+    bool LoadData(QString name);
+
+    //vtk vis functions.
+    void DisplayMesh(QVTKRenderer *qvtkRenderer = 0);
+    void DisplayMeshByIndex(int index = 0);
+
+    void SetSaveIndex(int index);
+    int GetCurrIndex();
+    set<double> GetSolveTime();
+    set<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 SetWidgetRange();
+//    void SetWidgetScalarName();
+    void SetTitleSize(double size);
+//    void SetWidgetTitleSize();
+    void SetLabelSize(double size);
+//    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(int index);
+    void DisplayUnstructGrid();
+
+private:
+    int m_currId;
+    Mesh *meshObj_;  //mesh object.
+    //mesh vis objects.  vtk vis functions.
+    map<double, map<string, vtkVISUnContour*>>  vtkVisZoneMeshMap_;  //id, <zoneid, mesh>.
+    map<double, map<string, vtkVISUnGlyph*>> vtkVisZoneGlyphMap_; //id, <zoneid, mesh>.
+    map<double, map<string, vtkVISUnShadeMesh*>> vtkVisZoneUnShadeMeshMap_;//solveTime zoneName unShadeMesh
+    vector<double> solveTime_;
+    set<double> solveTimes_;
+    set<string> zoneNameSet_;
+    set<string> currShowZoneNameSet_;
+    map<string, int> nameTypeMap_;
+    QVTKRenderer* render_;
+    vector<bool> showHideVec_;
+    vtkVISAddUnGridDataSource* addDataSource_;
+    vtkVISUnSlice* unSlice_;
+    double range_[2];
+    int scalarIndex;
+    int scalarLeave;
+
+//    ContourDisplayW* contourWidget_;
+//    LineDisplayW* lineWidget_;
+//    VectorW* vectorWidget_;
+//    ContourInimationW* animationWidget_;
+
+    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_;
 };
 
-#endif // RESULTMESHMANAGER_H
+#endif // RESULTMESHMANAGER_H

+ 264 - 0
CAE_Solution/src/VTK/Manager/xyplotmanager.cpp

@@ -0,0 +1,264 @@
+#include "xyplotmanager.h"
+#include <algorithm>
+#include <set>
+#include <QFileInfo>
+#include <QDebug>
+
+/*
+ * @brief: the constructor
+ * @param:
+ * @ret:
+ * @birth: created by czm in 20230411
+ */
+XYPlotManager::XYPlotManager()
+{
+    plotData = NULL;
+    curveNum = 0;
+    plot = NULL;
+
+    xRange.clear();
+    xRange.push_back(0);
+    xRange.push_back(0);
+}
+
+/*
+ * @brief: the destructor
+ * @param:
+ * @ret:
+ * @birth: created by czm in 20230411
+ */
+XYPlotManager::~XYPlotManager()
+{
+    this->Clear();
+    if (plot != NULL)
+    {
+        delete plot;
+    }
+    plot = NULL;
+}
+
+/*
+ * @brief: clear(删除图表数据和坐标轴)
+ * @param: void
+ * @ret: void
+ * @birth: created by czm in 20230411
+ */
+void XYPlotManager::Clear()
+{
+    if (plotData != NULL)
+    {
+        delete plotData;
+    }
+    plotData = NULL;
+    if (plot != NULL)
+    {
+        plot->DestroyXYPlot();
+        //delete plot;
+    }
+}
+
+/*
+ * @brief: load data(加载数据)
+ * @param: datafile
+ * @ret: bool
+ * @birth: created by czm in 20230411
+ */
+bool XYPlotManager::LoadData(const QString &datafile)
+{
+    this->Clear();
+    QFileInfo info(datafile);
+    QString extType(info.completeSuffix().toLower());
+    bool loadstate = false;
+    plotData = new LoadXYPlotData();
+    string str = datafile.toStdString();
+    char* name = (char* )(str.c_str());
+    loadstate = plotData->LoadData(name);
+    return loadstate;
+}
+
+/*
+ * @brief: init renderer(初始化renderer)
+ * @param: qvtkrenderer
+ * @ret: void
+ * @birth: created by czm in 20230411
+ */
+void XYPlotManager::InitRenderer(QVTKRenderer *qvtkRenderer)
+{
+
+    if (qvtkRenderer == 0)  return;
+    render_ = qvtkRenderer;
+    plot = new XYPlot();
+    plot->SetVtkRender(qvtkRenderer->GetRenderer());
+    plot->DestroyXYPlot();
+    plot->AllocateXYPlot(1);
+    vector<bool> showFlag(1,true);
+    plot->CreateXYPlot(showFlag);
+}
+
+/*
+ * @brief: allocate data(分配数据)
+ * @param: void
+ * @ret: void
+ * @birth: created by czm in 20230411
+ */
+void XYPlotManager::AllocateData()
+{
+    xRange.clear();
+    plot->DestroyXYPlot();
+    showHideVec.clear();
+    vector<string> nameVec;
+    nameVec = plotData->GetYNameVec();
+    string xName = plotData->GetXName();
+    map<string, vtkDoubleArray*> nameDataMap = plotData->GetNameDataMap();
+    map<string, vtkDoubleArray*>::iterator it = nameDataMap.find(xName);
+
+    plot->AllocateXYPlot(nameVec.size());
+    plot->SetXDoubleArray(it->second);
+    double range[2];
+    it->second->GetRange(range);
+    xRange.push_back(range[0]);
+    xRange.push_back(range[1]);
+    for (int i = 0; i < nameVec.size(); i ++)
+    {
+        if (i == 0)
+        {
+            showHideVec.push_back(true);
+        }else
+        {
+            showHideVec.push_back(false);
+        }
+        it = nameDataMap.find(nameVec.at(i));
+        plot->SetYDoubleArray(i, it->second);
+    }
+    plot->CreateXYPlot(showHideVec);
+    plot->SetXAxisTitle((char*)(xName.c_str()));
+    plot->SetLegendLabel(0,(char*)(nameVec.at(0).c_str()));
+    char c[] = "";
+    plot->SetGlyphType(0,c);
+    render_->Update();
+}
+
+/*
+ * @brief: set show hide vector(设置显示隐藏的容器)
+ * @param: vector
+ * @ret: void
+ * @birth: created by czm in 20230411
+ */
+void XYPlotManager::SetShowHideVec(vector<bool> vec)
+{
+    showHideVec.clear();
+    showHideVec = vec;
+}
+
+/*
+ * @brief: Display curve(展示曲线)
+ * @param: void
+ * @ret: void
+ * @birth: created by czm in 20230411
+ */
+void XYPlotManager::DisplayCurve()
+{
+    if (plotData != NULL)
+    {
+        vector<string> nameVec;
+        nameVec = plotData->GetYNameVec();
+        map<string, vtkDoubleArray*> nameDataMap = plotData->GetNameDataMap();
+        plot->RemoveXYPlotActor();
+        string xName = plotData->GetXName();
+        plot->CreateXYPlot(showHideVec);
+        plot->SetXAxisTitle((char*)(xName.c_str()));
+
+        int showCurveId = 0;
+        for (int i = 0; i < showHideVec.size(); i ++)
+        {
+            if (showHideVec.at(i))
+            {
+                plot->SetLegendLabel(showCurveId,(char*)(nameVec.at(i).c_str()));
+                showCurveId ++;
+            }
+        }
+        render_->Update();
+    }
+}
+
+/*
+ * @brief: set x range(设置x的范围)
+ * @param: min and max
+ * @ret:void
+ * @birth: created by czm in 20230411
+ */
+void XYPlotManager::SetXRange(double min, double max)
+{
+    plot->SetXRange(min,max);
+}
+
+/*
+ * @brief: set xy plot type(设置xyplot 类型)
+ * @param: type
+ * @ret: void
+ * @birth: created by czm in 20230411
+ */
+void XYPlotManager::SetXYPlotType(string type)
+{
+    plot->SetCurveType(type);
+    int id = 0;
+    if (type == "point")
+    {
+        for (int i = 0; i < showHideVec.size(); i ++)
+        {
+            if (showHideVec.at(i))
+            {
+                char p[] = "Point";
+                plot->SetGlyphType(id, p);
+                id ++;
+            }
+        }
+    }else if (type == "curve")
+    {
+        for (int i = 0; i < showHideVec.size(); i ++)
+        {
+            if (showHideVec.at(i))
+            {
+                char p[] = "";
+                plot->SetGlyphType(id, p);
+                id ++;
+            }
+        }
+    }
+}
+
+/*
+ * @brief: set xy plot point size(设置xyplot 点大小)
+ * @param: size
+ * @ret: void
+ * @birth: created by czm in 20230411
+ */
+void XYPlotManager::SetXyplotPointSize(double s)
+{
+    plot->SetPlotPointSize(s);
+}
+
+/*
+ * @brief: Set XYPlot Line Width(设置xyplot线宽)
+ * @param: line width
+ * @ret: void
+ * @birth: created by czm in 20230411
+ */
+void XYPlotManager::SetXYPlotLineWidth(double w)
+{
+    plot->SetPlotLineWidth(w);
+}
+
+/*
+ * @brief: render update(渲染刷新)
+ * @param: void
+ * @ret: void
+ * @birth: created by czm in 20230411
+ */
+void XYPlotManager::RenderUpdata()
+{
+    if (render_ != NULL)
+    {
+        render_->Update();
+    }
+}

+ 40 - 0
CAE_Solution/src/VTK/Manager/xyplotmanager.h

@@ -0,0 +1,40 @@
+#ifndef XYPLOTMANAGER_H
+#define XYPLOTMANAGER_H
+
+#include <iostream>
+using namespace std;
+#include "../visualization_VTK/loadxyplotdata.h"
+#include "../visualization_VTK/vtkxyplotvis.h"
+#include <QString>
+#include "../mesh/mesh.h"
+#include "../QVTKRenderer/qvtkrenderer.h"
+
+
+class XYPlotManager
+{
+public:
+    XYPlotManager();
+    ~XYPlotManager();
+    bool LoadData(const QString &datafile);
+    void InitRenderer(QVTKRenderer *qvtkRenderer = 0);
+    void AllocateData();
+    void DisplayCurve();
+    void Clear();
+
+    void SetShowHideVec(vector<bool> vec);
+    void SetXRange(double min, double max);
+    void SetXYPlotType(string type);
+    void SetXyplotPointSize(double s);
+    void SetXYPlotLineWidth(double w);
+    void RenderUpdata();
+private:
+    LoadXYPlotData* plotData;
+
+    vector<bool> showHideVec;
+    QVTKRenderer *render_;
+    int curveNum;
+    XYPlot* plot;
+    vector<double> xRange;
+};
+
+#endif // XYPLOTMANAGER_H

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

@@ -70,7 +70,7 @@ public:
     void HideAllActors();
     void RemoveAllActors();
 
-protected:
+public:
     enum SelectionMode
     {
         EntitySelection,

+ 8 - 2
CAE_Solution/src/VTK/visualization_VTK/visualization_VTK.pri

@@ -9,7 +9,10 @@ HEADERS += \
     $$PWD/vtkvismeshtovtksource.h \
     $$PWD/vtkvisaddungriddatasource.h \
     $$PWD/vtkvisunslice.h \
-    $$PWD/vtkviscapturefigure.h
+    $$PWD/vtkviscapturefigure.h \
+    $$PWD/vtkvisuncontour.h \
+    $$PWD/vtkvisxyplot.h \
+    $$PWD/vtkxyplotvis.h
 
 SOURCES += \
         $$PWD/*.cpp \
@@ -22,4 +25,7 @@ SOURCES += \
     $$PWD/vtkvismeshtovtksource.cpp \
     $$PWD/vtkvisaddungriddatasource.cpp \
     $$PWD/vtkvisunslice.cpp \
-    $$PWD/vtkviscapturefigure.cpp
+    $$PWD/vtkviscapturefigure.cpp \
+    $$PWD/vtkvisuncontour.cpp \
+    $$PWD/vtkvisxyplot.cpp \
+    $$PWD/vtkxyplotvis.cpp

+ 1614 - 0
CAE_Solution/src/VTK/visualization_VTK/vtkvisuncontour.cpp

@@ -0,0 +1,1614 @@
+#include "vtkvisuncontour.h"
+#include <vtkCellDataToPointData.h>
+
+
+vtkStandardNewMacro(vtkVISUnContour)
+
+/*
+ * @brief: the constructor
+ * @param:
+ * @ret:
+ * @birth: created by czm in 20230410
+ */
+vtkVISUnContour::vtkVISUnContour()
+{
+    contourLookupTable_ = NULL;
+    scalarBarWidget_ = NULL;
+    contourScalarIndex_ = 0;
+    vectorIndex_ = 0;
+    contourLevel_ = 10;
+
+    csdVectorWarp_ = NULL;
+
+    contourType_ = 0;
+    deformation_ = 0;
+    scaleFactor_ = 10.0;
+
+    conFilter_ = NULL;
+
+    scalarRange_[0] = 0;
+    scalarRange_[1] = 0;
+
+    representFlag_ = 1;
+
+    barEnable_ = 1;
+    scalarIndex_ = -1;
+}
+
+/*
+ * @brief: the destructor
+ * @param:
+ * @ret:
+ * @birth: created by czm in 20230410
+ */
+vtkVISUnContour::~vtkVISUnContour()
+{
+     ErrorInfo(0, "destructure func 0");
+    if(scalarBarWidget_ != NULL)
+    {
+        scalarBarWidget_->Delete();
+        scalarBarWidget_ = NULL;
+    }
+
+    ErrorInfo(0, "destructure func 2");
+    if(csdVectorWarp_ != NULL)
+    {
+        csdVectorWarp_->Delete();
+        csdVectorWarp_ = NULL;
+    }
+
+    if(conFilter_ != NULL)
+    {
+        conFilter_->Delete();
+        conFilter_ = NULL;
+    }
+    //delete [] _vtkObjects;
+}
+
+/*
+ * @brief: create contour display(创建等高线显示)
+ * @param: scalar
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISUnContour::CreateContourDisplay(char* scalarName)
+{
+    deformation_ = 0;
+    bool pointOrCell = true;
+
+    int scalarIndex = _source->GetScalarIndex(scalarName);
+
+    if (scalarIndex == -1)
+    {
+        ErrorInfo(1, "Scalar not exists, can't create contour.");
+        return;
+    }
+
+
+    if (_source->scalarSource[scalarIndex] == NULL)
+    {
+        ErrorInfo(1, "This Scalar Source is not exists, Please Load it First!");
+        return;
+    }
+
+    scalarIndex_ = scalarIndex;
+    scalarRange_[0] = _source->scalarRange[scalarIndex][0];
+    scalarRange_[1] = _source->scalarRange[scalarIndex][1];
+
+    vtkUnstructuredGrid *unGrid = vtkUnstructuredGrid::New();
+    unGrid->DeepCopy(_source->unstruGrid);
+    if (_source->scalarSource[scalarIndex]->GetDataSize() != 0)
+    {
+        pointOrCell = true;
+        (unGrid->GetPointData())->SetScalars(_source->scalarSource[scalarIndex]);
+    }
+    else
+    {
+        pointOrCell = false;
+        (unGrid->GetCellData())->SetScalars(_source->cellScalarSource_[scalarIndex]);
+    }
+    unGrid->Modified();
+
+    vtkCellDataToPointData* ctop = vtkCellDataToPointData::New();
+    if (!pointOrCell)
+    {
+
+        ctop->SetInputData(unGrid);
+        ctop->PassCellDataOn();
+        ctop->Update();
+    }
+
+    vtkGeometryFilter *geoFilter = vtkGeometryFilter::New();
+    if(pointOrCell)
+    {
+        geoFilter->SetInputData(unGrid);
+    }else
+    {
+        geoFilter->SetInputData(ctop->GetOutput());
+    }
+    //geoFilter->SetInputData(unGrid);
+
+    geoFilter->Modified();
+    geoFilter->Update();
+
+    vtkWarpVector* warp = vtkWarpVector::New();
+    warp->SetInputConnection(geoFilter->GetOutputPort());
+    warp->SetScaleFactor(scaleFactor_);
+    warp->Modified();
+
+    vtkContourFilter *conFilter = vtkContourFilter::New();
+    if (deformation_ == 0)
+    {
+        conFilter->SetInputData(geoFilter->GetOutput());
+    }
+    else if (deformation_ == 1)
+    {
+        conFilter->SetInputData(warp->GetOutput());
+    }
+    conFilter->GenerateValues(contourLevel_, _source->scalarRange[scalarIndex][0], _source->scalarRange[scalarIndex][1]);
+
+    vtkBandedPolyDataContourFilter *bConFilter = vtkBandedPolyDataContourFilter::New();
+    if (deformation_ == 0)
+    {
+        //cout<<"test no deformation: "<<(geoFilter->GetOutput())->GetNumberOfPoints()<<endl;
+
+        geoFilter->Modified();
+
+        bConFilter->SetInputConnection(geoFilter->GetOutputPort());
+    }
+    else if (deformation_ == 1)
+    {
+        bConFilter->SetInputData(warp->GetOutput());
+    }
+    bConFilter->GenerateValues(contourLevel_, _source->scalarRange[scalarIndex][0], _source->scalarRange[scalarIndex][1]);
+    bConFilter->ClippingOff();
+    bConFilter->Modified();
+    bConFilter->Update();
+
+    //cout<<"test contourFilter:; "<<(bConFilter->GetOutput())->GetNumberOfPoints()<<endl;
+
+    vtkDataSetMapper *mapper = vtkDataSetMapper::New();
+    if(_source->scalarRange[scalarIndex][0] == _source->scalarRange[scalarIndex][1])
+    {
+        mapper->SetInputConnection(geoFilter->GetOutputPort());
+    }
+    else
+    {
+        if(contourType_ == 2)
+        {
+            mapper->SetInputConnection(conFilter->GetOutputPort());
+        }
+        else
+        {
+            if (deformation_ == 0)
+            {
+                mapper->SetInputConnection(bConFilter->GetOutputPort());
+            }
+            else if (deformation_ == 1)
+            {
+                mapper->SetInputConnection(warp->GetOutputPort());
+            }
+        }
+    }
+    mapper->InterpolateScalarsBeforeMappingOn();
+    mapper->SetScalarRange(_source->scalarRange[scalarIndex][0], _source->scalarRange[scalarIndex][1]);
+
+    mapper->SetScalarModeToUsePointData();
+
+    double range[2];
+    vtkLookupTable *lut = (vtkLookupTable*)(mapper->GetLookupTable());
+    lut->GetHueRange(range);
+    lut->SetHueRange(range[1], range[0]);
+    lut->SetRange(_source->scalarRange[scalarIndex][0], _source->scalarRange[scalarIndex][1]);
+    if(contourType_ == 1)
+    {
+        lut->SetNumberOfColors(256);
+    }
+    else
+    {
+        lut->SetNumberOfColors(contourLevel_);
+    }
+
+
+    vtkActor *actor = vtkActor::New();
+    actor->SetMapper(mapper);
+
+    if(representFlag_ == 0)
+    {
+        (actor->GetProperty())->SetRepresentationToPoints();
+    }
+    else if(representFlag_ == 1)
+    {
+        (actor->GetProperty())->SetRepresentationToSurface();
+    }
+    else if (representFlag_ == 2)
+    {
+        (actor->GetProperty())->SetRepresentationToWireframe();
+    }
+
+
+    if (_renderer != NULL)
+    {
+        _renderer->AddActor(actor);
+    }
+
+    contourScalarIndex_ = scalarIndex;
+    contourLookupTable_ = lut;
+
+    conFilter_ = bConFilter;
+    _unActor = actor;
+
+    _vtkObjectsNum = 6;
+    _vtkObjects = new vtkObject*[_vtkObjectsNum];
+    _vtkObjects[0] = unGrid;
+    _vtkObjects[1] = geoFilter;
+    _vtkObjects[2] = conFilter;
+    _vtkObjects[3] = lut;
+    _vtkObjects[4] = mapper;
+    _vtkObjects[5] = warp;
+}
+
+/*
+ * @brief: create contour display(创建等高线显示)
+ * @param: scalar,vector
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISUnContour::CreateContourDisplay(char* scalarName,char* vectorName)
+{
+    int scalarIndex = _source->GetScalarIndex(scalarName);
+    int vectorIndex = -1;
+
+    if (! string(vectorName).empty ())
+    {
+        vectorIndex = _source->GetVectorIndex(vectorName);
+    }
+
+    if (scalarIndex == -1)
+    {
+        ErrorInfo(1, "Scalar not exists, can't create contour.");
+        return;
+    }
+
+    if (_source->scalarSource[scalarIndex] == NULL)
+    {
+        ErrorInfo(1, "This Scalar Source is not exists, Please Load it First!");
+        return;
+    }
+
+    scalarIndex_ = scalarIndex;
+    scalarRange_[0] = _source->scalarRange[scalarIndex][0];
+    scalarRange_[1] = _source->scalarRange[scalarIndex][1];
+
+    int num = _source->scalarSource[scalarIndex]->GetDataSize();
+
+    vtkUnstructuredGrid *unGrid = vtkUnstructuredGrid::New();
+        unGrid->DeepCopy(_source->unstruGrid);
+
+        if (num != 0)
+        {
+            (unGrid->GetPointData())->SetScalars(_source->scalarSource[scalarIndex]);
+        }
+        else
+        {
+            (unGrid->GetCellData())->SetScalars(_source->cellScalarSource_[scalarIndex]);
+        }
+
+        if (vectorIndex != -1)
+        {
+            if( _source->vectorSource[vectorIndex]->GetDataSize() != 0)
+            {
+                (unGrid->GetPointData())->SetVectors(_source->vectorSource[vectorIndex]);
+            }
+            else
+            {
+                (unGrid->GetCellData())->SetVectors(_source->cellVectorSource_[vectorIndex]);
+            }
+        }
+        unGrid->Modified();
+
+        vtkCellDataToPointData* ctop = vtkCellDataToPointData::New();
+        if (num == 0)
+        {
+            ctop->SetInputData(unGrid);
+            ctop->PassCellDataOn();
+            ctop->Update();
+        }
+
+        vtkGeometryFilter *geoFilter = vtkGeometryFilter::New();
+        if(num != 0)
+        {
+            geoFilter->SetInputData(unGrid);
+        }else
+        {
+            geoFilter->SetInputData(ctop->GetOutput());
+        }
+
+    vtkWarpVector* warp = vtkWarpVector::New();
+        warp->SetInputConnection(geoFilter->GetOutputPort());
+        warp->SetScaleFactor(scaleFactor_);
+        warp->Update();
+
+
+    vtkContourFilter *conFilter = vtkContourFilter::New();
+        if (deformation_ == 0)
+        {
+            conFilter->SetInputData(geoFilter->GetOutput());
+        }
+        else if (deformation_ == 1)
+        {
+            conFilter->SetInputData(warp->GetOutput());
+        }
+        conFilter->GenerateValues(contourLevel_, _source->scalarRange[scalarIndex][0], _source->scalarRange[scalarIndex][1]);
+        conFilter->Modified();
+
+    vtkBandedPolyDataContourFilter *bConFilter = vtkBandedPolyDataContourFilter::New();
+        if (deformation_ == 0)
+        {
+            bConFilter->SetInputData(geoFilter->GetOutput());
+        }
+        else if (deformation_ == 1)
+        {
+
+            bConFilter->SetInputData(warp->GetOutput());
+        }
+        bConFilter->GenerateValues(contourLevel_, _source->scalarRange[scalarIndex][0], _source->scalarRange[scalarIndex][1]);
+        bConFilter->ClippingOn();
+        bConFilter->Modified();
+
+    vtkDataSetMapper *mapper = vtkDataSetMapper::New();
+    if(_source->scalarRange[scalarIndex][0] == _source->scalarRange[scalarIndex][1])
+    {
+        mapper->SetInputConnection(geoFilter->GetOutputPort());
+    }
+    else
+    {
+        if(contourType_ == 2)
+        {
+            mapper->SetInputConnection(conFilter->GetOutputPort());
+        }
+        else
+        {
+            if (deformation_ == 0)
+            {
+                mapper->SetInputConnection(bConFilter->GetOutputPort());
+            }
+            else if (deformation_ == 1)
+            {
+                mapper->SetInputConnection(warp->GetOutputPort());
+            }
+        }
+    }
+    mapper->InterpolateScalarsBeforeMappingOn();
+        mapper->SetScalarRange(_source->scalarRange[scalarIndex][0], _source->scalarRange[scalarIndex][1]);
+        mapper->SetScalarModeToUsePointData();
+
+    double range[2];
+    vtkLookupTable *lut = (vtkLookupTable*)(mapper->GetLookupTable());
+        lut->GetHueRange(range);
+        lut->SetHueRange(range[1], range[0]);
+        lut->SetRange(_source->scalarRange[scalarIndex][0], _source->scalarRange[scalarIndex][1]);
+        if(contourType_ == 1)
+        {
+            lut->SetNumberOfColors(256);
+        }
+        else
+        {
+            lut->SetNumberOfColors(contourLevel_);
+        }
+
+    vtkActor *actor = vtkActor::New();
+        actor->SetMapper(mapper);
+
+        if(representFlag_ == 0)
+        {
+            (actor->GetProperty())->SetRepresentationToPoints();
+        }
+        else if(representFlag_ == 1)
+        {
+            (actor->GetProperty())->SetRepresentationToSurface();
+        }
+        else if (representFlag_ == 2)
+        {
+            (actor->GetProperty())->SetRepresentationToWireframe();
+        }
+
+
+    if (_renderer != NULL)
+    {
+        _renderer->AddActor(actor);
+    }
+
+    contourScalarIndex_ = scalarIndex;
+    vectorIndex_ = vectorIndex;
+    contourLookupTable_ = lut;
+
+    conFilter_ = bConFilter;
+    _unActor = actor;
+
+    _vtkObjectsNum = 6;
+    _vtkObjects = new vtkObject*[_vtkObjectsNum];
+    _vtkObjects[0] = unGrid;
+    _vtkObjects[1] = geoFilter;
+    _vtkObjects[2] = conFilter;
+    _vtkObjects[3] = lut;
+    _vtkObjects[4] = mapper;
+    _vtkObjects[5] = warp;
+}
+
+/*
+ * @brief: modify contour display type(修改轮廓显示类型)
+ * @param: void
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISUnContour::ModifyContourDisplayType()
+{
+    if (_vtkObjects == NULL)
+    {
+        ErrorInfo(1, "Contour Display Not Created.");
+        return;
+    }
+
+    ((vtkUnstructuredGrid*)_vtkObjects[0])->Modified();
+    ((vtkGeometryFilter*)_vtkObjects[1])->Modified();
+
+    if(contourType_ == 2)
+    {
+        if (deformation_ == 0)
+        {
+            ((vtkContourFilter*)_vtkObjects[2])->SetInputConnection(((vtkGeometryFilter*)_vtkObjects[1])->GetOutputPort());
+        }
+        else
+        {
+            ((vtkContourFilter*)_vtkObjects[2])->SetInputConnection(((vtkWarpVector*)_vtkObjects[5])->GetOutputPort());
+        }
+        ((vtkContourFilter*)_vtkObjects[2])->GenerateValues(contourLevel_, _source->scalarRange[contourScalarIndex_][0], _source->scalarRange[contourScalarIndex_][1]);
+        ((vtkContourFilter*)_vtkObjects[2])->Modified();
+
+        ((vtkDataSetMapper*)_vtkObjects[4])->SetInputConnection(((vtkContourFilter*)_vtkObjects[2])->GetOutputPort());
+    }
+    else
+    {
+        if (deformation_ == 0)
+        {
+            conFilter_->SetInputConnection(((vtkGeometryFilter*)_vtkObjects[1])->GetOutputPort());
+            conFilter_->Modified();
+
+            ((vtkDataSetMapper*)_vtkObjects[4])->SetInputConnection(conFilter_->GetOutputPort());
+        }
+        else
+        {
+            ((vtkDataSetMapper*)_vtkObjects[4])->SetInputConnection(((vtkWarpVector*)_vtkObjects[5])->GetOutputPort());
+        }
+    }
+    ((vtkDataSetMapper*)_vtkObjects[4])->Modified();
+
+    if(contourType_ == 1)
+    {
+        ((vtkLookupTable*)_vtkObjects[3])->SetNumberOfColors(256);
+    }
+    else
+    {
+        ((vtkLookupTable*)_vtkObjects[3])->SetNumberOfColors(contourLevel_);
+    }
+    ((vtkLookupTable*)_vtkObjects[3])->Modified();
+
+    if(representFlag_ == 0)
+    {
+        (_unActor->GetProperty())->SetRepresentationToPoints();
+    }
+    else if(representFlag_ == 1)
+    {
+        (_unActor->GetProperty())->SetRepresentationToSurface();
+    }
+    else if (representFlag_ == 2)
+    {
+        (_unActor->GetProperty())->SetRepresentationToWireframe();
+    }
+    _unActor->Modified();
+}
+
+/*
+ * @brief: modify contour display(修改轮廓显示)
+ * @param: scalar
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISUnContour::ModifyContourDisplay(char* scalarName)
+{
+    DeleteObjects();
+    CreateContourDisplay(scalarName);
+    /*char* vectorName = NULL;
+    int vectorIndex = -1;
+
+    if (_vtkObjects != NULL)
+    {
+        int scalarIndex = _source->GetScalarIndex(scalarName);
+//        if (! string(vectorName).empty ())
+//        {
+//            vectorIndex = _source->GetVectorIndex(vectorName);
+//        }
+        if (scalarIndex == -1)
+        {
+            return;
+        }
+
+        contourScalarIndex_ = scalarIndex;
+        vectorIndex_ = -1;
+
+        if (_source->scalarSource[scalarIndex] == NULL)
+        {
+            ErrorInfo(1, "This Scalar Source is not exists, Please Load it First!");
+            return;
+        }
+    int num = _source->scalarSource[scalarIndex]->GetDataSize();
+
+        if (num != 0)
+        {
+            ((vtkUnstructuredGrid*)_vtkObjects[0])->GetPointData()->SetScalars(_source->scalarSource[scalarIndex]);
+        }
+        else
+        {
+            ((vtkUnstructuredGrid*)_vtkObjects[0])->GetCellData()->SetScalars(_source->cellScalarSource_[scalarIndex]);
+        }
+
+    if (vectorIndex != -1)
+        {
+        if(num != 0)
+        {
+        ((vtkUnstructuredGrid*)_vtkObjects[0])->GetPointData()->SetVectors(_source->vectorSource[vectorIndex]);
+        }
+        else
+        {
+        ((vtkUnstructuredGrid*)_vtkObjects[0])->GetCellData()->SetVectors(_source->cellVectorSource_[vectorIndex]);
+        }
+    }
+    scalarRange_[0] = _source->scalarRange[scalarIndex][0];
+    scalarRange_[1] = _source->scalarRange[scalarIndex][1];
+
+    ((vtkUnstructuredGrid*)_vtkObjects[0])->Modified();
+    ((vtkGeometryFilter*)_vtkObjects[1])->Modified();
+    if (deformation_ == 1)
+    {
+        ((vtkWarpVector*)_vtkObjects[5])->SetInputConnection(((vtkGeometryFilter*)_vtkObjects[1])->GetOutputPort());
+        ((vtkWarpVector*)_vtkObjects[5])->SetScaleFactor(scaleFactor_);
+        ((vtkWarpVector*)_vtkObjects[5])->Modified ();
+    }
+
+        if(contourType_ == 2)
+        {
+            if (deformation_ == 0)
+            {
+                ((vtkContourFilter*)_vtkObjects[2])->SetInputData(((vtkGeometryFilter*)_vtkObjects[1])->GetOutput());
+            }
+            else
+            {
+                ((vtkContourFilter*)_vtkObjects[2])->SetInputData(((vtkWarpVector*)_vtkObjects[5])->GetOutput());
+            }
+            ((vtkContourFilter*)_vtkObjects[2])->GenerateValues(contourLevel_, _source->scalarRange[scalarIndex][0], _source->scalarRange[scalarIndex][1]);
+            ((vtkContourFilter*)_vtkObjects[2])->Modified();
+            ((vtkContourFilter*)_vtkObjects[2])->Update();
+
+            if(_source->scalarRange[scalarIndex][0]==_source->scalarRange[scalarIndex][1])
+            {
+               ((vtkDataSetMapper*)_vtkObjects[4])->SetInputConnection(((vtkGeometryFilter*)_vtkObjects[1])->GetOutputPort());
+            }
+            else
+            {
+               ((vtkDataSetMapper*)_vtkObjects[4])->SetInputConnection(((vtkContourFilter*)_vtkObjects[2])->GetOutputPort());
+            }
+            ((vtkDataSetMapper*)_vtkObjects[4])->Modified();
+
+        }
+        else
+        {
+            conFilter_->SetInputData(((vtkGeometryFilter*)_vtkObjects[1])->GetOutput());
+            conFilter_->GenerateValues(contourLevel_, _source->scalarRange[scalarIndex][0], _source->scalarRange[scalarIndex][1]);
+            conFilter_->Modified();
+
+            if(_source->scalarRange[scalarIndex][0]==_source->scalarRange[scalarIndex][1])
+            {
+               ((vtkDataSetMapper*)_vtkObjects[4])->SetInputConnection(((vtkGeometryFilter*)_vtkObjects[1])->GetOutputPort());
+            }
+            else
+            {
+            if (deformation_ == 0)
+            {
+                ((vtkDataSetMapper*)_vtkObjects[4])->SetInputConnection(conFilter_->GetOutputPort());
+            }
+            else
+            {
+                ((vtkDataSetMapper*)_vtkObjects[4])->SetInputConnection(((vtkWarpVector*)_vtkObjects[5])->GetOutputPort());
+            }
+            }
+        }
+        ((vtkDataSetMapper*)_vtkObjects[4])->SetScalarModeToUsePointData();
+
+        ((vtkDataSetMapper*)_vtkObjects[4])->SetScalarRange(_source->scalarRange[scalarIndex][0], _source->scalarRange[scalarIndex][1]);
+        ((vtkDataSetMapper*)_vtkObjects[4])->Modified();
+
+
+        if(representFlag_ == 0)
+        {
+            (_unActor->GetProperty())->SetRepresentationToPoints();
+        }
+        else if(representFlag_ == 1)
+        {
+            (_unActor->GetProperty())->SetRepresentationToSurface();
+        }
+        else if (representFlag_ == 2)
+        {
+            (_unActor->GetProperty())->SetRepresentationToWireframe();
+        }
+
+        _unActor->Modified();
+
+        string temp = scalarName;
+        int length = temp.length();
+        string::size_type loc = temp.find( " ", 0 );
+        if( loc != string::npos ) {
+            temp.insert (loc,"\n");
+        }
+        string::size_type loc1 = temp.find_last_of( "-", length );
+        if( loc1 != string::npos ) {
+            temp.insert (loc1+1,"\n");
+        }
+        string::size_type loc2 = temp.find_last_of( "*", length );
+        if( loc2 != string::npos ) {
+            temp.insert (loc2+1,"\n");
+        }
+
+        if (scalarBarWidget_ != NULL)
+        {
+            for (int s = temp.size(); s < 10; ++s)  temp.append(" "); //add space to reduce font
+            scalarBarWidget_->GetScalarBarActor()->SetTitle(temp.c_str ());
+        }
+    }
+    else
+    {
+        ErrorInfo(1, "Contour Display Not Created.");
+        return;
+    }*/
+}
+
+/*
+ * @brief: modify ontour display(修改等高线显示)
+ * @param: scalar vector
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISUnContour::ModifyContourDisplay(char* scalarName,char* vectorName)
+{
+    int vectorIndex = -1;
+
+    if (_vtkObjects != NULL)
+    {
+        int scalarIndex = _source->GetScalarIndex(scalarName);
+
+        if (! string(vectorName).empty ())
+        {
+           vectorIndex = _source->GetVectorIndex(vectorName);
+        }
+
+        if (scalarIndex == -1)
+        {
+            return;
+        }
+
+        contourScalarIndex_ = scalarIndex;
+
+        scalarRange_[0] = _source->scalarRange[scalarIndex][0];
+        scalarRange_[1] = _source->scalarRange[scalarIndex][1];
+
+        int num = _source->scalarSource[scalarIndex]->GetDataSize();
+
+        if (_source->scalarSource[scalarIndex] == NULL)
+        {
+            ErrorInfo(1, "This Scalar Source is not exists, Please Load it First!");
+            return;
+        }
+
+        if (num != 0)
+        {
+            ((vtkUnstructuredGrid*)_vtkObjects[0])->GetPointData()->SetScalars(_source->scalarSource[scalarIndex]);
+        }
+        else
+        {
+            ((vtkUnstructuredGrid*)_vtkObjects[0])->GetCellData()->SetScalars(_source->cellScalarSource_[scalarIndex]);
+        }
+
+        if (vectorIndex != -1)
+        {
+            vectorIndex_ = vectorIndex;
+
+            if(_source->vectorSource[vectorIndex]->GetDataSize() != 0)
+            {
+                ((vtkUnstructuredGrid*)_vtkObjects[0])->GetPointData()->SetVectors(_source->vectorSource[vectorIndex]);
+            }
+            else
+            {
+                ((vtkUnstructuredGrid*)_vtkObjects[0])->GetCellData()->SetVectors(_source->cellVectorSource_[vectorIndex]);
+            }
+        }
+
+        ((vtkUnstructuredGrid*)_vtkObjects[0])->Modified();
+        ((vtkGeometryFilter*)_vtkObjects[1])->Modified();
+
+
+        if (deformation_ == 1)
+        {
+            ((vtkWarpVector*)_vtkObjects[5])->SetInputConnection(((vtkGeometryFilter*)_vtkObjects[1])->GetOutputPort());
+            ((vtkWarpVector*)_vtkObjects[5])->SetScaleFactor(scaleFactor_);
+            ((vtkWarpVector*)_vtkObjects[5])->Modified ();
+        }
+
+        if(contourType_ == 2)
+        {
+            if (deformation_ == 0)
+            {
+                ((vtkContourFilter*)_vtkObjects[2])->SetInputData(((vtkGeometryFilter*)_vtkObjects[1])->GetOutput());
+            }
+            else
+            {
+                ((vtkContourFilter*)_vtkObjects[2])->SetInputData(((vtkWarpVector*)_vtkObjects[5])->GetOutput());
+            }
+            ((vtkContourFilter*)_vtkObjects[2])->GenerateValues(contourLevel_, _source->scalarRange[scalarIndex][0], _source->scalarRange[scalarIndex][1]);
+            ((vtkContourFilter*)_vtkObjects[2])->Modified();
+            ((vtkContourFilter*)_vtkObjects[2])->Update();
+
+            if(_source->scalarRange[scalarIndex][0]==_source->scalarRange[scalarIndex][1])
+            {
+               ((vtkDataSetMapper*)_vtkObjects[4])->SetInputConnection(((vtkGeometryFilter*)_vtkObjects[1])->GetOutputPort());
+            }
+            else
+            {
+               ((vtkDataSetMapper*)_vtkObjects[4])->SetInputConnection(((vtkContourFilter*)_vtkObjects[2])->GetOutputPort());
+            }
+            ((vtkDataSetMapper*)_vtkObjects[4])->Modified();
+
+        }
+        else
+        {
+            conFilter_->SetInputData(((vtkGeometryFilter*)_vtkObjects[1])->GetOutput());
+            conFilter_->GenerateValues(contourLevel_, _source->scalarRange[scalarIndex][0], _source->scalarRange[scalarIndex][1]);
+            conFilter_->Modified();
+
+            if(_source->scalarRange[scalarIndex][0]==_source->scalarRange[scalarIndex][1])
+            {
+               ((vtkDataSetMapper*)_vtkObjects[4])->SetInputConnection(((vtkGeometryFilter*)_vtkObjects[1])->GetOutputPort());
+            }
+            else
+            {
+            if (deformation_ == 0)
+            {
+                ((vtkDataSetMapper*)_vtkObjects[4])->SetInputConnection(conFilter_->GetOutputPort());
+            }
+            else
+            {
+                ((vtkDataSetMapper*)_vtkObjects[4])->SetInputConnection(((vtkWarpVector*)_vtkObjects[5])->GetOutputPort());
+            }
+            }
+        }
+        ((vtkDataSetMapper*)_vtkObjects[4])->SetScalarModeToUsePointData();
+
+        ((vtkDataSetMapper*)_vtkObjects[4])->SetScalarRange(_source->scalarRange[scalarIndex][0], _source->scalarRange[scalarIndex][1]);
+        ((vtkDataSetMapper*)_vtkObjects[4])->Modified();
+
+        if(representFlag_ == 0)
+        {
+            (_unActor->GetProperty())->SetRepresentationToPoints();
+        }
+        else if(representFlag_ == 1)
+        {
+            (_unActor->GetProperty())->SetRepresentationToSurface();
+        }
+        else if (representFlag_ == 2)
+        {
+            (_unActor->GetProperty())->SetRepresentationToWireframe();
+        }
+
+        _unActor->Modified();
+
+        string temp = scalarName;
+        int length = temp.length();
+        string::size_type loc = temp.find( " ", 0 );
+        if( loc != string::npos )
+        {
+            temp.insert (loc,"\n");
+        }
+        string::size_type loc1 = temp.find_last_of( "-", length );
+        if( loc1 != string::npos )
+        {
+            temp.insert (loc1+1,"\n");
+        }
+        string::size_type loc2 = temp.find_last_of( "*", length );
+        if( loc2 != string::npos )
+        {
+            temp.insert (loc2+1,"\n");
+        }
+
+        if (scalarBarWidget_ != NULL)
+        {
+            scalarBarWidget_->GetScalarBarActor()->SetTitle(temp.c_str());
+        }
+    }
+    else
+    {
+        ErrorInfo(1, "Contour Display Not Created.");
+        return;
+    }
+}
+
+/*
+ * @brief: create scalar bar(创建缩放栏)
+ * @param: void
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISUnContour::CreateScalarBar()
+{
+    string temp = _source->GetScalarName(contourScalarIndex_);
+    int length = temp.length();
+    string::size_type loc = temp.find( " ", 0 );
+    if( loc != string::npos ) {
+        temp.insert (loc,"\n");
+    }
+    string::size_type loc1 = temp.find_last_of( "-", length );
+    if( loc1 != string::npos ) {
+        temp.insert (loc1+1,"\n");
+    }
+    string::size_type loc2 = temp.find_last_of( "*", length );
+    if( loc2 != string::npos ) {
+        temp.insert (loc2+1,"\n");
+    }
+
+    vtkScalarBarActor *barActor = vtkScalarBarActor::New();
+    if(contourLevel_<10)
+    {
+        barActor->SetNumberOfLabels(contourLevel_);
+    }
+    else
+    {
+        barActor->SetNumberOfLabels(10);
+    }
+        barActor->SetOrientationToVertical();
+        for (int s = temp.size(); s < 10; ++s)  temp.append(" ");   //add space to reduce font
+        barActor->SetTitle(temp.c_str());
+        barActor->SetLabelFormat("%1.2E");
+
+        barActor->GetTitleTextProperty()->SetFontFamilyToArial();
+        barActor->GetTitleTextProperty()->SetFontSize(6);
+        barActor->GetTitleTextProperty()->SetColor(0, 0, 0);
+        barActor->GetTitleTextProperty()->ItalicOff();
+
+        barActor->GetLabelTextProperty()->SetFontFamilyToArial();
+        barActor->GetLabelTextProperty()->SetFontSize(5);
+        barActor->GetLabelTextProperty()->SetColor(0, 0, 0);
+        barActor->GetLabelTextProperty()->ItalicOff();
+        barActor->SetLookupTable((vtkScalarsToColors*)contourLookupTable_);
+
+    vtkScalarBarRepresentation* rep = vtkScalarBarRepresentation::New();
+        rep->SetPosition(0.8, 0.1);
+        rep->SetPosition2(0.08, 0.8);
+        //rep->SetMaximumSize(10, 50);
+        rep->ProportionalResizeOff();
+        rep->SetScalarBarActor(barActor);
+
+    vtkScalarBarWidget *barWidget = vtkScalarBarWidget::New();
+    _renWin = _renderer->GetRenderWindow();
+        barWidget->SetInteractor(_renWin->GetInteractor());
+        barWidget->SetRepresentation(rep);
+        if(barEnable_ == 1)
+        {
+            barWidget->EnabledOn();
+        }
+        else
+        {
+            barWidget->EnabledOff();
+        }
+
+    scalarBarWidget_ = barWidget;
+    scalarBarWidget_->On();
+}
+
+/*
+ * @brief: show on scalar bar(显示缩放栏)
+ * @param: void
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISUnContour::ShowOnScalarBar()
+{
+    if (scalarBarWidget_!=NULL)
+    {
+        barEnable_ = 1;
+
+        scalarBarWidget_->EnabledOn();
+    }
+}
+
+/*
+ * @brief: show off scalar bar(关闭缩放栏)
+ * @param: void
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISUnContour::ShowOffScalarBar()
+{
+    if (scalarBarWidget_!=NULL)
+    {
+        barEnable_ = 0;
+
+        scalarBarWidget_->EnabledOff();
+    }
+}
+
+/*
+ * @brief: update scalar bar(更新缩放栏)
+ * @param: void
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISUnContour::UpdataScalarBar()
+{
+    if (scalarBarWidget_==NULL)
+    {
+        CreateScalarBar();
+    }else
+    {
+        vtkScalarBarActor *barActor=scalarBarWidget_->GetScalarBarActor();
+        barActor->SetLookupTable((vtkScalarsToColors*)contourLookupTable_);
+    }
+}
+
+/*
+ * @brief: modify scalar bar font(修改缩放栏字体)
+ * @param: font
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISUnContour::ModifyScalarBarFont(char* fontName)
+{
+    if (scalarBarWidget_!=NULL)
+    {
+        vtkScalarBarActor *barActor=scalarBarWidget_->GetScalarBarActor();
+
+        if (strcmp(fontName,"Arial")==0)
+        {
+            barActor->GetTitleTextProperty()->SetFontFamilyToArial();
+            barActor->GetLabelTextProperty()->SetFontFamilyToArial();
+        }
+        else if (strcmp(fontName,"Courier")==0)
+        {
+            barActor->GetTitleTextProperty()->SetFontFamilyToCourier();
+            barActor->GetLabelTextProperty()->SetFontFamilyToCourier();
+        }
+        else if (strcmp(fontName,"Times")==0)
+        {
+            barActor->GetTitleTextProperty()->SetFontFamilyToTimes();
+            barActor->GetLabelTextProperty()->SetFontFamilyToTimes();
+        }
+    }
+}
+
+/*
+ * @brief: modify scalar bar color(修改缩放栏字体颜色)
+ * @param: rgb
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISUnContour::ModifyScalarBarFontColor(double r, double g, double b)
+{
+    if (scalarBarWidget_!=NULL)
+    {
+        vtkScalarBarActor *barActor=scalarBarWidget_->GetScalarBarActor();
+        barActor->GetTitleTextProperty()->SetColor(r, g, b);
+        barActor->GetLabelTextProperty()->SetColor(r, g, b);
+    }
+}
+
+/*
+ * @brief: modify scalar bar title(修改缩放栏标题)
+ * @param: title
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISUnContour::ModifyScalarBarTitle(char *title)
+{
+    if (scalarBarWidget_!=NULL)
+    {
+        scalarBarWidget_->GetScalarBarActor()->SetTitle(title);
+        scalarBarWidget_->GetScalarBarActor()->GetTitleTextProperty()->SetFontSize(6);
+        scalarBarWidget_->GetScalarBarActor()->GetTitleTextProperty()->ItalicOff();
+    }
+}
+
+/*
+ * @brief: delete scalar bar(删除缩放栏)
+ * @param: void
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISUnContour::DeleteScalarBar()
+{
+    if (scalarBarWidget_!=NULL)
+    {
+        scalarBarWidget_->Delete();
+        scalarBarWidget_=NULL;
+    }
+}
+
+/*
+ * @brief: modify contour level (修改等高线标高)
+ * @param: level
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISUnContour::ModifyContourLevel(int level)
+{
+    if (level < 2)
+    {
+        ErrorInfo(0, "Contour Level must be within range: 2 to 50!, Using the Min Level 2 insteading!");
+
+        level = 2;
+    }
+    if(level>MAXLEVEL)
+    {
+        ErrorInfo(0, "Contour Level must be within range: 2 to 50!, Using the Max Level 50 insteading!");
+
+        level = MAXLEVEL;
+    }
+
+    contourLevel_ = level;
+
+    if(contourType_ == 2)
+    {
+        ((vtkContourFilter*)_vtkObjects[2])->GenerateValues(contourLevel_, scalarRange_[0], scalarRange_[1]);
+        ((vtkContourFilter*)_vtkObjects[2])->Modified();
+    }
+    else
+    {
+        conFilter_->GenerateValues(contourLevel_, scalarRange_[0], scalarRange_[1]);
+        conFilter_->Modified();
+    }
+
+    if (contourLookupTable_ != NULL)
+    {
+        if(contourType_ == 1)
+        {
+            contourLookupTable_->SetNumberOfColors(256);
+        }
+        else
+        {
+            contourLookupTable_->SetNumberOfColors(level);
+        }
+        contourLookupTable_->Modified();
+    }
+    if (scalarBarWidget_!=NULL)
+    {
+        if(level<10)
+        {
+            scalarBarWidget_->GetScalarBarActor()->SetNumberOfLabels(level);
+        }
+        else
+        {
+            scalarBarWidget_->GetScalarBarActor()->SetNumberOfLabels(10);
+        }
+    }
+}
+
+/*
+ * @brief: set contour type (修改等高线类型)
+ * @param: type
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISUnContour::SetContourType(int type)
+{
+    this->contourType_ = type;
+}
+
+/*
+ * @brief: set deformation (设置变形)
+ * @param: flag
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISUnContour::SetDeformation(int flag)
+{
+    this->deformation_ = flag;
+
+    //cout<<"test flag::" << deformation_<<endl;
+}
+
+/*
+ * @brief: Modify Scale Factor (修改缩放因子)
+ * @param: value
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISUnContour::ModifyScaleFactor(double value)
+{
+    if ( _vtkObjects[5] != NULL )
+    {
+        scaleFactor_ = value;
+        ((vtkWarpVector*)_vtkObjects[5])->SetScaleFactor(scaleFactor_);
+        ((vtkWarpVector*)_vtkObjects[5])->Modified();
+    }
+}
+
+/*
+ * @brief: Modify Contour Representation (修改轮廓表示)
+ * @param: flag
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISUnContour::ModifyContourRepresentation(int flag)
+{
+    if ( _unActor != NULL )
+    {
+        if (flag == 0)
+        {
+            representFlag_ = 0;
+
+            (_unActor->GetProperty())->SetRepresentationToPoints();
+
+        }
+        else if (flag == 1)
+        {
+            representFlag_ = 1;
+
+            (_unActor->GetProperty())->SetRepresentationToSurface();
+        }
+        else if (flag == 2)
+        {
+            representFlag_ = 2;
+
+            (_unActor->GetProperty())->SetRepresentationToWireframe();
+        }
+        else
+        {
+            ErrorInfo(1, "Wrong Flag!");
+            return;
+        }
+    }
+    else
+    {
+        ErrorInfo(1, "The Actor is not Created");
+        return;
+    }
+}
+
+/*
+ * @brief: Get Warp Scale Factor (获取扭曲比例因子)
+ * @param: vector
+ * @ret: factor
+ * @birth: created by czm in 20230410
+ */
+double vtkVISUnContour::GetWarpScaleFactor(char* vectorName)
+{
+    if(_source == NULL)
+    {
+        return 0;
+    }
+
+    double *b = _source->GetSourceBounds();
+
+    double  l = sqrt((b[1]-b[0])*(b[1]-b[0]) + (b[3]-b[2])*(b[3]-b[2]) + (b[5]-b[4])*(b[5]-b[4]));
+
+    int vectorIndex = -1;
+    if (!string(vectorName).empty ())
+    {
+        vectorIndex = _source->GetVectorIndex(vectorName);
+    }
+
+    if(vectorIndex == -1)
+    {
+        vectorIndex = 0;
+    }
+
+    double *r;
+    if(_source->vectorSource[vectorIndex]->GetDataSize() != 0)
+    {
+        r = (_source->vectorSource[vectorIndex])->GetRange(-1);
+    }
+    else
+    {
+        r = (_source->cellVectorSource_[vectorIndex])->GetRange(-1);
+    }
+
+    scaleFactor_ = l/(r[1]-r[0])/10;
+
+    return scaleFactor_;
+}
+
+/*
+ * @brief: Set Contour Level (设置等高线标高)
+ * @param: level
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISUnContour::SetContourLevel(int level)
+{
+    this->contourLevel_ = level;
+}
+
+/*
+ * @brief: Clipping On Contour Display (打开轮廓显示上的剪裁)
+ * @param: void
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISUnContour::ClippingOnContourDisplay()
+{
+    if (_vtkObjects != NULL)
+    {
+        ((vtkUnstructuredGrid*)_vtkObjects[0])->Modified();
+        ((vtkGeometryFilter*)_vtkObjects[1])->Modified();
+
+        if(conFilter_ != NULL)
+        {
+            conFilter_->SetInputData(((vtkGeometryFilter*)_vtkObjects[1])->GetOutput());
+            conFilter_->GenerateValues(contourLevel_,scalarRange_[0], scalarRange_[1]);
+            conFilter_->ClippingOn();
+            conFilter_->Modified();
+        }
+
+        if (deformation_ == 0)
+        {
+            ((vtkDataSetMapper*)_vtkObjects[4])->SetInputConnection(conFilter_->GetOutputPort());
+        }
+        else
+        {
+            ((vtkDataSetMapper*)_vtkObjects[4])->SetInputConnection(((vtkWarpVector*)_vtkObjects[5])->GetOutputPort());
+        }
+
+        ((vtkDataSetMapper*)_vtkObjects[4])->SetScalarRange(scalarRange_[0], scalarRange_[1]);
+        ((vtkDataSetMapper*)_vtkObjects[4])->Modified();
+
+        if(representFlag_ == 0)
+        {
+            (_unActor->GetProperty())->SetRepresentationToPoints();
+        }
+        else if(representFlag_ == 1)
+        {
+            (_unActor->GetProperty())->SetRepresentationToSurface();
+        }
+        else if (representFlag_ == 2)
+        {
+            (_unActor->GetProperty())->SetRepresentationToWireframe();
+        }
+
+        _unActor->Modified();
+    }
+}
+
+/*
+ * @brief: Clipping Off Contour Display (关闭轮廓显示上的剪裁)
+ * @param: void
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISUnContour::ClippingOffContourDisplay()
+{
+    if (_vtkObjects != NULL)
+    {
+        ((vtkUnstructuredGrid*)_vtkObjects[0])->Modified();
+        ((vtkGeometryFilter*)_vtkObjects[1])->Modified();
+
+        if(conFilter_ != NULL)
+        {
+            conFilter_->SetInputData(((vtkGeometryFilter*)_vtkObjects[1])->GetOutput());
+            conFilter_->GenerateValues(contourLevel_,scalarRange_[0], scalarRange_[1]);
+            conFilter_->ClippingOff();
+            conFilter_->Modified();
+        }
+
+        if (deformation_ == 0)
+        {
+            ((vtkDataSetMapper*)_vtkObjects[4])->SetInputConnection(conFilter_->GetOutputPort());
+        }
+        else
+        {
+            ((vtkDataSetMapper*)_vtkObjects[4])->SetInputConnection(((vtkWarpVector*)_vtkObjects[5])->GetOutputPort());
+        }
+
+        ((vtkDataSetMapper*)_vtkObjects[4])->SetScalarRange(scalarRange_[0], scalarRange_[1]);
+        ((vtkDataSetMapper*)_vtkObjects[4])->Modified();
+
+        if(representFlag_ == 0)
+        {
+            (_unActor->GetProperty())->SetRepresentationToPoints();
+        }
+        else if(representFlag_ == 1)
+        {
+            (_unActor->GetProperty())->SetRepresentationToSurface();
+        }
+        else if (representFlag_ == 2)
+        {
+            (_unActor->GetProperty())->SetRepresentationToWireframe();
+        }
+
+        _unActor->Modified();
+    }
+}
+
+/*
+ * @brief: Modify Display Scalar Range (修改显示标量范围)
+ * @param: min and max range
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISUnContour::ModifyDisplayScalarRange(double min, double max)
+{
+    if (_vtkObjects != NULL)
+    {
+        ((vtkUnstructuredGrid*)_vtkObjects[0])->Modified();
+        ((vtkGeometryFilter*)_vtkObjects[1])->Modified();
+
+        if (deformation_ == 1)
+        {
+            ((vtkWarpVector*)_vtkObjects[5])->SetInputConnection(((vtkGeometryFilter*)_vtkObjects[1])->GetOutputPort());
+            ((vtkWarpVector*)_vtkObjects[5])->SetScaleFactor(scaleFactor_);
+            ((vtkWarpVector*)_vtkObjects[5])->Modified ();
+        }
+
+        if(contourType_ == 2)
+        {
+            if (deformation_ == 0)
+            {
+                ((vtkContourFilter*)_vtkObjects[2])->SetInputData(((vtkGeometryFilter*)_vtkObjects[1])->GetOutput());
+            }
+            else
+            {
+                ((vtkContourFilter*)_vtkObjects[2])->SetInputData(((vtkWarpVector*)_vtkObjects[5])->GetOutput());
+            }
+
+            ((vtkContourFilter*)_vtkObjects[2])->GenerateValues(contourLevel_, min, max);
+            ((vtkContourFilter*)_vtkObjects[2])->Modified();
+            ((vtkContourFilter*)_vtkObjects[2])->Update();
+
+            ((vtkDataSetMapper*)_vtkObjects[4])->SetInputConnection(((vtkContourFilter*)_vtkObjects[2])->GetOutputPort());
+        }
+        else
+        {
+            conFilter_->SetInputData(((vtkGeometryFilter*)_vtkObjects[1])->GetOutput());
+            conFilter_->GenerateValues(contourLevel_, min, max);
+            conFilter_->Modified();
+
+            if (deformation_ == 0)
+            {
+                ((vtkDataSetMapper*)_vtkObjects[4])->SetInputConnection(conFilter_->GetOutputPort());
+            }
+            else
+            {
+                ((vtkDataSetMapper*)_vtkObjects[4])->SetInputConnection(((vtkWarpVector*)_vtkObjects[5])->GetOutputPort());
+            }
+        }
+
+        ((vtkDataSetMapper*)_vtkObjects[4])->SetScalarRange(min, max);
+        ((vtkDataSetMapper*)_vtkObjects[4])->Modified();
+
+        if(representFlag_ == 0)
+        {
+            (_unActor->GetProperty())->SetRepresentationToPoints();
+        }
+        else if(representFlag_ == 1)
+        {
+            (_unActor->GetProperty())->SetRepresentationToSurface();
+        }
+        else if (representFlag_ == 2)
+        {
+            (_unActor->GetProperty())->SetRepresentationToWireframe();
+        }
+
+        _unActor->Modified();
+    }
+}
+
+/*
+ * @brief: Set Contour Representation Flag (设置轮廓表示标志)
+ * @param: flag
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISUnContour::SetContourRepresentationFlag(int flag)
+{
+    if(flag == 0 || flag == 1 || flag==2)
+    {
+        this->representFlag_ = flag;
+    }
+    else
+    {
+            ErrorInfo(1, "Wrong Flag!");
+            return;
+    }
+}
+
+/*
+ * @brief: Set Scalar Bar Enable(设置标量栏启用)
+ * @param: bool
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISUnContour::SetScalarBarEnable(bool enable)
+{
+    this->barEnable_ = enable;
+}
+
+/*
+ * @brief: Set Warp Scale Factor(设置扭曲比例因子)
+ * @param: value
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISUnContour::SetWarpScaleFactor(double value)
+{
+    this->scaleFactor_ = value;
+}
+
+/*
+ * @brief: DeleteObjects(删除对象)
+ * @param: void
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISUnContour::DeleteObjects()
+{
+    if (_unActor != 0)
+    {
+        if(_renderer != 0)
+        {
+            _renderer->RemoveActor(_unActor);
+        }
+        _unActor->Delete();
+        _unActor = 0;
+    }
+    if (_vtkObjects != 0)
+    {
+        if (_vtkObjects[0] != 0)
+        {
+            _vtkObjects[0]->Delete();
+            _vtkObjects[0] = 0;
+        }
+        if (_vtkObjects[2] != 0)
+        {
+            _vtkObjects[2]->Delete();
+            _vtkObjects[2] = 0;
+        }
+        if (_vtkObjects[4] != 0)
+        {
+            _vtkObjects[4]->Delete();
+            _vtkObjects[4] = 0;
+        }
+        if (_vtkObjects[5] != 0)
+        {
+            _vtkObjects[5]->Delete();
+            _vtkObjects[5] = 0;
+        }
+        //_vtkObjects[1] _vtkObjects[3] needn't be delete explicitly.
+    }
+}
+
+/*
+ * @brief: get scalar range(获取标量范围)
+ * @param: range and scalar
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISUnContour::GetScalarRange(double *range, char*ScalarName)
+{
+    if (ScalarName == NULL)
+    {
+        range[0] = scalarRange_[0];
+        range[1] = scalarRange_[1];
+    }else
+    {
+        range[0] = _source->GetScalarRange(ScalarName)[0];
+        range[1] = _source->GetScalarRange(ScalarName)[1];
+    }
+
+}
+
+/*
+ * @brief: Scalar Off Display(关闭标量显示)
+ * @param: void
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISUnContour::ScalarOffDisplay()
+{
+    if (_vtkObjects[4] != NULL)
+    {
+        ((vtkDataSetMapper*)_vtkObjects[4])->ScalarVisibilityOff();
+        ((vtkDataSetMapper*)_vtkObjects[4])->Modified();
+
+        if(representFlag_ == 0)
+        {
+            (_unActor->GetProperty())->SetRepresentationToPoints();
+        }
+        else if(representFlag_ == 1)
+        {
+            (_unActor->GetProperty())->SetRepresentationToSurface();
+        }
+        else if (representFlag_ == 2)
+        {
+            (_unActor->GetProperty())->SetRepresentationToWireframe();
+        }
+
+        (_unActor->GetProperty())->SetColor(0,0,1);
+
+        _unActor->Modified();
+    }
+    ShowOffScalarBar();
+}
+
+/*
+ * @brief: Scalar On Display(打开标量显示)
+ * @param: void
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISUnContour::ScalarOnDisplay()
+{
+    if (_vtkObjects[4] != NULL)
+    {
+        ((vtkDataSetMapper*)_vtkObjects[4])->ScalarVisibilityOn();
+        ((vtkDataSetMapper*)_vtkObjects[4])->Modified();
+
+        if(representFlag_ == 0)
+        {
+            (_unActor->GetProperty())->SetRepresentationToPoints();
+        }
+        else if(representFlag_ == 1)
+        {
+            (_unActor->GetProperty())->SetRepresentationToSurface();
+        }
+        else if (representFlag_ == 2)
+        {
+            (_unActor->GetProperty())->SetRepresentationToWireframe();
+        }
+
+        _unActor->Modified();
+    }
+    ShowOnScalarBar();
+}
+
+/*
+ * @brief: Get Scalar Index(获取标量数值)
+ * @param: void
+ * @ret: index
+ * @birth: created by czm in 20230410
+ */
+int vtkVISUnContour::GetScalarIndex()
+{
+    return scalarIndex_;
+}
+
+/*
+ * @brief: Get Scalar name(获取标量名)
+ * @param: void
+ * @ret: name
+ * @birth: created by czm in 20230410
+ */
+string vtkVISUnContour::GetScalarName()
+{
+    const char* str = _source->GetScalarName(scalarIndex_);
+    string name = (char*)str;
+    return name;
+}
+
+/*
+ * @brief: Get Dat Source(获取数据源)
+ * @param: void
+ * @ret: source
+ * @birth: created by czm in 20230410
+ */
+vtkVISUnstructuredGridSource* vtkVISUnContour::GetDatSource()
+{
+    if (_source != NULL)
+    {
+        return _source;
+    }
+}

+ 114 - 0
CAE_Solution/src/VTK/visualization_VTK/vtkvisuncontour.h

@@ -0,0 +1,114 @@
+#ifndef VTKVISUNCONTOUR_H
+#define VTKVISUNCONTOUR_H
+#include <iostream>
+#include <string>
+#include <vtkObjectFactory.h>
+#include "vtkVISManager.h"
+#include "vtkVISUnstructuredGridManager.h"
+#include <vtkGeometryFilter.h>
+#include <vtkPolyDataNormals.h>
+#include <vtkFloatArray.h>
+#include <vtkWarpVector.h>
+#include <vtkVectorDot.h>
+#include <vtkScalarBarWidget.h>
+#include <vtkScalarBarActor.h>
+#include <vtkLookupTable.h>
+#include <vtkTextProperty.h>
+#include <vtkPointData.h>
+#include <vtkCellData.h>
+#include <vtkDataSetMapper.h>
+#include <vtkScalarBarRepresentation.h>
+#include <vtkContourFilter.h>
+#include <vtkBandedPolyDataContourFilter.h>
+#include <vtkUnstructuredGrid.h>
+#include <vtkActor.h>
+#include <vtkDoubleArray.h>
+#include "vtkVISUnstructuredGridSource.h"
+#include <vtkProperty.h>
+#include <vtkRenderer.h>
+#include <vtkRenderWindow.h>
+#include <vtkCellCenters.h>
+using namespace std;
+
+class vtkVISUnContour : public vtkVISUnstructuredGridManager
+{
+public:
+    static vtkVISUnContour *New();
+    vtkVISUnContour();
+
+    ~vtkVISUnContour();
+
+    void CreateContourDisplay(char* scalarName);
+    void ModifyContourDisplay(char* scalarName);
+    void CreateContourDisplay(char* scalarName,char* vectorName);
+    void ModifyContourDisplay(char* scalarName,char* vectorName);
+    void CreateScalarBar();
+    void ShowOnScalarBar();
+    void ShowOffScalarBar();
+    void ModifyScalarBarFont(char *fontName);
+    void ModifyScalarBarFontColor(double r, double g, double b);
+    void ModifyScalarBarTitle(char *title);
+    void DeleteScalarBar();
+    void ModifyContourLevel(int level);
+    void SetScalarBarEnable(bool enable);
+    void UpdataScalarBar();
+
+    //---------------------------------------------
+    //0 -- banded
+    //1 -- continuous
+    //2 -- lines
+    void SetContourType(int type);
+    void ModifyContourDisplayType();
+    void SetDeformation(int flag);
+    void ModifyScaleFactor(double value);
+    void SetContourRepresentationFlag(int flag);
+    void ModifyContourRepresentation(int flag);
+    double GetWarpScaleFactor(char* vectorName);
+    void SetWarpScaleFactor(double value);
+    void SetContourLevel(int level);
+    void ClippingOnContourDisplay();
+    void ClippingOffContourDisplay();
+    void ModifyDisplayScalarRange(double min, double max);
+    //reimplement parent class method.
+    void DeleteObjects();
+    void ScalarOffDisplay();
+    void ScalarOnDisplay();
+    string GetScalarName();
+
+    int GetScalarIndex();
+    void GetScalarRange(double *range, char* name = NULL);
+
+    vtkVISUnstructuredGridSource* GetDatSource();
+protected:
+    vtkLookupTable* contourLookupTable_;
+    vtkScalarBarWidget* scalarBarWidget_;
+
+    int scalarIndex_;
+    int contourScalarIndex_;
+    int vectorIndex_;
+    int contourLevel_;
+    double scaleFactor_;
+    double scalarRange_[2];
+    vtkWarpVector* csdVectorWarp_;
+    vtkBandedPolyDataContourFilter* conFilter_;
+
+    //---------------------------------------------
+    //0 -- banded
+    //1 -- continuous
+    //2 -- lines
+    int contourType_;
+    // 0 -- no deformation
+    // 1 -- deformation
+    int deformation_;
+    // 0 -- points
+    // 1 -- surface
+    // 2 -- wireframe
+    int representFlag_;
+    // 0 -- off
+    // 1 -- on
+    bool barEnable_;
+
+private:
+};
+
+#endif // VTKVISUNCONTOUR_H

+ 838 - 0
CAE_Solution/src/VTK/visualization_VTK/vtkvisxyplot.cpp

@@ -0,0 +1,838 @@
+#include "vtkvisxyplot.h"
+#include "vtkRenderWindowInteractor.h"
+#include "vtkAxisActor2D.h"
+#include <vtkRenderer.h>
+
+vtkStandardNewMacro(vtkVISXYPlot)
+
+/*
+ * @brief: the constructor
+ * @param:
+ * @ret:
+ * @birth: created by czm in 20230410
+ */
+vtkVISXYPlot::vtkVISXYPlot()
+{
+    XYPlot_ = NULL;
+
+    legend_ = NULL;
+
+    plotNumber_ = 0;
+
+    xValues[0] = "Index";
+    xValues[1] = "ArcLength";
+    xValues[2] = "NormalizedArcLength";
+    xValues[3] = "Value";
+}
+
+/*
+ * @brief: the destructor
+ * @param:
+ * @ret:
+ * @birth: created by czm in 20230410
+ */
+vtkVISXYPlot::~vtkVISXYPlot()
+{
+    if(XYPlot_ != NULL)
+    {
+        if(_renderer != NULL)
+        {
+            _renderer->RemoveActor2D(XYPlot_);
+        }
+        XYPlot_->Delete();
+    }
+    XYPlot_ = NULL;
+
+    if(legend_ != NULL)
+    {
+        if(_renderer != NULL)
+        {
+            _renderer->RemoveActor2D(legend_);
+        }
+        legend_->Delete();
+    }
+    legend_ = NULL;
+
+}
+
+/*
+ * @brief: create a blank xy plot actor (创造一个空白的xy坐标的actor)An actor XYPlotActor_ will create and save as protected variable.
+ * @param: void
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISXYPlot::CreateBlankXYPlotActor()
+{
+    XYPlot_ = vtkXYPlotActor::New();
+
+    XYPlot_->SetXLabelFormat("%.1lf");
+    XYPlot_->SetYLabelFormat("%1.1E");
+
+    XYPlot_->LegendOff();
+
+    XYPlot_->SetNumberOfXMinorTicks(4);
+    XYPlot_->SetNumberOfYMinorTicks(4);
+
+    XYPlot_->AdjustTitlePositionOff();
+    XYPlot_->SetAdjustXLabels(1);
+    XYPlot_->SetAdjustYLabels(1);
+
+    XYPlot_->PlotLinesOn();
+    XYPlot_->PlotPointsOff();
+
+    vtkTextProperty *prop = XYPlot_->GetTitleTextProperty();
+    prop->SetFontFamilyToTimes();
+    prop->SetFontSize(5);
+    prop->ShadowOff();
+    prop->ItalicOff();
+    prop->SetColor((XYPlot_->GetProperty())->GetColor());
+
+    XYPlot_->SetAxisTitleTextProperty(prop);
+    XYPlot_->SetAxisLabelTextProperty(prop);
+
+    if (_renderer != NULL)
+    {
+        _renderer->AddActor2D(XYPlot_);
+    }
+}
+
+/*
+ * @brief: Change glyph using on plot point to specified type(将绘图点上使用的图示符更改为指定类型)
+ * @param: index and below type(point /cross square/square/Other string will turn the plot point off)
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISXYPlot::SetGlyphTypeTo(int index, char* type)
+{
+    vtkSphereSource *vertexGlyph = vtkSphereSource::New();
+    vertexGlyph->Update();
+
+    vtkCubeSource *cube = vtkCubeSource::New();
+    cube->Update();
+    vtkConeSource *triangle = vtkConeSource::New();
+    triangle->SetDirection(0, 1, 0);
+    triangle->Update();
+    //vtkLineSource *none = vtkLineSource::New();
+
+    vtkGlyphSource2D *none = vtkGlyphSource2D::New();
+    none->SetGlyphTypeToNone();
+    none->Update();
+    //--------------------------------
+    vtkSphereSource *vertexGlyph2 = vtkSphereSource::New();
+    vertexGlyph2->SetCenter(0, 0.5, 0);
+    vertexGlyph2->Update();
+
+    vtkCubeSource *cube2 = vtkCubeSource::New();
+    cube2->SetCenter(0, 0.5, 0);
+    cube2->Update();
+
+    vtkConeSource *triangle2 = vtkConeSource::New();
+    triangle2->SetDirection(0, 1, 0);
+    triangle2->SetCenter(0, 0.5, 0);
+    triangle2->Update();
+
+    vtkLineSource *none2 = vtkLineSource::New();
+    none2->SetPoint1(-0.25, 0.25, 0);
+    none2->SetPoint2(0.25, 0.25, 0);
+    none2->Update();
+
+
+    if (XYPlot_ != NULL)
+    {
+        //        XYPlot_->PlotPointsOn();
+        //        XYPlot_->SetGlyphSize(0.015);
+        //
+        //        if (strcmp(type, "Point") == 0)
+        //        {
+        //            XYPlot_->SetPlotSymbol(index, vertexGlyph->GetOutput());
+        //        }
+        //        else if (strcmp(type, "Square") == 0)
+        //        {
+        //            XYPlot_->SetPlotSymbol(index, cube->GetOutput());
+        //        }
+        //        else if (strcmp(type, "Triangle") == 0)
+        //        {
+        //            XYPlot_->SetPlotSymbol(index, triangle->GetOutput());
+        //        }
+        //        else
+        //        {
+        //            XYPlot_->SetPlotSymbol(index, none->GetOutput());
+        //        }
+    }
+    if(legend_ != NULL)
+    {
+        if (strcmp(type, "Point") == 0)
+        {
+            legend_->SetEntrySymbol(index,vertexGlyph2->GetOutput());
+        }
+        else if (strcmp(type, "Square") == 0)
+        {
+            legend_->SetEntrySymbol(index, cube2->GetOutput());
+        }
+        else if (strcmp(type, "Triangle") == 0)
+        {
+            legend_->SetEntrySymbol(index, triangle2->GetOutput());
+        }
+        else
+        {
+            legend_->SetEntrySymbol(index, none2->GetOutput());
+        }
+    }
+    XYPlot_->Modified();
+    /*XYPlot_->Modified();
+    legend_->Modified ();*/
+}
+
+/*
+ * @brief: Add data via vtkDataSet object(通过vtkDataSet对象添加数据)
+ * @param: data
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISXYPlot::AddXYPlotData(vtkDataSet *data)
+{
+    if (XYPlot_ != NULL)
+    {
+        XYPlot_->AddDataSetInput(data);
+    }
+}
+
+/*
+ * @brief: remove data(移除数据)
+ * @param: data
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISXYPlot::RemoveXYPlotData(vtkDataSet *data)
+{
+    if (XYPlot_ != NULL)
+    {
+        XYPlot_->RemoveDataSetInput(data);
+    }
+}
+
+/*
+ * @brief: Set X's label number(设置X的标签编号,设置将在x轴上放置的标签数量)
+ * @param: num
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISXYPlot::SetXLabelsNumber(int num)
+{
+    if (XYPlot_ != NULL)
+    {
+        XYPlot_->SetNumberOfXLabels(num);
+    }
+}
+
+/*
+ * @brief: Set Y's label number(设置Y的标签编号,设置将在y轴上放置的标签数量)
+ * @param: num
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISXYPlot::SetYLabelsNumber(int num)
+{
+    if (XYPlot_ != NULL)
+    {
+        XYPlot_->SetNumberOfYLabels(num);
+    }
+}
+
+/*
+ * @brief: Set position coordinate(设置位置坐标)
+ * @param:  a b
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISXYPlot::SetPositionCoordinate(double a, double b)
+{
+    if (XYPlot_ != NULL)
+    {
+        XYPlot_->SetPosition(a, b);
+    }
+}
+
+/*
+ * @brief: Set position2 coordinate(设置位置坐标)
+ * @param:  a b
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISXYPlot::SetPosition2Coordinate(double a, double b)
+{
+    if (XYPlot_ != NULL)
+    {
+        XYPlot_->SetPosition2(a, b);
+    }
+}
+
+/*
+ * @brief: Set x value(设置x值)
+ * @param: value
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISXYPlot::SetXValuesTo(char* xValue)
+{
+    int index = GetXValueIndex(xValue);
+
+    if (XYPlot_ != NULL)
+    {
+        XYPlot_->SetXValues(index);
+    }
+}
+
+/*
+ * @brief: Set figure title(设置xy绘图标题)
+ * @param: title
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISXYPlot::SetXYPlotTitle(char* title)
+{
+    if (XYPlot_ != NULL)
+    {
+        XYPlot_->SetTitle(title);
+    }
+}
+
+/*
+ * @brief: Set plot label title on x axis(在x轴上设置绘图标签标题)
+ * @param: xtitle
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISXYPlot::SetXYPlotXTitle(char* xTitle)
+{
+    if (XYPlot_ != NULL)
+    {
+        XYPlot_->SetXTitle(xTitle);
+    }
+}
+
+/*
+ * @brief: Set plot label title on y axis(在y轴上设置绘图标签标题)
+ * @param: ytitle
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISXYPlot::SetXYPlotYTitle(char* yTitle)
+{
+    if (XYPlot_ != NULL)
+    {
+        XYPlot_->SetYTitle(yTitle);
+    }
+}
+
+/*
+ * @brief: Set color for drawing the figure (Axis, title, labels)(设置绘制图形的颜色)
+ * @param: rgb
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISXYPlot::SetXYPlotActorColor(double r, double g, double b)
+{
+    if (XYPlot_ != NULL)
+    {
+        (XYPlot_->GetProperty())->SetColor(r, g, b);
+        (XYPlot_->GetTitleTextProperty())->SetColor(r, g, b);
+
+        XYPlot_->SetAxisTitleTextProperty(XYPlot_->GetTitleTextProperty());
+        XYPlot_->SetAxisLabelTextProperty(XYPlot_->GetTitleTextProperty());
+    }
+}
+
+/*
+ * @brief: Set plot legend label(设置绘图图例标签)
+ * @param: index and label
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISXYPlot::SetXYPlotLable(int index, char* label)
+{
+   /*
+   if (XYPlot_ != NULL)
+    {
+        XYPlot_->SetPlotLabel(index, label);
+    }
+    */
+
+    if(legend_ != NULL)
+    {
+        legend_->SetEntryString(index, label);
+    }
+}
+
+/*
+ * @brief: Set plotting color (lines and plot points)(设置打印颜色(线和打印点))
+ * @param: index and rgb
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISXYPlot::SetXYPlotColor(int index, double r, double g, double b)
+{
+    if (XYPlot_ != NULL)
+    {
+        XYPlot_->GetLegendActor()->SetEntryColor(index, r, g, b);
+        XYPlot_->Modified();
+    }
+    if(legend_ != NULL)
+    {
+        legend_->SetEntryColor(index, r, g, b);
+    }
+}
+
+/*
+ * @brief: Add data for plotting (via vtkDataObject)(添加用于打印的数据)
+ * @param: index and dataobj
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISXYPlot::AddXYPlotDataObject(int index, vtkDataObject *dataObj)
+{
+    if (XYPlot_ != NULL)
+    {
+        XYPlot_->AddDataObjectInput(dataObj);
+        XYPlot_->SetDataObjectXComponent(index, 0);
+        XYPlot_->SetDataObjectYComponent(index, 1);
+    }
+}
+
+/*
+ * @brief: Remove plotting data(删除打印数据)
+ * @param: dataobj
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISXYPlot::RemoveXYPlotDataObject( vtkDataObject *dataObj)
+{
+    if (XYPlot_ != NULL)
+    {
+        XYPlot_->RemoveDataObjectInput(dataObj);
+    }
+}
+
+/*
+ * @brief: Set x range in plot(在绘图中设置x范围)
+ * @param: range
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISXYPlot::SetPlotXRange(double min, double max)
+{
+    if (XYPlot_ != NULL)
+    {
+        XYPlot_->SetXRange(min, max);
+    }
+}
+
+/*
+ * @brief: Set y range in plot(在绘图中设置y范围)
+ * @param: range
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISXYPlot::SetPlotYRange(double min, double max)
+{
+    if (XYPlot_ != NULL)
+    {
+        XYPlot_->SetYRange(min, max);
+    }
+}
+
+/*
+ * @brief: Get X Value Index(获取X值索引)
+ * @param: tyep(index/arclength/normalizedarclength/value)
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+int vtkVISXYPlot::GetXValueIndex(char* type)
+{
+    for (int i=0; i<4; i++)
+    {
+        if( strcmp(type, xValues[i].c_str()) == 0)
+        {
+            return i;
+        }
+    }
+    ErrorInfo(1, "Error x value!");
+
+    return 0;
+}
+
+/*
+ * @brief: Modify Plot Line Width(修改打印线宽)
+ * @param: value
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISXYPlot::ModifyPlotLineWidth(double value)
+{
+    if (XYPlot_ != NULL)
+    {
+        if (value == 0)
+        {
+            XYPlot_->PlotLinesOff();
+            (XYPlot_->GetProperty())->SetLineWidth(0);
+        }
+        else
+        {
+            XYPlot_->PlotLinesOn();
+            (XYPlot_->GetProperty())->SetLineWidth(value);
+        }
+    }
+}
+
+/*
+ * @brief: Set XYPlot Legend Position(设置XYPlot图例位置)
+ * @param: a---x  b---y
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISXYPlot::SetXYPlotLegendPosition(double a, double b)
+{
+    if (legend_ != NULL)
+    {
+        legend_->SetPosition(a, b);
+    }
+}
+
+/*
+ * @brief: Set XYPlot Legend Position2(设置XYPlot图例位置2)
+ * @param: a---x  b---y
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISXYPlot::SetXYPlotLegendPosition2(double a, double b)
+{
+    if (legend_ != NULL)
+    {
+        legend_->SetPosition2(a, b);
+    }
+}
+
+/*
+ * @brief: Set XYPlot Title Position(设置XYPlot标题位置)
+ * @param: a---x  b---y
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISXYPlot::SetXYPlotTitlePosition(double a, double b)
+{
+    if (XYPlot_ != NULL)
+    {
+        XYPlot_->SetTitlePosition(a, b);
+    }
+}
+
+/*
+ * @brief: Get XYPlot Color(获取XYPlot颜色)
+ * @param: index
+ * @ret: color
+ * @birth: created by czm in 20230410
+ */
+double* vtkVISXYPlot::GetXYPlotColor(int index)
+{
+    if (XYPlot_ != NULL)
+    {
+         return XYPlot_->GetPlotColor(index);
+    }
+    return NULL;
+}
+
+/*
+ * @brief: Get XYPlot line width(获取XYPlot线宽)
+ * @param: void
+ * @ret: line width
+ * @birth: created by czm in 20230410
+ */
+double vtkVISXYPlot::GetPlotLineWidth()
+{
+    if (XYPlot_ != NULL)
+    {
+         return (XYPlot_->GetProperty())->GetLineWidth();
+    }
+    return -1;
+}
+
+/*
+ * @brief: set XYPlot glyph size(设置XYPlot字形大小)
+ * @param: size
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISXYPlot::SetXYPlotGlyphSize(double size)
+{
+    if (XYPlot_ != NULL)
+    {
+        XYPlot_->SetGlyphSize(size);
+    }
+}
+
+/*
+ * @brief: get XYPlot glyph size(获取XYPlot字形大小)
+ * @param: void
+ * @ret: size
+ * @birth: created by czm in 20230410
+ */
+double vtkVISXYPlot::GetXYPlotGlyphSize()
+{
+    if (XYPlot_ != NULL)
+    {
+         return XYPlot_->GetGlyphSize();
+    }
+
+    return 0;
+}
+
+/*
+ * @brief: get XYPlot label(获取XYPlot标签)
+ * @param: index
+ * @ret: const char*
+ * @birth: created by czm in 20230410
+ */
+const char* vtkVISXYPlot::GetXYPlotLable(int index)
+{
+   /*
+   if (XYPlot_ != NULL)
+    {
+         return XYPlot_->GetPlotLabel(index);
+    }
+    */
+    if(legend_ != NULL)
+    {
+        return legend_->GetEntryString(index);
+    }
+
+    return NULL;
+}
+
+/*
+ * @brief: remove XYPlot all input(移除XYPlot所有输入)
+ * @param: void
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISXYPlot::RemoveXYPlotAllInputs()
+{
+    if (XYPlot_ != NULL)
+    {
+         XYPlot_->RemoveAllDataSetInputConnections();
+    }
+}
+
+/*
+ * @brief: set XYPlot number(设置XYPlot编号)
+ * @param: num
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISXYPlot::SetXYPlotNumber(int num)
+{
+    plotNumber_ = num;
+
+    /*
+    if (XYPlot_ != NULL)
+    {
+         (XYPlot_->GetLegendActor())->SetNumberOfEntries(num);
+    }
+    */
+    if(legend_ != NULL)
+    {
+        return legend_->SetNumberOfEntries(num);
+    }
+}
+
+/*
+ * @brief: get XYPlot number(获取XYPlot编号)
+ * @param: void
+ * @ret: num
+ * @birth: created by czm in 20230410
+ */
+int vtkVISXYPlot::GetXYPlotNumber()
+{
+    return this->plotNumber_;
+}
+
+/*
+ * @brief: remove XYPlot actor(移除XYPlot actor)
+ * @param: void
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISXYPlot::RemoveXYPlotActor()
+{
+    if (_renderer != NULL && XYPlot_ != NULL)
+    {
+        _renderer->RemoveActor2D(XYPlot_);
+    }
+}
+
+/*
+ * @brief: Create Legend Box Actor(创建图例框演员)
+ * @param: void
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISXYPlot::CreateLegendBoxActor()
+{
+    if(legend_ != NULL)
+    {
+        if(_renderer != NULL)
+        {
+            _renderer->RemoveActor2D(legend_);
+        }
+        legend_->Delete();
+        legend_ = NULL;
+    }
+
+    legend_ = vtkLegendBoxActor::New();
+
+    //(legend_->GetPositionCoordinate())->Set
+    //(legend_->GetPosition2Coordinate())->SetCoordinateSystemToViewport();
+
+    legend_->BorderOff();
+
+    if(_renderer != NULL)
+    {
+        _renderer->AddActor2D(legend_);
+    }
+
+}
+
+/*
+ * @brief: GetCurrentRange(获取最近的范围)
+ * @param: void
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISXYPlot::GetCurrentRange()
+{
+    if (GetXYPlotActor()->GetAdjustXLabels())
+    {
+        GetXYPlotActor()->GetXAxisActor2D()->GetAdjustedRange(XRange_);
+    }
+    else
+    {
+        GetXYPlotActor()->GetXAxisActor2D()->GetRange(XRange_);
+    }
+    if (GetXYPlotActor()->GetAdjustYLabels())
+    {
+        GetXYPlotActor()->GetYAxisActor2D()->GetAdjustedRange(YRange_);
+    }
+    else
+    {
+        GetXYPlotActor()->GetYAxisActor2D()->GetRange(YRange_);
+    }
+}
+
+/*
+ * @brief: show on(打开显示)
+ * @param: void
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISXYPlot::ShowOn()
+{
+   if (XYPlot_ != NULL)
+   {
+        XYPlot_->VisibilityOn();
+   }
+   if (legend_!=NULL)
+   {
+       legend_->VisibilityOn();
+   }
+}
+
+/*
+ * @brief: show off(关闭显示)
+ * @param: void
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISXYPlot::ShowOff()
+{
+   if (XYPlot_ != NULL)
+   {
+        XYPlot_->VisibilityOff();
+   }
+   if (legend_!=NULL)
+   {
+       legend_->VisibilityOff();
+   }
+}
+
+/*
+ * @brief: Get XYPlot Actor(获取xypolt actor)
+ * @param: void
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+vtkXYPlotActor* vtkVISXYPlot::GetXYPlotActor()
+{
+   if (XYPlot_ != NULL)
+   {
+        return XYPlot_;
+   }
+   return NULL;
+}
+
+
+/*
+ * @brief: reset range(充值xy范围)
+ * @param: void
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISXYPlot::ResetRange()
+{
+    SetPlotXRange(min(XRange_[0],XRange_[1]), max(XRange_[0],XRange_[1]));
+    SetPlotYRange(min(YRange_[0],YRange_[1]), max(YRange_[0],YRange_[1]));
+}
+
+/*
+ * @brief: set point type(设置点类型)
+ * @param: void
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISXYPlot::SetPointType()
+{
+    XYPlot_->PlotPointsOn();
+    XYPlot_->PlotLinesOff();
+}
+
+/*
+ * @brief: set curve type(设置曲线类型)
+ * @param: void
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISXYPlot::SetCurveType()
+{
+    XYPlot_->PlotPointsOff();
+    XYPlot_->PlotLinesOn();
+}
+
+/*
+ * @brief: set point size(设置点大小)
+ * @param: size
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISXYPlot::SetPointSize(double s)
+{
+    XYPlot_->GetProperty()->SetPointSize(s);
+}
+
+/*
+ * @brief: set line width(设置线宽)
+ * @param: width
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void vtkVISXYPlot::SetLineWidth(double w)
+{
+    XYPlot_->GetProperty()->SetLineWidth(w);
+}

+ 131 - 0
CAE_Solution/src/VTK/visualization_VTK/vtkvisxyplot.h

@@ -0,0 +1,131 @@
+#ifndef VTKVISXYPLOT_H
+#define VTKVISXYPLOT_H
+
+#include <vector>
+
+#include <iostream>
+
+using namespace std;
+
+#include "vtkVISManager.h"
+#include "vtkObjectFactory.h"
+
+#include "vtkXYPlotActor.h"
+#include "vtkProperty2D.h"
+#include "vtkTextProperty.h"
+#include "vtkDataSet.h"
+#include "vtkGlyphSource2D.h"
+#include "vtkSphereSource.h"
+#include "vtkFieldData.h"
+#include "vtkDataObject.h"
+#include "vtkFloatArray.h"
+#include "vtkProperty2D.h"
+#include "vtkLegendBoxActor.h"
+
+#include "vtkConeSource.h"
+#include "vtkCubeSource.h"
+#include "vtkLineSource.h"
+//#include "vtkVISInteractorStyle.h"
+class vtkVISInteractorStyle;
+/// Class that manage xy plot figure rendering
+///
+/// CreateBlankXYPlotActor() first
+/// so we get an vtkXYPlotActor XYPlot_ \n
+/// Then adds data via AddXYPlotDataObject \n
+/// Set the properties afterwards.
+
+class vtkVISXYPlot : public vtkVISManager
+{
+public:
+    static vtkVISXYPlot *New();
+
+    vtkVISXYPlot();
+    ~vtkVISXYPlot();
+    void CreateBlankXYPlotActor();
+
+    void AddXYPlotData(vtkDataSet* data);
+    void RemoveXYPlotData(vtkDataSet *data);
+
+    void AddXYPlotDataObject(int index, vtkDataObject *dataObj);
+    void RemoveXYPlotDataObject(vtkDataObject *dataObj);
+
+    void SetPositionCoordinate(double a, double b);
+    void SetPosition2Coordinate(double a, double b);
+
+    void SetXYPlotTitle(char* title);
+    void SetXYPlotXTitle(char* xTitle);
+    void SetXYPlotYTitle(char* yTitle);
+
+    void SetXYPlotActorColor(double r, double g, double b);
+
+    void SetXLabelsNumber(int num);
+    void SetYLabelsNumber(int num);
+
+    void SetXValuesTo(char* xValue);
+    void SetGlyphTypeTo(int index, char* type);
+
+    void SetXYPlotLable(int index, char* label);
+    void SetXYPlotColor(int index, double r, double g, double b);
+
+    void SetPlotXRange(double min, double max);
+    void SetPlotYRange(double min, double max);
+
+    void ModifyPlotLineWidth(double Value);
+
+    void SetXYPlotLegendPosition(double a, double b);
+    void SetXYPlotLegendPosition2(double a, double b);
+
+    void SetXYPlotTitlePosition(double a, double b);
+
+    void ResetRange();
+    void GetCurrentRange();
+
+    const char* GetXYPlotLable(int index);
+    double* GetXYPlotColor(int index);
+    double GetPlotLineWidth();
+
+    void SetXYPlotGlyphSize(double size);
+    double GetXYPlotGlyphSize();
+
+    void RemoveXYPlotAllInputs();
+
+    void SetXYPlotNumber(int num);
+    int GetXYPlotNumber();
+
+    void RemoveXYPlotActor();
+
+    void  CreateLegendBoxActor();
+
+    void ShowOn();
+    void ShowOff();
+    vtkXYPlotActor* GetXYPlotActor();
+
+    void SetPointType();
+    void SetCurveType();
+    void SetPointSize(double s);
+    void SetLineWidth(double w);
+
+    double XRange_[2];
+    double YRange_[2];
+
+protected:
+
+    vtkXYPlotActor* XYPlot_;
+
+    //vtkFieldData* fieldData_;
+
+    string xValues[4];
+
+    int plotNumber_;
+
+    int GetXValueIndex(char* type);
+
+
+    vtkLegendBoxActor* legend_;
+    vtkVISInteractorStyle* InteractorStyle_;
+
+private:
+
+};
+
+#endif // VTKVISXYPLOT_H

+ 493 - 0
CAE_Solution/src/VTK/visualization_VTK/vtkxyplotvis.cpp

@@ -0,0 +1,493 @@
+#include "vtkxyplotvis.h"
+
+double ColorListXY[20][3]={{0.0,0.5019607843137255,1.0},
+        {0.1333333333333333,0.6941176470588235,0.2980392156862745},
+        {1.0,0.0,0.0},
+        {0.6941176470588235,0.3568627450980392,1.0},
+        {0.1568627450980392,0.1568627450980392,1.0},
+        {0.1333333333333333,0.6941176470588235,0.2980392156862745},
+        {1.0,0.5019607843137255,0.0},
+        {0.5254901960784314,0.0,1.0},
+        {0.8666666666666667,0.0,0.4352941176470588},
+        {1.0, 0.3764705882352941,0.6862745098039216},
+        {0.1568627450980392,0.5803921568627451,1.0},
+        {0.9764705882352941,0.9764705882352941,0.0},
+        {0.0,0.9254901960784314,0.0},
+        {1.0,0.34509803921568627,0.03529411764705882},
+        {0.6039215686274509,1.0,0.00784313725490196},
+        {0.5254901960784314,0.0,1.0},
+        {1.0,0.26666666666666666,1.0},
+        {1.0,1.0,0.21568627450980393},
+        {0.6039215686274509,1.0,0.00784313725490196},
+        {1.0,0.3764705882352941,0.00784313725490196}};
+
+/*
+ * @brief: the constructor
+ * @param:
+ * @ret:
+ * @birth: created by czm in 20230410
+ */
+XYPlot::XYPlot(): renderer_(0), renderWindow_(0), xyPlot_(0), curveNum_(0), xValues_(0), yValues_(0), curveDataObject_(0)
+{
+
+}
+
+/*
+ * @brief: the destructor
+ * @param:
+ * @ret:
+ * @birth: created by czm in 20230410
+ */
+XYPlot::~XYPlot()
+{
+    DestroyXYPlot();
+}
+
+/*
+ * @brief: set vtk renderer(设置vtk renderer)
+ * @param: renderer
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void XYPlot::SetVtkRender(vtkRenderer *renderer)
+{
+    renderer_ = renderer;
+    renderWindow_ = renderer_->GetRenderWindow();
+}
+
+/*
+ * @brief: update(刷新)
+ * @param: void
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void XYPlot::Update()
+{
+    if (renderWindow_)  renderWindow_->Render();
+}
+
+/*
+ * @brief: allocate xyplot
+ * @param: totalCurveNum
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void XYPlot::AllocateXYPlot(int totalCurveNum)
+{
+    curveNum_ = totalCurveNum;
+    xValues_ = vtkDoubleArray::New();
+    yValues_ = new vtkDoubleArray*[curveNum_];
+    curveDataObject_ = new vtkDataObject*[curveNum_];
+    for (int i = 0; i < curveNum_; ++i)
+    {
+        yValues_[i] = vtkDoubleArray::New();
+
+        vtkFieldData *fd = vtkFieldData::New();
+        fd->AllocateArrays(2);
+        fd->AddArray(xValues_);
+        fd->AddArray(yValues_[i]);
+        curveDataObject_[i] = vtkDataObject::New();
+        curveDataObject_[i]->SetFieldData(fd);
+
+        fd->Delete();
+    }
+}
+
+/*
+ * @brief: destory xyplot(销毁xy坐标轴)
+ * @param: void
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void XYPlot::DestroyXYPlot()
+{
+    if (xyPlot_ != 0)
+    {
+        xyPlot_->RemoveXYPlotActor();
+        xyPlot_->RemoveXYPlotAllInputs();
+        xyPlot_->Delete();
+        xyPlot_ = 0;
+    }
+    if (xValues_ != 0)
+    {
+        xValues_->Delete();
+        xValues_ = 0;
+    }
+    for (int i = 0; i < curveNum_; ++i)
+    {
+        yValues_[i]->Delete();
+        curveDataObject_[i]->Delete();
+    }
+    delete[] yValues_;
+    yValues_ = 0;
+    delete[] curveDataObject_;
+    curveDataObject_ = 0;
+}
+
+/*
+ * @brief: remove xyplot actor(移除xyplot actor)
+ * @param: void
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void XYPlot::RemoveXYPlotActor()
+{
+    if (xyPlot_ != 0)
+    {
+        xyPlot_->RemoveXYPlotActor();
+        xyPlot_->RemoveXYPlotAllInputs();
+        xyPlot_->Delete();
+        xyPlot_ = 0;
+    }
+}
+
+/*
+ * @brief: create xyplot(创造xyplot)
+ * @param: vector
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void XYPlot::CreateXYPlot(vector<bool> &curveShowOnFlagVec)
+{
+    int n = curveShowOnFlagVec.size();
+    if ( n != curveNum_)  return;
+    vector<int> visibleCurveIds;
+    for (int i = 0; i < n; ++i)
+    {
+        if (curveShowOnFlagVec.at(i))
+        {
+            visibleCurveIds.push_back(i);
+        }
+    }
+    int visibleNum = visibleCurveIds.size();
+    xyPlot_ = vtkVISXYPlot::New();
+    xyPlot_->SetRenderTo(renderer_, renderWindow_);
+    xyPlot_->CreateBlankXYPlotActor();
+    xyPlot_->SetPositionCoordinate(0.05, 0.05);
+    xyPlot_->SetPosition2Coordinate(0.8, 0.8);
+    xyPlot_->SetXYPlotTitlePosition(0.5, 0.9);
+    xyPlot_->SetXLabelsNumber(8);
+    xyPlot_->SetYLabelsNumber(6);
+    xyPlot_->SetXYPlotXTitle(const_cast<char*>("Step"));
+    xyPlot_->SetXYPlotYTitle(const_cast<char*>(""));
+    xyPlot_->SetXYPlotActorColor(0.0, 0.0, 0.0);
+    xyPlot_->SetXValuesTo(const_cast<char*>("Value"));
+    xyPlot_->CreateLegendBoxActor();
+    xyPlot_->SetXYPlotLegendPosition(0.88, 0.53-0.03*visibleNum/2);
+    xyPlot_->SetXYPlotLegendPosition2(0.1, 0.04*visibleNum);
+    xyPlot_->SetXYPlotNumber(visibleNum);
+    for (int i = 0; i < visibleNum; ++i)
+    {
+        xyPlot_->AddXYPlotDataObject(i, curveDataObject_[visibleCurveIds.at(i)]);
+        xyPlot_->SetGlyphTypeTo(i, const_cast<char*>(""));
+        xyPlot_->SetXYPlotColor(i, ColorListXY[i%20][0], ColorListXY[i%20][1], ColorListXY[i%20][2]);
+    }
+    xyPlot_->SetPointSize(1.5);
+    xyPlot_->SetLineWidth(1);
+    xyPlot_->SetCurveType();
+}
+
+/*
+ * @brief: Add Point X Value
+ * @param: step  update x range
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void XYPlot::AddPointXValue(double step, bool updateXRange)
+{
+    xValues_->InsertNextValue(step);
+    //if (updateXRange)
+    {
+        //if (step > 49)
+         xyPlot_->SetPlotXRange(0, step);
+    }
+}
+
+/*
+ * @brief: Add Point X Value
+ * @param: step  update x range
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void XYPlot::AddPointXValue(double startstep, double step, bool updateXRange)
+{
+    xValues_->InsertNextValue(step);
+    //if (updateXRange)
+    {
+        //if (step > 49)
+         xyPlot_->SetPlotXRange(startstep, step);
+    }
+}
+
+/*
+ * @brief: Add Point y Value
+ * @param: step  update x range
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void XYPlot::AddPointYValue(int curveId, double value)
+{
+    if (curveId < 0 || curveId >= curveNum_)  return;
+    yValues_[curveId]->InsertNextValue(value);
+    xyPlot_->SetPlotYRange(0,value);
+}
+
+/*
+ * @brief: Add Point y Value
+ * @param: step  update x range
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void XYPlot::AddPointYValue(double starty,int curveId, double value)
+{
+    if (curveId < 0 || curveId >= curveNum_)  return;
+    yValues_[curveId]->InsertNextValue(value);
+    //qDebug() << "starty594 = " << starty;
+    xyPlot_->SetPlotYRange(starty,value);
+}
+////////////property setting//////////////
+/*
+ * @brief: set Point X title
+ * @param: title
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void XYPlot::SetXAxisTitle(char *title)
+{
+    if (xyPlot_)  xyPlot_->SetXYPlotXTitle(title);
+}
+
+/*
+ * @brief: set y axis title(设置y轴标题)
+ * @param: step  update x range
+ * @ret: void
+ * @birth: created by czm in 20230410
+ */
+void XYPlot::SetYAxisTitle(char *title)
+{
+    if (xyPlot_)  xyPlot_->SetXYPlotYTitle(title);
+}
+
+/*
+ * @brief: set glyph type(设置字形类型)
+ * @param: curveid and type
+ * @ret: void
+ * @birth: created by czm in 20230411
+ */
+void XYPlot::SetGlyphType(int curveId, char *title)
+{
+    if (curveId < 0 || curveId >= curveNum_)  return;
+    if (xyPlot_)  xyPlot_->SetGlyphTypeTo(curveId, title);
+}
+
+/*
+ * @brief: set color(设置颜色)
+ * @param: curveid and rgb
+ * @ret: void
+ * @birth: created by czm in 20230411
+ */
+void XYPlot::SetColor(int curveId, double r, double g, double b)
+{
+    if (curveId < 0 || curveId >= curveNum_)  return;
+    if (xyPlot_)  xyPlot_->SetXYPlotColor(curveId, r, g, b);
+}
+
+/*
+ * @brief: set plot curve lines(设置图表曲线)
+ * @param: flag
+ * @ret: void
+ * @birth: created by czm in 20230411
+ */
+void XYPlot::SetPlotCurveLines(bool flag)
+{
+    if (xyPlot_)
+    {
+        vtkXYPlotActor *plotActor = xyPlot_->GetXYPlotActor();
+        if (flag)  plotActor->PlotCurveLinesOn();
+        else  plotActor->PlotCurveLinesOff();
+    }
+}
+
+/*
+ * @brief: set plot lines(设置图表线)
+ * @param: flag
+ * @ret: void
+ * @birth: created by czm in 20230411
+ */
+void XYPlot::SetPlotLines(bool flag)
+{
+    if (xyPlot_)
+    {
+        vtkXYPlotActor *plotActor = xyPlot_->GetXYPlotActor();
+        if (flag)  plotActor->PlotLinesOn();
+        else  plotActor->PlotLinesOff();
+    }
+}
+
+/*
+ * @brief: set visiable(设置可见性)
+ * @param: bool
+ * @ret: void
+ * @birth: created by czm in 20230411
+ */
+void XYPlot::SetVisiable(bool visiable)
+{
+    if (xyPlot_)
+    {
+        if (visiable)  xyPlot_->ShowOn();
+        else  xyPlot_->ShowOff();
+    }
+}
+
+/*
+ * @brief: set legend label(设置说明标签)
+ * @param: curveid and label
+ * @ret: void
+ * @birth: created by czm in 20230411
+ */
+void XYPlot::SetLegendLabel(int curveId, char *lable)
+{
+    if (curveId < 0 || curveId >= curveNum_)  return;
+    if (xyPlot_)  xyPlot_->SetXYPlotLable(curveId, lable);
+}
+
+/*
+ * @brief: Set Line Stipple(设置线点画)
+ * @param: pattern
+ * @ret: void
+ * @birth: created by czm in 20230411
+ */
+void XYPlot::SetLineStipple(int pattern)
+{
+    if (xyPlot_)
+    {
+        vtkXYPlotActor *plotActor = xyPlot_->GetXYPlotActor();
+        plotActor->GetProperty()->SetLineStipplePattern(pattern);
+    }
+}
+/////////////////////////////////////
+/*
+ * @brief: get x range(获取x范围)
+ * @param: min and max
+ * @ret: void
+ * @birth: created by czm in 20230411
+ */
+void XYPlot::GetXRange(double &xmin, double &xmax)
+{
+    if (xValues_)
+    {
+        double range[2];
+        xValues_->GetRange(range);
+        xmin = range[0];
+        xmax = range[1];
+    }
+}
+
+/*
+ * @brief: Set curve visiable(设置曲线可视化)
+ * @param: vector
+ * @ret: void
+ * @birth: created by czm in 20230411
+ */
+void XYPlot::SetCurveVisible(vector<int> &visibleCurveIds)
+{
+    if (xyPlot_)
+    {
+        for (int i = 0; i < curveNum_; ++i)
+        {
+            xyPlot_->RemoveXYPlotDataObject(curveDataObject_[i]);
+        }
+        int n = visibleCurveIds.size();
+        xyPlot_->SetXYPlotNumber(n);
+        for (int i = 0; i < n; ++i)
+        {
+            int curveId = visibleCurveIds[i];
+            xyPlot_->AddXYPlotDataObject(i, curveDataObject_[curveId]);
+            xyPlot_->SetGlyphTypeTo(i, const_cast<char*>("Line"));
+            xyPlot_->SetXYPlotColor(i, ColorListXY[curveId%20][0], ColorListXY[curveId%20][1], ColorListXY[curveId%20][2]);
+        }
+    }
+}
+
+/*
+ * @brief: Set x double array(设置xdouble数组)
+ * @param: array
+ * @ret: void
+ * @birth: created by czm in 20230411
+ */
+void XYPlot::SetXDoubleArray(vtkDoubleArray* array)
+{
+    xValues_->DeepCopy(array);
+}
+
+/*
+ * @brief: Set y double array(设置y double数组)
+ * @param: array
+ * @ret: void
+ * @birth: created by czm in 20230411
+ */
+void XYPlot::SetYDoubleArray(int id, vtkDoubleArray* array)
+{
+    yValues_[id]->DeepCopy(array);
+}
+
+/*
+ * @brief: Set x range(设置x 范围)
+ * @param: min and max
+ * @ret: void
+ * @birth: created by czm in 20230411
+ */
+void XYPlot::SetXRange(double min, double max)
+{
+    xyPlot_->SetPlotXRange(min, max);
+}
+
+/*
+ * @brief: Set y range(设置y 范围)
+ * @param: min and max
+ * @ret: void
+ * @birth: created by czm in 20230411
+ */
+void XYPlot::SetYRange(double min, double max)
+{
+    xyPlot_->SetPlotYRange(min, max);
+}
+
+/*
+ * @brief: Set curve type(设置曲线类型)
+ * @param: type
+ * @ret: void
+ * @birth: created by czm in 20230411
+ */
+void XYPlot::SetCurveType(string type)
+{
+    if (type == "point")
+    {
+        xyPlot_->SetPointType();
+    }else if (type == "curve")
+    {
+        xyPlot_->SetCurveType();
+    }
+}
+
+/*
+ * @brief: Set plot point size (设置图表点尺寸)
+ * @param: size
+ * @ret: void
+ * @birth: created by czm in 20230411
+ */
+void XYPlot::SetPlotPointSize(double s)
+{
+    xyPlot_->SetPointSize(s);
+}
+
+/*
+ * @brief: Set plot line size (设置图表线尺寸)
+ * @param: size
+ * @ret: void
+ * @birth: created by czm in 20230411
+ */
+void XYPlot::SetPlotLineWidth(double w)
+{
+    xyPlot_->SetLineWidth(w);
+}

+ 62 - 0
CAE_Solution/src/VTK/visualization_VTK/vtkxyplotvis.h

@@ -0,0 +1,62 @@
+#ifndef VTKXYPLOTVIS_H
+#define VTKXYPLOTVIS_H
+
+#include <vector>
+#include <vtkRenderer.h>
+#include <vtkRenderWindow.h>
+#include "vtkvisxyplot.h"
+#include <vtkDoubleArray.h>
+#include <vtkDataObject.h>
+using namespace std;
+
+class XYPlot
+{
+public:
+    XYPlot();
+    ~XYPlot();
+
+    void SetVtkRender(vtkRenderer *renderer);
+    void Update();
+    void AllocateXYPlot(int totalCurveNum);
+    void CreateXYPlot(vector<bool> &curveShowOnFlagVec);
+    void AddPointXValue(double step, bool updateXRange = false);
+    void AddPointYValue(double,int, double);
+    void AddPointYValue(int, double);
+    void DestroyXYPlot();
+    void RemoveXYPlotActor();
+    void GetXRange(double &xmin, double &xmax);
+
+    void SetXDoubleArray(vtkDoubleArray* array);
+    void SetYDoubleArray(int id, vtkDoubleArray* array);
+
+    void SetXRange(double min, double max);
+    void SetYRange(double min, double max);
+    ////////////////xyplot property setting//////////
+    void SetXAxisTitle(char *title);
+    void SetYAxisTitle(char *title);
+    void SetGlyphType(int curveId, char *type);
+    void SetColor(int curveId, double r, double g, double b);
+    void SetPlotLines(bool flag);
+    void SetPlotCurveLines(bool flag);
+    void SetVisiable(bool visiable);
+    void SetLegendLabel(int curveId, char *lable);
+    void SetLineStipple(int pattern);
+    void AddPointXValue(double startstep, double step, bool updateXRange);
+
+    void SetCurveVisible(vector<int> &visibleCurveIds);
+    void SetCurveType(string type);
+    void SetPlotPointSize(double s);
+    void SetPlotLineWidth(double w);
+
+private:
+    vtkRenderer *renderer_;
+    vtkRenderWindow *renderWindow_;
+    vtkVISXYPlot *xyPlot_;
+    int curveNum_;
+
+    vtkDoubleArray *xValues_;
+    vtkDoubleArray **yValues_;
+    vtkDataObject **curveDataObject_;
+};
+
+#endif // VTKXYPLOTVIS_H

+ 18 - 1
CAE_Solution/src/threadPool_and_statemachine/dealWith/handlepool.cpp

@@ -1,5 +1,12 @@
 #include "handlepool.h"
 #include <iostream>
+
+#include <vtkNew.h>
+#include <vtkSphereSource.h>
+#include <vtkPolyDataMapper.h>
+#include <vtkActor.h>
+
+
 /*
  * @brief:the constructor
  * @param:
@@ -61,7 +68,17 @@ void handlePool::operateRender(QString action,QVTKRenderer* render_)
         render_->init();
         emit sendWidget_handlePoolToWidget(render_->GetWidget());
     }else{
-        cout<<"action:"<<action.toStdString()<<endl;
+
+        //cout<<"action:"<<action.toStdString()<<endl;
+        vtkNew<vtkSphereSource> sphereSource;
+        sphereSource->SetCenter(0.0,0.0,0.0);
+        sphereSource->SetRadius(5.0);
+        vtkNew<vtkPolyDataMapper> mapper;
+        mapper->SetInputConnection(sphereSource->GetOutputPort());
+        vtkNew<vtkActor> actor;
+        actor->SetMapper(mapper);
+        render_->GetRenderer()->AddActor(actor);
+        render_->renderWin->Render();
     }
     render_->CaptureWindowImages();
 }