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 __domGles_texture_pipeline_h__
     10 #define __domGles_texture_pipeline_h__
     11 
     12 #include <dae/daeDocument.h>
     13 #include <dom/domTypes.h>
     14 #include <dom/domElements.h>
     15 
     16 #include <dom/domExtra.h>
     17 #include <dom/domGles_texcombiner_command_type.h>
     18 #include <dom/domGles_texenv_command_type.h>
     19 class DAE;
     20 
     21 /**
     22  * Defines a set of texturing commands that will be converted into multitexturing
     23  * operations using glTexEnv in regular and combiner mode.
     24  */
     25 class domGles_texture_pipeline_complexType
     26 {
     27 protected:  // Attribute
     28 /**
     29  *  The sid attribute is a text string value containing the sub-identifier
     30  * of this element.  This value must be unique within the scope of the parent
     31  * element. Optional attribute.
     32  */
     33 	xsNCName attrSid;
     34 
     35 protected:  // Elements
     36 /**
     37  * Defines a texture_pipeline command. This is a combiner-mode texturing operation.
     38  * @see domTexcombiner
     39  */
     40 	domGles_texcombiner_command_type_Array elemTexcombiner_array;
     41 /**
     42  * Defines a texture_pipeline command. It is a simple noncombiner mode of
     43  * texturing operations. @see domTexenv
     44  */
     45 	domGles_texenv_command_type_Array elemTexenv_array;
     46 /**
     47  *  The extra element may appear any number of times. OpenGL ES extensions
     48  * may be used here.  @see domExtra
     49  */
     50 	domExtra_Array elemExtra_array;
     51 	/**
     52 	 * Used to preserve order in elements that do not specify strict sequencing of sub-elements.
     53 	 */
     54 	daeElementRefArray _contents;
     55 	/**
     56 	 * Used to preserve order in elements that have a complex content model.
     57 	 */
     58 	daeUIntArray       _contentsOrder;
     59 
     60 	/**
     61 	 * Used to store information needed for some content model objects.
     62 	 */
     63 	daeTArray< daeCharArray * > _CMData;
     64 
     65 
     66 public:	//Accessors and Mutators
     67 	/**
     68 	 * Gets the sid attribute.
     69 	 * @return Returns a xsNCName of the sid attribute.
     70 	 */
     71 	xsNCName getSid() const { return attrSid; }
     72 	/**
     73 	 * Sets the sid attribute.
     74 	 * @param atSid The new value for the sid attribute.
     75 	 */
     76 	void setSid( xsNCName atSid ) { *(daeStringRef*)&attrSid = atSid;}
     77 
     78 	/**
     79 	 * Gets the texcombiner element array.
     80 	 * @return Returns a reference to the array of texcombiner elements.
     81 	 */
     82 	domGles_texcombiner_command_type_Array &getTexcombiner_array() { return elemTexcombiner_array; }
     83 	/**
     84 	 * Gets the texcombiner element array.
     85 	 * @return Returns a constant reference to the array of texcombiner elements.
     86 	 */
     87 	const domGles_texcombiner_command_type_Array &getTexcombiner_array() const { return elemTexcombiner_array; }
     88 	/**
     89 	 * Gets the texenv element array.
     90 	 * @return Returns a reference to the array of texenv elements.
     91 	 */
     92 	domGles_texenv_command_type_Array &getTexenv_array() { return elemTexenv_array; }
     93 	/**
     94 	 * Gets the texenv element array.
     95 	 * @return Returns a constant reference to the array of texenv elements.
     96 	 */
     97 	const domGles_texenv_command_type_Array &getTexenv_array() const { return elemTexenv_array; }
     98 	/**
     99 	 * Gets the extra element array.
    100 	 * @return Returns a reference to the array of extra elements.
    101 	 */
    102 	domExtra_Array &getExtra_array() { return elemExtra_array; }
    103 	/**
    104 	 * Gets the extra element array.
    105 	 * @return Returns a constant reference to the array of extra elements.
    106 	 */
    107 	const domExtra_Array &getExtra_array() const { return elemExtra_array; }
    108 	/**
    109 	 * Gets the _contents array.
    110 	 * @return Returns a reference to the _contents element array.
    111 	 */
    112 	daeElementRefArray &getContents() { return _contents; }
    113 	/**
    114 	 * Gets the _contents array.
    115 	 * @return Returns a constant reference to the _contents element array.
    116 	 */
    117 	const daeElementRefArray &getContents() const { return _contents; }
    118 
    119 protected:
    120 	/**
    121 	 * Constructor
    122 	 */
    123 	domGles_texture_pipeline_complexType(DAE& dae, daeElement* elt) : attrSid(), elemTexcombiner_array(), elemTexenv_array(), elemExtra_array() {}
    124 	/**
    125 	 * Destructor
    126 	 */
    127 	virtual ~domGles_texture_pipeline_complexType() { daeElement::deleteCMDataArray(_CMData); }
    128 	/**
    129 	 * Overloaded assignment operator
    130 	 */
    131 	virtual domGles_texture_pipeline_complexType &operator=( const domGles_texture_pipeline_complexType &cpy ) { (void)cpy; return *this; }
    132 };
    133 
    134 /**
    135  * An element of type domGles_texture_pipeline_complexType.
    136  */
    137 class domGles_texture_pipeline : public daeElement, public domGles_texture_pipeline_complexType
    138 {
    139 public:
    140 	virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::GLES_TEXTURE_PIPELINE; }
    141 	static daeInt ID() { return 152; }
    142 	virtual daeInt typeID() const { return ID(); }
    143 
    144 public:	//Accessors and Mutators
    145 	/**
    146 	 * Gets the sid attribute.
    147 	 * @return Returns a xsNCName of the sid attribute.
    148 	 */
    149 	xsNCName getSid() const { return attrSid; }
    150 	/**
    151 	 * Sets the sid attribute.
    152 	 * @param atSid The new value for the sid attribute.
    153 	 */
    154 	void setSid( xsNCName atSid ) { *(daeStringRef*)&attrSid = atSid; _validAttributeArray[0] = true; }
    155 
    156 protected:
    157 	/**
    158 	 * Constructor
    159 	 */
    160 	domGles_texture_pipeline(DAE& dae) : daeElement(dae), domGles_texture_pipeline_complexType(dae, this) {}
    161 	/**
    162 	 * Destructor
    163 	 */
    164 	virtual ~domGles_texture_pipeline() {}
    165 	/**
    166 	 * Overloaded assignment operator
    167 	 */
    168 	virtual domGles_texture_pipeline &operator=( const domGles_texture_pipeline &cpy ) { (void)cpy; return *this; }
    169 
    170 public: // STATIC METHODS
    171 	/**
    172 	 * Creates an instance of this class and returns a daeElementRef referencing it.
    173 	 * @return a daeElementRef referencing an instance of this object.
    174 	 */
    175 	static DLLSPEC daeElementRef create(DAE& dae);
    176 	/**
    177 	 * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
    178 	 * If a daeMetaElement already exists it will return that instead of creating a new one.
    179 	 * @return A daeMetaElement describing this COLLADA element.
    180 	 */
    181 	static DLLSPEC daeMetaElement* registerElement(DAE& dae);
    182 };
    183 
    184 
    185 #endif
    186