예제 #1
0
      public override void Added(ITab<UIntPtr> nodes)
      {
         IEnumerable<NodeLayerProperty> layerProps = Enum.GetValues(typeof(NodeLayerProperty))
                                                         .Cast<NodeLayerProperty>();

         foreach (IINode node in nodes.NodeKeysToINodeList())
         {
            IINodeLayerProperties nodeLayerProps = node.GetInterface(MaxInterfaces.NodeLayerProperties) as IINodeLayerProperties;
            if (nodeLayerProps == null)
               continue;

            String layerName = nodeLayerProps.Layer.Name;
            IILayer layer = MaxInterfaces.IILayerManager.GetLayer(ref layerName);

            if (layer == null)
               continue;

            foreach (NodeLayerProperty prop in layerProps)
            {
               Boolean byLayer = GetAutoInherit(layer, prop);
               if (byLayer)
                  setNodeInheritProperty(node, prop, true);
            }
         }
      }
예제 #2
0
      public override void MaterialStructured(ITab<UIntPtr> nodes)
      {
         foreach (IINode node in nodes.NodeKeysToINodeList())
         {
            TreeNode tn = this.TreeMode.GetFirstTreeNode(node);
            TreeNode matTn = this.TreeMode.GetFirstTreeNode(node.Mtl);

            if (tn == null || matTn == null)
               continue;

            matTn.Nodes.Add(tn);
            this.Tree.AddToSortQueue(tn);
         }

         this.Tree.StartTimedSort(true);
      }
예제 #3
0
      public override void GroupChanged(ITab<UIntPtr> nodes)
      {
         if (this.layerMode.showGroupContents)
            return;

         foreach (IINode node in nodes.NodeKeysToINodeList())
         {
            if (node.IsGroupMember)
            {
               this.layerMode.RemoveNode(node);
            }
            else
            {
               TreeNode layerTn = this.layerMode.GetParentTreeNode(node);
               if (layerTn == null)
                  continue;

               this.layerMode.AddNode(node, layerTn.Nodes);
               this.Tree.AddToSortQueue(layerTn.Nodes);
            }
         }

         this.Tree.StartTimedSort(true);
      }
예제 #4
0
      public override void LayerChanged(ITab<UIntPtr> nodes)
      {
         foreach (IINode node in nodes.NodeKeysToINodeList())
         {
            TreeNode tn = this.TreeMode.GetFirstTreeNode(node);
            if (tn == null)
               return;

            TreeNode layerTn = this.layerMode.GetParentTreeNode(node);
            if (layerTn == null)
               continue;

            layerTn.Nodes.Add(tn);
            this.Tree.AddToSortQueue(layerTn.Nodes);
         }
         this.Tree.StartTimedSort(true);
      }
예제 #5
0
 public override void ModelStructured(ITab<UIntPtr> nodes)
 {
    foreach (IINode node in nodes.NodeKeysToINodeList())
    {
       TreeNode tn = this.TreeMode.GetFirstTreeNode(node);
       if (tn != null)
          tn.Invalidate();
    }
 }
예제 #6
0
      public override void LinkChanged(ITab<UIntPtr> nodes)
      {
         foreach (IINode node in nodes.NodeKeysToINodeList())
         {
            TreeNode tn = this.TreeMode.GetFirstTreeNode(node);
            if (tn != null)
            {
               TreeNodeCollection newParentCol = null;
               if (node.ParentNode == null || node.ParentNode.IsRootNode)
                  newParentCol = this.Tree.Nodes;
               else
               {
                  TreeNode newParentTn = this.TreeMode.GetFirstTreeNode(node.ParentNode);
                  if (newParentTn != null)
                     newParentCol = newParentTn.Nodes;
                  //TODO add logic for filtered / not yet added node.
               }

               if (newParentCol != null)
               {
                  newParentCol.Add(tn);
                  this.Tree.AddToSortQueue(newParentCol);
               }
            }
         }
         this.Tree.StartTimedSort(true);
      }
예제 #7
0
 public override void Deleted(ITab<UIntPtr> nodes)
 {
    foreach (IINode node in nodes.NodeKeysToINodeList())
       this.TreeMode.RemoveNode(node);
 }
예제 #8
0
   public virtual void InvalidateTreeNodes(ITab<UIntPtr> nodes, Boolean sort)
   {
      foreach (IINode node in nodes.NodeKeysToINodeList())
      {
         IEnumerable<TreeNode> tns = this.GetTreeNodes(node);
         if (tns != null)
         {
            tns.ForEach(tn => tn.Invalidate());

            if (sort)
               this.Tree.AddToSortQueue(tns);
         }
      }

      if (sort)
         this.Tree.StartTimedSort(true);
   }