Ejemplo n.º 1
0
        public void AccessRgroupPseudoLabel()
        {
            var mock_atom = new Mock <IPseudoAtom>(); var atom = mock_atom.Object;

            mock_atom.Setup(n => n.Label).Returns("R1");
            Assert.AreEqual("R1", StandardAtomGenerator.AccessPseudoLabel(atom, "*"));
        }
Ejemplo n.º 2
0
        public void AccessNullPseudoLabel()
        {
            var mock_atom = new Mock <IPseudoAtom>(); var atom = mock_atom.Object;

            mock_atom.Setup(n => n.Label).Returns((string)null);
            Assert.AreEqual("*", StandardAtomGenerator.AccessPseudoLabel(atom, "*"));
        }
Ejemplo n.º 3
0
        private StandardSgroupGenerator(RendererModel parameters, StandardAtomGenerator atomGenerator, double stroke, Typeface font, double emSize, Color foreground)
        {
            this.font   = font;
            this.emSize = emSize;
            this.scale  = parameters.GetScale();
            this.stroke = stroke;
            double length = parameters.GetBondLength() / scale;

            this.bracketDepth = parameters.GetSgroupBracketDepth() * length;
            this.labelScale   = parameters.GetSgroupFontScale();

            // foreground is based on the carbon color
            this.foreground    = foreground;
            this.atomGenerator = atomGenerator;
            this.parameters    = parameters;
        }
Ejemplo n.º 4
0
 public static IRenderingElement Generate(RendererModel parameters, double stroke, Typeface font, double emSize, Color foreground, StandardAtomGenerator atomGenerator, AtomSymbol[] symbols, IAtomContainer container)
 {
     return(new StandardSgroupGenerator(parameters, atomGenerator, stroke, font, emSize, foreground).GenerateSgroups(container, symbols));
 }
Ejemplo n.º 5
0
 public void RadicalAndAnion()
 {
     Assert.AreEqual("(•)−", StandardAtomGenerator.ChargeAdjunctText(-1, 1));
 }
Ejemplo n.º 6
0
 public void DiradicalCation()
 {
     Assert.AreEqual("(2•)+", StandardAtomGenerator.ChargeAdjunctText(1, 2));
 }
Ejemplo n.º 7
0
 public void Diradical()
 {
     Assert.AreEqual("2•", StandardAtomGenerator.ChargeAdjunctText(0, 2));
 }
Ejemplo n.º 8
0
 public void Dication()
 {
     Assert.AreEqual("2+", StandardAtomGenerator.ChargeAdjunctText(2, 0));
 }
Ejemplo n.º 9
0
 public void Dianion()
 {
     Assert.AreEqual("2−", StandardAtomGenerator.ChargeAdjunctText(-2, 0));
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Create a new standard generator that utilises the specified font to display atom symbols.
 /// </summary>
 /// <param name="font">the font family, size, and style</param>
 public StandardGenerator(Typeface font, double emSize)
 {
     this.font          = font;
     this.emSize        = emSize;
     this.atomGenerator = new StandardAtomGenerator(font, emSize);
 }