root/include/mesh/SphereMesh.hpp

/* [<][>][^][v][top][bottom][index][help] */

INCLUDED FROM


   1 #ifndef _SPHERE_MESH_HPP_
   2 #define _SPHERE_MESH_HPP_
   3 
   4 #include <osg/Shape>
   5 #include <osg/Geometry>
   6 #include <osg/Geode>
   7 #include <osg/Vec3d>
   8 #include <osg/ShapeDrawable>
   9 #include <osg/ref_ptr>
  10 #include <osgViewer/Viewer>
  11 #include <osgGA/TrackballManipulator>
  12 #include <osgViewer/ViewerEventHandlers>
  13 #include <osgUtil/Optimizer>
  14 #include <osgUtil/SmoothingVisitor>
  15 #include <osg/LOD>
  16 
  17 #include <cmath>
  18 #include <chrono>
  19 #include <fstream>
  20 #include <iostream>
  21 #include <tuple>
  22 #include <algorithm>
  23 #include <unordered_map>
  24 #include <string>
  25 #include <vector>
  26 
  27 using namespace std;
  28 using namespace osg;
  29 
  30 class SphereMesh
  31 {
  32 public:
  33 
  34     SphereMesh();
  35 
  36     Geometry *
  37     operator()( Vec3f        center
  38               , float        radius
  39               , unsigned int points
  40               , const Vec4&  color
  41               );
  42 
  43     void
  44     operator()( Vec3f        center
  45               , float        radius
  46               , Geometry  *  geometry
  47               , unsigned int points
  48               , const Vec4&  color
  49               );
  50 
  51 private:
  52 
  53     unordered_map< unsigned int
  54                  , const tuple< const Vec3Array * const
  55                               , const DrawElementsUShort * const
  56                               , const Vec3Array * const
  57                               >
  58                  > spheres;
  59 
  60     const tuple< const Vec3Array * const
  61                , const DrawElementsUShort * const
  62                , const Vec3Array * const
  63                >
  64     unit(unsigned int points = 10);
  65 };
  66 
  67 #endif /* _SPHERE_MESH_HPP_ */

/* [<][>][^][v][top][bottom][index][help] */