Example #1
0
void TGen::Engine::EntityRecipe::prelink(const TGen::Engine::ComponentLinker & linker) {
    TGen::Engine::ComponentLinker newLinker(linker);
    newLinker.setEntityRecipe(this);

    for (RecipeList::iterator iter = componentRecipes.begin(); iter != componentRecipes.end(); ++iter) {
        std::cout << "LINKING COMPRECP: " << (*iter)->getName() << std::endl;

        (*iter)->prelink(newLinker);
    }

    worldInterfaceIndex = getComponentIndex(worldInterfaceName);
}
Example #2
0
void EdoTabs::addTab (const String &tabName, const Colour &tabBackgroundColour, Component *const contentComponent, const bool deleteComponentWhenNotNeeded, Image *icon, const int insertIndex)
{	
	EdoTab *t				= new EdoTab();
	t->tabIcon				= icon;
	t->tabComponent			= contentComponent;
	t->tabName				= tabName;
	t->tabColour			= tabBackgroundColour;
	t->deleteWhenNotNeeded	= deleteComponentWhenNotNeeded;
	
	edoTabs.add (t);
	TabbedComponent::addTab (tabName, tabBackgroundColour, contentComponent, deleteComponentWhenNotNeeded, insertIndex);

	if (insertIndex == -1)
		t->tabIndex				= getComponentIndex(contentComponent);
	else
		t->tabIndex				= insertIndex;

	t->tabComponent->setComponentProperty (T("tabIndex"), t->tabIndex);
}
Example #3
0
void ComponentGraph::updateConnections(const ComponentTypesFile &compFile,
        const ComponentDrawOptions &options)
    {
    BuildPackages buildPkgs(true);
    std::vector<Package> packages = buildPkgs.getPackages();
    mConnections.clear();

    OovStringVec compPaths;
    for(size_t i=0; i<mNodes.size(); i++)
        {
        if(mNodes[i].getComponentNodeType() == ComponentNode::CNT_Component)
            {
            std::string incPath;
            incPath = compFile.getComponentAbsolutePath(mNodes[i].getName());
            compPaths.push_back(incPath);
            }
        }

    // This is slow - look to improve?
    for(size_t consumerIndex=0; consumerIndex<mNodes.size(); consumerIndex++)
        {
        if(mNodes[consumerIndex].getComponentNodeType() == ComponentNode::CNT_Component)
            {
            OovStringVec srcFiles = compFile.getComponentFiles(
                ComponentTypesFile::CFT_CppSource, mNodes[consumerIndex].getName());
            for(auto const &srcFile : srcFiles)
                {
                FilePath fp;
                fp.getAbsolutePath(srcFile, FP_File);
                OovStringVec incDirs =
                        mIncludeMap->getNestedIncludeDirsUsedBySourceFile(fp);
                for(auto const &incDir : incDirs)
                    {
                    size_t supplierIndex = getComponentIndex(compPaths, incDir);
                    if(supplierIndex != NO_INDEX && consumerIndex != supplierIndex)
                        mConnections.insert(ComponentConnection(consumerIndex, supplierIndex));
                    }
                }
            }
        }
    for(size_t supplierIndex=0; supplierIndex<mNodes.size(); supplierIndex++)
        {
        if(mNodes[supplierIndex].getComponentNodeType() == ComponentNode::CNT_ExternalPackage)
            {
            OovString const &nodeName = mNodes[supplierIndex].getName();
            auto const &supplierIt = std::find_if(packages.begin(), packages.end(),
                    [nodeName](Package const &pkg) -> bool
                    { return(pkg.getPkgName().compare(nodeName) == 0); });
            if(supplierIt != packages.end())
                {
                for(size_t consumerIndex=0; consumerIndex<mNodes.size(); consumerIndex++)
                    {
                    if(mNodes[consumerIndex].getComponentNodeType() == ComponentNode::CNT_Component)
                        {
                        OovStringVec incRoots = (*supplierIt).getIncludeDirs();
                        if(mIncludeMap->anyRootDirsMatch(incRoots, compPaths[consumerIndex]))
                            {
                            mConnections.insert(ComponentConnection(consumerIndex, supplierIndex));
                            }
                        }
                    }
                }
            }
        }
    if(!options.drawImplicitRelations)
        pruneConnections();
    }
Example #4
0
void EdoTabs::setCurrentTab (Component *contentComponentToActivate)
{
	setCurrentTabIndex (getComponentIndex (contentComponentToActivate));
}