1 // Created on: 1991-09-10
2 // Created by: Denis PASCAL
3 // Copyright (c) 1991-1999 Matra Datavision
4 // Copyright (c) 1999-2012 OPEN CASCADE SAS
6 // The content of this file is subject to the Open CASCADE Technology Public
7 // License Version 6.5 (the "License"). You may not use the content of this file
8 // except in compliance with the License. Please obtain a copy of the License
9 // at http://www.opencascade.org and read it completely before using this file.
11 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
14 // The Original Code and all software distributed under the License is
15 // distributed on an "AS IS" basis, without warranty of any kind, and the
16 // Initial Developer hereby disclaims all such warranties, including without
17 // limitation, any warranties of merchantability, fitness for a particular
18 // purpose or non-infringement. Please see the License for the specific terms
19 // and conditions governing the rights and limitations under the License.
23 #include <Standard_NoMoreObject.hxx>
24 #include <Standard_NoSuchObject.hxx>
25 #include <GraphDS_DataMapIteratorOfEntityRoleMap.hxx>
27 //=======================================================================
28 //function : GraphDS_IncidentRelationsIterator
30 //=======================================================================
32 GraphDS_IncidentRelationsIterator::GraphDS_IncidentRelationsIterator ()
37 //=======================================================================
38 //function : GraphDS_IncidentRelationsIterator
40 //=======================================================================
42 GraphDS_IncidentRelationsIterator::GraphDS_IncidentRelationsIterator
43 (const GraphDS_RelationGraph& G,
44 const Handle(GraphDS_Relation)& R)
50 //=======================================================================
51 //function : GraphDS_Initialize
53 //=======================================================================
55 void GraphDS_IncidentRelationsIterator::Initialize
56 (const GraphDS_RelationGraph&,
57 const Handle(GraphDS_Relation)& R)
62 Handle(GraphDS_Entity) ENT;
63 Handle(GraphDS_Relation) REL;
64 GraphDS_DataMapIteratorOfEntityRoleMap itv;
65 TColStd_MapIteratorOfMapOfTransient itr;
67 for (itv.Initialize(R->GetEntities());itv.More();itv.Next()) {
68 ENT = Handle(GraphDS_Entity)::DownCast(itv.Key());
69 if (itv.Value() != GraphDS_OnlyOutput) {
70 for (itr.Initialize(ENT->GetRelations()); itr.More(); itr.Next()) {
71 REL = Handle(GraphDS_Relation)::DownCast(itr.Key());
72 if (REL->IsOutput(ENT)) myMap.Add(REL);
76 myRelations.Initialize(myMap);
80 //=======================================================================
83 //=======================================================================
85 Standard_Boolean GraphDS_IncidentRelationsIterator::More () const
87 return myRelations.More();
91 //=======================================================================
94 //=======================================================================
96 void GraphDS_IncidentRelationsIterator::Next ()
102 //=======================================================================
105 //=======================================================================
107 const Handle(GraphDS_Relation)& GraphDS_IncidentRelationsIterator::Value () const
109 return *((Handle(GraphDS_Relation)*)& myRelations.Key());
110 //return Handle(GraphDS_Relation)::DownCast(myRelations.Key());