public void WriteImageFile(string fname, IndigoObject mol, string format, string comment,float weight) { switch (format) { case "png":{indigo.setOption("render-output-format", "png");break;} case "svg":{indigo.setOption("render-output-format", "svg");break;} case "pdf":{indigo.setOption("render-output-format", "pdf");break;} case "emf":{indigo.setOption("render-output-format", "emf");break;} default: throw new Exception("format not handled by Indigo: " + format); } // http://ggasoftware.com/opensource/indigo/api/options#rendering //png, svg, pdf are allowed. On Windows, emf is also allowed. indigo.setOption ("render-bond-length","18"); indigo.setOption ("render-relative-thickness", Math.Round (weight,2).ToString ()); indigo.setOption("render-coloring", true); indigo.setOption("render-margins", 1, 1); //indigo.setOption("render-atom-ids-visible", true); indigo.setOption("render-comment", comment); indigo.setOption("render-implicit-hydrogens-visible", false); indigo.setOption("render-label-mode", "hetero"); indigo.setOption("render-comment-font-size", "15"); indigo.setOption("render-comment-offset", "6"); mol.layout(); renderer.renderToFile(mol, fname); //indigo.setOption("render-output-format", "svg"); }
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)); }
public byte[] renderGridToBuffer(IndigoObject items, int[] refatoms, int ncolumns) { IndigoObject bufh = _indigo.writeBuffer (); 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.indigoRenderGrid (items.self, refatoms, ncolumns, bufh.self)); return bufh.toBuffer (); }
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); }
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; } }
public IndigoObject createSaver(IndigoObject output, string format) { setSessionID(); return(new IndigoObject(this, output, _indigo_lib.indigoCreateSaver(output.self, format))); }
public void addCatalyst(IndigoObject molecule) { dispatcher.setSessionID(); _indigo_lib.indigoAddCatalyst(self, molecule.self); }
public void renderToFile(IndigoObject obj, string filename) { _indigo.setSessionID (); _indigo.checkResult (_renderer_lib.indigoRenderToFile (obj.self, filename)); }
public int arrayAdd(IndigoObject item) { dispatcher.setSessionID(); return dispatcher.checkResult(_indigo_lib.indigoArrayAdd(self, item.self)); }
public void setAtomMappingNumber(IndigoObject reaction_atom, int number) { dispatcher.setSessionID(); _indigo_lib.indigoSetAtomMappingNumber(self, reaction_atom.self, number); }
/// <summary> /// Inserts a structure under a specified id /// </summary> /// <param name="record">Indigo object with a chemical structure (molecule or reaction)</param> /// <param name="id">record id</param> /// <returns> inserted record id</returns> public int insert(IndigoObject record, int id) { _indigo.setSessionID(); return(Bingo.checkResult(_indigo, _lib.bingoInsertRecordObjWithId(_id, record.self, id))); }
public System.Collections.IEnumerable iterateMatches(IndigoObject query) { dispatcher.setSessionID(); return new IndigoObject(dispatcher, dispatcher.checkResult(_indigo_lib.indigoIterateMatches(self, query.self)), this); }
public System.Collections.IEnumerable iterateMatches(IndigoObject query) { dispatcher.setSessionID(); return(new IndigoObject(dispatcher, this, _indigo_lib.indigoIterateMatches(self, query.self))); }
public int countMatches(IndigoObject query) { dispatcher.setSessionID(); return dispatcher.checkResult(_indigo_lib.indigoCountMatches(self, query.self)); }
public int countMatchesWithLimit(IndigoObject query, int embeddings_limit) { dispatcher.setSessionID(); return dispatcher.checkResult(_indigo_lib.indigoCountMatchesWithLimit(self, query.self, embeddings_limit)); }
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); }
public void unignoreAtom(IndigoObject atom) { dispatcher.setSessionID(); dispatcher.checkResult(_indigo_lib.indigoUnignoreAtom(self, atom.self)); }
public void addCatalyst(IndigoObject molecule) { dispatcher.setSessionID(); dispatcher.checkResult(_indigo_lib.indigoAddCatalyst(self, molecule.self)); }
public int arrayAdd(IndigoObject item) { dispatcher.setSessionID(); return(_indigo_lib.indigoArrayAdd(self, item.self)); }
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); }
public int countMatches(IndigoObject query) { dispatcher.setSessionID(); return(_indigo_lib.indigoCountMatches(self, query.self)); }
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); }
public void append(IndigoObject obj) { dispatcher.setSessionID(); _indigo_lib.indigoAppend(self, obj.self); }
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); }
public IndigoObject addBond(IndigoObject dest, int order) { dispatcher.setSessionID(); return(new IndigoObject(dispatcher, this, _indigo_lib.indigoAddBond(self, dest.self, order))); }
public void addDecomposition(IndigoObject q_match) { dispatcher.setSessionID(); dispatcher.checkResult(_indigo_lib.indigoAddDecomposition(self, q_match.self)); }
/// <summary> /// Execute similarity search operation /// </summary> /// <param name="query">indigo object (molecule or reaction)</param> /// <param name="min">Minimum similarity value</param> /// <param name="max">Maximum similairy value</param> /// <returns>Bingo search object instance</returns> public BingoObject searchSim(IndigoObject query, float min, float max) { return(searchSim(query, min, max, null)); }
public void append(IndigoObject obj) { dispatcher.setSessionID(); dispatcher.checkResult(_indigo_lib.indigoAppend(self, obj.self)); }
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; }
public int atomMappingNumber(IndigoObject reaction_atom) { dispatcher.setSessionID(); return dispatcher.checkResult(_indigo_lib.indigoGetAtomMappingNumber(self, reaction_atom.self)); }
public IndigoObject reactionProductEnumerate(IndigoObject reaction, IndigoObject monomers) { setSessionID(); return(new IndigoObject(this, _indigo_lib.indigoReactionProductEnumerate(reaction.self, monomers.self))); }
public void setAtomMappingNumber(IndigoObject reaction_atom, int number) { dispatcher.setSessionID(); dispatcher.checkResult(_indigo_lib.indigoSetAtomMappingNumber(self, reaction_atom.self, number)); }
public void transform(IndigoObject reaction, IndigoObject monomer) { setSessionID(); _indigo_lib.indigoTransform(reaction.self, monomer.self); }
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"); }
public void cmlAppend(IndigoObject item) { dispatcher.setSessionID(); _indigo_lib.indigoCmlAppend(self, item.self); }
public void setReactingCenter(IndigoObject bond, ReactingCenter type) { dispatcher.setSessionID(); dispatcher.checkResult(_indigo_lib.indigoSetReactingCenter(self, bond.self, (int)type)); }
public void unignoreAtom(IndigoObject atom) { dispatcher.setSessionID(); _indigo_lib.indigoUnignoreAtom(self, atom.self); }
public IndigoObject addBond(IndigoObject dest, int order) { dispatcher.setSessionID(); return new IndigoObject(dispatcher, dispatcher.checkResult(_indigo_lib.indigoAddBond(self, dest.self, order)), this); }
public int countMatchesWithLimit(IndigoObject query, int embeddings_limit) { dispatcher.setSessionID(); return(_indigo_lib.indigoCountMatchesWithLimit(self, query.self, embeddings_limit)); }
public IndigoObject merge(IndigoObject what) { dispatcher.setSessionID(); return new IndigoObject(dispatcher, dispatcher.checkResult(_indigo_lib.indigoMerge(self, what.self)), this); }
public void addDecomposition(IndigoObject q_match) { dispatcher.setSessionID(); _indigo_lib.indigoAddDecomposition(self, q_match.self); }
public IndigoObject exactMatch(IndigoObject obj1, IndigoObject obj2) { return(exactMatch(obj1, obj2, "")); }
public int atomMappingNumber(IndigoObject reaction_atom) { dispatcher.setSessionID(); return(_indigo_lib.indigoGetAtomMappingNumber(self, reaction_atom.self)); }
public int commonBits(IndigoObject obj1, IndigoObject obj2) { setSessionID(); return(_indigo_lib.indigoCommonBits(obj1.self, obj2.self)); }
public void setReactingCenter(IndigoObject bond, ReactingCenter type) { dispatcher.setSessionID(); _indigo_lib.indigoSetReactingCenter(self, bond.self, (int)type); }
public IndigoObject substructureMatcher(IndigoObject target, string mode) { setSessionID(); return(new IndigoObject(this, target, _indigo_lib.indigoSubstructureMatcher(target.self, mode))); }
public IndigoObject merge(IndigoObject what) { dispatcher.setSessionID(); return(new IndigoObject(dispatcher, this, _indigo_lib.indigoMerge(self, what.self))); }
public IndigoObject substructureMatcher(IndigoObject target) { return(substructureMatcher(target, "")); }
/// <summary> /// Execute substructure search operation /// </summary> /// <param name="query">Indigo query object (molecule or reaction)</param> /// <returns>Bingo search object instance</returns> public BingoObject searchSub(IndigoObject query) { return(searchSub(query, null)); }
/// <summary> /// Perform exact search operation /// </summary> /// <param name="query">indigo object (molecule or reaction)</param> /// <param name="options">exact search options</param> /// <returns>Bingo search object instance</returns> public BingoObject searchExact(IndigoObject query, string options) { if (options == null) { options = ""; } _indigo.setSessionID(); return new BingoObject(Bingo.checkResult(_indigo, _lib.bingoSearchExact(_id, query.self, options)), _indigo, _lib); }
/// <summary> /// Perform exact search operation /// </summary> /// <param name="query">indigo object (molecule or reaction)</param> /// <returns>Bingo search object instance</returns> public BingoObject searchExact(IndigoObject query) { return(searchExact(query, null)); }
/// <summary> /// Perform exact search operation /// </summary> /// <param name="query">indigo object (molecule or reaction)</param> /// <returns>Bingo search object instance</returns> public BingoObject searchExact(IndigoObject query) { return searchExact(query, null); }
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)); }
/// <summary> /// Execute similarity search operation /// </summary> /// <param name="query">indigo object (molecule or reaction)</param> /// <param name="min">Minimum similarity value</param> /// <param name="max">Maximum similairy value</param> /// <returns>Bingo search object instance</returns> public BingoObject searchSim(IndigoObject query, float min, float max) { return searchSim(query, min, max, null); }
public IndigoObject decomposeMolecules(IndigoObject scaffold, IndigoObject structures) { setSessionID(); return(new IndigoObject(this, _indigo_lib.indigoDecomposeMolecules(scaffold.self, structures.self))); }
public void cmlAppend(IndigoObject item) { dispatcher.setSessionID(); dispatcher.checkResult(_indigo_lib.indigoCmlAppend(self, item.self)); }
public void renderToFile(IndigoObject obj, string filename) { _indigo.setSessionID(); _indigo.checkResult(_renderer_lib.indigoRenderToFile(obj.self, filename)); }
public IndigoObject decomposeMolecules(IndigoObject scaffold, IEnumerable structures) { return(decomposeMolecules(scaffold, toIndigoArray(structures))); }
public String getInchi(IndigoObject molecule) { _indigo.setSessionID(); return(new String(_indigo.checkResult(_inchi_lib.indigoInchiGetInchi(molecule.self)))); }
public IndigoObject createDecomposer(IndigoObject scaffold) { setSessionID(); return(new IndigoObject(this, _indigo_lib.indigoCreateDecomposer(scaffold.self))); }