3D PLM Enterprise Architecture

3D Visualization

Interactive Set of Objects

What is the ISO and how use it?
Technical Article

Abstract

The Interactive Set of Objects is an interactive object used to visualize temporary components, those not kept by a V5 document. This article describes it in detail, and explains how to use it. The last section is dedicated to the temporary component creation. 


A CATISO Class Instance

The Interactive Set of Objects is a component [1] whose main class is the CATISO class. It implements CATI3DGeoVisu, CATI2DGeoVisu, and CATIModelEvents interfaces, as represented by the following UML diagram:

The implementation of the CATI3DGeoVisu (or CATI2DGeoVisu) interface builds a CAT3DBagRep (or CAT2DBagRep) class instance. This set (bag) of graphic representations contains the graphic representations of all components set in the ISO. The next section, A Bag of Components, details this notion of bag.

For the CATIModelEvents interface, the How Does it Work ? section gives you explanations on the role of this interface.

[Top]

A Bag of Components 

The CATISO class contains methods to:

Before adding or removing an element, it is useless to test if the element already exists, because these two method do it. However, you can always need to know if a component is included in the ISO, for that there is the IsMember method. 

The introspection methods are: 

It locates an internal "cursor" just before the first element of the ISO. To retrieve the first element of the list, call InitElementList and then, GetNextElement .

It returns the element just after the current position of the cursor, and then increases the position of the cursor. If the returned value is NULL, the end of the list is reached.

The elements of the ISO are components which must at least implement the CATI3DGeoVisu or the CATI2DGeoVisu interface. The Creating Temporary Components section describes three kind of components that you can use or create. 

[Top]

Managed by  V5 Document Editors

Each V5 document is interactively controlled by one CATFrmEditor class instance called an editor [2] for short. When this object is instantiated, it creates three kinds of  ISO:

In the CATFrmEditor class destructor, these three interactive sets of objects are first emptied and then released. Consequently, in your command, while the editor is alive you must ensure the contents of the ISO. Refer you to the CAAAfrBoundingElementCmd use case [3] for an example.

[Top]

Like A Root Model

In a V5 document, Part features and the top Product are root components. You can you refer to the referenced article [9] for a brief notion of root object.You will also learn the main role of the unique CATVisManager class instance. 

The CATISO instance class plays the same role. It means that when you want create a new window class [2] for a V5 document, if you want the elements of the ISO to be also drawn in this new window, you must do the relation between each viewer of the window and each Interactive Set of Objects. You can you refer to the use cases [4] [5] which detail the creation of a new window. In the new window class constructor you can have the following lines:

...
  CATISO * pISO = pEditor->GetISO()  ;  
  pISO->AddViewer(_pViewer);
  CATISO * pfurtiveISO = pEditor->GetFurtiveISO()  ;  
  pfurtiveISO->AddViewer(_pViewer);
  CATISO * pbgISO = pEditor->GetBackgrdISO()  ;  
  pbgISO->AddViewer(_pViewer);
...

The AddViewer method calls the AttachTo method of the CATVisManager class with the following arguments:

HRESULT AttachTo ( CATPathElement* iTreeRoot,
                   CATViewpoint*	iViewpoint,
                   list<IID>&	iVisuList,
                   CATCommand* iSelectorFather = NULL,
                   int iFurtive=0,
                   int iLocalMatrix=0,
                   int iLocalGraphicAttributs=0 );

The following schema explains the command tree, and the similitude between a V5 root object and the ISO.

The manipulator (CAT3DManipulator/CAT2DManipulator) associated with the graphic representation of the root object, and the ISO are inside the command tree. It enables us to receive the information coming from the end user interactions in the viewer. 

This diagram shows that the complete path of an element into the ISO is first the ISO itself and then the component. Here is the code to create this path:

...
CATFrmEditor * pEdt = CATFrmEditor::GetCurrentEditor();
CATISO * pISO = pEdt->GetISO();

CATPathElement pPathElement (pISO);
PathElement.AddChildElement(pComponent);
...

Where pComponent is a pointer on an element contained in the ISO. 

[Top]

How Does it Work?

