use of org.scijava.vecmath.Point3f in project mcib3d-core by mcib3d.
the class Object3DSurface method translate.
@Override
public void translate(double x, double y, double z) {
Point3f T = new Point3f((float) x, (float) y, (float) z);
for (Point3f P : faces) {
P.add(T);
}
init();
// this.computeUniqueVertices();
}
use of org.scijava.vecmath.Point3f in project mcib3d-core by mcib3d.
the class Object3DSurface method computeContours.
@Override
public void computeContours() {
// Contours pixels are same as surface vertices
kdtreeContours = new KDTreeC(3);
kdtreeContours.setScale3(this.resXY, this.resXY, this.resZ);
contours = new ArrayList();
Point3f P;
// Value ?
double val = 1;
for (Point3f vertice : vertices) {
P = vertice;
Voxel3D vox = new Voxel3D(P, val);
contours.add(vox);
kdtreeContours.add(vox.getArray(), vox);
}
// needs to compute area since contours are used to compute areas in other classes
this.computeSurfaceAreas();
}
use of org.scijava.vecmath.Point3f in project mcib3d-core by mcib3d.
the class Object3DSurface method translateTool.
public static List translateTool(List l, float tx, float ty, float tz) {
List lt = new ArrayList(l.size());
for (Point3f P : (Iterable<Point3f>) l) {
Point3f Pt = new Point3f(P.x + tx, P.y + ty, P.z + tz);
lt.add(Pt);
}
return lt;
}
use of org.scijava.vecmath.Point3f in project mcib3d-core by mcib3d.
the class DeformableMesh method roughDisplacement.
public void roughDisplacement(double maxDispl) {
this.computeAllForces(false);
for (Vector3D force : forces) {
if ((force != null) && (force.getLength() > maxDispl)) {
Vector3D dirForce = force.getNormalizedVector();
force = dirForce.multiply(maxDispl);
}
// loop on vertices
if (force != null) {
for (Point3f vertice : vertices) {
vertice.add(force.getPoint3f());
}
}
}
this.computeVerticesNormals();
}
use of org.scijava.vecmath.Point3f in project mcib3d-core by mcib3d.
the class Deriche method newPositionF.
// Calcul d'un point (position) à partir d'un point initial, un vecteur
// de direction et un entier n
public Point3f newPositionF(Point3f position, Point3f direction, float n) {
float posX, posY, posZ;
posX = (position.x + (direction.x * n));
posY = (position.y + (direction.y * n));
posZ = (position.z + (direction.z * n));
Point3f vec = new Point3f(posX, posY, posZ);
return vec;
}
Aggregations