mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-04 13:13:25 +03:00
0024002: Overall code and build procedure refactoring -- automatic
Automatic upgrade of OCCT code by command "occt_upgrade . -nocdl": - WOK-generated header files from inc and sources from drv are moved to src - CDL files removed - All packages are converted to nocdlpack
This commit is contained in:
22
src/IFGraph/FILES
Normal file
22
src/IFGraph/FILES
Normal file
@@ -0,0 +1,22 @@
|
||||
IFGraph_AllConnected.cxx
|
||||
IFGraph_AllConnected.hxx
|
||||
IFGraph_AllShared.cxx
|
||||
IFGraph_AllShared.hxx
|
||||
IFGraph_Articulations.cxx
|
||||
IFGraph_Articulations.hxx
|
||||
IFGraph_Compare.cxx
|
||||
IFGraph_Compare.hxx
|
||||
IFGraph_ConnectedComponants.cxx
|
||||
IFGraph_ConnectedComponants.hxx
|
||||
IFGraph_Cumulate.cxx
|
||||
IFGraph_Cumulate.hxx
|
||||
IFGraph_Cycles.cxx
|
||||
IFGraph_Cycles.hxx
|
||||
IFGraph_ExternalSources.cxx
|
||||
IFGraph_ExternalSources.hxx
|
||||
IFGraph_SCRoots.cxx
|
||||
IFGraph_SCRoots.hxx
|
||||
IFGraph_StrongComponants.cxx
|
||||
IFGraph_StrongComponants.hxx
|
||||
IFGraph_SubPartsIterator.cxx
|
||||
IFGraph_SubPartsIterator.hxx
|
@@ -1,42 +0,0 @@
|
||||
-- Created on: 1992-09-22
|
||||
-- Created by: Christian CAILLET
|
||||
-- Copyright (c) 1992-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
package IFGraph
|
||||
|
||||
---Purpose : Provides tools to operate on an InterfaceModel and its
|
||||
-- Entities as on a Graph. These Tools are based on classes
|
||||
-- Graph and GraphContent from Interface
|
||||
|
||||
uses Interface, TColStd, Standard
|
||||
|
||||
is
|
||||
|
||||
-- (sub-classes of GraphContent from Interface)
|
||||
class AllShared;
|
||||
class AllConnected;
|
||||
class Cumulate;
|
||||
class Compare;
|
||||
class ExternalSources;
|
||||
|
||||
class Articulations;
|
||||
|
||||
class SubPartsIterator; -- result as several subsets
|
||||
class ConnectedComponants;
|
||||
class StrongComponants;
|
||||
class Cycles;
|
||||
class SCRoots;
|
||||
|
||||
end IFGraph;
|
@@ -1,58 +0,0 @@
|
||||
-- Created on: 1992-10-02
|
||||
-- Created by: Christian CAILLET
|
||||
-- Copyright (c) 1992-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class AllConnected from IFGraph inherits GraphContent
|
||||
|
||||
---Purpose : this class gives content of the CONNECTED COMPONANT(S)
|
||||
-- which include specific Entity(ies)
|
||||
|
||||
uses Transient, EntityIterator, Graph
|
||||
|
||||
is
|
||||
|
||||
Create (agraph : Graph) returns AllConnected;
|
||||
---Purpose : creates an AllConnected from a graph, empty ready to be filled
|
||||
|
||||
Create (agraph : Graph; ent : any Transient)
|
||||
returns AllConnected;
|
||||
---Purpose : creates an AllConnected which memorizes Entities Connected to
|
||||
-- a given one, at any level : that is, itself, all Entities
|
||||
-- Shared by it and Sharing it, and so on.
|
||||
-- In other terms, this is the content of the CONNECTED COMPONANT
|
||||
-- which include a specific Entity
|
||||
|
||||
GetFromEntity (me : in out; ent : any Transient);
|
||||
---Purpose : adds an entity and its Connected ones to the list (allows to
|
||||
-- cumulate all Entities Connected by some ones)
|
||||
-- Note that if "ent" is in the already computed list,, no entity
|
||||
-- will be added, but if "ent" is not already in the list, a new
|
||||
-- Connected Componant will be cumulated
|
||||
|
||||
ResetData (me : in out);
|
||||
---Purpose : Allows to restart on a new data set
|
||||
|
||||
-- -- Results -- --
|
||||
-- More-Next-Value give all entities noted in Connected Componant,
|
||||
-- including the entities given for construction or to GetFromEntity
|
||||
|
||||
Evaluate (me : in out) is redefined;
|
||||
---Purpose : does the specific evaluation (Connected entities atall levels)
|
||||
|
||||
fields
|
||||
|
||||
thegraph : Graph;
|
||||
|
||||
end AllConnected;
|
@@ -11,17 +11,16 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <IFGraph_AllConnected.ixx>
|
||||
|
||||
|
||||
#include <IFGraph_AllConnected.hxx>
|
||||
#include <Interface_Graph.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
|
||||
// AllConnected prend toutes les Entites connectees a une Entite donnee
|
||||
// c-a-d toutes les "Shared" + toutes les "Sharings" et on recommence
|
||||
// Autrement dit le contenu du "Composant Connexe" du graphe d'ensemble
|
||||
// qui contient cette entite
|
||||
// Le calcul est effectue par GetFromEntity (Evaluate n'a rien a faire)
|
||||
|
||||
|
||||
IFGraph_AllConnected::IFGraph_AllConnected (const Interface_Graph& agraph)
|
||||
: thegraph (agraph) { }
|
||||
|
||||
|
86
src/IFGraph/IFGraph_AllConnected.hxx
Normal file
86
src/IFGraph/IFGraph_AllConnected.hxx
Normal file
@@ -0,0 +1,86 @@
|
||||
// Created on: 1992-10-02
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _IFGraph_AllConnected_HeaderFile
|
||||
#define _IFGraph_AllConnected_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Interface_Graph.hxx>
|
||||
#include <Interface_GraphContent.hxx>
|
||||
class Interface_Graph;
|
||||
class Standard_Transient;
|
||||
|
||||
|
||||
//! this class gives content of the CONNECTED COMPONANT(S)
|
||||
//! which include specific Entity(ies)
|
||||
class IFGraph_AllConnected : public Interface_GraphContent
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! creates an AllConnected from a graph, empty ready to be filled
|
||||
Standard_EXPORT IFGraph_AllConnected(const Interface_Graph& agraph);
|
||||
|
||||
//! creates an AllConnected which memorizes Entities Connected to
|
||||
//! a given one, at any level : that is, itself, all Entities
|
||||
//! Shared by it and Sharing it, and so on.
|
||||
//! In other terms, this is the content of the CONNECTED COMPONANT
|
||||
//! which include a specific Entity
|
||||
Standard_EXPORT IFGraph_AllConnected(const Interface_Graph& agraph, const Handle(Standard_Transient)& ent);
|
||||
|
||||
//! adds an entity and its Connected ones to the list (allows to
|
||||
//! cumulate all Entities Connected by some ones)
|
||||
//! Note that if "ent" is in the already computed list,, no entity
|
||||
//! will be added, but if "ent" is not already in the list, a new
|
||||
//! Connected Componant will be cumulated
|
||||
Standard_EXPORT void GetFromEntity (const Handle(Standard_Transient)& ent);
|
||||
|
||||
//! Allows to restart on a new data set
|
||||
Standard_EXPORT void ResetData();
|
||||
|
||||
//! does the specific evaluation (Connected entities atall levels)
|
||||
Standard_EXPORT virtual void Evaluate() Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Interface_Graph thegraph;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _IFGraph_AllConnected_HeaderFile
|
@@ -1,57 +0,0 @@
|
||||
-- Created on: 1992-09-30
|
||||
-- Created by: Christian CAILLET
|
||||
-- Copyright (c) 1992-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class AllShared from IFGraph inherits GraphContent
|
||||
|
||||
---Purpose : this class determines all Entities shared by some specific
|
||||
-- ones, at any level (those which will be lead in a Transfer
|
||||
-- for instance)
|
||||
|
||||
uses Transient, EntityIterator, Graph
|
||||
|
||||
is
|
||||
|
||||
Create (agraph : Graph) returns AllShared;
|
||||
---Purpose : creates an AllShared from a graph, empty ready to be filled
|
||||
|
||||
Create (agraph : Graph; ent : any Transient)
|
||||
returns AllShared;
|
||||
---Purpose : creates an AllShared which memrizes Entities shared by a given
|
||||
-- one, at any level, including itself
|
||||
|
||||
GetFromEntity (me : in out; ent : any Transient);
|
||||
---Purpose : adds an entity and its shared ones to the list (allows to
|
||||
-- cumulate all Entities shared by some ones)
|
||||
|
||||
GetFromIter (me : in out; iter : EntityIterator);
|
||||
---Purpose : Adds Entities from an EntityIterator and all their shared
|
||||
-- ones at any level
|
||||
|
||||
ResetData (me : in out);
|
||||
---Purpose : Allows to restart on a new data set
|
||||
|
||||
-- -- Results -- --
|
||||
-- More-Next-Value give all entities noted as shared,
|
||||
-- including the entities given for construction or to GetFromEntity
|
||||
|
||||
Evaluate (me : in out) is redefined;
|
||||
---Purpose : does the specific evaluation (shared entities atall levels)
|
||||
|
||||
fields
|
||||
|
||||
thegraph : Graph;
|
||||
|
||||
end AllShared;
|
@@ -11,9 +11,12 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <IFGraph_AllShared.ixx>
|
||||
#include <Interface_InterfaceModel.hxx>
|
||||
|
||||
#include <IFGraph_AllShared.hxx>
|
||||
#include <Interface_EntityIterator.hxx>
|
||||
#include <Interface_Graph.hxx>
|
||||
#include <Interface_InterfaceModel.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
|
||||
IFGraph_AllShared::IFGraph_AllShared (const Interface_Graph& agraph)
|
||||
: thegraph (agraph) { }
|
||||
|
86
src/IFGraph/IFGraph_AllShared.hxx
Normal file
86
src/IFGraph/IFGraph_AllShared.hxx
Normal file
@@ -0,0 +1,86 @@
|
||||
// Created on: 1992-09-30
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _IFGraph_AllShared_HeaderFile
|
||||
#define _IFGraph_AllShared_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Interface_Graph.hxx>
|
||||
#include <Interface_GraphContent.hxx>
|
||||
class Interface_Graph;
|
||||
class Standard_Transient;
|
||||
class Interface_EntityIterator;
|
||||
|
||||
|
||||
//! this class determines all Entities shared by some specific
|
||||
//! ones, at any level (those which will be lead in a Transfer
|
||||
//! for instance)
|
||||
class IFGraph_AllShared : public Interface_GraphContent
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! creates an AllShared from a graph, empty ready to be filled
|
||||
Standard_EXPORT IFGraph_AllShared(const Interface_Graph& agraph);
|
||||
|
||||
//! creates an AllShared which memrizes Entities shared by a given
|
||||
//! one, at any level, including itself
|
||||
Standard_EXPORT IFGraph_AllShared(const Interface_Graph& agraph, const Handle(Standard_Transient)& ent);
|
||||
|
||||
//! adds an entity and its shared ones to the list (allows to
|
||||
//! cumulate all Entities shared by some ones)
|
||||
Standard_EXPORT void GetFromEntity (const Handle(Standard_Transient)& ent);
|
||||
|
||||
//! Adds Entities from an EntityIterator and all their shared
|
||||
//! ones at any level
|
||||
Standard_EXPORT void GetFromIter (const Interface_EntityIterator& iter);
|
||||
|
||||
//! Allows to restart on a new data set
|
||||
Standard_EXPORT void ResetData();
|
||||
|
||||
//! does the specific evaluation (shared entities atall levels)
|
||||
Standard_EXPORT virtual void Evaluate() Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Interface_Graph thegraph;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _IFGraph_AllShared_HeaderFile
|
@@ -1,60 +0,0 @@
|
||||
-- Created on: 1992-09-23
|
||||
-- Created by: Christian CAILLET
|
||||
-- Copyright (c) 1992-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class Articulations from IFGraph inherits GraphContent
|
||||
|
||||
---Purpose : this class gives entities which are Articulation points
|
||||
-- in a whole Model or in a sub-part
|
||||
-- An Articulation Point divides the graph in two (or more)
|
||||
-- disconnected sub-graphs
|
||||
-- Identifying Articulation Points allows improving
|
||||
-- efficiency of spliting a set of Entities into sub-sets
|
||||
|
||||
uses Transient, HSequenceOfInteger, EntityIterator, Graph
|
||||
|
||||
is
|
||||
|
||||
Create (agraph : Graph; whole : Boolean) returns Articulations;
|
||||
---Purpose : creates Articulations to evaluate a Graph
|
||||
-- whole True : works on the whole Model
|
||||
-- whole False : remains empty, ready to work on a sub-part
|
||||
|
||||
GetFromEntity (me : in out; ent : any Transient);
|
||||
---Purpose : adds an entity and its shared ones to the list
|
||||
|
||||
GetFromIter (me : in out; iter : EntityIterator);
|
||||
---Purpose : adds a list of entities (as an iterator)
|
||||
|
||||
ResetData (me : in out);
|
||||
---Purpose : Allows to restart on a new data set
|
||||
|
||||
-- -- Results -- --
|
||||
-- More-Next-Value give Articulation points
|
||||
|
||||
Evaluate (me : in out) is redefined;
|
||||
---Purpose : Evaluates the list of Articulation points
|
||||
|
||||
Visit (me : in out; num : Integer) returns Integer is private;
|
||||
---Purpose : basic routine of computation
|
||||
-- (see book Sedgewick "Algorithms", p 392)
|
||||
|
||||
fields
|
||||
|
||||
thegraph : Graph;
|
||||
thenow : Integer; -- for Visit algorithm
|
||||
thelist : HSequenceOfInteger; -- results from Visiting
|
||||
|
||||
end Articulations;
|
@@ -11,14 +11,15 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <IFGraph_Articulations.ixx>
|
||||
|
||||
#include <IFGraph_Articulations.hxx>
|
||||
#include <Interface_EntityIterator.hxx>
|
||||
#include <Interface_Graph.hxx>
|
||||
#include <Interface_InterfaceModel.hxx>
|
||||
|
||||
|
||||
#include <Standard_Transient.hxx>
|
||||
|
||||
// Points d'Articulation d'un Graphe : ce sont les "passages obliges" du graphe
|
||||
// Algorithme tire du Sedgewick, p 392
|
||||
|
||||
IFGraph_Articulations::IFGraph_Articulations
|
||||
(const Interface_Graph& agraph, const Standard_Boolean whole)
|
||||
: thegraph (agraph)
|
||||
|
94
src/IFGraph/IFGraph_Articulations.hxx
Normal file
94
src/IFGraph/IFGraph_Articulations.hxx
Normal file
@@ -0,0 +1,94 @@
|
||||
// Created on: 1992-09-23
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _IFGraph_Articulations_HeaderFile
|
||||
#define _IFGraph_Articulations_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Interface_Graph.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <TColStd_HSequenceOfInteger.hxx>
|
||||
#include <Interface_GraphContent.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class Interface_Graph;
|
||||
class Standard_Transient;
|
||||
class Interface_EntityIterator;
|
||||
|
||||
|
||||
//! this class gives entities which are Articulation points
|
||||
//! in a whole Model or in a sub-part
|
||||
//! An Articulation Point divides the graph in two (or more)
|
||||
//! disconnected sub-graphs
|
||||
//! Identifying Articulation Points allows improving
|
||||
//! efficiency of spliting a set of Entities into sub-sets
|
||||
class IFGraph_Articulations : public Interface_GraphContent
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! creates Articulations to evaluate a Graph
|
||||
//! whole True : works on the whole Model
|
||||
//! whole False : remains empty, ready to work on a sub-part
|
||||
Standard_EXPORT IFGraph_Articulations(const Interface_Graph& agraph, const Standard_Boolean whole);
|
||||
|
||||
//! adds an entity and its shared ones to the list
|
||||
Standard_EXPORT void GetFromEntity (const Handle(Standard_Transient)& ent);
|
||||
|
||||
//! adds a list of entities (as an iterator)
|
||||
Standard_EXPORT void GetFromIter (const Interface_EntityIterator& iter);
|
||||
|
||||
//! Allows to restart on a new data set
|
||||
Standard_EXPORT void ResetData();
|
||||
|
||||
//! Evaluates the list of Articulation points
|
||||
Standard_EXPORT virtual void Evaluate() Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
//! basic routine of computation
|
||||
//! (see book Sedgewick "Algorithms", p 392)
|
||||
Standard_EXPORT Standard_Integer Visit (const Standard_Integer num);
|
||||
|
||||
|
||||
Interface_Graph thegraph;
|
||||
Standard_Integer thenow;
|
||||
Handle(TColStd_HSequenceOfInteger) thelist;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _IFGraph_Articulations_HeaderFile
|
@@ -1,77 +0,0 @@
|
||||
-- Created on: 1992-09-23
|
||||
-- Created by: Christian CAILLET
|
||||
-- Copyright (c) 1992-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class Compare from IFGraph inherits GraphContent
|
||||
|
||||
---Purpose : this class evaluates effect of two compared sub-parts :
|
||||
-- cumulation (union), common part (intersection-overlapping)
|
||||
-- part specific to first sub-part or to the second one
|
||||
-- Results are kept in a Graph, several question can be set
|
||||
-- Basic Iteration gives Cumulation (union)
|
||||
|
||||
uses Transient, EntityIterator, Graph
|
||||
|
||||
is
|
||||
|
||||
Create (agraph : Graph) returns Compare;
|
||||
---Purpose : creates empty Compare, ready to work
|
||||
|
||||
GetFromEntity (me : in out; ent : any Transient; first : Boolean);
|
||||
---Purpose : adds an entity and its shared ones to the list :
|
||||
-- first True means adds to the first sub-list, else to the 2nd
|
||||
|
||||
GetFromIter (me : in out; iter : EntityIterator; first : Boolean);
|
||||
---Purpose : adds a list of entities (as an iterator) as such, that is,
|
||||
-- their shared entities are not considered (use AllShared to
|
||||
-- have them)
|
||||
-- first True means adds to the first sub-list, else to the 2nd
|
||||
|
||||
Merge (me : in out);
|
||||
---Purpose : merges the second list into the first one, hence the second
|
||||
-- list is empty
|
||||
|
||||
RemoveSecond (me : in out);
|
||||
---Purpose : Removes the contents of second list
|
||||
|
||||
KeepCommon (me : in out);
|
||||
---Purpose : Keeps only Common part, sets it as First list and clears
|
||||
-- second list
|
||||
|
||||
ResetData (me : in out);
|
||||
---Purpose : Allows to restart on a new data set
|
||||
|
||||
-- -- Results -- --
|
||||
-- More-Next-Value-Entity give all entities taken into the Cumulation
|
||||
-- other informations are provided, as EntityIterator : hence they
|
||||
-- are available for other evaluations
|
||||
|
||||
Evaluate (me : in out) is redefined;
|
||||
---Purpose : Recomputes result of comparing to sub-parts
|
||||
|
||||
Common (me) returns EntityIterator;
|
||||
---Purpose : returns entities common to the both parts
|
||||
|
||||
FirstOnly (me) returns EntityIterator;
|
||||
---Purpose : returns entities which are exclusively in the first list
|
||||
|
||||
SecondOnly (me) returns EntityIterator;
|
||||
---Purpose : returns entities which are exclusively in the second part
|
||||
|
||||
fields
|
||||
|
||||
thegraph : Graph;
|
||||
|
||||
end Compare;
|
@@ -11,16 +11,17 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <IFGraph_Compare.ixx>
|
||||
|
||||
#include <IFGraph_AllShared.hxx>
|
||||
|
||||
|
||||
#include <IFGraph_Compare.hxx>
|
||||
#include <Interface_EntityIterator.hxx>
|
||||
#include <Interface_Graph.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
|
||||
// Comparateur de deux sous-ensembles d un Modele
|
||||
// Au premier sous-ensemble, est attribue le Status 1
|
||||
// Au deuxieme sous-ensemble, est attribue le Status 2
|
||||
// La partie commune se voit attribuer le Status 3
|
||||
|
||||
IFGraph_Compare::IFGraph_Compare (const Interface_Graph& agraph)
|
||||
: thegraph (agraph) { }
|
||||
|
||||
|
107
src/IFGraph/IFGraph_Compare.hxx
Normal file
107
src/IFGraph/IFGraph_Compare.hxx
Normal file
@@ -0,0 +1,107 @@
|
||||
// Created on: 1992-09-23
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _IFGraph_Compare_HeaderFile
|
||||
#define _IFGraph_Compare_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Interface_Graph.hxx>
|
||||
#include <Interface_GraphContent.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class Interface_Graph;
|
||||
class Standard_Transient;
|
||||
class Interface_EntityIterator;
|
||||
|
||||
|
||||
//! this class evaluates effect of two compared sub-parts :
|
||||
//! cumulation (union), common part (intersection-overlapping)
|
||||
//! part specific to first sub-part or to the second one
|
||||
//! Results are kept in a Graph, several question can be set
|
||||
//! Basic Iteration gives Cumulation (union)
|
||||
class IFGraph_Compare : public Interface_GraphContent
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! creates empty Compare, ready to work
|
||||
Standard_EXPORT IFGraph_Compare(const Interface_Graph& agraph);
|
||||
|
||||
//! adds an entity and its shared ones to the list :
|
||||
//! first True means adds to the first sub-list, else to the 2nd
|
||||
Standard_EXPORT void GetFromEntity (const Handle(Standard_Transient)& ent, const Standard_Boolean first);
|
||||
|
||||
//! adds a list of entities (as an iterator) as such, that is,
|
||||
//! their shared entities are not considered (use AllShared to
|
||||
//! have them)
|
||||
//! first True means adds to the first sub-list, else to the 2nd
|
||||
Standard_EXPORT void GetFromIter (const Interface_EntityIterator& iter, const Standard_Boolean first);
|
||||
|
||||
//! merges the second list into the first one, hence the second
|
||||
//! list is empty
|
||||
Standard_EXPORT void Merge();
|
||||
|
||||
//! Removes the contents of second list
|
||||
Standard_EXPORT void RemoveSecond();
|
||||
|
||||
//! Keeps only Common part, sets it as First list and clears
|
||||
//! second list
|
||||
Standard_EXPORT void KeepCommon();
|
||||
|
||||
//! Allows to restart on a new data set
|
||||
Standard_EXPORT void ResetData();
|
||||
|
||||
//! Recomputes result of comparing to sub-parts
|
||||
Standard_EXPORT virtual void Evaluate() Standard_OVERRIDE;
|
||||
|
||||
//! returns entities common to the both parts
|
||||
Standard_EXPORT Interface_EntityIterator Common() const;
|
||||
|
||||
//! returns entities which are exclusively in the first list
|
||||
Standard_EXPORT Interface_EntityIterator FirstOnly() const;
|
||||
|
||||
//! returns entities which are exclusively in the second part
|
||||
Standard_EXPORT Interface_EntityIterator SecondOnly() const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Interface_Graph thegraph;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _IFGraph_Compare_HeaderFile
|
@@ -1,36 +0,0 @@
|
||||
-- Created on: 1992-09-23
|
||||
-- Created by: Christian CAILLET
|
||||
-- Copyright (c) 1992-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class ConnectedComponants from IFGraph inherits SubPartsIterator
|
||||
|
||||
---Purpose : determines Connected Componants in a Graph. They define
|
||||
-- disjoined sets of Entities
|
||||
|
||||
uses Graph
|
||||
|
||||
is
|
||||
|
||||
Create (agraph : Graph; whole : Boolean) returns ConnectedComponants;
|
||||
---Purpose : creates with a Graph, and will analyse :
|
||||
-- whole True : all the contents of the Model
|
||||
-- whole False : sub-parts which will be given later
|
||||
|
||||
Evaluate (me : in out) is redefined;
|
||||
---Purpose : does the computation
|
||||
|
||||
-- -- Iteration : More-Next-etc... will give the Connected Componants
|
||||
|
||||
end ConnectedComponants;
|
@@ -11,22 +11,18 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <IFGraph_ConnectedComponants.ixx>
|
||||
|
||||
#include <IFGraph_AllConnected.hxx>
|
||||
#include <IFGraph_ConnectedComponants.hxx>
|
||||
#include <Interface_Graph.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
|
||||
|
||||
|
||||
// Pour travailler, ConnectedComponants exploite AllConnected :
|
||||
// On prend un 1er Vertex, on determine ses AllConnected -> voila un 1er
|
||||
// Connected Componant
|
||||
// On recommence jusqu'a ce qu'il n'y ait plus de Vertex libre
|
||||
|
||||
|
||||
// Honnetement, si ca ne marche pas, cf classe ConnectedVerticesIterator
|
||||
// de GraphTools qui fait en principe la meme chose
|
||||
|
||||
|
||||
IFGraph_ConnectedComponants::IFGraph_ConnectedComponants
|
||||
(const Interface_Graph& agraph, const Standard_Boolean whole)
|
||||
: IFGraph_SubPartsIterator (agraph, whole) { }
|
||||
|
69
src/IFGraph/IFGraph_ConnectedComponants.hxx
Normal file
69
src/IFGraph/IFGraph_ConnectedComponants.hxx
Normal file
@@ -0,0 +1,69 @@
|
||||
// Created on: 1992-09-23
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _IFGraph_ConnectedComponants_HeaderFile
|
||||
#define _IFGraph_ConnectedComponants_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <IFGraph_SubPartsIterator.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class Interface_Graph;
|
||||
|
||||
|
||||
//! determines Connected Componants in a Graph. They define
|
||||
//! disjoined sets of Entities
|
||||
class IFGraph_ConnectedComponants : public IFGraph_SubPartsIterator
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! creates with a Graph, and will analyse :
|
||||
//! whole True : all the contents of the Model
|
||||
//! whole False : sub-parts which will be given later
|
||||
Standard_EXPORT IFGraph_ConnectedComponants(const Interface_Graph& agraph, const Standard_Boolean whole);
|
||||
|
||||
//! does the computation
|
||||
Standard_EXPORT virtual void Evaluate() Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _IFGraph_ConnectedComponants_HeaderFile
|
@@ -1,71 +0,0 @@
|
||||
-- Created on: 1992-09-23
|
||||
-- Created by: Christian CAILLET
|
||||
-- Copyright (c) 1992-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class Cumulate from IFGraph inherits GraphContent
|
||||
|
||||
---Purpose : this class evaluates effect of cumulated sub-parts :
|
||||
-- overlapping, forgotten entities
|
||||
-- Results are kept in a Graph, several question can be set
|
||||
-- Basic Iteration gives entities which are part of Cumulation
|
||||
|
||||
uses Transient, EntityIterator, Graph
|
||||
|
||||
is
|
||||
|
||||
Create (agraph : Graph) returns Cumulate;
|
||||
---Purpose : creates empty Cumulate, ready to work
|
||||
|
||||
GetFromEntity (me : in out; ent : any Transient);
|
||||
---Purpose : adds an entity and its shared ones to the list
|
||||
|
||||
GetFromIter (me : in out; iter : EntityIterator);
|
||||
---Purpose : adds a list of entities (as an iterator) as such, that is,
|
||||
-- without their shared entities (use AllShared to have them)
|
||||
|
||||
ResetData (me : in out);
|
||||
---Purpose : Allows to restart on a new data set
|
||||
|
||||
-- -- Results -- --
|
||||
-- More-Next-Value-Entity give all entities taken into the Cumulation
|
||||
-- other informations are provided, as EntityIterator : hence they
|
||||
-- are available for other evaluations
|
||||
|
||||
Evaluate (me : in out) is redefined;
|
||||
---Purpose : Evaluates the result of cumulation
|
||||
|
||||
Overlapped (me) returns EntityIterator;
|
||||
---Purpose : returns entities which are taken several times
|
||||
|
||||
Forgotten (me) returns EntityIterator;
|
||||
---Purpose : returns entities which are not taken
|
||||
|
||||
PerCount (me; count : Integer = 1) returns EntityIterator;
|
||||
---Purpose : Returns entities taken a given count of times
|
||||
-- (0 : same as Forgotten, 1 : same as no Overlap : default)
|
||||
|
||||
NbTimes (me; ent : Transient) returns Integer;
|
||||
---Purpose : returns number of times an Entity has been counted
|
||||
-- (0 means forgotten, more than 1 means overlap, 1 is normal)
|
||||
|
||||
HighestNbTimes (me) returns Integer;
|
||||
---Purpose : Returns the highest number of times recorded for every Entity
|
||||
-- (0 means empty, 1 means no overlap)
|
||||
|
||||
fields
|
||||
|
||||
thegraph : Graph;
|
||||
|
||||
end Cumulate;
|
@@ -11,11 +11,13 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <IFGraph_Cumulate.ixx>
|
||||
|
||||
#include <IFGraph_AllShared.hxx>
|
||||
#include <IFGraph_Cumulate.hxx>
|
||||
#include <Interface_EntityIterator.hxx>
|
||||
#include <Interface_Graph.hxx>
|
||||
#include <Interface_InterfaceModel.hxx>
|
||||
|
||||
|
||||
#include <Standard_Transient.hxx>
|
||||
|
||||
// Calcul de cumul
|
||||
// Tres simple, on note les entites demandees, et a la fin
|
||||
@@ -24,7 +26,6 @@
|
||||
// Les status demarrent a 2, ainsi a l ajout d une entite, on distingue bien
|
||||
// entre les entites nouvelles, liees a cet appel (statut temporaire 1) et les
|
||||
// autres (statut superieur ou egal a 2)
|
||||
|
||||
IFGraph_Cumulate::IFGraph_Cumulate (const Interface_Graph& agraph)
|
||||
: thegraph (agraph) { }
|
||||
|
||||
|
101
src/IFGraph/IFGraph_Cumulate.hxx
Normal file
101
src/IFGraph/IFGraph_Cumulate.hxx
Normal file
@@ -0,0 +1,101 @@
|
||||
// Created on: 1992-09-23
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _IFGraph_Cumulate_HeaderFile
|
||||
#define _IFGraph_Cumulate_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Interface_Graph.hxx>
|
||||
#include <Interface_GraphContent.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
class Interface_Graph;
|
||||
class Standard_Transient;
|
||||
class Interface_EntityIterator;
|
||||
|
||||
|
||||
//! this class evaluates effect of cumulated sub-parts :
|
||||
//! overlapping, forgotten entities
|
||||
//! Results are kept in a Graph, several question can be set
|
||||
//! Basic Iteration gives entities which are part of Cumulation
|
||||
class IFGraph_Cumulate : public Interface_GraphContent
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! creates empty Cumulate, ready to work
|
||||
Standard_EXPORT IFGraph_Cumulate(const Interface_Graph& agraph);
|
||||
|
||||
//! adds an entity and its shared ones to the list
|
||||
Standard_EXPORT void GetFromEntity (const Handle(Standard_Transient)& ent);
|
||||
|
||||
//! adds a list of entities (as an iterator) as such, that is,
|
||||
//! without their shared entities (use AllShared to have them)
|
||||
Standard_EXPORT void GetFromIter (const Interface_EntityIterator& iter);
|
||||
|
||||
//! Allows to restart on a new data set
|
||||
Standard_EXPORT void ResetData();
|
||||
|
||||
//! Evaluates the result of cumulation
|
||||
Standard_EXPORT virtual void Evaluate() Standard_OVERRIDE;
|
||||
|
||||
//! returns entities which are taken several times
|
||||
Standard_EXPORT Interface_EntityIterator Overlapped() const;
|
||||
|
||||
//! returns entities which are not taken
|
||||
Standard_EXPORT Interface_EntityIterator Forgotten() const;
|
||||
|
||||
//! Returns entities taken a given count of times
|
||||
//! (0 : same as Forgotten, 1 : same as no Overlap : default)
|
||||
Standard_EXPORT Interface_EntityIterator PerCount (const Standard_Integer count = 1) const;
|
||||
|
||||
//! returns number of times an Entity has been counted
|
||||
//! (0 means forgotten, more than 1 means overlap, 1 is normal)
|
||||
Standard_EXPORT Standard_Integer NbTimes (const Handle(Standard_Transient)& ent) const;
|
||||
|
||||
//! Returns the highest number of times recorded for every Entity
|
||||
//! (0 means empty, 1 means no overlap)
|
||||
Standard_EXPORT Standard_Integer HighestNbTimes() const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Interface_Graph thegraph;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _IFGraph_Cumulate_HeaderFile
|
@@ -1,39 +0,0 @@
|
||||
-- Created on: 1992-09-23
|
||||
-- Created by: Christian CAILLET
|
||||
-- Copyright (c) 1992-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class Cycles from IFGraph inherits SubPartsIterator
|
||||
|
||||
---Purpose : determines strong componants in a graph which are Cycles
|
||||
|
||||
uses Graph, StrongComponants
|
||||
|
||||
is
|
||||
|
||||
Create (agraph : Graph; whole : Boolean) returns Cycles;
|
||||
---Purpose : creates with a Graph, and will analyse :
|
||||
-- whole True : all the contents of the Model
|
||||
-- whole False : sub-parts which will be given later
|
||||
|
||||
Create (subparts : in out StrongComponants);
|
||||
---Purpose : creates from a StrongComponants which was already computed
|
||||
|
||||
Evaluate (me : in out) is redefined;
|
||||
---Purpose : does the computation. Cycles are StrongComponants which are
|
||||
-- not Single
|
||||
|
||||
-- -- Iteration : More-Next-etc... will give Cycles
|
||||
|
||||
end Cycles;
|
@@ -11,16 +11,14 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <IFGraph_Cycles.ixx>
|
||||
#include <Interface_GraphContent.hxx>
|
||||
|
||||
#include <IFGraph_Cycles.hxx>
|
||||
#include <IFGraph_StrongComponants.hxx>
|
||||
|
||||
|
||||
#include <Interface_Graph.hxx>
|
||||
#include <Interface_GraphContent.hxx>
|
||||
|
||||
// Cycles utilise les services de StrongComponants :
|
||||
// Il retient les Strong Componants qui ne sont pas Single
|
||||
|
||||
|
||||
IFGraph_Cycles::IFGraph_Cycles
|
||||
(const Interface_Graph& agraph, const Standard_Boolean whole)
|
||||
: IFGraph_SubPartsIterator (agraph,whole) { }
|
||||
|
73
src/IFGraph/IFGraph_Cycles.hxx
Normal file
73
src/IFGraph/IFGraph_Cycles.hxx
Normal file
@@ -0,0 +1,73 @@
|
||||
// Created on: 1992-09-23
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _IFGraph_Cycles_HeaderFile
|
||||
#define _IFGraph_Cycles_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <IFGraph_SubPartsIterator.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class Interface_Graph;
|
||||
class IFGraph_StrongComponants;
|
||||
|
||||
|
||||
//! determines strong componants in a graph which are Cycles
|
||||
class IFGraph_Cycles : public IFGraph_SubPartsIterator
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! creates with a Graph, and will analyse :
|
||||
//! whole True : all the contents of the Model
|
||||
//! whole False : sub-parts which will be given later
|
||||
Standard_EXPORT IFGraph_Cycles(const Interface_Graph& agraph, const Standard_Boolean whole);
|
||||
|
||||
//! creates from a StrongComponants which was already computed
|
||||
Standard_EXPORT IFGraph_Cycles(IFGraph_StrongComponants& subparts);
|
||||
|
||||
//! does the computation. Cycles are StrongComponants which are
|
||||
//! not Single
|
||||
Standard_EXPORT virtual void Evaluate() Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _IFGraph_Cycles_HeaderFile
|
@@ -1,53 +0,0 @@
|
||||
-- Created on: 1992-09-23
|
||||
-- Created by: Christian CAILLET
|
||||
-- Copyright (c) 1992-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class ExternalSources from IFGraph inherits GraphContent
|
||||
|
||||
---Purpose : this class gives entities which are Source of entities of
|
||||
-- a sub-part, but are not contained by this sub-part
|
||||
|
||||
uses Transient, EntityIterator, Graph
|
||||
|
||||
is
|
||||
|
||||
Create (agraph : Graph) returns ExternalSources;
|
||||
---Purpose : creates empty ExternalSources, ready to work
|
||||
|
||||
GetFromEntity (me : in out; ent : any Transient);
|
||||
---Purpose : adds an entity and its shared ones to the list
|
||||
|
||||
GetFromIter (me : in out; iter : EntityIterator);
|
||||
---Purpose : adds a list of entities (as an iterator) with shared ones
|
||||
|
||||
ResetData (me : in out);
|
||||
---Purpose : Allows to restart on a new data set
|
||||
|
||||
-- -- Results -- --
|
||||
-- More-Next-Value give External Source entities
|
||||
|
||||
Evaluate (me : in out) is redefined;
|
||||
---Purpose : Evaluates external sources of a set of entities
|
||||
|
||||
IsEmpty(me : in out) returns Boolean;
|
||||
---Purpose : Returns True if no External Source are found
|
||||
-- It means that we have a "root" set
|
||||
-- (performs an Evaluation as necessary)
|
||||
|
||||
fields
|
||||
|
||||
thegraph : Graph;
|
||||
|
||||
end ExternalSources;
|
@@ -11,9 +11,11 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <IFGraph_ExternalSources.ixx>
|
||||
|
||||
|
||||
#include <IFGraph_ExternalSources.hxx>
|
||||
#include <Interface_EntityIterator.hxx>
|
||||
#include <Interface_Graph.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
|
||||
// ExternalSources exploite les resultats stockes dans le Graphe sur Sharings
|
||||
// Soit les "Sharings" des entites notees par GetFromEntity et GetFromIter
|
||||
@@ -21,8 +23,6 @@
|
||||
// Les status :
|
||||
// - Les entites de depart sont au Status 0
|
||||
// - Les entites Sharing NOUVELLES (ExternalSources) sont au Status 1
|
||||
|
||||
|
||||
IFGraph_ExternalSources::IFGraph_ExternalSources
|
||||
(const Interface_Graph& agraph)
|
||||
: thegraph (agraph) { }
|
||||
|
85
src/IFGraph/IFGraph_ExternalSources.hxx
Normal file
85
src/IFGraph/IFGraph_ExternalSources.hxx
Normal file
@@ -0,0 +1,85 @@
|
||||
// Created on: 1992-09-23
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _IFGraph_ExternalSources_HeaderFile
|
||||
#define _IFGraph_ExternalSources_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Interface_Graph.hxx>
|
||||
#include <Interface_GraphContent.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class Interface_Graph;
|
||||
class Standard_Transient;
|
||||
class Interface_EntityIterator;
|
||||
|
||||
|
||||
//! this class gives entities which are Source of entities of
|
||||
//! a sub-part, but are not contained by this sub-part
|
||||
class IFGraph_ExternalSources : public Interface_GraphContent
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! creates empty ExternalSources, ready to work
|
||||
Standard_EXPORT IFGraph_ExternalSources(const Interface_Graph& agraph);
|
||||
|
||||
//! adds an entity and its shared ones to the list
|
||||
Standard_EXPORT void GetFromEntity (const Handle(Standard_Transient)& ent);
|
||||
|
||||
//! adds a list of entities (as an iterator) with shared ones
|
||||
Standard_EXPORT void GetFromIter (const Interface_EntityIterator& iter);
|
||||
|
||||
//! Allows to restart on a new data set
|
||||
Standard_EXPORT void ResetData();
|
||||
|
||||
//! Evaluates external sources of a set of entities
|
||||
Standard_EXPORT virtual void Evaluate() Standard_OVERRIDE;
|
||||
|
||||
//! Returns True if no External Source are found
|
||||
//! It means that we have a "root" set
|
||||
//! (performs an Evaluation as necessary)
|
||||
Standard_EXPORT Standard_Boolean IsEmpty();
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Interface_Graph thegraph;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _IFGraph_ExternalSources_HeaderFile
|
@@ -1,38 +0,0 @@
|
||||
-- Created on: 1992-09-23
|
||||
-- Created by: Christian CAILLET
|
||||
-- Copyright (c) 1992-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class SCRoots from IFGraph inherits StrongComponants
|
||||
|
||||
---Purpose : determines strong componants in a graph which are Roots
|
||||
|
||||
uses Graph
|
||||
|
||||
is
|
||||
|
||||
Create (agraph : Graph; whole : Boolean) returns SCRoots;
|
||||
---Purpose : creates with a Graph, and will analyse :
|
||||
-- whole True : all the contents of the Model
|
||||
-- whole False : sub-parts which will be given later
|
||||
|
||||
Create (subparts : in out StrongComponants);
|
||||
---Purpose : creates from a StrongComponants which was already computed
|
||||
|
||||
Evaluate (me : in out) is redefined;
|
||||
---Purpose : does the computation
|
||||
|
||||
-- -- Iteration : More-Next-etc... gives Roots (either Loop or not)
|
||||
|
||||
end SCRoots;
|
@@ -11,12 +11,14 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <IFGraph_SCRoots.ixx>
|
||||
//#include <Interface_GraphContent.hxx>
|
||||
#include <IFGraph_StrongComponants.hxx>
|
||||
|
||||
#include <IFGraph_ExternalSources.hxx>
|
||||
#include <IFGraph_SCRoots.hxx>
|
||||
#include <IFGraph_StrongComponants.hxx>
|
||||
#include <Interface_Graph.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
|
||||
//#include <Interface_GraphContent.hxx>
|
||||
IFGraph_SCRoots::IFGraph_SCRoots
|
||||
(const Interface_Graph& agraph, const Standard_Boolean whole)
|
||||
: IFGraph_StrongComponants (agraph,whole) { }
|
||||
|
72
src/IFGraph/IFGraph_SCRoots.hxx
Normal file
72
src/IFGraph/IFGraph_SCRoots.hxx
Normal file
@@ -0,0 +1,72 @@
|
||||
// Created on: 1992-09-23
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _IFGraph_SCRoots_HeaderFile
|
||||
#define _IFGraph_SCRoots_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <IFGraph_StrongComponants.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class Interface_Graph;
|
||||
class IFGraph_StrongComponants;
|
||||
|
||||
|
||||
//! determines strong componants in a graph which are Roots
|
||||
class IFGraph_SCRoots : public IFGraph_StrongComponants
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! creates with a Graph, and will analyse :
|
||||
//! whole True : all the contents of the Model
|
||||
//! whole False : sub-parts which will be given later
|
||||
Standard_EXPORT IFGraph_SCRoots(const Interface_Graph& agraph, const Standard_Boolean whole);
|
||||
|
||||
//! creates from a StrongComponants which was already computed
|
||||
Standard_EXPORT IFGraph_SCRoots(IFGraph_StrongComponants& subparts);
|
||||
|
||||
//! does the computation
|
||||
Standard_EXPORT virtual void Evaluate() Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _IFGraph_SCRoots_HeaderFile
|
@@ -1,36 +0,0 @@
|
||||
-- Created on: 1992-09-23
|
||||
-- Created by: Christian CAILLET
|
||||
-- Copyright (c) 1992-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class StrongComponants from IFGraph inherits SubPartsIterator
|
||||
|
||||
---Purpose : determines strong componants of a graph, that is
|
||||
-- isolated entities (single componants) or loops
|
||||
|
||||
uses Graph
|
||||
|
||||
is
|
||||
|
||||
Create (agraph : Graph; whole : Boolean) returns StrongComponants;
|
||||
---Purpose : creates with a Graph, and will analyse :
|
||||
-- whole True : all the contents of the Model
|
||||
-- whole False : sub-parts which will be given later
|
||||
|
||||
Evaluate (me : in out) is redefined;
|
||||
---Purpose : does the computation
|
||||
|
||||
-- -- Iteration : More-Next-etc... will give strong componants
|
||||
|
||||
end StrongComponants;
|
@@ -11,11 +11,12 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <IFGraph_StrongComponants.ixx>
|
||||
//#include <IFGraph_SortedStrongs.hxx>
|
||||
|
||||
#include <IFGraph_StrongComponants.hxx>
|
||||
#include <Interface_Graph.hxx>
|
||||
#include <Interface_GraphContent.hxx>
|
||||
|
||||
//#include <IFGraph_SortedStrongs.hxx>
|
||||
IFGraph_StrongComponants::IFGraph_StrongComponants
|
||||
(const Interface_Graph& agraph, const Standard_Boolean whole)
|
||||
: IFGraph_SubPartsIterator (agraph, whole) { }
|
||||
|
69
src/IFGraph/IFGraph_StrongComponants.hxx
Normal file
69
src/IFGraph/IFGraph_StrongComponants.hxx
Normal file
@@ -0,0 +1,69 @@
|
||||
// Created on: 1992-09-23
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _IFGraph_StrongComponants_HeaderFile
|
||||
#define _IFGraph_StrongComponants_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <IFGraph_SubPartsIterator.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class Interface_Graph;
|
||||
|
||||
|
||||
//! determines strong componants of a graph, that is
|
||||
//! isolated entities (single componants) or loops
|
||||
class IFGraph_StrongComponants : public IFGraph_SubPartsIterator
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! creates with a Graph, and will analyse :
|
||||
//! whole True : all the contents of the Model
|
||||
//! whole False : sub-parts which will be given later
|
||||
Standard_EXPORT IFGraph_StrongComponants(const Interface_Graph& agraph, const Standard_Boolean whole);
|
||||
|
||||
//! does the computation
|
||||
Standard_EXPORT virtual void Evaluate() Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _IFGraph_StrongComponants_HeaderFile
|
@@ -1,155 +0,0 @@
|
||||
-- Created on: 1992-09-23
|
||||
-- Created by: Christian CAILLET
|
||||
-- Copyright (c) 1992-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class SubPartsIterator from IFGraph
|
||||
|
||||
---Purpose : defines general form for graph classes of which result is
|
||||
-- not a single iteration on Entities, but a nested one :
|
||||
-- External iteration works on sub-parts, identified by each
|
||||
-- class (according to its algorithm)
|
||||
-- Internal Iteration concerns Entities of a sub-part
|
||||
-- Sub-Parts are assumed to be disjoined; if they are not,
|
||||
-- the first one has priority
|
||||
--
|
||||
-- A SubPartsIterator can work in two steps : first, load
|
||||
-- entities which have to be processed
|
||||
-- then, analyse to set those entities into sub-parts
|
||||
|
||||
uses Transient, HSequenceOfInteger, InterfaceModel, EntityIterator,
|
||||
Graph, GraphContent
|
||||
|
||||
raises OutOfRange, NoSuchObject, InterfaceError
|
||||
|
||||
is
|
||||
|
||||
Create (agraph : Graph; whole : Boolean) returns SubPartsIterator;
|
||||
---Purpose : Creates with a Graph, whole or parts of it
|
||||
-- whole True : works on the entire Model
|
||||
-- whole False : empty, ready to be filled
|
||||
-- SubPartIterator is set to load entities
|
||||
|
||||
Create (other : in out SubPartsIterator) returns SubPartsIterator;
|
||||
---Purpose : Creates a SubPartIterator from another one and gets its Data
|
||||
-- Note that only non-empty sub-parts are taken into account
|
||||
-- PartNum is set to the last one
|
||||
|
||||
GetParts (me : in out; other : in out SubPartsIterator)
|
||||
raises InterfaceError;
|
||||
---Purpose : Gets Parts from another SubPartsIterator (in addition to the
|
||||
-- ones already recorded)
|
||||
-- Error if both SubPartsIterators are not based on the same Model
|
||||
|
||||
Graph (me) returns Graph is private;
|
||||
---Purpose : Returns the Graph used by <me>. Used to create another
|
||||
-- SubPartsIterator from <me>
|
||||
---C++ : return const &
|
||||
|
||||
Model (me) returns InterfaceModel;
|
||||
---Purpose : Returns the Model with which this Iterator was created
|
||||
|
||||
AddPart (me : in out);
|
||||
---Purpose : Adds an empty part and sets it to receive entities
|
||||
|
||||
NbParts (me) returns Integer;
|
||||
---Purpose : Returns count of registered parts
|
||||
|
||||
PartNum (me) returns Integer;
|
||||
---Purpose : Returns numero of part which currently receives entities
|
||||
-- (0 at load time)
|
||||
|
||||
SetLoad (me : in out);
|
||||
---Purpose : Sets SubPartIterator to get Entities (by GetFromEntity &
|
||||
-- GetFromIter) into load status, to be analysed later
|
||||
|
||||
SetPartNum (me : in out; num : Integer) raises OutOfRange;
|
||||
---Purpose : Sets numero of receiving part to a new value
|
||||
-- Error if not in range (1-NbParts)
|
||||
|
||||
GetFromEntity (me : in out; ent : any Transient; shared : Boolean);
|
||||
---Purpose : Adds an Entity : into load status if in Load mode, to the
|
||||
-- current part if there is one. If shared is True, adds
|
||||
-- also its shared ones (shared at all levels)
|
||||
|
||||
GetFromIter (me : in out; iter : EntityIterator);
|
||||
---Purpose : Adds a list of Entities (into Load mode or to a Part),
|
||||
-- given as an Iterator
|
||||
|
||||
Reset (me : in out);
|
||||
---Purpose : Erases data (parts, entities) : "me" becomes empty and in
|
||||
-- load status
|
||||
|
||||
Evaluate (me : in out) is virtual;
|
||||
---Purpose : Called by Clear, this method allows evaluation just before
|
||||
-- iteration; its default is doing nothing, it is designed to
|
||||
-- be redefined
|
||||
|
||||
Loaded (me) returns GraphContent;
|
||||
---Purpose : Returns entities which where loaded (not set into a sub-part)
|
||||
|
||||
LoadedGraph (me) returns Graph;
|
||||
---Purpose : Same as above, but under the form of a Graph
|
||||
|
||||
IsLoaded (me; ent : Transient) returns Boolean;
|
||||
---Purpose : Returns True if an Entity is loaded (either set into a
|
||||
-- sub-part or not)
|
||||
|
||||
IsInPart (me; ent : Transient) returns Boolean;
|
||||
---Purpose : Returns True if an Entity is Present in a sub-part
|
||||
|
||||
EntityPartNum (me; ent : Transient) returns Integer;
|
||||
---Purpose : Returns number of the sub-part in which an Entity has been set
|
||||
-- if it is not in a sub-part (or not loaded at all), Returns 0
|
||||
|
||||
-- -- Iteration -- --
|
||||
|
||||
Start (me : in out);
|
||||
---Purpose : Sets iteration to its beginning; calls Evaluate
|
||||
|
||||
More (me : in out) returns Boolean;
|
||||
---Purpose : Returns True if there are more sub-parts to iterate on
|
||||
-- Note : an empty sub-part is not taken in account by Iteration
|
||||
|
||||
Next (me : in out);
|
||||
---Purpose : Sets iteration to the next sub-part
|
||||
-- if there is not, IsSingle-Entities will raises an exception
|
||||
|
||||
IsSingle (me) returns Boolean raises NoSuchObject;
|
||||
---Purpose : Returns True if current sub-part is single (has only one Entity)
|
||||
-- Error if there is no sub-part to iterate now
|
||||
|
||||
FirstEntity (me) returns Transient raises NoSuchObject;
|
||||
---Purpose : Returns the first entity of current sub-part, that is for a
|
||||
-- Single one, the only one it contains
|
||||
-- Error : same as above (end of iteration)
|
||||
|
||||
Entities (me) returns EntityIterator raises NoSuchObject;
|
||||
---Purpose : Returns current sub-part, not as a "Value", but as an Iterator
|
||||
-- on Entities it contains
|
||||
-- Error : same as above (end of iteration)
|
||||
|
||||
Delete (me:out) is virtual;
|
||||
---C++: alias "Standard_EXPORT virtual ~IFGraph_SubPartsIterator() { Delete(); }"
|
||||
|
||||
fields
|
||||
|
||||
thegraph : Graph is protected; -- graph of entities + stores the model
|
||||
-- protected : allows sub-classes to create a Graph Tool directly with it
|
||||
theparts : HSequenceOfInteger; -- for each part, its count of entities
|
||||
thefirsts : HSequenceOfInteger; -- ... number of its first Entity
|
||||
thepart : Integer; -- Part receiving entities (GetFromEntity,GetFromIter)
|
||||
thecurr : Integer; -- Part to be iterated
|
||||
|
||||
end SubPartsIterator;
|
@@ -11,17 +11,21 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <IFGraph_SubPartsIterator.ixx>
|
||||
#include <TColStd_Array1OfInteger.hxx>
|
||||
|
||||
#include <IFGraph_SubPartsIterator.hxx>
|
||||
#include <Interface_EntityIterator.hxx>
|
||||
#include <Interface_Graph.hxx>
|
||||
#include <Interface_GraphContent.hxx>
|
||||
#include <Interface_InterfaceError.hxx>
|
||||
#include <Interface_InterfaceModel.hxx>
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
|
||||
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <TColStd_Array1OfInteger.hxx>
|
||||
|
||||
// SubPartsIterator permet de regrouper les entites en plusieurs sous-parties
|
||||
// A chaque sous-partie est attache un Status : la 1re a 1, la 2e a 2, etc...
|
||||
// (consequence, les sous-parties sont necessairement disjointes)
|
||||
|
||||
IFGraph_SubPartsIterator::IFGraph_SubPartsIterator
|
||||
(const Interface_Graph& agraph, const Standard_Boolean whole)
|
||||
: thegraph (agraph)
|
||||
|
188
src/IFGraph/IFGraph_SubPartsIterator.hxx
Normal file
188
src/IFGraph/IFGraph_SubPartsIterator.hxx
Normal file
@@ -0,0 +1,188 @@
|
||||
// Created on: 1992-09-23
|
||||
// Created by: Christian CAILLET
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _IFGraph_SubPartsIterator_HeaderFile
|
||||
#define _IFGraph_SubPartsIterator_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Interface_Graph.hxx>
|
||||
#include <TColStd_HSequenceOfInteger.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class Standard_OutOfRange;
|
||||
class Standard_NoSuchObject;
|
||||
class Interface_InterfaceError;
|
||||
class Interface_Graph;
|
||||
class Interface_InterfaceModel;
|
||||
class Standard_Transient;
|
||||
class Interface_EntityIterator;
|
||||
class Interface_GraphContent;
|
||||
|
||||
|
||||
//! defines general form for graph classes of which result is
|
||||
//! not a single iteration on Entities, but a nested one :
|
||||
//! External iteration works on sub-parts, identified by each
|
||||
//! class (according to its algorithm)
|
||||
//! Internal Iteration concerns Entities of a sub-part
|
||||
//! Sub-Parts are assumed to be disjoined; if they are not,
|
||||
//! the first one has priority
|
||||
//!
|
||||
//! A SubPartsIterator can work in two steps : first, load
|
||||
//! entities which have to be processed
|
||||
//! then, analyse to set those entities into sub-parts
|
||||
class IFGraph_SubPartsIterator
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Creates with a Graph, whole or parts of it
|
||||
//! whole True : works on the entire Model
|
||||
//! whole False : empty, ready to be filled
|
||||
//! SubPartIterator is set to load entities
|
||||
Standard_EXPORT IFGraph_SubPartsIterator(const Interface_Graph& agraph, const Standard_Boolean whole);
|
||||
|
||||
//! Creates a SubPartIterator from another one and gets its Data
|
||||
//! Note that only non-empty sub-parts are taken into account
|
||||
//! PartNum is set to the last one
|
||||
Standard_EXPORT IFGraph_SubPartsIterator(IFGraph_SubPartsIterator& other);
|
||||
|
||||
//! Gets Parts from another SubPartsIterator (in addition to the
|
||||
//! ones already recorded)
|
||||
//! Error if both SubPartsIterators are not based on the same Model
|
||||
Standard_EXPORT void GetParts (IFGraph_SubPartsIterator& other);
|
||||
|
||||
//! Returns the Model with which this Iterator was created
|
||||
Standard_EXPORT Handle(Interface_InterfaceModel) Model() const;
|
||||
|
||||
//! Adds an empty part and sets it to receive entities
|
||||
Standard_EXPORT void AddPart();
|
||||
|
||||
//! Returns count of registered parts
|
||||
Standard_EXPORT Standard_Integer NbParts() const;
|
||||
|
||||
//! Returns numero of part which currently receives entities
|
||||
//! (0 at load time)
|
||||
Standard_EXPORT Standard_Integer PartNum() const;
|
||||
|
||||
//! Sets SubPartIterator to get Entities (by GetFromEntity &
|
||||
//! GetFromIter) into load status, to be analysed later
|
||||
Standard_EXPORT void SetLoad();
|
||||
|
||||
//! Sets numero of receiving part to a new value
|
||||
//! Error if not in range (1-NbParts)
|
||||
Standard_EXPORT void SetPartNum (const Standard_Integer num);
|
||||
|
||||
//! Adds an Entity : into load status if in Load mode, to the
|
||||
//! current part if there is one. If shared is True, adds
|
||||
//! also its shared ones (shared at all levels)
|
||||
Standard_EXPORT void GetFromEntity (const Handle(Standard_Transient)& ent, const Standard_Boolean shared);
|
||||
|
||||
//! Adds a list of Entities (into Load mode or to a Part),
|
||||
//! given as an Iterator
|
||||
Standard_EXPORT void GetFromIter (const Interface_EntityIterator& iter);
|
||||
|
||||
//! Erases data (parts, entities) : "me" becomes empty and in
|
||||
//! load status
|
||||
Standard_EXPORT void Reset();
|
||||
|
||||
//! Called by Clear, this method allows evaluation just before
|
||||
//! iteration; its default is doing nothing, it is designed to
|
||||
//! be redefined
|
||||
Standard_EXPORT virtual void Evaluate();
|
||||
|
||||
//! Returns entities which where loaded (not set into a sub-part)
|
||||
Standard_EXPORT Interface_GraphContent Loaded() const;
|
||||
|
||||
//! Same as above, but under the form of a Graph
|
||||
Standard_EXPORT Interface_Graph LoadedGraph() const;
|
||||
|
||||
//! Returns True if an Entity is loaded (either set into a
|
||||
//! sub-part or not)
|
||||
Standard_EXPORT Standard_Boolean IsLoaded (const Handle(Standard_Transient)& ent) const;
|
||||
|
||||
//! Returns True if an Entity is Present in a sub-part
|
||||
Standard_EXPORT Standard_Boolean IsInPart (const Handle(Standard_Transient)& ent) const;
|
||||
|
||||
//! Returns number of the sub-part in which an Entity has been set
|
||||
//! if it is not in a sub-part (or not loaded at all), Returns 0
|
||||
Standard_EXPORT Standard_Integer EntityPartNum (const Handle(Standard_Transient)& ent) const;
|
||||
|
||||
//! Sets iteration to its beginning; calls Evaluate
|
||||
Standard_EXPORT void Start();
|
||||
|
||||
//! Returns True if there are more sub-parts to iterate on
|
||||
//! Note : an empty sub-part is not taken in account by Iteration
|
||||
Standard_EXPORT Standard_Boolean More();
|
||||
|
||||
//! Sets iteration to the next sub-part
|
||||
//! if there is not, IsSingle-Entities will raises an exception
|
||||
Standard_EXPORT void Next();
|
||||
|
||||
//! Returns True if current sub-part is single (has only one Entity)
|
||||
//! Error if there is no sub-part to iterate now
|
||||
Standard_EXPORT Standard_Boolean IsSingle() const;
|
||||
|
||||
//! Returns the first entity of current sub-part, that is for a
|
||||
//! Single one, the only one it contains
|
||||
//! Error : same as above (end of iteration)
|
||||
Standard_EXPORT Handle(Standard_Transient) FirstEntity() const;
|
||||
|
||||
//! Returns current sub-part, not as a "Value", but as an Iterator
|
||||
//! on Entities it contains
|
||||
//! Error : same as above (end of iteration)
|
||||
Standard_EXPORT Interface_EntityIterator Entities() const;
|
||||
|
||||
Standard_EXPORT virtual void Delete();
|
||||
Standard_EXPORT virtual ~IFGraph_SubPartsIterator() { Delete(); }
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
Interface_Graph thegraph;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
//! Returns the Graph used by <me>. Used to create another
|
||||
//! SubPartsIterator from <me>
|
||||
Standard_EXPORT const Interface_Graph& Graph() const;
|
||||
|
||||
|
||||
Handle(TColStd_HSequenceOfInteger) theparts;
|
||||
Handle(TColStd_HSequenceOfInteger) thefirsts;
|
||||
Standard_Integer thepart;
|
||||
Standard_Integer thecurr;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _IFGraph_SubPartsIterator_HeaderFile
|
Reference in New Issue
Block a user