Project
Loading...
Searching...
No Matches
o2::base::O2Tessellated Class Reference

#include <O2Tessellated.h>

Inherits TGeoBBox.

Public Types

using Vertex_t = Tessellated::Vertex_t
 

Public Member Functions

 O2Tessellated ()
 
 O2Tessellated (const char *name, int nfacets=0)
 
 O2Tessellated (const char *name, const std::vector< Vertex_t > &vertices)
 
 O2Tessellated (TGeoTessellated const &, bool check=false)
 Construct from TGeoTessellated.
 
 ~O2Tessellated () override
 
void ComputeBBox () override
 Compute bounding box.
 
void CloseShape (bool check=true, bool fixFlipped=true, bool verbose=true)
 Close the shape: calculate bounding box and compact vertices.
 
bool AddFacet (const Vertex_t &pt0, const Vertex_t &pt1, const Vertex_t &pt2)
 Adding a triangular facet from vertex positions in absolute coordinates.
 
bool AddFacet (const Vertex_t &pt0, const Vertex_t &pt1, const Vertex_t &pt2, const Vertex_t &pt3)
 Adding a quadrilateral facet from vertex positions in absolute coordinates.
 
bool AddFacet (int i1, int i2, int i3)
 Adding a triangular facet from indices of vertices.
 
bool AddFacet (int i1, int i2, int i3, int i4)
 Adding a quadrilateral facet from indices of vertices.
 
int AddVertex (const Vertex_t &vert)
 Add a vertex checking for duplicates, returning the vertex index.
 
bool FacetCheck (int ifacet) const
 Check validity of facet.
 
Vertex_t FacetComputeNormal (int ifacet, bool &degenerated) const
 Compute normal for a given facet.
 
int GetNfacets () const
 
int GetNsegments () const
 
int GetNvertices () const
 
bool IsClosedBody () const
 
bool IsDefined () const
 
const TGeoFacet & GetFacet (int i) const
 
const Vertex_tGetVertex (int i) const
 
int DistancetoPrimitive (int, int) override
 
const TBuffer3D & GetBuffer3D (int reqSections, Bool_t localFrame) const override
 Fills a static 3D buffer and returns a reference.
 
void GetMeshNumbers (int &nvert, int &nsegs, int &npols) const override
 Returns numbers of vertices, segments and polygons composing the shape mesh.
 
int GetNmeshVertices () const override
 
void InspectShape () const override
 
TBuffer3D * MakeBuffer3D () const override
 
void Print (Option_t *option="") const override
 Prints basic info.
 
void SavePrimitive (std::ostream &, Option_t *) override
 
void SetPoints (double *points) const override
 Fill tessellated points to an array.
 
void SetPoints (Float_t *points) const override
 Fill tessellated points in float.
 
void SetSegsAndPols (TBuffer3D &buff) const override
 Fills TBuffer3D structure for segments and polygons.
 
void Sizeof3D () const override
 
void ResizeCenter (double maxsize)
 Resize and center the shape in a box of size maxsize.
 
void FlipFacets ()
 Flip all facets.
 
bool CheckClosure (bool fixFlipped=true, bool verbose=true)
 Check closure of the solid and check/fix flipped normals.
 
Double_t DistFromOutside (const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=nullptr) const override
 DistFromOutside.
 
Double_t DistFromInside (const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=nullptr) const override
 DistFromOutside.
 
bool Contains (const Double_t *point) const override
 Contains.
 
Double_t Safety (const Double_t *point, Bool_t in=kTRUE) const override
 Safety.
 
void ComputeNormal (const Double_t *point, const Double_t *dir, Double_t *norm) const override
 ComputeNormal interface.
 
Double_t DistFromInside_Loop (const Double_t *point, const Double_t *dir) const
 trivial (non-BVH) DistFromInside function
 
Double_t DistFromOutside_Loop (const Double_t *point, const Double_t *dir) const
 trivial (non-BVH) DistFromOutside function
 
bool Contains_Loop (const Double_t *point) const
 trivial (non-BVH) Contains
 
Double_t Capacity () const override
 Capacity.
 

Static Public Member Functions

static O2TessellatedImportFromObjFormat (const char *objfile, bool check=false, bool verbose=false)
 Reader from .obj format.
 

Detailed Description

Definition at line 26 of file O2Tessellated.h.

Member Typedef Documentation

◆ Vertex_t

using o2::base::O2Tessellated::Vertex_t = Tessellated::Vertex_t

Definition at line 30 of file O2Tessellated.h.

Constructor & Destructor Documentation

◆ O2Tessellated() [1/4]

o2::base::O2Tessellated::O2Tessellated ( )
inline

Definition at line 57 of file O2Tessellated.h.

◆ O2Tessellated() [2/4]

O2Tessellated::O2Tessellated ( const char name,
int  nfacets = 0 
)

Constructor. In case nfacets is zero, it is user's responsibility to call CloseShape once all faces are defined.

