Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes
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. More...

#include <Interface_Graph.hxx>

Public Member Functions

 Interface_Graph (const occ::handle< Interface_InterfaceModel > &amodel, const Interface_GeneralLib &lib, const bool theModeStats=true)
 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.
 
 Interface_Graph (const occ::handle< Interface_InterfaceModel > &amodel, const occ::handle< Interface_Protocol > &protocol, const bool theModeStats=true)
 Same as above, but the Library is defined through a Protocol.
 
 Interface_Graph (const occ::handle< Interface_InterfaceModel > &amodel, const occ::handle< Interface_GTool > &gtool, const bool theModeStats=true)
 Same as above, but the Library is defined through a Protocol.
 
 Interface_Graph (const occ::handle< Interface_InterfaceModel > &amodel, const bool theModeStats=true)
 Same a above but works with the Protocol recorded in the Model.
 
 Interface_Graph (const Interface_Graph &agraph, const bool copied=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.
 
Interface_Graphoperator= (const Interface_Graph &theOther)
 Assignment.
 
void Reset ()
 Erases data, making graph ready to rebegin from void (also resets Shared lists redefinitions)
 
void ResetStatus ()
 Erases Status (Values and Flags of Presence), making graph ready to rebegin from void. Does not concerns Shared lists.
 
int Size () const
 Returns size (max nb of entities, i.e. Model's nb of entities)
 
int NbStatuses () const
 Returns size of array of statuses.
 
int EntityNumber (const occ::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>)
 
bool IsPresent (const int 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.
 
bool IsPresent (const occ::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.
 
const occ::handle< Standard_Transient > & Entity (const int num) const
 Returns mapped Entity given its no (if it is present)
 
int Status (const int num) const
 Returns Status associated to a numero (only to read it)
 
void SetStatus (const int num, const int stat)
 Modifies Status associated to a numero.
 
void RemoveItem (const int num)
 Clears Entity and sets Status to 0, for a numero.
 
void ChangeStatus (const int oldstat, const int newstat)
 Changes all status which value is oldstat to new value newstat.
 
void RemoveStatus (const int stat)
 Removes all items of which status has a given value stat.
 
const Interface_BitMapBitMap () const
 Returns the Bit Map in order to read or edit flag values.
 
Interface_BitMapCBitMap ()
 Returns the Bit Map in order to edit it (add new flags)
 
const occ::handle< Interface_InterfaceModel > & Model () const
 Returns the Model with which this Graph was created.
 
void GetFromModel ()
 Loads Graph with all Entities contained in the Model.
 
void GetFromEntity (const occ::handle< Standard_Transient > &ent, const bool shared, const int 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.
 
void GetFromEntity (const occ::handle< Standard_Transient > &ent, const bool shared, const int newstat, const int overlapstat, const bool 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 :
 
void GetFromIter (const Interface_EntityIterator &iter, const int 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.
 
void GetFromIter (const Interface_EntityIterator &iter, const int newstat, const int overlapstat, const bool cumul)
 Gets Entities given by an EntityIterator and distinguishes those already present in the Graph :
 
void GetFromGraph (const Interface_Graph &agraph)
 Gets all present items from another graph.
 
void GetFromGraph (const Interface_Graph &agraph, const int stat)
 Gets items from another graph which have a specific Status.
 
bool HasShareErrors (const occ::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.
 
occ::handle< NCollection_HSequence< occ::handle< Standard_Transient > > > GetShareds (const occ::handle< Standard_Transient > &ent) const
 Returns the sequence of Entities Shared by an Entity.
 
Interface_EntityIterator Shareds (const occ::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.
 
Interface_EntityIterator Sharings (const occ::handle< Standard_Transient > &ent) const
 Returns the list of Entities which Share an Entity, computed from the Basic or Redefined Shared Lists.
 
occ::handle< NCollection_HSequence< occ::handle< Standard_Transient > > > GetSharings (const occ::handle< Standard_Transient > &ent) const
 Returns the sequence of Entities Sharings by an Entity.
 
Interface_EntityIterator TypedSharings (const occ::handle< Standard_Transient > &ent, const occ::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.
 
Interface_EntityIterator RootEntities () const
 Returns the Entities which are not Shared (their Sharing List is empty) in the Model.
 
occ::handle< TCollection_HAsciiStringName (const occ::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.
 
const occ::handle< NCollection_HArray1< NCollection_List< int > > > & SharingTable () const
 Returns the Table of Sharing lists. Used to Create another Graph from <me>
 
bool ModeStat () const
 Returns mode responsible for computation of statuses;.
 

Protected Member Functions

void InitStats ()
 Initialize statuses and flags.
 

Protected Attributes

occ::handle< Interface_InterfaceModelthemodel
 
TCollection_AsciiString thepresents
 
occ::handle< NCollection_HArray1< int > > thestats
 
occ::handle< NCollection_HArray1< NCollection_List< int > > > thesharings
 

Detailed Description

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)

Constructor & Destructor Documentation

◆ Interface_Graph() [1/5]

Interface_Graph::Interface_Graph ( const occ::handle< Interface_InterfaceModel > & amodel,
const Interface_GeneralLib & lib,
const bool theModeStats = true )

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.

◆ Interface_Graph() [2/5]

Interface_Graph::Interface_Graph ( const occ::handle< Interface_InterfaceModel > & amodel,
const occ::handle< Interface_Protocol > & protocol,
const bool theModeStats = true )

Same as above, but the Library is defined through a Protocol.

◆ Interface_Graph() [3/5]

Interface_Graph::Interface_Graph ( const occ::handle< Interface_InterfaceModel > & amodel,
const occ::handle< Interface_GTool > & gtool,
const bool theModeStats = true )

Same as above, but the Library is defined through a Protocol.

◆ Interface_Graph() [4/5]

Interface_Graph::Interface_Graph ( const occ::handle< Interface_InterfaceModel > & amodel,
const bool theModeStats = true )

Same a above but works with the Protocol recorded in the Model.

◆ Interface_Graph() [5/5]

Interface_Graph::Interface_Graph ( const Interface_Graph & agraph,
const bool copied = 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.

Member Function Documentation

◆ BitMap()

const Interface_BitMap & Interface_Graph::BitMap ( ) const

Returns the Bit Map in order to read or edit flag values.

◆ CBitMap()

Interface_BitMap & Interface_Graph::CBitMap ( )

Returns the Bit Map in order to edit it (add new flags)

◆ ChangeStatus()

void Interface_Graph::ChangeStatus ( const int oldstat,
const int newstat )

Changes all status which value is oldstat to new value newstat.

◆ Entity()

const occ::handle< Standard_Transient > & Interface_Graph::Entity ( const int num) const

Returns mapped Entity given its no (if it is present)

◆ EntityNumber()

int Interface_Graph::EntityNumber ( const occ::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>)

◆ GetFromEntity() [1/2]

void Interface_Graph::GetFromEntity ( const occ::handle< Standard_Transient > & ent,
const bool shared,
const int newstat,
const int overlapstat,
const bool 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)

◆ GetFromEntity() [2/2]

void Interface_Graph::GetFromEntity ( const occ::handle< Standard_Transient > & ent,
const bool shared,
const int 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.

◆ GetFromGraph() [1/2]

void Interface_Graph::GetFromGraph ( const Interface_Graph & agraph)

Gets all present items from another graph.

◆ GetFromGraph() [2/2]

void Interface_Graph::GetFromGraph ( const Interface_Graph & agraph,
const int stat )

Gets items from another graph which have a specific Status.

◆ GetFromIter() [1/2]

void Interface_Graph::GetFromIter ( const Interface_EntityIterator & iter,
const int 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.

◆ GetFromIter() [2/2]

void Interface_Graph::GetFromIter ( const Interface_EntityIterator & iter,
const int newstat,
const int overlapstat,
const bool 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)

◆ GetFromModel()

void Interface_Graph::GetFromModel ( )

Loads Graph with all Entities contained in the Model.

◆ GetShareds()

occ::handle< NCollection_HSequence< occ::handle< Standard_Transient > > > Interface_Graph::GetShareds ( const occ::handle< Standard_Transient > & ent) const

Returns the sequence of Entities Shared by an Entity.

◆ GetSharings()

occ::handle< NCollection_HSequence< occ::handle< Standard_Transient > > > Interface_Graph::GetSharings ( const occ::handle< Standard_Transient > & ent) const

Returns the sequence of Entities Sharings by an Entity.

◆ HasShareErrors()

bool Interface_Graph::HasShareErrors ( const occ::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.

◆ InitStats()

void Interface_Graph::InitStats ( )
protected

Initialize statuses and flags.

◆ IsPresent() [1/2]

bool Interface_Graph::IsPresent ( const int 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.

◆ IsPresent() [2/2]

bool Interface_Graph::IsPresent ( const occ::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.

◆ Model()

const occ::handle< Interface_InterfaceModel > & Interface_Graph::Model ( ) const

Returns the Model with which this Graph was created.

◆ ModeStat()

bool Interface_Graph::ModeStat ( ) const

Returns mode responsible for computation of statuses;.

◆ Name()

occ::handle< TCollection_HAsciiString > Interface_Graph::Name ( const occ::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.

◆ NbStatuses()

int Interface_Graph::NbStatuses ( ) const

Returns size of array of statuses.

◆ operator=()

Interface_Graph & Interface_Graph::operator= ( const Interface_Graph & theOther)

Assignment.

◆ RemoveItem()

void Interface_Graph::RemoveItem ( const int num)

Clears Entity and sets Status to 0, for a numero.

◆ RemoveStatus()

void Interface_Graph::RemoveStatus ( const int stat)

Removes all items of which status has a given value stat.

◆ Reset()

void Interface_Graph::Reset ( )

Erases data, making graph ready to rebegin from void (also resets Shared lists redefinitions)

◆ ResetStatus()

void Interface_Graph::ResetStatus ( )

Erases Status (Values and Flags of Presence), making graph ready to rebegin from void. Does not concerns Shared lists.

◆ RootEntities()

Interface_EntityIterator Interface_Graph::RootEntities ( ) const

Returns the Entities which are not Shared (their Sharing List is empty) in the Model.

◆ SetStatus()

void Interface_Graph::SetStatus ( const int num,
const int stat )

Modifies Status associated to a numero.

◆ Shareds()

Interface_EntityIterator Interface_Graph::Shareds ( const occ::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.

◆ Sharings()

Interface_EntityIterator Interface_Graph::Sharings ( const occ::handle< Standard_Transient > & ent) const

Returns the list of Entities which Share an Entity, computed from the Basic or Redefined Shared Lists.

◆ SharingTable()

const occ::handle< NCollection_HArray1< NCollection_List< int > > > & Interface_Graph::SharingTable ( ) const

Returns the Table of Sharing lists. Used to Create another Graph from <me>

◆ Size()

int Interface_Graph::Size ( ) const

Returns size (max nb of entities, i.e. Model's nb of entities)

◆ Status()

int Interface_Graph::Status ( const int num) const

Returns Status associated to a numero (only to read it)

◆ TypedSharings()

Interface_EntityIterator Interface_Graph::TypedSharings ( const occ::handle< Standard_Transient > & ent,
const occ::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.

Field Documentation

◆ themodel

occ::handle<Interface_InterfaceModel> Interface_Graph::themodel
protected

◆ thepresents

TCollection_AsciiString Interface_Graph::thepresents
protected

◆ thesharings

occ::handle<NCollection_HArray1<NCollection_List<int> > > Interface_Graph::thesharings
protected

◆ thestats

occ::handle<NCollection_HArray1<int> > Interface_Graph::thestats
protected

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