Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions
IFSelect_Editor Class Referenceabstract

An Editor defines a set of values and a way to edit them, on an entity or on the model (e.g. on its header) More...

#include <IFSelect_Editor.hxx>

Inheritance diagram for IFSelect_Editor:
Inheritance graph
[legend]

Public Member Functions

void SetValue (const int num, const occ::handle< Interface_TypedValue > &typval, const char *const shortname="", const IFSelect_EditValue accessmode=IFSelect_Editable)
 Sets a Typed Value for a given ident and short name, with an Edit Mode.
 
void SetList (const int num, const int max=0)
 Sets a parameter to be a List max < 0 : not for a list (set when starting) max = 0 : list with no length limit (default for SetList) max > 0 : list limited to <max> items.
 
int NbValues () const
 Returns the count of Typed Values.
 
occ::handle< Interface_TypedValueTypedValue (const int num) const
 Returns a Typed Value from its ident.
 
bool IsList (const int num) const
 Tells if a parameter is a list.
 
int MaxList (const int num) const
 Returns max length allowed for a list = 0 means : list with no limit < 0 means : not a list.
 
const charName (const int num, const bool isshort=false) const
 Returns the name of a Value (complete or short) from its ident Short Name can be empty.
 
IFSelect_EditValue EditMode (const int num) const
 Returns the edit mode of a Value.
 
int NameNumber (const char *const name) const
 Returns the number (ident) of a Value, from its name, short or complete. If not found, returns 0.
 
void PrintNames (Standard_OStream &S) const
 
void PrintDefs (Standard_OStream &S, const bool labels=false) const
 
int MaxNameLength (const int what) const
 Returns the MaxLength of, according to what : <what> = -1 : length of short names <what> = 0 : length of complete names <what> = 1 : length of values labels.
 
virtual TCollection_AsciiString Label () const =0
 Returns the specific label.
 
virtual occ::handle< IFSelect_EditFormForm (const bool readonly, const bool undoable=true) const
 Builds and Returns an EditForm, empty (no data yet) Can be redefined to return a specific type of EditForm.
 
virtual bool Recognize (const occ::handle< IFSelect_EditForm > &form) const =0
 Tells if this Editor can work on this EditForm and its content (model, entity ?)
 
virtual occ::handle< TCollection_HAsciiStringStringValue (const occ::handle< IFSelect_EditForm > &form, const int num) const =0
 Returns the value of an EditForm, for a given item (if not a list. for a list, a Null String may be returned)
 
virtual occ::handle< IFSelect_ListEditorListEditor (const int num) const
 Returns a ListEditor for a parameter which is a List Default returns a basic ListEditor for a List, a Null Handle if <num> is not for a List. Can be redefined.
 
virtual occ::handle< NCollection_HSequence< occ::handle< TCollection_HAsciiString > > > ListValue (const occ::handle< IFSelect_EditForm > &form, const int num) const
 Returns the value of an EditForm as a List, for a given item If not a list, a Null Handle should be returned Default returns a Null Handle, because many Editors have no list to edit. To be redefined as required.
 
virtual bool Load (const occ::handle< IFSelect_EditForm > &form, const occ::handle< Standard_Transient > &ent, const occ::handle< Interface_InterfaceModel > &model) const =0
 Loads original values from some data, to an EditForm Remark: <ent> may be Null, this means all <model> is concerned Also <model> may be Null, if no context applies for <ent> And both <ent> and <model> may be Null, for a full static editor.
 
virtual bool Update (const occ::handle< IFSelect_EditForm > &form, const int num, const occ::handle< TCollection_HAsciiString > &newval, const bool enforce) const
 Updates the EditForm when a parameter is modified I.E. default does nothing, can be redefined, as follows : Returns True when done (even if does nothing), False in case of refuse (for instance, if the new value is not suitable) <num> is the rank of the parameter for the EDITOR itself <enforce> True means that protected parameters can be touched.
 
virtual bool UpdateList (const occ::handle< IFSelect_EditForm > &form, const int num, const occ::handle< NCollection_HSequence< occ::handle< TCollection_HAsciiString > > > &newlist, const bool enforce) const
 Acts as Update, but when the value is a list.
 
