ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
TGLSurfacePainter Class Reference

Implements painting of TH2 with "SURF" option.

Definition at line 30 of file TGLSurfacePainter.h.

Classes

struct  Projection_t
 

Public Member Functions

 TGLSurfacePainter (TH1 *hist, TGLPlotCamera *camera, TGLPlotCoordinates *coord)
 Constructor. More...
 
char * GetPlotInfo (Int_t px, Int_t py)
 Coords for point on surface under cursor. More...
 
Bool_t InitGeometry ()
 Set mesh, normals. More...
 
void StartPan (Int_t px, Int_t py)
 User clicks right mouse button (in a pad). More...
 
void Pan (Int_t px, Int_t py)
 User's moving mouse cursor, with middle mouse button pressed (for pad). More...
 
void AddOption (const TString &stringOption)
 Additional options for surfaces. More...
 
void ProcessEvent (Int_t event, Int_t px, Int_t py)
 Remove all profiles/sections. More...
 
- Public Member Functions inherited from TGLPlotPainter
 TGLPlotPainter (TH1 *hist, TGLPlotCamera *camera, TGLPlotCoordinates *coord, Bool_t xoySelectable, Bool_t xozSelectable, Bool_t yozSelectable)
 
 TGLPlotPainter (TGL5DDataSet *data, TGLPlotCamera *camera, TGLPlotCoordinates *coord)
 TGLPlotPainter's ctor. More...
 
 TGLPlotPainter (TGLPlotCamera *camera)
 TGLPlotPainter's ctor. More...
 
const TGLPlotBoxRefBackBox () const
 
void SetPhysicalShapeColor (const Float_t *rgba)
 
virtual void Paint ()
 Draw lego/surf/whatever you can. More...
 
virtual Bool_t PlotSelected (Int_t px, Int_t py)
 Read color buffer content to find selected object. More...
 
void SetPadColor (const TColor *color)
 Used in a pad. More...
 
virtual void SetFrameColor (const TColor *frameColor)
 Set plot's back box color. More...
 
void InvalidateSelection ()
 Selection must be updated. More...
 
Bool_t CutAxisSelected () const
 
void SetDrawFrontBox (Bool_t b)
 
void SetDrawBackBox (Bool_t b)
 
void SetDrawAxes (Bool_t s)
 
Bool_t GetDrawAxes ()
 
- Public Member Functions inherited from TVirtualGLPainter
virtual ~TVirtualGLPainter ()
 
 ClassDef (TVirtualGLPainter, 0)
 

Private Types

enum  ESurfaceType {
  kSurf, kSurf1, kSurf2, kSurf3,
  kSurf4, kSurf5
}
 

Private Member Functions

void InitGL () const
 Initialize some OpenGL state variables. More...
 
void DeInitGL () const
 Initialize some OpenGL state variables. More...
 
void DrawPlot () const
 Draw surf/surf1/surf2/surf4. More...
 
void SetNormals ()
 One normal per vertex; this normal is average of neighbouring triangles normals. More...
 
void SetSurfaceColor () const
 Set color for surface. More...
 
Bool_t InitGeometryCartesian ()
 Find bin ranges for X and Y axes, axes ranges for X, Y and Z. More...
 
Bool_t InitGeometryPolar ()
 Find bin ranges for X and Y axes, axes ranges for X, Y and Z. More...
 
Bool_t InitGeometryCylindrical ()
 Find bin ranges for X and Y axes, axes ranges for X, Y and Z. More...
 
Bool_t InitGeometrySpherical ()
 Find bin ranges for X and Y axes, axes ranges for X, Y and Z. More...
 
void DrawProjections () const
 Draw projections. More...
 
void DrawSectionXOZ () const
 Draw section X. More...
 
void DrawSectionYOZ () const
 Draw section Y. More...
 
void DrawSectionXOY () const
 Draw section Z. More...
 
void ClampZ (Double_t &zVal) const
 Clamp z value. More...
 
char * WindowPointTo3DPoint (Int_t px, Int_t py) const
 Find 3d coords using mouse cursor coords. More...
 
Bool_t PreparePalette () const
 Generate palette. More...
 
void GenTexMap () const
 Find texture coordinates. More...
 
void DrawContoursProjection () const
 Draw flat textured surface. More...
 
Bool_t Textured () const
 Checks, if surf requires texture. More...
 
Bool_t HasSections () const
 Any section exists. More...
 
Bool_t HasProjections () const
 Any projection exists. More...
 
void DrawPalette () const
 Draw. More...
 
void DrawPaletteAxis () const
 Draw. Palette. Axis. More...
 

