Version: 9.12.0
SalomeApp_DataObject Class Reference

Implementation of the data object for use in CORBA-based SALOME modules. More...

#include <SalomeApp_DataObject.h>

Inheritance diagram for SalomeApp_DataObject:
Inheritance graph

Public Types

enum  { ValueId = RefEntryId + 1 , IORId , LastId }
 Column id. More...
 
- Public Types inherited from LightApp_DataObject
enum  { EntryId = VisibilityId + 1 , RefEntryId }
 Column id. More...
 
- Public Types inherited from SUIT_DataObject
enum  ColorRole {
  Text , Base , Foreground , Background ,
  Highlight , HighlightedText
}
 Color role. More...
 
enum  { NameId , VisibilityId }
 Column id. More...
 

Public Member Functions

 SalomeApp_DataObject (SUIT_DataObject *=0)
 Constructor. More...
 
 SalomeApp_DataObject (const _PTR(SObject)&, SUIT_DataObject *=0)
 Constructor. More...
 
virtual ~SalomeApp_DataObject ()
 Destructor. More...
 
virtual QString name () const
 Get data object name. More...
 
virtual QString entry () const
 Get object string identifier. More...
 
virtual QString text (const int=NameId) const
 Get object text data for the specified column. More...
 
virtual QPixmap icon (const int=NameId) const
 Get data object icon for the specified column. More...
 
virtual QColor color (const ColorRole, const int=NameId) const
 Get data object color for the specified column. More...
 
virtual QString toolTip (const int=NameId) const
 Get data object tooltip for the specified column. More...
 
virtual QFont font (const int=NameId) const
 Get font to be used for data object rendering in the item views. More...
 
virtual _PTR (SObject) object() const
 
virtual QString refEntry () const
 Returns the string identifier of the data objects referenced by this one. More...
 
virtual bool isReference () const
 Tells if this data objects is a reference to some other or not. More...
 
 _PTR (SObject) referencedObject() const
 
bool hasChildren () const
 
bool expandable () const
 
virtual bool isVisible () const
 Check if the object is visible. More...
 
virtual QString componentDataType () const
 Get component type. More...
 
virtual bool customSorting (const int=NameId) const
 Check if the specified column supports custom sorting. More...
 
virtual bool compare (const QVariant &, const QVariant &, const int=NameId) const
 Compares data from two items for sorting purposes. More...
 
virtual void insertChildAtTag (SalomeApp_DataObject *, int)
 
virtual void updateItem ()
 
- Public Member Functions inherited from LightApp_DataObject
 LightApp_DataObject (SUIT_DataObject *=0)
 Constructor. More...
 
virtual ~LightApp_DataObject ()
 Destructor. More...
 
virtual SUIT_DataObjectKeykey () const
 Get the data object unique key. More...
 
virtual SUIT_DataObjectcomponentObject () const
 Get the component object. More...
 
virtual int groupId () const
 return unique group identificator More...
 
virtual QVariant customData (Qtx::CustomDataType type)
 return custom data for data object More...
 
virtual bool isDraggable () const
 Check if the object is draggable. More...
 
virtual bool isDropAccepted () const
 Check if the drop operation fo this object is possible. More...
 
virtual bool renameAllowed (const int=NameId) const
 Check if this object is can't be renamed in place. More...
 
virtual bool setName (const QString &)
 Set name of the this object. More...
 
- Public Member Functions inherited from CAM_DataObject
 CAM_DataObject (SUIT_DataObject *=0)
 Constructor. More...
 
virtual ~CAM_DataObject ()
 Destructor. More...
 
CAM_Modulemodule () const
 Get CAM module. More...
 
virtual CAM_DataModeldataModel () const
 Get CAM data model. More...
 
- Public Member Functions inherited from SUIT_DataObject
 SUIT_DataObject (SUIT_DataObject *=0)
 Constructor. More...
 
virtual ~SUIT_DataObject ()
 Destructor. More...
 
SUIT_DataObjectroot () const
 Get the root object. More...
 
SUIT_DataObjectlastChild () const
 Get the last child object. More...
 
SUIT_DataObjectfirstChild () const
 Get the first child object. More...
 
int childCount () const
 Get the number of the child objects. More...
 
int childPos (const SUIT_DataObject *) const
 Get the index of the specified object in the child list. More...
 
void moveChildPos (SUIT_DataObject *, int)
 Moves the child position from current to new one. More...
 
SUIT_DataObjectchildObject (const int) const
 Get child object by the specified index. More...
 
int level () const
 Get the object level in the tree structure. More...
 
int position () const
 Get the position of the data object in its parent's children list. More...
 
void setPosition (int)
 Sets new position of the object in parent's list. More...
 
SUIT_DataObjectnextBrother () const
 Get the next sibling data object in the children list. More...
 
SUIT_DataObjectprevBrother () const
 Get the previous sibling data object in the children list. More...
 
bool autoDeleteChildren () const
 Get "auto-delete children" flag. More...
 
virtual void setAutoDeleteChildren (const bool)
 Set "auto-delete children" flag. More...
 
