Version: 6.3.1
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Private Attributes | Friends

SalomeApp_SavePointObject Class Reference

Represents persistent visual_state object. More...

#include <SalomeApp_DataObject.h>

Inheritance diagram for SalomeApp_SavePointObject:
Inheritance graph

Public Types

enum  { EntryId = VisibilityId + 1 }
 

Column id.

More...
enum  ColorRole {
  Text, Base, Foreground, Background,
  Highlight, HighlightedText
}
 

Color role.

More...
enum  { NameId, VisibilityId }
 

Column id.

More...

Public Member Functions

 SalomeApp_SavePointObject (SUIT_DataObject *, const int, SalomeApp_Study *)
 Constructor.
virtual ~SalomeApp_SavePointObject ()
 Destructor.
virtual QString name () const
 Get data object name.
virtual QString entry () const
 Get object string identifier.
virtual QPixmap icon (const int=NameId) const
 Get data object icon for the specified column.
virtual QString toolTip (const int=NameId) const
 Get data object tooltip for the specified column.
int getId () const
 Get save point unique identifier.
virtual SUIT_DataObjectKeykey () const
 Get the data object unique key.
virtual QString text (const int=NameId) const
 Get object text data for the specified column.
virtual SUIT_DataObjectcomponentObject () const
 Get the component object.
virtual QString componentDataType () const
 Get component type.
virtual bool customSorting (const int=NameId) const
 Check if the specified column supports custom sorting.
virtual bool compare (const QVariant &, const QVariant &, const int=NameId) const
 Compares data from two items for sorting purposes.
virtual int groupId () const
virtual QVariant customData (Qtx::CustomDataType type)
 return custom data for data object
virtual bool isVisible () const
 Check if the object is visible.
virtual bool renameAllowed (const int=NameId) const
 Check if this object is can't be renamed in place.
virtual bool setName (const QString &)
 Set name of the this object.
CAM_Modulemodule () const
 Get CAM module.
virtual CAM_DataModeldataModel () const
 Get CAM data model.
SUIT_DataObjectroot () const
 Get the root object.
SUIT_DataObjectlastChild () const
 Get the last child object.
SUIT_DataObjectfirstChild () const
 Get the first child object.
int childCount () const
 Get the number of the child objects.
int childPos (const SUIT_DataObject *) const
 Get the index of the specified object in the child list.
SUIT_DataObjectchildObject (const int) const
 Get child object by the specified index.
int level () const
 Get the object level in the tree structure.
int position () const
 Get the position of the data object in its parent's children list.
SUIT_DataObjectnextBrother () const
 Get the next sibling data object in the children list.
SUIT_DataObjectprevBrother () const
 Get the previous sibling data object in the children list.
bool autoDeleteChildren () const
 Get "auto-delete children" flag.
virtual void setAutoDeleteChildren (const bool)
 Set "auto-delete children" flag.
virtual void children (DataObjectList &, const bool=false) const
 Get all children.
virtual DataObjectList children (const bool=false)
 Get all children. .
void appendChild (SUIT_DataObject *)
 Add new child object to the end of the children list.
virtual void insertChild (SUIT_DataObject *, int)
 Insert new child object to the list of the children.
virtual void removeChild (SUIT_DataObject *, const bool=false)
 Remove the specified child object reference.
bool replaceChild (SUIT_DataObject *, SUIT_DataObject *, const bool=false)
 Replace the specified child object by another object.
void reparentChildren (const SUIT_DataObject *)
 Change the parent for all children from specified object to this one.
virtual SUIT_DataObjectparent () const
 Get the parent object.
virtual void setParent (SUIT_DataObject *)
 Change the parent object.
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).
bool modified ()
void setModified (bool modified)
virtual QColor color (const ColorRole, const int=NameId) const
 Get data object color for the specified column.
virtual QString statusTip (const int=NameId) const
 Get data object status tip for the specified column.
virtual QString whatsThis (const int=NameId) const
 Get data object "what's this" information for the specified column.
virtual QFont font (const int=NameId) const
 Get data object font for the specified column.
virtual int alignment (const int=NameId) const
 Get data object text alignment for the specified column.
virtual bool expandable () const
virtual bool isDragable () const
 Check if the object is draggable.
virtual bool isDropAccepted (SUIT_DataObject *obj)
 Check if the drop operation fo this object is possible.
virtual bool isEnabled () const
 Check if this object is enabled.
virtual bool isSelectable () const
 Check if this object is selectable.
