void draw()
{
	switch (currentMode) {
	case 1:
		drawTargets();
		break;

	case 2:
		drawRecursion();
		break;

	case 3:
		drawWidthHeight();
		break;
	}
}
예제 #2
0
void BCIViz::draw( M3dView & view, const MDagPath & path, 
							 M3dView::DisplayStyle style,
							 M3dView::DisplayStatus status )
{ 	
	MObject thisNode = thisMObject();
	view.beginGL(); 
	
	glPushAttrib (GL_CURRENT_BIT);
	glDisable(GL_DEPTH_TEST);
	drawDriver();
	drawTargets();
	drawNeighbours();
	drawWeights();
	glEnable(GL_DEPTH_TEST);
	glPopAttrib();
	view.endGL();
}
예제 #3
0
void ShowScene2(int mode, int view_mode, int quad, GLint s_left, GLint s_down){

  if(rotation_type==EYE_CENTERED&&nskyboxinfo>0)draw_skybox();

  if(UpdateLIGHTS==1)updateLights(light_position0,light_position1);

  if(mode==DRAWSCENE){
    glPointSize((float)1.0);


    /* ++++++++++++++++++++++++ draw trees +++++++++++++++++++++++++ */

    if(ntreeinfo>0){
      CLIP_GEOMETRY;
      drawtrees();
      SNIFF_ERRORS("after drawtrees");
    }

/* ++++++++++++++++++++++++ draw particles +++++++++++++++++++++++++ */

    if(showsmoke==1){
      CLIP_VALS;
      drawpart_frame();
    }

/* ++++++++++++++++++++++++ draw evacuation +++++++++++++++++++++++++ */

    if(showevac==1){
      CLIP_VALS;
      drawevac_frame();
    }

/* ++++++++++++++++++++++++ draw targets +++++++++++++++++++++++++ */

    if(showtarget==1){
      CLIP_VALS;
      drawTargets();
    }

#ifdef pp_GEOMTEST
    if(show_geomtest==1){
      CLIP_GEOMETRY;
      draw_geomtestclip();
      draw_geomtestoutline();
    }
    if(show_cutcells==1)draw_geom_cutcells();
#endif

/* ++++++++++++++++++++++++ draw circular vents +++++++++++++++++++++++++ */

    if(ncvents>0&&visCircularVents!=VENT_HIDE){
      CLIP_GEOMETRY;
      DrawCircVents(visCircularVents);
    }

/* ++++++++++++++++++++++++ draw sensors/sprinklers/heat detectors +++++++++++++++++++++++++ */

    CLIP_GEOMETRY;
    draw_devices();
#ifdef pp_PILOT
    draw_pilot();
#endif    
    SNIFF_ERRORS("after draw_devices");

    if(visaxislabels==1){
      UNCLIP;
      outputAxisLabels();
      SNIFF_ERRORS("after outputAxisLables");
    }


 /* ++++++++++++++++++++++++ draw user ticks +++++++++++++++++++++++++ */

    if(visUSERticks==1){
      antialias(ON);
      UNCLIP;
      draw_user_ticks();
      antialias(OFF);
      SNIFF_ERRORS("after drawticks");
    }

 /* ++++++++++++++++++++++++ draw ticks +++++++++++++++++++++++++ */

    if(visFDSticks==1&&ntickinfo>0){
      UNCLIP;
      drawticks();
      SNIFF_ERRORS("after drawticks");
    }

    /* ++++++++++++++++++++++++ draw ticks +++++++++++++++++++++++++ */

    if(showgravity==1){
      UNCLIP;
      drawaxis();
      SNIFF_ERRORS("after drawaxis");
    }

    /* draw the box framing the simulation (corners at (0,0,0) (xbar,ybar,zbar) */


/* ++++++++++++++++++++++++ draw simulation frame (corners at (0,0,0) and (xbar,ybar,zbar) +++++++++++++++++++++++++ */

    if(isZoneFireModel==0&&visFrame==1&&highlight_flag==2){
      CLIP_GEOMETRY;
      drawoutlines();
      SNIFF_ERRORS("after drawoutlines");
    }

    if(show_rotation_center==1){
      unsigned char pcolor[4];

      CLIP_GEOMETRY;
      glPushMatrix();
      glTranslatef(camera_current->xcen,camera_current->ycen,camera_current->zcen);
      pcolor[0]=255*foregroundcolor[0];
      pcolor[1]=255*foregroundcolor[1];
      pcolor[2]=255*foregroundcolor[2];
      drawsphere(0.03,pcolor);
      glPopMatrix();
    }


/* ++++++++++++++++++++++++ draw mesh +++++++++++++++++++++++++ */

    if(setPDIM==1){
      if(visGrid!=noGridnoProbe){
        int igrid;
        mesh *meshi;

        UNCLIP;
        for(igrid=0;igrid<nmeshes;igrid++){
          meshi=meshinfo+igrid;
          drawgrid(meshi);
          SNIFF_ERRORS("drawgrid");
        }
      }
    }
  } /* end of if(mode==DRAWSCENE) code segment */


/* ++++++++++++++++++++++++ draw selected devices +++++++++++++++++++++++++ */

  if(mode==SELECTOBJECT){
    if(select_device==1){
      CLIP_GEOMETRY;
      draw_devices();
      SNIFF_ERRORS("after drawselect_devices");
      return;
    }
  }

/* ++++++++++++++++++++++++ draw selected avatars +++++++++++++++++++++++++ */

  if(mode==SELECTOBJECT){
    if(select_avatar==1){
      CLIP_GEOMETRY;
      drawselect_avatars();
      SNIFF_ERRORS("after drawselect_avatars");
      return;
    }
  }

/* ++++++++++++++++++++++++ draw selected tours +++++++++++++++++++++++++ */

  if(mode==SELECTOBJECT){
    if(edittour==1&&ntours>0){
      CLIP_GEOMETRY;
      drawselect_tours();
      SNIFF_ERRORS("after drawselect_tours");
      return;
    }
  }


/* ++++++++++++++++++++++++ draw tours +++++++++++++++++++++++++ */

  if(showtours==1){
    CLIP_GEOMETRY;
    drawtours();
    SNIFF_ERRORS("after drawtours");
  }

  /* ++++++++++++++++++++++++ draw stereo parallax indicator +++++++++++++++++++++++++ */
  
  if(show_parallax==1){
    UNCLIP;
    antialias(ON);
    glLineWidth(linewidth);
    glBegin(GL_LINES);
    glColor3fv(foregroundcolor);
    glVertex3f(0.75,0.0,0.25);
    glVertex3f(0.75,1.0,0.25);
    glEnd();
    antialias(OFF);
  }

  /* ++++++++++++++++++++++++ draw blockages +++++++++++++++++++++++++ */

  CLIP_GEOMETRY;
  drawBlockages(mode,DRAW_OPAQUE);
  SNIFF_ERRORS("drawBlockages");

  /* ++++++++++++++++++++++++ draw triangles +++++++++++++++++++++++++ */
  
  if(ngeominfoptrs>0){
    CLIP_GEOMETRY;
    draw_geom(DRAW_OPAQUE,GEOM_STATIC);
    draw_geom(DRAW_OPAQUE,GEOM_DYNAMIC);
  }

/* ++++++++++++++++++++++++ draw shooter points +++++++++++++++++++++++++ */

  if(showshooter!=0&&shooter_active==1){
    CLIP_VALS;
    draw_shooter();
  }

/* ++++++++++++++++++++++++ draw terrain +++++++++++++++++++++++++ */

  if(visTerrainType!=TERRAIN_HIDDEN&&nterraininfo>0){
    int i;
    
    //shaded 17 0
    //stepped 18 1
    //line    19 2
    //texture 20 3
    //hidden 20 4

    CLIP_GEOMETRY;
    for(i=0;i<nterraininfo;i++){
      terraindata *terri;
      int only_geom;

      terri = terraininfo + i;
      if(terri->loaded==1){
        only_geom=0;
      }
      else{
        only_geom=1;
      }
      switch(visTerrainType){
        case TERRAIN_3D:
          drawterrain(terri,only_geom);
          break;
        case TERRAIN_2D_STEPPED:
          if(cullfaces==1)glDisable(GL_CULL_FACE);
          glPushMatrix();
          glScalef(SCALE2SMV(1.0),SCALE2SMV(1.0),SCALE2SMV(1.0));
          glTranslatef(-xbar0,-ybar0,-zbar0);
          DrawContours(&meshinfo[i].terrain_contour);
          glPopMatrix();
          if(cullfaces==1)glEnable(GL_CULL_FACE);
          break;
        case TERRAIN_2D_LINE:
          glPushMatrix();
          glScalef(SCALE2SMV(1.0),SCALE2SMV(1.0),SCALE2SMV(1.0));
          glTranslatef(-xbar0,-ybar0,-zbar0);
          DrawLineContours(&meshinfo[i].terrain_contour,1.0);
          glPopMatrix();
          break;
        case TERRAIN_3D_MAP:
          if(terrain_texture!=NULL&&terrain_texture->loaded==1){
            drawterrain_texture(terri,only_geom);
          }
          else{
            drawterrain(terri,only_geom);
          }
          break;
        default:
          ASSERT(FFALSE);
          break;
      }
    }
  }

/* ++++++++++++++++++++++++ draw slice files +++++++++++++++++++++++++ */

  if(show_gslice_triangles==1||show_gslice_normal==1||show_gslice_normal_keyboard==1||show_gslice_triangulation==1){
    CLIP_VALS;
    drawgslice_outline();
  }
  if((show_slices_and_vectors==1&&showvslice==1)||(showslice==1&&use_transparency_data==0)){
    CLIP_VALS;
    drawslice_frame();
  } 

  /* ++++++++++++++++++++++++ draw boundary files +++++++++++++++++++++++++ */

  if(showpatch==1){
    CLIP_VALS;
    drawpatch_frame();
  }

/* ++++++++++++++++++++++++ draw labels +++++++++++++++++++++++++ */

  if(visLabels==1){
    CLIP_GEOMETRY;
    drawLabels();
  }

/* ++++++++++++++++++++++++ draw animated isosurfaces +++++++++++++++++++++++++ */

    //if(isoinfo!=NULL)drawspherepoints(sphereinfo);
  if(showiso==1){
    CLIP_VALS;
    drawiso(DRAW_OPAQUE);
  }

/* ++++++++++++++++++++++++ draw zone fire modeling info +++++++++++++++++++++++++ */

  if(nrooms>0){
    CLIP_GEOMETRY;
    drawroomgeom();
    SNIFF_ERRORS("after drawroomgeom");
  }
  if(nrooms>0){
    if(showzone==1){
      CLIP_VALS;
      drawfiredata();
      SNIFF_ERRORS("after drawroomdata");
      if(ReadZoneFile==1&&nzvents>0){
        drawventdata();
        SNIFF_ERRORS("after drawventdata");
      }
    }
  }


//**********************************************************************************
//**********************************************************************************
//**********************************************************************************
//    nothing transparent should be drawn before this portion of the code
//    (ie draw all opaque objects first then draw transparent objects
//**********************************************************************************
//**********************************************************************************
//**********************************************************************************

  /* ++++++++++++++++++++++++ draw triangles +++++++++++++++++++++++++ */
  
  if(ngeominfoptrs>0){
    CLIP_GEOMETRY;
    draw_geom(DRAW_TRANSPARENT,GEOM_STATIC);
    draw_geom(DRAW_TRANSPARENT,GEOM_DYNAMIC);
  }

  if(showiso==1){
    CLIP_VALS;
    drawiso(DRAW_TRANSPARENT);
  }

/* ++++++++++++++++++++++++ draw transparent faces +++++++++++++++++++++++++ */

  CLIP_GEOMETRY;
  draw_transparent_faces();

/* ++++++++++++++++++++++++ draw 3D smoke +++++++++++++++++++++++++ */

  if(show3dsmoke==1||showvolrender==1){
    CLIP_VALS;
    drawsmoke_frame();
  }

  if(active_smokesensors==1&&show_smokesensors!=0){
    CLIP_VALS;
    getsmokesensors();
    draw_devices_val();
  }

/* ++++++++++++++++++++++++ draw zone fire modeling info +++++++++++++++++++++++++ */

  if(nrooms>0&&showzone==1){
    CLIP_VALS;
    drawroomdata();
    SNIFF_ERRORS("after drawroomdata");
  }

/* ++++++++++++++++++++++++ draw slice files +++++++++++++++++++++++++ */

  if((show_slices_and_vectors==1&&showvslice==1)||(showslice==1&&use_transparency_data==1)){
    CLIP_VALS;
    drawslice_frame();
    SNIFF_ERRORS("after drawslice_frame");
  } 

/* ++++++++++++++++++++++++ draw transparent blockages +++++++++++++++++++++++++ */

//  draw_demo(20,20);
//  draw_demo2(1);
  CLIP_GEOMETRY;
  drawBlockages(mode,DRAW_TRANSPARENT);
  SNIFF_ERRORS("after drawBlokcages");

/* ++++++++++++++++++++++++ draw vector slice files +++++++++++++++++++++++++ */

  if(showvslice==1){
    CLIP_VALS;
    drawvslice_frame();
  }
  SNIFF_ERRORS("after drawvslice");

/* ++++++++++++++++++++++++ draw plot3d files +++++++++++++++++++++++++ */

  if(showplot3d==1){
    CLIP_VALS;
    drawplot3d_frame();
  }
  SNIFF_ERRORS("after drawplot3d");
}