Changeset 1324 for js/sdk/js_interface


Ignore:
Timestamp:
08/14/24 00:56:06 (4 months ago)
Author:
Maciej Komosinski
Message:

Updated for current SDK sources and current Emscripten

Location:
js/sdk/js_interface
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • js/sdk/js_interface/js_interface.cpp

    r944 r1324  
    1515#include <frams/genetics/f9/f9_oper.h>
    1616#include <frams/genetics/fF/fF_oper.h>
     17#include <frams/genetics/fS/fS_oper.h>
     18#include <frams/genetics/fn/fn_oper.h>
     19#include <frams/genetics/genoconv.h>
     20#include <frams/genetics/f4/f4_conv.h>
     21#include <frams/genetics/fH/fH_conv.h>
     22#include <frams/genetics/fB/fB_conv.h>
     23#include <frams/genetics/f9/f9_conv.h>
     24#include <frams/genetics/fS/fS_conv.h>
     25#include <frams/genetics/fn/fn_conv.h>
     26#include <frams/genetics/fL/fL_conv.h>
    1727#include <common/loggers/loggers.h>
    1828#include <common/loggers/loggertostdout.h>
  • js/sdk/js_interface/js_interface.idl

    r944 r1324  
    9191
    9292enum Part_Shape {
    93         "Part::SHAPE_BALL_AND_STICK",
     93        "Part::SHAPE_BALL",
    9494        "Part::SHAPE_ELLIPSOID",
    9595        "Part::SHAPE_CUBOID",
     
    111111        [Value] attribute Pt3D scale;
    112112        [Value] attribute Pt3D vcolor;
    113         attribute double vsize;
    114113        attribute long shape;
    115 
    116         void Part(optional Part_Shape s = "Part::SHAPE_BALL_AND_STICK");
     114        static readonly attribute double BALL_AND_STICK_RADIUS;
     115
     116        void Part(optional Part_Shape s = "Part::SHAPE_BALL");
    117117
    118118        void setPositionAndRotationFromAxis([Const, Ref] Pt3D p1, [Const, Ref] Pt3D p2);
     
    126126
    127127enum Joint_Shape {
    128         "Joint::SHAPE_BALL_AND_STICK",
    129         "Joint::SHAPE_FIXED"
     128        "Joint::SHAPE_STICK",
     129        "Joint::SHAPE_FIXED",
     130        "Joint::SHAPE_HINGE_X",
     131        "Joint::SHAPE_HINGE_XY"
    130132};
    131133
     
    247249        void Geno([Const] DOMString genstring, byte genformat, [Const] DOMString genname, [Const] DOMString comment);
    248250        boolean isValid();
    249         byte getFormat();
     251        [Value] SString getFormat();
    250252        [Value] SString getGenes();
     253        [Value] SString getGenesAndFormat();
    251254        static Validators useValidators(Validators val);
    252255        static GenoConvManager useConverters(GenoConvManager gcm);
     
    261264
    262265enum Model_ShapeType {
    263         "Model::SHAPE_UNKNOWN",
    264         "Model::SHAPE_ILLEGAL",
    265         "Model::SHAPE_BALL_AND_STICK",
    266         "Model::SHAPE_SOLIDS"
     266        "Model::SHAPETYPE_UNKNOWN",
     267        "Model::SHAPETYPE_ILLEGAL",
     268        "Model::SHAPETYPE_BALL_AND_STICK",
     269        "Model::SHAPETYPE_SOLIDS"
    267270};
    268271
     
    272275        attribute double startenergy;
    273276
    274         void Model();
    275         void Model([Ref, Const] Geno newgeno, optional boolean buildmaps = false);
     277        void Model(optional Model_ShapeType sh = "Model::SHAPETYPE_UNKNOWN");
     278
     279        void Model([Ref, Const] Geno src, Model_ShapeType sh, optional boolean buildmaps = false, optional boolean _using_checkpoints = false, optional boolean _is_checkpoint = false);
     280        // The following constructor exists in the SDK, however in idl functions need to differ in number of arguments so it can't exist with the previous constructor
     281        //void Model([Ref, Const] Model model, optional boolean buildmaps = false, optional boolean _using_checkpoints = false, optional boolean _is_checkpoint = false);
    276282
    277283        [Value] MultiMap getMap();
     
    283289        long getErrorPosition(boolean includingwarnings);
    284290        Model_ShapeType getShapeType();
     291        void declareShapeType(Model_ShapeType sh);
    285292        void updateRefno();
    286293        [Const, Value] Geno getF0Geno();
    287         void makeGeno([Ref] Geno geno);
     294        void makeGeno([Ref] Geno geno, optional MultiMap sh,optional boolean handle_defaults,optional boolean can_be_invalid);
    288295        void setGeno([Const, Ref] Geno newgeno);
    289296        void setValidationLevel(long level);
     
    348355
    349356interface GenotypeMiniLoader : MultiParamLoader {
    350     void GenotypeMiniLoader(VirtFILE f);
     357        //this constructor has the same number of arguments as the next one which is not allowed in idl
     358    //void GenotypeMiniLoader(VirtFILE f);
     359        void GenotypeMiniLoader([Const] DOMString filename);
    351360        GenotypeMini loadNextGenotype();
    352361};
     
    442451};
    443452
     453interface GenoConverter {
     454        [Const] attribute DOMString name;
     455        [Value] attribute SString in_format;
     456        [Value] attribute SString out_format;
     457};
     458
     459interface GenoConv_f40 : GenoConverter{
     460        void GenoConv_f40();
     461};
     462
     463interface GenoConv_f90 : GenoConverter{
     464        void GenoConv_f90();
     465};
     466
     467interface GenoConv_fL0 : GenoConverter{
     468        void GenoConv_fL0();
     469};
     470
     471interface GenoConv_fBH : GenoConverter{
     472        void GenoConv_fBH();
     473};
     474
     475
     476interface GenoConv_fS0s : GenoConverter{
     477        void GenoConv_fS0s();
     478};
     479
     480interface GenoConv_fH0 : GenoConverter{
     481        void GenoConv_fH0();
     482};
     483
     484interface GenoConvHelper{
     485        void GenoConvHelper(GenoConverter genoConv);
     486        [Const] DOMString getName();
     487};
     488
    444489interface GenoOperators {
    445490        void GenoOperators();
     
    447492        long checkValidity([Const] DOMString geno, [Const] DOMString genoname);
    448493        long validate(DOMString geno, [Const] DOMString genoname);
    449         [Value] SString getSimplest();
     494        [Const] DOMString getSimplest();
    450495};
    451496
     
    473518        void GenoOper_fF();
    474519};
     520
     521interface GenoOper_fS : GenoOperators {
     522        void GenoOper_fS();
     523};
     524
    475525
    476526interface GenoOperatorsHelper {
     
    481531        [Value] SString getLastCrossGeno1();
    482532        [Value] SString getLastCrossGeno2();
     533        [Const] DOMString getSimplest();
    483534};
    484535
     
    542593        void quickCopyFrom(ParamInterface src);
    543594
    544         //long save(VirtFILE file, [Const] DOMString altname, optional boolean force = false);
     595        //long saveMultiLine(VirtFILE file, [Const] DOMString altname, optional boolean force = false);
    545596
    546597        static boolean isValidTypeDescription([Const] DOMString t);
     
    553604interface Param : SimpleAbstractParam {
    554605        void Param(ParamEntry t, VoidPtr o);
    555         //long save(VirtFILE file, [Const] DOMString altname, optional boolean force = false);
     606        long saveMultiLine(VirtFILE file, [Const] DOMString altname, optional boolean force = false);
    556607};
    557608
  • js/sdk/js_interface/js_types.h

    r879 r1324  
    205205        }
    206206
     207        const char* getSimplest()
     208        {
     209                return genoOper->getSimplest();
     210        }
     211
    207212        ~GenoOperatorsHelper()
    208213        {
     
    214219};
    215220
     221struct GenoConvHelper
     222{
     223        GenoConverter* genoConv;
     224        GenoConvHelper(GenoConverter* _genoConv)
     225        {
     226                genoConv = _genoConv;
     227        }
     228        const char* getName()
     229        {
     230                return genoConv->name;
     231        }
     232};
     233
    216234#endif
    217235#endif //JS_TYPES_H_
Note: See TracChangeset for help on using the changeset viewer.