#ifndef __ATOM_ANIM_LAYERS_H
#define __ATOM_ANIM_LAYERS_H
#include <set>
#include <string>
#include <maya/MPlug.h>
#include <maya/MPlugArray.h>
#include <maya/MString.h>
#include <maya/MTime.h>
#include <maya/MStringArray.h>
#include <maya/MObjectArray.h>
#include <maya/MSelectionList.h>
#include <maya/MAnimCurveClipboardItemArray.h>
#include <maya/MStatus.h>
#include "atomFileUtils.h"
class atomAnimLayers
{
public:
atomAnimLayers(){}
~atomAnimLayers(){}
void writeAnimLayers(ofstream &animFile, atomWriter &writer);
bool readAnimLayers(ifstream &readAnim, char *dataType,atomReader &reader);
unsigned int length(){return mAnimLayers.length();}
bool getOrderedAnimLayers();
void createMissingAnimLayers(
const MStringArray &animLayers);
void createAnimLayer(
const MString &layerName,
const MString &prevLayerName);
void addAnimLayersToSelection();
void removeLayersIfNeeded(
bool replaceLayers,
const MString &nodeName,
const MString &leafAttributeName);
void deleteEmptyLayers(bool replaceLayers);
static bool isAttrInAnimLayer(
const MString &nodeName,
const MString &attrName,
const MString &layerName);
static bool addAttrToAnimLayer(
const MString &nodeName,
const MString &attrName,
const MString &layerName);
private:
std::set<std::string> mAttrsRemovedFromAnimLayers;
std::set<std::string> mLayersWithRemovedAttrs;
};
class atomNodeWithAnimLayers
{
public:
atomNodeWithAnimLayers(){};
~atomNodeWithAnimLayers(){fAttrLayers.clear();}
bool isNodeLayered(std::set<std::string> &layerNames);
private:
struct PlugsAndLayers
{
~PlugsAndLayers() {}
};
typedef std::map< std::string, PlugsAndLayers > AttrLayersMap;
AttrLayersMap fAttrLayers;
};
class atomLayerClipboard
{
public:
atomLayerClipboard(){};
~atomLayerClipboard();
float startUnitless,
float endUnitless,
const MString &pasteFlags);
private:
float startUnitless,
float endUnitless,
const MString &pasteFlags,
typedef std::map< std::string, MAnimCurveClipboardItemArray* > ArrayMap;
ArrayMap fArray;
};
#endif