UnityMol  0.9.6-875
UnityMol viewer / In developement
GenInterpolationArray_BF.cs
Go to the documentation of this file.
1 
66 using UnityEngine;
67 using System.Collections;
68 using System.Collections.Generic;
69 
71 
72  public List<float[]> InputKeyNodes;
73  public List<string> InputTypeArray;
74  //C.R
75  public List<float> InputBfactArray;
76 
77  public List<float[]> OutputKeyNodes;
78  public List<string> OutputTypeArray;
79  //C.R
80  public List<float> OutputBfactArray;
81 
82  // Use this for initialization
83  void Start () {}
84 
85  public void CalculateSplineArray() {
86  Debug.Log("Entering :: CalculateSplineArray()");
87  OutputKeyNodes=new List<float[]>();
88  OutputTypeArray=new List<string>();
89  OutputBfactArray = new List<float> ();
90 
91  ArrayList ChainAtomList=new ArrayList();
92  List<string> CaSplineTypeList=new List<string>();
93  List<float> BfactList= new List<float>();
94 
95  for(int i=1;i<InputKeyNodes.Count;i++) {
96  if(((string)(InputTypeArray[i-1])==(string)(InputTypeArray[i]))&&(i<InputKeyNodes.Count-1)) {
97  ChainAtomList.Add(InputKeyNodes[i]);
98  CaSplineTypeList.Add(InputTypeArray[i]);
99  BfactList.Add (InputBfactArray[i]);
100  }
101  else {
102  GenInterpolationPoint_BF geninterpolationpoint = new GenInterpolationPoint_BF();
103 
104  geninterpolationpoint.InputKeyNodes=ChainAtomList;
105  geninterpolationpoint.InputTypeArray=CaSplineTypeList;
106  geninterpolationpoint.InputBfactArray=BfactList;
107 
108  geninterpolationpoint.CalculateSpline();
109 
110  OutputKeyNodes.AddRange(geninterpolationpoint.OutputKeyNodes);
111  OutputTypeArray.AddRange(geninterpolationpoint.OutputTypeArray);
112  OutputBfactArray.AddRange(geninterpolationpoint.OutputBfactArray);
113 
114  ChainAtomList=null;
115  ChainAtomList=new ArrayList();
116 
117  CaSplineTypeList=null;
118  CaSplineTypeList=new List<string>();
119  //C.R
120  BfactList=null;
121  BfactList=new List<float>();
122 
123  ChainAtomList.Add(InputKeyNodes[i]);
124  CaSplineTypeList.Add(InputTypeArray[i]);
125  BfactList.Add(InputBfactArray[i]);
126  Debug.Log("(string)(InputTypeArray[i-1])!=(string)(InputTypeArray[i])");
127  }
128  }
129  }
130 
131 
132  /*
133  void Update()
134  {
135  if (UI.UIData.resetSpline)
136  {
137  CalculateSplineArray();
138  UI.UIData.resetSpline = false;
139  }
140  } */
141 }