Example #1
0
/*!
  Create nodes for each objects
  */
void PathSolver::CreateNodes()
{
    const Connectables::hashObjects listObjects = myHost->objFactory->GetListObjects();
    Connectables::hashObjects::const_iterator i = listObjects.constBegin();
    while(i!=listObjects.constEnd()) {
        QSharedPointer<Connectables::Object> objPtr = i.value();

        //don't add parked objects
        if(!objPtr.isNull() && !objPtr->parked) {
//            if(objPtr->info().nodeType!=NodeType::bridge && objPtr->info().nodeType!=NodeType::container) {
            if( objPtr->info().nodeType!=NodeType::container) {
                SolverNode *node = new SolverNode();
                listNodes << node;
                node->listOfObj << objPtr;
                objPtr->SetSolverNode(node);
            }
        }
        ++i;
    }
}