MEPP2 Project
SimpleViewer.h
Go to the documentation of this file.
1 // Copyright (c) 2012-2019 University of Lyon and CNRS (France).
2 // All rights reserved.
3 //
4 // This file is part of MEPP2; you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published
6 // by the Free Software Foundation; either version 3 of the License,
7 // or (at your option) any later version.
8 //
9 // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
10 // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
11 #pragma once
12 
13 #if __GNUC__ >= 9
14 #pragma GCC diagnostic push
15 #pragma GCC diagnostic ignored "-Wdeprecated-copy"
16 #endif
17 
18 #include <osgViewer/ViewerEventHandlers>
19 
20 #if __GNUC__ >= 9
21 #pragma GCC diagnostic pop
22 #endif
23 
24 #include "Base/Color.hpp"
26 
27 #include "Base/Texture.h"
28 
31 
32 #include <osg/Material>
33 
34 #include <osg/Texture2D>
35 #include <osgDB/ReadFile>
36 
37 // Generic mesh iterators
38 #include <boost/graph/graph_traits.hpp>
39 #include <boost/graph/properties.hpp>
42 #include <CGAL/boost/graph/properties.h> // included in External folder
43 
44 #include <iostream>
45 #include <map>
46 #include <utility>
47 
48 #include <Eigen/Dense> // for Eigen::matrix
49 
50 #ifdef FEVV_USE_CGAL
59 #endif
60 
61 #ifdef FEVV_USE_OPENMESH
64 #endif
65 
66 #ifdef FEVV_USE_AIF
69 #endif
70 
71 #ifdef FEVV_USE_PCL
74 #endif
75 
76 namespace FEVV {
77 
78 
83 #ifdef FEVV_USE_CGAL
84  inline
85  std::string getDatastructureName(FEVV::MeshPolyhedron* /*m*/)
86  {
87  return "POLYHEDRON";
88  }
89 
90  inline
91  std::string getDatastructureName(FEVV::MeshSurface* /*m*/)
92  {
93  return "SURFACEMESH";
94  }
95 
96  inline
97  std::string getDatastructureName(FEVV::MeshLCC* /*m*/)
98  {
99  return "LCC";
100  }
101 
102  inline
103  std::string getDatastructureName(FEVV::CGALPointSet* /*m*/)
104  {
105  return "CGALPOINTSET";
106  }
107 #endif //FEVV_USE_CGAL
108 
109 #ifdef FEVV_USE_OPENMESH
110  inline
111  std::string getDatastructureName(FEVV::MeshOpenMesh* /*m*/)
112  {
113  return "OPENMESH";
114  }
115 #endif //FEVV_USE_OPENMESH
116 
117 #ifdef FEVV_USE_AIF
118  inline
119  std::string getDatastructureName(FEVV::MeshAIF* /*m*/)
120  {
121  return "AIF";
122  }
123 #endif //FEVV_USE_AIF
124 
125 #ifdef FEVV_USE_PCL
126  inline
127  std::string getDatastructureName(FEVV::PCLPointCloud* /*m*/)
128  {
129  return "PCLPOINTCLOUD";
130  }
131 #endif //FEVV_USE_PCL
132 
133 
138 {
139 public:
140  typedef std::pair<void*, std::string> VoidMeshPtr;
141 
143  {
144  storage.push_back(ptr);
145  }
146 
147  template< typename MeshT >
148  void push_back(MeshT *m)
149  {
150  auto pair = std::make_pair(static_cast< void* >(m),
151  getDatastructureName(m));
152  storage.push_back(pair);
153  std::cout << "[SimpleViewer] mesh " << pair.first
154  << " stored with datastructure " << pair.second
155  << std::endl;
156  }
157 
158  std::size_t size(void)
159  {
160  return storage.size();
161  }
162 
163  VoidMeshPtr& operator[](std::size_t pos)
164  {
165  return storage[pos];
166  }
167 
168 protected:
169  std::vector< VoidMeshPtr > storage;
170 };
171 
172 
180 {
181 public:
185  SimpleViewer();
186 
187  ~SimpleViewer();
188 
189  void init() override;
190 
191  bool isInit() const override;
192 
193  bool isValid() const override;
194 
199  // bool isSelected() const override; MT -> JL : why this function ?
200 
201  // void attach( Widget* _widget );
202 
208  bool changeBackgroundColor(const Color &_color) override;
209 
217  bool saveScreenshot(const std::string &_name) override;
218 
226  void addModel(Model *_geode) override;
227 
235  void addGroup(Group *_group) override;
236 
237  void setNodeSelected(osg::Node *_geode, bool isSelected) override;
238  bool isNodeSelected(osg::Node *_geode) override;
239 
247  std::vector< osg::Geode * > getSelectedGeodes();
248 
256  std::vector< osg::Geode * > getGeodes();
257 
266 
275 
282  size_t getMeshId(const void *mesh_ptr);
283 
291  std::vector< std::string > getSelectedMeshesNames();
292 
300  std::vector< std::string > getMeshesNames();
301 
309  std::vector< PMapsContainer * > getSelected_properties_maps();
310 
318  std::vector< PMapsContainer * > get_properties_maps();
319 
320 
321  std::vector< osg::Group * > getSelectedDraggers1();
322  std::vector< osg::Group * > getDraggers1();
323 
324  std::vector< osg::Group * > getSelectedDraggers2();
325  std::vector< osg::Group * > getDraggers2();
326 
327 
328 #if 0 //TODO-elo-rm-?-ask_MTO
329 
338  HalfedgeGraph *getMesh(unsigned int _position);
339 #endif
340 
341  DataModelVector *getDataModel() override;
342 
343 
353  osg::Matrix getTransformMatrixOsg(unsigned int position);
354  Eigen::Matrix4d getTransformMatrixEigen(unsigned int position);
355 
363  void resetTransformMatrix(unsigned int position);
364 
365 
378  template< typename HalfedgeGraph, typename PointMap >
379  osg::ref_ptr< osg::Group >
380  createMesh(HalfedgeGraph *_g,
381  PMapsContainer *_pmaps,
382  PointMap *_pm,
383  std::string _mesh_file = std::string(""),
384  osg::ref_ptr< osg::Group > _group = new osg::Group);
385 
386  template< typename HalfedgeGraph, typename PointMap >
387  void drawMesh(HalfedgeGraph *_g,
388  PMapsContainer *_pmaps,
389  PointMap *_pm,
390  std::string _mesh_file = std::string(""));
391 
392  template< typename HalfedgeGraph, typename PointMap >
393  void redrawMesh(HalfedgeGraph *_g,
394  PMapsContainer *_pmaps,
395  PointMap *_pm = nullptr,
396  std::string _mesh_file = std::string(""));
397 
398  template< typename HalfedgeGraph >
399  void centerMesh(HalfedgeGraph *_g);
400 
401  osg::Matrix getMatrixVP();
402  void setMatrixVP(osg::Matrix matrix);
403 
404  template< typename HalfedgeGraph >
405  void draw_or_redraw_mesh(/*const */ HalfedgeGraph *_g,
406  /*const */ PMapsContainer *_pmaps,
407  bool _redraw = false,
408  bool _recomputeNT_if_redraw = false,
409  std::string _mesh_filename = std::string(""),
410  bool _recreateOSGobj_if_redraw = true,
411  float _step = 0.);
412 
413  void activate_time_mode();
414  void activate_space_mode();
415 
416  void updateSWModelList();
417 
418  osg::Node *addDraggersToScene(osg::Node *scene,
419  const std::string &nameDrag1,
420  float fScaleDrag1,
421  char keyDrag1,
422  const std::string &nameDrag2,
423  float fScaleDrag2,
424  char keyDrag2);
425 
426 protected:
439  template< typename HalfedgeGraph, typename PointMap >
440  void internal_createMesh(
441  osg::Geode *&geode,
442  HalfedgeGraph *_g,
443  PMapsContainer *_pmaps,
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,
467  PointMap *_pm,
468  std::string _mesh_file = std::string(""));
481  template< typename HalfedgeGraph, typename PointMap >
482  osg::Geode *internal_createMesh(
483  HalfedgeGraph *_g,
484  PMapsContainer *_pmaps,
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,
508  PointMap *_pm,
509  std::string _mesh_file = std::string(""));
510 
523  template< typename PointCloud, typename PointMap >
525  osg::Geode *&geode,
526  PointCloud *_g,
527  PMapsContainer *_pmaps,
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,
551  PointMap *_pm,
552  std::string _mesh_file = std::string(""));
553 
554 private:
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 >
615  osg::Geode *_geode,
616  HalfedgeGraph *_g,
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,
641  FaceColorMap *_f_cm,
642  VertexUVMap *_vt_uv_m,
643  HalfedgeUVMap *_het_uv_m,
644  FaceMaterialMap *_m_mm,
645  bool has_face_color_map);
646 
705  template< typename HalfedgeGraph,
706  typename VertexNormalMap,
707  typename VertexColorMap,
708  typename FaceColorMap,
709  typename VertexUVMap,
710  typename HalfedgeUVMap,
711  typename FaceMaterialMap >
713  osg::Geode *_geode,
714  HalfedgeGraph *_g,
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,
735  int _texture_type,
736  VertexNormalMap *_vt_nm,
737  VertexColorMap *_vt_cm,
738  FaceColorMap *_f_cm,
739  VertexUVMap *_vt_uv_m,
740  HalfedgeUVMap *_het_uv_m,
741  FaceMaterialMap *_m_mm,
742  bool has_face_color_map);
743 
744  // List of lights used in the scene
745  std::vector< osg::ref_ptr< osg::Light > > lights;
746 
747 protected:
749 
750  std::vector< std::string > v_meshes_names;
751  std::vector< PMapsContainer * > v_properties_maps;
752  std::vector< osg::Group * > v_draggers1;
753  std::vector< osg::Group * > v_draggers2;
754  std::vector< bool > v_meshIsSelected;
755  std::vector< osg::Geode * > v_geodes;
756 
757  std::vector< std::vector< osg::ref_ptr< osg::Geometry > > > v_geometries,
759  std::vector< std::vector< osg::ref_ptr< osg::Vec3Array > > > v_vertexArrays,
761  std::vector< std::vector< osg::ref_ptr< osg::Vec3Array > > > v_normalsArrays,
763  std::vector< std::vector< osg::ref_ptr< osg::Vec3Array > > > v_tangentsArrays;
764  std::vector< std::vector< osg::ref_ptr< osg::Vec4Array > > > v_colorsArrays,
766  std::vector< std::vector< osg::ref_ptr< osg::Vec2Array > > >
768 
769 public:
770  osg::ref_ptr< osg::Group > gizmo;
771  osg::ref_ptr< osg::Group > grid;
772 
773  osg::ref_ptr< osg::Group > hud;
774  osg::ref_ptr< osgText::Text > hudText;
775 
776  int i_time;
778 };
779 
780 } // namespace FEVV
781 
784 
785 #ifdef FEVV_USE_CGAL
787 #endif
788 
789 #ifdef FEVV_USE_PCL
791 #endif
FEVV::SimpleViewer::activate_time_mode
void activate_time_mode()
Definition: SimpleViewer.inl:3456
FEVV::SimpleViewer::v_vertexArrays
std::vector< std::vector< osg::ref_ptr< osg::Vec3Array > > > v_vertexArrays
Definition: SimpleViewer.h:759
Graph_traits_extension_aif.h
FEVV::SimpleViewer::changeBackgroundColor
bool changeBackgroundColor(const Color &_color) override
Definition: SimpleViewer.inl:285
FEVV::SimpleViewer::addGroup
void addGroup(Group *_group) override
Definition: SimpleViewer.inl:348
FEVV::CGALPointSet
CGAL::Point_set_3< CGALPointSetPoint > CGALPointSet
Definition: DataStructures_cgal_point_set.h:71
FEVV::SimpleViewer::v_colorsArrays_edges
std::vector< std::vector< osg::ref_ptr< osg::Vec4Array > > > v_colorsArrays_edges
Definition: SimpleViewer.h:765
FEVV::SimpleViewer::v_geometriesL
std::vector< std::vector< osg::ref_ptr< osg::Geometry > > > v_geometriesL
Definition: SimpleViewer.h:758
FEVV::SimpleViewer::getSelectedMeshes
MixedMeshesVector getSelectedMeshes()
Definition: SimpleViewer.inl:402
BaseViewerOSG.h
FEVV::SimpleViewer::getSelected_properties_maps
std::vector< PMapsContainer * > getSelected_properties_maps()
Definition: SimpleViewer.inl:456
FEVV::SimpleViewer::v_normalsArrays_vertices
std::vector< std::vector< osg::ref_ptr< osg::Vec3Array > > > v_normalsArrays_vertices
Definition: SimpleViewer.h:762
FEVV::MeshLCC
CGAL::Linear_cell_complex_for_combinatorial_map< 2, 3, CGALLCCTraits, CGALItem > MeshLCC
Definition: DataStructures_cgal_linear_cell_complex.h:43
FEVV::SimpleViewer::~SimpleViewer
~SimpleViewer()
Definition: SimpleViewer.inl:56
FEVV::MixedMeshesVector::push_back
void push_back(MeshT *m)
Definition: SimpleViewer.h:148
FEVV::SimpleViewer::getSelectedMeshesNames
std::vector< std::string > getSelectedMeshesNames()
Definition: SimpleViewer.inl:429
FEVV::SimpleViewer::v_colorsArrays
std::vector< std::vector< osg::ref_ptr< osg::Vec4Array > > > v_colorsArrays
Definition: SimpleViewer.h:764
FEVV::SimpleViewer::v_geometries_vertices
std::vector< std::vector< osg::ref_ptr< osg::Geometry > > > v_geometries_vertices
Definition: SimpleViewer.h:758
FEVV::SimpleViewer::v_normalsArrays
std::vector< std::vector< osg::ref_ptr< osg::Vec3Array > > > v_normalsArrays
Definition: SimpleViewer.h:761
FEVV::SimpleViewer::getSelectedGeodes
std::vector< osg::Geode * > getSelectedGeodes()
Definition: SimpleViewer.inl:375
MeshLoading.inl
FEVV::BaseViewerOSG::Model
osg::Geode Model
Definition: BaseViewerOSG.h:51
FEVV::BaseViewerOSG
Definition: BaseViewerOSG.h:47
DataVisitor.h
FEVV::BaseViewerOSG::DataModelVector
DataVisitor::Output DataModelVector
Definition: BaseViewerOSG.h:50
FEVV::PCLPointCloud
pcl::PointCloud< PCLEnrichedPoint > PCLPointCloud
Definition: DataStructures_pcl_point_cloud.h:28
Graph_traits_extension_cgal_surface_mesh.h
FEVV::SimpleViewer::SimpleViewer
SimpleViewer()
Definition: SimpleViewer.inl:43
FEVV::SimpleViewer::saveScreenshot
bool saveScreenshot(const std::string &_name) override
Definition: SimpleViewer.inl:312
FEVV::SimpleViewer::createMesh
osg::ref_ptr< osg::Group > createMesh(HalfedgeGraph *_g, PMapsContainer *_pmaps, PointMap *_pm, std::string _mesh_file=std::string(""), osg::ref_ptr< osg::Group > _group=new osg::Group)
Definition: SimpleViewer.inl:2996
properties_linear_cell_complex.h
FEVV::MixedMeshesVector
Functions to retrieve the name of the datastructure according to the mesh type.
Definition: SimpleViewer.h:138
FEVV::MixedMeshesVector::size
std::size_t size(void)
Definition: SimpleViewer.h:158
FEVV::SimpleViewer::v_colorsArrays_custom_vectors
std::vector< std::vector< osg::ref_ptr< osg::Vec4Array > > > v_colorsArrays_custom_vectors
Definition: SimpleViewer.h:765
FEVV::MeshSurface
CGAL::Surface_mesh< CGALPoint > MeshSurface
Definition: DataStructures_cgal_surface_mesh.h:23
FEVV::SimpleViewer::addDraggersToScene
osg::Node * addDraggersToScene(osg::Node *scene, const std::string &nameDrag1, float fScaleDrag1, char keyDrag1, const std::string &nameDrag2, float fScaleDrag2, char keyDrag2)
Definition: SimpleViewer.inl:2918
FEVV::SimpleViewer::v_draggers1
std::vector< osg::Group * > v_draggers1
Definition: SimpleViewer.h:752
FEVV::SimpleViewer::resetTransformMatrix
void resetTransformMatrix(unsigned int position)
Definition: SimpleViewer.inl:3400
FEVV::MixedMeshesVector::VoidMeshPtr
std::pair< void *, std::string > VoidMeshPtr
Definition: SimpleViewer.h:140
FEVV::SimpleViewer::init
void init() override
Definition: SimpleViewer.inl:184
FEVV::SimpleViewer::getDataModel
DataModelVector * getDataModel() override
Definition: SimpleViewer.inl:363
properties_aif.h
Graph_traits_extension_cgal_linear_cell_complex.h
FEVV::SimpleViewer::activate_space_mode
void activate_space_mode()
Definition: SimpleViewer.inl:3468
FEVV::PMapsContainer
std::map< std::string, boost::any > PMapsContainer
Definition: properties.h:99
FEVV::SimpleViewer::v_normalsArraysF
std::vector< std::vector< osg::ref_ptr< osg::Vec3Array > > > v_normalsArraysF
Definition: SimpleViewer.h:762
FEVV::SimpleViewer::draw_or_redraw_mesh
void draw_or_redraw_mesh(HalfedgeGraph *_g, PMapsContainer *_pmaps, bool _redraw=false, bool _recomputeNT_if_redraw=false, std::string _mesh_filename=std::string(""), bool _recreateOSGobj_if_redraw=true, float _step=0.)
Definition: SimpleViewer.inl:3415
FEVV::SimpleViewer::v_geometriesP
std::vector< std::vector< osg::ref_ptr< osg::Geometry > > > v_geometriesP
Definition: SimpleViewer.h:758
FEVV::SimpleViewer::v_mixed_meshes
MixedMeshesVector v_mixed_meshes
Definition: SimpleViewer.h:748
FEVV::SimpleViewer::setNodeSelected
void setNodeSelected(osg::Node *_geode, bool isSelected) override
Definition: SimpleViewer.inl:3492
FEVV::SimpleViewer::updateSWModelList
void updateSWModelList()
Definition: SimpleViewer.inl:3480
FEVV::SimpleViewer
SimpleViewer is a specialization of osgViewer::CompositeViewer. This class is a widget where we are a...
Definition: SimpleViewer.h:180
FEVV::BaseViewerOSG::Group
osg::Group Group
Definition: BaseViewerOSG.h:52
properties_polyhedron_3.h
FEVV::SimpleViewer::v_texcoordsArrays
std::vector< std::vector< osg::ref_ptr< osg::Vec2Array > > > v_texcoordsArrays
Definition: SimpleViewer.h:767
FEVV::SimpleViewer::getDraggers2
std::vector< osg::Group * > getDraggers2()
Definition: SimpleViewer.inl:529
FEVV::SimpleViewer::getMeshes
MixedMeshesVector getMeshes()
Definition: SimpleViewer.inl:421
FEVV::SimpleViewer::v_vertexArrays_vertices
std::vector< std::vector< osg::ref_ptr< osg::Vec3Array > > > v_vertexArrays_vertices
Definition: SimpleViewer.h:760
OSGHelpers.h
FEVV
Interfaces for plugins These interfaces will be used for different plugins.
Definition: Assert.h:16
FEVV::SimpleViewer::getSelectedDraggers2
std::vector< osg::Group * > getSelectedDraggers2()
Definition: SimpleViewer.inl:510
FEVV::SimpleViewer::v_geometries_edges
std::vector< std::vector< osg::ref_ptr< osg::Geometry > > > v_geometries_edges
Definition: SimpleViewer.h:758
FEVV::SimpleViewer::v_geometries_custom_vectors
std::vector< std::vector< osg::ref_ptr< osg::Geometry > > > v_geometries_custom_vectors
Definition: SimpleViewer.h:758
Graph_traits_extension_cgal_point_set.h
properties_surface_mesh.h
FEVV::SimpleViewer::isValid
bool isValid() const override
Definition: SimpleViewer.inl:263
Graph_traits_extension_pcl_point_cloud.h
FEVV::Color
Definition: Color.hpp:18
FEVV::SimpleViewer::v_vertexArrays_custom_vectors
std::vector< std::vector< osg::ref_ptr< osg::Vec3Array > > > v_vertexArrays_custom_vectors
Definition: SimpleViewer.h:760
FEVV::SimpleViewer::hudText
osg::ref_ptr< osgText::Text > hudText
Definition: SimpleViewer.h:774
FEVV::SimpleViewer::isNodeSelected
bool isNodeSelected(osg::Node *_geode) override
Definition: SimpleViewer.inl:3584
FEVV::SimpleViewer::getMatrixVP
osg::Matrix getMatrixVP()
Definition: SimpleViewer.inl:3310
FEVV::SimpleViewer::v_draggers2
std::vector< osg::Group * > v_draggers2
Definition: SimpleViewer.h:753
Geometry_traits.h
FEVV::SimpleViewer::v_properties_maps
std::vector< PMapsContainer * > v_properties_maps
Definition: SimpleViewer.h:751
FEVV::SimpleViewer::redrawMesh
void redrawMesh(HalfedgeGraph *_g, PMapsContainer *_pmaps, PointMap *_pm=nullptr, std::string _mesh_file=std::string(""))
Definition: SimpleViewer.inl:3127
FEVV::MixedMeshesVector::push_back
void push_back(VoidMeshPtr &ptr)
Definition: SimpleViewer.h:142
Graph_traits_extension_cgal_polyhedron_3.h
FEVV::SimpleViewer::getGeodes
std::vector< osg::Geode * > getGeodes()
Definition: SimpleViewer.inl:394
FEVV::SimpleViewer::v_geometries
std::vector< std::vector< osg::ref_ptr< osg::Geometry > > > v_geometries
Definition: SimpleViewer.h:757
FEVV::SimpleViewer::v_tangentsArrays
std::vector< std::vector< osg::ref_ptr< osg::Vec3Array > > > v_tangentsArrays
Definition: SimpleViewer.h:763
FEVV::SimpleViewer::get_properties_maps
std::vector< PMapsContainer * > get_properties_maps()
Definition: SimpleViewer.inl:475
properties_pcl_point_cloud.h
FEVV::SimpleViewer::v_meshes_names
std::vector< std::string > v_meshes_names
Definition: SimpleViewer.h:750
SimpleViewer.inl
FEVV::SimpleViewer::setMatrixVP
void setMatrixVP(osg::Matrix matrix)
Definition: SimpleViewer.inl:3339
FEVV::SimpleViewer::v_colorsArrays_normals
std::vector< std::vector< osg::ref_ptr< osg::Vec4Array > > > v_colorsArrays_normals
Definition: SimpleViewer.h:765
FEVV::SimpleViewer::getTransformMatrixOsg
osg::Matrix getTransformMatrixOsg(unsigned int position)
Definition: SimpleViewer.inl:3364
FEVV::SimpleViewer::getTransformMatrixEigen
Eigen::Matrix4d getTransformMatrixEigen(unsigned int position)
Definition: SimpleViewer.inl:3379
FEVV::SimpleViewer::lights
std::vector< osg::ref_ptr< osg::Light > > lights
Definition: SimpleViewer.h:745
FEVV::BaseViewerOSG::isSelected
virtual bool isSelected() const
Definition: BaseViewer.h:118
Graph_traits_extension_openmesh.h
properties_openmesh.h
FEVV::SimpleViewer::i_time
int i_time
Definition: SimpleViewer.h:776
FEVV::SimpleViewer::isInit
bool isInit() const override
Definition: SimpleViewer.inl:255
FEVV::SimpleViewer::internal_createMesh_pointcloud
void internal_createMesh_pointcloud(osg::Geode *&geode, PointCloud *_g, PMapsContainer *_pmaps, std::vector< osg::ref_ptr< osg::Geometry > > &geometries, std::vector< osg::ref_ptr< osg::Geometry > > &geometriesL, std::vector< osg::ref_ptr< osg::Geometry > > &geometriesP, std::vector< osg::ref_ptr< osg::Geometry > > &geometries_edges, std::vector< osg::ref_ptr< osg::Geometry > > &geometries_vertices, std::vector< osg::ref_ptr< osg::Geometry > > &geometries_normals, std::vector< osg::ref_ptr< osg::Geometry > > &geometries_custom_vectorss, std::vector< osg::ref_ptr< osg::Vec3Array > > &vertexArrays, std::vector< osg::ref_ptr< osg::Vec3Array > > &vertexArrays_edges, std::vector< osg::ref_ptr< osg::Vec3Array > > &vertexArrays_vertices, std::vector< osg::ref_ptr< osg::Vec3Array > > &vertexArrays_normals, std::vector< osg::ref_ptr< osg::Vec3Array > > &vertexArrays_custom_vectors, std::vector< osg::ref_ptr< osg::Vec3Array > > &normalsArrays, std::vector< osg::ref_ptr< osg::Vec3Array > > &normalsArraysF, std::vector< osg::ref_ptr< osg::Vec3Array > > &normalsArrays_edges, std::vector< osg::ref_ptr< osg::Vec3Array > > &normalsArrays_vertices, std::vector< osg::ref_ptr< osg::Vec3Array > > &tangentsArrays, std::vector< osg::ref_ptr< osg::Vec4Array > > &colorsArrays, std::vector< osg::ref_ptr< osg::Vec4Array > > &colorsArrays_edges, std::vector< osg::ref_ptr< osg::Vec4Array > > &colorsArrays_vertices, std::vector< osg::ref_ptr< osg::Vec4Array > > &colorsArrays_normals, std::vector< osg::ref_ptr< osg::Vec4Array > > &colorsArrays_custom_vectors, std::vector< osg::ref_ptr< osg::Vec2Array > > &texcoordsArrays, PointMap *_pm, std::string _mesh_file=std::string(""))
Definition: SimpleViewer.inl:2079
FEVV::MeshOpenMesh
OpenMesh::PolyMesh_ArrayKernelT< MyTraits > MeshOpenMesh
Definition: DataStructures_openmesh.h:51
Texture.h
FEVV::SimpleViewer::gizmo
osg::ref_ptr< osg::Group > gizmo
Definition: SimpleViewer.h:770
Color.hpp
FEVV::DataStructures::AIF::AIFMesh
This class represents an AIF structure. AIF structure can deal with both manifold and non-manifold su...
Definition: AIFMesh.hpp:47
FEVV::MixedMeshesVector::operator[]
VoidMeshPtr & operator[](std::size_t pos)
Definition: SimpleViewer.h:163
Graph_traits_extension.h
FEVV::SimpleViewer::current_i_time
int current_i_time
Definition: SimpleViewer.h:777
FEVV::SimpleViewer::v_geodes
std::vector< osg::Geode * > v_geodes
Definition: SimpleViewer.h:755
FEVV::SimpleViewer::v_meshIsSelected
std::vector< bool > v_meshIsSelected
Definition: SimpleViewer.h:754
FEVV::SimpleViewer::hud
osg::ref_ptr< osg::Group > hud
Definition: SimpleViewer.h:773
FEVV::SimpleViewer::v_geometries_normals
std::vector< std::vector< osg::ref_ptr< osg::Geometry > > > v_geometries_normals
Definition: SimpleViewer.h:758
SimpleViewerCGALPointSet.inl
FEVV::SimpleViewer::v_colorsArrays_vertices
std::vector< std::vector< osg::ref_ptr< osg::Vec4Array > > > v_colorsArrays_vertices
Definition: SimpleViewer.h:765
FEVV::SimpleViewer::getSelectedDraggers1
std::vector< osg::Group * > getSelectedDraggers1()
Definition: SimpleViewer.inl:483
FEVV::SimpleViewer::grid
osg::ref_ptr< osg::Group > grid
Definition: SimpleViewer.h:771
FEVV::SimpleViewer::v_vertexArrays_normals
std::vector< std::vector< osg::ref_ptr< osg::Vec3Array > > > v_vertexArrays_normals
Definition: SimpleViewer.h:760
FEVV::SimpleViewer::centerMesh
void centerMesh(HalfedgeGraph *_g)
Definition: SimpleViewer.inl:3245
properties_cgal_point_set.h
FEVV::SimpleViewer::getMeshesNames
std::vector< std::string > getMeshesNames()
Definition: SimpleViewer.inl:448
FEVV::SimpleViewer::addModel
void addModel(Model *_geode) override
Definition: SimpleViewer.inl:333
FEVV::SimpleViewer::v_vertexArrays_edges
std::vector< std::vector< osg::ref_ptr< osg::Vec3Array > > > v_vertexArrays_edges
Definition: SimpleViewer.h:760
FEVV::SimpleViewer::internal_loadLegacyMesh
void internal_loadLegacyMesh(osg::Geode *_geode, HalfedgeGraph *_g, const std::vector< osg::ref_ptr< osg::Geometry > > &_geometries, const std::vector< osg::ref_ptr< osg::Geometry > > &_geometries_edges, const std::vector< osg::ref_ptr< osg::Geometry > > &_geometries_vertices, const std::vector< osg::ref_ptr< osg::Geometry > > &_geometries_normals, const std::vector< osg::ref_ptr< osg::Geometry > > &_geometries_custom_vectors, const std::vector< osg::ref_ptr< osg::Vec3Array > > &_vertexArrays, const std::vector< osg::ref_ptr< osg::Vec3Array > > &_vertexArrays_edges, const std::vector< osg::ref_ptr< osg::Vec3Array > > &_vertexArrays_vertices, const std::vector< osg::ref_ptr< osg::Vec3Array > > &_vertexArrays_normals, const std::vector< osg::ref_ptr< osg::Vec3Array > > &_vertexArrays_custom_vectors, const std::vector< osg::ref_ptr< osg::Vec3Array > > &_normalsArrays, const std::vector< osg::ref_ptr< osg::Vec3Array > > &_normalsArrays_edges, const std::vector< osg::ref_ptr< osg::Vec3Array > > &_normalsArrays_vertices, const std::vector< osg::ref_ptr< osg::Vec2Array > > &_texcoordsArrays, const std::vector< osg::ref_ptr< osg::Vec4Array > > &_colorsArrays, const std::vector< osg::ref_ptr< osg::Vec4Array > > &_colorsArrays_edges, const std::vector< osg::ref_ptr< osg::Vec4Array > > &_colorsArrays_vertices, const std::vector< osg::ref_ptr< osg::Vec4Array > > &_colorsArrays_normals, const std::vector< osg::ref_ptr< osg::Vec4Array > > &_colorsArrays_custom_vectors, std::size_t _m_mm_size, int _texture_type, VertexNormalMap *_vt_nm, VertexColorMap *_vt_cm, FaceColorMap *_f_cm, VertexUVMap *_vt_uv_m, HalfedgeUVMap *_het_uv_m, FaceMaterialMap *_m_mm, bool has_face_color_map)
Definition: MeshLoading.inl:1050
FEVV::SimpleViewer::internal_loadShadedMesh
void internal_loadShadedMesh(osg::Geode *_geode, HalfedgeGraph *_g, const std::vector< osg::ref_ptr< osg::Geometry > > &_geometries, const std::vector< osg::ref_ptr< osg::Geometry > > &_geometries_edges, const std::vector< osg::ref_ptr< osg::Geometry > > &_geometries_vertices, const std::vector< osg::ref_ptr< osg::Geometry > > &_geometries_normals, const std::vector< osg::ref_ptr< osg::Geometry > > &_geometries_custom_vectors, const std::vector< osg::ref_ptr< osg::Vec3Array > > &_vertexArrays, const std::vector< osg::ref_ptr< osg::Vec3Array > > &_vertexArrays_edges, const std::vector< osg::ref_ptr< osg::Vec3Array > > &_vertexArrays_vertices, const std::vector< osg::ref_ptr< osg::Vec3Array > > &_vertexArrays_normals, const std::vector< osg::ref_ptr< osg::Vec3Array > > &_vertexArrays_custom_vectors, const std::vector< osg::ref_ptr< osg::Vec3Array > > &_normalsArrays, const std::vector< osg::ref_ptr< osg::Vec3Array > > &_normalsArrays_edges, const std::vector< osg::ref_ptr< osg::Vec3Array > > &_normalsArrays_vertices, const std::vector< osg::ref_ptr< osg::Vec3Array > > &_tangentsArrays, const std::vector< osg::ref_ptr< osg::Vec2Array > > &_texcoordsArrays, const std::vector< osg::ref_ptr< osg::Vec4Array > > &_colorsArrays, const std::vector< osg::ref_ptr< osg::Vec4Array > > &_colorsArrays_edges, const std::vector< osg::ref_ptr< osg::Vec4Array > > &_colorsArrays_vertices, const std::vector< osg::ref_ptr< osg::Vec4Array > > &_colorsArrays_normals, const std::vector< osg::ref_ptr< osg::Vec4Array > > &_colorsArrays_custom_vectors, std::size_t _m_mm_size, VertexNormalMap *_vt_nm, VertexTangentMap *_vt_tm, VertexColorMap *_vt_cm, FaceColorMap *_f_cm, VertexUVMap *_vt_uv_m, HalfedgeUVMap *_het_uv_m, FaceMaterialMap *_m_mm, bool has_face_color_map)
Definition: MeshLoading.inl:615
FEVV::MeshPolyhedron
CGAL::Polyhedron_3< CGALKernel, CGAL::Polyhedron_items_with_id_3 > MeshPolyhedron
Definition: DataStructures_cgal_polyhedron_3.h:33
FEVV::SimpleViewer::v_normalsArrays_edges
std::vector< std::vector< osg::ref_ptr< osg::Vec3Array > > > v_normalsArrays_edges
Definition: SimpleViewer.h:762
FEVV::MixedMeshesVector::storage
std::vector< VoidMeshPtr > storage
Definition: SimpleViewer.h:169
FEVV::SimpleViewer::drawMesh
void drawMesh(HalfedgeGraph *_g, PMapsContainer *_pmaps, PointMap *_pm, std::string _mesh_file=std::string(""))
Definition: SimpleViewer.inl:3100
SimpleViewerPCLPointCloud.inl
FEVV::SimpleViewer::getMeshId
size_t getMeshId(const void *mesh_ptr)
Definition: SimpleViewer.inl:3606
FEVV::SimpleViewer::internal_createMesh
void internal_createMesh(osg::Geode *&geode, HalfedgeGraph *_g, PMapsContainer *_pmaps, std::vector< osg::ref_ptr< osg::Geometry > > &geometries, std::vector< osg::ref_ptr< osg::Geometry > > &geometriesL, std::vector< osg::ref_ptr< osg::Geometry > > &geometriesP, std::vector< osg::ref_ptr< osg::Geometry > > &geometries_edges, std::vector< osg::ref_ptr< osg::Geometry > > &geometries_vertices, std::vector< osg::ref_ptr< osg::Geometry > > &geometries_normals, std::vector< osg::ref_ptr< osg::Geometry > > &geometries_custom_vectors, std::vector< osg::ref_ptr< osg::Vec3Array > > &vertexArrays, std::vector< osg::ref_ptr< osg::Vec3Array > > &vertexArrays_edges, std::vector< osg::ref_ptr< osg::Vec3Array > > &vertexArrays_vertices, std::vector< osg::ref_ptr< osg::Vec3Array > > &vertexArrays_normals, std::vector< osg::ref_ptr< osg::Vec3Array > > &vertexArrays_custom_vectors, std::vector< osg::ref_ptr< osg::Vec3Array > > &normalsArrays, std::vector< osg::ref_ptr< osg::Vec3Array > > &normalsArraysF, std::vector< osg::ref_ptr< osg::Vec3Array > > &normalsArrays_edges, std::vector< osg::ref_ptr< osg::Vec3Array > > &normalsArrays_vertices, std::vector< osg::ref_ptr< osg::Vec3Array > > &tangentsArrays, std::vector< osg::ref_ptr< osg::Vec4Array > > &colorsArrays, std::vector< osg::ref_ptr< osg::Vec4Array > > &colorsArrays_edges, std::vector< osg::ref_ptr< osg::Vec4Array > > &colorsArrays_vertices, std::vector< osg::ref_ptr< osg::Vec4Array > > &colorsArrays_normals, std::vector< osg::ref_ptr< osg::Vec4Array > > &colorsArrays_custom_vectors, std::vector< osg::ref_ptr< osg::Vec2Array > > &texcoordsArrays, PointMap *_pm, std::string _mesh_file=std::string(""))
Definition: SimpleViewer.inl:616
FEVV::SimpleViewer::getDraggers1
std::vector< osg::Group * > getDraggers1()
Definition: SimpleViewer.inl:502