12#ifndef ROOT_TGeoTessellated
13#define ROOT_TGeoTessellated
29 void SetVertices(
int nvert = 0,
int i0 = -1,
int i1 = -1,
int i2 = -1,
int i3 = -1)
83 void CloseShape(
bool check =
true,
bool fixFlipped =
true,
bool verbose =
true);
87 bool AddFacet(
int i1,
int i2,
int i3);
88 bool AddFacet(
int i1,
int i2,
int i3,
int i4);
105 void GetMeshNumbers(
int &nvert,
int &nsegs,
int &npols)
const override;
126 bool CheckClosure(
bool fixFlipped =
true,
bool verbose =
true);
#define ClassDefOverride(name, id)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t points
Generic 3D primitive description class.
void SetVertices(int nvert=0, int i0=-1, int i1=-1, int i2=-1, int i3=-1)
Tessellated::VertexVec_t VertexVec_t
bool IsNeighbour(const TGeoFacet &other, bool &flip) const
Check if a connected neighbour facet has compatible normal.
static int CompactFacet(Vertex_t *vert, int nvertices)
Compact consecutive equal vertices.
int operator[](int ivert) const
TGeoFacet(int i0, int i1, int i2, int i3)
TGeoFacet(int i0, int i1, int i2)
void ResizeCenter(double maxsize)
Resize and center the shape in a box of size maxsize.
const TGeoFacet & GetFacet(int i) const
int DistancetoPrimitive(int, int) override
Computes distance from point (px,py) to the object.
int AddVertex(const Vertex_t &vert)
Add a vertex checking for duplicates, returning the vertex index.
void Sizeof3D() const override
bool FacetCheck(int ifacet) const
Check validity of facet.
const Vertex_t & GetVertex(int i) const
void InspectShape() const override
void Print(Option_t *option="") const override
Prints basic info.
void SetSegsAndPols(TBuffer3D &buff) const override
Fills TBuffer3D structure for segments and polygons.
const TBuffer3D & GetBuffer3D(int reqSections, Bool_t localFrame) const override
Fills a static 3D buffer and returns a reference.
TGeoTessellated(const TGeoTessellated &)=delete
Temporary map used to deduplicate vertices.
void SetPoints(double *points) const override
Fill tessellated points to an array.
TGeoTessellated & operator=(const TGeoTessellated &)=delete
bool IsClosedBody() const
bool CheckClosure(bool fixFlipped=true, bool verbose=true)
Check closure of the solid and check/fix flipped normals.
void SavePrimitive(std::ostream &, Option_t *) override
Save a primitive as a C++ statement(s) on output stream "out".
int GetNmeshVertices() const override
Vertex_t FacetComputeNormal(int ifacet, bool °enerated) const
Compute normal for a given facet.
void CloseShape(bool check=true, bool fixFlipped=true, bool verbose=true)
Close the shape: calculate bounding box and compact vertices.
void GetMeshNumbers(int &nvert, int &nsegs, int &npols) const override
Returns numbers of vertices, segments and polygons composing the shape mesh.
std::vector< TGeoFacet > fFacets
static TGeoTessellated * ImportFromObjFormat(const char *objfile, bool check=false, bool verbose=false)
Reader from .obj format.
TBuffer3D * MakeBuffer3D() const override
Creates a TBuffer3D describing this shape.
void ComputeBBox() override
Compute bounding box.
std::multimap< long, int > fVerticesMap
~TGeoTessellated() override
bool AddFacet(const Vertex_t &pt0, const Vertex_t &pt1, const Vertex_t &pt2)
Adding a triangular facet from vertex positions in absolute coordinates.
void FlipFacets()
Flip all facets.
std::vector< Vertex_t > fVertices
bool fClosedBody
Shape fully defined.
ROOT::Geom::Vertex_t Vertex_t
std::vector< Vertex_t > VertexVec_t