virtual void children (DataObjectList &, const bool=false) const
 Get all children. More...
 
virtual DataObjectList children (const bool=false)
 Get all children. \override. More...
 
void appendChild (SUIT_DataObject *)
 Add new child object to the end of the children list. More...
 
virtual void insertChild (SUIT_DataObject *, int)
 Insert new child object to the list of the children. More...
 
virtual void removeChild (SUIT_DataObject *, const bool=false)
 Remove the specified child object reference. More...
 
bool replaceChild (SUIT_DataObject *, SUIT_DataObject *, const bool=false)
 Replace the specified child object by another object. More...
 
void reparentChildren (const SUIT_DataObject *)
 Change the parent for all children from specified object to this one. More...
 
virtual SUIT_DataObjectparent () const
 Get the parent object. More...
 
virtual void setParent (SUIT_DataObject *)
 Change the parent object. More...
 
virtual void assignParent (SUIT_DataObject *)
 
void insertChildAtPos (SUIT_DataObject *obj, int position)
 Insert new child object into the list of the children (faster version of insertChild without signal). More...
 
bool modified ()
 
virtual void setModified (bool modified)
 Sets modification state of the object. More...
 
virtual QString statusTip (const int=NameId) const
 Get data object status tip for the specified column. More...
 
virtual QString whatsThis (const int=NameId) const
 Get data object "what's this" information for the specified column. More...
 
virtual int alignment (const int=NameId) const
 Get data object text alignment for the specified column. More...
 
virtual bool isEnabled () const
 Check if this object is enabled. More...
 
virtual bool isSelectable () const
 Check if this object is selectable. More...
 
virtual bool isCheckable (const int=NameId) const
 Check if this object is checkable for the specified column. More...
 
virtual bool isOn (const int=NameId) const
 Get the checked state of the object (if it is checkable) for the specified column. More...
 
virtual void setOn (const bool, const int=NameId)
 Set the checked state of the object (if it is checkable) for the specified column. More...
 
virtual bool isOpen () const
 Get the "opened" state of the object. More...
 
virtual void setOpen (const bool)
 Set the "opened" state of the object. More...
 
virtual void update ()
 Updates necessary internal fields of data object. More...
 
void deleteLater ()
 Schedule this object for the late deleting. More...
 
void dump (const int indent=2) const
 Dump the object tree recursively to the standard output. More...
 

Private Member Functions

QString ior (const _PTR(SObject)&) const
 
QString entry (const _PTR(SObject)&) const
 
QString value (const _PTR(SObject)&) const
 
 _PTR (SObject) myObject
 

Additional Inherited Members

- Static Public Member Functions inherited from SUIT_DataObject
static Signalsignal ()
 Get global signal handler. More...
 
static bool connect (const char *, QObject *, const char *)
 Connect to the signal handlerx. More...
 
static bool disconnect (const char *, QObject *, const char *)
 Disconnect from the signal handler. More...
 
- Protected Attributes inherited from LightApp_DataObject
QString myCompDataType
 
SUIT_DataObjectmyCompObject
 

Detailed Description

Implementation of the data object for use in CORBA-based SALOME modules.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Column id.

Enumerator
ValueId 

value column

IORId 

IOR column.

LastId 

indicates last Id value

Constructor & Destructor Documentation

◆ SalomeApp_DataObject() [1/2]

SalomeApp_DataObject::SalomeApp_DataObject ( SUIT_DataObject parent = 0)

Constructor.

Parameters
parentparent data object

◆ SalomeApp_DataObject() [2/2]

SalomeApp_DataObject::SalomeApp_DataObject ( const _PTR(SObject)&  sobj,
SUIT_DataObject parent = 0 
)

Constructor.

Parameters
sobjSALOMEDS object
parentparent data object

◆ ~SalomeApp_DataObject()

SalomeApp_DataObject::~SalomeApp_DataObject ( )
virtual

Destructor.

Member Function Documentation

◆ _PTR() [1/3]

SalomeApp_DataObject::_PTR ( SObject  )
private

◆ _PTR() [2/3]

virtual SalomeApp_DataObject::_PTR ( SObject  ) const
virtual

◆ _PTR() [3/3]

SalomeApp_DataObject::_PTR ( SObject  ) const

◆ color()

QColor SalomeApp_DataObject::color ( const ColorRole  role,
const int  id = NameId 
) const
virtual

Get data object color for the specified column.

Parameters
rolecolor role
idcolumn id (not used)
Returns
object color for the specified column

Reimplemented from LightApp_DataObject.

Reimplemented in SalomeApp_RootObject.

References _PTR(), LightApp_DataObject::color(), SUIT_DataObject::Foreground, SUIT_DataObject::Highlight, isReference(), and SUIT_DataObject::Text.

◆ compare()

virtual bool SalomeApp_DataObject::compare ( const QVariant &  left,
const QVariant &  right,
const int  id = NameId 
) const
virtual

Compares data from two items for sorting purposes.

This method is called only for those columns for which customSorting() method returns true.

