[GRASS-SVN] r31631 - grass/branches/develbranch_6/lib/ogsf
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Jun 4 18:49:32 EDT 2008
Author: martinl
Date: 2008-06-04 18:49:32 -0400 (Wed, 04 Jun 2008)
New Revision: 31631
Modified:
grass/branches/develbranch_6/lib/ogsf/GS2.c
grass/branches/develbranch_6/lib/ogsf/gs.c
grass/branches/develbranch_6/lib/ogsf/gsd_cplane.c
grass/branches/develbranch_6/lib/ogsf/gsd_prim.c
grass/branches/develbranch_6/lib/ogsf/gsd_surf.c
Log:
ogsf: minor doxygen docs update, intendation fix
Modified: grass/branches/develbranch_6/lib/ogsf/GS2.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/GS2.c 2008-06-04 20:20:50 UTC (rev 31630)
+++ grass/branches/develbranch_6/lib/ogsf/GS2.c 2008-06-04 22:49:32 UTC (rev 31631)
@@ -241,7 +241,7 @@
}
/*!
- \brief Add new light model
+ \brief Add new model light
\return light model id
\return -1 on error (MAX_LIGHTS exceded)
@@ -285,7 +285,7 @@
\param num light id (starts with 1)
\param xpos,ypos,zpos coordinates (model)
- \param local ?
+ \param local local coordinate (for viewport)
*/
void GS_setlight_position(int num, float xpos, float ypos, float zpos,
int local)
@@ -2520,7 +2520,8 @@
void GS_set_focus(float *realto)
{
- G_debug(3, "GS_set_focus");
+ G_debug(3, "GS_set_focus(): %f,%f,%f",
+ realto[0], realto[1], realto[2]);
Gv.infocus = 1;
GS_v3eq(Gv.real_to, realto);
@@ -2905,8 +2906,6 @@
return;
}
-
-
/*!
\brief Set viewport
@@ -3154,7 +3153,7 @@
}
/*!
- \brief Unset cplace
+ \brief Unset clip place (turn off)
\param num cplane id
*/
Modified: grass/branches/develbranch_6/lib/ogsf/gs.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/gs.c 2008-06-04 20:20:50 UTC (rev 31630)
+++ grass/branches/develbranch_6/lib/ogsf/gs.c 2008-06-04 22:49:32 UTC (rev 31631)
@@ -862,7 +862,8 @@
*/
int gs_set_att_const(geosurf * gs, int desc, float constant)
{
- G_debug(4, "gs_set_att_const");
+ G_debug(4, "gs_set_att_const(): id=%d, desc=%d, const=%f",
+ gs->gsurf_id, desc, constant);
if (gs) {
gs->att[desc].constant = constant;
Modified: grass/branches/develbranch_6/lib/ogsf/gsd_cplane.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/gsd_cplane.c 2008-06-04 20:20:50 UTC (rev 31630)
+++ grass/branches/develbranch_6/lib/ogsf/gsd_cplane.c 2008-06-04 22:49:32 UTC (rev 31631)
@@ -119,9 +119,9 @@
}
/*!
- \brief ADD
+ \brief Turn off clip plane
- \param num
+ \param num cplane id
*/
void gsd_cplane_off(int num)
{
Modified: grass/branches/develbranch_6/lib/ogsf/gsd_prim.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/gsd_prim.c 2008-06-04 20:20:50 UTC (rev 31630)
+++ grass/branches/develbranch_6/lib/ogsf/gsd_prim.c 2008-06-04 22:49:32 UTC (rev 31631)
@@ -704,7 +704,7 @@
}
/*!
- \brief ADD
+ \brief Initialize model light
*/
void gsd_init_lightmodel(void)
{
@@ -820,8 +820,8 @@
/*!
\brief Define light
- \param num
- \param vals
+ \param num light id (starts with 1)
+ \param vals position(x,y,z,w), color, ambientm, emission
*/
void gsd_deflight(int num, struct lightdefs *vals)
{
Modified: grass/branches/develbranch_6/lib/ogsf/gsd_surf.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/gsd_surf.c 2008-06-04 20:20:50 UTC (rev 31630)
+++ grass/branches/develbranch_6/lib/ogsf/gsd_surf.c 2008-06-04 22:49:32 UTC (rev 31631)
@@ -2224,9 +2224,9 @@
row /= 2;
}
*/
- datarow1 = row * ymod;
- datarow2 = (row - (step_val/2)) * ymod;
- datarow3 = (row + (step_val/2)) * ymod;
+ datarow1 = row * ymod;
+ datarow2 = (row - (step_val/2)) * ymod;
+ datarow3 = (row + (step_val/2)) * ymod;
y1 = ymax - row*yres;
@@ -2239,96 +2239,95 @@
for (col = start_val; col < xcnt; col+=step_val) {
-
- datacol1 = col * xmod;
- datacol2 = (col - (step_val/2)) * xmod;
- datacol3 = (col + (step_val/2)) * xmod;
-
- x1 = col*xres;
- x2 = (col-(step_val/2))*xres;
- x3 = (col+(step_val/2))*xres;
-
-
- /* 0 */
- /*
- if (check_mask) {
- if (BM_get(surf->curmask, datacol1, datarow1))
- continue;
- }
- */
-
- cnt1++;
-
- /* Do not need BM_get because GET_MAPATT calls
- * same and returns zero if masked
- */
- offset2[0] = y1off+datacol1; /* fan center */
- pt2[0][X] = x1; pt2[0][Y] = y1; /* fan center */
- pt[X]=pt2[0][X]; pt[Y] = pt2[0][Y];
+ datacol1 = col * xmod;
+ datacol2 = (col - (step_val/2)) * xmod;
+ datacol3 = (col + (step_val/2)) * xmod;
+
+ x1 = col*xres;
+ x2 = (col-(step_val/2))*xres;
+ x3 = (col+(step_val/2))*xres;
+
+
+ /* 0 */
+ /*
+ if (check_mask) {
+ if (BM_get(surf->curmask, datacol1, datarow1))
+ continue;
+ }
+ */
+
+ cnt1++;
+
+ /* Do not need BM_get because GET_MAPATT calls
+ * same and returns zero if masked
+ */
+ offset2[0] = y1off+datacol1; /* fan center */
+ pt2[0][X] = x1; pt2[0][Y] = y1; /* fan center */
+ pt[X]=pt2[0][X]; pt[Y] = pt2[0][Y];
if ( !GET_MAPATT(buff, offset2[0], pt[Z]) )
- continue; /* masked */
+ continue; /* masked */
else {
- pt[Z] *= zexag;
- if (gsd_checkpoint
+ pt[Z] *= zexag;
+ if (gsd_checkpoint
(pt, window, viewport, modelMatrix, projMatrix))
- continue;
+ continue;
}
-
- offset2[1] = y2off+datacol2;
- offset2[2] = y2off+datacol1;
- offset2[3] = y2off+datacol3;
- offset2[4] = y1off+datacol3;
- offset2[5] = y3off+datacol3;
- offset2[6] = y3off+datacol1;
- offset2[7] = y3off+datacol2;
- offset2[8] = y1off+datacol2;
- offset2[9] = y2off+datacol2; /* repeat 1st corner to close */
-
- pt2[1][X] = x2; pt2[1][Y] = y2;
- pt2[2][X] = x1; pt2[2][Y] = y2;
- pt2[3][X] = x3; pt2[3][Y] = y2;
- pt2[4][X] = x3; pt2[4][Y] = y1;
- pt2[5][X] = x3; pt2[5][Y] = y3;
- pt2[6][X] = x1; pt2[6][Y] = y3;
- pt2[7][X] = x2; pt2[7][Y] = y3;
- pt2[8][X] = x2; pt2[8][Y] = y1;
- pt2[9][X] = x2; pt2[9][Y] = y2; /* repeat 1st corner to close */
-
-
- /* Run through triangle fan */
+
+ offset2[1] = y2off+datacol2;
+ offset2[2] = y2off+datacol1;
+ offset2[3] = y2off+datacol3;
+ offset2[4] = y1off+datacol3;
+ offset2[5] = y3off+datacol3;
+ offset2[6] = y3off+datacol1;
+ offset2[7] = y3off+datacol2;
+ offset2[8] = y1off+datacol2;
+ offset2[9] = y2off+datacol2; /* repeat 1st corner to close */
+
+ pt2[1][X] = x2; pt2[1][Y] = y2;
+ pt2[2][X] = x1; pt2[2][Y] = y2;
+ pt2[3][X] = x3; pt2[3][Y] = y2;
+ pt2[4][X] = x3; pt2[4][Y] = y1;
+ pt2[5][X] = x3; pt2[5][Y] = y3;
+ pt2[6][X] = x1; pt2[6][Y] = y3;
+ pt2[7][X] = x2; pt2[7][Y] = y3;
+ pt2[8][X] = x2; pt2[8][Y] = y1;
+ pt2[9][X] = x2; pt2[9][Y] = y2; /* repeat 1st corner to close */
+
+
+ /* Run through triangle fan */
gsd_bgntfan();
for (ii = 0; ii < 10; ii++) {
-
- if ( ii > 0) {
+
+ if ( ii > 0) {
pt[X]=pt2[ii][X]; pt[Y] = pt2[ii][Y];
- if (!GET_MAPATT(buff, offset2[ii], pt[Z]) )
- continue;
+ if (!GET_MAPATT(buff, offset2[ii], pt[Z]) )
+ continue;
pt[Z] *= zexag;
- }
-
- FNORM(surf->norms[offset2[ii]], n);
-
- if (check_color)
- curcolor = gs_mapcolor(cobuff, coloratt, offset2[ii]);
-
+ }
+
+ FNORM(surf->norms[offset2[ii]], n);
+
+ if (check_color)
+ curcolor = gs_mapcolor(cobuff, coloratt, offset2[ii]);
+
if (check_transp) {
GET_MAPATT(trbuff, offset2[ii], ttr);
ktrans = (char) SCALE_ATT(tratt, ttr, 0, 255);
ktrans = (char) (255 - ktrans) << 24;
}
-
+
if (check_material) {
if (check_emis) {
GET_MAPATT(embuff, offset2[ii], kem);
kem = SCALE_ATT(ematt, kem, 0., 1.);
}
-
+
if (check_shin) {
GET_MAPATT(shbuff, offset2[ii], ksh);
ksh = SCALE_ATT(shatt, ksh, 0., 1.);
}
-
+
if (pksh != ksh || pkem != kem
|| (kem && check_color)) {
pksh = ksh;
@@ -2337,24 +2336,20 @@
ksh, kem, curcolor);
}
}
-
+
gsd_litvert_func(n, ktrans | curcolor, pt);
- } /* close ii loop */
+ } /* close ii loop */
gsd_endtfan();
cnt2++;
-
-
-
} /* end col */
-
- } /* end row */
-
-
+ } /* end row */
+
+
gsd_popmatrix();
gsd_blend(0);
gsd_zwritemask(0xffffffff);
-
+
return (0);
}
More information about the grass-commit
mailing list