Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

  • 9d1ee36
  • /
  • pySPlisHSPlasH
  • /
  • ExporterModule.cpp
Raw File Download
Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
content badge Iframe embedding
swh:1:cnt:67cd3161736f9c41113cc3fd793422bbbce2c9a5
directory badge Iframe embedding
swh:1:dir:39b20ac81eeac3e59492345b4b824b0a458280c6
Citations

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
ExporterModule.cpp
#include "common.h"

#include <Simulator/Exporter/ExporterBase.h>
#include <Simulator/SimulatorBase.h>

#include <pybind11/pybind11.h>


#include <iostream>

namespace py = pybind11;

class pyExporterBase : public SPH::ExporterBase
{
    using SPH::ExporterBase::ExporterBase;

    virtual void init(const std::string& outputPath) { PYBIND11_OVERRIDE(void, SPH::ExporterBase, init, outputPath); };
    virtual void reset() { PYBIND11_OVERRIDE(void, SPH::ExporterBase, reset, ); };
    virtual void step(const unsigned int frame) { PYBIND11_OVERRIDE_PURE(void, SPH::ExporterBase, step, frame); };
    virtual void setActive(const bool active) { PYBIND11_OVERRIDE(void, SPH::ExporterBase, setActive, active); }
};

void ExporterModule(py::module m_sub) {
    // ---------------------------------------
    // Exporter Base
    // ---------------------------------------
    py::class_<SPH::ExporterBase, pyExporterBase>(m_sub, "ExporterBase")
        .def(py::init<SPH::SimulatorBase*>())
        .def("step", &SPH::ExporterBase::step)
        .def("reset", &SPH::ExporterBase::reset)
        .def("setActive", &SPH::ExporterBase::setActive)
        .def("getActive", &SPH::ExporterBase::getActive)
        .def("init", &SPH::ExporterBase::init);

}

back to top

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Contact— JavaScript license information— Web API