关键词不能为空

当前您在: 主页 > 英语 >

CGAL引用文件路径

作者:高考题库网
来源:https://www.bjmy2z.cn/gaokao
2021-02-01 21:41
tags:

-

2021年2月1日发(作者:外耳炎)


C/C++->General->Additional include directories


D:Program filesCGAL-4.11auxiliarygmpinclude


D:Program filesboost_1_65_1


D:Program filesCGAL-4.11Buildinclude


D:Program filesCGAL-4.11include



C/C++->Preprocessor->Preprocesser definitions


WIN32


_DEBUG


_CONSOLE


_LIB


_CRT_SECURE_NO_WARNINGS



Linker -> General -> Additional library directories


D:Program filesboost_1_65_1lib32-msvc-12.0


D:Program filesCGAL-4.11auxiliarygmplib


D:Program filesCGAL-4.11Buildlib



Linker -> Input -> Additional Dependences






stdafx.h


文件中添加



#define



_SCL_SECURE_NO_WARNINGS



示例程序:



// straight_ : Defines the entry point for the console application.



//




#include





#include





#include





#include





#includ e




#include




#inc lude




#include





#include




#include






using



namespace



std


;



typedef



CGAL

< p>
::


Exact_predicates_inexact_constr uctions_kernel



K


;



typedef



K

< br>::


Point_2






















Point


;



typedef



CGAL

< p>
::


Polygon_2


<


K


>














Polygon_2


;



typedef



CGAL

< p>
::


Polygon_with_holes_2


<


K


>



Po lygon_with_holes


;



typedef



CGAL

< p>
::


Straight_skeleton_2


<


K


>




Ss


;



//typedef CGAL::Delaunay_triangulation_2 Delaunay;



typedef



CGAL


::


Delaunay_tr iangulation_2


<


K


>< /p>



Delaunay


;



typedef



boost


::


shared_ptr


<

< br>Ss


>



SsPtr


;




int



global_w


,



global_h


;



std


::


vector


<< /p>


Point


>



vertices


,



mypts


;




void



points_draw


()



{

















}




void



points_add_p oint


(


int



x


,



int



y


)



{




}



vertices


.


push_back


(


Po int


(


x


,



global_h



-



y


));



glPopMatrix


();



glutSwapBuffers


();



std


::


vector



<


Point


>::


iterator



iter


;



glColor3f


(


1.0


,



1.0


,



1.0


);



glPointSize


(


8


);



glBegin


(


GL_POINTS


);



for



(


iter



=



vertices


.


begin


();



iter



!=



vertices


.


end


();



iter


++)




glVertex2i


(

< p>
iter


->


hx


(),



iter


->


hy


());



glEnd


();



glPushMatrix


();


< /p>


glClear


(


GL_COLOR_B UFFER_BIT


);



glPushMatrix


();




void



init


(


void


)



{





}




void



points_clear


()



{









}




void



points_trian gulation


()



{


























glEnable


(


GL_LINE_STIPPLE


);


//

< p>
使用点画模式,即使用虚线来绘制


Voronoi








glLineStipple


(


1


,



0x3333


);


< br>glColor3f


(


0.0


,



1.0


,



0.0


);



Delaunay


::


Edge_iterator

< p>


eit


;


//


遍历


Delaunay


的所有边,绘制


Delaunay


图的对偶图,即


Vorono i








//


开始绘制





glPushMatrix


();


< /p>


Delaunay


::


Finite_f aces_iterator



fit


;


//


遍历


Delaunay


的所有面(有限面),将每个面的边画出来






glColor3f


(


0.0


,



0.0


,



1.0


);



for



(


fit



=



dt


.< /p>


finite_faces_begin


();

< br>


fit



!=



dt


.


finite_faces_end


();


fit


++)



{








glB egin


(


GL_LINE_LOOP


);



glVertex2i


(


fit


->


vertex

(


0


)->


point

< p>
().


hx


(),



fit


->


vertex

< br>(


0


)->


point


().


hy


());



glVertex2i


(


fit


->


vertex


(


1


)->


point


().

< p>
hx


(),



fit


->


vertex


(


1


)->


point


().


hy


());



glV ertex2i


(


fit


->


vertex


(


2


)- >


point


().


hx


(),



fit


->


vertex


(


2


) ->


point


().


hy

< p>
());



glEnd


();


< br>//Delaunay


数据结构,代表当前数据的一个且仅有一个的三角剖分,详 情请参考


Delaunay



dt


;



//


将所有点加入


dt




dt


.< /p>


insert


(


vertices


.


begin


(),



vertices


.


end

< p>
());


//


输入数据







CGAL_manual






vertices


.


clear


();



glClear


(


GL_COLOR_BUF FER_BIT


);



glPushMatrix


();



glPopMatrix


();



glutSwapBuffers


();



glClearColor


(


0.0< /p>


,



0.0


,



0.0


,



0.0


);



glShadeModel


(


GL_FLAT

< br>);



}


//

< br>完成


Delaunay


三角剖分的绘制,


Delaunay







-


-


-


-


-


-


-


-



本文更新与2021-02-01 21:41,由作者提供,不代表本网站立场,转载请注明出处:https://www.bjmy2z.cn/gaokao/595284.html

CGAL引用文件路径的相关文章

  • 余华爱情经典语录,余华爱情句子

    余华的经典语录——余华《第七天》40、我不怕死,一点都不怕,只怕再也不能看见你——余华《第七天》4可是我再也没遇到一个像福贵这样令我难忘的人了,对自己的经历如此清楚,

    语文
  • 心情低落的图片压抑,心情低落的图片发朋友圈

    心情压抑的图片(心太累没人理解的说说带图片)1、有时候很想找个人倾诉一下,却又不知从何说起,最终是什么也不说,只想快点睡过去,告诉自己,明天就好了。有时候,突然会觉得

    语文
  • 经典古训100句图片大全,古训名言警句

    古代经典励志名言100句译:好的药物味苦但对治病有利;忠言劝诫的话听起来不顺耳却对人的行为有利。3良言一句三冬暖,恶语伤人六月寒。喷泉的高度不会超过它的源头;一个人的事

    语文
  • 关于青春奋斗的名人名言鲁迅,关于青年奋斗的名言鲁迅

    鲁迅名言名句大全励志1、世上本没有路,走的人多了自然便成了路。下面是我整理的鲁迅先生的名言名句大全,希望对你有所帮助!当生存时,还是将遭践踏,将遭删刈,直至于死亡而

    语文
  • 三国群英单机版手游礼包码,三国群英手机单机版攻略

    三国群英传7五神兽洞有什么用那是多一个武将技能。青龙飞升召唤出东方的守护兽,神兽之一的青龙。玄武怒流召唤出北方的守护兽,神兽之一的玄武。白虎傲啸召唤出西方的守护兽,

    语文
  • 不收费的情感挽回专家电话,情感挽回免费咨询

    免费的情感挽回机构(揭秘情感挽回机构骗局)1、牛牛(化名)向上海市公安局金山分局报案,称自己为了挽回与女友的感情,被一家名为“实花教育咨询”的情感咨询机构诈骗4万余元。

    语文