@@ -93,19 +93,13 @@ class Basic_viewer : public CGAL::QGLViewer
9393 m_draw_cylinder_edge (false ),
9494 m_draw_sphere_vertex (false ),
9595 m_draw_mesh_triangles (false ),
96- m_geometry_feature_enabled (true ),
9796 m_flat_shading (true ),
9897 m_use_default_color (use_default_color),
9998 m_use_default_color_normal (false ),
10099 m_display_face_normal (false ),
101100 m_inverse_normal (inverse_normal),
101+ m_geometry_feature_enabled (true ),
102102 m_no_2D_mode (no_2D_mode),
103- m_size_vertices (1.0 ),
104- m_size_edges (1.0 ),
105- m_size_rays (1.0 ),
106- m_size_lines (1.0 ),
107- m_size_normals (0.2 ),
108- m_height_factor_normals (0.02 ),
109103 m_default_color_normal (220 , 60 , 20 ),
110104 m_ambient_color (0 .6f , 0 .5f , 0 .5f , 0 .5f ),
111105 m_are_buffers_initialized (false )
@@ -166,6 +160,21 @@ class Basic_viewer : public CGAL::QGLViewer
166160
167161 if (inverse_normal)
168162 { reverse_all_normals (); }
163+
164+ if (!buf.empty ())
165+ {
166+ auto & bbox=buf.bounding_box ();
167+ double d=CGAL::sqrt (CGAL::squared_distance
168+ (Local_point (bbox.xmin (), bbox.ymin (), bbox.zmin ()),
169+ Local_point (bbox.xmax (), bbox.ymax (), bbox.zmax ())));
170+ // std::cout<<"Length of the diagonal: "<<d<<std::endl;
171+ m_size_vertices=1.5 *d;
172+ m_size_edges=d;
173+ m_size_rays=m_size_edges;
174+ m_size_lines=m_size_edges;
175+ m_size_normals=d/3 ;
176+ m_height_factor_normals=0.02 ;
177+ }
169178 }
170179
171180 ~Basic_viewer ()
@@ -1867,13 +1876,12 @@ class Basic_viewer : public CGAL::QGLViewer
18671876 // filled by users but by the basic viewer.
18681877 std::vector<BufferType> m_array_for_clipping_plane;
18691878
1870- double m_size_vertices;
1871- double m_size_edges;
1872- double m_size_rays;
1873- double m_size_lines;
1874- double m_size_normals;
1875-
1876- double m_height_factor_normals;
1879+ double m_size_vertices=1 .;
1880+ double m_size_edges=1 .;
1881+ double m_size_rays=1 .;
1882+ double m_size_lines=1 .;
1883+ double m_size_normals=.2 ;
1884+ double m_height_factor_normals=.02 ;
18771885
18781886 CGAL::IO::Color m_default_color_normal;
18791887 QVector4D m_ambient_color;
0 commit comments