User 704eeef1ba
23-10-2013 20:50:39
Im trying to view the 3D view of a drawn molecule in the MSketchPane. What are the classes which can be used to get the 3D view.
User 704eeef1ba
23-10-2013 20:50:39
Im trying to view the 3D view of a drawn molecule in the MSketchPane. What are the classes which can be used to get the 3D view.
ChemAxon 5433b8e56b
27-10-2013 13:18:18
Hi Emma,
you can use the MViewPane to have a viewer component, the Cleaner utility class methods to clean the structure in 3D.
Basically the algorith should do somthing like this:
1. get the Molecule from the MSketchPane you have. (you can also listen to molecule property change events, the property name is "mol".
2. use Cleaner.clean(MoleculeGraph, int) method, the int should be 3, since you want a 3D structure.
3. Instantiate an MViewPane, if you want an interactive component for the 3D view, and set the Molecule on it, and add to your UI, or use MolPrinter to paint the structure into an image, or component, and display the result.
I hope this helps to begin the work, if you have further questions do not hesitate to ask.
Regards,
Istvan