UnityMol  0.9.6-875
UnityMol viewer / In developement
BondTubeStyle.cs
Go to the documentation of this file.
1 
66 
67 namespace Molecule.View.DisplayBond
68 {
69 
70  using UnityEngine;
71  using System.Collections;
72  using System.Collections.Generic;
73  using Molecule.Model;
74  using Molecule.Control;
75  using UI;
77 
79  {
80 
81  public int number=1;
82  public List<int[]> bondEPList=new List<int[]>();
83 
84  public BondTubeStyle()
85  {
86  }
87 
88 
89  public void DisplayBonds()
90  {
92  {
93  bondEPList=MoleculeModel.bondCAList;
94  }
95  else
96  {
97  bondEPList=MoleculeModel.bondEPList;
98  }
99  MoleculeModel.bondsnumber=bondEPList.Count;
100  int Number=bondEPList.Count/number;
101 
102  Debug.Log("DisplayBonds??bondEPList.Count " + bondEPList.Count);
103  Debug.Log("UIData.EnableUpdate " + UIData.EnableUpdate);
104 
105  for(int i=0;i<Number;i++)
106  {
107  CreateTube(i*number);
108 
109  }
110 
111  }
112  private void CreateTube(int i)
113  {
114 
115 
116  GameObject Line=new GameObject();
117 // TubeRenderer tubeRenderer = Line.AddComponent<TubeRenderer>();
118  Line.AddComponent<TubeRenderer>();
119 
120  int[] atomsIds = bondEPList[i] as int[];
121 
122 
123  if(Line.GetComponent<TubeUpdate>()==null)
124  Line.AddComponent<TubeUpdate>();
125 
126  TubeUpdate comp = Line.GetComponent<TubeUpdate>();
127  comp.SetAtoms((GameObject)MoleculeModel.atoms[atomsIds[0]], (GameObject)MoleculeModel.atoms[atomsIds[1]]);
128 // comp.atompointer1=(GameObject)MoleculeModel.atoms[atom1number];
129 // comp.atompointer2=(GameObject)MoleculeModel.atoms[atom2number];
130  comp.enabled = true;
131  Line.tag="Club";
132 
133 
134 
135  }
136 
137  }
138 }
static bool EnableUpdate
Definition: UIData.cs:143
static List< int[]> bondCAList
The bonds between carbon alpha in the CA-Spline.
static bool secondarystruct
Switch between all atoms and C-alpha trace or BFactor secondary structure representation.
Definition: UIData.cs:176
!WiP Includes FLAGS of GUI.
Definition: UIData.cs:78
void SetAtoms(GameObject atom1, GameObject atom2)
Definition: TubeUpdate.cs:81
static List< int[]> bondEPList
The bonds between atoms.
Definition: GUIDisplay.cs:66