@@ -82,7 +82,7 @@ public static class Axis {
8282 private int firstRepeat ;
8383 private RotationAxis rotAxis ;
8484
85- public Axis (Matrix4d operator , int order , SymmetryType type ) {
85+ public Axis (Matrix4d operator , int order , SymmetryType type , int level , int firstRepeat ) {
8686 if (order < 2 ) {
8787 throw new IllegalArgumentException ("A symmetry axis should divide a structure in > 2 parts" );
8888 }
@@ -93,8 +93,8 @@ public Axis(Matrix4d operator, int order, SymmetryType type) {
9393 this .operator = operator ;
9494 this .order = order ;
9595 this .symmType = type ;
96- this . level = - 1 ;
97- this . firstRepeat = - 1 ;
96+ setLevel ( level ) ;
97+ setFirstRepeat ( firstRepeat ) ;
9898 rotAxis = null ;
9999 }
100100 /**
@@ -242,7 +242,7 @@ public void addAxis(Matrix4d axis, List<List<Integer>> superposition,
242242 * @param type indicates whether the axis has OPEN or CLOSED symmetry
243243 */
244244 public void addAxis (Matrix4d axis , int order , SymmetryType type ) {
245- axes .add (new Axis (axis ,order ,type ));
245+ axes .add (new Axis (axis ,order ,type , axes . size (), 0 ));
246246 }
247247
248248 /**
@@ -345,12 +345,12 @@ public List<List<Integer>> getRepeatRelation(int level, int firstRepeat) {
345345 int m = getNumRepeats (level +1 );//size of the children
346346 int d = axis .getOrder (); // degree of this node
347347 int n = m *d ; // number of repeats included
348- if (axis .getSymmType () == SymmetryType .OPEN ) {
349- n -= m ; // leave off last child for open symm
350- }
351348 if (firstRepeat % n != 0 ) {
352349 throw new IllegalArgumentException (String .format ("Repeat %d cannot start a block at level %s of this tree" ,firstRepeat ,level ));
353350 }
351+ if (axis .getSymmType () == SymmetryType .OPEN ) {
352+ n -= m ; // leave off last child for open symm
353+ }
354354 List <Integer > repeats = new ArrayList <>(n );
355355 List <Integer > equiv = new ArrayList <>(n );
356356 for (int i =0 ;i <n ;i ++) {
@@ -362,7 +362,7 @@ public List<List<Integer>> getRepeatRelation(int level, int firstRepeat) {
362362 }
363363
364364 /**
365- * Get the indicies of participating repeats in cyclic form.
365+ * Get the indices of participating repeats in cyclic form.
366366 * <p>
367367 * Each inner list gives a set of equivalent repeats and should have length
368368 * equal to the order of the axis' operator.
@@ -484,9 +484,7 @@ private void getSymmetryAxes(List<Axis> symmAxes, Matrix4d prior, int level, int
484484 currAxisOp .invert ();
485485 currAxisOp .mul (elemOp );
486486 currAxisOp .mul (prior );
487- Axis currAxis = new Axis (currAxisOp ,elem .getOrder (),elem .getSymmType ());
488- currAxis .setLevel (level );
489- currAxis .setFirstRepeat (firstRepeat );
487+ Axis currAxis = new Axis (currAxisOp ,elem .getOrder (),elem .getSymmType (),level ,firstRepeat );
490488 symmAxes .add (currAxis );
491489
492490 //Remember that all degrees are at least 2
@@ -502,6 +500,7 @@ private void getSymmetryAxes(List<Axis> symmAxes, Matrix4d prior, int level, int
502500 }
503501 }
504502
503+
505504// public Matrix4d getSymmetryAxis(int level, int axisNum) {
506505// if(level == 0) {
507506// if( axisNum != 0 )
0 commit comments