Parameters
leftfirst data to compare
rightsecond data to compare
idcolumn id
Returns
result of the comparison
See also
customSorting()

Reimplemented from LightApp_DataObject.

◆ componentDataType()

QString SalomeApp_DataObject::componentDataType ( ) const
virtual

Get component type.

Returns
component type

Reimplemented from LightApp_DataObject.

References _PTR(), LightApp_DataObject::componentObject(), and LightApp_DataObject::myCompDataType.

◆ customSorting()

virtual bool SalomeApp_DataObject::customSorting ( const int  id = NameId) const
virtual

Check if the specified column supports custom sorting.

Parameters
idcolumn id
Returns
true if column sorting should be customized
See also
compare()

Reimplemented from LightApp_DataObject.

◆ entry() [1/2]

QString SalomeApp_DataObject::entry ( ) const
virtual

Get object string identifier.

Returns
object ID

Reimplemented from LightApp_DataObject.

Reimplemented in SalomeApp_RootObject.

◆ entry() [2/2]

QString SalomeApp_DataObject::entry ( const _PTR(SObject)&  ) const
private

◆ expandable()

bool SalomeApp_DataObject::expandable ( ) const
virtual

Reimplemented from SUIT_DataObject.

◆ font()

QFont SalomeApp_DataObject::font ( const int  id = NameId) const
virtual

Get font to be used for data object rendering in the item views.

Parameters
idcolumn id
Returns
font to be used for the item rendering

Reimplemented from SUIT_DataObject.

References expandable(), SUIT_DataObject::font(), hasChildren(), and SUIT_DataObject::NameId.

◆ hasChildren()

bool SalomeApp_DataObject::hasChildren ( ) const

◆ icon()

QPixmap SalomeApp_DataObject::icon ( const int  id = NameId) const
virtual

Get data object icon for the specified column.

Parameters
idcolumn id
Returns
object icon for the specified column

Reimplemented from SUIT_DataObject.

Reimplemented in SalomeApp_RootObject, and SalomeApp_ModuleObject.

References _PTR(), SUIT_Study::application(), componentDataType(), SUIT_DataObject::icon(), QtxResourceMgr::loadPixmap(), SUIT_DataObject::NameId, SUIT_Application::resourceMgr(), SUIT_DataObject::root(), and LightApp_RootObject::study().

◆ insertChildAtTag()

virtual void SalomeApp_DataObject::insertChildAtTag ( SalomeApp_DataObject ,
int   
)
virtual

◆ ior()

QString SalomeApp_DataObject::ior ( const _PTR(SObject)&  ) const
private

◆ isReference()

virtual bool SalomeApp_DataObject::isReference ( ) const
virtual

Tells if this data objects is a reference to some other or not.

The base implementation retuns true, if refEntry() returns non-empty string.

Returns
true if refEntry() is a non-empty string.

Reimplemented from LightApp_DataObject.

◆ isVisible()

virtual bool SalomeApp_DataObject::isVisible ( ) const
virtual

Check if the object is visible.

Returns
true if this object is displayable or false otherwise

Reimplemented from LightApp_DataObject.

◆ name()

QString SalomeApp_DataObject::name ( ) const
virtual

Get data object name.

Returns
object name

Reimplemented from SUIT_DataObject.

Reimplemented in SalomeApp_RootObject, and SalomeApp_ModuleObject.

References _PTR(), and isReference().

◆ refEntry()

virtual QString SalomeApp_DataObject::refEntry ( ) const
virtual

Returns the string identifier of the data objects referenced by this one.

This method should be reimplemented in the subclasses. Default implementation returns null string.

Returns
ID string of the referenced data object

Reimplemented from LightApp_DataObject.

◆ text()

QString SalomeApp_DataObject::text ( const int  id = NameId) const
virtual

Get object text data for the specified column.

This method returns the data according to the specufied column id:

  • NameId : object name (by calling name() method)
  • EntryId : object entry (by calling entry() method)
  • ValueId : object value
  • IORId : object IOR
  • RefEntryId : object reference entry
Parameters
idcolumn id
Returns
object text data

Reimplemented from LightApp_DataObject.

Reimplemented in SalomeApp_RootObject.

References LightApp_DataObject::componentObject(), ior(), IORId, LightApp_DataObject::text(), value(), and ValueId.

◆ toolTip()

QString SalomeApp_DataObject::toolTip ( const int  = NameId) const
virtual

Get data object tooltip for the specified column.

Parameters
idcolumn id (not used)
Returns
object tooltip for the specified column

Reimplemented from SUIT_DataObject.

Reimplemented in SalomeApp_RootObject, and SalomeApp_ModuleObject.

References SUIT_Session::activeApplication(), componentDataType(), LightApp_DataObject::componentObject(), entry(), ior(), SalomeApp_Application::lcc(), name(), SUIT_DataObject::root(), SUIT_Session::session(), and LightApp_RootObject::study().

◆ updateItem()

void SalomeApp_DataObject::updateItem ( )
virtual

◆ value()

QString SalomeApp_DataObject::value ( const _PTR(SObject)&  ) const
private

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