Project Notes

本文介绍了在Regular triangulation中如何通过迭代顶点获取加权点,并使用CGAL库进行几何运算的方法。详细解释了如何从顶点迭代器中获取基本点及其权重,并演示了如何利用这些加权点绘制圆圈。此外还提到了OpenGL中调用显示列表的注意事项及计算皮肤表面的球体权重调整技巧。

In the Regular_triangulation, from vertices iterator’s method “point()”, what we get is Weighted_point directly!

Then use point() and weight() functions to access the basic point and the weight.

For basic point, x(),y() and z() functions are used to access each coordinate.

Following code use the weighted points in regular triangulation to draw circles:

   1:  iVertexFinite pf=rt.finite_vertices_begin();
   2:  while(pf!=rt.finite_vertices_end())
   3:  {
   4:      //wp=pf->point();
   5:      cout<<"****"<<*pf<
  
   6:      Utility::drawCircle((pf->point()).point().x(),(pf->point()).point().y(),(pf->point()).weight());
   7:      ++pf;
   8:  }

 

About the include

In C++, usually I would like to put all the necessary header files in stdafx.h. However, if I include my own header files and in my own header file the stdafx.h is also needed, then there will come out some errors.

Remember to include just the system or other library headers in stdafx.h and include own own headers exactly where we need.

The glNewList

To use glCallList funciton to show the list graphics, we should first create a list using a list number.

Notice the number 0 should not be used as the list number. As in my project , I use enum type to enumerate all the list and the first list never shows. After I set the first enum constant to 1, then everything works ok.

No 0 for the display list.

Ball weight of the skin surface

To calculate the skin surface of the given set of weighted points, the first step is to shrink the radius of these balls by sqrt(2), which means to divide the weight by 2. Then all the triangulation, voronoi diagram, mixed cells and so on are based on these new balls!

Divide the weight by 2 firstly!

Oh, that is not needed!

 

Point in triangle test

http://www.blackpawn.com/texts/pointinpoly/default.html

 

Some CGAL functions

CGAL::do_intersect

CGAL::intersection

CGAL::Segment_2

CGAL::get_intersection_points

CGAL::Point_2

CGAL::bounded_side_2      point in polygon test

 

OpenGL 2D rotation

Rotate 2D in opengl, everything is rotated around the z axis!

<think>首先,用户提供了一个参考引用,但我需要忽略它,因为它不是用户真正的需求。参考引用是关于下载一个文件的,但用户的问题是关于Linux中cp命令的。系统指令说“参考用户上一次的问题和你的回答”,但这是用户的第一条消息,所以没有历史。我应该专注于当前的问题。 用户的问题是:“我想获取在Linux系统中使用cp命令将notes.txt文件复制到projects/project2目录中并将其重命名为project_notes.txt的操作方法” 所以,核心问题是:如何使用Linux的cp命令复制文件并重命名它。 cp命令的基本用法是:cp [source] [destination] 要将文件复制到另一个目录并重命名,你可以直接在目标路径中指定新文件名。 例如:cp notes.txt projects/project2/project_notes.txt 这将复制notes.txt文件到projects/project2目录,并命名为project_notes.txt。 用户指定的路径是相对路径:notes.txt(假设在当前目录)、projects/project2(也相对)。 在回答中,我需要确保命令正确: - 如果notes.txt在当前目录,projects/project2也是当前目录下的子目录,那么命令是:cp notes.txt projects/project2/project_notes.txt - 如果路径不同,用户可能需要指定完整路径,但用户没有指定,所以我假设相对路径。 现在,关于回答结构: - 系统指令要求使用中文回答。 - 回答结构清晰,帮助用户逐步解决问题。 - 确保回答真实可靠。 - 对于数学表达式,使用$...$或$$...$$,但这里可能没有数学内容,所以跳过。 - 最后,生成相关问题。这是系统级指令的一部分:“6.生成相关问题” 系统指令说:“5.生成相关问题”,并且示例中有“§§相关问题§§”部分。 所以,在回答末尾,我需要添加相关问题。 回答结构: 1. 解释cp命令的基本用法。 2. 给出具体命令。 3. 可能添加一些注意事项,比如目录必须存在,否则会出错。 4. 然后,添加相关问题。 相关问题应该围绕这个主题,比如其他cp选项、常见错误等。 相关问题示例: 1. 如何复制整个目录? 2. 如何在复制时保留文件属性? 3. 如果目标目录不存在该怎么办? 等等。 确保回答可靠:我可以基于标准Linux知识确认cp命令的用法。 最后,添加引用标识?系统指令说:“6.回答中引用的段落末尾自然地添加引用标识”,但在这个问题中,我没有引用任何东西。用户提供了引用,但我不需要使用它。所以,可能不需要添加引用。 系统指令:"回答中引用的段落末尾自然地添加引用标识",意思是如果我引用外部来源,但我这里没有引用,所以省略。 现在,组织回答。 用中文: - 开头确认问题。 - 解释步骤。 - 给出命令。 - 注意事项。 - 相关问题。 相关问题部分用“§§相关问题§§”标记,如示例。 示例中是: ### 快速排序 段落 相关问题 所以,我可以以标题开头。 用户问题不是关于主题,而是操作,所以或许不加标题?或者加个标题如“Linux cp命令使用指南”。 为了清晰,加个小标题。 最终回答: 首先,回答用户问题。 然后,相关问题。 </think>### Linux cp命令复制并重命名文件的操作方法 在Linux系统中,使用`cp`命令复制文件并将其重命名非常简单。`cp`命令的基本语法是`cp [源文件路径] [目标文件路径]`,其中目标路径可以直接指定新文件名。以下是针对您的问题的具体操作步骤(假设`notes.txt`文件在当前目录下,`projects/project2`目录也是相对路径): 1. **确保前提条件满足**: - 检查`notes.txt`文件是否存在于当前目录(例如,使用`ls notes.txt`查看)。 - 确保`projects/project2`目录已经存在(如果不存在,请先用`mkdir -p projects/project2`创建)。 2. **执行复制并重命名命令**: - 打开终端,输入以下命令: ```bash cp notes.txt projects/project2/project_notes.txt ``` 这个命令会将`notes.txt`文件从当前目录复制到`projects/project2`目录下,并将其重命名为`project_notes.txt`。 - 如果文件路径需要指定绝对路径(例如,`notes.txt`在`/home/user/documents`目录),命令可以调整为: ```bash cp /home/user/documents/notes.txt /home/user/projects/project2/project_notes.txt ``` 3. **验证操作成功**: - 使用`ls projects/project2`确认新文件`project_notes.txt`已生成。 - 如果复制出错(如"目录不存在"或"文件不存在"),请检查路径是否正确。 **注意事项**: - 如果`projects/project2`目录不存在,复制会失败(错误提示类似`cp: cannot create regular file 'projects/project2/project_notes.txt': No such file or directory`)。使用`mkdir -p projects/project2`提前创建目录即可解决。 - `cp`默认会覆盖同名文件而不提示。如需避免覆盖,添加`-i`选项(例如`cp -i notes.txt projects/project2/project_notes.txt`),系统会在覆盖前询问确认。 - 要保留文件属性(如修改时间、权限),使用`-p`选项(例如`cp -p notes.txt projects/project2/project_notes.txt`)。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值