Пример #1
0
nuiRect nuiFlowView::CalcIdealSize()
{
  if (mCurrentIdealWidth == 0)
  {
    if (GetObjectName() == "Grid")
    {
      NGL_OUT("Flow Layout %p '%s'\n", this, GetObjectName().GetChars());
    }
  }
  if (mIdealWidth > 0)
  {
    mCurrentIdealWidth = mIdealWidth;
  }
  else if (mRect.GetWidth() > 0)
  {
    mCurrentIdealWidth = mRect.GetWidth();
  }
  nuiRect idealsize = Layout(false, mCurrentIdealWidth);

  if (GetDebug())
  {
    NGL_OUT(_T("nuiFlowView::CalcIdealSize[%f]: %s\n"), mCurrentIdealWidth, idealsize.GetValue().GetChars());
  }

  return idealsize;
}
Пример #2
0
void CClassData::UpdateObjectDataTicks(LTObject* pObj, uint32 nTicksThisUpdate)
{
	if (!pObj) return;

	// Get the object's name...

	char szName[64] = {0};
	GetObjectName(pObj, szName, sizeof(szName));


	// Find the object data associated with this object...

	CObjectTickData* pObjectTickData = FindObjectTickData(szName);


	// Add a new object tick data if necessary...

	if (!pObjectTickData)
	{
		pObjectTickData = new CObjectTickData;
		LTStrCpy(pObjectTickData->m_ObjectName, szName, sizeof(pObjectTickData->m_ObjectName));

		m_ObjectTickDataList.push_back(pObjectTickData);
	}

	// Set the number of ticks this object ate this update...

	if (!pObjectTickData->m_bUpdatedData)
	{
		pObjectTickData->m_nTicksThisUpdate = nTicksThisUpdate;
		pObjectTickData->m_bUpdatedData = LTTRUE;
	}
}
Пример #3
0
HRESULT Kernel::GetDispatcherInfo(ULONG32 ObjectAddress)
{
	DISPATCHER_HEADER WaitObject;
	HRESULT hr = g_ExtData2->ReadVirtual(SIGN_EXTEND(ObjectAddress), &WaitObject, sizeof(WaitObject), NULL);


	printf("        Obj %08x Type %d Size %d SignalState %d \n", 
				ObjectAddress,
				WaitObject.Type,
				WaitObject.Size,
				WaitObject.SignalState);

	ULONG32 handle = 0;
	hr = GetHandleFromObjectAddress(ObjectAddress, _KProcess, handle);

	printf("        Obj Handle 0x%x \n", handle);
	
	wchar_t name[1024];
	name[0] = '\0';
	hr = GetObjectName(SIGN_EXTEND(ObjectAddress),name, 1024);

	wprintf(L"        Obj Name   %s \n\n", name);

	_pCurrentSnapshot->AddObject(SIGN_EXTEND(ObjectAddress), 
								 WaitObject.Type,
								 WaitObject.Size,
								 WaitObject.SignalState, 
								 name);


	return hr;

}
Пример #4
0
MapInfoObject::MapInfoObject(ZCom_Control *_control, unsigned int zoidlevel, const MapInfo & minfo)
{
	#ifndef _ZOID_USED_NEW_VERSION_
		m_node->registerNodeDynamic(m_classid, _control);
	#else
		_control->ZCom_registerDynamicNode( m_node, m_classid );
	#endif

	#ifdef _DEBUG
		LogHandler::getInstance()->LogToFile("New Node " + GetObjectName() + " of name " + minfo.Name);
	#endif


	// only do that on authority
	if(m_node->getRole() == eZCom_RoleAuthority)
	{
		// add announcement data
		ZCom_BitStream *adata = new ZCom_BitStream();
		adata->addString(minfo.Name.c_str());
		adata->addString(minfo.Type.c_str());
		adata->addString(minfo.Music.c_str());
		adata->addSignedInt(minfo.MusicLoop, 16);
		m_node->setAnnounceData(adata);


		// change zoidlevel
		m_node->applyForZoidLevel( zoidlevel );
		//m_node->removeFromZoidLevel( 1 );
	}


}
Пример #5
0
bool CTriangleObj::saveMeshWavefrontObj(const char *fname, const double *matrix)
{
	int i;

	Vector3d *pVertex = new Vector3d[m_nVertexCount];
	assert(pVertex!=NULL);
	for (i=0; i<m_nVertexCount; i++)
		TransformVertex3dToVertex3d(m_pVertex[i], matrix, &pVertex[i].x);

	vector<OglMaterial> mats;

	std::string objname = GetObjectName();
	if (objname.empty()) objname+="defaultname";
	Vector3f *pNormal = m_pVertexNorm;
	if (pNormal==NULL){
		ComputeVertexNormals();
		pNormal = m_pVertexNorm;
		assert(pNormal!=NULL);
	}
	vector<Vector3f> texCoords;
	unsigned int faceMatIndex[2], nFaceMatIndex=0;
	const Vector3i *pTexIndex = NULL;

	const bool r = writeOBJFile(fname, objname,
		mats, 
		pVertex, m_nVertexCount,
		pNormal, m_nVertexCount, texCoords,
		(const Vector3i*)m_pPolygon, m_nPolygonCount, pTexIndex,
		faceMatIndex, nFaceMatIndex);

	delete [] pVertex;
	return r;
}
Пример #6
0
/////////////////////////////////////////////////////////////////
// HRESULT CBase::SetInterface
//
/////////////////////////////////////////////////////////////////
HRESULT CBase::SetInterface(REFIID riid, IUnknown* pIUnknown)
{
	//We need to put the obtained interface in the appropiate member...
	if(pIUnknown)
	{
		//First obtain the correct interface member variable...
		IUnknown** ppInterfaceMember = GetInterfaceAddress(riid);
		if(!ppInterfaceMember)
			return E_NOINTERFACE;

		TRACE_RELEASE(*ppInterfaceMember, GetObjectName());
		TRACE_ADDREF(pIUnknown, GetObjectName());
		*ppInterfaceMember = pIUnknown;
	}

	return S_OK;
}
Пример #7
0
bool MongodbUpdateObject::SaveData()
{
    Logger::Debug("MongodbUpdateObject::SaveData");
    SafeRelease(updateObject);
    updateObject = new MongodbObject();
    updateObject->SetObjectName(GetObjectName());
    return MongodbClient::KeyedArchiveToDBObject(updateData, updateObject);
}    
Пример #8
0
/////////////////////////////////////////////////////////////////
// CBase::ObjectAddRef
//
/////////////////////////////////////////////////////////////////
ULONG CBase::ObjectAddRef()
{
	//Record the number of times the user has addref'd this object.
	//So we can know when to correctly NULL out the interface, so they can longer use it...
	AddRef();

	//IUnknown::AddRef
	return TRACE_ADDREF(m_pIUnknown, GetObjectName());
}
Пример #9
0
void CDestructibleModel::CreateWorldModelDebris()
{
    ILTServer* pServerDE = BaseClass::GetServerDE();
	if (!pServerDE) return;

	const char* pName = GetObjectName(m_hObject);
	if (!pName || !pName[0]) return;


	// Find all the debris objects...

	int nNum = 0;

	char strKey[128]; memset(strKey, 0, 128);
	char strNum[18];  memset(strNum, 0, 18);

	HCLASS hWMDebris = pServerDE->GetClass("WorldModelDebris");

	while (1)
	{
		// Create the keyname string...

		sprintf(strKey, "%sDebris%d", pName, nNum);

		// Find any debris with that name...

		ObjArray <HOBJECT, MAX_OBJECT_ARRAY_SIZE> objArray;
		pServerDE->FindNamedObjects(strKey, objArray);

		int numObjects = objArray.NumObjects();
		if (!numObjects) return;

		for (int i = 0; i < numObjects; i++)
		{
			HOBJECT hObject = objArray.GetObject(i);

			if (pServerDE->IsKindOf(pServerDE->GetObjectClass(hObject), hWMDebris))
			{
				WorldModelDebris* pDebris = (WorldModelDebris*)pServerDE->HandleToObject(hObject);
				if (!pDebris) break;

				LTVector vVel, vRotPeriods;
				vVel.Init(GetRandom(-200.0f, 200.0f),
					GetRandom(100.0f, 300.0f), GetRandom(-200.0f, 200.0f));

				vRotPeriods.Init(GetRandom(-1.0f, 1.0f),
					GetRandom(-1.0f, 1.0f), GetRandom(-1.0f, 1.0f));

				pDebris->Start(&vRotPeriods, &vVel);
			}
		}

		// Increment the counter...

		nNum++;
	}
}
Пример #10
0
QString Model::GetShortName()
{
	QString ObjName = GetObjectName();

	int n = ObjName.indexOf(".");
	if(n <= 0)
		return ObjName;
	QString ShortName = ObjName.mid(n + 1);

	return ShortName;
}
Пример #11
0
nuiSpriteDef::~nuiSpriteDef()
{
  for (size_t i = 0; i < mpAnimations.size(); i++)
    delete mpAnimations[i];
  nglString name(GetObjectName());
  //printf("~nuiSpriteDef: %p %s\n", this, name.GetChars());
  
  std::map<nglString, nuiSpriteDef*>::iterator it = mSpriteMap.find(name);
  NGL_ASSERT(it != mSpriteMap.end());
  mSpriteMap.erase(it);
}
Пример #12
0
QString Model::GetModuleName()
{
	QString ObjName = GetObjectName();

	int n = ObjName.indexOf(".");
	if(n <= 0)
		return ObjName;
	QString ModuleName = ObjName.mid(0, n);

	return ModuleName;
}
Пример #13
0
MapInfoObject::MapInfoObject(ZCom_Control *_control)
{
	#ifndef _ZOID_USED_NEW_VERSION_
		m_node->registerNodeDynamic(m_classid, _control);
	#else
		_control->ZCom_registerDynamicNode( m_node, m_classid );
	#endif

	#ifdef _DEBUG
		LogHandler::getInstance()->LogToFile("New Node " + GetObjectName());
	#endif
}
Пример #14
0
/////////////////////////////////////////////////////////////////
// HRESULT CBase::ObjectQI
//
/////////////////////////////////////////////////////////////////
HRESULT CBase::ObjectQI(REFIID riid, IUnknown** ppIUnknown)
{
	HRESULT hr = S_OK;
	
	//IUnknown::QueryInterface
	XTESTC(hr = TRACE_QI(m_pIUnknown, riid, ppIUnknown, GetObjectName()));
	
	//We need to put the obtained interface in the appropiate member...
	if(ppIUnknown && *ppIUnknown)
		hr = SetInterface(riid, *ppIUnknown);
	
CLEANUP:
	return hr;
}
Пример #15
0
/////////////////////////////////////////////////////////////////
// HRESULT CBase::CreateObject
//
/////////////////////////////////////////////////////////////////
HRESULT CBase::CreateObject(CBase* pCSource, REFIID riid, IUnknown* pIUnkObject, DWORD dwCreateOpts)
{
	//No-op...
	if(!pIUnkObject)
		return E_INVALIDARG;
	
	//Use exsiting Connection
	IUnknown* pIUnknown = NULL;

	if(dwCreateOpts	== -1 /*Default*/)
		dwCreateOpts = GetOptions()->m_dwCreateOpts;

	HRESULT hr			= S_OK;

	//Store the Parent Object...
	SAFE_RELEASE(m_pCParent);
	SAFE_ADDREF(pCSource);
	m_pCParent = pCSource;

	//First we QI for IID_IUnknown the object passed in.
	//NOTE: We do this before we call ReleaseObject since the caller of this 
	//method could have passed in our own member variable (m_pIUnknown) to "recreate" the object.
	TRACE_QI(pIUnkObject, IID_IUnknown, &pIUnknown, GetObjectName());
	
	//Release all Previous interfaces...
	ReleaseObject(1);
	
	//[MANDATORY]
	//Used the AddRef'd input as our IUnknown, since all interfaces inherit from IUnknown.
	m_pIUnknown = pIUnknown;

	//Now set the pointer pased into the appropiate interface member
	//NOTE: We already handled IUnknown above...
	if(riid != IID_IUnknown)
		SetInterface(riid, pIUnkObject);

	//Now AutoQI for derived object interfaces...
	AutoQI(dwCreateOpts);
	
	//Add this object to the Objects Window
	m_pCMainWindow->m_pCMDIObjects->m_pCObjTree->AddObject(pCSource, this);
	
//CLEANUP:
	return hr;
}
std::string CXBindingsGenerator::GetRealType( const std::string& typeBase , CXBindingsGeneratorOptions& options )
{
    std::string type = typeBase;
    
	if( boost::algorithm::contains(type,":") )   {
		type = after_first( type, ':' );
	}

	std::string realType = type;
	std::string ns;
	
	if( IsKnownType( type ) ) {
		CXBindingsStringStringMap& types = m_genfile->GetTypeInfo().GetTypes();
		CXBindingsStringStringMap::iterator it = types.find( type );
		
		if( it == types.end() ) {
			return type;
		}

		return it->second;
	}

	if( boost::algorithm::contains(realType,":") )   {
		ns = before_first( realType , ':' );
		realType = after_first( realType, ':' );
	}
	
	//if( ns.empty() )
	//ns = options.ns;

	realType = GetObjectName( realType , options );
	//realType = ns + realType;

	CXBindingsStringStringMap& types = m_genfile->GetTypeInfo().GetTypes();
	types[type] = realType;
	
	//wxLogMessage( type + " - ") + realType  ;

	return realType;
}
Пример #17
0
/////////////////////////////////////////////////////////////////
// CBase::ObjectRelease
//
/////////////////////////////////////////////////////////////////
ULONG CBase::ObjectRelease()
{
	IUnknown* pIUnknown = m_pIUnknown;
	ULONG ulRefCount = 0;

	//IUnknown::Release
	ulRefCount = CIntTrace::TraceRelease(&pIUnknown, GetObjectName());
	
	//We need to disable this interface once it hits zero so
	//its not used incorrectly after the object is released...
	if(ulRefCount == 0 || m_cRef<=1)
	{
		m_pIUnknown = NULL;
		ReleaseObject();
	}
	else
	{
		Release();
	}
	
	return ulRefCount;
}
Пример #18
0
nglString nuiDecoration::GetCSSDeclaration() const
{
    nglString decl;
    decl.Add(_T("@")).Add(GetObjectClass()).Add(_T(" ")).Add(GetObjectName()).AddNewLine().Add(_T("{")).AddNewLine();

    // build attributes list
    std::map<nglString, nuiAttribBase> attributes;
    GetAttributes(attributes);
    uint32 i = 0;
    std::map<nglString, nuiAttribBase>::const_iterator it_a = attributes.begin();
    std::map<nglString, nuiAttribBase>::const_iterator end_a = attributes.end();

    while (it_a != end_a)
    {
        nglString pname(it_a->first);
        if (!ShouldSkipAttrib(pname))
        {

            //printf("\tattr: %ls\n", pname.GetChars());
            nuiAttribBase Base = it_a->second;

            nglString value;
            switch (Base.GetDimension())
            {
            case 0:
                Base.ToString(value);
                break;
            case 1:
            {
                nglString str;
                uint32 count = Base.GetIndexRange(0);
                for (uint32 i = 0; i < count; i++)
                {
                    Base.ToString(i, str);
                    value.Add(i).Add(_T(":")).Add(str).Add("\t");
                }
                value.Trim(_T('\t'));
            }
            break;
            case 2:
            {
                nglString str;
                uint32 counti = Base.GetIndexRange(0);
                uint32 countj = Base.GetIndexRange(1);
                for (uint32 i = 0; i < MIN(10, counti); i++)
                {
                    for (uint32 j = 0; j < MIN(10, countj); j++)
                    {
                        Base.ToString(i, j, str);
                        value.Add(i).Add(",").Add(j).Add(_T(":")).Add(str).Add("\t");
                    }
                }
                value.Trim(_T('\t'));
            }

            }

            if (value.Find(' ') >= 0)
                value = nglString(_T("\"")).Add(value).Add(_T("\""));
            if (value.IsEmpty())
                value = _T("\"\"");
            decl.Add(_T("  ")).Add(Base.GetName()).Add(_T(" : ")).Add(value).Add(_T(";")).AddNewLine();
        }

        ++it_a;
        i++;
    }

    decl.Add(_T("}")).AddNewLine().AddNewLine();
    return decl;
}
Пример #19
0
void CGenPropertyPage::OnAddItem(CDialog & dlg) 
{

  // load dialog with default values
  InitDialog (&dlg);

  // display dialog, exit if cancelled
  if (dlg.DoModal () != IDOK)
    return;

  // create the object's lookup name (label converted to lower case, or generated)
 CObject * pItem;
 CString strObjectName;

  strObjectName = GetObjectName (&dlg);
  if (strObjectName.IsEmpty ())
    strObjectName.Format ("*%s%s",       // e.g. *trigger100
                            (LPCTSTR) m_strObjectType,
                            (LPCTSTR) App.GetUniqueString ());
  else
    strObjectName.MakeLower();

  // if already there (presumably not possible with un-named objects),
  // then abort the add
  if (m_ObjectMap->Lookup (strObjectName, pItem))
    {
    CString strMsg;

    strMsg = TFormat ("The %s named \"%s\" is already in the %s list",
                  (LPCTSTR) m_strObjectType,
                  (LPCTSTR) GetObjectName (&dlg),
                  (LPCTSTR) m_strObjectType);
    ::UMessageBox (strMsg);
    return;
    }

  // add new object to map
  m_ObjectMap->SetAt (strObjectName, pItem = MakeNewObject ());

  // unload from dialog into object's properties
  UnloadDialog (&dlg, pItem);

  // They can no longer cancel the property sheet, the document has changed
  CancelToClose ();
  if (!CheckIfTemporary (pItem))
    m_doc->SetModifiedFlag (TRUE);

  // create a CString for lookup purposes
  CString * pstrObjectName = new CString (strObjectName);

  // add this item to the list view
  add_item (pItem, pstrObjectName, 0, TRUE);

  SetInternalName (pItem, strObjectName);  // set name so we can delete one-shot items

  // resort the list
  t_gen_sort_param sort_param (m_ObjectMap, m_last_col, m_reverse, m_CompareObjects);
  m_ctlList->SortItems (CompareFunc, (LPARAM) &sort_param); 

  // redraw the list
  if (GetFilterFlag ())
    LoadList ();       // full reload because it may have changed filter requirements

// get dispatch id from the script and put it into the item

  if (m_doc->m_ScriptEngine)
    {
    CString strMessage;
    SetDispatchID (pItem, m_doc->GetProcedureDispid (GetScriptName (pItem),
                                                     m_strObjectType, 
                                                     GetLabel (pItem),
                                                     strMessage));
    if (!strMessage.IsEmpty ())
      ::UMessageBox (strMessage, MB_ICONINFORMATION);
    }
  
}    // end of CGenPropertyPage::OnAddItem
Пример #20
0
void CGenPropertyPage::OnChangeItem(CDialog & dlg) 
{
CString strMsg;

// iterate through list in case we implement multiple selection one day
for (int nItem = -1;
      (nItem = m_ctlList->GetNextItem(nItem, LVNI_SELECTED)) != -1;)
  {

  // get the lower-case name of this item's object
  CString * pstrObjectName = (CString *) m_ctlList->GetItemData (nItem);

  ASSERT (pstrObjectName != NULL);

  CObject * pItem;

  // check object is still there (it might have gone while we looked at the list box)
  if (!m_ObjectMap->Lookup (*pstrObjectName, pItem))
    {
    m_ctlList->DeleteItem (nItem);    // it's gone, so delete it from the list view
    m_ctlList->RedrawItems (0, m_ctlList->GetItemCount () - 1);    // redraw the list

    // in the case of one-shot timers, unnamed items might be removed from the list
    if (pstrObjectName->Left (1) == "*")
      strMsg = TFormat ("The %s you selected is no longer in the %s list",
                    (LPCTSTR) m_strObjectType,
                    (LPCTSTR) m_strObjectType);
    else
      strMsg = TFormat ("The %s named \"%s\" is no longer in the %s list",
                    (LPCTSTR) m_strObjectType,
                    (LPCTSTR) *pstrObjectName,
                    (LPCTSTR) m_strObjectType);

    ::UMessageBox (strMsg);

    delete pstrObjectName;                 // and get rid of its name string
    continue;
    }

  ASSERT_VALID (pItem);
  ASSERT( pItem->IsKindOf( RUNTIME_CLASS( CObject ) ) );


  // load dialog with values from the found item
  LoadDialog (&dlg, pItem);

  // put up the dialog, give up if they cancel
  if (dlg.DoModal () != IDOK)
    continue;

  // lookup this object, to make sure it still exists
  if (!m_ObjectMap->Lookup (*pstrObjectName, pItem))
    {
    m_ctlList->DeleteItem (nItem);    // it's gone, so delete it from the list view
    m_ctlList->RedrawItems (0, m_ctlList->GetItemCount () - 1);    // redraw the list
    
    // in the case of one-shot timers, unnamed items might be removed from the list
    if (pstrObjectName->Left (1) == "*")
      strMsg = TFormat ("The %s you selected is no longer in the %s list",
                    (LPCTSTR) m_strObjectType,
                    (LPCTSTR) m_strObjectType);
    else
      strMsg = TFormat ("The %s named \"%s\" is no longer in the %s list",
                    (LPCTSTR) m_strObjectType,
                    (LPCTSTR) *pstrObjectName,
                    (LPCTSTR) m_strObjectType);

    delete pstrObjectName;                 // and get rid of its name string
    ::UMessageBox (strMsg);
    continue;
    }

  ASSERT_VALID (pItem);
  ASSERT( pItem->IsKindOf( RUNTIME_CLASS( CObject ) ) );

  if (CheckIfIncluded (pItem))
    {
    strMsg = TFormat ("The %s named \"%s\" has been included from an include file. You cannot modify it here.",
                  (LPCTSTR) m_strObjectType,
                  (LPCTSTR) *pstrObjectName);
    ::UMessageBox (strMsg);
    return; // can't modify included items
    }

  // check object still has the same modification number
  // (it might have been modified while we looked at the list box)
  if (GetModificationNumber (pItem) != m_nUpdateNumber)
    {
    strMsg = TFormat ("The %s named \"%s\" has already been modified by a script subroutine",
                  (LPCTSTR) m_strObjectType,
                  (LPCTSTR) *pstrObjectName);
    ::UMessageBox (strMsg);
    continue;
    }

  // check for name change 
  CString strObjectName = GetObjectName (&dlg);
  if (strObjectName.IsEmpty ())
    strObjectName.Format ("*%s%s", 
                          (LPCTSTR) m_strObjectType,
                          (LPCTSTR) App.GetUniqueString ());
  else
    strObjectName.MakeLower ();
      
  if (strObjectName != *pstrObjectName)     // has name changed?
    {
    // here if label has changed
    CObject * new_pItem;
    if (m_ObjectMap->Lookup (strObjectName, new_pItem))
      {
      strMsg = TFormat ("The %s named \"%s\" already exists in the %s list",
                    (LPCTSTR) m_strObjectType,
                    (LPCTSTR) strObjectName,
                    (LPCTSTR) m_strObjectType);
      ::UMessageBox (strMsg);
      continue;
      }

    // remove old entry and re-add under new name
    m_ObjectMap->RemoveKey (*pstrObjectName);     // remove old entry
    m_ObjectMap->SetAt (strObjectName, pItem);   // insert under new name

    // delete old name in the list
    delete pstrObjectName;

    // create a new CString for lookup purposes
    pstrObjectName = new CString (strObjectName);

    // record item's new name as the list object data
    m_ctlList->SetItemData(nItem, (DWORD) pstrObjectName);
    }   // end of label changing

  // see if the user changed anything, anyway
  if (CheckIfChanged (&dlg, pItem))
    {

    // unload from dialog into object's properties
    UnloadDialog (&dlg, pItem);

    // They can no longer cancel the property sheet, the document has changed
    CancelToClose ();
    if (!CheckIfTemporary (pItem))
      m_doc->SetModifiedFlag (TRUE);

    // re-setup list with amended details
    int nNewItem = add_item (pItem, pstrObjectName, nItem, FALSE);

    m_ctlList->RedrawItems (nNewItem, nNewItem);

    }   // end of item changing

// Get dispatch id from the script and put it into the item.
// We do this even if nothing has changed, so that we can force re-evaluation
// of the dispatch ID, by just getting the item and pressing OK.

  if (m_doc->m_ScriptEngine)
    {
    CString strMessage;
    SetDispatchID (pItem, m_doc->GetProcedureDispid (GetScriptName (pItem),
                                                     m_strObjectType, 
                                                     GetLabel (pItem),
                                                     strMessage));
    if (!strMessage.IsEmpty ())
      ::UMessageBox (strMessage, MB_ICONINFORMATION);
    }

  }   // end of dealing with each selected item

  // redraw the list
  if (GetFilterFlag ())
    LoadList ();       // full reload because it may have changed filter requirements

  // resort the list
  t_gen_sort_param sort_param (m_ObjectMap, m_last_col, m_reverse, m_CompareObjects);
  m_ctlList->SortItems (CompareFunc, (LPARAM) &sort_param); 

}   // end of CGenPropertyPage::OnChangeItem
Пример #21
0
 //from Animatable
 void GetClassName(TSTR& s) {s = GetObjectName();}		
