Ejemplo n.º 1
0
		public Bitmap renderToBitmap (IndigoObject obj)
		{
			_indigo.setSessionID ();
			
			_indigo.checkResult (_indigo._indigo_lib.indigoSetOption ("render-output-format", "png"));
			byte[] res = renderToBuffer (obj);
			
			MemoryStream stream = new MemoryStream ();
			stream.Write (res, 0, res.Length);
			stream.Seek (0, SeekOrigin.Begin);
			
			return (Bitmap)Image.FromStream (stream);
		}
Ejemplo n.º 2
0
		public byte[] renderToBuffer (IndigoObject obj)
		{
			_indigo.setSessionID ();
			using (IndigoObject bufh = _indigo.writeBuffer()) {
				_indigo.checkResult (_renderer_lib.indigoRender (obj.self, bufh.self));
				byte* buf;
				int bufsize;
				_indigo.checkResult (_indigo._indigo_lib.indigoToBuffer (bufh.self, &buf, &bufsize));

				byte[] res = new byte[bufsize];
				for (int i = 0; i < bufsize; ++i)
					res [i] = buf [i];
				return res;
			}
		}
Ejemplo n.º 3
0
		public void renderToFile (IndigoObject obj, string filename)
		{
			_indigo.setSessionID ();
			_indigo.checkResult (_renderer_lib.indigoRenderToFile (obj.self, filename));
		}
Ejemplo n.º 4
0
 public int transformCTABtoSCSR(IndigoObject templates)
 {
     dispatcher.setSessionID();
     return dispatcher.checkResult(_indigo_lib.indigoTransformCTABtoSCSR(self, templates.self));
 }
Ejemplo n.º 5
0
 public void setReactingCenter(IndigoObject bond, ReactingCenter type)
 {
     dispatcher.setSessionID();
     dispatcher.checkResult(_indigo_lib.indigoSetReactingCenter(self, bond.self, (int)type));
 }
Ejemplo n.º 6
0
 public void setAtomMappingNumber(IndigoObject reaction_atom, int number)
 {
     dispatcher.setSessionID();
     dispatcher.checkResult(_indigo_lib.indigoSetAtomMappingNumber(self, reaction_atom.self, number));
 }
Ejemplo n.º 7
0
 public float getBasicPkaValue(IndigoObject atom, int level, int min_level)
 {
    dispatcher.setSessionID();
    float* ptr = dispatcher.checkResult(_indigo_lib.indigoGetBasicPkaValue(self, atom.self, level, min_level));
    float pka = ptr[0];
    return pka;
 }
Ejemplo n.º 8
0
 public void addDecomposition(IndigoObject q_match)
 {
     dispatcher.setSessionID();
     dispatcher.checkResult(_indigo_lib.indigoAddDecomposition(self, q_match.self));
 }
Ejemplo n.º 9
0
 public IndigoObject mapBond(IndigoObject query_bond)
 {
     dispatcher.setSessionID();
     int mapped = dispatcher.checkResult(_indigo_lib.indigoMapBond(self, query_bond.self));
     if (mapped == 0)
         return null;
     return new IndigoObject(dispatcher, mapped);
 }
Ejemplo n.º 10
0
 public IndigoObject merge(IndigoObject what)
 {
     dispatcher.setSessionID();
     return new IndigoObject(dispatcher, dispatcher.checkResult(_indigo_lib.indigoMerge(self, what.self)), this);
 }
Ejemplo n.º 11
0
 public IndigoObject addBond(IndigoObject dest, int order)
 {
     dispatcher.setSessionID();
     return new IndigoObject(dispatcher, dispatcher.checkResult(_indigo_lib.indigoAddBond(self, dest.self, order)), this);
 }
Ejemplo n.º 12
0
		/// <summary>
		/// Returns a shared IndigoObject for the matched target
		/// </summary>
		/// <returns>Shared Indigo object for the current search operation</returns>
		public IndigoObject getIndigoObject()
		{
		   _indigo.setSessionID();
		   IndigoObject res = new IndigoObject(_indigo, Bingo.checkResult(_indigo, _bingoLib.bingoGetObject(_id)));
		   _reference = res;
		   return res;
		}
Ejemplo n.º 13
0
		public Metafile renderToMetafile (IndigoObject obj)
		{
			_indigo.setSessionID ();
			
			_indigo.checkResult (_indigo._indigo_lib.indigoSetOption ("render-output-format", "emf"));
			byte[] res = renderToBuffer (obj);
			
			MemoryStream ms = new MemoryStream (res);
			Metafile mf = new Metafile (ms);
			
			return mf;
		}
Ejemplo n.º 14
0
		public void renderToHDC (IndigoObject obj, IntPtr hdc, bool printing)
		{
			_indigo.setSessionID ();
			int hdch = _indigo.checkResult (_renderer_lib.indigoRenderWriteHDC ((void*)hdc, printing ? 1 : 0));
			_indigo.checkResult (_renderer_lib.indigoRender (obj.self, hdch));
		}