virtual bool isCheckable (const int=NameId) const
 Check if this object is checkable for the specified column.
virtual bool isOn (const int=NameId) const
 Get the checked state of the object (if it is checkable) for the specified column.
virtual void setOn (const bool, const int=NameId)
 Set the checked state of the object (if it is checkable) for the specified column.
virtual bool isOpen () const
 Get the "opened" state of the object.
virtual void setOpen (const bool)
 Set the "opened" state of the object.
virtual void update ()
 Updates necessary internal fields of data object.
void deleteLater ()
 Schedule this object for the late deleting.
void dump (const int indent=2) const
 Dump the object tree recursively to the standard output.

Static Public Member Functions

static Signalsignal ()
 Get global signal handler.
static bool connect (const char *, QObject *, const char *)
 Connect to the signal handlerx.
static bool disconnect (const char *, QObject *, const char *)
 Disconnect from the signal handler.

Protected Attributes

QString myCompDataType
SUIT_DataObjectmyCompObject

Private Attributes

int myId
SalomeApp_StudymyStudy

Friends

class SUIT_DataObject::Signal

Detailed Description

Save point objects are stored in the data model, but NOT in SObjects structure, so they are handled separately using this special class


Member Enumeration Documentation

anonymous enum [inherited]
Enumerator:
EntryId 

entry column

enum SUIT_DataObject::ColorRole [inherited]
Enumerator:
Text 

editor foreground (text) color

Base 

editor background color

Foreground 

foreground (text) color

Background 

background color

Highlight 

highlight background color

HighlightedText 

highlighted foreground (text) color

anonymous enum [inherited]
Enumerator:
NameId 

name column

VisibilityId 

visibility state column


Constructor & Destructor Documentation

SalomeApp_SavePointObject::SalomeApp_SavePointObject ( SUIT_DataObject parent,
const int  id,
SalomeApp_Study study 
)
Parameters:
parentparent data object
idsave point ID
studystudy
SalomeApp_SavePointObject::~SalomeApp_SavePointObject ( ) [virtual]

Member Function Documentation

QString SalomeApp_SavePointObject::name ( ) const [virtual]
Returns:
object name

Reimplemented from SUIT_DataObject.

References SalomeApp_Study.getNameOfSavePoint(), myId, and myStudy.

QString SalomeApp_SavePointObject::entry ( ) const [virtual]

Gets entry ob object.

Returns:
object ID

Reimplemented from LightApp_DataObject.

References Handle().

QPixmap SalomeApp_SavePointObject::icon ( const int  = NameId) const [virtual]
Parameters:
idcolumn id
Returns:
object icon for the specified column

Reimplemented from SUIT_DataObject.

QString SalomeApp_SavePointObject::toolTip ( const int  = NameId) const [virtual]
Parameters:
idcolumn id (not used)
Returns:
object tooltip for the specified column

Reimplemented from SUIT_DataObject.

References name().

int SalomeApp_SavePointObject::getId ( ) const
Returns:
save point ID

References myId.

SUIT_DataObjectKey * LightApp_DataObject::key ( ) const [virtual, inherited]
Returns:
data object key

Reimplemented from SUIT_DataObject.

References LightApp_DataObject.entry().

QString LightApp_DataObject::text ( const int  id = NameId) const [virtual, inherited]

Column with id = 0 (NameId) is supposed to be used to get the object name. Column with id = 1 (EntryId) is supposed to be used to get the object entry.

Parameters:
idcolumn id
Returns:
object text data

Reimplemented from SUIT_DataObject.

Reimplemented in SalomeApp_DataObject, and SalomeApp_RootObject.

References LightApp_DataObject.entry(), and LightApp_DataObject.EntryId.

SUIT_DataObject * LightApp_DataObject::componentObject ( ) const [virtual, inherited]
Returns:
component data object

References LightApp_DataObject.myCompObject, SUIT_DataObject.parent(), and SUIT_DataObject.root().

QString LightApp_DataObject::componentDataType ( ) const [virtual, inherited]
bool LightApp_DataObject::customSorting ( const int  id = NameId) const [virtual, inherited]
Parameters:
idcolumn id
Returns:
true if column sorting should be customized
See also:
compare()

Reimplemented from SUIT_DataObject.

Reimplemented in SalomeApp_DataObject.

References LightApp_DataObject.EntryId.

bool LightApp_DataObject::compare ( const QVariant &  left,
const QVariant &  right,
const int  id = NameId 
) const [virtual, inherited]

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 SUIT_DataObject.

Reimplemented in SalomeApp_DataObject.

