Beispiel #1
0
Datei: emit.c Projekt: EQ4/vis
/* n x y ux uy rad urad ds uds theta utheta life ulife r g b ur ug ub
 * force limit blender */
emit_desc* make_emit_frame(int n,
        double x, double y, double ux, double uy,
        double rad, double urad, double ds, double uds,
        double theta, double utheta, int life, int ulife,
        float r, float g, float b, float ur, float ub, float ug,
        force_id force, limit_id limit, blend_id blend) /* sorry */ {
    emit_desc* emit = emit_new();
    emit->n = n;
    emit->x = x;
    emit->y = y;
    emit->ux = ux;
    emit->uy = uy;
    emit->rad = rad;
    emit->urad = urad;
    emit->life = life;
    emit->ulife = ulife;
    emit->ds = ds;
    emit->uds = uds;
    emit->theta = theta;
    emit->utheta = utheta;
    emit->r = r;
    emit->b = b;
    emit->g = g;
    emit->ur = ur;
    emit->ub = ub;
    emit->ug = ug;
    emit->force = force;
    emit->limit = limit;
    emit->blender = blend;
    return emit;
}
Beispiel #2
0
Cell *gera_codigo_try_list(struct Predicates *predi) /* gerar os try's para o  predicado i */
{
  struct Clauses *c;
  int nr=0,nr_preds;

  StartCode=NULL;
  inter_code=NULL;
  nr_preds=predi->idx_list+predi->idx_var;
  c=predi->first;

  emit_new(prepare_tries,nr_preds,predi->arity);
  if (nr_preds>=1) { 
    while(c!=NULL) {
      if (c->predi==predi && (c->idx==Lista || c->idx==Variavel)) {
 	 if (nr_preds==1) {
           emit_new(only_1_clause_op,0,(unsigned long) c);
           break;
	 }
	 if (nr+1==nr_preds) { emit_new(trust_me_op,nr,(unsigned long) c); break; }
	 else if (nr==0) emit_new(try_me_op,nr_preds,(unsigned long) c);
	      else emit_new(retry_me_op,nr,(unsigned long) c);
         nr++;
      }
      c=c->next;
    }
  } else {
      emit_new(fail_op,0,0);
  }
  
  return(eam_assemble(StartCode));
}
Beispiel #3
0
Cell *gera_codigo_try(struct Predicates *predi) /* gerar os try's para o  predicado i */
{
  struct Clauses *c;
  int nr=0;

  StartCode=NULL;
  inter_code=NULL;
  c=predi->first;

  emit_new(prepare_tries,predi->nr_alt,predi->arity);
  if (predi->nr_alt==1) {
      emit_new(only_1_clause_op,0,(unsigned long) c);    
  } else if (predi->nr_alt>1) { 
    while(c!=NULL) {
      if (nr+1==predi->nr_alt) emit_new(trust_me_op,nr,(unsigned long) c); 
      else if (nr==0) emit_new(try_me_op,predi->nr_alt,(unsigned long) c);
           else emit_new(retry_me_op,nr,(unsigned long) c);

      c=c->next;
      nr++;
    }
  } else {  
      emit_new(fail_op,0,0);
  }
  
  return(eam_assemble(StartCode));
}