예제 #1
0
void CControlBase::CContNode::PopulateChildren() {

  CDasherNode *pNewNode;

  const unsigned int iNChildren( m_pTemplate->successors.size() );
  unsigned int iLbnd(0), iIdx(0);

  for (vector<NodeTemplate *>::iterator it = m_pTemplate->successors.begin(); it!=m_pTemplate->successors.end(); it++) {

    const unsigned int iHbnd((++iIdx*CDasherModel::NORMALIZATION)/iNChildren);

    if( *it == NULL ) {
      // Escape back to alphabet

      pNewNode = m_pMgr->m_pNCManager->GetAlphabetManager()->GetRoot(this, false, offset()+1);
    }
    else {

      pNewNode = new CContNode(offset(), m_pMgr->getColour(*it, this), *it, m_pMgr);
    }
    pNewNode->Reparent(this, iLbnd, iHbnd);
    iLbnd=iHbnd;
    DASHER_ASSERT(GetChildren().back()==pNewNode);
  }
}
예제 #2
0
void CControlBase::CContNode::PopulateChildren() {

  CDasherNode *pNewNode;

  const unsigned int iNChildren( m_pTemplate->successors.size() );
  unsigned int iLbnd(0), iIdx(0);
      int newOffset = m_pTemplate->calculateNewOffset(this, offset());

      for (auto child : m_pTemplate->successors) {

    const unsigned int iHbnd((++iIdx*CDasherModel::NORMALIZATION)/iNChildren);

    if( child == NULL ) {
      // Escape back to alphabet

      pNewNode = m_pMgr->m_pNCManager->GetAlphabetManager()->GetRoot(this, false, newOffset + 1);
    }
    else {
      pNewNode = new CContNode(newOffset, m_pMgr->getColour(child, this), child, m_pMgr);
    }
    pNewNode->Reparent(this, iLbnd, iHbnd);
    iLbnd=iHbnd;
    DASHER_ASSERT(GetChildren().back()==pNewNode);
  }
}
예제 #3
0
void CNodeCreationManager::AddExtras(CDasherNode *pParent) {
  //control mode:
  DASHER_ASSERT(pParent->GetChildren().back()->Hbnd() == m_iAlphNorm);
  if (m_pControlManager) {
    //ACL leave offset as is - like its groupnode parent, but unlike its alphnode siblings,
    //the control node does not enter a symbol....
    CDasherNode *ctl = m_pControlManager->GetRoot(pParent, pParent->offset());
    ctl->Reparent(pParent, pParent->GetChildren().back()->Hbnd(), CDasherModel::NORMALIZATION);
  }
}