Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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#include <vector>
20
21///////////////////////////////////////////////////////////////////////
23{
24private:
25 std::vector<Double_t> fVertices;
26 std::vector<Double_t> fNormals;
27 std::vector<Int_t> fPolyDesc;
29
31
32public:
33 TGLFaceSet(const TBuffer3D & buffer);
34
35 virtual void DirectDraw(TGLRnrCtx & rnrCtx) const;
36
37 void SetFromMesh(const RootCsg::TBaseMesh *m);
38 void CalculateNormals();
39 void EnforceTriangles();
40
41 std::vector<Double_t>& GetVertices() { return fVertices; }
42 std::vector<Double_t>& GetNormals() { return fNormals; }
43 std::vector<Int_t>& GetPolyDesc() { return fPolyDesc; }
44 UInt_t GetNbPols() { return fNbPols; }
45
47 static void SetEnforceTriangles(Bool_t e);
48
49private:
50 void GLDrawPolys() const;
51 Int_t CheckPoints(const Int_t *source, Int_t *dest) const;
52
53 static Bool_t Eq(const Double_t *p1, const Double_t *p2);
54
55 ClassDef(TGLFaceSet,0) // a faceset logical shape
56};
57
58#endif
#define e(i)
Definition RSha256.hxx:103
bool Bool_t
Definition RtypesCore.h:63
double Double_t
Definition RtypesCore.h:59
#define ClassDef(name, id)
Definition Rtypes.h:325
Generic 3D primitive description class.
Definition TBuffer3D.h:18
Implements a native ROOT-GL representation of an arbitrary set of polygons.
Definition TGLFaceSet.h:23
void EnforceTriangles()
Use GLU tesselator to replace all polygons with N > 3 with triangles.
UInt_t fNbPols
Definition TGLFaceSet.h:28
static void SetEnforceTriangles(Bool_t e)
Set state of static flag EnforceTriangles.
std::vector< Int_t > fPolyDesc
Definition TGLFaceSet.h:27
std::vector< Int_t > & GetPolyDesc()
Definition TGLFaceSet.h:43
std::vector< Double_t > fNormals
Definition TGLFaceSet.h:26
std::vector< Double_t > & GetNormals()
Definition TGLFaceSet.h:42
Int_t CheckPoints(const Int_t *source, Int_t *dest) const
CheckPoints.
void GLDrawPolys() const
void SetFromMesh(const RootCsg::TBaseMesh *m)
Should only be done on an empty faceset object.
virtual void DirectDraw(TGLRnrCtx &rnrCtx) const
Debug tracing.
void CalculateNormals()
CalculateNormals.
std::vector< Double_t > fVertices
Definition TGLFaceSet.h:25
static Bool_t Eq(const Double_t *p1, const Double_t *p2)
test equality
std::vector< Double_t > & GetVertices()
Definition TGLFaceSet.h:41
static Bool_t fgEnforceTriangles
Definition TGLFaceSet.h:30
UInt_t GetNbPols()
Definition TGLFaceSet.h:44
static Bool_t GetEnforceTriangles()
Get current state of static flag EnforceTriangles.
Abstract logical shape - a GL 'drawable' - base for all shapes - faceset sphere etc.
The TGLRnrCtx class aggregates data for a given redering context as needed by various parts of the RO...
Definition TGLRnrCtx.h:41
auto * m
Definition textangle.C:8
#define dest(otri, vertexptr)
Definition triangle.c:1041