Skip to content

Commit

Permalink
resolve warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
sechel committed Feb 26, 2018
1 parent 948e256 commit 413a412
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public OppositeAnglesAdapter(Map<E, Double> betaMap) {
this.angleMap = betaMap;
}

@SuppressWarnings("unlikely-arg-type")
@Override
public <
VV extends Vertex<VV, EE, FF>,
Expand Down
82 changes: 40 additions & 42 deletions src/de/varylab/discreteconformal/util/PathUtility.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@

import java.util.HashSet;
import java.util.Set;
import java.util.Stack;
import java.util.TreeSet;

import de.jtem.halfedge.Edge;
import de.jtem.halfedge.Face;
import de.jtem.halfedge.HalfEdgeDataStructure;
import de.jtem.halfedge.Vertex;
import de.varylab.discreteconformal.util.Search.WeightAdapter;

Expand Down Expand Up @@ -159,46 +157,46 @@ > boolean isCycleSimple(Set<E> cycle) {



/**
* Checks whether a cycle is essential
* TODO This is not ready yet!
* @param <V>
* @param <E>
* @param <F>
* @param cycle must be a cycle of consistently oriented half-edges
* @return
*/
public static <
V extends Vertex<V, E, F>,
E extends Edge<V, E, F>,
F extends Face<V, E, F>
> boolean isCycleEssential(Set<E> cycle) {
if (cycle.size() == 0) {
return false;
}
if (!isCycleSimple(cycle)) {
return false;
}
E seed = cycle.iterator().next();
V startLeft = seed.getNextEdge().getTargetVertex();
V startRight = seed.getOppositeEdge().getNextEdge().getTargetVertex();
Set<V> leftVisited = new HashSet<V>();
Set<V> rightVisited = new HashSet<V>();
Stack<V> leftPath = new Stack<V>();
Stack<V> rightPath = new Stack<V>();
leftPath.push(startLeft);
rightPath.push(startRight);
leftVisited.add(startLeft);
rightVisited.add(startRight);

HalfEdgeDataStructure<V, E, F> hds = startLeft.getHalfEdgeDataStructure();
Set<V> validVertices = new HashSet<V>(hds.getVertices());
validVertices.removeAll(cycle);



return false;
}
// /**
// * Checks whether a cycle is essential
// * TODO This is not ready yet!
// * @param <V>
// * @param <E>
// * @param <F>
// * @param cycle must be a cycle of consistently oriented half-edges
// * @return
// */
// public static <
// V extends Vertex<V, E, F>,
// E extends Edge<V, E, F>,
// F extends Face<V, E, F>
// > boolean isCycleEssential(Set<E> cycle) {
// if (cycle.size() == 0) {
// return false;
// }
// if (!isCycleSimple(cycle)) {
// return false;
// }
// E seed = cycle.iterator().next();
// V startLeft = seed.getNextEdge().getTargetVertex();
// V startRight = seed.getOppositeEdge().getNextEdge().getTargetVertex();
// Set<V> leftVisited = new HashSet<V>();
// Set<V> rightVisited = new HashSet<V>();
// Stack<V> leftPath = new Stack<V>();
// Stack<V> rightPath = new Stack<V>();
// leftPath.push(startLeft);
// rightPath.push(startRight);
// leftVisited.add(startLeft);
// rightVisited.add(startRight);
//
// HalfEdgeDataStructure<V, E, F> hds = startLeft.getHalfEdgeDataStructure();
// Set<V> validVertices = new HashSet<V>(hds.getVertices());
// validVertices.removeAll(cycle);
//
//
//
// return false;
// }


}

0 comments on commit 413a412

Please sign in to comment.