mirror of https://github.com/CGAL/cgal
basic viewer user manual
This commit is contained in:
parent
102f1595e8
commit
785f301cda
|
|
@ -93,21 +93,25 @@ The result of this example can be shown in \cgalFigureRef{basic_viewer_ex3} wher
|
|||
Example of mesh drawing with a color for each face computed thanks to its height.
|
||||
\cgalFigureEnd
|
||||
|
||||
\section Graphic_Scene
|
||||
|
||||
It is possible to do more advanced visualisations by using the class `CGAL::Graphics_scene`. Its goal is to be a container class for various geometric elements, such as points, segments, rays, lines, faces and texts. It provides several methods to add elements (points, segments, rays, lines, text), possibly with colors. Things are a little bit different for faces. You should call `face_begin` to start a new face (possibly with a color), add all the points in the face by using `add_point_in_face` as many times as necessary, then call `face_end` to finish the face. Note that the given polygonal face is internally triangulated.
|
||||
|
||||
This class also stores the normal of the faces (computed automatically), and possibly the normal of the vertices that should be given by the users.
|
||||
|
||||
Users can either fill directly a `Graphics_scene` using these methods, or by using a global function `CGAL::add_to_graphics_scene` that fill the scene using all the geometric elements of the given CGAL data structure. Like for the draw functions, there is one `add_to_graphics_scene` for each CGAL data structure (Arrangement_on_surface_2, Boolean_set_operations_2, Linear_cell_complex, Nef_3, Periodic_2_triangulation_2, Point_set_3, Polygon, Polyhedron, Straight_skeleton_2, Surface_mesh, Triangulation_2, Triangulation_3, Voronoi_diagram_2).
|
||||
|
||||
A `Graphics_scene` can be drawn using the basic viewer thanks to the `CGAL::draw_graphics_scene` function.
|
||||
|
||||
The following example illustrates this possibility by showing in a same viewer both a `CGAL::Point_set_3` and a `CGAL::Polyhedron_3`. Note that, like the draw functions, each `add_to_graphics_scene` can use an optional Graphics_scene_options as parameter allowing to tune the drawing of the given data structure. In the example, we use this possibility to change the color of all vertices of the point set.
|
||||
|
||||
\cgalExample{Basic_viewer/draw_mesh_and_points.cpp}
|
||||
|
||||
The result of this example can be shown in \cgalFigureRef{basic_viewer_ex4} where we can see in green the original points of the point cloud, supperposed with the polyhedron surface reconstructed by the poisson surface reconstruction method.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\cgalFigureBegin{basic_viewer_ex4,draw_mesh_and_points.png}
|
||||
Example of drawing of a point cloud and a polyhedron in a same viewer.
|
||||
\cgalFigureEnd
|
||||
|
||||
|
||||
|
||||
|
|
@ -115,13 +119,11 @@ Example of mesh drawing with a color for each face computed thanks to its height
|
|||
ICICICI
|
||||
|
||||
|
||||
\section Graphic_Scene
|
||||
|
||||
The Graphics_scene class appears to be a container class responsible for managing CGAL data structures and handling buffers for various geometric elements, such as points, segments, rays, lines, and faces by fill data in given graphic buffer.
|
||||
|
||||
Draw two different CGAL data-structures in a same viewer
|
||||
|
||||
\cgalExample{Basic_viewer/draw_mesh_and_points.cpp}
|
||||
|
||||
|
||||
|
||||
|
||||
\subsection GraphicSceneClass key components and functionality of this class:
|
||||
|
|
|
|||
|
|
@ -10,11 +10,11 @@
|
|||
#include <vector>
|
||||
#include <iostream>
|
||||
|
||||
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
|
||||
typedef Kernel::Point_3 Point;
|
||||
typedef Kernel::Vector_3 Vector;
|
||||
typedef std::pair<Point, Vector> Pwn;
|
||||
typedef CGAL::Polyhedron_3<Kernel> Polyhedron;
|
||||
using Kernel=CGAL::Exact_predicates_inexact_constructions_kernel;
|
||||
using Point=Kernel::Point_3;
|
||||
using Vector=Kernel::Vector_3;
|
||||
using Pwn=std::pair<Point, Vector>;
|
||||
using Polyhedron=CGAL::Polyhedron_3<Kernel>;
|
||||
using PS3=CGAL::Point_set_3<Point>;
|
||||
|
||||
struct Graphics_scene_options_green_points:
|
||||
|
|
|
|||
Loading…
Reference in New Issue