avoid several implicit conversions, replace several old C-casts, other minor changes
This commit is contained in:
@@ -267,7 +267,7 @@ public:
|
||||
/**
|
||||
* Destruction
|
||||
*/
|
||||
virtual ~QuadraticFit(){};
|
||||
virtual ~QuadraticFit(){}
|
||||
/**
|
||||
* Get the quadric coefficients
|
||||
* @param ulIndex Number of coefficient (0..9)
|
||||
@@ -515,7 +515,9 @@ public:
|
||||
Base::Vector3f GetGradient( double x, double y, double z ) const
|
||||
{
|
||||
Wm4::Vector3<double> grad = pImplSurf->GetGradient( Wm4::Vector3<double>(x, y, z) );
|
||||
return Base::Vector3f( (float)grad.X(), (float)grad.Y(), (float)grad.Z() );
|
||||
return Base::Vector3f(static_cast<float>(grad.X()),
|
||||
static_cast<float>(grad.Y()),
|
||||
static_cast<float>(grad.Z()));
|
||||
}
|
||||
|
||||
Base::Matrix4D GetHessian( double x, double y, double z ) const
|
||||
@@ -535,16 +537,16 @@ public:
|
||||
double zx = - ( Fx(x,y,z) / dQuot );
|
||||
double zy = - ( Fy(x,y,z) / dQuot );
|
||||
|
||||
double zxx = - ( 2.0f * ( dKoeff[5] + dKoeff[6] * zx * zx + dKoeff[8] * zx ) ) / dQuot;
|
||||
double zyy = - ( 2.0f * ( dKoeff[5] + dKoeff[6] * zy * zy + dKoeff[9] * zy ) ) / dQuot;
|
||||
double zxx = - ( 2.0 * ( dKoeff[5] + dKoeff[6] * zx * zx + dKoeff[8] * zx ) ) / dQuot;
|
||||
double zyy = - ( 2.0 * ( dKoeff[5] + dKoeff[6] * zy * zy + dKoeff[9] * zy ) ) / dQuot;
|
||||
double zxy = - ( dKoeff[6] * zx * zy + dKoeff[7] + dKoeff[8] * zy + dKoeff[9] * zx ) / dQuot;
|
||||
|
||||
double dNen = 1 + zx*zx + zy*zy;
|
||||
double dNenSqrt = (double)sqrt( dNen );
|
||||
double dNenSqrt = sqrt( dNen );
|
||||
double K = ( zxx * zyy - zxy * zxy ) / ( dNen * dNen );
|
||||
double H = 0.5f * ( ( 1.0f+zx*zx - 2*zx*zy*zxy + (1.0f+zy*zy)*zxx ) / ( dNenSqrt * dNenSqrt * dNenSqrt ) ) ;
|
||||
double H = 0.5 * ( ( 1.0+zx*zx - 2*zx*zy*zxy + (1.0+zy*zy)*zxx ) / ( dNenSqrt * dNenSqrt * dNenSqrt ) ) ;
|
||||
|
||||
double dDiscr = (double)sqrt(fabs(H*H-K));
|
||||
double dDiscr = sqrt(fabs(H*H-K));
|
||||
rfCurv0 = H - dDiscr;
|
||||
rfCurv1 = H + dDiscr;
|
||||
|
||||
@@ -562,22 +564,22 @@ public:
|
||||
//+++++++++ 1. derivations ++++++++++++++++++++++++++++++++
|
||||
double Fx ( double x, double y, double z )
|
||||
{
|
||||
return( dKoeff[1] + 2.0f*dKoeff[4]*x + dKoeff[7]*y + dKoeff[8]*z );
|
||||
return( dKoeff[1] + 2.0*dKoeff[4]*x + dKoeff[7]*y + dKoeff[8]*z );
|
||||
}
|
||||
double Fy ( double x, double y, double z )
|
||||
{
|
||||
return( dKoeff[2] + 2.0f*dKoeff[5]*y + dKoeff[7]*x + dKoeff[9]*z );
|
||||
return( dKoeff[2] + 2.0*dKoeff[5]*y + dKoeff[7]*x + dKoeff[9]*z );
|
||||
}
|
||||
double Fz ( double x, double y, double z )
|
||||
{
|
||||
return( dKoeff[3] + 2.0f*dKoeff[6]*z + dKoeff[8]*x + dKoeff[9]*y );
|
||||
return( dKoeff[3] + 2.0*dKoeff[6]*z + dKoeff[8]*x + dKoeff[9]*y );
|
||||
}
|
||||
|
||||
//+++++++++ 2. derivations ++++++++++++++++++++++++++++++++
|
||||
double Fxx( double x, double y, double z )
|
||||
{
|
||||
(void)x; (void)y; (void)z;
|
||||
return( 2.0f*dKoeff[4] );
|
||||
return( 2.0*dKoeff[4] );
|
||||
}
|
||||
double Fxy( double x, double y, double z )
|
||||
{
|
||||
@@ -592,7 +594,7 @@ public:
|
||||
double Fyy( double x, double y, double z )
|
||||
{
|
||||
(void)x; (void)y; (void)z;
|
||||
return( 2.0f*dKoeff[5] );
|
||||
return( 2.0*dKoeff[5] );
|
||||
}
|
||||
double Fyz( double x, double y, double z )
|
||||
{
|
||||
@@ -602,7 +604,7 @@ public:
|
||||
double Fzz( double x, double y, double z )
|
||||
{
|
||||
(void)x; (void)y; (void)z;
|
||||
return( 2.0f*dKoeff[6] );
|
||||
return( 2.0*dKoeff[6] );
|
||||
}
|
||||
|
||||
protected:
|
||||
@@ -613,7 +615,7 @@ private:
|
||||
/**
|
||||
* Private construction.
|
||||
*/
|
||||
FunctionContainer(){};
|
||||
FunctionContainer(){}
|
||||
};
|
||||
|
||||
class MeshExport PolynomialFit : public Approximation
|
||||
|
||||
@@ -533,7 +533,7 @@ bool MeshGeomFacet::IsDegenerated(float epsilon) const
|
||||
Base::Vector3d u = p2 - p1;
|
||||
Base::Vector3d v = p3 - p1;
|
||||
|
||||
double eps = epsilon;
|
||||
double eps = static_cast<double>(epsilon);
|
||||
double uu = u*u;
|
||||
if (uu <= eps)
|
||||
return true;
|
||||
@@ -991,15 +991,15 @@ int MeshGeomFacet::IntersectWithFacet (const MeshGeomFacet& rclFacet,
|
||||
// Note: The algorithm delivers sometimes false-positives, i.e. it claims
|
||||
// that the two triangles intersect but they don't. It seems that this bad
|
||||
// behaviour occurs if the triangles are nearly co-planar
|
||||
float mult = (float)fabs(this->GetNormal() * rclFacet.GetNormal());
|
||||
float mult = fabs(this->GetNormal() * rclFacet.GetNormal());
|
||||
if (rclPt0 == rclPt1) {
|
||||
if (mult < 0.995) // not co-planar, thus no test needed
|
||||
if (mult < 0.995f) // not co-planar, thus no test needed
|
||||
return 1;
|
||||
if (this->IsPointOf(rclPt0) && rclFacet.IsPointOf(rclPt0))
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
if (mult < 0.995) // not co-planar, thus no test needed
|
||||
if (mult < 0.995f) // not co-planar, thus no test needed
|
||||
return 2;
|
||||
if (this->IsPointOf(rclPt0) && rclFacet.IsPointOf(rclPt0) &&
|
||||
this->IsPointOf(rclPt1) && rclFacet.IsPointOf(rclPt1))
|
||||
@@ -1085,9 +1085,9 @@ float MeshGeomFacet::CenterOfCircumCircle(Base::Vector3f& rclCenter) const
|
||||
float vw = - (v * w);
|
||||
float uw = - (w * u);
|
||||
|
||||
float w0 = (float)(2 * sqrt(uu * ww - uw * uw) * uw / (uu * ww));
|
||||
float w1 = (float)(2 * sqrt(uu * vv - uv * uv) * uv / (uu * vv));
|
||||
float w2 = (float)(2 * sqrt(vv * ww - vw * vw) * vw / (vv * ww));
|
||||
float w0 = static_cast<float>(2 * sqrt(uu * ww - uw * uw) * uw / (uu * ww));
|
||||
float w1 = static_cast<float>(2 * sqrt(uu * vv - uv * uv) * uv / (uu * vv));
|
||||
float w2 = static_cast<float>(2 * sqrt(vv * ww - vw * vw) * vw / (vv * ww));
|
||||
|
||||
// center of the circle
|
||||
float wx = w0 + w1 + w2;
|
||||
@@ -1096,7 +1096,7 @@ float MeshGeomFacet::CenterOfCircumCircle(Base::Vector3f& rclCenter) const
|
||||
rclCenter.z = (w0*p0.z + w1*p1.z + w2*p2.z)/wx;
|
||||
|
||||
// radius of the circle
|
||||
float fRadius = (float)(sqrt(uu * vv * ww) / (4 * Area()));
|
||||
float fRadius = static_cast<float>(sqrt(uu * vv * ww) / (4 * Area()));
|
||||
|
||||
return fRadius;
|
||||
}
|
||||
@@ -1378,10 +1378,19 @@ float MeshGeomFacet::AspectRatio2() const
|
||||
float MeshGeomFacet::Roundness() const
|
||||
{
|
||||
const double FOUR_ROOT3 = 6.928203230275509;
|
||||
double area = Area();
|
||||
double area = static_cast<double>(Area());
|
||||
Base::Vector3f d0 = _aclPoints[0] - _aclPoints[1];
|
||||
Base::Vector3f d1 = _aclPoints[1] - _aclPoints[2];
|
||||
Base::Vector3f d2 = _aclPoints[2] - _aclPoints[0];
|
||||
|
||||
return (float) (FOUR_ROOT3 * area / (d0.Sqr() + d1.Sqr() + d2.Sqr()));
|
||||
double sum = static_cast<double>(d0.Sqr() + d1.Sqr() + d2.Sqr());
|
||||
return static_cast<float>(FOUR_ROOT3 * area / sum);
|
||||
}
|
||||
|
||||
void MeshGeomFacet::Transform(const Base::Matrix4D& mat)
|
||||
{
|
||||
mat.multVec(_aclPoints[0], _aclPoints[0]);
|
||||
mat.multVec(_aclPoints[1], _aclPoints[1]);
|
||||
mat.multVec(_aclPoints[2], _aclPoints[2]);
|
||||
NormalInvalid();
|
||||
}
|
||||
|
||||
@@ -121,11 +121,11 @@ public:
|
||||
*/
|
||||
//@{
|
||||
void SetFlag (TFlagType tF) const
|
||||
{ const_cast<MeshPoint*>(this)->_ucFlag |= (unsigned char)(tF); }
|
||||
{ const_cast<MeshPoint*>(this)->_ucFlag |= static_cast<unsigned char>(tF); }
|
||||
void ResetFlag (TFlagType tF) const
|
||||
{ const_cast<MeshPoint*>(this)->_ucFlag &= ~(unsigned char)(tF); }
|
||||
{ const_cast<MeshPoint*>(this)->_ucFlag &= ~static_cast<unsigned char>(tF); }
|
||||
bool IsFlag (TFlagType tF) const
|
||||
{ return (_ucFlag & (unsigned char)(tF)) == (unsigned char)(tF); }
|
||||
{ return (_ucFlag & static_cast<unsigned char>(tF)) == static_cast<unsigned char>(tF); }
|
||||
void ResetInvalid (void) const
|
||||
{ ResetFlag(INVALID); }
|
||||
void SetInvalid (void) const
|
||||
@@ -226,11 +226,11 @@ public:
|
||||
*/
|
||||
//@{
|
||||
void SetFlag (TFlagType tF) const
|
||||
{ const_cast<MeshFacet*>(this)->_ucFlag |= (unsigned char)(tF); }
|
||||
{ const_cast<MeshFacet*>(this)->_ucFlag |= static_cast<unsigned char>(tF); }
|
||||
void ResetFlag (TFlagType tF) const
|
||||
{ const_cast<MeshFacet*>(this)->_ucFlag &= ~(unsigned char)(tF); }
|
||||
{ const_cast<MeshFacet*>(this)->_ucFlag &= ~static_cast<unsigned char>(tF); }
|
||||
bool IsFlag (TFlagType tF) const
|
||||
{ return (_ucFlag & (unsigned char)(tF)) == (unsigned char)(tF); }
|
||||
{ return (_ucFlag & static_cast<unsigned char>(tF)) == static_cast<unsigned char>(tF); }
|
||||
void ResetInvalid (void) const
|
||||
{ ResetFlag(INVALID); }
|
||||
void SetProperty(unsigned long uP) const
|
||||
@@ -412,17 +412,17 @@ public:
|
||||
* Adjusts the facet's orientation to its normal.
|
||||
*/
|
||||
inline void AdjustCirculationDirection (void);
|
||||
/** Checks if the normal is not yet calculated. */
|
||||
/** Invalidate the normal. It will be recomputed when querying it. */
|
||||
void NormalInvalid (void) { _bNormalCalculated = false; }
|
||||
/** Query the flag state of the facet. */
|
||||
bool IsFlag (MeshFacet::TFlagType tF) const
|
||||
{ return (_ucFlag & (unsigned char)(tF)) == (unsigned char)(tF); }
|
||||
{ return (_ucFlag & static_cast<unsigned char>(tF)) == static_cast<unsigned char>(tF); }
|
||||
/** Set flag state */
|
||||
void SetFlag (MeshFacet::TFlagType tF)
|
||||
{ _ucFlag |= (unsigned char)(tF); }
|
||||
{ _ucFlag |= static_cast<unsigned char>(tF); }
|
||||
/** Reset flag state */
|
||||
void ResetFlag (MeshFacet::TFlagType tF)
|
||||
{ _ucFlag &= ~(unsigned char)(tF); }
|
||||
{ _ucFlag &= ~static_cast<unsigned char>(tF); }
|
||||
/** Calculates the facet's gravity point. */
|
||||
inline Base::Vector3f GetGravityPoint (void) const;
|
||||
/** Returns the normal of the facet. */
|
||||
@@ -517,6 +517,9 @@ public:
|
||||
/** The roundness is in the range between 0.0 (colinear) and 1.0 (equilateral).
|
||||
*/
|
||||
float Roundness() const;
|
||||
/** Apply a transformation on the triangle.
|
||||
*/
|
||||
void Transform(const Base::Matrix4D&);
|
||||
|
||||
protected:
|
||||
Base::Vector3f _clNormal; /**< Normal of the facet. */
|
||||
|
||||
@@ -239,7 +239,7 @@ public:
|
||||
void GetFacetIndices (std::vector<unsigned long> &facets) const;
|
||||
const std::list<std::vector<unsigned long> >& GetFacetIndices () const { return facetsOfNonManifoldPoints; }
|
||||
const std::vector<unsigned long>& GetIndices() const { return nonManifoldPoints; }
|
||||
unsigned long CountManifolds() const { return nonManifoldPoints.size(); }
|
||||
unsigned long CountManifolds() const { return static_cast<unsigned long>(nonManifoldPoints.size()); }
|
||||
|
||||
protected:
|
||||
std::vector<unsigned long> nonManifoldPoints;
|
||||
|
||||
@@ -125,7 +125,7 @@ public:
|
||||
bool GetPositionToIndex(unsigned long id, unsigned long& ulX, unsigned long& ulY, unsigned long& ulZ) const;
|
||||
/** Returns the number of elements in a given grid. */
|
||||
unsigned long GetCtElements(unsigned long ulX, unsigned long ulY, unsigned long ulZ) const
|
||||
{ return _aulGrid[ulX][ulY][ulZ].size(); }
|
||||
{ return static_cast<unsigned long>(_aulGrid[ulX][ulY][ulZ].size()); }
|
||||
/** Validates the grid structure and rebuilds it if needed. Must be implemented in sub-classes. */
|
||||
virtual void Validate (const MeshKernel &rclM) = 0;
|
||||
/** Verifies the grid structure and returns false if inconsistencies are found. */
|
||||
@@ -395,9 +395,9 @@ inline bool MeshGrid::CheckPos (unsigned long ulX, unsigned long ulY, unsigned l
|
||||
|
||||
inline void MeshFacetGrid::Pos (const Base::Vector3f &rclPoint, unsigned long &rulX, unsigned long &rulY, unsigned long &rulZ) const
|
||||
{
|
||||
rulX = (unsigned long)((rclPoint.x - _fMinX) / _fGridLenX);
|
||||
rulY = (unsigned long)((rclPoint.y - _fMinY) / _fGridLenY);
|
||||
rulZ = (unsigned long)((rclPoint.z - _fMinZ) / _fGridLenZ);
|
||||
rulX = static_cast<unsigned long>((rclPoint.x - _fMinX) / _fGridLenX);
|
||||
rulY = static_cast<unsigned long>((rclPoint.y - _fMinY) / _fGridLenY);
|
||||
rulZ = static_cast<unsigned long>((rclPoint.z - _fMinZ) / _fGridLenZ);
|
||||
|
||||
assert((rulX < _ulCtGridsX) && (rulY < _ulCtGridsY) && (rulZ < _ulCtGridsZ));
|
||||
}
|
||||
@@ -408,7 +408,7 @@ inline void MeshFacetGrid::PosWithCheck (const Base::Vector3f &rclPoint, unsigne
|
||||
rulX = 0;
|
||||
else
|
||||
{
|
||||
rulX = (unsigned long)((rclPoint.x - _fMinX) / _fGridLenX);
|
||||
rulX = static_cast<unsigned long>((rclPoint.x - _fMinX) / _fGridLenX);
|
||||
if (rulX >= _ulCtGridsX)
|
||||
rulX = (_ulCtGridsX-1);
|
||||
}
|
||||
@@ -417,7 +417,7 @@ inline void MeshFacetGrid::PosWithCheck (const Base::Vector3f &rclPoint, unsigne
|
||||
rulY = 0;
|
||||
else
|
||||
{
|
||||
rulY = (unsigned long)((rclPoint.y - _fMinY) / _fGridLenY);
|
||||
rulY = static_cast<unsigned long>((rclPoint.y - _fMinY) / _fGridLenY);
|
||||
if (rulY >= _ulCtGridsY)
|
||||
rulY = (_ulCtGridsY-1);
|
||||
}
|
||||
@@ -426,7 +426,7 @@ inline void MeshFacetGrid::PosWithCheck (const Base::Vector3f &rclPoint, unsigne
|
||||
rulZ = 0;
|
||||
else
|
||||
{
|
||||
rulZ = (unsigned long)((rclPoint.z - _fMinZ) / _fGridLenZ);
|
||||
rulZ = static_cast<unsigned long>((rclPoint.z - _fMinZ) / _fGridLenZ);
|
||||
if (rulZ >= _ulCtGridsZ)
|
||||
rulZ = (_ulCtGridsZ-1);
|
||||
}
|
||||
|
||||
@@ -43,6 +43,7 @@ class MeshHelpEdge;
|
||||
* The MeshFacetIterator allows to iterate over the facets that
|
||||
* hold the topology of the mesh and provides access to their
|
||||
* geometric information.
|
||||
* \note This class is not thread-safe.
|
||||
*/
|
||||
class MeshFacetIterator
|
||||
{
|
||||
@@ -167,6 +168,7 @@ protected:
|
||||
/**
|
||||
* The MeshPointIterator allows to iterate over the vertices of the mesh and provides access to their
|
||||
* geometric information.
|
||||
* \note This class is not thread-safe.
|
||||
*/
|
||||
class MeshExport MeshPointIterator
|
||||
{
|
||||
|
||||
@@ -719,7 +719,7 @@ bool MeshInput::LoadPLY (std::istream &inp)
|
||||
str >> space_format_string >> std::ws
|
||||
>> format_string >> space_format_version
|
||||
>> std::ws >> version;
|
||||
if (!str || !str.eof() ||
|
||||
if (/*!str || !str.eof() ||*/
|
||||
!std::isspace(space_format_string) ||
|
||||
!std::isspace(space_format_version)) {
|
||||
return false;
|
||||
@@ -749,7 +749,7 @@ bool MeshInput::LoadPLY (std::istream &inp)
|
||||
str >> space_element_name >> std::ws
|
||||
>> name >> space_name_count >> std::ws
|
||||
>> count;
|
||||
if (!str || !str.eof() ||
|
||||
if (/*!str || !str.eof() ||*/
|
||||
!std::isspace(space_element_name) ||
|
||||
!std::isspace(space_name_count)) {
|
||||
return false;
|
||||
|
||||
@@ -13,7 +13,9 @@
|
||||
#include <vector>
|
||||
#include <Base/Vector3D.h>
|
||||
|
||||
#ifndef _USE_MATH_DEFINES
|
||||
#define _USE_MATH_DEFINES
|
||||
#endif
|
||||
|
||||
typedef Base::Vector3f vec3f;
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ void PlaneFitSmoothing::Smooth(unsigned int iterations)
|
||||
center += v_beg[*cv_it];
|
||||
}
|
||||
|
||||
float scale = 1.0f/((float)cv.size()+1.0f);
|
||||
float scale = 1.0f/(static_cast<float>(cv.size())+1.0f);
|
||||
center.Scale(scale,scale,scale);
|
||||
|
||||
// get the mean plane of the current vertex with the surrounding vertices
|
||||
@@ -98,11 +98,11 @@ void PlaneFitSmoothing::Smooth(unsigned int iterations)
|
||||
|
||||
// look in which direction we should move the vertex
|
||||
L.Set(v_it->x - center.x, v_it->y - center.y, v_it->z - center.z);
|
||||
if (N*L < 0.0)
|
||||
if (N*L < 0.0f)
|
||||
N.Scale(-1.0, -1.0, -1.0);
|
||||
|
||||
// maximum value to move is distance to mean plane
|
||||
float d = std::min<float>((float)fabs(this->tolerance),(float)fabs(N*L));
|
||||
float d = std::min<float>(fabs(this->tolerance),fabs(N*L));
|
||||
N.Scale(d,d,d);
|
||||
|
||||
PointArray[v_it.Position()].Set(v_it->x - N.x, v_it->y - N.y, v_it->z - N.z);
|
||||
@@ -142,7 +142,7 @@ void PlaneFitSmoothing::SmoothPoints(unsigned int iterations, const std::vector<
|
||||
center += v_beg[*cv_it];
|
||||
}
|
||||
|
||||
float scale = 1.0f/((float)cv.size()+1.0f);
|
||||
float scale = 1.0f/(static_cast<float>(cv.size())+1.0f);
|
||||
center.Scale(scale,scale,scale);
|
||||
|
||||
// get the mean plane of the current vertex with the surrounding vertices
|
||||
@@ -152,11 +152,11 @@ void PlaneFitSmoothing::SmoothPoints(unsigned int iterations, const std::vector<
|
||||
|
||||
// look in which direction we should move the vertex
|
||||
L.Set(v_it->x - center.x, v_it->y - center.y, v_it->z - center.z);
|
||||
if (N*L < 0.0)
|
||||
if (N*L < 0.0f)
|
||||
N.Scale(-1.0, -1.0, -1.0);
|
||||
|
||||
// maximum value to move is distance to mean plane
|
||||
float d = std::min<float>((float)fabs(this->tolerance),(float)fabs(N*L));
|
||||
float d = std::min<float>(fabs(this->tolerance),fabs(N*L));
|
||||
N.Scale(d,d,d);
|
||||
|
||||
PointArray[v_it.Position()].Set(v_it->x - N.x, v_it->y - N.y, v_it->z - N.z);
|
||||
@@ -196,21 +196,21 @@ void LaplaceSmoothing::Umbrella(const MeshRefPointToPoints& vv_it,
|
||||
continue;
|
||||
}
|
||||
|
||||
unsigned int n_count = cv.size();
|
||||
size_t n_count = cv.size();
|
||||
double w;
|
||||
w=1.0/double(n_count);
|
||||
|
||||
double delx=0.0,dely=0.0,delz=0.0;
|
||||
std::set<unsigned long>::const_iterator cv_it;
|
||||
for (cv_it = cv.begin(); cv_it !=cv.end(); ++cv_it) {
|
||||
delx += w*((v_beg[*cv_it]).x-v_it->x);
|
||||
dely += w*((v_beg[*cv_it]).y-v_it->y);
|
||||
delz += w*((v_beg[*cv_it]).z-v_it->z);
|
||||
delx += w*static_cast<double>((v_beg[*cv_it]).x-v_it->x);
|
||||
dely += w*static_cast<double>((v_beg[*cv_it]).y-v_it->y);
|
||||
delz += w*static_cast<double>((v_beg[*cv_it]).z-v_it->z);
|
||||
}
|
||||
|
||||
float x = (float)(v_it->x+stepsize*delx);
|
||||
float y = (float)(v_it->y+stepsize*dely);
|
||||
float z = (float)(v_it->z+stepsize*delz);
|
||||
float x = static_cast<float>(static_cast<double>(v_it->x)+stepsize*delx);
|
||||
float y = static_cast<float>(static_cast<double>(v_it->y)+stepsize*dely);
|
||||
float z = static_cast<float>(static_cast<double>(v_it->z)+stepsize*delz);
|
||||
kernel.SetPoint(pos,x,y,z);
|
||||
}
|
||||
}
|
||||
@@ -231,21 +231,21 @@ void LaplaceSmoothing::Umbrella(const MeshRefPointToPoints& vv_it,
|
||||
continue;
|
||||
}
|
||||
|
||||
unsigned int n_count = cv.size();
|
||||
size_t n_count = cv.size();
|
||||
double w;
|
||||
w=1.0/double(n_count);
|
||||
|
||||
double delx=0.0,dely=0.0,delz=0.0;
|
||||
std::set<unsigned long>::const_iterator cv_it;
|
||||
for (cv_it = cv.begin(); cv_it !=cv.end(); ++cv_it) {
|
||||
delx += w*((v_beg[*cv_it]).x-(v_beg[*pos]).x);
|
||||
dely += w*((v_beg[*cv_it]).y-(v_beg[*pos]).y);
|
||||
delz += w*((v_beg[*cv_it]).z-(v_beg[*pos]).z);
|
||||
delx += w*static_cast<double>((v_beg[*cv_it]).x-(v_beg[*pos]).x);
|
||||
dely += w*static_cast<double>((v_beg[*cv_it]).y-(v_beg[*pos]).y);
|
||||
delz += w*static_cast<double>((v_beg[*cv_it]).z-(v_beg[*pos]).z);
|
||||
}
|
||||
|
||||
float x = (float)((v_beg[*pos]).x+stepsize*delx);
|
||||
float y = (float)((v_beg[*pos]).y+stepsize*dely);
|
||||
float z = (float)((v_beg[*pos]).z+stepsize*delz);
|
||||
float x = static_cast<float>(static_cast<double>((v_beg[*pos]).x)+stepsize*delx);
|
||||
float y = static_cast<float>(static_cast<double>((v_beg[*pos]).y)+stepsize*dely);
|
||||
float z = static_cast<float>(static_cast<double>((v_beg[*pos]).z)+stepsize*delz);
|
||||
kernel.SetPoint(*pos,x,y,z);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ unsigned long MeshSearchNeighbours::NeighboursFromFacet (unsigned long ulFacetId
|
||||
|
||||
// copy points in result container
|
||||
raclResultPoints.resize(_aclResult.size());
|
||||
int i = 0;
|
||||
size_t i = 0;
|
||||
for (std::set<unsigned long>::iterator pI = _aclResult.begin(); pI != _aclResult.end(); ++pI, i++)
|
||||
raclResultPoints[i] = _rclPAry[*pI];
|
||||
|
||||
@@ -140,7 +140,7 @@ void MeshSearchNeighbours::SampleAllFacets (void)
|
||||
|
||||
_aclSampledFacets.resize(_rclMesh.CountFacets());
|
||||
MeshFacetIterator clFIter(_rclMesh);
|
||||
int i = 0;
|
||||
size_t i = 0;
|
||||
for (clFIter.Init(); clFIter.More(); clFIter.Next(), i++) {
|
||||
std::vector<Base::Vector3f> clPoints;
|
||||
clFIter->SubSample(_fSampleDistance, clPoints);
|
||||
@@ -322,7 +322,7 @@ unsigned long MeshSearchNeighbours::NeighboursFacetFromFacet (unsigned long ulFa
|
||||
|
||||
// copy points in result container
|
||||
raclResultPoints.resize(_aclResult.size());
|
||||
int i = 0;
|
||||
size_t i = 0;
|
||||
for (std::set<unsigned long>::iterator pI = _aclResult.begin(); pI != _aclResult.end(); ++pI, i++)
|
||||
raclResultPoints[i] = _rclPAry[*pI];
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ Base::Matrix4D AbstractPolygonTriangulator::GetTransformToFitPlane() const
|
||||
for (std::vector<Base::Vector3f>::const_iterator it = _points.begin(); it!=_points.end(); ++it)
|
||||
planeFit.AddPoint(*it);
|
||||
|
||||
if (planeFit.Fit() == FLOAT_MAX)
|
||||
if (planeFit.Fit() >= FLOAT_MAX)
|
||||
throw Base::RuntimeError("Plane fit failed");
|
||||
|
||||
Base::Vector3f bs = planeFit.GetBase();
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
|
||||
#elif defined(FC_OS_WIN32)
|
||||
#define NOMINMAX
|
||||
#include <windows.h>
|
||||
#include <Windows.h>
|
||||
#endif //_PreComp_
|
||||
|
||||
#endif // MESHGUI_PRECOMPILED_H
|
||||
|
||||
@@ -415,7 +415,7 @@ bool MeshRenderer::shouldRenderDirectly(bool direct)
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
SO_ENGINE_SOURCE(SoFCMaterialEngine);
|
||||
SO_ENGINE_SOURCE(SoFCMaterialEngine)
|
||||
|
||||
SoFCMaterialEngine::SoFCMaterialEngine()
|
||||
{
|
||||
@@ -446,7 +446,7 @@ void SoFCMaterialEngine::evaluate()
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
SO_NODE_SOURCE(SoFCIndexedFaceSet);
|
||||
SO_NODE_SOURCE(SoFCIndexedFaceSet)
|
||||
|
||||
void SoFCIndexedFaceSet::initClass()
|
||||
{
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
#ifndef _PreComp_
|
||||
# ifdef FC_OS_WIN32
|
||||
# include <windows.h>
|
||||
# include <Windows.h>
|
||||
# endif
|
||||
# ifdef FC_OS_MACOSX
|
||||
# include <OpenGL/gl.h>
|
||||
@@ -55,7 +55,7 @@
|
||||
using namespace MeshGui;
|
||||
|
||||
|
||||
SO_NODE_SOURCE(SoPolygon);
|
||||
SO_NODE_SOURCE(SoPolygon)
|
||||
|
||||
void SoPolygon::initClass()
|
||||
{
|
||||
|
||||
@@ -48,7 +48,7 @@ public:
|
||||
SoSFBool render;
|
||||
|
||||
protected:
|
||||
virtual ~SoPolygon() {};
|
||||
virtual ~SoPolygon() {}
|
||||
virtual void GLRender(SoGLRenderAction *action);
|
||||
virtual void computeBBox(SoAction *action, SbBox3f &box, SbVec3f ¢er);
|
||||
virtual void rayPick (SoRayPickAction *action);
|
||||
|
||||
Reference in New Issue
Block a user