grass  7.8.6
About: GRASS (Geographic Resources Analysis Support System) is a raster- and vector-based GIS, image processing system, graphics production system and spatial modeling system.
  Fossies Dox: grass-7.8.6.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

cplanes_obj.c File Reference

Nviz library – Clip planes manipulation. More...

#include <grass/nviz.h>
Include dependency graph for cplanes_obj.c:

Go to the source code of this file.

Functions

static void cp_draw (nv_data *data, int current, int surf1, int surf2)
 Draw current clip plane. More...
 
int Nviz_new_cplane (nv_data *data, int id)
 Creates a clip plane object. More...
 
int Nviz_on_cplane (nv_data *data, int id)
 Turn on (make current) the given clip plane. More...
 
int Nviz_off_cplane (nv_data *data, int id)
 Turn off (make inactive) the given clip plane. More...
 
int Nviz_draw_cplane (nv_data *data, int bound1, int bound2)
 Draw the clip plane. More...
 
int Nviz_num_cplanes (nv_data *data)
 Return the number of clip planes objects currently allocated. More...
 
int Nviz_get_current_cplane (nv_data *data)
 Get the current active cutplane. More...
 
int Nviz_set_cplane_rotation (nv_data *data, int id, float dx, float dy, float dz)
 Set the rotation for the current clip plane. More...
 
int Nviz_get_cplane_rotation (nv_data *data, int id, float *dx, float *dy, float *dz)
 Get the rotation values for the current clip plane. More...
 
int Nviz_set_cplane_translation (nv_data *data, int id, float dx, float dy, float dz)
 Set the translation for the current clip plane. More...
 
int Nviz_get_cplane_translation (nv_data *data, int id, float *dx, float *dy, float *dz)
 Get the translation values for the current clip plane. More...
 
int Nviz_set_fence_color (nv_data *data, int type)
 Set appropriate fence color. More...
 
int Nviz_set_cplane_here (nv_data *data, int cplane, float sx, float sy)
 

Variables

static geoview Gv
 

Detailed Description

Nviz library – Clip planes manipulation.

Based on visualization/nviz/src/cutplanes_obj.c

(C) 2008, 2010 by the GRASS Development Team This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.

Author
Updated/modified by Martin Landa <landa.martin gmail.com> (Google SoC 2008/2010)

Definition in file cplanes_obj.c.

Function Documentation

◆ cp_draw()

void cp_draw ( nv_data data,
int  current,
int  surf1,
int  surf2 
)
static

Draw current clip plane.

Parameters
datanviz data
currentid of current clip plane
surf1first surface id
surf2second surface id

Definition at line 93 of file cplanes_obj.c.

References data, GS_clear(), GS_done_draw(), GS_draw_cplane_fence(), GS_draw_wire(), GS_get_surf_list(), GS_ready_draw(), GS_set_draw(), GSD_BACK, and MAX_CPLANES.

Referenced by Nviz_draw_cplane(), Nviz_set_cplane_rotation(), and Nviz_set_cplane_translation().

◆ Nviz_draw_cplane()

int Nviz_draw_cplane ( nv_data data,
int  bound1,
int  bound2 
)

Draw the clip plane.

Parameters
datanviz data
bound1
bound2

Definition at line 78 of file cplanes_obj.c.

References cp_draw(), and data.

◆ Nviz_get_cplane_rotation()

int Nviz_get_cplane_rotation ( nv_data data,
int  id,
float *  dx,
float *  dy,
float *  dz 
)

Get the rotation values for the current clip plane.

Parameters
datanviz data
idid of current clip plane
dx,dy,dzrotation parameters
Returns
1

Definition at line 193 of file cplanes_obj.c.

References data, X, Y, and Z.

◆ Nviz_get_cplane_translation()

int Nviz_get_cplane_translation ( nv_data data,
int  id,
float *  dx,
float *  dy,
float *  dz 
)

Get the translation values for the current clip plane.

Parameters
datanviz data
idid of current clip plane
dx,dy,dztranslation parameters

Definition at line 230 of file cplanes_obj.c.

References data, X, Y, and Z.

Referenced by Nviz_set_cplane_here().

◆ Nviz_get_current_cplane()

int Nviz_get_current_cplane ( nv_data data)

Get the current active cutplane.

Parameters
datanviz data

Definition at line 156 of file cplanes_obj.c.

References data.

◆ Nviz_new_cplane()

int Nviz_new_cplane ( nv_data data,
int  id 
)

Creates a clip plane object.

The number of clip planes is fixed (MAX_CPLANES) and we'll create them all ahead of time anyway we just let the user decide on the id for each.

Parameters
datanviz data
id

Definition at line 30 of file cplanes_obj.c.

References data, X, Y, and Z.

Referenced by Nviz_init_data().

◆ Nviz_num_cplanes()

int Nviz_num_cplanes ( nv_data data)

Return the number of clip planes objects currently allocated.

Parameters
datanviz data

Definition at line 146 of file cplanes_obj.c.

References data.

◆ Nviz_off_cplane()

int Nviz_off_cplane ( nv_data data,
int  id 
)

Turn off (make inactive) the given clip plane.

Parameters
datanviz data
cplaneid

Definition at line 63 of file cplanes_obj.c.

References data, and GS_unset_cplane().

Referenced by Nviz_init_data().

◆ Nviz_on_cplane()

int Nviz_on_cplane ( nv_data data,
int  id 
)

Turn on (make current) the given clip plane.

Parameters
datanviz data
cplaneid

Definition at line 48 of file cplanes_obj.c.

References data, and GS_set_cplane().

◆ Nviz_set_cplane_here()

◆ Nviz_set_cplane_rotation()

int Nviz_set_cplane_rotation ( nv_data data,
int  id,
float  dx,
float  dy,
float  dz 
)

Set the rotation for the current clip plane.

Parameters
datanviz data
idid of current clip plane
dx,dy,dzrotation parameters
Returns
1

Definition at line 171 of file cplanes_obj.c.

References cp_draw(), data, GS_set_cplane_rot(), X, Y, and Z.

◆ Nviz_set_cplane_translation()

int Nviz_set_cplane_translation ( nv_data data,
int  id,
float  dx,
float  dy,
float  dz 
)

Set the translation for the current clip plane.

Parameters
datanviz data
idid of current clip plane
dx,dy,dzvalues for setting translation
Returns
1

Definition at line 211 of file cplanes_obj.c.

References cp_draw(), data, GS_set_cplane_trans(), X, Y, and Z.

Referenced by Nviz_set_cplane_here().

◆ Nviz_set_fence_color()

int Nviz_set_fence_color ( nv_data data,
int  type 
)

Set appropriate fence color.

Parameters
typetype of fence (FC_ABOVE, FC_BELOW, FC_BLEND, FC_GREY, FC_OFF)

Definition at line 243 of file cplanes_obj.c.

References GS_set_fencecolor(), and type.

Variable Documentation

◆ Gv

geoview Gv
static

Definition at line 18 of file cplanes_obj.c.

Referenced by Nviz_set_cplane_here().