Ignore:
Timestamp:
Nov 9, 2007, 3:32:25 PM (17 years ago)
Author:
garnier
Message:

r627@mac-90108: laurentgarnier | 2007-11-09 07:57:42 +0100
modif dans les includes directives

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/geant4/visualization/OpenGL/src/G4OpenGLImmediateSceneHandler.cc

    r554 r593  
    2525//
    2626//
    27 // $Id: G4OpenGLImmediateSceneHandler.cc,v 1.24 2006/09/04 12:03:25 allison Exp $
    28 // GEANT4 tag $Name: geant4-08-02-patch-01 $
     27// $Id: G4OpenGLImmediateSceneHandler.cc,v 1.27 2007/04/04 16:50:26 allison Exp $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929//
    3030//
     
    4747#include "G4OpenGLTransform3D.hh"
    4848#include "G4Polyline.hh"
     49#include "G4Polymarker.hh"
     50#include "G4Text.hh"
    4951#include "G4Circle.hh"
    5052#include "G4Square.hh"
    51 
    52 G4OpenGLImmediateSceneHandler::G4OpenGLImmediateSceneHandler (G4VGraphicsSystem& system,
    53                                                 const G4String& name):
    54 G4OpenGLSceneHandler (system, fSceneIdCount++, name)
     53#include "G4Scale.hh"
     54#include "G4Polyhedron.hh"
     55
     56G4OpenGLImmediateSceneHandler::G4OpenGLImmediateSceneHandler
     57(G4VGraphicsSystem& system,const G4String& name):
     58  G4OpenGLSceneHandler (system, fSceneIdCount++, name)
    5559{}
    5660
     
    6266void G4OpenGLImmediateSceneHandler::AddPrimitivePreamble(const G4Visible& visible)
    6367{
     68  if (fpViewer->GetViewParameters().IsPicking()) {
     69    glLoadName(++fPickName);
     70    fPickMap[fPickName] = 0;
     71  }
     72
    6473  const G4Colour& c = GetColour (visible);
    6574  glColor3d (c.GetRed (), c.GetGreen (), c.GetBlue ());
     
    7281}
    7382
     83void G4OpenGLImmediateSceneHandler::AddPrimitive (const G4Polymarker& polymarker)
     84{
     85  AddPrimitivePreamble(polymarker);
     86  G4OpenGLSceneHandler::AddPrimitive(polymarker);
     87}
     88
     89void G4OpenGLImmediateSceneHandler::AddPrimitive (const G4Text& text)
     90{
     91  // Note: colour is still handled in
     92  // G4OpenGLSceneHandler::AddPrimitive(const G4Text&).
     93  AddPrimitivePreamble(text);
     94  G4OpenGLSceneHandler::AddPrimitive(text);
     95}
     96
    7497void G4OpenGLImmediateSceneHandler::AddPrimitive (const G4Circle& circle)
    7598{
     
    84107}
    85108
     109void G4OpenGLImmediateSceneHandler::AddPrimitive (const G4Scale& scale)
     110{
     111  AddPrimitivePreamble(scale);
     112  G4OpenGLSceneHandler::AddPrimitive(scale);
     113}
     114
     115void G4OpenGLImmediateSceneHandler::AddPrimitive (const G4Polyhedron& polyhedron)
     116{
     117  // Note: colour is still handled in
     118  // G4OpenGLSceneHandler::AddPrimitive(const G4Polyhedron&).
     119  AddPrimitivePreamble(polyhedron);
     120  G4OpenGLSceneHandler::AddPrimitive(polyhedron);
     121}
     122
     123void G4OpenGLImmediateSceneHandler::AddPrimitive (const G4NURBS& nurbs)
     124{
     125  // Note: colour is still handled in
     126  // G4OpenGLSceneHandler::AddPrimitive(const G4NURBS&).
     127  AddPrimitivePreamble(nurbs);
     128  G4OpenGLSceneHandler::AddPrimitive(nurbs);
     129}
     130
    86131void G4OpenGLImmediateSceneHandler::BeginPrimitives
    87132(const G4Transform3D& objectTransformation) {
    88   G4VSceneHandler::BeginPrimitives (objectTransformation);
     133  G4OpenGLSceneHandler::BeginPrimitives (objectTransformation);
    89134  glPushMatrix();
    90135  G4OpenGLTransform3D oglt (objectTransformation);
     
    110155  glFlush ();
    111156
    112   G4VSceneHandler::EndPrimitives ();
     157  G4OpenGLSceneHandler::EndPrimitives ();
    113158}
    114159
    115160void G4OpenGLImmediateSceneHandler::BeginPrimitives2D()
    116161{
    117   G4VSceneHandler::BeginPrimitives2D();
     162  G4OpenGLSceneHandler::BeginPrimitives2D();
    118163
    119164  // Push current 3D world matrices and load identity to define screen
     
    122167  glPushMatrix();
    123168  glLoadIdentity();
    124   glOrtho (-1., 1., -1., 1., -DBL_MAX, DBL_MAX);
     169  glOrtho (-1., 1., -1., 1., -G4OPENGL_DBL_MAX, G4OPENGL_DBL_MAX);
    125170  glMatrixMode (GL_MODELVIEW);
    126171  glPushMatrix();
     
    139184  glFlush ();
    140185
    141   G4VSceneHandler::EndPrimitives2D ();
     186  G4OpenGLSceneHandler::EndPrimitives2D ();
    142187}
    143188
     
    151196
    152197void G4OpenGLImmediateSceneHandler::ClearTransientStore () {
     198
    153199  G4VSceneHandler::ClearTransientStore ();
     200
    154201  // Make sure screen corresponds to graphical database...
    155202  if (fpViewer) {
Note: See TracChangeset for help on using the changeset viewer.