solidsurfacewidget.cpp 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #include "solidsurfacewidget.h"
  2. /*
  3. * @brief: the constructor
  4. * @param:
  5. * @ret:
  6. * @birth: created by czm in 20230505
  7. */
  8. SolidSurface::SolidSurface(ResultMeshManager* rs)
  9. {
  10. this->Cmanager = rs;
  11. }
  12. /*
  13. * @brief: the destructor
  14. * @param:
  15. * @ret:
  16. * @birth: created by czm in 20230505
  17. */
  18. SolidSurface::~SolidSurface()
  19. {
  20. this->Cmanager = NULL;//不析构,Cmanager存在handPool中map,调用handPool析构函数时析构
  21. }
  22. /*
  23. * @brief: get param for recvmsg and display solidsurface
  24. * @param: vtkJsonObject
  25. * @ret: void
  26. * @birth: created by czm in 20230505
  27. */
  28. void SolidSurface::solidsurfce_execute(vtkJsonObject* jsonObj_)
  29. {
  30. //apply setting data.
  31. // ResultMeshManager::getInstance()->SetSurfaceShowHideFlag(static_cast<SolidSurfaceWidget*>(m_pWidget)->GetShowHideState());
  32. // ResultMeshManager::getInstance()->SetSurfaceColor(static_cast<SolidSurfaceWidget*>(m_pWidget)->GetColor());
  33. // ResultMeshManager::getInstance()->SetSurfaceTransparency(static_cast<SolidSurfaceWidget*>(m_pWidget)->GetTransparency());
  34. // ResultMeshManager::getInstance()->DisplayMeshByIndex(ResultMeshManager::getInstance()->GetCurrIndex());
  35. this->Cmanager->solidSurfaceW_->SetShowHideState(jsonObj_->sf_struct->showhidestate);
  36. this->Cmanager->SetSurfaceShowHideFlag(this->Cmanager->solidSurfaceW_->GetShowHideState());
  37. this->Cmanager->solidSurfaceW_->Setcolor(jsonObj_->sf_struct->r,jsonObj_->sf_struct->g,jsonObj_->sf_struct->b);
  38. this->Cmanager->SetSurfaceColor(this->Cmanager->solidSurfaceW_->GetColor());
  39. this->Cmanager->solidSurfaceW_->SetTransparency(jsonObj_->sf_struct->transparency);
  40. this->Cmanager->SetSurfaceTransparency(this->Cmanager->solidSurfaceW_->GetTransparency());
  41. this->Cmanager->DisplayMeshByIndex(0);
  42. }
  43. /*
  44. * @brief: get its resultmeshManager
  45. * @param: void
  46. * @ret: ResultMeshManager*
  47. * @birth: created by czm in 20230505
  48. */
  49. ResultMeshManager *SolidSurface::getResultMeshManager()
  50. {
  51. return this->Cmanager;
  52. }