Skip to content
Snippets Groups Projects
Select Git revision
  • f91f7a14535fc7d1646f97577981cfab9e39f8b9
  • master default protected
  • develop protected
  • cmake_boost_refactor
  • ubuntu_ci
  • mmtf
  • non-orthogonal-maps
  • no_boost_filesystem
  • data_viewer
  • 2.11.1
  • 2.11.0
  • 2.10.0
  • 2.9.3
  • 2.9.2
  • 2.9.1
  • 2.9.0
  • 2.8.0
  • 2.7.0
  • 2.6.1
  • 2.6.0
  • 2.6.0-rc4
  • 2.6.0-rc3
  • 2.6.0-rc2
  • 2.6.0-rc
  • 2.5.0
  • 2.5.0-rc2
  • 2.5.0-rc
  • 2.4.0
  • 2.4.0-rc2
29 results

export_map.cc

Blame
  • user avatar
    valerio authored
    git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@2107 5a81b35b-ba03-0410-adc8-b2c5c5119f08
    53098faa
    History
    export_map.cc 2.71 KiB
    //------------------------------------------------------------------------------
    // This file is part of the OpenStructure project <www.openstructure.org>
    //
    // Copyright (C) 2008-2010 by the OpenStructure authors
    //
    // This library is free software; you can redistribute it and/or modify it under
    // the terms of the GNU Lesser General Public License as published by the Free
    // Software Foundation; either version 3.0 of the License, or (at your option)
    // any later version.
    // This library is distributed in the hope that it will be useful, but WITHOUT
    // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    // FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
    // details.
    //
    // You should have received a copy of the GNU Lesser General Public License
    // along with this library; if not, write to the Free Software Foundation, Inc.,
    // 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
    //------------------------------------------------------------------------------
    #include <boost/python.hpp>
    using namespace boost::python;
    
    #include <ost/gfx/map_iso.hh>
    #include <ost/gfx/map_slab.hh>
    using namespace ost;
    using namespace ost::gfx;
    
    namespace {
    
    void ms_color_by_01(MapSlab *s, const Gradient& g, float minv, float maxv)
    {
      s->ColorBy(g,minv,maxv);
    }
    
    void ms_color_by_02(MapSlab *s, const Gradient& g)
    {
      s->ColorBy(g);
    }
    
    void ms_color_by_03(MapSlab *s, const Color& c1, const Color& c2, float minv, float maxv)
    {
      s->ColorBy(c1,c2,minv,maxv);
    }
    
    void ms_color_by_04(MapSlab *s, const Color& c1, const Color& c2)
    {
      s->ColorBy(c1,c2);
    }
    
    } // anon ns
    
    void export_Map()
    {
      class_<MapIso, bases<GfxObj>, boost::shared_ptr<MapIso>,
             boost::noncopyable>("MapIso", init<const String&, const ::img::MapHandle&, float, optional<uint> >())
        .def("SetLevel",&MapIso::SetLevel)
        .def("GetLevel",&MapIso::GetLevel)
        .def("GetMean", &MapIso::GetMean)
        .def("GetMap", &MapIso::GetMap,return_value_policy<reference_existing_object>())
        .def("GetOriginalMap", &MapIso::GetOriginalMap,return_value_policy<reference_existing_object>())
        .def("Rebuild", &MapIso::Rebuild)
        .def("SetNSF",&MapIso::SetNSF)
        .def("SetColor", &MapIso::SetColor)
        .def("GetColor", &MapIso::GetColor, return_value_policy<copy_const_reference>())
        .def("SetDebugOctree", &MapIso::SetDebugOctree)    
      ;
    
      class_<MapSlab, bases<GfxObj>, boost::shared_ptr<MapSlab>,
             boost::noncopyable>("MapSlab",init<const String&,const ::img::MapHandle&, const geom::Plane>())
        .def("SetPlane",&MapSlab::SetPlane)
        .def("GetPlane",&MapSlab::GetPlane)
        .def("ColorBy", ms_color_by_01)
        .def("ColorBy", ms_color_by_02)
        .def("ColorBy", ms_color_by_03)
        .def("ColorBy", ms_color_by_04)
      ;
    }