Beispiel #1
0
void main(void *arg)
{
	ei_sub_context();

	eiToken filename = eval_token(filename);
	eiToken root_name = eval_token(root_name);
	eiScalar particle_radius = eval_scalar(particle_radius);
	eiInt render_frame = eval_int(render_frame);
	eiScalar particle_speed = eval_scalar(particle_speed);

	ei_parse_abc(filename.str, particle_radius, particle_speed, render_frame, EI_TRUE);

	// set the root node for current procedural object
	geometry_root(root_name.str);

	ei_end_sub_context();
}
Beispiel #2
0
	void main(void *arg)
	{
		ei_sub_context();

		eiToken filename = eval_token(fileName);
		eiScalar proxy_scale = eval_scalar(proxy_scale);

		char resolved_filename[ EI_MAX_FILE_NAME_LEN ];
		ei_resolve_scene_name(resolved_filename, filename.str);
		ei_parse_vrmesh(resolved_filename, proxy_scale, "instance_group");

		// set the root node for current procedural object
		geometry_root("instance_group");

		ei_end_sub_context();
	}
Beispiel #3
0
/* ----------------------------- MNI Header -----------------------------------
@NAME       : do_math
@INPUT      : Standard for voxel loop
@OUTPUT     : Standard for voxel loop
@RETURNS    : (nothing)
@DESCRIPTION: Routine doing math operations.
@METHOD     : 
@GLOBALS    : Output_values, A
@CALLS      : 
@CREATED    : April 25, 1995 (Peter Neelin)
@MODIFIED   : Thu Dec 21 17:08:40 EST 2000 (Andrew Janke - [email protected])
---------------------------------------------------------------------------- */
static void do_math(void *caller_data, long num_voxels, 
                    int input_num_buffers, int input_vector_length,
                    double *input_data[],
                    int output_num_buffers, int output_vector_length,
                    double *output_data[],
                    Loop_Info *loop_info){
   long ivox, ibuff, ivalue, nvox;
   scalar_t scalar, *output_scalars;
   int num_output, iout;
   long total_values;  /* Total # of values to process in this call */

   /* Check arguments */
   if ((output_num_buffers < 1) || 
       (output_vector_length != input_vector_length)) {
      (void) fprintf(stderr, "Bad arguments to do_math!\n");
      exit(EXIT_FAILURE);
   }

   total_values = num_voxels * input_vector_length;

   /* Loop through the voxels */
   for (ivox=0; ivox < total_values; ivox+=eval_width) {

      /* Figure out how many voxels to work on at once */
      nvox = eval_width;
      if (ivox + nvox > total_values) 
          nvox = total_values - ivox;
      
      /* Copy the data into the A vector */
      for (ivalue=0; ivalue < nvox; ivalue++) {
         for (ibuff=0; ibuff < input_num_buffers; ibuff++){
            A->el[ibuff]->vals[ivalue] = input_data[ibuff][ivox+ivalue];
         }
      }

      /* Some debugging */
      if (debug) {
         (void) fprintf(stderr, "\n===New voxel===\n");
      }

      /* Evaluate the expression */
      scalar = eval_scalar((int) nvox, NULL, root, rootsym);

      /* Get the list of scalar values to write out */
      if (Output_values == NULL) {
         num_output = 1;
         output_scalars = &scalar;
      }
      else {
         num_output = Output_list_size;
         output_scalars = Output_values;
      }

      /* Copy the scalar values into the right buffers */
      for (iout=0; iout < num_output; iout++) {
         for (ivalue=0; ivalue < nvox; ivalue++) {
            output_data[iout][ivox+ivalue] = 
               output_scalars[iout]->vals[ivalue];
         }
      }

      /* Free things up */
      scalar_free(scalar);

      if (debug) {
         (void) printf("Voxel result = %g\n", output_data[0][ivox]);
      }
         

   }

   return;
}