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

A ListEditor is an auxiliary operator for Editor/EditForm I.E. it works on parameter values expressed as strings. More...

#include <IFSelect_ListEditor.hxx>

Inheritance diagram for IFSelect_ListEditor:
Inheritance graph
[legend]

Public Member Functions

 IFSelect_ListEditor ()
 Creates a ListEditor with absolutely no constraint.
 
 IFSelect_ListEditor (const occ::handle< Interface_TypedValue > &def, const int max=0)
 Creates a ListEditor, for which items of the list to edit are defined by <def>, and <max> describes max length : 0 (D) means no limit value > 0 means : no more the <max> items are allowed.
 
void LoadModel (const occ::handle< Interface_InterfaceModel > &model)
 Loads a Model. It is used to check items of type Entity(Ident)
 
void LoadValues (const occ::handle< NCollection_HSequence< occ::handle< TCollection_HAsciiString > > > &vals)
 Loads the original values for the list. Remark : If its length is more then MaxLength, editions remain allowed, except Add.
 
void SetTouched ()
 Declares this ListEditor to have been touched (whatever action)
 
void ClearEdit ()
 Clears all editions already recorded.
 
virtual bool LoadEdited (const occ::handle< NCollection_HSequence< occ::handle< TCollection_HAsciiString > > > &list)
 Loads a new list to replace the older one, in once ! By default (can be redefined) checks the length of the list and the value of each item according to the def Items are all recorded as Modified.
 
virtual bool SetValue (const int num, const occ::handle< TCollection_HAsciiString > &val)
 Sets a new value for the item <num> (in edited list) <val> may be a Null Handle, then the value will be cleared but not removed Returns True when done. False if <num> is out of range or if <val> does not satisfy the definition.
 
virtual bool AddValue (const occ::handle< TCollection_HAsciiString > &val, const int atnum=0)
 Adds a new item. By default appends (at the end of the list) Can insert before a given rank <num>, if positive Returns True when done. False if MaxLength may be overpassed or if <val> does not satisfy the definition.
 
virtual bool Remove (const int num=0, const int howmany=1)
 Removes items from the list By default removes one item. Else, count given by <howmany> Remove from rank <num> included. By default, from the end Returns True when done, False (and does not work) if case of out of range of if <howmany> is greater than current length.
 
occ::handle< NCollection_HSequence< occ::handle< TCollection_HAsciiString > > > OriginalValues () const
 Returns the value from which the edition started.
 
occ::handle< NCollection_HSequence< occ::handle< TCollection_HAsciiString > > > EditedValues () const
 Returns the result of the edition.
 
int NbValues (const bool edited=true) const
 Returns count of values, edited (D) or original.
 
occ::handle< TCollection_HAsciiStringValue (const int num, const bool edited=true) const
 Returns a value given its rank. Edited (D) or Original A Null String means the value is cleared but not removed.
 
bool IsChanged (const int num) const
 Tells if a value (in edited list) has been changed, i.e. either modified-value, or added.
 
bool IsModified (const int num) const
 Tells if a value (in edited list) has been modified-value (not added)
 
bool IsAdded (const int num) const
 Tells if a value (in edited list) has been added (new one)
 
bool IsTouched () const
 Tells if at least one edition (SetValue-AddValue-Remove) has been recorded.
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor.
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing.
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter.
 
virtual ~Standard_Transient ()=default
 Destructor must be virtual.
 
virtual const opencascade::handle< Standard_Type > & DynamicType () const
 Returns a type descriptor about this object.
 
bool IsInstance (const opencascade::handle< Standard_Type > &theType) const
 Returns a true value if this is an instance of Type.
 
bool IsInstance (const char *const theTypeName) const
 Returns a true value if this is an instance of TypeName.
 
bool IsKind (const opencascade::handle< Standard_Type > &theType) const
 Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism.
 
bool IsKind (const char *const theTypeName) const
 Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism.
 
Standard_TransientThis () const
 Returns non-const pointer to this object (like const_cast). For protection against creating handle to objects allocated in stack or call from constructor, it will raise exception Standard_ProgramError if reference counter is zero.
 
int GetRefCount () const noexcept
 Get the reference counter of this object.
 
void IncrementRefCounter () noexcept
 Increments the reference counter of this object. Uses relaxed memory ordering since incrementing only requires atomicity, not synchronization with other memory operations.
 
int DecrementRefCounter () noexcept
 Decrements the reference counter of this object; returns the decremented value. Uses release ordering for the decrement to ensure all writes to the object are visible before the count reaches zero. An acquire fence is added only when the count reaches zero, ensuring proper synchronization before deletion. This is more efficient than using acq_rel for every decrement.
 
virtual void Delete () const
 Memory deallocator for transient classes.
 

Additional Inherited Members

- Public Types inherited from Standard_Transient
typedef void base_type
 Returns a type descriptor about this object.
 
- Static Public Member Functions inherited from Standard_Transient
static constexpr const charget_type_name ()
 Returns a type descriptor about this object.
 
