1 /* 2 * Copyright 2006 Sony Computer Entertainment Inc. 3 * 4 * Licensed under the MIT Open Source License, for details please see license.txt or the website 5 * http://www.opensource.org/licenses/mit-license.php 6 * 7 */ 8 9 #include <dae.h> 10 #include <dae/daeDom.h> 11 #include <dom/domRigid_constraint.h> 12 #include <dae/daeMetaCMPolicy.h> 13 #include <dae/daeMetaSequence.h> 14 #include <dae/daeMetaChoice.h> 15 #include <dae/daeMetaGroup.h> 16 #include <dae/daeMetaAny.h> 17 #include <dae/daeMetaElementAttribute.h> 18 19 daeElementRef 20 domRigid_constraint::create(DAE& dae) 21 { 22 domRigid_constraintRef ref = new domRigid_constraint(dae); 23 return ref; 24 } 25 26 27 daeMetaElement * 28 domRigid_constraint::registerElement(DAE& dae) 29 { 30 daeMetaElement* meta = dae.getMeta(ID()); 31 if ( meta != NULL ) return meta; 32 33 meta = new daeMetaElement(dae); 34 dae.setMeta(ID(), *meta); 35 meta->setName( "rigid_constraint" ); 36 meta->registerClass(domRigid_constraint::create); 37 38 daeMetaCMPolicy *cm = NULL; 39 daeMetaElementAttribute *mea = NULL; 40 cm = new daeMetaSequence( meta, cm, 0, 1, 1 ); 41 42 mea = new daeMetaElementAttribute( meta, cm, 0, 1, 1 ); 43 mea->setName( "ref_attachment" ); 44 mea->setOffset( daeOffsetOf(domRigid_constraint,elemRef_attachment) ); 45 mea->setElementType( domRigid_constraint::domRef_attachment::registerElement(dae) ); 46 cm->appendChild( mea ); 47 48 mea = new daeMetaElementAttribute( meta, cm, 1, 1, 1 ); 49 mea->setName( "attachment" ); 50 mea->setOffset( daeOffsetOf(domRigid_constraint,elemAttachment) ); 51 mea->setElementType( domRigid_constraint::domAttachment::registerElement(dae) ); 52 cm->appendChild( mea ); 53 54 mea = new daeMetaElementAttribute( meta, cm, 2, 1, 1 ); 55 mea->setName( "technique_common" ); 56 mea->setOffset( daeOffsetOf(domRigid_constraint,elemTechnique_common) ); 57 mea->setElementType( domRigid_constraint::domTechnique_common::registerElement(dae) ); 58 cm->appendChild( mea ); 59 60 mea = new daeMetaElementArrayAttribute( meta, cm, 3, 0, -1 ); 61 mea->setName( "technique" ); 62 mea->setOffset( daeOffsetOf(domRigid_constraint,elemTechnique_array) ); 63 mea->setElementType( domTechnique::registerElement(dae) ); 64 cm->appendChild( mea ); 65 66 mea = new daeMetaElementArrayAttribute( meta, cm, 4, 0, -1 ); 67 mea->setName( "extra" ); 68 mea->setOffset( daeOffsetOf(domRigid_constraint,elemExtra_array) ); 69 mea->setElementType( domExtra::registerElement(dae) ); 70 cm->appendChild( mea ); 71 72 cm->setMaxOrdinal( 4 ); 73 meta->setCMRoot( cm ); 74 75 // Add attribute: sid 76 { 77 daeMetaAttribute *ma = new daeMetaAttribute; 78 ma->setName( "sid" ); 79 ma->setType( dae.getAtomicTypes().get("xsNCName")); 80 ma->setOffset( daeOffsetOf( domRigid_constraint , attrSid )); 81 ma->setContainer( meta ); 82 ma->setIsRequired( true ); 83 84 meta->appendAttribute(ma); 85 } 86 87 // Add attribute: name 88 { 89 daeMetaAttribute *ma = new daeMetaAttribute; 90 ma->setName( "name" ); 91 ma->setType( dae.getAtomicTypes().get("xsNCName")); 92 ma->setOffset( daeOffsetOf( domRigid_constraint , attrName )); 93 ma->setContainer( meta ); 94 95 meta->appendAttribute(ma); 96 } 97 98 meta->setElementSize(sizeof(domRigid_constraint)); 99 meta->validate(); 100 101 return meta; 102 } 103 104 daeElementRef 105 domRigid_constraint::domRef_attachment::create(DAE& dae) 106 { 107 domRigid_constraint::domRef_attachmentRef ref = new domRigid_constraint::domRef_attachment(dae); 108 return ref; 109 } 110 111 112 daeMetaElement * 113 domRigid_constraint::domRef_attachment::registerElement(DAE& dae) 114 { 115 daeMetaElement* meta = dae.getMeta(ID()); 116 if ( meta != NULL ) return meta; 117 118 meta = new daeMetaElement(dae); 119 dae.setMeta(ID(), *meta); 120 meta->setName( "ref_attachment" ); 121 meta->registerClass(domRigid_constraint::domRef_attachment::create); 122 123 meta->setIsInnerClass( true ); 124 daeMetaCMPolicy *cm = NULL; 125 daeMetaElementAttribute *mea = NULL; 126 cm = new daeMetaChoice( meta, cm, 0, 0, 0, -1 ); 127 128 mea = new daeMetaElementArrayAttribute( meta, cm, 0, 1, 1 ); 129 mea->setName( "translate" ); 130 mea->setOffset( daeOffsetOf(domRigid_constraint::domRef_attachment,elemTranslate_array) ); 131 mea->setElementType( domTranslate::registerElement(dae) ); 132 cm->appendChild( mea ); 133 134 mea = new daeMetaElementArrayAttribute( meta, cm, 0, 1, 1 ); 135 mea->setName( "rotate" ); 136 mea->setOffset( daeOffsetOf(domRigid_constraint::domRef_attachment,elemRotate_array) ); 137 mea->setElementType( domRotate::registerElement(dae) ); 138 cm->appendChild( mea ); 139 140 mea = new daeMetaElementArrayAttribute( meta, cm, 0, 0, -1 ); 141 mea->setName( "extra" ); 142 mea->setOffset( daeOffsetOf(domRigid_constraint::domRef_attachment,elemExtra_array) ); 143 mea->setElementType( domExtra::registerElement(dae) ); 144 cm->appendChild( mea ); 145 146 cm->setMaxOrdinal( 3000 ); 147 meta->setCMRoot( cm ); 148 // Ordered list of sub-elements 149 meta->addContents(daeOffsetOf(domRigid_constraint::domRef_attachment,_contents)); 150 meta->addContentsOrder(daeOffsetOf(domRigid_constraint::domRef_attachment,_contentsOrder)); 151 152 meta->addCMDataArray(daeOffsetOf(domRigid_constraint::domRef_attachment,_CMData), 1); 153 // Add attribute: rigid_body 154 { 155 daeMetaAttribute *ma = new daeMetaAttribute; 156 ma->setName( "rigid_body" ); 157 ma->setType( dae.getAtomicTypes().get("xsAnyURI")); 158 ma->setOffset( daeOffsetOf( domRigid_constraint::domRef_attachment , attrRigid_body )); 159 ma->setContainer( meta ); 160 161 meta->appendAttribute(ma); 162 } 163 164 meta->setElementSize(sizeof(domRigid_constraint::domRef_attachment)); 165 meta->validate(); 166 167 return meta; 168 } 169 170 daeElementRef 171 domRigid_constraint::domAttachment::create(DAE& dae) 172 { 173 domRigid_constraint::domAttachmentRef ref = new domRigid_constraint::domAttachment(dae); 174 return ref; 175 } 176 177 178 daeMetaElement * 179 domRigid_constraint::domAttachment::registerElement(DAE& dae) 180 { 181 daeMetaElement* meta = dae.getMeta(ID()); 182 if ( meta != NULL ) return meta; 183 184 meta = new daeMetaElement(dae); 185 dae.setMeta(ID(), *meta); 186 meta->setName( "attachment" ); 187 meta->registerClass(domRigid_constraint::domAttachment::create); 188 189 meta->setIsInnerClass( true ); 190 daeMetaCMPolicy *cm = NULL; 191 daeMetaElementAttribute *mea = NULL; 192 cm = new daeMetaChoice( meta, cm, 0, 0, 0, -1 ); 193 194 mea = new daeMetaElementArrayAttribute( meta, cm, 0, 1, 1 ); 195 mea->setName( "translate" ); 196 mea->setOffset( daeOffsetOf(domRigid_constraint::domAttachment,elemTranslate_array) ); 197 mea->setElementType( domTranslate::registerElement(dae) ); 198 cm->appendChild( mea ); 199 200 mea = new daeMetaElementArrayAttribute( meta, cm, 0, 1, 1 ); 201 mea->setName( "rotate" ); 202 mea->setOffset( daeOffsetOf(domRigid_constraint::domAttachment,elemRotate_array) ); 203 mea->setElementType( domRotate::registerElement(dae) ); 204 cm->appendChild( mea ); 205 206 mea = new daeMetaElementArrayAttribute( meta, cm, 0, 0, -1 ); 207 mea->setName( "extra" ); 208 mea->setOffset( daeOffsetOf(domRigid_constraint::domAttachment,elemExtra_array) ); 209 mea->setElementType( domExtra::registerElement(dae) ); 210 cm->appendChild( mea ); 211 212 cm->setMaxOrdinal( 3000 ); 213 meta->setCMRoot( cm ); 214 // Ordered list of sub-elements 215 meta->addContents(daeOffsetOf(domRigid_constraint::domAttachment,_contents)); 216 meta->addContentsOrder(daeOffsetOf(domRigid_constraint::domAttachment,_contentsOrder)); 217 218 meta->addCMDataArray(daeOffsetOf(domRigid_constraint::domAttachment,_CMData), 1); 219 // Add attribute: rigid_body 220 { 221 daeMetaAttribute *ma = new daeMetaAttribute; 222 ma->setName( "rigid_body" ); 223 ma->setType( dae.getAtomicTypes().get("xsAnyURI")); 224 ma->setOffset( daeOffsetOf( domRigid_constraint::domAttachment , attrRigid_body )); 225 ma->setContainer( meta ); 226 227 meta->appendAttribute(ma); 228 } 229 230 meta->setElementSize(sizeof(domRigid_constraint::domAttachment)); 231 meta->validate(); 232 233 return meta; 234 } 235 236 daeElementRef 237 domRigid_constraint::domTechnique_common::create(DAE& dae) 238 { 239 domRigid_constraint::domTechnique_commonRef ref = new domRigid_constraint::domTechnique_common(dae); 240 return ref; 241 } 242 243 244 daeMetaElement * 245 domRigid_constraint::domTechnique_common::registerElement(DAE& dae) 246 { 247 daeMetaElement* meta = dae.getMeta(ID()); 248 if ( meta != NULL ) return meta; 249 250 meta = new daeMetaElement(dae); 251 dae.setMeta(ID(), *meta); 252 meta->setName( "technique_common" ); 253 meta->registerClass(domRigid_constraint::domTechnique_common::create); 254 255 meta->setIsInnerClass( true ); 256 daeMetaCMPolicy *cm = NULL; 257 daeMetaElementAttribute *mea = NULL; 258 cm = new daeMetaSequence( meta, cm, 0, 1, 1 ); 259 260 mea = new daeMetaElementAttribute( meta, cm, 0, 0, 1 ); 261 mea->setName( "enabled" ); 262 mea->setOffset( daeOffsetOf(domRigid_constraint::domTechnique_common,elemEnabled) ); 263 mea->setElementType( domRigid_constraint::domTechnique_common::domEnabled::registerElement(dae) ); 264 cm->appendChild( mea ); 265 266 mea = new daeMetaElementAttribute( meta, cm, 1, 0, 1 ); 267 mea->setName( "interpenetrate" ); 268 mea->setOffset( daeOffsetOf(domRigid_constraint::domTechnique_common,elemInterpenetrate) ); 269 mea->setElementType( domRigid_constraint::domTechnique_common::domInterpenetrate::registerElement(dae) ); 270 cm->appendChild( mea ); 271 272 mea = new daeMetaElementAttribute( meta, cm, 2, 0, 1 ); 273 mea->setName( "limits" ); 274 mea->setOffset( daeOffsetOf(domRigid_constraint::domTechnique_common,elemLimits) ); 275 mea->setElementType( domRigid_constraint::domTechnique_common::domLimits::registerElement(dae) ); 276 cm->appendChild( mea ); 277 278 mea = new daeMetaElementAttribute( meta, cm, 3, 0, 1 ); 279 mea->setName( "spring" ); 280 mea->setOffset( daeOffsetOf(domRigid_constraint::domTechnique_common,elemSpring) ); 281 mea->setElementType( domRigid_constraint::domTechnique_common::domSpring::registerElement(dae) ); 282 cm->appendChild( mea ); 283 284 cm->setMaxOrdinal( 3 ); 285 meta->setCMRoot( cm ); 286 287 meta->setElementSize(sizeof(domRigid_constraint::domTechnique_common)); 288 meta->validate(); 289 290 return meta; 291 } 292 293 daeElementRef 294 domRigid_constraint::domTechnique_common::domEnabled::create(DAE& dae) 295 { 296 domRigid_constraint::domTechnique_common::domEnabledRef ref = new domRigid_constraint::domTechnique_common::domEnabled(dae); 297 return ref; 298 } 299 300 301 daeMetaElement * 302 domRigid_constraint::domTechnique_common::domEnabled::registerElement(DAE& dae) 303 { 304 daeMetaElement* meta = dae.getMeta(ID()); 305 if ( meta != NULL ) return meta; 306 307 meta = new daeMetaElement(dae); 308 dae.setMeta(ID(), *meta); 309 meta->setName( "enabled" ); 310 meta->registerClass(domRigid_constraint::domTechnique_common::domEnabled::create); 311 312 meta->setIsInnerClass( true ); 313 // Add attribute: _value 314 { 315 daeMetaAttribute *ma = new daeMetaAttribute; 316 ma->setName( "_value" ); 317 ma->setType( dae.getAtomicTypes().get("Bool")); 318 ma->setOffset( daeOffsetOf( domRigid_constraint::domTechnique_common::domEnabled , _value )); 319 ma->setContainer( meta ); 320 meta->appendAttribute(ma); 321 } 322 323 // Add attribute: sid 324 { 325 daeMetaAttribute *ma = new daeMetaAttribute; 326 ma->setName( "sid" ); 327 ma->setType( dae.getAtomicTypes().get("xsNCName")); 328 ma->setOffset( daeOffsetOf( domRigid_constraint::domTechnique_common::domEnabled , attrSid )); 329 ma->setContainer( meta ); 330 331 meta->appendAttribute(ma); 332 } 333 334 meta->setElementSize(sizeof(domRigid_constraint::domTechnique_common::domEnabled)); 335 meta->validate(); 336 337 return meta; 338 } 339 340 daeElementRef 341 domRigid_constraint::domTechnique_common::domInterpenetrate::create(DAE& dae) 342 { 343 domRigid_constraint::domTechnique_common::domInterpenetrateRef ref = new domRigid_constraint::domTechnique_common::domInterpenetrate(dae); 344 return ref; 345 } 346 347 348 daeMetaElement * 349 domRigid_constraint::domTechnique_common::domInterpenetrate::registerElement(DAE& dae) 350 { 351 daeMetaElement* meta = dae.getMeta(ID()); 352 if ( meta != NULL ) return meta; 353 354 meta = new daeMetaElement(dae); 355 dae.setMeta(ID(), *meta); 356 meta->setName( "interpenetrate" ); 357 meta->registerClass(domRigid_constraint::domTechnique_common::domInterpenetrate::create); 358 359 meta->setIsInnerClass( true ); 360 // Add attribute: _value 361 { 362 daeMetaAttribute *ma = new daeMetaAttribute; 363 ma->setName( "_value" ); 364 ma->setType( dae.getAtomicTypes().get("Bool")); 365 ma->setOffset( daeOffsetOf( domRigid_constraint::domTechnique_common::domInterpenetrate , _value )); 366 ma->setContainer( meta ); 367 meta->appendAttribute(ma); 368 } 369 370 // Add attribute: sid 371 { 372 daeMetaAttribute *ma = new daeMetaAttribute; 373 ma->setName( "sid" ); 374 ma->setType( dae.getAtomicTypes().get("xsNCName")); 375 ma->setOffset( daeOffsetOf( domRigid_constraint::domTechnique_common::domInterpenetrate , attrSid )); 376 ma->setContainer( meta ); 377 378 meta->appendAttribute(ma); 379 } 380 381 meta->setElementSize(sizeof(domRigid_constraint::domTechnique_common::domInterpenetrate)); 382 meta->validate(); 383 384 return meta; 385 } 386 387 daeElementRef 388 domRigid_constraint::domTechnique_common::domLimits::create(DAE& dae) 389 { 390 domRigid_constraint::domTechnique_common::domLimitsRef ref = new domRigid_constraint::domTechnique_common::domLimits(dae); 391 return ref; 392 } 393 394 395 daeMetaElement * 396 domRigid_constraint::domTechnique_common::domLimits::registerElement(DAE& dae) 397 { 398 daeMetaElement* meta = dae.getMeta(ID()); 399 if ( meta != NULL ) return meta; 400 401 meta = new daeMetaElement(dae); 402 dae.setMeta(ID(), *meta); 403 meta->setName( "limits" ); 404 meta->registerClass(domRigid_constraint::domTechnique_common::domLimits::create); 405 406 meta->setIsInnerClass( true ); 407 daeMetaCMPolicy *cm = NULL; 408 daeMetaElementAttribute *mea = NULL; 409 cm = new daeMetaSequence( meta, cm, 0, 1, 1 ); 410 411 mea = new daeMetaElementAttribute( meta, cm, 0, 0, 1 ); 412 mea->setName( "swing_cone_and_twist" ); 413 mea->setOffset( daeOffsetOf(domRigid_constraint::domTechnique_common::domLimits,elemSwing_cone_and_twist) ); 414 mea->setElementType( domRigid_constraint::domTechnique_common::domLimits::domSwing_cone_and_twist::registerElement(dae) ); 415 cm->appendChild( mea ); 416 417 mea = new daeMetaElementAttribute( meta, cm, 1, 0, 1 ); 418 mea->setName( "linear" ); 419 mea->setOffset( daeOffsetOf(domRigid_constraint::domTechnique_common::domLimits,elemLinear) ); 420 mea->setElementType( domRigid_constraint::domTechnique_common::domLimits::domLinear::registerElement(dae) ); 421 cm->appendChild( mea ); 422 423 cm->setMaxOrdinal( 1 ); 424 meta->setCMRoot( cm ); 425 426 meta->setElementSize(sizeof(domRigid_constraint::domTechnique_common::domLimits)); 427 meta->validate(); 428 429 return meta; 430 } 431 432 daeElementRef 433 domRigid_constraint::domTechnique_common::domLimits::domSwing_cone_and_twist::create(DAE& dae) 434 { 435 domRigid_constraint::domTechnique_common::domLimits::domSwing_cone_and_twistRef ref = new domRigid_constraint::domTechnique_common::domLimits::domSwing_cone_and_twist(dae); 436 return ref; 437 } 438 439 440 daeMetaElement * 441 domRigid_constraint::domTechnique_common::domLimits::domSwing_cone_and_twist::registerElement(DAE& dae) 442 { 443 daeMetaElement* meta = dae.getMeta(ID()); 444 if ( meta != NULL ) return meta; 445 446 meta = new daeMetaElement(dae); 447 dae.setMeta(ID(), *meta); 448 meta->setName( "swing_cone_and_twist" ); 449 meta->registerClass(domRigid_constraint::domTechnique_common::domLimits::domSwing_cone_and_twist::create); 450 451 meta->setIsInnerClass( true ); 452 daeMetaCMPolicy *cm = NULL; 453 daeMetaElementAttribute *mea = NULL; 454 cm = new daeMetaSequence( meta, cm, 0, 1, 1 ); 455 456 mea = new daeMetaElementAttribute( meta, cm, 0, 0, 1 ); 457 mea->setName( "min" ); 458 mea->setOffset( daeOffsetOf(domRigid_constraint::domTechnique_common::domLimits::domSwing_cone_and_twist,elemMin) ); 459 mea->setElementType( domTargetableFloat3::registerElement(dae) ); 460 cm->appendChild( mea ); 461 462 mea = new daeMetaElementAttribute( meta, cm, 1, 0, 1 ); 463 mea->setName( "max" ); 464 mea->setOffset( daeOffsetOf(domRigid_constraint::domTechnique_common::domLimits::domSwing_cone_and_twist,elemMax) ); 465 mea->setElementType( domTargetableFloat3::registerElement(dae) ); 466 cm->appendChild( mea ); 467 468 cm->setMaxOrdinal( 1 ); 469 meta->setCMRoot( cm ); 470 471 meta->setElementSize(sizeof(domRigid_constraint::domTechnique_common::domLimits::domSwing_cone_and_twist)); 472 meta->validate(); 473 474 return meta; 475 } 476 477 daeElementRef 478 domRigid_constraint::domTechnique_common::domLimits::domLinear::create(DAE& dae) 479 { 480 domRigid_constraint::domTechnique_common::domLimits::domLinearRef ref = new domRigid_constraint::domTechnique_common::domLimits::domLinear(dae); 481 return ref; 482 } 483 484 485 daeMetaElement * 486 domRigid_constraint::domTechnique_common::domLimits::domLinear::registerElement(DAE& dae) 487 { 488 daeMetaElement* meta = dae.getMeta(ID()); 489 if ( meta != NULL ) return meta; 490 491 meta = new daeMetaElement(dae); 492 dae.setMeta(ID(), *meta); 493 meta->setName( "linear" ); 494 meta->registerClass(domRigid_constraint::domTechnique_common::domLimits::domLinear::create); 495 496 meta->setIsInnerClass( true ); 497 daeMetaCMPolicy *cm = NULL; 498 daeMetaElementAttribute *mea = NULL; 499 cm = new daeMetaSequence( meta, cm, 0, 1, 1 ); 500 501 mea = new daeMetaElementAttribute( meta, cm, 0, 0, 1 ); 502 mea->setName( "min" ); 503 mea->setOffset( daeOffsetOf(domRigid_constraint::domTechnique_common::domLimits::domLinear,elemMin) ); 504 mea->setElementType( domTargetableFloat3::registerElement(dae) ); 505 cm->appendChild( mea ); 506 507 mea = new daeMetaElementAttribute( meta, cm, 1, 0, 1 ); 508 mea->setName( "max" ); 509 mea->setOffset( daeOffsetOf(domRigid_constraint::domTechnique_common::domLimits::domLinear,elemMax) ); 510 mea->setElementType( domTargetableFloat3::registerElement(dae) ); 511 cm->appendChild( mea ); 512 513 cm->setMaxOrdinal( 1 ); 514 meta->setCMRoot( cm ); 515 516 meta->setElementSize(sizeof(domRigid_constraint::domTechnique_common::domLimits::domLinear)); 517 meta->validate(); 518 519 return meta; 520 } 521 522 daeElementRef 523 domRigid_constraint::domTechnique_common::domSpring::create(DAE& dae) 524 { 525 domRigid_constraint::domTechnique_common::domSpringRef ref = new domRigid_constraint::domTechnique_common::domSpring(dae); 526 return ref; 527 } 528 529 530 daeMetaElement * 531 domRigid_constraint::domTechnique_common::domSpring::registerElement(DAE& dae) 532 { 533 daeMetaElement* meta = dae.getMeta(ID()); 534 if ( meta != NULL ) return meta; 535 536 meta = new daeMetaElement(dae); 537 dae.setMeta(ID(), *meta); 538 meta->setName( "spring" ); 539 meta->registerClass(domRigid_constraint::domTechnique_common::domSpring::create); 540 541 meta->setIsInnerClass( true ); 542 daeMetaCMPolicy *cm = NULL; 543 daeMetaElementAttribute *mea = NULL; 544 cm = new daeMetaSequence( meta, cm, 0, 1, 1 ); 545 546 mea = new daeMetaElementAttribute( meta, cm, 0, 0, 1 ); 547 mea->setName( "angular" ); 548 mea->setOffset( daeOffsetOf(domRigid_constraint::domTechnique_common::domSpring,elemAngular) ); 549 mea->setElementType( domRigid_constraint::domTechnique_common::domSpring::domAngular::registerElement(dae) ); 550 cm->appendChild( mea ); 551 552 mea = new daeMetaElementAttribute( meta, cm, 1, 0, 1 ); 553 mea->setName( "linear" ); 554 mea->setOffset( daeOffsetOf(domRigid_constraint::domTechnique_common::domSpring,elemLinear) ); 555 mea->setElementType( domRigid_constraint::domTechnique_common::domSpring::domLinear::registerElement(dae) ); 556 cm->appendChild( mea ); 557 558 cm->setMaxOrdinal( 1 ); 559 meta->setCMRoot( cm ); 560 561 meta->setElementSize(sizeof(domRigid_constraint::domTechnique_common::domSpring)); 562 meta->validate(); 563 564 return meta; 565 } 566 567 daeElementRef 568 domRigid_constraint::domTechnique_common::domSpring::domAngular::create(DAE& dae) 569 { 570 domRigid_constraint::domTechnique_common::domSpring::domAngularRef ref = new domRigid_constraint::domTechnique_common::domSpring::domAngular(dae); 571 return ref; 572 } 573 574 575 daeMetaElement * 576 domRigid_constraint::domTechnique_common::domSpring::domAngular::registerElement(DAE& dae) 577 { 578 daeMetaElement* meta = dae.getMeta(ID()); 579 if ( meta != NULL ) return meta; 580 581 meta = new daeMetaElement(dae); 582 dae.setMeta(ID(), *meta); 583 meta->setName( "angular" ); 584 meta->registerClass(domRigid_constraint::domTechnique_common::domSpring::domAngular::create); 585 586 meta->setIsInnerClass( true ); 587 daeMetaCMPolicy *cm = NULL; 588 daeMetaElementAttribute *mea = NULL; 589 cm = new daeMetaSequence( meta, cm, 0, 1, 1 ); 590 591 mea = new daeMetaElementAttribute( meta, cm, 0, 0, 1 ); 592 mea->setName( "stiffness" ); 593 mea->setOffset( daeOffsetOf(domRigid_constraint::domTechnique_common::domSpring::domAngular,elemStiffness) ); 594 mea->setElementType( domTargetableFloat::registerElement(dae) ); 595 cm->appendChild( mea ); 596 597 mea = new daeMetaElementAttribute( meta, cm, 1, 0, 1 ); 598 mea->setName( "damping" ); 599 mea->setOffset( daeOffsetOf(domRigid_constraint::domTechnique_common::domSpring::domAngular,elemDamping) ); 600 mea->setElementType( domTargetableFloat::registerElement(dae) ); 601 cm->appendChild( mea ); 602 603 mea = new daeMetaElementAttribute( meta, cm, 2, 0, 1 ); 604 mea->setName( "target_value" ); 605 mea->setOffset( daeOffsetOf(domRigid_constraint::domTechnique_common::domSpring::domAngular,elemTarget_value) ); 606 mea->setElementType( domTargetableFloat::registerElement(dae) ); 607 cm->appendChild( mea ); 608 609 cm->setMaxOrdinal( 2 ); 610 meta->setCMRoot( cm ); 611 612 meta->setElementSize(sizeof(domRigid_constraint::domTechnique_common::domSpring::domAngular)); 613 meta->validate(); 614 615 return meta; 616 } 617 618 daeElementRef 619 domRigid_constraint::domTechnique_common::domSpring::domLinear::create(DAE& dae) 620 { 621 domRigid_constraint::domTechnique_common::domSpring::domLinearRef ref = new domRigid_constraint::domTechnique_common::domSpring::domLinear(dae); 622 return ref; 623 } 624 625 626 daeMetaElement * 627 domRigid_constraint::domTechnique_common::domSpring::domLinear::registerElement(DAE& dae) 628 { 629 daeMetaElement* meta = dae.getMeta(ID()); 630 if ( meta != NULL ) return meta; 631 632 meta = new daeMetaElement(dae); 633 dae.setMeta(ID(), *meta); 634 meta->setName( "linear" ); 635 meta->registerClass(domRigid_constraint::domTechnique_common::domSpring::domLinear::create); 636 637 meta->setIsInnerClass( true ); 638 daeMetaCMPolicy *cm = NULL; 639 daeMetaElementAttribute *mea = NULL; 640 cm = new daeMetaSequence( meta, cm, 0, 1, 1 ); 641 642 mea = new daeMetaElementAttribute( meta, cm, 0, 0, 1 ); 643 mea->setName( "stiffness" ); 644 mea->setOffset( daeOffsetOf(domRigid_constraint::domTechnique_common::domSpring::domLinear,elemStiffness) ); 645 mea->setElementType( domTargetableFloat::registerElement(dae) ); 646 cm->appendChild( mea ); 647 648 mea = new daeMetaElementAttribute( meta, cm, 1, 0, 1 ); 649 mea->setName( "damping" ); 650 mea->setOffset( daeOffsetOf(domRigid_constraint::domTechnique_common::domSpring::domLinear,elemDamping) ); 651 mea->setElementType( domTargetableFloat::registerElement(dae) ); 652 cm->appendChild( mea ); 653 654 mea = new daeMetaElementAttribute( meta, cm, 2, 0, 1 ); 655 mea->setName( "target_value" ); 656 mea->setOffset( daeOffsetOf(domRigid_constraint::domTechnique_common::domSpring::domLinear,elemTarget_value) ); 657 mea->setElementType( domTargetableFloat::registerElement(dae) ); 658 cm->appendChild( mea ); 659 660 cm->setMaxOrdinal( 2 ); 661 meta->setCMRoot( cm ); 662 663 meta->setElementSize(sizeof(domRigid_constraint::domTechnique_common::domSpring::domLinear)); 664 meta->validate(); 665 666 return meta; 667 } 668 669