|
@@ -87,7 +87,7 @@ ResultMeshManager::ResultMeshManager()
|
|
|
solidSurfaceW_ = NULL;
|
|
|
sliceW_ = NULL;
|
|
|
streamW_ = NULL;
|
|
|
-// xyplot2dW_ = NULL;
|
|
|
+ // xyplot2dW_ = NULL;
|
|
|
|
|
|
changeRangeFlag = false;
|
|
|
surfaceHideFlag = true;
|
|
@@ -262,10 +262,10 @@ void ResultMeshManager::Clear()
|
|
|
surfaceActorColor_.push_back(1);
|
|
|
surfaceActorTransparency_ = 1;
|
|
|
|
|
|
-// if (animationWidget_ != NULL)
|
|
|
-// {
|
|
|
-// animationWidget_->RestoreWidget();
|
|
|
-// }
|
|
|
+ // if (animationWidget_ != NULL)
|
|
|
+ // {
|
|
|
+ // animationWidget_->RestoreWidget();
|
|
|
+ // }
|
|
|
if (contourWidget_ != NULL)
|
|
|
{
|
|
|
contourWidget_->RestoreWidget();
|
|
@@ -277,23 +277,39 @@ void ResultMeshManager::Clear()
|
|
|
if (vectorWidget_ != NULL)
|
|
|
{
|
|
|
//vectorWidget_->RestoreWidget();
|
|
|
+ /*vectorWidget_->dataU.clear();
|
|
|
+ vectorWidget_->dataV.clear();
|
|
|
+ vectorWidget_->dataW.clear();
|
|
|
+ vectorWidget_->SetScaleFactor(0.02);*/
|
|
|
}
|
|
|
if (solidSurfaceW_ != NULL)
|
|
|
{
|
|
|
//solidSurfaceW_->RestoreWidget();
|
|
|
+ //solidSurfaceW_->SetShowHideState(true);
|
|
|
+ //solidSurfaceW_->SetTransparency(1);
|
|
|
+ }
|
|
|
+ if (sliceW_ != NULL)
|
|
|
+ {
|
|
|
+ /*sliceW_->scalarNameVec.clear();
|
|
|
+ sliceW_->zoneIdVec.clear();
|
|
|
+ sliceW_->index = 0;
|
|
|
+ sliceW_->oldIndex = -1;*/
|
|
|
+ // sliceW_->RestoreWidget();
|
|
|
}
|
|
|
-// if (sliceW_ != NULL)
|
|
|
-// {
|
|
|
-// sliceW_->RestoreWidget();
|
|
|
-// }
|
|
|
if (streamW_ != NULL)
|
|
|
{
|
|
|
//streamW_->RestoreWidget();
|
|
|
- }
|
|
|
-// if (xyplot2dW_ != NULL)
|
|
|
-// {
|
|
|
-// xyplot2dW_->RestoreWidget();
|
|
|
-// }
|
|
|
+ /*streamW_->dataU.clear();
|
|
|
+ streamW_->dataV.clear();
|
|
|
+ streamW_->dataW.clear();
|
|
|
+ streamW_->current_direction = "both";
|
|
|
+ streamW_->showstate = true;
|
|
|
+ streamW_->toolstate = true;*/
|
|
|
+ }
|
|
|
+ // if (xyplot2dW_ != NULL)
|
|
|
+ // {
|
|
|
+ // xyplot2dW_->RestoreWidget();
|
|
|
+ // }
|
|
|
if (render_ != NULL)
|
|
|
{
|
|
|
render_->HideAllActors();
|
|
@@ -322,7 +338,9 @@ void ResultMeshManager::Clear()
|
|
|
uncontour->Delete();
|
|
|
uncontour = NULL;
|
|
|
}
|
|
|
- qDeleteAll(uncontourVec_);
|
|
|
+ if(!uncontourVec_.empty()){
|
|
|
+ qDeleteAll(uncontourVec_);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -678,6 +696,14 @@ void ResultMeshManager::DisplayMeshByIndex(int index)
|
|
|
it2->second->ShowOffScalarBar();
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ /*for (map<string, vtkVISUnShadeMesh*>::iterator it2= unMehsIt->second.begin();
|
|
|
+ it2 != unMehsIt->second.end(); it2 ++)
|
|
|
+ {
|
|
|
+ it2->second->SetOpacity(0);
|
|
|
+ it2->second->ShowOn();
|
|
|
+ }*/
|
|
|
+
|
|
|
}else if (displayType == 3)//unglyph
|
|
|
{
|
|
|
HideAllContourActors();
|
|
@@ -688,8 +714,8 @@ void ResultMeshManager::DisplayMeshByIndex(int index)
|
|
|
if (currShowZoneNameSet_.count(it2->first))
|
|
|
{
|
|
|
it2->second->InitGlyphDisplay(vectorScalarIndexVec.at(0),
|
|
|
- vectorScalarIndexVec.at(1),
|
|
|
- vectorScalarIndexVec.at(2));//cuode
|
|
|
+ vectorScalarIndexVec.at(1),
|
|
|
+ vectorScalarIndexVec.at(2));//cuode
|
|
|
it2->second->SetGlyphScaleFactor(scaleFactor_);
|
|
|
it2->second->ShowOn();
|
|
|
}else
|
|
@@ -1101,7 +1127,7 @@ void ResultMeshManager::SetVectorWidget(VectorW* w)
|
|
|
{
|
|
|
vector<string> tmp = GetMeshScalarNameVec();//0504 append去除容器里元素的"\0000"
|
|
|
//for(auto &p:tmp){
|
|
|
- //p=deleteSpaces(p);
|
|
|
+ //p=deleteSpaces(p);
|
|
|
//}
|
|
|
vectorWidget_->GetData_u(tmp);
|
|
|
vectorWidget_->GetData_v(tmp);
|
|
@@ -1400,11 +1426,11 @@ void ResultMeshManager::InitWidgetsParameter()
|
|
|
streamW_->SetData_v(GetMeshScalarNameVec());
|
|
|
streamW_->SetData_w(GetMeshScalarNameVec());
|
|
|
}
|
|
|
-// if (xyplot2dW_ != NULL)
|
|
|
-// {
|
|
|
-// xyplot2dW_->SetArea(zoneNameVec_);
|
|
|
-// xyplot2dW_->SetYAxis(GetMeshScalarNameVec());
|
|
|
-// }
|
|
|
+ // if (xyplot2dW_ != NULL)
|
|
|
+ // {
|
|
|
+ // xyplot2dW_->SetArea(zoneNameVec_);
|
|
|
+ // xyplot2dW_->SetYAxis(GetMeshScalarNameVec());
|
|
|
+ // }
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -1687,8 +1713,8 @@ void ResultMeshManager::HideSliceActors()
|
|
|
* @date 20230225
|
|
|
*/
|
|
|
void ResultMeshManager::SetAllSliceState(vector<int> sliceId, vector<bool> solidState, vector<bool> planeWidgetState, vector<vector<double>> nomal,
|
|
|
- vector<vector<double>> posision, vector<string> type, vector<string> contourName, vector<int> level,
|
|
|
- vector<bool> planeState, vector<bool>labelState)
|
|
|
+ vector<vector<double>> posision, vector<string> type, vector<string> contourName, vector<int> level,
|
|
|
+ vector<bool> planeState, vector<bool>labelState)
|
|
|
{
|
|
|
for (int i = 0; i < sliceId.size(); i ++)
|
|
|
{
|
|
@@ -1826,27 +1852,27 @@ void ResultMeshManager::UpdataCurrUnstructSource()
|
|
|
num ++;
|
|
|
}
|
|
|
vector<vtkVISUnstructuredGridSource*> vec;
|
|
|
- map<double, map<string, vtkVISUnContour*>>::iterator it = vtkVisZoneMeshMap_.find(time);
|
|
|
- if (it != vtkVisZoneMeshMap_.end())
|
|
|
+ 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 ++)
|
|
|
{
|
|
|
- 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 (currAddDataSource_ != NULL)
|
|
|
+ if (currShowZoneNameSet_.count(it2->first))
|
|
|
{
|
|
|
- delete currAddDataSource_;
|
|
|
- currAddDataSource_ = NULL;
|
|
|
+ vtkVISUnstructuredGridSource* unGrid = vtkVISUnstructuredGridSource::New();
|
|
|
+ unGrid = it2->second->GetDatSource();
|
|
|
+ vec.push_back(unGrid);
|
|
|
}
|
|
|
- currAddDataSource_ = new vtkVISAddUnGridDataSource();
|
|
|
- currAddDataSource_->SetVISUnGridDataSource(vec);
|
|
|
}
|
|
|
+ if (currAddDataSource_ != NULL)
|
|
|
+ {
|
|
|
+ delete currAddDataSource_;
|
|
|
+ currAddDataSource_ = NULL;
|
|
|
+ }
|
|
|
+ currAddDataSource_ = new vtkVISAddUnGridDataSource();
|
|
|
+ currAddDataSource_->SetVISUnGridDataSource(vec);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -2057,15 +2083,15 @@ void ResultMeshManager::GetActorText(string text_, vector<double> position_XY, d
|
|
|
}
|
|
|
titleText_ = vtkTextActor::New();
|
|
|
if(!text_.empty())
|
|
|
- {
|
|
|
- const char *TitleText = text_.c_str();
|
|
|
- titleText_->SetInput(TitleText);
|
|
|
- titleText_->SetDisplayPosition(position_XY.at(0),position_XY.at(1));
|
|
|
- titleText_->GetTextProperty()->SetFontSize(fontsize);
|
|
|
- titleText_->GetTextProperty()->SetColor(color.at(0),color.at(1),color.at(2));
|
|
|
- render_->GetRenderer()->AddActor2D(titleText_);
|
|
|
- render_->Update();
|
|
|
- }
|
|
|
+ {
|
|
|
+ const char *TitleText = text_.c_str();
|
|
|
+ titleText_->SetInput(TitleText);
|
|
|
+ titleText_->SetDisplayPosition(position_XY.at(0),position_XY.at(1));
|
|
|
+ titleText_->GetTextProperty()->SetFontSize(fontsize);
|
|
|
+ titleText_->GetTextProperty()->SetColor(color.at(0),color.at(1),color.at(2));
|
|
|
+ render_->GetRenderer()->AddActor2D(titleText_);
|
|
|
+ render_->Update();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -2268,34 +2294,34 @@ void ResultMeshManager::ChangeMeshType(int type)
|
|
|
surfaceActorColor_.push_back(1);
|
|
|
surfaceActorTransparency_ = 1;
|
|
|
|
|
|
-// if (contourWidget_ != NULL)
|
|
|
-// {
|
|
|
-// contourWidget_->RestoreWidget();
|
|
|
-// }
|
|
|
-// if (lineWidget_ != NULL)
|
|
|
-// {
|
|
|
-// lineWidget_->RestoreWidget();
|
|
|
-// }
|
|
|
-// if (vectorWidget_ != NULL)
|
|
|
-// {
|
|
|
-// vectorWidget_->RestoreWidget();
|
|
|
-// }
|
|
|
-// if (solidSurfaceW_ != NULL)
|
|
|
-// {
|
|
|
-// solidSurfaceW_->RestoreWidget();
|
|
|
-// }
|
|
|
-// if (sliceW_ != NULL)
|
|
|
-// {
|
|
|
-// sliceW_->RestoreWidget();
|
|
|
-// }
|
|
|
-// if (streamW_ != NULL)
|
|
|
-// {
|
|
|
-// streamW_->RestoreWidget();
|
|
|
-// }
|
|
|
-// if (xyplot2dW_ != NULL)
|
|
|
-// {
|
|
|
-// xyplot2dW_->RestoreWidget();
|
|
|
-// }
|
|
|
+ // if (contourWidget_ != NULL)
|
|
|
+ // {
|
|
|
+ // contourWidget_->RestoreWidget();
|
|
|
+ // }
|
|
|
+ // if (lineWidget_ != NULL)
|
|
|
+ // {
|
|
|
+ // lineWidget_->RestoreWidget();
|
|
|
+ // }
|
|
|
+ // if (vectorWidget_ != NULL)
|
|
|
+ // {
|
|
|
+ // vectorWidget_->RestoreWidget();
|
|
|
+ // }
|
|
|
+ // if (solidSurfaceW_ != NULL)
|
|
|
+ // {
|
|
|
+ // solidSurfaceW_->RestoreWidget();
|
|
|
+ // }
|
|
|
+ // if (sliceW_ != NULL)
|
|
|
+ // {
|
|
|
+ // sliceW_->RestoreWidget();
|
|
|
+ // }
|
|
|
+ // if (streamW_ != NULL)
|
|
|
+ // {
|
|
|
+ // streamW_->RestoreWidget();
|
|
|
+ // }
|
|
|
+ // if (xyplot2dW_ != NULL)
|
|
|
+ // {
|
|
|
+ // xyplot2dW_->RestoreWidget();
|
|
|
+ // }
|
|
|
render_->HideAllActors();
|
|
|
|
|
|
if (type == 0)
|