fix -Wextra in Mesh
This commit is contained in:
parent
c48a9bfead
commit
b980cf3361
|
@ -173,7 +173,7 @@ bool MeshAlgorithm::NearestFacetOnRay (const Base::Vector3f &rclPt, const Base::
|
|||
}
|
||||
|
||||
bool MeshAlgorithm::RayNearestField (const Base::Vector3f &rclPt, const Base::Vector3f &rclDir, const std::vector<unsigned long> &raulFacets,
|
||||
Base::Vector3f &rclRes, unsigned long &rulFacet, float fMaxAngle) const
|
||||
Base::Vector3f &rclRes, unsigned long &rulFacet, float /*fMaxAngle*/) const
|
||||
{
|
||||
Base::Vector3f clProj, clRes;
|
||||
bool bSol = false;
|
||||
|
|
|
@ -415,6 +415,7 @@ public:
|
|||
double &rfCurv0, double &rfCurv1,
|
||||
Wm4::Vector3<double> &rkDir0, Wm4::Vector3<double> &rkDir1, double &dDistance)
|
||||
{
|
||||
(void)dDistance;
|
||||
return pImplSurf->ComputePrincipalCurvatureInfo( Wm4::Vector3<double>(x, y, z),rfCurv0, rfCurv1, rkDir0, rkDir1 );
|
||||
}
|
||||
|
||||
|
@ -482,26 +483,32 @@ public:
|
|||
//+++++++++ 2. derivations ++++++++++++++++++++++++++++++++
|
||||
double Fxx( double x, double y, double z )
|
||||
{
|
||||
(void)x; (void)y; (void)z;
|
||||
return( 2.0f*dKoeff[4] );
|
||||
}
|
||||
double Fxy( double x, double y, double z )
|
||||
{
|
||||
(void)x; (void)y; (void)z;
|
||||
return( dKoeff[7] );
|
||||
}
|
||||
double Fxz( double x, double y, double z )
|
||||
{
|
||||
(void)x; (void)y; (void)z;
|
||||
return( dKoeff[8] );
|
||||
}
|
||||
double Fyy( double x, double y, double z )
|
||||
{
|
||||
(void)x; (void)y; (void)z;
|
||||
return( 2.0f*dKoeff[5] );
|
||||
}
|
||||
double Fyz( double x, double y, double z )
|
||||
{
|
||||
(void)x; (void)y; (void)z;
|
||||
return( dKoeff[9] );
|
||||
}
|
||||
double Fzz( double x, double y, double z )
|
||||
{
|
||||
(void)x; (void)y; (void)z;
|
||||
return( 2.0f*dKoeff[6] );
|
||||
}
|
||||
|
||||
|
|
|
@ -50,9 +50,11 @@ MeshOrientationVisitor::MeshOrientationVisitor() : _nonuniformOrientation(false)
|
|||
{
|
||||
}
|
||||
|
||||
bool MeshOrientationVisitor::Visit (const MeshFacet &rclFacet, const MeshFacet &rclFrom,
|
||||
bool MeshOrientationVisitor::Visit (const MeshFacet &rclFacet, const MeshFacet &rclFrom,
|
||||
unsigned long ulFInd, unsigned long ulLevel)
|
||||
{
|
||||
(void)ulFInd;
|
||||
(void)ulLevel;
|
||||
if (!rclFrom.HasSameOrientation(rclFacet)) {
|
||||
_nonuniformOrientation = true;
|
||||
return false;
|
||||
|
@ -71,9 +73,10 @@ MeshOrientationCollector::MeshOrientationCollector(std::vector<unsigned long>& a
|
|||
{
|
||||
}
|
||||
|
||||
bool MeshOrientationCollector::Visit (const MeshFacet &rclFacet, const MeshFacet &rclFrom,
|
||||
bool MeshOrientationCollector::Visit (const MeshFacet &rclFacet, const MeshFacet &rclFrom,
|
||||
unsigned long ulFInd, unsigned long ulLevel)
|
||||
{
|
||||
(void)ulLevel;
|
||||
// different orientation of rclFacet and rclFrom
|
||||
if (!rclFacet.HasSameOrientation(rclFrom)) {
|
||||
// is not marked as false oriented
|
||||
|
@ -109,6 +112,7 @@ bool MeshSameOrientationCollector::Visit (const MeshFacet &rclFacet, const MeshF
|
|||
unsigned long ulFInd, unsigned long ulLevel)
|
||||
{
|
||||
// different orientation of rclFacet and rclFrom
|
||||
(void)ulLevel;
|
||||
if (rclFacet.HasSameOrientation(rclFrom)) {
|
||||
_aulIndices.push_back(ulFInd);
|
||||
}
|
||||
|
|
|
@ -994,6 +994,7 @@ MeshPointGrid::MeshPointGrid (const MeshKernel &rclM, float fGridLen)
|
|||
|
||||
void MeshPointGrid::AddPoint (const MeshPoint &rclPt, unsigned long ulPtIndex, float fEpsilon)
|
||||
{
|
||||
(void)fEpsilon;
|
||||
unsigned long ulX, ulY, ulZ;
|
||||
Pos(Base::Vector3f(rclPt.x, rclPt.y, rclPt.z), ulX, ulY, ulZ);
|
||||
if ( (ulX < _ulCtGridsX) && (ulY < _ulCtGridsY) && (ulZ < _ulCtGridsZ) )
|
||||
|
|
|
@ -434,7 +434,7 @@ inline void MeshFacetGrid::PosWithCheck (const Base::Vector3f &rclPoint, unsigne
|
|||
assert((rulX < _ulCtGridsX) && (rulY < _ulCtGridsY) && (rulZ < _ulCtGridsZ));
|
||||
}
|
||||
|
||||
inline void MeshFacetGrid::AddFacet (const MeshGeomFacet &rclFacet, unsigned long ulFacetIndex, float fEpsilon)
|
||||
inline void MeshFacetGrid::AddFacet (const MeshGeomFacet &rclFacet, unsigned long ulFacetIndex, float /*fEpsilon*/)
|
||||
{
|
||||
#if 0
|
||||
unsigned long i, ulX, ulY, ulZ, ulX1, ulY1, ulZ1, ulX2, ulY2, ulZ2;
|
||||
|
|
|
@ -2583,7 +2583,7 @@ bool MeshOutput::SaveNastran (std::ostream &rstrOut) const
|
|||
}
|
||||
|
||||
/** Writes a Cadmould FE file. */
|
||||
bool MeshOutput::SaveCadmouldFE (std::ostream &rstrOut) const
|
||||
bool MeshOutput::SaveCadmouldFE (std::ostream & /*rstrOut*/) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -925,6 +925,7 @@ void MeshKernel::Transform (const Base::Matrix4D &rclMat)
|
|||
|
||||
void MeshKernel::Smooth(int iterations, float stepsize)
|
||||
{
|
||||
(void)stepsize;
|
||||
LaplaceSmoothing(*this).Smooth(iterations);
|
||||
}
|
||||
|
||||
|
|
|
@ -492,121 +492,129 @@ void SetOperations::CollectFacets (int side, float mult)
|
|||
// MeshDefinitions::SetMinPointDistance(distSave);
|
||||
}
|
||||
|
||||
SetOperations::CollectFacetVisitor::CollectFacetVisitor (const MeshKernel& mesh, std::vector<unsigned long>& facets, std::map<Edge, EdgeInfo>& edges, int side, float mult , Base::Builder3D& builder )
|
||||
: _facets(facets),
|
||||
_mesh(mesh),
|
||||
_edges(edges),
|
||||
_side(side),
|
||||
_mult(mult),
|
||||
_addFacets(-1)
|
||||
SetOperations::CollectFacetVisitor::CollectFacetVisitor (const MeshKernel& mesh, std::vector<unsigned long>& facets,
|
||||
std::map<Edge, EdgeInfo>& edges, int side, float mult,
|
||||
Base::Builder3D& builder)
|
||||
: _facets(facets)
|
||||
, _mesh(mesh)
|
||||
, _edges(edges)
|
||||
, _side(side)
|
||||
, _mult(mult)
|
||||
, _addFacets(-1)
|
||||
,_builder(builder)
|
||||
{
|
||||
}
|
||||
|
||||
bool SetOperations::CollectFacetVisitor::Visit (const MeshFacet &rclFacet, const MeshFacet &rclFrom, unsigned long ulFInd, unsigned long ulLevel)
|
||||
bool SetOperations::CollectFacetVisitor::Visit (const MeshFacet &rclFacet, const MeshFacet &rclFrom,
|
||||
unsigned long ulFInd, unsigned long ulLevel)
|
||||
{
|
||||
_facets.push_back(ulFInd);
|
||||
return true;
|
||||
(void)rclFacet;
|
||||
(void)rclFrom;
|
||||
(void)ulLevel;
|
||||
_facets.push_back(ulFInd);
|
||||
return true;
|
||||
}
|
||||
|
||||
//static int matchCounter = 0;
|
||||
bool SetOperations::CollectFacetVisitor::AllowVisit (const MeshFacet& rclFacet, const MeshFacet& rclFrom, unsigned long ulFInd, unsigned long ulLevel, unsigned short neighbourIndex)
|
||||
bool SetOperations::CollectFacetVisitor::AllowVisit (const MeshFacet& rclFacet, const MeshFacet& rclFrom,
|
||||
unsigned long ulFInd, unsigned long ulLevel,
|
||||
unsigned short neighbourIndex)
|
||||
{
|
||||
if (rclFacet.IsFlag(MeshFacet::MARKED) && rclFrom.IsFlag(MeshFacet::MARKED))
|
||||
{ // facet connected to an edge
|
||||
unsigned long pt0 = rclFrom._aulPoints[neighbourIndex], pt1 = rclFrom._aulPoints[(neighbourIndex+1)%3];
|
||||
Edge edge(_mesh.GetPoint(pt0), _mesh.GetPoint(pt1));
|
||||
(void)ulFInd;
|
||||
(void)ulLevel;
|
||||
if (rclFacet.IsFlag(MeshFacet::MARKED) && rclFrom.IsFlag(MeshFacet::MARKED)) {
|
||||
// facet connected to an edge
|
||||
unsigned long pt0 = rclFrom._aulPoints[neighbourIndex], pt1 = rclFrom._aulPoints[(neighbourIndex+1)%3];
|
||||
Edge edge(_mesh.GetPoint(pt0), _mesh.GetPoint(pt1));
|
||||
|
||||
std::map<Edge, EdgeInfo>::iterator it = _edges.find(edge);
|
||||
std::map<Edge, EdgeInfo>::iterator it = _edges.find(edge);
|
||||
|
||||
if (it != _edges.end())
|
||||
{
|
||||
if (_addFacets == -1)
|
||||
{ // detemine if the facets shoud add or not only once
|
||||
MeshGeomFacet facet = _mesh.GetFacet(rclFrom); // triangulated facet
|
||||
MeshGeomFacet facetOther = it->second.facets[1-_side][0]; // triangulated facet from same edge and other mesh
|
||||
Vector3f normalOther = facetOther.GetNormal();
|
||||
//Vector3f normal = facet.GetNormal();
|
||||
if (it != _edges.end()) {
|
||||
if (_addFacets == -1) {
|
||||
// detemine if the facets shoud add or not only once
|
||||
MeshGeomFacet facet = _mesh.GetFacet(rclFrom); // triangulated facet
|
||||
MeshGeomFacet facetOther = it->second.facets[1-_side][0]; // triangulated facet from same edge and other mesh
|
||||
Vector3f normalOther = facetOther.GetNormal();
|
||||
//Vector3f normal = facet.GetNormal();
|
||||
|
||||
Vector3f edgeDir = it->first.pt1 - it->first.pt2;
|
||||
Vector3f ocDir = (edgeDir % (facet.GetGravityPoint() - it->first.pt1)) % edgeDir;
|
||||
ocDir.Normalize();
|
||||
Vector3f ocDirOther = (edgeDir % (facetOther.GetGravityPoint() - it->first.pt1)) % edgeDir;
|
||||
ocDirOther.Normalize();
|
||||
Vector3f edgeDir = it->first.pt1 - it->first.pt2;
|
||||
Vector3f ocDir = (edgeDir % (facet.GetGravityPoint() - it->first.pt1)) % edgeDir;
|
||||
ocDir.Normalize();
|
||||
Vector3f ocDirOther = (edgeDir % (facetOther.GetGravityPoint() - it->first.pt1)) % edgeDir;
|
||||
ocDirOther.Normalize();
|
||||
|
||||
//Vector3f dir = ocDir % normal;
|
||||
//Vector3f dirOther = ocDirOther % normalOther;
|
||||
//Vector3f dir = ocDir % normal;
|
||||
//Vector3f dirOther = ocDirOther % normalOther;
|
||||
|
||||
bool match = ((ocDir * normalOther) * _mult) < 0.0f;
|
||||
bool match = ((ocDir * normalOther) * _mult) < 0.0f;
|
||||
|
||||
//if (matchCounter == 1)
|
||||
//{
|
||||
// // _builder.addSingleArrow(it->second.pt1, it->second.pt1 + edgeDir, 3, 0.0, 1.0, 0.0);
|
||||
//if (matchCounter == 1)
|
||||
//{
|
||||
// // _builder.addSingleArrow(it->second.pt1, it->second.pt1 + edgeDir, 3, 0.0, 1.0, 0.0);
|
||||
|
||||
// _builder.addSingleTriangle(facet._aclPoints[0], facet._aclPoints[1], facet._aclPoints[2], true, 3.0, 1.0, 0.0, 0.0);
|
||||
// // _builder.addSingleArrow(facet.GetGravityPoint(), facet.GetGravityPoint() + ocDir, 3, 1.0, 0.0, 0.0);
|
||||
// _builder.addSingleArrow(facet.GetGravityPoint(), facet.GetGravityPoint() + normal, 3, 1.0, 0.5, 0.0);
|
||||
// // _builder.addSingleArrow(facet.GetGravityPoint(), facet.GetGravityPoint() + dir, 3, 1.0, 1.0, 0.0);
|
||||
// _builder.addSingleTriangle(facet._aclPoints[0], facet._aclPoints[1], facet._aclPoints[2], true, 3.0, 1.0, 0.0, 0.0);
|
||||
// // _builder.addSingleArrow(facet.GetGravityPoint(), facet.GetGravityPoint() + ocDir, 3, 1.0, 0.0, 0.0);
|
||||
// _builder.addSingleArrow(facet.GetGravityPoint(), facet.GetGravityPoint() + normal, 3, 1.0, 0.5, 0.0);
|
||||
// // _builder.addSingleArrow(facet.GetGravityPoint(), facet.GetGravityPoint() + dir, 3, 1.0, 1.0, 0.0);
|
||||
|
||||
// _builder.addSingleTriangle(facetOther._aclPoints[0], facetOther._aclPoints[1], facetOther._aclPoints[2], true, 3.0, 0.0, 0.0, 1.0);
|
||||
// // _builder.addSingleArrow(facetOther.GetGravityPoint(), facetOther.GetGravityPoint() + ocDirOther, 3, 0.0, 0.0, 1.0);
|
||||
// _builder.addSingleArrow(facetOther.GetGravityPoint(), facetOther.GetGravityPoint() + normalOther, 3, 0.0, 0.5, 1.0);
|
||||
// // _builder.addSingleArrow(facetOther.GetGravityPoint(), facetOther.GetGravityPoint() + dirOther, 3, 0.0, 1.0, 1.0);
|
||||
// _builder.addSingleTriangle(facetOther._aclPoints[0], facetOther._aclPoints[1], facetOther._aclPoints[2], true, 3.0, 0.0, 0.0, 1.0);
|
||||
// // _builder.addSingleArrow(facetOther.GetGravityPoint(), facetOther.GetGravityPoint() + ocDirOther, 3, 0.0, 0.0, 1.0);
|
||||
// _builder.addSingleArrow(facetOther.GetGravityPoint(), facetOther.GetGravityPoint() + normalOther, 3, 0.0, 0.5, 1.0);
|
||||
// // _builder.addSingleArrow(facetOther.GetGravityPoint(), facetOther.GetGravityPoint() + dirOther, 3, 0.0, 1.0, 1.0);
|
||||
|
||||
//}
|
||||
//}
|
||||
|
||||
// float scalar = dir * dirOther * _mult;
|
||||
// bool match = scalar > 0.0f;
|
||||
// float scalar = dir * dirOther * _mult;
|
||||
// bool match = scalar > 0.0f;
|
||||
|
||||
|
||||
//MeshPoint pt0 = it->first.pt1;
|
||||
//MeshPoint pt1 = it->first.pt2;
|
||||
//MeshPoint pt0 = it->first.pt1;
|
||||
//MeshPoint pt1 = it->first.pt2;
|
||||
|
||||
//int i, n0 = -1, n1 = -1, m0 = -1, m1 = -1;
|
||||
//for (i = 0; i < 3; i++)
|
||||
//{
|
||||
// if ((n0 == -1) && (facet._aclPoints[i] == pt0))
|
||||
// n0 = i;
|
||||
// if ((n1 == -1) && (facet._aclPoints[i] == pt1))
|
||||
// n1 = i;
|
||||
// if ((m0 == -1) && (facetOther._aclPoints[i] == pt0))
|
||||
// m0 = i;
|
||||
// if ((m1 == -1) && (facetOther._aclPoints[i] == pt1))
|
||||
// m1 = i;
|
||||
//}
|
||||
//int i, n0 = -1, n1 = -1, m0 = -1, m1 = -1;
|
||||
//for (i = 0; i < 3; i++)
|
||||
//{
|
||||
// if ((n0 == -1) && (facet._aclPoints[i] == pt0))
|
||||
// n0 = i;
|
||||
// if ((n1 == -1) && (facet._aclPoints[i] == pt1))
|
||||
// n1 = i;
|
||||
// if ((m0 == -1) && (facetOther._aclPoints[i] == pt0))
|
||||
// m0 = i;
|
||||
// if ((m1 == -1) && (facetOther._aclPoints[i] == pt1))
|
||||
// m1 = i;
|
||||
//}
|
||||
|
||||
//if ((n0 != -1) && (n1 != -1) && (m0 != -1) && (m1 != -1))
|
||||
//{
|
||||
// bool orient_n = n1 > n0;
|
||||
// bool orient_m = m1 > m0;
|
||||
//if ((n0 != -1) && (n1 != -1) && (m0 != -1) && (m1 != -1))
|
||||
//{
|
||||
// bool orient_n = n1 > n0;
|
||||
// bool orient_m = m1 > m0;
|
||||
|
||||
// Vector3f dirN = facet._aclPoints[n1] - facet._aclPoints[n0];
|
||||
// Vector3f dirM = facetOther._aclPoints[m1] - facetOther._aclPoints[m0];
|
||||
// Vector3f dirN = facet._aclPoints[n1] - facet._aclPoints[n0];
|
||||
// Vector3f dirM = facetOther._aclPoints[m1] - facetOther._aclPoints[m0];
|
||||
|
||||
// if (matchCounter == 1)
|
||||
// {
|
||||
// _builder.addSingleArrow(facet.GetGravityPoint(), facet.GetGravityPoint() + dirN, 3, 1.0, 1.0, 0.0);
|
||||
// _builder.addSingleArrow(facetOther.GetGravityPoint(), facetOther.GetGravityPoint() + dirM, 3, 0.0, 1.0, 1.0);
|
||||
// }
|
||||
// if (matchCounter == 1)
|
||||
// {
|
||||
// _builder.addSingleArrow(facet.GetGravityPoint(), facet.GetGravityPoint() + dirN, 3, 1.0, 1.0, 0.0);
|
||||
// _builder.addSingleArrow(facetOther.GetGravityPoint(), facetOther.GetGravityPoint() + dirM, 3, 0.0, 1.0, 1.0);
|
||||
// }
|
||||
|
||||
// if (_mult > 0.0)
|
||||
// match = orient_n == orient_m;
|
||||
// else
|
||||
// match = orient_n != orient_m;
|
||||
//}
|
||||
|
||||
if (match)
|
||||
_addFacets = 0;
|
||||
else
|
||||
_addFacets = 1;
|
||||
// if (_mult > 0.0)
|
||||
// match = orient_n == orient_m;
|
||||
// else
|
||||
// match = orient_n != orient_m;
|
||||
//}
|
||||
|
||||
//matchCounter++;
|
||||
}
|
||||
if (match)
|
||||
_addFacets = 0;
|
||||
else
|
||||
_addFacets = 1;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
//matchCounter++;
|
||||
}
|
||||
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -144,97 +144,95 @@ bool MeshTopoAlgorithm::SnapVertex(unsigned long ulFacetPos, const Base::Vector3
|
|||
|
||||
void MeshTopoAlgorithm::OptimizeTopology(float fMaxAngle)
|
||||
{
|
||||
// For each internal edge get the adjacent facets. When doing an edge swap we must update
|
||||
// this structure.
|
||||
std::map<std::pair<unsigned long, unsigned long>, std::vector<unsigned long> > aEdge2Face;
|
||||
for (MeshFacetArray::_TIterator pI = _rclMesh._aclFacetArray.begin(); pI != _rclMesh._aclFacetArray.end(); ++pI)
|
||||
{
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
// ignore open edges
|
||||
if ( pI->_aulNeighbours[i] != ULONG_MAX ) {
|
||||
unsigned long ulPt0 = std::min<unsigned long>(pI->_aulPoints[i], pI->_aulPoints[(i+1)%3]);
|
||||
unsigned long ulPt1 = std::max<unsigned long>(pI->_aulPoints[i], pI->_aulPoints[(i+1)%3]);
|
||||
aEdge2Face[std::pair<unsigned long, unsigned long>(ulPt0, ulPt1)].push_back(pI - _rclMesh._aclFacetArray.begin());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// fill up this list with all internal edges and perform swap edges until this list is empty
|
||||
std::list<std::pair<unsigned long, unsigned long> > aEdgeList;
|
||||
std::map<std::pair<unsigned long, unsigned long>, std::vector<unsigned long> >::iterator pE;
|
||||
for (pE = aEdge2Face.begin(); pE != aEdge2Face.end(); ++pE) {
|
||||
if (pE->second.size() == 2) // make sure that we really have an internal edge
|
||||
aEdgeList.push_back(pE->first);
|
||||
}
|
||||
|
||||
// to be sure to avoid an endless loop
|
||||
unsigned long uMaxIter = 5 * aEdge2Face.size();
|
||||
|
||||
// Perform a swap edge where needed
|
||||
while ( !aEdgeList.empty() && uMaxIter > 0 ) {
|
||||
// get the first edge and remove it from the list
|
||||
std::pair<unsigned long, unsigned long> aEdge = aEdgeList.front();
|
||||
aEdgeList.pop_front();
|
||||
uMaxIter--;
|
||||
|
||||
// get the adjacent facets to this edge
|
||||
pE = aEdge2Face.find( aEdge );
|
||||
|
||||
// this edge has been removed some iterations before
|
||||
if ( pE == aEdge2Face.end() )
|
||||
continue;
|
||||
|
||||
// Is swap edge allowed and sensible?
|
||||
if ( !ShouldSwapEdge(pE->second[0], pE->second[1], fMaxAngle) )
|
||||
continue;
|
||||
|
||||
// ok, here we should perform a swap edge to minimize the maximum angle
|
||||
if ( /*fMax12 > fMax34*/true ) {
|
||||
// swap the edge
|
||||
SwapEdge(pE->second[0], pE->second[1]);
|
||||
|
||||
MeshFacet& rF1 = _rclMesh._aclFacetArray[pE->second[0]];
|
||||
MeshFacet& rF2 = _rclMesh._aclFacetArray[pE->second[1]];
|
||||
unsigned short side1 = rF1.Side(aEdge.first, aEdge.second);
|
||||
unsigned short side2 = rF2.Side(aEdge.first, aEdge.second);
|
||||
|
||||
// adjust the edge list
|
||||
for ( int i=0; i<3; i++ ) {
|
||||
std::map<std::pair<unsigned long, unsigned long>, std::vector<unsigned long> >::iterator it;
|
||||
// first facet
|
||||
unsigned long ulPt0 = std::min<unsigned long>(rF1._aulPoints[i], rF1._aulPoints[(i+1)%3]);
|
||||
unsigned long ulPt1 = std::max<unsigned long>(rF1._aulPoints[i], rF1._aulPoints[(i+1)%3]);
|
||||
it = aEdge2Face.find( std::make_pair(ulPt0, ulPt1) );
|
||||
if ( it != aEdge2Face.end() ) {
|
||||
if ( it->second[0] == pE->second[1] )
|
||||
it->second[0] = pE->second[0];
|
||||
else if ( it->second[1] == pE->second[1] )
|
||||
it->second[1] = pE->second[0];
|
||||
aEdgeList.push_back( it->first );
|
||||
// For each internal edge get the adjacent facets. When doing an edge swap we must update
|
||||
// this structure.
|
||||
std::map<std::pair<unsigned long, unsigned long>, std::vector<unsigned long> > aEdge2Face;
|
||||
for (MeshFacetArray::_TIterator pI = _rclMesh._aclFacetArray.begin(); pI != _rclMesh._aclFacetArray.end(); ++pI) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
// ignore open edges
|
||||
if (pI->_aulNeighbours[i] != ULONG_MAX) {
|
||||
unsigned long ulPt0 = std::min<unsigned long>(pI->_aulPoints[i], pI->_aulPoints[(i+1)%3]);
|
||||
unsigned long ulPt1 = std::max<unsigned long>(pI->_aulPoints[i], pI->_aulPoints[(i+1)%3]);
|
||||
aEdge2Face[std::pair<unsigned long, unsigned long>(ulPt0, ulPt1)].push_back(pI - _rclMesh._aclFacetArray.begin());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// fill up this list with all internal edges and perform swap edges until this list is empty
|
||||
std::list<std::pair<unsigned long, unsigned long> > aEdgeList;
|
||||
std::map<std::pair<unsigned long, unsigned long>, std::vector<unsigned long> >::iterator pE;
|
||||
for (pE = aEdge2Face.begin(); pE != aEdge2Face.end(); ++pE) {
|
||||
if (pE->second.size() == 2) // make sure that we really have an internal edge
|
||||
aEdgeList.push_back(pE->first);
|
||||
}
|
||||
|
||||
// to be sure to avoid an endless loop
|
||||
unsigned long uMaxIter = 5 * aEdge2Face.size();
|
||||
|
||||
// Perform a swap edge where needed
|
||||
while (!aEdgeList.empty() && uMaxIter > 0) {
|
||||
// get the first edge and remove it from the list
|
||||
std::pair<unsigned long, unsigned long> aEdge = aEdgeList.front();
|
||||
aEdgeList.pop_front();
|
||||
uMaxIter--;
|
||||
|
||||
// get the adjacent facets to this edge
|
||||
pE = aEdge2Face.find( aEdge );
|
||||
|
||||
// this edge has been removed some iterations before
|
||||
if (pE == aEdge2Face.end())
|
||||
continue;
|
||||
|
||||
// Is swap edge allowed and sensible?
|
||||
if (!ShouldSwapEdge(pE->second[0], pE->second[1], fMaxAngle))
|
||||
continue;
|
||||
|
||||
// ok, here we should perform a swap edge to minimize the maximum angle
|
||||
if ( /*fMax12 > fMax34*/true ) {
|
||||
// swap the edge
|
||||
SwapEdge(pE->second[0], pE->second[1]);
|
||||
|
||||
MeshFacet& rF1 = _rclMesh._aclFacetArray[pE->second[0]];
|
||||
MeshFacet& rF2 = _rclMesh._aclFacetArray[pE->second[1]];
|
||||
unsigned short side1 = rF1.Side(aEdge.first, aEdge.second);
|
||||
unsigned short side2 = rF2.Side(aEdge.first, aEdge.second);
|
||||
|
||||
// adjust the edge list
|
||||
for (int i=0; i<3; i++) {
|
||||
std::map<std::pair<unsigned long, unsigned long>, std::vector<unsigned long> >::iterator it;
|
||||
// first facet
|
||||
unsigned long ulPt0 = std::min<unsigned long>(rF1._aulPoints[i], rF1._aulPoints[(i+1)%3]);
|
||||
unsigned long ulPt1 = std::max<unsigned long>(rF1._aulPoints[i], rF1._aulPoints[(i+1)%3]);
|
||||
it = aEdge2Face.find( std::make_pair(ulPt0, ulPt1) );
|
||||
if (it != aEdge2Face.end()) {
|
||||
if (it->second[0] == pE->second[1])
|
||||
it->second[0] = pE->second[0];
|
||||
else if (it->second[1] == pE->second[1])
|
||||
it->second[1] = pE->second[0];
|
||||
aEdgeList.push_back( it->first );
|
||||
}
|
||||
|
||||
// second facet
|
||||
ulPt0 = std::min<unsigned long>(rF2._aulPoints[i], rF2._aulPoints[(i+1)%3]);
|
||||
ulPt1 = std::max<unsigned long>(rF2._aulPoints[i], rF2._aulPoints[(i+1)%3]);
|
||||
it = aEdge2Face.find( std::make_pair(ulPt0, ulPt1) );
|
||||
if (it != aEdge2Face.end()) {
|
||||
if (it->second[0] == pE->second[0])
|
||||
it->second[0] = pE->second[1];
|
||||
else if (it->second[1] == pE->second[0])
|
||||
it->second[1] = pE->second[1];
|
||||
aEdgeList.push_back( it->first );
|
||||
}
|
||||
}
|
||||
|
||||
// Now we must remove the edge and replace it through the new edge
|
||||
unsigned long ulPt0 = std::min<unsigned long>(rF1._aulPoints[(side1+1)%3], rF2._aulPoints[(side2+1)%3]);
|
||||
unsigned long ulPt1 = std::max<unsigned long>(rF1._aulPoints[(side1+1)%3], rF2._aulPoints[(side2+1)%3]);
|
||||
std::pair<unsigned long, unsigned long> aNewEdge = std::make_pair(ulPt0, ulPt1);
|
||||
aEdge2Face[aNewEdge] = pE->second;
|
||||
aEdge2Face.erase(pE);
|
||||
}
|
||||
|
||||
// second facet
|
||||
ulPt0 = std::min<unsigned long>(rF2._aulPoints[i], rF2._aulPoints[(i+1)%3]);
|
||||
ulPt1 = std::max<unsigned long>(rF2._aulPoints[i], rF2._aulPoints[(i+1)%3]);
|
||||
it = aEdge2Face.find( std::make_pair(ulPt0, ulPt1) );
|
||||
if ( it != aEdge2Face.end() ) {
|
||||
if ( it->second[0] == pE->second[0] )
|
||||
it->second[0] = pE->second[1];
|
||||
else if ( it->second[1] == pE->second[0] )
|
||||
it->second[1] = pE->second[1];
|
||||
aEdgeList.push_back( it->first );
|
||||
}
|
||||
}
|
||||
|
||||
// Now we must remove the edge and replace it through the new edge
|
||||
unsigned long ulPt0 = std::min<unsigned long>(rF1._aulPoints[(side1+1)%3], rF2._aulPoints[(side2+1)%3]);
|
||||
unsigned long ulPt1 = std::max<unsigned long>(rF1._aulPoints[(side1+1)%3], rF2._aulPoints[(side2+1)%3]);
|
||||
std::pair<unsigned long, unsigned long> aNewEdge = std::make_pair(ulPt0, ulPt1);
|
||||
aEdge2Face[aNewEdge] = pE->second;
|
||||
aEdge2Face.erase(pE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Cosine of the maximum angle in triangle (v1,v2,v3)
|
||||
|
@ -570,188 +568,188 @@ bool MeshTopoAlgorithm::InsertVertexAndSwapEdge(unsigned long ulFacetPos, const
|
|||
|
||||
bool MeshTopoAlgorithm::IsSwapEdgeLegal(unsigned long ulFacetPos, unsigned long ulNeighbour) const
|
||||
{
|
||||
MeshFacet& rclF = _rclMesh._aclFacetArray[ulFacetPos];
|
||||
MeshFacet& rclN = _rclMesh._aclFacetArray[ulNeighbour];
|
||||
MeshFacet& rclF = _rclMesh._aclFacetArray[ulFacetPos];
|
||||
MeshFacet& rclN = _rclMesh._aclFacetArray[ulNeighbour];
|
||||
|
||||
unsigned short uFSide = rclF.Side(rclN);
|
||||
unsigned short uNSide = rclN.Side(rclF);
|
||||
unsigned short uFSide = rclF.Side(rclN);
|
||||
unsigned short uNSide = rclN.Side(rclF);
|
||||
|
||||
if (uFSide == USHRT_MAX || uNSide == USHRT_MAX)
|
||||
return false; // not neighbours
|
||||
if (uFSide == USHRT_MAX || uNSide == USHRT_MAX)
|
||||
return false; // not neighbours
|
||||
|
||||
Base::Vector3f cP1 = _rclMesh._aclPointArray[rclF._aulPoints[uFSide]];
|
||||
Base::Vector3f cP2 = _rclMesh._aclPointArray[rclF._aulPoints[(uFSide+1)%3]];
|
||||
Base::Vector3f cP3 = _rclMesh._aclPointArray[rclF._aulPoints[(uFSide+2)%3]];
|
||||
Base::Vector3f cP4 = _rclMesh._aclPointArray[rclN._aulPoints[(uNSide+2)%3]];
|
||||
Base::Vector3f cP1 = _rclMesh._aclPointArray[rclF._aulPoints[uFSide]];
|
||||
Base::Vector3f cP2 = _rclMesh._aclPointArray[rclF._aulPoints[(uFSide+1)%3]];
|
||||
Base::Vector3f cP3 = _rclMesh._aclPointArray[rclF._aulPoints[(uFSide+2)%3]];
|
||||
Base::Vector3f cP4 = _rclMesh._aclPointArray[rclN._aulPoints[(uNSide+2)%3]];
|
||||
|
||||
// do not allow to create degenerated triangles
|
||||
MeshGeomFacet cT3(cP4, cP3, cP1);
|
||||
if ( cT3.IsDegenerated(MeshDefinitions::_fMinPointDistanceP2) )
|
||||
return false;
|
||||
MeshGeomFacet cT4(cP3, cP4, cP2);
|
||||
if ( cT4.IsDegenerated(MeshDefinitions::_fMinPointDistanceP2) )
|
||||
return false;
|
||||
// do not allow to create degenerated triangles
|
||||
MeshGeomFacet cT3(cP4, cP3, cP1);
|
||||
if (cT3.IsDegenerated(MeshDefinitions::_fMinPointDistanceP2))
|
||||
return false;
|
||||
MeshGeomFacet cT4(cP3, cP4, cP2);
|
||||
if (cT4.IsDegenerated(MeshDefinitions::_fMinPointDistanceP2))
|
||||
return false;
|
||||
|
||||
// We must make sure that the two adjacent triangles builds a convex polygon, otherwise
|
||||
// the swap edge operation is illegal
|
||||
Base::Vector3f cU = cP2-cP1;
|
||||
Base::Vector3f cV = cP4-cP3;
|
||||
// build a helper plane through cP1 that must separate cP3 and cP4
|
||||
Base::Vector3f cN1 = (cU % cV) % cU;
|
||||
if ( ((cP3-cP1)*cN1)*((cP4-cP1)*cN1) >= 0.0f )
|
||||
return false; // not convex
|
||||
// build a helper plane through cP3 that must separate cP1 and cP2
|
||||
Base::Vector3f cN2 = (cU % cV) % cV;
|
||||
if ( ((cP1-cP3)*cN2)*((cP2-cP3)*cN2) >= 0.0f )
|
||||
return false; // not convex
|
||||
// We must make sure that the two adjacent triangles builds a convex polygon, otherwise
|
||||
// the swap edge operation is illegal
|
||||
Base::Vector3f cU = cP2-cP1;
|
||||
Base::Vector3f cV = cP4-cP3;
|
||||
// build a helper plane through cP1 that must separate cP3 and cP4
|
||||
Base::Vector3f cN1 = (cU % cV) % cU;
|
||||
if (((cP3-cP1)*cN1)*((cP4-cP1)*cN1) >= 0.0f)
|
||||
return false; // not convex
|
||||
// build a helper plane through cP3 that must separate cP1 and cP2
|
||||
Base::Vector3f cN2 = (cU % cV) % cV;
|
||||
if (((cP1-cP3)*cN2)*((cP2-cP3)*cN2) >= 0.0f)
|
||||
return false; // not convex
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MeshTopoAlgorithm::ShouldSwapEdge(unsigned long ulFacetPos, unsigned long ulNeighbour, float fMaxAngle) const
|
||||
{
|
||||
if ( !IsSwapEdgeLegal(ulFacetPos, ulNeighbour) )
|
||||
return false;
|
||||
if (!IsSwapEdgeLegal(ulFacetPos, ulNeighbour))
|
||||
return false;
|
||||
|
||||
MeshFacet& rclF = _rclMesh._aclFacetArray[ulFacetPos];
|
||||
MeshFacet& rclN = _rclMesh._aclFacetArray[ulNeighbour];
|
||||
MeshFacet& rclF = _rclMesh._aclFacetArray[ulFacetPos];
|
||||
MeshFacet& rclN = _rclMesh._aclFacetArray[ulNeighbour];
|
||||
|
||||
unsigned short uFSide = rclF.Side(rclN);
|
||||
unsigned short uNSide = rclN.Side(rclF);
|
||||
unsigned short uFSide = rclF.Side(rclN);
|
||||
unsigned short uNSide = rclN.Side(rclF);
|
||||
|
||||
Base::Vector3f cP1 = _rclMesh._aclPointArray[rclF._aulPoints[uFSide]];
|
||||
Base::Vector3f cP2 = _rclMesh._aclPointArray[rclF._aulPoints[(uFSide+1)%3]];
|
||||
Base::Vector3f cP3 = _rclMesh._aclPointArray[rclF._aulPoints[(uFSide+2)%3]];
|
||||
Base::Vector3f cP4 = _rclMesh._aclPointArray[rclN._aulPoints[(uNSide+2)%3]];
|
||||
Base::Vector3f cP1 = _rclMesh._aclPointArray[rclF._aulPoints[uFSide]];
|
||||
Base::Vector3f cP2 = _rclMesh._aclPointArray[rclF._aulPoints[(uFSide+1)%3]];
|
||||
Base::Vector3f cP3 = _rclMesh._aclPointArray[rclF._aulPoints[(uFSide+2)%3]];
|
||||
Base::Vector3f cP4 = _rclMesh._aclPointArray[rclN._aulPoints[(uNSide+2)%3]];
|
||||
|
||||
MeshGeomFacet cT1(cP1, cP2, cP3); float fMax1 = cT1.MaximumAngle();
|
||||
MeshGeomFacet cT2(cP2, cP1, cP4); float fMax2 = cT2.MaximumAngle();
|
||||
MeshGeomFacet cT3(cP4, cP3, cP1); float fMax3 = cT3.MaximumAngle();
|
||||
MeshGeomFacet cT4(cP3, cP4, cP2); float fMax4 = cT4.MaximumAngle();
|
||||
MeshGeomFacet cT1(cP1, cP2, cP3); float fMax1 = cT1.MaximumAngle();
|
||||
MeshGeomFacet cT2(cP2, cP1, cP4); float fMax2 = cT2.MaximumAngle();
|
||||
MeshGeomFacet cT3(cP4, cP3, cP1); float fMax3 = cT3.MaximumAngle();
|
||||
MeshGeomFacet cT4(cP3, cP4, cP2); float fMax4 = cT4.MaximumAngle();
|
||||
|
||||
// get the angle between the triangles
|
||||
Base::Vector3f cN1 = cT1.GetNormal();
|
||||
Base::Vector3f cN2 = cT2.GetNormal();
|
||||
if ( cN1.GetAngle(cN2) > fMaxAngle )
|
||||
return false;
|
||||
// get the angle between the triangles
|
||||
Base::Vector3f cN1 = cT1.GetNormal();
|
||||
Base::Vector3f cN2 = cT2.GetNormal();
|
||||
if (cN1.GetAngle(cN2) > fMaxAngle)
|
||||
return false;
|
||||
|
||||
float fMax12 = std::max<float>(fMax1, fMax2);
|
||||
float fMax34 = std::max<float>(fMax3, fMax4);
|
||||
float fMax12 = std::max<float>(fMax1, fMax2);
|
||||
float fMax34 = std::max<float>(fMax3, fMax4);
|
||||
|
||||
return fMax12 > fMax34;
|
||||
return fMax12 > fMax34;
|
||||
}
|
||||
|
||||
void MeshTopoAlgorithm::SwapEdge(unsigned long ulFacetPos, unsigned long ulNeighbour)
|
||||
{
|
||||
MeshFacet& rclF = _rclMesh._aclFacetArray[ulFacetPos];
|
||||
MeshFacet& rclN = _rclMesh._aclFacetArray[ulNeighbour];
|
||||
MeshFacet& rclF = _rclMesh._aclFacetArray[ulFacetPos];
|
||||
MeshFacet& rclN = _rclMesh._aclFacetArray[ulNeighbour];
|
||||
|
||||
unsigned short uFSide = rclF.Side(rclN);
|
||||
unsigned short uNSide = rclN.Side(rclF);
|
||||
unsigned short uFSide = rclF.Side(rclN);
|
||||
unsigned short uNSide = rclN.Side(rclF);
|
||||
|
||||
if (uFSide == USHRT_MAX || uNSide == USHRT_MAX)
|
||||
return; // not neighbours
|
||||
if (uFSide == USHRT_MAX || uNSide == USHRT_MAX)
|
||||
return; // not neighbours
|
||||
|
||||
// adjust the neighbourhood
|
||||
if (rclF._aulNeighbours[(uFSide+1)%3] != ULONG_MAX)
|
||||
_rclMesh._aclFacetArray[rclF._aulNeighbours[(uFSide+1)%3]].ReplaceNeighbour(ulFacetPos, ulNeighbour);
|
||||
if (rclN._aulNeighbours[(uNSide+1)%3] != ULONG_MAX)
|
||||
_rclMesh._aclFacetArray[rclN._aulNeighbours[(uNSide+1)%3]].ReplaceNeighbour(ulNeighbour, ulFacetPos);
|
||||
// adjust the neighbourhood
|
||||
if (rclF._aulNeighbours[(uFSide+1)%3] != ULONG_MAX)
|
||||
_rclMesh._aclFacetArray[rclF._aulNeighbours[(uFSide+1)%3]].ReplaceNeighbour(ulFacetPos, ulNeighbour);
|
||||
if (rclN._aulNeighbours[(uNSide+1)%3] != ULONG_MAX)
|
||||
_rclMesh._aclFacetArray[rclN._aulNeighbours[(uNSide+1)%3]].ReplaceNeighbour(ulNeighbour, ulFacetPos);
|
||||
|
||||
// swap the point and neighbour indices
|
||||
rclF._aulPoints[(uFSide+1)%3] = rclN._aulPoints[(uNSide+2)%3];
|
||||
rclN._aulPoints[(uNSide+1)%3] = rclF._aulPoints[(uFSide+2)%3];
|
||||
rclF._aulNeighbours[uFSide] = rclN._aulNeighbours[(uNSide+1)%3];
|
||||
rclN._aulNeighbours[uNSide] = rclF._aulNeighbours[(uFSide+1)%3];
|
||||
rclF._aulNeighbours[(uFSide+1)%3] = ulNeighbour;
|
||||
rclN._aulNeighbours[(uNSide+1)%3] = ulFacetPos;
|
||||
// swap the point and neighbour indices
|
||||
rclF._aulPoints[(uFSide+1)%3] = rclN._aulPoints[(uNSide+2)%3];
|
||||
rclN._aulPoints[(uNSide+1)%3] = rclF._aulPoints[(uFSide+2)%3];
|
||||
rclF._aulNeighbours[uFSide] = rclN._aulNeighbours[(uNSide+1)%3];
|
||||
rclN._aulNeighbours[uNSide] = rclF._aulNeighbours[(uFSide+1)%3];
|
||||
rclF._aulNeighbours[(uFSide+1)%3] = ulNeighbour;
|
||||
rclN._aulNeighbours[(uNSide+1)%3] = ulFacetPos;
|
||||
}
|
||||
|
||||
bool MeshTopoAlgorithm::SplitEdge(unsigned long ulFacetPos, unsigned long ulNeighbour, const Base::Vector3f& rP)
|
||||
{
|
||||
MeshFacet& rclF = _rclMesh._aclFacetArray[ulFacetPos];
|
||||
MeshFacet& rclN = _rclMesh._aclFacetArray[ulNeighbour];
|
||||
MeshFacet& rclF = _rclMesh._aclFacetArray[ulFacetPos];
|
||||
MeshFacet& rclN = _rclMesh._aclFacetArray[ulNeighbour];
|
||||
|
||||
unsigned short uFSide = rclF.Side(rclN);
|
||||
unsigned short uNSide = rclN.Side(rclF);
|
||||
unsigned short uFSide = rclF.Side(rclN);
|
||||
unsigned short uNSide = rclN.Side(rclF);
|
||||
|
||||
if (uFSide == USHRT_MAX || uNSide == USHRT_MAX)
|
||||
return false; // not neighbours
|
||||
if (uFSide == USHRT_MAX || uNSide == USHRT_MAX)
|
||||
return false; // not neighbours
|
||||
|
||||
unsigned long uPtCnt = _rclMesh._aclPointArray.size();
|
||||
unsigned long uPtInd = this->GetOrAddIndex(rP);
|
||||
unsigned long ulSize = _rclMesh._aclFacetArray.size();
|
||||
unsigned long uPtCnt = _rclMesh._aclPointArray.size();
|
||||
unsigned long uPtInd = this->GetOrAddIndex(rP);
|
||||
unsigned long ulSize = _rclMesh._aclFacetArray.size();
|
||||
|
||||
// the given point is already part of the mesh => creating new facets would
|
||||
// be an illegal operation
|
||||
if (uPtInd < uPtCnt)
|
||||
return false;
|
||||
// the given point is already part of the mesh => creating new facets would
|
||||
// be an illegal operation
|
||||
if (uPtInd < uPtCnt)
|
||||
return false;
|
||||
|
||||
// adjust the neighbourhood
|
||||
if (rclF._aulNeighbours[(uFSide+1)%3] != ULONG_MAX)
|
||||
_rclMesh._aclFacetArray[rclF._aulNeighbours[(uFSide+1)%3]].ReplaceNeighbour(ulFacetPos, ulSize);
|
||||
if (rclN._aulNeighbours[(uNSide+2)%3] != ULONG_MAX)
|
||||
_rclMesh._aclFacetArray[rclN._aulNeighbours[(uNSide+2)%3]].ReplaceNeighbour(ulNeighbour, ulSize+1);
|
||||
// adjust the neighbourhood
|
||||
if (rclF._aulNeighbours[(uFSide+1)%3] != ULONG_MAX)
|
||||
_rclMesh._aclFacetArray[rclF._aulNeighbours[(uFSide+1)%3]].ReplaceNeighbour(ulFacetPos, ulSize);
|
||||
if (rclN._aulNeighbours[(uNSide+2)%3] != ULONG_MAX)
|
||||
_rclMesh._aclFacetArray[rclN._aulNeighbours[(uNSide+2)%3]].ReplaceNeighbour(ulNeighbour, ulSize+1);
|
||||
|
||||
MeshFacet cNew1, cNew2;
|
||||
cNew1._aulPoints[0] = uPtInd;
|
||||
cNew1._aulPoints[1] = rclF._aulPoints[(uFSide+1)%3];
|
||||
cNew1._aulPoints[2] = rclF._aulPoints[(uFSide+2)%3];
|
||||
cNew1._aulNeighbours[0] = ulSize+1;
|
||||
cNew1._aulNeighbours[1] = rclF._aulNeighbours[(uFSide+1)%3];
|
||||
cNew1._aulNeighbours[2] = ulFacetPos;
|
||||
MeshFacet cNew1, cNew2;
|
||||
cNew1._aulPoints[0] = uPtInd;
|
||||
cNew1._aulPoints[1] = rclF._aulPoints[(uFSide+1)%3];
|
||||
cNew1._aulPoints[2] = rclF._aulPoints[(uFSide+2)%3];
|
||||
cNew1._aulNeighbours[0] = ulSize+1;
|
||||
cNew1._aulNeighbours[1] = rclF._aulNeighbours[(uFSide+1)%3];
|
||||
cNew1._aulNeighbours[2] = ulFacetPos;
|
||||
|
||||
cNew2._aulPoints[0] = rclN._aulPoints[uNSide];
|
||||
cNew2._aulPoints[1] = uPtInd;
|
||||
cNew2._aulPoints[2] = rclN._aulPoints[(uNSide+2)%3];
|
||||
cNew2._aulNeighbours[0] = ulSize;
|
||||
cNew2._aulNeighbours[1] = ulNeighbour;
|
||||
cNew2._aulNeighbours[2] = rclN._aulNeighbours[(uNSide+2)%3];
|
||||
cNew2._aulPoints[0] = rclN._aulPoints[uNSide];
|
||||
cNew2._aulPoints[1] = uPtInd;
|
||||
cNew2._aulPoints[2] = rclN._aulPoints[(uNSide+2)%3];
|
||||
cNew2._aulNeighbours[0] = ulSize;
|
||||
cNew2._aulNeighbours[1] = ulNeighbour;
|
||||
cNew2._aulNeighbours[2] = rclN._aulNeighbours[(uNSide+2)%3];
|
||||
|
||||
// adjust the facets
|
||||
rclF._aulPoints[(uFSide+1)%3] = uPtInd;
|
||||
rclF._aulNeighbours[(uFSide+1)%3] = ulSize;
|
||||
rclN._aulPoints[uNSide] = uPtInd;
|
||||
rclN._aulNeighbours[(uNSide+2)%3] = ulSize+1;
|
||||
// adjust the facets
|
||||
rclF._aulPoints[(uFSide+1)%3] = uPtInd;
|
||||
rclF._aulNeighbours[(uFSide+1)%3] = ulSize;
|
||||
rclN._aulPoints[uNSide] = uPtInd;
|
||||
rclN._aulNeighbours[(uNSide+2)%3] = ulSize+1;
|
||||
|
||||
// insert new facets
|
||||
_rclMesh._aclFacetArray.push_back(cNew1);
|
||||
_rclMesh._aclFacetArray.push_back(cNew2);
|
||||
// insert new facets
|
||||
_rclMesh._aclFacetArray.push_back(cNew1);
|
||||
_rclMesh._aclFacetArray.push_back(cNew2);
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
void MeshTopoAlgorithm::SplitOpenEdge(unsigned long ulFacetPos, unsigned short uSide, const Base::Vector3f& rP)
|
||||
{
|
||||
MeshFacet& rclF = _rclMesh._aclFacetArray[ulFacetPos];
|
||||
if (rclF._aulNeighbours[uSide] != ULONG_MAX)
|
||||
return; // not open
|
||||
MeshFacet& rclF = _rclMesh._aclFacetArray[ulFacetPos];
|
||||
if (rclF._aulNeighbours[uSide] != ULONG_MAX)
|
||||
return; // not open
|
||||
|
||||
unsigned long uPtCnt = _rclMesh._aclPointArray.size();
|
||||
unsigned long uPtInd = this->GetOrAddIndex(rP);
|
||||
unsigned long ulSize = _rclMesh._aclFacetArray.size();
|
||||
unsigned long uPtCnt = _rclMesh._aclPointArray.size();
|
||||
unsigned long uPtInd = this->GetOrAddIndex(rP);
|
||||
unsigned long ulSize = _rclMesh._aclFacetArray.size();
|
||||
|
||||
if ( uPtInd < uPtCnt )
|
||||
return; // the given point is already part of the mesh => creating new facets would be an illegal operation
|
||||
if (uPtInd < uPtCnt)
|
||||
return; // the given point is already part of the mesh => creating new facets would be an illegal operation
|
||||
|
||||
// adjust the neighbourhood
|
||||
if (rclF._aulNeighbours[(uSide+1)%3] != ULONG_MAX)
|
||||
_rclMesh._aclFacetArray[rclF._aulNeighbours[(uSide+1)%3]].ReplaceNeighbour(ulFacetPos, ulSize);
|
||||
// adjust the neighbourhood
|
||||
if (rclF._aulNeighbours[(uSide+1)%3] != ULONG_MAX)
|
||||
_rclMesh._aclFacetArray[rclF._aulNeighbours[(uSide+1)%3]].ReplaceNeighbour(ulFacetPos, ulSize);
|
||||
|
||||
MeshFacet cNew;
|
||||
cNew._aulPoints[0] = uPtInd;
|
||||
cNew._aulPoints[1] = rclF._aulPoints[(uSide+1)%3];
|
||||
cNew._aulPoints[2] = rclF._aulPoints[(uSide+2)%3];
|
||||
cNew._aulNeighbours[0] = ULONG_MAX;
|
||||
cNew._aulNeighbours[1] = rclF._aulNeighbours[(uSide+1)%3];
|
||||
cNew._aulNeighbours[2] = ulFacetPos;
|
||||
MeshFacet cNew;
|
||||
cNew._aulPoints[0] = uPtInd;
|
||||
cNew._aulPoints[1] = rclF._aulPoints[(uSide+1)%3];
|
||||
cNew._aulPoints[2] = rclF._aulPoints[(uSide+2)%3];
|
||||
cNew._aulNeighbours[0] = ULONG_MAX;
|
||||
cNew._aulNeighbours[1] = rclF._aulNeighbours[(uSide+1)%3];
|
||||
cNew._aulNeighbours[2] = ulFacetPos;
|
||||
|
||||
// adjust the facets
|
||||
rclF._aulPoints[(uSide+1)%3] = uPtInd;
|
||||
rclF._aulNeighbours[(uSide+1)%3] = ulSize;
|
||||
// adjust the facets
|
||||
rclF._aulPoints[(uSide+1)%3] = uPtInd;
|
||||
rclF._aulNeighbours[(uSide+1)%3] = ulSize;
|
||||
|
||||
// insert new facets
|
||||
_rclMesh._aclFacetArray.push_back(cNew);
|
||||
// insert new facets
|
||||
_rclMesh._aclFacetArray.push_back(cNew);
|
||||
}
|
||||
|
||||
bool MeshTopoAlgorithm::Vertex_Less::operator ()(const Base::Vector3f& u,
|
||||
|
@ -801,43 +799,40 @@ unsigned long MeshTopoAlgorithm::GetOrAddIndex (const MeshPoint &rclPoint)
|
|||
|
||||
std::vector<unsigned long> MeshTopoAlgorithm::GetFacetsToPoint(unsigned long uFacetPos, unsigned long uPointPos) const
|
||||
{
|
||||
// get all facets this point is referenced by
|
||||
std::list<unsigned long> aReference;
|
||||
aReference.push_back(uFacetPos);
|
||||
std::set<unsigned long> aRefFacet;
|
||||
while ( !aReference.empty() )
|
||||
{
|
||||
unsigned long uIndex = aReference.front();
|
||||
aReference.pop_front();
|
||||
aRefFacet.insert(uIndex);
|
||||
MeshFacet& rFace = _rclMesh._aclFacetArray[uIndex];
|
||||
for ( int i=0; i<3; i++ ) {
|
||||
if ( rFace._aulPoints[i] == uPointPos ) {
|
||||
if ( rFace._aulNeighbours[i] != ULONG_MAX )
|
||||
{
|
||||
if ( aRefFacet.find(rFace._aulNeighbours[i]) == aRefFacet.end() )
|
||||
aReference.push_back( rFace._aulNeighbours[i] );
|
||||
// get all facets this point is referenced by
|
||||
std::list<unsigned long> aReference;
|
||||
aReference.push_back(uFacetPos);
|
||||
std::set<unsigned long> aRefFacet;
|
||||
while (!aReference.empty()) {
|
||||
unsigned long uIndex = aReference.front();
|
||||
aReference.pop_front();
|
||||
aRefFacet.insert(uIndex);
|
||||
MeshFacet& rFace = _rclMesh._aclFacetArray[uIndex];
|
||||
for (int i=0; i<3; i++) {
|
||||
if (rFace._aulPoints[i] == uPointPos) {
|
||||
if (rFace._aulNeighbours[i] != ULONG_MAX) {
|
||||
if (aRefFacet.find(rFace._aulNeighbours[i]) == aRefFacet.end())
|
||||
aReference.push_back( rFace._aulNeighbours[i] );
|
||||
}
|
||||
if (rFace._aulNeighbours[(i+2)%3] != ULONG_MAX) {
|
||||
if (aRefFacet.find(rFace._aulNeighbours[(i+2)%3]) == aRefFacet.end())
|
||||
aReference.push_back( rFace._aulNeighbours[(i+2)%3] );
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ( rFace._aulNeighbours[(i+2)%3] != ULONG_MAX )
|
||||
{
|
||||
if ( aRefFacet.find(rFace._aulNeighbours[(i+2)%3]) == aRefFacet.end() )
|
||||
aReference.push_back( rFace._aulNeighbours[(i+2)%3] );
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//copy the items
|
||||
std::vector<unsigned long> aRefs;
|
||||
aRefs.insert(aRefs.end(), aRefFacet.begin(), aRefFacet.end());
|
||||
return aRefs;
|
||||
//copy the items
|
||||
std::vector<unsigned long> aRefs;
|
||||
aRefs.insert(aRefs.end(), aRefFacet.begin(), aRefFacet.end());
|
||||
return aRefs;
|
||||
}
|
||||
|
||||
void MeshTopoAlgorithm::Cleanup()
|
||||
{
|
||||
_rclMesh.RemoveInvalids();
|
||||
_needsCleanup = false;
|
||||
_rclMesh.RemoveInvalids();
|
||||
_needsCleanup = false;
|
||||
}
|
||||
|
||||
bool MeshTopoAlgorithm::CollapseEdge(unsigned long ulFacetPos, unsigned long ulNeighbour)
|
||||
|
|
|
@ -195,7 +195,7 @@ MeshPlaneVisitor::~MeshPlaneVisitor ()
|
|||
}
|
||||
|
||||
bool MeshPlaneVisitor::AllowVisit (const MeshFacet& face, const MeshFacet&,
|
||||
unsigned long, unsigned long, unsigned short neighbourIndex)
|
||||
unsigned long, unsigned long, unsigned short)
|
||||
{
|
||||
if (!fitter->Done())
|
||||
fitter->Fit();
|
||||
|
|
|
@ -59,6 +59,11 @@ public:
|
|||
unsigned long ulFInd, unsigned long ulLevel,
|
||||
unsigned short neighbourIndex)
|
||||
{
|
||||
(void)rclFacet;
|
||||
(void)rclFrom;
|
||||
(void)ulFInd;
|
||||
(void)ulLevel;
|
||||
(void)neighbourIndex;
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
@ -88,6 +93,7 @@ protected:
|
|||
inline bool MeshSearchNeighbourFacetsVisitor::Visit (const MeshFacet &rclFacet, const MeshFacet &rclFrom,
|
||||
unsigned long ulFInd, unsigned long ulLevel)
|
||||
{
|
||||
(void)rclFrom;
|
||||
if (ulLevel > _ulCurrentLevel) {
|
||||
if (_bFacetsFoundInCurrentLevel == false)
|
||||
return false;
|
||||
|
@ -118,6 +124,8 @@ public:
|
|||
virtual bool Visit (const MeshFacet &rclFacet, const MeshFacet &rclFrom,
|
||||
unsigned long ulFInd, unsigned long)
|
||||
{
|
||||
(void)rclFacet;
|
||||
(void)rclFrom;
|
||||
_raulNeighbours.push_back(ulFInd);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -61,8 +61,10 @@ PyObject *FacetPy::PyMake(struct _typeobject *, PyObject *, PyObject *) // Pyth
|
|||
}
|
||||
|
||||
// constructor method
|
||||
int FacetPy::PyInit(PyObject* args, PyObject*k)
|
||||
int FacetPy::PyInit(PyObject* args, PyObject* /*kwds*/)
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -199,12 +201,12 @@ Py::Float FacetPy::getArea(void) const
|
|||
return Py::Float(tria.Area());
|
||||
}
|
||||
|
||||
PyObject *FacetPy::getCustomAttributes(const char* attr) const
|
||||
PyObject *FacetPy::getCustomAttributes(const char* /*attr*/) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int FacetPy::setCustomAttributes(const char* attr, PyObject *obj)
|
||||
int FacetPy::setCustomAttributes(const char* /*attr*/, PyObject * /*obj*/)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -107,7 +107,7 @@ unsigned long MeshObject::countSubElements(const char* Type) const
|
|||
return 0;
|
||||
}
|
||||
|
||||
Data::Segment* MeshObject::getSubElement(const char* Type, unsigned long n) const
|
||||
Data::Segment* MeshObject::getSubElement(const char* Type, unsigned long /*n*/) const
|
||||
{
|
||||
//TODO
|
||||
std::string element(Type);
|
||||
|
@ -118,9 +118,9 @@ Data::Segment* MeshObject::getSubElement(const char* Type, unsigned long n) cons
|
|||
return 0;
|
||||
}
|
||||
|
||||
void MeshObject::getFacesFromSubelement(const Data::Segment* segm,
|
||||
void MeshObject::getFacesFromSubelement(const Data::Segment* /*segm*/,
|
||||
std::vector<Base::Vector3d> &Points,
|
||||
std::vector<Base::Vector3d> &PointNormals,
|
||||
std::vector<Base::Vector3d> &/*PointNormals*/,
|
||||
std::vector<Facet> &faces) const
|
||||
{
|
||||
//TODO
|
||||
|
@ -289,7 +289,7 @@ Mesh::Facet MeshObject::getFacet(unsigned long index) const
|
|||
}
|
||||
|
||||
void MeshObject::getFaces(std::vector<Base::Vector3d> &Points,std::vector<Facet> &Topo,
|
||||
float Accuracy, uint16_t flags) const
|
||||
float /*Accuracy*/, uint16_t /*flags*/) const
|
||||
{
|
||||
unsigned long ctpoints = _kernel.CountPoints();
|
||||
Points.reserve(ctpoints);
|
||||
|
@ -314,7 +314,7 @@ unsigned int MeshObject::getMemSize (void) const
|
|||
return _kernel.GetMemSize();
|
||||
}
|
||||
|
||||
void MeshObject::Save (Base::Writer &writer) const
|
||||
void MeshObject::Save (Base::Writer &/*writer*/) const
|
||||
{
|
||||
// this is handled by the property class
|
||||
}
|
||||
|
@ -324,7 +324,7 @@ void MeshObject::SaveDocFile (Base::Writer &writer) const
|
|||
_kernel.Write(writer.Stream());
|
||||
}
|
||||
|
||||
void MeshObject::Restore(Base::XMLReader &reader)
|
||||
void MeshObject::Restore(Base::XMLReader &/*reader*/)
|
||||
{
|
||||
// this is handled by the property class
|
||||
}
|
||||
|
@ -1659,7 +1659,7 @@ MeshObject* MeshObject::meshFromSegment(const std::vector<unsigned long>& indice
|
|||
return new MeshObject(kernel, _Mtrx);
|
||||
}
|
||||
|
||||
std::vector<Segment> MeshObject::getSegmentsFromType(MeshObject::GeometryType type, const Segment& aSegment,
|
||||
std::vector<Segment> MeshObject::getSegmentsFromType(MeshObject::GeometryType type,
|
||||
float dev, unsigned long minFacets) const
|
||||
{
|
||||
std::vector<Segment> segm;
|
||||
|
@ -1667,17 +1667,31 @@ std::vector<Segment> MeshObject::getSegmentsFromType(MeshObject::GeometryType ty
|
|||
return segm;
|
||||
|
||||
MeshCore::MeshSegmentAlgorithm finder(this->_kernel);
|
||||
MeshCore::MeshDistanceSurfaceSegment* surf;
|
||||
surf = new MeshCore::MeshDistancePlanarSegment(this->_kernel, minFacets, dev);
|
||||
std::vector<MeshCore::MeshSurfaceSegment*> surfaces;
|
||||
surfaces.push_back(surf);
|
||||
finder.FindSegments(surfaces);
|
||||
|
||||
const std::vector<MeshCore::MeshSegment>& data = surf->GetSegments();
|
||||
for (std::vector<MeshCore::MeshSegment>::const_iterator it = data.begin(); it != data.end(); ++it) {
|
||||
segm.push_back(Segment(const_cast<MeshObject*>(this), *it, false));
|
||||
std::unique_ptr<MeshCore::MeshDistanceSurfaceSegment> surf;
|
||||
switch (type) {
|
||||
case PLANE:
|
||||
surf.reset(new MeshCore::MeshDistancePlanarSegment(this->_kernel, minFacets, dev));
|
||||
break;
|
||||
// todo!
|
||||
case CYLINDER:
|
||||
break;
|
||||
case SPHERE:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
delete surf;
|
||||
|
||||
if (surf.get()) {
|
||||
std::vector<MeshCore::MeshSurfaceSegment*> surfaces;
|
||||
surfaces.push_back(surf.get());
|
||||
finder.FindSegments(surfaces);
|
||||
|
||||
const std::vector<MeshCore::MeshSegment>& data = surf->GetSegments();
|
||||
for (std::vector<MeshCore::MeshSegment>::const_iterator it = data.begin(); it != data.end(); ++it) {
|
||||
segm.push_back(Segment(const_cast<MeshObject*>(this), *it, false));
|
||||
}
|
||||
}
|
||||
|
||||
return segm;
|
||||
}
|
||||
|
||||
|
|
|
@ -293,7 +293,7 @@ public:
|
|||
const Segment& getSegment(unsigned long) const;
|
||||
Segment& getSegment(unsigned long);
|
||||
MeshObject* meshFromSegment(const std::vector<unsigned long>&) const;
|
||||
std::vector<Segment> getSegmentsFromType(GeometryType, const Segment& aSegment, float dev, unsigned long minFacets) const;
|
||||
std::vector<Segment> getSegmentsFromType(GeometryType, float dev, unsigned long minFacets) const;
|
||||
//@}
|
||||
|
||||
/** @name Primitives */
|
||||
|
|
|
@ -57,7 +57,7 @@ PyObject *MeshPointPy::PyMake(struct _typeobject *, PyObject *, PyObject *) //
|
|||
}
|
||||
|
||||
// constructor method
|
||||
int MeshPointPy::PyInit(PyObject* args, PyObject*k)
|
||||
int MeshPointPy::PyInit(PyObject* args, PyObject* /*kwds*/)
|
||||
{
|
||||
double x=0.0,y=0.0,z=0.0;
|
||||
if (!PyArg_ParseTuple(args, "|ddd", &x,&y,&z))
|
||||
|
@ -69,6 +69,8 @@ int MeshPointPy::PyInit(PyObject* args, PyObject*k)
|
|||
|
||||
PyObject* MeshPointPy::unbound(PyObject *args)
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return NULL;
|
||||
getMeshPointPtr()->Index = UINT_MAX;
|
||||
getMeshPointPtr()->Mesh = 0;
|
||||
Py_Return;
|
||||
|
@ -176,12 +178,12 @@ void MeshPointPy::setz(Py::Float arg)
|
|||
}
|
||||
}
|
||||
|
||||
PyObject *MeshPointPy::getCustomAttributes(const char* attr) const
|
||||
PyObject *MeshPointPy::getCustomAttributes(const char* /*attr*/) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int MeshPointPy::setCustomAttributes(const char* attr, PyObject *obj)
|
||||
int MeshPointPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -404,7 +404,7 @@ PyObject* PropertyCurvatureList::getPyObject(void)
|
|||
return Py::new_reference_to(list);
|
||||
}
|
||||
|
||||
void PropertyCurvatureList::setPyObject(PyObject *value)
|
||||
void PropertyCurvatureList::setPyObject(PyObject* /*value*/)
|
||||
{
|
||||
throw Base::AttributeError(std::string("This attribute is read-only"));
|
||||
}
|
||||
|
|
|
@ -488,6 +488,8 @@ PyObject* MeshPy::outer(PyObject *args)
|
|||
|
||||
PyObject* MeshPy::coarsen(PyObject *args)
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return NULL;
|
||||
PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
|
||||
return 0;
|
||||
}
|
||||
|
@ -1649,7 +1651,7 @@ PyObject* MeshPy::getPlanarSegments(PyObject *args)
|
|||
|
||||
Mesh::MeshObject* mesh = getMeshObjectPtr();
|
||||
std::vector<Mesh::Segment> segments = mesh->getSegmentsFromType
|
||||
(Mesh::MeshObject::PLANE, Mesh::Segment(mesh,false), dev, minFacets);
|
||||
(Mesh::MeshObject::PLANE, dev, minFacets);
|
||||
|
||||
Py::List s;
|
||||
for (std::vector<Mesh::Segment>::iterator it = segments.begin(); it != segments.end(); ++it) {
|
||||
|
@ -1730,12 +1732,12 @@ Py::Float MeshPy::getVolume(void) const
|
|||
return Py::Float(getMeshObjectPtr()->getVolume());
|
||||
}
|
||||
|
||||
PyObject *MeshPy::getCustomAttributes(const char* attr) const
|
||||
PyObject *MeshPy::getCustomAttributes(const char* /*attr*/) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int MeshPy::setCustomAttributes(const char* attr, PyObject *obj)
|
||||
int MeshPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -63,6 +63,7 @@ template <class Real>
|
|||
Real DistVector3Plane3<Real>::Get (Real fT, const Vector3<Real>& rkVelocity0,
|
||||
const Vector3<Real>& rkVelocity1)
|
||||
{
|
||||
(void)rkVelocity1;
|
||||
Vector3<Real> kMVector = m_rkVector + fT*rkVelocity0;
|
||||
Real fMConstant = m_rkPlane.Constant +
|
||||
fT*m_rkPlane.Normal.Dot(rkVelocity0);
|
||||
|
@ -74,6 +75,7 @@ template <class Real>
|
|||
Real DistVector3Plane3<Real>::GetSquared (Real fT,
|
||||
const Vector3<Real>& rkVelocity0, const Vector3<Real>& rkVelocity1)
|
||||
{
|
||||
(void)rkVelocity1;
|
||||
Vector3<Real> kMVector = m_rkVector + fT*rkVelocity0;
|
||||
Real fMConstant = m_rkPlane.Constant +
|
||||
fT*m_rkPlane.Normal.Dot(rkVelocity0);
|
||||
|
|
|
@ -606,6 +606,9 @@ bool IntrTriangle3Triangle3<Real>::IntersectsSegment (
|
|||
const Vector3<Real>& rkEnd1)
|
||||
{
|
||||
// TO DO.
|
||||
(void)rkTriangle;
|
||||
(void)rkEnd0;
|
||||
(void)rkEnd1;
|
||||
return false;
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
|
@ -614,6 +617,8 @@ bool IntrTriangle3Triangle3<Real>::GetCoplanarIntersection (
|
|||
const Plane3<Real>& rkPlane, const Triangle3<Real>& rkTri0,
|
||||
const Triangle3<Real>& rkTri1)
|
||||
{
|
||||
(void)rkTri0;
|
||||
(void)rkTri1;
|
||||
// Project triangles onto coordinate plane most aligned with plane
|
||||
// normal.
|
||||
int iMaxNormal = 0;
|
||||
|
@ -742,6 +747,7 @@ bool IntrTriangle3Triangle3<Real>::TestOverlap (const Vector3<Real>& rkAxis,
|
|||
Real fTMax, Real fSpeed, Real fUMin, Real fUMax, Real fVMin, Real fVMax,
|
||||
Real& rfTFirst, Real& rfTLast)
|
||||
{
|
||||
(void)rkAxis;
|
||||
// Constant velocity separating axis test.
|
||||
|
||||
Real fT;
|
||||
|
@ -855,6 +861,7 @@ bool IntrTriangle3Triangle3<Real>::FindOverlap (const Vector3<Real>& rkAxis,
|
|||
const Configuration& rkVC, ContactSide& rkSide, Configuration& rkTUC,
|
||||
Configuration& rkTVC, Real& rfTFirst, Real& rfTLast)
|
||||
{
|
||||
(void)rkAxis;
|
||||
// Constant velocity separating axis test. UC and VC are the new
|
||||
// potential configurations, and TUC and TVC are the best known
|
||||
// configurations.
|
||||
|
@ -1242,6 +1249,10 @@ void IntrTriangle3Triangle3<Real>::GetEdgeEdgeIntersection (
|
|||
const Vector3<Real>& rkV0, const Vector3<Real>& rkV1)
|
||||
{
|
||||
// TO DO.
|
||||
(void)rkU0;
|
||||
(void)rkU1;
|
||||
(void)rkV0;
|
||||
(void)rkV1;
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
|
|
|
@ -108,6 +108,7 @@ Real QuadricSurface<Real>::FZ (const Vector3<Real>& rkP) const
|
|||
template <class Real>
|
||||
Real QuadricSurface<Real>::FXX (const Vector3<Real>& rkP) const
|
||||
{
|
||||
(void)rkP;
|
||||
Real fFXX = ((Real)2.0)*m_kA[0][0];
|
||||
return fFXX;
|
||||
}
|
||||
|
@ -115,6 +116,7 @@ Real QuadricSurface<Real>::FXX (const Vector3<Real>& rkP) const
|
|||
template <class Real>
|
||||
Real QuadricSurface<Real>::FXY (const Vector3<Real>& rkP) const
|
||||
{
|
||||
(void)rkP;
|
||||
Real fFXY = ((Real)2.0)*m_kA[0][1];
|
||||
return fFXY;
|
||||
}
|
||||
|
@ -122,6 +124,7 @@ Real QuadricSurface<Real>::FXY (const Vector3<Real>& rkP) const
|
|||
template <class Real>
|
||||
Real QuadricSurface<Real>::FXZ (const Vector3<Real>& rkP) const
|
||||
{
|
||||
(void)rkP;
|
||||
Real fFXZ = ((Real)2.0)*m_kA[0][2];
|
||||
return fFXZ;
|
||||
}
|
||||
|
@ -129,6 +132,7 @@ Real QuadricSurface<Real>::FXZ (const Vector3<Real>& rkP) const
|
|||
template <class Real>
|
||||
Real QuadricSurface<Real>::FYY (const Vector3<Real>& rkP) const
|
||||
{
|
||||
(void)rkP;
|
||||
Real fFYY = ((Real)2.0)*m_kA[1][1];
|
||||
return fFYY;
|
||||
}
|
||||
|
@ -136,6 +140,7 @@ Real QuadricSurface<Real>::FYY (const Vector3<Real>& rkP) const
|
|||
template <class Real>
|
||||
Real QuadricSurface<Real>::FYZ (const Vector3<Real>& rkP) const
|
||||
{
|
||||
(void)rkP;
|
||||
Real fFYZ = ((Real)2.0)*m_kA[1][2];
|
||||
return fFYZ;
|
||||
}
|
||||
|
@ -143,6 +148,7 @@ Real QuadricSurface<Real>::FYZ (const Vector3<Real>& rkP) const
|
|||
template <class Real>
|
||||
Real QuadricSurface<Real>::FZZ (const Vector3<Real>& rkP) const
|
||||
{
|
||||
(void)rkP;
|
||||
Real fFZZ = ((Real)2.0)*m_kA[2][2];
|
||||
return fFZZ;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ RVector3<ISIZE>::RVector3 ()
|
|||
}
|
||||
//----------------------------------------------------------------------------
|
||||
template <int ISIZE>
|
||||
RVector3<ISIZE>::RVector3 (const RVector3& rkV)
|
||||
RVector3<ISIZE>::RVector3 (const RVector3& rkV) : TRVector<3,ISIZE>()
|
||||
{
|
||||
m_akTuple[0] = rkV.m_akTuple[0];
|
||||
m_akTuple[1] = rkV.m_akTuple[1];
|
||||
|
|
|
@ -278,6 +278,7 @@ template <class Real>
|
|||
void TriangulateEC<Real>::InitializeVertices (int iVQuantity,
|
||||
const int* aiIndex, std::vector<int>& rkTriangle)
|
||||
{
|
||||
(void)rkTriangle;
|
||||
m_kVertex.clear();
|
||||
m_kVertex.resize(iVQuantity);
|
||||
m_iCFirst = -1;
|
||||
|
|
|
@ -93,7 +93,7 @@ CmdMeshTransform::CmdMeshTransform()
|
|||
sPixmap = "Std_Tool1";
|
||||
}
|
||||
|
||||
void CmdMeshTransform::activated(int iMsg)
|
||||
void CmdMeshTransform::activated(int)
|
||||
{
|
||||
unsigned int n = getSelection().countObjectsOfType(Mesh::Feature::getClassTypeId());
|
||||
if ( n!=1 ) return;
|
||||
|
@ -132,7 +132,7 @@ CmdMeshDemolding::CmdMeshDemolding()
|
|||
sPixmap = "Std_Tool1";
|
||||
}
|
||||
|
||||
void CmdMeshDemolding::activated(int iMsg)
|
||||
void CmdMeshDemolding::activated(int)
|
||||
{
|
||||
unsigned int n = getSelection().countObjectsOfType(Mesh::Feature::getClassTypeId());
|
||||
if ( n!=1 ) return;
|
||||
|
@ -170,7 +170,7 @@ CmdMeshUnion::CmdMeshUnion()
|
|||
sStatusTip = sMenuText;
|
||||
}
|
||||
|
||||
void CmdMeshUnion::activated(int iMsg)
|
||||
void CmdMeshUnion::activated(int)
|
||||
{
|
||||
std::vector<App::DocumentObject*> obj = Gui::Selection().getObjectsOfType(Mesh::Feature::getClassTypeId());
|
||||
std::string name1 = obj.front()->getNameInDocument();
|
||||
|
@ -240,7 +240,7 @@ CmdMeshDifference::CmdMeshDifference()
|
|||
sStatusTip = sMenuText;
|
||||
}
|
||||
|
||||
void CmdMeshDifference::activated(int iMsg)
|
||||
void CmdMeshDifference::activated(int)
|
||||
{
|
||||
std::vector<App::DocumentObject*> obj = Gui::Selection().getObjectsOfType(Mesh::Feature::getClassTypeId());
|
||||
std::string name1 = obj.front()->getNameInDocument();
|
||||
|
@ -310,7 +310,7 @@ CmdMeshIntersection::CmdMeshIntersection()
|
|||
sStatusTip = sMenuText;
|
||||
}
|
||||
|
||||
void CmdMeshIntersection::activated(int iMsg)
|
||||
void CmdMeshIntersection::activated(int)
|
||||
{
|
||||
std::vector<App::DocumentObject*> obj = Gui::Selection().getObjectsOfType(Mesh::Feature::getClassTypeId());
|
||||
std::string name1 = obj.front()->getNameInDocument();
|
||||
|
@ -381,7 +381,7 @@ CmdMeshImport::CmdMeshImport()
|
|||
sPixmap = "Mesh_Import_Mesh";
|
||||
}
|
||||
|
||||
void CmdMeshImport::activated(int iMsg)
|
||||
void CmdMeshImport::activated(int)
|
||||
{
|
||||
// use current path as default
|
||||
QStringList filter;
|
||||
|
@ -434,7 +434,7 @@ CmdMeshExport::CmdMeshExport()
|
|||
sPixmap = "Mesh_Export_Mesh";
|
||||
}
|
||||
|
||||
void CmdMeshExport::activated(int iMsg)
|
||||
void CmdMeshExport::activated(int)
|
||||
{
|
||||
std::vector<App::DocumentObject*> docObjs = Gui::Selection().getObjectsOfType
|
||||
(Mesh::Feature::getClassTypeId());
|
||||
|
@ -503,7 +503,7 @@ CmdMeshFromGeometry::CmdMeshFromGeometry()
|
|||
sStatusTip = QT_TR_NOOP("Create mesh from the selected geometry");
|
||||
}
|
||||
|
||||
void CmdMeshFromGeometry::activated(int iMsg)
|
||||
void CmdMeshFromGeometry::activated(int)
|
||||
{
|
||||
bool ok;
|
||||
double tol = QInputDialog::getDouble(Gui::getMainWindow(), QObject::tr("Meshing Tolerance"),
|
||||
|
@ -562,7 +562,7 @@ CmdMeshFromPartShape::CmdMeshFromPartShape()
|
|||
sPixmap = "Mesh_Mesh_from_Shape.svg";
|
||||
}
|
||||
|
||||
void CmdMeshFromPartShape::activated(int iMsg)
|
||||
void CmdMeshFromPartShape::activated(int)
|
||||
{
|
||||
doCommand(Doc,"import MeshPartGui, FreeCADGui\nFreeCADGui.runCommand('MeshPart_Mesher')\n");
|
||||
}
|
||||
|
@ -588,7 +588,7 @@ CmdMeshVertexCurvature::CmdMeshVertexCurvature()
|
|||
sPixmap = "Mesh_Curvature_Plot";
|
||||
}
|
||||
|
||||
void CmdMeshVertexCurvature::activated(int iMsg)
|
||||
void CmdMeshVertexCurvature::activated(int)
|
||||
{
|
||||
std::vector<App::DocumentObject*> meshes = getSelection().getObjectsOfType(Mesh::Feature::getClassTypeId());
|
||||
for (std::vector<App::DocumentObject*>::const_iterator it = meshes.begin(); it != meshes.end(); ++it) {
|
||||
|
@ -630,7 +630,7 @@ CmdMeshVertexCurvatureInfo::CmdMeshVertexCurvatureInfo()
|
|||
sStatusTip = QT_TR_NOOP("Information about curvature");
|
||||
}
|
||||
|
||||
void CmdMeshVertexCurvatureInfo::activated(int iMsg)
|
||||
void CmdMeshVertexCurvatureInfo::activated(int)
|
||||
{
|
||||
Gui::Document* doc = Gui::Application::Instance->activeDocument();
|
||||
Gui::View3DInventor* view = static_cast<Gui::View3DInventor*>(doc->getActiveView());
|
||||
|
@ -675,7 +675,7 @@ CmdMeshPolySegm::CmdMeshPolySegm()
|
|||
sPixmap = "PolygonPick";
|
||||
}
|
||||
|
||||
void CmdMeshPolySegm::activated(int iMsg)
|
||||
void CmdMeshPolySegm::activated(int)
|
||||
{
|
||||
std::vector<App::DocumentObject*> docObj = Gui::Selection().getObjectsOfType(Mesh::Feature::getClassTypeId());
|
||||
for (std::vector<App::DocumentObject*>::iterator it = docObj.begin(); it != docObj.end(); ++it) {
|
||||
|
@ -729,7 +729,7 @@ CmdMeshPolySelect::CmdMeshPolySelect()
|
|||
sStatusTip = QT_TR_NOOP("Select an area of the mesh");
|
||||
}
|
||||
|
||||
void CmdMeshPolySelect::activated(int iMsg)
|
||||
void CmdMeshPolySelect::activated(int)
|
||||
{
|
||||
std::vector<App::DocumentObject*> docObj = Gui::Selection().getObjectsOfType(Mesh::Feature::getClassTypeId());
|
||||
for (std::vector<App::DocumentObject*>::iterator it = docObj.begin(); it != docObj.end(); ++it) {
|
||||
|
@ -782,7 +782,7 @@ CmdMeshAddFacet::CmdMeshAddFacet()
|
|||
sStatusTip = QT_TR_NOOP("Add triangle manually to a mesh");
|
||||
}
|
||||
|
||||
void CmdMeshAddFacet::activated(int iMsg)
|
||||
void CmdMeshAddFacet::activated(int)
|
||||
{
|
||||
std::vector<App::DocumentObject*> docObj = Gui::Selection().getObjectsOfType(Mesh::Feature::getClassTypeId());
|
||||
for (std::vector<App::DocumentObject*>::iterator it = docObj.begin(); it != docObj.end(); ++it) {
|
||||
|
@ -829,7 +829,7 @@ CmdMeshPolyCut::CmdMeshPolyCut()
|
|||
sPixmap = "mesh_cut";
|
||||
}
|
||||
|
||||
void CmdMeshPolyCut::activated(int iMsg)
|
||||
void CmdMeshPolyCut::activated(int)
|
||||
{
|
||||
std::vector<App::DocumentObject*> docObj = Gui::Selection().getObjectsOfType(Mesh::Feature::getClassTypeId());
|
||||
for (std::vector<App::DocumentObject*>::iterator it = docObj.begin(); it != docObj.end(); ++it) {
|
||||
|
@ -887,7 +887,7 @@ CmdMeshPolyTrim::CmdMeshPolyTrim()
|
|||
sStatusTip = QT_TR_NOOP("Trims a mesh with a picked polygon");
|
||||
}
|
||||
|
||||
void CmdMeshPolyTrim::activated(int iMsg)
|
||||
void CmdMeshPolyTrim::activated(int)
|
||||
{
|
||||
std::vector<App::DocumentObject*> docObj = Gui::Selection().getObjectsOfType(Mesh::Feature::getClassTypeId());
|
||||
for (std::vector<App::DocumentObject*>::iterator it = docObj.begin(); it != docObj.end(); ++it) {
|
||||
|
@ -941,7 +941,7 @@ CmdMeshTrimByPlane::CmdMeshTrimByPlane()
|
|||
sStatusTip = QT_TR_NOOP("Trims a mesh with a plane");
|
||||
}
|
||||
|
||||
void CmdMeshTrimByPlane::activated(int iMsg)
|
||||
void CmdMeshTrimByPlane::activated(int)
|
||||
{
|
||||
Base::Type partType = Base::Type::fromName("Part::Plane");
|
||||
std::vector<App::DocumentObject*> plane = getSelection().getObjectsOfType(partType);
|
||||
|
@ -1024,7 +1024,7 @@ CmdMeshPolySplit::CmdMeshPolySplit()
|
|||
sStatusTip = QT_TR_NOOP("Splits a mesh into two meshes");
|
||||
}
|
||||
|
||||
void CmdMeshPolySplit::activated(int iMsg)
|
||||
void CmdMeshPolySplit::activated(int)
|
||||
{
|
||||
std::vector<App::DocumentObject*> docObj = Gui::Selection().getObjectsOfType(Mesh::Feature::getClassTypeId());
|
||||
for (std::vector<App::DocumentObject*>::iterator it = docObj.begin(); it != docObj.end(); ++it) {
|
||||
|
@ -1077,7 +1077,7 @@ CmdMeshToolMesh::CmdMeshToolMesh()
|
|||
sStatusTip = QT_TR_NOOP("Creates a segment from a given tool mesh");
|
||||
}
|
||||
|
||||
void CmdMeshToolMesh::activated(int iMsg)
|
||||
void CmdMeshToolMesh::activated(int)
|
||||
{
|
||||
std::vector<App::DocumentObject*> fea = Gui::Selection().getObjectsOfType(Mesh::Feature::getClassTypeId());
|
||||
if ( fea.size() == 2 )
|
||||
|
@ -1132,7 +1132,7 @@ CmdMeshEvaluation::CmdMeshEvaluation()
|
|||
sStatusTip = QT_TR_NOOP("Opens a dialog to analyze and repair a mesh");
|
||||
}
|
||||
|
||||
void CmdMeshEvaluation::activated(int iMsg)
|
||||
void CmdMeshEvaluation::activated(int)
|
||||
{
|
||||
if (MeshGui::DockEvaluateMeshImp::hasInstance()) {
|
||||
MeshGui::DockEvaluateMeshImp::instance()->show();
|
||||
|
@ -1174,7 +1174,7 @@ CmdMeshEvaluateFacet::CmdMeshEvaluateFacet()
|
|||
sPixmap = "mesh_pipette";
|
||||
}
|
||||
|
||||
void CmdMeshEvaluateFacet::activated(int iMsg)
|
||||
void CmdMeshEvaluateFacet::activated(int)
|
||||
{
|
||||
Gui::Document* doc = Gui::Application::Instance->activeDocument();
|
||||
Gui::View3DInventor* view = static_cast<Gui::View3DInventor*>(doc->getActiveView());
|
||||
|
@ -1217,7 +1217,7 @@ CmdMeshRemoveComponents::CmdMeshRemoveComponents()
|
|||
sPixmap = "Mesh_Remove_Components";
|
||||
}
|
||||
|
||||
void CmdMeshRemoveComponents::activated(int iMsg)
|
||||
void CmdMeshRemoveComponents::activated(int)
|
||||
{
|
||||
Gui::TaskView::TaskDialog* dlg = Gui::Control().activeDialog();
|
||||
if (!dlg) {
|
||||
|
@ -1261,7 +1261,7 @@ CmdMeshRemoveCompByHand::CmdMeshRemoveCompByHand()
|
|||
sStatusTip = QT_TR_NOOP("Mark a component to remove it from the mesh");
|
||||
}
|
||||
|
||||
void CmdMeshRemoveCompByHand::activated(int iMsg)
|
||||
void CmdMeshRemoveCompByHand::activated(int)
|
||||
{
|
||||
Gui::Document* doc = Gui::Application::Instance->activeDocument();
|
||||
Gui::View3DInventor* view = static_cast<Gui::View3DInventor*>(doc->getActiveView());
|
||||
|
@ -1303,7 +1303,7 @@ CmdMeshEvaluateSolid::CmdMeshEvaluateSolid()
|
|||
sStatusTip = QT_TR_NOOP("Checks whether the mesh is a solid");
|
||||
}
|
||||
|
||||
void CmdMeshEvaluateSolid::activated(int iMsg)
|
||||
void CmdMeshEvaluateSolid::activated(int)
|
||||
{
|
||||
std::vector<App::DocumentObject*> meshes = getSelection().getObjectsOfType(Mesh::Feature::getClassTypeId());
|
||||
for (std::vector<App::DocumentObject*>::const_iterator it = meshes.begin(); it != meshes.end(); ++it) {
|
||||
|
@ -1340,7 +1340,7 @@ CmdMeshSmoothing::CmdMeshSmoothing()
|
|||
sStatusTip = QT_TR_NOOP("Smooth the selected meshes");
|
||||
}
|
||||
|
||||
void CmdMeshSmoothing::activated(int iMsg)
|
||||
void CmdMeshSmoothing::activated(int)
|
||||
{
|
||||
#if 0
|
||||
MeshGui::SmoothingDialog dlg(Gui::getMainWindow());
|
||||
|
@ -1403,7 +1403,7 @@ CmdMeshHarmonizeNormals::CmdMeshHarmonizeNormals()
|
|||
sPixmap = "Mesh_Harmonize_Normals";
|
||||
}
|
||||
|
||||
void CmdMeshHarmonizeNormals::activated(int iMsg)
|
||||
void CmdMeshHarmonizeNormals::activated(int)
|
||||
{
|
||||
std::vector<App::DocumentObject*> meshes = getSelection().getObjectsOfType(Mesh::Feature::getClassTypeId());
|
||||
openCommand("Harmonize mesh normals");
|
||||
|
@ -1437,7 +1437,7 @@ CmdMeshFlipNormals::CmdMeshFlipNormals()
|
|||
sPixmap = "Mesh_Flip_Normals";
|
||||
}
|
||||
|
||||
void CmdMeshFlipNormals::activated(int iMsg)
|
||||
void CmdMeshFlipNormals::activated(int)
|
||||
{
|
||||
std::vector<App::DocumentObject*> meshes = getSelection().getObjectsOfType(Mesh::Feature::getClassTypeId());
|
||||
openCommand("Flip mesh normals");
|
||||
|
@ -1470,7 +1470,7 @@ CmdMeshBoundingBox::CmdMeshBoundingBox()
|
|||
sStatusTip = QT_TR_NOOP("Shows the boundings of the selected mesh");
|
||||
}
|
||||
|
||||
void CmdMeshBoundingBox::activated(int iMsg)
|
||||
void CmdMeshBoundingBox::activated(int)
|
||||
{
|
||||
std::vector<App::DocumentObject*> meshes = getSelection().getObjectsOfType(Mesh::Feature::getClassTypeId());
|
||||
for (std::vector<App::DocumentObject*>::const_iterator it = meshes.begin(); it != meshes.end(); ++it) {
|
||||
|
@ -1510,7 +1510,7 @@ CmdMeshBuildRegularSolid::CmdMeshBuildRegularSolid()
|
|||
sPixmap = "Mesh_Regular_Solid";
|
||||
}
|
||||
|
||||
void CmdMeshBuildRegularSolid::activated(int iMsg)
|
||||
void CmdMeshBuildRegularSolid::activated(int)
|
||||
{
|
||||
MeshGui::SingleDlgRegularSolidImp::instance()->show();
|
||||
}
|
||||
|
@ -1536,7 +1536,7 @@ CmdMeshFillupHoles::CmdMeshFillupHoles()
|
|||
sStatusTip = QT_TR_NOOP("Fill holes of the mesh");
|
||||
}
|
||||
|
||||
void CmdMeshFillupHoles::activated(int iMsg)
|
||||
void CmdMeshFillupHoles::activated(int)
|
||||
{
|
||||
std::vector<App::DocumentObject*> meshes = getSelection().getObjectsOfType(Mesh::Feature::getClassTypeId());
|
||||
bool ok;
|
||||
|
@ -1574,7 +1574,7 @@ CmdMeshFillInteractiveHole::CmdMeshFillInteractiveHole()
|
|||
sPixmap = "mesh_boundary";
|
||||
}
|
||||
|
||||
void CmdMeshFillInteractiveHole::activated(int iMsg)
|
||||
void CmdMeshFillInteractiveHole::activated(int)
|
||||
{
|
||||
Gui::Document* doc = Gui::Application::Instance->activeDocument();
|
||||
Gui::View3DInventor* view = static_cast<Gui::View3DInventor*>(doc->getActiveView());
|
||||
|
@ -1614,7 +1614,7 @@ CmdMeshSegmentation::CmdMeshSegmentation()
|
|||
sStatusTip = QT_TR_NOOP("Create mesh segments");
|
||||
}
|
||||
|
||||
void CmdMeshSegmentation::activated(int iMsg)
|
||||
void CmdMeshSegmentation::activated(int)
|
||||
{
|
||||
std::vector<App::DocumentObject*> objs = Gui::Selection().getObjectsOfType
|
||||
(Mesh::Feature::getClassTypeId());
|
||||
|
@ -1650,7 +1650,7 @@ CmdMeshMerge::CmdMeshMerge()
|
|||
sStatusTip = sToolTipText;
|
||||
}
|
||||
|
||||
void CmdMeshMerge::activated(int iMsg)
|
||||
void CmdMeshMerge::activated(int)
|
||||
{
|
||||
App::Document *pcDoc = App::GetApplication().getActiveDocument();
|
||||
if (!pcDoc)
|
||||
|
|
|
@ -1293,7 +1293,7 @@ DockEvaluateMeshImp::~DockEvaluateMeshImp()
|
|||
/**
|
||||
* Destroys the dock window this object is embedded into without destroying itself.
|
||||
*/
|
||||
void DockEvaluateMeshImp::closeEvent(QCloseEvent* e)
|
||||
void DockEvaluateMeshImp::closeEvent(QCloseEvent*)
|
||||
{
|
||||
// closes the dock window
|
||||
Gui::DockWindowManager* pDockMgr = Gui::DockWindowManager::instance();
|
||||
|
|
|
@ -110,8 +110,8 @@ public:
|
|||
virtual ~MeshHoleFiller()
|
||||
{
|
||||
}
|
||||
virtual bool fillHoles(Mesh::MeshObject& mesh, const std::list<std::vector<unsigned long> >& boundaries,
|
||||
unsigned long v1, unsigned long v2)
|
||||
virtual bool fillHoles(Mesh::MeshObject&, const std::list<std::vector<unsigned long> >&,
|
||||
unsigned long, unsigned long)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -85,19 +85,26 @@ QVariant PropertyMeshKernelItem::toolTip(const App::Property* prop) const
|
|||
|
||||
void PropertyMeshKernelItem::setValue(const QVariant& value)
|
||||
{
|
||||
Q_UNUSED(value);
|
||||
}
|
||||
|
||||
QWidget* PropertyMeshKernelItem::createEditor(QWidget* parent, const QObject* receiver, const char* method) const
|
||||
{
|
||||
Q_UNUSED(parent);
|
||||
Q_UNUSED(receiver);
|
||||
Q_UNUSED(method);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void PropertyMeshKernelItem::setEditorData(QWidget *editor, const QVariant& data) const
|
||||
{
|
||||
Q_UNUSED(editor);
|
||||
Q_UNUSED(data);
|
||||
}
|
||||
|
||||
QVariant PropertyMeshKernelItem::editorData(QWidget *editor) const
|
||||
{
|
||||
Q_UNUSED(editor);
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
|
|
|
@ -117,10 +117,10 @@ void SoFCIndexedFaceSet::drawCoords(const SoGLCoordinateElement * const vertexli
|
|||
const SbVec3f *normals,
|
||||
const int32_t *normalindices,
|
||||
SoMaterialBundle *materials,
|
||||
const int32_t *matindices,
|
||||
const int32_t * /*matindices*/,
|
||||
const int32_t binding,
|
||||
const SoTextureCoordinateBundle * const texcoords,
|
||||
const int32_t *texindices)
|
||||
const SoTextureCoordinateBundle * const /*texcoords*/,
|
||||
const int32_t * /*texindices*/)
|
||||
{
|
||||
const SbVec3f * coords3d = 0;
|
||||
coords3d = vertexlist->getArrayPtr3();
|
||||
|
@ -343,7 +343,7 @@ void SoFCIndexedFaceSet::startVisibility(SoAction * action)
|
|||
glLoadMatrixf((float*)view);
|
||||
}
|
||||
|
||||
void SoFCIndexedFaceSet::stopVisibility(SoAction * action)
|
||||
void SoFCIndexedFaceSet::stopVisibility(SoAction * /*action*/)
|
||||
{
|
||||
// restoring the original projection matrix
|
||||
glPopMatrix();
|
||||
|
|
|
@ -368,7 +368,7 @@ void SoFCMeshPickNode::notify(SoNotList *list)
|
|||
}
|
||||
|
||||
// Doc from superclass.
|
||||
void SoFCMeshPickNode::rayPick(SoRayPickAction * action)
|
||||
void SoFCMeshPickNode::rayPick(SoRayPickAction * /*action*/)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -426,7 +426,7 @@ void SoFCMeshGridNode::initClass(void)
|
|||
SO_NODE_INIT_CLASS(SoFCMeshGridNode, SoNode, "Node");
|
||||
}
|
||||
|
||||
void SoFCMeshGridNode::GLRender(SoGLRenderAction * action)
|
||||
void SoFCMeshGridNode::GLRender(SoGLRenderAction * /*action*/)
|
||||
{
|
||||
const SbVec3f& min = minGrid.getValue();
|
||||
const SbVec3f& max = maxGrid.getValue();
|
||||
|
|
|
@ -134,7 +134,7 @@ SoPolygon::rayPick(SoRayPickAction * action)
|
|||
inherited::rayPick(action);
|
||||
}
|
||||
|
||||
void SoPolygon::generatePrimitives(SoAction* action)
|
||||
void SoPolygon::generatePrimitives(SoAction* /*action*/)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -807,6 +807,7 @@ bool ViewProviderMesh::createToolMesh(const std::vector<SbVec2f>& rclPoly, const
|
|||
|
||||
void ViewProviderMesh::showOpenEdges(bool show)
|
||||
{
|
||||
(void)show;
|
||||
}
|
||||
|
||||
void ViewProviderMesh::clipMeshCallback(void * ud, SoEventCallback * n)
|
||||
|
|
|
@ -39,15 +39,15 @@
|
|||
# include <algorithm>
|
||||
# include <sstream>
|
||||
# include <QEvent>
|
||||
# include <QMenu>
|
||||
# include <QMessageBox>
|
||||
# include <QMenu>
|
||||
# include <QMessageBox>
|
||||
# include <QCursor>
|
||||
# include <QToolTip>
|
||||
# include <QWhatsThis>
|
||||
#endif
|
||||
|
||||
# include <iomanip>
|
||||
# include <ios>
|
||||
# include <iomanip>
|
||||
# include <ios>
|
||||
|
||||
// Here the FreeCAD includes sorted by Base,App,Gui......
|
||||
#include <Base/Console.h>
|
||||
|
@ -87,12 +87,12 @@ PROPERTY_SOURCE(MeshGui::ViewProviderMeshCurvature, Gui::ViewProviderDocumentObj
|
|||
|
||||
ViewProviderMeshCurvature::ViewProviderMeshCurvature()
|
||||
{
|
||||
pcColorRoot = new SoSeparator();
|
||||
pcColorRoot->ref();
|
||||
pcColorRoot = new SoSeparator();
|
||||
pcColorRoot->ref();
|
||||
pcColorMat = new SoMaterial;
|
||||
pcColorMat->ref();
|
||||
pcColorStyle = new SoDrawStyle();
|
||||
pcColorRoot->addChild(pcColorStyle);
|
||||
pcColorStyle = new SoDrawStyle();
|
||||
pcColorRoot->addChild(pcColorStyle);
|
||||
// simple color bar
|
||||
pcColorBar = new Gui::SoFCColorBar;
|
||||
pcColorBar->Attach(this);
|
||||
|
@ -101,7 +101,7 @@ ViewProviderMeshCurvature::ViewProviderMeshCurvature()
|
|||
pcLinkRoot = new SoGroup;
|
||||
pcLinkRoot->ref();
|
||||
|
||||
App::Material mat;
|
||||
App::Material mat;
|
||||
const SbColor* cols;
|
||||
if (pcColorMat->ambientColor.getNum() == 1) {
|
||||
cols = pcColorMat->ambientColor.getValues(0);
|
||||
|
@ -127,44 +127,44 @@ ViewProviderMeshCurvature::ViewProviderMeshCurvature()
|
|||
const float* trans = pcColorMat->transparency.getValues(0);
|
||||
mat.transparency = trans[0];
|
||||
}
|
||||
|
||||
ADD_PROPERTY(TextureMaterial,(mat));
|
||||
|
||||
ADD_PROPERTY(TextureMaterial,(mat));
|
||||
}
|
||||
|
||||
ViewProviderMeshCurvature::~ViewProviderMeshCurvature()
|
||||
{
|
||||
pcColorRoot->unref();
|
||||
pcColorRoot->unref();
|
||||
pcColorMat->unref();
|
||||
pcColorBar->Detach(this);
|
||||
pcColorBar->unref();
|
||||
pcLinkRoot->unref();
|
||||
}
|
||||
|
||||
void ViewProviderMeshCurvature::onChanged(const App::Property* prop)
|
||||
{
|
||||
if (prop == &TextureMaterial) {
|
||||
const App::Material& Mat = TextureMaterial.getValue();
|
||||
pcColorMat->ambientColor.setValue(Mat.ambientColor.r,Mat.ambientColor.g,Mat.ambientColor.b);
|
||||
pcColorMat->specularColor.setValue(Mat.specularColor.r,Mat.specularColor.g,Mat.specularColor.b);
|
||||
pcColorMat->emissiveColor.setValue(Mat.emissiveColor.r,Mat.emissiveColor.g,Mat.emissiveColor.b);
|
||||
pcColorMat->shininess.setValue(Mat.shininess);
|
||||
pcColorMat->transparency.setValue(Mat.transparency);
|
||||
}
|
||||
|
||||
ViewProviderDocumentObject::onChanged(prop);
|
||||
}
|
||||
|
||||
void ViewProviderMeshCurvature::hide(void)
|
||||
{
|
||||
inherited::hide();
|
||||
pcColorStyle->style = SoDrawStyle::INVISIBLE;
|
||||
}
|
||||
|
||||
void ViewProviderMeshCurvature::show(void)
|
||||
{
|
||||
inherited::show();
|
||||
pcColorStyle->style = SoDrawStyle::FILLED;
|
||||
}
|
||||
void ViewProviderMeshCurvature::onChanged(const App::Property* prop)
|
||||
{
|
||||
if (prop == &TextureMaterial) {
|
||||
const App::Material& Mat = TextureMaterial.getValue();
|
||||
pcColorMat->ambientColor.setValue(Mat.ambientColor.r,Mat.ambientColor.g,Mat.ambientColor.b);
|
||||
pcColorMat->specularColor.setValue(Mat.specularColor.r,Mat.specularColor.g,Mat.specularColor.b);
|
||||
pcColorMat->emissiveColor.setValue(Mat.emissiveColor.r,Mat.emissiveColor.g,Mat.emissiveColor.b);
|
||||
pcColorMat->shininess.setValue(Mat.shininess);
|
||||
pcColorMat->transparency.setValue(Mat.transparency);
|
||||
}
|
||||
|
||||
ViewProviderDocumentObject::onChanged(prop);
|
||||
}
|
||||
|
||||
void ViewProviderMeshCurvature::hide(void)
|
||||
{
|
||||
inherited::hide();
|
||||
pcColorStyle->style = SoDrawStyle::INVISIBLE;
|
||||
}
|
||||
|
||||
void ViewProviderMeshCurvature::show(void)
|
||||
{
|
||||
inherited::show();
|
||||
pcColorStyle->style = SoDrawStyle::FILLED;
|
||||
}
|
||||
|
||||
void ViewProviderMeshCurvature::init(const Mesh::PropertyCurvatureList* pCurvInfo)
|
||||
{
|
||||
|
@ -281,8 +281,8 @@ void ViewProviderMeshCurvature::attach(App::DocumentObject *pcFeat)
|
|||
pcColorBar->unref();
|
||||
pcColorBar = pcBar;
|
||||
}
|
||||
|
||||
pcColorRoot->addChild(pcColorBar);
|
||||
|
||||
pcColorRoot->addChild(pcColorBar);
|
||||
}
|
||||
|
||||
void ViewProviderMeshCurvature::updateData(const App::Property* prop)
|
||||
|
@ -399,7 +399,7 @@ std::vector<std::string> ViewProviderMeshCurvature::getDisplayModes(void) const
|
|||
return StrList;
|
||||
}
|
||||
|
||||
void ViewProviderMeshCurvature::OnChange(Base::Subject<int> &rCaller,int rcReason)
|
||||
void ViewProviderMeshCurvature::OnChange(Base::Subject<int> &/*rCaller*/,int /*rcReason*/)
|
||||
{
|
||||
setActiveMode();
|
||||
}
|
||||
|
@ -479,22 +479,22 @@ void ViewProviderMeshCurvature::curvatureInfoCallback(void * ud, SoEventCallback
|
|||
n->getAction()->setHandled();
|
||||
if (mbe->getButton() == SoMouseButtonEvent::BUTTON2 && mbe->getState() == SoButtonEvent::UP) {
|
||||
n->setHandled();
|
||||
// context-menu
|
||||
QMenu menu;
|
||||
QAction* fl = menu.addAction(QObject::tr("Annotation"));
|
||||
fl->setCheckable(true);
|
||||
fl->setChecked(addflag);
|
||||
QAction* cl = menu.addAction(QObject::tr("Leave info mode"));
|
||||
QAction* id = menu.exec(QCursor::pos());
|
||||
if (fl == id) {
|
||||
addflag = fl->isChecked();
|
||||
}
|
||||
else if (cl == id) {
|
||||
view->setEditing(false);
|
||||
view->getWidget()->setCursor(QCursor(Qt::ArrowCursor));
|
||||
// context-menu
|
||||
QMenu menu;
|
||||
QAction* fl = menu.addAction(QObject::tr("Annotation"));
|
||||
fl->setCheckable(true);
|
||||
fl->setChecked(addflag);
|
||||
QAction* cl = menu.addAction(QObject::tr("Leave info mode"));
|
||||
QAction* id = menu.exec(QCursor::pos());
|
||||
if (fl == id) {
|
||||
addflag = fl->isChecked();
|
||||
}
|
||||
else if (cl == id) {
|
||||
view->setEditing(false);
|
||||
view->getWidget()->setCursor(QCursor(Qt::ArrowCursor));
|
||||
view->setRedirectToSceneGraph(false);
|
||||
view->removeEventCallback(SoEvent::getClassTypeId(), curvatureInfoCallback);
|
||||
}
|
||||
view->removeEventCallback(SoEvent::getClassTypeId(), curvatureInfoCallback, ud);
|
||||
}
|
||||
}
|
||||
else if (mbe->getButton() == SoMouseButtonEvent::BUTTON1 && mbe->getState() == SoButtonEvent::UP) {
|
||||
const SoPickedPoint * point = n->getPickedPoint();
|
||||
|
@ -524,17 +524,17 @@ void ViewProviderMeshCurvature::curvatureInfoCallback(void * ud, SoEventCallback
|
|||
if (addflag) {
|
||||
SbVec3f pt = point->getPoint();
|
||||
SbVec3f nl = point->getNormal();
|
||||
Annotation* anno = new Annotation(self, text, pt, nl);
|
||||
SoIdleSensor* sensor = new SoIdleSensor(Annotation::run, anno);
|
||||
sensor->schedule();
|
||||
}
|
||||
else {
|
||||
Annotation* anno = new Annotation(self, text, pt, nl);
|
||||
SoIdleSensor* sensor = new SoIdleSensor(Annotation::run, anno);
|
||||
sensor->schedule();
|
||||
}
|
||||
else {
|
||||
Gui::ToolTip::showText(QCursor::pos(), text);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (ev->getTypeId().isDerivedFrom(SoLocation2Event::getClassTypeId())) {
|
||||
else if (ev->getTypeId().isDerivedFrom(SoLocation2Event::getClassTypeId())) {
|
||||
const SoPickedPoint * point = n->getPickedPoint();
|
||||
if (point == NULL)
|
||||
return;
|
||||
|
@ -557,7 +557,7 @@ void ViewProviderMeshCurvature::curvatureInfoCallback(void * ud, SoEventCallback
|
|||
std::string info = that->curvatureInfo(false, index1, index2, index3);
|
||||
Gui::getMainWindow()->setPaneText(1,QString::fromLatin1(info.c_str()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::string ViewProviderMeshCurvature::curvatureInfo(bool detail, int index1, int index2, int index3) const
|
||||
|
@ -608,8 +608,8 @@ std::string ViewProviderMeshCurvature::curvatureInfo(bool detail, int index1, in
|
|||
str << mode << ": <" << fVal1 << ", " << fVal2 << ", " << fVal3 << ">";
|
||||
}
|
||||
else {
|
||||
str.setf(std::ios::fixed | std::ios::showpoint);
|
||||
str.precision(5);
|
||||
str.setf(std::ios::fixed | std::ios::showpoint);
|
||||
str.precision(5);
|
||||
str << mode << std::endl
|
||||
<< "v1: " << std::setw(5) << fVal1 << std::endl
|
||||
<< "v2: " << std::setw(5) << fVal2 << std::endl
|
||||
|
|
|
@ -46,7 +46,7 @@ using namespace MeshGui;
|
|||
qApp->translate("Workbench", "Mesh tools");
|
||||
#endif
|
||||
|
||||
/// @namespace MeshGui @class Workbench
|
||||
/// @namespace MeshGui @class Workbench
|
||||
TYPESYSTEM_SOURCE(MeshGui::Workbench, Gui::StdWorkbench)
|
||||
|
||||
Workbench::Workbench()
|
||||
|
@ -56,106 +56,106 @@ Workbench::Workbench()
|
|||
Workbench::~Workbench()
|
||||
{
|
||||
}
|
||||
|
||||
class MeshInfoWatcher : public Gui::TaskView::TaskWatcher, public Gui::SelectionObserver
|
||||
{
|
||||
public:
|
||||
MeshInfoWatcher() : TaskWatcher(0)
|
||||
{
|
||||
labelPoints = new QLabel();
|
||||
|
||||
class MeshInfoWatcher : public Gui::TaskView::TaskWatcher, public Gui::SelectionObserver
|
||||
{
|
||||
public:
|
||||
MeshInfoWatcher() : TaskWatcher(0)
|
||||
{
|
||||
labelPoints = new QLabel();
|
||||
labelPoints->setText(QString::fromLatin1("Number of points:"));
|
||||
|
||||
labelFacets = new QLabel();
|
||||
|
||||
labelFacets = new QLabel();
|
||||
labelFacets->setText(QString::fromLatin1("Number of facets:"));
|
||||
|
||||
numPoints = new QLabel();
|
||||
numFacets = new QLabel();
|
||||
|
||||
labelMin = new QLabel();
|
||||
|
||||
numPoints = new QLabel();
|
||||
numFacets = new QLabel();
|
||||
|
||||
labelMin = new QLabel();
|
||||
labelMin->setText(QString::fromLatin1("Minumum bound:"));
|
||||
|
||||
labelMax = new QLabel();
|
||||
|
||||
labelMax = new QLabel();
|
||||
labelMax->setText(QString::fromLatin1("Maximum bound:"));
|
||||
|
||||
numMin = new QLabel();
|
||||
numMax = new QLabel();
|
||||
|
||||
QGroupBox* box = new QGroupBox();
|
||||
|
||||
numMin = new QLabel();
|
||||
numMax = new QLabel();
|
||||
|
||||
QGroupBox* box = new QGroupBox();
|
||||
box->setTitle(QString::fromLatin1("Mesh info box"));
|
||||
//box->setAutoFillBackground(true);
|
||||
QGridLayout* grid = new QGridLayout(box);
|
||||
grid->addWidget(labelPoints, 0, 0);
|
||||
grid->addWidget(numPoints, 0, 1);
|
||||
grid->addWidget(labelFacets, 1, 0);
|
||||
grid->addWidget(numFacets, 1, 1);
|
||||
|
||||
grid->addWidget(labelMin, 2, 0);
|
||||
grid->addWidget(numMin, 2, 1);
|
||||
grid->addWidget(labelMax, 3, 0);
|
||||
grid->addWidget(numMax, 3, 1);
|
||||
|
||||
Gui::TaskView::TaskBox* taskbox = new Gui::TaskView::TaskBox(
|
||||
//box->setAutoFillBackground(true);
|
||||
QGridLayout* grid = new QGridLayout(box);
|
||||
grid->addWidget(labelPoints, 0, 0);
|
||||
grid->addWidget(numPoints, 0, 1);
|
||||
grid->addWidget(labelFacets, 1, 0);
|
||||
grid->addWidget(numFacets, 1, 1);
|
||||
|
||||
grid->addWidget(labelMin, 2, 0);
|
||||
grid->addWidget(numMin, 2, 1);
|
||||
grid->addWidget(labelMax, 3, 0);
|
||||
grid->addWidget(numMax, 3, 1);
|
||||
|
||||
Gui::TaskView::TaskBox* taskbox = new Gui::TaskView::TaskBox(
|
||||
QPixmap(), QString::fromLatin1("Mesh info"), false, 0);
|
||||
taskbox->groupLayout()->addWidget(box);
|
||||
Content.push_back(taskbox);
|
||||
}
|
||||
bool shouldShow(void)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
void onSelectionChanged(const Gui::SelectionChanges& msg)
|
||||
{
|
||||
Base::BoundBox3d bbox;
|
||||
unsigned long countPoints=0, countFacets=0;
|
||||
std::vector<Mesh::Feature*> mesh = Gui::Selection().getObjectsOfType<Mesh::Feature>();
|
||||
for (std::vector<Mesh::Feature*>::iterator it = mesh.begin(); it != mesh.end(); ++it) {
|
||||
countPoints += (*it)->Mesh.getValue().countPoints();
|
||||
countFacets += (*it)->Mesh.getValue().countFacets();
|
||||
bbox.Add((*it)->Mesh.getBoundingBox());
|
||||
}
|
||||
|
||||
if (countPoints > 0) {
|
||||
numPoints->setText(QString::number(countPoints));
|
||||
numFacets->setText(QString::number(countFacets));
|
||||
taskbox->groupLayout()->addWidget(box);
|
||||
Content.push_back(taskbox);
|
||||
}
|
||||
bool shouldShow(void)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
void onSelectionChanged(const Gui::SelectionChanges&)
|
||||
{
|
||||
Base::BoundBox3d bbox;
|
||||
unsigned long countPoints=0, countFacets=0;
|
||||
std::vector<Mesh::Feature*> mesh = Gui::Selection().getObjectsOfType<Mesh::Feature>();
|
||||
for (std::vector<Mesh::Feature*>::iterator it = mesh.begin(); it != mesh.end(); ++it) {
|
||||
countPoints += (*it)->Mesh.getValue().countPoints();
|
||||
countFacets += (*it)->Mesh.getValue().countFacets();
|
||||
bbox.Add((*it)->Mesh.getBoundingBox());
|
||||
}
|
||||
|
||||
if (countPoints > 0) {
|
||||
numPoints->setText(QString::number(countPoints));
|
||||
numFacets->setText(QString::number(countFacets));
|
||||
numMin->setText(QString::fromLatin1("X: %1\tY: %2\tZ: %3")
|
||||
.arg(bbox.MinX).arg(bbox.MinX).arg(bbox.MinX));
|
||||
.arg(bbox.MinX).arg(bbox.MinX).arg(bbox.MinX));
|
||||
numMax->setText(QString::fromLatin1("X: %1\tY: %2\tZ: %3")
|
||||
.arg(bbox.MaxX).arg(bbox.MaxX).arg(bbox.MaxX));
|
||||
}
|
||||
else {
|
||||
.arg(bbox.MaxX).arg(bbox.MaxX).arg(bbox.MaxX));
|
||||
}
|
||||
else {
|
||||
numPoints->setText(QString::fromLatin1(""));
|
||||
numFacets->setText(QString::fromLatin1(""));
|
||||
numMin->setText(QString::fromLatin1(""));
|
||||
numMax->setText(QString::fromLatin1(""));
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
QLabel* labelPoints;
|
||||
QLabel* numPoints;
|
||||
QLabel* labelFacets;
|
||||
QLabel* numFacets;
|
||||
QLabel* labelMin;
|
||||
QLabel* numMin;
|
||||
QLabel* labelMax;
|
||||
QLabel* numMax;
|
||||
};
|
||||
|
||||
void Workbench::activated()
|
||||
{
|
||||
Gui::Workbench::activated();
|
||||
|
||||
std::vector<Gui::TaskView::TaskWatcher*> Watcher;
|
||||
Watcher.push_back(new MeshInfoWatcher);
|
||||
addTaskWatcher(Watcher);
|
||||
}
|
||||
|
||||
void Workbench::deactivated()
|
||||
{
|
||||
Gui::Workbench::deactivated();
|
||||
removeTaskWatcher();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
QLabel* labelPoints;
|
||||
QLabel* numPoints;
|
||||
QLabel* labelFacets;
|
||||
QLabel* numFacets;
|
||||
QLabel* labelMin;
|
||||
QLabel* numMin;
|
||||
QLabel* labelMax;
|
||||
QLabel* numMax;
|
||||
};
|
||||
|
||||
void Workbench::activated()
|
||||
{
|
||||
Gui::Workbench::activated();
|
||||
|
||||
std::vector<Gui::TaskView::TaskWatcher*> Watcher;
|
||||
Watcher.push_back(new MeshInfoWatcher);
|
||||
addTaskWatcher(Watcher);
|
||||
}
|
||||
|
||||
void Workbench::deactivated()
|
||||
{
|
||||
Gui::Workbench::deactivated();
|
||||
removeTaskWatcher();
|
||||
|
||||
}
|
||||
|
||||
void Workbench::setupContextMenu(const char* recipient,Gui::MenuItem* item) const
|
||||
{
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
//===========================================================================
|
||||
// Cmd_TEMPLATE_Test THIS IS JUST A TEST COMMAND
|
||||
//===========================================================================
|
||||
DEF_STD_CMD(Cmd_TEMPLATE_Test);
|
||||
DEF_STD_CMD(Cmd_TEMPLATE_Test)
|
||||
|
||||
Cmd_TEMPLATE_Test::Cmd_TEMPLATE_Test()
|
||||
:Command("_TEMPLATE__Test")
|
||||
|
@ -51,7 +51,7 @@ Cmd_TEMPLATE_Test::Cmd_TEMPLATE_Test()
|
|||
sAccel = "CTRL+H";
|
||||
}
|
||||
|
||||
void Cmd_TEMPLATE_Test::activated(int iMsg)
|
||||
void Cmd_TEMPLATE_Test::activated(int)
|
||||
{
|
||||
Base::Console().Message("Hello, World!\n");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user