AfrFoundation CATCSO

Usage: you must use this class as is. You should never derive it.


public class CATCSO

Class containing the selection.
Role: This class stores a list of the currently selected elements. There is only one instance of this class by document. A pointer to this class is returned by method. Use this class to add or remove elements from the selection.
This class dispatches a event when elements are added or removed from the selection.
Elements added to the selection are automatically highlighted. Elements removed from the selection are automatically unhighlighted.

See also:
,


Constructor and Destructor Index


o ~CATCSO()

Method Index


o AddElement(CATBaseUnknown*,int)
Adds an element to the selection.
o AddSO(CATSO*,AddSOType)
Adds a set of elements to the selection.
o Contains(CATBaseUnknown*)
Tells whether an element is contained in the list.
o Empty(int)
Empties the selection.
o GetSize()
Returns the number of selected elements.
o InitElementList()
Initializes the cursor to the begining of the element list.
o Locate(CATBaseUnknown*)
Returns the position of an element in the selection.
o NextElement()
Returns the element at cursor position.
o RemoveElement(CATBaseUnknown*,int)
Removes an element from the selection.
o RemoveFromUndoRedoManagement()

Enumerated Type Index


o AddSOType
Indicates how to add a set of elements to the selection.

Constructor and Destructor


o ~CATCSO
public virtual ~CATCSO()

Methods


o AddElement
public AddElement( iPathElement,
iDispatchChange=1)
Adds an element to the selection.
Parameters:
iPathElement
The element to be added to the selection.
Legal values: Any valid pointer to a
instance.
Cyclic reference: iPathElement is AddRef'ed. It is released either when the element is removed from the set, or when the set is deleted or emptied.
iDispatchChange
Request that a
event is sent after the operation. If the element was already in the selection, the selection is not modified and the event is not sent.
Legal values: 1 or a non null value to send the event, 0 to prevent sending it. 1 is the default.
o AddSO
public AddSO( iSO,
iType)
Adds a set of elements to the selection.
Role: Fast way to add a set of elements to selection. An is dispatched at the end of the operation.
Parameters:
iSO
The set of elements to be added to the selection.
Legal values: Each element of the set must be a pointer to a
instance.
Cyclic reference: A pointer to each element of the set, added in the CSO, is kept and AddRef'ed as long as the element is in the selection.
iType
Indicates how the set is added to the selection.
Legal values: It can be set to either CATCSO::Merge to perform an XOR merge with the selection or to CATCSO::Replace to replace the existing selection or to CATCSO::Add to extend the existing selection.
See also:
o Contains
public Contains( )
Tells whether an element is contained in the list.
Returns:
TRUE if the element is here or FALSE otherwise
o Empty
public Empty( iDispatchChange=1)
Empties the selection.
Role: Fast way to remove all elements from the selection.
Parameters:
iDispatchChange
Requests that a
event is dispatched at the end of the operation.
Legal values: 1 or a non null value to send the event, 0 to prevent sending it. 1 is the default.
o GetSize
public GetSize()
Returns the number of selected elements.
o InitElementList
public InitElementList()
Initializes the cursor to the begining of the element list.
Role: Use InitElementList to initialize a loop on the selected elements. Then use to return each element.
o Locate
public Locate( element)
Returns the position of an element in the selection.
Returns:
0 if the element is not in the list else its position. Indice in this list begins at 1.
o NextElement
public NextElement()
Returns the element at cursor position.
Role: Returns a pointer to the CATPathElement instance at the cursor position. Increments the cursor position of 1 after the operation.
Use NextElement to loop on the selection. The following code sample may be used:

cso->InitElementList();
while (element = cso->NextElement())
{
// element processing here
}


where cso is a pointer to a CATCSO instance.
Returns:
The element at cursor position.
Lifecycle rules deviation: This method doesn't AddRef the returned value.
See also:
o RemoveElement
public RemoveElement( iPathElement,
iDispatchChange=1)
Removes an element from the selection.
Parameters:
iPathElement
The element to be removed from the selection.
Legal values: Any valid pointer to a
instance.
iDispatchChange
Requests that a
event is sent after the operation. If the element was not in the selection, the selection is not modified and the event is not sent.
Legal values: 1 or a non null value to send the event, 0 to prevent sending it. 1 is the default.
o RemoveFromUndoRedoManagement
public RemoveFromUndoRedoManagement()

Enumerated Types


o AddSOType
enum AddSOType {
  Merge,
  Replace,
  Add
}
Indicates how to add a set of elements to the selection.
Parameters:
Merge
The operation follows a XOR type merge rule. If the element was not in the selection then it is added to the selection. If the element was in the selection then it is removed from the selection.
Replace
The set of elements replaces the existing selection.
Add
The set of elements is added to the existing selection.

This object is included in the file: CATCSO.h
If needed, your Imakefile.mk should include the module: CATAfrFoundation

Copyright © 1999-2015, Dassault Systèmes. All rights reserved.