mirror of https://github.com/CGAL/cgal
draw smt
This commit is contained in:
parent
f70a2d30cd
commit
2c3428335b
|
|
@ -1,8 +1,6 @@
|
||||||
#ifndef DRAW_FACEWIDTH_H
|
#ifndef DRAW_FACEWIDTH_H
|
||||||
#define DRAW_FACEWIDTH_H
|
#define DRAW_FACEWIDTH_H
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
#ifdef CGAL_USE_BASIC_VIEWER
|
#ifdef CGAL_USE_BASIC_VIEWER
|
||||||
|
|
||||||
#include <CGAL/draw_linear_cell_complex.h>
|
#include <CGAL/draw_linear_cell_complex.h>
|
||||||
|
|
|
||||||
|
|
@ -184,9 +184,10 @@ template <typename Mesh, class GSOptions>
|
||||||
void compute_edge(const Mesh &mesh,
|
void compute_edge(const Mesh &mesh,
|
||||||
const typename Get_map<Mesh, Mesh>::storage_type& lcc,
|
const typename Get_map<Mesh, Mesh>::storage_type& lcc,
|
||||||
typename Get_map<Mesh, Mesh>::type::Dart_const_descriptor dh,
|
typename Get_map<Mesh, Mesh>::type::Dart_const_descriptor dh,
|
||||||
typename Get_map<Mesh, Mesh>::type::size_type amark,
|
|
||||||
CGAL::Graphics_scene& graphics_scene,
|
CGAL::Graphics_scene& graphics_scene,
|
||||||
GSOptions& gso)
|
GSOptions& gso,
|
||||||
|
bool colored=false,
|
||||||
|
const CGAL::IO::Color& color=CGAL::IO::black())
|
||||||
{
|
{
|
||||||
if(!gso.are_edges_enabled() || !gso.draw_edge(mesh, dh))
|
if(!gso.are_edges_enabled() || !gso.draw_edge(mesh, dh))
|
||||||
{ return; }
|
{ return; }
|
||||||
|
|
@ -199,39 +200,35 @@ void compute_edge(const Mesh &mesh,
|
||||||
Dart_const_descriptor d2=lcc.other_extremity(dh);
|
Dart_const_descriptor d2=lcc.other_extremity(dh);
|
||||||
if (d2!=LCC::null_descriptor)
|
if (d2!=LCC::null_descriptor)
|
||||||
{
|
{
|
||||||
if (amark!=LCC::INVALID_MARK &&
|
if(colored)
|
||||||
(lcc.is_marked(dh, amark) || lcc.is_marked(lcc.opposite2(dh), amark)))
|
{ graphics_scene.add_segment(p1, get_point(mesh, d2), color); }
|
||||||
{ graphics_scene.add_segment(p1, get_point(mesh, d2), gso.color_of_marked_edges()); }
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if(gso.colored_edge(mesh, dh))
|
|
||||||
{ graphics_scene.add_segment(p1, get_point(mesh, d2),
|
|
||||||
gso.edge_color(mesh, dh)); }
|
|
||||||
else
|
else
|
||||||
{ graphics_scene.add_segment(p1, get_point(mesh, d2)); }
|
{ graphics_scene.add_segment(p1, get_point(mesh, d2)); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
template <typename Mesh, class GSOptions>
|
template <typename Mesh, class GSOptions>
|
||||||
void compute_edge(const Mesh &mesh,
|
void compute_edge(const Mesh &mesh,
|
||||||
const typename Get_map<Mesh, Mesh>::storage_type& lcc,
|
const typename Get_map<Mesh, Mesh>::storage_type& lcc,
|
||||||
typename Get_map<Mesh, Mesh>::type::Dart_const_descriptor dh,
|
typename Get_map<Mesh, Mesh>::type::Dart_const_descriptor dh,
|
||||||
const CGAL::IO::Color& color,
|
|
||||||
CGAL::Graphics_scene& graphics_scene,
|
CGAL::Graphics_scene& graphics_scene,
|
||||||
GSOptions& gso)
|
GSOptions& gso,
|
||||||
|
typename Get_map<Mesh, Mesh>::type::size_type amark)
|
||||||
{
|
{
|
||||||
if(!gso.are_edges_enabled() || !gso.draw_edge(mesh, dh))
|
if(!gso.are_edges_enabled() || !gso.draw_edge(mesh, dh))
|
||||||
{ return; }
|
{ return; }
|
||||||
|
|
||||||
typedef typename Get_map<Mesh, Mesh>::type LCC;
|
if (amark!=Get_map<Mesh, Mesh>::type::INVALID_MARK &&
|
||||||
typedef typename LCC::Dart_const_descriptor Dart_const_descriptor;
|
(lcc.is_marked(dh, amark) || lcc.is_marked(lcc.opposite2(dh), amark)))
|
||||||
typedef typename CGAL::Get_traits<Mesh>::Point Point;
|
{ compute_edge(mesh, lcc, dh, graphics_scene, gso, true, gso.color_of_marked_edges()); }
|
||||||
|
else
|
||||||
Point p1=get_point(mesh, dh);
|
{
|
||||||
Dart_const_descriptor d2=lcc.other_extremity(dh);
|
if(gso.colored_edge(mesh, dh))
|
||||||
if (d2!=LCC::null_descriptor)
|
{ compute_edge(mesh, lcc, dh, graphics_scene, gso, true,
|
||||||
{ graphics_scene.add_segment(p1, get_point(mesh, d2), color); }
|
gso.edge_color(mesh, dh)); }
|
||||||
|
else
|
||||||
|
{ compute_edge(mesh, lcc, dh, graphics_scene, gso, false); }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Mesh, class GSOptions>
|
template <typename Mesh, class GSOptions>
|
||||||
|
|
@ -271,7 +268,7 @@ void compute_path(const Mesh &mesh,
|
||||||
{
|
{
|
||||||
if (!lcc.is_marked( (*paths)[i].get_ith_dart(j), amark))
|
if (!lcc.is_marked( (*paths)[i].get_ith_dart(j), amark))
|
||||||
{
|
{
|
||||||
compute_edge(mesh, lcc, (*paths)[i].get_ith_dart(j), color, graphics_scene, gso);
|
compute_edge(mesh, lcc, (*paths)[i].get_ith_dart(j), graphics_scene, gso, true, color);
|
||||||
lcc.template mark_cell<1>((*paths)[i].get_ith_dart(j), amark);
|
lcc.template mark_cell<1>((*paths)[i].get_ith_dart(j), amark);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -324,7 +321,7 @@ void compute_elements(const Mesh &mesh,
|
||||||
|
|
||||||
if ( !lcc.is_marked(it, markedges) )
|
if ( !lcc.is_marked(it, markedges) )
|
||||||
{
|
{
|
||||||
compute_edge(mesh, lcc, it, amark, graphics_scene, gso);
|
compute_edge(mesh, lcc, it, graphics_scene, gso, amark);
|
||||||
lcc.template mark_cell<1>(it, markedges);
|
lcc.template mark_cell<1>(it, markedges);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -347,8 +344,8 @@ void add_to_graphics_scene(const Mesh& mesh,
|
||||||
CGAL::Graphics_scene& graphics_scene,
|
CGAL::Graphics_scene& graphics_scene,
|
||||||
const GSOptions& gso,
|
const GSOptions& gso,
|
||||||
const std::vector<Surface_mesh_topology::Path_on_surface<Mesh>>* paths,
|
const std::vector<Surface_mesh_topology::Path_on_surface<Mesh>>* paths,
|
||||||
typename Get_map<Mesh, Mesh>::type::size_type amark=0)
|
typename Get_map<Mesh, Mesh>::type::size_type amark=
|
||||||
//TODO typename Get_map<Mesh, Mesh>::type::INVALID_MARK)
|
Get_map<Mesh, Mesh>::type::INVALID_MARK)
|
||||||
{
|
{
|
||||||
draw_function_for_face_graph_with_paths::compute_elements(mesh, graphics_scene,
|
draw_function_for_face_graph_with_paths::compute_elements(mesh, graphics_scene,
|
||||||
gso, paths, amark);
|
gso, paths, amark);
|
||||||
|
|
@ -358,8 +355,8 @@ template <class Mesh>
|
||||||
void add_to_graphics_scene(const Mesh& mesh,
|
void add_to_graphics_scene(const Mesh& mesh,
|
||||||
CGAL::Graphics_scene& graphics_scene,
|
CGAL::Graphics_scene& graphics_scene,
|
||||||
const std::vector<Surface_mesh_topology::Path_on_surface<Mesh>>* paths,
|
const std::vector<Surface_mesh_topology::Path_on_surface<Mesh>>* paths,
|
||||||
typename Get_map<Mesh, Mesh>::type::size_type amark=0)
|
typename Get_map<Mesh, Mesh>::type::size_type amark=
|
||||||
// TODO typename Get_map<Mesh, Mesh>::type::INVALID_MARK)
|
Get_map<Mesh, Mesh>::type::INVALID_MARK)
|
||||||
{
|
{
|
||||||
// Default graphics view options.
|
// Default graphics view options.
|
||||||
Graphics_scene_options_face_graph_with_paths<Mesh,
|
Graphics_scene_options_face_graph_with_paths<Mesh,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue