Home | History | Annotate | Download | only in dom
      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 #ifndef __domFx_include_common_h__
     10 #define __domFx_include_common_h__
     11 
     12 #include <dae/daeDocument.h>
     13 #include <dom/domTypes.h>
     14 #include <dom/domElements.h>
     15 
     16 class DAE;
     17 
     18 /**
     19  * The include element is used to import source code or precompiled binary
     20  * shaders into the FX Runtime by referencing an external resource.
     21  */
     22 class domFx_include_common_complexType
     23 {
     24 protected:  // Attributes
     25 /**
     26  *  The sid attribute is a text string value containing the sub-identifier
     27  * of this element.  This value must be unique within the scope of the parent
     28  * element. Optional attribute.
     29  */
     30 	xsNCName attrSid;
     31 /**
     32  *  The url attribute refers to resource.  This may refer to a local resource
     33  * using a relative URL  fragment identifier that begins with the #
     34  * character. The url attribute may refer to an external  resource using an
     35  * absolute or relative URL.
     36  */
     37 	xsAnyURI attrUrl;
     38 
     39 
     40 public:	//Accessors and Mutators
     41 	/**
     42 	 * Gets the sid attribute.
     43 	 * @return Returns a xsNCName of the sid attribute.
     44 	 */
     45 	xsNCName getSid() const { return attrSid; }
     46 	/**
     47 	 * Sets the sid attribute.
     48 	 * @param atSid The new value for the sid attribute.
     49 	 */
     50 	void setSid( xsNCName atSid ) { *(daeStringRef*)&attrSid = atSid;}
     51 
     52 	/**
     53 	 * Gets the url attribute.
     54 	 * @return Returns a xsAnyURI reference of the url attribute.
     55 	 */
     56 	xsAnyURI &getUrl() { return attrUrl; }
     57 	/**
     58 	 * Gets the url attribute.
     59 	 * @return Returns a constant xsAnyURI reference of the url attribute.
     60 	 */
     61 	const xsAnyURI &getUrl() const { return attrUrl; }
     62 	/**
     63 	 * Sets the url attribute.
     64 	 * @param atUrl The new value for the url attribute.
     65 	 */
     66 	void setUrl( const xsAnyURI &atUrl ) { attrUrl = atUrl; }
     67 	/**
     68 	 * Sets the url attribute.
     69 	 * @param atUrl The new value for the url attribute.
     70 	 */
     71 	void setUrl( xsString atUrl ) { attrUrl = atUrl; }
     72 
     73 protected:
     74 	/**
     75 	 * Constructor
     76 	 */
     77 	domFx_include_common_complexType(DAE& dae, daeElement* elt) : attrSid(), attrUrl(dae, *elt) {}
     78 	/**
     79 	 * Destructor
     80 	 */
     81 	virtual ~domFx_include_common_complexType() {}
     82 	/**
     83 	 * Overloaded assignment operator
     84 	 */
     85 	virtual domFx_include_common_complexType &operator=( const domFx_include_common_complexType &cpy ) { (void)cpy; return *this; }
     86 };
     87 
     88 /**
     89  * An element of type domFx_include_common_complexType.
     90  */
     91 class domFx_include_common : public daeElement, public domFx_include_common_complexType
     92 {
     93 public:
     94 	virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::FX_INCLUDE_COMMON; }
     95 	static daeInt ID() { return 92; }
     96 	virtual daeInt typeID() const { return ID(); }
     97 
     98 public:	//Accessors and Mutators
     99 	/**
    100 	 * Gets the sid attribute.
    101 	 * @return Returns a xsNCName of the sid attribute.
    102 	 */
    103 	xsNCName getSid() const { return attrSid; }
    104 	/**
    105 	 * Sets the sid attribute.
    106 	 * @param atSid The new value for the sid attribute.
    107 	 */
    108 	void setSid( xsNCName atSid ) { *(daeStringRef*)&attrSid = atSid; _validAttributeArray[0] = true; }
    109 
    110 	/**
    111 	 * Gets the url attribute.
    112 	 * @return Returns a xsAnyURI reference of the url attribute.
    113 	 */
    114 	xsAnyURI &getUrl() { return attrUrl; }
    115 	/**
    116 	 * Gets the url attribute.
    117 	 * @return Returns a constant xsAnyURI reference of the url attribute.
    118 	 */
    119 	const xsAnyURI &getUrl() const { return attrUrl; }
    120 	/**
    121 	 * Sets the url attribute.
    122 	 * @param atUrl The new value for the url attribute.
    123 	 */
    124 	void setUrl( const xsAnyURI &atUrl ) { attrUrl = atUrl; _validAttributeArray[1] = true; }
    125 	/**
    126 	 * Sets the url attribute.
    127 	 * @param atUrl The new value for the url attribute.
    128 	 */
    129 	void setUrl( xsString atUrl ) { attrUrl = atUrl; _validAttributeArray[1] = true; }
    130 
    131 protected:
    132 	/**
    133 	 * Constructor
    134 	 */
    135 	domFx_include_common(DAE& dae) : daeElement(dae), domFx_include_common_complexType(dae, this) {}
    136 	/**
    137 	 * Destructor
    138 	 */
    139 	virtual ~domFx_include_common() {}
    140 	/**
    141 	 * Overloaded assignment operator
    142 	 */
    143 	virtual domFx_include_common &operator=( const domFx_include_common &cpy ) { (void)cpy; return *this; }
    144 
    145 public: // STATIC METHODS
    146 	/**
    147 	 * Creates an instance of this class and returns a daeElementRef referencing it.
    148 	 * @return a daeElementRef referencing an instance of this object.
    149 	 */
    150 	static DLLSPEC daeElementRef create(DAE& dae);
    151 	/**
    152 	 * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
    153 	 * If a daeMetaElement already exists it will return that instead of creating a new one.
    154 	 * @return A daeMetaElement describing this COLLADA element.
    155 	 */
    156 	static DLLSPEC daeMetaElement* registerElement(DAE& dae);
    157 };
    158 
    159 
    160 #endif
    161