sofa::component::topology::RegularGridTopology Class Reference

#include <RegularGridTopology.h>

Inheritance diagram for sofa::component::topology::RegularGridTopology:

Inheritance graph
[legend]
Collaboration diagram for sofa::component::topology::RegularGridTopology:

Collaboration graph
[legend]

Public Member Functions

 RegularGridTopology (int nx, int ny, int nz)
 RegularGridTopology ()
virtual void reinit ()
 Update method called when variables used in precomputation are modified.
void parse (core::objectmodel::BaseObjectDescription *arg)
 Parse the given description to assign values to this object's fields and potentially other parameters.
void setP0 (const Vector3 &val)
void setDx (const Vector3 &val)
void setDy (const Vector3 &val)
void setDz (const Vector3 &val)
void setPos (SReal xmin, SReal xmax, SReal ymin, SReal ymax, SReal zmin, SReal zmax)
const Vector3 & getP0 () const
const Vector3 & getDx () const
const Vector3 & getDy () const
const Vector3 & getDz () const
unsigned getIndex (int i, int j, int k) const
 one-dimensional index of a grid point
Vector3 getPoint (int i) const
Vector3 getPoint (int x, int y, int z) const
bool hasPos () const
double getPX (int i) const
double getPY (int i) const
double getPZ (int i) const
unsigned getCubeIndex (int i, int j, int k) const
 one-dimensional index of a grid cube
Vector3 getCubeCoordinate (int i) const
 from the one-dimensional index of a grid cube, give its three-dimensional indices
Vector3 getMin () const
Vector3 getMax () const
virtual int findCube (const Vector3 &pos)
 return the cube containing the given point (or -1 if not found).
int findHexa (const Vector3 &pos)
virtual int findNearestCube (const Vector3 &pos)
 return the nearest cube (or -1 if not found).
