Skip to content

Commit

Permalink
Replace old color API using global const variable with new one using …
Browse files Browse the repository at this point in the history
…functions
  • Loading branch information
sgiraudot authored and afabri committed Apr 3, 2019
1 parent 428195e commit 2c1ca1e
Show file tree
Hide file tree
Showing 28 changed files with 73 additions and 73 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ void xAlci_main_window::setup(int w, int h)
tab_widget->addTab(cad_tab,"cad");
tab_widget->addTab(arr_tab,"arrangement");

*widget << CGAL::LineWidth(2) << CGAL::BackgroundColor(CGAL::WHITE);
*widget << CGAL::LineWidth(2) << CGAL::BackgroundColor(CGAL::white());
resize(w,h);
double ratio = 1.0;//(double)h/w;
widget->set_window(-1, 1, -ratio, ratio, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,11 +277,11 @@ inline std::ostream & operator<<(std::ostream & os, const Arr::Vertex & vertex)
inline Window_stream & operator<<(Window_stream & ws, Arr & arr)
{
Arr::Edge_iterator ei;
ws << CGAL::BLUE;
ws << CGAL::blue();
for (ei = arr.edges_begin(); ei != arr.edges_end(); ++ei)
ws << (*ei).curve();
Arr::Vertex_iterator vi;
ws << CGAL::RED;
ws << CGAL::red();
for (vi = arr.vertices_begin(); vi != arr.vertices_end(); ++vi)
ws << (*vi).point();
return ws;
Expand Down Expand Up @@ -474,7 +474,7 @@ class Display_arr : public Basic_arr {
m_window->flush();
#else
m_window->lock();
*m_window << CGAL::BackgroundColor(CGAL::WHITE) << CGAL::RED;
*m_window << CGAL::BackgroundColor(CGAL::white()) << CGAL::red();
(*m_window) << arr;
m_window->unlock();
App->flush();
Expand All @@ -490,9 +490,9 @@ class Display_arr : public Basic_arr {
ps_stream.set_line_width(1);
CGAL::Arr_drawer<Arr, CGAL::Postscript_file_stream> drawer(ps_stream);
// drawer.draw_faces(arr.faces_begin(), arr.faces_end());
ps_stream << CGAL::BLUE;
ps_stream << CGAL::blue();
drawer.draw_halfedges(arr.halfedges_begin(), arr.halfedges_end());
ps_stream << CGAL::RED;
ps_stream << CGAL::red();
drawer.draw_vertices(arr.vertices_begin(), arr.vertices_end());

// draw_arr(arr, drawer, ps_stream);
Expand Down
4 changes: 2 additions & 2 deletions Convex_hull_3/demo/Convex_hull_3/quickhull_3_demo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void draw_points_and_hull(const std::vector<Point_3>& points,
std::vector<Point_3>::const_iterator p_it;

CGAL::Geomview_stream geomview;
geomview << CGAL::RED;
geomview << CGAL::red();
for (p_it = points.begin(); p_it != points.end(); p_it++)
{
geomview << *p_it;
Expand All @@ -78,7 +78,7 @@ void draw_points_and_hull(const std::vector<Point_3>& points,
Point_3 point;
Polyhedron_3 polyhedron;

geomview << CGAL::BLUE;
geomview << CGAL::blue();
if ( CGAL::assign(point, object) )
geomview << point;
else if ( CGAL::assign(segment, object) )
Expand Down
4 changes: 2 additions & 2 deletions Geomview/demo/Geomview/gv_terrain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ int main()

// use different colors, and put a few sleeps/clear.

gv << CGAL::BLUE;
gv << CGAL::blue();
std::cout << "Drawing 2D Delaunay triangulation in wired mode.\n";
gv.set_wired(true);
gv << D;

#if 1 // It's too slow ! Needs to use OFF for that.
gv << CGAL::RED;
gv << CGAL::red();
std::cout << "Drawing its Voronoi diagram.\n";
gv.set_wired(true);
D.draw_dual(gv);
Expand Down
16 changes: 8 additions & 8 deletions Geomview/demo/Geomview/kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,33 +50,33 @@ int main()
gv.clear(); // remove the pickplane.

gv << K::Point_2 (200, 100);
gv << CGAL::BLUE;
gv << CGAL::blue();
gv << K::Point_3 (200, 100, 100);
gv << CGAL::RED;
gv << CGAL::red();
gv << K::Segment_2 (K::Point_2(200, 100),
K::Point_2(300, 100));
gv << CGAL::GREEN;
gv << CGAL::green();
gv << K::Segment_3 (K::Point_3(200, 100, 100),
K::Point_3(300, 100, 200));
gv << CGAL::DEEPBLUE;
gv << CGAL::deep_blue();
gv << K::Sphere_3 (K::Point_3(100, 100, 100), 1000);
gv << CGAL::VIOLET;
gv << CGAL::violet();
gv << K::Triangle_2 (K::Point_2(200, 200),
K::Point_2(220, 220),
K::Point_2(180, 220));
gv << CGAL::ORANGE;
gv << CGAL::orange();
gv << K::Triangle_3 (K::Point_3(200, 200, 50),
K::Point_3(220, 220, 80),
K::Point_3(180, 220, 100));
gv << CGAL::PURPLE;
gv << CGAL::purple();
gv << K::Tetrahedron_3 (K::Point_3(100, 100, 180),
K::Point_3(120, 70, 220),
K::Point_3(100, 100, 220),
K::Point_3(120, 150, 250));
gv << CGAL::Bbox_2(10, 10, 30, 30);
gv << CGAL::Bbox_3(10, 10, 10, 30, 30, 30);

gv << CGAL::RED;
gv << CGAL::red();
gv << K::Ray_2(K::Point_2(205,205), K::Point_2(500,500));
gv << K::Ray_3(K::Point_3(250,250,250), K::Point_3(500,500,500));
gv << K::Line_2(K::Point_2(195,195), K::Point_2(500,500));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,9 @@ SegmentDelaunayGraphGraphicsItem<T>::drawAll(QPainter *painter, const QStyleOpti
vit != t->finite_vertices_end(); ++vit) {
typename T::Site_2 s = vit->site();
if ( s.is_input() ) {
//*widget << CGAL::RED;
//*widget << CGAL::red();
} else {
//*widget << CGAL::YELLOW;
//*widget << CGAL::yellow();
}
if ( s.is_point() ) {
QPointF point = matrix.map(convert(s.point()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,9 @@ SegmentDelaunayGraphLinfGraphicsItem<T>::drawAll(QPainter *painter, const QStyle
vit != t->finite_vertices_end(); ++vit) {
typename T::Site_2 s = vit->site();
if ( s.is_input() ) {
//*widget << CGAL::RED;
//*widget << CGAL::red();
} else {
//*widget << CGAL::YELLOW;
//*widget << CGAL::yellow();
}
if ( s.is_point() ) {
QPointF point = matrix.map(convert(s.point()));
Expand Down
6 changes: 3 additions & 3 deletions HalfedgeDS/examples/HalfedgeDS/hds_prog_color.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ typedef HDS::Face_handle Face_handle;

int main() {
HDS hds;
Face_handle f = hds.faces_push_back( Face( CGAL::RED));
f->color = CGAL::BLUE;
CGAL_assertion( f->color == CGAL::BLUE);
Face_handle f = hds.faces_push_back( Face( CGAL::red()));
f->color = CGAL::blue();
CGAL_assertion( f->color == CGAL::blue());
return 0;
}
4 changes: 2 additions & 2 deletions Interpolation/demo/Interpolation/interpolation_2_demo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,14 +287,14 @@ int main(int , char** )

std::cout << "The data points are displayed in blue in the geomview"
<< " application." << std::endl;
gv << CGAL::BLUE;
gv << CGAL::blue();
visu_points(gv,sample_3);

//show the gradients
if(method>0){
std::cout << "The function gradients are displayed by red lines "
<<" in the geomview application." << std::endl;
gv <<CGAL::RED;
gv <<CGAL::red();
gv << Segment_3(Point_3(h/3,h/3,w),Point_3(h/3,h/3,w)+ Vector_3(-g,-g,0));
gv << Segment_3(Point_3(-h/3,h/3,w),Point_3(-h/3,h/3,w)+Vector_3(g,-g,0));
gv << Segment_3(Point_3(-h/3,-h/3,w),Point_3(-h/3,-h/3,w)+Vector_3(g,g,0));
Expand Down
10 changes: 5 additions & 5 deletions Interpolation/demo/Interpolation/surface_voronoi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,21 +217,21 @@ int main()
}

char ch;
gv << CGAL::VIOLET;
gv << CGAL::violet();
visu_points(gv,points);

gv << CGAL::RED << Segment(p, p+ 0.3*normal);
gv << CGAL::ORANGE <<p;
gv << CGAL::red() << Segment(p, p+ 0.3*normal);
gv << CGAL::orange() <<p;

std::cout << "Visualizing the intersection of "
<< "3D Voronoi diagram with tangent plane at "
<< p << "." << std::endl;
gv << CGAL::BLUE;
gv << CGAL::blue();
T.draw_dual(gv);
Face_iterator fit = T.finite_faces_begin(),
fend = T.finite_faces_end();
for(;fit != fend;fit++)
gv <<CGAL::BLACK<<T.dual(fit);
gv <<CGAL::black()<<T.dual(fit);

std::cout << "Enter any character to quit" << std::endl;
std::cin >> ch;
Expand Down
6 changes: 3 additions & 3 deletions Mesh_3/archive/applications/display_distribution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ void output_distribution_to_png(std::vector<double>& elements,

const double scale = double_options["scale"];

*widget << CGAL::FillColor(CGAL::BLACK);
*widget << CGAL::FillColor(CGAL::black());
// *widget << Segment_2(Point_2(0., 0.), Point_2(1., 0.));
for(int k=0;k<number_of_classes;k++)
if(distribution[k]>0)
Expand All @@ -184,12 +184,12 @@ void output_distribution_to_png(std::vector<double>& elements,
height = ( (distribution[k]+0.)/number_of_cells ) * scale;
else
height = ( std::log(distribution[k]+0.)/std::log(number_of_cells) ) * (-scale);
*widget << CGAL::BLACK
*widget << CGAL::black()
<< Rectangle_2(Point_2(k*width, 0),
Point_2((k+1)*width, height));
}
else
*widget << CGAL::RED << Segment_2(Point_2(k*width, 0),
*widget << CGAL::red() << Segment_2(Point_2(k*width, 0),
Point_2((k+1)*width, 0));

widget->unlock();
Expand Down
4 changes: 2 additions & 2 deletions Mesh_3/archive/applications/distribution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ void display_distribution(Distribution_displayer* display,
const double height = ( distribution[k]+0. ) * echelle;
display->fill_rectangle(k * width, 0,
(k+1)* width, height,
CGAL::BLACK);
CGAL::black());
}
else
display->segment(k * width, 0.,
(k+1) * width, 0.,
CGAL::RED);
CGAL::red());
}
2 changes: 1 addition & 1 deletion Mesh_3/archive/applications/lanteri_process_results.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ bool process_aux_2(const std::vector<Qualities>& qualities,

displays[i]->segment(x_position_of_length_bound, 0.0,
x_position_of_length_bound, -0.05,
CGAL::BLUE);
CGAL::blue());
}

*out_stream << "saving " << filename.c_str() << "...\n";
Expand Down
6 changes: 3 additions & 3 deletions Mesh_3/archive/applications/output_distribution_to_stdout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ void parse_argv(int argc, char** argv, int extra_args = 0)
//
// const double scale = double_options["scale"];
//
//// *widget << CGAL::FillColor(CGAL::BLACK);
//// *widget << CGAL::FillColor(CGAL::black());
// // *widget << Segment_2(Point_2(0., 0.), Point_2(1., 0.));
// for(int k=0;k<number_of_classes;k++)
// if(distribution[k]>0)
Expand All @@ -190,12 +190,12 @@ void parse_argv(int argc, char** argv, int extra_args = 0)
// height = ( (distribution[k]+0.)/number_of_cells ) * scale;
// else
// height = ( std::log(distribution[k]+0.)/std::log(number_of_cells) ) * (-scale);
//// *widget << CGAL::BLACK
//// *widget << CGAL::black()
//// << Rectangle_2(Point_2(k*width, 0),
//// Point_2((k+1)*width, height));
// }
// else
//// *widget << CGAL::RED << Segment_2(Point_2(k*width, 0),
//// *widget << CGAL::red() << Segment_2(Point_2(k*width, 0),
//// Point_2((k+1)*width, 0));
//
// // widget->unlock();
Expand Down
6 changes: 3 additions & 3 deletions Nef_3/include/CGAL/Nef_3/SM_visualizor.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ class SNC_SM_BooleColor
typedef typename Refs_::Mark Mark;
public:
Color color(SVertex_const_handle, Mark m) const
{ return ( m ? CGAL::BLACK : CGAL::WHITE ); }
{ return ( m ? CGAL::black() : CGAL::white() ); }
Color color(SHalfedge_const_handle, Mark m) const
{ return ( m ? CGAL::BLACK : CGAL::WHITE ); }
{ return ( m ? CGAL::black() : CGAL::white() ); }
Color color(SHalfloop_const_handle, Mark m) const
{ return ( m ? CGAL::BLACK : CGAL::WHITE ); }
{ return ( m ? CGAL::black() : CGAL::white() ); }
Color color(SFace_const_handle, Mark m) const
{ return ( m ? CGAL_NEF3_DGREY : CGAL_NEF3_LGREY ); }
};
Expand Down
6 changes: 3 additions & 3 deletions Nef_3/include/CGAL/Nef_3/SNC_SM_visualizor.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ class SNC_SM_BooleColor
typedef typename Map_::Mark Mark;
public:
Color color(SVertex_const_handle, Mark m) const
{ return ( m ? CGAL::BLACK : CGAL::WHITE ); }
{ return ( m ? CGAL::black() : CGAL::white() ); }
Color color(SHalfedge_const_handle, Mark m) const
{ return ( m ? CGAL::BLACK : CGAL::WHITE ); }
{ return ( m ? CGAL::black() : CGAL::white() ); }
Color color(SHalfloop_const_handle, Mark m) const
{ return ( m ? CGAL::BLACK : CGAL::WHITE ); }
{ return ( m ? CGAL::black() : CGAL::white() ); }
Color color(SFace_const_handle, Mark m) const
{ return ( m ? CGAL_NEF_DGREY : CGAL_NEF_LGREY ); }
};
Expand Down
6 changes: 3 additions & 3 deletions Nef_S2/include/CGAL/Nef_S2/SM_visualizor.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ class SM_BooleColor
typedef typename Map_::Mark Mark;
public:
Color color(SVertex_const_handle, Mark m) const
{ return ( m ? CGAL::BLACK : CGAL::WHITE ); }
{ return ( m ? CGAL::black() : CGAL::white() ); }
Color color(SHalfedge_const_handle, Mark m) const
{ return ( m ? CGAL::BLACK : CGAL::WHITE ); }
{ return ( m ? CGAL::black() : CGAL::white() ); }
Color color(SHalfloop_const_handle, Mark m) const
{ return ( m ? CGAL::BLACK : CGAL::WHITE ); }
{ return ( m ? CGAL::black() : CGAL::white() ); }
Color color(SFace_const_handle, Mark m) const
{ return ( m ? CGAL_NEF_DGREY : CGAL_NEF_LGREY ); }
};
Expand Down
22 changes: 11 additions & 11 deletions Nef_S2/include/CGAL/Nef_S2/Sphere_geometry_OGL.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ class Sphere_point : public VPoint, public Gen_object {
public:
Sphere_point() {}
Sphere_point(const CGAL::Sphere_point<R>& p,
CGAL::Color c = CGAL::BLACK, unsigned w = 10) :
CGAL::Color c = CGAL::black(), unsigned w = 10) :
VPoint(Approximator<R>::approximate(p)), p_(p), c_(c), w_(w) {}
Sphere_point(const Sphere_point<R>& p) : VPoint(p), Gen_object()
{ p_ = p.p_; c_ = p.c_; w_ = p.w_; }
Expand Down Expand Up @@ -297,7 +297,7 @@ class Sphere_segment : public VSegment, public Gen_object {
public:
Sphere_segment() {}
Sphere_segment(const CGAL::Sphere_segment<R>& s,
CGAL::Color c = CGAL::BLACK, unsigned w = 2)
CGAL::Color c = CGAL::black(), unsigned w = 2)
: VSegment(Approximator<R>::approximate(s)), s_(s), c_(c), w_(w) {}
Sphere_segment(const Sphere_segment<R>& s) : VSegment(s), Gen_object()
{ s_ = s.s_; c_ = s.c_; w_ = s.w_; }
Expand Down Expand Up @@ -350,7 +350,7 @@ class Sphere_circle : public VSegment, public Gen_object {
public:
Sphere_circle() {}
Sphere_circle(const CGAL::Sphere_circle<R>& s,
CGAL::Color c = CGAL::BLACK, unsigned w = 2)
CGAL::Color c = CGAL::black(), unsigned w = 2)
: VSegment(Approximator<R>::approximate(s)), s_(s), c_(c), w_(w) {}
Sphere_circle(const Sphere_circle<R>& s) : VSegment(s), Gen_object()
{ s_ = s.s_; c_ = s.c_; w_ = s.w_; }
Expand Down Expand Up @@ -539,27 +539,27 @@ Unit_sphere& operator=(const Unit_sphere& S)

template <typename R>
void push_back(const CGAL::Sphere_point<R>& p,
CGAL::Color c = CGAL::YELLOW, unsigned w = 5)
CGAL::Color c = CGAL::yellow(), unsigned w = 5)
{ objects_.push_back(new Sphere_point<R>(p,c,w)); }

template <typename R>
void push_back(const CGAL::Sphere_segment<R>& s,
CGAL::Color c = CGAL::BLACK, unsigned w = 1)
CGAL::Color c = CGAL::black(), unsigned w = 1)
{ objects_.push_back(new Sphere_segment<R>(s,c,w)); }

template <typename R>
void push_back(const CGAL::Sphere_circle<R>& s,
CGAL::Color c = CGAL::BLACK, unsigned w = 1)
CGAL::Color c = CGAL::black(), unsigned w = 1)
{ objects_.push_back(new Sphere_circle<R>(s,c,w)); }

template <typename R>
void push_back(const CGAL::Sphere_triangle<R>& t,
CGAL::Color c = CGAL::WHITE)
CGAL::Color c = CGAL::white())
{ triangles_.push_back(new Sphere_triangle<R>(t,c)); }

template <typename R>
void push_back_triangle_edge(const CGAL::Sphere_segment<R>& s,
CGAL::Color c = CGAL::BLUE, unsigned w = 1)
CGAL::Color c = CGAL::blue(), unsigned w = 1)
{ triangle_edges_.push_back(new Sphere_segment<R>(s,c,w)); }

void set_style(int style) {
Expand Down Expand Up @@ -718,11 +718,11 @@ class SM_BooleColor
typedef typename Map_::Mark Mark;
public:
Color color(SVertex_const_handle, Mark m) const
{ return ( m ? CGAL::BLACK : CGAL::WHITE ); }
{ return ( m ? CGAL::black() : CGAL::white() ); }
Color color(SHalfedge_const_handle, Mark m) const
{ return ( m ? CGAL::BLACK : CGAL::WHITE ); }
{ return ( m ? CGAL::black() : CGAL::white() ); }
Color color(SHalfloop_const_handle, Mark m) const
{ return ( m ? CGAL::BLACK : CGAL::WHITE ); }
{ return ( m ? CGAL::black() : CGAL::white() ); }
Color color(SFace_const_handle, Mark m) const
{ return ( m ? CGAL_NEF_DGREY : CGAL_NEF_LGREY ); }
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ int main()
PDT::Vertex_iterator vit;
for (vit = T.vertices_begin(); vit != T.vertices_end(); ++vit)
if (T.degree(vit) == 6)
vit->info() = CGAL::RED;
vit->info() = CGAL::red();

return 0;
}
Loading

0 comments on commit 2c1ca1e

Please sign in to comment.