OCC Main Page | DataExchange | Toolkits | Packages | Class Hierarchy | Data Structures | File List | Data Fields | Globals

# DataExchange
TKXSBase
Interface

# Interface_Graph Class Reference

Gives basic data structure for operating and storing
graph results (usage is normally internal)
Entities are Mapped according their Number in the Model
Each Entity from the Model can be known as "Present" or
not; if it is, it is Mapped with a Status : an Integer
which can be used according to needs of each algorithm
In addition, the Graph brings a BitMap which can be used
by any caller
Also, it is bound with two lists : a list of Shared
Entities (in fact, their Numbers in the Model) which is
filled by a ShareTool, and a list of Sharing Entities,
computed by deduction from the Shared Lists
Moreover, it is possible to redefine the list of Entities
Shared by an Entity (instead of standard answer by general
service Shareds) : this new list can be empty; it can
be changed or reset (i.e. to come back to standard answer)
.

`#include <Interface_Graph.hxx>`

## Public Member Functions
void * | operator new (size_t, void *anAddress)
void * | operator new (size_t size)
void | operator delete (void *anAddress)
Standard_EXPORT | Interface_Graph (const Handle(Interface_InterfaceModel)&amodel, const Interface_GeneralLib &lib)
| Creates an empty graph, ready to receive Entities from amodel Note that this way of Creation allows <me> to verify that Entities to work with are contained in <amodel> Basic Shared and Sharing lists are obtained from a General Services Library, given directly as an argument .
Standard_EXPORT | Interface_Graph (const Handle(Interface_InterfaceModel)&amodel, const Handle(Interface_Protocol)&protocol)
| Same as above, but the Library is defined through a Protocol .
Standard_EXPORT | Interface_Graph (const Handle(Interface_InterfaceModel)&amodel, const Handle(Interface_GTool)&gtool)
| Same as above, but the Library is defined through a Protocol .
Standard_EXPORT | Interface_Graph (const Handle(Interface_InterfaceModel)&amodel)
| Same a above but works with the Protocol recorded in the Model .
Standard_EXPORT | Interface_Graph (const Interface_Graph &agraph, const Standard_Boolean copied=Standard_False)
| Creates a Graph from another one, getting all its data Remark that status are copied from <agraph>, but the other lists (sharing/shared) are copied only if <copied> = True .
Standard_EXPORT void | EvalSharings ()
| Reevaluates the Sharing Lists of the Graph, starting from the Shared Lists (priority to the redefined ones) .
Standard_EXPORT void | Reset ()
| Erases data, making graph ready to rebegin from void (also resets Shared lists redefinitions) .
Standard_EXPORT void | ResetStatus ()
| Erases Status (Values and Flags of Presence), making graph ready to rebegin from void. Does not concerns Shared lists .
Standard_EXPORT Standard_Integer | Size () const
| Returns size (max nb of entities, i.e. Model's nb of entities) .
Standard_EXPORT Standard_Integer | EntityNumber (const Handle(Standard_Transient)&ent) const
| Returns the Number of the entity in the Map, computed at creation time (Entities loaded from the Model) Returns 0 if <ent> not contained by Model used to create <me> (that is, <ent> is unknown from <me>) .
Standard_EXPORT Standard_Boolean | IsPresent (const Standard_Integer num) const
| Returns True if an Entity is noted as present in the graph (See methods Get... which determine this status) Returns False if <num> is out of range too .
Standard_EXPORT Standard_Boolean | IsPresent (const Handle(Standard_Transient)&ent) const
| Same as above but directly on an Entity <ent> : if it is not contained in the Model, returns False. Else calls IsPresent(num) with <num> given by EntityNumber .
Standard_EXPORT const Handle_Standard_Transient & | Entity (const Standard_Integer num) const
| Returns mapped Entity given its no (if it is present) .
Standard_EXPORT Standard_Integer | Status (const Standard_Integer num) const
| Returns Status associated to a numero (only to read it) .
Standard_EXPORT Standard_Integer & | CStatus (const Standard_Integer num)
| Returns Status associated to a numero, to be read or changed .
Standard_EXPORT void | SetStatus (const Standard_Integer num, const Standard_Integer stat)
| Modifies Status associated to a numero .
Standard_EXPORT void | RemoveItem (const Standard_Integer num)
| Clears Entity and sets Status to 0, for a numero .
Standard_EXPORT void | ChangeStatus (const Standard_Integer oldstat, const Standard_Integer newstat)
| Changes all status which value is oldstat to new value newstat .
Standard_EXPORT void | RemoveStatus (const Standard_Integer stat)
| Removes all items of which status has a given value stat .
Standard_EXPORT const Interface_BitMap & | BitMap () const
| Returns the Bit Map in order to read or edit flag values .
Standard_EXPORT Interface_BitMap & | CBitMap ()
| Returns the Bit Map in order to edit it (add new flags) .
Standard_EXPORT const Handle_Interface_InterfaceModel & | Model () const
| Returns the Model with which this Graph was created .
Standard_EXPORT void | GetFromModel ()
| Loads Graph with all Entities contained in the Model .
Standard_EXPORT void | GetFromEntity (const Handle(Standard_Transient)&ent, const Standard_Boolean shared, const Standard_Integer newstat=0)
| Gets an Entity, plus its shared ones (at every level) if "shared" is True. New items are set to status "newstat" Items already present in graph remain unchanged Of course, redefinitions of Shared lists are taken into account if there are some .
Standard_EXPORT void | GetFromEntity (const Handle(Standard_Transient)&ent, const Standard_Boolean shared, const Standard_Integer newstat, const Standard_Integer overlapstat, const Standard_Boolean cumul)
| Gets an Entity, plus its shared ones (at every level) if "shared" is True. New items are set to status "newstat". Items already present in graph are processed as follows : - if they already have status "newstat", they remain unchanged - if they have another status, this one is modified : if cumul is True, to former status + overlapstat (cumul) if cumul is False, to overlapstat (enforce) .
Standard_EXPORT void | GetFromIter (const Interface_EntityIterator &iter, const Standard_Integer newstat)
| Gets Entities given by an EntityIterator. Entities which were not yet present in the graph are mapped with status "newstat" Entities already present remain unchanged .
Standard_EXPORT void | GetFromIter (const Interface_EntityIterator &iter, const Standard_Integer newstat, const Standard_Integer overlapstat, const Standard_Boolean cumul)
| Gets Entities given by an EntityIterator and distinguishes those already present in the Graph : - new entities added to the Graph with status "newstst" - entities already present with status = "newstat" remain unchanged - entities already present with status different form "newstat" have their status modified : if cumul is True, to former status + overlapstat (cumul) if cumul is False, to overlapstat (enforce) (Note : works as GetEntity, shared = False, for each entity) .
Standard_EXPORT void | GetFromGraph (const Interface_Graph &agraph)
| Gets all present items from another graph .
Standard_EXPORT void | GetFromGraph (const Interface_Graph &agraph, const Standard_Integer stat)
| Gets items from another graph which have a specific Status .
Standard_EXPORT Standard_Boolean | HasShareErrors (const Handle(Standard_Transient)&ent) const
| Returns True if <ent> or the list of entities shared by <ent> (not redefined) contains items unknown from this Graph Remark : apart from the status HasShareError, these items are ignored .
Standard_EXPORT Standard_Boolean | HasRedefinedShareds (const Handle(Standard_Transient)&ent) const
| Returns True if Shared list of <ent> has been redefined (Thus, Shareds from Graph gives a result different from general service Shareds) .
Standard_EXPORT Interface_EntityIterator | Shareds (const Handle(Standard_Transient)&ent) const
| Returns the list of Entities Shared by an Entity, as recorded by the Graph. That is, by default Basic Shared List, else it can be redefined by methods SetShare, SetNoShare ... see below .
Standard_EXPORT Interface_IntList | SharedNums (const Standard_Integer num) const
| Same as Shareds, but under the form of a list of Integers, each one beeing the Number of a Shared Entity in the Graph Especially intended for fast internal uses Returns a Null Handle if <num> is not contained by <themodel> .
Standard_EXPORT Interface_EntityIterator | Sharings (const Handle(Standard_Transient)&ent) const
| Returns the list of Entities which Share an Entity, computed from the Basic or Redefined Shared Lists .
Standard_EXPORT Interface_IntList | SharingNums (const Standard_Integer num) const
| Same as Sharings, but under the form of a list of Integers each one beeing the Number of a Sharing Entity in the Graph .
Standard_EXPORT Interface_EntityIterator | TypedSharings (const Handle(Standard_Transient)&ent, const Handle(Standard_Type)&type) const
| Returns the list of sharings entities, AT ANY LEVEL, which are kind of a given type. A sharing entity kind of this type ends the exploration of its branch .
Standard_EXPORT Interface_EntityIterator | RootEntities () const
| Returns the Entities which are not Shared (their Sharing List is empty) in the Model .
Standard_EXPORT void | SetShare (const Handle(Standard_Transient)&ent)
| Sets explicit the shared list of an Entity <ent>, that is, available for a further edit (Add/Remove). All SetShare and SetNoShare methods allow further edit operations. Effect cancelled by ResetShare Remark that all Redefinition methods work on Shared Lists, but also manage (update) the Sharing Lists .
Standard_EXPORT void | SetShare (const Handle(Standard_Transient)&ent, const Interface_EntityIterator &list)
| Sets as Shared list of an Entity <ent> considered by <me>, the list given as an EntityIterator <iter>. It can be empty. This list will now be considered by method Shareds above Does nothing if <ent> is not contained by <themodel> .
Standard_EXPORT void | SetShare (const Handle(Standard_Transient)&ent, const Interface_IntList &list)
| Same as above, but the list is given as the list of Numbers of the Entities shared by <ent> .
Standard_EXPORT void | SetNoShare (const Handle(Standard_Transient)&ent)
| Sets the Shared list of an Entity considered in <me> as beeing Empty (if <ent> is contained by <themodel>) .
Standard_EXPORT void | SetNoShare (const Interface_EntityIterator &list)
| Sets the Shared lists of a list of Entities to be Empty .
Standard_EXPORT void | AddShared (const Handle(Standard_Transient)&ent, const Handle(Standard_Transient)&shared)
| Adds a shared Entity to a redefined Shared List (formerly defined by SetShare or SetNoShare). Does nothing if already in .
Standard_EXPORT void | RemoveShared (const Handle(Standard_Transient)&ent, const Handle(Standard_Transient)&shared)
| Removes a shared Entity from a redefined Shared List (formerly defined ...). Does nothing if <shared> no in the list .
Standard_EXPORT void | ResetShare (const Handle(Standard_Transient)&ent)
| Comes back to the standard Shared list for <ent> : Cancels all the former redefinitions for it .
Standard_EXPORT void | ResetAllShare ()
| Clears all effects of former redefinition of Shared lists .
Standard_EXPORT Handle_TCollection_HAsciiString | Name (const Handle(Standard_Transient)&ent) const
| Determines the name attached to an entity, by using the general service Name in GeneralModule Returns a null handle if no name could be computed or if the entity is not in the model .
## Private Member Functions
Standard_EXPORT void | Evaluate (const Interface_GeneralLib &lib, const Handle(Interface_GTool)&gtool)
| Performs the Evaluation of the Graph, from an initial Library, either defined through a Protocol, or given dierctly Called by the non-empty Constructors Normally, gtool suffices. But if a Graph is created from a GeneralLib directly, it cannot be used If <gtool> is defined, it has priority .
Standard_EXPORT Interface_IntList | BasicSharedTable () const
| Returns the Table of Basic Shared lists. Used to Create another Graph from <me> .
Standard_EXPORT Interface_IntList | RedefinedSharedTable () const
| Returns the Table of redefined Shared lists. Used to Create another Graph from <me>. Null Handle is no one redefinition .
Standard_EXPORT Interface_IntList | SharingTable () const
| Returns the Table of Sharing lists. Used to Create another Graph from <me> .
## Private Attributes
Handle_Interface_InterfaceModel | themodel
TCollection_AsciiString | thepresents
TColStd_Array1OfInteger | thestats
Interface_BitMap | theflags
Interface_IntList | theshareds
Interface_IntList | thesharnews
Interface_IntList | thesharings

## Constructor & Destructor Documentation

Standard_EXPORT Interface_Graph::Interface_Graph | ( | const Handle(Interface_InterfaceModel)& | amodel,
|  | const Interface_GeneralLib & | lib
| ) |

Standard_EXPORT Interface_Graph::Interface_Graph | ( | const Handle(Interface_InterfaceModel)& | amodel,
|  | const Handle(Interface_Protocol)& | protocol
| ) |

Standard_EXPORT Interface_Graph::Interface_Graph | ( | const Handle(Interface_InterfaceModel)& | amodel,
|  | const Handle(Interface_GTool)& | gtool
| ) |

Standard_EXPORT Interface_Graph::Interface_Graph | ( | const Handle(Interface_InterfaceModel)& | amodel | ) |

Standard_EXPORT Interface_Graph::Interface_Graph | ( | const Interface_Graph & | agraph,
|  | const Standard_Boolean | copied = `Standard_False`
| ) |

## Member Function Documentation

Standard_EXPORT void Interface_Graph::AddShared | ( | const Handle(Standard_Transient)& | ent,
|  | const Handle(Standard_Transient)& | shared
| ) |

Standard_EXPORT Interface_IntList Interface_Graph::BasicSharedTable | ( |  | ) | const`[private]`

Standard_EXPORT const Interface_BitMap& Interface_Graph::BitMap | ( |  | ) | const

Standard_EXPORT Interface_BitMap& Interface_Graph::CBitMap | ( |  | ) |

Standard_EXPORT void Interface_Graph::ChangeStatus | ( | const Standard_Integer | oldstat,
|  | const Standard_Integer | newstat
| ) |

Standard_EXPORT Standard_Integer& Interface_Graph::CStatus | ( | const Standard_Integer | num | ) |

Standard_EXPORT const Handle_Standard_Transient& Interface_Graph::Entity | ( | const Standard_Integer | num | ) | const

Standard_EXPORT Standard_Integer Interface_Graph::EntityNumber | ( | const Handle(Standard_Transient)& | ent | ) | const

Standard_EXPORT void Interface_Graph::EvalSharings | ( |  | ) |

Standard_EXPORT void Interface_Graph::Evaluate | ( | const Interface_GeneralLib & | lib,
|  | const Handle(Interface_GTool)& | gtool
| ) | `[private]`

Standard_EXPORT void Interface_Graph::GetFromEntity | ( | const Handle(Standard_Transient)& | ent,
|  | const Standard_Boolean | shared,
|  | const Standard_Integer | newstat,
|  | const Standard_Integer | overlapstat,
|  | const Standard_Boolean | cumul
| ) |

Standard_EXPORT void Interface_Graph::GetFromEntity | ( | const Handle(Standard_Transient)& | ent,
|  | const Standard_Boolean | shared,
|  | const Standard_Integer | newstat = `0`
| ) |

Standard_EXPORT void Interface_Graph::GetFromGraph | ( | const Interface_Graph & | agraph,
|  | const Standard_Integer | stat
| ) |

Standard_EXPORT void Interface_Graph::GetFromGraph | ( | const Interface_Graph & | agraph | ) |

Standard_EXPORT void Interface_Graph::GetFromIter | ( | const Interface_EntityIterator & | iter,
|  | const Standard_Integer | newstat,
|  | const Standard_Integer | overlapstat,
|  | const Standard_Boolean | cumul
| ) |

Standard_EXPORT void Interface_Graph::GetFromIter | ( | const Interface_EntityIterator & | iter,
|  | const Standard_Integer | newstat
| ) |

Standard_EXPORT void Interface_Graph::GetFromModel | ( |  | ) |

Standard_EXPORT Standard_Boolean Interface_Graph::HasRedefinedShareds | ( | const Handle(Standard_Transient)& | ent | ) | const

Standard_EXPORT Standard_Boolean Interface_Graph::HasShareErrors | ( | const Handle(Standard_Transient)& | ent | ) | const

Standard_EXPORT Standard_Boolean Interface_Graph::IsPresent | ( | const Handle(Standard_Transient)& | ent | ) | const

Standard_EXPORT Standard_Boolean Interface_Graph::IsPresent | ( | const Standard_Integer | num | ) | const

Standard_EXPORT const Handle_Interface_InterfaceModel& Interface_Graph::Model | ( |  | ) | const

Standard_EXPORT Handle_TCollection_HAsciiString Interface_Graph::Name | ( | const Handle(Standard_Transient)& | ent | ) | const

void Interface_Graph::operator delete | ( | void * | anAddress | ) | `[inline]`

void* Interface_Graph::operator new | ( | size_t | size | ) | `[inline]`

void* Interface_Graph::operator new | ( | size_t | ,
|  | void * | anAddress
| ) | `[inline]`

Standard_EXPORT Interface_IntList Interface_Graph::RedefinedSharedTable | ( |  | ) | const`[private]`

Standard_EXPORT void Interface_Graph::RemoveItem | ( | const Standard_Integer | num | ) |

Standard_EXPORT void Interface_Graph::RemoveShared | ( | const Handle(Standard_Transient)& | ent,
|  | const Handle(Standard_Transient)& | shared
| ) |

Standard_EXPORT void Interface_Graph::RemoveStatus | ( | const Standard_Integer | stat | ) |

Standard_EXPORT void Interface_Graph::Reset | ( |  | ) |

Standard_EXPORT void Interface_Graph::ResetAllShare | ( |  | ) |

Standard_EXPORT void Interface_Graph::ResetShare | ( | const Handle(Standard_Transient)& | ent | ) |

Standard_EXPORT void Interface_Graph::ResetStatus | ( |  | ) |

Standard_EXPORT Interface_EntityIterator Interface_Graph::RootEntities | ( |  | ) | const

Standard_EXPORT void Interface_Graph::SetNoShare | ( | const Interface_EntityIterator & | list | ) |

Standard_EXPORT void Interface_Graph::SetNoShare | ( | const Handle(Standard_Transient)& | ent | ) |

Standard_EXPORT void Interface_Graph::SetShare | ( | const Handle(Standard_Transient)& | ent,
|  | const Interface_IntList & | list
| ) |

Standard_EXPORT void Interface_Graph::SetShare | ( | const Handle(Standard_Transient)& | ent,
|  | const Interface_EntityIterator & | list
| ) |

Standard_EXPORT void Interface_Graph::SetShare | ( | const Handle(Standard_Transient)& | ent | ) |

Standard_EXPORT void Interface_Graph::SetStatus | ( | const Standard_Integer | num,
|  | const Standard_Integer | stat
| ) |

Standard_EXPORT Interface_IntList Interface_Graph::SharedNums | ( | const Standard_Integer | num | ) | const

Standard_EXPORT Interface_EntityIterator Interface_Graph::Shareds | ( | const Handle(Standard_Transient)& | ent | ) | const

Standard_EXPORT Interface_IntList Interface_Graph::SharingNums | ( | const Standard_Integer | num | ) | const

Standard_EXPORT Interface_EntityIterator Interface_Graph::Sharings | ( | const Handle(Standard_Transient)& | ent | ) | const

Standard_EXPORT Interface_IntList Interface_Graph::SharingTable | ( |  | ) | const`[private]`

Standard_EXPORT Standard_Integer Interface_Graph::Size | ( |  | ) | const

Standard_EXPORT Standard_Integer Interface_Graph::Status | ( | const Standard_Integer | num | ) | const

Standard_EXPORT Interface_EntityIterator Interface_Graph::TypedSharings | ( | const Handle(Standard_Transient)& | ent,
|  | const Handle(Standard_Type)& | type
| ) | const

## Field Documentation

Interface_BitMap Interface_Graph::theflags`[private]`

Handle_Interface_InterfaceModel Interface_Graph::themodel`[private]`

TCollection_AsciiString Interface_Graph::thepresents`[private]`

Interface_IntList Interface_Graph::theshareds`[private]`

Interface_IntList Interface_Graph::thesharings`[private]`

Interface_IntList Interface_Graph::thesharnews`[private]`

TColStd_Array1OfInteger Interface_Graph::thestats`[private]`

The documentation for this class was generated from the following file:

- Interface_Graph.hxx