//-----------------------------------------------------------------------------
#ifndef PropTreeH
#define PropTreeH PropTreeH
//-----------------------------------------------------------------------------
#include <mvIMPACT_CPP/mvIMPACT_acquire.h>
#include <map>
#include <wxPropGrid/Include/propgrid.h>

class PropData;
class VectorPropertyObject;

typedef std::map<mvIMPACT::acquire::HOBJ, PropData*> CompToDataMap;
typedef std::pair<mvIMPACT::acquire::HOBJ, PropData*> CompDataPair;

//------------------------------------------------------------------------------
class PropTree
//------------------------------------------------------------------------------
{
	friend class VectorPropertyObject;
	mvIMPACT::acquire::ComponentIterator	m_rootList;
	wxPropertyGrid*							m_pPropGrid;
	wxPGId									m_RootProp;
	wxPGId									m_TopLevelProp;
	std::string								m_Title;
	CompToDataMap							m_CompToDataMap; 
	bool									m_boDisplayDebugInfo;
	bool									m_boDisplayInvisibleComponents;

	wxPGId				CreateGridProperty( mvIMPACT::acquire::HOBJ hObj, wxPGId parentProp, int index = -1, bool* boModified = 0, const char* pTitle = 0 );
	void				Delete( void );
	void				UpdateGridPropsRecursively( mvIMPACT::acquire::ComponentIterator iter, wxPGId prop );
	void				UpdateGridPropsRecursively2( wxPGId listRoot );
public:
						PropTree( mvIMPACT::acquire::HOBJ hObj, wxPGId rootProp, const char *pTitle, wxPropertyGrid* pPropGrid, bool boDisplayDebugInfo, bool boDisplayInvisibleComponents );
				       ~PropTree( void );
	int					Draw( void );
	PropData*			GetPropData( mvIMPACT::acquire::HOBJ hObj ) const;
	PropData*			GetPropData( const std::string& name ) const;
	unsigned int		GetChangedCounter( void ) const;
	wxPropertyGrid*		GetPropGrid( void ) { return m_pPropGrid; }
};

#endif // PropTreeH