int findNearestHexa (const Vector3 &pos)
virtual int findCube (const Vector3 &pos, SReal &fx, SReal &fy, SReal &fz)
 return the cube containing the given point (or -1 if not found), as well as deplacements from its first corner in terms of dx, dy, dz (i.e.
int findHexa (const Vector3 &pos, SReal &fx, SReal &fy, SReal &fz)
virtual int findNearestCube (const Vector3 &pos, SReal &fx, SReal &fy, SReal &fz)
 return the cube containing the given point (or -1 if not found), as well as deplacements from its first corner in terms of dx, dy, dz (i.e.
int findNearestHexa (const Vector3 &pos, SReal &fx, SReal &fy, SReal &fz)

Protected Attributes

Data< Vector3 > min
Data< Vector3 > max
Data< Vector3 > p0
 Position of point 0.
Vector3 dx
 Distance between points in the grid. Must be perpendicular to each other.
Vector3 dy
Vector3 dz
SReal inv_dx2
SReal inv_dy2
SReal inv_dz2

Detailed Description

Definition at line 43 of file RegularGridTopology.h.


Constructor & Destructor Documentation

sofa::component::topology::RegularGridTopology::RegularGridTopology ( int  nx,
int  ny,
int  nz 
)

Definition at line 76 of file RegularGridTopology.cpp.

sofa::component::topology::RegularGridTopology::RegularGridTopology (  ) 

Definition at line 84 of file RegularGridTopology.cpp.


Member Function Documentation

int sofa::component::topology::RegularGridTopology::findCube ( const Vector3 &  pos,
SReal &  fx,
SReal &  fy,
SReal &  fz 
) [virtual]

return the cube containing the given point (or -1 if not found), as well as deplacements from its first corner in terms of dx, dy, dz (i.e.

return the cube containing the given point (or -1 if not found), as well as deplacements from its first corner in terms of dx, dy, dz (i.e.

barycentric coordinates).

Definition at line 173 of file RegularGridTopology.cpp.

References sofa::component::topology::GridTopology::cube(), dx, dy, dz, sofa::core::objectmodel::Data< T >::getValue(), inv_dx2, inv_dy2, inv_dz2, sofa::component::topology::GridTopology::n, and p0.

int sofa::component::topology::RegularGridTopology::findCube ( const Vector3 &  pos  )  [virtual]

int sofa::component::topology::RegularGridTopology::findHexa ( const Vector3 &  pos,
SReal &  fx,
SReal &  fy,
SReal &  fz 
) [inline]

Definition at line 97 of file RegularGridTopology.h.

References findCube().

int sofa::component::topology::RegularGridTopology::findHexa ( const Vector3 &  pos  )  [inline]

Definition at line 88 of file RegularGridTopology.h.

References findCube().

int sofa::component::topology::RegularGridTopology::findNearestCube ( const Vector3 &  pos,
SReal &  fx,
SReal &  fy,
SReal &  fz 
) [virtual]

return the cube containing the given point (or -1 if not found), as well as deplacements from its first corner in terms of dx, dy, dz (i.e.

return the cube containing the given point (or -1 if not found), as well as deplacements from its first corner in terms of dx, dy, dz (i.e.

barycentric coordinates).

Definition at line 200 of file RegularGridTopology.cpp.

References sofa::component::topology::GridTopology::cube(), dx, dy, dz, sofa::core::objectmodel::Data< T >::getValue(), inv_dx2, inv_dy2, inv_dz2, sofa::component::topology::GridTopology::n, and p0.

int sofa::component::topology::RegularGridTopology::findNearestCube ( const Vector3 &  pos  )  [virtual]

int sofa::component::topology::RegularGridTopology::findNearestHexa ( const Vector3 &  pos,
SReal &  fx,
SReal &  fy,
SReal &  fz 
) [inline]

Definition at line 102 of file RegularGridTopology.h.

References findNearestCube().

int sofa::component::topology::RegularGridTopology::findNearestHexa ( const Vector3 &  pos  )  [inline]

Definition at line 92 of file RegularGridTopology.h.

References findNearestCube().

Vector3 sofa::component::topology::RegularGridTopology::getCubeCoordinate ( int  i  )  const

from the one-dimensional index of a grid cube, give its three-dimensional indices

Definition at line 225 of file RegularGridTopology.cpp.

References sofa::component::topology::GridTopology::n.

Referenced by sofa::component::topology::SparseGridTopology::findneighboorCubes().

unsigned sofa::component::topology::RegularGridTopology::getCubeIndex ( int  i,
int  j,
int  k 
) const

one-dimensional index of a grid cube

Definition at line 220 of file RegularGridTopology.cpp.

References sofa::component::topology::GridTopology::n.

Referenced by sofa::component::topology::SparseGridTopology::findneighboorCubes().

const Vector3& sofa::component::topology::RegularGridTopology::getDx (  )  const [inline]

const Vector3& sofa::component::topology::RegularGridTopology::getDy (  )  const [inline]

const Vector3& sofa::component::topology::RegularGridTopology::getDz (  )  const [inline]

unsigned sofa::component::topology::RegularGridTopology::getIndex ( int  i,
int  j,
int  k 
) const

one-dimensional index of a grid point

Definition at line 111 of file RegularGridTopology.cpp.

References sofa::component::topology::GridTopology::n.

Vector3 sofa::component::topology::RegularGridTopology::getMax (  )  const [inline]

Definition at line 83 of file RegularGridTopology.h.

References sofa::core::objectmodel::Data< T >::getValue(), and max.

Vector3 sofa::component::topology::RegularGridTopology::getMin (  )  const [inline]

Definition at line 82 of file RegularGridTopology.h.

References sofa::core::objectmodel::Data< T >::getValue(), and min.

const Vector3& sofa::component::topology::RegularGridTopology::getP0 (  )  const [inline]

Vector3 sofa::component::topology::RegularGridTopology::getPoint ( int  x,
int  y,
int  z 
) const

Definition at line 125 of file RegularGridTopology.cpp.

References dx, dy, dz, sofa::core::objectmodel::Data< T >::getValue(), and p0.

Vector3 sofa::component::topology::RegularGridTopology::getPoint ( int  i  )  const

double sofa::component::topology::RegularGridTopology::getPX ( int  i  )  const [inline, virtual]

Reimplemented from sofa::component::topology::MeshTopology.

Definition at line 73 of file RegularGridTopology.h.

References getPoint().

double sofa::component::topology::RegularGridTopology::getPY ( int  i  )  const [inline, virtual]

Reimplemented from sofa::component::topology::MeshTopology.

Definition at line 74 of file RegularGridTopology.h.

References getPoint().

double sofa::component::topology::RegularGridTopology::getPZ ( int  i  )  const [inline, virtual]

Reimplemented from sofa::component::topology::MeshTopology.

Definition at line 75 of file RegularGridTopology.h.

References getPoint().

bool sofa::component::topology::RegularGridTopology::hasPos (  )  const [inline, virtual]

Reimplemented from sofa::component::topology::MeshTopology.

Definition at line 72 of file RegularGridTopology.h.

void sofa::component::topology::RegularGridTopology::parse ( core::objectmodel::BaseObjectDescription *  arg  )  [virtual]

Parse the given description to assign values to this object's fields and potentially other parameters.

Reimplemented from sofa::component::topology::GridTopology.

Definition at line 41 of file RegularGridTopology.cpp.

References sofa::core::objectmodel::BaseObjectDescription::getAttribute(), sofa::core::objectmodel::Data< T >::getValue(), max, min, setPos(), and sofa::core::objectmodel::Data< T >::setValue().

virtual void sofa::component::topology::RegularGridTopology::reinit (  )  [inline, virtual]

Update method called when variables used in precomputation are modified.

Reimplemented from sofa::core::objectmodel::BaseObject.

Definition at line 49 of file RegularGridTopology.h.

References sofa::core::objectmodel::Data< T >::getValue(), max, min, and setPos().

void sofa::component::topology::RegularGridTopology::setDx ( const Vector3 &  val  )  [inline]

Definition at line 57 of file RegularGridTopology.h.

References dx, and inv_dx2.

Referenced by setPos().

void sofa::component::topology::RegularGridTopology::setDy ( const Vector3 &  val  )  [inline]

Definition at line 58 of file RegularGridTopology.h.

References dy, and inv_dy2.

Referenced by setPos().

void sofa::component::topology::RegularGridTopology::setDz ( const Vector3 &  val  )  [inline]

Definition at line 59 of file RegularGridTopology.h.

References dz, and inv_dz2.

Referenced by setPos().

void sofa::component::topology::RegularGridTopology::setP0 ( const Vector3 &  val  )  [inline]

Definition at line 56 of file RegularGridTopology.h.

References p0.

Referenced by sofa::component::MechanicalObject< DataTypes >::reinit(), and setPos().

void sofa::component::topology::RegularGridTopology::setPos ( SReal  xmin,
SReal  xmax,
SReal  ymin,
SReal  ymax,
SReal  zmin,
SReal  zmax 
)


Field Documentation

Distance between points in the grid. Must be perpendicular to each other.

Definition at line 109 of file RegularGridTopology.h.

Referenced by findCube(), findNearestCube(), getDx(), getPoint(), and setDx().

Definition at line 109 of file RegularGridTopology.h.

Referenced by findCube(), findNearestCube(), getDy(), getPoint(), and setDy().

Definition at line 109 of file RegularGridTopology.h.

Referenced by findCube(), findNearestCube(), getDz(), getPoint(), and setDz().

Definition at line 110 of file RegularGridTopology.h.

Referenced by findCube(), findNearestCube(), and setDx().

Definition at line 110 of file RegularGridTopology.h.

Referenced by findCube(), findNearestCube(), and setDy().

Definition at line 110 of file RegularGridTopology.h.

Referenced by findCube(), findNearestCube(), and setDz().

Definition at line 105 of file RegularGridTopology.h.

Referenced by getMax(), parse(), reinit(), and setPos().

Definition at line 105 of file RegularGridTopology.h.

Referenced by getMin(), parse(), reinit(), and setPos().

Position of point 0.

Definition at line 107 of file RegularGridTopology.h.

Referenced by findCube(), findNearestCube(), getP0(), getPoint(), setP0(), and setPos().


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

Generated on Sun Nov 23 04:21:36 2008 for Sofa by  doxygen 1.5.7.1