Ejemplo n.º 15
0
 public System.Collections.IEnumerable iterateMatches(IndigoObject query)
 {
     dispatcher.setSessionID();
     return new IndigoObject(dispatcher, dispatcher.checkResult(_indigo_lib.indigoIterateMatches(self, query.self)), this);
 }
Ejemplo n.º 16
0
 public void addCatalyst(IndigoObject molecule)
 {
     dispatcher.setSessionID();
     dispatcher.checkResult(_indigo_lib.indigoAddCatalyst(self, molecule.self));
 }
Ejemplo n.º 17
0
 public IndigoObject mapMolecule(IndigoObject query_reaction_molecule)
 {
     dispatcher.setSessionID();
     int mapped = dispatcher.checkResult(_indigo_lib.indigoMapMolecule(self, query_reaction_molecule.self));
     if (mapped == 0)
         return null;
     return new IndigoObject(dispatcher, mapped);
 }
Ejemplo n.º 18
0
 public void cmlAppend(IndigoObject item)
 {
     dispatcher.setSessionID();
     dispatcher.checkResult(_indigo_lib.indigoCmlAppend(self, item.self));
 }
Ejemplo n.º 19
0
 public IndigoObject decomposeMolecule(IndigoObject mol)
 {
     dispatcher.setSessionID();
     int res = dispatcher.checkResult(_indigo_lib.indigoDecomposeMolecule(self, mol.self));
     if (res == 0)
         return null;
     return new IndigoObject(dispatcher, res, this);
 }
Ejemplo n.º 20
0
 public int arrayAdd(IndigoObject item)
 {
     dispatcher.setSessionID();
     return dispatcher.checkResult(_indigo_lib.indigoArrayAdd(self, item.self));
 }
Ejemplo n.º 21
0
 public void append(IndigoObject obj)
 {
     dispatcher.setSessionID();
    dispatcher.checkResult(_indigo_lib.indigoAppend(self, obj.self));
 }
Ejemplo n.º 22
0
 public void unignoreAtom(IndigoObject atom)
 {
     dispatcher.setSessionID();
     dispatcher.checkResult(_indigo_lib.indigoUnignoreAtom(self, atom.self));
 }
Ejemplo n.º 23
0
 public int atomMappingNumber(IndigoObject reaction_atom)
 {
     dispatcher.setSessionID();
     return dispatcher.checkResult(_indigo_lib.indigoGetAtomMappingNumber(self, reaction_atom.self));
 }
Ejemplo n.º 24
0
 public IndigoObject match(IndigoObject query)
 {
     dispatcher.setSessionID();
     int res = dispatcher.checkResult(_indigo_lib.indigoMatch(self, query.self));
     if (res == 0)
         return null;
     return new IndigoObject(dispatcher, res, this);
 }
Ejemplo n.º 25
0
        public ReactingCenter reactingCenter(IndigoObject bond)
        {
            int c;
            dispatcher.setSessionID();

            if (dispatcher.checkResult(_indigo_lib.indigoGetReactingCenter(self, bond.self, &c)) == 1)
                return (ReactingCenter)c;
            throw new IndigoException("reactingCenter(): unexpected result");
        }
Ejemplo n.º 26
0
 public int countMatches(IndigoObject query)
 {
     dispatcher.setSessionID();
     return dispatcher.checkResult(_indigo_lib.indigoCountMatches(self, query.self));
 }
Ejemplo n.º 27
0
 public IndigoObject createSGroup(String type, IndigoObject mapping, String name)
 {
     dispatcher.setSessionID();
     return new IndigoObject(dispatcher, dispatcher.checkResult(_indigo_lib.indigoCreateSGroup(type, mapping.self, name)));
 }
Ejemplo n.º 28
0
 public int countMatchesWithLimit(IndigoObject query, int embeddings_limit)
 {
     dispatcher.setSessionID();
     return dispatcher.checkResult(_indigo_lib.indigoCountMatchesWithLimit(self, query.self, embeddings_limit));
 }
Ejemplo n.º 29
0
		public String getInchi (IndigoObject molecule)
		{
			_indigo.setSessionID ();
			return new String (_indigo.checkResult (_inchi_lib.indigoInchiGetInchi (molecule.self)));
		}
Ejemplo n.º 30
0
		public void renderGridToFile (IndigoObject items, int[] refatoms, int ncolumns, string filename)
		{
			if (refatoms != null)
			if (refatoms.Length != items.count ())
				throw new IndigoException ("renderGridToFile(): refatoms[] size must be equal to the number of objects");
			
			_indigo.checkResult(_renderer_lib.indigoRenderGridToFile (items.self, refatoms, ncolumns, filename));
		}