static const opencascade::handle< Standard_Type > & get_type_descriptor ()
 Returns type descriptor of Standard_Transient class.
 

Detailed Description

A ListEditor is an auxiliary operator for Editor/EditForm I.E. it works on parameter values expressed as strings.

For a parameter which is a list, it may not be edited in once by just setting a new value (as a string)

Firstly, a list can be long (and tedious to be accessed flat) then requires a better way of accessing

Moreover, not only its VALUES may be changed (SetValue), but also its LENGTH : items may be added or removed ...

Hence, the way of editing a parameter as a list is :

An EditList is produced by the Editor, with a basic definition This definition (brought by this class) can be redefined Hence the Editor may produce a specific ListEditor as needed

Constructor & Destructor Documentation

◆ IFSelect_ListEditor() [1/2]

IFSelect_ListEditor::IFSelect_ListEditor ( )

Creates a ListEditor with absolutely no constraint.

◆ IFSelect_ListEditor() [2/2]

IFSelect_ListEditor::IFSelect_ListEditor ( const occ::handle< Interface_TypedValue > & def,
const int max = 0 )

Creates a ListEditor, for which items of the list to edit are defined by <def>, and <max> describes max length : 0 (D) means no limit value > 0 means : no more the <max> items are allowed.

Member Function Documentation

◆ AddValue()

virtual bool IFSelect_ListEditor::AddValue ( const occ::handle< TCollection_HAsciiString > & val,
const int atnum = 0 )
virtual

Adds a new item. By default appends (at the end of the list) Can insert before a given rank <num>, if positive Returns True when done. False if MaxLength may be overpassed or if <val> does not satisfy the definition.

◆ ClearEdit()

void IFSelect_ListEditor::ClearEdit ( )

Clears all editions already recorded.

◆ EditedValues()

occ::handle< NCollection_HSequence< occ::handle< TCollection_HAsciiString > > > IFSelect_ListEditor::EditedValues ( ) const

Returns the result of the edition.

◆ IsAdded()

bool IFSelect_ListEditor::IsAdded ( const int num) const

Tells if a value (in edited list) has been added (new one)

◆ IsChanged()

bool IFSelect_ListEditor::IsChanged ( const int num) const

Tells if a value (in edited list) has been changed, i.e. either modified-value, or added.

◆ IsModified()

bool IFSelect_ListEditor::IsModified ( const int num) const

Tells if a value (in edited list) has been modified-value (not added)

◆ IsTouched()

bool IFSelect_ListEditor::IsTouched ( ) const

Tells if at least one edition (SetValue-AddValue-Remove) has been recorded.

◆ LoadEdited()

virtual bool IFSelect_ListEditor::LoadEdited ( const occ::handle< NCollection_HSequence< occ::handle< TCollection_HAsciiString > > > & list)
virtual

Loads a new list to replace the older one, in once ! By default (can be redefined) checks the length of the list and the value of each item according to the def Items are all recorded as Modified.

If no def has been given at creation time, no check is done Returns True when done, False if checks have failed ... a specialisation may also lock it by returning always False ...

◆ LoadModel()

void IFSelect_ListEditor::LoadModel ( const occ::handle< Interface_InterfaceModel > & model)

Loads a Model. It is used to check items of type Entity(Ident)

◆ LoadValues()

void IFSelect_ListEditor::LoadValues ( const occ::handle< NCollection_HSequence< occ::handle< TCollection_HAsciiString > > > & vals)

Loads the original values for the list. Remark : If its length is more then MaxLength, editions remain allowed, except Add.

◆ NbValues()

int IFSelect_ListEditor::NbValues ( const bool edited = true) const

Returns count of values, edited (D) or original.

◆ OriginalValues()

occ::handle< NCollection_HSequence< occ::handle< TCollection_HAsciiString > > > IFSelect_ListEditor::OriginalValues ( ) const

Returns the value from which the edition started.

◆ Remove()

virtual bool IFSelect_ListEditor::Remove ( const int num = 0,
const int howmany = 1 )
virtual

Removes items from the list By default removes one item. Else, count given by <howmany> Remove from rank <num> included. By default, from the end Returns True when done, False (and does not work) if case of out of range of if <howmany> is greater than current length.

◆ SetTouched()

void IFSelect_ListEditor::SetTouched ( )

Declares this ListEditor to have been touched (whatever action)

◆ SetValue()

virtual bool IFSelect_ListEditor::SetValue ( const int num,
const occ::handle< TCollection_HAsciiString > & val )
virtual

Sets a new value for the item <num> (in edited list) <val> may be a Null Handle, then the value will be cleared but not removed Returns True when done. False if <num> is out of range or if <val> does not satisfy the definition.

◆ Value()

occ::handle< TCollection_HAsciiString > IFSelect_ListEditor::Value ( const int num,
const bool edited = true ) const

Returns a value given its rank. Edited (D) or Original A Null String means the value is cleared but not removed.


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