CGAL::2D Arrangements-4

4. Free函数

Arrangement_on_surface_2类模板是用曲线切分二维的面。因为它的接口设计是最简化的,这意味着它的成员函数很少执行几何操作。本章将解释怎么利用这些Free function来达到Arrangement操作。执行这些操作通常需要优秀的几何算法,而且有时会对几何traits类增加额外的要求。这些操作很多都是基于2个框架:面扫描(surface sweep)和区域构建(zone contructions)。这些操作接收一个x单调的曲线,因此几何特征类(geometry-traits class)可以被Arrangement当入参和出参,这些操作必须是ArrangementXMonotoneTraits_2概念的一个model。

4.1 区域构建算法
4.1.1 插入一对不相交的曲线
4.1.2 插入X单调的曲线
4.1.3 插入一般曲线
4.1.4 插入点集
4.1.5 插入相交的线段(code example)

文件在Arrangement_on_surface_2/incremental_insertion.cpp

代码段如下:

cpp 复制代码
// Using the global incremental insertion functions.
#include <CGAL/basic.h>
#include <CGAL/Arr_naive_point_location.h>
#include "arr_exact_construction_segments.h"
#include "arr_print.h"
typedef CGAL::Arr_naive_point_location<Arrangement>             Naive_pl;
typedef CGAL::Arr_point_location_result<Arrangement>::Type      Pl_result_type;
int main() {
  // Construct the arrangement of five intersecting segments.
  Arrangement arr;
  Naive_pl pl(arr);
  Segment s1(Point(1, 0), Point(2, 4));
  Segment s2(Point(5, 0), Point(5, 5));
  Segment s3(Point(1, 0), Point(5, 3));
  Segment s4(Point(0, 2), Point(6, 0));
  Segment s5(Point(3, 0), Point(5, 5));
  auto e = insert_non_intersecting_curve(arr, s1, pl);
  insert_non_intersecting_curve(arr, s2, pl);
  insert(arr, s3, Pl_result_type(e->source()));
  insert(arr, s4, pl);
  insert(arr, s5, pl);
  print_arrangement_size(arr);
  // Perform a point-location query on the resulting arrangement and print
  // the boundary of the face that contains it.
  Point q(4, 1);
  auto obj = pl.locate(q);
  auto* f = boost::get<Arrangement::Face_const_handle>(&obj);
  std::cout << "The query point (" << q << ") is located in: ";
  print_face<Arrangement>(*f);
  return 0;
}
4.2 另外的区域关联函数
4.3 面扫描算法
4.4 删除点和边
4.5 垂直分解
相关推荐
SUPER52661 小时前
FastApi项目启动失败 got an unexpected keyword argument ‘loop_factory‘
java·服务器·前端
sanx181 小时前
专业电竞体育数据与系统解决方案
前端·数据库·apache·数据库开发·时序数据库
咕噜咕噜啦啦2 小时前
Eclipse集成开发环境的使用
java·ide·eclipse
你的人类朋友4 小时前
【Node】认识一下Node.js 中的 VM 模块
前端·后端·node.js
Cosolar4 小时前
FunASR 前端语音识别代码解析
前端·面试·github
光军oi4 小时前
全栈开发杂谈————关于websocket若干问题的大讨论
java·websocket·apache
weixin_419658315 小时前
Spring 的统一功能
java·后端·spring
小许学java5 小时前
Spring AI-流式编程
java·后端·spring·sse·spring ai
haogexiaole6 小时前
Java高并发常见架构、处理方式、api调优
java·开发语言·架构
@大迁世界6 小时前
Vue 设计模式 实战指南
前端·javascript·vue.js·设计模式·ecmascript