References LightApp_DataObject.EntryId.

int LightApp_DataObject::groupId ( ) const [virtual, inherited]
QVariant LightApp_DataObject::customData ( Qtx::CustomDataType  type) [virtual, inherited]

Reimplemented from SUIT_DataObject.

References LightApp_DataObject.EntryId, and Qtx.IdType.

bool LightApp_DataObject::isVisible ( ) const [virtual, inherited]
Returns:
true if this object is displayable or false otherwise

Reimplemented from SUIT_DataObject.

Reimplemented in SalomeApp_DataObject.

References LightApp_DataObject.componentDataType(), LightApp_Study.getVisualComponentName(), SUIT_DataObject.root(), and LightApp_RootObject.study().

bool LightApp_DataObject::renameAllowed ( const int  id = NameId) const [virtual, inherited]

This method can be re-implemented in the subclasses. Default implementation returns false (all objects can not be renamed).

Parameters:
idcolumn id
Returns:
true if the item can be renamed by the user in place (e.g. in the Object browser)

Reimplemented from SUIT_DataObject.

References SUIT_Study.application(), LightApp_DataObject.entry(), CAM_DataObject.module(), SUIT_DataObject.NameId, LightApp_Application.renameAllowed(), LightApp_Module.renameAllowed(), SUIT_DataObject.root(), and LightApp_RootObject.study().

bool LightApp_DataObject::setName ( const QString &  name) [virtual, inherited]

This method can be re-implemented in the subclasses. Default implementation returns false.

Returns:
true if rename operation finished successfully, false otherwise.

Reimplemented from SUIT_DataObject.

Reimplemented in SALOME_PYQT_DataObjectLight.

References SUIT_Study.application(), LightApp_DataObject.entry(), CAM_DataObject.module(), LightApp_Application.renameObject(), LightApp_Module.renameObject(), SUIT_DataObject.root(), and LightApp_RootObject.study().

CAM_Module * CAM_DataObject::module ( ) const [inherited]
Returns:
parent module object pointer

References CAM_DataObject.dataModel(), and CAM_DataModel.module().

CAM_DataModel * CAM_DataObject::dataModel ( ) const [virtual, inherited]
Returns:
data model or 0 if it is not set
See also:
CAM_ModuleObject class

Reimplemented in CAM_ModuleObject.

References CAM_DataObject.dataModel(), and SUIT_DataObject.parent().

SUIT_DataObject * SUIT_DataObject::root ( ) const [inherited]
Returns:
root object of the data tree

References SUIT_DataObject.parent(), and SUIT_DataObject.root().

SUIT_DataObject * SUIT_DataObject::lastChild ( ) const [inherited]
Returns:
last child object or 0 if there are no children
See also:
firstChild()

References SUIT_DataObject.myChildren.

SUIT_DataObject * SUIT_DataObject::firstChild ( ) const [inherited]
Returns:
first child object or 0 if there are no children
See also:
lastChild()

References SUIT_DataObject.myChildren.

int SUIT_DataObject::childCount ( ) const [inherited]
Returns:
number of the children

References SUIT_DataObject.myChildren.

int SUIT_DataObject::childPos ( const SUIT_DataObject obj) const [inherited]
Parameters:
objchild object
Returns:
subobject position or -1 if it does not belong to this object

References SUIT_DataObject.myChildren.

SUIT_DataObject * SUIT_DataObject::childObject ( const int  idx) const [inherited]
Parameters:
idxchild object index
Returns:
child object or 0 if index is out of range

References SUIT_DataObject.myChildren.

int SUIT_DataObject::level ( ) const [inherited]

Root object has level 0.

Returns:
object level.

References SUIT_DataObject.parent().

int SUIT_DataObject::position ( ) const [inherited]
Returns:
data object position

References SUIT_DataObject.childPos(), and SUIT_DataObject.myParent.

SUIT_DataObject * SUIT_DataObject::nextBrother ( ) const [inherited]
Returns:
child object or 0 if there is no next sibling
See also:
prevBrother()

References SUIT_DataObject.childObject(), SUIT_DataObject.childPos(), and SUIT_DataObject.myParent.

SUIT_DataObject * SUIT_DataObject::prevBrother ( ) const [inherited]
Returns:
child object or 0 if there is no previous sibling
See also:
nextBrother()

References SUIT_DataObject.childObject(), SUIT_DataObject.childPos(), and SUIT_DataObject.myParent.

