![]() |
Open CASCADE Technology Reference Manual 8.0.0
|
An EditForm is the way to apply an Editor on an Entity or on the Model It gives read-only or read-write access, with or without undo. More...
#include <IFSelect_EditForm.hxx>

Public Member Functions | |
| IFSelect_EditForm (const occ::handle< IFSelect_Editor > &editor, const bool readonly, const bool undoable, const char *const label="") | |
| Creates a complete EditForm from an Editor A specific Label can be given. | |
| IFSelect_EditForm (const occ::handle< IFSelect_Editor > &editor, const NCollection_Sequence< int > &nums, const bool readonly, const bool undoable, const char *const label="") | |
| Creates an extracted EditForm from an Editor, limited to the values identified in <nums> A specific Label can be given. | |
| bool & | EditKeepStatus () |
| Returns and may change the keep status on modif It starts as False If it is True, Apply does not clear modification status and the EditForm can be loaded again, modified value remain and may be applied again Remark that ApplyData does not clear the modification status, a call to ClearEdit does. | |
| const char * | Label () const |
| bool | IsLoaded () const |
| Tells if the EditForm is loaded now. | |
| void | ClearData () |
| void | SetData (const occ::handle< Standard_Transient > &ent, const occ::handle< Interface_InterfaceModel > &model) |
| void | SetEntity (const occ::handle< Standard_Transient > &ent) |
| void | SetModel (const occ::handle< Interface_InterfaceModel > &model) |
| occ::handle< Standard_Transient > | Entity () const |
| occ::handle< Interface_InterfaceModel > | Model () const |
| occ::handle< IFSelect_Editor > | Editor () const |
| bool | IsComplete () const |
| Tells if an EditForm is complete or is an extract from Editor. | |
| int | NbValues (const bool editable) const |
| Returns the count of values <editable> True : count of editable values, i.e. For a complete EditForm, it is given by the Editor Else, it is the length of the extraction map <editable> False : all the values from the Editor. | |
| int | NumberFromRank (const int rank) const |
| Returns the Value Number in the Editor from a given Rank in the EditForm For a complete EditForm, both are equal Else, it is given by the extraction map Returns 0 if <rank> exceeds the count of editable values,. | |
| int | RankFromNumber (const int number) const |
| Returns the Rank in the EditForm from a given Number of Value for the Editor For a complete EditForm, both are equal Else, it is given by the extraction map Returns 0 if <number> is not forecast to be edited, or is out of range. | |
| int | NameNumber (const char *const name) const |
| Returns the Value Number in the Editor for a given Name i.e. the true ValueNumber which can be used in various methods of EditForm If it is not complete, for a recorded (in the Editor) but non-loaded name, returns negative value (- number) | |
| int | NameRank (const char *const name) const |
| Returns the Rank of Value in the EditForm for a given Name i.e. if it is not complete, for a recorded (in the Editor) but non-loaded name, returns 0. | |
| void | LoadDefault () |
| For a read-write undoable EditForm, loads original values from defaults stored in the Editor. | |
| virtual bool | LoadData (const occ::handle< Standard_Transient > &ent, const occ::handle< Interface_InterfaceModel > &model) |
| Loads modifications to data Default uses Editor. Can be redefined Remark that <ent> and/or <model> may be null, according to the kind of Editor. Shortcuts are available for these cases, but they finally call LoadData (hence, just ignore non-used args) | |
| bool | LoadEntity (const occ::handle< Standard_Transient > &ent) |
| Shortcut for LoadData when <model> is not used. | |
| bool | LoadModel (const occ::handle< Interface_InterfaceModel > &model) |
| Shortcut for LoadData when only the model is concerned. | |
| bool | LoadData () |
| Shortcut when both <ent> and <model> are not used (when the Editor works on fully static or global data) | |
| occ::handle< IFSelect_ListEditor > | ListEditor (const int num) const |
| Returns a ListEditor to edit the parameter <num> of the EditForm, if it is a List The Editor created it (by ListEditor) then loads it (by ListValue) For a single parameter, returns a Null Handle ... | |
| void | LoadValue (const int num, const occ::handle< TCollection_HAsciiString > &val) |
| Loads an original value (single). Called by the Editor only. | |
| void | LoadList (const int num, const occ::handle< NCollection_HSequence< occ::handle< TCollection_HAsciiString > > > &list) |
| Loads an original value as a list. Called by the Editor only. | |
| occ::handle< TCollection_HAsciiString > | OriginalValue (const int num) const |
| From an edited value, returns its ... value (original one) Null means that this value is not defined <num> is for the EditForm, not the Editor It is for a single parameter. For a list, gives a Null Handle. | |
| occ::handle< NCollection_HSequence< occ::handle< TCollection_HAsciiString > > > | OriginalList (const int num) const |
| Returns an original value, as a list <num> is for the EditForm, not the Editor For a single parameter, gives a Null Handle. | |
| occ::handle< TCollection_HAsciiString > | EditedValue (const int num) const |
| Returns the Edited (i.e. Modified) Value (string for single) <num> reports to the EditForm If IsModified is False, returns OriginalValue Null with IsModified True : means that this value is not defined or has been removed It is for a single parameter. For a list, gives a Null Handle. | |
| occ::handle< NCollection_HSequence< occ::handle< TCollection_HAsciiString > > > | EditedList (const int num) const |
| Returns the Edited Value as a list If IsModified is False, returns OriginalValue Null with IsModified True : means that this value is not defined or has been removed For a single parameter, gives a Null Handle. | |
| bool | IsModified (const int num) const |
| Tells if a Value (of the EditForm) is modified (directly or through touching by Update) | |
| bool | IsTouched (const int num) const |
| Tells if a Value (of the EditForm) has been touched, i.e. not modified directly but by the modification of another one (by method Update from the Editor) | |
| bool | Modify (const int num, const occ::handle< TCollection_HAsciiString > &newval, const bool enforce=false) |
| Gives a new value for the item <num> of the EditForm, if it is a single parameter (for a list, just returns False) Null means to Remove it <enforce> True to overpass Protected or Computed Access Mode Calls the method Update from the Editor, which can touch other parameters (see NbTouched) Returns True if well recorded, False if this value is not allowed Warning : Does not apply immediately : will be applied by the method Apply. | |
| bool | ModifyList (const int num, const occ::handle< IFSelect_ListEditor > &edited, const bool enforce=false) |
| Changes the value of an item of the EditForm, if it is a List (else, just returns False) The ListEditor contains the edited values of the list If no edition was recorded, just returns False Calls the method Update from the Editor, which can touch other parameters (see NbTouched) Returns True if well recorded, False if this value is not allowed Warning : Does not apply immediately : will be applied by the method Apply. | |
| bool | ModifyListValue (const int num, const occ::handle< NCollection_HSequence< occ::handle< TCollection_HAsciiString > > > &list, const bool enforce=false) |
| As ModifyList but the new value is given as such Creates a ListEditor, Loads it, then calls ModifyList. | |
| bool | Touch (const int num, const occ::handle< TCollection_HAsciiString > &newval) |
| Gives a new value computed by the Editor, if another parameter commands the value of <num> It is generally the case for a Computed Parameter for instance Increments the counter of touched parameters Warning : it gives no protection for ReadOnly etc... while it is the internal way of touching parameters Does not work (returns False) if <num> is for a list. | |
| bool | TouchList (const int num, const occ::handle< NCollection_HSequence< occ::handle< TCollection_HAsciiString > > > &newlist) |
| Acts as Touch but for a list Does not work (returns False) if <num> is for a single param. | |
| int | NbTouched () const |
| Returns the count of parameters touched by the last Modify (apart from the modified parameter itself) Normally it is zero. | |
| void | ClearEdit (const int num=0) |
| Clears modification status : by default all, or one by its numbers (in the Editor) | |
| void | PrintDefs (Standard_OStream &S) const |
| Prints Definitions, relative to the Editor. | |
| void | PrintValues (Standard_OStream &S, const int what, const bool names, const bool alsolist=false) const |
| Prints Values, according to what and alsolist <names> True : prints Long Names; False : prints Short Names <what> < 0 : prints Original Values (+ flag Modified) <what> > 0 : prints Final Values (+flag Modified) <what> = 0 : prints Modified Values (Original + Edited) <alsolist> False (D) : lists are printed only as their count <alsolist> True : lists are printed for all their items. | |
| bool | Apply () |
| Applies modifications to own data Calls ApplyData then Clears Status according EditKeepStatus. | |
| virtual bool | Recognize () const |
| Tells if this EditForm can work with its Editor and its actual Data (Entity and Model) Default uses Editor. Can be redefined. | |
| virtual bool | ApplyData (const occ::handle< Standard_Transient > &ent, const occ::handle< Interface_InterfaceModel > &model) |
| Applies modifications to data Default uses Editor. Can be redefined. | |
| bool | Undo () |
| For an undoable EditForm, Applies ... origibal values ! and clears modified ones Can be run only once. | |
Public Member Functions inherited from Standard_Transient | |
| Standard_Transient () | |
| Empty constructor. | |
| Standard_Transient (const Standard_Transient &) | |
| Copy constructor – does nothing. | |
| Standard_Transient & | operator= (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_Transient * | This () 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 char * | get_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. | |
An EditForm is the way to apply an Editor on an Entity or on the Model It gives read-only or read-write access, with or without undo.
It can be complete (all the values of the Editor are present) or partial (a sub-list of these value are present) Anyway, all references to Number (argument <num>) refer to Number of Value for the Editor While references to Rank are for rank in the EditForm, which may differ if it is not Complete Two methods give the correspondence between this Number and the Rank in the EditForm : RankFromNumber and NumberFromRank
| IFSelect_EditForm::IFSelect_EditForm | ( | const occ::handle< IFSelect_Editor > & | editor, |
| const bool | readonly, | ||
| const bool | undoable, | ||
| const char *const | label = "" ) |
Creates a complete EditForm from an Editor A specific Label can be given.
| IFSelect_EditForm::IFSelect_EditForm | ( | const occ::handle< IFSelect_Editor > & | editor, |
| const NCollection_Sequence< int > & | nums, | ||
| const bool | readonly, | ||
| const bool | undoable, | ||
| const char *const | label = "" ) |
Creates an extracted EditForm from an Editor, limited to the values identified in <nums> A specific Label can be given.
| bool IFSelect_EditForm::Apply | ( | ) |
Applies modifications to own data Calls ApplyData then Clears Status according EditKeepStatus.
|
virtual |
Applies modifications to data Default uses Editor. Can be redefined.
| void IFSelect_EditForm::ClearData | ( | ) |
Clears modification status : by default all, or one by its numbers (in the Editor)
| occ::handle< NCollection_HSequence< occ::handle< TCollection_HAsciiString > > > IFSelect_EditForm::EditedList | ( | const int | num | ) | const |
Returns the Edited Value as a list If IsModified is False, returns OriginalValue Null with IsModified True : means that this value is not defined or has been removed For a single parameter, gives a Null Handle.
| occ::handle< TCollection_HAsciiString > IFSelect_EditForm::EditedValue | ( | const int | num | ) | const |
Returns the Edited (i.e. Modified) Value (string for single) <num> reports to the EditForm If IsModified is False, returns OriginalValue Null with IsModified True : means that this value is not defined or has been removed It is for a single parameter. For a list, gives a Null Handle.
| bool & IFSelect_EditForm::EditKeepStatus | ( | ) |
Returns and may change the keep status on modif It starts as False If it is True, Apply does not clear modification status and the EditForm can be loaded again, modified value remain and may be applied again Remark that ApplyData does not clear the modification status, a call to ClearEdit does.
| occ::handle< IFSelect_Editor > IFSelect_EditForm::Editor | ( | ) | const |
| occ::handle< Standard_Transient > IFSelect_EditForm::Entity | ( | ) | const |
| bool IFSelect_EditForm::IsComplete | ( | ) | const |
Tells if an EditForm is complete or is an extract from Editor.
| bool IFSelect_EditForm::IsLoaded | ( | ) | const |
Tells if the EditForm is loaded now.
Tells if a Value (of the EditForm) is modified (directly or through touching by Update)
Tells if a Value (of the EditForm) has been touched, i.e. not modified directly but by the modification of another one (by method Update from the Editor)
| const char * IFSelect_EditForm::Label | ( | ) | const |
| occ::handle< IFSelect_ListEditor > IFSelect_EditForm::ListEditor | ( | const int | num | ) | const |
Returns a ListEditor to edit the parameter <num> of the EditForm, if it is a List The Editor created it (by ListEditor) then loads it (by ListValue) For a single parameter, returns a Null Handle ...
| bool IFSelect_EditForm::LoadData | ( | ) |
Shortcut when both <ent> and <model> are not used (when the Editor works on fully static or global data)
|
virtual |
Loads modifications to data Default uses Editor. Can be redefined Remark that <ent> and/or <model> may be null, according to the kind of Editor. Shortcuts are available for these cases, but they finally call LoadData (hence, just ignore non-used args)
| void IFSelect_EditForm::LoadDefault | ( | ) |
For a read-write undoable EditForm, loads original values from defaults stored in the Editor.
| bool IFSelect_EditForm::LoadEntity | ( | const occ::handle< Standard_Transient > & | ent | ) |
Shortcut for LoadData when <model> is not used.
| void IFSelect_EditForm::LoadList | ( | const int | num, |
| const occ::handle< NCollection_HSequence< occ::handle< TCollection_HAsciiString > > > & | list ) |
Loads an original value as a list. Called by the Editor only.
| bool IFSelect_EditForm::LoadModel | ( | const occ::handle< Interface_InterfaceModel > & | model | ) |
Shortcut for LoadData when only the model is concerned.
| void IFSelect_EditForm::LoadValue | ( | const int | num, |
| const occ::handle< TCollection_HAsciiString > & | val ) |
Loads an original value (single). Called by the Editor only.
| occ::handle< Interface_InterfaceModel > IFSelect_EditForm::Model | ( | ) | const |
| bool IFSelect_EditForm::Modify | ( | const int | num, |
| const occ::handle< TCollection_HAsciiString > & | newval, | ||
| const bool | enforce = false ) |
Gives a new value for the item <num> of the EditForm, if it is a single parameter (for a list, just returns False) Null means to Remove it <enforce> True to overpass Protected or Computed Access Mode Calls the method Update from the Editor, which can touch other parameters (see NbTouched) Returns True if well recorded, False if this value is not allowed Warning : Does not apply immediately : will be applied by the method Apply.
| bool IFSelect_EditForm::ModifyList | ( | const int | num, |
| const occ::handle< IFSelect_ListEditor > & | edited, | ||
| const bool | enforce = false ) |
Changes the value of an item of the EditForm, if it is a List (else, just returns False) The ListEditor contains the edited values of the list If no edition was recorded, just returns False Calls the method Update from the Editor, which can touch other parameters (see NbTouched) Returns True if well recorded, False if this value is not allowed Warning : Does not apply immediately : will be applied by the method Apply.
| bool IFSelect_EditForm::ModifyListValue | ( | const int | num, |
| const occ::handle< NCollection_HSequence< occ::handle< TCollection_HAsciiString > > > & | list, | ||
| const bool | enforce = false ) |
As ModifyList but the new value is given as such Creates a ListEditor, Loads it, then calls ModifyList.
Returns the Value Number in the Editor for a given Name i.e. the true ValueNumber which can be used in various methods of EditForm If it is not complete, for a recorded (in the Editor) but non-loaded name, returns negative value (- number)
Returns the Rank of Value in the EditForm for a given Name i.e. if it is not complete, for a recorded (in the Editor) but non-loaded name, returns 0.
| int IFSelect_EditForm::NbTouched | ( | ) | const |
Returns the count of parameters touched by the last Modify (apart from the modified parameter itself) Normally it is zero.
Returns the count of values <editable> True : count of editable values, i.e. For a complete EditForm, it is given by the Editor Else, it is the length of the extraction map <editable> False : all the values from the Editor.
Returns the Value Number in the Editor from a given Rank in the EditForm For a complete EditForm, both are equal Else, it is given by the extraction map Returns 0 if <rank> exceeds the count of editable values,.
| occ::handle< NCollection_HSequence< occ::handle< TCollection_HAsciiString > > > IFSelect_EditForm::OriginalList | ( | const int | num | ) | const |
Returns an original value, as a list <num> is for the EditForm, not the Editor For a single parameter, gives a Null Handle.
| occ::handle< TCollection_HAsciiString > IFSelect_EditForm::OriginalValue | ( | const int | num | ) | const |
From an edited value, returns its ... value (original one) Null means that this value is not defined <num> is for the EditForm, not the Editor It is for a single parameter. For a list, gives a Null Handle.
| void IFSelect_EditForm::PrintDefs | ( | Standard_OStream & | S | ) | const |
Prints Definitions, relative to the Editor.
| void IFSelect_EditForm::PrintValues | ( | Standard_OStream & | S, |
| const int | what, | ||
| const bool | names, | ||
| const bool | alsolist = false ) const |
Prints Values, according to what and alsolist <names> True : prints Long Names; False : prints Short Names <what> < 0 : prints Original Values (+ flag Modified) <what> > 0 : prints Final Values (+flag Modified) <what> = 0 : prints Modified Values (Original + Edited) <alsolist> False (D) : lists are printed only as their count <alsolist> True : lists are printed for all their items.
Returns the Rank in the EditForm from a given Number of Value for the Editor For a complete EditForm, both are equal Else, it is given by the extraction map Returns 0 if <number> is not forecast to be edited, or is out of range.
Tells if this EditForm can work with its Editor and its actual Data (Entity and Model) Default uses Editor. Can be redefined.
| void IFSelect_EditForm::SetData | ( | const occ::handle< Standard_Transient > & | ent, |
| const occ::handle< Interface_InterfaceModel > & | model ) |
| void IFSelect_EditForm::SetEntity | ( | const occ::handle< Standard_Transient > & | ent | ) |
| void IFSelect_EditForm::SetModel | ( | const occ::handle< Interface_InterfaceModel > & | model | ) |
| bool IFSelect_EditForm::Touch | ( | const int | num, |
| const occ::handle< TCollection_HAsciiString > & | newval ) |
Gives a new value computed by the Editor, if another parameter commands the value of <num> It is generally the case for a Computed Parameter for instance Increments the counter of touched parameters Warning : it gives no protection for ReadOnly etc... while it is the internal way of touching parameters Does not work (returns False) if <num> is for a list.
| bool IFSelect_EditForm::TouchList | ( | const int | num, |
| const occ::handle< NCollection_HSequence< occ::handle< TCollection_HAsciiString > > > & | newlist ) |
Acts as Touch but for a list Does not work (returns False) if <num> is for a single param.
| bool IFSelect_EditForm::Undo | ( | ) |
For an undoable EditForm, Applies ... origibal values ! and clears modified ones Can be run only once.