// QuadSet
#pragma link C++ class Reve::Quad+;
+#pragma link C++ class Reve::OldQuadSet+;
#pragma link C++ class Reve::QuadSet+;
// BoxSet
//================================
// ReveGLRenderers
-#pragma link C++ class Reve::QuadSetGL+;
+#pragma link C++ class Reve::OldQuadSetGL+;
#pragma link C++ class Reve::BoxSetGL+;
#pragma link C++ class Reve::TriangleSetGL;
}
/**************************************************************************/
-// QuadSet
+// OldQuadSet
/**************************************************************************/
-ClassImp(Reve::QuadSet)
+ClassImp(Reve::OldQuadSet)
-QuadSet::QuadSet(const Text_t* n, const Text_t* t) :
+OldQuadSet::OldQuadSet(const Text_t* n, const Text_t* t) :
TNamed(n, t),
fQuads(),
fTrans(false)
{}
-void QuadSet::Test(Int_t nquads)
+void OldQuadSet::Test(Int_t nquads)
{
TRandom rnd(0);
fQuads.resize(nquads);
}
}
-void QuadSet::Paint(Option_t* )
+void OldQuadSet::Paint(Option_t* )
{
TBuffer3D buffer(TBuffer3DTypes::kGeneric);
// We fill kCore on first pass and try with viewer
Int_t reqSections = gPad->GetViewer3D()->AddObject(buffer);
if (reqSections == TBuffer3D::kNone) {
- // printf("QuadSet::Paint viewer was happy with Core buff3d.\n");
+ // printf("OldQuadSet::Paint viewer was happy with Core buff3d.\n");
return;
}
/**************************************************************************/
-void QuadSet::ComputeBBox()
+void OldQuadSet::ComputeBBox()
{
if(fQuads.empty()) {
-#if ROOT_VERSION_CODE <= ROOT_VERSION(5,11,2)
- bbox_zero();
-#else
BBoxZero();
-#endif
return;
}
-#if ROOT_VERSION_CODE <= ROOT_VERSION(5,11,2)
- bbox_init();
-#else
BBoxInit();
-#endif
for(std::vector<Quad>::iterator q=fQuads.begin(); q!=fQuads.end(); ++q) {
Float_t* p = q->vertices;
for(int i=0; i<4; ++i, p+=3)
-#if ROOT_VERSION_CODE <= ROOT_VERSION(5,11,2)
- bbox_check_point(p);
-#else
BBoxCheckPoint(p);
-#endif
}
// printf("%s BBox is x(%f,%f), y(%f,%f), z(%f,%f)\n", GetName(),
#include <TAtt3D.h>
#include <TAttBBox.h>
+#include <Reve/RenderElement.h>
+#include <Reve/Reve.h>
+#include "ZTrans.h"
+
#include <vector>
class TRandom;
ClassDef(Quad, 1);
};
-/**************************************************************************/
-
-class QuadSet : public TNamed, public TAtt3D, public TAttBBox
+class OldQuadSet : public TNamed, public TAtt3D, public TAttBBox
{
- friend class QuadSetGL;
+ friend class OldQuadSetGL;
protected:
std::vector<Quad> fQuads;
Bool_t fTrans;
public:
- QuadSet(const Text_t* n="QuadSet", const Text_t* t="");
- virtual ~QuadSet() {}
+ OldQuadSet(const Text_t* n="QuadSet", const Text_t* t="");
+ virtual ~OldQuadSet() {}
Bool_t GetTrans() const { return fTrans; }
void SetTrans(Bool_t t) { fTrans = t; }
+ std::vector<Reve::Quad>& Quads() { return fQuads; }
+
+ void Test(Int_t nquads);
+
+ virtual void ComputeBBox();
+
+ virtual void Paint(Option_t* option = "");
+
+ ClassDef(OldQuadSet, 1);
+};
+
+/**************************************************************************/
+// To become new implementation of QuadSet ... not finished yet.
+/**************************************************************************/
+
+class QuadSet : public RenderElement,
+ public TNamed,
+ public TAtt3D,
+ public TAttBBox
+{
+ friend class QuadSetGL;
+
+public:
+ enum QuadType_e
+ { QT_FreeQuad,
+ QT_AxisAligned,
+ QT_AxisAlignedFixedZ,
+ QT_AxisAlignedFixedDim,
+ QT_AxisAlignedFixedDimZ
+ };
+
+protected:
+ struct QuadBase {
+ UChar_t fColor[4];
+ };
+
+ struct FreeQuad : public QuadBase {
+ Float_t fVertices[12];
+ };
+
+ struct AAFixDimZQuad : public QuadBase {
+ Float_t fX, fY;
+ };
+
+ struct AAFixDimQuad : public AAFixDimZQuad {
+ Float_t fZ;
+ };
+
+ struct AAFixZQuad : public AAFixDimZQuad {
+ Float_t fW, fH;
+ };
+
+ struct AAQuad : public AAFixDimQuad {
+ Float_t fW, fH;
+ };
+
+protected:
+ QuadType_e fQuadType;
+ Int_t fSizeOf;
+ Int_t fReserveStep;
+ Int_t fLastEntry;
+ Int_t fNumReserved;
+
+ // Missing:
+ // * some actual container
+ // * RGBAPalette
+ // * user specifies a value instead of a color
+
+ Color_t fDefaultColor;
+ Float_t fDefWidth;
+ Float_t fDefHeight;
+ Float_t fDefZ;
+
+ ZTrans fHMTrans;
+
+public:
+ QuadSet(const Text_t* n="QuadSet", const Text_t* t="");
+ virtual ~QuadSet() {}
+
+ ZTrans& RefHMTrans() { return fHMTrans; }
+ void SetTransMatrix(Double_t* carr) { fHMTrans.SetFrom(carr); }
+ void SetTransMatrix(const TGeoMatrix& mat) { fHMTrans.SetFrom(mat); }
+
+ /*
void Test(Int_t nquads);
virtual void ComputeBBox();
virtual void Paint(Option_t* option = "");
+ */
ClassDef(QuadSet, 1);
};
using namespace Reve;
//______________________________________________________________________
-// QuadSetGL
+// OldQuadSetGL
//
-ClassImp(QuadSetGL)
+ClassImp(OldQuadSetGL)
/**************************************************************************/
-QuadSetGL::QuadSetGL() : TGLObject()
+OldQuadSetGL::OldQuadSetGL() : TGLObject()
{
// fCached = false; // Disable DL.
}
-QuadSetGL::~QuadSetGL()
+OldQuadSetGL::~OldQuadSetGL()
{}
/**************************************************************************/
-Bool_t QuadSetGL::SetModel(TObject* obj)
+Bool_t OldQuadSetGL::SetModel(TObject* obj)
{
-#if ROOT_VERSION_CODE <= ROOT_VERSION(5,11,2)
- return set_model(obj, "Reve::QuadSet");
-#elif ROOT_VERSION_CODE <= ROOT_VERSION(5,13,0)
- return SetModelCheckClass(obj, "Reve::QuadSet");
-#else
- return SetModelCheckClass(obj, Reve::QuadSet::Class());
-#endif
+ return SetModelCheckClass(obj, Reve::OldQuadSet::Class());
}
-void QuadSetGL::SetBBox()
+void OldQuadSetGL::SetBBox()
{
-#if ROOT_VERSION_CODE <= ROOT_VERSION(5,11,2)
- set_axis_aligned_bbox(((QuadSet*)fExternalObj)->AssertBBox());
-#else
- SetAxisAlignedBBox(((QuadSet*)fExternalObj)->AssertBBox());
-#endif
+ SetAxisAlignedBBox(((OldQuadSet*)fExternalObj)->AssertBBox());
}
/**************************************************************************/
-void QuadSetGL::DirectDraw(const TGLDrawFlags & ) const
+void OldQuadSetGL::DirectDraw(const TGLDrawFlags & ) const
{
- // printf("QuadSetGLRenderer::DirectDraw Style %d, LOD %d\n", flags.Style(), flags.LOD());
+ // printf("OldQuadSetGLRenderer::DirectDraw Style %d, LOD %d\n", flags.Style(), flags.LOD());
- QuadSet& Q = * (QuadSet*) fExternalObj;
+ OldQuadSet& Q = * (OldQuadSet*) fExternalObj;
glPushAttrib(GL_ENABLE_BIT | GL_POLYGON_BIT);
namespace Reve {
-class QuadSetGL : public TGLObject
+class OldQuadSetGL : public TGLObject
{
protected:
virtual void DirectDraw(const TGLDrawFlags & flags) const;
public:
- QuadSetGL();
- virtual ~QuadSetGL();
+ OldQuadSetGL();
+ virtual ~OldQuadSetGL();
virtual Bool_t SetModel(TObject* obj);
virtual void SetBBox();
- ClassDef(QuadSetGL, 0);
+ ClassDef(OldQuadSetGL, 0);
};
}