[GRASS-SVN] r32032 - grass/trunk/lib/nviz
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Jul 6 16:25:12 EDT 2008
Author: martinl
Date: 2008-07-06 16:25:12 -0400 (Sun, 06 Jul 2008)
New Revision: 32032
Modified:
grass/trunk/lib/nviz/Makefile
grass/trunk/lib/nviz/draw.c
Log:
Makefile of nvizlib updated (based on ogsf Makefile)
Modified: grass/trunk/lib/nviz/Makefile
===================================================================
--- grass/trunk/lib/nviz/Makefile 2008-07-06 18:51:27 UTC (rev 32031)
+++ grass/trunk/lib/nviz/Makefile 2008-07-06 20:25:12 UTC (rev 32032)
@@ -2,18 +2,16 @@
LIB_NAME = $(NVIZ_LIBNAME)
-DEPENDENCIES = $(BITMAPDEP) $(DBMIDEP) $(GISDEP) $(OGSFDEP) $(G3DDEP) $(VECTRDEP)
+EXTRA_LIBS = $(GISLIB) $(BITMAPLIB) $(VECTLIB) $(XLIBPATH) $(OPENGLLIB) $(OPENGLULIB) $(TIFFLIBPATH) $(TIFFLIB) $(FFMPEGLIBPATH) $(FFMPEGLIB) $(SITESLIB) $(G3DLIB)
-EXTRA_INC = $(VECT_INC)
-EXTRA_CFLAGS = $(INC) \
- $(TIFFINCPATH) $(DSPINC) \
- $(VECT_CFLAGS) $(OPENGLINC)
-EXTRA_LIBS = $(GISLIB) $(XLIBPATH) $(XMLIB) $(XTLIB) $(XLIB) $(XEXTRALIBS) $(OGSFLIB)
-
include $(MODULE_TOPDIR)/include/Make/Lib.make
include $(MODULE_TOPDIR)/include/Make/Doxygen.make
-# doxygen
-DOXNAME=nviz
+EXTRA_INC = $(VECT_INC) $(OPENGLINC) $(TIFFINCPATH) $(FFMPEGINCPATH)
+EXTRA_CFLAGS = $(VECT_CFLAGS) $(XCFLAGS)
+
default: lib
+
+# doxygen
+DOXNAME=nviz
Modified: grass/trunk/lib/nviz/draw.c
===================================================================
--- grass/trunk/lib/nviz/draw.c 2008-07-06 18:51:27 UTC (rev 32031)
+++ grass/trunk/lib/nviz/draw.c 2008-07-06 20:25:12 UTC (rev 32032)
@@ -20,7 +20,6 @@
#include <grass/nviz.h>
static int sort_surfs_max(int *, int *, int *, int);
-static int check_blank(int);
/*!
\brief Draw all loaded surfaces
@@ -56,9 +55,7 @@
GS_setlight_position(num, 0., 0., 1., 0);
for (i = 0; i < nsurfs; i++) {
- if (!check_blank(sortSurfs[i])) {
- GS_draw_surf(sortSurfs[i]);
- }
+ GS_draw_surf(sortSurfs[i]);
}
/* GS_draw_cplane_fence params will change - surfs aren't used anymore */
@@ -115,30 +112,39 @@
return 1;
}
-/*
- \brief Check if a specific map object should be blanked for
- a draw.
+/*!
+ \brief Draw all loaded vector sets
- This option is used by one of the script tools for
- blanking maps during specific frames.
-
- \param map_id map object id
-
- \return 0 not blank
- \return 1 blank
+ \param dc nviz data
+
+ \return 1
*/
-int check_blank(int map_id)
+int Nviz_draw_all_vect(nv_data *dc)
{
- return 0;
+ // GS_set_cancel(0);
+
+ /* in case transparency is set */
+ GS_set_draw(GSD_BOTH);
+
+ GS_ready_draw();
+
+ GV_alldraw_vect();
+
+ GS_done_draw();
+
+ GS_set_draw(GSD_BACK);
+
+ // GS_set_cancel(0);
+
+ return 1;
}
/*!
- \brief Draw all
+ \brief Draw all map objects (in full resolution) and decorations
\param data nviz data
- \param clear clear screen before drawing
*/
-int Nviz_draw_all(nv_data *data, int clear)
+int Nviz_draw_all(nv_data *data)
{
int draw_surf, draw_vect, draw_site, draw_vol;
int draw_north_arrow, arrow_x, draw_label, draw_legend;
@@ -166,10 +172,11 @@
// Tcl_SetVar(interp, "is_drawing", "1", TCL_GLOBAL_ONLY);
GS_set_draw(GSD_BACK); /* needs to be BACK to avoid flickering */
- if (clear)
- GS_clear(data->bgcolor);
+
GS_ready_draw();
+ GS_clear(data->bgcolor);
+
/*
buf_surf = Tcl_GetVar(interp, "surface", TCL_GLOBAL_ONLY);
buf_vect = Tcl_GetVar(interp, "vector", TCL_GLOBAL_ONLY);
@@ -302,23 +309,27 @@
}
/*!
- \brief Draw in coarse mode
+ \brief Draw all surfaces in wireframe
\param dc nviz data
- \param clear clear screen before drawing
+
\return 1
*/
-int Nviz_draw_quick(nv_data *dc, int clear)
+int Nviz_draw_quick(nv_data *data)
{
GS_set_draw(GSD_BACK);
- if (clear)
- GS_clear(dc->bgcolor);
-
GS_ready_draw();
+ GS_clear(data->bgcolor);
+
+ /* draw surfaces */
GS_alldraw_wire();
+ /* draw vector */
+ /* GV_alldraw_fastvect(); is broken */
+ /* GV_alldraw_vect(); */
+
/*
vol_list = GVL_get_vol_list(&max);
max = GVL_num_vols();
@@ -336,39 +347,3 @@
return 1;
}
-/*!
- \brief Draw all loaded vector sets
-
- \param dc nviz data
-
- \return 1
-*/
-int Nviz_draw_all_vect(nv_data *dc)
-{
- int i, nvects;
- int *vect_list;
-
- // GS_set_cancel(0);
- vect_list = GV_get_vect_list(&nvects);
-
- /* in case transparency is set */
- GS_set_draw(GSD_BOTH);
-
- GS_ready_draw();
-
- for (i = 0; i < nvects; i++) {
- if (!check_blank(vect_list[i])) {
- GV_draw_vect(vect_list[i]);
- }
- }
- G_free (vect_list);
-
- GS_done_draw();
-
- GS_set_draw(GSD_BACK);
-
- // GS_set_cancel(0);
-
- return 1;
-}
-
More information about the grass-commit
mailing list