4
\brief wxNviz extension (3D view mode) - vector attributes
6
This program is free software under the GNU General Public
7
License (>=v2). Read the file COPYING that comes with GRASS
10
(C) 2008-2009 by Martin Landa, and the GRASS development team
12
\author Martin Landa <landa.martin gmail.com> (Google SoC 2008)
18
\brief Set mode of vector line overlay
21
\param color_str color string
22
\param width line width
23
\param flat display flat or on surface
25
\return -1 vector set not found
29
int Nviz::SetVectorLineMode(int id, const char *color_str,
34
if(!GV_vect_exists(id))
37
G_debug(1, "Nviz::SetVectorMode(): id=%d, color=%s, width=%d, flat=%d",
38
id, color_str, width, flat);
41
color = Nviz_color_from_str(color_str);
43
/* use memory by default */
44
if (GV_set_vectmode(id, 1, color, width, flat) < 0)
51
\brief Set vector height above surface (lines)
53
\param id vector set id
56
\return -1 vector set not found
59
int Nviz::SetVectorLineHeight(int id, float height)
61
if(!GV_vect_exists(id))
64
G_debug(1, "Nviz::SetVectorLineHeight(): id=%d, height=%f",
67
GV_set_trans(id, 0.0, 0.0, height);
73
\brief Set reference surface of vector set (lines)
75
\param id vector set id
76
\param surf_id surface id
79
\return -1 vector set not found
80
\return -2 surface not found
83
int Nviz::SetVectorLineSurface(int id, int surf_id)
85
if (!GV_vect_exists(id))
88
if (!GS_surf_exists(surf_id))
91
if (GV_select_surf(id, surf_id) < 0)
98
\brief Set mode of vector point overlay
101
\param color_str color string
102
\param width line width
105
\return -1 vector set not found
107
int Nviz::SetVectorPointMode(int id, const char *color_str,
108
int width, float size, int marker)
112
if(!GP_site_exists(id))
115
G_debug(1, "Nviz::SetVectorPointMode(): id=%d, color=%s, "
116
"width=%d, size=%f, marker=%d",
117
id, color_str, width, size, marker);
120
color = Nviz_color_from_str(color_str);
122
if (GP_set_sitemode(id, ST_ATT_NONE,
123
color, width, size, marker) < 0)
130
\brief Set vector height above surface (points)
132
\param id vector set id
135
\return -1 vector set not found
138
int Nviz::SetVectorPointHeight(int id, float height)
140
if(!GP_site_exists(id))
143
G_debug(1, "Nviz::SetVectorPointHeight(): id=%d, height=%f",
146
GP_set_trans(id, 0.0, 0.0, height);
152
\brief Set reference surface of vector set (points)
154
\param id vector set id
155
\param surf_id surface id
158
\return -1 vector set not found
159
\return -2 surface not found
160
\return -3 on failure
162
int Nviz::SetVectorPointSurface(int id, int surf_id)
164
if (!GP_site_exists(id))
167
if (!GS_surf_exists(surf_id))
170
if (GP_select_surf(id, surf_id) < 0)