Definition at line 106 of file O2Tessellated.cxx.

◆ O2Tessellated() [3/4]

O2Tessellated::O2Tessellated ( const char name,
const std::vector< Vertex_t > &  vertices 
)

Constructor providing directly the array of vertices. Facets have to be added providing vertex indices rather than coordinates.

Definition at line 117 of file O2Tessellated.cxx.

◆ O2Tessellated() [4/4]

O2Tessellated::O2Tessellated ( TGeoTessellated const &  tsl,
bool  check = false 
)

Construct from TGeoTessellated.

Definition at line 126 of file O2Tessellated.cxx.

◆ ~O2Tessellated()

o2::base::O2Tessellated::~O2Tessellated ( )
inlineoverride

Definition at line 64 of file O2Tessellated.h.

Member Function Documentation

◆ AddFacet() [1/4]

bool O2Tessellated::AddFacet ( const Vertex_t pt0,
const Vertex_t pt1,
const Vertex_t pt2 
)

Adding a triangular facet from vertex positions in absolute coordinates.

Definition at line 188 of file O2Tessellated.cxx.

◆ AddFacet() [2/4]

bool O2Tessellated::AddFacet ( const Vertex_t pt0,
const Vertex_t pt1,
const Vertex_t pt2,
const Vertex_t pt3 
)

Adding a quadrilateral facet from vertex positions in absolute coordinates.

Definition at line 235 of file O2Tessellated.cxx.

◆ AddFacet() [3/4]

bool O2Tessellated::AddFacet ( int  i1,
int  i2,
int  i3 
)

Adding a triangular facet from indices of vertices.

Definition at line 216 of file O2Tessellated.cxx.

◆ AddFacet() [4/4]

bool O2Tessellated::AddFacet ( int  i1,
int  i2,
int  i3,
int  i4 
)

Adding a quadrilateral facet from indices of vertices.

Definition at line 269 of file O2Tessellated.cxx.

◆ AddVertex()

int O2Tessellated::AddVertex ( const Vertex_t vert)

Add a vertex checking for duplicates, returning the vertex index.

Definition at line 148 of file O2Tessellated.cxx.

◆ Capacity()

Double_t O2Tessellated::Capacity ( ) const
override

Capacity.

Definition at line 1059 of file O2Tessellated.cxx.

◆ CheckClosure()

bool O2Tessellated::CheckClosure ( bool  fixFlipped = true,
bool  verbose = true 
)

Check closure of the solid and check/fix flipped normals.

Definition at line 391 of file O2Tessellated.cxx.

◆ CloseShape()

void O2Tessellated::CloseShape ( bool  check = true,
bool  fixFlipped = true,
bool  verbose = true 
)

Close the shape: calculate bounding box and compact vertices.

Definition at line 351 of file O2Tessellated.cxx.

◆ ComputeBBox()

void O2Tessellated::ComputeBBox ( )
override

Compute bounding box.

Definition at line 457 of file O2Tessellated.cxx.

◆ ComputeNormal()

void O2Tessellated::ComputeNormal ( const Double_t *  point,
const Double_t *  dir,
Double_t *  norm 
) const
override

ComputeNormal interface.

Definition at line 1359 of file O2Tessellated.cxx.

◆ Contains()

bool O2Tessellated::Contains ( const Double_t *  point) const
override

Contains.

Definition at line 1142 of file O2Tessellated.cxx.

◆ Contains_Loop()

bool O2Tessellated::Contains_Loop ( const Double_t *  point) const

trivial (non-BVH) Contains

Definition at line 1456 of file O2Tessellated.cxx.

◆ DistancetoPrimitive()

int o2::base::O2Tessellated::DistancetoPrimitive ( int  ,
int   
)
inlineoverride

Definition at line 87 of file O2Tessellated.h.

◆ DistFromInside()

Double_t O2Tessellated::DistFromInside ( const Double_t *  point,
const Double_t *  dir,
Int_t  iact = 1,
Double_t  step = TGeoShape::Big(),
Double_t *  safe = nullptr 
) const
override

DistFromOutside.

Definition at line 993 of file O2Tessellated.cxx.

◆ DistFromInside_Loop()

Double_t O2Tessellated::DistFromInside_Loop ( const Double_t *  point,
const Double_t *  dir 
) const

trivial (non-BVH) DistFromInside function

Definition at line 1394 of file O2Tessellated.cxx.

◆ DistFromOutside()

Double_t O2Tessellated::DistFromOutside ( const Double_t *  point,
const Double_t *  dir,
Int_t  iact = 1,
Double_t  step = TGeoShape::Big(),
Double_t *  safe = nullptr 
) const
override

DistFromOutside.

Definition at line 909 of file O2Tessellated.cxx.

◆ DistFromOutside_Loop()

Double_t O2Tessellated::DistFromOutside_Loop ( const Double_t *  point,
const Double_t *  dir 
) const