virtual bool Apply (const occ::handle< IFSelect_EditForm > &form, const occ::handle< Standard_Transient > &ent, const occ::handle< Interface_InterfaceModel > &model) const =0
 Applies modified values of the EditForm with some data Remark: <ent> may be Null, this means all <model> is concerned Also <model> may be Null, if no context applies for <ent> And both <ent> and <model> may be Null, for a full static editor.
 
- 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.
 

Protected Member Functions

 IFSelect_Editor (const int nbval)
 Prepares the list of Typed Values (gives its count) This count can be tuned later, to a LOWER value, this allows to initialize with a "maximum reservation" then cut the extra.
 
void SetNbValues (const int nbval)
 Adjusts the true count of values. It can be LOWER or equal to the initial size (which then acts as a reservation), but never greater.
 

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

An Editor defines a set of values and a way to edit them, on an entity or on the model (e.g. on its header)

Each Value is controlled by a TypedValue, with a number (it is an Integer) and a name under two forms (complete and short) and an edit mode

Constructor & Destructor Documentation

◆ IFSelect_Editor()

IFSelect_Editor::IFSelect_Editor ( const int nbval)
protected

Prepares the list of Typed Values (gives its count) This count can be tuned later, to a LOWER value, this allows to initialize with a "maximum reservation" then cut the extra.

Member Function Documentation

◆ Apply()

virtual bool IFSelect_Editor::Apply ( const occ::handle< IFSelect_EditForm > & form,
const occ::handle< Standard_Transient > & ent,
const occ::handle< Interface_InterfaceModel > & model ) const
pure virtual

Applies modified values of the EditForm with some data Remark: <ent> may be Null, this means all <model> is concerned Also <model> may be Null, if no context applies for <ent> And both <ent> and <model> may be Null, for a full static editor.

Implemented in IGESSelect_EditDirPart, IGESSelect_EditHeader, APIHeaderSection_EditHeader, STEPEdit_EditContext, STEPEdit_EditSDR, and IFSelect_ParamEditor.

◆ EditMode()

IFSelect_EditValue IFSelect_Editor::EditMode ( const int num) const

Returns the edit mode of a Value.

◆ Form()

virtual occ::handle< IFSelect_EditForm > IFSelect_Editor::Form ( const bool readonly,
const bool undoable = true ) const
virtual

Builds and Returns an EditForm, empty (no data yet) Can be redefined to return a specific type of EditForm.

◆ IsList()

bool IFSelect_Editor::IsList ( const int num) const

Tells if a parameter is a list.

◆ Label()

virtual TCollection_AsciiString IFSelect_Editor::Label ( ) const
pure virtual

◆ ListEditor()

virtual occ::handle< IFSelect_ListEditor > IFSelect_Editor::ListEditor ( const int num) const
virtual

Returns a ListEditor for a parameter which is a List Default returns a basic ListEditor for a List, a Null Handle if <num> is not for a List. Can be redefined.

◆ ListValue()

virtual occ::handle< NCollection_HSequence< occ::handle< TCollection_HAsciiString > > > IFSelect_Editor::ListValue ( const occ::handle< IFSelect_EditForm > & form,
const int num ) const
virtual

Returns the value of an EditForm as a List, for a given item If not a list, a Null Handle should be returned Default returns a Null Handle, because many Editors have no list to edit. To be redefined as required.

◆ Load()

virtual bool IFSelect_Editor::Load ( const occ::handle< IFSelect_EditForm > & form,
const occ::handle< Standard_Transient > & ent,
const occ::handle< Interface_InterfaceModel > & model ) const
pure virtual

Loads original values from some data, to an EditForm Remark: <ent> may be Null, this means all <model> is concerned Also <model> may be Null, if no context applies for <ent> And both <ent> and <model> may be Null, for a full static editor.

Implemented in IGESSelect_EditDirPart, IGESSelect_EditHeader, APIHeaderSection_EditHeader, STEPEdit_EditContext, STEPEdit_EditSDR, and IFSelect_ParamEditor.

