Logo ROOT   6.14/05
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 #include "TGLLogicalShape.h"
18 #include "CsgOps.h"
19 
20 ///////////////////////////////////////////////////////////////////////
22 {
23 private:
24  std::vector<Double_t> fVertices;
25  std::vector<Double_t> fNormals;
26  std::vector<Int_t> fPolyDesc;
28 
30 
31 public:
32  TGLFaceSet(const TBuffer3D & buffer);
33 
34  virtual void DirectDraw(TGLRnrCtx & rnrCtx) const;
35 
36  void SetFromMesh(const RootCsg::TBaseMesh *m);
37  void CalculateNormals();
38  void EnforceTriangles();
39 
40  std::vector<Double_t>& GetVertices() { return fVertices; }
41  std::vector<Double_t>& GetNormals() { return fNormals; }
42  std::vector<Int_t>& GetPolyDesc() { return fPolyDesc; }
43  UInt_t GetNbPols() { return fNbPols; }
44 
45  static Bool_t GetEnforceTriangles();
46  static void SetEnforceTriangles(Bool_t e);
47 
48 private:
49  void GLDrawPolys() const;
50  Int_t CheckPoints(const Int_t *source, Int_t *dest) const;
51 
52  static Bool_t Eq(const Double_t *p1, const Double_t *p2);
53 
54  ClassDef(TGLFaceSet,0) // a faceset logical shape
55 };
56 
57 #endif
The TGLRnrCtx class aggregates data for a given redering context as needed by various parts of the RO...
Definition: TGLRnrCtx.h:40
auto * m
Definition: textangle.C:8
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:42
Implements a native ROOT-GL representation of an arbitrary set of polygons.
Definition: TGLFaceSet.h:21
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
#define ClassDef(name, id)
Definition: Rtypes.h:320
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:26
static void SetEnforceTriangles(Bool_t e)
Set state of static flag EnforceTriangles.
Definition: TGLFaceSet.cxx:442
std::vector< Double_t > & GetVertices()
Definition: TGLFaceSet.h:40
static Bool_t GetEnforceTriangles()
Get current state of static flag EnforceTriangles.
Definition: TGLFaceSet.cxx:430
std::vector< Double_t > & GetNormals()
Definition: TGLFaceSet.h:41
unsigned int UInt_t
Definition: RtypesCore.h:42
Generic 3D primitive description class.
Definition: TBuffer3D.h:17
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:24
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:43
static Bool_t fgEnforceTriangles
Definition: TGLFaceSet.h:29
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:27
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:25