static void run (const gchar *name, gint nparams, const GimpParam *param, gint *nreturn_vals, GimpParam **return_vals) { static GimpParam values[1]; gint32 image_ID; GimpPDBStatusType status = GIMP_PDB_SUCCESS; *nreturn_vals = 1; *return_vals = values; values[0].type = GIMP_PDB_STATUS; values[0].data.d_status = status; INIT_I18N(); image_ID = param[1].data.d_image; if (status == GIMP_PDB_SUCCESS) { gimp_progress_init (_("Guillotine")); guillotine (image_ID); gimp_displays_flush (); } values[0].data.d_status = status; }
static void run (const gchar *name, gint nparams, const GimpParam *param, gint *nreturn_vals, GimpParam **return_vals) { static GimpParam values[3]; GimpRunMode run_mode = param[0].data.d_int32; GimpPDBStatusType status = GIMP_PDB_SUCCESS; *nreturn_vals = 3; *return_vals = values; values[0].type = GIMP_PDB_STATUS; values[0].data.d_status = status; values[1].type = GIMP_PDB_INT32; values[1].data.d_int32 = 0; values[2].type = GIMP_PDB_INT32ARRAY; values[2].data.d_int32array = NULL; INIT_I18N(); if (status == GIMP_PDB_SUCCESS) { GList *images; GList *list; gint i; gimp_progress_init (_("Guillotine")); images = guillotine (param[1].data.d_image, run_mode == GIMP_RUN_INTERACTIVE); values[1].data.d_int32 = g_list_length (images); values[2].data.d_int32array = g_new (gint32, values[1].data.d_int32); for (list = images, i = 0; list; list = g_list_next (list), i++) { values[2].data.d_int32array[i] = GPOINTER_TO_INT (list->data); } g_list_free (images); if (run_mode == GIMP_RUN_INTERACTIVE) gimp_displays_flush (); } values[0].data.d_status = status; }
void display(void) { // ****** declaracoes internas 'a funcao display() ****** float temp; // ****** fim de todas as declaracoes da funcao display() ****** glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); setCamera(); // permissao de atribuicao directa de cores // para objectos que nao tem material atribuido, como // e' o caso dos eixos e da esfera que simboliza a fonte de luz... /*glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE); glEnable(GL_COLOR_MATERIAL);*/ // Actualizacao da posicao da fonte de luz... light0_position[0] = light0x; // por razoes de eficiencia, os restantes light0_position[1] = light0y; // parametros _invariaveis_ da LIGHT0 mantem os valores light0_position[2] = light0z; // definidos na funcao de inicializacao glLightfv(GL_LIGHT0, GL_POSITION, light0_position); // ... e da esfera que a simboliza /*glColor3f(1.0,1.0,0.0); // cor amarela gluQuadricOrientation( glQ, GLU_INSIDE); glPushMatrix(); glTranslated(light0x,light0y,light0z); gluSphere(glQ, symb_light0_radius, symb_light0_slices, symb_light0_stacks); glPopMatrix(); gluQuadricOrientation( glQ, GLU_OUTSIDE); glDisable(GL_COLOR_MATERIAL);*/ glCallList(DP_GEOMETRY); glCallList(DP_MACHINE); glPushMatrix(); if(st==ST2){ glTranslated(centerX,0,centerZ); glRotated(ang,0,1,0); glTranslated(-centerX,0,-centerZ); } else if(st==ST5){ glTranslated(centerX,0,centerZ); glRotated(-ang,0,1,0); glTranslated(-centerX,0,-centerZ); } glTranslated(robotXa,0,robotZa); if(st==ST3||st==ST4||st==ST5) glRotated(90,0,1,0); light1_position[0] = light1x; light1_position[1] = light1y; light1_position[2] = light1z; glLightf(GL_LIGHT1, GL_SPOT_CUTOFF, light1_cone_radius); glLightfv(GL_LIGHT1, GL_SPOT_DIRECTION, light1_spot_direction); glLightfv(GL_LIGHT1, GL_POSITION, light1_position); if(n_newspapers>0){ glPushMatrix(); glTranslated(0,paperYf,0); paper(); glPopMatrix(); } glCallList(DP_ROBOT); glPopMatrix(); glPushMatrix(); glTranslated(printingMachineX,0,printingMachineZ+conveyorZ+machineZ); belt(conveyorX,conveyorY,conveyorZ); drawNewspapers(newspapersX,newspapersY,newspapersZi,newspapersZf); glPopMatrix(); if(st==ST01){ glPushMatrix(); glTranslated(newspaperX,0,newspaperZ); drawNewspaper(newspapersX,newspapersY,newspaperZi,newspaperZf); glPopMatrix(); } if(st==ST02){ glPushMatrix(); glTranslated(newspaperX,paperYa,paperZa); paper(); glPopMatrix(); } glPushMatrix(); glTranslated(platenX,platenY,platenZ); glRotated(-platen_ang,1.0,0.0,0.0); platen(); glPopMatrix(); glPushMatrix(); glTranslated(guillotinePosX,guillotineYa,guillotinePosZ); guillotine(guillotineX,guillotineY); glPopMatrix(); showCameraNumber(); glEnable(GL_NORMALIZE); // swapping the buffers causes the rendering above to be shown glutSwapBuffers(); // glFlush(); included in the above glutSwapBuffers() }