mirror of https://github.com/CGAL/cgal
copy the parts of gsoc2024-basic_viewer_glfw-tgrillon that concern only the qt basic viewer
This commit is contained in:
parent
705494d7fc
commit
219ea871d7
|
|
@ -29,11 +29,8 @@ namespace CGAL {
|
|||
* `CGAL::Arrangement_2` class template. Parameters of the drawing are taken
|
||||
* from the optional graphics scene options parameter.
|
||||
*
|
||||
* A call to this function blocks the execution of the program until the drawing
|
||||
* window is closed. This function requires `CGAL_Qt6`, and is only available if
|
||||
* the macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target
|
||||
* `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt6` and add the definition
|
||||
* `CGAL_USE_BASIC_VIEWER`.
|
||||
A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER`/`CGAL_USE_BASIC_VIEWER_QT` (Qt viewer) is defined.
|
||||
Linking with the cmake target `CGAL::CGAL_Basic_viewer`/`CGAL::CGAL_Basic_viewer_Qt` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`/`CGAL_USE_BASIC_VIEWER_QT`.
|
||||
*
|
||||
* \tparam GeometryTraits_2 a geometry traits type, a model of a 2D arrangement
|
||||
* traits concept. At this point it must be an instance of either
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
#include <cstdlib>
|
||||
#include <random>
|
||||
|
||||
#include <CGAL/Qt/Basic_viewer.h>
|
||||
#include <CGAL/Basic_viewer.h>
|
||||
#include <CGAL/Graphics_scene.h>
|
||||
#include <CGAL/Graphics_scene_options.h>
|
||||
#include <CGAL/Random.h>
|
||||
|
|
@ -587,8 +587,6 @@ void add_to_graphics_scene(const CGAL_ARR_TYPE& aos,
|
|||
add_to_graphics_scene(aos, graphics_scene, gso);
|
||||
}
|
||||
|
||||
#ifdef CGAL_USE_BASIC_VIEWER
|
||||
|
||||
/// Draw an arrangement on surface.
|
||||
template <typename GeometryTraits_2, typename TopologyTraits, class GSOptions>
|
||||
void draw(const CGAL_ARR_TYPE& aos, const GSOptions& gso,
|
||||
|
|
@ -609,8 +607,6 @@ void draw(const CGAL_ARR_TYPE& aos,
|
|||
draw_graphics_scene(graphics_scene, title);
|
||||
}
|
||||
|
||||
#endif // CGAL_USE_BASIC_VIEWER
|
||||
|
||||
#undef CGAL_ARR_TYPE
|
||||
|
||||
} // namespace CGAL
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ Example of drawing of a point cloud and a polyhedron in a same viewer.
|
|||
\cgalFigureEnd
|
||||
|
||||
<!-- /////////////////////////////////////////////////////////////////////////////// -->
|
||||
\section BV_BasicViewer The Basic Viewer Class
|
||||
\section BV_BasicViewer The Qt Basic Viewer Class
|
||||
|
||||
The class `CGAL::Qt::Basic_viewer` is a \qt widget that inherits from `QGLViewer` and mainly stores a `Graphics_scene` and allows to visualize it and interact with the scene. Since this class is a \qt widget, it can be used into more complex \qt code to create more advanced demos.
|
||||
|
||||
|
|
|
|||
|
|
@ -102,6 +102,36 @@ public:
|
|||
|
||||
/// returns `true` if the scene is in 2D, i.e., lies on the XY or XZ or YZ plane.
|
||||
bool is_two_dimensional() const;
|
||||
|
||||
/// set the default color of faces
|
||||
void set_default_color_face(const CGAL::IO::Color& c);
|
||||
|
||||
/// set the default color of points
|
||||
void set_default_color_point(const CGAL::IO::Color& c);
|
||||
|
||||
/// set the default color of segments
|
||||
void set_default_color_segment(const CGAL::IO::Color& c);
|
||||
|
||||
/// set the default color of rays
|
||||
void set_default_color_ray(const CGAL::IO::Color& c);
|
||||
|
||||
/// set the default color of lines
|
||||
void set_default_color_line(const CGAL::IO::Color& c);
|
||||
|
||||
/// returns the default color of faces
|
||||
const CGAL::IO::Color &get_default_color_face() const;
|
||||
|
||||
/// returns the default color of points
|
||||
const CGAL::IO::Color &get_default_color_point() const;
|
||||
|
||||
/// returns the default color of segments
|
||||
const CGAL::IO::Color &get_default_color_segment() const;
|
||||
|
||||
/// returns the default color of rays
|
||||
const CGAL::IO::Color &get_default_color_ray() const;
|
||||
|
||||
/// returns the default color of lines
|
||||
const CGAL::IO::Color &get_default_color_line() const;
|
||||
};
|
||||
|
||||
} // namespace CGAL
|
||||
|
|
|
|||
|
|
@ -5,126 +5,187 @@ namespace CGAL {
|
|||
/*!
|
||||
\ingroup PkgBasicViewerClasses
|
||||
|
||||
The class `Basic_viewer` is a Qt widget based on `QGLViewer` that allows to visualize 3D elements: points, segments, triangles, rays and lines. This class stores a reference to a `Graphics_scene`. Elements are added through the scene. This class requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`.
|
||||
The class `Basic_viewer` is a Qt widget based on `QGLViewer` that allows to visualize 3D elements: points, segments, triangles, rays and lines. This class stores a reference to a `Graphics_scene`. Elements are added through the scene. This class requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER_QT` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` or `CGAL::CGAL_Basic_viewer_Qt` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER` & `CGAL_USE_BASIC_VIEWER_QT`.
|
||||
|
||||
CGAL::QGLViewer is our internal fork of <a href="https://github.com/GillesDebunne/libQGLViewer">QGLViewer class</a> which is <em>A versatile 3D OpenGL viewer based on QOpenGLWidget</em>.
|
||||
*/
|
||||
class Basic_viewer : public CGAL::QGLViewer
|
||||
{
|
||||
public:
|
||||
/// \name Constructors
|
||||
/// @{
|
||||
|
||||
/// Constructor given a pointer on a `QWidget` (can be a `nullptr`) and a `Graphics_scene`.
|
||||
/// `title` will be the title of the window.
|
||||
Basic_viewer(QWidget* parent,
|
||||
const Graphics_scene& scene,
|
||||
const char* title="");
|
||||
|
||||
/// enables or disables the drawing of vertices.
|
||||
/// @}
|
||||
|
||||
/// \name Setters
|
||||
/// @{
|
||||
|
||||
/// \brief Set size of vertices.
|
||||
/// \param s The size of vertices.
|
||||
void size_vertices(float s);
|
||||
|
||||
/// \brief Set size of edges.
|
||||
/// \param s The size of edges.
|
||||
void size_edges(float s);
|
||||
|
||||
/// \brief Set size of rays.
|
||||
/// \param s The size of rays.
|
||||
void size_rays(float s);
|
||||
|
||||
/// \brief Set size of lines.
|
||||
/// \param s The size of lines.
|
||||
void size_lines(float s);
|
||||
|
||||
/// \brief Enables or disables the drawing of vertices.
|
||||
/// \param b Set to `true` to enable, `false` to disable.
|
||||
void draw_vertices(bool b);
|
||||
|
||||
/// enables or disables the drawing of edges.
|
||||
/// \brief Enables or disables the drawing of edges.
|
||||
/// \param b Set to `true` to enable, `false` to disable.
|
||||
void draw_edges(bool b);
|
||||
|
||||
/// enables or disables the drawing of rays.
|
||||
/// \brief Enables or disables the drawing of rays.
|
||||
/// \param b Set to `true` to enable, `false` to disable.
|
||||
void draw_rays(bool b);
|
||||
|
||||
/// enables or disables the drawing of lines.
|
||||
/// \brief Enables or disables the drawing of lines.
|
||||
/// \param b Set to `true` to enable, `false` to disable.
|
||||
void draw_lines(bool b);
|
||||
|
||||
/// enables or disables the drawing of faces.
|
||||
/// \brief enables or disables the drawing of faces.
|
||||
/// \param b Set to `true` to enable, `false` to disable.
|
||||
void draw_faces(bool b);
|
||||
|
||||
/// enables or disables the use of only one color (if `b` is `true`) or the use of multiple colors (if `b` is `false`).
|
||||
void use_mono_color(bool b);
|
||||
|
||||
/// enables or disables the drawing of texts.
|
||||
/// \brief enables or disables the drawing of texts.
|
||||
/// \param b Set to `true` to enable, `false` to disable.
|
||||
void draw_text(bool b);
|
||||
|
||||
/// sets the color used for vertices in mono color mode.
|
||||
void vertices_mono_color(const CGAL::IO::Color& c);
|
||||
/// \brief Enables or disables the drawing of mesh triangles.
|
||||
/// \param b Set to `true` to enable, `false` to disable.
|
||||
void draw_mesh_triangles(bool b);
|
||||
|
||||
/// sets the color used for edges in mono color mode.
|
||||
void edges_mono_color(const CGAL::IO::Color& c);
|
||||
/// \brief Enables or disables the use of only one color or the use of multiple colors.
|
||||
/// \param b Set to `true` to use only one color, `false` to use multiple colors.
|
||||
void use_default_color(bool b);
|
||||
|
||||
/// sets the color used for rays in mono color mode.
|
||||
void rays_mono_color(const CGAL::IO::Color& c);
|
||||
/// \brief Enables or disables the use of a single color for all normals.
|
||||
/// \param b Set to `true` to enable, `false` to disable.
|
||||
void use_default_color_normals(bool b);
|
||||
|
||||
/// sets the color used for lines in mono color mode.
|
||||
void lines_mono_color(const CGAL::IO::Color& c);
|
||||
/// \brief enables or disables the use of flat shading or the use of smooth shading.
|
||||
/// \param b Set to `true` for flat shading, `false` for smooth shading.
|
||||
void flat_shading(bool b);
|
||||
|
||||
/// sets the color used for faces in mono color mode.
|
||||
void faces_mono_color(const CGAL::IO::Color& c);
|
||||
/// \brief Enables or disables the reversal of normals.
|
||||
/// \param b Set to `true` to reverse normals, `false` to keep normals as is.
|
||||
void reverse_normal(bool b);
|
||||
|
||||
/// toggles the drawing of vertices.
|
||||
/// \brief Sets the default color of the normals.
|
||||
/// \param c The default color of the normals.
|
||||
void default_color_normals(const CGAL::IO::Color& c);
|
||||
|
||||
/// \brief Sets the height factor value of the normals.
|
||||
/// \param h The height factor value of the normals.
|
||||
void normal_height_factor(float h);
|
||||
|
||||
/// \brief Toggles the drawing of vertices.
|
||||
void toggle_draw_vertices();
|
||||
|
||||
/// toggles the drawing of edges.
|
||||
/// \brief Toggles the drawing of edges.
|
||||
void toggle_draw_edges();
|
||||
|
||||
/// toggles the drawing of rays.
|
||||
/// \brief Toggles the drawing of rays.
|
||||
void toggle_draw_rays();
|
||||
|
||||
/// toggles the drawing of lines.
|
||||
/// \brief Toggles the drawing of lines.
|
||||
void toggle_draw_lines();
|
||||
|
||||
/// toggles the drawing of faces.
|
||||
/// \brief Toggles the drawing of faces.
|
||||
void toggle_draw_faces();
|
||||
|
||||
/// toggles the use of mono color mode.
|
||||
void toggle_use_mono_color();
|
||||
/// \brief Toggles the use of mono color mode.
|
||||
void toggle_use_default_color();
|
||||
|
||||
/// toggles the drawing of text.
|
||||
/// \brief Toggles the use of the default color mode for normals.
|
||||
void toggle_use_default_color_normal();
|
||||
|
||||
/// \brief Toggles the use of flat shading.
|
||||
void toggle_flat_shading();
|
||||
|
||||
/// \brief Toggles the drawing of text.
|
||||
void toggle_draw_text();
|
||||
|
||||
/// returns `true` if vertices are drawn.
|
||||
/// \brief Reverses all normals of vertices and faces.
|
||||
void reverse_all_normals();
|
||||
|
||||
/// @}
|
||||
|
||||
/// \name Getters
|
||||
/// @{
|
||||
|
||||
/// \brief Checks if vertices are drawn.
|
||||
/// \return `true` if vertices are drawn, `false` otherwise.
|
||||
bool draw_vertices() const;
|
||||
|
||||
/// returns `true` if edges are drawn.
|
||||
/// \brief Checks if edges are drawn.
|
||||
/// \return `true` if edges are drawn, `false` otherwise.
|
||||
bool draw_edges() const;
|
||||
|
||||
/// returns `true` if rays are drawn.
|
||||
/// \brief Checks if rays are drawn.
|
||||
/// \return `true` if rays are drawn, `false` otherwise.
|
||||
bool draw_rays() const;
|
||||
|
||||
/// returns `true` if lines are drawn.
|
||||
/// \brief Checks if lines are drawn.
|
||||
/// \return `true` if lines are drawn, `false` otherwise.
|
||||
bool draw_lines() const;
|
||||
|
||||
/// returns `true` if faces are drawn.
|
||||
/// \brief Checks if faces are drawn.
|
||||
/// \return `true` if faces are drawn, `false` otherwise.
|
||||
bool draw_faces() const;
|
||||
|
||||
/// returns `true` if mono color mode is used.
|
||||
bool use_mono_color() const;
|
||||
|
||||
/// returns `true` if normals are reversed.
|
||||
bool reverse_normal() const;
|
||||
|
||||
/// returns `true` if text are drawn.
|
||||
/// \brief Checks if text is drawn.
|
||||
/// \return `true` if text is drawn, `false` otherwise.
|
||||
bool draw_text() const;
|
||||
|
||||
/// returns the mono color used for vertices.
|
||||
const CGAL::IO::Color& vertices_mono_color() const;
|
||||
/// \brief Checks if the default color mode is used.
|
||||
/// \return `true` if mono color mode is used, `false` otherwise.
|
||||
bool use_default_color() const;
|
||||
|
||||
/// returns the mono color used for edges.
|
||||
const CGAL::IO::Color& edges_mono_color() const;
|
||||
/// \brief Checks if the default color mode for normals is used.
|
||||
/// \return `true` if default color mode for normals is used, `false` otherwise.
|
||||
bool use_default_color_normal() const;
|
||||
|
||||
/// returns the mono color used for rays.
|
||||
const CGAL::IO::Color& rays_mono_color() const;
|
||||
/// \brief Checks if normals are reversed.
|
||||
/// \return `true` if normals are reversed, `false` otherwise.
|
||||
bool reverse_normal() const;
|
||||
|
||||
/// returns the mono color used for lines.
|
||||
const CGAL::IO::Color& lines_mono_color() const;
|
||||
|
||||
/// returns the mono color used for faces.
|
||||
const CGAL::IO::Color& faces_mono_color() const;
|
||||
|
||||
/// returns `true` if the clipping plane is enabled.
|
||||
/// \brief Checks if the clipping plane is enabled.
|
||||
/// \return `true` if the clipping plane is enabled, `false` otherwise.
|
||||
bool clipping_plane_enabled() const;
|
||||
|
||||
/// returns the clipping plane when it is enabled.
|
||||
/// \brief Checks if m_no_2D_mode is false and the graphics scene is two-dimensional.
|
||||
/// \return `true` if m_no_2D_mode is false and the scene is 2D, `false` otherwise.
|
||||
bool is_two_dimensional() const;
|
||||
|
||||
/// \brief Gets the clipping plane when enabled.
|
||||
/// \return The clipping plane as a `CGAL::Exact_predicates_inexact_constructions_kernel::Plane_3` object.
|
||||
CGAL::Exact_predicates_inexact_constructions_kernel::Plane_3 clipping_plane() const;
|
||||
|
||||
/// returns the graphics scene of the viewer.
|
||||
/// \brief Gets the graphics scene of the viewer.
|
||||
/// \return A reference to the `Graphics_scene` object.
|
||||
const Graphics_scene& graphics_scene() const;
|
||||
|
||||
/// reverses all normals of vertices and faces.
|
||||
void reverse_all_normals();
|
||||
/// @}
|
||||
|
||||
/// \name Draw
|
||||
/// @{
|
||||
|
||||
/// draws the viewer without recomputing all internal buffers.
|
||||
virtual void draw();
|
||||
|
|
@ -132,6 +193,8 @@ public:
|
|||
/// redraws the viewer, i.e., recompute all internal buffers and update the window.
|
||||
virtual void redraw();
|
||||
|
||||
/// @}
|
||||
|
||||
/// Function called when a key is pressed. Users can define their own function in order
|
||||
/// to add specific behavior.
|
||||
std::function<bool(QKeyEvent *, CGAL::Qt::Basic_viewer *)> on_key_pressed;
|
||||
|
|
@ -144,7 +207,7 @@ public:
|
|||
|
||||
The class `QApplication_and_basic_viewer` regroups a `Basic_viewer` and Qt `QApplication`. The `QApplication` is created in the constructor, but started by the `run()` method. This allows for example users to modify the `on_key_pressed` method of the `Basic_viewer` to define their own behavior.
|
||||
|
||||
This class requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`.
|
||||
This class requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` or `CGAL_USE_BASIC_VIEWER_QT` is defined. Linking with the cmake target `CGAL::CGAL_Basic_viewer` or `CGAL::CGAL_Basic_viewer_Qt` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER` & `CGAL_USE_BASIC_VIEWER_QT`.
|
||||
|
||||
*/
|
||||
class QApplication_and_basic_viewer
|
||||
|
|
|
|||
|
|
@ -23,12 +23,12 @@ create_single_source_cgal_program("draw_surface_mesh_vcolor.cpp")
|
|||
|
||||
if(CGAL_Qt6_FOUND)
|
||||
#link it with the required CGAL libraries
|
||||
target_link_libraries(draw_lcc PRIVATE CGAL::CGAL_Basic_viewer)
|
||||
target_link_libraries(draw_mesh_and_points PRIVATE CGAL::CGAL_Basic_viewer)
|
||||
target_link_libraries(draw_several_windows PRIVATE CGAL::CGAL_Basic_viewer)
|
||||
target_link_libraries(draw_surface_mesh_height PRIVATE CGAL::CGAL_Basic_viewer)
|
||||
target_link_libraries(draw_surface_mesh_small_faces PRIVATE CGAL::CGAL_Basic_viewer)
|
||||
target_link_libraries(draw_surface_mesh_vcolor PRIVATE CGAL::CGAL_Basic_viewer)
|
||||
target_link_libraries(draw_lcc PRIVATE CGAL::CGAL_Basic_viewer_Qt)
|
||||
target_link_libraries(draw_mesh_and_points PRIVATE CGAL::CGAL_Basic_viewer_Qt)
|
||||
target_link_libraries(draw_several_windows PRIVATE CGAL::CGAL_Basic_viewer_Qt)
|
||||
target_link_libraries(draw_surface_mesh_height PRIVATE CGAL::CGAL_Basic_viewer_Qt)
|
||||
target_link_libraries(draw_surface_mesh_small_faces PRIVATE CGAL::CGAL_Basic_viewer_Qt)
|
||||
target_link_libraries(draw_surface_mesh_vcolor PRIVATE CGAL::CGAL_Basic_viewer_Qt)
|
||||
else()
|
||||
message("CGAL_Qt6 not configured: examples that require Qt will not be compiled.")
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
#include <CGAL/draw_polyhedron.h>
|
||||
#include <CGAL/draw_point_set_3.h>
|
||||
#include <CGAL/Graphics_scene_options.h>
|
||||
#include <CGAL/Qt/Basic_viewer.h>
|
||||
#include <CGAL/Basic_viewer.h>
|
||||
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
|
|
|
|||
|
|
@ -17,131 +17,299 @@
|
|||
|
||||
namespace CGAL
|
||||
{
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
const char vertex_source_color[]=R"DELIM(
|
||||
const char VERTEX_SOURCE_COLOR[]=R"DELIM(
|
||||
#version 150
|
||||
in highp vec4 vertex;
|
||||
in highp vec3 normal;
|
||||
in highp vec3 color;
|
||||
in highp vec3 a_Pos;
|
||||
in highp vec3 a_Normal;
|
||||
in mediump vec3 a_Color;
|
||||
|
||||
uniform highp mat4 mvp_matrix;
|
||||
uniform highp mat4 mv_matrix;
|
||||
uniform highp float point_size;
|
||||
out highp vec4 vs_fP; // view space position
|
||||
out highp vec4 ls_fP; // local space position
|
||||
out highp vec3 fN;
|
||||
out mediump vec4 fColor;
|
||||
|
||||
out highp vec4 fP;
|
||||
out highp vec3 fN;
|
||||
out highp vec4 fColor;
|
||||
out highp vec4 m_vertex;
|
||||
uniform highp mat4 u_Mvp;
|
||||
uniform highp mat4 u_Mv;
|
||||
uniform mediump float u_PointSize;
|
||||
uniform mediump vec3 u_DefaultColor;
|
||||
uniform bool u_UseDefaultColor;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
fP = mv_matrix * vertex;
|
||||
fN = mat3(mv_matrix)* normal;
|
||||
fColor = vec4(color, 1.0);
|
||||
gl_PointSize = point_size;
|
||||
fColor = vec4(a_Color, 1.0);
|
||||
if (u_UseDefaultColor)
|
||||
{
|
||||
fColor = vec4(u_DefaultColor, 1.0);
|
||||
}
|
||||
|
||||
m_vertex = vertex;
|
||||
vec4 pos = vec4(a_Pos, 1.0);
|
||||
|
||||
gl_Position = mvp_matrix * vertex;
|
||||
ls_fP = pos;
|
||||
vs_fP = u_Mv * pos;
|
||||
|
||||
fN = mat3(u_Mv)* a_Normal;
|
||||
|
||||
gl_Position = u_Mvp * pos;
|
||||
gl_PointSize = u_PointSize;
|
||||
}
|
||||
)DELIM";
|
||||
|
||||
const char fragment_source_color[]=R"DELIM(
|
||||
const char FRAGMENT_SOURCE_COLOR[]=R"DELIM(
|
||||
#version 150
|
||||
in highp vec4 fP;
|
||||
in highp vec3 fN;
|
||||
in highp vec4 fColor;
|
||||
in highp vec4 m_vertex;
|
||||
in highp vec4 vs_fP;
|
||||
in highp vec4 ls_fP;
|
||||
in highp vec3 fN;
|
||||
in mediump vec4 fColor;
|
||||
|
||||
uniform highp vec4 light_pos;
|
||||
uniform highp vec4 light_diff;
|
||||
uniform highp vec4 light_spec;
|
||||
uniform highp vec4 light_amb;
|
||||
uniform highp float spec_power;
|
||||
out mediump vec4 out_color;
|
||||
|
||||
uniform highp vec4 clipPlane;
|
||||
uniform highp vec4 pointPlane;
|
||||
uniform highp float rendering_mode;
|
||||
uniform highp float rendering_transparency;
|
||||
uniform highp vec4 u_LightPos;
|
||||
uniform mediump vec4 u_LightDiff;
|
||||
uniform mediump vec4 u_LightSpec;
|
||||
uniform mediump vec4 u_LightAmb;
|
||||
uniform mediump float u_SpecPower;
|
||||
|
||||
out highp vec4 out_color;
|
||||
uniform highp vec4 u_ClipPlane;
|
||||
uniform highp vec4 u_PointPlane;
|
||||
uniform mediump float u_RenderingMode;
|
||||
uniform mediump float u_RenderingTransparency;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
highp vec3 L = light_pos.xyz - fP.xyz;
|
||||
highp vec3 V = -fP.xyz;
|
||||
highp vec3 L = u_LightPos.xyz - vs_fP.xyz;
|
||||
highp vec3 V = -vs_fP.xyz;
|
||||
|
||||
highp vec3 N = normalize(fN);
|
||||
highp vec3 a_Normal = normalize(fN);
|
||||
L = normalize(L);
|
||||
V = normalize(V);
|
||||
|
||||
highp vec3 R = reflect(-L, N);
|
||||
highp vec4 diffuse = vec4(max(dot(N,L), 0.0) * light_diff.rgb * fColor.rgb, 1.0);
|
||||
highp vec4 ambient = vec4(light_amb.rgb * fColor.rgb, 1.0);
|
||||
highp vec4 specular = pow(max(dot(R,V), 0.0), spec_power) * light_spec;
|
||||
highp vec3 R = reflect(-L, a_Normal);
|
||||
highp vec4 diffuse = vec4(max(dot(a_Normal,L), 0.0) * u_LightDiff.rgb * fColor.rgb, 1.0);
|
||||
highp vec4 ambient = vec4(u_LightAmb.rgb * fColor.rgb, 1.0);
|
||||
highp vec4 specular = pow(max(dot(R,V), 0.0), u_SpecPower) * u_LightSpec;
|
||||
|
||||
// onPlane == 1: inside clipping plane, should be solid;
|
||||
// onPlane == -1: outside clipping plane, should be transparent;
|
||||
// onPlane == 0: on clipping plane, whatever;
|
||||
float onPlane = sign(dot((m_vertex.xyz-pointPlane.xyz), clipPlane.xyz));
|
||||
float onPlane = sign(dot((ls_fP.xyz-u_PointPlane.xyz), u_ClipPlane.xyz));
|
||||
|
||||
// rendering_mode == -1: draw all solid;
|
||||
// rendering_mode == 0: draw solid only;
|
||||
// rendering_mode == 1: draw transparent only;
|
||||
if (rendering_mode == (onPlane+1)/2) {
|
||||
if (u_RenderingMode == (onPlane+1)/2) {
|
||||
// discard other than the corresponding half when rendering
|
||||
discard;
|
||||
}
|
||||
|
||||
// draw corresponding part
|
||||
out_color = rendering_mode < 1 ? (diffuse + ambient) :
|
||||
vec4(diffuse.rgb + ambient.rgb, rendering_transparency);
|
||||
out_color = u_RenderingMode < 1 ? (diffuse + ambient) :
|
||||
vec4(diffuse.rgb + ambient.rgb, u_RenderingTransparency);
|
||||
}
|
||||
)DELIM";
|
||||
|
||||
const char vertex_source_p_l[]=R"DELIM(
|
||||
const char VERTEX_SOURCE_P_L[]=R"DELIM(
|
||||
#version 150
|
||||
in highp vec4 vertex;
|
||||
in highp vec3 color;
|
||||
in highp vec3 a_Pos;
|
||||
in mediump vec3 a_Color;
|
||||
|
||||
uniform highp mat4 mvp_matrix;
|
||||
uniform highp float point_size;
|
||||
out mediump vec4 fColor;
|
||||
out highp vec4 ls_fP; // local space
|
||||
|
||||
out highp vec4 fColor;
|
||||
out highp vec4 m_vertex;
|
||||
uniform highp mat4 u_Mvp;
|
||||
uniform mediump float u_PointSize;
|
||||
uniform bool u_IsOrthographic;
|
||||
uniform mediump vec3 u_DefaultColor;
|
||||
uniform bool u_UseDefaultColor;
|
||||
|
||||
bool EqualZero(float value)
|
||||
{
|
||||
return abs(value) < 0.00001;
|
||||
}
|
||||
|
||||
void main(void)
|
||||
{
|
||||
gl_PointSize = point_size;
|
||||
fColor = vec4(color, 1.0);
|
||||
m_vertex = vertex;
|
||||
gl_Position = mvp_matrix * vertex;
|
||||
fColor = vec4(a_Color, 1.0);
|
||||
if (u_UseDefaultColor)
|
||||
{
|
||||
fColor = vec4(u_DefaultColor, 1.0);
|
||||
}
|
||||
|
||||
vec4 pos = vec4(a_Pos, 1.0);
|
||||
|
||||
ls_fP = pos;
|
||||
|
||||
gl_Position = u_Mvp * pos;
|
||||
|
||||
float distance = gl_Position.w;
|
||||
if (u_IsOrthographic)
|
||||
{
|
||||
distance = u_PointSize;
|
||||
}
|
||||
|
||||
float effectiveDistance = EqualZero(distance) ? 0.00001 : distance;
|
||||
gl_PointSize = u_PointSize / effectiveDistance * 5.0;
|
||||
}
|
||||
)DELIM";
|
||||
|
||||
const char fragment_source_p_l[]=R"DELIM(
|
||||
const char VERTEX_SOURCE_SHAPE[]=R"DELIM(
|
||||
#version 150
|
||||
in highp vec4 fColor;
|
||||
in highp vec4 m_vertex;
|
||||
in highp vec3 a_Pos;
|
||||
in mediump vec3 a_Color;
|
||||
|
||||
uniform highp vec4 clipPlane;
|
||||
uniform highp vec4 pointPlane;
|
||||
uniform highp float rendering_mode;
|
||||
out mediump vec4 gColor;
|
||||
out highp vec4 ls_fP;
|
||||
|
||||
out highp vec4 out_color;
|
||||
uniform highp mat4 u_Mvp;
|
||||
uniform mediump vec3 u_DefaultColor;
|
||||
uniform bool u_UseDefaultColor;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
gColor = vec4(a_Color, 1.0);
|
||||
if (u_UseDefaultColor)
|
||||
{
|
||||
gColor = vec4(u_DefaultColor, 1.0);
|
||||
}
|
||||
|
||||
gl_Position = vec4(a_Pos, 1.0);
|
||||
}
|
||||
)DELIM";
|
||||
|
||||
const char GEOMETRY_SOURCE_SPHERE[]=R"DELIM(
|
||||
#version 150
|
||||
layout(points) in;
|
||||
layout(triangle_strip, max_vertices = 72) out; // max_vertices = (resolution+1) * 2 * latResolution
|
||||
|
||||
#define PI 3.14159265358979323846
|
||||
|
||||
in mediump vec4 gColor[];
|
||||
|
||||
out mediump vec4 fColor;
|
||||
out highp vec4 ls_fP;
|
||||
|
||||
uniform highp mat4 u_Mvp;
|
||||
uniform mediump float u_Radius;
|
||||
|
||||
void drawSphere(in vec4 center, in float radius, in float resolution)
|
||||
{
|
||||
float latResolution = resolution*0.5;
|
||||
float stepTheta = PI/latResolution;
|
||||
float stepPhi = 2*PI/resolution;
|
||||
for(int i=0; i<latResolution; ++i)
|
||||
{
|
||||
float theta1 = stepTheta*i;
|
||||
float theta2 = stepTheta*(i+1);
|
||||
for(int j=0; j<=resolution; ++j)
|
||||
{
|
||||
float phi = stepPhi*j;
|
||||
float x1 = center.x + radius * sin(theta1) * cos(phi);
|
||||
float y1 = center.y + radius * sin(theta1) * sin(phi);
|
||||
float z1 = center.z + radius * cos(theta1);
|
||||
ls_fP = vec4(x1, y1, z1, 1.0);
|
||||
gl_Position = u_Mvp * ls_fP;
|
||||
EmitVertex();
|
||||
|
||||
float x2 = center.x + radius * sin(theta2) * cos(phi);
|
||||
float y2 = center.y + radius * sin(theta2) * sin(phi);
|
||||
float z2 = center.z + radius * cos(theta2);
|
||||
ls_fP = vec4(x2, y2, z2, 1.0);
|
||||
gl_Position = u_Mvp * ls_fP;
|
||||
EmitVertex();
|
||||
}
|
||||
EndPrimitive();
|
||||
}
|
||||
}
|
||||
|
||||
void main(void)
|
||||
{
|
||||
fColor = gColor[0];
|
||||
|
||||
int resolution = 8;
|
||||
vec4 center = gl_in[0].gl_Position;
|
||||
|
||||
drawSphere(center, u_Radius, resolution);
|
||||
}
|
||||
)DELIM";
|
||||
|
||||
const char GEOMETRY_SOURCE_CYLINDER[]=R"DELIM(
|
||||
#version 150
|
||||
layout(lines) in;
|
||||
layout(triangle_strip, max_vertices = 22) out;
|
||||
|
||||
#define PI 3.14159265358979323846
|
||||
|
||||
in mediump vec4 gColor[];
|
||||
|
||||
out mediump vec4 fColor;
|
||||
out highp vec4 ls_fP;
|
||||
|
||||
uniform highp mat4 u_Mvp;
|
||||
uniform mediump float u_Radius;
|
||||
|
||||
void drawCylinder(in vec3 u, in vec3 v, in vec4 bot, in vec4 top, in float radius, in float resolution)
|
||||
{
|
||||
float step = 2*PI/resolution;
|
||||
for(int i=0; i<=resolution; ++i)
|
||||
{
|
||||
float theta = step*i;
|
||||
float cosf = radius*cos(theta);
|
||||
float sinf = radius*sin(theta);
|
||||
vec3 xAxis = cosf*u.xyz;
|
||||
vec3 yAxis = sinf*v.xyz;
|
||||
ls_fP = vec4(top.xyz+xAxis.xyz+yAxis.xyz, 1.0);
|
||||
gl_Position = u_Mvp * ls_fP;
|
||||
EmitVertex();
|
||||
ls_fP = vec4(bot.xyz+xAxis.xyz+yAxis.xyz, 1.0);
|
||||
gl_Position = u_Mvp * ls_fP;
|
||||
EmitVertex();
|
||||
}
|
||||
EndPrimitive();
|
||||
}
|
||||
|
||||
void main(void)
|
||||
{
|
||||
fColor = gColor[0];
|
||||
|
||||
vec4 a = gl_in[0].gl_Position;
|
||||
vec4 b = gl_in[1].gl_Position;
|
||||
|
||||
vec3 n = normalize(vec3(b.x-a.x, b.y-a.y, b.z-a.z)); // compute top normal
|
||||
|
||||
vec3 w = normalize(vec3(-n.z, n.x, n.y));
|
||||
|
||||
// Axis vectors
|
||||
vec3 u = normalize(cross(n, w));
|
||||
vec3 v = normalize(cross(n, u));
|
||||
|
||||
int resolution = 10;
|
||||
|
||||
drawCylinder(u, v, a, b, u_Radius, resolution);
|
||||
}
|
||||
)DELIM";
|
||||
|
||||
const char FRAGMENT_SOURCE_P_L[]=R"DELIM(
|
||||
#version 150
|
||||
in mediump vec4 fColor;
|
||||
in highp vec4 ls_fP;
|
||||
|
||||
out mediump vec4 out_color;
|
||||
|
||||
uniform highp vec4 u_ClipPlane;
|
||||
uniform highp vec4 u_PointPlane;
|
||||
uniform mediump float u_RenderingMode;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
// onPlane == 1: inside clipping plane, should be solid;
|
||||
// onPlane == -1: outside clipping plane, should be transparent;
|
||||
// onPlane == 0: on clipping plane, whatever;
|
||||
float onPlane = sign(dot((m_vertex.xyz-pointPlane.xyz), clipPlane.xyz));
|
||||
float onPlane = sign(dot((ls_fP.xyz-u_PointPlane.xyz), u_ClipPlane.xyz));
|
||||
|
||||
// rendering_mode == -1: draw both inside and outside;
|
||||
// rendering_mode == 0: draw inside only;
|
||||
// rendering_mode == 1: draw outside only;
|
||||
if (rendering_mode == (onPlane+1)/2) {
|
||||
if (u_RenderingMode == (onPlane+1)/2) {
|
||||
// discard other than the corresponding half when rendering
|
||||
discard;
|
||||
}
|
||||
|
|
@ -150,106 +318,554 @@ void main(void)
|
|||
}
|
||||
)DELIM";
|
||||
|
||||
const char vertex_source_clipping_plane[]=R"DELIM(
|
||||
const char VERTEX_SOURCE_CLIPPING_PLANE[]=R"DELIM(
|
||||
#version 150
|
||||
in highp vec4 vertex;
|
||||
in highp vec3 a_Pos;
|
||||
|
||||
uniform highp mat4 vp_matrix;
|
||||
uniform highp mat4 m_matrix;
|
||||
uniform highp mat4 u_Vp;
|
||||
uniform highp mat4 u_M;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
gl_Position = vp_matrix * m_matrix * vertex;
|
||||
gl_Position = u_Vp * u_M * vec4(a_Pos, 1.0);
|
||||
}
|
||||
)DELIM";
|
||||
|
||||
const char fragment_source_clipping_plane[]=R"DELIM(
|
||||
const char FRAGMENT_SOURCE_CLIPPING_PLANE[]=R"DELIM(
|
||||
#version 150
|
||||
out highp vec4 out_color;
|
||||
|
||||
out mediump vec4 out_color;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
out_color = vec4(0.0, 0.0, 0.0, 1.0);
|
||||
}
|
||||
)DELIM";
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// compatibility shaders
|
||||
const char VERTEX_SOURCE_LINE[]=R"DELIM(
|
||||
#version 150
|
||||
in highp vec3 a_Pos;
|
||||
in mediump vec3 a_Color;
|
||||
|
||||
const char vertex_source_color_comp[]=R"DELIM(
|
||||
varying highp vec4 vertex;
|
||||
varying highp vec3 normal;
|
||||
varying highp vec3 color;
|
||||
out VS_OUT {
|
||||
mediump vec4 color;
|
||||
} vs_out; // vertex shader output
|
||||
|
||||
uniform highp mat4 mvp_matrix;
|
||||
uniform highp mat4 mv_matrix;
|
||||
uniform highp float point_size;
|
||||
|
||||
varying highp vec4 fP;
|
||||
varying highp vec3 fN;
|
||||
varying highp vec4 fColor;
|
||||
uniform mediump vec3 u_DefaultColor;
|
||||
uniform bool u_UseDefaultColor;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
fP = mv_matrix * vertex;
|
||||
vs_out.color = vec4(a_Color, 1.0);
|
||||
if (u_UseDefaultColor)
|
||||
{
|
||||
vs_out.color = vec4(u_DefaultColor, 1.0);
|
||||
}
|
||||
|
||||
gl_Position = vec4(a_Pos, 1.0);
|
||||
}
|
||||
)DELIM";
|
||||
|
||||
const char GEOMETRY_SOURCE_ARROW[]=R"DELIM(
|
||||
#version 150
|
||||
layout(lines) in;
|
||||
layout(triangle_strip, max_vertices = 82) out; // max_vertices = resolution * 2 + 2 (cylinder) + resolution * 3 (disc) + resolution * 3 (cone)
|
||||
|
||||
#define PI 3.14159265358979323846
|
||||
|
||||
in VS_OUT {
|
||||
mediump vec4 color;
|
||||
} gs_in[]; // geometry shader input
|
||||
|
||||
out mediump vec4 fColor;
|
||||
|
||||
uniform highp mat4 u_Mvp;
|
||||
uniform mediump float u_SceneRadius;
|
||||
|
||||
void drawTriangle(in vec4 v1, in vec4 v2, in vec4 v3)
|
||||
{
|
||||
gl_Position = u_Mvp*v1;
|
||||
EmitVertex();
|
||||
gl_Position = u_Mvp*v2;
|
||||
EmitVertex();
|
||||
gl_Position = u_Mvp*v3;
|
||||
EmitVertex();
|
||||
EndPrimitive();
|
||||
}
|
||||
|
||||
void drawTriangleFan(in vec3 u, in vec3 v, in vec4 center, in vec4 edge0, in float radius, in int resolution)
|
||||
{
|
||||
float step = 2*PI/resolution;
|
||||
for(int i=0; i<resolution; ++i)
|
||||
{
|
||||
float theta = step*i;
|
||||
float cosf = radius*cos(theta);
|
||||
float sinf = radius*sin(theta);
|
||||
vec3 xAxis = cosf*u.xyz;
|
||||
vec3 yAxis = sinf*v.xyz;
|
||||
vec4 edge1 = vec4(edge0.xyz+xAxis.xyz+yAxis.xyz, 1.0);
|
||||
theta = step*(i+1);
|
||||
cosf = radius*cos(theta);
|
||||
sinf = radius*sin(theta);
|
||||
xAxis = cosf*u.xyz;
|
||||
yAxis = sinf*v.xyz;
|
||||
vec4 edge2 = vec4(edge0.xyz+xAxis.xyz+yAxis.xyz, 1.0);
|
||||
drawTriangle(center, edge1, edge2);
|
||||
}
|
||||
}
|
||||
|
||||
void drawDisc(in vec3 u, in vec3 v, in vec4 center, in float radius, in int resolution)
|
||||
{
|
||||
drawTriangleFan(u, v, center, center, radius, resolution);
|
||||
}
|
||||
|
||||
void drawCone(in vec3 u, in vec3 v, in vec3 n, in vec4 center, in float radius, in float height, in int resolution)
|
||||
{
|
||||
drawTriangleFan(u, v, center, vec4(center.xyz-height*n.xyz, 1.0), radius, resolution);
|
||||
}
|
||||
|
||||
void drawCylinder(in vec3 u, in vec3 v, in vec4 bot, in vec4 top, in float radius, in float resolution)
|
||||
{
|
||||
float step = 2*PI/resolution;
|
||||
for(int i=0; i<=resolution; ++i)
|
||||
{
|
||||
float theta = step*i;
|
||||
float cosf = radius*cos(theta);
|
||||
float sinf = radius*sin(theta);
|
||||
vec3 xAxis = cosf*u.xyz;
|
||||
vec3 yAxis = sinf*v.xyz;
|
||||
gl_Position = u_Mvp * vec4(top.xyz+xAxis.xyz+yAxis.xyz, 1.0);
|
||||
EmitVertex();
|
||||
gl_Position = u_Mvp * vec4(bot.xyz+xAxis.xyz+yAxis.xyz, 1.0);
|
||||
EmitVertex();
|
||||
}
|
||||
EndPrimitive();
|
||||
}
|
||||
|
||||
void main(void)
|
||||
{
|
||||
fColor = gs_in[0].color;
|
||||
|
||||
vec4 a = gl_in[0].gl_Position;
|
||||
vec4 b = gl_in[1].gl_Position;
|
||||
|
||||
vec3 n = normalize(vec3(b.x-a.x, b.y-a.y, b.z-a.z)); // compute top normal
|
||||
vec3 w = normalize(vec3(-n.z, n.x, n.y));
|
||||
|
||||
// Axis vectors
|
||||
vec3 u = normalize(cross(n, w));
|
||||
vec3 v = normalize(cross(n, u));
|
||||
|
||||
float radius = 0.013 * u_SceneRadius;
|
||||
float height = 0.035 * u_SceneRadius;
|
||||
int resolution = 10;
|
||||
|
||||
vec4 c = vec4(b.xyz-height*n.xyz, 1.0);
|
||||
drawDisc(u, v, c, radius, resolution);
|
||||
drawCone(u, v, n, b, radius, height, resolution);
|
||||
drawCylinder(u, v, a, c, radius*0.5, resolution);
|
||||
}
|
||||
)DELIM";
|
||||
|
||||
const char GEOMETRY_SOURCE_LINE[]=R"DELIM(
|
||||
#version 150
|
||||
layout(lines) in;
|
||||
layout(line_strip, max_vertices = 2) out;
|
||||
|
||||
in VS_OUT {
|
||||
mediump vec4 color;
|
||||
} gs_in[]; // geometry shader input
|
||||
|
||||
out mediump vec4 fColor;
|
||||
|
||||
uniform highp mat4 u_Mvp;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
fColor = gs_in[0].color;
|
||||
|
||||
gl_Position = u_Mvp * gl_in[0].gl_Position;
|
||||
EmitVertex();
|
||||
gl_Position = u_Mvp * gl_in[1].gl_Position;
|
||||
EmitVertex();
|
||||
|
||||
EndPrimitive();
|
||||
}
|
||||
)DELIM";
|
||||
|
||||
const char FRAGMENT_SOURCE_LINE[]=R"DELIM(
|
||||
#version 150
|
||||
|
||||
in mediump vec4 fColor;
|
||||
|
||||
out mediump vec4 out_color;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
out_color = fColor;
|
||||
}
|
||||
)DELIM";
|
||||
|
||||
const char VERTEX_SOURCE_NORMAL[]=R"DELIM(
|
||||
#version 150
|
||||
in highp vec3 a_Pos;
|
||||
in highp vec3 a_Normal;
|
||||
|
||||
out VS_OUT {
|
||||
mediump vec4 color;
|
||||
highp vec3 normal;
|
||||
} vs_out; // vertex shader output
|
||||
|
||||
uniform highp mat4 u_Mv;
|
||||
uniform mediump vec3 u_DefaultColor;
|
||||
uniform bool u_UseDefaultColor;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
vs_out.color = vec4(abs(normalize(a_Normal)), 1.0);
|
||||
if (u_UseDefaultColor)
|
||||
{
|
||||
vs_out.color = vec4(u_DefaultColor, 1.0);
|
||||
}
|
||||
|
||||
mat3 normalMatrix = mat3(transpose(inverse(u_Mv)));
|
||||
vs_out.normal = normalize(vec3(vec4(normalMatrix * a_Normal, 0.0)));
|
||||
|
||||
gl_Position = vec4(a_Pos, 1.0);
|
||||
}
|
||||
)DELIM";
|
||||
|
||||
const char GEOMETRY_SOURCE_NORMAL[]=R"DELIM(
|
||||
#version 150
|
||||
layout (triangles) in;
|
||||
layout (line_strip, max_vertices = 6) out;
|
||||
|
||||
in VS_OUT {
|
||||
mediump vec4 color;
|
||||
highp vec3 normal;
|
||||
} gs_in[]; // geometry shader input
|
||||
|
||||
out mediump vec4 fColor;
|
||||
out highp vec4 ls_fP;
|
||||
|
||||
uniform highp mat4 u_Projection;
|
||||
uniform mediump float u_Factor;
|
||||
uniform mediump float u_SceneRadius;
|
||||
uniform highp mat4 u_Mv;
|
||||
uniform bool u_DisplayFaceNormal;
|
||||
|
||||
void GenerateLine(int index)
|
||||
{
|
||||
fColor = gs_in[index].color;
|
||||
|
||||
ls_fP = gl_in[index].gl_Position;
|
||||
gl_Position = u_Projection * u_Mv * gl_in[index].gl_Position;
|
||||
EmitVertex();
|
||||
|
||||
vec4 newPosition = u_Mv * gl_in[index].gl_Position + vec4(gs_in[index].normal, 0.0) * u_SceneRadius * u_Factor;
|
||||
ls_fP = inverse(u_Mv) * newPosition;
|
||||
gl_Position = u_Projection * newPosition;
|
||||
EmitVertex();
|
||||
|
||||
EndPrimitive();
|
||||
}
|
||||
|
||||
void DrawVerticesNormal()
|
||||
{
|
||||
GenerateLine(0); // first vertex normal
|
||||
GenerateLine(1); // second vertex normal
|
||||
GenerateLine(2); // third vertex normal
|
||||
}
|
||||
|
||||
void DrawFaceNormal()
|
||||
{
|
||||
fColor = (gs_in[0].color + gs_in[1].color + gs_in[2].color) / 3;
|
||||
vec4 center = (gl_in[0].gl_Position + gl_in[1].gl_Position + gl_in[2].gl_Position) / 3;
|
||||
ls_fP = center;
|
||||
gl_Position = u_Projection * u_Mv * center;
|
||||
EmitVertex();
|
||||
|
||||
vec3 n = normalize((gs_in[0].normal.xyz + gs_in[1].normal.xyz + gs_in[2].normal.xyz) / 3);
|
||||
|
||||
vec4 newPosition = u_Mv * center + vec4(n, 0.0) * u_SceneRadius * u_Factor;
|
||||
ls_fP = inverse(u_Mv) * newPosition;
|
||||
gl_Position = u_Projection * newPosition;
|
||||
EmitVertex();
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
if (u_DisplayFaceNormal)
|
||||
{
|
||||
DrawFaceNormal();
|
||||
}
|
||||
else
|
||||
{
|
||||
DrawVerticesNormal();
|
||||
}
|
||||
}
|
||||
)DELIM";
|
||||
|
||||
const char VERTEX_SOURCE_TRIANGLE[]=R"DELIM(
|
||||
#version 150
|
||||
in highp vec3 a_Pos;
|
||||
|
||||
out VS_OUT {
|
||||
mediump vec4 color;
|
||||
highp vec4 ls_fP;
|
||||
} vs_out;
|
||||
|
||||
uniform highp mat4 u_Mvp;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
vec4 pos = vec4(a_Pos, 1.0);
|
||||
|
||||
vs_out.color = vec4(0.85, 0.85, 0.85, 1.0);
|
||||
vs_out.ls_fP = pos;
|
||||
|
||||
gl_Position = u_Mvp * pos;
|
||||
}
|
||||
)DELIM";
|
||||
|
||||
const char GEOMETRY_SOURCE_TRIANGLE[]=R"DELIM(
|
||||
#version 150
|
||||
layout (triangles) in;
|
||||
layout (line_strip, max_vertices=4) out;
|
||||
|
||||
in VS_OUT {
|
||||
mediump vec4 color;
|
||||
highp vec4 ls_fP;
|
||||
} gs_in[];
|
||||
|
||||
out mediump vec4 fColor;
|
||||
out highp vec4 ls_fP;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
fColor = gs_in[0].color;
|
||||
ls_fP = gs_in[0].ls_fP;
|
||||
gl_Position = gl_in[0].gl_Position;
|
||||
EmitVertex();
|
||||
|
||||
ls_fP = gs_in[1].ls_fP;
|
||||
gl_Position = gl_in[1].gl_Position;
|
||||
EmitVertex();
|
||||
|
||||
ls_fP = gs_in[2].ls_fP;
|
||||
gl_Position = gl_in[2].gl_Position;
|
||||
EmitVertex();
|
||||
|
||||
ls_fP = gs_in[0].ls_fP;
|
||||
gl_Position = gl_in[0].gl_Position;
|
||||
EmitVertex();
|
||||
}
|
||||
)DELIM";
|
||||
|
||||
const char VERTEX_SOURCE_LINE_WIDTH[]=R"DELIM(
|
||||
#version 150
|
||||
|
||||
in highp vec3 a_Pos;
|
||||
in mediump vec3 a_Color;
|
||||
|
||||
out VS_OUT {
|
||||
mediump float pointSize;
|
||||
mediump vec4 color;
|
||||
highp vec4 ls_fP;
|
||||
} vs_out;
|
||||
|
||||
uniform highp mat4 u_Mvp;
|
||||
uniform mediump float u_PointSize;
|
||||
uniform bool u_IsOrthographic;
|
||||
uniform mediump vec3 u_DefaultColor;
|
||||
uniform bool u_UseDefaultColor;
|
||||
|
||||
bool EqualZero(float value)
|
||||
{
|
||||
return abs(value) < 0.00001;
|
||||
}
|
||||
|
||||
void main(void)
|
||||
{
|
||||
vec4 pos = vec4(a_Pos, 1.0);
|
||||
|
||||
vs_out.ls_fP = pos;
|
||||
vs_out.color = vec4(a_Color, 1.0);
|
||||
if (u_UseDefaultColor)
|
||||
{
|
||||
vs_out.color = vec4(u_DefaultColor, 1.0);
|
||||
}
|
||||
|
||||
gl_Position = u_Mvp * pos;
|
||||
|
||||
float distance = gl_Position.w;
|
||||
if (u_IsOrthographic)
|
||||
{
|
||||
distance = u_PointSize;
|
||||
}
|
||||
|
||||
float effectiveDistance = EqualZero(distance) ? 0.00001 : distance;
|
||||
vs_out.pointSize = u_PointSize / effectiveDistance;
|
||||
}
|
||||
)DELIM";
|
||||
|
||||
const char GEOMETRY_SOURCE_LINE_WIDTH[]=R"DELIM(
|
||||
#version 150
|
||||
layout (lines) in;
|
||||
layout (triangle_strip, max_vertices = 4) out;
|
||||
|
||||
in mediump vec4 g_Color[];
|
||||
|
||||
in VS_OUT {
|
||||
mediump float pointSize;
|
||||
mediump vec4 color;
|
||||
highp vec4 ls_fP;
|
||||
} gs_in[];
|
||||
|
||||
out mediump vec4 fColor;
|
||||
out highp vec4 ls_fP;
|
||||
|
||||
uniform mediump float u_PointSize;
|
||||
uniform mediump vec2 u_Viewport;
|
||||
uniform highp mat4 u_Mvp;
|
||||
|
||||
vec2 ToScreenSpace(vec4 vertex)
|
||||
{
|
||||
return vec2(vertex.xy / vertex.w) * u_Viewport;
|
||||
}
|
||||
|
||||
vec4 ToWorldSpace(vec4 vertex)
|
||||
{
|
||||
return vec4((vertex.xy * vertex.w) / u_Viewport, vertex.zw);
|
||||
}
|
||||
|
||||
void main(void)
|
||||
{
|
||||
vec2 p0 = ToScreenSpace(gl_in[0].gl_Position);
|
||||
vec2 p1 = ToScreenSpace(gl_in[1].gl_Position);
|
||||
vec2 v0 = normalize(p1 - p0);
|
||||
vec2 n0 = vec2(-v0.y, v0.x) * u_PointSize * 0.5;
|
||||
|
||||
// line start
|
||||
gl_Position = ToWorldSpace(vec4(p0 - n0 * gs_in[0].pointSize, gl_in[0].gl_Position.zw));
|
||||
fColor = gs_in[0].color;
|
||||
ls_fP = inverse(u_Mvp) * gl_Position;
|
||||
EmitVertex();
|
||||
|
||||
gl_Position = ToWorldSpace(vec4(p0 + n0 * gs_in[0].pointSize, gl_in[0].gl_Position.zw));
|
||||
fColor = gs_in[0].color;
|
||||
ls_fP = inverse(u_Mvp) * gl_Position;
|
||||
EmitVertex();
|
||||
|
||||
// line end
|
||||
gl_Position = ToWorldSpace(vec4(p1 - n0 * gs_in[1].pointSize, gl_in[1].gl_Position.zw));
|
||||
fColor = gs_in[1].color;
|
||||
ls_fP = inverse(u_Mvp) * gl_Position;
|
||||
EmitVertex();
|
||||
|
||||
gl_Position = ToWorldSpace(vec4(p1 + n0 * gs_in[1].pointSize, gl_in[1].gl_Position.zw));
|
||||
fColor = gs_in[1].color;
|
||||
ls_fP = inverse(u_Mvp) * gl_Position;
|
||||
EmitVertex();
|
||||
}
|
||||
)DELIM";
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// compatibility shaders
|
||||
|
||||
const char VERTEX_SOURCE_COLOR_COMP[]=R"DELIM(
|
||||
varying highp vec3 a_Pos;
|
||||
varying highp vec3 a_Normal;
|
||||
varying mediump vec3 a_Color;
|
||||
|
||||
varying highp vec4 vs_fP; // view space position
|
||||
varying highp vec3 fN;
|
||||
varying mediump vec4 fColor;
|
||||
|
||||
uniform highp mat4 u_Mvp;
|
||||
uniform highp mat4 u_Mv;
|
||||
uniform mediump float u_PointSize;
|
||||
uniform mediump vec3 u_DefaultColor;
|
||||
uniform bool u_UseDefaultColor;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
vec4 pos = vec4(a_Pos, 1.0);
|
||||
|
||||
vs_fP = u_Mv * pos;
|
||||
highp mat3 mv_matrix_3;
|
||||
mv_matrix_3[0] = mv_matrix[0].xyz;
|
||||
mv_matrix_3[1] = mv_matrix[1].xyz;
|
||||
mv_matrix_3[2] = mv_matrix[2].xyz;
|
||||
fN = mv_matrix_3* normal;
|
||||
fColor = vec4(color, 1.0);
|
||||
gl_PointSize = point_size;
|
||||
fN = mv_matrix_3* a_Normal;
|
||||
|
||||
gl_Position = mvp_matrix * vertex;
|
||||
fColor = vec4(a_Color, 1.0);
|
||||
if (u_UseDefaultColor)
|
||||
{
|
||||
fColor = vec4(u_DefaultColor, 1.0);
|
||||
}
|
||||
|
||||
gl_PointSize = u_PointSize;
|
||||
|
||||
gl_Position = u_Mvp * pos;
|
||||
}
|
||||
)DELIM";
|
||||
|
||||
const char fragment_source_color_comp[]=R"DELIM(
|
||||
varying highp vec4 fP;
|
||||
varying highp vec3 fN;
|
||||
varying highp vec4 fColor;
|
||||
const char FRAGMENT_SOURCE_COLOR_COMP[]=R"DELIM(
|
||||
varying highp vec4 vs_fP;
|
||||
varying highp vec3 fN;
|
||||
varying mediump vec4 fColor;
|
||||
|
||||
uniform highp vec4 light_pos;
|
||||
uniform highp vec4 light_diff;
|
||||
uniform highp vec4 light_spec;
|
||||
uniform highp vec4 light_amb;
|
||||
uniform highp float spec_power ;
|
||||
uniform highp vec4 u_LightPos;
|
||||
uniform mediump vec4 u_LightDiff;
|
||||
uniform mediump vec4 u_LightSpec;
|
||||
uniform mediump vec4 u_LightAmb;
|
||||
uniform mediump float u_SpecPower ;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
highp vec3 L = light_pos.xyz - fP.xyz;
|
||||
highp vec3 V = -fP.xyz;
|
||||
highp vec3 L = u_LightPos.xyz - vs_fP.xyz;
|
||||
highp vec3 V = -vs_fP.xyz;
|
||||
|
||||
highp vec3 N = normalize(fN);
|
||||
highp vec3 a_Normal = normalize(fN);
|
||||
L = normalize(L);
|
||||
V = normalize(V);
|
||||
|
||||
highp vec3 R = reflect(-L, N);
|
||||
highp vec4 diffuse = max(dot(N,L), 0.0) * light_diff * fColor;
|
||||
highp vec4 specular = pow(max(dot(R,V), 0.0), spec_power) * light_spec;
|
||||
highp vec3 R = reflect(-L, a_Normal);
|
||||
highp vec4 diffuse = max(dot(a_Normal,L), 0.0) * u_LightDiff * fColor;
|
||||
highp vec4 specular = pow(max(dot(R,V), 0.0), u_SpecPower) * u_LightSpec;
|
||||
|
||||
gl_FragColor = light_amb*fColor + diffuse;
|
||||
gl_FragColor = u_LightAmb*fColor + diffuse;
|
||||
}
|
||||
)DELIM";
|
||||
|
||||
const char vertex_source_p_l_comp[]=R"DELIM(
|
||||
varying highp vec4 vertex;
|
||||
varying highp vec3 color;
|
||||
const char VERTEX_SOURCE_P_L_COMP[]=R"DELIM(
|
||||
varying highp vec3 a_Pos;
|
||||
varying mediump vec3 a_Color;
|
||||
|
||||
uniform highp mat4 mvp_matrix;
|
||||
uniform highp float point_size;
|
||||
varying mediump vec4 fColor;
|
||||
|
||||
varying highp vec4 fColor;
|
||||
uniform highp mat4 u_Mvp;
|
||||
uniform mediump float u_PointSize;
|
||||
uniform mediump vec3 u_DefaultColor;
|
||||
uniform bool u_UseDefaultColor;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
gl_PointSize = point_size;
|
||||
fColor = vec4(color, 1.0);
|
||||
gl_Position = mvp_matrix * vertex;
|
||||
fColor = vec4(a_Color, 1.0);
|
||||
if (u_UseDefaultColor)
|
||||
{
|
||||
fColor = vec4(u_DefaultColor, 1.0);
|
||||
}
|
||||
|
||||
gl_PointSize = u_PointSize;
|
||||
gl_Position = u_Mvp * vec4(a_Pos, 1.0);
|
||||
}
|
||||
)DELIM";
|
||||
|
||||
const char fragment_source_p_l_comp[]=R"DELIM(
|
||||
varying highp vec4 fColor;
|
||||
const char FRAGMENT_SOURCE_P_L_COMP[]=R"DELIM(
|
||||
varying mediump vec4 fColor;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
gl_FragColor = fColor;
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ namespace internal
|
|||
{
|
||||
typename CDT::Edge e(fh,i);
|
||||
auto n = fh->neighbor(i);
|
||||
if (n->info().m_nesting_level==-1)
|
||||
if (n!=nullptr && n->info().m_nesting_level==-1)
|
||||
{
|
||||
if (tri.is_constrained(e)) { border.push(e); }
|
||||
else { queue.push(n); }
|
||||
|
|
|
|||
|
|
@ -64,64 +64,82 @@ public:
|
|||
typedef Local_kernel::Vector_3 Local_vector;
|
||||
|
||||
Graphics_scene()
|
||||
: m_buffer_for_mono_points(&arrays[POS_MONO_POINTS], nullptr,
|
||||
&m_bounding_box, nullptr, nullptr, nullptr),
|
||||
m_buffer_for_colored_points(&arrays[POS_COLORED_POINTS], nullptr,
|
||||
&m_bounding_box, &arrays[COLOR_POINTS],
|
||||
nullptr, nullptr),
|
||||
m_buffer_for_mono_segments(&arrays[POS_MONO_SEGMENTS], nullptr,
|
||||
&m_bounding_box, nullptr, nullptr, nullptr),
|
||||
m_buffer_for_colored_segments(&arrays[POS_COLORED_SEGMENTS], nullptr,
|
||||
&m_bounding_box, &arrays[COLOR_SEGMENTS],
|
||||
nullptr, nullptr),
|
||||
m_buffer_for_mono_rays(&arrays[POS_MONO_RAYS], nullptr, &m_bounding_box,
|
||||
nullptr, nullptr),
|
||||
m_buffer_for_colored_rays(&arrays[POS_COLORED_RAYS], nullptr,
|
||||
&m_bounding_box, &arrays[COLOR_RAYS], nullptr,
|
||||
nullptr),
|
||||
m_buffer_for_mono_lines(&arrays[POS_MONO_RAYS], nullptr,
|
||||
&m_bounding_box, nullptr, nullptr),
|
||||
m_buffer_for_colored_lines(&arrays[POS_COLORED_LINES], nullptr,
|
||||
&m_bounding_box, &arrays[COLOR_LINES],
|
||||
nullptr, nullptr),
|
||||
m_buffer_for_mono_faces(
|
||||
&arrays[POS_MONO_FACES], nullptr, &m_bounding_box, nullptr,
|
||||
&arrays[FLAT_NORMAL_MONO_FACES], &arrays[SMOOTH_NORMAL_MONO_FACES]),
|
||||
m_buffer_for_colored_faces(&arrays[POS_COLORED_FACES], nullptr,
|
||||
&m_bounding_box, &arrays[COLOR_FACES],
|
||||
&arrays[FLAT_NORMAL_COLORED_FACES],
|
||||
&arrays[SMOOTH_NORMAL_COLORED_FACES])
|
||||
: m_buffer_for_points(&arrays[POS_POINTS], nullptr,
|
||||
&m_bounding_box, &arrays[COLOR_POINTS]),
|
||||
m_buffer_for_segments(&arrays[POS_SEGMENTS], nullptr,
|
||||
&m_bounding_box, &arrays[COLOR_SEGMENTS]),
|
||||
m_buffer_for_rays(&arrays[POS_RAYS], nullptr, &m_bounding_box,
|
||||
&arrays[COLOR_RAYS]),
|
||||
m_buffer_for_lines(&arrays[POS_RAYS], nullptr,
|
||||
&m_bounding_box, &arrays[COLOR_LINES]),
|
||||
m_buffer_for_faces(&arrays[POS_FACES], nullptr, &m_bounding_box, &arrays[COLOR_FACES],
|
||||
&arrays[FLAT_NORMAL_FACES], &arrays[SMOOTH_NORMAL_FACES]),
|
||||
m_default_color_face(60, 60, 200),
|
||||
m_default_color_point(200, 60, 60),
|
||||
m_default_color_segment(0, 0, 0),
|
||||
m_default_color_ray(0, 0, 0),
|
||||
m_default_color_line(0, 0, 0)
|
||||
{}
|
||||
|
||||
const Buffer_for_vao &get_buffer_for_mono_points() const
|
||||
{ return m_buffer_for_mono_points; }
|
||||
inline
|
||||
const CGAL::IO::Color &get_default_color_face() const
|
||||
{ return m_default_color_face; }
|
||||
|
||||
const Buffer_for_vao &get_buffer_for_colored_points() const
|
||||
{ return m_buffer_for_colored_points; }
|
||||
inline
|
||||
const CGAL::IO::Color &get_default_color_point() const
|
||||
{ return m_default_color_point; }
|
||||
|
||||
const Buffer_for_vao &get_buffer_for_mono_segments() const
|
||||
{ return m_buffer_for_mono_segments; }
|
||||
inline
|
||||
const CGAL::IO::Color &get_default_color_segment() const
|
||||
{ return m_default_color_segment; }
|
||||
|
||||
const Buffer_for_vao &get_buffer_for_colored_segments() const
|
||||
{ return m_buffer_for_colored_segments; }
|
||||
inline
|
||||
const CGAL::IO::Color &get_default_color_ray() const
|
||||
{ return m_default_color_ray; }
|
||||
|
||||
const Buffer_for_vao &get_buffer_for_mono_rays() const
|
||||
{ return m_buffer_for_mono_rays; }
|
||||
inline
|
||||
const CGAL::IO::Color &get_default_color_line() const
|
||||
{ return m_default_color_line; }
|
||||
|
||||
const Buffer_for_vao &get_buffer_for_colored_rays() const
|
||||
{ return m_buffer_for_colored_rays; }
|
||||
inline
|
||||
const Buffer_for_vao &get_buffer_for_points() const
|
||||
{ return m_buffer_for_points; }
|
||||
|
||||
const Buffer_for_vao &get_buffer_for_mono_lines() const
|
||||
{ return m_buffer_for_mono_lines; }
|
||||
inline
|
||||
void set_default_color_face(const CGAL::IO::Color& c)
|
||||
{ m_default_color_face = c; }
|
||||
|
||||
const Buffer_for_vao &get_buffer_for_colored_lines() const
|
||||
{ return m_buffer_for_colored_lines; }
|
||||
inline
|
||||
void set_default_color_point(const CGAL::IO::Color& c)
|
||||
{ m_default_color_point = c; }
|
||||
|
||||
const Buffer_for_vao &get_buffer_for_mono_faces() const
|
||||
{ return m_buffer_for_mono_faces; }
|
||||
inline
|
||||
void set_default_color_segment(const CGAL::IO::Color& c)
|
||||
{ m_default_color_segment = c; }
|
||||
|
||||
const Buffer_for_vao &get_buffer_for_colored_faces() const
|
||||
{ return m_buffer_for_colored_faces; }
|
||||
inline
|
||||
void set_default_color_ray(const CGAL::IO::Color& c)
|
||||
{ m_default_color_ray = c; }
|
||||
|
||||
inline
|
||||
void set_default_color_line(const CGAL::IO::Color& c)
|
||||
{ m_default_color_line = c; }
|
||||
|
||||
inline
|
||||
const Buffer_for_vao &get_buffer_for_segments() const
|
||||
{ return m_buffer_for_segments; }
|
||||
|
||||
inline
|
||||
const Buffer_for_vao &get_buffer_for_rays() const
|
||||
{ return m_buffer_for_rays; }
|
||||
|
||||
inline
|
||||
const Buffer_for_vao &get_buffer_for_lines() const
|
||||
{ return m_buffer_for_lines; }
|
||||
|
||||
inline
|
||||
const Buffer_for_vao &get_buffer_for_faces() const
|
||||
{ return m_buffer_for_faces; }
|
||||
|
||||
const CGAL::Bbox_3 &bounding_box() const { return m_bounding_box; }
|
||||
|
||||
|
|
@ -159,31 +177,30 @@ public:
|
|||
|
||||
void reverse_all_normals() const
|
||||
{
|
||||
m_buffer_for_mono_faces.negate_normals();
|
||||
m_buffer_for_colored_faces.negate_normals();
|
||||
m_buffer_for_faces.negate_normals();
|
||||
}
|
||||
|
||||
template <typename KPoint> void add_point(const KPoint &p)
|
||||
{ m_buffer_for_mono_points.add_point(p); }
|
||||
{ m_buffer_for_points.add_point(p, m_default_color_point); }
|
||||
|
||||
template <typename KPoint>
|
||||
void add_point(const KPoint &p, const CGAL::IO::Color &acolor)
|
||||
{ m_buffer_for_colored_points.add_point(p, acolor); }
|
||||
{ m_buffer_for_points.add_point(p, acolor); }
|
||||
|
||||
template <typename KPoint>
|
||||
void add_segment(const KPoint &p1, const KPoint &p2)
|
||||
{ m_buffer_for_mono_segments.add_segment(p1, p2); }
|
||||
{ m_buffer_for_segments.add_segment(p1, p2, m_default_color_segment); }
|
||||
|
||||
template <typename KPoint>
|
||||
void add_segment(const KPoint &p1, const KPoint &p2,
|
||||
const CGAL::IO::Color &acolor)
|
||||
{ m_buffer_for_colored_segments.add_segment(p1, p2, acolor); }
|
||||
{ m_buffer_for_segments.add_segment(p1, p2, acolor); }
|
||||
|
||||
template <typename KPoint, typename KVector>
|
||||
void add_ray(const KPoint &p, const KVector &v)
|
||||
{
|
||||
double bigNumber = 1e30;
|
||||
m_buffer_for_mono_rays.add_ray_segment(p, (p + (bigNumber)*v));
|
||||
m_buffer_for_rays.add_ray_segment(p, (p + (bigNumber)*v), m_default_color_ray);
|
||||
}
|
||||
|
||||
template <typename KPoint, typename KVector>
|
||||
|
|
@ -191,15 +208,15 @@ public:
|
|||
const CGAL::IO::Color &acolor)
|
||||
{
|
||||
double bigNumber = 1e30;
|
||||
m_buffer_for_colored_rays.add_ray_segment(p, (p + (bigNumber)*v), acolor);
|
||||
m_buffer_for_rays.add_ray_segment(p, (p + (bigNumber)*v), acolor);
|
||||
}
|
||||
|
||||
template <typename KPoint, typename KVector>
|
||||
void add_line(const KPoint &p, const KVector &v)
|
||||
{
|
||||
double bigNumber = 1e30;
|
||||
m_buffer_for_mono_lines.add_line_segment((p - (bigNumber)*v),
|
||||
(p + (bigNumber)*v));
|
||||
m_buffer_for_lines.add_line_segment((p - (bigNumber)*v),
|
||||
(p + (bigNumber)*v), m_default_color_line);
|
||||
}
|
||||
|
||||
template <typename KPoint, typename KVector>
|
||||
|
|
@ -207,33 +224,28 @@ public:
|
|||
const CGAL::IO::Color &acolor)
|
||||
{
|
||||
double bigNumber = 1e30;
|
||||
m_buffer_for_colored_lines.add_line_segment((p - (bigNumber)*v),
|
||||
m_buffer_for_lines.add_line_segment((p - (bigNumber)*v),
|
||||
(p + (bigNumber)*v), acolor);
|
||||
}
|
||||
|
||||
template <typename KPoint> bool add_point_in_face(const KPoint &kp)
|
||||
{
|
||||
if (m_buffer_for_mono_faces.is_a_face_started())
|
||||
{ return m_buffer_for_mono_faces.add_point_in_face(kp); }
|
||||
else if (m_buffer_for_colored_faces.is_a_face_started())
|
||||
{ return m_buffer_for_colored_faces.add_point_in_face(kp); }
|
||||
if (m_buffer_for_faces.is_a_face_started())
|
||||
{ return m_buffer_for_faces.add_point_in_face(kp); }
|
||||
return false;
|
||||
}
|
||||
|
||||
template <typename KPoint, typename KVector>
|
||||
bool add_point_in_face(const KPoint &kp, const KVector &p_normal)
|
||||
{
|
||||
if (m_buffer_for_mono_faces.is_a_face_started())
|
||||
{ return m_buffer_for_mono_faces.add_point_in_face(kp, p_normal); }
|
||||
else if (m_buffer_for_colored_faces.is_a_face_started())
|
||||
{ return m_buffer_for_colored_faces.add_point_in_face(kp, p_normal); }
|
||||
if (m_buffer_for_faces.is_a_face_started())
|
||||
{ return m_buffer_for_faces.add_point_in_face(kp, p_normal); }
|
||||
return false;
|
||||
}
|
||||
|
||||
bool a_face_started() const
|
||||
{
|
||||
return m_buffer_for_mono_faces.is_a_face_started() ||
|
||||
m_buffer_for_colored_faces.is_a_face_started();
|
||||
return m_buffer_for_faces.is_a_face_started();
|
||||
}
|
||||
|
||||
void face_begin()
|
||||
|
|
@ -245,7 +257,7 @@ public:
|
|||
<< std::endl;
|
||||
}
|
||||
else
|
||||
{ m_buffer_for_mono_faces.face_begin(); }
|
||||
{ m_buffer_for_faces.face_begin(m_default_color_face); }
|
||||
}
|
||||
|
||||
void face_begin(const CGAL::IO::Color &acolor)
|
||||
|
|
@ -257,15 +269,13 @@ public:
|
|||
<< std::endl;
|
||||
}
|
||||
else
|
||||
{ m_buffer_for_colored_faces.face_begin(acolor); }
|
||||
{ m_buffer_for_faces.face_begin(acolor); }
|
||||
}
|
||||
|
||||
void face_end()
|
||||
{
|
||||
if (m_buffer_for_mono_faces.is_a_face_started())
|
||||
{ m_buffer_for_mono_faces.face_end(); }
|
||||
else if (m_buffer_for_colored_faces.is_a_face_started())
|
||||
{ m_buffer_for_colored_faces.face_end(); }
|
||||
if (m_buffer_for_faces.is_a_face_started())
|
||||
{ m_buffer_for_faces.face_end(); }
|
||||
}
|
||||
|
||||
template <typename KPoint>
|
||||
|
|
@ -281,58 +291,38 @@ public:
|
|||
|
||||
bool empty() const
|
||||
{
|
||||
return (m_buffer_for_mono_points.is_empty() &&
|
||||
m_buffer_for_colored_points.is_empty() &&
|
||||
m_buffer_for_mono_segments.is_empty() &&
|
||||
m_buffer_for_colored_segments.is_empty() &&
|
||||
m_buffer_for_mono_rays.is_empty() &&
|
||||
m_buffer_for_colored_rays.is_empty() &&
|
||||
m_buffer_for_mono_lines.is_empty() &&
|
||||
m_buffer_for_colored_lines.is_empty() &&
|
||||
m_buffer_for_mono_faces.is_empty() &&
|
||||
m_buffer_for_colored_faces.is_empty());
|
||||
return (m_buffer_for_points.is_empty() &&
|
||||
m_buffer_for_segments.is_empty() &&
|
||||
m_buffer_for_rays.is_empty() &&
|
||||
m_buffer_for_lines.is_empty() &&
|
||||
m_buffer_for_faces.is_empty());
|
||||
}
|
||||
|
||||
bool has_zero_x() const
|
||||
{
|
||||
return m_buffer_for_mono_points.has_zero_x() &&
|
||||
m_buffer_for_colored_points.has_zero_x() &&
|
||||
m_buffer_for_mono_segments.has_zero_x() &&
|
||||
m_buffer_for_colored_segments.has_zero_x() &&
|
||||
m_buffer_for_mono_faces.has_zero_x() &&
|
||||
m_buffer_for_colored_faces.has_zero_x() &&
|
||||
m_buffer_for_mono_rays.has_zero_x() &&
|
||||
m_buffer_for_colored_rays.has_zero_x() &&
|
||||
m_buffer_for_mono_lines.has_zero_x() &&
|
||||
m_buffer_for_colored_lines.has_zero_x();
|
||||
return m_buffer_for_points.has_zero_x() &&
|
||||
m_buffer_for_segments.has_zero_x() &&
|
||||
m_buffer_for_faces.has_zero_x() &&
|
||||
m_buffer_for_rays.has_zero_x() &&
|
||||
m_buffer_for_lines.has_zero_x();
|
||||
}
|
||||
|
||||
bool has_zero_y() const
|
||||
{
|
||||
return m_buffer_for_mono_points.has_zero_y() &&
|
||||
m_buffer_for_colored_points.has_zero_y() &&
|
||||
m_buffer_for_mono_segments.has_zero_y() &&
|
||||
m_buffer_for_colored_segments.has_zero_y() &&
|
||||
m_buffer_for_mono_faces.has_zero_y() &&
|
||||
m_buffer_for_colored_faces.has_zero_y() &&
|
||||
m_buffer_for_mono_rays.has_zero_y() &&
|
||||
m_buffer_for_colored_rays.has_zero_y() &&
|
||||
m_buffer_for_mono_lines.has_zero_y() &&
|
||||
m_buffer_for_colored_lines.has_zero_y();
|
||||
return m_buffer_for_points.has_zero_y() &&
|
||||
m_buffer_for_segments.has_zero_y() &&
|
||||
m_buffer_for_faces.has_zero_y() &&
|
||||
m_buffer_for_rays.has_zero_y() &&
|
||||
m_buffer_for_lines.has_zero_y();
|
||||
}
|
||||
|
||||
bool has_zero_z() const
|
||||
{
|
||||
return m_buffer_for_mono_points.has_zero_z() &&
|
||||
m_buffer_for_colored_points.has_zero_z() &&
|
||||
m_buffer_for_mono_segments.has_zero_z() &&
|
||||
m_buffer_for_colored_segments.has_zero_z() &&
|
||||
m_buffer_for_mono_faces.has_zero_z() &&
|
||||
m_buffer_for_colored_faces.has_zero_z() &&
|
||||
m_buffer_for_mono_rays.has_zero_z() &&
|
||||
m_buffer_for_colored_rays.has_zero_z() &&
|
||||
m_buffer_for_mono_lines.has_zero_z() &&
|
||||
m_buffer_for_colored_lines.has_zero_z();
|
||||
return m_buffer_for_points.has_zero_z() &&
|
||||
m_buffer_for_segments.has_zero_z() &&
|
||||
m_buffer_for_faces.has_zero_z() &&
|
||||
m_buffer_for_rays.has_zero_z() &&
|
||||
m_buffer_for_lines.has_zero_z();
|
||||
}
|
||||
|
||||
// Returns true if the data structure lies on a XY or XZ or YZ plane
|
||||
|
|
@ -343,16 +333,11 @@ public:
|
|||
|
||||
void clear()
|
||||
{
|
||||
m_buffer_for_mono_points.clear();
|
||||
m_buffer_for_colored_points.clear();
|
||||
m_buffer_for_mono_segments.clear();
|
||||
m_buffer_for_colored_segments.clear();
|
||||
m_buffer_for_mono_rays.clear();
|
||||
m_buffer_for_colored_rays.clear();
|
||||
m_buffer_for_mono_lines.clear();
|
||||
m_buffer_for_colored_lines.clear();
|
||||
m_buffer_for_mono_faces.clear();
|
||||
m_buffer_for_colored_faces.clear();
|
||||
m_buffer_for_points.clear();
|
||||
m_buffer_for_segments.clear();
|
||||
m_buffer_for_rays.clear();
|
||||
m_buffer_for_lines.clear();
|
||||
m_buffer_for_faces.clear();
|
||||
m_texts.clear();
|
||||
m_bounding_box=CGAL::Bbox_3();
|
||||
}
|
||||
|
|
@ -385,16 +370,11 @@ public:
|
|||
// vectors.
|
||||
enum Buffers {
|
||||
BEGIN_POS = 0,
|
||||
POS_MONO_POINTS = BEGIN_POS,
|
||||
POS_COLORED_POINTS,
|
||||
POS_MONO_SEGMENTS,
|
||||
POS_COLORED_SEGMENTS,
|
||||
POS_MONO_RAYS,
|
||||
POS_COLORED_RAYS,
|
||||
POS_MONO_LINES,
|
||||
POS_COLORED_LINES,
|
||||
POS_MONO_FACES,
|
||||
POS_COLORED_FACES,
|
||||
POS_POINTS = BEGIN_POS,
|
||||
POS_SEGMENTS,
|
||||
POS_RAYS,
|
||||
POS_LINES,
|
||||
POS_FACES,
|
||||
END_POS,
|
||||
BEGIN_COLOR = END_POS,
|
||||
COLOR_POINTS = BEGIN_COLOR,
|
||||
|
|
@ -404,25 +384,24 @@ public:
|
|||
COLOR_FACES,
|
||||
END_COLOR,
|
||||
BEGIN_NORMAL = END_COLOR,
|
||||
SMOOTH_NORMAL_MONO_FACES = BEGIN_NORMAL,
|
||||
FLAT_NORMAL_MONO_FACES,
|
||||
SMOOTH_NORMAL_COLORED_FACES,
|
||||
FLAT_NORMAL_COLORED_FACES,
|
||||
SMOOTH_NORMAL_FACES = BEGIN_NORMAL,
|
||||
FLAT_NORMAL_FACES,
|
||||
END_NORMAL,
|
||||
LAST_INDEX = END_NORMAL
|
||||
};
|
||||
|
||||
protected:
|
||||
Buffer_for_vao m_buffer_for_mono_points;
|
||||
Buffer_for_vao m_buffer_for_colored_points;
|
||||
Buffer_for_vao m_buffer_for_mono_segments;
|
||||
Buffer_for_vao m_buffer_for_colored_segments;
|
||||
Buffer_for_vao m_buffer_for_mono_rays;
|
||||
Buffer_for_vao m_buffer_for_colored_rays;
|
||||
Buffer_for_vao m_buffer_for_mono_lines;
|
||||
Buffer_for_vao m_buffer_for_colored_lines;
|
||||
Buffer_for_vao m_buffer_for_mono_faces;
|
||||
Buffer_for_vao m_buffer_for_colored_faces;
|
||||
Buffer_for_vao m_buffer_for_points;
|
||||
Buffer_for_vao m_buffer_for_segments;
|
||||
Buffer_for_vao m_buffer_for_rays;
|
||||
Buffer_for_vao m_buffer_for_lines;
|
||||
Buffer_for_vao m_buffer_for_faces;
|
||||
|
||||
CGAL::IO::Color m_default_color_face;
|
||||
CGAL::IO::Color m_default_color_point;
|
||||
CGAL::IO::Color m_default_color_segment;
|
||||
CGAL::IO::Color m_default_color_ray;
|
||||
CGAL::IO::Color m_default_color_line;
|
||||
|
||||
std::vector<std::tuple<Local_point, std::string>> m_texts;
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -27,8 +27,8 @@ struct Graphics_scene_options_polygon_set_2: public CGAL::Graphics_scene_options
|
|||
|
||||
opens a new window and draws a 2D polygon set. Parameters of the drawing are taken from the optional graphics scene options parameter.
|
||||
|
||||
A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined.
|
||||
Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`.
|
||||
A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER`/`CGAL_USE_BASIC_VIEWER_QT` (Qt viewer) is defined.
|
||||
Linking with the cmake target `CGAL::CGAL_Basic_viewer`/`CGAL::CGAL_Basic_viewer_Qt` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`/`CGAL_USE_BASIC_VIEWER_QT`.
|
||||
|
||||
\tparam PS2 which must be an instantiation of a `CGAL::Polygon_set_2<...>`.
|
||||
\tparam GSOptions a model of `GraphicsSceneOptionsPolygonSet2` concept.
|
||||
|
|
|
|||
|
|
@ -19,10 +19,10 @@
|
|||
|
||||
#include <CGAL/license/Boolean_set_operations_2.h>
|
||||
|
||||
#include <CGAL/Qt/Basic_viewer.h>
|
||||
#include <CGAL/Graphics_scene.h>
|
||||
#include <CGAL/Graphics_scene_options.h>
|
||||
#include <CGAL/Polygon_set_2.h>
|
||||
#include <CGAL/Basic_viewer.h>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
|
|
@ -166,7 +166,7 @@ void compute_elements(const PWH& pwh,
|
|||
|
||||
} // End namespace draw_function_for_boolean_set_2
|
||||
|
||||
#ifdef CGAL_USE_BASIC_VIEWER
|
||||
#if defined(CGAL_USE_BASIC_VIEWER_QT) || defined(CGAL_USE_BASIC_VIEWER)
|
||||
|
||||
template <typename PolygonSet_2, typename GSOptions>
|
||||
class Polygon_set_2_basic_viewer_qt : public Basic_viewer
|
||||
|
|
@ -319,7 +319,7 @@ void draw(const CGAL_PS2_TYPE& ps,
|
|||
draw(ps, gso, title);
|
||||
}
|
||||
|
||||
#endif // CGAL_USE_BASIC_VIEWER
|
||||
#endif // CGAL_USE_BASIC_VIEWER_QT || CGAL_USE_BASIC_VIEWER
|
||||
|
||||
#undef CGAL_PS2_TYPE
|
||||
|
||||
|
|
|
|||
|
|
@ -203,6 +203,13 @@ if (NOT TARGET CGAL::CGAL_Basic_viewer)
|
|||
INTERFACE_LINK_LIBRARIES CGAL::CGAL_Qt6)
|
||||
endif()
|
||||
|
||||
if (NOT TARGET CGAL::CGAL_Basic_viewer_Qt)
|
||||
add_library(CGAL::CGAL_Basic_viewer_Qt INTERFACE IMPORTED GLOBAL)
|
||||
set_target_properties(CGAL::CGAL_Basic_viewer_Qt PROPERTIES
|
||||
INTERFACE_COMPILE_DEFINITIONS "CGAL_USE_BASIC_VIEWER_QT"
|
||||
INTERFACE_LINK_LIBRARIES CGAL::CGAL_Qt6)
|
||||
endif()
|
||||
|
||||
#warning: the order in this list has to match the enum in Exact_type_selector
|
||||
set(CGAL_CMAKE_EXACT_NT_BACKEND_OPTIONS GMP_BACKEND GMPXX_BACKEND BOOST_GMP_BACKEND BOOST_BACKEND LEDA_BACKEND MP_FLOAT_BACKEND Default)
|
||||
set(CGAL_CMAKE_EXACT_NT_BACKEND "Default" CACHE STRING "Setting for advanced users that what to change the default number types used in filtered kernels. Some options might not be working depending on how you configured your build.")
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ namespace CGAL {
|
|||
|
||||
opens a new window and draws a linear cell complex. Parameters of the drawing are taken from the optional graphics scene options parameter.
|
||||
|
||||
A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined.
|
||||
Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`.
|
||||
A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER`/`CGAL_USE_BASIC_VIEWER_QT` (Qt viewer) is defined.
|
||||
Linking with the cmake target `CGAL::CGAL_Basic_viewer`/`CGAL::CGAL_Basic_viewer_Qt` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`/`CGAL_USE_BASIC_VIEWER_QT`.
|
||||
|
||||
\tparam LCC which must be an instantiation of a `CGAL::Linear_cell_complex_for_combinatorial_map<...>` or `CGAL::Linear_cell_complex_for_generalized_map<...>`.
|
||||
\tparam GSOptions a model of `GraphicsSceneOptions` concept.
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ namespace CGAL {
|
|||
|
||||
opens a new window and draws a nef polyhedron. Parameters of the drawing are taken from the optional graphics scene options parameter.
|
||||
|
||||
A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined.
|
||||
Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`.
|
||||
A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER`/`CGAL_USE_BASIC_VIEWER_QT` (Qt viewer) is defined.
|
||||
Linking with the cmake target `CGAL::CGAL_Basic_viewer`/`CGAL::CGAL_Basic_viewer_Qt` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`/`CGAL_USE_BASIC_VIEWER_QT`.
|
||||
|
||||
\tparam NP3 which must be an instantiation of a `CGAL::Nef_polyhedron_3<...>`.
|
||||
\tparam GSOptions a model of `GraphicsSceneOptions` concept.
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
#define DRAW_NEF_3_H
|
||||
|
||||
#include <CGAL/license/Nef_3.h>
|
||||
#include <CGAL/Qt/Basic_viewer.h>
|
||||
#include <CGAL/Basic_viewer.h>
|
||||
#include <CGAL/Graphics_scene.h>
|
||||
#include <CGAL/Graphics_scene_options.h>
|
||||
#include <CGAL/Nef_polyhedron_3.h>
|
||||
|
|
@ -278,8 +278,6 @@ void add_to_graphics_scene(const CGAL_NEF3_TYPE &anef,
|
|||
add_to_graphics_scene(anef, graphics_scene, gs_options);
|
||||
}
|
||||
|
||||
#ifdef CGAL_USE_BASIC_VIEWER
|
||||
|
||||
// Specialization of draw function
|
||||
template <typename Kernel_, typename Items_, typename Mark_,
|
||||
class GSOptions>
|
||||
|
|
@ -301,8 +299,6 @@ void draw(const CGAL_NEF3_TYPE &anef,
|
|||
draw_graphics_scene(buffer, title);
|
||||
}
|
||||
|
||||
#endif // CGAL_USE_BASIC_VIEWER
|
||||
|
||||
#undef CGAL_NEF3_TYPE
|
||||
|
||||
} // End namespace CGAL
|
||||
|
|
|
|||
|
|
@ -27,8 +27,8 @@ struct Graphics_scene_options_periodic_2_triangulation_2: public CGAL::Graphics_
|
|||
|
||||
opens a new window and draws a periodic 2D triangulation. Parameters of the drawing are taken from the optional graphics scene options parameter.
|
||||
|
||||
A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined.
|
||||
Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`.
|
||||
A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER`/`CGAL_USE_BASIC_VIEWER_QT` (Qt viewer) is defined.
|
||||
Linking with the cmake target `CGAL::CGAL_Basic_viewer`/`CGAL::CGAL_Basic_viewer_Qt` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`/`CGAL_USE_BASIC_VIEWER_QT`.
|
||||
|
||||
\tparam P2T2 which must be an instantiation of a `CGAL::Periodic_2_triangulation_2<...>`.
|
||||
\tparam GSOptions a model of `GraphicsSceneOptionsPeriodic2Triangulation2` concept.
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
#define DRAW_PERIODIC_2_TRIANGULATION_2_H
|
||||
|
||||
#include <CGAL/license/Periodic_2_triangulation_2.h>
|
||||
#include <CGAL/Qt/Basic_viewer.h>
|
||||
#include <CGAL/Basic_viewer.h>
|
||||
#include <CGAL/Graphics_scene.h>
|
||||
#include <CGAL/Graphics_scene_options.h>
|
||||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
||||
|
|
@ -220,7 +220,7 @@ void add_to_graphics_scene(const CGAL_P2T2_TYPE& p2t2,
|
|||
add_to_graphics_scene(p2t2, graphics_scene, gs_options);
|
||||
}
|
||||
|
||||
#ifdef CGAL_USE_BASIC_VIEWER
|
||||
#if defined(CGAL_USE_BASIC_VIEWER_QT) || defined(CGAL_USE_BASIC_VIEWER)
|
||||
|
||||
// Specialization of draw function
|
||||
template<class Gt, class Tds, class GSOptions>
|
||||
|
|
@ -278,7 +278,7 @@ void draw(const CGAL_P2T2_TYPE& ap2t2,
|
|||
draw(ap2t2, gs_options, title);
|
||||
}
|
||||
|
||||
#endif // CGAL_USE_BASIC_VIEWER
|
||||
#endif // CGAL_USE_BASIC_VIEWER_QT || CGAL_USE_BASIC_VIEWER
|
||||
|
||||
#undef CGAL_P2T2_TYPE
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
#define CGAL_DRAW_POINT_SET_3_H
|
||||
|
||||
#include <CGAL/license/Point_set_3.h>
|
||||
#include <CGAL/Qt/Basic_viewer.h>
|
||||
#include <CGAL/Basic_viewer.h>
|
||||
#include <CGAL/Graphics_scene.h>
|
||||
#include <CGAL/Graphics_scene_options.h>
|
||||
#include <CGAL/Point_set_3.h>
|
||||
|
|
@ -28,8 +28,8 @@ namespace CGAL {
|
|||
|
||||
opens a new window and draws a point set. Parameters of the drawing are taken from the optional graphics scene options parameter.
|
||||
|
||||
A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined.
|
||||
Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`.
|
||||
A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER`/`CGAL_USE_BASIC_VIEWER_QT` (Qt viewer) is defined.
|
||||
Linking with the cmake target `CGAL::CGAL_Basic_viewer`/`CGAL::CGAL_Basic_viewer_Qt` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`/`CGAL_USE_BASIC_VIEWER_QT`.
|
||||
|
||||
\tparam PS which must be an instantiation of a `CGAL::Point_set_3<...>`.
|
||||
\tparam GSOptions a model of `GraphicsSceneOptions` concept.
|
||||
|
|
@ -147,8 +147,6 @@ void add_to_graphics_scene(const Point_set_3<P, V>& apointset,
|
|||
add_to_graphics_scene(apointset, graphics_scene, gs_options);
|
||||
}
|
||||
|
||||
#ifdef CGAL_USE_BASIC_VIEWER
|
||||
|
||||
// Specialization of draw function.
|
||||
template <class P, class V, class GSOptions>
|
||||
void draw(const Point_set_3<P, V>& apointset,
|
||||
|
|
@ -169,8 +167,6 @@ void draw(const Point_set_3<P, V>& apointset,
|
|||
draw_graphics_scene(buffer, title);
|
||||
}
|
||||
|
||||
#endif // CGAL_USE_BASIC_VIEWER
|
||||
|
||||
} // End namespace CGAL
|
||||
|
||||
#endif // CGAL_DRAW_POINT_SET_3_H
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
#ifndef CGAL_DRAW_MULTIPOLYGON_WITH_HOLES_2_H
|
||||
#define CGAL_DRAW_MULTIPOLYGON_WITH_HOLES_2_H
|
||||
|
||||
#include <CGAL/Qt/Basic_viewer.h>
|
||||
#include <CGAL/Basic_viewer.h>
|
||||
|
||||
#ifdef DOXYGEN_RUNNING
|
||||
namespace CGAL {
|
||||
|
|
@ -44,7 +44,7 @@ void draw(const MPH& aph);
|
|||
|
||||
#endif
|
||||
|
||||
#ifdef CGAL_USE_BASIC_VIEWER
|
||||
#if defined(CGAL_USE_BASIC_VIEWER_QT) || defined(CGAL_USE_BASIC_VIEWER)
|
||||
|
||||
#include <CGAL/Qt/init_ogl_context.h>
|
||||
#include <CGAL/Multipolygon_with_holes_2.h>
|
||||
|
|
@ -207,6 +207,6 @@ void draw(const CGAL::Multipolygon_with_holes_2<T, C>& mpwh,
|
|||
|
||||
} // End namespace CGAL
|
||||
|
||||
#endif // CGAL_USE_BASIC_VIEWER
|
||||
#endif // CGAL_USE_BASIC_VIEWER_QT || CGAL_USE_BASIC_VIEWER
|
||||
|
||||
#endif // CGAL_DRAW_MULTIPOLYGON_WITH_HOLES_2_H
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
#ifndef CGAL_DRAW_POLYGON_2_H
|
||||
#define CGAL_DRAW_POLYGON_2_H
|
||||
|
||||
#include <CGAL/Qt/Basic_viewer.h>
|
||||
#include <CGAL/Basic_viewer.h>
|
||||
#include <CGAL/Graphics_scene.h>
|
||||
#include <CGAL/Graphics_scene_options.h>
|
||||
#include <CGAL/Polygon_2.h>
|
||||
|
|
@ -31,8 +31,8 @@ namespace CGAL {
|
|||
|
||||
opens a new window and draws a 2D polygon. Parameters of the drawing are taken from the optional graphics scene options parameter.
|
||||
|
||||
A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined.
|
||||
Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`.
|
||||
A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER`/`CGAL_USE_BASIC_VIEWER_QT` (Qt viewer) is defined.
|
||||
Linking with the cmake target `CGAL::CGAL_Basic_viewer`/`CGAL::CGAL_Basic_viewer_Qt` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`/`CGAL_USE_BASIC_VIEWER_QT`.
|
||||
|
||||
\tparam P which must be an instantiation of a `CGAL::Polygon_2<...>`.
|
||||
\tparam GSOptions a model of `GraphicsSceneOptions` concept.
|
||||
|
|
@ -174,8 +174,6 @@ void add_to_graphics_scene(const CGAL_P2_TYPE& ap2,
|
|||
draw_function_for_p2::compute_elements(ap2, graphics_scene, gso);
|
||||
}
|
||||
|
||||
#ifdef CGAL_USE_BASIC_VIEWER
|
||||
|
||||
// Specialization of draw function.
|
||||
template <class T, class C>
|
||||
void draw(const CGAL_P2_TYPE &ap2,
|
||||
|
|
@ -196,8 +194,6 @@ void draw(const CGAL_P2_TYPE &ap2,
|
|||
draw_graphics_scene(buffer, title);
|
||||
}
|
||||
|
||||
#endif // CGAL_USE_BASIC_VIEWER
|
||||
|
||||
#undef CGAL_P2_TYPE
|
||||
|
||||
} // End namespace CGAL
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
#ifndef CGAL_DRAW_POLYGON_WITH_HOLES_2_H
|
||||
#define CGAL_DRAW_POLYGON_WITH_HOLES_2_H
|
||||
|
||||
#include <CGAL/Qt/Basic_viewer.h>
|
||||
#include <CGAL/Basic_viewer.h>
|
||||
#include <CGAL/Graphics_scene.h>
|
||||
#include <CGAL/Graphics_scene_options.h>
|
||||
#include <CGAL/Polygon_with_holes_2.h>
|
||||
|
|
@ -31,8 +31,8 @@ namespace CGAL {
|
|||
|
||||
opens a new window and draws a 2D polygon with holes. Parameters of the drawing are taken from the optional graphics scene options parameter.
|
||||
|
||||
A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined.
|
||||
Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`.
|
||||
A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER`/`CGAL_USE_BASIC_VIEWER_QT` (Qt viewer) is defined.
|
||||
Linking with the cmake target `CGAL::CGAL_Basic_viewer`/`CGAL::CGAL_Basic_viewer_Qt` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`/`CGAL_USE_BASIC_VIEWER_QT`.
|
||||
|
||||
\tparam PH which must be an instantiation of a `CGAL::Polygon_with_holes_2<...>`.
|
||||
\tparam GSOptions a model of `GraphicsSceneOptions` concept.
|
||||
|
|
@ -212,8 +212,6 @@ void add_to_graphics_scene(const CGAL_P2_WITH_HOLES_TYPE& p2,
|
|||
add_to_graphics_scene(p2, graphics_scene, gs_options);
|
||||
}
|
||||
|
||||
#ifdef CGAL_USE_BASIC_VIEWER
|
||||
|
||||
// Specialization of draw function.
|
||||
template<class T, class C, class GSOptions>
|
||||
void draw(const CGAL_P2_WITH_HOLES_TYPE& ap2, const GSOptions &gs_options,
|
||||
|
|
@ -233,8 +231,6 @@ void draw(const CGAL_P2_WITH_HOLES_TYPE& ap2,
|
|||
draw_graphics_scene(buffer, title);
|
||||
}
|
||||
|
||||
#endif // CGAL_USE_BASIC_VIEWER
|
||||
|
||||
#undef CGAL_P2_WITH_HOLES_TYPE
|
||||
|
||||
} // End namespace CGAL
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ namespace CGAL {
|
|||
|
||||
opens a new window and draws a polyhedron. Parameters of the drawing are taken from the optional graphics scene options parameter.
|
||||
|
||||
A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined.
|
||||
Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`.
|
||||
A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER`/`CGAL_USE_BASIC_VIEWER_QT` (Qt viewer) is defined.
|
||||
Linking with the cmake target `CGAL::CGAL_Basic_viewer`/`CGAL::CGAL_Basic_viewer_Qt` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`/`CGAL_USE_BASIC_VIEWER_QT`.
|
||||
|
||||
\tparam P which must be an instantiation of a `CGAL::Polyhedron_3<...>`.
|
||||
\tparam GSOptions a model of `GraphicsSceneOptions` concept.
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
#include <CGAL/Graphics_scene_options.h>
|
||||
#include <CGAL/Polyhedron_3.h>
|
||||
#include <CGAL/draw_face_graph.h>
|
||||
#include <CGAL/Qt/Basic_viewer.h>
|
||||
#include <CGAL/Basic_viewer.h>
|
||||
|
||||
namespace CGAL
|
||||
{
|
||||
|
|
@ -48,7 +48,6 @@ void add_to_graphics_scene(const CGAL_POLY_TYPE& apoly,
|
|||
{ add_to_graphics_scene_for_fg(apoly, graphics_scene); }
|
||||
|
||||
// Specialization of draw function: require Qt and the CGAL basic viewer.
|
||||
#ifdef CGAL_USE_BASIC_VIEWER
|
||||
|
||||
template<class PolyhedronTraits_3,
|
||||
class PolyhedronItems_3,
|
||||
|
|
@ -77,7 +76,6 @@ void draw(const CGAL_POLY_TYPE& apoly,
|
|||
add_to_graphics_scene_for_fg(apoly, buffer, gs_options);
|
||||
draw_graphics_scene(buffer, title);
|
||||
}
|
||||
#endif // CGAL_USE_BASIC_VIEWER
|
||||
|
||||
#undef CGAL_POLY_TYPE
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
#define CGAL_DRAW_SS2_H
|
||||
|
||||
#include <CGAL/license/Straight_skeleton_2.h>
|
||||
#include <CGAL/Qt/Basic_viewer.h>
|
||||
#include <CGAL/Basic_viewer.h>
|
||||
#include <CGAL/Graphics_scene.h>
|
||||
#include <CGAL/Graphics_scene_options.h>
|
||||
#include <CGAL/Straight_skeleton_2.h>
|
||||
|
|
@ -180,8 +180,6 @@ void add_to_graphics_scene(const CGAL_SS_TYPE& ass2,
|
|||
}
|
||||
|
||||
// Specialization of draw function.
|
||||
#ifdef CGAL_USE_BASIC_VIEWER
|
||||
|
||||
template <class K, class GSOptions>
|
||||
void draw(const CGAL_SS_TYPE &ass2, const GSOptions &gs_options,
|
||||
const char *title="Straight Skeleton Basic Viewer")
|
||||
|
|
@ -200,8 +198,6 @@ void draw(const CGAL_SS_TYPE &ass2,
|
|||
draw_graphics_scene(buffer, title);
|
||||
}
|
||||
|
||||
#endif // CGAL_USE_BASIC_VIEWER
|
||||
|
||||
#undef CGAL_SS_TYPE
|
||||
|
||||
} // End namespace CGAL
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@
|
|||
|
||||
opens a new window and draws a surface mesh. Parameters of the drawing are taken from the optional graphics scene options parameter.
|
||||
|
||||
A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined.
|
||||
Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`.
|
||||
A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER`/`CGAL_USE_BASIC_VIEWER_QT` (Qt viewer) is defined.
|
||||
Linking with the cmake target `CGAL::CGAL_Basic_viewer`/`CGAL::CGAL_Basic_viewer_Qt` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`/`CGAL_USE_BASIC_VIEWER_QT`.
|
||||
|
||||
\tparam SM which must be an instantiation of a `CGAL::Surface_mesh<...>`.
|
||||
\tparam GSOptions a model of `GraphicsSceneOptions` concept.
|
||||
|
|
@ -93,7 +93,7 @@ void add_to_graphics_scene(const SM& sm,
|
|||
#include <CGAL/Graphics_scene_options.h>
|
||||
#include <CGAL/Surface_mesh.h>
|
||||
#include <CGAL/draw_face_graph.h>
|
||||
#include <CGAL/Qt/Basic_viewer.h>
|
||||
#include <CGAL/Basic_viewer.h>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
|
|
@ -164,8 +164,6 @@ void add_to_graphics_scene(const Surface_mesh<K>& amesh,
|
|||
{ add_to_graphics_scene_for_fg(amesh, graphics_scene,
|
||||
Graphics_scene_options_surface_mesh<K>(amesh)); }
|
||||
|
||||
#ifdef CGAL_USE_BASIC_VIEWER
|
||||
|
||||
// Specialization of draw function.
|
||||
template<class K>
|
||||
void draw(const Surface_mesh<K>& amesh,
|
||||
|
|
@ -186,8 +184,6 @@ void draw(const Surface_mesh<K>& amesh,
|
|||
draw_graphics_scene(buffer, title);
|
||||
}
|
||||
|
||||
#endif // CGAL_USE_BASIC_VIEWER
|
||||
|
||||
} // End namespace CGAL
|
||||
|
||||
#endif // DOXYGEN_RUNNING
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ namespace CGAL {
|
|||
|
||||
opens a new window and draws `amesh`, either a 2D linear cell complex or a model of the FaceGraph concept, plus the paths lying on this mesh given in `apaths`. Parameters of the drawing are taken from the optional graphics scene options parameter.
|
||||
|
||||
A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined.
|
||||
Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`.
|
||||
A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER`/`CGAL_USE_BASIC_VIEWER_QT` (Qt viewer) is defined.
|
||||
Linking with the cmake target `CGAL::CGAL_Basic_viewer`/`CGAL::CGAL_Basic_viewer_Qt` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`/`CGAL_USE_BASIC_VIEWER_QT`.
|
||||
|
||||
\tparam Mesh either a 2D linear cell complex or a model of the FaceGraph concept.
|
||||
\tparam GSOptions a model of `GraphicsSceneOptionsFaceGraphWithPaths` concept.
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
#ifndef DRAW_FACEWIDTH_H
|
||||
#define DRAW_FACEWIDTH_H
|
||||
|
||||
#ifdef CGAL_USE_BASIC_VIEWER
|
||||
|
||||
#include <CGAL/draw_linear_cell_complex.h>
|
||||
#include <CGAL/Graphics_scene_options.h>
|
||||
|
||||
|
|
@ -55,6 +53,4 @@ void draw_facewidth(const LCC& lcc,
|
|||
lcc.free_mark(face_mark);
|
||||
}
|
||||
|
||||
#endif // CGAL_USE_BASIC_VIEWER
|
||||
|
||||
#endif // DRAW_FACEWIDTH_H
|
||||
|
|
|
|||
|
|
@ -386,8 +386,6 @@ void add_to_graphics_scene(const Mesh& mesh,
|
|||
add_to_graphics_scene(mesh, graphics_scene, paths, amark);
|
||||
}
|
||||
|
||||
#ifdef CGAL_USE_BASIC_VIEWER
|
||||
|
||||
template<typename Mesh, typename GSOptions>
|
||||
void draw(const Mesh& mesh,
|
||||
const std::vector<Surface_mesh_topology::Path_on_surface<Mesh> >& paths,
|
||||
|
|
@ -436,8 +434,6 @@ void draw(const Mesh& mesh,
|
|||
draw(mesh, paths, title, amark);
|
||||
}
|
||||
|
||||
#endif // CGAL_USE_BASIC_VIEWER
|
||||
|
||||
} // End namespace CGAL
|
||||
|
||||
#endif // CGAL_DRAW_FACE_GRAPH_WITH_PATHS_H
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ namespace CGAL {
|
|||
|
||||
opens a new window and draws a constrained triangulation. If the triangulation has constraints they are drawn. The faces inside and outside of the domain, based on the property map, are drawn in different colors.
|
||||
|
||||
A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined.
|
||||
Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`.
|
||||
A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER`/`CGAL_USE_BASIC_VIEWER_QT` (Qt viewer) is defined.
|
||||
Linking with the cmake target `CGAL::CGAL_Basic_viewer`/`CGAL::CGAL_Basic_viewer_Qt` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`/`CGAL_USE_BASIC_VIEWER_QT`.
|
||||
|
||||
\tparam CT2 which must be an instantiation of a `CGAL::Constrained_triangulation_2<...>`.
|
||||
\tparam InDomainPMap a class model of `ReadablePropertyMap` with `CT2::Face_handle` as key type and `bool` as value type.
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ namespace CGAL {
|
|||
|
||||
opens a new window and draws a triangulation. Parameters of the drawing are taken from the optional graphics scene options parameter.
|
||||
|
||||
A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined.
|
||||
Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`.
|
||||
A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER`/`CGAL_USE_BASIC_VIEWER_QT` (Qt viewer) is defined.
|
||||
Linking with the cmake target `CGAL::CGAL_Basic_viewer`/`CGAL::CGAL_Basic_viewer_Qt` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`/`CGAL_USE_BASIC_VIEWER_QT`.
|
||||
|
||||
\tparam T2 which must be an instantiation of a `CGAL::Triangulation_2<...>`.
|
||||
\tparam GSOptions a model of `GraphicsSceneOptions` concept.
|
||||
|
|
|
|||
|
|
@ -81,8 +81,6 @@ void add_to_graphics_scene(const CGAL_T2_TYPE& at2,
|
|||
draw_function_for_t2::compute_elements(at2, graphics_scene, gso);
|
||||
}
|
||||
|
||||
#ifdef CGAL_USE_BASIC_VIEWER
|
||||
|
||||
template<class Gt, class Tds, class Itag, class InDomainPmap>
|
||||
void draw(const CGAL_T2_TYPE& at2, InDomainPmap ipm,
|
||||
const char *title="Constrained Triangulation_2 Basic Viewer")
|
||||
|
|
@ -101,8 +99,6 @@ void draw(const CGAL_T2_TYPE& at2,
|
|||
draw_graphics_scene(buffer, title);
|
||||
}
|
||||
|
||||
#endif // CGAL_USE_BASIC_VIEWER
|
||||
|
||||
#undef CGAL_T2_TYPE
|
||||
|
||||
} // End namespace CGAL
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
#define CGAL_DRAW_T2_H
|
||||
|
||||
#include <CGAL/license/Triangulation_2.h>
|
||||
#include <CGAL/Qt/Basic_viewer.h>
|
||||
#include <CGAL/Basic_viewer.h>
|
||||
#include <CGAL/Graphics_scene.h>
|
||||
#include <CGAL/Graphics_scene_options.h>
|
||||
#include <CGAL/Triangulation_2.h>
|
||||
|
|
@ -145,8 +145,6 @@ void add_to_graphics_scene(const CGAL_T2_TYPE& at2,
|
|||
add_to_graphics_scene(at2, graphics_scene, drawingFunctor);
|
||||
}
|
||||
|
||||
#ifdef CGAL_USE_BASIC_VIEWER
|
||||
|
||||
// Specialization of draw function.
|
||||
template <class Gt, class Tds, class GSOptions>
|
||||
void draw(const CGAL_T2_TYPE &at2, const GSOptions &gs_options,
|
||||
|
|
@ -166,8 +164,6 @@ void draw(const CGAL_T2_TYPE& at2,
|
|||
draw_graphics_scene(buffer, title);
|
||||
}
|
||||
|
||||
#endif // CGAL_USE_BASIC_VIEWER
|
||||
|
||||
#undef CGAL_T2_TYPE
|
||||
|
||||
} // End namespace CGAL
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ namespace CGAL {
|
|||
|
||||
opens a new window and draws a 3D triangulation. Parameters of the drawing are taken from the optional graphics scene options parameter.
|
||||
|
||||
A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined.
|
||||
Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`.
|
||||
A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER`/`CGAL_USE_BASIC_VIEWER_QT` (Qt viewer) is defined.
|
||||
Linking with the cmake target `CGAL::CGAL_Basic_viewer`/`CGAL::CGAL_Basic_viewer_Qt` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`/`CGAL_USE_BASIC_VIEWER_QT`.
|
||||
|
||||
\tparam T3 which must be an instantiation of a `CGAL::Triangulation_3<...>`.
|
||||
\tparam GSOptions a model of `GraphicsSceneOptions` concept.
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
#define CGAL_DRAW_T3_H
|
||||
|
||||
#include <CGAL/license/Triangulation_3.h>
|
||||
#include <CGAL/Qt/Basic_viewer.h>
|
||||
#include <CGAL/Basic_viewer.h>
|
||||
#include <CGAL/Graphics_scene.h>
|
||||
#include <CGAL/Graphics_scene_options.h>
|
||||
#include <CGAL/Random.h>
|
||||
|
|
@ -154,8 +154,6 @@ void add_to_graphics_scene(const CGAL_T3_TYPE& at3,
|
|||
add_to_graphics_scene(at3, graphics_scene, gs_options);
|
||||
}
|
||||
|
||||
#ifdef CGAL_USE_BASIC_VIEWER
|
||||
|
||||
// Specialization of draw function.
|
||||
template<class Gt, class Tds, class Lock_data_structure, class GSOptions>
|
||||
void draw(const CGAL_T3_TYPE &at3, const GSOptions &gs_options,
|
||||
|
|
@ -174,8 +172,6 @@ void draw(const CGAL_T3_TYPE &at3, const char *title="T3 Basic Viewer")
|
|||
draw_graphics_scene(buffer, title);
|
||||
}
|
||||
|
||||
#endif // CGAL_USE_BASIC_VIEWER
|
||||
|
||||
#undef CGAL_T3_TYPE
|
||||
|
||||
} // End namespace CGAL
|
||||
|
|
|
|||
|
|
@ -27,8 +27,8 @@ struct Graphics_scene_options_voronoi_diagram_2: public CGAL::Graphics_scene_opt
|
|||
|
||||
opens a new window and draws a 2D voronoi diagram. Parameters of the drawing are taken from the optional graphics scene options parameter.
|
||||
|
||||
A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined.
|
||||
Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`.
|
||||
A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER`/`CGAL_USE_BASIC_VIEWER_QT` (Qt viewer) is defined.
|
||||
Linking with the cmake target `CGAL::CGAL_Basic_viewer`/`CGAL::CGAL_Basic_viewer_Qt` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`/`CGAL_USE_BASIC_VIEWER_QT`.
|
||||
|
||||
\tparam VD2 which must be an instantiation of a `CGAL::Voronoi_diagram_2<...>`.
|
||||
\tparam GSOptions a model of `GraphicsSceneOptionsVoronoiDiagram2` concept.
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
#define CGAL_DRAW_VORONOI_DIAGRAM_2_H
|
||||
|
||||
#include <CGAL/license/Voronoi_diagram_2.h>
|
||||
#include <CGAL/Qt/Basic_viewer.h>
|
||||
#include <CGAL/Basic_viewer.h>
|
||||
#include <CGAL/Graphics_scene.h>
|
||||
#include <CGAL/Graphics_scene_options.h>
|
||||
#include <CGAL/Triangulation_utils_2.h>
|
||||
|
|
@ -371,7 +371,7 @@ void add_to_graphics_scene(const CGAL_VORONOI_TYPE& v2,
|
|||
add_to_graphics_scene(v2, graphics_scene, gs_options);
|
||||
}
|
||||
|
||||
#ifdef CGAL_USE_BASIC_VIEWER
|
||||
#if defined(CGAL_USE_BASIC_VIEWER) || defined(CGAL_USE_BASIC_VIEWER_QT)
|
||||
|
||||
// Specialization of draw function.
|
||||
template<class DG, class AT, class AP, class GSOptions>
|
||||
|
|
@ -449,7 +449,7 @@ void draw(const CGAL_VORONOI_TYPE& av2,
|
|||
draw(av2, gs_options, title);
|
||||
}
|
||||
|
||||
#endif // CGAL_USE_BASIC_VIEWER
|
||||
#endif // CGAL_USE_BASIC_VIEWER || CGAL_USE_BASIC_VIEWER_QT
|
||||
|
||||
#undef CGAL_VORONOI_TYPE
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue