/****************************************************************************************************

		InstancePath.h
		Copyright: (c) 2001 Eovia Corp. All rights reserved.

		Author:	Charles
		Date:	8/16/2002

****************************************************************************************************/

#ifndef __InstancePath__
#define __InstancePath__

#if CP_PRAGMA_ONCE
#pragma once
#endif

#include "MCSMPCountedObject.h"
#include "MCPtrArray.h"

struct I3DShInstance;

/// \addtogroup Data
/// \{

/// Instance Path is used to store the list of Master Groups in which a given Instance is located.  This is used to 
/// calculate transforms in global coordinates, etc.  
///
class TInstancePath : public TMCSMPCountedObject
{
protected:
	// protected constructor, use static Create instead
	TInstancePath(const TInstancePath* instancePath,I3DShInstance* instance);
	~TInstancePath();
public:
	static void Create(TInstancePath** newInstancePath,const TInstancePath* instancePath,I3DShInstance* instance);

	inline I3DShInstance*	GetSceneInstance(int32 i) const		{ return fInstanceList[i]; }
	inline int32			GetLength() const					{ return fInstanceList.GetElemCount(); }

	boolean Contains(const I3DShInstance* sceneInstance) const;

	static boolean AreEqual(TInstancePath* path1,TInstancePath* path2);
protected:
	TMCPtrArray<I3DShInstance>	fInstanceList;
};
/// \}


#endif
