Coverity issues: fix Mesh, Points and Inspection module

This commit is contained in:
wmayer 2016-08-17 14:08:47 +02:00
parent e4f0ddad84
commit 9b013f7254
18 changed files with 124 additions and 83 deletions

View File

@ -751,8 +751,11 @@ App::DocumentObjectExecReturn* Feature::execute(void)
} }
} }
if (countRMS > 0) {
fRMS = fRMS / countRMS; fRMS = fRMS / countRMS;
fRMS = sqrt(fRMS); fRMS = sqrt(fRMS);
}
Base::Console().Message("RMS value for '%s' with search radius=%.4f is: %.4f\n", Base::Console().Message("RMS value for '%s' with search radius=%.4f is: %.4f\n",
this->Label.getValue(), this->SearchRadius.getValue(), fRMS); this->Label.getValue(), this->SearchRadius.getValue(), fRMS);

View File

@ -183,7 +183,7 @@ void ViewProviderInspection::updateData(const App::Property* prop)
{ {
// set to the expected size // set to the expected size
if (prop->getTypeId() == App::PropertyLink::getClassTypeId()) { if (prop->getTypeId() == App::PropertyLink::getClassTypeId()) {
App::GeoFeature* object = static_cast<const App::PropertyLink*>(prop)->getValue<App::GeoFeature*>(); App::GeoFeature* object = dynamic_cast<const App::PropertyLink*>(prop)->getValue<App::GeoFeature*>();
if (object) { if (object) {
float accuracy=0; float accuracy=0;
Base::Type meshId = Base::Type::fromName("Mesh::Feature"); Base::Type meshId = Base::Type::fromName("Mesh::Feature");
@ -260,10 +260,11 @@ void ViewProviderInspection::updateData(const App::Property* prop)
// force an update of the Inventor data nodes // force an update of the Inventor data nodes
if (this->pcObject) { if (this->pcObject) {
App::Property* link = this->pcObject->getPropertyByName("Actual"); App::Property* link = this->pcObject->getPropertyByName("Actual");
if (link) updateData(link); if (link)
} updateData(link);
setDistances(); setDistances();
} }
}
else if (prop->getTypeId() == App::PropertyFloat::getClassTypeId()) { else if (prop->getTypeId() == App::PropertyFloat::getClassTypeId()) {
if (strcmp(prop->getName(), "SearchRadius") == 0) { if (strcmp(prop->getName(), "SearchRadius") == 0) {
float fSearchRadius = ((App::PropertyFloat*)prop)->getValue(); float fSearchRadius = ((App::PropertyFloat*)prop)->getValue();
@ -281,6 +282,9 @@ SoSeparator* ViewProviderInspection::getFrontRoot(void) const
void ViewProviderInspection::setDistances() void ViewProviderInspection::setDistances()
{ {
if (!pcObject)
return;
App::Property* pDistances = pcObject->getPropertyByName("Distances"); App::Property* pDistances = pcObject->getPropertyByName("Distances");
if (!pDistances) { if (!pDistances) {
SoDebugError::post("ViewProviderInspection::setDistances", "Unknown property 'Distances'"); SoDebugError::post("ViewProviderInspection::setDistances", "Unknown property 'Distances'");

View File

@ -1570,24 +1570,24 @@ bool MeshAlgorithm::ConnectPolygons(std::list<std::vector<Base::Vector3f> > &clP
std::list<std::pair<Base::Vector3f, Base::Vector3f> > &rclLines) const std::list<std::pair<Base::Vector3f, Base::Vector3f> > &rclLines) const
{ {
for(std::list< std::vector<Base::Vector3f> >::iterator OutIter = clPolyList.begin(); OutIter != clPolyList.end(); ++OutIter) for (std::list< std::vector<Base::Vector3f> >::iterator OutIter = clPolyList.begin(); OutIter != clPolyList.end(); ++OutIter) {
{ if (OutIter->empty())
continue;
std::pair<Base::Vector3f,Base::Vector3f> currentSort; std::pair<Base::Vector3f,Base::Vector3f> currentSort;
float fDist = Base::Distance(OutIter->front(),OutIter->back()); float fDist = Base::Distance(OutIter->front(),OutIter->back());
currentSort.first = OutIter->front(); currentSort.first = OutIter->front();
currentSort.second = OutIter->back(); currentSort.second = OutIter->back();
for(std::list< std::vector<Base::Vector3f> >::iterator InnerIter = clPolyList.begin(); InnerIter != clPolyList.end(); ++InnerIter) for (std::list< std::vector<Base::Vector3f> >::iterator InnerIter = clPolyList.begin(); InnerIter != clPolyList.end(); ++InnerIter) {
{ if (OutIter == InnerIter)
if(OutIter == InnerIter) continue; continue;
if(Base::Distance(OutIter->front(),InnerIter->front()) < fDist) if (Base::Distance(OutIter->front(), InnerIter->front()) < fDist) {
{
currentSort.second = InnerIter->front(); currentSort.second = InnerIter->front();
fDist = Base::Distance(OutIter->front(),InnerIter->front()); fDist = Base::Distance(OutIter->front(),InnerIter->front());
} }
if(Base::Distance(OutIter->front(),InnerIter->back()) < fDist)
{ if (Base::Distance(OutIter->front(), InnerIter->back()) < fDist) {
currentSort.second = InnerIter->back(); currentSort.second = InnerIter->back();
fDist = Base::Distance(OutIter->front(),InnerIter->back()); fDist = Base::Distance(OutIter->front(),InnerIter->back());
} }

View File

@ -107,9 +107,11 @@ void Approximation::AddPoints(const std::list<Base::Vector3f> &rsPointList)
Base::Vector3f Approximation::GetGravity() const Base::Vector3f Approximation::GetGravity() const
{ {
Base::Vector3f clGravity; Base::Vector3f clGravity;
if (!_vPoints.empty()) {
for (std::list<Base::Vector3f>::const_iterator it = _vPoints.begin(); it!=_vPoints.end(); ++it) for (std::list<Base::Vector3f>::const_iterator it = _vPoints.begin(); it!=_vPoints.end(); ++it)
clGravity += *it; clGravity += *it;
clGravity *= 1.0f / float(_vPoints.size()); clGravity *= 1.0f / float(_vPoints.size());
}
return clGravity; return clGravity;
} }
@ -451,7 +453,7 @@ const double& QuadraticFit::GetCoeffArray() const
double QuadraticFit::GetCoeff(unsigned long ulIndex) const double QuadraticFit::GetCoeff(unsigned long ulIndex) const
{ {
assert( ulIndex >= 0 && ulIndex < 10 ); assert(ulIndex < 10);
if( _bIsFitted ) if( _bIsFitted )
return _fCoeff[ ulIndex ]; return _fCoeff[ ulIndex ];
@ -765,6 +767,7 @@ double SurfaceFit::PolynomFit()
// that 'sigma' becomes negative. // that 'sigma' becomes negative.
if (sigma < 0) if (sigma < 0)
sigma = 0; sigma = 0;
if (!_vPoints.empty())
sigma = sqrt(sigma/_vPoints.size()); sigma = sqrt(sigma/_vPoints.size());
_fLastResult = static_cast<float>(sigma); _fLastResult = static_cast<float>(sigma);

View File

@ -36,7 +36,7 @@
using namespace MeshCore; using namespace MeshCore;
MeshBuilder::MeshBuilder (MeshKernel& kernel) : _meshKernel(kernel), _seq(0) MeshBuilder::MeshBuilder (MeshKernel& kernel) : _meshKernel(kernel), _seq(0), _ptIdx(0)
{ {
_fSaveTolerance = MeshDefinitions::_fMinPointDistanceD1; _fSaveTolerance = MeshDefinitions::_fMinPointDistanceD1;
} }

View File

@ -508,7 +508,7 @@ void MeshEvalPointManifolds::GetFacetIndices (std::vector<unsigned long> &facets
bool MeshEvalSingleFacet::Evaluate () bool MeshEvalSingleFacet::Evaluate ()
{ {
// get all non-manifolds // get all non-manifolds
MeshEvalTopology::Evaluate(); (void)MeshEvalTopology::Evaluate();
/* /*
// for each (multiple) single linked facet there should // for each (multiple) single linked facet there should
// exist two valid facets sharing the same edge // exist two valid facets sharing the same edge

View File

@ -1794,6 +1794,7 @@ bool MeshOutput::SaveBinarySTL (std::ostream &rstrOut) const
Base::SequencerLauncher seq("saving...", _rclMesh.CountFacets() + 1); Base::SequencerLauncher seq("saving...", _rclMesh.CountFacets() + 1);
// stl_header has a length of 80
strcpy(szInfo, stl_header.c_str()); strcpy(szInfo, stl_header.c_str());
rstrOut.write(szInfo, std::strlen(szInfo)); rstrOut.write(szInfo, std::strlen(szInfo));

View File

@ -74,7 +74,6 @@ protected:
MeshKernel &_resultMesh; /** Result mesh */ MeshKernel &_resultMesh; /** Result mesh */
OperationType _operationType; /** Set Operation Type */ OperationType _operationType; /** Set Operation Type */
float _minDistanceToPoint; /** Minimal distance to facet corner points */ float _minDistanceToPoint; /** Minimal distance to facet corner points */
float _saveMinMeshDistance;
private: private:
// Helper class cutting edge to his two attached facets // Helper class cutting edge to his two attached facets

View File

@ -36,7 +36,11 @@
using namespace MeshCore; using namespace MeshCore;
AbstractSmoothing::AbstractSmoothing(MeshKernel& m) : kernel(m) AbstractSmoothing::AbstractSmoothing(MeshKernel& m)
: kernel(m)
, tolerance(0)
, component(Normal)
, continuity(C0)
{ {
} }

View File

@ -34,11 +34,13 @@
using namespace MeshCore; using namespace MeshCore;
MeshSearchNeighbours::MeshSearchNeighbours (const MeshKernel &rclM, float fSampleDistance) MeshSearchNeighbours::MeshSearchNeighbours (const MeshKernel &rclM, float fSampleDistance)
: _rclMesh(rclM), : _rclMesh(rclM)
_rclFAry(rclM.GetFacets()), , _rclFAry(rclM.GetFacets())
_rclPAry(rclM.GetPoints()), , _rclPAry(rclM.GetPoints())
_clPt2Fa(rclM), , _clPt2Fa(rclM)
_fSampleDistance(fSampleDistance) , _fMaxDistanceP2(0)
, _fSampleDistance(fSampleDistance)
, _bTooFewPoints(false)
{ {
MeshAlgorithm(_rclMesh).ResetFacetFlag(MeshFacet::MARKED); MeshAlgorithm(_rclMesh).ResetFacetFlag(MeshFacet::MARKED);
MeshAlgorithm(_rclMesh).ResetPointFlag(MeshPoint::MARKED); MeshAlgorithm(_rclMesh).ResetPointFlag(MeshPoint::MARKED);

View File

@ -409,7 +409,12 @@ namespace MeshGui {
/* TRANSLATOR MeshGui::MeshFillHole */ /* TRANSLATOR MeshGui::MeshFillHole */
MeshFillHole::MeshFillHole(MeshHoleFiller& hf, Gui::View3DInventor* parent) MeshFillHole::MeshFillHole(MeshHoleFiller& hf, Gui::View3DInventor* parent)
: QObject(parent), myMesh(0), myNumPoints(0), myHoleFiller(hf) : QObject(parent)
, myMesh(0)
, myNumPoints(0)
, myVertex1(0)
, myVertex2(0)
, myHoleFiller(hf)
{ {
myBoundariesRoot = new SoSeparator; myBoundariesRoot = new SoSeparator;
myBoundariesRoot->ref(); myBoundariesRoot->ref();

View File

@ -78,6 +78,9 @@ unsigned char MeshSelection::cross_mask_bitmap[] = {
MeshSelection::MeshSelection() MeshSelection::MeshSelection()
: onlyPointToUserTriangles(false) : onlyPointToUserTriangles(false)
, onlyVisibleTriangles(false) , onlyVisibleTriangles(false)
, addToSelection(false)
, addComponent(false)
, removeComponent(false)
, activeCB(0) , activeCB(0)
, selectionCB(0) , selectionCB(0)
, ivViewer(0) , ivViewer(0)

View File

@ -588,7 +588,10 @@ void SoFCMeshObjectShape::initClass()
SO_NODE_INIT_CLASS(SoFCMeshObjectShape, SoShape, "Shape"); SO_NODE_INIT_CLASS(SoFCMeshObjectShape, SoShape, "Shape");
} }
SoFCMeshObjectShape::SoFCMeshObjectShape() : renderTriangleLimit(100000), meshChanged(true) SoFCMeshObjectShape::SoFCMeshObjectShape()
: renderTriangleLimit(100000)
, meshChanged(true)
, selectBuf(0)
{ {
SO_NODE_CONSTRUCTOR(SoFCMeshObjectShape); SO_NODE_CONSTRUCTOR(SoFCMeshObjectShape);
setName(SoFCMeshObjectShape::getClassTypeId().getName()); setName(SoFCMeshObjectShape::getClassTypeId().getName());

View File

@ -1028,7 +1028,7 @@ void ViewProviderMesh::getFacetsFromPolygon(const std::vector<SbVec2f>& picked,
std::vector<unsigned long>& indices) const std::vector<unsigned long>& indices) const
{ {
#if 1 #if 1
bool ok = true; const bool ok = true;
Base::Polygon2D polygon; Base::Polygon2D polygon;
for (std::vector<SbVec2f>::const_iterator it = picked.begin(); it != picked.end(); ++it) for (std::vector<SbVec2f>::const_iterator it = picked.begin(); it != picked.end(); ++it)
polygon.Add(Base::Vector2D((*it)[0],(*it)[1])); polygon.Add(Base::Vector2D((*it)[0],(*it)[1]));
@ -1890,6 +1890,8 @@ PROPERTY_SOURCE(MeshGui::ViewProviderIndexedFaceSet, MeshGui::ViewProviderMesh)
ViewProviderIndexedFaceSet::ViewProviderIndexedFaceSet() ViewProviderIndexedFaceSet::ViewProviderIndexedFaceSet()
{ {
pcMeshCoord = 0;
pcMeshFaces = 0;
} }
ViewProviderIndexedFaceSet::~ViewProviderIndexedFaceSet() ViewProviderIndexedFaceSet::~ViewProviderIndexedFaceSet()
@ -1979,6 +1981,8 @@ PROPERTY_SOURCE(MeshGui::ViewProviderMeshObject, MeshGui::ViewProviderMesh)
ViewProviderMeshObject::ViewProviderMeshObject() ViewProviderMeshObject::ViewProviderMeshObject()
{ {
pcMeshNode = 0;
pcMeshShape = 0;
} }
ViewProviderMeshObject::~ViewProviderMeshObject() ViewProviderMeshObject::~ViewProviderMeshObject()

View File

@ -145,7 +145,7 @@ void ViewProviderMeshOrientation::attach(App::DocumentObject* pcFeat)
void ViewProviderMeshOrientation::showDefects(const std::vector<unsigned long>& inds) void ViewProviderMeshOrientation::showDefects(const std::vector<unsigned long>& inds)
{ {
Mesh::Feature* f = dynamic_cast<Mesh::Feature*>(pcObject); Mesh::Feature* f = static_cast<Mesh::Feature*>(pcObject);
const MeshCore::MeshKernel & rMesh = f->Mesh.getValue().getKernel(); const MeshCore::MeshKernel & rMesh = f->Mesh.getValue().getKernel();
pcCoords->point.deleteValues(0); pcCoords->point.deleteValues(0);
@ -212,7 +212,7 @@ void ViewProviderMeshNonManifolds::showDefects(const std::vector<unsigned long>&
{ {
if ((inds.size() % 2) != 0) if ((inds.size() % 2) != 0)
return; return;
Mesh::Feature* f = dynamic_cast<Mesh::Feature*>(pcObject); Mesh::Feature* f = static_cast<Mesh::Feature*>(pcObject);
const MeshCore::MeshKernel & rMesh = f->Mesh.getValue().getKernel(); const MeshCore::MeshKernel & rMesh = f->Mesh.getValue().getKernel();
pcCoords->point.deleteValues(0); pcCoords->point.deleteValues(0);
@ -275,7 +275,7 @@ void ViewProviderMeshNonManifoldPoints::attach(App::DocumentObject* pcFeat)
void ViewProviderMeshNonManifoldPoints::showDefects(const std::vector<unsigned long>& inds) void ViewProviderMeshNonManifoldPoints::showDefects(const std::vector<unsigned long>& inds)
{ {
Mesh::Feature* f = dynamic_cast<Mesh::Feature*>(pcObject); Mesh::Feature* f = static_cast<Mesh::Feature*>(pcObject);
const MeshCore::MeshKernel & rMesh = f->Mesh.getValue().getKernel(); const MeshCore::MeshKernel & rMesh = f->Mesh.getValue().getKernel();
pcCoords->point.deleteValues(0); pcCoords->point.deleteValues(0);
pcCoords->point.setNum(inds.size()); pcCoords->point.setNum(inds.size());
@ -339,7 +339,7 @@ void ViewProviderMeshDuplicatedFaces::attach(App::DocumentObject* pcFeat)
void ViewProviderMeshDuplicatedFaces::showDefects(const std::vector<unsigned long>& inds) void ViewProviderMeshDuplicatedFaces::showDefects(const std::vector<unsigned long>& inds)
{ {
Mesh::Feature* f = dynamic_cast<Mesh::Feature*>(pcObject); Mesh::Feature* f = static_cast<Mesh::Feature*>(pcObject);
const MeshCore::MeshKernel & rMesh = f->Mesh.getValue().getKernel(); const MeshCore::MeshKernel & rMesh = f->Mesh.getValue().getKernel();
pcCoords->point.deleteValues(0); pcCoords->point.deleteValues(0);
@ -404,7 +404,7 @@ void ViewProviderMeshDuplicatedPoints::attach(App::DocumentObject* pcFeat)
void ViewProviderMeshDuplicatedPoints::showDefects(const std::vector<unsigned long>& inds) void ViewProviderMeshDuplicatedPoints::showDefects(const std::vector<unsigned long>& inds)
{ {
Mesh::Feature* f = dynamic_cast<Mesh::Feature*>(pcObject); Mesh::Feature* f = static_cast<Mesh::Feature*>(pcObject);
const MeshCore::MeshKernel & rMesh = f->Mesh.getValue().getKernel(); const MeshCore::MeshKernel & rMesh = f->Mesh.getValue().getKernel();
pcCoords->point.deleteValues(0); pcCoords->point.deleteValues(0);
pcCoords->point.setNum(inds.size()); pcCoords->point.setNum(inds.size());
@ -461,7 +461,7 @@ void ViewProviderMeshDegenerations::attach(App::DocumentObject* pcFeat)
void ViewProviderMeshDegenerations::showDefects(const std::vector<unsigned long>& inds) void ViewProviderMeshDegenerations::showDefects(const std::vector<unsigned long>& inds)
{ {
Mesh::Feature* f = dynamic_cast<Mesh::Feature*>(pcObject); Mesh::Feature* f = static_cast<Mesh::Feature*>(pcObject);
const MeshCore::MeshKernel & rMesh = f->Mesh.getValue().getKernel(); const MeshCore::MeshKernel & rMesh = f->Mesh.getValue().getKernel();
pcCoords->point.deleteValues(0); pcCoords->point.deleteValues(0);
@ -567,7 +567,7 @@ void ViewProviderMeshIndices::attach(App::DocumentObject* pcFeat)
void ViewProviderMeshIndices::showDefects(const std::vector<unsigned long>& inds) void ViewProviderMeshIndices::showDefects(const std::vector<unsigned long>& inds)
{ {
Mesh::Feature* f = dynamic_cast<Mesh::Feature*>(pcObject); Mesh::Feature* f = static_cast<Mesh::Feature*>(pcObject);
const MeshCore::MeshKernel & rMesh = f->Mesh.getValue().getKernel(); const MeshCore::MeshKernel & rMesh = f->Mesh.getValue().getKernel();
if (!inds.empty()) { if (!inds.empty()) {
@ -636,7 +636,7 @@ void ViewProviderMeshSelfIntersections::showDefects(const std::vector<unsigned l
{ {
if (indices.size() % 2 != 0) if (indices.size() % 2 != 0)
return; return;
Mesh::Feature* f = dynamic_cast<Mesh::Feature*>(pcObject); Mesh::Feature* f = static_cast<Mesh::Feature*>(pcObject);
const MeshCore::MeshKernel & rMesh = f->Mesh.getValue().getKernel(); const MeshCore::MeshKernel & rMesh = f->Mesh.getValue().getKernel();
MeshCore::MeshEvalSelfIntersection eval(rMesh); MeshCore::MeshEvalSelfIntersection eval(rMesh);
@ -714,7 +714,7 @@ void ViewProviderMeshFolds::attach(App::DocumentObject* pcFeat)
void ViewProviderMeshFolds::showDefects(const std::vector<unsigned long>& inds) void ViewProviderMeshFolds::showDefects(const std::vector<unsigned long>& inds)
{ {
Mesh::Feature* f = dynamic_cast<Mesh::Feature*>(pcObject); Mesh::Feature* f = static_cast<Mesh::Feature*>(pcObject);
const MeshCore::MeshKernel & rMesh = f->Mesh.getValue().getKernel(); const MeshCore::MeshKernel & rMesh = f->Mesh.getValue().getKernel();
pcCoords->point.deleteValues(0); pcCoords->point.deleteValues(0);

View File

@ -65,6 +65,8 @@ ViewProviderMeshTransformDemolding::ViewProviderMeshTransformDemolding()
{ {
pcTrackballDragger = new SoTrackballDragger; pcTrackballDragger = new SoTrackballDragger;
pcTrackballDragger->ref(); pcTrackballDragger->ref();
pcTransformDrag = 0;
pcColorMat = 0;
} }
ViewProviderMeshTransformDemolding::~ViewProviderMeshTransformDemolding() ViewProviderMeshTransformDemolding::~ViewProviderMeshTransformDemolding()
@ -122,7 +124,7 @@ void ViewProviderMeshTransformDemolding::attach(App::DocumentObject *pcFeat)
calcNormalVector(); calcNormalVector();
calcMaterialIndex(SbRotation()); calcMaterialIndex(SbRotation());
// geting center point // geting center point
center = dynamic_cast<Feature*>(pcObject)->Mesh.getValue().getKernel().GetBoundBox().GetCenter(); center = static_cast<Feature*>(pcObject)->Mesh.getValue().getKernel().GetBoundBox().GetCenter();
//SoGetBoundingBoxAction boxAction; //SoGetBoundingBoxAction boxAction;
//pcHighlight->getBoundingBox(&boxAction); //pcHighlight->getBoundingBox(&boxAction);
@ -131,7 +133,7 @@ void ViewProviderMeshTransformDemolding::attach(App::DocumentObject *pcFeat)
void ViewProviderMeshTransformDemolding::calcNormalVector(void) void ViewProviderMeshTransformDemolding::calcNormalVector(void)
{ {
const MeshKernel& cMesh = dynamic_cast<Feature*>(pcObject)->Mesh.getValue().getKernel(); const MeshKernel& cMesh = static_cast<Feature*>(pcObject)->Mesh.getValue().getKernel();
MeshFacetIterator cFIt(cMesh); MeshFacetIterator cFIt(cMesh);
for( cFIt.Init(); cFIt.More(); cFIt.Next()) for( cFIt.Init(); cFIt.More(); cFIt.Next())

View File

@ -298,10 +298,18 @@ void PointsGrid::CalculateGridLength (unsigned long ulCtGrid, unsigned long ulMa
double fVol = fVolElem * float(ulCtGrid); double fVol = fVolElem * float(ulCtGrid);
double fGridLen = float(pow((float)fVol,(float) 1.0f / 3.0f)); double fGridLen = float(pow((float)fVol,(float) 1.0f / 3.0f));
if (fGridLen > 0) {
_ulCtGridsX = std::max<unsigned long>((unsigned long)(clBBPtsEnlarged.LengthX() / fGridLen), 1); _ulCtGridsX = std::max<unsigned long>((unsigned long)(clBBPtsEnlarged.LengthX() / fGridLen), 1);
_ulCtGridsY = std::max<unsigned long>((unsigned long)(clBBPtsEnlarged.LengthY() / fGridLen), 1); _ulCtGridsY = std::max<unsigned long>((unsigned long)(clBBPtsEnlarged.LengthY() / fGridLen), 1);
_ulCtGridsZ = std::max<unsigned long>((unsigned long)(clBBPtsEnlarged.LengthZ() / fGridLen), 1); _ulCtGridsZ = std::max<unsigned long>((unsigned long)(clBBPtsEnlarged.LengthZ() / fGridLen), 1);
} }
else {
// Degenerated grid
_ulCtGridsX = 1;
_ulCtGridsY = 1;
_ulCtGridsZ = 1;
}
}
void PointsGrid::CalculateGridLength (int iCtGridPerAxis) void PointsGrid::CalculateGridLength (int iCtGridPerAxis)
{ {