Logo Search packages:      
Sourcecode: v-sim version File versions  Download package

int visuDataAdd_VisuElement ( VisuData data,
VisuElement *  ele,
double  x,
double  y,
double  z,
int  number 
)

visuDataAdd_VisuElement: : the VisuData where to add the new VisuNode ; : the VisuElement kind of the new VisuNode ; : its x coordinate ; : its y coordinate ; : its z coordinate ; : its position in the input file (or anything else that can uniqualy identify this new VisuNode).

This method adds a new VisuNode to the specified VisuData.

Returns: 0 if everything is allright.

visuDataAdd_VisuElement: : the VisuData where to add the new VisuNode ; : the VisuElement kind of the new VisuNode ; : its x coordinate ; : its y coordinate ; : its z coordinate ; : its position in the input file (or anything else that can uniqualy identify this new VisuNode).

This method adds a new VisuNode to the specified VisuData. Rotation is set to 0.

Returns: 0 if everything is allright.

Definition at line 1163 of file visu_data.c.

References _VisuData::fromNumberToVisuNode, _VisuData::fromVisuElementToInt, _VisuData::nbOfAllStoredNodes, _VisuData::nodes, _VisuData::ntype, and _VisuData::numberOfStoredNodes.

{
  int *pos;

  if (!data)
    return 1;

  pos = (int*)g_hash_table_lookup(data->fromVisuElementToInt, (gpointer)ele);
  if (!pos)
    {
      g_warning("Can't add a node of element '%s' in VisuData %p since"
            " no such element has been allocated.\n", ele->name, (gpointer)data);
      return 1;
    }

  if (*pos > data->ntype || *pos < 0)
    {
      g_warning("The hashtable from VisuElement to position"
            " of the VisuData %d is malformed since the VisuElement '%s' has a"
            " position %d.\n", GPOINTER_TO_INT(data), ele->name, *pos);
      return 1;
    }
  data->nbOfAllStoredNodes += 1;
  visuNodeSet_newValues(data->nodes[*pos] + data->numberOfStoredNodes[*pos],
                  x, y, z, data->nbOfAllStoredNodes, 1, *pos,
                  data->numberOfStoredNodes[*pos]);
  data->fromNumberToVisuNode[data->nbOfAllStoredNodes - 1] =
    data->nodes[*pos] + data->numberOfStoredNodes[*pos];
  data->numberOfStoredNodes[*pos] += 1;
  return 0;
}


Generated by  Doxygen 1.6.0   Back to index