public IndigoObject loadFingerprintFromDescriptors(double[] descriptors, int size, double density) { setSessionID(); int result = IndigoLib.indigoLoadFingerprintFromDescriptors(descriptors, descriptors.Length, size, density); return(new IndigoObject(this, checkResult(result))); }
public IndigoObject(Indigo dispatcher, object parent, int id) { this.dispatcher = dispatcher; this.self = id; this.parent = parent; _indigo_lib = dispatcher._indigo_lib; }
public IndigoObject(Indigo dispatcher, int id, object parent) { this.dispatcher = dispatcher; this.self = id; this.parent = parent; _indigo_lib = dispatcher._indigo_lib; dll_loader = IndigoDllLoader.Instance; }
public void Dispose() { if (_sid >= 0) { IndigoLib.indigoReleaseSessionId(_sid); _sid = -1; } }
public bool getOptionBool(string option) { setSessionID(); int res; checkResult(IndigoLib.indigoGetOptionBool(option, &res)); return(res > 0); }
public int *checkResult(int *result) { if (result == null) { throw new IndigoException(_sbyteToStringUTF8(IndigoLib.indigoGetLastError())); } return(result); }
public double checkResult(double result) { if (result < 0) { throw new IndigoException(_sbyteToStringUTF8(IndigoLib.indigoGetLastError())); } return(result); }
public static string checkResult(sbyte *result) { if (result == null) { throw new BingoException(new string(IndigoLib.indigoGetLastError())); } return(new string(result)); }
internal static float checkResult(float result) { if (result < 0.0) { throw new BingoException(new string(IndigoLib.indigoGetLastError())); } return(result); }
public float similarity(IndigoObject obj1, IndigoObject obj2, string metrics) { setSessionID(); if (metrics == null) { metrics = ""; } return(checkResult(IndigoLib.indigoSimilarity(obj1.self, obj2.self, metrics))); }
public float?getOptionFloat(string option) { setSessionID(); float res; if (checkResult(IndigoLib.indigoGetOptionFloat(option, &res)) == 1) { return(res); } return(null); }
public IndigoObject iterateSmiles(IndigoObject reader) { setSessionID(); int result = checkResult(IndigoLib.indigoIterateSmiles(reader.self)); if (result == 0) { return(null); } return(new IndigoObject(this, result, reader)); }
public Metafile renderToMetafile(IndigoObject obj) { _indigo.setSessionID(); _indigo.checkResult(IndigoLib.indigoSetOption("render-output-format", "emf")); byte[] res = renderToBuffer(obj); MemoryStream ms = new MemoryStream(res); Metafile mf = new Metafile(ms); return(mf); }
public IndigoObject tautomerEnumerate(IndigoObject molecule, string parameters) { setSessionID(); int result = checkResult(IndigoLib.indigoIterateTautomers(molecule.self, parameters)); if (result == 0) { return(null); } return(new IndigoObject(this, result, molecule)); }
public IndigoObject transformHELMtoSCSR(IndigoObject item) { setSessionID(); int result = checkResult(IndigoLib.indigoTransformHELMtoSCSR(item.self)); if (result == 0) { return(null); } return(new IndigoObject(this, result)); }
public IndigoObject extractCommonScaffold(IndigoObject structures, string options) { setSessionID(); int res = checkResult(IndigoLib.indigoExtractCommonScaffold(structures.self, options)); if (res == 0) { return(null); } return(new IndigoObject(this, res)); }
public IndigoObject getFragmentedMolecule(IndigoObject structures, string options) { setSessionID(); int res = checkResult(IndigoLib.indigoGetFragmentedMolecule(structures.self, options)); if (res == 0) { return(null); } return(new IndigoObject(this, res)); }
public IndigoObject rgroupComposition(IndigoObject structures, string options) { setSessionID(); int res = checkResult(IndigoLib.indigoRGroupComposition(structures.self, options)); if (res == 0) { return(null); } return(new IndigoObject(this, res)); }
public Bitmap renderToBitmap(IndigoObject obj) { _indigo.setSessionID(); _indigo.checkResult(IndigoLib.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 IndigoObject reactionProductEnumerate(IndigoObject reaction, IEnumerable monomers) { IndigoObject indigoArrayArray = createArray(); foreach (IEnumerable iter in monomers) { IndigoObject indigoArray = createArray(); foreach (IndigoObject monomer in iter) { indigoArray.arrayAdd(monomer); } indigoArrayArray.arrayAdd(indigoArray); } setSessionID(); return(new IndigoObject(this, checkResult(IndigoLib.indigoReactionProductEnumerate(reaction.self, indigoArrayArray.self)))); }
public IndigoObject nameToStructure(string name, string parameters) { if (parameters == null) { parameters = ""; } setSessionID(); int result = checkResult(IndigoLib.indigoNameToStructure(name, parameters)); if (result == 0) { return(null); } return(new IndigoObject(this, result)); }
public IndigoObject exactMatch(IndigoObject obj1, IndigoObject obj2, string flags) { if (flags == null) { flags = ""; } setSessionID(); int match = checkResult(IndigoLib.indigoExactMatch(obj1.self, obj2.self, flags)); if (match == 0) { return(null); } return(new IndigoObject(this, match, new IndigoObject[] { obj1, obj2 })); }
public byte[] renderToBuffer(IndigoObject obj) { _indigo.setSessionID(); using (IndigoObject bufh = _indigo.writeBuffer()) { _indigo.checkResult(IndigoRendererLib.indigoRender(obj.self, bufh.self)); byte *buf; int bufsize; _indigo.checkResult(IndigoLib.indigoToBuffer(bufh.self, &buf, &bufsize)); byte[] res = new byte[bufsize]; for (int i = 0; i < bufsize; ++i) { res[i] = buf[i]; } return(res); } }
private void init(string lib_path) { IndigoDllLoader dll_loader = IndigoDllLoader.Instance; dll_loader.loadLibrary(lib_path, "msvcr100.dll", "com.ggasoftware.indigo.Properties.Resources", false); //dll_loader.loadLibrary(lib_path, "zlib.dll", "com.ggasoftware.indigo.Properties.Resources", false); dll_loader.loadLibrary(lib_path, "indigo.dll", "com.ggasoftware.indigo.Properties.Resources", false); // Save instance id to check if session was allocated for this instance _dll_loader_id = IndigoDllLoader.InstanceId; _dllpath = lib_path; _indigo_lib = dll_loader.getInterface<IndigoLib>("indigo.dll"); _sid = _indigo_lib.indigoAllocSessionId(); _indigo_lib.indigoSetSessionId(_sid); _errh = new ErrorHandler(_handleError); _indigo_lib.indigoSetErrorHandler(_errh, this); }
private void init(string lib_path) { string libraryName; dll_loader = IndigoDllLoader.Instance; switch (Environment.OSVersion.Platform) { case PlatformID.Win32NT: libraryName = "indigo.dll"; bool vs2013 = true; bool vs2015 = true; try { dll_loader.loadLibrary(lib_path, "msvcr120.dll", "com.epam.indigo.Properties.ResourcesWin2013", false); } catch { vs2013 = false; } try { dll_loader.loadLibrary(lib_path, "vcruntime140.dll", "com.epam.indigo.Properties.ResourcesWin2015", false); } catch { vs2015 = false; } if (vs2013) { dll_loader.loadLibrary(lib_path, "msvcr120.dll", "com.epam.indigo.Properties.ResourcesWin2013", false); dll_loader.loadLibrary(lib_path, "msvcp120.dll", "com.epam.indigo.Properties.ResourcesWin2013", false); dll_loader.loadLibrary(lib_path, libraryName, "com.epam.indigo.Properties.ResourcesWin2013", false); } else if (vs2015) { dll_loader.loadLibrary(lib_path, "vcruntime140.dll", "com.epam.indigo.Properties.ResourcesWin2015", false); dll_loader.loadLibrary(lib_path, "msvcp140.dll", "com.epam.indigo.Properties.ResourcesWin2015", false); dll_loader.loadLibrary(lib_path, libraryName, "com.epam.indigo.Properties.ResourcesWin2015", false); } break; case PlatformID.Unix: if (IndigoDllLoader.isMac()) { libraryName = "libindigo.dylib"; dll_loader.loadLibrary(lib_path, libraryName, "com.epam.indigo.Properties.ResourcesMac", false); } else { libraryName = "libindigo.so"; dll_loader.loadLibrary(lib_path, libraryName, "com.epam.indigo.Properties.ResourcesLinux", false); } break; default: throw new PlatformNotSupportedException(String.Format("Unsupported platform: {0}", Environment.OSVersion.Platform)); } // Save instance id to check if session was allocated for this instance _dll_loader_id = IndigoDllLoader.InstanceId; _dllpath = lib_path; _indigo_lib = dll_loader.getInterface <IndigoLib>(libraryName); _sid = _indigo_lib.indigoAllocSessionId(); _indigo_lib.indigoSetSessionId(_sid); }
public void free(int id) { setSessionID(); checkResult(IndigoLib.indigoFree(id)); }
public int buildPkaModel(int level, float threshold, string filename) { setSessionID(); return(checkResult(IndigoLib.indigoBuildPkaModel(level, threshold, filename))); }
public IndigoObject createFileSaver(string filename, string format) { setSessionID(); return(new IndigoObject(this, checkResult(checkResult(IndigoLib.indigoCreateFileSaver(filename, format))))); }
public void transform(IndigoObject reaction, IndigoObject monomer) { setSessionID(); checkResult(IndigoLib.indigoTransform(reaction.self, monomer.self)); }
public IndigoObject loadBuffer(byte[] buf) { setSessionID(); return(new IndigoObject(this, checkResult(IndigoLib.indigoLoadBuffer(buf, buf.Length)))); }
public void dbgBreakpoint() { setSessionID(); IndigoLib.indigoDbgBreakpoint(); }
public IndigoObject loadString(string s) { setSessionID(); return(new IndigoObject(this, checkResult(IndigoLib.indigoLoadString(s)))); }