mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-08 13:23:51 +00:00
Fix compiler warnings. Comment out std::cout usage for testing with cuda.
This commit is contained in:
parent
83cf50d549
commit
d7e793861b
@ -234,13 +234,16 @@ VTKM_EXEC typename FieldVecType::ComponentType CellInterpolate(
|
||||
return CellInterpolate(field, pcoords, vtkm::CellShapeTagLine(), worklet);
|
||||
}
|
||||
|
||||
vtkm::FloatDefault dt = 1 / static_cast<vtkm::FloatDefault>(numPoints - 1);
|
||||
using T = ParametricCoordType;
|
||||
|
||||
T dt = 1 / static_cast<T>(numPoints - 1);
|
||||
//vtkm::FloatDefault dt = 1 / static_cast<vtkm::FloatDefault>(numPoints - 1);
|
||||
vtkm::IdComponent idx = static_cast<vtkm::IdComponent>(pcoords[0] / dt);
|
||||
if (idx == numPoints - 1)
|
||||
return field[numPoints - 1];
|
||||
|
||||
vtkm::FloatDefault t = pcoords[0] - static_cast<vtkm::FloatDefault>(idx) * dt;
|
||||
t = t / dt;
|
||||
T t = (pcoords[0] - static_cast<T>(idx) * dt) / dt;
|
||||
//vtkm::FloatDefault t = pcoords[0] - static_cast<vtkm::FloatDefault>(idx) * dt;
|
||||
/*
|
||||
std::cout<<" dt= "<<dt<<" idx= "<<idx<<" T= "<<t<<std::endl;
|
||||
std::cout<<" Lerp("<<field[idx]<<", "<<field[idx+1]<<", "<<t<<")"<<std::endl;
|
||||
|
@ -695,14 +695,15 @@ WorldCoordinatesToParametricCoordinates(const WorldCoordVector& pointWCoords,
|
||||
pointWCoords, wcoords, vtkm::CellShapeTagLine(), success, worklet);
|
||||
}
|
||||
|
||||
std::cout << std::endl << std::endl;
|
||||
/*
|
||||
std::cout<<std::endl<<std::endl;
|
||||
std::cout << "worldCoordsToParam:" << std::endl;
|
||||
std::cout << " PointWcoords= (";
|
||||
for (int i = 0; i < numPoints; i++)
|
||||
std::cout << pointWCoords[i] << " ";
|
||||
std::cout << ")" << std::endl;
|
||||
std::cout << "wCoords= " << wcoords << std::endl;
|
||||
|
||||
*/
|
||||
using Vector3 = typename WorldCoordVector::ComponentType;
|
||||
using T = typename Vector3::ComponentType;
|
||||
|
||||
@ -710,14 +711,15 @@ WorldCoordinatesToParametricCoordinates(const WorldCoordVector& pointWCoords,
|
||||
vtkm::IdComponent idx = 0;
|
||||
Vector3 vec = pointWCoords[0] - wcoords;
|
||||
T minDistSq = vtkm::Dot(vec, vec);
|
||||
std::cout << "Find idx: " << std::endl;
|
||||
std::cout << " idx: " << idx << " " << minDistSq << std::endl;
|
||||
/*
|
||||
std::cout<<"Find idx: "<<std::endl;
|
||||
std::cout<<" idx: "<<idx<<" "<<minDistSq<<std::endl;
|
||||
*/
|
||||
for (vtkm::IdComponent i = 1; i < numPoints; i++)
|
||||
{
|
||||
vec = pointWCoords[i] - wcoords;
|
||||
T d = vtkm::Dot(vec, vec);
|
||||
std::cout << " idx: " << i << " " << d << " " << pointWCoords[i] << " " << wcoords
|
||||
<< std::endl;
|
||||
//std::cout<<" idx: "<<i<<" "<<d<<" "<<pointWCoords[i]<<" "<<wcoords<<std::endl;
|
||||
|
||||
if (d < minDistSq)
|
||||
{
|
||||
@ -737,7 +739,7 @@ WorldCoordinatesToParametricCoordinates(const WorldCoordVector& pointWCoords,
|
||||
T denominator = vtkm::MagnitudeSquared(vec);
|
||||
T segmentParam = numerator / denominator;
|
||||
|
||||
std::cout << "segment: " << idx - 1 << " " << idx << " p= " << segmentParam << std::endl;
|
||||
//std::cout<<"segment: "<<idx-1<<" "<<idx<<" p= "<<segmentParam<<std::endl;
|
||||
//The point is on the OTHER side of idx. If there is a next segment reparam onto it.
|
||||
if (segmentParam > 1 && idx < numPoints - 1)
|
||||
{
|
||||
@ -746,7 +748,7 @@ WorldCoordinatesToParametricCoordinates(const WorldCoordVector& pointWCoords,
|
||||
numerator = vtkm::Dot(vec, wcoords - pointWCoords[idx - 1]);
|
||||
denominator = vtkm::MagnitudeSquared(vec);
|
||||
segmentParam = numerator / denominator;
|
||||
std::cout << " +++ segment: " << idx - 1 << " " << idx << " p= " << segmentParam << std::endl;
|
||||
//std::cout<<" +++ segment: "<<idx-1<<" "<<idx<<" p= "<<segmentParam<<std::endl;
|
||||
}
|
||||
|
||||
//Segment param is [0,1] on that segment.
|
||||
@ -754,8 +756,8 @@ WorldCoordinatesToParametricCoordinates(const WorldCoordVector& pointWCoords,
|
||||
T dParam = static_cast<T>(1) / static_cast<T>(numPoints - 1);
|
||||
T polyLineParam = static_cast<T>(idx - 1) * dParam + segmentParam * dParam;
|
||||
|
||||
std::cout << "idx= " << idx << " dParam= " << dParam << std::endl;
|
||||
std::cout << "Param= " << Vector3(polyLineParam, 0, 0) << std::endl;
|
||||
//std::cout << "idx= " << idx << " dParam= "<<dParam<<std::endl;
|
||||
//std::cout << "Param= " << Vector3(polyLineParam, 0, 0) << std::endl;
|
||||
|
||||
return Vector3(polyLineParam, 0, 0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user