![]() Rogue Wave Views 5.5.1 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
Group class. More...
#include <ilviews/graphics/smartset.h>
Public Member Functions | |
| IlvSmartSet (IlvDisplay *display, IlvInputFile &file) | |
| Constructor. | |
| IlvSmartSet (const char *name=0) | |
| Constructor. | |
| IlvSmartSet (const IlvSmartSet &, const char *name=0) | |
| Constructor. | |
| virtual | ~IlvSmartSet () |
| Destructor. | |
| IlBoolean | addObject (IlvGraphic *object) |
| Adds an object. | |
| virtual IlvSmartSet * | copy () const |
| Copies this smart set. | |
| IlUInt | getCardinal () const |
| Gets the number of objects. | |
| const char * | getName (const IlvGraphic *object) |
| Gets the original name of an object. | |
| const char * | getName () const |
| Gets the name. | |
| virtual const char * | getNamesSeparator () const |
| Gets the string used to name the objects. | |
| virtual IlvGraphic * | getObject (const char *) const |
| Gets an object by name. | |
| IlvGraphic *const * | getObjects (IlUInt &count) const |
| Gets all the objects. | |
| IlBoolean | hasObject (IlvGraphic *object) const |
| Checks if an object is present. | |
| IlBoolean | removeObject (IlvGraphic *object, IlBoolean destroy=((IlBoolean) 0)) |
| Removes an object. | |
| void | setName (const IlvGraphic *, const char *) |
| Sets the name of an object. | |
| void | setName (const char *newName) |
| Sets the name. | |
| virtual void | write (IlvOutputFile &file) const |
| Writes this smart set to a stream. | |
Group class.
Library: views
The IlvSmartSet class is designed to create logical groups, called SmartSets, in the context of a container or a manager. A SmartSet references a group of objects. When an object is added to the SmartSet, its name is modified in order to reference the name of the SmartSet. An object cannot be stored simultaneously in more than one SmartSet.
IlvContainer, IlvManager. | IlvSmartSet::IlvSmartSet | ( | const IlvSmartSet & | , | |
| const char * | name = 0 | |||
| ) |
Constructor.
This constructor initializes a new SmartSet by creating a copy of an existing SmartSet. All the objects stored in the source are copied (by calling their copy method) and stored in this new SmartSet. If name is not 0, the name of this new SmartSet is set to a copy of name, otherwise, this SmartSet is given the same name as set.
| IlvSmartSet::IlvSmartSet | ( | const char * | name = 0 |
) |
Constructor.
This constructor initializes a new empty IlvSmartSet. The name of this new SmartSet is initialized to a copy of the string name.
| IlvSmartSet::IlvSmartSet | ( | IlvDisplay * | display, | |
| IlvInputFile & | file | |||
| ) |
Constructor.
This constructor initializes a new SmartSet by reading its definition from the input file file.
| virtual IlvSmartSet::~IlvSmartSet | ( | ) | [virtual] |
Destructor.
The destructor removes all the objects this SmartSet stores, and gives them their original names. No objects are destroyed.
| IlBoolean IlvSmartSet::addObject | ( | IlvGraphic * | object | ) |
Adds an object.
Adds the graphic object object to this SmartSet. If both this SmartSet and object have names, the name of object is changed to the concatenation of the SmartSet name, the name separator string, and the object name. This function returns IlFalse on error, that is, if this object is already located in a SmartSet.
| virtual IlvSmartSet* IlvSmartSet::copy | ( | ) | const [virtual] |
Copies this smart set.
SmartSet. It is equivalent to: new IlvSmartSet(*this); | IlUInt IlvSmartSet::getCardinal | ( | ) | const |
Gets the number of objects.
SmartSet. | const char* IlvSmartSet::getName | ( | const IlvGraphic * | object | ) |
Gets the original name of an object.
0 if the object cannot be found or has no name. | const char* IlvSmartSet::getName | ( | ) | const |
Gets the name.
SmartSet or 0 if the SmartSet doesn't have a name. This string must not be modified nor deleted. | virtual const char* IlvSmartSet::getNamesSeparator | ( | ) | const [virtual] |
Gets the string used to name the objects.
SmartSet. The default implementation returns "#". | virtual IlvGraphic* IlvSmartSet::getObject | ( | const char * | ) | const [virtual] |
Gets an object by name.
0 if it cannot be found. | IlvGraphic* const* IlvSmartSet::getObjects | ( | IlUInt & | count | ) | const |
Gets all the objects.
SmartSet. The number of objects is returned in count. This array must not be modified nor deleted. Other Rogue Wave Views functions can overwrite this array so the caller of this method should consider copying it. | IlBoolean IlvSmartSet::hasObject | ( | IlvGraphic * | object | ) | const |
Checks if an object is present.
IlTrue if object is stored in this SmartSet, and IlFalse if it is not. | IlBoolean IlvSmartSet::removeObject | ( | IlvGraphic * | object, | |
| IlBoolean | destroy = ((IlBoolean) 0) | |||
| ) |
Removes an object.
Removes the object object from the SmartSet. If destroy is set to IlTrue, the object is deleted, otherwise, the object is renamed to its original name.
| void IlvSmartSet::setName | ( | const IlvGraphic * | , | |
| const char * | ||||
| ) |
Sets the name of an object.
Sets the original name of object, that must be stored in this SmartSet, to a copy of the string name. If name is 0, the name of the object is removed.
| void IlvSmartSet::setName | ( | const char * | newName | ) |
Sets the name.
Sets the name of this SmartSet to a copy of the string newName. If newName is 0, the SmartSet has no name and the name of the subobjects is hidden.
| virtual void IlvSmartSet::write | ( | IlvOutputFile & | file | ) | const [virtual] |
Writes this smart set to a stream.
Writes in the output file file a description of this SmartSet.
© Copyright 2012, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.