关键词不能为空

当前您在: 主页 > 英语 >

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引用文件路径的相关文章

  • 爱心与尊严的高中作文题库

    1.关于爱心和尊严的作文八百字 我们不必怀疑富翁的捐助,毕竟普施爱心,善莫大焉,它是一 种美;我们也不必指责苛求受捐者的冷漠的拒绝,因为人总是有尊 严的,这也是一种美。

    小学作文
  • 爱心与尊严高中作文题库

    1.关于爱心和尊严的作文八百字 我们不必怀疑富翁的捐助,毕竟普施爱心,善莫大焉,它是一 种美;我们也不必指责苛求受捐者的冷漠的拒绝,因为人总是有尊 严的,这也是一种美。

    小学作文
  • 爱心与尊重的作文题库

    1.作文关爱与尊重议论文 如果说没有爱就没有教育的话,那么离开了尊重同样也谈不上教育。 因为每一位孩子都渴望得到他人的尊重,尤其是教师的尊重。可是在现实生活中,不时会有

    小学作文
  • 爱心责任100字作文题库

    1.有关爱心,坚持,责任的作文题库各三个 一则150字左右 (要事例) “胜不骄,败不馁”这句话我常听外婆说起。 这句名言的意思是说胜利了抄不骄傲,失败了不气馁。我真正体会到它

    小学作文
  • 爱心责任心的作文题库

    1.有关爱心,坚持,责任的作文题库各三个 一则150字左右 (要事例) “胜不骄,败不馁”这句话我常听外婆说起。 这句名言的意思是说胜利了抄不骄傲,失败了不气馁。我真正体会到它

    小学作文
  • 爱心责任作文题库

    1.有关爱心,坚持,责任的作文题库各三个 一则150字左右 (要事例) “胜不骄,败不馁”这句话我常听外婆说起。 这句名言的意思是说胜利了抄不骄傲,失败了不气馁。我真正体会到它

    小学作文