7 #include "PlusConfigure.h" 9 #include "vtkObjectFactory.h" 10 #include "vtkPolyData.h" 12 #include "vtkMatrix4x4.h" 22 this->gammaSigmoid = 2;
23 this->scaleForce = 20.0;
33 os << indent.GetNextIndent() <<
"Gamma Sigmoid: " << this->gammaSigmoid << endl;
52 distance =
CalculateDistance( transformMatrix->GetElement( 0, 3 ), transformMatrix->GetElement( 1, 3 ), transformMatrix->GetElement( 2, 3 ) );
56 CalculateForce( transformMatrix->GetElement( 0, 3 ), transformMatrix->GetElement( 1, 3 ), transformMatrix->GetElement( 2, 3 ), force );
64 cout <<
" FORCE: " << force[0] <<
", " << force[1] <<
", " << force[2] << endl;
73 pointID = this->poly->FindPoint(
x,
y, z );
74 this->poly->GetPoint( pointID, this->lastPos );
76 double tmp = pow( (
x - lastPos[0] ), 2 ) + pow( (
y - lastPos[1] ), 2 ) + pow( ( z - lastPos[2] ), 2 );
94 vector[0] = fabs(
x - this->lastPos[0] );
95 vector[1] = fabs(
y - this->lastPos[1] );
96 vector[2] = fabs( z - this->lastPos[2] );
98 cout <<
"vector[0]: " << vector[0] << endl;
99 cout <<
"vector[1]: " << vector[1] << endl;
100 cout <<
"vector[2]: " << vector[2] << endl;
102 for (
int i = 0;
i < 3;
i++ )
106 force[
i] = ( 0.1 / ( vector[
i] * vector[
i] ) ) * .6;
109 cout <<
"X: " << force[0] << endl;
110 cout <<
"Y: " << force[1] << endl;
111 cout <<
"Z: " << force[2] << endl;
double CalculateDistance(double x, double y, double z)
void CalculateForce(double x, double y, double z, double force[3])
int SetGamma(double gamma)
virtual ~vtkPlusPolydataForce()
virtual void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
void SetInput(vtkPolyData *poly)
virtual void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
int GenerateForce(vtkMatrix4x4 *transformMatrix, double force[3])
Direction vectors of rods y
vtkStandardNewMacro(vtkPlusPolydataForce) vtkPlusPolydataForce