Modified GraphicBuffer class name to snake case.

This commit is contained in:
Mostafa-ashraf19 2022-10-03 13:27:22 +02:00
parent 913f676b22
commit 796ec13391
9 changed files with 48 additions and 48 deletions

View File

@ -40,13 +40,13 @@ namespace CGAL {
// This class is responsible for dealing with available CGAL data structures and
// handling buffers.
template <typename BufferType = float>
class GraphicBuffer {
class Graphic_buffer {
public:
typedef CGAL::Exact_predicates_inexact_constructions_kernel Local_kernel;
typedef Local_kernel::Point_3 Local_point;
GraphicBuffer(std::vector<BufferType> (&pos)[20], CGAL::Bbox_3 &bbox)
Graphic_buffer(std::vector<BufferType> (&pos)[20], CGAL::Bbox_3 &bbox)
: m_buffer_for_mono_points(&pos[POS_MONO_POINTS], nullptr, &bbox, nullptr,
nullptr, nullptr),
m_buffer_for_colored_points(&pos[POS_COLORED_POINTS], nullptr, &bbox,
@ -72,7 +72,7 @@ public:
&pos[FLAT_NORMAL_COLORED_FACES],
&pos[SMOOTH_NORMAL_COLORED_FACES]) {}
GraphicBuffer()
Graphic_buffer()
: 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,

View File

@ -83,7 +83,7 @@ public:
// Constructor/Destructor
Basic_viewer_qt(QWidget* parent,
GraphicBuffer<BufferType>& buf,
Graphic_buffer<BufferType>& buf,
const char* title="",
bool draw_vertices=false,
bool draw_edges=true,
@ -1612,7 +1612,7 @@ protected:
protected:
GraphicBuffer<BufferType>& gBuffer;
Graphic_buffer<BufferType>& gBuffer;
bool m_draw_vertices;
bool m_draw_edges;
@ -1724,7 +1724,7 @@ protected:
* @param graphic_buffer
*/
template <typename BufferType = float>
void draw_buffer(GraphicBuffer<BufferType> &graphic_buffer) {
void draw_buffer(Graphic_buffer<BufferType> &graphic_buffer) {
#if defined(CGAL_TEST_SUITE)
bool cgal_test_suite = true;

View File

@ -42,7 +42,7 @@ private:
Dart_const_handle,
Dart_const_handle,
Dart_const_handle> m_drawing_functor;
CGAL::GraphicBuffer<float> m_graphic_buffer;
CGAL::Graphic_buffer<float> m_graphic_buffer;
Scene* scene;
bool m_previous_scene_empty;
};

View File

@ -70,7 +70,7 @@ template <typename BufferType=float, class LCC, class DrawingFunctorLCC>
void compute_face(typename LCC::Dart_const_handle dh,
typename LCC::Dart_const_handle voldh, const LCC *lcc,
const DrawingFunctorLCC &m_drawing_functor,
GraphicBuffer<BufferType> &graphic_buffer)
Graphic_buffer<BufferType> &graphic_buffer)
{
if (!m_drawing_functor.are_faces_enabled() ||
!m_drawing_functor.draw_face(*lcc, dh))
@ -115,7 +115,7 @@ void compute_face(typename LCC::Dart_const_handle dh,
template <typename BufferType=float, class LCC, class DrawingFunctor>
void compute_edge(typename LCC::Dart_const_handle dh, const LCC *lcc,
const DrawingFunctor &m_drawing_functor,
GraphicBuffer<BufferType> &graphic_buffer)
Graphic_buffer<BufferType> &graphic_buffer)
{
if (!m_drawing_functor.are_edges_enabled() ||
!m_drawing_functor.draw_edge(*lcc, dh))
@ -138,7 +138,7 @@ void compute_edge(typename LCC::Dart_const_handle dh, const LCC *lcc,
template <typename BufferType = float, class LCC, class DrawingFunctorLCC>
void compute_vertex(typename LCC::Dart_const_handle dh, const LCC *lcc,
const DrawingFunctorLCC &m_drawing_functor,
GraphicBuffer<BufferType> &graphic_buffer)
Graphic_buffer<BufferType> &graphic_buffer)
{
if (!m_drawing_functor.are_vertices_enabled() ||
!m_drawing_functor.draw_vertex(*lcc, dh))
@ -154,7 +154,7 @@ void compute_vertex(typename LCC::Dart_const_handle dh, const LCC *lcc,
}
template <typename BufferType = float, class LCC, class DrawingFunctor>
void compute_elements(const LCC *lcc, GraphicBuffer<BufferType> &graphic_buffer,
void compute_elements(const LCC *lcc, Graphic_buffer<BufferType> &graphic_buffer,
const DrawingFunctor &m_drawing_functor)
{
if (lcc==nullptr)
@ -245,14 +245,14 @@ void compute_elements(const LCC *lcc, GraphicBuffer<BufferType> &graphic_buffer,
* @param alcc
*/
template <typename BufferType = float, class LCC, class DrawingFunctor>
void add_in_graphic_buffer_lcc(const LCC &alcc, GraphicBuffer<BufferType> &graphic_buffer,
void add_in_graphic_buffer_lcc(const LCC &alcc, Graphic_buffer<BufferType> &graphic_buffer,
const DrawingFunctor &m_drawing_functor)
{
draw_function_for_lcc::compute_elements(&alcc, graphic_buffer, m_drawing_functor);
}
template <typename BufferType = float, class LCC>
void add_in_graphic_buffer_lcc(const LCC &alcc, GraphicBuffer<BufferType> &graphic_buffer)
void add_in_graphic_buffer_lcc(const LCC &alcc, Graphic_buffer<BufferType> &graphic_buffer)
{
Drawing_functor_with_volume<LCC,typename LCC::Dart_const_handle,
typename LCC::Dart_const_handle,
@ -275,7 +275,7 @@ template<unsigned int d_, unsigned int ambient_dim, class Traits_,
void draw(const CGAL_LCC_TYPE &alcc, const DrawingFunctor &drawing_functor,
const char *title = "LCC for CMap Basic Viewer")
{
GraphicBuffer<float> buffer;
Graphic_buffer<float> buffer;
add_in_graphic_buffer_lcc(alcc, buffer, drawing_functor);
draw_buffer(buffer);
}
@ -286,7 +286,7 @@ template<unsigned int d_, unsigned int ambient_dim, class Traits_,
class Refs, class Storage_>
void draw(const CGAL_LCC_TYPE &alcc, const char *title = "LCC for CMap Basic Viewer")
{
GraphicBuffer<float> buffer;
Graphic_buffer<float> buffer;
add_in_graphic_buffer_lcc(alcc, buffer);
draw_buffer(buffer);
}

View File

@ -47,7 +47,7 @@ namespace draw_function_for_PointSet {
template <typename BufferType = float, class PointSet>
void compute_vertex(const typename PointSet::Point_map::value_type &p,
GraphicBuffer<BufferType> &graphic_buffer) {
Graphic_buffer<BufferType> &graphic_buffer) {
graphic_buffer.add_point(p);
// We can use add_point(p, c) with c a CGAL::IO::Color to add a colored point
@ -56,7 +56,7 @@ void compute_vertex(const typename PointSet::Point_map::value_type &p,
template <typename BufferType = float, class PointSet>
void compute_elements(const PointSet *pointset,
GraphicBuffer<BufferType> &graphic_buffer) {
Graphic_buffer<BufferType> &graphic_buffer) {
for (typename PointSet::const_iterator it = pointset->begin();
it != pointset->end(); ++it) {
compute_vertex<float, PointSet>(pointset->point(*it), graphic_buffer);
@ -66,7 +66,7 @@ void compute_elements(const PointSet *pointset,
} // namespace draw_function_for_PointSet
template <typename BufferType = float, class PointSet>
void add_in_graphic_buffer_point_set(GraphicBuffer<BufferType> &graphic_buffer,
void add_in_graphic_buffer_point_set(Graphic_buffer<BufferType> &graphic_buffer,
const PointSet *aPointSet = nullptr) {
if (aPointSet != nullptr) {
draw_function_for_PointSet::compute_elements(aPointSet, graphic_buffer);
@ -77,7 +77,7 @@ void add_in_graphic_buffer_point_set(GraphicBuffer<BufferType> &graphic_buffer,
template <class P, class V>
void draw(const Point_set_3<P, V> &apointset,
const char *title = "Point_set_3 Basic Viewer") {
GraphicBuffer<float> buffer;
Graphic_buffer<float> buffer;
add_in_graphic_buffer_point_set(buffer, &apointset);
draw_buffer(buffer);
}

View File

@ -52,7 +52,7 @@ namespace CGAL {
namespace draw_function_for_p2 {
template <typename BufferType = float, class P2>
void compute_elements(CGAL::GraphicBuffer<BufferType> &graphic_buffer,
void compute_elements(CGAL::Graphic_buffer<BufferType> &graphic_buffer,
const P2 *p2) {
typedef typename P2::Point_2 Point;
@ -79,7 +79,7 @@ void compute_elements(CGAL::GraphicBuffer<BufferType> &graphic_buffer,
} // namespace draw_function_for_p2
template <typename BufferType = float, class P2>
void add_in_graphic_buffer_p2(CGAL::GraphicBuffer<BufferType> &graphic_buffer,
void add_in_graphic_buffer_p2(CGAL::Graphic_buffer<BufferType> &graphic_buffer,
const P2 *p2 = nullptr) {
if (p2 != nullptr) {
draw_function_for_p2::compute_elements(graphic_buffer, p2);
@ -98,7 +98,7 @@ void draw(const CGAL_P2_TYPE &ap2,
// typename CGAL_P2_TYPE::Face_const_handle>
// drawingFunctor;
CGAL::GraphicBuffer<float> buffer;
CGAL::Graphic_buffer<float> buffer;
add_in_graphic_buffer_p2(buffer, &ap2);
draw_buffer(buffer);
}

View File

@ -32,7 +32,7 @@ namespace draw_function_for_ss2 {
template <typename BufferType = float, class SS2, class DrawingFunctor>
void compute_edge(typename SS2::Halfedge_const_handle eh,
const DrawingFunctor &drawing_functor, const SS2 *ss2,
CGAL::GraphicBuffer<BufferType> &graphic_buffer) {
CGAL::Graphic_buffer<BufferType> &graphic_buffer) {
if (!drawing_functor.draw_edge(*ss2, eh)) {
return;
@ -50,7 +50,7 @@ void compute_edge(typename SS2::Halfedge_const_handle eh,
template <typename BufferType = float, class SS2>
void print_halfedge_labels(typename SS2::Halfedge_const_handle h,
CGAL::GraphicBuffer<BufferType> &graphic_buffer) {
CGAL::Graphic_buffer<BufferType> &graphic_buffer) {
std::stringstream label;
label << "H" << h->id() << " (V" << h->vertex()->id() << ") ";
@ -65,7 +65,7 @@ void print_halfedge_labels(typename SS2::Halfedge_const_handle h,
template <typename BufferType = float, class SS2, class DrawingFunctor>
void compute_vertex(typename SS2::Vertex_const_handle vh,
const DrawingFunctor &drawing_functor, const SS2 *ss2,
CGAL::GraphicBuffer<BufferType> &graphic_buffer) {
CGAL::Graphic_buffer<BufferType> &graphic_buffer) {
if (!drawing_functor.draw_vertex(*ss2, vh)) {
return;
@ -84,7 +84,7 @@ void compute_vertex(typename SS2::Vertex_const_handle vh,
template <typename BufferType = float, class SS2>
void print_vertex_label(typename SS2::Vertex_const_handle vh,
CGAL::GraphicBuffer<BufferType> &graphic_buffer) {
CGAL::Graphic_buffer<BufferType> &graphic_buffer) {
std::stringstream label;
label << "V" << vh->id() << std::ends;
graphic_buffer.add_text(vh->point(), label.str());
@ -92,7 +92,7 @@ void print_vertex_label(typename SS2::Vertex_const_handle vh,
template <typename BufferType = float, class SS2, class DrawingFunctor>
void compute_elements(const SS2 *ss2,
CGAL::GraphicBuffer<BufferType> &graphic_buffer,
CGAL::Graphic_buffer<BufferType> &graphic_buffer,
const DrawingFunctor &drawing_functor) {
for (typename SS2::Halfedge_const_iterator it = ss2->halfedges_begin();
@ -113,7 +113,7 @@ void compute_elements(const SS2 *ss2,
template <typename BufferType = float, class SS2, class DrawingFunctor>
void add_in_graphic_buffer_ss2(const SS2 &ass2,
CGAL::GraphicBuffer<BufferType> &graphic_buffer,
CGAL::Graphic_buffer<BufferType> &graphic_buffer,
const DrawingFunctor &drawing_functor) {
draw_function_for_ss2::compute_elements(&ass2, graphic_buffer,
drawing_functor);
@ -121,7 +121,7 @@ void add_in_graphic_buffer_ss2(const SS2 &ass2,
template <typename BufferType = float, class SS2>
void add_in_graphic_buffer_ss2(
const SS2 &ass2, CGAL::GraphicBuffer<BufferType> &graphic_buffer) {
const SS2 &ass2, CGAL::Graphic_buffer<BufferType> &graphic_buffer) {
Drawing_functor<SS2, typename SS2::Vertex_const_handle,
typename SS2::Halfedge_const_handle,
typename SS2::Face_const_handle>
@ -136,7 +136,7 @@ void add_in_graphic_buffer_ss2(
template <class K, class DrawingFunctor>
void draw(const CGAL_SS_TYPE &ass2, const DrawingFunctor &drawingfunctor,
const char *title = "Straight Skeleton Basic Viewer") {
CGAL::GraphicBuffer<float> buffer;
CGAL::Graphic_buffer<float> buffer;
add_in_graphic_buffer_ss2(ass2, buffer, drawingfunctor);
draw_buffer(buffer);
}
@ -144,7 +144,7 @@ void draw(const CGAL_SS_TYPE &ass2, const DrawingFunctor &drawingfunctor,
template <class K>
void draw(const CGAL_SS_TYPE &ass2,
const char *title = "Straight Skeleton Basic Viewer") {
CGAL::GraphicBuffer<float> buffer;
CGAL::Graphic_buffer<float> buffer;
add_in_graphic_buffer_ss2(ass2, buffer);
draw_buffer(buffer);
}

View File

@ -31,7 +31,7 @@ namespace draw_function_for_t2 {
template <typename BufferType = float, class T2, class DrawingFunctor>
void compute_face(typename T2::Finite_faces_iterator fh,
const DrawingFunctor &drawing_functor,
CGAL::GraphicBuffer<BufferType> &graphic_buffer,
CGAL::Graphic_buffer<BufferType> &graphic_buffer,
const T2 *t2) {
if (!drawing_functor.draw_face(*t2, fh)) {
@ -56,7 +56,7 @@ void compute_face(typename T2::Finite_faces_iterator fh,
template <typename BufferType = float, class T2, class DrawingFunctor>
void compute_edge(typename T2::Finite_edges_iterator eh,
const DrawingFunctor &drawing_functor, const T2 *t2,
CGAL::GraphicBuffer<BufferType> &graphic_buffer) {
CGAL::Graphic_buffer<BufferType> &graphic_buffer) {
if (!drawing_functor.draw_edge(*t2, eh)) {
return;
@ -79,7 +79,7 @@ void compute_edge(typename T2::Finite_edges_iterator eh,
template <typename BufferType = float, class T2, class DrawingFunctor>
void compute_vertex(typename T2::Vertex_handle vh,
CGAL::GraphicBuffer<BufferType> &graphic_buffer,
CGAL::Graphic_buffer<BufferType> &graphic_buffer,
const DrawingFunctor &drawing_functor, const T2 *t2) {
if (!drawing_functor.draw_vertex(*t2, vh)) {
@ -96,7 +96,7 @@ void compute_vertex(typename T2::Vertex_handle vh,
template <typename BufferType = float, class T2, class DrawingFunctor>
void compute_elements(const T2 *t2,
CGAL::GraphicBuffer<BufferType> &graphic_buffer,
CGAL::Graphic_buffer<BufferType> &graphic_buffer,
const DrawingFunctor &drawing_functor,
bool m_nofaces = false) {
@ -122,7 +122,7 @@ void compute_elements(const T2 *t2,
template <typename BufferType = float, class T2, class DrawingFunctor>
void add_in_graphic_buffer_t2(const T2 &at2,
CGAL::GraphicBuffer<BufferType> &graphic_buffer,
CGAL::Graphic_buffer<BufferType> &graphic_buffer,
const DrawingFunctor &drawing_functor,
bool m_nofaces = false) {
draw_function_for_t2::compute_elements(&at2, graphic_buffer, drawing_functor,
@ -131,10 +131,10 @@ void add_in_graphic_buffer_t2(const T2 &at2,
template <typename BufferType = float, class T2>
void add_in_graphic_buffer_t2(const T2 &at2,
CGAL::GraphicBuffer<BufferType> &graphic_buffer,
CGAL::Graphic_buffer<BufferType> &graphic_buffer,
bool m_nofaces = false) {
CGAL::GraphicBuffer<float> buffer;
CGAL::Graphic_buffer<float> buffer;
Drawing_functor<T2, typename T2::Vertex_handle,
typename T2::Finite_edges_iterator,
typename T2::Finite_faces_iterator>
@ -162,7 +162,7 @@ template <class Gt, class Tds, class DrawingFunctor>
void draw(const CGAL_T2_TYPE &at2, const DrawingFunctor &drawingfunctor,
const char *title = "Triangulation_2 Basic Viewer",
bool nofill = false) {
CGAL::GraphicBuffer<float> buffer;
CGAL::Graphic_buffer<float> buffer;
add_in_graphic_buffer_t2(at2, buffer, drawingfunctor, nofill);
draw_buffer(buffer);
}
@ -171,7 +171,7 @@ template <class Gt, class Tds>
void draw(const CGAL_T2_TYPE &at2,
const char *title = "Triangulation_2 Basic Viewer",
bool nofill = false) {
CGAL::GraphicBuffer<float> buffer;
CGAL::Graphic_buffer<float> buffer;
add_in_graphic_buffer_t2(at2, buffer, nofill);
draw_buffer(buffer);
}

View File

@ -32,7 +32,7 @@ namespace draw_function_for_t3
template <typename BufferType = float, class T3, class DrawingFunctor>
void compute_face(typename T3::Finite_facets_iterator fh,
const DrawingFunctor &drawing_functor,
CGAL::GraphicBuffer<BufferType> &graphic_buffer, const T3 *t3)
CGAL::Graphic_buffer<BufferType> &graphic_buffer, const T3 *t3)
{
if(!drawing_functor.draw_face(*t3, fh))
{ return; }
@ -57,7 +57,7 @@ void compute_face(typename T3::Finite_facets_iterator fh,
template <typename BufferType = float, class T3, class DrawingFunctor>
void compute_edge(typename T3::Finite_edges_iterator eh,
CGAL::GraphicBuffer<BufferType> &graphic_buffer,
CGAL::Graphic_buffer<BufferType> &graphic_buffer,
const DrawingFunctor &drawing_functor, const T3 *t3)
{
if(!drawing_functor.draw_edge(*t3, eh))
@ -77,7 +77,7 @@ void compute_edge(typename T3::Finite_edges_iterator eh,
template <typename BufferType = float, class T3, class DrawingFunctor>
void compute_vertex(typename T3::Vertex_handle vh,
CGAL::GraphicBuffer<BufferType> &graphic_buffer,
CGAL::Graphic_buffer<BufferType> &graphic_buffer,
const DrawingFunctor &drawing_functor, const T3 *t3)
{
if(!drawing_functor.draw_vertex(*t3, vh))
@ -93,7 +93,7 @@ void compute_vertex(typename T3::Vertex_handle vh,
}
template <typename BufferType = float, class T3, class DrawingFunctor>
void compute_elements(const T3 *t3, CGAL::GraphicBuffer<BufferType> &graphic_buffer,
void compute_elements(const T3 *t3, CGAL::Graphic_buffer<BufferType> &graphic_buffer,
const DrawingFunctor &drawing_functor)
{
for (typename T3::Finite_facets_iterator it = t3->finite_facets_begin();
@ -119,7 +119,7 @@ void compute_elements(const T3 *t3, CGAL::GraphicBuffer<BufferType> &graphic_buf
template <typename BufferType = float, class T3, class DrawingFunctor>
void add_in_graphic_buffer_t3(const T3 &at3,
CGAL::GraphicBuffer<BufferType> &graphic_buffer,
CGAL::Graphic_buffer<BufferType> &graphic_buffer,
const DrawingFunctor &drawing_functor)
{
draw_function_for_t3::compute_elements(&at3, graphic_buffer, drawing_functor);
@ -127,7 +127,7 @@ void add_in_graphic_buffer_t3(const T3 &at3,
template <typename BufferType = float, class T3>
void add_in_graphic_buffer_t3(const T3 &at3,
CGAL::GraphicBuffer<BufferType> &graphic_buffer)
CGAL::Graphic_buffer<BufferType> &graphic_buffer)
{
CGAL::Drawing_functor<T3,
typename T3::Vertex_handle,
@ -163,7 +163,7 @@ template<class Gt, class Tds, class Lock_data_structure, class DrawingFunctor>
void draw(const CGAL_T3_TYPE &at3, const DrawingFunctor &drawingfunctor,
const char *title = "T3 Basic Viewer")
{
CGAL::GraphicBuffer<float> buffer;
CGAL::Graphic_buffer<float> buffer;
add_in_graphic_buffer_t3(at3, buffer, drawingfunctor);
draw_buffer(buffer);
}
@ -171,7 +171,7 @@ void draw(const CGAL_T3_TYPE &at3, const DrawingFunctor &drawingfunctor,
template <class Gt, class Tds, class Lock_data_structure>
void draw(const CGAL_T3_TYPE &at3, const char *title = "T3 Basic Viewer")
{
CGAL::GraphicBuffer<float> buffer;
CGAL::Graphic_buffer<float> buffer;
add_in_graphic_buffer_t3(at3, buffer);
draw_buffer(buffer);
}