// Copyright (c)1999 MetaCreations All Rights Reserved.

//   Modifier Extension : BARYCENTER
//------------------------------
//   Implementation of the BARYCENTER Interface
//////////////////////////////////////////////////////////////////////// 


#include "weight.h"
#include "MCCountedPtrHelper.h"
#include "COMUtilities.h"
#include "BasicModifiers.h"  

const MCGUID CLSID_ExWeight(R_CLSID_ExWeight);
const MCGUID IID_ExWeight(R_IID_ExWeight);


void* Weight::GetExtensionDataBuffer()
{
	return &fData;
}

real Weight::GetWeight()
{
	return fData.fWeight;
}



// Constructor / Destructor of the C++ Object :
Weight::Weight()
{
	fData.fWeight=1.0f;
}

MCCOMErr Weight::ExtensionDataChanged()
{
	return MC_S_OK;
}


MCCOMErr Weight::QueryInterface(const MCIID& riid, void** ppvObj)
{
	if (MCIsEqualIID(riid, IID_I3DExDataComponent))
	{
		TMCCountedGetHelper<I3DExDataComponent> result(ppvObj);
		result = this;
		return MC_S_OK;
	}

	if (MCIsEqualIID(riid, CLSID_ExWeight))
	{
		TMCCountedGetHelper<Weight> result(ppvObj);
		result = this;
		return MC_S_OK;
	}
	return TBasicDataExchanger::QueryInterface(riid, ppvObj);
}

