PeriDEM 0.3.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
Loading...
Searching...
No Matches
geom::NullGeomObject Class Reference

Defines null (empty) geom object. More...

#include <geomObjects.h>

Inheritance diagram for geom::NullGeomObject:
Collaboration diagram for geom::NullGeomObject:

Public Member Functions

 NullGeomObject (std::string description="")
 Constructor.
 
 NullGeomObject (const NullGeomObject &other)
 Copy constructor.
 
NullGeomObjectoperator= (const NullGeomObject &other)
 Assignment operator.
 
void transform (const util::Point &translation, const double &scale, const double &angle, const util::Point &axis, const util::Point *rotationPoint) override
 Similarity about pivot \(\mathbf p\) (default: old center d_x), then rigid displacement \(\mathbf t\) = translation: \(\mathbf y = \mathbf p + s\,\mathbf R(\mathbf x-\mathbf p) + \mathbf t\). When \(\theta=0\) and \(s=1\), \(\mathbf y = \mathbf x + \mathbf t\) for every point and the center.
 
virtual std::string printStr (int nt, int lvl) const override
 Returns the string containing printable information about the object.
 
void print (int nt, int lvl) const override
 Prints the information about the object.
 
void print () const override
 Prints the information about the object.
 
- Public Member Functions inherited from geom::GeomObject
 GeomObject (std::string name="", std::string description="")
 Constructor.
 
virtual double volume () const
 Computes the volume (area in 2d, length in 1d) of object.
 
virtual util::Point center () const
 Computes the center of object.
 
virtual std::pair< util::Point, util::Pointbox () const
 Computes the bounding box of object.
 
virtual std::pair< util::Point, util::Pointbox (const double &tol) const
 Computes the bounding box of object.
 
virtual double inscribedRadius () const
 Computes the radius of biggest circle/sphere completely within the object.
 
virtual double boundingRadius () const
 Computes the radius of smallest circle/sphere such that object can be fit into it.
 
virtual bool wallContactQuery (const util::Point &x, WallContactHit &hit) const
 Closest-point / signed-gap query for analytical wall contact. Default: unsupported (returns false, clears hit).
 
virtual bool isInside (const util::Point &x) const
 Checks if point is inside this object.
 
virtual bool isOutside (const util::Point &x) const
 Checks if point is outside of this object.
 
virtual bool isNear (const util::Point &x, const double &tol) const
 Checks if point is within given distance of this object.
 
virtual bool isNearBoundary (const util::Point &x, const double &tol, const bool &within) const
 Checks if point is within given distance of this object.
 
virtual bool doesIntersect (const util::Point &x) const
 Checks if point lies exactly on the boundary.
 
virtual bool isInside (const std::pair< util::Point, util::Point > &box) const
 Checks if box is completely inside.
 
virtual bool isOutside (const std::pair< util::Point, util::Point > &box) const
 Checks if box is outside of the object.
 
virtual bool isNear (const std::pair< util::Point, util::Point > &box, const double &tol) const
 Checks if box is within given distance of this object.
 
virtual bool doesIntersect (const std::pair< util::Point, util::Point > &box) const
 Checks if box intersects this object.
 

Additional Inherited Members

- Data Fields inherited from geom::GeomObject
const std::string d_name
 name of object
 
const std::string d_description
 Further description of object.
 
std::vector< std::string > d_tags
 Tags/attributes about the object.
 

Detailed Description

Defines null (empty) geom object.

Definition at line 356 of file geomObjects.h.

Constructor & Destructor Documentation

◆ NullGeomObject() [1/2]

geom::NullGeomObject::NullGeomObject ( std::string  description = "")
inline

Constructor.

Definition at line 361 of file geomObjects.h.

361 : GeomObject("null", description) {
362 };
GeomObject(std::string name="", std::string description="")
Constructor.

◆ NullGeomObject() [2/2]

geom::NullGeomObject::NullGeomObject ( const NullGeomObject other)
inline

Copy constructor.

Parameters
otherObject to copy from

Definition at line 368 of file geomObjects.h.

369 : GeomObject(other.d_name, other.d_description) {
370 d_tags = other.d_tags;
371 }
std::vector< std::string > d_tags
Tags/attributes about the object.

References geom::GeomObject::d_tags.

Member Function Documentation

◆ operator=()

NullGeomObject & geom::NullGeomObject::operator= ( const NullGeomObject other)
inline

Assignment operator.

Parameters
otherObject to copy from
Returns
Reference to this object

Definition at line 378 of file geomObjects.h.

378 {
379 if (this != &other) {
380 // Copy base class members
381 d_tags = other.d_tags;
382 }
383 return *this;
384 }

References geom::GeomObject::d_tags.

◆ print() [1/2]

void geom::NullGeomObject::print ( ) const
inlineoverridevirtual

Prints the information about the object.

Reimplemented from geom::GeomObject.

Definition at line 420 of file geomObjects.h.

420{ print(0, 0); };
void print() const override
Prints the information about the object.

References print().

Referenced by print().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ print() [2/2]

void geom::NullGeomObject::print ( int  nt,
int  lvl 
) const
inlineoverridevirtual

Prints the information about the object.

Parameters
ntNumber of tabs to append before printing
lvlInformation level (higher means more information)

Reimplemented from geom::GeomObject.

Definition at line 413 of file geomObjects.h.

413 {
414 std::cout << printStr(nt, lvl);
415 };
virtual std::string printStr(int nt, int lvl) const override
Returns the string containing printable information about the object.

References printStr().

Here is the call graph for this function:

◆ printStr()

virtual std::string geom::NullGeomObject::printStr ( int  nt,
int  lvl 
) const
inlineoverridevirtual

Returns the string containing printable information about the object.

Parameters
ntNumber of tabs to append before printing
lvlInformation level (higher means more information)
Returns
string String containing printable information about the object

Reimplemented from geom::GeomObject.

Definition at line 399 of file geomObjects.h.

399 {
400 auto tabS = util::io::getTabS(nt);
401 std::ostringstream oss;
402
403 oss << tabS << "------- NullGeomObject --------" << std::endl
404 << std::endl;
405 oss << tabS << "Name of GeomObject = " << d_name << std::endl;
406
407 return oss.str();
408 };
const std::string d_name
name of object
std::string getTabS(int nt)
Returns tab spaces of a given size.
Definition io.h:39

References geom::GeomObject::d_name, and util::io::getTabS().

Referenced by print().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ transform()

void geom::NullGeomObject::transform ( const util::Point translation,
const double &  scale,
const double &  angle,
const util::Point axis,
const util::Point rotationPoint 
)
inlineoverridevirtual

Similarity about pivot \(\mathbf p\) (default: old center d_x), then rigid displacement \(\mathbf t\) = translation: \(\mathbf y = \mathbf p + s\,\mathbf R(\mathbf x-\mathbf p) + \mathbf t\). When \(\theta=0\) and \(s=1\), \(\mathbf y = \mathbf x + \mathbf t\) for every point and the center.

Parameters
translationRigid translation vector \(\mathbf t\) (added after rotate+scale about \(\mathbf p\))
scaleUniform scale factor
angleRotation angle (radians)
axisAxis of rotation
rotationPointIf non-null, use as \(\mathbf p\); if null, use old d_x as pivot.

Reimplemented from geom::GeomObject.

Definition at line 386 of file geomObjects.h.

388 {
389 (void)translation;
390 (void)scale;
391 (void)angle;
392 (void)axis;
393 (void)rotationPoint;
394 }

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