trivial (non-BVH) DistFromOutside function

Definition at line 1425 of file O2Tessellated.cxx.

◆ FacetCheck()

bool O2Tessellated::FacetCheck ( int  ifacet) const

Check validity of facet.

Definition at line 321 of file O2Tessellated.cxx.

◆ FacetComputeNormal()

Vertex_t O2Tessellated::FacetComputeNormal ( int  ifacet,
bool &  degenerated 
) const

Compute normal for a given facet.

Definition at line 288 of file O2Tessellated.cxx.

◆ FlipFacets()

void o2::base::O2Tessellated::FlipFacets ( )
inline

Flip all facets.

Definition at line 104 of file O2Tessellated.h.

◆ GetBuffer3D()

const TBuffer3D & O2Tessellated::GetBuffer3D ( int  reqSections,
Bool_t  localFrame 
) const
override

Fills a static 3D buffer and returns a reference.

Definition at line 593 of file O2Tessellated.cxx.

◆ GetFacet()

const TGeoFacet & o2::base::O2Tessellated::GetFacet ( int  i) const
inline

Definition at line 84 of file O2Tessellated.h.

◆ GetMeshNumbers()

void O2Tessellated::GetMeshNumbers ( int nvert,
int nsegs,
int npols 
) const
override

Returns numbers of vertices, segments and polygons composing the shape mesh.

Definition at line 480 of file O2Tessellated.cxx.

◆ GetNfacets()

int o2::base::O2Tessellated::GetNfacets ( ) const
inline

Definition at line 78 of file O2Tessellated.h.

◆ GetNmeshVertices()

int o2::base::O2Tessellated::GetNmeshVertices ( ) const
inlineoverride

Definition at line 90 of file O2Tessellated.h.

◆ GetNsegments()

int o2::base::O2Tessellated::GetNsegments ( ) const
inline

Definition at line 79 of file O2Tessellated.h.

◆ GetNvertices()

int o2::base::O2Tessellated::GetNvertices ( ) const
inline

Definition at line 80 of file O2Tessellated.h.

◆ GetVertex()

const Vertex_t & o2::base::O2Tessellated::GetVertex ( int  i) const
inline

Definition at line 85 of file O2Tessellated.h.

◆ ImportFromObjFormat()

O2Tessellated * O2Tessellated::ImportFromObjFormat ( const char objfile,
bool  check = false,
bool  verbose = false 
)
static

Reader from .obj format.

Reads a single tessellated solid from an .obj file.

Definition at line 624 of file O2Tessellated.cxx.

◆ InspectShape()

void o2::base::O2Tessellated::InspectShape ( ) const
inlineoverride

Definition at line 91 of file O2Tessellated.h.

◆ IsClosedBody()

bool o2::base::O2Tessellated::IsClosedBody ( ) const
inline

Definition at line 81 of file O2Tessellated.h.

◆ IsDefined()

bool o2::base::O2Tessellated::IsDefined ( ) const
inline

Definition at line 82 of file O2Tessellated.h.

◆ MakeBuffer3D()

TBuffer3D * O2Tessellated::MakeBuffer3D ( ) const
override

Creates a TBuffer3D describing this shape. Coordinates are in local reference frame.

Definition at line 491 of file O2Tessellated.cxx.

◆ Print()

void O2Tessellated::Print ( Option_t *  option = "") const
override

Prints basic info.

Definition at line 507 of file O2Tessellated.cxx.

◆ ResizeCenter()

void O2Tessellated::ResizeCenter ( double  maxsize)

Resize and center the shape in a box of size maxsize.

Resize the shape by scaling vertices within maxsize and center to origin.

Definition at line 570 of file O2Tessellated.cxx.

◆ Safety()

Double_t O2Tessellated::Safety ( const Double_t *  point,
Bool_t  in = kTRUE 
) const
override

Safety.

Definition at line 1347 of file O2Tessellated.cxx.

◆ SavePrimitive()

void o2::base::O2Tessellated::SavePrimitive ( std::ostream &  ,
Option_t *   
)
inlineoverride

Definition at line 94 of file O2Tessellated.h.

◆ SetPoints() [1/2]

void O2Tessellated::SetPoints ( double *  points) const
override

Fill tessellated points to an array.

Definition at line 545 of file O2Tessellated.cxx.

◆ SetPoints() [2/2]

void O2Tessellated::SetPoints ( Float_t points) const
override

Fill tessellated points in float.

Definition at line 557 of file O2Tessellated.cxx.

◆ SetSegsAndPols()

void O2Tessellated::SetSegsAndPols ( TBuffer3D &  buff) const
override

Fills TBuffer3D structure for segments and polygons.

Definition at line 516 of file O2Tessellated.cxx.

◆ Sizeof3D()

void o2::base::O2Tessellated::Sizeof3D ( ) const
inlineoverride

Definition at line 98 of file O2Tessellated.h.


The documentation for this class was generated from the following files: