//=====
void GeodesicMeshDeformation::Process()
{
-printf("PG GeodesicMeshDeformation::Process START \n");
// THE MAIN PROCESSING METHOD BODY
// Here we simply set the input 'In' value to the output 'Out'
// And print out the output value
// * TYPE is the C++ type of the input/output
// (the one provided in the attribute 'type' of the tag 'input')
std::vector<double> lstCenter = bbGetInputCenter();
- double s = bbGetInputS();
- bool ok = false;
- bool pdChanged = false;
- using MeshType = itk::QuadEdgeMesh<double, 3>;
+ double s = bbGetInputS();
+ bool ok = false;
+ bool pdChanged = false;
+ using MeshType = itk::QuadEdgeMesh<double, 3>;
+ std::vector<double> deformInfo;
+ bbSetOutputOut(deformInfo);
+ //std::vector<double> displacementVector;
//Set up QuadEdge and filter every time polydata changes
if ((bbGetInputIn() != polydata) && (bbGetInputActive()==true) && (bbGetInputIn() != NULL))
double p[3]; // point
double pb[3]; // point base
double np[3]; // new point
- double sx,sy,sz;
- sx = s*2;
- sy = sx;
- sz = sy;
+// double sx,sy,sz;
+// sx = s*2;
+// sy = s*2;
+// sz = s*2;
double displcement_x = 0;
double displcement_y = 0;
displcement_z = bbGetInputDirection()[2];
} // if TypeIn 0 Direction
- printf(" EED GeodesicMeshDeformation::Process %ld %ld - %f %f %f \n", EdgeIdBack, bbGetInputEdgeId() , lstCenter[0],lstCenter[1],lstCenter[2] );
+ //printf(" EED GeodesicMeshDeformation::Process %ld %ld - %f %f %f \n", EdgeIdBack, bbGetInputEdgeId() , lstCenter[0],lstCenter[1],lstCenter[2] );
if (bbGetInputTypeIn()==1) // Center
{
using CriterionType = itk::FastMarchingThresholdStoppingCriterion<MeshType, MeshType>;
auto criterion = CriterionType::New();
sCurrent = s;
- criterion->SetThreshold(s*2);
+ criterion->SetThreshold(s*4);
fmmFilter->SetStoppingCriterion(criterion);
}
fmmFilter->Update();
}
++BegProcessedIt;
}
+ //double directionMoved[3] = {lstCenter[0]-displcement_x, lstCenter[1]-displcement_y, lstCenter[2]-displcement_z};
+ //vtkMath::Normalize(directionMoved);
+ std::vector<double> info{lstCenter[0],lstCenter[1],lstCenter[2], bbGetInputDirection()[0] , bbGetInputDirection()[1], bbGetInputDirection()[2],(double) bbGetInputEdgeId(), s};
+ bbSetOutputOut(info);
+ cout << "info updated" << endl;
points->Modified();
- bbGetInputIn()->Modified();
+ bbGetInputIn()->Modified();
}// if ffmFilter != NULL
} // if distance_x y z != 0
} // In != NULL ok active
- printf("PG GeodesicMeshDeformation::Process END \n");
}
//=====
// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
EdgeIdBack=-1;
bbSetInputEdgeId(EdgeIdBack);
bbSetInputS(10);
+ std::vector<double> OutputVect;
+ bbSetOutputOut(OutputVect);
backLstCenter.push_back(0);
backLstCenter.push_back(0);