When an element is added in the ISO, the CATISO class instance keeps the new component in a list, and sends a CATCreate notification thanks to its implementation to the CATIModelEvents interface. The CATVisManager receives the notification and asks the reconstruction of the graphic representation of the ISO. The Build method of the CATI3DGeoVisu (or 2D) interface, for the CATISO component, browses the internal list of the ISO, and asks the CATVisManager to retrieve or build the graphic representation of each element of the list.

When an element is removed from the ISO, the element is first removed from the internal list. Then, depending on the second argument of the RemoveElement method, two kinds of notifications can be sent:

When an element of the ISO is updated, thanks to the UpdateElement method, a CATModify notification is sent. The CATVisManager will ask for the re-construction of the graphic representation associated with the element to update. This reconstruction must be absolutely done by the CATVisManager thanks to the implementation of the CATI3DGeoVisu (or 2D) interface on the component to update. 

Here is a forbidden scenario:

You must not modify the graphic representation of a component included into an ISO.

Here is a possible scenario:

The step 3 consists in using an interface of the component to modify one or more of its characteristic. These characteristics are parameters used to build the graphic representation, and consequently used in the CATI3DGeoVisu (or 2D) interface. 

You can you refer to the CAADegClippingByBoxCmd use case [6] where elements are added into ISO, removed with or without deletion from the ISO, and updated. 

[Top]

Creating Temporary Components

There are three ways to create a component which will be displayed thanks to the Interactive Set of Objects:

  1. Create an instance of the CATModelForRep3D class 
  2. Create a component which derives from the CATModelForRep3D component
  3. Create a component which derives from CATBaseUnknown and implements, at least, the CATI3DGeoVisu interface (or 2D)

Each case is in relationship to a specific usage of the component. 

  1. Create an instance of the CATModelForRep3D class 
  2. It is the simplest way to create a temporary component. Here is an example:

    ...
    CATModelForRep3D *pModel = new CATModelForRep3D();
    
    CAT3DCustomRep *pMyRep = new CAT3DCustomRep() ; 
    ...
    pModel->SetRep(pMyRep );
    ...

    The graphic representation is built in your code and associated with the component, pModel, thanks to the SetRep method of the CATModelForRep3D class. Once the graphic representation is associated with the component, it is hold by the component, you do not have to delete the graphic representation (pMyRep). 

    You use it when your component is just a visual help, not modifiable and not selectable by the end user. 

  3. Create a component which derives from the CATModelForRep3D component
  4. You create a component [1] which Object Modeler and C++ derives from the CATModelForRep3D component, you create a specific interface [8], and you implement it on your component. This interface will be used as filter of an agent of selection. 

    ...
    CATPathElementAgent * pAgent = new CATPathElementAgent(...);
    pAgent->AddElementType(IID_ISpecificInterface);
    ...

    To create the component, and set it its graphic representation, the method is identical as the one detailed above:

    ...
    CATMyModel *pModel = new CATMyModel();
    
    CAT3DCustomRep *pMyRep = new CAT3DCustomRep() ; 
    ...
    pModel->SetRep(pMyRep );
    ...

    where CATMyModel is a component main class which OM and C++ derives from CATModelForRep. If the component implements CATICreateInstance, refer to the use case [7] for a complete implementation. 

    You create such a component when the end user must select it without ambiguity. 

  5. Create a component which derives from CATBaseUnknown and implements, at least, the CATI3DGeoVisu interface (or 2D)
  6. In fact, there are the following steps:

    You create such a component when the graphic representation can change during the life cycle of the component. See the How does it Work section to understand the life cycle of the graphic representation. The interface of type can also be the filter interface. 

You can refer to the CAADegClippingByBoxCmd use case [7] where these three kinds of components have been implemented.  

[Top]


In Short

The Interactive Set of Objects (ISO) is an interactive object handled by the CATISO class. It enables you to display components which are not included in a V5 document. These components must only implement the CATI3DGeoVisu (2D) interface. 

[Top]


References

[1] Creating Components
[2] Understanding the Application Frame Layout
[3] Creating a Command that Consists in a Dialog Window
[4] Creating a Document's Window-1
[5] Creating a Document's Window-2
[6] Visualizing Temporary Components
[7] Creating Temporary Components
[8] Creating Interfaces 
[9] Using the Visualization Manager
[Top]

History

Version: 1 [Feb 2004] Document created
[Top]

Copyright © 2004, Dassault Systèmes. All rights reserved.