Analysis Solution

Analysis Modeler

Creating an Analysis Application

How to create a new Analysis workbench
Use Case

Abstract

This article discusses the CAAAniWorkBench use case. This use case explains how to create a new analysis workbench and all the interfaces that can be used in order to customize it.

What You Will Learn With This Use Case

This use case is intended to help you design a new workbench dedicated to the analysis domain.

Before getting to the use case itself, it is important to have an understanding of some concepts that are the heart of the 3D PLM PPR Hub Enterprise Infrastructure, since the use case basically navigates among objects that represent those concepts. Refer to the appropriate articles and use cases in reference [1]. If you are already familiar with all these frameworks, let's start with analysis and simulation concepts:

Before starting, you have to think about the kind of application you need to integrate inside the analysis domain.

In this use case we will focus on the first scenario. The access to your application will look like the following picture:

[Top]

The CAAAniWorkBench Use Case

CAAAniWorkBench is a use case of the CAAAnalysisInterfaces.edu framework that illustrates the way to define a new application inside the Analysis domain.

What Does CAAAniWorkBench Do.

This use case will explain how to design a new workbench inside the Analysis & Simulation product line and define some commands.

[Top]

How to Launch CAAAniWorkBench

To launch CAAAniWorkBench, you will need to set up the build time environment, then compile CAAAniWorkBench along with its prerequisites, set up the run time environment, and then execute the use case [2].

[Top]

Where to Find the CAAAniWorkBench Code

The CAAAniWorkBench use case is made of interfaces, implementations and commands located in the CAAAniWb.m module of the CAAAnalysisInterfaces.edu framework:

Windows InstallRootDirectory\CAAAnalysisInterfaces.edu\CAAAniWb.m\
Unix InstallRootDirectory/CAAAnalysisInterfaces.edu/CAAAniWb.m/

where InstallRootDirectory is the directory where the CAA CD-ROM is installed.

The following table shows which code resources are used in this Use Case. These resources are physically located within the appropriate directories (with same names) of your CAA installation.

Framework Module/Interface Source Content

CAAAnalysisInterfaces.edu

CAAAniWb.m

CAAIAniConfigurationFactory.cpp

Create a new factory.

CAAAniWb.m CAAAniConfigurationFactory.cpp Implements CAAIAniConfigurationFactory

CAAAniWb.m

CAAAniCfg.cpp

Implements CATISAMWorkshopConfiguration

CAAAniWb.m CAAAniCfgTemplate.cpp Implements CATISamWorkbenchTemplate
CAAAniWb.m CAAEAniCfgInit.cpp Implements CATIWorkbenchInitialization
CAAAniWb.m CAAAniCtxMenu.cpp Implement CATISamCtxMenuProvider.

[Top]

Step-by-Step

We will now comment each of those files by looking at the code. This use case is made of the following steps:

[Top]

Define the new workbench.

This step is assumed by the files:

It defines the ANICfg workbench configuration and the capability to make this workbench extendable with an ADDIN interface. Some important associated files with the ANICfg prefix are located in the resources/msgcatalog directory in order to configure this new workbench. For more information, have a look at the reference[1]. Note that to define a workbench inside the Analysis & Simulation product line, the CATRsc file may include the line:

CAAAniCfg.Category = "AnalysisSimulation";

Before testing you may remove the comments in the beginning of this line.

[Top]

The workbench initialization.

The CAAEAniCfgInit implements the CATIWorkbenchInitialization interface to do some initializations before starting a workbench. For example, in the implementation made in this sample, the following tasks are performed:

...
  CATFrmEditor * pEditor = CATFrmEditor::GetCurrentEditor();
  if (NULL == pEditor) return;

//=====================================
// Retrieves the Analysis document from the Editor.
  CATDocument * pDoc = pEditor -> GetDocument();
  CATISamAccess * piDocAccess =  NULL;
  CATIContainer * piSpecContainer = NULL;
  CATISamImageDisplayManager_var spSpmDisplay ;

  if (pDoc) pDoc -> QueryInterface(IID_CATISamAccess, (void**) &piDocAccess);

if ( piDocAccess)
{
   piDocAccess -> GetSpecContainer(piSpecContainer); // Container for feature
   piDocAccess -> Release(); piDocAccess = NULL;
}

//=====================================
// Open CAAAniCatalog.CATfct  catalog
if ( piSpecContainer )
{
  CATICatalogManager * piCatalogManager = NULL;
  piSpecContainer -> QueryInterface(IID_CATICatalogManager,(void**) &piCatalogManager);
  if (piCatalogManager)
  {
    CATBaseUnknown * pCatalog = piCatalogManager -> OpenCatalog("CAAAniCatalog.CATfct",CATIContainer::ClassName());
    if (pCatalog) pCatalog -> Release(); pCatalog = NULL;
    piCatalogManager -> Release(); piCatalogManager = NULL;
  }
  piSpecContainer -> Release(); piSpecContainer = NULL;
}
... 
...
CATISamImageDisplayManager_var spSpmDisplay ;

