summaryrefslogtreecommitdiff
path: root/src/Interface/Interface_GraphContent.cxx
blob: 02eade9ec3bdcd3d1d5f3a6b12e9151862248e76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#include <Interface_GraphContent.ixx>
#include <Interface_InterfaceModel.hxx>
#include <Interface_IntList.hxx>



    Interface_GraphContent::Interface_GraphContent ()    {  }

    Interface_GraphContent::Interface_GraphContent
  (const Interface_Graph& agraph)
      {  GetFromGraph(agraph);  }

    Interface_GraphContent::Interface_GraphContent
  (const Interface_Graph& agraph, const Standard_Integer stat)
      {  GetFromGraph(agraph,stat);  }

    Interface_GraphContent::Interface_GraphContent
  (const Interface_Graph& agraph, const Handle(Standard_Transient)& ent)
{
  Interface_IntList list =
    agraph.SharedNums(agraph.EntityNumber(ent));
  Standard_Integer nb = list.Length();
  if (nb == 0) return;                             // Liste redefinie a VIDE
  Handle(Interface_InterfaceModel) mod = agraph.Model();
  for (Standard_Integer i = 1; i <= nb; i ++) {
    Standard_Integer num = list.Value(i);
    if (agraph.IsPresent(num)) GetOneItem (agraph.Entity(num));
  }
}


    void  Interface_GraphContent::GetFromGraph (const Interface_Graph& agraph)
{
  Standard_Integer nb = agraph.Size();
  for (Standard_Integer i = 1; i <= nb; i ++) {
    if (agraph.IsPresent(i)) GetOneItem (agraph.Entity(i));
  }
}

    void  Interface_GraphContent::GetFromGraph
  (const Interface_Graph& agraph, const Standard_Integer stat)
{
  Standard_Integer nb = agraph.Size();
  for (Standard_Integer i = 1; i <= nb; i ++) {
    if (agraph.IsPresent(i) && agraph.Status(i) == stat)
      GetOneItem (agraph.Entity(i));
  }
}

    Interface_EntityIterator Interface_GraphContent::Result ()
{
  Interface_EntityIterator iter;    // On transvase ...
  for (Begin(); More(); Next()) iter.GetOneItem(Value());
  return iter;
}


    void Interface_GraphContent::Begin ()
{
  Evaluate();
  Interface_EntityIterator::Start();
}

    void Interface_GraphContent::Evaluate ()
{  }    // par defaut, Evaluate ne fait rien