コード例 #1
0
ファイル: ConfigIO.py プロジェクト: ScientificPython/MMTK
 def writeAtom(self, atom, configuration):
     p = atom.position(configuration)
     if p is None:
         self.warning = 1
     else:
         color = self.atomColor(atom)
         s = VRML.Sphere(p, 0.1*Units.Ang,
                         material = VRML.DiffuseMaterial(color),
                         reuse = 1)
         s.writeToFile(self)
コード例 #2
0
ファイル: ConfigIO.py プロジェクト: ScientificPython/MMTK
 def writeAtom(self, atom, configuration):
     p = atom.position(configuration)
     c = atom.charge()
     c = max(min(c, 1.), -1.)
     if p is None:
         self.warning = 1
     else:
         s = VRML.Sphere(p, 0.1*Units.Ang,
                         material = VRML.Material(diffuse_color =
                                                  self.color_scale(c)))
         s.writeToFile(self)
コード例 #3
0
ファイル: ConfigIO.py プロジェクト: ScientificPython/MMTK
 def writeAtom(self, atom, configuration):
     try:
         highlight = atom.highlight
     except AttributeError:
         highlight = 0
     if highlight:
         p = atom.position(configuration)
         if p is None:
             self.warning = 1
         else:
             s = VRML.Sphere(p, 0.1*Units.Ang,
                             material = VRML.DiffuseMaterial(atom.color),
                             reuse = 1)
             s.writeToFile(self)