Private Attributes

ESurfaceType fType
 
TGL2DArray< TGLVertex3fMesh
 
TGL2DArray< Double_tfTexMap
 
TGL2DArray< std::pair
< TGLVector3, TGLVector3 > > 
fFaceNormals
 
TGL2DArray< TGLVector3fAverageNormals
 
TString fObjectInfo
 
Projection_t fProj
 
std::list< Projection_tfXOZProj
 
std::list< Projection_tfYOZProj
 
std::list< Projection_tfXOYProj
 
TGLLevelPalette fPalette
 
std::vector< Double_tfColorLevels
 
Rgl::Range_t fMinMaxVal
 
Bool_t fSectionPass
 
Bool_t fUpdateTexMap
 

Static Private Attributes

static TRandomfgRandom
 

Additional Inherited Members

- Public Types inherited from TGLPlotPainter
enum  ECutAxisID { kXAxis = 7, kYAxis = 8, kZAxis = 9 }
 
- Protected Types inherited from TGLPlotPainter
enum  ESelectionBase { kHighColorSelectionBase = 7, kTrueColorSelectionBase = 10 }
 
- Protected Member Functions inherited from TGLPlotPainter
const TColorGetPadColor () const
 Get pad color. More...
 
void MoveSection (Int_t px, Int_t py)
 Create dynamic profile using selected plane. More...
 
void DrawSections () const
 Draw sections (if any). More...
 
virtual void ClearBuffers () const
 
void PrintPlot () const
 Generate PS using gl2ps. More...
 
void SaveModelviewMatrix () const
 
void SaveProjectionMatrix () const
 
void RestoreModelviewMatrix () const
 
void RestoreProjectionMatrix () const
 
- Protected Attributes inherited from TGLPlotPainter
const Float_tfPhysicalShapeColor
 
Double_t fPadPhi
 
Double_t fPadTheta
 
TH1fHist
 
TAxisfXAxis
 
TAxisfYAxis
 
TAxisfZAxis
 
TGLPlotCoordinatesfCoord
 
TGLPlotCamerafCamera
 
TGLSelectionBuffer fSelection
 
Bool_t fUpdateSelection
 
Bool_t fSelectionPass
 
Int_t fSelectedPart
 
TPoint fMousePosition
 
Double_t fXOZSectionPos
 
Double_t fYOZSectionPos
 
Double_t fXOYSectionPos
 
TGLPlotBox fBackBox
 
TGLBoxCut fBoxCut
 
std::vector< Double_tfZLevels
 
Bool_t fHighColor
 
Int_t fSelectionBase
 
Bool_t fDrawPalette
 
Bool_t fDrawAxes
 

#include <TGLSurfacePainter.h>

Inheritance diagram for TGLSurfacePainter:
[legend]

Member Enumeration Documentation

Enumerator
kSurf 
kSurf1 
kSurf2 
kSurf3 
kSurf4 
kSurf5 

Definition at line 32 of file TGLSurfacePainter.h.

Constructor & Destructor Documentation

TGLSurfacePainter::TGLSurfacePainter ( TH1 hist,
TGLPlotCamera camera,
TGLPlotCoordinates coord 
)

Constructor.

Definition at line 57 of file TGLSurfacePainter.cxx.

Member Function Documentation

void TGLSurfacePainter::AddOption ( const TString stringOption)
virtual

Additional options for surfaces.

Implements TGLPlotPainter.

Definition at line 159 of file TGLSurfacePainter.cxx.

void TGLSurfacePainter::ClampZ ( Double_t zVal) const
private

Clamp z value.

Definition at line 1066 of file TGLSurfacePainter.cxx.

Referenced by GenTexMap(), InitGeometryCartesian(), and InitGeometryPolar().

void TGLSurfacePainter::DeInitGL ( ) const
privatevirtual

Initialize some OpenGL state variables.

Implements TGLPlotPainter.

Definition at line 249 of file TGLSurfacePainter.cxx.

void TGLSurfacePainter::DrawContoursProjection ( ) const
private

Draw flat textured surface.

Definition at line 1184 of file TGLSurfacePainter.cxx.

Referenced by DrawPlot().

void TGLSurfacePainter::DrawPalette ( ) const
private

Draw.

Palette. Originally, fCamera was never null. It can be a null now because of gl-viewer.

Definition at line 1239 of file TGLSurfacePainter.cxx.

Referenced by DrawPlot().

void TGLSurfacePainter::DrawPaletteAxis ( ) const
privatevirtual

Draw. Palette. Axis.

