Logo ROOT   6.08/07
Reference Guide
TGLFaceSet.h
Go to the documentation of this file.
1 // @(#)root/gl:$Id$
2 // Author: Timur Pocheptsov 03/08/2004
3 // NOTE: This code moved from obsoleted TGLSceneObject.h / .cxx - see these
4 // attic files for previous CVS history
5 
6 /*************************************************************************
7  * Copyright (C) 1995-2006, Rene Brun and Fons Rademakers. *
8  * All rights reserved. *
9  * *
10  * For the licensing terms see $ROOTSYS/LICENSE. *
11  * For the list of contributors see $ROOTSYS/README/CREDITS. *
12  *************************************************************************/
13 
14 #ifndef ROOT_TGLFaceSet
15 #define ROOT_TGLFaceSet
16 
17 #ifndef ROOT_TGLLogicalShape
18 #include "TGLLogicalShape.h"
19 #endif
20 #ifndef ROOT_CsgOps
21 #include "CsgOps.h"
22 #endif
23 
24 ///////////////////////////////////////////////////////////////////////
26 {
27 private:
28  std::vector<Double_t> fVertices;
29  std::vector<Double_t> fNormals;
30  std::vector<Int_t> fPolyDesc;
32 
34 
35 public:
36  TGLFaceSet(const TBuffer3D & buffer);
37 
38  virtual void DirectDraw(TGLRnrCtx & rnrCtx) const;
39 
40  void SetFromMesh(const RootCsg::TBaseMesh *m);
41  void CalculateNormals();
42  void EnforceTriangles();
43 
44  std::vector<Double_t>& GetVertices() { return fVertices; }
45  std::vector<Double_t>& GetNormals() { return fNormals; }
46  std::vector<Int_t>& GetPolyDesc() { return fPolyDesc; }
47  UInt_t GetNbPols() { return fNbPols; }
48 
49  static Bool_t GetEnforceTriangles();
50  static void SetEnforceTriangles(Bool_t e);
51 
52 private:
53  void GLDrawPolys() const;
54  Int_t CheckPoints(const Int_t *source, Int_t *dest) const;
55 
56  static Bool_t Eq(const Double_t *p1, const Double_t *p2);
57 
58  ClassDef(TGLFaceSet,0) // a faceset logical shape
59 };
60 
61 #endif
The TGLRnrCtx class aggregates data for a given redering context as needed by various parts of the RO...
Definition: TGLRnrCtx.h:40
void SetFromMesh(const RootCsg::TBaseMesh *m)
Should only be done on an empty faceset object.
Definition: TGLFaceSet.cxx:134
std::vector< Int_t > & GetPolyDesc()
Definition: TGLFaceSet.h:46
Implements a native ROOT-GL representation of an arbitrary set of polygons.
Definition: TGLFaceSet.h:25
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
#define ClassDef(name, id)
Definition: Rtypes.h:254
Int_t CheckPoints(const Int_t *source, Int_t *dest) const
CheckPoints.
Definition: TGLFaceSet.cxx:352
static double p2(double t, double a, double b, double c)
std::vector< Int_t > fPolyDesc
Definition: TGLFaceSet.h:30
static void SetEnforceTriangles(Bool_t e)
Set state of static flag EnforceTriangles.
Definition: TGLFaceSet.cxx:442
std::vector< Double_t > & GetVertices()
Definition: TGLFaceSet.h:44
static Bool_t GetEnforceTriangles()
Get current state of static flag EnforceTriangles.
Definition: TGLFaceSet.cxx:430
std::vector< Double_t > & GetNormals()
Definition: TGLFaceSet.h:45
unsigned int UInt_t
Definition: RtypesCore.h:42
TMarker * m
Definition: textangle.C:8
Generic 3D primitive description class.
Definition: TBuffer3D.h:19
static Bool_t Eq(const Double_t *p1, const Double_t *p2)
test equality
Definition: TGLFaceSet.cxx:385
static double p1(double t, double a, double b)
Abstract logical shape - a GL &#39;drawable&#39; - base for all shapes - faceset sphere etc.
void GLDrawPolys() const
std::vector< Double_t > fVertices
Definition: TGLFaceSet.h:28
virtual void DirectDraw(TGLRnrCtx &rnrCtx) const
Debug tracing.
Definition: TGLFaceSet.cxx:312
double Double_t
Definition: RtypesCore.h:55
UInt_t GetNbPols()
Definition: TGLFaceSet.h:47
static Bool_t fgEnforceTriangles
Definition: TGLFaceSet.h:33
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
Definition: TRolke.cxx:630
UInt_t fNbPols
Definition: TGLFaceSet.h:31
void EnforceTriangles()
Use GLU tesselator to replace all polygons with N > 3 with triangles.
Definition: TGLFaceSet.cxx:176
void CalculateNormals()
CalculateNormals.
Definition: TGLFaceSet.cxx:396
TGLFaceSet(const TBuffer3D &buffer)
constructor
Definition: TGLFaceSet.cxx:58
#define dest(otri, vertexptr)
Definition: triangle.c:1040
std::vector< Double_t > fNormals
Definition: TGLFaceSet.h:29