Skip to content
Snippets Groups Projects
Commit 04ed7383 authored by Matej Lukes's avatar Matej Lukes
Browse files

JavaDoc added to classes, hashCode() override added

parent db03fca6
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,7 @@
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
......
......@@ -2,6 +2,11 @@ package cz.fidentis.analyst.mesh.core;
import java.util.List;
/**
* Abstract universal node, implements management of parent elements
*
* @author Matej Lukes
*/
public abstract class MeshComponent {
private List<MeshComponent> parents;
......
......@@ -2,6 +2,11 @@ package cz.fidentis.analyst.mesh.core;
import java.util.List;
/**
* Inner node of the Hierarchy, implements management of child elements
*
* @author Matej Lukes
*/
public class MeshComposite extends MeshComponent {
private List<MeshComponent> children;
......
package cz.fidentis.analyst.mesh.core;
import java.util.List;
/**
* MeshEdge is an edge shared between two MeshFaces.
*
* @author Matej Lukes
*/
public class MeshEdge extends MeshComposite {
public MeshEdge(MeshPoint point1, MeshPoint point2){
......@@ -40,4 +43,14 @@ public class MeshEdge extends MeshComposite {
return true;
}
@Override
public int hashCode() {
int hash = 0;
for (MeshComponent point :
getChildren()) {
hash += point.hashCode();
}
return hash;
}
}
package cz.fidentis.analyst.mesh.core;
/**
* MeshFace is a surface triangle or planar polygon
*
* @author Matej Lukes
*/
public class MeshFace extends MeshComposite {
/**
* @param newChild new child element must be MeshEdge
......
package cz.fidentis.analyst.mesh.core;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* MashFacet is a group of MeshFaces
*
* @author Matej Lukes
*/
public class MeshFacet extends MeshComposite {
private Map<MeshPoint, MeshPoint> pointPool = new HashMap<>();
......
package cz.fidentis.analyst.mesh.core;
import java.util.ArrayList;
import java.util.List;
/**
* MeshLeaf is a leaf node of the hierarchy
*
* @author Matej Lukes
*/
public class MeshLeaf extends MeshComponent {
/**
* MeshLeaf does not have child elements
......
......@@ -2,6 +2,9 @@ package cz.fidentis.analyst.mesh.core;
import java.util.List;
/**
* MeshModel is a root node of the hierarchy
*/
public class MeshModel extends MeshComposite {
/**
* MeshModel is root element, it does not have parent elements
......
package cz.fidentis.analyst.mesh.core;
import javax.vecmath.Vector3d;
import java.util.List;
/**
* MeshPoint represents a point with position, normal, and texture coordinates
*
* @author Matej Lukes
*/
public class MeshPoint extends MeshLeaf {
private final Vector3d position, normal, texCoord;
......@@ -50,4 +54,9 @@ public class MeshPoint extends MeshLeaf {
&& this.normal.equals(meshPointObj.normal)
&& this.texCoord.equals(meshPointObj.texCoord);
}
@Override
public int hashCode() {
return position.hashCode() + normal.hashCode() + texCoord.hashCode();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment