Changeset 1324 for js/sdk/js_interface
- Timestamp:
- 08/14/24 00:56:06 (3 months ago)
- Location:
- js/sdk/js_interface
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
js/sdk/js_interface/js_interface.cpp
r944 r1324 15 15 #include <frams/genetics/f9/f9_oper.h> 16 16 #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> 17 27 #include <common/loggers/loggers.h> 18 28 #include <common/loggers/loggertostdout.h> -
js/sdk/js_interface/js_interface.idl
r944 r1324 91 91 92 92 enum Part_Shape { 93 "Part::SHAPE_BALL _AND_STICK",93 "Part::SHAPE_BALL", 94 94 "Part::SHAPE_ELLIPSOID", 95 95 "Part::SHAPE_CUBOID", … … 111 111 [Value] attribute Pt3D scale; 112 112 [Value] attribute Pt3D vcolor; 113 attribute double vsize;114 113 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"); 117 117 118 118 void setPositionAndRotationFromAxis([Const, Ref] Pt3D p1, [Const, Ref] Pt3D p2); … … 126 126 127 127 enum 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" 130 132 }; 131 133 … … 247 249 void Geno([Const] DOMString genstring, byte genformat, [Const] DOMString genname, [Const] DOMString comment); 248 250 boolean isValid(); 249 bytegetFormat();251 [Value] SString getFormat(); 250 252 [Value] SString getGenes(); 253 [Value] SString getGenesAndFormat(); 251 254 static Validators useValidators(Validators val); 252 255 static GenoConvManager useConverters(GenoConvManager gcm); … … 261 264 262 265 enum 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" 267 270 }; 268 271 … … 272 275 attribute double startenergy; 273 276 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); 276 282 277 283 [Value] MultiMap getMap(); … … 283 289 long getErrorPosition(boolean includingwarnings); 284 290 Model_ShapeType getShapeType(); 291 void declareShapeType(Model_ShapeType sh); 285 292 void updateRefno(); 286 293 [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); 288 295 void setGeno([Const, Ref] Geno newgeno); 289 296 void setValidationLevel(long level); … … 348 355 349 356 interface 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); 351 360 GenotypeMini loadNextGenotype(); 352 361 }; … … 442 451 }; 443 452 453 interface GenoConverter { 454 [Const] attribute DOMString name; 455 [Value] attribute SString in_format; 456 [Value] attribute SString out_format; 457 }; 458 459 interface GenoConv_f40 : GenoConverter{ 460 void GenoConv_f40(); 461 }; 462 463 interface GenoConv_f90 : GenoConverter{ 464 void GenoConv_f90(); 465 }; 466 467 interface GenoConv_fL0 : GenoConverter{ 468 void GenoConv_fL0(); 469 }; 470 471 interface GenoConv_fBH : GenoConverter{ 472 void GenoConv_fBH(); 473 }; 474 475 476 interface GenoConv_fS0s : GenoConverter{ 477 void GenoConv_fS0s(); 478 }; 479 480 interface GenoConv_fH0 : GenoConverter{ 481 void GenoConv_fH0(); 482 }; 483 484 interface GenoConvHelper{ 485 void GenoConvHelper(GenoConverter genoConv); 486 [Const] DOMString getName(); 487 }; 488 444 489 interface GenoOperators { 445 490 void GenoOperators(); … … 447 492 long checkValidity([Const] DOMString geno, [Const] DOMString genoname); 448 493 long validate(DOMString geno, [Const] DOMString genoname); 449 [ Value] SString getSimplest();494 [Const] DOMString getSimplest(); 450 495 }; 451 496 … … 473 518 void GenoOper_fF(); 474 519 }; 520 521 interface GenoOper_fS : GenoOperators { 522 void GenoOper_fS(); 523 }; 524 475 525 476 526 interface GenoOperatorsHelper { … … 481 531 [Value] SString getLastCrossGeno1(); 482 532 [Value] SString getLastCrossGeno2(); 533 [Const] DOMString getSimplest(); 483 534 }; 484 535 … … 542 593 void quickCopyFrom(ParamInterface src); 543 594 544 //long save (VirtFILE file, [Const] DOMString altname, optional boolean force = false);595 //long saveMultiLine(VirtFILE file, [Const] DOMString altname, optional boolean force = false); 545 596 546 597 static boolean isValidTypeDescription([Const] DOMString t); … … 553 604 interface Param : SimpleAbstractParam { 554 605 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); 556 607 }; 557 608 -
js/sdk/js_interface/js_types.h
r879 r1324 205 205 } 206 206 207 const char* getSimplest() 208 { 209 return genoOper->getSimplest(); 210 } 211 207 212 ~GenoOperatorsHelper() 208 213 { … … 214 219 }; 215 220 221 struct 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 216 234 #endif 217 235 #endif //JS_TYPES_H_
Note: See TracChangeset
for help on using the changeset viewer.