mirror of https://github.com/CGAL/cgal
Uses overloading functions instead of different fill_buffer names.
This commit is contained in:
parent
7a7f39f2e8
commit
68b031e113
|
|
@ -38,7 +38,7 @@ void Viewer::setScene(Scene *scene_, bool doredraw)
|
||||||
scene = scene_;
|
scene = scene_;
|
||||||
|
|
||||||
if (scene->lcc!=nullptr)
|
if (scene->lcc!=nullptr)
|
||||||
{ CGAL::add_in_graphic_buffer_lcc(*scene->lcc, gBuffer, m_drawing_functor); }
|
{ CGAL::add_in_graphic_buffer(*scene->lcc, gBuffer, m_drawing_functor); }
|
||||||
|
|
||||||
if (doredraw)
|
if (doredraw)
|
||||||
{ Base::redraw(); }
|
{ Base::redraw(); }
|
||||||
|
|
@ -47,7 +47,7 @@ void Viewer::setScene(Scene *scene_, bool doredraw)
|
||||||
void Viewer::sceneChanged()
|
void Viewer::sceneChanged()
|
||||||
{
|
{
|
||||||
gBuffer.clear();
|
gBuffer.clear();
|
||||||
CGAL::add_in_graphic_buffer_lcc(*scene->lcc, gBuffer, m_drawing_functor);
|
CGAL::add_in_graphic_buffer(*scene->lcc, gBuffer, m_drawing_functor);
|
||||||
|
|
||||||
this->camera()->setSceneBoundingBox(
|
this->camera()->setSceneBoundingBox(
|
||||||
CGAL::qglviewer::Vec(gBuffer.get_bounding_box().xmin(),
|
CGAL::qglviewer::Vec(gBuffer.get_bounding_box().xmin(),
|
||||||
|
|
|
||||||
|
|
@ -239,14 +239,14 @@ void compute_elements(const LCC *lcc, Graphic_buffer<BufferType> &graphic_buffer
|
||||||
* @param alcc
|
* @param alcc
|
||||||
*/
|
*/
|
||||||
template <typename BufferType = float, class LCC, class DrawingFunctor>
|
template <typename BufferType = float, class LCC, class DrawingFunctor>
|
||||||
void add_in_graphic_buffer_lcc(const LCC &alcc, Graphic_buffer<BufferType> &graphic_buffer,
|
void add_in_graphic_buffer(const LCC &alcc, Graphic_buffer<BufferType> &graphic_buffer,
|
||||||
const DrawingFunctor &m_drawing_functor)
|
const DrawingFunctor &m_drawing_functor)
|
||||||
{
|
{
|
||||||
draw_function_for_lcc::compute_elements(&alcc, graphic_buffer, m_drawing_functor);
|
draw_function_for_lcc::compute_elements(&alcc, graphic_buffer, m_drawing_functor);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename BufferType = float, class LCC>
|
template <typename BufferType = float, class LCC>
|
||||||
void add_in_graphic_buffer_lcc(const LCC &alcc, Graphic_buffer<BufferType> &graphic_buffer)
|
void add_in_graphic_buffer(const LCC &alcc, Graphic_buffer<BufferType> &graphic_buffer)
|
||||||
{
|
{
|
||||||
Drawing_functor_with_volume<LCC,typename LCC::Dart_const_handle,
|
Drawing_functor_with_volume<LCC,typename LCC::Dart_const_handle,
|
||||||
typename LCC::Dart_const_handle,
|
typename LCC::Dart_const_handle,
|
||||||
|
|
@ -264,7 +264,7 @@ void add_in_graphic_buffer_lcc(const LCC &alcc, Graphic_buffer<BufferType> &grap
|
||||||
return get_random_color(random);
|
return get_random_color(random);
|
||||||
};
|
};
|
||||||
|
|
||||||
add_in_graphic_buffer_lcc(alcc, graphic_buffer, drawing_functor_with_volume);
|
add_in_graphic_buffer(alcc, graphic_buffer, drawing_functor_with_volume);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Specialization of draw function.
|
// Specialization of draw function.
|
||||||
|
|
@ -281,7 +281,7 @@ void draw(const CGAL_LCC_TYPE &alcc, const DrawingFunctor &drawing_functor,
|
||||||
const char *title = "LCC for CMap Basic Viewer")
|
const char *title = "LCC for CMap Basic Viewer")
|
||||||
{
|
{
|
||||||
Graphic_buffer<float> buffer;
|
Graphic_buffer<float> buffer;
|
||||||
add_in_graphic_buffer_lcc(alcc, buffer, drawing_functor);
|
add_in_graphic_buffer(alcc, buffer, drawing_functor);
|
||||||
draw_buffer(buffer);
|
draw_buffer(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -292,7 +292,7 @@ template<unsigned int d_, unsigned int ambient_dim, class Traits_,
|
||||||
void draw(const CGAL_LCC_TYPE &alcc, const char *title = "LCC for CMap Basic Viewer")
|
void draw(const CGAL_LCC_TYPE &alcc, const char *title = "LCC for CMap Basic Viewer")
|
||||||
{
|
{
|
||||||
Graphic_buffer<float> buffer;
|
Graphic_buffer<float> buffer;
|
||||||
add_in_graphic_buffer_lcc(alcc, buffer);
|
add_in_graphic_buffer(alcc, buffer);
|
||||||
draw_buffer(buffer);
|
draw_buffer(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ void compute_elements(const PointSet *pointset,
|
||||||
} // namespace draw_function_for_PointSet
|
} // namespace draw_function_for_PointSet
|
||||||
|
|
||||||
template <typename BufferType = float, class PointSet>
|
template <typename BufferType = float, class PointSet>
|
||||||
void add_in_graphic_buffer_point_set(Graphic_buffer<BufferType> &graphic_buffer,
|
void add_in_graphic_buffer(Graphic_buffer<BufferType> &graphic_buffer,
|
||||||
const PointSet *aPointSet = nullptr) {
|
const PointSet *aPointSet = nullptr) {
|
||||||
if (aPointSet != nullptr) {
|
if (aPointSet != nullptr) {
|
||||||
draw_function_for_PointSet::compute_elements(aPointSet, graphic_buffer);
|
draw_function_for_PointSet::compute_elements(aPointSet, graphic_buffer);
|
||||||
|
|
@ -78,7 +78,7 @@ template <class P, class V>
|
||||||
void draw(const Point_set_3<P, V> &apointset,
|
void draw(const Point_set_3<P, V> &apointset,
|
||||||
const char *title = "Point_set_3 Basic Viewer") {
|
const char *title = "Point_set_3 Basic Viewer") {
|
||||||
Graphic_buffer<float> buffer;
|
Graphic_buffer<float> buffer;
|
||||||
add_in_graphic_buffer_point_set(buffer, &apointset);
|
add_in_graphic_buffer(buffer, &apointset);
|
||||||
draw_buffer(buffer);
|
draw_buffer(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@ void compute_elements(CGAL::Graphic_buffer<BufferType> &graphic_buffer,
|
||||||
} // namespace draw_function_for_p2
|
} // namespace draw_function_for_p2
|
||||||
|
|
||||||
template <typename BufferType = float, class P2>
|
template <typename BufferType = float, class P2>
|
||||||
void add_in_graphic_buffer_p2(CGAL::Graphic_buffer<BufferType> &graphic_buffer,
|
void add_in_graphic_buffer(CGAL::Graphic_buffer<BufferType> &graphic_buffer,
|
||||||
const P2 *p2 = nullptr) {
|
const P2 *p2 = nullptr) {
|
||||||
if (p2 != nullptr) {
|
if (p2 != nullptr) {
|
||||||
draw_function_for_p2::compute_elements(graphic_buffer, p2);
|
draw_function_for_p2::compute_elements(graphic_buffer, p2);
|
||||||
|
|
@ -99,7 +99,7 @@ void draw(const CGAL_P2_TYPE &ap2,
|
||||||
// drawingFunctor;
|
// drawingFunctor;
|
||||||
|
|
||||||
CGAL::Graphic_buffer<float> buffer;
|
CGAL::Graphic_buffer<float> buffer;
|
||||||
add_in_graphic_buffer_p2(buffer, &ap2);
|
add_in_graphic_buffer(buffer, &ap2);
|
||||||
draw_buffer(buffer);
|
draw_buffer(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,7 @@ void compute_elements(const SS2 *ss2,
|
||||||
} // namespace draw_function_for_ss2
|
} // namespace draw_function_for_ss2
|
||||||
|
|
||||||
template <typename BufferType = float, class SS2, class DrawingFunctor>
|
template <typename BufferType = float, class SS2, class DrawingFunctor>
|
||||||
void add_in_graphic_buffer_ss2(const SS2 &ass2,
|
void add_in_graphic_buffer(const SS2 &ass2,
|
||||||
CGAL::Graphic_buffer<BufferType> &graphic_buffer,
|
CGAL::Graphic_buffer<BufferType> &graphic_buffer,
|
||||||
const DrawingFunctor &drawing_functor) {
|
const DrawingFunctor &drawing_functor) {
|
||||||
draw_function_for_ss2::compute_elements(&ass2, graphic_buffer,
|
draw_function_for_ss2::compute_elements(&ass2, graphic_buffer,
|
||||||
|
|
@ -120,14 +120,14 @@ void add_in_graphic_buffer_ss2(const SS2 &ass2,
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename BufferType = float, class SS2>
|
template <typename BufferType = float, class SS2>
|
||||||
void add_in_graphic_buffer_ss2(
|
void add_in_graphic_buffer(
|
||||||
const SS2 &ass2, CGAL::Graphic_buffer<BufferType> &graphic_buffer) {
|
const SS2 &ass2, CGAL::Graphic_buffer<BufferType> &graphic_buffer) {
|
||||||
Drawing_functor<SS2, typename SS2::Vertex_const_handle,
|
Drawing_functor<SS2, typename SS2::Vertex_const_handle,
|
||||||
typename SS2::Halfedge_const_handle,
|
typename SS2::Halfedge_const_handle,
|
||||||
typename SS2::Face_const_handle>
|
typename SS2::Face_const_handle>
|
||||||
drawingFunctor;
|
drawingFunctor;
|
||||||
|
|
||||||
add_in_graphic_buffer_ss2(ass2, graphic_buffer, drawingFunctor);
|
add_in_graphic_buffer(ass2, graphic_buffer, drawingFunctor);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Specialization of draw function.
|
// Specialization of draw function.
|
||||||
|
|
@ -137,7 +137,7 @@ template <class K, class DrawingFunctor>
|
||||||
void draw(const CGAL_SS_TYPE &ass2, const DrawingFunctor &drawingfunctor,
|
void draw(const CGAL_SS_TYPE &ass2, const DrawingFunctor &drawingfunctor,
|
||||||
const char *title = "Straight Skeleton Basic Viewer") {
|
const char *title = "Straight Skeleton Basic Viewer") {
|
||||||
CGAL::Graphic_buffer<float> buffer;
|
CGAL::Graphic_buffer<float> buffer;
|
||||||
add_in_graphic_buffer_ss2(ass2, buffer, drawingfunctor);
|
add_in_graphic_buffer(ass2, buffer, drawingfunctor);
|
||||||
draw_buffer(buffer);
|
draw_buffer(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -145,7 +145,7 @@ template <class K>
|
||||||
void draw(const CGAL_SS_TYPE &ass2,
|
void draw(const CGAL_SS_TYPE &ass2,
|
||||||
const char *title = "Straight Skeleton Basic Viewer") {
|
const char *title = "Straight Skeleton Basic Viewer") {
|
||||||
CGAL::Graphic_buffer<float> buffer;
|
CGAL::Graphic_buffer<float> buffer;
|
||||||
add_in_graphic_buffer_ss2(ass2, buffer);
|
add_in_graphic_buffer(ass2, buffer);
|
||||||
draw_buffer(buffer);
|
draw_buffer(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -121,7 +121,7 @@ void compute_elements(const T2 *t2,
|
||||||
} // namespace draw_function_for_t2
|
} // namespace draw_function_for_t2
|
||||||
|
|
||||||
template <typename BufferType = float, class T2, class DrawingFunctor>
|
template <typename BufferType = float, class T2, class DrawingFunctor>
|
||||||
void add_in_graphic_buffer_t2(const T2 &at2,
|
void add_in_graphic_buffer(const T2 &at2,
|
||||||
CGAL::Graphic_buffer<BufferType> &graphic_buffer,
|
CGAL::Graphic_buffer<BufferType> &graphic_buffer,
|
||||||
const DrawingFunctor &drawing_functor,
|
const DrawingFunctor &drawing_functor,
|
||||||
bool m_nofaces = false) {
|
bool m_nofaces = false) {
|
||||||
|
|
@ -130,7 +130,7 @@ void add_in_graphic_buffer_t2(const T2 &at2,
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename BufferType = float, class T2>
|
template <typename BufferType = float, class T2>
|
||||||
void add_in_graphic_buffer_t2(const T2 &at2,
|
void add_in_graphic_buffer(const T2 &at2,
|
||||||
CGAL::Graphic_buffer<BufferType> &graphic_buffer,
|
CGAL::Graphic_buffer<BufferType> &graphic_buffer,
|
||||||
bool m_nofaces = false) {
|
bool m_nofaces = false) {
|
||||||
|
|
||||||
|
|
@ -152,7 +152,7 @@ void add_in_graphic_buffer_t2(const T2 &at2,
|
||||||
return get_random_color(random);
|
return get_random_color(random);
|
||||||
};
|
};
|
||||||
|
|
||||||
add_in_graphic_buffer_t2(at2, graphic_buffer, drawingFunctor, m_nofaces);
|
add_in_graphic_buffer(at2, graphic_buffer, drawingFunctor, m_nofaces);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Specialization of draw function.
|
// Specialization of draw function.
|
||||||
|
|
@ -163,7 +163,7 @@ void draw(const CGAL_T2_TYPE &at2, const DrawingFunctor &drawingfunctor,
|
||||||
const char *title = "Triangulation_2 Basic Viewer",
|
const char *title = "Triangulation_2 Basic Viewer",
|
||||||
bool nofill = false) {
|
bool nofill = false) {
|
||||||
CGAL::Graphic_buffer<float> buffer;
|
CGAL::Graphic_buffer<float> buffer;
|
||||||
add_in_graphic_buffer_t2(at2, buffer, drawingfunctor, nofill);
|
add_in_graphic_buffer(at2, buffer, drawingfunctor, nofill);
|
||||||
draw_buffer(buffer);
|
draw_buffer(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -172,7 +172,7 @@ void draw(const CGAL_T2_TYPE &at2,
|
||||||
const char *title = "Triangulation_2 Basic Viewer",
|
const char *title = "Triangulation_2 Basic Viewer",
|
||||||
bool nofill = false) {
|
bool nofill = false) {
|
||||||
CGAL::Graphic_buffer<float> buffer;
|
CGAL::Graphic_buffer<float> buffer;
|
||||||
add_in_graphic_buffer_t2(at2, buffer, nofill);
|
add_in_graphic_buffer(at2, buffer, nofill);
|
||||||
draw_buffer(buffer);
|
draw_buffer(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,7 @@ void compute_elements(const T3 *t3, CGAL::Graphic_buffer<BufferType> &graphic_bu
|
||||||
} // namespace draw_function_for_t3
|
} // namespace draw_function_for_t3
|
||||||
|
|
||||||
template <typename BufferType = float, class T3, class DrawingFunctor>
|
template <typename BufferType = float, class T3, class DrawingFunctor>
|
||||||
void add_in_graphic_buffer_t3(const T3 &at3,
|
void add_in_graphic_buffer(const T3 &at3,
|
||||||
CGAL::Graphic_buffer<BufferType> &graphic_buffer,
|
CGAL::Graphic_buffer<BufferType> &graphic_buffer,
|
||||||
const DrawingFunctor &drawing_functor)
|
const DrawingFunctor &drawing_functor)
|
||||||
{
|
{
|
||||||
|
|
@ -126,7 +126,7 @@ void add_in_graphic_buffer_t3(const T3 &at3,
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename BufferType = float, class T3>
|
template <typename BufferType = float, class T3>
|
||||||
void add_in_graphic_buffer_t3(const T3 &at3,
|
void add_in_graphic_buffer(const T3 &at3,
|
||||||
CGAL::Graphic_buffer<BufferType> &graphic_buffer)
|
CGAL::Graphic_buffer<BufferType> &graphic_buffer)
|
||||||
{
|
{
|
||||||
CGAL::Drawing_functor<T3,
|
CGAL::Drawing_functor<T3,
|
||||||
|
|
@ -153,7 +153,7 @@ void add_in_graphic_buffer_t3(const T3 &at3,
|
||||||
return get_random_color(random);
|
return get_random_color(random);
|
||||||
};
|
};
|
||||||
|
|
||||||
add_in_graphic_buffer_t3(at3, graphic_buffer, drawing_functor);
|
add_in_graphic_buffer(at3, graphic_buffer, drawing_functor);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Specialization of draw function.
|
// Specialization of draw function.
|
||||||
|
|
@ -164,7 +164,7 @@ void draw(const CGAL_T3_TYPE &at3, const DrawingFunctor &drawingfunctor,
|
||||||
const char *title = "T3 Basic Viewer")
|
const char *title = "T3 Basic Viewer")
|
||||||
{
|
{
|
||||||
CGAL::Graphic_buffer<float> buffer;
|
CGAL::Graphic_buffer<float> buffer;
|
||||||
add_in_graphic_buffer_t3(at3, buffer, drawingfunctor);
|
add_in_graphic_buffer(at3, buffer, drawingfunctor);
|
||||||
draw_buffer(buffer);
|
draw_buffer(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -172,7 +172,7 @@ template <class Gt, class Tds, class Lock_data_structure>
|
||||||
void draw(const CGAL_T3_TYPE &at3, const char *title = "T3 Basic Viewer")
|
void draw(const CGAL_T3_TYPE &at3, const char *title = "T3 Basic Viewer")
|
||||||
{
|
{
|
||||||
CGAL::Graphic_buffer<float> buffer;
|
CGAL::Graphic_buffer<float> buffer;
|
||||||
add_in_graphic_buffer_t3(at3, buffer);
|
add_in_graphic_buffer(at3, buffer);
|
||||||
draw_buffer(buffer);
|
draw_buffer(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue