Logo ROOT   6.16/01
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{
23private:
24 std::vector<Double_t> fVertices;
25 std::vector<Double_t> fNormals;
26 std::vector<Int_t> fPolyDesc;
28
30
31public:
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
46 static void SetEnforceTriangles(Bool_t e);
47
48private:
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
#define e(i)
Definition: RSha256.hxx:103
static double p1(double t, double a, double b)
static double p2(double t, double a, double b, double c)
int Int_t
Definition: RtypesCore.h:41
unsigned int UInt_t
Definition: RtypesCore.h:42
bool Bool_t
Definition: RtypesCore.h:59
double Double_t
Definition: RtypesCore.h:55
#define ClassDef(name, id)
Definition: Rtypes.h:324
Generic 3D primitive description class.
Definition: TBuffer3D.h:18
Implements a native ROOT-GL representation of an arbitrary set of polygons.
Definition: TGLFaceSet.h:22
void EnforceTriangles()
Use GLU tesselator to replace all polygons with N > 3 with triangles.
Definition: TGLFaceSet.cxx:176
UInt_t fNbPols
Definition: TGLFaceSet.h:27
static void SetEnforceTriangles(Bool_t e)
Set state of static flag EnforceTriangles.
Definition: TGLFaceSet.cxx:442
std::vector< Int_t > fPolyDesc
Definition: TGLFaceSet.h:26
std::vector< Int_t > & GetPolyDesc()
Definition: TGLFaceSet.h:42
std::vector< Double_t > fNormals
Definition: TGLFaceSet.h:25
std::vector< Double_t > & GetNormals()
Definition: TGLFaceSet.h:41
Int_t CheckPoints(const Int_t *source, Int_t *dest) const
CheckPoints.
Definition: TGLFaceSet.cxx:352
void GLDrawPolys() const
void SetFromMesh(const RootCsg::TBaseMesh *m)
Should only be done on an empty faceset object.
Definition: TGLFaceSet.cxx:134
virtual void DirectDraw(TGLRnrCtx &rnrCtx) const
Debug tracing.
Definition: TGLFaceSet.cxx:312
TGLFaceSet(const TBuffer3D &buffer)
constructor
Definition: TGLFaceSet.cxx:58
void CalculateNormals()
CalculateNormals.
Definition: TGLFaceSet.cxx:396
std::vector< Double_t > fVertices
Definition: TGLFaceSet.h:24
static Bool_t Eq(const Double_t *p1, const Double_t *p2)
test equality
Definition: TGLFaceSet.cxx:385
std::vector< Double_t > & GetVertices()
Definition: TGLFaceSet.h:40
static Bool_t fgEnforceTriangles
Definition: TGLFaceSet.h:29
UInt_t GetNbPols()
Definition: TGLFaceSet.h:43
static Bool_t GetEnforceTriangles()
Get current state of static flag EnforceTriangles.
Definition: TGLFaceSet.cxx:430
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:1040