CATIContainer * piContainer = NULL;
piDocAccess -> GetPostproContainer(piContainer); // Container for postprocessing
if (piContainer)
{
  spSpmDisplay = piContainer;
  piContainer -> Release(); piContainer = NULL;
}
... 
...
//                                - Define the XML file definition.
CATISamImageFactory * piImageFactory = NULL;
spSpmDisplay -> QueryInterface(IID_CATISamImageFactory,(void **)& piImageFactory);
if (piImageFactory)
{
  piImageFactory -> AddImageFile ("CAAAniImages.xml");
  piImageFactory -> Release();
}
... 
With the following visualization mode          You can see

CATSamVisuModeMeshing

Mesh.

CATSamVisuModeGeometry

Geometry.

CATSamVisuModePreProcessing Symbols from the preprocessing.
CATSamVisuModePostProcessing    Images from the post processing.   
CATSamVisuModeRealDeformation

Real deformation images.

 

Global and default visualization mode have been defined to manager the visualization in assembly context.

The global mode corresponds to the mode in which you want to visualize the activated analysis (Analysis 2) and all its analysis leaves (Analysis 3 and Analysis 4).

The default mode is applied to each analysis document out of the scope of the activated Analysis document. So by activating Analysis 2, you will only see the mesh of Analysis 1 and Analysis 5.  

 

 

 

 

...
CATISamAnalysisContext * piContextEditor = NULL;
pEditor -> QueryInterface (IID_CATISamAnalysisContext, (void**) & piContextEditor);
if (piContextEditor)
{
  piContextEditor -> SetVisuModes(CATSamVisuModeMeshing,CATSamVisuModeMeshing|CATSamVisuModePostProcessing);
  piContextEditor -> Release(); piContextEditor = NULL;
}
... 
...
// Declare a contextual menu provider
CATISamProviders* piProvider = NULL;
if (pDoc)
pDoc -> QueryInterface(IID_CATISamProviders, (void **) &piProvider);

if (piProvider)
{
   CAAAniCtxMenu * _piCtxMenu = new CAAAniCtxMenu ();
   if (_piCtxMenu) piProvider -> AddProvider(IID_CATISamCtxMenuProvider,_piCtxMenu);
   piProvider -> Release(); piProvider = NULL;
}
... 

[Top]

Customize the document.

This step allows for a workbench to define the list of allowed "transitions". The main transition goal is to create an analysis case and all the required  sets for a kind of analysis. This is implemented in the CAAAniCfgTemplate.cpp file on the CAAAniCfg_TempList late type. In this sample, only one transition is allowed, the transition is automatically launched without any user interaction.

If you add new transition types or removes the comments in the sample file, the user interface will looks like:

 

The AeroDynamic transition is implemented in the Reference [4]. To allow this new analysis case and have a workbench initialization as defined in the previous image:

...
HRESULT CAAAniCfgTemplate::GetTemplates(CATListOfCATString& oList)
{
  oList.Append("AeroDynamic");
  oList.Append("CATGPSStressAnalysis_template");
  oList.Append("CATGPSModalAnalysis_template");	

}
...

[Top]

Customize the workbench with contextual menu.

This step allows you to add some contextual menus to an analysis feature. This is based on the provider technology. More information about providers are in Reference [5].

As example, in the CAAAniCtxMenu.cpp file, we will associate a command that creates an image on the solution. This command will be defined twice in the workbench, one in a toolbar and once as a contextual menu to a specific feature.

 

...
HRESULT CAAAniCtxMenu::GetContextualMenu(CATBaseUnknown * iObj, CATCmdContainer* &ioCtxMenu)
{
  CATISpecObject_var spSpecObj (iObj);
  if (NULL_var == spSpecObj) return S_OK;

  CATString FeatureType = ((spSpecObj -> GetType()).ConvertToChar());

  if (FeatureType == "AeroDynamicSet")              
  {
    CATString HeaderId = "CreateOneImage" ;    // header defined in the CAAAniCfg.cpp
    NewAccess (CATCmdStarter ,CmdStarterCreateOneImage ,CAAAniCreateOneImage);
    SetAccessCommand	(CmdStarterCreateOneImage,HeaderId);
    if (ioCtxMenu) ioCtxMenu -> AddChild (CmdStarterCreateOneImage);

    CATCommandHeader* pHeader = NULL;
    CATAfrGetCommandHeader(HeaderId,pHeader);  // provided by #include "CATAfrCommandHeaderServices.h"
    if (pHeader)
    {
      pHeader -> BecomeUnavailable();
      if (spSpecObj -> IsUpToDate()) pHeader -> BecomeAvailable();
    }
  }
...

In Short

This use case can be used as an example to define a new workbench dedicated to the analysis domain. We will now see how to create some new commands:

[Top]


References

[1] 3D PLM Enterprise Architecture
[2] Building and Launching a CAA V5 Use Case
[3] Analysis Images Overview
[4] Define new Analysis feature
[5] About Analysis Providers.
[Top]

History

Version: 1 [Jan 2002] Document created
Version: 2 [Jun 2004] Document modified
[Top]

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