Skip to content
Snippets Groups Projects
Commit 9a095b62 authored by Sergey Linev's avatar Sergey Linev
Browse files

eve7: use RCsg library, eliminate copy in eve7

parent 7e28d6d1
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,6 @@ ROOT_STANDARD_LIBRARY_PACKAGE(ROOTEve
HEADERS
inc/ROOT/REveClient.hxx
inc/ROOT/REveCompound.hxx
inc/ROOT/REveCsgOps.hxx
inc/ROOT/REveDataClasses.hxx
inc/ROOT/REveElement.hxx
inc/ROOT/REveGeoPolyShape.hxx
......@@ -46,7 +45,6 @@ ROOT_STANDARD_LIBRARY_PACKAGE(ROOTEve
glu/tess.c
glu/tessmono.c
src/REveCompound.cxx
src/REveCsgOps.cxx
src/REveDataClasses.cxx
src/REveElement.cxx
src/REveGeoPolyShape.cxx
......@@ -83,7 +81,8 @@ ROOT_STANDARD_LIBRARY_PACKAGE(ROOTEve
Geom
Physics
EG
TreePlayer
TreePlayer
RCsg
ROOTWebDisplay
)
......
// @(#)root/gl:$Id$
// Author: Timur Pocheptsov 01/04/2005
#ifndef ROOT7_REveCsgOps
#define ROOT7_REveCsgOps
#include "Rtypes.h"
class TBuffer3D;
namespace ROOT {
namespace Experimental {
namespace EveCsg {
class TBaseMesh {
public:
virtual ~TBaseMesh() {}
virtual Int_t NumberOfPolys() const = 0;
virtual Int_t NumberOfVertices() const = 0;
virtual Int_t SizeOfPoly(Int_t polyIndex) const = 0;
virtual const Double_t *GetVertex(Int_t vertNum) const = 0;
virtual Int_t GetVertexIndex(Int_t polyNum, Int_t vertNum) const = 0;
};
TBaseMesh *ConvertToMesh(const TBuffer3D &buff);
TBaseMesh *BuildUnion(const TBaseMesh *leftOperand, const TBaseMesh *rightOperand);
TBaseMesh *BuildIntersection(const TBaseMesh *leftOperand, const TBaseMesh *rightOperand);
TBaseMesh *BuildDifference(const TBaseMesh *leftOperand, const TBaseMesh *rightOperand);
} // namespace EveCsg
} // namespace Experimental
} // namespace ROOT
#endif
This diff is collapsed.
......@@ -16,12 +16,12 @@
#include <ROOT/REveGeoPolyShape.hxx>
#include <ROOT/REveGeoShape.hxx>
#include <ROOT/REveUtil.hxx>
#include <ROOT/REveCsgOps.hxx>
#include <ROOT/REveGluTess.hxx>
#include <ROOT/REveRenderData.hxx>
#include "TBuffer3D.h"
#include "TBuffer3DTypes.h"
#include "CsgOps.h"
#include "TGeoBoolNode.h"
#include "TGeoCompositeShape.h"
......@@ -48,11 +48,11 @@ Bool_t REveGeoPolyShape::GetAutoCalculateNormals() { return fgAutoCalcul
////////////////////////////////////////////////////////////////////////
/// Function produces mesh for provided shape, applying matrix to the result
std::unique_ptr<EveCsg::TBaseMesh> MakeGeoMesh(TGeoMatrix *matr, TGeoShape *shape)
std::unique_ptr<RootCsg::TBaseMesh> MakeGeoMesh(TGeoMatrix *matr, TGeoShape *shape)
{
TGeoCompositeShape *comp = dynamic_cast<TGeoCompositeShape *> (shape);
std::unique_ptr<EveCsg::TBaseMesh> res;
std::unique_ptr<RootCsg::TBaseMesh> res;
if (!comp) {
std::unique_ptr<TBuffer3D> b3d(shape->MakeBuffer3D());
......@@ -68,7 +68,7 @@ std::unique_ptr<EveCsg::TBaseMesh> MakeGeoMesh(TGeoMatrix *matr, TGeoShape *shap
}
}
res.reset(EveCsg::ConvertToMesh(*b3d.get()));
res.reset(RootCsg::ConvertToMesh(*b3d.get()));
} else {
auto node = comp->GetBoolNode();
......@@ -81,9 +81,9 @@ std::unique_ptr<EveCsg::TBaseMesh> MakeGeoMesh(TGeoMatrix *matr, TGeoShape *shap
mright.Multiply(node->GetRightMatrix());
auto right = MakeGeoMesh(&mright, node->GetRightShape());
if (node->IsA() == TGeoUnion::Class()) res.reset(EveCsg::BuildUnion(left.get(), right.get()));
if (node->IsA() == TGeoIntersection::Class()) res.reset(EveCsg::BuildIntersection(left.get(), right.get()));
if (node->IsA() == TGeoSubtraction::Class()) res.reset(EveCsg::BuildDifference(left.get(), right.get()));
if (node->IsA() == TGeoUnion::Class()) res.reset(RootCsg::BuildUnion(left.get(), right.get()));
if (node->IsA() == TGeoIntersection::Class()) res.reset(RootCsg::BuildIntersection(left.get(), right.get()));
if (node->IsA() == TGeoSubtraction::Class()) res.reset(RootCsg::BuildDifference(left.get(), right.get()));
}
return res;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment