Changeset 929


Ignore:
Timestamp:
Feb 17, 2009, 6:25:18 PM (17 years ago)
Author:
garnier
Message:

juste pour sauver le boulot ....ne compile pas....

Location:
trunk/source/visualization
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/visualization/OpenGL/src/G4OpenGLSceneHandler.cc

    r877 r929  
    367367
    368368  // Draw...
    369   if (sizeType == world) {  // Size specified in world coordinates.
    370 
     369///   if (sizeType == world) {  // Size specified in world coordinates.
     370    printf("G4OpenGLSceneHandler::AddCircleSquare  world\n");
    371371    DrawXYPolygon (shape, size, centre, pVA);
    372372
    373   } else { // Size specified in screen (window) coordinates.
    374 
    375     glRasterPos3d(centre.x(),centre.y(),centre.z());
    376     const GLubyte* marker =
    377       G4OpenGLBitMapStore::GetBitMap(shape, size, filled);
    378     glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
    379     glBitmap(GLsizei(size), GLsizei(size), size/2., size/2., 0., 0., marker);
    380   }
     373//   } else { // Size specified in screen (window) coordinates.
     374//     printf("G4OpenGLSceneHandler::AddCircleSquare  bitmap\n");
     375
     376//     glRasterPos3d(centre.x(),centre.y(),centre.z());
     377//     const GLubyte* marker =
     378//       G4OpenGLBitMapStore::GetBitMap(shape, size, filled);
     379//     glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
     380//     glBitmap(GLsizei(size), GLsizei(size), size/2., size/2., 0., 0., marker);
     381//   }
    381382}
    382383
  • trunk/source/visualization/OpenGL/src/G4OpenGLStoredQtViewer.cc

    r911 r929  
    3232//                                G4OpenGLStoredViewer.
    3333
     34#define G4DEBUG_VIS_OGL
     35
    3436#ifdef G4VIS_BUILD_OPENGLQT_DRIVER
    3537
  • trunk/source/visualization/OpenGL/src/G4OpenGLViewer.cc

    r925 r929  
    813813
    814814  WritePostScript("AAAAAAAAAAAAAAA.ps");
     815
    815816  pixels = grabPixels (inColour, width, height);
    816817
     
    883884void G4OpenGLViewer::WritePostScript(const char *aFile) {
    884885
     886
    885887  if (!fGL2PSAction) return;
     888
     889  // FIXME : TEST
     890  G4VMarker defaultMarker = GetViewParameters().GetDefaultMarker();
     891  defaultMarker.SetWorldSize(defaultMarker.GetScreenSize());
     892  defaultMarker.SetWorldDiameter(defaultMarker.GetScreenDiameter());
     893  defaultMarker.SetWorldRadius(defaultMarker.GetScreenRadius());
    886894
    887895  fGL2PSAction->setFileName("PostScriptViaGL2PS.ps");
    888896  if (fGL2PSAction->enableFileWriting()) {
     897    ShowView();
     898    ProcessView();
    889899    DrawView();
    890900    fGL2PSAction->disableFileWriting();
    891901  }
     902//   defaultMarker.SetScreenSize(defaultMarker.GetWorldSize());
     903//   defaultMarker.SetScreenDiameter(defaultMarker.GetWorldDiameter());
     904//   defaultMarker.SetScreenRadius(defaultMarker.GetWorldRadius());
     905  // FIXME : TEST
     906
     907
     908
    892909  FILE *fFile = fopen(aFile,"w");
    893910  if(!fFile) {
  • trunk/source/visualization/OpenInventor/include/HEPVis/actions/SoGL2PSAction.h

    r928 r929  
    4646  bool enableFileWriting();
    4747  void disableFileWriting();
     48  bool addBitmap(int,int,float=0,float=0,float=0,float=0);
    4849protected:
    4950  virtual void beginTraversal(SoNode*);
  • trunk/source/visualization/OpenInventor/src/G4OpenInventorSceneHandler.cc

    r850 r929  
    230230void G4OpenInventorSceneHandler::AddPrimitive (const G4Polymarker& polymarker)
    231231{
     232  printf("G4OpenInventorSceneHandler::AddPrimitive------ \n");
     233
    232234  AddProperties(polymarker.GetVisAttributes()); // Transformation, colour, etc.
    233235
  • trunk/source/visualization/OpenInventor/src/SoGL2PSAction.cc

    r928 r929  
    108108
    109109//////////////////////////////////////////////////////////////////////////////
     110bool SoGL2PSAction::addBitmap(
     111 int aWidth
     112,int aHeight
     113,float aXorig
     114,float aYorig
     115,float aXmove
     116,float aYmove
     117)
     118/////////////////////////////////////////////////////////////////////////////
     119//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
     120{
     121#ifdef G4DEBUG_VIS_OGL
     122  printf("SoGL2PSAction::addBitmap\n");
     123#endif
     124  if(!fFile) return false;
     125  GLboolean valid;
     126  glGetBooleanv(GL_CURRENT_RASTER_POSITION_VALID,&valid);
     127  if(!valid) return false;
     128  float pos[4];
     129  glGetFloatv(GL_CURRENT_RASTER_POSITION,pos);
     130  int xoff = -(int)(aXmove + aXorig);
     131  int yoff = -(int)(aYmove + aYorig);
     132  int x = (int)(pos[0] + xoff);
     133  int y = (int)(pos[1] + yoff);
     134  // Should clip against viewport area :
     135  GLint vp[4];
     136  glGetIntegerv(GL_VIEWPORT,vp);
     137  GLsizei w = aWidth;
     138  GLsizei h = aHeight;
     139  if(x+w>(vp[0]+vp[2])) w = vp[0]+vp[2]-x;
     140  if(y+h>(vp[1]+vp[3])) h = vp[1]+vp[3]-y;
     141  int s = 3 * w * h;
     142  if(s<=0) return false;
     143  float* image = (float*)::malloc(s * sizeof(float));
     144  if(!image) return false;
     145  glReadPixels(x,y,w,h,GL_RGB,GL_FLOAT,image);
     146  GLint status = gl2psDrawPixels(w,h,xoff,yoff,GL_RGB,GL_FLOAT,image);
     147  ::free(image);
     148  return (status!=GL2PS_SUCCESS ? false : true);
     149}
     150//////////////////////////////////////////////////////////////////////////////
    110151void SoGL2PSAction::beginTraversal(
    111152 SoNode* aNode
     
    131172}
    132173
    133 #endif
     174void SoGL2PSAction::DrawXYPolygon
     175(G4double size,
     176 const G4Point3D& centre,
     177 const G4VisAttributes* pApplicableVisAtts)
     178{
     179  G4int nSides;
     180  G4double startPhi;
     181  nSides = GetNoOfSides(pApplicableVisAtts);
     182  startPhi = 0.;
     183
     184  const G4Vector3D& viewpointDirection =
     185    fpViewer -> GetViewParameters().GetViewpointDirection();
     186  const G4Vector3D& up = fpViewer->GetViewParameters().GetUpVector();
     187  const G4double dPhi = twopi / nSides;
     188  const G4double radius = size / 2.;
     189  G4Vector3D start = radius * (up.cross(viewpointDirection)).unit();
     190  G4double phi;
     191  G4int i;
     192
     193  glBegin (GL_POLYGON);
     194  for (i = 0, phi = startPhi; i < nSides; i++, phi += dPhi) {
     195    G4Vector3D r = start; r.rotate(phi, viewpointDirection);
     196    G4Vector3D p = centre + r;
     197    glVertex3d (p.x(), p.y(), p.z());
     198  }
     199  glEnd ();
     200}
     201
     202#endif
  • trunk/source/visualization/OpenInventor/src/SoMarkerSet.cc

    r529 r929  
    657657//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
    658658{
     659  printf("HEPVis_SoMarkerSet::GLRender\n");
    659660  SoState* state = aAction->getState();
    660661
     
    710711//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
    711712{
     713  printf("drawMarker\n");
    712714  GLsizei w = 0,h = 0;
    713715  GLfloat xorig = 0,yorig = 0;
Note: See TracChangeset for help on using the changeset viewer.