#include "define.h"

#include <string>
#include <maya/MStringArray.h>
#include <maya/MObject.h>
#include <maya/MObjectArray.h>
#include <maya/MPointArray.h>
#include <maya/MVectorArray.h>
#include <maya/MIntArray.h>
#include <maya/MFnDagNode.h>
#include <maya/MFnDependencyNode.h>

class PfxHairHelper
{
public:
    PfxHairHelper();
    PfxHairHelper(MObject &pfxHair);
    PfxHairHelper(string pfxHair);
    ~PfxHairHelper();
    MObject GetPfxHairNode() { return m_pfxHair; };
    MObjectArray GetHairBaseMesh();
    IndexArrayMap GetMeshHairIndexMap();
    MStatus GetMeshFromHairIndex(int hairIndex, MObject &hairMesh);
    MStatus GetMeshFromHairIndex(int hairIndex, MString &hairmesh);
    MStatus GetHairIndexesFromMesh(MIntArray &indexes, MObject &mesh);
    MRenderLineArray GetHairData(MStatus *status = nullptr);
    void GetHairRootPoints(PointArrayMap &rootPointArrayMap);
    void GetHairRootPointsAndNormals(MPointArray &pointArray, MVectorArray &vectorArray, bool debug = false);
    MIntArray GetHairBaseSegement(MStatus *status = nullptr);
    int GetHairCount();
    int GetHairIndexFromCurveId(int curveId, MStatus *status);
    void GetHairLinesFromMesh(MObject &hairMesh, VectorArrayMap &hairArrayMap);
    int GetHairsPerClump();
    bool IsRenderable();
    MObject &Get() { return m_pfxHair; };
    MObject GetHairSystem();

private:
    MObject m_pfxHair;
    MObject m_hairSystem;
    MObjectArray m_pfxHairs;
};
