40 #ifdef RINGMESH_WITH_GRAPHICS 44 #include <geogram_gfx/glup_viewer/glup_viewer_gui.h> 65 template < index_t DIMENSION >
66 class GeoModelGfxEntity
72 explicit GeoModelGfxEntity( GeoModelGfx< DIMENSION >& gfx );
73 virtual ~GeoModelGfxEntity() =
default;
75 virtual void draw() = 0;
76 virtual void initialize() = 0;
77 void set_scalar_attribute( GEO::MeshElementsFlags subelements,
78 const std::string& name,
81 GLuint colormap_texture );
82 void unset_scalar_attribute();
90 void set_vertex_color(
float red,
float green,
float blue );
98 void set_vertex_color(
99 index_t entity_id,
float red,
float green,
float blue );
104 void set_vertex_visibility(
bool is_visible );
110 void set_vertex_visibility( index_t entity_id,
bool is_visible );
115 void set_vertex_size( index_t size );
121 void set_vertex_size( index_t entity_id, index_t size );
124 GeoModelGfx< DIMENSION >& gfx_;
125 std::vector< std::unique_ptr< MeshEntityGfx< DIMENSION > > > entities_;
128 template < index_t DIMENSION >
129 class CornerGfxEntity final :
public GeoModelGfxEntity< DIMENSION >
132 explicit CornerGfxEntity( GeoModelGfx< DIMENSION >& gfx );
134 PointSetMeshGfx< DIMENSION >& corner( index_t corner_id );
139 void draw()
override;
140 void initialize()
override;
143 template < index_t DIMENSION >
144 class LineGfxEntity final :
public GeoModelGfxEntity< DIMENSION >
147 explicit LineGfxEntity( GeoModelGfx< DIMENSION >& gfx );
149 LineMeshGfx< DIMENSION >& line( index_t line_id );
154 void draw()
override;
155 void initialize()
override;
163 void set_line_color(
float red,
float green,
float blue );
172 index_t line_id,
float red,
float green,
float blue );
177 void set_line_visibility(
bool is_visible );
183 void set_line_visibility( index_t line_id,
bool is_visible );
188 void set_line_size( index_t size );
194 void set_line_size( index_t line_id, index_t size );
197 template < index_t DIMENSION >
198 class SurfaceGfxEntity final :
public GeoModelGfxEntity< DIMENSION >
201 explicit SurfaceGfxEntity( GeoModelGfx< DIMENSION >& gfx );
203 SurfaceMeshGfx< DIMENSION >& surface( index_t surface_id );
208 void draw()
override;
209 void initialize()
override;
216 void set_surface_color(
float red,
float green,
float blue );
224 void set_surface_color(
225 index_t surface_id,
float red,
float green,
float blue );
230 void set_surface_visibility(
bool is_visible );
236 void set_surface_visibility( index_t surface_id,
bool is_visible );
243 void set_backface_surface_color(
float red,
float green,
float blue );
251 void set_backface_surface_color(
252 index_t surface_id,
float red,
float green,
float blue );
259 void set_mesh_color(
float red,
float green,
float blue );
268 index_t surface_id,
float red,
float green,
float blue );
273 void set_mesh_visibility(
bool is_visible );
279 void set_mesh_visibility( index_t surface_id,
bool is_visible );
284 void set_mesh_size( index_t size );
290 void set_mesh_size( index_t surface_id, index_t size );
293 template < index_t DIMENSION >
294 class RegionGfxEntity final :
public GeoModelGfxEntity< 3 >
297 explicit RegionGfxEntity( GeoModelGfx3D& gfx );
299 VolumeMeshGfx< DIMENSION >& region( index_t region_id );
304 void draw()
override;
305 void initialize()
override;
313 void set_region_color(
float red,
float green,
float blue );
321 void set_region_color(
322 index_t region_id,
float red,
float green,
float blue );
327 void set_region_visibility(
bool is_visible );
333 void set_region_visibility( index_t region_id,
bool is_visible );
341 void set_mesh_color(
float red,
float green,
float blue );
350 index_t region_id,
float red,
float green,
float blue );
355 void set_mesh_visibility(
bool is_visible );
361 void set_mesh_visibility( index_t region_id,
bool is_visible );
366 void set_mesh_size( index_t size );
372 void set_mesh_size( index_t region_id, index_t size );
377 void set_draw_cells(
CellType type,
bool x );
381 void set_draw_cells( index_t region_id,
CellType type,
bool x );
385 void set_cell_colors_by_type();
390 void set_cell_colors_by_type( index_t region_id );
391 void set_cell_type_visibility(
CellType t,
bool is_visible );
392 void set_cell_type_visibility(
393 index_t region_id,
CellType t,
bool is_visible );
398 void set_shrink(
double shrink );
404 void set_shrink( index_t region_id,
double shrink );
#define ringmesh_disable_copy_and_move(Class)
#define ringmesh_template_assert_2d_or_3d(type)
Classes to build GeoModel from various inputs.
FORWARD_DECLARATION_DIMENSION_CLASS(GeoModelMeshEntityAccess)