Mesh: translate doxygen from DE to EN

For the purpose of making the source documentation uniform, source comments in this file were translated to english.
This commit is contained in:
luz paz
2021-12-21 16:33:22 -05:00
committed by Uwe
parent 99765c53a8
commit 3b2cf4713b
3 changed files with 125 additions and 125 deletions

View File

@@ -73,16 +73,16 @@ bool MeshAlgorithm::NearestFacetOnRay (const Base::Vector3f &rclPt, const Base::
bool bSol = false;
FacetIndex ulInd = 0;
// langsame Ausfuehrung ohne Grid
// slow execution with no grid
MeshFacetIterator clFIter(_rclMesh);
for (clFIter.Init(); clFIter.More(); clFIter.Next()) {
if (clFIter->Foraminate( rclPt, rclDir, clRes ) == true) {
if (bSol == false) { // erste Loesung
if (bSol == false) { // first solution
bSol = true;
clProj = clRes;
ulInd = clFIter.Position();
}
else { // liegt Punkt naeher
else { // is closer to the point
if ((clRes - rclPt).Length() < (clProj - rclPt).Length()) {
clProj = clRes;
ulInd = clFIter.Position();
@@ -151,12 +151,12 @@ bool MeshAlgorithm::NearestFacetOnRay (const Base::Vector3f &rclPt, const Base::
for (std::vector<FacetIndex>::const_iterator pI = raulFacets.begin(); pI != raulFacets.end(); ++pI) {
MeshGeomFacet rclSFacet = _rclMesh.GetFacet(*pI);
if (rclSFacet.Foraminate(rclPt, rclDir, clRes) == true) {
if (bSol == false) {// erste Loesung
if (bSol == false) {// first solution
bSol = true;
clProj = clRes;
ulInd = *pI;
}
else { // liegt Punkt naeher
else { // is closer to the point
if ((clRes - rclPt).Length() < (clProj - rclPt).Length()) {
clProj = clRes;
ulInd = *pI;
@@ -182,12 +182,12 @@ bool MeshAlgorithm::RayNearestField (const Base::Vector3f &rclPt, const Base::Ve
for (std::vector<FacetIndex>::const_iterator pF = raulFacets.begin(); pF != raulFacets.end(); ++pF) {
if (_rclMesh.GetFacet(*pF).Foraminate(rclPt, rclDir, clRes/*, fMaxAngle*/) == true) {
if (bSol == false) { // erste Loesung
if (bSol == false) { // first solution
bSol = true;
clProj = clRes;
ulInd = *pF;
}
else { // liegt Punkt naeher
else { // is closer to the point
if ((clRes - rclPt).Length() < (clProj - rclPt).Length()) {
clProj = clRes;
ulInd = *pF;
@@ -437,7 +437,7 @@ void MeshAlgorithm::GetFacetBorder(FacetIndex uFacet, std::list<PointIndex>& rBo
if (openEdges.empty())
return; // facet is not a border facet
for (MeshFacetArray::_TConstIterator it = rFAry.begin(); it != rFAry.end(); ++it)
{
if (it == face)
@@ -604,7 +604,7 @@ void MeshAlgorithm::SplitBoundaryLoops(const std::vector<PointIndex>& rBound,
}
bool MeshAlgorithm::FillupHole(const std::vector<PointIndex>& boundary,
AbstractPolygonTriangulator& cTria,
AbstractPolygonTriangulator& cTria,
MeshFacetArray& rFaces, MeshPointArray& rPoints,
int level, const MeshRefPointToFacets* pP2FStructure) const
{
@@ -697,8 +697,8 @@ bool MeshAlgorithm::FillupHole(const std::vector<PointIndex>& boundary,
// criterion to decide whether it's a hole or not.
//
std::vector<MeshFacet> faces = cTria.GetFacets();
// Special case handling for a hole with three edges: the resulting facet might be coincident with the
// Special case handling for a hole with three edges: the resulting facet might be coincident with the
// reference facet
if (faces.size()==1){
MeshFacet first = faces.front();
@@ -734,9 +734,9 @@ bool MeshAlgorithm::FillupHole(const std::vector<PointIndex>& boundary,
}
}
// in case the reference facet has not an open edge print a log message
// in case the reference facet has not an open edge print a log message
if (ref_side == USHRT_MAX || tri_side == USHRT_MAX) {
Base::Console().Log("MeshAlgorithm::FillupHole: Expected open edge for facet <%d, %d, %d>\n",
Base::Console().Log("MeshAlgorithm::FillupHole: Expected open edge for facet <%d, %d, %d>\n",
rFace._aulPoints[0], rFace._aulPoints[1], rFace._aulPoints[2]);
rFaces.clear();
rPoints.clear();
@@ -937,7 +937,7 @@ void MeshAlgorithm::GetFacetsFromToolMesh(const MeshKernel& rToolMesh, const Bas
if (ret == 1) {
// these facets can be removed without more checks
clGridIter.GetElements(raclCutted);
}
}
// the box intersects with toolmesh
else if (ret == 0) {
// these facets must be tested for intersections with the toolmesh
@@ -1006,9 +1006,9 @@ int MeshAlgorithm::Surround(const Base::BoundBox3f& rBox, const Base::Vector3f&
if (cBB && rBox) {
// check for intersections with the actual mesh
Base::Vector3f cCorner[8] = {
Base::Vector3f(rBox.MinX,rBox.MinY,rBox.MinZ), Base::Vector3f(rBox.MaxX,rBox.MinY,rBox.MinZ),
Base::Vector3f(rBox.MinX,rBox.MinY,rBox.MinZ), Base::Vector3f(rBox.MaxX,rBox.MinY,rBox.MinZ),
Base::Vector3f(rBox.MaxX,rBox.MaxY,rBox.MinZ), Base::Vector3f(rBox.MinX,rBox.MaxY,rBox.MinZ),
Base::Vector3f(rBox.MinX,rBox.MinY,rBox.MaxZ), Base::Vector3f(rBox.MaxX,rBox.MinY,rBox.MaxZ),
Base::Vector3f(rBox.MinX,rBox.MinY,rBox.MaxZ), Base::Vector3f(rBox.MaxX,rBox.MinY,rBox.MaxZ),
Base::Vector3f(rBox.MaxX,rBox.MaxY,rBox.MaxZ), Base::Vector3f(rBox.MinX,rBox.MaxY,rBox.MaxZ)};
MeshFacetIterator cTIt(_rclMesh);
@@ -1026,8 +1026,8 @@ int MeshAlgorithm::Surround(const Base::BoundBox3f& rBox, const Base::Vector3f&
std::vector<MeshGeomFacet> cFacet(12);
int id=0;
for (size_t ii=0; ii<12; ii++) {
cFacet[ii]._aclPoints[0]=cCorner[triangles[id++]];
cFacet[ii]._aclPoints[1]=cCorner[triangles[id++]];
cFacet[ii]._aclPoints[0]=cCorner[triangles[id++]];
cFacet[ii]._aclPoints[1]=cCorner[triangles[id++]];
cFacet[ii]._aclPoints[2]=cCorner[triangles[id++]];
}
@@ -1223,7 +1223,7 @@ void MeshAlgorithm::SearchFacetsFromPolyline (const std::vector<Base::Vector3f>
for (std::vector<Base::Vector3f>::const_iterator pV = rclPolyline.begin(); pV < (rclPolyline.end() - 1); ++pV)
{
const Base::Vector3f &rclP0 = *pV, &rclP1 = *(pV + 1);
// BB eines Polyline-Segments
BoundBox3f clSegmBB(rclP0.x, rclP0.y, rclP0.z, rclP0.x, rclP0.y, rclP0.z);
clSegmBB.Add(rclP1);
@@ -1397,28 +1397,28 @@ bool MeshAlgorithm::CutWithPlane (const Base::Vector3f &clBase, const Base::Vect
{
std::vector<FacetIndex> aulFacets;
// Grid durschsuchen
// Search grid
MeshGridIterator clGridIter(rclGrid);
for (clGridIter.Init(); clGridIter.More(); clGridIter.Next())
{
// wenn Gridvoxel Ebene schneidet: alle Facets aufnehmen zum Schneiden
{
// if Gridvoxel intersects the plane: pick up all facets for cutting
if (clGridIter.GetBoundBox().IsCutPlane(clBase, clNormal) == true)
clGridIter.GetElements(aulFacets);
}
// mehrfach vorhanden Dreiecke entfernen
// remove multiple triangles
std::sort(aulFacets.begin(), aulFacets.end());
aulFacets.erase(std::unique(aulFacets.begin(), aulFacets.end()), aulFacets.end());
aulFacets.erase(std::unique(aulFacets.begin(), aulFacets.end()), aulFacets.end());
// alle Facets mit Ebene schneiden
std::list<std::pair<Base::Vector3f, Base::Vector3f> > clTempPoly; // Feld mit Schnittlinien (unsortiert, nicht verkettet)
// intersect all facets with plane
std::list<std::pair<Base::Vector3f, Base::Vector3f> > clTempPoly; // Field with intersection lines (unsorted, not chained)
for (std::vector<FacetIndex>::iterator pF = aulFacets.begin(); pF != aulFacets.end(); ++pF)
{
Base::Vector3f clE1, clE2;
const MeshGeomFacet clF(_rclMesh.GetFacet(*pF));
// Facet schneiden und Schnittstrecke ablegen
// Cut the facet and store the cutting path
if (clF.IntersectWithPlane(clBase, clNormal, clE1, clE2) == true)
clTempPoly.emplace_back(clE1, clE2);
}
@@ -1448,7 +1448,7 @@ bool MeshAlgorithm::ConnectLines (std::list<std::pair<Base::Vector3f, Base::Vect
typedef std::list<std::pair<Base::Vector3f, Base::Vector3f> >::iterator TCIter;
// square search radius
// const float fMinEps = 1.0e-2f; // := 10 mirometer distance
// const float fMinEps = 1.0e-2f; // := 10 micrometer distance
fMinEps = fMinEps * fMinEps;
// remove all lines whose distance is smaller than epsilon
@@ -1602,7 +1602,7 @@ void MeshAlgorithm::GetFacetsFromPlane (const MeshFacetGrid &rclGrid, const Base
Base::Vector3f clPtNormal(rclLeft - rclRight);
clPtNormal.Normalize();
// search grid
// search grid
MeshGridIterator clGridIter(rclGrid);
for (clGridIter.Init(); clGridIter.More(); clGridIter.Next()) {
// add facets from grid if the plane if cut the grid-voxel

View File

@@ -46,7 +46,7 @@ class MeshHelpEdge;
class MeshPoint;
/**
* Helper class providing an operator for comparison
* Helper class providing an operator for comparison
* of two edges. The class holds the point indices of the
* underlying edge.
*/
@@ -150,7 +150,7 @@ public:
};
/**
* The MeshGeomEdge class is geometric counterpart to MeshEdge that holds the
* The MeshGeomEdge class is geometric counterpart to MeshEdge that holds the
* geometric data points of an edge.
*/
class MeshExport MeshGeomEdge
@@ -218,7 +218,7 @@ public:
* The MeshFacet class represent a triangle facet in the mesh data.structure. A facet indexes
* three neighbour facets and also three corner points.
* This class only keeps topologic information but no geometric information at all.
*
*
* Here are the most important conventions concerning the facet's orientation:
* \li neighbour or edge number of 0 is defined by corner 0 and 1
* \li neighbour or edge number of 1 is defined by corner 1 and 2
@@ -276,11 +276,11 @@ public:
inline void SetNeighbours(FacetIndex,FacetIndex,FacetIndex);
/**
* Returns the indices of the corner points of the given edge number.
* Returns the indices of the corner points of the given edge number.
*/
inline void GetEdge (unsigned short usSide, MeshHelpEdge &rclEdge) const;
/**
* Returns the indices of the corner points of the given edge number.
* Returns the indices of the corner points of the given edge number.
*/
inline std::pair<PointIndex, PointIndex> GetEdge (unsigned short usSide) const;
/**
@@ -294,7 +294,7 @@ public:
*/
inline unsigned short Side (PointIndex ulP0, PointIndex P1) const;
/**
* Returns the edge-number defined by the shared edge of both facets. If the facets don't
* Returns the edge-number defined by the shared edge of both facets. If the facets don't
* share a common edge USHRT_MAX is returned.
*/
inline unsigned short Side (const MeshFacet& rcFace) const;
@@ -353,16 +353,16 @@ public:
};
/**
* The MeshGeomFacet class is geometric counterpart to MeshFacet that holds the
* The MeshGeomFacet class is geometric counterpart to MeshFacet that holds the
* geometric data points of a triangle.
*/
class MeshExport MeshGeomFacet
class MeshExport MeshGeomFacet
{
public:
/** @name Construction */
//@{
/// default constructor
MeshGeomFacet ();
MeshGeomFacet ();
/// Constructor with the corner points
MeshGeomFacet (const Base::Vector3f &v1,const Base::Vector3f &v2,const Base::Vector3f &v3);
/// Destruction
@@ -382,15 +382,15 @@ public:
* checked. This method is very efficient.
*/
bool IsPointOf (const Base::Vector3f &rclPoint) const;
/** Checks whether the given point is inside the facet with tolerance \a fDistance.
* This method does actually the same as IsPointOf() but this implementation
/** Checks whether the given point is inside the facet with tolerance \a fDistance.
* This method does actually the same as IsPointOf() but this implementation
* is done more effective through comparison of normals.
*/
bool IsPointOfFace (const Base::Vector3f& rclP, float fDistance) const;
/** Calculates the weights \a w1, ..., \a w3 of the corners to get the point \a rclP, i.e.
* rclP = w0*v0 + w1*v1 + w2*v2 (v0-v2 are the corners corners).
* If w0+w1+w2==1.0 then the point rclP lies on the plane that is spanned by the facet, otherwise
* the point doesn't lie on the plane.
* the point doesn't lie on the plane.
* If the sum of wi is 1 and if each wi is between [0,1] than the point lies inside
* the facet or on the border, respectively.
*
@@ -493,11 +493,11 @@ public:
bool IntersectWithLine (const Base::Vector3f &rclPt, const Base::Vector3f &rclDir, Base::Vector3f &rclRes) const;
/** Calculates the intersection point of the line defined by the base \a rclPt and the direction \a rclDir
* with the facet. The intersection must be inside the facet. If there is no intersection false is returned.
* This does actually the same as IntersectWithLine() with one additionally constraint that the angle
* This does actually the same as IntersectWithLine() with one additionally constraint that the angle
* between the direction of the line and the normal of the plane must not exceed \a fMaxAngle.
*/
bool Foraminate (const Base::Vector3f &rclPt, const Base::Vector3f &rclDir, Base::Vector3f &rclRes, float fMaxAngle = Mathf::PI) const;
/** Checks if the facet intersects with the plane defined by the base \a rclBase and the normal
/** Checks if the facet intersects with the plane defined by the base \a rclBase and the normal
* \a rclNormal and returns true if two points are found, false otherwise.
*/
bool IntersectWithPlane (const Base::Vector3f &rclBase, const Base::Vector3f &rclNormal, Base::Vector3f &rclP1, Base::Vector3f &rclP2) const;
@@ -507,10 +507,10 @@ public:
*/
inline bool IntersectWithPlane (const Base::Vector3f &rclBase, const Base::Vector3f &rclNormal) const;
/** Checks if the plane defined by the facet \a rclFacet intersects with the line defined by the base
* \a rclBase and the direction \a rclNormal and returns the intersection point \a rclRes if possible.
* \a rclBase and the direction \a rclNormal and returns the intersection point \a rclRes if possible.
*/
bool IntersectPlaneWithLine (const Base::Vector3f &rclBase, const Base::Vector3f &rclNormal, Base::Vector3f &rclRes ) const;
/** Calculates the volume of the prism defined by two facets.
/** Calculates the volume of the prism defined by two facets.
* \note The two facets must not intersect.
*/
float VolumeOfPrism (const MeshGeomFacet& rclF) const;
@@ -609,7 +609,7 @@ public:
/**
* Searches for the first point index Two points are equal if the distance is less
* than EPSILON. If no such points is found the point is added to the array at end
* and its index is returned.
* and its index is returned.
*/
PointIndex GetOrAddIndex (const MeshPoint &rclPoint);
};
@@ -643,9 +643,9 @@ public:
* of the object
*/
//@{
/// Sets the flag for all facets.
/// Sets the flag for all facets.
void SetFlag (MeshFacet::TFlagType tF) const;
/// Resets the flag for all facets.
/// Resets the flag for all facets.
void ResetFlag (MeshFacet::TFlagType tF) const;
/// Sets all facets invalid
void ResetInvalid () const;
@@ -853,27 +853,27 @@ inline float MeshGeomFacet::Perimeter() const
inline float MeshGeomFacet::Area () const
{
return ((_aclPoints[1] - _aclPoints[0]) %
return ((_aclPoints[1] - _aclPoints[0]) %
(_aclPoints[2] - _aclPoints[0])).Length() / 2.0f;
}
inline bool MeshGeomFacet::ContainedByOrIntersectBoundingBox ( const Base::BoundBox3f &rclBB ) const
{
// Test, ob alle Eckpunkte des Facets sich auf einer der 6 Seiten der BB befinden
// Test, if all corner points of the facet are on one of the 6 sides of the BB
if ((GetBoundBox() && rclBB) == false)
return false;
// Test, ob Facet-BB komplett in BB liegt
// Test, whether Facet-BB is completely within BB
if (rclBB.IsInBox(GetBoundBox()))
return true;
// Test, ob einer der Eckpunkte in BB liegt
// Test, whether one of the corner points is in BB
for (int i=0;i<3;i++) {
if (rclBB.IsInBox(_aclPoints[i]))
return true;
}
// "echter" Test auf Schnitt
// "real" test for cutting
if (IntersectBoundingBox(rclBB))
return true;
@@ -882,7 +882,7 @@ inline bool MeshGeomFacet::ContainedByOrIntersectBoundingBox ( const Base::Bound
inline bool MeshGeomFacet::IntersectWithPlane (const Base::Vector3f &rclBase, const Base::Vector3f &rclNormal) const
{
bool bD0 = (_aclPoints[0].DistanceToPlane(rclBase, rclNormal) > 0.0f);
bool bD0 = (_aclPoints[0].DistanceToPlane(rclBase, rclNormal) > 0.0f);
return !((bD0 == (_aclPoints[1].DistanceToPlane(rclBase, rclNormal) > 0.0f)) &&
(bD0 == (_aclPoints[2].DistanceToPlane(rclBase, rclNormal) > 0.0f)));
}
@@ -1057,21 +1057,21 @@ inline unsigned short MeshFacet::Side (PointIndex ulP0, PointIndex ulP1) const
{
if (_aulPoints[0] == ulP0) {
if (_aulPoints[1] == ulP1)
return 0; // Kante 0-1 ==> 0
return 0; // Edge 0-1 ==> 0
else if (_aulPoints[2] == ulP1)
return 2; // Kante 0-2 ==> 2
return 2; // Edge 0-2 ==> 2
}
else if (_aulPoints[1] == ulP0) {
if (_aulPoints[0] == ulP1)
return 0; // Kante 1-0 ==> 0
return 0; // Edge 1-0 ==> 0
else if (_aulPoints[2] == ulP1)
return 1; // Kante 1-2 ==> 1
return 1; // Edge 1-2 ==> 1
}
else if (_aulPoints[2] == ulP0) {
if (_aulPoints[0] == ulP1)
return 2; // Kante 2-0 ==> 2
return 2; // Edge 2-0 ==> 2
else if (_aulPoints[1] == ulP1)
return 1; // Kante 2-1 ==> 1
return 1; // Edge 2-1 ==> 1
}
return USHRT_MAX;
@@ -1163,4 +1163,4 @@ public:
} // namespace MeshCore
#endif // MESH_ELEMENTS_H
#endif // MESH_ELEMENTS_H

View File

@@ -63,7 +63,7 @@ void MeshGrid::Attach (const MeshKernel &rclM)
void MeshGrid::Clear ()
{
_aulGrid.clear();
_pclMesh = nullptr;
_pclMesh = nullptr;
}
void MeshGrid::Rebuild (unsigned long ulX, unsigned long ulY, unsigned long ulZ)
@@ -95,17 +95,17 @@ void MeshGrid::InitGrid ()
unsigned long i, j;
// Grid Laengen berechnen wenn nicht initialisiert
// Calculate grid length if not initialised
//
if ((_ulCtGridsX == 0) || (_ulCtGridsY == 0) || (_ulCtGridsZ == 0))
CalculateGridLength(MESH_CT_GRID, MESH_MAX_GRIDS);
// Grid Laengen und Offset bestimmen
// Determine grid length and offset
//
{
Base::BoundBox3f clBBMesh = _pclMesh->GetBoundBox();
float fLengthX = clBBMesh.LengthX();
float fLengthX = clBBMesh.LengthX();
float fLengthY = clBBMesh.LengthY();
float fLengthZ = clBBMesh.LengthZ();
@@ -127,7 +127,7 @@ void MeshGrid::InitGrid ()
}
}
// Daten-Struktur anlegen
// Create data structure
_aulGrid.clear();
_aulGrid.resize(_ulCtGridsX);
for (i = 0; i < _ulCtGridsX; i++)
@@ -142,10 +142,10 @@ unsigned long MeshGrid::Inside (const Base::BoundBox3f &rclBB, std::vector<Eleme
bool bDelDoubles) const
{
unsigned long i, j, k, ulMinX, ulMinY, ulMinZ, ulMaxX, ulMaxY, ulMaxZ;
raulElements.clear();
// Grid-Boxen zur naehreren Auswahl
// Grid boxes for a more detailed selection
Position(Base::Vector3f(rclBB.MinX, rclBB.MinY, rclBB.MinZ), ulMinX, ulMinY, ulMinZ);
Position(Base::Vector3f(rclBB.MaxX, rclBB.MaxY, rclBB.MaxZ), ulMaxX, ulMaxY, ulMaxZ);
@@ -158,13 +158,13 @@ unsigned long MeshGrid::Inside (const Base::BoundBox3f &rclBB, std::vector<Eleme
raulElements.insert(raulElements.end(), _aulGrid[i][j][k].begin(), _aulGrid[i][j][k].end());
}
}
}
}
if (bDelDoubles == true)
{
// doppelte Nennungen entfernen
// remove duplicate mentions
std::sort(raulElements.begin(), raulElements.end());
raulElements.erase(std::unique(raulElements.begin(), raulElements.end()), raulElements.end());
raulElements.erase(std::unique(raulElements.begin(), raulElements.end()), raulElements.end());
}
return raulElements.size();
@@ -179,7 +179,7 @@ unsigned long MeshGrid::Inside (const Base::BoundBox3f &rclBB, std::vector<Eleme
raulElements.clear();
// Grid-Boxen zur naehreren Auswahl
// Grid boxes for a more detailed selection
Position(Base::Vector3f(rclBB.MinX, rclBB.MinY, rclBB.MinZ), ulMinX, ulMinY, ulMinZ);
Position(Base::Vector3f(rclBB.MaxX, rclBB.MaxY, rclBB.MaxZ), ulMaxX, ulMaxY, ulMaxZ);
@@ -193,13 +193,13 @@ unsigned long MeshGrid::Inside (const Base::BoundBox3f &rclBB, std::vector<Eleme
raulElements.insert(raulElements.end(), _aulGrid[i][j][k].begin(), _aulGrid[i][j][k].end());
}
}
}
}
if (bDelDoubles == true)
{
// doppelte Nennungen entfernen
// remove duplicate mentions
std::sort(raulElements.begin(), raulElements.end());
raulElements.erase(std::unique(raulElements.begin(), raulElements.end()), raulElements.end());
raulElements.erase(std::unique(raulElements.begin(), raulElements.end()), raulElements.end());
}
return raulElements.size();
@@ -208,10 +208,10 @@ unsigned long MeshGrid::Inside (const Base::BoundBox3f &rclBB, std::vector<Eleme
unsigned long MeshGrid::Inside (const Base::BoundBox3f &rclBB, std::set<ElementIndex> &raulElements) const
{
unsigned long i, j, k, ulMinX, ulMinY, ulMinZ, ulMaxX, ulMaxY, ulMaxZ;
raulElements.clear();
// Grid-Boxen zur naehreren Auswahl
// Grid boxes for a more detailed selection
Position(Base::Vector3f(rclBB.MinX, rclBB.MinY, rclBB.MinZ), ulMinX, ulMinY, ulMinZ);
Position(Base::Vector3f(rclBB.MaxX, rclBB.MaxY, rclBB.MaxZ), ulMaxX, ulMaxY, ulMaxZ);
@@ -224,7 +224,7 @@ unsigned long MeshGrid::Inside (const Base::BoundBox3f &rclBB, std::set<ElementI
raulElements.insert(_aulGrid[i][j][k].begin(), _aulGrid[i][j][k].end());
}
}
}
}
return raulElements.size();
}
@@ -261,9 +261,9 @@ void MeshGrid::Position (const Base::Vector3f &rclPoint, unsigned long &rulX, un
void MeshGrid::CalculateGridLength (unsigned long ulCtGrid, unsigned long ulMaxGrids)
{
// Grid Laengen bzw. Anzahl der Grids pro Dimension berechnen
// pro Grid sollen ca. 10 (?!?!) Facets liegen
// bzw. max Grids sollten 10000 nicht ueberschreiten
// Calculate grid lengths or number of grids per dimension
// There should be about 10 (?!?!) facets per grid
// respectively max grids should not exceed 10000
Base::BoundBox3f clBBMeshEnlarged = _pclMesh->GetBoundBox();
float fGridLen = 0;
@@ -283,7 +283,7 @@ void MeshGrid::CalculateGridLength (unsigned long ulCtGrid, unsigned long ulMaxG
fGridLen = float(pow(fVol, 1.0f / 3.0f));
}
else {
// Planare Bounding box
// Planar bounding box
float fArea = fLenX * fLenY + fLenX * fLenZ + fLenY * fLenZ;
float fAreaElem;
if (_ulCtElements > (ulMaxGrids * ulCtGrid))
@@ -316,9 +316,9 @@ void MeshGrid::CalculateGridLength (int iCtGridPerAxis)
return;
}
// Grid Laengen bzw. Anzahl der Grids pro Dimension berechnen
// pro Grid sollen ca. 10 (?!?!) Facets liegen
// bzw. max Grids sollten 10000 nicht ueberschreiten
// Calculate grid lengths or number of grids per dimension
// There should be about 10 (?!?!) facets per grid
// respectively max grids should not exceed 10000
Base::BoundBox3f clBBMesh = _pclMesh->GetBoundBox();
float fLenghtX = clBBMesh.LengthX();
@@ -337,21 +337,21 @@ void MeshGrid::CalculateGridLength (int iCtGridPerAxis)
int iMaxGrids = 1;
if (bLenghtXisZero)
iFlag += 1;
if (bLenghtXisZero)
iFlag += 1;
else
iMaxGrids *= iCtGridPerAxis;
if (bLenghtYisZero)
if (bLenghtYisZero)
iFlag += 2;
else
iMaxGrids *= iCtGridPerAxis;
if (bLenghtZisZero)
iFlag += 4;
iFlag += 4;
else
iMaxGrids *= iCtGridPerAxis;
unsigned long ulGridsFacets = 10;
float fFactorVolumen = 40.0;
@@ -373,12 +373,12 @@ void MeshGrid::CalculateGridLength (int iCtGridPerAxis)
_ulCtGridsX = std::max<unsigned long>(static_cast<unsigned long>(fLenghtX / fLengthGrid), 1);
_ulCtGridsY = std::max<unsigned long>(static_cast<unsigned long>(fLenghtY / fLengthGrid), 1);
_ulCtGridsZ = std::max<unsigned long>(static_cast<unsigned long>(fLenghtZ / fLengthGrid), 1);
} break;
case 1:
{
_ulCtGridsX = 1; // bLenghtXisZero
float fArea = fLenghtY * fLenghtZ;
float fAreaGrid = (fArea * ulGridsFacets) / (fFactorArea * _ulCtElements);
@@ -394,7 +394,7 @@ void MeshGrid::CalculateGridLength (int iCtGridPerAxis)
case 2:
{
_ulCtGridsY = 1; // bLenghtYisZero
float fArea = fLenghtX * fLenghtZ;
float fAreaGrid = (fArea * ulGridsFacets) / (fFactorArea * _ulCtElements);
@@ -416,7 +416,7 @@ void MeshGrid::CalculateGridLength (int iCtGridPerAxis)
case 4:
{
_ulCtGridsZ = 1; // bLenghtZisZero
float fArea = fLenghtX * fLenghtY;
float fAreaGrid = (fArea * ulGridsFacets) / (fFactorArea * _ulCtElements);
@@ -456,7 +456,7 @@ void MeshGrid::SearchNearestFromPoint (const Base::Vector3f &rclPt, std::set<Ele
Base::BoundBox3f clBB = GetBoundBox();
if (clBB.IsInBox(rclPt) == true)
{ // Punkt liegt innerhalb
{ // Point lies within
unsigned long ulX, ulY, ulZ;
Position(rclPt, ulX, ulY, ulZ);
//int nX = ulX, nY = ulY, nZ = ulZ;
@@ -467,7 +467,7 @@ void MeshGrid::SearchNearestFromPoint (const Base::Vector3f &rclPt, std::set<Ele
GetHull(ulX, ulY, ulZ, ulLevel, raclInd);
}
else
{ // Punkt ausserhalb
{ // Point outside
Base::BoundBox3f::SIDE tSide = clBB.GetSideFromRay(rclPt, clBB.GetCenter() - rclPt);
switch (tSide)
{
@@ -562,7 +562,7 @@ void MeshGrid::SearchNearestFromPoint (const Base::Vector3f &rclPt, std::set<Ele
}
}
void MeshGrid::GetHull (unsigned long ulX, unsigned long ulY, unsigned long ulZ,
void MeshGrid::GetHull (unsigned long ulX, unsigned long ulY, unsigned long ulZ,
unsigned long ulDistance, std::set<ElementIndex> &raclInd) const
{
int nX1 = std::max<int>(0, int(ulX) - int(ulDistance));
@@ -642,7 +642,7 @@ void MeshGrid::GetHull (unsigned long ulX, unsigned long ulY, unsigned long ulZ,
}
}
unsigned long MeshGrid::GetElements (unsigned long ulX, unsigned long ulY, unsigned long ulZ,
unsigned long MeshGrid::GetElements (unsigned long ulX, unsigned long ulY, unsigned long ulZ,
std::set<ElementIndex> &raclInd) const
{
const std::set<ElementIndex> &rclSet = _aulGrid[ulX][ulY][ulZ];
@@ -739,7 +739,7 @@ void MeshFacetGrid::Validate ()
bool MeshFacetGrid::Verify() const
{
if ( !_pclMesh )
if ( !_pclMesh )
return false; // no mesh attached
if (_pclMesh->CountFacets() != _ulCtElements)
return false; // not up-to-date
@@ -766,8 +766,8 @@ void MeshFacetGrid::RebuildGrid ()
_ulCtElements = _pclMesh->CountFacets();
InitGrid();
// Daten-Struktur fuellen
// Fill data structure
MeshFacetIterator clFIter(*_pclMesh);
unsigned long i = 0;
@@ -786,7 +786,7 @@ unsigned long MeshFacetGrid::SearchNearestFromPoint (const Base::Vector3f &rclPt
Base::BoundBox3f clBB = GetBoundBox();
if (clBB.IsInBox(rclPt) == true)
{ // Punkt liegt innerhalb
{ // Point lies within
unsigned long ulX, ulY, ulZ;
Position(rclPt, ulX, ulY, ulZ);
float fMinGridDist = std::min<float>(std::min<float>(_fGridLenX, _fGridLenY), _fGridLenZ);
@@ -799,7 +799,7 @@ unsigned long MeshFacetGrid::SearchNearestFromPoint (const Base::Vector3f &rclPt
SearchNearestFacetInHull(ulX, ulY, ulZ, ulDistance, rclPt, ulFacetInd, fMinDist);
}
else
{ // Punkt ausserhalb
{ // Point outside
Base::BoundBox3f::SIDE tSide = clBB.GetSideFromRay(rclPt, clBB.GetCenter() - rclPt);
switch (tSide)
{
@@ -909,7 +909,7 @@ unsigned long MeshFacetGrid::SearchNearestFromPoint (const Base::Vector3f &rclPt
Inside(clBB, aulFacets, rclPt, fMaxSearchArea, true);
for (std::vector<ElementIndex>::const_iterator pI = aulFacets.begin(); pI != aulFacets.end(); ++pI)
{
{
float fDist;
if (clFTool.Distance(rclPt, *pI, fMinDist, fDist) == true)
@@ -922,7 +922,7 @@ unsigned long MeshFacetGrid::SearchNearestFromPoint (const Base::Vector3f &rclPt
return ulFacetInd;
}
void MeshFacetGrid::SearchNearestFacetInHull (unsigned long ulX, unsigned long ulY, unsigned long ulZ,
void MeshFacetGrid::SearchNearestFacetInHull (unsigned long ulX, unsigned long ulY, unsigned long ulZ,
unsigned long ulDistance, const Base::Vector3f &rclPt,
ElementIndex &rulFacetInd, float &rfMinDist) const
{
@@ -1003,7 +1003,7 @@ void MeshFacetGrid::SearchNearestFacetInHull (unsigned long ulX, unsigned long u
}
}
void MeshFacetGrid::SearchNearestFacetInGrid(unsigned long ulX, unsigned long ulY, unsigned long ulZ,
void MeshFacetGrid::SearchNearestFacetInGrid(unsigned long ulX, unsigned long ulY, unsigned long ulZ,
const Base::Vector3f &rclPt, float &rfMinDist,
ElementIndex &rulFacetInd) const
{
@@ -1021,25 +1021,25 @@ void MeshFacetGrid::SearchNearestFacetInGrid(unsigned long ulX, unsigned long ul
//----------------------------------------------------------------------------
MeshPointGrid::MeshPointGrid (const MeshKernel &rclM)
: MeshGrid(rclM)
MeshPointGrid::MeshPointGrid (const MeshKernel &rclM)
: MeshGrid(rclM)
{
RebuildGrid();
}
MeshPointGrid::MeshPointGrid ()
: MeshGrid()
: MeshGrid()
{
}
MeshPointGrid::MeshPointGrid (const MeshKernel &rclM, unsigned long ulX, unsigned long ulY, unsigned long ulZ)
: MeshGrid(rclM)
: MeshGrid(rclM)
{
Rebuild(ulX, ulY, ulZ);
}
MeshPointGrid::MeshPointGrid (const MeshKernel &rclM, int iCtGridPerAxis)
: MeshGrid(rclM)
: MeshGrid(rclM)
{
Rebuild(iCtGridPerAxis);
}
@@ -1081,7 +1081,7 @@ void MeshPointGrid::Validate ()
bool MeshPointGrid::Verify() const
{
if ( !_pclMesh )
if ( !_pclMesh )
return false; // no mesh attached
if (_pclMesh->CountFacets() != _ulCtElements)
return false; // not up-to-date
@@ -1108,8 +1108,8 @@ void MeshPointGrid::RebuildGrid ()
_ulCtElements = _pclMesh->CountPoints();
InitGrid();
// Daten-Struktur fuellen
// Fill data structure
MeshPointIterator cPIter(*_pclMesh);
@@ -1169,24 +1169,24 @@ bool MeshGridIterator::InitOnRay (const Base::Vector3f &rclPt, const Base::Vecto
_fMaxSearchArea = FLOAT_MAX;
raulElements.clear();
raulElements.clear();
_clPt = rclPt;
_clDir = rclDir;
_bValidRay = false;
// liegt Punkt innerhalb globalen BB
// point lies within global BB
if ((_rclGrid.GetBoundBox().IsInBox(rclPt)) == true)
{ // Voxel bestimmen, indem der Startpunkt liegt
{ // Determine the voxel by the starting point
_rclGrid.Position(rclPt, _ulX, _ulY, _ulZ);
raulElements.insert(raulElements.end(), _rclGrid._aulGrid[_ulX][_ulY][_ulZ].begin(), _rclGrid._aulGrid[_ulX][_ulY][_ulZ].end());
_bValidRay = true;
}
else
{ // Startpunkt ausserhalb
{ // Start point outside
Base::Vector3f cP0, cP1;
if (_rclGrid.GetBoundBox().IntersectWithLine(rclPt, rclDir, cP0, cP1) == true)
{ // naechsten Punkt bestimmen
{ // determine the next point
if ((cP0 - rclPt).Length() < (cP1 - rclPt).Length())
_rclGrid.Position(cP0, _ulX, _ulY, _ulZ);
else
@@ -1203,16 +1203,16 @@ bool MeshGridIterator::InitOnRay (const Base::Vector3f &rclPt, const Base::Vecto
bool MeshGridIterator::NextOnRay (std::vector<ElementIndex> &raulElements)
{
if (_bValidRay == false)
return false; // nicht initialisiert oder Strahl ausgetreten
return false; // not initialized or beam exited
raulElements.clear();
Base::Vector3f clIntersectPoint;
// naechstes anliegende BB auf dem Suchstrahl suchen
// Look for the next adjacent BB on the search beam
Base::BoundBox3f::SIDE tSide = _rclGrid.GetBoundBox(_ulX, _ulY, _ulZ).GetSideFromRay(_clPt, _clDir, clIntersectPoint);
// Suchbereich
// Search area
//
if ((_clPt-clIntersectPoint).Length() > _fMaxSearchArea)
{
@@ -1243,10 +1243,10 @@ bool MeshGridIterator::NextOnRay (std::vector<ElementIndex> &raulElements)
if ((_bValidRay == true) && (_rclGrid.CheckPos(_ulX, _ulY, _ulZ) == true))
{
GridElement pos(_ulX, _ulY, _ulZ); _cSearchPositions.insert(pos);
raulElements.insert(raulElements.end(), _rclGrid._aulGrid[_ulX][_ulY][_ulZ].begin(), _rclGrid._aulGrid[_ulX][_ulY][_ulZ].end());
raulElements.insert(raulElements.end(), _rclGrid._aulGrid[_ulX][_ulY][_ulZ].begin(), _rclGrid._aulGrid[_ulX][_ulY][_ulZ].end());
}
else
_bValidRay = false; // Strahl ausgetreten
_bValidRay = false; // Beam leaked
return _bValidRay;
}