!B (Sandbox) (CE-21795) Importing models with multisubmaterials via fbx switches...
[CRYENGINE.git] / Code / Sandbox / Plugins / LodGeneratorPlugin / control / MeshBakerUVPreview.h
blobb3b76ae614df5dfcfc626c273ec6d8b4bf3ae9f2
1 #pragma once
3 #include <QWidget>
4 #include <Cry3DEngine/IIndexedMesh.h>
5 #include "QViewport.h"
6 #include "../Util/PolygonMesh.h"
7 #include "../Util/TopologyGraph.h"
9 using namespace LODGenerator;
11 class QViewport;
12 class CMaterial;
13 class CDisplayViewportAdapter;
15 struct EdgeStyle
17 EdgeStyle() : visible(false), color(0.0,0.0,0.0,1.0), width(1.0) {}
18 bool visible ;
19 Vec4 color ;
20 float width ;
21 } ;
23 struct PointStyle
25 PointStyle() : visible(false), color(0.0,0.0,0.0,1.0), size(4.0) {}
26 bool visible ;
27 Vec4 color ;
28 float size ;
29 } ;
34 class CMeshBakerUVPreview
36 public:
37 CMeshBakerUVPreview(QViewport * viewPort);
38 virtual ~CMeshBakerUVPreview();
40 void SetMeshMap(CTopologyGraph* pMeshMap);
41 void UpdateMeshMap();
43 void SetMaterial(IMaterial* pMaterial);
45 void OnRender(const SRenderContext& rc);
46 void OnMouseEvent(const SMouseEvent& sMouseEvent);
48 void SetRenderMesh(bool bRenderMesh)
50 m_bRenderMesh = bRenderMesh;
53 private:
55 void RenderUV(DisplayContext& dc,const SRenderContext& rc);
56 void RenderUVEdges(DisplayContext& dc,const SRenderContext& rc);
57 void RenderUVBorders(DisplayContext& dc,const SRenderContext& rc);
59 void RenderMesh(DisplayContext& dc,const SRenderContext& rc);
60 void RenderSurface(DisplayContext& dc,const SRenderContext& rc);
62 void AutoSeamPrepare(bool glue);
64 private:
67 QViewport * m_ViewPort;
68 std::shared_ptr<CDisplayViewportAdapter> m_pViewportAdapter;
70 bool m_bRenderMesh;
72 EdgeStyle seam_style_ ;
73 EdgeStyle cut_seam_style_ ;
74 EdgeStyle straight_seam_style_ ;
75 PointStyle seam_anchor_style_ ;
76 PointStyle angle_constraints_style_ ;
78 EdgeStyle mesh_style_ ;
79 PointStyle vertices_style_ ;
81 bool show_overlaps_ ;
82 bool has_selection_ ;
83 bool points_as_spheres_;
84 bool smooth_;
86 double overlap_u_min_ ;
87 double overlap_v_min_ ;
88 double overlap_u_max_ ;
89 double overlap_v_max_ ;
91 float texture_repeat_;
93 float extendVetexLength;
95 LODGenerator::CTopologyGraph* m_MeshMap;
96 LODGenerator::CPolygonMesh* m_pMatPolygonMesh;
97 bool m_Ctrl;
99 std::vector<CDLight> m_lights;