geometrySetViewData.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #ifndef _GEOMETRYSETVIEWDATA_H__
  2. #define _GEOMETRYSETVIEWDATA_H__
  3. #include <QList>
  4. #include <QHash>
  5. #include <Standard_Handle.hxx>
  6. class vtkPolyData;
  7. class TopoDS_TShape;
  8. class QColor;
  9. namespace Geometry
  10. {
  11. class GeometryData;
  12. class GeometrySet;
  13. }
  14. namespace MainWidget
  15. {
  16. class GeometryViewObject;
  17. class GeoSetViewObject
  18. {
  19. public:
  20. GeoSetViewObject(Geometry::GeometrySet*);
  21. ~GeoSetViewObject();
  22. Geometry::GeometrySet* getGeometrySet();
  23. void setFacePoly(vtkPolyData* p);
  24. vtkPolyData* getFacePoly();
  25. void setEdgePoly(vtkPolyData* p);
  26. vtkPolyData* getEdgePoly();
  27. void setPointPoly(vtkPolyData* p);
  28. vtkPolyData* getPointPoly();
  29. void genSolidViewObj();
  30. void appendFaceViewObj(int index, Handle(TopoDS_TShape) s, GeometryViewObject* v);
  31. void appendEdgeViewObj(int index, GeometryViewObject* v);
  32. void appendPointViewObj(int index, GeometryViewObject* v);
  33. void appendSolidViewObj(int index, GeometryViewObject* v);
  34. GeometryViewObject* getFaceViewObjByIndex(int index);
  35. GeometryViewObject* getFaceViewObjByCellIndex(int cellIndex);
  36. GeometryViewObject* getEdgeViewObjByCellIndex(int cellIndex);
  37. GeometryViewObject* getPointViewObjByCellIndex(int pointIndex);
  38. GeometryViewObject* getSolidViewObjByFaceIndex(int faceIndex);
  39. QList<GeometryViewObject*> getViewObjectByStates(int selectModel, int sates);
  40. void resetColor();
  41. void highLight(bool on);
  42. void highLightFace(int index, bool on);
  43. void highLightEdge(int index, bool on);
  44. void highLightPoint(int index, bool on);
  45. void highLightSolid(int index, bool on);
  46. private:
  47. Geometry::GeometrySet* _geoSet{};
  48. vtkPolyData* _facePoly{};
  49. vtkPolyData* _edgePoly{};
  50. vtkPolyData* _pointPoly{};
  51. QHash<GeometryViewObject*, Handle(TopoDS_TShape)> _faceObjHash{};
  52. QHash<int, GeometryViewObject*> _faceViewObjs{};
  53. QHash<int, GeometryViewObject*> _edgeViewObjs{};
  54. QHash<int, GeometryViewObject*> _pointViewObjs{};
  55. QHash<int, GeometryViewObject*> _solidViewObjs{};
  56. };
  57. }
  58. #endif