Project Notes

来源:互联网 发布:常见的网络攻防技术 编辑:程序博客网 时间:2024/06/01 07:54

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:  }
.csharpcode, .csharpcode pre{font-size: small;color: black;font-family: consolas, "Courier New", courier, monospace;background-color: #ffffff;/*white-space: pre;*/}.csharpcode pre { margin: 0em; }.csharpcode .rem { color: #008000; }.csharpcode .kwrd { color: #0000ff; }.csharpcode .str { color: #006080; }.csharpcode .op { color: #0000c0; }.csharpcode .preproc { color: #cc6633; }.csharpcode .asp { background-color: #ffff00; }.csharpcode .html { color: #800000; }.csharpcode .attr { color: #ff0000; }.csharpcode .alt {background-color: #f4f4f4;width: 100%;margin: 0em;}.csharpcode .lnum { color: #606060; }

 

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!

原创粉丝点击