
/***************************************************************************
*                                                                          *
*  Copyright (C) Golaem S.A.  All Rights Reserved.                         *
*                                                                          *
***************************************************************************/
#pragma once
#if defined(GLM_EXPORT_ALEMBIC)

#include <glmString.h>
#include <glmArray.h>
#include "glmMap.h"

#include "glmCrowdIOAPI.h"

#include "glmCrowdAlembicPolymesh.h"
#include "glmCrowdAlembicFurCurves.h"

namespace glm
{
	namespace crowdio
	{
		class GLM_CROWDIO_API AlembicCharacter
		{
		public:
			AlembicCharacter(const GlmString&);

			virtual ~AlembicCharacter();

			//************************************************************
			/*! @name Accessors
			*/ //*********************************************************
			//@{

			/**
			* \brief Returns the name of the Character
			*/
			const GlmString& getName() const;

			/**
			* \brief Returns the number of polymeshes
			*/
			const size_t getNbPolymeshes() const;

			/**
			* \brief Returns the number of polymeshes
			*/
			const size_t getNbFurCurves() const;

			/**
			* \brief Creates or get existing AlembicPolymesh
			* \param meshName The name of the mesh
			* \param shadingGroupNames The name of the shader groups of the mesh
			* \param userDataNames The name of the userdata of the mesh
			* \param nbVertices The number of vertices
			* \param nbIndices The number of indices
			* \param nbPolygons The number of polygons
			*
			*/
			AlembicPolymesh* createPolymesh(const GlmString& fullPathName, const GlmString& shadingGroupNames,
				const Array<GlmString>& floatUserDataNames, const Array<GlmString>& vectorUserDataNames,
				unsigned int nbVertices, unsigned int nbIndices, 
				unsigned int nbNormalIndices, bool normalsPerControlPoint, 
				unsigned int nbUVIndices, bool uvsPerControlPoint, 
				unsigned int nbPolygons, unsigned int nbNormals, unsigned int nbUVs);
			//@}

			AlembicFurCurves* getFurCurves(const GlmString& fullPathName);
			AlembicFurCurves* createFurCurves(const GlmString& fullPathName, const GlmString& shadingGroupNames,
				const Array<GlmString>& floatUserDataNames, const Array<GlmString>& vectorUserDataNames,
				unsigned int curveCount, uint32_t* verticesPerCurve, uint8_t degree);
			//@}

			//************************************************************
			/*! @name Data Members
			*/ //*********************************************************
			//@{

			/// The map of Alembic polymeshes
			glm::GlmMap<GlmString, AlembicPolymesh*> _polymeshes;
			glm::GlmMap<GlmString, AlembicFurCurves*> _furCurves;
			glm::PODArray<bool> _visibilitySamples;

			/// The name of the Character
			GlmString _name;
			//@}
		};
	}
}

#endif // GLM_EXPORT_ALEMBIC
