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 __domTechnique_h__
     10 #define __domTechnique_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 technique element declares the information used to process some portion
     20  * of the content. Each  technique conforms to an associated profile. Techniques
     21  * generally act as a switch. If more than  one is present for a particular
     22  * portion of content, on import, one or the other is picked, but  usually
     23  * not both. Selection should be based on which profile the importing application
     24  * can support. Techniques contain application data and programs, making them
     25  * assets that can be managed as a unit.
     26  */
     27 class domTechnique : public daeElement
     28 {
     29 public:
     30 	virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::TECHNIQUE; }
     31 	static daeInt ID() { return 680; }
     32 	virtual daeInt typeID() const { return ID(); }
     33 protected:  // Attribute
     34 	/**
     35 	 * This element may specify its own xmlns.
     36 	 */
     37 	xsAnyURI attrXmlns;
     38 /**
     39  *  The profile attribute indicates the type of profile. This is a vendor
     40  * defined character  string that indicates the platform or capability target
     41  * for the technique. Required attribute.
     42  */
     43 	xsNMTOKEN attrProfile;
     44 
     45 protected:  // Element
     46 	/**
     47 	 * Used to preserve order in elements that do not specify strict sequencing of sub-elements.
     48 	 */
     49 	daeElementRefArray _contents;
     50 	/**
     51 	 * Used to preserve order in elements that have a complex content model.
     52 	 */
     53 	daeUIntArray       _contentsOrder;
     54 
     55 
     56 public:	//Accessors and Mutators
     57 	/**
     58 	 * Gets the xmlns attribute.
     59 	 * @return Returns a xsAnyURI reference of the xmlns attribute.
     60 	 */
     61 	xsAnyURI &getXmlns() { return attrXmlns; }
     62 	/**
     63 	 * Gets the xmlns attribute.
     64 	 * @return Returns a constant xsAnyURI reference of the xmlns attribute.
     65 	 */
     66 	const xsAnyURI &getXmlns() const { return attrXmlns; }
     67 	/**
     68 	 * Sets the xmlns attribute.
     69 	 * @param xmlns The new value for the xmlns attribute.
     70 	 */
     71 	void setXmlns( const xsAnyURI &xmlns ) { attrXmlns = xmlns;
     72 	 _validAttributeArray[0] = true; }
     73 
     74 	/**
     75 	 * Gets the profile attribute.
     76 	 * @return Returns a xsNMTOKEN of the profile attribute.
     77 	 */
     78 	xsNMTOKEN getProfile() const { return attrProfile; }
     79 	/**
     80 	 * Sets the profile attribute.
     81 	 * @param atProfile The new value for the profile attribute.
     82 	 */
     83 	void setProfile( xsNMTOKEN atProfile ) { *(daeStringRef*)&attrProfile = atProfile; _validAttributeArray[1] = true; }
     84 
     85 	/**
     86 	 * Gets the _contents array.
     87 	 * @return Returns a reference to the _contents element array.
     88 	 */
     89 	daeElementRefArray &getContents() { return _contents; }
     90 	/**
     91 	 * Gets the _contents array.
     92 	 * @return Returns a constant reference to the _contents element array.
     93 	 */
     94 	const daeElementRefArray &getContents() const { return _contents; }
     95 
     96 protected:
     97 	/**
     98 	 * Constructor
     99 	 */
    100 	domTechnique(DAE& dae) : daeElement(dae), attrXmlns(dae, *this), attrProfile() {}
    101 	/**
    102 	 * Destructor
    103 	 */
    104 	virtual ~domTechnique() {}
    105 	/**
    106 	 * Overloaded assignment operator
    107 	 */
    108 	virtual domTechnique &operator=( const domTechnique &cpy ) { (void)cpy; return *this; }
    109 
    110 public: // STATIC METHODS
    111 	/**
    112 	 * Creates an instance of this class and returns a daeElementRef referencing it.
    113 	 * @return a daeElementRef referencing an instance of this object.
    114 	 */
    115 	static DLLSPEC daeElementRef create(DAE& dae);
    116 	/**
    117 	 * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
    118 	 * If a daeMetaElement already exists it will return that instead of creating a new one.
    119 	 * @return A daeMetaElement describing this COLLADA element.
    120 	 */
    121 	static DLLSPEC daeMetaElement* registerElement(DAE& dae);
    122 };
    123 
    124 
    125 #endif
    126