#include "define.h"

#include <maya/MObject.h>
#include <vector>

namespace CurveAPI
{
    typedef StringArray MeshArray;
    class CurveBaseAPI
    {
    public:
        CurveBaseAPI();
        virtual ~CurveBaseAPI() = 0;
        virtual MObjectArray GetMeshFromIndex(int index) = 0;
        virtual IntArray GetIndexesFromMesh(MObject &mesh) = 0;
        virtual MObjectArray GetBaseMesh() = 0;
        virtual MStatus GetRootPoints(MPointArray &) = 0;
        virtual MStatus GetRootNormals(MVectorArray &) = 0;
        virtual int GetSegment();
        virtual int Count();
        MObject &GetNode() { return m_node; };
        MDagPath &GetDagPath();
        void Set(MObject &node) { m_node = node; };
        bool IsRenderable();

    private:
        MObject m_node;
    };

    class HairCurveAPI : public CurveBaseAPI
    {
    public:
        HairCurveAPI(MObject &pfxNode);
        HairCurveAPI(MString name);
        ~HairCurveAPI();
        MObjectArray GetMeshFromIndex(int index) override;
        MStatus GetRootPoints(MPointArray &rootPoints) override;
        MStatus GetRootNormals(MVectorArray &rootNormals) override;
        MObject GetHairSystem();

    private:
        MObject m_node;
    };

    class XGenIGSCurveAPI : public CurveBaseAPI
    {
    public:
        XGenIGSCurveAPI(MObject &node);
        XGenIGSCurveAPI(MString name);
        ~XGenIGSCurveAPI();

        MStatus GetRootPoints(MPointArray &rootPoints) override;
        MStatus GetRootNormals(MVectorArray &rootNormals) override;

    private:
        MObject m_node;
    };

    class YetiCurveAPI : public CurveBaseAPI
    {
    public:
        YetiCurveAPI(MObject &node);
        YetiCurveAPI(MString name);
        ~YetiCurveAPI();
        MStatus GetRootPoints(MPointArray &rootPoints) override;

    private:
        MObject m_node;
    };
}
