Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Member Functions
Interface_IntList Class Reference

This class detains the data which describe a Graph. A Graph has two lists, one for shared refs, one for sharing refs (the reverses). Each list comprises, for each Entity of the Model of the Graph, a list of Entities (shared or sharing). In fact, entities are identified by their numbers in the Model or Graph : this gives better performances. More...

#include <Interface_IntList.hxx>

Public Member Functions

 Interface_IntList ()
 Creates empty IntList.
 
 Interface_IntList (const int nbe)
 Creates an IntList for <nbe> entities.
 
 Interface_IntList (const Interface_IntList &other, const bool copied)
 Creates an IntList from another one. if <copied> is True, copies data else, data are not copied, only the header object is.
 
void Initialize (const int nbe)
 Initialize IntList by number of entities.
 
int NbReferences () const
 Returns count of stored references.
 
const occ::handle< NCollection_HArray1< int > > & Entities () const
 Returns entity headers used to describe the lists.
 
const occ::handle< NCollection_HArray1< int > > & References () const
 Returns the packed references storage.
 
void Internals (int &nbrefs, occ::handle< NCollection_HArray1< int > > &ents, occ::handle< NCollection_HArray1< int > > &refs) const
 Returns internal values, used for copying.
 
int NbEntities () const
 Returns count of entities to be acknowledged.
 
void SetNbEntities (const int nbe)
 Changes the count of entities (ignored if decreased)
 
void SetNumber (const int number)
 Sets an entity number as current (for read and fill)
 
int Number () const
 Returns the current entity number.
 
Interface_IntList List (const int number, const bool copied=false) const
 Returns an IntList, identical to <me> but set to a specified entity Number By default, not copied (in order to be read) Specified <copied> to produce another list and edit it.
 
void SetRedefined (const bool mode)
 Sets current entity list to be redefined or not This is used in a Graph for redefinition list : it can be disable (no redefinition, i.e. list is cleared), or enabled (starts as empty). The original list has not to be "redefined".
 
void Reservate (const int count)
 Makes a reservation for <count> references to be later attached to the current entity. If required, it increases the size of array used to store refs. Remark that if count is less than two, it does nothing (because immediate storing)
 
void Add (const int ref)
 Adds a reference (as an integer value, an entity number) to the current entity number. Zero is ignored.
 
int Length () const
 Returns the count of refs attached to current entity number.
 
bool IsRedefined (const int num=0) const
 Returns True if the list for a number (default is taken as current) is "redefined" (useful for empty list)
 
int Value (const int num) const
 Returns a reference number in the list for current number, according to its rank.
 
bool Remove (const int num)
 Removes an item in the list for current number, given its rank Returns True if done, False else.
 
void Clear ()
 Clears all data, hence each entity number has an empty list.
 
void AdjustSize (const int margin=0)
 Resizes lists to exact sizes. For list of refs, a positive margin can be added.
 

Detailed Description

This class detains the data which describe a Graph. A Graph has two lists, one for shared refs, one for sharing refs (the reverses). Each list comprises, for each Entity of the Model of the Graph, a list of Entities (shared or sharing). In fact, entities are identified by their numbers in the Model or Graph : this gives better performances.

A simple way to implement this is to instantiate a HArray1 with a HSequenceOfInteger : each Entity Number designates a value, which is a Sequence (if it is null, it is considered as empty : this is a little optimisation).

This class gives a more efficient way to implement this. It has two lists (two arrays of integers), one to describe list (empty, one value given immediately, or negated index in the second list), one to store refs (pointed from the first list). This is much more efficient than a list of sequences, in terms of speed (especially for read) and of memory

An IntList can also be set to access data for a given entity number, it then acts as a single sequence

Remark that if an IntList is created from another one, it can be read, but if it is created without copying, it may not be edited

Constructor & Destructor Documentation

◆ Interface_IntList() [1/3]

Interface_IntList::Interface_IntList ( )

Creates empty IntList.

◆ Interface_IntList() [2/3]

Interface_IntList::Interface_IntList ( const int nbe)

Creates an IntList for <nbe> entities.

◆ Interface_IntList() [3/3]

Interface_IntList::Interface_IntList ( const Interface_IntList & other,
const bool copied )

Creates an IntList from another one. if <copied> is True, copies data else, data are not copied, only the header object is.

Member Function Documentation

◆ Add()

void Interface_IntList::Add ( const int ref)

Adds a reference (as an integer value, an entity number) to the current entity number. Zero is ignored.

◆ AdjustSize()

void Interface_IntList::AdjustSize ( const int margin = 0)

Resizes lists to exact sizes. For list of refs, a positive margin can be added.

◆ Clear()

void Interface_IntList::Clear ( )

Clears all data, hence each entity number has an empty list.

◆ Entities()

const occ::handle< NCollection_HArray1< int > > & Interface_IntList::Entities ( ) const

Returns entity headers used to describe the lists.

Returns
handle to the array of entity headers

◆ Initialize()

void Interface_IntList::Initialize ( const int nbe)

Initialize IntList by number of entities.

◆ Internals()

void Interface_IntList::Internals ( int & nbrefs,
occ::handle< NCollection_HArray1< int > > & ents,
occ::handle< NCollection_HArray1< int > > & refs ) const

Returns internal values, used for copying.

Deprecated

Use NbReferences(), Entities(), and References() instead.

("Use NbReferences(), Entities(), and References() instead")

◆ IsRedefined()

bool Interface_IntList::IsRedefined ( const int num = 0) const

Returns True if the list for a number (default is taken as current) is "redefined" (useful for empty list)

◆ Length()

int Interface_IntList::Length ( ) const

Returns the count of refs attached to current entity number.

◆ List()

Interface_IntList Interface_IntList::List ( const int number,
const bool copied = false ) const

Returns an IntList, identical to <me> but set to a specified entity Number By default, not copied (in order to be read) Specified <copied> to produce another list and edit it.

◆ NbEntities()

int Interface_IntList::NbEntities ( ) const

Returns count of entities to be acknowledged.

◆ NbReferences()

int Interface_IntList::NbReferences ( ) const

Returns count of stored references.

Returns
number of references

◆ Number()

int Interface_IntList::Number ( ) const

Returns the current entity number.

◆ References()

const occ::handle< NCollection_HArray1< int > > & Interface_IntList::References ( ) const

Returns the packed references storage.

Returns
handle to the array of packed references

◆ Remove()

bool Interface_IntList::Remove ( const int num)

Removes an item in the list for current number, given its rank Returns True if done, False else.

◆ Reservate()

void Interface_IntList::Reservate ( const int count)

Makes a reservation for <count> references to be later attached to the current entity. If required, it increases the size of array used to store refs. Remark that if count is less than two, it does nothing (because immediate storing)

◆ SetNbEntities()

void Interface_IntList::SetNbEntities ( const int nbe)

Changes the count of entities (ignored if decreased)

◆ SetNumber()

void Interface_IntList::SetNumber ( const int number)

Sets an entity number as current (for read and fill)

◆ SetRedefined()

void Interface_IntList::SetRedefined ( const bool mode)

Sets current entity list to be redefined or not This is used in a Graph for redefinition list : it can be disable (no redefinition, i.e. list is cleared), or enabled (starts as empty). The original list has not to be "redefined".

◆ Value()

int Interface_IntList::Value ( const int num) const

Returns a reference number in the list for current number, according to its rank.


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