//=====================================================================
int SQLiteTreeHandler::AddBranch( const AttributeMapType& attr )
{
- mIsAdding=true;
+ //std::cout << "AddBranch" << std::endl;
tree::Node* parent = DBGetParent(attr);
+ //std::cout << " parent = "<<parent->GetLabel()<<" level "<<parent->GetLevel()<<std::endl;
DBGraftToParent(parent,attr);
- mIsAdding=false;
+
return (parent->GetLevel()+1);
}
int p=0;
while (!q.eof())
{
+
+ // std::cout << "DBLoadCh : creating node level "<<level+1<<std::endl;
+
nbloaded++;
Node* n = new Node(node);
for (int fld = 0; fld < q.numFields(); fld++)
void SQLiteTreeHandler::DBGraftToParent( tree::Node* parent,
const AttributeMapType& attr)
{
- GimmickMessage(2,"Grafting to parent '"<<parent->GetLabel()
- <<"'"<<std::endl);
+ // std::cout <<"Grafting to parent '"<<parent->GetLabel()
+ // <<"'"<<std::endl;
for (int level = parent->GetLevel()+1;
level < GetTree().GetNumberOfLevels();
{
// Create Node
tree::Node* child = new tree::Node(parent,attr);
- std::cout<<"Number of children "<<parent->GetNumberOfChildren()<<std::endl;
+ child->SetChildrenLoaded(true);
+ // std::cout<<"Number of children "<<parent->GetNumberOfChildren()<<std::endl;
// Set PARENT_ID if necessary
if ( parent->GetLevel()>0 )
child->SetAttribute("PARENT_ID",parent->GetAttribute("ID"));