|
@@ -19,12 +19,16 @@
|
|
|
#include "nviz.h"
|
|
|
|
|
|
/**
|
|
|
- \brief Set mode of vector overlay
|
|
|
+ \brief Set mode of vector line overlay
|
|
|
|
|
|
\param id vector id
|
|
|
\param color_str color string
|
|
|
\param width line width
|
|
|
- \param flat
|
|
|
+ \param flat display flat or on surface
|
|
|
+
|
|
|
+ \return -1 vector set not found
|
|
|
+ \return -2 on failure
|
|
|
+ \return 1 on success
|
|
|
*/
|
|
|
int Nviz::SetVectorLineMode(int id, const char *color_str,
|
|
|
int width, int flat)
|
|
@@ -32,7 +36,7 @@ int Nviz::SetVectorLineMode(int id, const char *color_str,
|
|
|
int color;
|
|
|
|
|
|
if(!GV_vect_exists(id))
|
|
|
- return 0;
|
|
|
+ return -1;
|
|
|
|
|
|
G_debug(1, "Nviz::SetVectorMode(): id=%d, color=%s, width=%d, flat=%d",
|
|
|
id, color_str, width, flat);
|
|
@@ -42,26 +46,26 @@ int Nviz::SetVectorLineMode(int id, const char *color_str,
|
|
|
|
|
|
/* use memory by default */
|
|
|
if (GV_set_vectmode(id, 1, color, width, flat) < 0)
|
|
|
- return 0;
|
|
|
+ return -2;
|
|
|
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- \brief Set vector height above surface
|
|
|
+ \brief Set vector height above surface (lines)
|
|
|
|
|
|
\param id vector set id
|
|
|
\param height
|
|
|
|
|
|
+ \return -1 vector set not found
|
|
|
\return 1 on success
|
|
|
- \return 0 on failure
|
|
|
*/
|
|
|
-int Nviz::SetVectorHeight(int id, float height)
|
|
|
+int Nviz::SetVectorLineHeight(int id, float height)
|
|
|
{
|
|
|
if(!GV_vect_exists(id))
|
|
|
- return 0;
|
|
|
+ return -1;
|
|
|
|
|
|
- G_debug(1, "Nviz::SetVectorHeight(): id=%d, height=%f",
|
|
|
+ G_debug(1, "Nviz::SetVectorLineHeight(): id=%d, height=%f",
|
|
|
id, height);
|
|
|
|
|
|
GV_set_trans(id, 0.0, 0.0, height);
|
|
@@ -70,21 +74,105 @@ int Nviz::SetVectorHeight(int id, float height)
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- \brief Set reference surface of vector set
|
|
|
+ \brief Set reference surface of vector set (lines)
|
|
|
|
|
|
\param id vector set id
|
|
|
\param surf_id surface id
|
|
|
|
|
|
\return 1 on success
|
|
|
- \return 0 on failure
|
|
|
+ \return -1 vector set not found
|
|
|
+ \return -2 surface not found
|
|
|
+ \return -3 on failure
|
|
|
*/
|
|
|
-int Nviz::SetVectorSurface(int id, int surf_id)
|
|
|
+int Nviz::SetVectorLineSurface(int id, int surf_id)
|
|
|
{
|
|
|
- if (!GS_surf_exists(surf_id) || !GV_vect_exists(id))
|
|
|
- return 0;
|
|
|
+ if (!GV_vect_exists(id))
|
|
|
+ return -1;
|
|
|
+
|
|
|
+ if (!GS_surf_exists(surf_id))
|
|
|
+ return -2;
|
|
|
|
|
|
if (GV_select_surf(id, surf_id) < 0)
|
|
|
- return 0;
|
|
|
+ return -3;
|
|
|
+
|
|
|
+ return 1;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ \brief Set mode of vector point overlay
|
|
|
+
|
|
|
+ \param id vector id
|
|
|
+ \param color_str color string
|
|
|
+ \param width line width
|
|
|
+ \param flat
|
|
|
+
|
|
|
+ \return -1 vector set not found
|
|
|
+*/
|
|
|
+int Nviz::SetVectorPointMode(int id, const char *color_str,
|
|
|
+ int width, float size, int marker)
|
|
|
+{
|
|
|
+ int color;
|
|
|
+
|
|
|
+ if(!GP_site_exists(id))
|
|
|
+ return -1;
|
|
|
+
|
|
|
+ G_debug(1, "Nviz::SetVectorPointMode(): id=%d, color=%s, "
|
|
|
+ "width=%d, size=%f, marker=%d",
|
|
|
+ id, color_str, width, size, marker);
|
|
|
+
|
|
|
+
|
|
|
+ color = Nviz_color_from_str(color_str);
|
|
|
+
|
|
|
+ if (GP_set_sitemode(id, ST_ATT_NONE,
|
|
|
+ color, width, size, marker) < 0)
|
|
|
+ return -2;
|
|
|
+
|
|
|
+ return 1;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ \brief Set vector height above surface (points)
|
|
|
+
|
|
|
+ \param id vector set id
|
|
|
+ \param height
|
|
|
+
|
|
|
+ \return -1 vector set not found
|
|
|
+ \return 1 on success
|
|
|
+*/
|
|
|
+int Nviz::SetVectorPointHeight(int id, float height)
|
|
|
+{
|
|
|
+ if(!GP_site_exists(id))
|
|
|
+ return -1;
|
|
|
+
|
|
|
+ G_debug(1, "Nviz::SetVectorPointHeight(): id=%d, height=%f",
|
|
|
+ id, height);
|
|
|
+
|
|
|
+ GP_set_trans(id, 0.0, 0.0, height);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ \brief Set reference surface of vector set (points)
|
|
|
+
|
|
|
+ \param id vector set id
|
|
|
+ \param surf_id surface id
|
|
|
+
|
|
|
+ \return 1 on success
|
|
|
+ \return -1 vector set not found
|
|
|
+ \return -2 surface not found
|
|
|
+ \return -3 on failure
|
|
|
+*/
|
|
|
+int Nviz::SetVectorPointSurface(int id, int surf_id)
|
|
|
+{
|
|
|
+ if (!GP_site_exists(id))
|
|
|
+ return -1;
|
|
|
+
|
|
|
+ if (!GS_surf_exists(surf_id))
|
|
|
+ return -2;
|
|
|
+
|
|
|
+ if (GP_select_surf(id, surf_id) < 0)
|
|
|
+ return -3;
|
|
|
|
|
|
return 1;
|
|
|
}
|