00001 /* 00002 * Copyright 2006 Sony Computer Entertainment Inc. 00003 * 00004 * Licensed under the MIT Open Source License, for details please see license.txt or the website 00005 * http://www.opensource.org/licenses/mit-license.php 00006 * 00007 */ 00008 00009 #ifndef __domLight_h__ 00010 #define __domLight_h__ 00011 00012 #include <dae/daeDocument.h> 00013 #include <dom/domTypes.h> 00014 #include <dom/domElements.h> 00015 00016 #include <dom/domAsset.h> 00017 #include <dom/domTechnique.h> 00018 #include <dom/domExtra.h> 00019 #include <dom/domTargetableFloat3.h> 00020 #include <dom/domTargetableFloat.h> 00021 class DAE; 00022 00028 class domLight : public daeElement 00029 { 00030 public: 00031 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::LIGHT; } 00032 static daeInt ID() { return 638; } 00033 virtual daeInt typeID() const { return ID(); } 00034 public: 00035 class domTechnique_common; 00036 00037 typedef daeSmartRef<domTechnique_common> domTechnique_commonRef; 00038 typedef daeTArray<domTechnique_commonRef> domTechnique_common_Array; 00039 00044 class domTechnique_common : public daeElement 00045 { 00046 public: 00047 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::TECHNIQUE_COMMON; } 00048 static daeInt ID() { return 639; } 00049 virtual daeInt typeID() const { return ID(); } 00050 public: 00051 class domAmbient; 00052 00053 typedef daeSmartRef<domAmbient> domAmbientRef; 00054 typedef daeTArray<domAmbientRef> domAmbient_Array; 00055 00061 class domAmbient : public daeElement 00062 { 00063 public: 00064 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::AMBIENT; } 00065 static daeInt ID() { return 640; } 00066 virtual daeInt typeID() const { return ID(); } 00067 00068 protected: // Element 00073 domTargetableFloat3Ref elemColor; 00074 00075 public: //Accessors and Mutators 00080 const domTargetableFloat3Ref getColor() const { return elemColor; } 00081 protected: 00085 domAmbient(DAE& dae) : daeElement(dae), elemColor() {} 00089 virtual ~domAmbient() {} 00093 virtual domAmbient &operator=( const domAmbient &cpy ) { (void)cpy; return *this; } 00094 00095 public: // STATIC METHODS 00100 static DLLSPEC daeElementRef create(DAE& dae); 00106 static DLLSPEC daeMetaElement* registerElement(DAE& dae); 00107 }; 00108 00109 class domDirectional; 00110 00111 typedef daeSmartRef<domDirectional> domDirectionalRef; 00112 typedef daeTArray<domDirectionalRef> domDirectional_Array; 00113 00122 class domDirectional : public daeElement 00123 { 00124 public: 00125 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::DIRECTIONAL; } 00126 static daeInt ID() { return 641; } 00127 virtual daeInt typeID() const { return ID(); } 00128 00129 protected: // Element 00134 domTargetableFloat3Ref elemColor; 00135 00136 public: //Accessors and Mutators 00141 const domTargetableFloat3Ref getColor() const { return elemColor; } 00142 protected: 00146 domDirectional(DAE& dae) : daeElement(dae), elemColor() {} 00150 virtual ~domDirectional() {} 00154 virtual domDirectional &operator=( const domDirectional &cpy ) { (void)cpy; return *this; } 00155 00156 public: // STATIC METHODS 00161 static DLLSPEC daeElementRef create(DAE& dae); 00167 static DLLSPEC daeMetaElement* registerElement(DAE& dae); 00168 }; 00169 00170 class domPoint; 00171 00172 typedef daeSmartRef<domPoint> domPointRef; 00173 typedef daeTArray<domPointRef> domPoint_Array; 00174 00182 class domPoint : public daeElement 00183 { 00184 public: 00185 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::POINT; } 00186 static daeInt ID() { return 642; } 00187 virtual daeInt typeID() const { return ID(); } 00188 00189 protected: // Elements 00194 domTargetableFloat3Ref elemColor; 00200 domTargetableFloatRef elemConstant_attenuation; 00206 domTargetableFloatRef elemLinear_attenuation; 00212 domTargetableFloatRef elemQuadratic_attenuation; 00213 00214 public: //Accessors and Mutators 00219 const domTargetableFloat3Ref getColor() const { return elemColor; } 00224 const domTargetableFloatRef getConstant_attenuation() const { return elemConstant_attenuation; } 00229 const domTargetableFloatRef getLinear_attenuation() const { return elemLinear_attenuation; } 00234 const domTargetableFloatRef getQuadratic_attenuation() const { return elemQuadratic_attenuation; } 00235 protected: 00239 domPoint(DAE& dae) : daeElement(dae), elemColor(), elemConstant_attenuation(), elemLinear_attenuation(), elemQuadratic_attenuation() {} 00243 virtual ~domPoint() {} 00247 virtual domPoint &operator=( const domPoint &cpy ) { (void)cpy; return *this; } 00248 00249 public: // STATIC METHODS 00254 static DLLSPEC daeElementRef create(DAE& dae); 00260 static DLLSPEC daeMetaElement* registerElement(DAE& dae); 00261 }; 00262 00263 class domSpot; 00264 00265 typedef daeSmartRef<domSpot> domSpotRef; 00266 typedef daeTArray<domSpotRef> domSpot_Array; 00267 00281 class domSpot : public daeElement 00282 { 00283 public: 00284 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::SPOT; } 00285 static daeInt ID() { return 643; } 00286 virtual daeInt typeID() const { return ID(); } 00287 00288 protected: // Elements 00293 domTargetableFloat3Ref elemColor; 00299 domTargetableFloatRef elemConstant_attenuation; 00305 domTargetableFloatRef elemLinear_attenuation; 00311 domTargetableFloatRef elemQuadratic_attenuation; 00316 domTargetableFloatRef elemFalloff_angle; 00321 domTargetableFloatRef elemFalloff_exponent; 00322 00323 public: //Accessors and Mutators 00328 const domTargetableFloat3Ref getColor() const { return elemColor; } 00333 const domTargetableFloatRef getConstant_attenuation() const { return elemConstant_attenuation; } 00338 const domTargetableFloatRef getLinear_attenuation() const { return elemLinear_attenuation; } 00343 const domTargetableFloatRef getQuadratic_attenuation() const { return elemQuadratic_attenuation; } 00348 const domTargetableFloatRef getFalloff_angle() const { return elemFalloff_angle; } 00353 const domTargetableFloatRef getFalloff_exponent() const { return elemFalloff_exponent; } 00354 protected: 00358 domSpot(DAE& dae) : daeElement(dae), elemColor(), elemConstant_attenuation(), elemLinear_attenuation(), elemQuadratic_attenuation(), elemFalloff_angle(), elemFalloff_exponent() {} 00362 virtual ~domSpot() {} 00366 virtual domSpot &operator=( const domSpot &cpy ) { (void)cpy; return *this; } 00367 00368 public: // STATIC METHODS 00373 static DLLSPEC daeElementRef create(DAE& dae); 00379 static DLLSPEC daeMetaElement* registerElement(DAE& dae); 00380 }; 00381 00382 00383 00384 protected: // Elements 00390 domAmbientRef elemAmbient; 00399 domDirectionalRef elemDirectional; 00408 domPointRef elemPoint; 00422 domSpotRef elemSpot; 00426 daeElementRefArray _contents; 00430 daeUIntArray _contentsOrder; 00431 00435 daeTArray< daeCharArray * > _CMData; 00436 00437 00438 public: //Accessors and Mutators 00443 const domAmbientRef getAmbient() const { return elemAmbient; } 00448 const domDirectionalRef getDirectional() const { return elemDirectional; } 00453 const domPointRef getPoint() const { return elemPoint; } 00458 const domSpotRef getSpot() const { return elemSpot; } 00463 daeElementRefArray &getContents() { return _contents; } 00468 const daeElementRefArray &getContents() const { return _contents; } 00469 00470 protected: 00474 domTechnique_common(DAE& dae) : daeElement(dae), elemAmbient(), elemDirectional(), elemPoint(), elemSpot() {} 00478 virtual ~domTechnique_common() { daeElement::deleteCMDataArray(_CMData); } 00482 virtual domTechnique_common &operator=( const domTechnique_common &cpy ) { (void)cpy; return *this; } 00483 00484 public: // STATIC METHODS 00489 static DLLSPEC daeElementRef create(DAE& dae); 00495 static DLLSPEC daeMetaElement* registerElement(DAE& dae); 00496 }; 00497 00498 00499 protected: // Attributes 00505 xsID attrId; 00509 xsNCName attrName; 00510 00511 protected: // Elements 00515 domAssetRef elemAsset; 00520 domTechnique_commonRef elemTechnique_common; 00525 domTechnique_Array elemTechnique_array; 00529 domExtra_Array elemExtra_array; 00530 00531 public: //Accessors and Mutators 00536 xsID getId() const { return attrId; } 00541 void setId( xsID atId ) { *(daeStringRef*)&attrId = atId; _validAttributeArray[0] = true; 00542 if( _document != NULL ) _document->changeElementID( this, attrId ); 00543 } 00544 00549 xsNCName getName() const { return attrName; } 00554 void setName( xsNCName atName ) { *(daeStringRef*)&attrName = atName; _validAttributeArray[1] = true; } 00555 00560 const domAssetRef getAsset() const { return elemAsset; } 00565 const domTechnique_commonRef getTechnique_common() const { return elemTechnique_common; } 00570 domTechnique_Array &getTechnique_array() { return elemTechnique_array; } 00575 const domTechnique_Array &getTechnique_array() const { return elemTechnique_array; } 00580 domExtra_Array &getExtra_array() { return elemExtra_array; } 00585 const domExtra_Array &getExtra_array() const { return elemExtra_array; } 00586 protected: 00590 domLight(DAE& dae) : daeElement(dae), attrId(), attrName(), elemAsset(), elemTechnique_common(), elemTechnique_array(), elemExtra_array() {} 00594 virtual ~domLight() {} 00598 virtual domLight &operator=( const domLight &cpy ) { (void)cpy; return *this; } 00599 00600 public: // STATIC METHODS 00605 static DLLSPEC daeElementRef create(DAE& dae); 00611 static DLLSPEC daeMetaElement* registerElement(DAE& dae); 00612 }; 00613 00614 00615 #endif