org.xistrat.bean
Class FastFace

java.lang.Object
  extended by org.xistrat.bean.FastFace

public class FastFace
extends java.lang.Object

FaceData should be organized in such a way that standard methods run fast

neisF has replaced neisP

Since:
0.5.42

Field Summary
 int[] adjustHelper
           
 java.util.LinkedList<EdgeData> boundary_edges
           
 int[][] face
           
 FaceData faceData
           
 int faces
           
 int[][] fJ
           
 int[][][] fJE
           
 java.util.LinkedList<EdgeData> flips
           
 java.util.LinkedList<java.util.LinkedList<java.util.LinkedList<java.lang.Integer>>> glueLines
           
 java.util.LinkedList<java.util.LinkedList<EdgeData>> holes
           
 java.util.LinkedList<java.util.LinkedList<java.lang.Integer>> holesF
           
 java.util.LinkedList<java.util.LinkedList<java.lang.Integer>> innerBoundaries
           
 java.util.LinkedList<java.util.LinkedList<java.lang.Integer>> innerRotis
           
 int[][] neisF
           
 int[][] neisP
           
static int NOTSET
           
 int[][] pJ
           
 int[][][] pJjE
           
 int poly
           
 int polygons
           
 int[] reverseAH
           
 java.util.LinkedList<EdgeData> roti_edges
           
 java.util.LinkedList<java.util.LinkedList<EdgeData>> rotis
           
 java.util.LinkedList<java.util.LinkedList<java.lang.Integer>> rotisF
           
 
Constructor Summary
FastFace()
           
FastFace(FaceData faceData)
           