Пример #22
0
 void InitNodeName(TSTR& s) {s = GetObjectName();}
Пример #23
0
MapInfoObject::~MapInfoObject()
{
	#ifdef _DEBUG
		LogHandler::getInstance()->LogToFile("Deleting node " + GetObjectName());
	#endif
}
Пример #24
0
void UFSDirectory::ListContentToConsole() {
	std::cout << "Contents of: " << GetObjectName() << std::endl;
	for(std::vector<IVFSObject*>::iterator i = contents.begin();i<contents.end();++i){
		std::cout << (*i)->GetObjectName() << std::endl;
	}
}
Пример #25
0
		BOOL XAnimationParser::ParseObject(ID3DXFileData* pDataObj,
											  ID3DXFileData* pParentObj,
											  DWORD Depth,
											  void** Data,
											  BOOL Reference)
		{
		HRESULT hr=0;
		//Gets the GUID to know what is this XFileData object
		GUID* pGuid = GetObjectGUID(pDataObj);

		//if it is an AnimationSet
		if( *pGuid == TID_D3DRMAnimationSet )
			{
			XAnimationSet* pNewAnimationSet = new XAnimationSet();
			pNewAnimationSet->m_Name = GetObjectName(pDataObj);
			pNewAnimationSet->m_Next = m_AnimationSets;//Link this new AnimationSet to the main list
			m_AnimationSets = pNewAnimationSet;
			m_NumOfAnimationSets++;
			}

		//if it is an Animation Data
		if( *pGuid == TID_D3DRMAnimation && m_AnimationSets )
			{
			XAnimation* pNewAnimation = new XAnimation();
			pNewAnimation->m_Next = m_AnimationSets->m_Animations;
			m_AnimationSets->m_Animations = pNewAnimation;//Link this new Animation Data AnimationSet
			m_AnimationSets->m_NumOfAnimations++;
			}

		//if it is Frame(Bone)
		if( *pGuid == TID_D3DRMFrame && m_AnimationSets && m_AnimationSets->m_Animations
				&& Reference)
			{
			if( *GetObjectGUID(pParentObj) == TID_D3DRMAnimation )//if inside an Animation Data
				m_AnimationSets->m_Animations->m_Name = GetObjectName(pDataObj);
			}

		//if it is a KeyFrame of the Animation
		if( *pGuid == TID_D3DRMAnimationKey && m_AnimationSets && m_AnimationSets->m_Animations )
			{
			XAnimation* CurAnim = m_AnimationSets->m_Animations;
			DWORD* pData = NULL;
			SIZE_T size;
			pDataObj->Lock(&size,(LPCVOID*)&pData);
			
			//Read the XFile Template Properties
			DWORD Type = *pData++;
			DWORD NumOfKeys = *pData++;

			#pragma region Loads KeyFrame Data
			switch(Type)
				{
				case 0://Rotacion
					{
					delete[] CurAnim->m_QuaternionKeys;
					CurAnim->m_NumOfQuaternionKey = NumOfKeys;
					CurAnim->m_QuaternionKeys = new XAnimationQuaternionKey[NumOfKeys];

					for(int i=0; i < NumOfKeys ; ++i)
						{
						CurAnim->m_QuaternionKeys[i].m_Time = *pData++;
						if( CurAnim->m_QuaternionKeys[i].m_Time > m_AnimationSets->m_Length )
							m_AnimationSets->m_Length = CurAnim->m_QuaternionKeys[i].m_Time;

						pData++;//Esto se que es 4*4 = 16 bits, asi que no me molesto en leerlo

						CurAnim->m_QuaternionKeys[i].m_QuatKey.w = *pData++;
						CurAnim->m_QuaternionKeys[i].m_QuatKey.x = *pData++;
						CurAnim->m_QuaternionKeys[i].m_QuatKey.y = *pData++;
						CurAnim->m_QuaternionKeys[i].m_QuatKey.z = *pData++;
						}
					}
					break;
				case 1: //Escalado
					{
					delete[] CurAnim->m_VectorKeys;
					CurAnim->m_NumOfVectorKey = NumOfKeys;
					CurAnim->m_VectorKeys = new XAnimationVectorKey[NumOfKeys];

					for(int i=0; i < NumOfKeys ; ++i)
						{
						CurAnim->m_VectorKeys[i].m_Time = *pData++;
						if( CurAnim->m_QuaternionKeys[i].m_Time > m_AnimationSets->m_Length )
							m_AnimationSets->m_Length = CurAnim->m_QuaternionKeys[i].m_Time;

						pData++;//Esto se que es 4*4 = 16 bits, asi que no me molesto en leerlo
						D3DXVECTOR3* vecPtr = (D3DXVECTOR3*)pData;
						CurAnim->m_VectorKeys[i].m_VecKey = *vecPtr;

						pData += 3;
						}
					}
					break;

				case 2: //Traslacion
					{
					delete[] CurAnim->m_TranslationKeys;
					CurAnim->m_NumOfVectorKey = NumOfKeys;
					CurAnim->m_TranslationKeys = new XAnimationVectorKey[NumOfKeys];

					for(int i=0; i < NumOfKeys ; ++i)
						{
						CurAnim->m_TranslationKeys[i].m_Time = *pData++;
						if( CurAnim->m_TranslationKeys[i].m_Time > m_AnimationSets->m_Length )
							m_AnimationSets->m_Length = CurAnim->m_TranslationKeys[i].m_Time;

						pData++;//Esto se que es 4*4 = 16 bits, asi que no me molesto en leerlo
						D3DXVECTOR3* vecPtr = (D3DXVECTOR3*)pData;
						CurAnim->m_VectorKeys[i].m_VecKey = *vecPtr;

						pData += 3;
						}
					}
					break;

				case 4: // Matriz de Transformacion
					{
					delete[] CurAnim->m_MatrixKeys;
					CurAnim->m_NumOfMatrixKey = NumOfKeys;
					CurAnim->m_MatrixKeys = new XAnimationMatrixKey[NumOfKeys];

					for(int i=0; i < NumOfKeys ; ++i)
						{
						CurAnim->m_MatrixKeys[i].m_Time = *pData++;
						if( CurAnim->m_MatrixKeys[i].m_Time > m_AnimationSets->m_Length )
							m_AnimationSets->m_Length = CurAnim->m_MatrixKeys[i].m_Time;

						pData++;//Esto se que es 4*4 = 16 bits, asi que no me molesto en leerlo
						D3DXMATRIX* matPtr = (D3DXMATRIX*)pData;
						CurAnim->m_MatrixKeys[i].m_MatKey = *matPtr;

						pData += 16;
						}
					}
					break;
				}
			#pragma endregion

			pDataObj->Unlock();
			}
				
		//Parse Children
		return ParseChildObject(pDataObj,Depth,Data,Reference);
		}