|
GRASS 8 Programmer's Manual 8.6.0dev(2026)-4bb960b182
|
OGSF library - calculation normals (lower level functions) More...
#include <math.h>#include <grass/gis.h>#include <grass/ogsf.h>#include "gsget.h"#include "rowcol.h"
Go to the source code of this file.
Macros | |
| #define | NTOP 0x00001000 |
| #define | NBOT 0x00000100 |
| #define | NLFT 0x00000010 |
| #define | NRGT 0x00000001 |
| #define | NALL 0x00001111 |
| #define | NTL 0x00001010 |
| #define | NTR 0x00001001 |
| #define | NBL 0x00000110 |
| #define | NBR 0x00000101 |
| #define | SET_NORM(i) |
| This macro is only used in the function calc_norm() | |
Functions | |
| void | init_vars (geosurf *gs) |
| Init variables. | |
| int | gs_calc_normals (geosurf *gs) |
| Calculate normals. | |
| int | calc_norm (geosurf *gs, int drow, int dcol, unsigned int neighbors) |
| Calculate normals. | |
OGSF library - calculation normals (lower level functions)
GRASS OpenGL gsurf OGSF Library
SPDX-FileCopyrightText: 1999-2008 GRASS Development Team SPDX-License-Identifier: GPL-2.0-or-later
Definition in file gs_norms.c.
| #define NALL 0x00001111 |
Definition at line 28 of file gs_norms.c.
| #define NBL 0x00000110 |
Definition at line 32 of file gs_norms.c.
| #define NBOT 0x00000100 |
Definition at line 24 of file gs_norms.c.
| #define NBR 0x00000101 |
Definition at line 33 of file gs_norms.c.
| #define NLFT 0x00000010 |
Definition at line 25 of file gs_norms.c.
| #define NRGT 0x00000001 |
Definition at line 26 of file gs_norms.c.
| #define NTL 0x00001010 |
Definition at line 30 of file gs_norms.c.
| #define NTOP 0x00001000 |
Definition at line 23 of file gs_norms.c.
| #define NTR 0x00001001 |
Definition at line 31 of file gs_norms.c.
| #define SET_NORM | ( | i | ) |
This macro is only used in the function calc_norm()
Definition at line 38 of file gs_norms.c.
Calculate normals.
Need either four neighbors or two non-linear neighbors passed initial state of neighbors known from array position and data row & col
| gs | surface (geosurf) |
| drow | data row |
| dcol | data col |
| neighbors | neighbors id |
Definition at line 202 of file gs_norms.c.
References BM_get(), DRC2OFF, GET_MAPATT, NBOT, NLFT, NRGT, NTOP, and SET_NORM.
Referenced by gs_calc_normals().
Calculate normals.
OPTIMIZED for constant dy & dx
The norm array is always the same size, but diff resolutions force resampled data points to have their normals recalculated, then only those norms are passed to n3f during drawing. Norms are converted to a packed unsigned int for storage, must be converted back at time of use.
Uses the previous and next cells (when available) for normal calculations to produce smoother normals
| gs | surface (geosurf) |
Definition at line 120 of file gs_norms.c.
References calc_norm(), G_debug(), gs_update_curmask(), init_vars(), NALL, NBL, NBOT, NBR, NLFT, NRGT, NTL, NTOP, NTR, VCOLS, and VROWS.
Referenced by GS_get_norm_at_xy(), GS_update_normals(), gsd_coarse_surf_map(), and gsd_surf().
Init variables.
for optimization
| gs | surface (geosurf) |
Definition at line 69 of file gs_norms.c.
References ATT_TOPO, gs_get_att_typbuff(), GS_get_scale(), and GS_global_exag().
Referenced by gs_calc_normals().