1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210
|
/*
Copyright 2014-2019 Thibaut Paumard
This file is part of Gyoto.
Gyoto is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Gyoto 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with Gyoto. If not, see <http://www.gnu.org/licenses/>.
*/
%module(docstring="The Gyoto standard plug-in", package="gyoto") std
%import gyoto.i
%include "exception.i"
%{
#define GYOTO_NO_DEPRECATED
#include "gyoto_swig.h"
#include "gyoto_std_swig.h"
using namespace Gyoto;
%}
%array_class(double, array_double)
%array_class(unsigned long, array_unsigned_long)
%array_class(size_t, array_size_t)
// This will be called upon extension initialization
%init {
#ifdef SWIGPYTHON
import_array();
#endif
}
// Worldline::getCartesian is enough
%ignore Gyoto::Astrobj::Star::getCartesian(double const * const dates,
size_t const n_dates,
double * const x,
double * const y,
double * const z,
double * const xprime=NULL,
double * const yprime=NULL,
double * const zprime=NULL);
// Typemaps to translate SmartPointer to specific classes
GyotoSmPtrTypeMapClassDerived(Astrobj, UniformSphere)
GyotoSmPtrTypeMapClassDerived(Astrobj, Star)
GyotoSmPtrTypeMapClassDerived(Astrobj, StarTrace)
GyotoSmPtrTypeMapClassDerived(Astrobj, FixedStar)
GyotoSmPtrTypeMapClassDerived(Astrobj, FreeStar)
GyotoSmPtrTypeMapClassDerived(Astrobj, InflateStar)
GyotoSmPtrTypeMapClassDerived(Astrobj, Torus)
GyotoSmPtrTypeMapClassDerived(Astrobj, OscilTorus)
GyotoSmPtrTypeMapClassDerived(Astrobj, PageThorneDisk)
GyotoSmPtrTypeMapClassDerived(Astrobj, ThinDiskPL)
GyotoSmPtrTypeMapClassDerived(Astrobj, PolishDoughnut)
GyotoSmPtrTypeMapClassDerived(Astrobj, ThinDiskIronLine)
GyotoSmPtrTypeMapClassDerived(Astrobj, PatternDisk)
GyotoSmPtrTypeMapClassDerived(Astrobj, PatternDiskBB)
GyotoSmPtrTypeMapClassDerived(Astrobj, DynamicalDisk)
GyotoSmPtrTypeMapClassDerived(Astrobj, DynamicalDiskBolometric)
GyotoSmPtrTypeMapClassDerived(Astrobj, Disk3D)
GyotoSmPtrTypeMapClassDerived(Astrobj, DynamicalDisk3D)
GyotoSmPtrTypeMapClassDerived(Astrobj, DirectionalDisk)
GyotoSmPtrTypeMapClassDerived(Astrobj, DeformedTorus)
GyotoSmPtrTypeMapClassDerived(Astrobj, EquatorialHotSpot)
GyotoSmPtrTypeMapClassDerived(Astrobj, XillverReflection)
GyotoSmPtrTypeMapClassDerived(Astrobj, Jet)
GyotoSmPtrTypeMapClassDerived(Astrobj, Blob)
GyotoSmPtrTypeMapClassDerived(Astrobj, Plasmoid)
GyotoSmPtrTypeMapClassDerived(Astrobj, FlaredDiskSynchrotron)
GyotoSmPtrTypeMapClassDerived(Astrobj, ThinDiskGridIntensity)
GyotoSmPtrTypeMapClassDerived(Astrobj, ThickDisk)
GyotoSmPtrTypeMapClassDerived(Astrobj, SphericalAccretion)
GyotoSmPtrTypeMapClassDerived(Astrobj, ThinDiskProfile)
GyotoSmPtrTypeMapClassDerived(Metric, KerrBL)
GyotoSmPtrTypeMapClassDerived(Metric, KerrKS)
GyotoSmPtrTypeMapClassDerived(Metric, Minkowski)
GyotoSmPtrTypeMapClassDerived(Metric, ChernSimons)
GyotoSmPtrTypeMapClassDerived(Metric, RezzollaZhidenko)
GyotoSmPtrTypeMapClassDerived(Metric, Hayward)
GyotoSmPtrTypeMapClassDerived(Metric, SchwarzschildHarmonic)
GyotoSmPtrTypeMapClassDerived(Spectrum, PowerLaw)
GyotoSmPtrTypeMapClassDerived(Spectrum, BlackBody)
GyotoSmPtrTypeMapClassDerived(Spectrum, ThermalBremsstrahlung)
GyotoSmPtrTypeMapClassDerived(Spectrum, ThermalSynchrotron)
GyotoSmPtrTypeMapClassDerived(Spectrum, PowerLawSynchrotron)
%ignore Gyoto::Astrobj::UniformSphere::UniformSphere (std::string kind, SmartPointer<Metric::Generic> gg, double radius);
%ignore Gyoto::Astrobj::UniformSphere::UniformSphere (std::string kind);
%ignore Gyoto::Astrobj::UniformSphere::UniformSphere (const UniformSphere& orig);
GyotoSmPtrClassDerived(Astrobj, UniformSphere)
%inline {
class myCplxIdxExcept {};
}
%exception Gyoto::Astrobj::Complex::__getitem__ {
try {
$action ;
} catch (myCplxIdxExcept e) {
SWIG_exception_fail(SWIG_IndexError, "Index out of bounds");
}
}
%extend Gyoto::Astrobj::Complex {
Gyoto::SmartPointer<Gyoto::Astrobj::Generic> __getitem__ (size_t i) {
if (i >= ($self)->getCardinal()) {
throw myCplxIdxExcept();
}
Gyoto::SmartPointer<Gyoto::Astrobj::Generic> res = ($self)->operator[](i);
return res;
}
};
%extend Gyoto::Astrobj::Complex {
void __setitem__(int i, Gyoto::Astrobj::Generic * p) {
($self)->operator[](i)=p;
}
};
GyotoSmPtrClassDerivedPtrHdr(Astrobj, Complex, ComplexAstrobj, GyotoComplexAstrobj.h)
// Declare specific classes
GyotoSmPtrClassDerived(Astrobj, Star)
GyotoSmPtrClassDerived(Astrobj, StarTrace)
GyotoSmPtrClassDerived(Astrobj, FixedStar)
GyotoSmPtrClassDerived(Astrobj, FreeStar)
GyotoSmPtrClassDerived(Astrobj, InflateStar)
GyotoSmPtrClassDerived(Astrobj, Torus)
GyotoSmPtrClassDerived(Astrobj, OscilTorus)
GyotoSmPtrClassDerived(Astrobj, PageThorneDisk)
GyotoSmPtrClassDerived(Astrobj, ThinDiskPL)
GyotoSmPtrClassDerived(Astrobj, PolishDoughnut)
GyotoSmPtrClassDerived(Astrobj, ThinDiskIronLine)
GyotoSmPtrClassDerived(Astrobj, PatternDisk)
GyotoSmPtrClassDerived(Astrobj, PatternDiskBB)
GyotoSmPtrClassDerived(Astrobj, DynamicalDisk)
GyotoSmPtrClassDerived(Astrobj, DynamicalDiskBolometric)
GyotoSmPtrClassDerived(Astrobj, Disk3D)
GyotoSmPtrClassDerived(Astrobj, DynamicalDisk3D)
GyotoSmPtrClassDerived(Astrobj, DirectionalDisk)
GyotoSmPtrClassDerived(Astrobj, DeformedTorus)
GyotoSmPtrClassDerived(Astrobj, EquatorialHotSpot)
GyotoSmPtrClassDerived(Astrobj, XillverReflection)
GyotoSmPtrClassDerived(Astrobj, Jet)
GyotoSmPtrClassDerived(Astrobj, Blob)
GyotoSmPtrClassDerived(Astrobj, Plasmoid)
GyotoSmPtrClassDerived(Astrobj, FlaredDiskSynchrotron)
GyotoSmPtrClassDerived(Astrobj, ThinDiskGridIntensity)
GyotoSmPtrClassDerived(Astrobj, ThickDisk)
GyotoSmPtrClassDerived(Astrobj, SphericalAccretion)
GyotoSmPtrClassDerived(Astrobj, ThinDiskProfile)
%exception Gyoto::Metric::Complex::__getitem__ {
try {
$action ;
} catch (myCplxIdxExcept e) {
SWIG_exception_fail(SWIG_IndexError, "Index out of bounds");
}
}
%extend Gyoto::Metric::Complex {
Gyoto::SmartPointer<Gyoto::Metric::Generic> __getitem__ (size_t i) {
if (i >= ($self)->getCardinal()) {
throw myCplxIdxExcept();
}
Gyoto::SmartPointer<Gyoto::Metric::Generic> res = ($self)->operator[](i);
return res;
}
};
%extend Gyoto::Metric::Complex {
void __setitem__(int i, Gyoto::Metric::Generic * p) {
($self)->operator[](i)=p;
}
};
GyotoSmPtrClassDerivedPtrHdr(Metric, Complex, ComplexMetric, GyotoComplexMetric.h)
GyotoSmPtrClassDerivedMetric(Shift)
GyotoSmPtrClassDerivedMetric(KerrBL)
GyotoSmPtrClassDerivedMetric(KerrKS)
GyotoSmPtrClassDerivedMetric(Minkowski)
GyotoSmPtrClassDerivedMetric(ChernSimons)
GyotoSmPtrClassDerivedMetric(RezzollaZhidenko)
GyotoSmPtrClassDerivedMetric(Hayward)
GyotoSmPtrClassDerivedMetric(SchwarzschildHarmonic)
GyotoSmPtrClassDerivedHdr(Spectrum, PowerLaw, GyotoPowerLawSpectrum.h)
GyotoSmPtrClassDerivedHdr(Spectrum, BlackBody, GyotoBlackBodySpectrum.h)
GyotoSmPtrClassDerivedHdr(Spectrum, ThermalBremsstrahlung, GyotoThermalBremsstrahlungSpectrum.h)
GyotoSmPtrClassDerivedHdr(Spectrum, ThermalSynchrotron, GyotoThermalSynchrotronSpectrum.h)
GyotoSmPtrClassDerivedHdr(Spectrum, PowerLawSynchrotron, GyotoPowerLawSynchrotronSpectrum.h)
// Workaround cvar bug in Swig which makes help(gyoto_std) fail:
%inline {
namespace GyotoStd {
extern int __class__;
}
int GyotoStd::__class__ = 0;
}
|