当前位置: 首页>>代码示例>>C++>>正文


C++ IObject::GetName方法代码示例

本文整理汇总了C++中IObject::GetName方法的典型用法代码示例。如果您正苦于以下问题:C++ IObject::GetName方法的具体用法?C++ IObject::GetName怎么用?C++ IObject::GetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IObject的用法示例。


在下文中一共展示了IObject::GetName方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: DeInit

bool CManager::DeInit()
{
	DELETEOBJECTPARAMS dop;

	// Call DeleteObject on every object we manage from every group
	MAPGROUPLISTS::iterator mglIter;
	for (mglIter = m_GroupLists.begin(); mglIter != m_GroupLists.end(); ++mglIter)
	{
		IDTOOBJECTMAP *ntom;

		// loop through all the objects in this group
		ntom = mglIter->second;
		IDTOOBJECTMAP::iterator ntomIter = ntom->begin();
		while (ntomIter != ntom->end())
		{
			IObject *delObject;
			delObject = ntomIter->second;
			dop.name = delObject->GetName();
			static DWORD msgHash_DeleteObject = CHashString(_T("DeleteObject")).GetUniqueID();
			m_ToolBox->SendMessage(msgHash_DeleteObject, sizeof( DELETEOBJECTPARAMS ), &dop, NULL, NULL );
			ntomIter = ntom->begin();
		}

		// no more objects in the list.
		ntom->clear();
	}

	return true;
}
开发者ID:klhurley,项目名称:ElementalEngine2,代码行数:29,代码来源:CManager.cpp

示例2: OnFindDatabaseByFileName

DWORD CDatabaseManager::OnFindDatabaseByFileName(DWORD size, void *params)
{
	DBFINDDATABASE *dbInfo;
	
	// verify the message we have received is the the right size
	VERIFY_MESSAGE_SIZE(size, sizeof(DBFINDDATABASE));

	// cast params to a DATABASEINFO
	dbInfo = (DBFINDDATABASE *)params;
	if( dbInfo->m_DatabaseFileName == NULL )
	{
		return MSG_ERROR;
	}

	IObject* tmpobj = GetDatabaseByFile( dbInfo->m_DatabaseFileName );

	if( tmpobj == NULL )
	{
		dbInfo->m_bIsFound = false;
		dbInfo->m_DatabaseObjName = NULL;
		return MSG_HANDLED_PROCEED;
	}
	
	dbInfo->m_bIsFound = true;
	dbInfo->m_DatabaseObjName = tmpobj->GetName();

	return MSG_HANDLED_PROCEED;	
}
开发者ID:klhurley,项目名称:ElementalEngine2,代码行数:28,代码来源:DatabaseManager.cpp

示例3: OnAddGUIElementToPage

// add a gui element to the page list
DWORD CGUIPage::OnAddGUIElementToPage(DWORD size, void *params)
{
	OBJECTLIST::iterator olIter;
	GUIPAGEMESSAGE *gpm;
	IObject *guiObject;
	static CHashString managerName(_T("CGUIManager"));
	CGUIManager *manager;

	// make sure message is valid
	VERIFY_MESSAGE_SIZE(size, sizeof(GUIPAGEMESSAGE));

	// downcast parameters to struct we expect
	gpm = (GUIPAGEMESSAGE *)params;

	// ask gui manager for the object to add
	manager = dynamic_cast<CGUIManager*>(EngineGetToolBox()->GetComponent( &managerName ));
	if (!manager)
	{
		EngineGetToolBox()->SetErrorValue(ERR_NULL_POINTER);
		EngineGetToolBox()->Log(LOGERROR, _T("could not cast IComponent from EngineToolBox to CGUIManager\n")); 
		return MSG_ERROR;
	}
	guiObject = manager->GetObject(gpm->name, gpm->compType);
	if(guiObject == NULL)
	{
		EngineGetToolBox()->SetErrorValue(ERR_NULL_POINTER);
		EngineGetToolBox()->Log(LOGERROR, _T("could not get the gui object from the gui manager: %s object not found\n"), gpm->name);
		return MSG_ERROR;
	}

	// check if object is already on list
	for(olIter = m_ObjectList.begin(); olIter != m_ObjectList.end(); olIter++)
	{
		if ( (*olIter)->GetName()->GetUniqueID() == guiObject->GetName()->GetUniqueID() )
		{
			// object is already on page
			return MSG_NOT_HANDLED;
		}
	}
	// now add object to list
	m_ObjectList.push_back(guiObject);
	m_SortedMap.clear();
	IGUIElement *guiElement = dynamic_cast<IGUIElement*>(guiObject);
	guiElement->SetWidthRatio(m_fWidthRatio);
	guiElement->SetHeightRatio(m_fHeightRatio);
	guiElement->SetZoomFactor(m_fZoomFactor);
	guiElement->SetPageOffset(m_iPageOffsetX, m_iPageOffsetY);
	return MSG_HANDLED_STOP;
}
开发者ID:klhurley,项目名称:ElementalEngine2,代码行数:50,代码来源:CGUIPage.cpp

