0031682: Visualization - Prs3d_ShadingAspect::SetTransparency() has no effect with...
[occt.git] / src / Interface / Interface_GraphContent.cxx
CommitLineData
973c2be1 1// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 2//
973c2be1 3// This file is part of Open CASCADE Technology software library.
b311480e 4//
d5f74e42 5// This library is free software; you can redistribute it and/or modify it under
6// the terms of the GNU Lesser General Public License version 2.1 as published
973c2be1 7// by the Free Software Foundation, with special exception defined in the file
8// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9// distribution for complete text of the license and disclaimer of any warranty.
b311480e 10//
973c2be1 11// Alternatively, this file may be used under the terms of Open CASCADE
12// commercial license or contractual agreement.
b311480e 13
42cf5bc1 14
15#include <Interface_EntityIterator.hxx>
16#include <Interface_Graph.hxx>
17#include <Interface_GraphContent.hxx>
7fd59977 18#include <Interface_InterfaceModel.hxx>
19#include <Interface_IntList.hxx>
42cf5bc1 20#include <Standard_Transient.hxx>
7fd59977 21
b311480e 22Interface_GraphContent::Interface_GraphContent () { }
7fd59977 23
24 Interface_GraphContent::Interface_GraphContent
25 (const Interface_Graph& agraph)
26 { GetFromGraph(agraph); }
27
28 Interface_GraphContent::Interface_GraphContent
29 (const Interface_Graph& agraph, const Standard_Integer stat)
30 { GetFromGraph(agraph,stat); }
31
32 Interface_GraphContent::Interface_GraphContent
33 (const Interface_Graph& agraph, const Handle(Standard_Transient)& ent)
34{
bc650d41
G
35 Interface_EntityIterator list = agraph.Shareds(ent);
36 Standard_Integer nb = list.NbEntities();
7fd59977 37 if (nb == 0) return; // Liste redefinie a VIDE
bc650d41
G
38 for( ; list.More(); list.Next()) {
39 Handle(Standard_Transient) curent = list.Value();
40 if (agraph.IsPresent(agraph.EntityNumber(curent)))
41 GetOneItem (curent);
7fd59977 42 }
43}
44
45
46 void Interface_GraphContent::GetFromGraph (const Interface_Graph& agraph)
47{
48 Standard_Integer nb = agraph.Size();
49 for (Standard_Integer i = 1; i <= nb; i ++) {
50 if (agraph.IsPresent(i)) GetOneItem (agraph.Entity(i));
51 }
52}
53
54 void Interface_GraphContent::GetFromGraph
55 (const Interface_Graph& agraph, const Standard_Integer stat)
56{
57 Standard_Integer nb = agraph.Size();
58 for (Standard_Integer i = 1; i <= nb; i ++) {
59 if (agraph.IsPresent(i) && agraph.Status(i) == stat)
60 GetOneItem (agraph.Entity(i));
61 }
62}
63
64 Interface_EntityIterator Interface_GraphContent::Result ()
65{
66 Interface_EntityIterator iter; // On transvase ...
67 for (Begin(); More(); Next()) iter.GetOneItem(Value());
68 return iter;
69}
70
71
72 void Interface_GraphContent::Begin ()
73{
74 Evaluate();
75 Interface_EntityIterator::Start();
76}
77
78 void Interface_GraphContent::Evaluate ()
79{ } // par defaut, Evaluate ne fait rien