mirror of https://github.com/CGAL/cgal
- MainWindow.ui: add shortcuts
- Terrain.cpp: let users pass a filepath as first argument. - Viewer: - draw constraints edges in red, - use lighting when needed.
This commit is contained in:
parent
397c0fd00f
commit
e3b02d40c5
|
|
@ -81,6 +81,13 @@ GraphicsView/demo/Triangulation_2/Constrained_Delaunay_triangulation_2
|
|||
GraphicsView/demo/Triangulation_2/Delaunay_triangulation_2
|
||||
GraphicsView/demo/Triangulation_2/Makefile
|
||||
GraphicsView/demo/Triangulation_2/Regular_triangulation_2
|
||||
GraphicsView/demo/Triangulation_2/Terrain/*.exe
|
||||
GraphicsView/demo/Triangulation_2/Terrain/*.sln
|
||||
GraphicsView/demo/Triangulation_2/Terrain/*.vcproj
|
||||
GraphicsView/demo/Triangulation_2/Terrain/Makefile
|
||||
GraphicsView/demo/Triangulation_2/Terrain/Terrain
|
||||
GraphicsView/demo/Triangulation_2/Terrain/qrc_*.cxx
|
||||
GraphicsView/demo/Triangulation_2/Terrain/ui_*.h
|
||||
GraphicsView/demo/Triangulation_2/qrc_*.cxx
|
||||
GraphicsView/demo/Triangulation_2/ui_*.h
|
||||
GraphicsView/doc_tex/GraphicsView.tex
|
||||
|
|
|
|||
|
|
@ -29,12 +29,12 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>635</width>
|
||||
<height>19</height>
|
||||
<height>28</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuFile" >
|
||||
<property name="title" >
|
||||
<string>File</string>
|
||||
<string>&File</string>
|
||||
</property>
|
||||
<addaction name="actionLoad_New_File" />
|
||||
<addaction name="separator" />
|
||||
|
|
@ -47,11 +47,17 @@
|
|||
<property name="text" >
|
||||
<string>Quit</string>
|
||||
</property>
|
||||
<property name="shortcut" >
|
||||
<string>Ctrl+Q</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionLoad_New_File" >
|
||||
<property name="text" >
|
||||
<string>Load New File</string>
|
||||
</property>
|
||||
<property name="shortcut" >
|
||||
<string>Ctrl+O</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
|
|
|
|||
|
|
@ -20,6 +20,10 @@ int main(int argc, char** argv)
|
|||
Q_INIT_RESOURCE(Terrain);
|
||||
Q_INIT_RESOURCE(CGAL);
|
||||
MainWindow mw;
|
||||
|
||||
if(!application.arguments().value(1).isEmpty())
|
||||
mw.open(application.arguments().value(1));
|
||||
|
||||
mw.show();
|
||||
|
||||
return application.exec();
|
||||
|
|
|
|||
|
|
@ -60,12 +60,17 @@ Viewer::draw()
|
|||
|
||||
if(m_view_surface)
|
||||
{
|
||||
::glEnable(GL_LIGHTING);
|
||||
::glPolygonMode(GL_FRONT_AND_BACK,GL_FILL);
|
||||
::glColor3f(0.2f, 0.2f, 1.f);
|
||||
::glEnable(GL_POLYGON_OFFSET_FILL);
|
||||
::glPolygonOffset(3.0f,-3.0f);
|
||||
::glPolygonOffset(3.0f,3.0f);
|
||||
|
||||
::glDisable(GL_LIGHTING);
|
||||
gl_draw_vertices();
|
||||
|
||||
::glEnable(GL_LIGHTING);
|
||||
gl_draw_surface();
|
||||
|
||||
gl_draw_constraints();
|
||||
|
||||
if(draw_triangles_edges)
|
||||
|
|
@ -84,7 +89,7 @@ Viewer::draw()
|
|||
|
||||
|
||||
void
|
||||
Viewer::gl_draw_surface()
|
||||
Viewer::gl_draw_vertices()
|
||||
{
|
||||
::glColor3f(1.0f, 0.0f, 0.0f);
|
||||
::glDisable(GL_LIGHTING);
|
||||
|
|
@ -98,8 +103,11 @@ Viewer::gl_draw_surface()
|
|||
}
|
||||
::glEnd();
|
||||
::glDisable(GL_POINT_SMOOTH);
|
||||
}
|
||||
|
||||
::glEnable(GL_LIGHTING);
|
||||
void
|
||||
Viewer::gl_draw_surface()
|
||||
{
|
||||
::glBegin(GL_TRIANGLES);
|
||||
|
||||
::glColor3f(0.2f, 1.0f, 0.2f);
|
||||
|
|
@ -131,14 +139,12 @@ Viewer::gl_draw_constraints()
|
|||
{
|
||||
|
||||
glDisable(GL_LIGHTING);
|
||||
glDisable(GL_LIGHT0);
|
||||
//glDisable(GL_LIGHT1);
|
||||
glEnable(GL_LINE_SMOOTH);
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glHint(GL_LINE_SMOOTH_HINT,GL_DONT_CARE);
|
||||
glLineWidth(1.5);
|
||||
glColor3f(0.f, 0.8f , 0.f);
|
||||
glColor3f(8.f, 0.0f , 0.f);
|
||||
Finite_edges_iterator eit = scene->terrain.finite_edges_begin(),
|
||||
eend = scene->terrain.finite_edges_end();
|
||||
glBegin(GL_LINES);
|
||||
|
|
|
|||
|
|
@ -27,6 +27,8 @@ public:
|
|||
public:
|
||||
void draw();
|
||||
|
||||
void gl_draw_vertices();
|
||||
|
||||
void gl_draw_surface();
|
||||
|
||||
void gl_draw_constraints();
|
||||
|
|
|
|||
Loading…
Reference in New Issue