Reimplemented from TGLPlotPainter.

Definition at line 1257 of file TGLSurfacePainter.cxx.

void TGLSurfacePainter::DrawPlot ( ) const
privatevirtual

Draw surf/surf1/surf2/surf4.

Implements TGLPlotPainter.

Definition at line 330 of file TGLSurfacePainter.cxx.

void TGLSurfacePainter::DrawProjections ( ) const
private

Draw projections.

Definition at line 778 of file TGLSurfacePainter.cxx.

Referenced by DrawPlot().

void TGLSurfacePainter::DrawSectionXOY ( ) const
privatevirtual

Draw section Z.

Implements TGLPlotPainter.

Definition at line 969 of file TGLSurfacePainter.cxx.

Referenced by ProcessEvent().

void TGLSurfacePainter::DrawSectionXOZ ( ) const
privatevirtual

Draw section X.

Implements TGLPlotPainter.

Definition at line 867 of file TGLSurfacePainter.cxx.

Referenced by ProcessEvent().

void TGLSurfacePainter::DrawSectionYOZ ( ) const
privatevirtual

Draw section Y.

Implements TGLPlotPainter.

Definition at line 918 of file TGLSurfacePainter.cxx.

Referenced by ProcessEvent().

void TGLSurfacePainter::GenTexMap ( ) const
private

Find texture coordinates.

Definition at line 1163 of file TGLSurfacePainter.cxx.

Referenced by PreparePalette().

char * TGLSurfacePainter::GetPlotInfo ( Int_t  px,
Int_t  py 
)
virtual

Coords for point on surface under cursor.

Implements TVirtualGLPainter.

Definition at line 68 of file TGLSurfacePainter.cxx.

Bool_t TGLSurfacePainter::HasProjections ( ) const
private

Any projection exists.

Definition at line 1229 of file TGLSurfacePainter.cxx.

Referenced by DrawPlot(), and ProcessEvent().

Bool_t TGLSurfacePainter::HasSections ( ) const
private

Any section exists.

Definition at line 1220 of file TGLSurfacePainter.cxx.

Referenced by DrawPlot(), and ProcessEvent().

Bool_t TGLSurfacePainter::InitGeometry ( )
virtual

Set mesh, normals.

Implements TGLPlotPainter.

Definition at line 82 of file TGLSurfacePainter.cxx.

Bool_t TGLSurfacePainter::InitGeometryCartesian ( )
private

Find bin ranges for X and Y axes, axes ranges for X, Y and Z.

Function returns false, if logarithmic scale for some axis was requested, but we cannot find correct range.

Definition at line 495 of file TGLSurfacePainter.cxx.

Referenced by InitGeometry().

Bool_t TGLSurfacePainter::InitGeometryCylindrical ( )
private

Find bin ranges for X and Y axes, axes ranges for X, Y and Z.

Function returns false, if logarithmic scale for some axis was requested, but we cannot find correct range.

Definition at line 630 of file TGLSurfacePainter.cxx.

Referenced by InitGeometry().

Bool_t TGLSurfacePainter::InitGeometryPolar ( )
private

Find bin ranges for X and Y axes, axes ranges for X, Y and Z.

Function returns false, if logarithmic scale for some axis was requested, but we cannot find correct range.

Definition at line 563 of file TGLSurfacePainter.cxx.

Referenced by InitGeometry().

Bool_t TGLSurfacePainter::InitGeometrySpherical ( )
private

Find bin ranges for X and Y axes, axes ranges for X, Y and Z.

Function returns false, if logarithmic scale for some axis was requested, but we cannot find correct range.

Definition at line 703 of file TGLSurfacePainter.cxx.

Referenced by InitGeometry().

void TGLSurfacePainter::InitGL ( ) const
privatevirtual

Initialize some OpenGL state variables.

Implements TGLPlotPainter.

Definition at line 237 of file TGLSurfacePainter.cxx.

void TGLSurfacePainter::Pan ( Int_t  px,
Int_t  py 
)
virtual

User's moving mouse cursor, with middle mouse button pressed (for pad).

Calculate 3d shift related to 2d mouse movement.

Implements TVirtualGLPainter.

Definition at line 116 of file TGLSurfacePainter.cxx.

Bool_t TGLSurfacePainter::PreparePalette ( ) const
private

Generate palette.

Definition at line 1134 of file TGLSurfacePainter.cxx.

Referenced by DrawPlot().

void TGLSurfacePainter::ProcessEvent ( Int_t  event,
Int_t  px,
Int_t  py 
)
virtual

Remove all profiles/sections.

Implements TGLPlotPainter.

