replace use of get_local_point

This commit is contained in:
Guillaume Damiand 2022-10-19 16:34:08 +02:00
parent 4377f527bc
commit 534e7894b4
2 changed files with 13 additions and 5 deletions

View File

@ -61,6 +61,7 @@ class Graphic_buffer
public: public:
typedef CGAL::Exact_predicates_inexact_constructions_kernel Local_kernel; typedef CGAL::Exact_predicates_inexact_constructions_kernel Local_kernel;
typedef Local_kernel::Point_3 Local_point; typedef Local_kernel::Point_3 Local_point;
typedef Local_kernel::Vector_3 Local_vector;
Graphic_buffer() Graphic_buffer()
: m_buffer_for_mono_points(&arrays[POS_MONO_POINTS], nullptr, : m_buffer_for_mono_points(&arrays[POS_MONO_POINTS], nullptr,
@ -331,6 +332,13 @@ public:
Local_kernel>::get_local_point(p); Local_kernel>::get_local_point(p);
} }
template <typename KVector>
static Local_vector get_local_vector(const KVector &v)
{
return internal::Geom_utils<typename CGAL::Kernel_traits<KVector>::Kernel,
Local_kernel>::get_local_vector(v);
}
template <typename KPoint> template <typename KPoint>
void add_text(const KPoint &kp, const QString &txt) void add_text(const KPoint &kp, const QString &txt)
{ {

View File

@ -127,8 +127,8 @@ void add_segments_and_update_bounding_box(const V2& v2,
end_point = he->source()->point(); end_point = he->source()->point();
// update_bounding_box_for_ray(end_point, direction); // update_bounding_box_for_ray(end_point, direction);
Local_point lp = Basic_viewer_qt<>::get_local_point(end_point); Local_point lp = graphic_buffer.get_local_point(end_point);
Local_vector lv = Basic_viewer_qt<>::get_local_vector(direction); Local_vector lv = graphic_buffer.get_local_vector(direction);
CGAL::Bbox_3 b = (lp + lv).bbox(); CGAL::Bbox_3 b = (lp + lv).bbox();
graphic_buffer.update_bounding_box(b); graphic_buffer.update_bounding_box(b);
} }
@ -143,9 +143,9 @@ void add_segments_and_update_bounding_box(const V2& v2,
// update_bounding_box_for_line(pointOnLine, direction, // update_bounding_box_for_line(pointOnLine, direction,
// perpendicularDirection); // perpendicularDirection);
Local_point lp = Basic_viewer_qt<>::get_local_point(pointOnLine); Local_point lp = graphic_buffer.get_local_point(pointOnLine);
Local_vector lv = Basic_viewer_qt<>::get_local_vector(direction); Local_vector lv = graphic_buffer.get_local_vector(direction);
Local_vector lpv = Basic_viewer_qt<>::get_local_vector(perpendicularDirection); Local_vector lpv = graphic_buffer.get_local_vector(perpendicularDirection);
CGAL::Bbox_3 b = lp.bbox() + (lp + lv).bbox() + (lp + lpv).bbox(); CGAL::Bbox_3 b = lp.bbox() + (lp + lv).bbox() + (lp + lpv).bbox();
graphic_buffer.update_bounding_box(b); graphic_buffer.update_bounding_box(b);