FastFace(FaceData faceData, java.util.LinkedList<java.util.LinkedList<java.lang.Integer>> innerBoundaries)
           
 
Method Summary
 void buildJEs(int _vertices)
          replacing fJ
 void buildRotis(boolean[] isRoti)
          find out about the area to be rotated in atomic Rubik move: give them their vertices, as if they would have been stored in database as regular face (with arbitrary number of edges though)
 void buildRotisF(boolean[] isRoti)
          (for now it seems nobody uses the rotisF)
 void debugInnerLines(java.util.LinkedList<java.util.LinkedList<java.lang.Integer>> lines)
          used for debugging of inner boundaries
 void debugLines(java.util.LinkedList<java.util.LinkedList<java.util.LinkedList<java.lang.Integer>>> lines)
          used for debugging
 int getD(int location, int precessor, int next)
          uses neisP
 EdgeData getEdgeByIndex(int index)
           
 int getFD(int location, int precessor, int next)
          uses neisF
 int getFJ(int precessor, int location)
          how to use the fJ (awareness of reflected states)
 int getFNByEdge(EdgeData edge)
          used in holesF, holeF creating
 int getFNByEdge(EdgeData edge, int a)
           
 int getFNWithD(int location, int precessor, int distInEdges)
          uses neisF
 int getGlueFJ(java.util.LinkedList<java.lang.Integer> glueShape, int help_stand)
          goal is s.th. like fJ, but this time for glueShapes
 java.util.LinkedList<java.lang.Integer> getGlueShape(int i)
           
 int getJ(int a, int b)
          uses neisF assumes that faces or holes a and b are connected at max once used for computing the label of the directed edge for holes edges we don't need this method
 int getNumberOfLines(int value)
           
 int getNWithD(int location, int precessor, int distInEdges)
          for now use neisP, later will use neisF
 int getPNByEdge(EdgeData edge)
          used in holesF, holeF creating
 int getPNByEdge(EdgeData edge, int a)
           
 int getPNByEdge(EdgeData edge, int a, boolean identicIsOK)
          used in creation of neisP, neisF, adjusts...
 int getPointJ(int p, int i)
          get j such that face[j][i] = p;
 int getPStandByEdgeIndex(int index)
          Deprecated.  
 int getRotFNByEdge(EdgeData edge, boolean[] isRoti)
          used for Rubik things
 int getRotPNByEdge(EdgeData edge, boolean[] isRoti)
          used for Rubik things
 int getRotPNByEdge(EdgeData edge, int a, boolean[] isRoti)
          used for Rubik things
 int getStandByEdgeIndex(int index)
           
 void listEdges()
          invoke flips filling for cover group stuff
 boolean notContainedInBoundary(int i)
           
 int reflStuff(int help_stand, int help_next)
          behavior for two touching boundaries as usual pay attention in case both ids belong to boundaries, because then next is changed downwards and the other upwards (and vice versa)
 void repairRotis(boolean[] isRoti)
          more cutting and gluing of rotis edges chains in case they have points in common, and building of another inner lines (but aren't used later on) (yes, it's copy paste from repairHoles() ) (didn't fusionate because somewhere here holes might play a role as well ?!)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NOTSET

public static final int NOTSET
See Also:
Constant Field Values

neisF

public int[][] neisF

neisP

public int[][] neisP

poly

public int poly

polygons

public int polygons

faces

public int faces

face

public int[][] face

faceData

public FaceData faceData

adjustHelper

public int[] adjustHelper

reverseAH

public int[] reverseAH

pJ

public int[][] pJ

fJ

public int[][] fJ

pJjE

public int[][][] pJjE

fJE

public int[][][] fJE

boundary_edges

public java.util.LinkedList<EdgeData> boundary_edges

holes

public java.util.LinkedList<java.util.LinkedList<EdgeData>> holes

holesF

public java.util.LinkedList<java.util.LinkedList<java.lang.Integer>> holesF

innerBoundaries

public java.util.LinkedList<java.util.LinkedList<java.lang.Integer>> innerBoundaries

glueLines

public java.util.LinkedList<java.util.LinkedList<java.util.LinkedList<java.lang.Integer>>> glueLines

roti_edges

public java.util.LinkedList<EdgeData> roti_edges

rotis

public java.util.LinkedList<java.util.LinkedList<EdgeData>> rotis

innerRotis

public java.util.LinkedList<java.util.LinkedList<java.lang.Integer>> innerRotis

rotisF

public java.util.LinkedList<java.util.LinkedList<java.lang.Integer>> rotisF

flips

public java.util.LinkedList<EdgeData> flips
Constructor Detail

FastFace

public FastFace()

FastFace

public FastFace(FaceData faceData)

FastFace

public FastFace(FaceData faceData,
                java.util.LinkedList<java.util.LinkedList<java.lang.Integer>> innerBoundaries)
Method Detail

getNumberOfLines

public int getNumberOfLines(int value)

debugInnerLines

public void debugInnerLines(java.util.LinkedList<java.util.LinkedList<java.lang.Integer>> lines)
used for debugging of inner boundaries

Since:
0.6.34

debugLines

public void debugLines(java.util.LinkedList<java.util.LinkedList<java.util.LinkedList<java.lang.Integer>>> lines)
used for debugging

Since:
0.6.34

getPointJ

public int getPointJ(int p,
                     int i)
get j such that face[j][i] = p;

Since:
0.6.59

getPNByEdge

public int getPNByEdge(EdgeData edge,
                       int a)

getPNByEdge

public int getPNByEdge(EdgeData edge,
                       int a,
                       boolean identicIsOK)
used in creation of neisP, neisF, adjusts...

Parameters:
edge - between a valid face and a valid face or a hole
a - index within [0, .., polygons-1] of a definitely valid face (no hole) we know already, we seek the other part
Returns:
the other part in [0, .., polygons-1] (may be == a, in case it has an edge with itself), or < 0 for a hole as a counterpart

getRotPNByEdge

public int getRotPNByEdge(EdgeData edge,
                          int a,
                          boolean[] isRoti)
used for Rubik things

Parameters:
edge - between an (unrotated, for now valid) face and another valid face or a hole
a - index of a definitely unrotated (for now valid face) we know already
Returns:
the other part (may taking part in rotating, or not)

getFNByEdge

public int getFNByEdge(EdgeData edge,
                       int a)

getFNByEdge

public int getFNByEdge(EdgeData edge)
used in holesF, holeF creating

Parameters:
edge - between a hole and a regular face
Returns:
the regular face (0 .. faces-1)

getRotFNByEdge

public int getRotFNByEdge(EdgeData edge,
                          boolean[] isRoti)
used for Rubik things

Parameters:
edge - between an rotated face (or hole later on) and an unrotated thing
Returns:
the unrotated side: regular face [0 .. faces-1] or hole [-1, ...]

getPNByEdge

public int getPNByEdge(EdgeData edge)
used in holesF, holeF creating

Parameters:
edge - between a hole and a regular face
Returns:
the valid polygon (0 .. polygon-1)

getRotPNByEdge

public int getRotPNByEdge(EdgeData edge,
                          boolean[] isRoti)
used for Rubik things

Parameters:
edge - between a 'to be rotated' and a regular face (or a hole)
Returns:
the valid polygon (0 .. polygon-1)... (well could be a hole later on as well)

getJ

public int getJ(int a,
                int b)
uses neisF

assumes that faces or holes a and b are connected at max once used for computing the label of the directed edge for holes edges we don't need this method


getFNWithD

public int getFNWithD(int location,
                      int precessor,
                      int distInEdges)
uses neisF


getNWithD

public int getNWithD(int location,
                     int precessor,
                     int distInEdges)
for now use neisP, later will use neisF


getD

public int getD(int location,
                int precessor,
                int next)
uses neisP


getFD

public int getFD(int location,
                 int precessor,
                 int next)
uses neisF


getEdgeByIndex

public EdgeData getEdgeByIndex(int index)
Returns:
EdgeData has points within [0, polygons-1]

getPStandByEdgeIndex

public int getPStandByEdgeIndex(int index)
Deprecated. 

Parameters:
index - edge starts at 0 (permutation starts at 1 though)
Returns:
stand is in [0, polygons - 1]

getStandByEdgeIndex

public int getStandByEdgeIndex(int index)
Parameters:
index - edge starts at 0 (permutation starts at 1 though)
Returns:
stand is in [0, faces - 1]

buildJEs

public void buildJEs(int _vertices)
replacing fJ

Parameters:
_vertices - number of point labels int[][][] pJjE having an edge of a polygon b, wanted pJjE[b][edge[0]][edge[1]]=j such that face[j][b], face[(j+1)%poly][b] = edge int[][][] fJE having an edge of a face b, wanted fJE[b][edge[0]][edge[1]]=j such that neisF[b][j] goes over this edge

reflStuff

public int reflStuff(int help_stand,
                     int help_next)
behavior for two touching boundaries

as usual pay attention in case both ids belong to boundaries, because then next is changed downwards and the other upwards (and vice versa)

Since:
0.6.34

getFJ

public int getFJ(int precessor,
                 int location)
how to use the fJ (awareness of reflected states)

Returns:
some j
Since:
0.6.90
See Also:
getGlueFJ(java.util.LinkedList, int)

getGlueFJ

public int getGlueFJ(java.util.LinkedList<java.lang.Integer> glueShape,
                     int help_stand)
goal is s.th. like fJ, but this time for glueShapes

Returns:
unique j
See Also:
getFJ(int, int)

getGlueShape

public java.util.LinkedList<java.lang.Integer> getGlueShape(int i)
Parameters:
i - within [0, .., faces-1] return null in case face is not contained in an inner boundary line, else return reference to the corresponding glueShape in case multiple glueShapes could serve, more info should have been supplemented see other method

notContainedInBoundary

public boolean notContainedInBoundary(int i)
Parameters:
i - within [0, .., faces-1]
Returns:
true in case it's not contained in an inner boundary line

buildRotis

public void buildRotis(boolean[] isRoti)
find out about the area to be rotated in atomic Rubik move: give them their vertices, as if they would have been stored in database as regular face (with arbitrary number of edges though)

Since:
0.6.59

repairRotis

public void repairRotis(boolean[] isRoti)
more cutting and gluing of rotis edges chains in case they have points in common, and building of another inner lines (but aren't used later on) (yes, it's copy paste from repairHoles() ) (didn't fusionate because somewhere here holes might play a role as well ?!)

attention: it's only partly implemented for corner cases involving holes

Since:
0.6.59

buildRotisF

public void buildRotisF(boolean[] isRoti)
(for now it seems nobody uses the rotisF)

Since:
0.6.59

listEdges

public void listEdges()
invoke flips filling for cover group stuff

Since:
0.6.90