OCCT3D OCCT 8.0.1
OCCT documentation

Search guides and API reference

Enter at least two characters.

    Open CASCADE Technology Reference Manual 8.0.1
    Interface_BitMap Class Reference

    A bit map simply allows to associate a boolean flag to each item of a list, such as a list of entities, etc... numbered between 1 and a positive count nbitems. More...

    #include <Interface_BitMap.hxx>

    Public Member Functions

     Interface_BitMap ()
     Creates a empty BitMap.
     Interface_BitMap (const int nbitems, const int resflags=0)
     Creates a BitMap for <nbitems> items One flag is defined, n0 0 <resflags> prepares allocation for <resflags> more flags Flags values start at false.
    void Initialize (const int nbitems, const int resflags=0)
     Initialize empty bit by <nbitems> items One flag is defined, n0 0 <resflags> prepares allocation for <resflags> more flags Flags values start at false.
     Interface_BitMap (const Interface_BitMap &other, const bool copied=false)
     Creates a BitMap from another one if <copied> is True, copies data else, data are not copied, only the header object is.
    void Initialize (const Interface_BitMap &other, const bool copied=false)
     Initialize a BitMap from another one.
    void Reservate (const int moreflags)
     Reservates for a count of more flags.
    void SetLength (const int nbitems)
     Sets for a new count of items, which can be either less or greater than the former one For new items, their flags start at false.
    int AddFlag (const char *const namename="")
     Adds a flag, a name can be attached to it Returns its flag number Makes required reservation.
    int AddSomeFlags (const int more)
     Adds several flags (<more>) with no name Returns the number of last added flag.
    bool RemoveFlag (const int numnum)
     Removes a flag given its number. Returns True if done, false if num is out of range.
    bool SetFlagName (const int numnum, const char *const namename)
     Sets a name for a flag, given its number name can be empty (to erase the name of a flag) Returns True if done, false if : num is out of range, or name non-empty already set to another flag.
    int NbFlags () const
     Returns the count of flags (flag 0 not included).
    int Length () const
     Returns the count of items (i.e. the length of the bitmap).
    const char * FlagName (const int numnum) const
     Returns the name recorded for a flag, or an empty string.
    int FlagNumber (const char *const namename) const
     Returns the number or a flag given its name, or zero.
    bool Value (const int item, const int flag=0) const
     Returns the value (true/false) of a flag, from :
    void SetValue (const int item, const bool valval, const int flag=0) const
     Sets a new value for a flag.
    void SetTrue (const int item, const int flag=0) const
     Sets a flag to True.
    void SetFalse (const int item, const int flag=0) const
     Sets a flag to False.
    bool CTrue (const int item, const int flag=0) const
     Returns the former value for a flag and sets it to True (before : value returned; after : True).
    bool CFalse (const int item, const int flag=0) const
     Returns the former value for a flag and sets it to False (before : value returned; after : False).
    void Init (const bool valval, const int flag=0) const
     Initialises all the values of Flag Number <flag> to a given value <val>.
    void Clear ()
     Clear all field of bit map.

    Detailed Description

    A bit map simply allows to associate a boolean flag to each item of a list, such as a list of entities, etc... numbered between 1 and a positive count nbitems.

    The BitMap class allows to associate several binary flags, each of one is identified by a number from 0 to a count which can remain at zero or be positive : nbflags

    Flags lists over than numflag=0 are added after creation Each of one can be named, hence the user can identify it either by its flag number or by a name which gives a flag n0 (flag n0 0 has no name)

    Constructor & Destructor Documentation

    ◆ Interface_BitMap() [1/3]

    Interface_BitMap::Interface_BitMap ( )

    Creates a empty BitMap.

    ◆ Interface_BitMap() [2/3]

    Interface_BitMap::Interface_BitMap ( const int nbitems,
    const int resflags = 0 )

    Creates a BitMap for <nbitems> items One flag is defined, n0 0 <resflags> prepares allocation for <resflags> more flags Flags values start at false.

    ◆ Interface_BitMap() [3/3]

    Interface_BitMap::Interface_BitMap ( const Interface_BitMap & other,
    const bool copied = false )

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

    Member Function Documentation

    ◆ AddFlag()

    int Interface_BitMap::AddFlag ( const char *const name = "")

    Adds a flag, a name can be attached to it Returns its flag number Makes required reservation.

    ◆ AddSomeFlags()

    int Interface_BitMap::AddSomeFlags ( const int more)

    Adds several flags (<more>) with no name Returns the number of last added flag.

    ◆ CFalse()

    bool Interface_BitMap::CFalse ( const int item,
    const int flag = 0 ) const

    Returns the former value for a flag and sets it to False (before : value returned; after : False).

    ◆ Clear()

    void Interface_BitMap::Clear ( )

    Clear all field of bit map.

    ◆ CTrue()

    bool Interface_BitMap::CTrue ( const int item,
    const int flag = 0 ) const

    Returns the former value for a flag and sets it to True (before : value returned; after : True).

    ◆ FlagName()

    const char * Interface_BitMap::FlagName ( const int num) const

    Returns the name recorded for a flag, or an empty string.

    ◆ FlagNumber()

    int Interface_BitMap::FlagNumber ( const char *const name) const

    Returns the number or a flag given its name, or zero.

    ◆ Init()

    void Interface_BitMap::Init ( const bool val,
    const int flag = 0 ) const

    Initialises all the values of Flag Number <flag> to a given value <val>.

    ◆ Initialize() [1/2]

    void Interface_BitMap::Initialize ( const int nbitems,
    const int resflags = 0 )

    Initialize empty bit by <nbitems> items One flag is defined, n0 0 <resflags> prepares allocation for <resflags> more flags Flags values start at false.

    ◆ Initialize() [2/2]

    void Interface_BitMap::Initialize ( const Interface_BitMap & other,
    const bool copied = false )

    Initialize a BitMap from another one.

    ◆ Length()

    int Interface_BitMap::Length ( ) const

    Returns the count of items (i.e. the length of the bitmap).

    ◆ NbFlags()

    int Interface_BitMap::NbFlags ( ) const

    Returns the count of flags (flag 0 not included).

    ◆ RemoveFlag()

    bool Interface_BitMap::RemoveFlag ( const int num)

    Removes a flag given its number. Returns True if done, false if num is out of range.

    ◆ Reservate()

    void Interface_BitMap::Reservate ( const int moreflags)

    Reservates for a count of more flags.

    ◆ SetFalse()

    void Interface_BitMap::SetFalse ( const int item,
    const int flag = 0 ) const

    Sets a flag to False.

    ◆ SetFlagName()

    bool Interface_BitMap::SetFlagName ( const int num,
    const char *const name )

    Sets a name for a flag, given its number name can be empty (to erase the name of a flag) Returns True if done, false if : num is out of range, or name non-empty already set to another flag.

    ◆ SetLength()

    void Interface_BitMap::SetLength ( const int nbitems)

    Sets for a new count of items, which can be either less or greater than the former one For new items, their flags start at false.

    ◆ SetTrue()

    void Interface_BitMap::SetTrue ( const int item,
    const int flag = 0 ) const

    Sets a flag to True.

    ◆ SetValue()

    void Interface_BitMap::SetValue ( const int item,
    const bool val,
    const int flag = 0 ) const

    Sets a new value for a flag.

    ◆ Value()

    bool Interface_BitMap::Value ( const int item,
    const int flag = 0 ) const

    Returns the value (true/false) of a flag, from :

    • the number of the item
    • the flag number, by default 0

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