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 __domNode_h__ 00010 #define __domNode_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/domLookat.h> 00018 #include <dom/domMatrix.h> 00019 #include <dom/domRotate.h> 00020 #include <dom/domScale.h> 00021 #include <dom/domSkew.h> 00022 #include <dom/domTranslate.h> 00023 #include <dom/domInstance_camera.h> 00024 #include <dom/domInstance_controller.h> 00025 #include <dom/domInstance_geometry.h> 00026 #include <dom/domInstance_light.h> 00027 #include <dom/domInstance_node.h> 00028 #include <dom/domNode.h> 00029 #include <dom/domExtra.h> 00030 class DAE; 00031 00035 class domNode : public daeElement 00036 { 00037 public: 00038 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::NODE; } 00039 static daeInt ID() { return 681; } 00040 virtual daeInt typeID() const { return ID(); } 00041 protected: // Attributes 00047 xsID attrId; 00051 xsNCName attrName; 00057 xsNCName attrSid; 00062 domNodeType attrType; 00070 domListOfNames attrLayer; 00071 00072 protected: // Elements 00076 domAssetRef elemAsset; 00080 domLookat_Array elemLookat_array; 00084 domMatrix_Array elemMatrix_array; 00088 domRotate_Array elemRotate_array; 00092 domScale_Array elemScale_array; 00096 domSkew_Array elemSkew_array; 00100 domTranslate_Array elemTranslate_array; 00104 domInstance_camera_Array elemInstance_camera_array; 00109 domInstance_controller_Array elemInstance_controller_array; 00113 domInstance_geometry_Array elemInstance_geometry_array; 00117 domInstance_light_Array elemInstance_light_array; 00122 domInstance_node_Array elemInstance_node_array; 00127 domNode_Array elemNode_array; 00131 domExtra_Array elemExtra_array; 00135 daeElementRefArray _contents; 00139 daeUIntArray _contentsOrder; 00140 00144 daeTArray< daeCharArray * > _CMData; 00145 00146 00147 public: //Accessors and Mutators 00152 xsID getId() const { return attrId; } 00157 void setId( xsID atId ) { *(daeStringRef*)&attrId = atId; _validAttributeArray[0] = true; 00158 if( _document != NULL ) _document->changeElementID( this, attrId ); 00159 } 00160 00165 xsNCName getName() const { return attrName; } 00170 void setName( xsNCName atName ) { *(daeStringRef*)&attrName = atName; _validAttributeArray[1] = true; } 00171 00176 xsNCName getSid() const { return attrSid; } 00181 void setSid( xsNCName atSid ) { *(daeStringRef*)&attrSid = atSid; _validAttributeArray[2] = true; } 00182 00187 domNodeType getType() const { return attrType; } 00192 void setType( domNodeType atType ) { attrType = atType; _validAttributeArray[3] = true; } 00193 00198 domListOfNames &getLayer() { return attrLayer; } 00203 const domListOfNames &getLayer() const { return attrLayer; } 00208 void setLayer( const domListOfNames &atLayer ) { attrLayer = atLayer; _validAttributeArray[4] = true; } 00209 00214 const domAssetRef getAsset() const { return elemAsset; } 00219 domLookat_Array &getLookat_array() { return elemLookat_array; } 00224 const domLookat_Array &getLookat_array() const { return elemLookat_array; } 00229 domMatrix_Array &getMatrix_array() { return elemMatrix_array; } 00234 const domMatrix_Array &getMatrix_array() const { return elemMatrix_array; } 00239 domRotate_Array &getRotate_array() { return elemRotate_array; } 00244 const domRotate_Array &getRotate_array() const { return elemRotate_array; } 00249 domScale_Array &getScale_array() { return elemScale_array; } 00254 const domScale_Array &getScale_array() const { return elemScale_array; } 00259 domSkew_Array &getSkew_array() { return elemSkew_array; } 00264 const domSkew_Array &getSkew_array() const { return elemSkew_array; } 00269 domTranslate_Array &getTranslate_array() { return elemTranslate_array; } 00274 const domTranslate_Array &getTranslate_array() const { return elemTranslate_array; } 00279 domInstance_camera_Array &getInstance_camera_array() { return elemInstance_camera_array; } 00284 const domInstance_camera_Array &getInstance_camera_array() const { return elemInstance_camera_array; } 00289 domInstance_controller_Array &getInstance_controller_array() { return elemInstance_controller_array; } 00294 const domInstance_controller_Array &getInstance_controller_array() const { return elemInstance_controller_array; } 00299 domInstance_geometry_Array &getInstance_geometry_array() { return elemInstance_geometry_array; } 00304 const domInstance_geometry_Array &getInstance_geometry_array() const { return elemInstance_geometry_array; } 00309 domInstance_light_Array &getInstance_light_array() { return elemInstance_light_array; } 00314 const domInstance_light_Array &getInstance_light_array() const { return elemInstance_light_array; } 00319 domInstance_node_Array &getInstance_node_array() { return elemInstance_node_array; } 00324 const domInstance_node_Array &getInstance_node_array() const { return elemInstance_node_array; } 00329 domNode_Array &getNode_array() { return elemNode_array; } 00334 const domNode_Array &getNode_array() const { return elemNode_array; } 00339 domExtra_Array &getExtra_array() { return elemExtra_array; } 00344 const domExtra_Array &getExtra_array() const { return elemExtra_array; } 00349 daeElementRefArray &getContents() { return _contents; } 00354 const daeElementRefArray &getContents() const { return _contents; } 00355 00356 protected: 00360 domNode(DAE& dae) : daeElement(dae), attrId(), attrName(), attrSid(), attrType(), attrLayer(), elemAsset(), elemLookat_array(), elemMatrix_array(), elemRotate_array(), elemScale_array(), elemSkew_array(), elemTranslate_array(), elemInstance_camera_array(), elemInstance_controller_array(), elemInstance_geometry_array(), elemInstance_light_array(), elemInstance_node_array(), elemNode_array(), elemExtra_array() {} 00364 virtual ~domNode() { daeElement::deleteCMDataArray(_CMData); } 00368 virtual domNode &operator=( const domNode &cpy ) { (void)cpy; return *this; } 00369 00370 public: // STATIC METHODS 00375 static DLLSPEC daeElementRef create(DAE& dae); 00381 static DLLSPEC daeMetaElement* registerElement(DAE& dae); 00382 }; 00383 00384 00385 #endif