◆ MaxList()

int IFSelect_Editor::MaxList ( const int num) const

Returns max length allowed for a list = 0 means : list with no limit < 0 means : not a list.

◆ MaxNameLength()

int IFSelect_Editor::MaxNameLength ( const int what) const

Returns the MaxLength of, according to what : <what> = -1 : length of short names <what> = 0 : length of complete names <what> = 1 : length of values labels.

◆ Name()

const char * IFSelect_Editor::Name ( const int num,
const bool isshort = false ) const

Returns the name of a Value (complete or short) from its ident Short Name can be empty.

◆ NameNumber()

int IFSelect_Editor::NameNumber ( const char *const name) const

Returns the number (ident) of a Value, from its name, short or complete. If not found, returns 0.

◆ NbValues()

int IFSelect_Editor::NbValues ( ) const

Returns the count of Typed Values.

◆ PrintDefs()

void IFSelect_Editor::PrintDefs ( Standard_OStream & S,
const bool labels = false ) const

◆ PrintNames()

void IFSelect_Editor::PrintNames ( Standard_OStream & S) const

◆ Recognize()

virtual bool IFSelect_Editor::Recognize ( const occ::handle< IFSelect_EditForm > & form) const
pure virtual

Tells if this Editor can work on this EditForm and its content (model, entity ?)

Implemented in IGESSelect_EditDirPart, IGESSelect_EditHeader, APIHeaderSection_EditHeader, STEPEdit_EditContext, STEPEdit_EditSDR, and IFSelect_ParamEditor.

◆ SetList()

void IFSelect_Editor::SetList ( const int num,
const int max = 0 )

Sets a parameter to be a List max < 0 : not for a list (set when starting) max = 0 : list with no length limit (default for SetList) max > 0 : list limited to <max> items.

◆ SetNbValues()

void IFSelect_Editor::SetNbValues ( const int nbval)
protected

Adjusts the true count of values. It can be LOWER or equal to the initial size (which then acts as a reservation), but never greater.

◆ SetValue()

void IFSelect_Editor::SetValue ( const int num,
const occ::handle< Interface_TypedValue > & typval,
const char *const shortname = "",
const IFSelect_EditValue accessmode = IFSelect_Editable )

Sets a Typed Value for a given ident and short name, with an Edit Mode.

◆ StringValue()

virtual occ::handle< TCollection_HAsciiString > IFSelect_Editor::StringValue ( const occ::handle< IFSelect_EditForm > & form,
const int num ) const
pure virtual

Returns the value of an EditForm, for a given item (if not a list. for a list, a Null String may be returned)

Implemented in IGESSelect_EditDirPart, IGESSelect_EditHeader, APIHeaderSection_EditHeader, STEPEdit_EditContext, STEPEdit_EditSDR, and IFSelect_ParamEditor.

◆ TypedValue()

occ::handle< Interface_TypedValue > IFSelect_Editor::TypedValue ( const int num) const

Returns a Typed Value from its ident.

◆ Update()

virtual bool IFSelect_Editor::Update ( const occ::handle< IFSelect_EditForm > & form,
const int num,
const occ::handle< TCollection_HAsciiString > & newval,
const bool enforce ) const
virtual

Updates the EditForm when a parameter is modified I.E. default does nothing, can be redefined, as follows : Returns True when done (even if does nothing), False in case of refuse (for instance, if the new value is not suitable) <num> is the rank of the parameter for the EDITOR itself <enforce> True means that protected parameters can be touched.

If a parameter commands the value of other ones, when it is modified, it is necessary to touch them by Touch from EditForm

Reimplemented in IGESSelect_EditDirPart, and IGESSelect_EditHeader.

◆ UpdateList()

virtual bool IFSelect_Editor::UpdateList ( const occ::handle< IFSelect_EditForm > & form,
const int num,
const occ::handle< NCollection_HSequence< occ::handle< TCollection_HAsciiString > > > & newlist,
const bool enforce ) const
virtual

Acts as Update, but when the value is a list.


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