Open CASCADE Technology  7.6.0
Public Member Functions

IFSelect_EditForm Class Reference

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>

Inheritance diagram for IFSelect_EditForm:
Inheritance graph
[legend]

Public Member Functions

 IFSelect_EditForm (const Handle< IFSelect_Editor > &editor, const Standard_Boolean readonly, const Standard_Boolean undoable, const Standard_CString label="")
 Creates a complete EditForm from an Editor A specific Label can be given. More...
 
 IFSelect_EditForm (const Handle< IFSelect_Editor > &editor, const TColStd_SequenceOfInteger &nums, const Standard_Boolean readonly, const Standard_Boolean undoable, const Standard_CString label="")
 Creates an extracted EditForm from an Editor, limited to the values identified in <nums> A specific Label can be given. More...
 
Standard_BooleanEditKeepStatus ()
 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. More...
 
Standard_CString Label () const
 
Standard_Boolean IsLoaded () const
 Tells if the EditForm is loaded now. More...
 
void ClearData ()
 
void SetData (const Handle< Standard_Transient > &ent, const Handle< Interface_InterfaceModel > &model)
 
void SetEntity (const Handle< Standard_Transient > &ent)
 
void SetModel (const Handle< Interface_InterfaceModel > &model)
 
Handle< Standard_TransientEntity () const
 
Handle< Interface_InterfaceModelModel () const
 
Handle< IFSelect_EditorEditor () const
 
Standard_Boolean IsComplete () const
 Tells if an EditForm is complete or is an extract from Editor. More...
 
