MeshCore::MeshGridIterator Class Reference

The MeshGridIterator class provides an interface to walk through all grid elements of a mesh grid. More...

#include <Grid.h>

List of all members.

Classes

struct  GridElement
 Checks if a grid position is already visited by NextOnRay(). More...

Public Member Functions

Base::BoundBox3f GetBoundBox (void) const
 Returns the bounding box of the current grid element.
unsigned long GetCtElements () const
 Returns the number of elements in the current grid.
void GetElements (std::vector< unsigned long > &raulElements) const
 Returns indices of the elements in the current grid.
void GetGridPos (unsigned long &rulX, unsigned long &rulY, unsigned long &rulZ) const
 Returns the grid number of the current position.
 MeshGridIterator (const MeshGrid &rclG)
 Construction.
Iteration



void Init (void)
 Sets the iterator to the first element.
bool More (void) const
 Checks if the iterator has not yet reached the end position.
void Next (void)
 Go to the next grid.
Tests with rays



bool InitOnRay (const Base::Vector3f &rclPt, const Base::Vector3f &rclDir, float fMaxSearchArea, std::vector< unsigned long > &raulElements)
 Searches for facets around the ray.
bool InitOnRay (const Base::Vector3f &rclPt, const Base::Vector3f &rclDir, std::vector< unsigned long > &raulElements)
 Searches for facets around the ray.
bool NextOnRay (std::vector< unsigned long > &raulElements)
 Searches for facets around the ray.

Protected Attributes

bool _bValidRay
 Search ray ok?
Base::Vector3f _clDir
 Direction of search ray.
Base::Vector3f _clPt
 Base point of search ray.
std::set< GridElement_cSearchPositions
float _fMaxSearchArea
const MeshGrid_rclGrid
 The mesh kernel.
unsigned long _ulX
 Number of grids in x.
unsigned long _ulY
 Number of grids in y.
unsigned long _ulZ
 Number of grids in z.

Detailed Description

The MeshGridIterator class provides an interface to walk through all grid elements of a mesh grid.

Definition at line 287 of file Grid.h.


Constructor & Destructor Documentation

MeshGridIterator::MeshGridIterator ( const MeshGrid rclG  ) 

Construction.

Definition at line 1056 of file Grid.cpp.


Member Function Documentation

Base::BoundBox3f MeshCore::MeshGridIterator::GetBoundBox ( void   )  const [inline]
unsigned long MeshCore::MeshGridIterator::GetCtElements (  )  const [inline]

Returns the number of elements in the current grid.

Definition at line 301 of file Grid.h.

void MeshCore::MeshGridIterator::GetElements ( std::vector< unsigned long > &  raulElements  )  const [inline]
void MeshCore::MeshGridIterator::GetGridPos ( unsigned long &  rulX,
unsigned long &  rulY,
unsigned long &  rulZ 
) const [inline]

Returns the grid number of the current position.

Definition at line 332 of file Grid.h.

Referenced by Mesh::MeshPy::nearestFacetOnRay().

void MeshCore::MeshGridIterator::Init ( void   )  [inline]
bool MeshGridIterator::InitOnRay ( const Base::Vector3f rclPt,
const Base::Vector3f rclDir,
float  fMaxSearchArea,
std::vector< unsigned long > &  raulElements 
)

Searches for facets around the ray.

Definition at line 1066 of file Grid.cpp.

References _fMaxSearchArea, and InitOnRay().

bool MeshGridIterator::InitOnRay ( const Base::Vector3f rclPt,
const Base::Vector3f rclDir,
std::vector< unsigned long > &  raulElements 
)
bool MeshCore::MeshGridIterator::More ( void   )  const [inline]
void MeshCore::MeshGridIterator::Next ( void   )  [inline]
bool MeshGridIterator::NextOnRay ( std::vector< unsigned long > &  raulElements  ) 

Member Data Documentation

Search ray ok?

Definition at line 342 of file Grid.h.

Referenced by InitOnRay(), and NextOnRay().

Direction of search ray.

Definition at line 341 of file Grid.h.

Referenced by InitOnRay(), and NextOnRay().

Base point of search ray.

Definition at line 340 of file Grid.h.

Referenced by InitOnRay(), and NextOnRay().

Definition at line 359 of file Grid.h.

Referenced by InitOnRay(), and NextOnRay().

Definition at line 343 of file Grid.h.

Referenced by InitOnRay(), and NextOnRay().

The mesh kernel.

Definition at line 336 of file Grid.h.

Referenced by InitOnRay(), and NextOnRay().

unsigned long MeshCore::MeshGridIterator::_ulX [protected]

Number of grids in x.

Definition at line 337 of file Grid.h.

Referenced by InitOnRay(), and NextOnRay().

unsigned long MeshCore::MeshGridIterator::_ulY [protected]

Number of grids in y.

Definition at line 338 of file Grid.h.

Referenced by InitOnRay(), and NextOnRay().

unsigned long MeshCore::MeshGridIterator::_ulZ [protected]

Number of grids in z.

Definition at line 339 of file Grid.h.

Referenced by InitOnRay(), and NextOnRay().


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

Generated on Wed Nov 23 19:02:24 2011 for FreeCAD by  doxygen 1.6.1