示例4: GetObjectMap

DWORD Cal3DModelManager::OnSaveAllCalCubes(DWORD size, void *param)
{
	static CHashString modelType = _T("Cal3DRenderObject");
	IDTOOBJECTMAP *calMap = GetObjectMap(&modelType);
	if (calMap)
	{
		IDTOOBJECTMAP::iterator objIter = calMap->begin();
		while (objIter != calMap->end())
		{
			IObject *calObj = objIter->second;
			IHashString *objName = calObj->GetName();
			static DWORD msgHash_SaveCalCubes = CHashString(_T("SaveCalCubes")).GetUniqueID();
			m_ToolBox->SendMessage(msgHash_SaveCalCubes, 0, 0, objName, &modelType );
			objIter++;
		}
	}
	return MSG_HANDLED_STOP;
}
开发者ID:klhurley,项目名称:ElementalEngine2,代码行数:18,代码来源:Cal3DModelManager.cpp

示例5: Visit

bool CVisitNodeDWORD::Visit(IComponent *component, bool bVisitEnter)
{
	IObject *theObject;
	IHashString *objName;

	theObject = dynamic_cast<IObject *>(component);

	// if the object is invalid
	if (!theObject)
	{
		// log error
		return false;
	}

	// get the name of the object
	objName = theObject->GetName();

	// add name to set
	m_DWORDSet->Add(objName);

	return true;
}
开发者ID:klhurley,项目名称:ElementalEngine2,代码行数:22,代码来源:VisitNodeDWORD.cpp

示例6: OnDeleteObject

DWORD CCoordinateToolManager::OnDeleteObject(DWORD size, void *param)
{
	// This message has its priority raised so that it gets called before the
  	// parent entity's delete object. We MUST to remove coordinate tool
  	// for entity, before its deletion. Otherwise physics will crash.
  	// Is there any better solution, except to catch all DeleteObject messages?
  
  	VERIFY_MESSAGE_SIZE(sizeof(DELETEOBJECTPARAMS), size);
  	DELETEOBJECTPARAMS* dop = (DELETEOBJECTPARAMS*)param;
  
  	IObject * object = FindByParent(dop->name);
  	if (object != NULL)
  	{
  		// Remove coordinate tool for this parent object.
  		DELETEOBJECTPARAMS dop;
  		dop.name = object->GetName();
  		static DWORD msgHash_DeleteObject = CHashString(_T("DeleteObject")).GetUniqueID();
  		m_ToolBox->SendMessage(msgHash_DeleteObject, sizeof(DELETEOBJECTPARAMS), &dop);

		m_CoordinateToolName = NULL;
  	}

	return MSG_HANDLED_PROCEED;
}
开发者ID:klhurley,项目名称:ElementalEngine2,代码行数:24,代码来源:CoordinateToolManager.cpp

示例7: Visit

bool CWorldVisitor::Visit( IComponent * component, bool bVisitEnter )
{
	IObject *theObject;
	IHashString *name;
	IHashString *parentName;
	IHashString *type;

	StdString parentType;
	StdString childType;

	std::string str;

	theObject = dynamic_cast<IObject *>(component);
	// This shouldn't happen but it does for some odd reason....
	assert(theObject);
	if( theObject == NULL )
	{
		return false;
	}
	name = theObject->GetName();
	parentName = theObject->GetParentName();
	type = theObject->GetComponentType();

	//Check to see if it is a valid object (for object exclusion)
	if( !CheckObject( type->GetString() ) )
	{
		return true;
	}

	else
	{
		if ( name == NULL )
		{
			name = &CHashString(_T("NULL"));
		}	

		if( bVisitEnter == true )
		{
			//if( (m_pArchiver != NULL) && ( _tcscmp( type->GetString(), _T("CPhysicsObject") ) != 0 ) )
			if( (m_pArchiver != NULL) )
			{
				// Start the Node
				m_pArchiver->StartClass( type->GetString() );
				
				// Write out the Unique ID aka Name
				m_pArchiver->Write( name->GetString(), _T("Name") );
				theObject->Serialize( *m_pArchiver );
			}

			// Removal of CPhysShape and changes to CPhysicsObject
			if( _tcscmp( type->GetString(), _T("CPhysicsObject") ) == 0 )
			{
				
				CPhysObjectStruct tmpCPhysObject;
				StdString CPhyShapeFile;
				StdString CPhyShapeFileOld;
				// if it's parent is not a CTerrainSector Object
				if( _tcsstr( name->GetString(), _T("Terrain") ) == NULL )
				{
					static DWORD msgHash_GetModelFileName = CHashString(_T("GetModelFileName")).GetUniqueID();
					m_ToolBox->SendMessage(msgHash_GetModelFileName, sizeof(StdString*), &CPhyShapeFile, parentName, NULL );
					CPhyShapeFile += _T(".psl");
				}
				// CTerrainSector Object
				else
				{
					CPhyShapeFile = _T("maps\\terrain.psl");
				}

				IArchive *PhysObjectIn;
				IArchive *PhysObjectRead;
				CHashString memTypePhysObjectIn(_T("Memory"));
				
				int PhysObjectInMemSize = 1024 * 1024 * sizeof(char);
				char* PhysObjectInMemChunk = new char[PhysObjectInMemSize];
				memset( PhysObjectInMemChunk, 0, PhysObjectInMemSize );

				CREATEARCHIVE caPhysObjectIn;
				caPhysObjectIn.mode = STREAM_MODE_READ;
				caPhysObjectIn.streamData = PhysObjectInMemChunk;
				caPhysObjectIn.streamSize = PhysObjectInMemSize;
				caPhysObjectIn.streamType = &memTypePhysObjectIn;
				static DWORD msgHash_CreateArchive = CHashString(_T("CreateArchive")).GetUniqueID();
				if (m_ToolBox->SendMessage(msgHash_CreateArchive, sizeof(CREATEARCHIVE), &caPhysObjectIn) != MSG_HANDLED)
				{
					return true;
				}
				PhysObjectIn = caPhysObjectIn.archive;

				CREATESTREAM csPhysObjectIn;
				csPhysObjectIn.streamData = caPhysObjectIn.streamData;
				csPhysObjectIn.streamSize = caPhysObjectIn.streamSize;
				csPhysObjectIn.mode = STREAM_MODE_WRITE;
				static DWORD msgHash_CreateStream_Memory = CHashString(_T("CreateStream_Memory")).GetUniqueID();
				if (m_ToolBox->SendMessage(msgHash_CreateStream_Memory, sizeof(CREATESTREAM), &csPhysObjectIn) != MSG_HANDLED)
				{
					return true;
				}
				PhysObjectIn->Init(csPhysObjectIn.openStream);		    

//.........这里部分代码省略.........
开发者ID:klhurley,项目名称:ElementalEngine2,代码行数:101,代码来源:WorldVisitor.cpp


注:本文中的IObject::GetName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。