Standard_Integer NbValues (const Standard_Boolean 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. More...
 
Standard_Integer NumberFromRank (const Standard_Integer 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,. More...
 
Standard_Integer RankFromNumber (const Standard_Integer 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. More...
 
Standard_Integer NameNumber (const Standard_CString 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) More...
 
Standard_Integer NameRank (const Standard_CString 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. More...
 
void LoadDefault ()
 For a read-write undoable EditForm, loads original values from defaults stored in the Editor. More...
 
virtual Standard_Boolean LoadData (const Handle< Standard_Transient > &ent, const 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) More...
 
Standard_Boolean LoadEntity (const Handle< Standard_Transient > &ent)
 Shortcut for LoadData when <model> is not used. More...
 
Standard_Boolean LoadModel (const Handle< Interface_InterfaceModel > &model)
 Shortcut for LoadData when only the model is concerned. More...
 
Standard_Boolean LoadData ()
 Shortcut when both <ent> and <model> are not used (when the Editor works on fully static or global data) More...
 
Handle< IFSelect_ListEditorListEditor (const Standard_Integer 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 ... More...
 
void LoadValue (const Standard_Integer num, const Handle< TCollection_HAsciiString > &val)
 Loads an original value (single). Called by the Editor only. More...
 
void LoadList (const Standard_Integer num, const Handle< TColStd_HSequenceOfHAsciiString > &list)
 Loads an original value as a list. Called by the Editor only. More...
 
Handle< TCollection_HAsciiStringOriginalValue (const Standard_Integer 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. More...
 
Handle< TColStd_HSequenceOfHAsciiString > OriginalList (const Standard_Integer 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. More...
 
Handle< TCollection_HAsciiStringEditedValue (const Standard_Integer 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. More...
 
Handle< TColStd_HSequenceOfHAsciiString > EditedList (const Standard_Integer 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. More...
 
Standard_Boolean IsModified (const Standard_Integer num) const
 Tells if a Value (of the EditForm) is modified (directly or through touching by Update) More...
 
Standard_Boolean IsTouched (const Standard_Integer 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) More...
 
Standard_Boolean Modify (const Standard_Integer num, const Handle< TCollection_HAsciiString > &newval, const Standard_Boolean enforce=Standard_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. More...
 
Standard_Boolean ModifyList (const Standard_Integer num, const Handle< IFSelect_ListEditor > &edited, const Standard_Boolean enforce=Standard_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. More...
 
Standard_Boolean ModifyListValue (const Standard_Integer num, const Handle< TColStd_HSequenceOfHAsciiString > &list, const Standard_Boolean enforce=Standard_False)
 As ModifyList but the new value is given as such Creates a ListEditor, Loads it, then calls ModifyList. More...
 
Standard_Boolean Touch (const Standard_Integer num, const 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. More...
 
Standard_Boolean TouchList (const Standard_Integer num, const Handle< TColStd_HSequenceOfHAsciiString > &newlist)
 Acts as Touch but for a list Does not work (returns False) if <num> is for a single param. More...
 
Standard_Integer NbTouched () const
 Returns the count of parameters touched by the last Modify (apart from the modified parameter itself) Normally it is zero. More...
 
void ClearEdit (const Standard_Integer num=0)
 Clears modification status : by default all, or one by its numbers (in the Editor) More...
 
void PrintDefs (Standard_OStream &S) const
 Prints Definitions, relative to the Editor. More...
 
void PrintValues (Standard_OStream &S, const Standard_Integer what, const Standard_Boolean names, const Standard_Boolean alsolist=Standard_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. More...
 
Standard_Boolean Apply ()
 Applies modifications to own data Calls ApplyData then Clears Status according EditKeepStatus. More...
 
virtual Standard_Boolean Recognize () const
 Tells if this EditForm can work with its Editor and its actual Data (Entity and Model) Default uses Editor. Can be redefined. More...
 
virtual Standard_Boolean ApplyData (const Handle< Standard_Transient > &ent, const Handle< Interface_InterfaceModel > &model)
 Applies modifications to data Default uses Editor. Can be redefined. More...
 
Standard_Boolean Undo ()
 For an undoable EditForm, Applies ... origibal values ! and clears modified ones Can be run only once. More...
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor. More...
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing. More...
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter. More...
 
virtual ~Standard_Transient ()
 Destructor must be virtual. More...
 
virtual void Delete () const
 Memory deallocator for transient classes. More...
 
virtual const opencascade::handle< Standard_Type > & DynamicType () const
 Returns a type descriptor about this object. More...
 
Standard_Boolean IsInstance (const opencascade::handle< Standard_Type > &theType) const
 Returns a true value if this is an instance of Type. More...
 
Standard_Boolean IsInstance (const Standard_CString theTypeName) const
 Returns a true value if this is an instance of TypeName. More...
 
Standard_Boolean 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. More...
 
Standard_Boolean IsKind (const Standard_CString 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. More...
 
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. More...
 
Standard_Integer GetRefCount () const
 Get the reference counter of this object. More...
 
void IncrementRefCounter () const
 Increments the reference counter of this object. More...
 
Standard_Integer DecrementRefCounter () const
 Decrements the reference counter of this object; returns the decremented value. More...
 

Additional Inherited Members

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

Detailed Description

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

Constructor & Destructor Documentation

◆ IFSelect_EditForm() [1/2]

IFSelect_EditForm::IFSelect_EditForm ( const Handle< IFSelect_Editor > &  editor,
const Standard_Boolean  readonly,
const Standard_Boolean  undoable,
const Standard_CString  label = "" 
)

Creates a complete EditForm from an Editor A specific Label can be given.

◆ IFSelect_EditForm() [2/2]

IFSelect_EditForm::IFSelect_EditForm ( const Handle< IFSelect_Editor > &  editor,
const TColStd_SequenceOfInteger nums,
const Standard_Boolean  readonly,
const Standard_Boolean  undoable,
const Standard_CString  label = "" 
)

Creates an extracted EditForm from an Editor, limited to the values identified in <nums> A specific Label can be given.

Member Function Documentation

◆ Apply()

Standard_Boolean IFSelect_EditForm::Apply ( )

Applies modifications to own data Calls ApplyData then Clears Status according EditKeepStatus.

◆ ApplyData()

virtual Standard_Boolean IFSelect_EditForm::ApplyData ( const Handle< Standard_Transient > &  ent,
const Handle< Interface_InterfaceModel > &  model 
)
virtual

Applies modifications to data Default uses Editor. Can be redefined.

◆ ClearData()

void IFSelect_EditForm::ClearData ( )

◆ ClearEdit()

void IFSelect_EditForm::ClearEdit ( const Standard_Integer  num = 0)

Clears modification status : by default all, or one by its numbers (in the Editor)

◆ EditedList()

Handle< TColStd_HSequenceOfHAsciiString > IFSelect_EditForm::EditedList ( const Standard_Integer  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.

◆ EditedValue()

Handle< TCollection_HAsciiString > IFSelect_EditForm::EditedValue ( const Standard_Integer  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.

◆ EditKeepStatus()

Standard_Boolean& 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.

◆ Editor()

Handle< IFSelect_Editor > IFSelect_EditForm::Editor ( ) const

◆ Entity()

Handle< Standard_Transient > IFSelect_EditForm::Entity ( ) const

◆ IsComplete()

Standard_Boolean IFSelect_EditForm::IsComplete ( ) const

Tells if an EditForm is complete or is an extract from Editor.

◆ IsLoaded()

Standard_Boolean IFSelect_EditForm::IsLoaded ( ) const

Tells if the EditForm is loaded now.

◆ IsModified()

Standard_Boolean IFSelect_EditForm::IsModified ( const Standard_Integer  num) const

Tells if a Value (of the EditForm) is modified (directly or through touching by Update)

◆ IsTouched()

Standard_Boolean IFSelect_EditForm::IsTouched ( const Standard_Integer  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)

◆ Label()

Standard_CString IFSelect_EditForm::Label ( ) const

◆ ListEditor()

Handle< IFSelect_ListEditor > IFSelect_EditForm::ListEditor ( const Standard_Integer  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 ...

◆ LoadData() [1/2]

Standard_Boolean IFSelect_EditForm::LoadData ( )

Shortcut when both <ent> and <model> are not used (when the Editor works on fully static or global data)

◆ LoadData() [2/2]

virtual Standard_Boolean IFSelect_EditForm::LoadData ( const Handle< Standard_Transient > &  ent,
const Handle< Interface_InterfaceModel > &  model 
)
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)

◆ LoadDefault()

void IFSelect_EditForm::LoadDefault ( )

For a read-write undoable EditForm, loads original values from defaults stored in the Editor.

◆ LoadEntity()

Standard_Boolean IFSelect_EditForm::LoadEntity ( const Handle< Standard_Transient > &  ent)

Shortcut for LoadData when <model> is not used.

◆ LoadList()

void IFSelect_EditForm::LoadList ( const Standard_Integer  num,
const Handle< TColStd_HSequenceOfHAsciiString > &  list 
)

Loads an original value as a list. Called by the Editor only.

◆ LoadModel()

Standard_Boolean IFSelect_EditForm::LoadModel ( const Handle< Interface_InterfaceModel > &  model)

Shortcut for LoadData when only the model is concerned.

◆ LoadValue()

void IFSelect_EditForm::LoadValue ( const Standard_Integer  num,
const Handle< TCollection_HAsciiString > &  val 
)

Loads an original value (single). Called by the Editor only.

◆ Model()

Handle< Interface_InterfaceModel > IFSelect_EditForm::Model ( ) const

◆ Modify()

Standard_Boolean IFSelect_EditForm::Modify ( const Standard_Integer  num,
const Handle< TCollection_HAsciiString > &  newval,
const Standard_Boolean  enforce = Standard_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.

◆ ModifyList()

Standard_Boolean IFSelect_EditForm::ModifyList ( const Standard_Integer  num,
const Handle< IFSelect_ListEditor > &  edited,
const Standard_Boolean  enforce = Standard_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.

◆ ModifyListValue()

Standard_Boolean IFSelect_EditForm::ModifyListValue ( const Standard_Integer  num,
const Handle< TColStd_HSequenceOfHAsciiString > &  list,
const Standard_Boolean  enforce = Standard_False 
)

As ModifyList but the new value is given as such Creates a ListEditor, Loads it, then calls ModifyList.

◆ NameNumber()

Standard_Integer IFSelect_EditForm::NameNumber ( const Standard_CString  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)

◆ NameRank()

Standard_Integer IFSelect_EditForm::NameRank ( const Standard_CString  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.

◆ NbTouched()

Standard_Integer IFSelect_EditForm::NbTouched ( ) const

Returns the count of parameters touched by the last Modify (apart from the modified parameter itself) Normally it is zero.

◆ NbValues()

Standard_Integer IFSelect_EditForm::NbValues ( const Standard_Boolean  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.

◆ NumberFromRank()

Standard_Integer IFSelect_EditForm::NumberFromRank ( const Standard_Integer  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,.

◆ OriginalList()

Handle< TColStd_HSequenceOfHAsciiString > IFSelect_EditForm::OriginalList ( const Standard_Integer  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.

◆ OriginalValue()

Handle< TCollection_HAsciiString > IFSelect_EditForm::OriginalValue ( const Standard_Integer  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.

◆ PrintDefs()

void IFSelect_EditForm::PrintDefs ( Standard_OStream S) const

Prints Definitions, relative to the Editor.

◆ PrintValues()

void IFSelect_EditForm::PrintValues ( Standard_OStream S,
const Standard_Integer  what,
const Standard_Boolean  names,
const Standard_Boolean  alsolist = Standard_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.

◆ RankFromNumber()

Standard_Integer IFSelect_EditForm::RankFromNumber ( const Standard_Integer  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.

◆ Recognize()

virtual Standard_Boolean IFSelect_EditForm::Recognize ( ) const
virtual

Tells if this EditForm can work with its Editor and its actual Data (Entity and Model) Default uses Editor. Can be redefined.

◆ SetData()

void IFSelect_EditForm::SetData ( const Handle< Standard_Transient > &  ent,
const Handle< Interface_InterfaceModel > &  model 
)

◆ SetEntity()

void IFSelect_EditForm::SetEntity ( const Handle< Standard_Transient > &  ent)

◆ SetModel()

void IFSelect_EditForm::SetModel ( const Handle< Interface_InterfaceModel > &  model)

◆ Touch()

Standard_Boolean IFSelect_EditForm::Touch ( const Standard_Integer  num,
const 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.

◆ TouchList()

Standard_Boolean IFSelect_EditForm::TouchList ( const Standard_Integer  num,
const Handle< TColStd_HSequenceOfHAsciiString > &  newlist 
)

Acts as Touch but for a list Does not work (returns False) if <num> is for a single param.

◆ Undo()

Standard_Boolean IFSelect_EditForm::Undo ( )

For an undoable EditForm, Applies ... origibal values ! and clears modified ones Can be run only once.


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