Class MeshPointImpl
java.lang.Object
cz.fidentis.analyst.data.mesh.impl.MeshPointImpl
- All Implemented Interfaces:
IPosition
,MeshPoint
,Serializable
- Direct Known Subclasses:
RayIntersectionImpl
MeshPoint represents a point with position, normal, and texture coordinates.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMeshPointImpl
(MeshPoint meshPoint) Copy constructor.MeshPointImpl
(Collection<MeshPoint> meshPoints) Creates average point.MeshPointImpl
(javax.vecmath.Point3d position, javax.vecmath.Vector3d normal, javax.vecmath.Vector3d texCoord) Constructor.MeshPointImpl
(javax.vecmath.Point3d position, javax.vecmath.Vector3d normal, javax.vecmath.Vector3d texCoord, Curvature curvature) Complete constructor with curvature -
Method Summary
Modifier and TypeMethodDescriptionboolean
javax.vecmath.Vector3d
Returns normal vector at the pointjavax.vecmath.Point3d
get position of thePoint3d
objectjavax.vecmath.Vector3d
int
hashCode()
double
relativeDistance
(javax.vecmath.Point3d point) Method for calculating relative distance topoint
.void
setCurvature
(Curvature curvature) Sets curvature of the mesh point.void
setNormal
(javax.vecmath.Vector3d newNormal) Sets the normal vectorvoid
setPosition
(javax.vecmath.Point3d newPos) toString()
-
Constructor Details
-
MeshPointImpl
public MeshPointImpl(javax.vecmath.Point3d position, javax.vecmath.Vector3d normal, javax.vecmath.Vector3d texCoord) Constructor. Curvature is not set.- Parameters:
position
- position of MeshPointnormal
- normal of MeshPointtexCoord
- coordinates in texture
-
MeshPointImpl
public MeshPointImpl(javax.vecmath.Point3d position, javax.vecmath.Vector3d normal, javax.vecmath.Vector3d texCoord, Curvature curvature) Complete constructor with curvature- Parameters:
position
- position of MeshPointnormal
- normal of MeshPointtexCoord
- coordinates in texturecurvature
- curvature of the mesh point
-
MeshPointImpl
Copy constructor.- Parameters:
meshPoint
- copied meshPoint
-
MeshPointImpl
Creates average point.- Parameters:
meshPoints
- Mesh points- Throws:
IllegalArgumentException
- ifmeshPoints
isnull
or empty.
-
-
Method Details
-
relativeDistance
public double relativeDistance(javax.vecmath.Point3d point) Description copied from interface:MeshPoint
Method for calculating relative distance topoint
. Positive ifpoint
is in front (same side as normal vector) ofMeshPoint
. Negative ifpoint
is behind (opposite side as normal vector) ofMeshPoint
.- Specified by:
relativeDistance
in interfaceMeshPoint
- Parameters:
point
-Point3d
from which to calculate relative distance toMeshPoint
.- Returns:
- Positive or negative distance depending if
point
is in front of/behindMeshPoint
.
-
getNormal
public javax.vecmath.Vector3d getNormal()Description copied from interface:MeshPoint
Returns normal vector at the point -
getPosition
public javax.vecmath.Point3d getPosition()Description copied from interface:IPosition
get position of thePoint3d
object- Specified by:
getPosition
in interfaceIPosition
- Specified by:
getPosition
in interfaceMeshPoint
- Returns:
- position of the
Point3d
object
-
getCurvature
- Specified by:
getCurvature
in interfaceMeshPoint
- Returns:
- curvature
-
getTexCoord
public javax.vecmath.Vector3d getTexCoord()- Specified by:
getTexCoord
in interfaceMeshPoint
- Returns:
- texture coordinates
-
setPosition
public void setPosition(javax.vecmath.Point3d newPos) - Specified by:
setPosition
in interfaceMeshPoint
- Parameters:
newPos
- New position, must not benull
-
setNormal
public void setNormal(javax.vecmath.Vector3d newNormal) Description copied from interface:MeshPoint
Sets the normal vector -
setCurvature
Description copied from interface:MeshPoint
Sets curvature of the mesh point.- Specified by:
setCurvature
in interfaceMeshPoint
- Parameters:
curvature
- Curvature
-
equals
-
hashCode
public int hashCode() -
toString
-