Definition at line 196 of file TGLSurfacePainter.cxx.

void TGLSurfacePainter::SetNormals ( )
private

One normal per vertex; this normal is average of neighbouring triangles normals.

Definition at line 264 of file TGLSurfacePainter.cxx.

Referenced by InitGeometryCartesian(), InitGeometryCylindrical(), InitGeometryPolar(), and InitGeometrySpherical().

void TGLSurfacePainter::SetSurfaceColor ( ) const
private

Set color for surface.

Definition at line 313 of file TGLSurfacePainter.cxx.

Referenced by DrawPlot().

void TGLSurfacePainter::StartPan ( Int_t  px,
Int_t  py 
)
virtual

User clicks right mouse button (in a pad).

Implements TGLPlotPainter.

Definition at line 104 of file TGLSurfacePainter.cxx.

Bool_t TGLSurfacePainter::Textured ( ) const
private

Checks, if surf requires texture.

Definition at line 1203 of file TGLSurfacePainter.cxx.

Referenced by DrawPlot(), InitGeometryCartesian(), InitGeometryCylindrical(), InitGeometryPolar(), and InitGeometrySpherical().

char * TGLSurfacePainter::WindowPointTo3DPoint ( Int_t  px,
Int_t  py 
) const
private

Find 3d coords using mouse cursor coords.

Definition at line 1087 of file TGLSurfacePainter.cxx.

Referenced by GetPlotInfo().

Member Data Documentation

TGL2DArray<TGLVector3> TGLSurfacePainter::fAverageNormals
private

Definition at line 46 of file TGLSurfacePainter.h.

Referenced by DrawPlot(), and SetNormals().

std::vector<Double_t> TGLSurfacePainter::fColorLevels
mutableprivate

Definition at line 63 of file TGLSurfacePainter.h.

TGL2DArray<std::pair<TGLVector3, TGLVector3> > TGLSurfacePainter::fFaceNormals
private

Definition at line 45 of file TGLSurfacePainter.h.

Referenced by SetNormals().

TRandom* TGLSurfacePainter::fgRandom
staticprivate

Definition at line 114 of file TGLSurfacePainter.h.

Referenced by DrawSectionXOY(), DrawSectionXOZ(), and DrawSectionYOZ().

TGL2DArray<TGLVertex3> TGLSurfacePainter::fMesh
private
Rgl::Range_t TGLSurfacePainter::fMinMaxVal
private
TString TGLSurfacePainter::fObjectInfo
mutableprivate

Definition at line 48 of file TGLSurfacePainter.h.

Referenced by WindowPointTo3DPoint().

TGLLevelPalette TGLSurfacePainter::fPalette
mutableprivate

Definition at line 62 of file TGLSurfacePainter.h.

Referenced by DrawPalette(), DrawPlot(), GenTexMap(), and PreparePalette().

Projection_t TGLSurfacePainter::fProj
mutableprivate

Definition at line 56 of file TGLSurfacePainter.h.

Referenced by DrawSectionXOY(), DrawSectionXOZ(), and DrawSectionYOZ().

Bool_t TGLSurfacePainter::fSectionPass
private

Definition at line 66 of file TGLSurfacePainter.h.

Referenced by DrawSectionXOY(), DrawSectionXOZ(), DrawSectionYOZ(), and ProcessEvent().

TGL2DArray<Double_t> TGLSurfacePainter::fTexMap
mutableprivate

Definition at line 44 of file TGLSurfacePainter.h.

Referenced by DrawContoursProjection(), DrawPlot(), and GenTexMap().

ESurfaceType TGLSurfacePainter::fType
mutableprivate
Bool_t TGLSurfacePainter::fUpdateTexMap
mutableprivate
std::list<Projection_t> TGLSurfacePainter::fXOYProj
mutableprivate

Definition at line 60 of file TGLSurfacePainter.h.

Referenced by DrawProjections(), DrawSectionXOY(), HasProjections(), and ProcessEvent().

std::list<Projection_t> TGLSurfacePainter::fXOZProj
mutableprivate

Definition at line 58 of file TGLSurfacePainter.h.

Referenced by DrawProjections(), DrawSectionXOZ(), HasProjections(), and ProcessEvent().

std::list<Projection_t> TGLSurfacePainter::fYOZProj
mutableprivate

Definition at line 59 of file TGLSurfacePainter.h.

Referenced by DrawProjections(), DrawSectionYOZ(), HasProjections(), and ProcessEvent().

Collaboration diagram for TGLSurfacePainter:
[legend]

The documentation for this class was generated from the following files: