//*********************************************************************************************** void CParticleWorkspace::sort(ISort &predicate) { CParticleWorkspaceSorter ws; ws.Sorter = &predicate; std::sort(_Nodes.begin(), _Nodes.end(), ws); setModifiedFlag(true); }
//*********************************************************************************************** CParticleWorkspace::CNode *CParticleWorkspace::addNode(const std::string &filenameWithFullPath) throw( NLMISC::EStream) { nlassert(_OV); // Check that file is not already inserted std::string fileName = NLMISC::CFile::getFilename(filenameWithFullPath); for(uint k = 0; k < _Nodes.size(); ++k) { if (NLMISC::nlstricmp(_Nodes[k]->getFilename(), fileName) == 0) return NULL; } char resultPath[MAX_PATH]; std::string dosPath = NLMISC::CPath::standardizeDosPath(getPath()); std::string relativePath; if (!PathRelativePathTo(resultPath, dosPath.c_str(), FILE_ATTRIBUTE_DIRECTORY, filenameWithFullPath.c_str(), 0)) { relativePath = filenameWithFullPath; } else { relativePath = resultPath; } if (relativePath.size() >= 2) { if (relativePath[0] == '\\' && relativePath[1] != '\\') { relativePath = relativePath.substr(1); } } CNode *newNode = new CNode; newNode->init(this); newNode->setRelativePath(relativePath); _Nodes.push_back(newNode); setModifiedFlag(true); return newNode; }
void CSLevel::initialize() { // log this event CS_LOG(CSLOGTYPE::CSL_DEBUG, "CSLevel::initialize()"); // set all variables to a known value CS_INIT(m_Application); CS_INIT(m_Id); CS_INIT(m_GUIBaseWindow); CS_INIT(m_ObjectFactory); CS_INIT(m_PhysXWorld); CS_INIT(m_Camera); CS_INIT(m_UseLight); CS_INIT(m_UseFog); CS_INIT(m_BlackBoard); for (int x = 0; x < MAX_REGISTERED_OBJECTS; x++) m_RegisteredObjects[x] = 0; CS_INIT(m_CollMan); setModifiedFlag(true); setMode(MODE_TRANSLATE); m_ObjectType = OBJECT_TYPE::CS_TYPE_ALL; setPickFlag(PF_NODE); }