.. include:: ../../toolkit-substitutions

.. oe:namespace:: OEConfGen

.. meta::
   :keywords: OEMolBuilder, MolBuilder


.. _OEConfGen_OEMolBuilder:

.. oe:class:: OEMolBuilder

   .. oe:api::

      class OEMolBuilder : public OEBuilderBase

   This class defines an interface for generating an initial 3D structure
   of a molecule by connecting pregenerated fragment coordinates that
   constitute the molecule.  Building the 3D structure of a molecule with this
   builder is fast when all the fragments constituting a molecule
   are available in the fragment library associated with the builder. This builder makes
   no effort to obtain a low energy conformer of the molecule.

   .. seealso::

      * :ref:`OEMolBuilderOptions <OEConfGen_OEMolBuilderOptions>` class
      * :ref:`OEConfFixOptions <OEConfGen_OEConfFixOptions>` class

   The following methods are publicly inherited from :ref:`OEBuilderBase <OEConfGen_OEBuilderBase>`:
    * :oe:meth:`AddFragLib<OEConfGen::OEBuilderBase::AddFragLib>`
    * :oe:meth:`ClearFragLibs<OEConfGen::OEBuilderBase::ClearFragLibs>`
   
   The :ref:`OEMolBuilder <OEConfGen_OEMolBuilder>` class defines the following public methods:
    * :oe:meth:`Build<OEConfGen::OEMolBuilder::Build>`
    * :oe:meth:`GetOptions<OEConfGen::OEMolBuilder::GetOptions>` and
      :oe:meth:`SetOptions<OEConfGen::OEMolBuilder::SetOptions>`
    * :oe:meth:`Prep<OEConfGen::OEMolBuilder::Prep>`


   .. oe:method:: Constructors

      .. oe:language:: c++ java csharp

         .. oe:api::

            OEMolBuilder(const OEMolBuilderOptions& argOpts = OEMolBuilderOptions())
            OEMolBuilder(const OEMolBuilder&)

      .. oe:language:: python

         .. oe:api:: python

            OEMolBuilder(argOpts: OEMolBuilderOptions = OEMolBuilderOptions()) -> OEMolBuilder
            OEMolBuilder(arg2: OEMolBuilder) -> OEMolBuilder

      Default and copy constructors.

   .. oe:method:: operator=
      :language: c++

      .. oe:api::

         OEMolBuilder &operator=(const OEMolBuilder&)

      Assignment operator.

   .. _OEConfGen_OEMolBuilder_Build:


   .. oe:method:: Build

      .. oe:language:: c++ java csharp

         .. oe:api::

            unsigned Build(OEChem::OEMCMolBase&,
                           const OEConfFixOptions& fixOpts = OEConfFixOptions()) const

      .. oe:language:: python

         .. oe:api:: python

            Build(mol: OEMol, fixOpts: OEConfFixOptions = OEConfFixOptions()) -> int

      Generates a 3D structure for a molecule. Returns 
      :oe:const:`OEConfGen::OEOmegaReturnCode::Success` if 
      the process succeeds, otherwise returns an error code from the
      :oe:constns:`OEConfGen::OEOmegaReturnCode` namespace. The second argument 
      provided with appropriate options can be
      used to fix part of a molecule structure to predefined coordinates.

      .. seealso::

         * :ref:`OEConfFixOptions <OEConfGen_OEConfFixOptions>` class

   .. _OEConfGen_OEMolBuilder_GetOptions:


   .. oe:method:: GetOptions

      .. oe:language:: c++ java csharp

         .. oe:api::

            const OEMolBuilderOptions& GetOptions() const

      .. oe:language:: python

         .. oe:api:: python

            GetOptions() -> OEMolBuilderOptions

      See the :oe:meth:`SetOptions<OEConfGen::OEMolBuilder::SetOptions>` method.

   .. _OEConfGen_OEMolBuilder_Prep:


   .. oe:method:: Prep

      .. oe:language:: c++ java csharp

         .. oe:api::

            unsigned Prep(OEChem::OEMCMolBase& mol) const

      .. oe:language:: python

         .. oe:api:: python

            Prep(mol: OEMol) -> int

      Prepares molecules for 3D structure generation. Returns
      :oe:const:`OEConfGen::OEOmegaReturnCode::Success` if 
      the process succeeds, otherwise returns an error code from the
      :oe:constns:`OEConfGen::OEOmegaReturnCode` namespace. 

      A call to the :oe:meth:`OEConfGen::OEMolBuilder::Prep` is not required
      before calling :oe:meth:`OEConfGen::OEMolBuilder::Build`; however, it is useful
      in determining if some of the pre-conditions are met for building.

   .. _OEConfGen_OEMolBuilder_SetOptions:


   .. oe:method:: SetOptions

      .. oe:language:: c++ java csharp

         .. oe:api::

            void SetOptions(const OEMolBuilderOptions&)

      .. oe:language:: python

         .. oe:api:: python

            SetOptions(argOpts: OEMolBuilderOptions) -> None

      Sets :oe:cls:`options<OEConfGen::OEMolBuilderOptions>` for building the molecule's 3D structures.

   .. seealso::

      * :ref:`OEMolBuilderOptions <OEConfGen_OEMolBuilderOptions>` class