bool SUIT_DataObject::autoDeleteChildren ( ) const [inherited]
Returns:
true if the object should delete all its children on destroying
See also:
setAutoDeleteChildren()

References SUIT_DataObject.myAutoDel.

void SUIT_DataObject::setAutoDeleteChildren ( const bool  on) [virtual, inherited]

If this flag is on (default), the object will delete all its children on destroying.

Parameters:
onnew flag value
See also:
autoDeleteChildren()

References SUIT_DataObject.myAutoDel.

void SUIT_DataObject::children ( DataObjectList lst,
const bool  rec = false 
) const [virtual, inherited]

If parameter rec is true then function collects all the children recursively.

Parameters:
lstreturning list of children
recif true collect all children recursively

References SUIT_DataObject.myChildren.

DataObjectList SUIT_DataObject::children ( const bool  rec = false) [virtual, inherited]

If parameter rec is true then function collects all the children recursively.

Parameters:
recif true collect all children recursively
Returns:
list of children

References SUIT_DataObject.children().

void SUIT_DataObject::appendChild ( SUIT_DataObject obj) [inherited]
Parameters:
objchild object being added

References SUIT_DataObject.insertChild(), and SUIT_DataObject.myChildren.

void SUIT_DataObject::insertChild ( SUIT_DataObject obj,
int  position 
) [virtual, inherited]
Parameters:
objchild object being added
positionchild position

Reimplemented in LightApp_ModuleObject.

References SUIT_DataObject.Signal.emitInserted(), SUIT_DataObject.myChildren, SUIT_DataObject.position(), SUIT_DataObject.setParent(), and SUIT_DataObject.signal().

void SUIT_DataObject::removeChild ( SUIT_DataObject obj,
const bool  del = false 
) [virtual, inherited]
Parameters:
objchild object being removed
delif true, the child object is destroyed

References SUIT_DataObject.deleteLater(), SUIT_DataObject.Signal.emitRemoved(), SUIT_DataObject.myChildren, SUIT_DataObject.setParent(), and SUIT_DataObject.signal().

bool SUIT_DataObject::replaceChild ( SUIT_DataObject src,
SUIT_DataObject trg,
const bool  del = false 
) [inherited]
Parameters:
srcchild object being replaced
trgnew child object
delif true, the previous object is destroyed
Returns:
true if the object has been replaced

References SUIT_DataObject.childPos(), SUIT_DataObject.deleteLater(), SUIT_DataObject.insertChild(), and SUIT_DataObject.removeChild().

void SUIT_DataObject::reparentChildren ( const SUIT_DataObject obj) [inherited]
Parameters:
objobject which children to be reparented

References SUIT_DataObject.children().

SUIT_DataObject * SUIT_DataObject::parent ( ) const [virtual, inherited]
Returns:
parent object or 0 if this is top-level item

References SUIT_DataObject.myParent.

void SUIT_DataObject::setParent ( SUIT_DataObject p) [virtual, inherited]
void SUIT_DataObject::assignParent ( SUIT_DataObject p) [virtual, inherited]
void SUIT_DataObject::insertChildAtPos ( SUIT_DataObject obj,
int  position 
) [inherited]
Parameters:
objchild object being added
positionchild position

References SUIT_DataObject.assignParent(), SUIT_DataObject.myChildren, and SUIT_DataObject.position().

bool SUIT_DataObject.modified ( ) [inherited]
void SUIT_DataObject.setModified ( bool  modified) [inherited]
QColor SUIT_DataObject::color ( const ColorRole  ,
const int  = NameId 
) const [virtual, inherited]

This method can be re-implemented in the subclasses. Default implementation returns null color.

The parameter id specifies the column identificator

Parameters:
rolecolor role
idcolumn id
Returns:
object color for the specified column

Reimplemented in SalomeApp_DataObject, and SalomeApp_RootObject.

QString SUIT_DataObject::statusTip ( const int  = NameId) const [virtual, inherited]

This method can be re-implemented in the subclasses. Default implementation returns null string.

The parameter id specifies the column identificator

Parameters:
idcolumn id
Returns:
object status tip for the specified column
QString SUIT_DataObject::whatsThis ( const int  = NameId) const [virtual, inherited]

This method can be re-implemented in the subclasses. Default implementation returns null string.

The parameter id specifies the column identificator

Parameters:
idcolumn id
Returns:
object "what's this" information for the specified column
QFont SUIT_DataObject::font ( const int  = NameId) const [virtual, inherited]

This method can be re-implemented in the subclasses. Default implementation returns application default font.

The parameter id specifies the column identificator

