ivutils
Loading...
Searching...
No Matches
Box Class Reference

orthogonal box, see documentation to Box_N More...

#include <region_3.h>

Inheritance diagram for Box:
Collaboration diagram for Box:

Public Member Functions

virtual int GetFlags () const override
 Returns a set of bit flags specifying which functions are implemented for this region (see RegFlags).
 
virtual vec_type Volume () const override
 Returns volume of the region. '-1' means that function is not implemented.
 
virtual int TestLine (const vector_t &p, const vector_t &dir, vec_type *frac, vector_t *surfp=NULL, vector_t *surfn=NULL, vec_type epsilon=0) const override
 Records the fractions frac1 and frac2 of the line (p,dir) corresponding to the intersections surfpi=p+fraci*dir, surfni - coords of intersection and corresponding outer normal.
 
template<class contour_t >
vec_type TestContour (const contour_t &cnt, VecContour< 3 > *subcont=NULL, vector_t *subcenter=NULL) const
 Returns the area fraction of the contour part that is inside the region and subcontour which is inside the region (if pointer is not NULL) and the center of the subcontour (if pointer is not NULL)
 
virtual RegDumper< 3 > * CreateDumper () const override
 return pointer on object RegDumper, which has function Dump drawing the region
 
virtual Region_3Clone (const vector_t &shift1=vector_t()) const override
 
- Public Member Functions inherited from Box_N< 3 >
void shift (const vector_t &shiftv)
 Shift by a specified vector.
 
void init (const vector_t &sp1, const vector_t &sp2)
 sp1, sp2 are opposite vertices of the box
 
point_it points_begin () const
 returns begin iterator point_it at vertex of the box with minimal x, y and z coordinates
 
point_it points_end () const
 returns end iterator point_it at vertex of the box
 
Box_Noperator&= (const Box_N &other)
 this box becomes an intersection of itself with other box
 
bool valid () const
 
bool TestBox (const Box_N &other) const
 
virtual vec_type SurfProject (const vector_t &p, vector_t *surfp=nullptr, vector_t *surfn=nullptr) const override
 finds the point on the region surface closest to the given one p returns distance to this point (positive is P outside and negative is P inside region), surfp – projection, surfn – norm vector at surfp

 
- Public Member Functions inherited from Region< N >
template<class contour_t >
vec_type TestContour (const contour_t &cnt, VecContour< N > *subcont=nullptr, vector_t *subcenter=nullptr) const
 Returns the area fraction of the contour part that is inside the region, subcontour which is inside the region (if pointer is not nullptr) and the center of the subcontour (if pointer is not nullptr)
 
virtual vec_type TestPtrContour (const PtrContour< N > &cnt, VecContour< N > *subcont=nullptr, vector_t *subcenter=nullptr) const
 virtual version of TestContour for particular PtrContour
 
virtual vector_t GetCenter () const
 Returns the center of the region.
 
virtual vec_type GetInsideEdgePart (const vector_t &p1, const vector_t &p2) const
 Returns a fraction of the edge [0-1] that belongs to the region.
 
virtual vec_type TestEdge (const vector_t &p1, const vector_t &p2, vector_t *surfp=nullptr, vector_t *surfn=nullptr) const
 Returns a fraction of the edge from the first point till the intersection with the surface of the region.
 
virtual vec_type TestRay (const vector_t &p1, const vector_t &dir, vector_t *surfp=nullptr, vector_t *surfn=nullptr, vec_type epsilon=0) const
 Returns the fraction of the ray corresponding to the nearest intersection in positive direction frac<0 means no intersection in positive direction intersections with frac<=epsilon are ignored.
 
virtual size_t GetElementarySubRegions (std::vector< int > *flags=nullptr, std::vector< Region * > *regs=nullptr) const
 For composite regions returns the number of elementary subregions, otherwise returns 0.
 

Additional Inherited Members

- Public Types inherited from Region< N >
typedef unknown_cat category
 Category of the region to determine the correct template behaviour for various algorithms (see Body categories categories).
 

Detailed Description

orthogonal box, see documentation to Box_N

Member Function Documentation

◆ Clone()

virtual Region_3 * Box::Clone ( const vector_t shift = vector_t()) const
inlineoverridevirtual
Returns
a copy of itself optionally shifted in space with the shift vector

Reimplemented from Box_N< 3 >.

◆ GetFlags()

virtual int Box::GetFlags ( ) const
inlineoverridevirtual

Returns a set of bit flags specifying which functions are implemented for this region (see RegFlags).

Returns
HAS_TESTPOINT|HAS_TESTLINE|HAS_TESTCONTOUR|HAS_CLONE|HAS_VOLUME

Reimplemented from Box_N< 3 >.

◆ TestLine()

virtual int Box::TestLine ( const vector_t p,
const vector_t dir,
vec_type *  frac,
vector_t surfp = NULL,
vector_t surfn = NULL,
vec_type  epsilon = 0 
) const
overridevirtual

Records the fractions frac1 and frac2 of the line (p,dir) corresponding to the intersections surfpi=p+fraci*dir, surfni - coords of intersection and corresponding outer normal.

Intersections with frac<=epsilon are ignored. Returns the number of intersections: 0, 1 (touching or intersection of infinite region) or 2 because region is convex.

Reimplemented from Region< N >.


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