14 #pragma GCC diagnostic push
15 #pragma GCC diagnostic ignored "-Wdeprecated-copy"
18 #include <osgViewer/ViewerEventHandlers>
21 #pragma GCC diagnostic pop
32 #include <osg/Material>
34 #include <osg/Texture2D>
35 #include <osgDB/ReadFile>
38 #include <boost/graph/graph_traits.hpp>
39 #include <boost/graph/properties.hpp>
42 #include <CGAL/boost/graph/properties.h>
48 #include <Eigen/Dense>
61 #ifdef FEVV_USE_OPENMESH
105 return "CGALPOINTSET";
107 #endif //FEVV_USE_CGAL
109 #ifdef FEVV_USE_OPENMESH
115 #endif //FEVV_USE_OPENMESH
123 #endif //FEVV_USE_AIF
129 return "PCLPOINTCLOUD";
131 #endif //FEVV_USE_PCL
147 template<
typename MeshT >
150 auto pair = std::make_pair(
static_cast< void*
>(m),
151 getDatastructureName(m));
153 std::cout <<
"[SimpleViewer] mesh " << pair.first
154 <<
" stored with datastructure " << pair.second
189 void init()
override;
191 bool isInit()
const override;
328 #if 0 //TODO-elo-rm-?-ask_MTO
338 HalfedgeGraph *getMesh(
unsigned int _position);
378 template<
typename HalfedgeGraph,
typename Po
intMap >
379 osg::ref_ptr< osg::Group >
383 std::string _mesh_file = std::string(
""),
384 osg::ref_ptr< osg::Group > _group =
new osg::Group);
386 template<
typename HalfedgeGraph,
typename Po
intMap >
390 std::string _mesh_file = std::string(
""));
392 template<
typename HalfedgeGraph,
typename Po
intMap >
395 PointMap *_pm =
nullptr,
396 std::string _mesh_file = std::string(
""));
398 template<
typename HalfedgeGraph >
404 template<
typename HalfedgeGraph >
407 bool _redraw =
false,
408 bool _recomputeNT_if_redraw =
false,
409 std::string _mesh_filename = std::string(
""),
410 bool _recreateOSGobj_if_redraw =
true,
419 const std::string &nameDrag1,
422 const std::string &nameDrag2,
439 template<
typename HalfedgeGraph,
typename Po
intMap >
444 std::vector< osg::ref_ptr< osg::Geometry > > &geometries,
445 std::vector< osg::ref_ptr< osg::Geometry > > &geometriesL,
446 std::vector< osg::ref_ptr< osg::Geometry > > &geometriesP,
447 std::vector< osg::ref_ptr< osg::Geometry > > &geometries_edges,
448 std::vector< osg::ref_ptr< osg::Geometry > > &geometries_vertices,
449 std::vector< osg::ref_ptr< osg::Geometry > > &geometries_normals,
450 std::vector< osg::ref_ptr< osg::Geometry > > &geometries_custom_vectors,
451 std::vector< osg::ref_ptr< osg::Vec3Array > > &vertexArrays,
452 std::vector< osg::ref_ptr< osg::Vec3Array > > &vertexArrays_edges,
453 std::vector< osg::ref_ptr< osg::Vec3Array > > &vertexArrays_vertices,
454 std::vector< osg::ref_ptr< osg::Vec3Array > > &vertexArrays_normals,
455 std::vector< osg::ref_ptr< osg::Vec3Array > > &vertexArrays_custom_vectors,
456 std::vector< osg::ref_ptr< osg::Vec3Array > > &normalsArrays,
457 std::vector< osg::ref_ptr< osg::Vec3Array > > &normalsArraysF,
458 std::vector< osg::ref_ptr< osg::Vec3Array > > &normalsArrays_edges,
459 std::vector< osg::ref_ptr< osg::Vec3Array > > &normalsArrays_vertices,
460 std::vector< osg::ref_ptr< osg::Vec3Array > > &tangentsArrays,
461 std::vector< osg::ref_ptr< osg::Vec4Array > > &colorsArrays,
462 std::vector< osg::ref_ptr< osg::Vec4Array > > &colorsArrays_edges,
463 std::vector< osg::ref_ptr< osg::Vec4Array > > &colorsArrays_vertices,
464 std::vector< osg::ref_ptr< osg::Vec4Array > > &colorsArrays_normals,
465 std::vector< osg::ref_ptr< osg::Vec4Array > > &colorsArrays_custom_vectors,
466 std::vector< osg::ref_ptr< osg::Vec2Array > > &texcoordsArrays,
468 std::string _mesh_file = std::string(
""));
481 template<
typename HalfedgeGraph,
typename Po
intMap >
485 std::vector< osg::ref_ptr< osg::Geometry > > &geometries,
486 std::vector< osg::ref_ptr< osg::Geometry > > &geometriesL,
487 std::vector< osg::ref_ptr< osg::Geometry > > &geometriesP,
488 std::vector< osg::ref_ptr< osg::Geometry > > &geometries_edges,
489 std::vector< osg::ref_ptr< osg::Geometry > > &geometries_vertices,
490 std::vector< osg::ref_ptr< osg::Geometry > > &geometries_normals,
491 std::vector< osg::ref_ptr< osg::Geometry > > &geometries_custom_vectors,
492 std::vector< osg::ref_ptr< osg::Vec3Array > > &vertexArrays,
493 std::vector< osg::ref_ptr< osg::Vec3Array > > &vertexArrays_edges,
494 std::vector< osg::ref_ptr< osg::Vec3Array > > &vertexArrays_vertices,
495 std::vector< osg::ref_ptr< osg::Vec3Array > > &vertexArrays_normals,
496 std::vector< osg::ref_ptr< osg::Vec3Array > > &vertexArrays_custom_vectors,
497 std::vector< osg::ref_ptr< osg::Vec3Array > > &normalsArrays,
498 std::vector< osg::ref_ptr< osg::Vec3Array > > &normalsArraysF,
499 std::vector< osg::ref_ptr< osg::Vec3Array > > &normalsArrays_edges,
500 std::vector< osg::ref_ptr< osg::Vec3Array > > &normalsArrays_vertices,
501 std::vector< osg::ref_ptr< osg::Vec3Array > > &tangentsArrays,
502 std::vector< osg::ref_ptr< osg::Vec4Array > > &colorsArrays,
503 std::vector< osg::ref_ptr< osg::Vec4Array > > &colorsArrays_edges,
504 std::vector< osg::ref_ptr< osg::Vec4Array > > &colorsArrays_vertices,
505 std::vector< osg::ref_ptr< osg::Vec4Array > > &colorsArrays_normals,
506 std::vector< osg::ref_ptr< osg::Vec4Array > > &colorsArrays_custom_vectors,
507 std::vector< osg::ref_ptr< osg::Vec2Array > > &texcoordsArrays,
509 std::string _mesh_file = std::string(
""));
523 template<
typename Po
intCloud,
typename Po
intMap >
528 std::vector< osg::ref_ptr< osg::Geometry > > &geometries,
529 std::vector< osg::ref_ptr< osg::Geometry > > &geometriesL,
530 std::vector< osg::ref_ptr< osg::Geometry > > &geometriesP,
531 std::vector< osg::ref_ptr< osg::Geometry > > &geometries_edges,
532 std::vector< osg::ref_ptr< osg::Geometry > > &geometries_vertices,
533 std::vector< osg::ref_ptr< osg::Geometry > > &geometries_normals,
534 std::vector< osg::ref_ptr< osg::Geometry > > &geometries_custom_vectorss,
535 std::vector< osg::ref_ptr< osg::Vec3Array > > &vertexArrays,
536 std::vector< osg::ref_ptr< osg::Vec3Array > > &vertexArrays_edges,
537 std::vector< osg::ref_ptr< osg::Vec3Array > > &vertexArrays_vertices,
538 std::vector< osg::ref_ptr< osg::Vec3Array > > &vertexArrays_normals,
539 std::vector< osg::ref_ptr< osg::Vec3Array > > &vertexArrays_custom_vectors,
540 std::vector< osg::ref_ptr< osg::Vec3Array > > &normalsArrays,
541 std::vector< osg::ref_ptr< osg::Vec3Array > > &normalsArraysF,
542 std::vector< osg::ref_ptr< osg::Vec3Array > > &normalsArrays_edges,
543 std::vector< osg::ref_ptr< osg::Vec3Array > > &normalsArrays_vertices,
544 std::vector< osg::ref_ptr< osg::Vec3Array > > &tangentsArrays,
545 std::vector< osg::ref_ptr< osg::Vec4Array > > &colorsArrays,
546 std::vector< osg::ref_ptr< osg::Vec4Array > > &colorsArrays_edges,
547 std::vector< osg::ref_ptr< osg::Vec4Array > > &colorsArrays_vertices,
548 std::vector< osg::ref_ptr< osg::Vec4Array > > &colorsArrays_normals,
549 std::vector< osg::ref_ptr< osg::Vec4Array > > &colorsArrays_custom_vectors,
550 std::vector< osg::ref_ptr< osg::Vec2Array > > &texcoordsArrays,
552 std::string _mesh_file = std::string(
""));
606 template<
typename HalfedgeGraph,
607 typename VertexNormalMap,
608 typename VertexTangentMap,
609 typename VertexColorMap,
610 typename FaceColorMap,
611 typename VertexUVMap,
612 typename HalfedgeUVMap,
613 typename FaceMaterialMap >
617 const std::vector< osg::ref_ptr< osg::Geometry > > &_geometries,
618 const std::vector< osg::ref_ptr< osg::Geometry > > &_geometries_edges,
619 const std::vector< osg::ref_ptr< osg::Geometry > > &_geometries_vertices,
620 const std::vector< osg::ref_ptr< osg::Geometry > > &_geometries_normals,
621 const std::vector< osg::ref_ptr< osg::Geometry > > &_geometries_custom_vectors,
622 const std::vector< osg::ref_ptr< osg::Vec3Array > > &_vertexArrays,
623 const std::vector< osg::ref_ptr< osg::Vec3Array > > &_vertexArrays_edges,
624 const std::vector< osg::ref_ptr< osg::Vec3Array > > &_vertexArrays_vertices,
625 const std::vector< osg::ref_ptr< osg::Vec3Array > > &_vertexArrays_normals,
626 const std::vector< osg::ref_ptr< osg::Vec3Array > > &_vertexArrays_custom_vectors,
627 const std::vector< osg::ref_ptr< osg::Vec3Array > > &_normalsArrays,
628 const std::vector< osg::ref_ptr< osg::Vec3Array > > &_normalsArrays_edges,
629 const std::vector< osg::ref_ptr< osg::Vec3Array > > &_normalsArrays_vertices,
630 const std::vector< osg::ref_ptr< osg::Vec3Array > > &_tangentsArrays,
631 const std::vector< osg::ref_ptr< osg::Vec2Array > > &_texcoordsArrays,
632 const std::vector< osg::ref_ptr< osg::Vec4Array > > &_colorsArrays,
633 const std::vector< osg::ref_ptr< osg::Vec4Array > > &_colorsArrays_edges,
634 const std::vector< osg::ref_ptr< osg::Vec4Array > > &_colorsArrays_vertices,
635 const std::vector< osg::ref_ptr< osg::Vec4Array > > &_colorsArrays_normals,
636 const std::vector< osg::ref_ptr< osg::Vec4Array > > &_colorsArrays_custom_vectors,
637 std::size_t _m_mm_size,
638 VertexNormalMap *_vt_nm,
639 VertexTangentMap *_vt_tm,
640 VertexColorMap *_vt_cm,
642 VertexUVMap *_vt_uv_m,
643 HalfedgeUVMap *_het_uv_m,
644 FaceMaterialMap *_m_mm,
645 bool has_face_color_map);
705 template<
typename HalfedgeGraph,
706 typename VertexNormalMap,
707 typename VertexColorMap,
708 typename FaceColorMap,
709 typename VertexUVMap,
710 typename HalfedgeUVMap,
711 typename FaceMaterialMap >
715 const std::vector< osg::ref_ptr< osg::Geometry > > &_geometries,
716 const std::vector< osg::ref_ptr< osg::Geometry > > &_geometries_edges,
717 const std::vector< osg::ref_ptr< osg::Geometry > > &_geometries_vertices,
718 const std::vector< osg::ref_ptr< osg::Geometry > > &_geometries_normals,
719 const std::vector< osg::ref_ptr< osg::Geometry > > &_geometries_custom_vectors,
720 const std::vector< osg::ref_ptr< osg::Vec3Array > > &_vertexArrays,
721 const std::vector< osg::ref_ptr< osg::Vec3Array > > &_vertexArrays_edges,
722 const std::vector< osg::ref_ptr< osg::Vec3Array > > &_vertexArrays_vertices,
723 const std::vector< osg::ref_ptr< osg::Vec3Array > > &_vertexArrays_normals,
724 const std::vector< osg::ref_ptr< osg::Vec3Array > > &_vertexArrays_custom_vectors,
725 const std::vector< osg::ref_ptr< osg::Vec3Array > > &_normalsArrays,
726 const std::vector< osg::ref_ptr< osg::Vec3Array > > &_normalsArrays_edges,
727 const std::vector< osg::ref_ptr< osg::Vec3Array > > &_normalsArrays_vertices,
728 const std::vector< osg::ref_ptr< osg::Vec2Array > > &_texcoordsArrays,
729 const std::vector< osg::ref_ptr< osg::Vec4Array > > &_colorsArrays,
730 const std::vector< osg::ref_ptr< osg::Vec4Array > > &_colorsArrays_edges,
731 const std::vector< osg::ref_ptr< osg::Vec4Array > > &_colorsArrays_vertices,
732 const std::vector< osg::ref_ptr< osg::Vec4Array > > &_colorsArrays_normals,
733 const std::vector< osg::ref_ptr< osg::Vec4Array > > &_colorsArrays_custom_vectors,
734 std::size_t _m_mm_size,
736 VertexNormalMap *_vt_nm,
737 VertexColorMap *_vt_cm,
739 VertexUVMap *_vt_uv_m,
740 HalfedgeUVMap *_het_uv_m,
741 FaceMaterialMap *_m_mm,
742 bool has_face_color_map);
745 std::vector< osg::ref_ptr< osg::Light > >
lights;
757 std::vector< std::vector< osg::ref_ptr< osg::Geometry > > >
v_geometries,
766 std::vector< std::vector< osg::ref_ptr< osg::Vec2Array > > >
771 osg::ref_ptr< osg::Group >
grid;
773 osg::ref_ptr< osg::Group >
hud;