Parameters:
idcolumn id
Returns:
object font for the specified column

Reimplemented in SalomeApp_DataObject.

int SUIT_DataObject::alignment ( const int  = NameId) const [virtual, inherited]

This method can be re-implemented in the subclasses. Default implementation returns default alignment which is Qt:AlignLeft.

The parameter id specifies the column identificator (to display, for example, in the tree view widget).

Parameters:
idcolumn id
Returns:
object text alignment flags for the specified column
bool SUIT_DataObject::expandable ( ) const [virtual, inherited]

Reimplemented in SalomeApp_DataObject.

bool SUIT_DataObject::isDragable ( ) const [virtual, inherited]

This method can be re-implemented in the subclasses. Default implementation returns false (all objects could not be dragged).

Returns:
true if it is possible to drag this object
bool SUIT_DataObject::isDropAccepted ( SUIT_DataObject obj) [virtual, inherited]

This method can be re-implemented in the subclasses. Default implementation returns false (drop operation is not allowed).

Parameters:
objobject being dropped
Returns:
true if it is possible to drop an object obj to this object
bool SUIT_DataObject::isEnabled ( ) const [virtual, inherited]

This method can be re-implemented in the subclasses. Default implementation returns true (all objects are enabled).

Returns:
true if the user can interact with the item
bool SUIT_DataObject::isSelectable ( ) const [virtual, inherited]

This method can be re-implemented in the subclasses. Default implementation returns true (all objects are selectable).

Returns:
true if the item can be selected
bool SUIT_DataObject::isCheckable ( const int  = NameId) const [virtual, inherited]

This method can be re-implemented in the subclasses. Default implementation returns false (all objects are not checkable).

Parameters:
idcolumn id
Returns:
true if the item can be checked or unchecked by the user
See also:
isOn(), setOn()
bool SUIT_DataObject::isOn ( const int  id = NameId) const [virtual, inherited]

Default implementation supports the checked state for the first ("Name") column only.

Parameters:
idcolumn id
Returns:
checked state of the object for the specified column
See also:
setOn(), isCheckable()

References SUIT_DataObject.myCheck, and SUIT_DataObject.NameId.

void SUIT_DataObject::setOn ( const bool  on,
const int  id = NameId 
) [virtual, inherited]

Default implementation supports the checked state for the first ("Name") column only.

Parameters:
onnew checked state of the object for the specified column
idcolumn id
See also:
isOn(), isCheckable()

References SUIT_DataObject.myCheck, and SUIT_DataObject.NameId.

bool SUIT_DataObject::isOpen ( ) const [virtual, inherited]
Returns:
"opened" state of the object
See also:
setOpen()

References SUIT_DataObject.myOpen.

void SUIT_DataObject::setOpen ( const bool  on) [virtual, inherited]
Parameters:
onnew "opened" state of the object
See also:
isOpen()

References SUIT_DataObject.myOpen.

void SUIT_DataObject::update ( ) [virtual, inherited]
SUIT_DataObject::Signal * SUIT_DataObject::signal ( ) [static, inherited]
Returns:
the only instance of the signal handler

References SUIT_DataObject.mySignal.

bool SUIT_DataObject::connect ( const char *  sig,
QObject reciever,
const char *  slot 
) [static, inherited]
Parameters:
sigsignal name
recieversignal receiver object
slotslot name
Returns:
true if connection is successfull

References SUIT_DataObject.signal().

bool SUIT_DataObject::disconnect ( const char *  sig,
QObject reciever,
const char *  slot 
) [static, inherited]
Parameters:
sigsignal name
recieversignal receiver object
slotslot name
Returns:
true if disconnection is successfull

References SUIT_DataObject.signal().

void SUIT_DataObject::deleteLater ( ) [inherited]

The object will be deleted when control returns to the event loop. Note that entering and leaving a new event loop (e.g., by opening a modal dialog) will not perform the deferred deletion; for the object to be deleted, the control must return to the event loop from which deleteLater() was called.

References SUIT_DataObject.Signal.deleteLater(), SUIT_DataObject.parent(), SUIT_DataObject.removeChild(), and SUIT_DataObject.signal().

void SUIT_DataObject::dump ( const int  indent = 2) const [inherited]
Parameters:
indentcurrent indentation level

References SUIT_DataObject.myChildren, and SUIT_DataObject.name().


Friends And Related Function Documentation

friend class SUIT_DataObject::Signal [friend, inherited]

Field Documentation

QString LightApp_DataObject.myCompDataType [protected, inherited]
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS