Académique Documents
Professionnel Documents
Culture Documents
Student Notes:
CATIA Training
Foils
Version 5 Release 17
September 2006
EDU-CAA-EN-CAG-AF-V5R17
Student Notes:
Table of Contents (1/2)
Student Notes:
Table of Contents (2/2)
Appendix p.396
Student Notes:
You will learn what are the different techniques and tools available to
customize CATIA V5 and when to use which one.
Application typology
Some Case Studies
Summary
Copyright DASSAULT SYSTEMES
Student Notes:
Application typology
Create application
Automate Design Best Practices
Define some new user interface
Student Notes:
Technological Choices
Create Application
Using interactive techniques:
BKT – Business Process Knowledge Template
Automate Design Best Practices
KWE – Knowledge Expert:
Check Corporate Rules
Student Notes:
Business Process
Knowledge Template
Engine
Capture and reuse corporate engineering and
design processes
Generate interactively customized vertical
applications
Application technological objects
Attributes
Types
Rules
Application logic: behavioral model
Design, Engineering, Manufacturing,
Decision Support Tasks, etc…
Reuse of all V5 Tools
User Interface tools and technological object
environment
Workbench Generator
Icon Editor
The application is described in a directory
Copyright DASSAULT SYSTEMES
including:
A feature catalog
Resource files
Student Notes:
BKT Characteristics
LOW
The main part of the job is to define the Design Best Practice to be
Dev. cost automated
Student Notes:
Knowledge Expert
Click on movie
Student Notes:
KWE Characteristics
All V5 Domains
Scope of Work
Student Notes:
VB macros using
V5 Automation API
Student Notes:
All V5 domains
Scope of Work In the standard language only simple dialog boxes
“InputBox” and “MsgBox”
More sophisticated dialog boxes in VBA but only on Windows
Advantage
Simple
Student Notes:
CAA V5
Student Notes:
CAA V5 Characteristics
All V5 domains
Scope of Work
Powerful
Advantage CAA V5 wizards to speed up the development time:
focus on your specificities
Student Notes:
Technological Choices
Extend PPR
Using interactive techniques:
PKT – Product Knowledge Template
Define new feature types by composing a sequence of existing
ones
Student Notes:
Product Knowledge Template
Student Notes:
PKT Characteristics
Student Notes:
CAA: Foreign
Geometric Object
Student Notes:
CAA: DS Feature Derivation
Student Notes:
CAA: Feature in an Applicative Container
Student Notes:
CAA: Feature Extension
Student Notes:
CAA
CAA programmer
Skills
HIGH
Dev. cost
Student Notes:
Technological Choices
Connect
Student Notes:
OLE/Automation protocol
VB application
1. Launch CATIA
2. Generate data
VB application
3. Retrieve information
Copyright DASSAULT SYSTEMES
from CATIA
Student Notes:
OLE/Automation protocol Characteristics
Skills VB programmer
V5 Licenses
Corresponding Interactive Product Licenses to use the
Automation API
Ex: to use the Part Design Automation API, you need to have a license
allowing you to use the interactive product
Student Notes:
CAA and “xPDM”
CATIA PPR PDM Gateway
Developed by a
SCP Partner
Student Notes:
CAA and “xPDM” Characteristics
Advantage
Focus on the specificities of the PDM system you’re dealing with
Skills
CAA programmer
Student Notes:
CAA: Backbone
Additional
command Third party
4. instantiates
application
a message
2. declares itself
1. declares itself to the bus
to the bus
Copyright DASSAULT SYSTEMES
3. defines a callback on
the message event to
react accordingly
Student Notes:
CAA: Backbone
Characteristics
Skills
CAA programmer
Dev. cost
MEDIUM
Copyright DASSAULT SYSTEMES
Student Notes:
Collaboration between
all these techniques
VB macros VB Manage
your own objects
through IDL interfaces
UserFeatures Instanciate
Reuse
BKT PKT
CAA code
CAA
Instantiate
KWE
Student Notes:
Summary
Student Notes:
To Sum Up ...
Student Notes:
You will learn about the specific CAA V5 directory tree structure, the CAA V5
RADE tools plugged in Microsoft Visual C++, and how to find information in the
CAA V5 Encyclopedia.
A Component Architecture
Workspaces and Frameworks
Building Tools
Microsoft Developer Studio Integration
CAA V5 Encyclopedia
Copyright DASSAULT SYSTEMES
Student Notes:
CAA V5 Development Environment Objectives
Tools and Methods for an OO programming environment
Student Notes:
CAA V5 Characteristics
Common development platform for all the Dassault Systemes product lines
CATIA / ENOVIA / DELMIA
Student Notes:
Component Application Architecture
CAA V5 can be used to implement new products
Extended CATIA V5
CATIA V5 the system
Product reusing
Copyright DASSAULT SYSTEMES
Student Notes:
Application Architecture
Every CAA Application is a set of 1 to n components : the frameworks.
Workspace
Module Module
Framework 3
Module
Module
Module
Module
Copyright DASSAULT SYSTEMES
Framework 4 Framework 5
Student Notes:
CAA V5 Framework / Module Organization
Group of interoperating objects with built-in capabilities delivered as a
complete resource to client applications
Private Interfaces .h .h .h .h
Module1 Module n
Local Interfaces .h Local Interfaces .h .h
...
Copyright DASSAULT SYSTEMES
Available for
src .cpp .cpp .cpp src .cpp .cpp this module
only
Student Notes:
CAA V5 Pre-Requisites
To access the header file of CATIShaft for build/link time, the customer
Application needs the header file complete path : Workspace + framework +
module
Framework Prerequisite
Framework 4 Framework 5
Framework 1 PartInterfaces
Customer CATIShaft
Module CATIPad
Module Prerequisite
Copyright DASSAULT SYSTEMES
Framework 3
Framework 3 Framework 2
Workspace Prerequisite
Student Notes:
CAA V5 File Tree
Workspace directory
Frameworks
Resource directories
IdentityCard
Modules
solaris_a
Student Notes:
Define your prerequisite workspaces: mkGetPreq
mkGetPreq -p PrerequisiteWorkspace1
This enables you to define where the prerequisite resources are located
For build time: header files
For run time: shared libraries, resource files, …
Student Notes:
Framework IdentityCard
The IdentityCard defines the pre-requisite frameworks to build and use a
framework.
This header file is used by our building tool to limit the header file search to
the corresponding Interfaces directories of the pre-requisite frameworks.
Student Notes:
mkmk: The Imakefile.mk
The Imakefile.mk file must be defined for every module.
Imakefile.mk
BUILT_OBJECT_TYPE=SHARED
BUILT_OBJECT_TYPE=SHAREDLIBRARY
LIBRARY Define the module type
Student Notes:
Manage the CAA V5 Tool Level: TCK
The Tool Configuration Key manages several levels of the CAA V5 RADE
tools.
Student Notes:
Build your executables: mkmk
A unique DS tool built on top of the standard compilers that works in the
same way on UNIX and Windows:
Compile Fortran, C, C++, IDL, ...
Link-edit
Copyright DASSAULT SYSTEMES
Student Notes:
About mkmk
To access the mkmk help on line, use mkmk -h.
In other cases, do not use the update option. mkmk will reuse some
intermediate files generated before like:
Objects
ImportedInterfaces
various
Student Notes:
Build with external libraries
Imakefile.mk
OS
OS==Windows_NT
Windows_NT On WINDOWS
##Link
Linkwith
withexternal
externallibraries
libraries
LOCAL_LDFLAGS =
LOCAL_LDFLAGS =/LIBPATH:”E:\DirectoryWhereTheLibrariesAreStored”
/LIBPATH:”E:\DirectoryWhereTheLibrariesAreStored”
##Name of the libraries
Name of the libraries
SYS_LIBS
SYS_LIBS==LibraryName.lib
LibraryName.lib
##Link
Link with includefiles
with include files
LOCAL_CCFLAGS
LOCAL_CCFLAGS==/I”E:\DirectoryWhereTheIncludeFilesAreStored”
/I”E:\DirectoryWhereTheIncludeFilesAreStored”
OS
OS==AIX
AIX On UNIX
##Link with external libraries
Link with external libraries
LOCAL_LDFLAGS
LOCAL_LDFLAGS==-L/MachineName/DirectoryWhereTheLibrariesAreStored
-L/MachineName/DirectoryWhereTheLibrariesAreStored
##Name of the libraries
Name of the libraries
SYS_LIBS
SYS_LIBS==LibraryName
LibraryName
##Link
Link with includefiles
with include files
LOCAL_CCFLAGS
LOCAL_CCFLAGS==-I/MachineName/DirectoryWhereTheIncludeFilesAreStored
-I/MachineName/DirectoryWhereTheIncludeFilesAreStored
Copyright DASSAULT SYSTEMES
Student Notes:
ExportedByModuleName Preprocessor Variables
A Windows mechanism imposes that shared libraries declare explicitly what
they import and export.
Variable defined by
mkmk on Windows
MyClass.h MyModule.h
#include
#include“MyModule.h”
“MyModule.h” #ifdef
#ifdef _WINDOWS_SOURCE
_WINDOWS_SOURCE Variable defined by mkmk
class
class ExportedByMyModuleMyClass
ExportedByMyModule MyClass #ifdef __MyModule
#ifdef __MyModule when building MyModule
{{
…… #define ExportedByMyModule__declspec(dllexport)
#defineExportedByMyModule __declspec(dllexport)
}} #else
#else
#define
#defineExportedByMyModule
ExportedByMyModule__declspec(dllimport)
__declspec(dllimport)
#endif
#endif
#else
#else
#define
#defineExportedByMyModule
ExportedByMyModule
Copyright DASSAULT SYSTEMES
#endif
#endif
Student Notes:
Run with external libraries
Modify environment
Windows
Start + Programs + CATIA + Tools +
CATIA Environment Editor
E:\CATIA\intel_a\code\bin\CATIAENV.exe
UNIX
.. / B17 / OS / code / command / catstart –
run .. CATIAENV
Copyright DASSAULT SYSTEMES
Student Notes:
Run time tools
mkCreateRuntimeView
copies the application resources (icons, message files, dictionaries, …) from the
Build time directories into the Run time directories.
mkrun
run CATIA V5 or any main executable developed on top of CAA V5
mkrun -c MyProgram
Student Notes:
Microsoft Developer Studio CAA V5 Add-Ins
All our specific tools have been integrated in Microsoft Developer .Net
Must be installed using the Unicode String option.
Copyright DASSAULT SYSTEMES
Student Notes:
CAA V5 wizards in Ms Developer Studio
Wizards to generate code
corresponding to generic tasks:
New CAA V5 Workspace
New Framework
New Module
New Command
New Panel
New Interface
New implementation
…
Copyright DASSAULT SYSTEMES
Student Notes:
Mapping between commands and MsDev Add-Ins
mkGetPreq
Edit an IdentityCard
mkCreateRuntimeView
mkmk
Copyright DASSAULT SYSTEMES
Student Notes:
MSDev Add-Ins: Hints and Tips (1/3)
To see any modification done directly in Windows Explorer (copied, moved
or deleted files) in MSDev, use the following command
Project + Choose/Refresh CAA V5 Project…
Copyright DASSAULT SYSTEMES
Student Notes:
MSDev Add-Ins: Hints and Tips (2/3)
To see your trace statements, the
environment variable
CNEXTOUTPUT has to be set to
console in Tools+Runtime
Environment Variables
Copyright DASSAULT SYSTEMES
Student Notes:
CAA V5 C++ Objects Documentation from Microsoft Visual C++
Position the
cursor
on a class name
and key CTRL+F1
Copyright DASSAULT SYSTEMES
Student Notes:
MSDev Add-Ins: Hints and Tips (3/3)
To rebuild a module and if you don’t need the update option, use the
keyboard shortcut F7.
To export a workspace (just the source code) get rid of all the intermediate
files generated by mkmk:
go to Tools + Open Command Window and key mkRemoveDo -a
Student Notes:
Enable porting on UNIX from Visual C++
If you need to port your applications on UNIX, you should run again the
CATVBTSetup executable:
C:\Program Files\Dassault Systemes\T17\intel_a\code\bin
In the Tool access tab page, activate the remote access and inform where
the CAA V5 Tools are installed on UNIX
Copyright DASSAULT SYSTEMES
Student Notes:
Activate the Porting on UNIX
When opening a workspace, you can ask for building on UNIX by informing
Visual C++ on which UNIX machine, with which user and in which directory
the operations will be performed.
Student Notes:
Porting on UNIX
From Visual C++, then
you can define the pre-requisite workspaces
you can build
you can update the run time view
Copyright DASSAULT SYSTEMES
Student Notes:
CAA V5 Encyclopedia Home Page
Student Notes:
CAA V5 C++ Objects Documentation from a html browser
Copyright DASSAULT SYSTEMES
Student Notes:
CAA V5 Programmer's Guide (1/3)
All documentations
about a domain
Technical Articles
Use Cases
Quick references
Copyright DASSAULT SYSTEMES
Student Notes:
CAA V5 Programmer's Guide (2/3)
Technical articles
In depth paper
Less than 10 pages
Hyper linked
Copyright DASSAULT SYSTEMES
Student Notes:
CAA V5 Programmer's Guide (3/3)
Use Cases
CAA V5 Code in Action
Step by Step
Each step detailed and commented
Delivered with fully operational source code
Made to be copied/pasted into customer code
Copyright DASSAULT SYSTEMES
Student Notes:
CAA V5 Programming Rules
Programming Rules
Naming convention
C++ coding rules
Java coding rules
Architecture rules
User Interface look and feel
Available in the
encyclopedia
Copyright DASSAULT SYSTEMES
Student Notes:
CAA V5 ObjectModeler:
Interface / Implementation Design Pattern
In this lesson you will learn the CAA V5 OO infrastructure, the interface
handling, shielding any client application from implementation details.
Student Notes:
C++ as a Starting Point
Encapsulation
Contour Hiding implementation details
virtual Surface() =0 Changing private part without client impact
Color
Inheritance
Reusing implementation
Square Circle Extending types
Surface() Surface()
{L**2} {pi*R**2}
Polymorphism
L R Genericity on client side
Specialization of provider side
Copyright DASSAULT SYSTEMES
Student Notes:
What’s wrong with C++ ? (1/3)
Contour
virtual Surface() =0
Color
Encapsulation could be better
Compilation link between object and its client
even if only a private member changes
Contour
virtual Surface() =0
Red, Green, Blue
Student Notes:
What’s wrong with C++ ? (2/3)
No support for «schizophrenic» objects
In large systems, objects have more than one type. These types are needed
or useless according to the context.
Persistent
Displayable
Surfacic
Student Notes:
What’s wrong with C++ ? (3/3)
Extension only through inheritance
How to organize inheritance trees?
What if extensions added later?
What about code modularity?
PersistentPoint DisplayPoint
Save() Display()
DisplayPoint PersistentPoint
Display() Save()
DisplayPoint PersistentPoint
Display() Save()
Copyright DASSAULT SYSTEMES
Student Notes:
The Interface / Implementation Pattern
Client and Implementation separation is achieved by the mean of interfaces.
<<uses>> <<implements>>
Client Object Interface Implementation
Alternative notation :
Student Notes:
Interface / Implementation Definition (1/2)
An interface is an abstract object with a set of pure virtual methods that
defines a behavior that implementation objects must support.
Interface.h
virtual GetX(…) =
0;
virtual GetY(…) =
0;
Interface.cpp
ø
Copyright DASSAULT SYSTEMES
Student Notes:
Interface / Implementation Definition (2/2)
An implementation is an object that defines a specific way to fulfill the
contract set by an interface.
An implementation must provide code for all the abstract methods defined
in the interfaces it adheres to.
The client application deals with the implementation only through the
interface.
ImplementationObject.h
Interface.h
GetX(…);
virtual GetX(…) =
GetY(…);
0;
virtual GetY(…) =
ImplementationObject.cpp
0;
Interface.cpp
Copyright DASSAULT SYSTEMES
ImplementationObject ::GetX(…)
ø {...}
ImplementationObject ::GetY(…)
{…}
Student Notes:
Interface / Implementation Rules
An interface’s name gets always an « I » as the 4th character.
ImplementationObject1.cpp
ImplementationObject1.h ImplementationObject1 :: GetX(…)
GetX(…); {...}
GetY(…); ImplementationObject1 :: GetY(…)
TSTIMyInterface.h
{...}
virtual GetX(…) =
ImplementationObject2.cpp
0;
ImplementationObject2.h ImplementationObject2 :: GetX(…)
virtual GetY(…) =
0; GetX(…); {...}
Copyright DASSAULT SYSTEMES
Student Notes:
Interface / Implementation Inheritance (1/2)
Interfaces can inherit from each other
But at least, the first one must inherit from IUnknown / CATBaseUnknown
CATBaseUnknown.h
…
TSTIMyInterface1.h
…
ImplementationObject.h
TSTIMyInterface2.h
…
…
…
TSTIMyInterface.h
…
Student Notes:
Interface / Implementation Inheritance (2/2)
ImplObject2 adheres to TSTIMyInterface2 and to TSTIMyInterface1 by
inheritance from ImplObject1, whereas ImplObject3 adheres only to
TSTIMyInterface1.
TSTIMyInterface1 ImplObject1
Student Notes:
Interface at work : the GUID
The Global Unique Identifier (GUID) of an Interface is stored in a specific
module :
Module’s default name generated by the CAA wizard :
MyFrameworkInterfacesUUID.m
Name of the file : TSTIMyInterface.cpp TSTIMyInterface.cpp
TSTIMyInterface.cpp
#include “IUnknown.h”
extern "C" const IID IID_TSTIMyInterface =
{ 0x32bbc9aa, 0x0254, 0x11d5, { 0x85, 0x08, 0x00, 0x02, 0xb3, 0x06, 0x11, 0x71} };
Student Notes:
Interface at work
Interface inheritance
Copyright DASSAULT SYSTEMES
Student Notes:
Implementation at work (1/2)
ImplObject.h ImplObject.cpp
[...]
[...] [...]
[...]
#include
#include“CATBaseUnknown.h”
“CATBaseUnknown.h” #include
#include“ImplObject.h”
“ImplObject.h”
class
classImplObject:
ImplObject:public
publicCATBaseUnknown
CATBaseUnknown CATImplementClass
CATImplementClass(( ImplObject,
ImplObject,
{{ Implementation,
Implementation,
CATDeclareClass;
CATDeclareClass; CATBaseUnknown,
CATBaseUnknown,
CATNull
CATNull))
public:
public: [...]
[...]
ImplObject()
ImplObject(); ; ////TSTIMyInterface
TSTIMyInterfaceadhesion
adhesion
~~ImplObject()
ImplObject(); ; [...]
[...]
......ImplObject
ImplObject::Method1()
::Method1(){{…
…}}
////TSTIMyInterface
TSTIMyInterfaceadhesion
adhesion ......ImplObject
ImplObject::Method2()
::Method2(){{…
…}}
...... Method1(…) ;
Method1(…) ;
...... Method2(…)
Method2(…); ; ////Other
Othermethods
methods
[...]
[...]
////Other
Othermethods
methods
[...]
[...]
}}; ;
CAA Macros for an implementation class
Copyright DASSAULT SYSTEMES
ImplObject.h TSTIMyInterface.h
... Method1(…);
virtual ... Method1(…) = 0;
... Method1(…);
….
virtual ... Method2(…) = 0;
Student Notes:
Implementation at work (2/2)
ImplObject1.h ImplObject1.cpp
[...]
[...] [...]
[...]
#include
#include“ImplObject.h”
“ImplObject.h” #include
#include“ImplObject1.h”
“ImplObject1.h”
class
classImplObject1:
ImplObject1:public
publicImplObject
ImplObject CATImplementClass
CATImplementClass(( ImplObject1,
ImplObject1,
{{ Implementation,
Implementation,
CATDeclareClass;
CATDeclareClass; ImplObject,
ImplObject,
CATNull
CATNull))
public:
public: [...]
[...]
ImplObject1()
ImplObject1(); ; ////TSTIMyInterface
TSTIMyInterfaceadhesion
adhesion
~~ImplObject1()
ImplObject1(); ; [...]
[...]
......ImplObject1
ImplObject1::Method3()
::Method3(){{…
…}}
////TSTIMyInterface1
TSTIMyInterface1adhesion
adhesion ......ImplObject1
ImplObject1::Method4()
::Method4(){{…
…}}
...... Method3(…) ;
Method3(…) ;
...... Method4(…)
Method4(…); ; ////Other
Othermethods
methods
[...]
[...]
////Other
Othermethods
methods
[...]
[...]
}}; ; CAA Macros for an implementation class with
inheritance
Copyright DASSAULT SYSTEMES
ImplObject TSTIMyInterface
ImplObject1 TSTIMyInterface1
Student Notes:
The CATImplementClass Macro
CATImplementClass(( <this
CATImplementClass <thisClassName>,
ClassName>,
<<Implementation
Implementation>,>,
<its
<itsC++
C++inheritance
inheritance| |CATBaseUnknown>,
CATBaseUnknown>,
CATNull
CATNull ))
Student Notes:
Using Interfaces (1/4)
Getting an Interface from an Implementation
TSTIMyInterface1.h
virtual method1(…) = 0
ImplObject.h
method1(…)
method2(…)
method3(…)
TSTIMyInterface4.h
virtual method4(…) = 0
ImplObject*
ImplObject*pObject
pObject==new
newImplObject
ImplObject();
();
TSTIMyInterface1* piMyInterface1 = NULL;
TSTIMyInterface1* piMyInterface1 = NULL;
TSTIMyInterface2.h
HRESULT
HRESULT rc rc==0;
0;
virtual method2(…) = 0 rc
rc==pObject
pObject->QueryInterface(IID_TSTIMyInterface1,
->QueryInterface(IID_TSTIMyInterface1,
(void**)&
(void**)&piMyInterface1
piMyInterface1););
TSTIMyInterface3.h
virtual method3(…) = 0
Copyright DASSAULT SYSTEMES
Student Notes:
Using Interfaces (2/4)
Using an interface method
TSTIMyInterface1.h
virtual method1(…) = 0
ImplObject.h
method1(…)
method2(…)
method3(…)
TSTIMyInterface4.h
virtual method4(…) = 0
ImplObject*
ImplObject*pObject
pObject==new
newImplObject
ImplObject();();
TSTIMyInterface1* piMyInterface1 = NULL;
TSTIMyInterface1* piMyInterface1 = NULL;
TSTIMyInterface2.h
HRESULT
HRESULT rcrc==0;0;
virtual method2(…) = 0 rcrc==pObject
pObject->QueryInterface(IID_TSTIMyInterface1,
->QueryInterface(IID_TSTIMyInterface1,
(void**)&
(void**)&piMyInterface1
piMyInterface1););
ifif(SUCCEEDED
(SUCCEEDED(rc)(rc))&&(NULL
)&&(NULL!=!=piMyInterface1
piMyInterface1))))
{{
piMyInterface1
piMyInterface1->->method1(…);
method1(…);
TSTIMyInterface3.h }}
virtual method3(…) = 0
Copyright DASSAULT SYSTEMES
Student Notes:
Using Interfaces (3/4)
Getting an Interface from another Interface
TSTIMyInterface1.h
virtual method1(…) = 0
ImplObject.h
method1(…)
method2(…)
method3(…)
TSTIMyInterface4.h
virtual method4(…) = 0
ImplObject*
ImplObject*pObject
pObject==new
newImplObject
ImplObject();
();
TSTIMyInterface1* piMyInterface1 = NULL;
TSTIMyInterface1* piMyInterface1 = NULL;
TSTIMyInterface2.h
HRESULT
HRESULT rcrc==0;0;
virtual method2(…) = 0 rcrc==pObject
pObject->QueryInterface(IID_TSTIMyInterface1,
->QueryInterface(IID_TSTIMyInterface1,
(void**)&
(void**)&piMyInterface1
piMyInterface1););
ifif(SUCCEEDED
(SUCCEEDED(rc)
(rc))&&(NULL
)&&(NULL!=!=piMyInterface1
piMyInterface1)))) ….
….
TSTIMyInterface2
TSTIMyInterface2**piMyInterface2
piMyInterface2==NULL;
NULL;
TSTIMyInterface3.h rc
rc = piMyInterface1 ->QueryInterface(IID_TSTIMyInterface2, ,
= piMyInterface1 ->QueryInterface(IID_TSTIMyInterface2
virtual method3(…) = 0 (void**)&
(void**)&piMyInterface2
piMyInterface2););
Copyright DASSAULT SYSTEMES
Student Notes:
Using Interfaces (4/4)
Manage error
TSTIMyInterface1.h
virtual method1(…) = 0
ImplObject.h
method1(…)
method2(…)
method3(…)
TSTIMyInterface4.h
virtual method4(…) = 0
ImplObject*
ImplObject*pObject
pObject==new newImplObject
ImplObject();();
TSTIMyInterface1* piMyInterface1 =
TSTIMyInterface1* piMyInterface1 = NULL;NULL;
TSTIMyInterface2.h
HRESULT
HRESULT rcrc==0;0;
virtual method2(…) = 0 rcrc==pObject
pObject->QueryInterface(IID_TSTIMyInterface1,
->QueryInterface(IID_TSTIMyInterface1,
(void**)&
(void**)&piMyInterface1
piMyInterface1););
ifif(SUCCEEDED
(SUCCEEDED(rc) (rc))&&(NULL
)&&(NULL!=!=piMyInterface1
piMyInterface1)))) ….
….
… …
TSTIMyInterface4
TSTIMyInterface4**piMyInterface4
piMyInterface4==NULL;
NULL;
TSTIMyInterface3.h rcrc==piMyInterface1->QueryInterface(IID_TSTIMyInterface4,
piMyInterface1->QueryInterface(IID_TSTIMyInterface4,
virtual method3(…) = 0 (void**)&
(void**)&piMyInterface4
piMyInterface4););
ifif((FAILED (rc))||(NULL == piMyInterface4))
((FAILED (rc))||(NULL == piMyInterface4)) … …
Copyright DASSAULT SYSTEMES
Check that the object adheres to the interface by testing the HRESULT return value. If the object
doesn’t adhere to the interface HRESULT = E_FAIL (see HRESULT documentation).
Student Notes:
Create an Interface with CAA V5 wizards in Visual C++
TSTIMyInterface.h ImplObject.h
Student Notes:
Create an Implementation with CAA V5 wizards in Visual C++
TSTIMyInterface.h ImplObject.h
Student Notes:
Coding Rules (1/3)
Adopt a consistent naming scheme
Manipulating the same object through many different interface pointers
quickly gets confusing
CATInit
CATInit* piInitOnDoc
CATIPersistent Document
CATIPersistent* piPersitentOnDoc
CATIDocAlias* piDocAliasOnDoc CATIDocAlias
Part Document
CATIPersistent* piPersitentOnPartDoc CATIPersistent
Copyright DASSAULT SYSTEMES
Student Notes:
Coding Rules (2/3)
Always test the return value of the QueryInterface method before using the
returned pointer
TSTIMyInterface2
TSTIMyInterface2**piMyInterface2
piMyInterface2==NULL;
NULL;
rcrc==piMyInterface1
piMyInterface1 ->QueryInterface(IID_TSTIMyInterface2, ,
->QueryInterface(IID_TSTIMyInterface2
(void**)&
(void**)&piMyInterface2
piMyInterface2););
ifif(SUCCEEDED
(SUCCEEDED(rc) (rc)&&(NULL
&&(NULL!= piMyInterface2){{
!=piMyInterface2)
….….
}}
OR
OR
ifif(FAILED (rc) ||(NULL == piMyInterface2))){{
(FAILED (rc) ||(NULL ==piMyInterface2)
….….
}}
Student Notes:
Coding Rules (3/3)
Apply following rules for the signature methods
virtual
virtualHRESULT
HRESULTmethod
method((TSTIMyInterface1
TSTIMyInterface1** ipiMyInterface1OnObject,
ipiMyInterface1OnObject,
TSTIMyinterface2
TSTIMyinterface2**** oppiMyInterface2OnObject,
oppiMyInterface2OnObject,
TSTIMyInterface3
TSTIMyInterface3**** ioppiMyInterface3OnObject)
ioppiMyInterface3OnObject)==0;0;
OR
virtual
virtualHRESULT
HRESULTmethod
method((TSTIMyInterface1
TSTIMyInterface1** ipiMyInterface1OnObject,
ipiMyInterface1OnObject,
TSTIMyinterface2
TSTIMyinterface2*&
*& opiMyInterface2OnObject,
opiMyInterface2OnObject,
TSTIMyInterface3 *&
TSTIMyInterface3 *& iopiMyInterface3OnObject)
iopiMyInterface3OnObject)==0;0;
Copyright DASSAULT SYSTEMES
Student Notes:
Interface Limitation
Interface / Implementation pattern :
Application uses interfaces instead of implementation objects.
The application remains isolated from the implementation.
<<uses>> <<implements>>
Client Object Interface Implementation
ImplObject*
ImplObject*pObject
pObject==new
newImplObject
ImplObject();
();
TSTIMyInterface1* piMyInterface1 = NULL;
TSTIMyInterface1* piMyInterface1 = NULL;
HRESULT
HRESULT rcrc==0;0;
rcrc==pObject
pObject->QueryInterface(
->QueryInterface( IID_
IID_TSTIMyInterface1,
TSTIMyInterface1,
(void**)&
(void**)&piMyInterface1
piMyInterface1););
Copyright DASSAULT SYSTEMES
This
Thiscapability
capabilityisisoffered
offeredthrough
throughaaspecial
specialobject
object…
…
Student Notes:
Factory
A factory is a special object that contains methods dedicated to object
creation.
The factory minimizes the coupling since the client application doesn’t
manipulate any implementation instance.
Student Notes:
Factory at work
HRESULT CreateObject(TSTIMyInterface1
HRESULTCreateObject (TSTIMyInterface1****oppiMyInterface)
oppiMyInterface)
The CreateObject method {{
creates an implementation (*oppiMyInterface)
(*oppiMyInterface)==NULL;
NULL;
object and returns an ImplObject*
ImplObject* pObject==new
pObject newImplObject
ImplObject();
();
interface on it to the client HRESULT rc =
HRESULT rc = 0; 0;
application. rc
rc==pObject
pObject->QueryInterface(IID_
->QueryInterface(IID_TSTIMyInterface1,
TSTIMyInterface1,
(void**)
(void**)oppiMyInterface);
oppiMyInterface);
pObject->Release(); pObject = NULL;
pObject->Release(); pObject = NULL;
return
returnrc;
rc;
}}
Client view
TSTIFactory.h TSTFactory.h
virtual HRESULT CreateObject HRESULT CreateObject
(TSTIMyInterface1** oppiMyInterface) = 0 (TSTIMyInterface1** oppiMyInterface)
TSTIMyInterface1.h ImplObject.h
virtual method1(…) = 0 method1(…)
ImplObject*
ImplObject*pObject
pObject==new
newImplObject
ImplObject();
(); CATIFactory
CATIFactory **piFactory
piFactory==… …; ;
Copyright DASSAULT SYSTEMES
TSTIMyInterface1*
TSTIMyInterface1*piMyInterface1
piMyInterface1==NULL;
NULL; TSTIMyInterface1*
HRESULT TSTIMyInterface1* piMyInterface1==NULL;
piMyInterface1 NULL;
HRESULT rcrc==0;0; HRESULT
HRESULT rcrc==S_OK;
S_OK;
rcrc==pObject
pObject->QueryInterface(IID_
->QueryInterface(IID_TSTIMyInterface1,
TSTIMyInterface1, rc
(void**)& rc==piFactory
piFactory->CreateObject(&piMyInterface1);
->CreateObject(&piMyInterface1);
(void**)&piMyInterface1);
piMyInterface1);
Student Notes:
Exercise Presentation
Object Modeler Exercise : Using behavior through interface
And now practice on 2 exercises, to learn about:
Using behavior through interface
Set up the environment
Instantiate objects
Manipulate objects through interfaces
Student Notes:
You will learn how to provide existing objects with new behaviors
Extension
Extension at work
Extension Types
Dictionary
Extension with CAA V5 wizards
Copyright DASSAULT SYSTEMES
Student Notes:
Interface / Implementation limits
How to add new capabilities (behaviors) on an existing object without
modifying the implementation object ?
TSTIPointCoordinate TSTPointImplementation.h
virtual GetX(…)=0; // data members
virtual GetY(…)=0; double _x, _y;
GetX(…)
GetY(…)
TSTIColor GetColor(…);
Student Notes:
Extension Definition
An extension is an object that adds new capabilities to an existing
implementation object.
Student Notes:
Extension Example
Component
TSTIPointCoordinate.h TSTPointImplementation.h
GetX(…)
GetY(…)
GetColor(…);
« extends » SetColor(…);
// data members
Int red, blue, green;
TSTIColor.h TSTPointColor.h
SetColor(…);
Student Notes:
Extension at work CAA Macros for an
extension class
ExtObject.h ExtObject.cpp
[...]
[...] [...]
[...]
#include
#include“CATBaseUnknown.h”
“CATBaseUnknown.h” #include
#include“ExtObject.h”
“ExtObject.h”
class
class ExtObject:public
ExtObject: publicCATBaseUnknown
CATBaseUnknown
{{ CATImplementClass((ExtObject,
CATImplementClass ExtObject,
CATDeclareClass;
CATDeclareClass; DataExtension,
DataExtension,
public:
public: 3rd argument useless CATBaseUnknown,
CATBaseUnknown,
ExtObject()
ExtObject(); ; for an extension ImplObject
ImplObject))
~~ExtObject()
ExtObject(); ;
////TSTIMyInterface2
TSTIMyInterface2adhesion
adhesion ////TSTIMyInterface
TSTIMyInterfaceadhesion
adhesion
...... Method3(…)
Method3(…); ; [...]
[...]
...... Method4(…)
Method4(…); ; ......ExtObject
ExtObject::Method3()
::Method3(){{……}}
......ExtObject
ExtObject ::Method4() { …}}
::Method4() { …
////Other
Othermethods
methods
[...]
[...] ////Other
Othermethods
methods
}}; ; [...]
[...]
TSTIMyInterface1.h ImplObject.h
virtual ... Method1(…) = 0; ... Method1(…);
virtual ... Method2(…) = 0; ... Method2(…);
Copyright DASSAULT SYSTEMES
TSTIMyInterface2.h ExtObject.h
virtual ... Method3(…) = 0; ... Method3(…);
virtual ... Method4(…) = 0; ... Method4(…);
Student Notes:
Extension Types
CATImplementClass(( <this
CATImplementClass <thisClassName>,
ClassName>,
<its
<itsOM
OMtype>,
type>,
<its
<its OM inheritance| |CATBaseUnknown>,
OM inheritance CATBaseUnknown>,
<what
<what it extends | CATNull ))
it extends | CATNull
2 extension types:
• DataExtension
• CodeExtension
Data Extension
Can contain methods and data members
One extension object for each extended object instance
Extension deleted with the implementation object
Code Extension
Can only contain methods
Only one extension object for all extended object instances but for each
Copyright DASSAULT SYSTEMES
implemented interface
Extension deleted at the end of session
Student Notes:
Dictionary
A dictionary is required to locate all other interfaces bound to a given
implementation or its extensions.
ImplObject CATIModelize2
« extends »
ExtObject TSTIMyInterface3
MyAppli.dico
ImplObject CATIModelize2 libImplModule
ImplObject TSTIMyInterface3 libExtModule
Component
Interface it adheres to
directly, through its
Copyright DASSAULT SYSTEMES
Student Notes:
Create an Extension with CAA V5 wizards in Visual C++
Create an extension of ImplObject that
implements the TSTIMyInterface3
interface.
ImplObject CATIModelize2
ExtObject TSTIMynterface3
Copyright DASSAULT SYSTEMES
Student Notes:
CAA V5 ObjectModeler:
Link between Interface & Implementation
In this lesson you will learn how the link is done between interface objects and
implementation objects.
TIE Definition
Standard TIE and Chained TIE
TIE Generation
BOA
Standard TIE, Chained TIE and BOA at work
Copyright DASSAULT SYSTEMES
Student Notes:
TIE Definition
A TIE is the object that links the interface and the implementation.
TSTIMyInterface ImplObject
A pointer on an interface is
in fact a pointer on a TIE
object.
piPoint
TIE_TSTIMyInterface
Copyright DASSAULT SYSTEMES
Student Notes:
Standard TIE and Chained TIE
ImplObject
piMyInterface1
piMyInterface1 ImplObject
TIE_TSTIMyInterface
TIE_TSTIMyInterface
TIE_TSTIMyInterface
piMyInterface2
Copyright DASSAULT SYSTEMES
piMyInterface2
Student Notes:
TIE Generation
If the interface is defined in C++, the TIE header file will be generated if you
create a file TIE_TSTIxxx.tsrc that just includes the interface header file
TSTIxxx.h.
<FWInterfaces>/FWItfCPP.m/CATIPoint.tsrc
//Code
//CodeGenerated
Generatedby bythe
theCAA
CAAWizard
Wizard
//This
//This source file insures the regenerationofofthe
source file insures the regeneration thetie
tieTIE_TSTIMyInterface.h
TIE_TSTIMyInterface.h
#include " TSTIMyInterface.h"
#include " TSTIMyInterface.h"
mkmk
<FWInterfaces>/ProtectedGenerated/intel_a/TIE_TSTIMyInterface.h
…
…
Copyright DASSAULT SYSTEMES
Student Notes:
BOA (Basic Object Adapter) Definition
New
V5R14
Don’t create TIE object
Save memory
Direct access to an extension or an
implementation
Better CPU performances
TSTIMyInterface
Polymorphism instead of re-route
BOA.
Student Notes:
Standard TIE, Chained TIE and BOA at work ImplObject.cpp
[...]
[...]
#include
#include“ImplObject.h”
“ImplObject.h”
CATImplementClass
CATImplementClass(( ImplObject, ImplObject,
Implementation,
Implementation,
CATBaseUnknown,
CATBaseUnknown,
CATNull
CATNull))
[...]
[...]
////Link
Linkthe
theimplementation
implementationtotoits itsinterface
interface
////---------------------------------------
---------------------------------------
CATImplementBOA(…) //BOA
//BOAdefinition
definition
macro is used for a BOA CATImplementBOA(TSTI1,ImplObject);
CATImplementBOA(TSTI1,ImplObject);
//TIE
//TIEor
orTIEchain
TIEchaindefinitions
definitions
TIE_xxx macro is used #include "TIE_TSTI2.h"
#include "TIE_TSTI2.h"
for a standard TIE TIE_TSTI2(Comp2);
TIE_TSTI2(Comp2);
......ImplObject
ImplObject::Method1()
::Method1(){{…
…}}
......ImplObject
ImplObject::Method2()
::Method2(){{…
…}}
////Other
Othermethods
methods
[...]
[...]
Student Notes:
Component
Late Type
Late Type and Inheritance
Extension
CAA V5 Object Browser
Copyright DASSAULT SYSTEMES
Student Notes:
Component
...
C1 MyInterface lib1 myframework.dico
C1 CATIPersistent lib2
C2 MyInterface2 lib3
...
Copyright DASSAULT SYSTEMES
Student Notes:
Late Type
Different kind of objects have a late type (we will speak about these objects
later) :
Feature
Document (CATPart, CATProduct, …)
Container
….
Copyright DASSAULT SYSTEMES
Student Notes:
Late Type and Inheritance
In the same way than real type, late types support inheritance.
Late type A
« extends »
Late type AB
« extends »
ExtObject AB TSTIMynterface
Copyright DASSAULT SYSTEMES
Student Notes:
Extension
Component
Base Object :
Implementation
Or
Late Type :
Base behavior Interface Base
- Feature
- Container
- Document
-…
Interface 1 Extension 1
New behavior
Interface 2 Extension 2
Copyright DASSAULT SYSTEMES
Student Notes:
CAA V5 Object Browser
You can see the Late Type adhesion with the CAA V5 Object Browser.
Copyright DASSAULT SYSTEMES
Student Notes:
CAA V5 ObjectModeler:
Object Life Cycle Management
You will learn how to manage the life cycle of interfaces and implementations
through reference counting and smart pointer techniques.
Student Notes:
CAA V5 ObjectModeler Rules
Implementation should be manipulated by applications only through
interfaces.
Student Notes:
Managing the Interface Life Cycle
We can have many references on the Impl
piMyInterface1
same interface at the same time.
TIE_TSTIMyInterface
delete piMyInterface1 ;
// Access to piMyInterface2 ; Boom piMyInterface2
Student Notes:
Reference Counting
Interface offers special methods for locking itself from deletion by others
The removal of the last reference causes the deletion of the interface by
ObjectModeler.
CATBaseUnknown
CATBaseUnknown CATBaseUnknown
Int _count;
QueryInterface(…)
TSTIMyInterface ImplObject
AddRef()
Copyright DASSAULT SYSTEMES
Release()
Student Notes:
Reference Counting at work
[...]
[...]
CAAIPoint
CAAIPoint**piPoint
piPoint==NULL;
NULL;
hr
hr = piOnPointObject->QueryInterface(IID_CAAIPoint,(void**)&
= piOnPointObject->QueryInterface(IID_CAAIPoint, (void**)&piPoint
piPoint)); ;
piOnPointObject
piOnPointObject->Release();
->Release();////Done
Donewith
withold
oldinterface
interface
piOnPointObject = NULL;
piOnPointObject = NULL;
piPoint
piPoint->GetX(
->GetX(......)); ;
piPoint
piPoint->Release()
->Release(); ; ////Done
Donewith
withlast
lastinterface
interface
piPoint
piPoint==NULL;
NULL;
[...]
[...]
Copyright DASSAULT SYSTEMES
Remark : a pointer copy does not increase the reference count, we must call AddRef()
Student Notes:
Factory and Reference Counting
piMov
Copyright DASSAULT SYSTEMES
TIE_CATIMove
e
10
Student Notes:
Reference Counting: Golden Rules
Methods returning a pointer to an interface (ex: QueryInterface) should
always do an AddRef() on it prior to returning
Tip: write the Release() code just after the function call that created the interface
pointer and « push » it with usage code
Tip: when using QueryInterface(), you usually Release() the previous interface
after getting the new one
Copyright DASSAULT SYSTEMES
Student Notes:
Smart Pointers (also called Handlers)
A smart pointer is a class associated to an interface, that behaves like an
interface pointer, with additional automatic reference counting
Smart pointers for interface CATIxxx are of type CATIxxx_var and are
defined in the same header file.
Student Notes:
Smart Pointers Arithmetic
CATIVisu_var spiVisuOnObject ;
CATITransform_var spiTransOnObject ;
Operator Example Meaning
spiVisuOnObject ->Draw() Dereference. Access a public member of the interface. It
-> makes the usage of interface very similar to a regular C++
pointer on implementation.
NB: do not use the "." operator with handlers.
= spiVisuOnObject = spiTransOnObject Assignment. Make aCATIVisu refer to the same object as
aCATITransfor. Since those handlers are not of the same
type, it does only an AddRef if right value is a subtype of
left value. If not, it runs a QueryInterface on right value.
Therefore the result can be a NULL handler.
== if spiVisuOnObject = =spiTransOnObject IsEqual. Test if two interface instances are dealing with the
same implementation. Thanks to NULL_var that defines
the NULL handler value.
Copyright DASSAULT SYSTEMES
Student Notes:
Smart Pointers or AddRef/Release?
When a method returns an interface pointer
Avoid using a handler to get the result
You can use handlers in methods that ask for interface pointers as input
parameters (parameters IN)
Always use handlers from the correct type in methods that ask for
references on handlers (parameters INOUT)
Copyright DASSAULT SYSTEMES
Student Notes:
Do and Do Not (1/2)
CATIPersistent
Object
CATIVisu
Don’t do Instead Do
In that case the returned value is a smart pointer that increments the
reference count upon creation and decrements it upon deletion.
Copyright DASSAULT SYSTEMES
Student Notes:
Do and Do Not (2/2)
CATIPersistent
Object
CATIVisu
Don’t do Instead Do
not released !
Student Notes:
mkCheckSource
mkCheckSource (C++ Source Checker) is a C++ static controller which
analyzes a program and tries to discover potential defects or logical errors
without executing the program.
Student Notes:
mkCheckSource at work
This command Checks :
AddRef / Release rules
Callbacks rules
Pointer Lifecycle rules
Exceptions rules
C++ rules
Miscellaneous rules
Student Notes:
Exercise Presentation
Object Modeler Exercise : Using behavior through interface
And now practice on 2 exercises, to learn about:
Extending Point’s behavior through Extension mechanism
Extend object’s behavior
Student Notes:
In this course you will be introduced to specification modeling and you will
discover the provided modeler for such a modeling
Student Notes:
Reason Of Using Specifications
allows users to accelerate the art-to-part process by capturing
specifications and generating results
Drafting specifications
Benefits:
Results are generated faster
Company rules and know-how are captured
Result is explainable
Copyright DASSAULT SYSTEMES
Student Notes:
ObjectSpecsModeler Objectives
Provide an infrastructure for Specification/Result management, and
therefore associativity
A generic mechanism for change propagation
Persistency
Student Notes:
Feature Structure
A feature is a basic object to store data
A1
A Feature is defined by a Late Type (its name) and
its attributes.
Feature1
An attribute stored a data that can be of a simple
type (string, double, boolean, octet, integer), a
feature type or a list of those types.
A2
Student Notes:
Specification and Result Management Example
❍Specs
✔ H, Sketch: Pad spec
✔ Lines to connect, radius: corner
spec
❍Result
✔ B-Rep for Pad
✔ 2D Geometry for corner
Pad
Height
Sketch
Line1
Copyright DASSAULT SYSTEMES
Line2
Radius
Student Notes:
Feature and Late Typing
Because a feature is a Late type
Behaviors are provided through the extension mechanism (an Object
Modeler service) following the Interface / Implementation pattern.
Inheritance between features is allowed (see Late type inheritance)
New feature will inherit both behaviors and attributes of its super type
FeatureDS
TSTInterface
TSTExtension
DS Interface
Copyright DASSAULT SYSTEMES
Student Notes:
Feature Instances
Every feature is an instance of a CATSpecObject
Interface to instantiate a
CATISpecObject startup, manage attributes,
manage update
AnyFeature
Student Notes:
Document architecture and Feature Persistency
A document is a set of containers.
Document in memory
Instances of features
Container 2
Copyright DASSAULT SYSTEMES
Container 1 Container 3
Student Notes:
Student Notes:
CAA V5 Mechanical Modeler Objectives (1/3)
Applications that just reference the BRep of a part or an assembly and/or read
geometric information:
Ex: Assembly Design, Drafting, Generative Part Stress Analysis, IGES interface
Copyright DASSAULT SYSTEMES
Student Notes:
CAA V5 Mechanical Modeler Objectives (2/3)
Student Notes:
CAA V5 Mechanical Modeler Objectives (3/3)
Provide the CATPart document and its dedicated workshop with some
generic interactive commands:
Update with a specific error management
Delete/Cut/Copy/Paste, Reorder, Activate/Deactivate, ...
Manage the intermediate states of the part (Smart concept)
3D compass use
Student Notes:
Framework Architecture
Other
Other App.
• Provides some derived
Applications
Applications mechanical features
App.
features
mechanical features MechanicalModeler
MechanicalModeler • Implements the update policy for
mechanical applications
Use predefined basic • Provides predefined features of
features LiteralFeatures general usage
LiteralFeatures
• Provides associated editors
Define their own specs • Defines data structure concepts
(document, container, link)
Benefits from update
mechanism • Defines the Spec behavior as an
ObjectSpecsModeler
ObjectSpecsModeler interface
• Defines Specs composition rules
• Defines events in the world of Specs
ObjectModelerBase
ObjectModelerBase • Implements the generic update
mechanism
• Defines late typing mechanisms
Copyright DASSAULT SYSTEMES
Student Notes:
The CATPart Document Access (1/2)
All methods of this class must be used to create, open or close a document when no
visualization is necessary. This is always the case in batch mode, but it is also
possible in interactive session (see next slide).
Copyright DASSAULT SYSTEMES
Student Notes:
The CATPart Document Access (2/2)
CATIIniInteractiveSession
Save
SaveAs CATSession
CATSession*session
*session==CATSession::GetPtrSession();
CATSession::GetPtrSession();
ifif(session){
(session){
Open
New CATIIniInteractiveSession*spIISession
CATIIniInteractiveSession *spIISession==NULL;
NULL;
NewFrom hr = session->QueryInterface(IID_CATIIniInteractiveSession,
hr = session->QueryInterface(IID_CATIIniInteractiveSession,
(void
(void**)
**)&spIISession);
&spIISession);
ifif(SUCCEEDED(hr))
(SUCCEEDED(hr))
{{
CATIEditor
CATIEditor*piEdit
*piEdit==NULL;
NULL;
hrhr = spIISession-> New("Part",&piEdit);
= spIISession-> New("Part", &piEdit);
......
}}
}}
If you want to visualize the document (in an interactive session), use the
CATIIniInteractiveSession interface. This last interface is defined in the
Copyright DASSAULT SYSTEMES
InteractiveInterfaces Framework.
Student Notes:
The CATPart Document Structure (1/2)
CATIContainerOfDocument
CATPart
“BRep Access”
Student Notes:
The CATPart Document Structure (2/2)
Mechanical container
CATIContainer
CATIMechanicalRootFactory
CATICstFactory
CATISketchFactory
CATIPrtFactory
CATIExtensionFactory
CATIXXX
Copyright DASSAULT SYSTEMES
MechanicalFeature
Student Notes:
Main Mechanical Modeler Feature Categories
MechanicalRoot:
a feature aggregating other features
GeometricalElement:
a feature generating a topological body as a result
GeometricalSubElement:
a feature accessing in a stable way to a sub-element of the result of a
Geometrical Element.
Constraint:
a feature defining constraints between features
Copyright DASSAULT SYSTEMES
Student Notes:
Mechanical Modeler Feature Hierarchy
MechanicalFeature
MechanicalPart
HybridBody GeometricalElement GeometricalSubElement
GSMTool
Sketch
GeometricalElement3D Geometrical2DWireFrame
SketchElement
Geometrical3DWireFrame Solid GSMGeom
2DGeometry
Copyright DASSAULT SYSTEMES
MechanicalShapeFeature
3DPoint GSMZeroDim
3DLine GSMMonoDim
GSMBiDim 2DPoint
Plane MechanicalFormFeature Law 2DCurve
MechanicalContextualFeature
Student Notes:
Student Notes:
MechanicalRoot Features
Mechanical features are
aggregated in “Root” features.
Root Features
MechanicalPart
HybridBody
Sketch
GSMTool
Copyright DASSAULT SYSTEMES
Student Notes:
MechanicalPart Features
It is the top level feature of the CATPart document. It aggregates directly
or indirectly all the other mechanical features. It is unique.
Student Notes:
What is a Tool?
A tool is an aggregating feature. There
are three main types:
HybridBody dedicated for all
mechanical features (solid, surface
and wireframe)
GSMTool for surface and wireframe
features
Sketch for 2D features
Active tool
Student Notes:
HybridBody Features
HybridBody features contain solid, surface and wireframe features to
simplify the hybrid design.
Before V5R14, PartBody was a MechanicalTool feature (containing only solid).
There will not be any conversions for the MechanicalTool feature (a
MechanicalTool stored in V5R13 and open in V5R14 will be always a
MechanicalTool).
New
V5R14
Student Notes:
GSMTool Features
GSMTool feature aggregates wireframe or surface features.
Geometrical Set:
Adapted for features with few history or without input specification
Parent-Children management
Student Notes:
Order Principle
The goal is to have a body where features are ordered from the basic
features (top) to the features with huge historical graph (bottom).
Each feature inside an ordered body can only have as input specifications
features which are above.
New
V5R13
Copyright DASSAULT SYSTEMES
Student Notes:
Linearity Principle
The goal is to have a body where only relevant features are taken into
account. Those specific features are named absorbent features.
Ex: The Split feature, is an absorbent feature. The split surface (ex: an
Extrude feature) is an absorbed feature
Extrude.1 is only
hidden Extrude.1 is not
drawn
New
V5R13
Copyright DASSAULT SYSTEMES
Student Notes:
The Sketcher Tool
Sketch feature aggregates 2D point, wireframe and 2D constraints. It is
displayed in the specification tree under the default name Sketch.
Sketcher Tool
Copyright DASSAULT SYSTEMES
Student Notes:
The Sketch object creation (1/2)
As in interactive, you need to create a sketch with the factory
CATISketchFactory**piSketchFactory
CATISketchFactory piSketchFactory=NULL;
=NULL;
hr
hr==spSpecCont->QueryInterface
spSpecCont->QueryInterface(IID_CATISketchFactory,
(IID_CATISketchFactory,(void
(void**)
**)&piSketchFactory
&piSketchFactory););
……////Test
Testresult
result Retrieve sketch factory
double from mechanical container
doubleorigin[3]
origin[3]=={0,0,0};
{0,0,0}; Create a sketch with
double
doublexAxis[3]
xAxis[3]=={1,0,0};
{1,0,0};
double this factory
doubleyAxis[3]
yAxis[3]=={0,1,0};
{0,1,0};
double
doublezAxis[3]
zAxis[3]=={0,0,1};
{0,0,1};
CATISpecObject_var
CATISpecObject_varspSpecOnSketch
spSpecOnSketch==piSketchFactory->CreateSketch(origin,
piSketchFactory->CreateSketch(origin,xAxis,
xAxis,yAxis);
yAxis);
… // Test result
… // Test result
CATISketch** piSketch
CATISketch piSketch==NULL;
NULL;
rcrc==spSpecOnSketch->QueryInterface
spSpecOnSketch->QueryInterface(IID_CATISketch,
(IID_CATISketch,(void**)
(void**)&piSketch);
&piSketch);
… // Test result
… // Test result
Copyright DASSAULT SYSTEMES
////Open
Openaaedition
edition
piSketch->OpenEdition();
piSketch->OpenEdition();
Student Notes:
The Sketcher object creation (2/2)
Create 2D elements (and constraints if needed)
CATI2DWFFactory**piFactoryOnSketch=
CATI2DWFFactory piFactoryOnSketch=NULL
NULL
hr
hr = spSpecOnSketch->QueryInterface (IID_CATI2DWFFactory,(void**)
= spSpecOnSketch->QueryInterface (IID_CATI2DWFFactory, (void**)&piFactoryOnSketch);
&piFactoryOnSketch);
……////Test
Testresult
result Retrieve the 2D wireframe
factory from sketch feature
Creation of 2D wireframe
With this factory
CATISpecObject_var
CATISpecObject_varspSketchPoint
spSketchPoint==piFactoryOnSketch->CreatePoint(…);
piFactoryOnSketch->CreatePoint(…);
CATISpecObject_var spSketchLine = piFactoryOnSketch->CreateLine(…);
CATISpecObject_var spSketchLine = piFactoryOnSketch->CreateLine(…);
piSketch->CloseEdition();
piSketch->CloseEdition();
Student Notes:
Main Interface for the “Root” Features
CATIMechanicalFeature Retrieve MechanicalPart Feature
MechanicalFeature
Manage ordered component
CATIDescendants
aggregation within a feature
Student Notes:
Topological Link
Solid Feature
Mechanical Form Feature
Mechanical Contextual Feature
GSMGeom Feature
Copyright DASSAULT SYSTEMES
Student Notes:
Link with Topology and Geometry
To retrieve the topological body, use the method GetBodyResult() from the
CATIGeometricalElement interface.
GeometricalElement3D CATIGeometricalElement
Solid GSMGeom
Manages
Produce topological result
Topological Object
Copyright DASSAULT SYSTEMES
Student Notes:
The GSMGeom features
Base Feature for surfacic and wireframe feature inserted in a HybridBody or
a GSMTool
CATIGSMFactory allow you to create DS surfacic or wireframe features
After creating, you have to aggregate it under a tool thanks to
CATIGSMProceduralView
Input “Mechanical
CATIGSMFactory
attributes Container”
CATIBuild
“creates”
CATIGSMProceduralView GSMGeom
Student Notes:
Creating Wireframe and surface Features example:
[...]
[...]
CATICkeParmFactory_varspCkeParmFact=
CATICkeParmFactory_var spCkeParmFact=spSpecCont;
spSpecCont;
Use KW Factory to
double create X, Y and Z
doubleXCoord
XCoord==0.;
0.;
double YCoord = 0.; parameters
double YCoord = 0.;
double
doubleZCoord
ZCoord==1.;
1.;
CATICkeParm_var
CATICkeParm_var spFirstCoord
spFirstCoord ==spCkeParmFact
spCkeParmFact->CreateLength(
->CreateLength("X",
"X",XCoord);
XCoord);
CATICkeParm_var spSecondCoord
CATICkeParm_var spSecondCoord ==spCkeParmFact ->CreateLength( "Y", YCoord);
spCkeParmFact ->CreateLength( "Y", YCoord);
CATICkeParm_var
CATICkeParm_var spThirdCoord
spThirdCoord ==spCkeParmFact
spCkeParmFact->CreateLength(
->CreateLength("Z",
"Z",ZCoord);
ZCoord);
Creation of a GSMPoint
CATIGSMFactory_varspGSMFactory
CATIGSMFactory_var spGSMFactory==spSpecCont;
spSpecCont;
CATIGSMPointCoord_var
CATIGSMPointCoord_var spGSMPoint = spGSMFactory->
spGSMPoint = spGSMFactory->CreatePoint(spFirstCoord,
CreatePoint(spFirstCoord,
spSecondCoord,
spSecondCoord,
spThirdCoord);
spThirdCoord);
CATISpecObject_var
CATISpecObject_varspSOonGSMPoint
spSOonGSMPoint==spGSMPoint;
spGSMPoint;
spSOonGSMPoint->Update();
Copyright DASSAULT SYSTEMES
spSOonGSMPoint->Update();
Student Notes:
The Solid Feature (1/2)
ResultIN references an input Solid feature and ResultOUT aggregates an
output Solid feature.
CATIPrtFactory allow you to create DS solid feature
After creating, you have to aggregate it under a hybridbody thanks to
CATIPrtProceduralView
“Mechanical
ResultIN Input CATIPrtFactory
Solid Container”
specobject attributes
“creates”
CATIPrtProceduralView MechanicalShapeFeature
ResultOUT
Solid
specobject
Copyright DASSAULT SYSTEMES
Student Notes:
The Solid feature (2/2)
Use the CATIShapeFeatureBody interface to retrieve the ResultIN and
ResultOUT feature and the corresponding Topological body.
ResultIN Input
Topological Body Solid
specobject attributes
CATIShapeFeatureBody
GetBodyInAttributes()
GetBodyIN("CATBody") MechanicalShapeFeature
GetBodyOUT()
GetResultOUT()
Copyright DASSAULT SYSTEMES
ResultOUT
Topological Body Solid
specobject
Student Notes:
The MechanicalFormFeature feature
Creates material by itself, even without context.
The Build method calls first BuildShape to build the shape of the form
feature, then operates the previous shape with the resulting solid of the
previous feature in the procedural view.
Result of
The operation to be done depends on the feature : BuildShape()
Union for a Pad.
Subtraction for a Pocket. Solid
MechanicalFormFeature
CATIBuild
Pad, Hole, Shaft, ….
CATIBuildShape Final Result of
Copyright DASSAULT SYSTEMES
ResultOut
Build() method
Solid
1
Student Notes:
The MechanicalContextualFeature features
No BuildShape method
Solid
MechanicalContextualFeature
Student Notes:
Solid architecture sample
Pad
ResultOUT
Solid
reference
Hole
ResultOUT
Solid
reference
EdgeFillet
ResultOUT
Copyright DASSAULT SYSTEMES
Solid
Topological result
Student Notes:
Creating Solid feature example:
[…]
[…]
Retrieve CATISpecObject
////aa- -Retrieve
RetrieveSketcher
Sketcheras
asSpecObject
SpecObject Interface on the sketch feature
CATISpecObject_var
CATISpecObject_var spSpecOnSelectedSketch=spSketch;
spSpecOnSelectedSketch= spSketch;
double HeadHeight =
double HeadHeight = 11;11;
////bb––Create
Createthe
thePad
Pad Modify Pad attributes
CATIPrtFactory_varspPrtFactory
CATIPrtFactory_var spPrtFactory==spSpecCont;
spSpecCont;
CATISpecObject_var
CATISpecObject_var spSpecOnPad =spPrtFactory
spSpecOnPad = spPrtFactory->CreatePad(spSpecOnSelectedSketch);
->CreatePad(spSpecOnSelectedSketch);
////cc- -Modify
ModifyPad
Padattributes
attributes Modify Pad attributes
CATIPad_var
CATIPad_varspPad
spPad==spSpecOnPad;
spSpecOnPad;
spPad->ModifyEndOffset(HeadHeight);
spPad->ModifyEndOffset(HeadHeight);
spPad->ReverseDirection();
spPad->ReverseDirection();
You must update your feature.
spSpecOnPad->Update();
spSpecOnPad->Update();
[…]
[…]
Copyright DASSAULT SYSTEMES
Student Notes:
Student Notes:
The “Constraint” Features
The Constraint features enable constraint definition between one or several
geometrical features.
Student Notes:
Interface Summary for the “Constraint” Features
Standard DS Constraints (Part / Assembly / Sketcher) deriving from
Constraint are used through the CATICst interface.
[...]
[...]
CATICstFactory_varspCstFactory
CATICstFactory_var spCstFactory==spSpecCont;
spSpecCont;
CATCstType
CATCstType iType
iType== CstType_Distance
CstType_Distance; ;
CATBaseUnknown_var
CATBaseUnknown_varspFirstPointFeature
spFirstPointFeature==spFirstSelectedFeature;
spFirstSelectedFeature;
CATBaseUnknown_var
CATBaseUnknown_var spSecondPointFeature==spSecondSelectedFeature;
spSecondPointFeature spSecondSelectedFeature;
double iValue = 15;
double iValue = 15;
CATICst_var
CATICst_varspCst
spCst==spCstFactory
spCstFactory->CreateStdConstraint
->CreateStdConstraint( ( iType,
iType,
spFirstPointFeature,
spFirstPointFeature,
spSecondPointFeature,
spSecondPointFeature,
iValue);
iValue);
[...]
Copyright DASSAULT SYSTEMES
[...]
Student Notes:
Student Notes:
The “Axis System” Features
Student Notes:
Creating an Axis System - Example
CATIMf3DAxisSystemFactory**pIMf3DAxisSystemFactory
CATIMf3DAxisSystemFactory pIMf3DAxisSystemFactory==NULL
NULL; ;
oRC = spSpecCont->QueryInterface(IID_CATIMf3DAxisSystemFactory,
oRC = spSpecCont->QueryInterface(IID_CATIMf3DAxisSystemFactory,
(void
(void**)
**)&&pIMf3DAxisSystemFactory);
pIMf3DAxisSystemFactory);
ifif((SUCCEEDED(oRC))
((SUCCEEDED(oRC))&&
&&(NULL
(NULL!=!=pIMf3DAxisSystemFactoryOnFeatCont))
pIMf3DAxisSystemFactoryOnFeatCont))
{{
Create Axis System from
origin + directions
oRC
oRC==pIMf3DAxisSystemFactory->CreateAxisSystem(
pIMf3DAxisSystemFactory->CreateAxisSystem( ););
pIMf3DAxisSystemFactoryOnFeatCont->
pIMf3DAxisSystemFactoryOnFeatCont->Release();
Release();
pIMf3DAxisSystemFactoryOnFeatCont = NULL;
pIMf3DAxisSystemFactoryOnFeatCont = NULL;
}}
Copyright DASSAULT SYSTEMES
Student Notes:
Exercise Presentation
Screw : First part
And now practice on 2 exercises, to learn about:
Using a Batch to create an empty CATPart document :
Creating a new workspace
Creating a new batch program
Student Notes:
In this lesson you will have an overview of the capabilities offered in Drafting
and FTA in CAA.
Drafting Overview
FTA overview
Student Notes:
Drafting Overview
Student Notes:
Drafting : Managing Sheets and Views (1/2)
Student Notes:
Drafting : Managing Sheets and Views (2/2)
CATDocument*
CATDocument*pDocDrawing
pDocDrawing==NULL;
NULL; Open drawing
CATDocumentServices::OpenDocument
CATDocumentServices::OpenDocument(pfileNameDrawing,
(pfileNameDrawing,pDocDrawing);
pDocDrawing); document
CATIDftDocumentServices
CATIDftDocumentServices*piDftDocServ
*piDftDocServ==NULL;
NULL;
pDocDrawing->QueryInterface (IID_CATIDftDocumentServices,(void
pDocDrawing->QueryInterface(IID_CATIDftDocumentServices, (void**)&piDftDocServ);
**)&piDftDocServ);
CATIDftDrawing *piDrawing = NULL;
CATIDftDrawing *piDrawing = NULL; Get pointer on
piDftDocServices-> GetDrawing(IID_CATIDftDrawing,
piDftDocServices->GetDrawing (IID_CATIDftDrawing,(void
(void**)&piDrawing);
**)&piDrawing); drawing root
CATIDftView
CATIDftView*piDftView
*piDftView==NULL;
NULL; Get active view
piDrawing->GetActiveView
piDrawing->GetActiveView(&piDftView);
(&piDftView); of active sheet
Drawing CATIDftDrawing
Sheet CATIDftSheet
1…N
view CATIDftView
2…N
0…N
Generative results
Copyright DASSAULT SYSTEMES
0…N
Annotations
0…N
2D Geometries
0…N
Constraints
Student Notes:
Drafting : Creating Geometry
Two kinds of geometry coexist in a View:
2D geometry managed by the Sketcher component.
Generative geometry created from extraction of 3D documents.
CATI2DWFFactory*piGeomFactory
CATI2DWFFactory *piGeomFactory==NULL;
NULL; Get Wireframe
piDftView->QueryInterface(IID_CATI2DWFFactory,
piDftView->QueryInterface(IID_CATI2DWFFactory,(void
(void**)&piGeomFact);
**)&piGeomFact); factory
double
doublestartPoint={20.,30.};
startPoint={20.,30.}; double
doubleendPoint={20.,70.};
endPoint={20.,70.}; Create Geometric
CATISpecObject_var spLine;
CATISpecObject_var spLine; objects
spLine
spLine==piGeomFact->CreateLine
piGeomFact->CreateLine(startPoint,
(startPoint,endPoint);
endPoint);
CATISketch
Sketch CATI2DWFFactory
CATI2DConstraintFactory
2D sketch CATI2Dxxx
Copyright DASSAULT SYSTEMES
geometries
View IDMxxx2D
Generative
IDMxxx2D
Geometry
Student Notes:
Drafting : Additionnal information
Student Notes:
Tolerancing Overview
Note :
TTRS (Technologically and Topologically Related Surfaces) is a component
provided by the MechModInterfaces framework used to link TPS with surfaces.
Copyright DASSAULT SYSTEMES
Student Notes:
Tolerancing : Object Model
CATITPSSet
Annotation Set
0…N Annotation
CATITPSFactoryElementary
Creation
3D View CATITPSView
0…N
CATITPSComponent
CATITPSSemanticValidity
0…N
3D Annotation
CATITPSText
TTRS CATITTRS
0…N
Copyright DASSAULT SYSTEMES
Student Notes:
Tolerancing : Basic Creation
CATITPSFactoryAdvanced
CATITPSFactoryAdvanced**piFactAdv
piFactAdv==NULL;
NULL; Retrieve
rcrc==CATTPSInstantiateComponent (DfTPS_ItfTPSFactoryAdvanced,
CATTPSInstantiateComponent (DfTPS_ItfTPSFactoryAdvanced, CATITPSFactoryAdvanced
(void**)
(void**)&&piFactAdv);
piFactAdv); interface
CATITPSText
CATITPSText**piText
piText==NULL;
NULL;
CATUnicodeString TextString(“Top"); Create the 3D text
CATUnicodeString TextString(“Top");
CATMathPlane
CATMathPlanePlane
Plane==CATMathOIJ;
CATMathOIJ;
rcrc==piFactAdv -> CreateTextOnGeometry(pSelection,
piFactAdv ->CreateTextOnGeometry (pSelection,&Plane,
&Plane,&TextString,
&TextString,&piText);
&piText);
Copyright DASSAULT SYSTEMES
Student Notes:
Tolerancing : Complex Creation (1/2)
CATITPSView
CATITPSView**piTPSView
piTPSView==NULL;
NULL;
piViewFact
piViewFact -> CreateView (&piTPSView,&ViewPlane,
-> CreateView (&piTPSView, &ViewPlane, DftFrontView);
DftFrontView);
Copyright DASSAULT SYSTEMES
Student Notes:
Tolerancing : Complex Creation (2/2)
CATITPSFactoryTTRS
CATITPSFactoryTTRS**piTPSTTRSFact
piTPSTTRSFact==NULL;
NULL;
CATTPSInstantiateComponent (DfTPS_ItfTPSFactoryTTRS,(void**)&piTPSTTRSFact);
CATTPSInstantiateComponent (DfTPS_ItfTPSFactoryTTRS, (void**)&piTPSTTRSFact);
CATSO
CATSOpSO;
pSO; Step 3 : Create a TTRS
CATBaseUnknown * piBase = NULL;
CATBaseUnknown * piBase = NULL; from a geometrical
_pmyPathEltAgent->
_pmyPathEltAgent ->QueryInterface
QueryInterface(IID_CATBaseUnknown,
(IID_CATBaseUnknown,(void**)&piBase);
(void**)&piBase); selection
pSO.AddElement(piBase);
pSO.AddElement(piBase);
CATITTRS
CATITTRS**piTTRS
piTTRS==NULL;
NULL;
piTPSTTRSFact
piTPSTTRSFact -> GetTTRS(&pSO,
-> GetTTRS (&pSO,&piTTRS);
&piTTRS);
Step 4 : Create dimension
CATITPSFactoryElementary**piTPSFactElem
CATITPSFactoryElementary piTPSFactElem==NULL;
NULL;
piTPSSet
piTPSSet -> QueryInterface (IID_CATITPSFactoryElementary,(void**)&piTPSFactElem);
-> QueryInterface (IID_CATITPSFactoryElementary, (void**)&piTPSFactElem);
CATITPSDimension
CATITPSDimension**piTPSDim
piTPSDim==NULL;
NULL;
piTPSFactElem
piTPSFactElem -> CreateSemanticDimension(piTTRS,
-> CreateSemanticDimension (piTTRS,
CATTPSLinearDimension,
CATTPSLinearDimension, ////Type
Type
CATTPSDistanceDimension, // SubType
CATTPSDistanceDimension, // SubType
&piTPSDim);
&piTPSDim);
Copyright DASSAULT SYSTEMES
Student Notes:
CAA V5 ApplicationFrame
In this lesson you will learn the CATIA V5 frame editor, the Document Edition
infrastructure, the main user interface principles and also how to plug your
interactive application in CATIA.
Student Notes:
Look and Feel of the CATIA V5 frame editor
Compass
Menu Bar
Current
Workbench
Standard Toolbar:
New/Open/Save/Print Select
Cut/Copy/Paste Command
Undo/Redo
Help
Toolbars
to manage
Specification Objects
3D Viewer
Graph View Point
Panel
Student Notes:
Frame editor class: CATFrmEditor
To have a pointer on this method, you have to use the static method:
static CATFrmEditor * GetCurrentEditor( )
Note: you can also handle the document thanks to CATILinkableObject interface from almost
Copyright DASSAULT SYSTEMES
any objects
Student Notes:
Path To Objects class: CATPathElement
Student Notes:
Object Properties
Object Properties edition
can be triggered thru :
Selecting it, then ‘Edit’ menu bar
Selecting it, then pressing Alt+Enter
contextual menu item
Student Notes:
Application Properties
Application Properties are edited thru
the Tools+Options command:
Student Notes:
Workshop, Workbench, Addin
A workshop (as a workbench) defines a list of commands accessible
through menus or toolbars.
A workshop defines the common menus and toolbars associated to a given
document type (exception : sketch).
A workbench provides specialized commands.
Part Design for solid modeling
Student Notes:
A Model for Command Access
A command encapsulates a basic
user action:
Creation, Edition, Analysis,
Deletion
Command
0,N 1,N
A workshop groups common
commands to a set of
workbenches for a given 1,1
Document 0,N
document type Type
Workshop Workbench
Student Notes:
Command Header
Command header hold necessary information to load the command.
You can create your own customized command Header by creating its class,
callbacks, etc… (see Creating Customized Command Header in CAA doc).
MyWorkbench.cpp
#include
#include"CATCommandHeader.h“
"CATCommandHeader.h“
MacDeclareHeader(
MacDeclareHeader(CATMyCmdHeader
CATMyCmdHeader) ) Macro declaring and
void defining a header class
voidMyWorkbench::CreateCommands()
MyWorkbench::CreateCommands()
{{
new
newCATMyCmdHeader(
CATMyCmdHeader(“CommandName“
“CommandName“, , Command Header
“SharedLibraryDefiningTheCommand“
“SharedLibraryDefiningTheCommand“, , instanciation
“CommandClassName"
“CommandClassName" , ,
(void
(void*)*)DataToBePassedToTheCommand
DataToBePassedToTheCommand););
……
Copyright DASSAULT SYSTEMES
Student Notes:
Application Integration
Three ways to integrate your commands in the CATIA V5 frame:
Student Notes:
Addin
Define an object that implements the Addin interface of an existing
workbench (Toolbar and Menu)
AddinObjectLT
AddinExtension CATI…Addin
Copyright DASSAULT SYSTEMES
Student Notes:
Workbench (1/4)
First step: Workbench factory creation
CATIWorkbenchAddin CATIGenericFactory
Prefixe + CAACreationWkbFactory.cpp
Workbench name + #include "CAACreationWkb.h"
Factory
#include "CAACreationWkbFactory.h"
#include <TIE_CAAIGenericFactory .h>
CATImplementConfigurationFactory(
These macros create CAACreationWkb, CAAIGenericFactory );
the workbench factory
implementation class as Workbench name
a data extension of the CAACreationWkbFactory.h
CATApplicationFrame
Copyright DASSAULT SYSTEMES
Student Notes:
Workbench (2/4)
Second step : Update the dictionary Workbench factory dictionary
CAAWorkbench.fact
CAAIGenericFactory has been
CAACreationWkb
CAACreationWkbCAAIGenericFactory
CAAIGenericFactory implemented by CATApplicationFrame
through the previous macros
CAAWorkbench.dico
CATApplicationFrame
CATApplicationFrame CAAIGenericFactory
CAAIGenericFactory libCAAWorkbenchMod
libCAAWorkbenchMod
WorkbenchObject CATI…Configuration
CAACreationWkb.CATRsc
CAACreationWkb.Category
CAACreationWkb.Category=="Infrastructure";
"Infrastructure";
Student Notes:
Workbench (3/4)
Last Step: Implementation of the CreateWorkbench() method
MyWorkbench.cpp
……
CATCmdWorkbench
CATCmdWorkbench**MyWorkbench::CreateWorkbench()
MyWorkbench::CreateWorkbench() Define the workbench
{{
NewAccess(CATCmdWorkbench,pMyWorkbench,NewWorkbench);
NewAccess(CATCmdWorkbench,pMyWorkbench,NewWorkbench);
NewAccess(CATCmdContainer,pMyContainer,NewToolBar);
NewAccess(CATCmdContainer,pMyContainer,NewToolBar);
NewAccess(CATCmdStarter,pStarter1,NewButton1);
NewAccess(CATCmdStarter,pStarter1,NewButton1);
SetAccessCommand(pStarter1,“MyCommand1");
SetAccessCommand(pStarter1,“MyCommand1");
SetAccessChild(pMyContainer,pStarter1);
SetAccessChild(pMyContainer,pStarter1);
NewAccess(CATCmdStarter,pStarter2,NewButton2);
NewAccess(CATCmdStarter,pStarter2,NewButton2); Define a starter that will be
SetAccessCommand(pStarter2,“MyCommand2");
SetAccessCommand(pStarter2,“MyCommand2"); associated to a command
SetAccessNext(pStarter1,pStarter2);
SetAccessNext(pStarter1,pStarter2); header and then arrange the
command order
AddToolbarView(pMyContainer,1,Right);
AddToolbarView(pMyContainer,1,Right);
Copyright DASSAULT SYSTEMES
SetAccessChild(pMyWorkbench,pMyContainer);
SetAccessChild(pMyWorkbench,pMyContainer); Define the container as a
…
… toolbar,position it by default
on the right and include it in
the workbench
Student Notes:
Workbench (4/4)
Additional step: Complete an existing Menu in the main menu bar of CATIA
Workbench.cpp
……
CATCmdWorkbench
CATCmdWorkbench**MyWorkbench::CreateWorkbench()
MyWorkbench::CreateWorkbench()
{{ Retrieve the Insert Menu
……
NewAccess(CATCmdContainer,pINSERT,INSERT);
NewAccess(CATCmdContainer,pINSERT,INSERT);
NewAccess(CATCmdContainer,pMyMenu,
NewAccess(CATCmdContainer,pMyMenu,MyMenu);
MyMenu); Define another container to
SetAccessChild(pMyMenu,pINSERT);
SetAccessChild(pMyMenu,pINSERT); be aggregated in the Insert
menu
NewAccess(CATCmdStarter,pMyCommand1,MyCommand1);
NewAccess(CATCmdStarter,pMyCommand1,MyCommand1);
SetAccessChild(pINSERT,
SetAccessChild(pINSERT,pMyCommand1);
pMyCommand1);
SetAccessCommand(pMyCommand1,“MyCommand");
SetAccessCommand(pMyCommand1,“MyCommand");
Define the container as a
SetWorkbenchMenu(pMyWorkbench, menu in the workbench
SetWorkbenchMenu(pMyWorkbench,pMyMenu);
pMyMenu);
return
returnpMyWorkbench;
pMyWorkbench;
}}
Copyright DASSAULT SYSTEMES
Student Notes:
Exercise Presentation
Screw : Second part
And now practice on exercise, to learn about:
Screw Creation in interactive mode :
Create your toolbar
Create an One Shot command and Implement the activate method
Retrieve the factories from the editor
Create geometry using DS feature (Pad and Shaft)
Use your interactive command inside CATIA V5
Copyright DASSAULT SYSTEMES
Student Notes:
CAA V5 Dialog
In this course you will learn the CATIA V5 infrastructure to build Dialog Boxes
Framework objectives
Student Notes:
Framework objectives
Programmer productivity
High level objects and widgets
Promotion of reusable components
Portability
Abstract objects for:
UNIX
MS WINDOWS
Standard compliance
Built on top of high level native software
OSF/MOTIF
MFC
Versatility
Dialog applications can be run in:
Copyright DASSAULT SYSTEMES
Student Notes:
Provided Objects
Containers Components
Student Notes:
Container: Windows
A window is an independent resizable container in which other Dialog
objects are created.
CATDlgDocument CATDlgDialog
CATDlgFile
CATDlgNotify
Copyright DASSAULT SYSTEMES
Student Notes:
Container: Bars
A bar is a standard permanent zone for task starter or information fields.
Class Usage
Student Notes:
Container: Menus
A menu is a pop-up container for permanent task starter.
Class Usage
Student Notes:
Component: Menu Items
A menu item is a pop-up control for permanent task starter.
Class Usage
Student Notes:
Component: Control
Check
Button Label Combo
Selector
Selector
Radio List
List
Button
Slider
Spinner
Copyright DASSAULT SYSTEMES
Student Notes:
Dialog Architecture CATDialog
Containers Components
CATDlgWindow CATDlgNotify
CATDlgNotify
CATDlgControl
CATDlgFile
CATDlgFile
CATDlgDocument
CATDlgDocument
CATDlgDialog
CATDlgDialog
CATDlgPushButton
CATDlgPushButton
CATDlgContainer CATDlgRadioButton
CATDlgRadioButton
CATDlgContainer
CATDlgBox CATDlgSplitter CATDlgCheckButton
CATDlgCheckButton
CATDlgSplitter
CATDlgTabContainer
CATDlgTabContainer CATDlgSelectorList
CATDlgSelectorList
CATDlgTabPage
CATDlgTabPage CATDlgIMultiList
CATDlgIMultiList
CATDlgFrame
CATDlgFrame CATDlgCombo
CATDlgCombo
CATDlgIconBox
CATDlgIconBox CATDlgMenuItem CATDlgEditor
CATDlgEditor
CATDlgMenu CATDlgSpinner
CATDlgSpinner
CATDlgBarMenu
CATDlgBarMenu
CATDlgSlider
CATDlgSlider
CATDlgSubMenu
CATDlgSubMenu CATDlgPushItem
CATDlgPushItem
CATDlgScrollBar
CATDlgScrollBar
CATDlgContextualMenu
CATDlgContextualMenu CATDlgRadioItem
CATDlgRadioItem
CATDlgSeparator
Copyright DASSAULT SYSTEMES
CATDlgSeparator
CATDlgBar CATDlgCheckItem
CATDlgCheckItem
CATDlgLabel
CATDlgLabel
CATDlgToolBar
CATDlgToolBar CATDlgSeparatorItem
CATDlgSeparatorItem CATDlgProgress
CATDlgProgress
CATDlgStatusBar
CATDlgStatusBar
Student Notes:
Dialog Design Steps (1/2)
First, determine the type of your dialog
It is a dialog box or a window that contains several representations of a
document.
Create a class that derives from CATDlgDialog.
It is a message pop-up.
Instantiate the CATDlgNotify class
It is a file selection box.
Instantiate the CATDlgFile class.
It is an application main window.
Create a class that derives from CATDlgDocument.
Student Notes:
Dialog Design Steps (2/2)
Second, design the dialog appearance.
Controls, frames, labels…
User interactions and actions.
Specifies the layout of the dialog.
Student Notes:
Layout Management (1/2)
The layout defines the way the objects are organized inside a container.
?
when the container's window is resized
Copyright DASSAULT SYSTEMES
Student Notes:
Layout Management (2/2)
Student Notes:
Grid Layout Management (1/2)
If the option CATDlgGridLayout was not here, the default layout will be attachement
layout.
Copyright DASSAULT SYSTEMES
Student Notes:
Grid Layout Management (2/2)
To place a dialog object you have to set the grid constraint on the dialog
object:
pCircleLimitationsFrame->SetGridConstraints(1,1,1,1,CATGRID_4SIDES);
pCircleLimitationsFrame->SetGridConstraints(1,1,1,1,CATGRID_4SIDES);
Columns 0 1
CircleLimitationsFrame:
Rows - placed at row 1 and column 1,
0 - 1 row span and 1 column span,
- attached to four sides.
SetGridColumnResizable(1,1);
SetGridColumnResizable(1,1);
Student Notes:
Attachment Layout Management (1/3)
_pContainer->SetDefaultOrientation(Vertical);
_pContainer ->SetDefaultOrientation(Vertical);
_pContainer->Attach4Sides(child1);
_pContainer ->Attach4Sides(child1);
_pContainer ->Attach4Sides(child2);
_pContainer ->Attach4Sides(child2);
_pContainer->Attach4Sides(child3);
_pContainer ->Attach4Sides(child3);
Student Notes:
Attachment Layout Management (2/3)
Once the objects have been creating in the container, it is necessary to arrange them
in the container. Note that arranging is not available for some containers such as
CATDlgBar, for which the layout is imposed.
this->SetHorizontalAttachment(0,
this->SetHorizontalAttachment(0,CATDlgTopOrLeft,
CATDlgTopOrLeft,pLabel1,
pLabel1,pCombo1,
pCombo1,NULL);
Copyright DASSAULT SYSTEMES
NULL);
this->
this-> SetHorizontalAttachment(1, CATDlgTopOrLeft, pLabel2, pSpinner1,NULL);
SetHorizontalAttachment(1, CATDlgTopOrLeft, pLabel2, pSpinner1, NULL);
this-> SetHorizontalAttachment(2, CATDlgTopOrLeft, pLabel3, pSpinner2, NULL);
this-> SetHorizontalAttachment(2, CATDlgTopOrLeft, pLabel3, pSpinner2, NULL);
this->
this->SetVerticalAttachment(0,
SetVerticalAttachment(0,CATDlgTopOrLeft,
CATDlgTopOrLeft,pLabel1,
pLabel1,pLabel2,
pLabel2,pLabel3,
pLabel3,NULL);
NULL);
this->
this->SetVerticalAttachment(1, CATDlgRightOrBottomRelative,pCombo1,
SetVerticalAttachment(1,CATDlgRightOrBottomRelative, pCombo1,pSpinner1,
pSpinner1,pSpinner2,
pSpinner2,NULL);
NULL);
Student Notes:
Attachment Layout Management (3/3)
The Attachment Layout is the single way to have a dynamic management:
A dialog box can have a hidden part that can be displayed using a More push
button.
Copyright DASSAULT SYSTEMES
For further information, you can see in the encyclopedia: « User Interface /
Wintop Dialogs / Use Cases / Creating Dialog Boxes Automatically
Resizable »
Student Notes:
Defining a Callback
Callbacks are set with the AddAnalyseNotificationCB method
CATDlgDialog MyDialog
AddAnalyseNotificationCB Build ( )
myFirstCB ( )
callback mechanism
pMyPushButton
pMyPushButton==new
newCATDlgPushButton(this,“Apply”);
CATDlgPushButton(this,“Apply”);
Control object that will
callback the current object
AddAnalyseNotificationCB
AddAnalyseNotificationCB( (
pMyPushButton,
pMyPushButton,
Notification
pMyPushButton->GetPushBActivateNotification(),
pMyPushButton->GetPushBActivateNotification(),
CB method (CATCommandMethod)&MyDialog::myFirstCB,
(CATCommandMethod)&MyDialog::myFirstCB,
NULL);
NULL);
User data to be passed
Copyright DASSAULT SYSTEMES
to the CB method
Student Notes:
The Dialog Builder
CATIA Dialog Builder makes panel creation and edition easier.
Access through menu or by double-clicking on an existing *.CATDlg file.
Generates C++ code.
Possibility to define Callbacks.
Student Notes:
CAA V5 DialogEngine
In this course you will learn the mechanisms necessary to describe and to
manage the dialog of an interactive command, how to monitor the interactions
at run time and manage Undo/Redo capabilities
Main notions
Student Notes:
Dialog Engine Architecture
Your new toolbar will launch a command who will be responsible for user
interactions. If you need it, your command can manipulate a panel.
Addin Launch
Panel
Student Notes:
Notions to describe a dialog
If you don’t need to select objects or to enter values, use a Basic Command.
(Example: Load a Feature catalog)
If you don’t need to select objects but you need to enter values, use a
Dialog-Based Command.
(Example: Create a 3D Point by valuating X, Y and Z in a Panel)
Student Notes:
Command with/without an argument
CATCreateClass(
CATCreateClass(MyCommand
MyCommand) )
…… This macro is mandatory to be able to instantiate a
corresponding command header in a toolbar or a menu
CATCreateClassArg(
CATCreateClassArg(MyCommand,CATISample
MyCommand,CATISample) )
MyCommand::MyCommand
MyCommand::MyCommand(CATISample
(CATISample**iArg)
iArg)
……
Copyright DASSAULT SYSTEMES
Student Notes:
Notions to describe a CATStateCommand
A StateCommand will receive user interactions in CATIA ApplicationFrame.
It is triggered by a Condition:
at least event-driven: an end user interaction
conditional, it validates the user input
When a Transition is triggered, the target state becomes the active state.
Copyright DASSAULT SYSTEMES
Student Notes:
Finite State Machine
Initial State
Intermediate States
Indicate Position 1 Proposed
Interaction
Mouse Button 1 Click
[Indication in the right location?] Condition
Transition
/ Point1 = CreatePoint(Position1) Action
Indicate Position 2
Student Notes:
The CATStateCommand Class
Create a new class deriving from CATStateCommand
Overload at least:
To describe your own state chart
BuildGraph()
To manage properly your command life cycle
Activate()
Desactivate()
Cancel()
Define some specific methods that will be used as conditions or actions
Store as data members the dialog agents used in the command
Copyright DASSAULT SYSTEMES
Student Notes:
Define the State Charts
Overload the BuildGraph method
Define the dialog agents you need
Create all the states and plug the dialog agents in the corresponding states
Define the transitions between states:
Source and target states
Condition
Action
Copyright DASSAULT SYSTEMES
Student Notes:
Agent (1/2) : Definition
A Dialog Agent translates a user interaction into an user input
Ex: a CATIndicationAgent converts a left button mouse click in a 2D viewer as a
2D-coordinate input
Indicate
Position1
Position1 ?
Copyright DASSAULT SYSTEMES
Student Notes:
Agent (2/2) : Main Types
CATDialogAgent is the main class
This class can be used to define an agent linked to a panel object instantiated in
the command.
This agent can be valuated when a notification is sent.
_AgentPanelOK
_AgentPanelOK==new
newCATDialogAgent("
CATDialogAgent("AgentPanelOK
AgentPanelOK");
");
_AgentPanelOK->AcceptOnNotify(
_AgentPanelOK->AcceptOnNotify(_MyPanel,
_MyPanel,_MyPanel->GetDiaOKNotification());
_MyPanel->GetDiaOKNotification());
The agent will be valuated when the OK
button of the panel will be pressed
_myAgent
_myAgent->SetBehavior(CATDlgEngWithPSOHSO|CATDlgEngWithPrevaluation);
->SetBehavior(CATDlgEngWithPSOHSO|CATDlgEngWithPrevaluation);
AddCSOClient(
AddCSOClient(__myAgent
myAgent);); A valid object is highlighted when
Enable the Object / Action dialog style. the mouse is located on it
Look in the CSO (Current Set of Objects)
Student Notes:
States (1/2): Declaration
void
voidMyCommand::BuildGraph()
MyCommand::BuildGraph()
{{ The initial state is already created.
CATDialogState
CATDialogState**State1
State1==GetInitialState(“Start”);
GetInitialState(“Start”);
CATDialogState State2==AddDialogState
CATDialogState**State2 AddDialogState(“Second”);
(“Second”);
. .. .. .
}}
Copyright DASSAULT SYSTEMES
Student Notes:
States (2/2) : Plug the Dialog Agents to the states
……
_myAgent1
_myAgent1==new
newCATPathElementAgent(
CATPathElementAgent(“myAgent1"
“myAgent1"););
_myAgent2
_myAgent2==new
newCATPathElementAgent(
CATPathElementAgent(“myAgent2”
“myAgent2”););
Position1
State1->AddDialogAgent(_myAgent1);
State1->AddDialogAgent(_myAgent1);
Position2 State2->AddDialogAgent(_myAgent2);
State2->AddDialogAgent(_myAgent2);
Several agent can be plugged
to the same state.
Copyright DASSAULT SYSTEMES
Student Notes:
Transitions (1/3) : Agent condition
Student Notes:
Define the Transitions (2/3) : additional condition
The condition method signature is:
boolean ConditionMethod (void* iUsefulData)
Position1
Position2
Student Notes:
Define the Transitions (3/3) : actions to be executed
The action method signature is:
boolean ActionMethod (void* iUsefulData)
Position1
/ Point1 = CreatePoint(Position1)
Position2
AddTransition(State1,
AddTransition(State1,State2,
State2,AndCondition(
AndCondition(IsOutputSetCondition(_myAgent1),
IsOutputSetCondition(_myAgent1),
Condition((ConditionMethod)&MyCommand::CheckPosition,
Condition((ConditionMethod)&MyCommand::CheckPosition,
CATIPoint*
CATIPoint*PointToBeChecked)
PointToBeChecked)),),
Action((ActionMethod)
Action((ActionMethod)&MyCommand::CreatePoint,
&MyCommand::CreatePoint,
(ActionMethod) &MyCommand::UndoCreatePoint,
Copyright DASSAULT SYSTEMES
(ActionMethod) &MyCommand::UndoCreatePoint,
(ActionMethod)
(ActionMethod)&MyCommand::RedoCreatePoint,…)
&MyCommand::RedoCreatePoint,…) ););
Student Notes:
Interruption by another command: Exclusive or Shared
Only for CATStateCommand: the second command can be launched
interactively or can be called by a simple new() in the first command.
Current
command Cancel()
Current
Copyright DASSAULT SYSTEMES
Student Notes:
Launching a sub-command (or macro-agent)
The CATStateCommand class derives from the CATDialogAgent class, then
it can be used as a agent in another command.
SecondCmd
SecondCmd*_pSecondCmd
*_pSecondCmd==new
newSecondCmd();
SecondCmd();
State1->AddDialogAgent(_pSecondCmd);
State1->AddDialogAgent(_pSecondCmd);
Copyright DASSAULT SYSTEMES
AddTransition(
AddTransition(State1,
State1,State2,
State2,IsOutputSetCondition
IsOutputSetCondition(_pSecondCmd),
(_pSecondCmd),
Action
Action ((ActionMethod) &MyCmd::ActionOne)););
((ActionMethod) &MyCmd::ActionOne)
Student Notes:
Additional Information: Propose Multi Acquisition (1/2)
To enable multi-selection for a path element dialog agent, set its behavior to
CATDlgEngMultiAcquisitionSelModes (selection by trap)
CATDlgEngMultiAcquisitionCtrl (selection by trap and by Ctrl Key)
CATDlgEngMultiAcquisitionUserCtrl (allow you to switch between the two
previous modes)
……
_pAgentMultiSel
_pAgentMultiSel==new
newCATPathElementAgent(
CATPathElementAgent(“Sample"
“Sample"););
_pAgentMultiSel
_pAgentMultiSel->AddElementType(CATISample::ClassName());
->AddElementType(CATISample::ClassName());
_pAgentMultiSel ->SetBehavior(CATDlgEngWithPSOHSO| |
_pAgentMultiSel->SetBehavior(CATDlgEngWithPSOHSO
CATDlgEngWithPrevaluation
CATDlgEngWithPrevaluation| |
CATDlgEngMultiAcquisitionCtrl);
CATDlgEngMultiAcquisitionCtrl);
_pAgentMultiSel->AddElementType(CATISample::ClassName());
_pAgentMultiSel->AddElementType(CATISample::ClassName()); MultiAcquisition Behavior
AddCSOClient(_pAgentMultiSel);
AddCSOClient(_pAgentMultiSel);
…
…
Copyright DASSAULT SYSTEMES
Student Notes:
Additional Information: Propose Multi Acquisition (2/2)
To Retrieve your set of selected objects from your path element agent you
must use the CATSO class.
… …
CATSO*
CATSO*pSOonSample
pSOonSample==_pAgentSample->GetListOfValues();
_pAgentSample->GetListOfValues();
ifif(NULL != pSOonSample)
(NULL != pSOonSample) Method to retrieve the
{{ list of selected objects
int NbOfSample = pSOonSample->GetSize();
int NbOfSample = pSOonSample->GetSize();
for
for(int
(inti i==00; ;i i<<NbOfSample
NbOfSample; ;i++)
i++)
{{
CATPathElement*
CATPathElement*pPEonSample
pPEonSample==(CATPathElement*)(*pSOonSample)[i];
(CATPathElement*)(*pSOonSample)[i];
CATBaseUnknown*
CATBaseUnknown* piBUonSample =pPEonSample->FindElement(IID_CATISample);
piBUonSample = pPEonSample->FindElement(IID_CATISample);
……
}}
}}
… …
Copyright DASSAULT SYSTEMES
Student Notes:
Additional Information: Rubber Banding
Define a self-transition
Use a Dialog Agent with specific behaviors
CATDlgEngWithPrevaluation: the agent can be valuated by the object that is under the
mouse without selecting it.
CATDlgEngAcceptOnPrevaluate: The transition is triggered when the agent is valued without
selecting.
Student Notes:
Additional Information: Managing Undo/Redo
Two levels of Undo/Redo
Input Undo/Redo within a command
Command Undo/Redo
Then, when out of a command, global Undo methods are executed to cancel
the results of the previous commands
Copyright DASSAULT SYSTEMES
Student Notes:
Dialog Engine Integration (1/2)
Associate a dialog to your command
CATStateCommand CATDlgDialog
BuildGraph () SetVisibility ()
MyCommand MyDialog
_panel
_panel==new
newMyDialog();
MyDialog();
_panel->Build();
MyCommand () Build ()
_panel->Build();
_panel->SetVisibility(CATDlgShow);
_panel->SetVisibility(CATDlgShow); ~MyCommand()
BuildGraph () Dialog definition
(layout, controls)
if(_panel)
if(_panel)
_panel->RequestDelayedDestruction(); State Machine definition
_panel->RequestDelayedDestruction();
_panel (states, agents and transitions)
_panel==NULL;
NULL;
Copyright DASSAULT SYSTEMES
Student Notes:
Dialog Engine Integration (2/2)
Use a DialogAgent instead of a callback when you want to perform a
transition.
CATStateCommand CATDlgDialog CATDlgSpinner
GetSpinnerBtnDownNotification()
_SpinnerAgent
_SpinnerAgent==new
newCATDialogAgent(“Agent”);
CATDialogAgent(“Agent”);
_SpinnerAgent->AcceptOnNotify(
_SpinnerAgent->AcceptOnNotify(_panel->_Spinner001,
_panel->_Spinner001,_panel->_Spinner001->GetSpinnerModifyNotification());
_panel->_Spinner001->GetSpinnerModifyNotification());
firstState->AddDialogAgent(_SpinnerAgent);
firstState->AddDialogAgent(_SpinnerAgent);
......
AddTransition
AddTransition(firstState,
(firstState,secondState,
secondState,IsOutputSetCondition(_SpinnerAgent),
IsOutputSetCondition(_SpinnerAgent),
Action((ActionMethod)&MyCommand::MyActionMethod));
Action((ActionMethod)&MyCommand::MyActionMethod));
Copyright DASSAULT SYSTEMES
If you do not need any transition for your dialog objects just use an
AddAnalyseNotificationCB
Student Notes:
State Charts definition using DMC (1/3)
It is also possible to use Data Model Customer (DMC) to create a state chart
command.
Student Notes:
State Charts definition using DMC (2/3)
Student Notes:
State Charts definition using DMC (3/3)
Then define these components (output
conditions for the state, agent type or
action during a transition)
Tools\DIALOGENGINE\Edit….
Call Tools\DIALOGENGINE\Generate
Source command to generate
automatically the C++ code associated
with your state chart
Copyright DASSAULT SYSTEMES
Student Notes:
Dialog / Dialog Engine / Tool bar / Workbench
All this objects are referenced by an unique identifier (his name). To avoid
name collisions inside and outside the CAA environment, you must follow
the naming convention (C++ class name, identifier, late type, …).
Copyright DASSAULT SYSTEMES
Student Notes:
CAAV5 Resources
You will learn how to define your resources files (text, icon, …).
Resources Overview
Assigning Resources
Student Notes:
Resources OverView
What are resources?
Resources could be text or icons displayed by the application.
Text resources are compatible with National Language Support
Resources can be changed without recompilation
Student Notes:
Assigning Resources: Declaration and Creation
Declare resources in your object
MyDialogBox.h
class
classMyDialogBox
MyDialogBox: :public
publicCATDlgDocument
CATDlgDocument
{{
DeclareResource(MyDialogBox,
DeclareResource(MyDialogBox,CATDlgDocument);
CATDlgDocument);
......
};};
Father class for
resource inheritance
Class
name
Create resource files
One message file (CATNls) for each supported language.
One CATRsc file for non message resources.
MyDialogBox.CATNls
Copyright DASSAULT SYSTEMES
English files
MyDialogBox.CATRsc
Student Notes:
Assigning Resources: Defined and Predefined
Using user defined resources
These are messages that you define and use by yourself.
MyDialogBox.cpp
CATUnicodeString
CATUnicodeStringtext
text==CATMsgCatalog::BuildMessage(“MyDialogBox”,
CATMsgCatalog::BuildMessage(“MyDialogBox”,“Pick”);
“Pick”);
Message Key
MyDialogBox.CATNls
Message File
Pick
Pick==“Indicate
“Indicatecoordinates”;
coordinates”;
MyDialogBox.CATNls
Title
Title==“A
“Asimple
simplepanel”;
panel”;
Student Notes:
Assigning Predefined Resources: Panel
Concatenation
Resources of contained objects can be defined in the container object
resource file.
Inheritance
Derived object inherit from any resources defined in the father object.
TSTPanel.cpp
void
voidTSTPanel::Build()
TSTPanel::Build()
{{
CATDlgFrame*
CATDlgFrame*pFrame
pFrame==new
newCATDlgFrame(this,
CATDlgFrame(this,"CoordinatesFrame");
"CoordinatesFrame");
CATDlgLabel*
CATDlgLabel*pLabel1
pLabel1==new
newCATDlgLabel(pFrame
CATDlgLabel(pFrame, ,“XLabel");
“XLabel");
CATDlgLabel*
CATDlgLabel*pLabel2
pLabel2==new
newCATDlgLabel(pFrame
CATDlgLabel(pFrame, ,“YLabel");
“YLabel");
CATDlgLabel*
CATDlgLabel*pLabel3
pLabel3==new
newCATDlgLabel(pFrame
CATDlgLabel(pFrame, ,“ZLabel");
“ZLabel");
}}
TSTPanel.CatNLS
Title
Title==“Point
“PointEdition”;
Edition”;
CoordinatesFrame.Title
CoordinatesFrame.Title==“Coordinates”;
Copyright DASSAULT SYSTEMES
“Coordinates”;
CoordinatesFrame.XLabel.Title
CoordinatesFrame.XLabel.Title==“X
“X: :”;”;
CoordinatesFrame.YLabel.Title
CoordinatesFrame.YLabel.Title = “Y: :”;”;
= “Y
CoordinatesFrame.ZLabel.Title
CoordinatesFrame.ZLabel.Title==“Z
“Z: :”;”;
Student Notes:
Assigning Predefined Resources: Toolbar and Workbench
MyAddin.CatNLS
MyToolbar.Title
MyToolbar.Title==“Toolbar”;
“Toolbar”;
MyCommandHeader.CatNLS
MyCommandHeader.MyCommand1.Title
MyCommandHeader.MyCommand1.Title==“OneShot”;
“OneShot”;
MyCommandHeader.MyCommand2.Title
MyCommandHeader.MyCommand2.Title==“Statechart
“Statechart”;”;
MyCommandHeader.MyCommand3.Title = “MultiSel”;
MyCommandHeader.MyCommand3.Title = “MultiSel”;
MyWkb1.CatNLS
MyWkb1.Title
MyWkb1.Title==“CAA
“CAAV5:
V5:Geometrical
GeometricalCreation”;
Creation”;
Copyright DASSAULT SYSTEMES
MyWkb2.CatNLS
MyWkb2.Title
MyWkb2.Title==“CAA
“CAAV5
V5Geometrical
GeometricalAnalysis”;
Analysis”;
Student Notes:
CATDialog Predefined Resources
There are several kind of Text and Icon Resources defined by several
methods of CATDialog class
Text Resources
Title : object title string
Mnemonic : Alt key shortcut to select a displayed menu or menu item
Accelerator : Ctrl key shortcut to select a menu item
Help : help message associated with the object
ShortHelp : short message displayed when the mouse stays over this object.
LongHelp : message displayed when the user clicks on Help button or on the ?
box, the cursor becoming a ?, and clicks on the object to get help about it.
Icon Resources
Icon : dialog object default icon
IconSel : icon displayed when this object is selected.
IconFocus : icon displayed when the mouse moves over this object.
IconDisabled : icon displayed when this object can not be selected.
IconType : type of the icon (Default, General, Creation, Modification, or Analysis),
Copyright DASSAULT SYSTEMES
Student Notes:
Exercise Presentation
Screw : Third part
Student Notes:
CAA V5 Visualization
Framework Objectives
Student Notes:
Framework Objectives
Visualize a model
A model is visualized thanks to a graphic representation
Multi-window management
Components can be seen in several viewers or in several windows at the same
time
Direct manipulation
Viewers provide 3D and 2D manipulators to interact with the representation
Copyright DASSAULT SYSTEMES
Student Notes:
Architecture Principles
Model / View / Controller
Assume the independency between the data model and its representation (view)
Allow to change the viewer without impacting on the data
Student Notes:
Architecture Overview
5) Sends
6) Updates the model notification (user
(if necessary) Controller interaction)
CATCommand
CATVisManager
1)
Attaches 4) Sets the graphic
representation to the
2)Sends Notification viewpoint
Root Object
CATIModelEvents Bag2D Bag3D CATSelector
CATIVisu
Viewer
Model 3) Asks for the graphic View
representation
Student Notes:
Controller Creation
The manager is a unique instance of the CATVisManager class that
manages the display of all the documents in all their windows
CATVisManager::GetVisManager();
CATVisManager::GetVisManager();
Copyright DASSAULT SYSTEMES
Student Notes:
Model: Graphic Properties
Any features which are a graphic representation adheres to
CATIVisProperties interface which allow to set some properties attributes
with SetPropertiesAtt() method.
Student Notes:
Model: Refresh
Sometimes it is necessary to force the refreshing of the specification tree
and the 3D view to see the created feature:
Student Notes:
View: architecture
VIEWER:
AddViewPoint()
Object allowing to navigate CATViewer
inside the visualized model and
to define the visualization mode.
CATViewPoint
VIEW POINT:
AddRep()
View point of the user on
the model CAT3DViewPoint CAT2DViewPoint
AddRep()
CATRep
AddChild()
REPRESENTATION:
CAT3DLineRep
Define the positioning and
the graphic attributes CAT2DLineRep
CAT3DCustomRep CAT3DPlanRep
CAT2DCustomRep CAT2DPointRep CAT3DBagRep
CATSurfacicRep … CAT2DBagRep
CATGraphicPrimitive
AddGP()
Visualized. CAT2DRectangle
CAT2DAnnotationTextGP
CAT3DMarkerGP
CAT3DAnnotationTextGP
…
CAT2DFixedArrow
CAT3DFixedArrow
…
Student Notes:
View: Creating Visualization Sample
CATGraphicAttributeSet
CATGraphicAttributeSetpGraphicAttributeSet;
pGraphicAttributeSet;
pGraphicAttributeSet.SetColor(TRUECOLOR); Define the graphic attributes
pGraphicAttributeSet.SetColor(TRUECOLOR); of the representation.
pGraphicAttributeSet.SetColorRGBA(0,
pGraphicAttributeSet.SetColorRGBA(0,255,
255,0);
0);
CAT3DCustomRep*
CAT3DCustomRep*p3DCustomRep
p3DCustomRep==new
newCAT3DCustomRep(pArrow,
CAT3DCustomRep(pArrow,pGraphicAttributeSet);
pGraphicAttributeSet);
CATMathPointf
CATMathPointfMPfOrigin(MPOrigin);
MPfOrigin(MPOrigin);
CAT3DBoundingSphere Define the bounding
CAT3DBoundingSphereBSon3DCustomRep(MPfOrigin,
BSon3DCustomRep(MPfOrigin,0,0,Length);
Length); visualization.
p3DCustomRep->SetBoundingElement(BSon3DCustomRep);
p3DCustomRep->SetBoundingElement(BSon3DCustomRep);
_p3DBagRep
_p3DBagRep==new
newCAT3DBagRep();
CAT3DBagRep();_p3DBagRep->AddChild(*p3DCustomRep);
_p3DBagRep->AddChild(*p3DCustomRep); Creation of a 3D bag
CATFrmLayout*
CATFrmLayout*pFrmLayout
pFrmLayout==CATFrmLayout::GetCurrentLayout();
CATFrmLayout::GetCurrentLayout();
CATFrmWindow*
CATFrmWindow* pFrmWindow =pFrmLayout->GetCurrentWindow();
pFrmWindow =
Copyright DASSAULT SYSTEMES
pFrmLayout->GetCurrentWindow();
CATViewer* pViewer = pFrmWindow->GetViewer();
CATViewer* pViewer = pFrmWindow->GetViewer(); Force the redrawing
pViewer->AddRep(_p3DBagRep); of the scene.
pViewer->AddRep(_p3DBagRep);pViewer->Draw();
pViewer->Draw();
Student Notes:
View: manipulator sample (parameterization)
_p3DBagRep
_p3DBagRep==…;
…; Type of displacement
_pManipulator
_pManipulator==new
newCAT3DManipulator(this,
CAT3DManipulator(this,"Manip",
"Manip",_p3DBagRep,
_p3DBagRep,CAT3DManipulator::DirectionTranslation);
CAT3DManipulator::DirectionTranslation);
CATMathPoint
CATMathPointP(0.,
P(0.,0.,
0.,0.);
0.);
CATMathVector Set the manipulator
CATMathVector I(1., 0.,0.),
I(1., 0., 0.),J(0.,
J(0.,1.,
1.,0.),
0.),K(0.,
K(0.,0.,
0.,1.);
1.);
CATMathAxis axis and direction
CATMathAxisAxis(P,
Axis(P,I,I,J,J,K);
K);
_pManipulator->SetPosition(Axis);
_pManipulator->SetPosition(Axis); Define a callback to .manage
CATMathDirection
CATMathDirectionD(0.,
D(0.,1.,1.,0.);
0.);_pManipulator->SetTranslationDirection(D);
Copyright DASSAULT SYSTEMES
AddAnalyseNotificationCB(_pManipulator,
AddAnalyseNotificationCB(_pManipulator,CATManipulator::GetCATManipulate(),
CATManipulator::GetCATManipulate(),
(CATCommandMethod)
(CATCommandMethod)&CAAMyCmd::CBManipulator,
&CAAMyCmd::CBManipulator, (void*)
(void*)NULL);
NULL);
Student Notes:
View: manipulator sample (Callback)
void
voidCAAMyCmd::CBManipulator(CATCommand*
CAAMyCmd::CBManipulator(CATCommand*cmd, cmd,CATNotification*
CATNotification*evt,
evt,CATCommandClientData
CATCommandClientDatadata)
data)
{{
CATMathAxis
CATMathAxisPosition
Position==((CAT3DManipulator
((CAT3DManipulator*)cmd)->GetPosition();
*)cmd)->GetPosition();
CAT4x4Matrix InitialisationMatrix(Position); Set the new
CAT4x4Matrix InitialisationMatrix(Position); bag position
_p3DBagRep->SetMatrix(InitialisationMatrix);
_p3DBagRep->SetMatrix(InitialisationMatrix);
CATFrmLayout*
CATFrmLayout*pFrmLayout
pFrmLayout==CATFrmLayout::GetCurrentLayout();
CATFrmLayout::GetCurrentLayout();
CATFrmWindow*
CATFrmWindow* pFrmWindow =pFrmLayout->GetCurrentWindow();
pFrmWindow = pFrmLayout->GetCurrentWindow();
CATViewer*
CATViewer*pViewer
pViewer==pFrmWindow->GetViewer();
pFrmWindow->GetViewer();
pViewer->Draw();
pViewer->Draw();
}}
Force the redrawing
of the scene.
Copyright DASSAULT SYSTEMES
Student Notes:
View: Temporary representation
It is also possible to create temporary graphic representations of objects that are not
part of the document, such as arrows to specify a direction of a face.
Student Notes:
View: Temporary representation (sample)
Student Notes:
View : Manage 2D-3D Viewers in Dialog Boxes
Isolate an object
Simplfy a view
Copyright DASSAULT SYSTEMES
Student Notes:
View : Manage 2D-3D Viewers in Dialog Boxes
……
Copyright DASSAULT SYSTEMES
Tools/Options/Display/Performances
Restart Session
Student Notes:
View : Manage 2D-3D Viewers in Dialog Boxes
“AnyFeature3D” CATI3DGeoVisu
GiveRep()
“AnyFeature2D” CATI2DGeoVisu
“MyFeature” TSTIVisu
Graphic 2D and 3D
representations
Student Notes:
View : Manage 2D-3D Viewers in Dialog Boxes
::AddCallback(viewer,
::AddCallback(viewer, To receive these notifications
CATViewer::VIEWER_FEEDBACK_UPDATE(),
CATViewer::VIEWER_FEEDBACK_UPDATE(),
(CATSubscriberMethod)&MyClass::MyCBMethod,
(CATSubscriberMethod)&MyClass::MyCBMethod,NULL);
NULL);
void
voidMyClass::MyMethodCB(…,
MyClass::MyMethodCB(…,CATNotification
CATNotification**iNotification,
iNotification,…)
…)
{{
Get the
CATVisViewerFeedbackEvent**pFeedbackEvent
CATVisViewerFeedbackEvent pFeedbackEvent==NULL NULL; ; notification
pFeedbackEvent = (CATVisViewerFeedbackEvent*) iNotification;
pFeedbackEvent = (CATVisViewerFeedbackEvent*) iNotification;
int
intcontext=pFeedbackEvent->GetContext();
context=pFeedbackEvent->GetContext();
IfIf(context==Move)
(context==Move)
……
……
Copyright DASSAULT SYSTEMES
else
elseifif(context==
(context==Preactivate)
Preactivate)
……
……
Student Notes:
View : Manage 2D-3D Viewers in Dialog Boxes
Lifecycle management
viewer->RemoveRep(pMyCAT3DRep );
pMyCAT3DRep ->Destroy( );
RequestDelayedDestruction( );
MyDlgDialog
Copyright DASSAULT SYSTEMES
MyNavigation3DViewer
Propagate the Dialog
object destruction
Student Notes:
You will learn what are the CATIA geometric and topological capabilities, and
how to manipulate them.
Objectives
Geometric Objects
Student Notes:
CGM in the overall architecture
Applicative Modelers
MechanicalModeler DialogEngine
Model Presentation
Student Notes:
Mathematics Overview
Provides basic mathematical classes
Point, Vector, Line, Plane, Circle, 2D and 3D Matrices,
Transformations, Boxes, …
Optimized classes
Student Notes:
Mathematics-like code writing
Computation of the projection of the point P on the line (A,u)
CATMathVector u;u;
CATMathVector n P
CATMathPoint
CATMathPoint A,P,H;
A,P,H;
////Compute
Computeprojection
projection
HH==AA++( ((P-A)
(P-A)**uu) )**uu
////Compute
Computenormal
normal A
CATMathVector u H
CATMathVectornn==uu^^(P-A);
(P-A);
n.Normalize();
n.Normalize();
Copyright DASSAULT SYSTEMES
Student Notes:
AdvancedMathematics Overview
Provides generic solvers dedicated to applications which want to do
intensive mathematical computations
Implicit equation solver
Differential system solver
Non linear system solver
Function sampling and sampled points interpolation
Student Notes:
AdvancedMathematics Usage in Geometric Operations
Mathematic algorithms are used in geometric operations:
Student Notes:
GeometricObjects Overview
A wide set of interfaces for using geometric objects:
Lines, curves, conics, NURBS curves …
Canonical surfaces, NURBS surfaces, revolution surface,…
Curves of any type on surfaces of any type
Laws
Capability to introduce foreign curve and surface definition
Student Notes:
Geometry definition
Mathematical definition of a portion of the space which can be:
a point:
a curve:
a surface:
Student Notes:
NewTopologicalObjects Overview
Object Definition
Enable basic creation of the topological objects
Navigation through any body definition
Support of non-manifold and multi-dimensional bodies
Minimal model size through data sharing at any level of the topological graph
Student Notes:
Topology Definition
Topology is a building set for limiting the geometry (So, it’s also a
streamed and temporary object).
Student Notes:
Body, Cell and Domain Relationship
CATBody
CATDomain CATCell
CATShell 1,*
CATFace
CATLoop 1,*
1,* CATEdge
CATVertexInFace
1
2
CATWire CATVertex
CATVertexInVolume
Copyright DASSAULT SYSTEMES
CATMacroPoint Associated
Geometry
CATEdgeCurve
CATSurface
Student Notes:
CGM Interface Hierarchy Objects in this
diagram are only
interfaces, even if
Contains they do not respect
CATICGMObject
the interface naming
CATICGMContainer convention: CATIXXX
CGM Creates
container
CATGeoFactory CATGeometry CATLaw
CATMacroPoint
CATCartesianPoint
CATTopology CATPoint CATPointOnCurve
CATPointOnSurface P is for
Parametric
CATConic
CATDomain CATTopObject CATLine CATPLine
CATNurbsCurve CATPCircle
CATCurve CATSplineCurve CATPEllipse
CATIForeignCurve CATPHyperbola
CATPCurve CATPParabola
CATBody CATCell CATEdgeCurve CATPNurbs
CATLump
CATShell
CATLoop CATElementarySurface
CATIForeignSurface
Copyright DASSAULT SYSTEMES
CATWire CATVolume
CATVertexInFace CATFace CATNurbsSurface
CATVertexInVolume CATEdge CATSurface CATOffsetSurface
CATVertex CATPlane
CATRevolutionSurface
CATTabulatedCylinder
Student Notes:
Conceptual Link between Topology & Geometry (1/2)
According to the dimension of the topological object, the
associated geometry can be:
CATMacroPoint
CATEgdeCurve
CATSurface
Student Notes:
Conceptual Link between Topology & Geometry (2/2)
Topology
Surface2 Curve1
Geometry
Face1
Face2
Surface1
Curve2
Edge12
Student Notes:
The CATBody Interface
Describe the concept of a Topological Body (restriction of the 3D
geometrical space)
Provide the factory to create all the Topological objects: CATCell(s) and
CATDomain(s)
Copyright DASSAULT SYSTEMES
Student Notes:
Navigation through the Topological Data Structure
The three main interfaces propose some navigation capabilities.
Student Notes:
Scanning a Topological Body: Domains
CATBody
CATBody **piBody
piBody==…;
…;
////Get
Getthe
thenumber
numberofofdomains
domainsfor
forthe
thebody
body
long NumberOfDomains = piBody -> GetNbDomains();
long NumberOfDomains = piBody -> GetNbDomains();
////For
Foreach
eachdomain
domain Retrieve a CATDomain interface
for
for (int i = 1;i<=
(int i = 1; i<=NumberOfDomains;
NumberOfDomains;i++)
i++) on each domain of the body
{{
CATDomain
CATDomain **piDomain
piDomain==piBody
piBody->
->GetDomain(i);
GetDomain(i);
long
long tag
tag==piDomain
piDomain->GetPersistentTag();
->GetPersistentTag(); Get the domain’s tag
long
long NumberOfCells
NumberOfCells==piDomain
piDomain->GetNbCellUses();
->GetNbCellUses();
for (int j=1; j<= NumberOfCells; j++)
for (int j=1; j<= NumberOfCells; j++)
{{
You can scan the domain: retrieve
CATCell**piCell
CATCell piCell==piDomain
piDomain->GetCell(j);
->GetCell(j); all cells and get their dimension.
int
int dimCell
dimCell==piCell
piCell->GetDimension();
->GetDimension();
}}
Copyright DASSAULT SYSTEMES
}}
Student Notes:
Scanning a Topological Body: Cells
////Retrieve
Retrieveaalist
listofofcells
cells(faces)
(faces)
CATLISTP(CATCell)
CATLISTP(CATCell) CellList;CellList; Retrieve all cells of dimension 2
piBody->GetAllCells(CellList,2);
piBody->GetAllCells(CellList,2); (faces) in the body
////Get
Getthe
thenumber
numberofoffaces
faces
int
int NumberOfFaces =CellList.Size();
NumberOfFaces = CellList.Size(); Retrieve the underlying
geometry type of the cell
////Loop
Loopover
overeach
eachface
face (ex: CATPoint, CATLine, …)
for
for (int i=1; i< NumberOfFaces++1;1;i++)
(int i=1; i< NumberOfFaces i++)
{{
CATGeometry **piGeomOfCell
CATGeometry piGeomOfCell==CellList[i]->GetGeometry();
CellList[i]->GetGeometry();
////Compute
Computethe
thearea
areaofofthe
theface
face Retrieve a CATFace interface on
CATFace* piAFace = (CATFace*)(CellList[i]);
CATFace* piAFace = (CATFace*) (CellList[i]); the cells to use the methods
double FaceArea = piAFace ->CalcArea(); CalcArea() and GetSurface()
double FaceArea = piAFace ->CalcArea();
//Retrieve
//Retrieveall
allplanar
planarsurfaces
surfaces Use the method IsATypeOf() to
CATSurface * piASurface==piAFace
CATSurface * piASurface piAFace->GetSurface();
->GetSurface(); test the type of a CGM object
ifif(piASurface
(piASurface->IsATypeOf(CATPlaneType))
->IsATypeOf(CATPlaneType))
CATPlane
CATPlane**piPlanarSurface
piPlanarSurface==(CATPlane*)
(CATPlane*)piASurface
piASurface; ;
Copyright DASSAULT SYSTEMES
long
longNumberOfDomainsForCell
NumberOfDomainsForCell==CellList[i]->GetNbDomains();
CellList[i]->GetNbDomains(); Retrieve the aggregated
for
for (int k=1; k<NumberOfDomainsForCell;k++)
(int k=1; k<NumberOfDomainsForCell; k++) domains to this cell
CATDomain* Domain = CellList[i]->GetDomain(k);
CATDomain* Domain = CellList[i]->GetDomain(k);
}}
Student Notes:
CGM Objects rules
In most cases, no AddRef/Release on a CGM interface
CGM objects don’t follow typical CAA lifecycle rules
The reference counter is not incremented while object is returned by a function
Nevertheless an AddRef/Release error can produce a crash or memory leak
Student Notes:
Exercise Presentation
Screw : Fourth part
And now practice one exercise, to learn about:
Scan Geometry in Batch mode :
Creating a new batch program
Retrieve Using topological operators
Copyright DASSAULT SYSTEMES
Student Notes:
Student Notes:
Selection in an Interactive Session
In the 3D view
features or sub-elements
Student Notes:
Filter to select a whole Feature
CATIMfTriDimResult
CATIMfInfiniteResult
Student Notes:
Filter to select a sub-element of a feature
A BRep Access is a TEMPORARY object built each time a sub-element is pre-
selected or selected
It is a C++ object
Student Notes:
BRep Access Interfaces
CATIRSur
CATIREdge
CATIREdgeAccess CATIBorderREdge
CATIBRepAccess CATIWireREdge
CATIFVertex
CATIFVertexAccess CATIWireFVertex
Copyright DASSAULT SYSTEMES
CATIBorderFVertex
Student Notes:
Selection Filter: Geometrical and Topological interfaces
Selection with Topological interfaces (ex: CATBody):
Impossible
Student Notes:
Selection Filter: Delegation sample
REdge
GSMLine
Student Notes:
Selection Filter: Order
pAgent
pAgent==new
newCAFeatureImportAgent
CAFeatureImportAgent("Select");
("Select");
CATListOfCATString Types;
CATListOfCATString Types;
Types.Append
Types.Append("CATIGSMLine");
("CATIGSMLine");
Copyright DASSAULT SYSTEMES
Types.Append ("CATLine");
Types.Append ("CATLine");
pAgent->SetOrderedTypeList
pAgent->SetOrderedTypeList(Types);
(Types);
Student Notes:
Filter Methods
A selection filter allows you to select
an object which adheres to this
interface
You can also use a filter method to
define a more accurate selection
void
voidCAACmd::BuildGraph()
CAACmd::BuildGraph()
{{
……
CATAcquisitionFilter*
CATAcquisitionFilter*pFilter
pFilter==Filter((FilterMethod
Filter((FilterMethod)& )&CAACmd::Check,
CAACmd::Check,(void*)
(void*)NULL);
NULL);
_pAgentSelect->SetFilter (pFilter);
_pAgentSelect->SetFilter (pFilter);
….
…. Set the filter to the agent
}}
CATBoolean
CATBooleanCAACmd::Check(CATDialogAgent*
CAACmd::Check(CATDialogAgent*iAgent,
iAgent,void*
void*iData)
iData)
{{
CATIProduct*
CATIProduct*piProduct
piProduct==((CATPathElementAgent*)iAgent)
((CATPathElementAgent*)iAgent) GetElementValue();
GetElementValue();
ifif(IsFirstLevel (piProduct) ) return CATTrue;
(IsFirstLevel (piProduct) ) return CATTrue;
Copyright DASSAULT SYSTEMES
Student Notes:
BRep Feature
CATFeatureImportAgent
Copyright DASSAULT SYSTEMES
Student Notes:
BRep Feature Introduction
GeometricalSubElement CATIMfBRep
“Featurize”
FeatureWIREFVERTEX CATIMfWireFvertex
Student Notes:
Featurization Parameters (1/3)
its Support:
Determines which feature is used to look for the cell
its Duplication
keep the default mode
its Connexity
Copyright DASSAULT SYSTEMES
Student Notes:
Featurization Parameters (2/3)
Mode
Support
R
or
F
Initial F
Last
R
Selecting
Copyright DASSAULT SYSTEMES
Student Notes:
Featurization Parameters (3/3)
Build type:
MfTemporaryBody:
BRep feature will not be used in input for the procedural report
MfPermanentBody:
BRep feature will be used in input for the procedural report
In most cases,
MfPermanentBody is used for the feature which inherits from GSMGeom and
MechanicalFormFeature
MfTemporaryBody is used for MechanicalContextualFeature
Duplicate type:
This option should not be set
You have to keep the default mode MfNoDuplicateFeature
Connexity:
MfNoConnex
Copyright DASSAULT SYSTEMES
MfConnex
Student Notes:
Featurization Implementation
Mechanical Container
CATIGSMFactory
CATISpecObject
“Creates and aggregates
GSMOffset automatically”
CATIGSMOffset
Temporary Object
CATIMfBRep BRep CATIBRepAccess BRep Access
Feature
CATISpecObject Object
CATIFeaturize
“Creates”
MfNoDuplicateFeature);
MfNoDuplicateFeature);
Student Notes:
Featurization by CATFeatureImportAgent (1/2)
Student Notes:
Featurization by CATFeatureImportAgent (2/2)
New context
Offset feature
External reference
…
CATISpecObject_var spSO = _pAgentSelect GetElementValue();
Student Notes:
Exercise Presentation (Optional)
Screw : Fifth part
Student Notes:
CAA V5 Knowledgeware:
Parameters and Relations
You will learn what are the programming aspects around the Knowledgeware
Products
Literal Features
Copyright DASSAULT SYSTEMES
Student Notes:
Knowledge Modeler (1/2)
Dedicated to create and manipulate knowledge objects : parameters,
formula or design table.
Provides :
basic features such as Length, Weight, … with their corresponding units
More complex features.
Formulas edition.
Student Notes:
Knowledge Modeler (2/2)
Allows to create relations between Knowledgeware parameters
Different kind of relations
Design tables (based on Excel or text files).
Formula, rule, and check based on Knowledgeware language and on all types of parameters.
Sets of Equations
Set of predefined functions (mathematical, string, tables,…).
: KnowledgeInterfaces.
Student Notes:
Literal Features (1/2)
The Literal Feature
Models the value taken by a given instance of a given type.
ex: 3mm, “Hello world”
A unit can be associated
Used to be referenced within a Relation
ex: PartBody.1\Hole.1\Radius
Student Notes:
Literal Features (2/2)
Literal Features are created with the CATICkeParmFactory
Simple Type Parameters, such as Integer, real or String,
Dimension Type Parameters, such as Length or Angle,
Magnitude Type Parameters, such as dimensions
Enumerated Type Parameters
Student Notes:
Literal Features Architecture
Any Feature
CATICkeParmFactory
Container
« Creates »
CATICkeParm
CATIParmAsStored
Literal
CATICkeInst
CATIParmEvents
String, integer, …
* ,1
Manipulator CATIParmManipulator
Define the range
of values
Magnitude CATICkeMagnitude
Length, time, …
Unit CATICkeUnit
Meter, centimeter, …
Student Notes:
Main Interfaces for Parameter and Value Management
CATICkeParm
Parameter management in MKSA (meters-kilos-seconds-ampere) when dealing
with values
CATIParmAsStored
Value management in model unit (mm and degree)
CATICkeInst
Value management (conversions)
CATIParmEvents
Add subscription to parameter events:
Changed Value
Renamed parameter
Changed Visualization when visibility changes, user access changes,
driving relation is set or unset, activated or deactivated, current unit
changes
Deleted parameter
Copyright DASSAULT SYSTEMES
CATIParmManipulator
Associated with one or several parameters
CATICkeParm::SetManipulator (const CATIParmManipulator_var )
Student Notes:
Parameter code example
CATICkeParmFactory
CATICkeParmFactory*piParamFactory
*piParamFactory==NULL;
NULL;
hr = piSpecCont->QueryInterface( IID_CATICkeParmFactory,
hr = piSpecCont->QueryInterface( IID_CATICkeParmFactory,
(void
(void**)
**)&&piParamFactory);
piParamFactory);
////Create
CreateaaLength
Lengthtype
typeparameter:
parameter:Radius
Radius
////The
The radius is described by a lengthtype
radius is described by a length typeparameter
parameter
////Default unit is MKS unit i.e. millimeters
Default unit is MKS unit i.e. millimeters
double
doubleRadiusValue
RadiusValue==2.5;
2.5;
CATICkeParm_var
CATICkeParm_varspRadius
spRadius==piParamFactory->CreateLength("Radius",
piParamFactory->CreateLength("Radius",
RadiusValue
RadiusValue););
CATICkeFunctionFactory_var
CATICkeFunctionFactory_var FunctionFactory=
FunctionFactory=NULL_var;
NULL_var;
FunctionFactory=
FunctionFactory= CATCkeGlobalFunctions::GetFunctionFactory(); ;
CATCkeGlobalFunctions::GetFunctionFactory()
FunctionFactory->AddToCurrentParameterSet(
FunctionFactory->AddToCurrentParameterSet(spRadius);
spRadius);
Copyright DASSAULT SYSTEMES
Student Notes:
Parameter Editor Management
A Parameter Editor allows to modify the value of a parameter associated to
it.
You can then attach the parameter editor to a parameter and customize its
frame.
CATIParameterEditorFactory CATApplicationFrame
CreateParameterEditor() method
creates a standard parameter editor
Copyright DASSAULT SYSTEMES
Student Notes:
Parameter Editor integration in a Panel
CATIParmManipulator_var
CATIParmManipulator_varspManipOnParm
spManipOnParm==piParamFactory->
piParamFactory->
CreateParmManipulator();
CreateParmManipulator();
spManipOnParm
spManipOnParm->SetAccurateRange
->SetAccurateRange(0.5,1,5,1);
(0.5,1,5,1);
spRadius
spRadius ->SetManipulator (spManipOnParm););
->SetManipulator (spManipOnParm
CATApplicationFrame
CATApplicationFrame**pAppFrame
pAppFrame==CATApplicationFrame::GetFrame
CATApplicationFrame::GetFrame();();
CATIParameterEditorFactory * piFactory = NULL;
CATIParameterEditorFactory * piFactory = NULL;
pAppFrame
pAppFrame->->QueryInterface
QueryInterface(IID_CATIParameterEditorFactory,(void
(IID_CATIParameterEditorFactory,(void**)&piFactory);
**)&piFactory);
CATIParameterEditor*
CATIParameterEditor*piEditor
piEditor==NULL;
NULL;
piEditorFactory->CreateParameterEditor
piEditorFactory->CreateParameterEditor(iParent
(iParent, ,"CAAParmEditor",
"CAAParmEditor",1,
1,piEditor
piEditor););
Create a standard parameter edition frame in a dialog
Copyright DASSAULT SYSTEMES
piEditor->
piEditor->SetEditedParameter(spRadius
SetEditedParameter(spRadius););
… Set the parameter to be edited by this
… parameter editor.
Student Notes:
Literal Features and Edition (1/2)
When you click on the icon, the characteristics of a feature are
displayed in the parameters list.
To benefit from this behavior, the feature and its paramameters must fulfill
two conditions:
The feature must implement CATIParmPublisher
Its attributes must be implemented as feature parameters
CATIParmValuator
Feature
CATIParmPublisher
LiteralFeature CATICkeParm
Student Notes:
Literal Features and Edition (2/2)
Example :
CATIParmPublisher_var
CATIParmPublisher_var spParmPub(spFillet);
spParmPub(spFillet);
CATLISTV(CATISpecObject_var)
CATLISTV(CATISpecObject_var)ListFound;
ListFound;
Copyright DASSAULT SYSTEMES
spParmPub->GetAllChildren(
spParmPub->GetAllChildren(CATICkeParm::ClassName()
CATICkeParm::ClassName(), ,ListFound);
ListFound);
Student Notes:
Relation
Relation
Defines a relation between one or several literals and how output values are
deduced from input ones.
Design Table
A relation type for which input is always an integer literal serving as an index in
a table for valuating n other output literals.
Expressional Relation
Relation between literals described by a language
Formula : valuates one literal from other one(s)
Rule : valuates several literals from other one(s)
Check : uses several literals as input and produces a diagnosis.
Copyright DASSAULT SYSTEMES
Student Notes:
Relation Management Literal CATIRelationEvents
KnowledgeRelation CATICkeNaming
CATICkeRelation
« Creates »
CATICkeParmFactory
RelationExpressionnelle CATICkeRelationExp
RelationExpProg
RelationExpForm
« Creates »
CATICkeRelationFactory
Copyright DASSAULT SYSTEMES
Law CATICkeLaw
DesignTable CATIDesignTable
Student Notes:
Relation creation sample (1/2)
////Get
Getthe
theParam
Paramdictionary
dictionary
CATIParmDictionary_var
CATIParmDictionary_varspParamDictionary
spParamDictionary==NULL_var;
NULL_var;
spParamDictionary = CATCkeGlobalFunctions::GetParmDictionary();
spParamDictionary = CATCkeGlobalFunctions::GetParmDictionary();
////Get
GetParam
ParamFactory
Factory
CATICkeParmFactory_var
CATICkeParmFactory_varspParamFactory
spParamFactory==spSpecCont;
spSpecCont;
////Creating
Creatingobject
objectreference
referencefrom
fromselecting
selectingfeature
feature
CATICkeParm_var spiSurfaceRef = NULL_var;
CATICkeParm_var spiSurfaceRef = NULL_var;
spiSurfaceRef
spiSurfaceRef==spParamFactory
spParamFactory->CreateObjectReference(spiSurfaceAsSpec);
->CreateObjectReference(spiSurfaceAsSpec);
////Retrieving
RetrievingAREA
AREAmagnitude
magnitude
CATICkeMagnitude_var
CATICkeMagnitude_varspiSurfaceMagnitude
spiSurfaceMagnitude==NULL_var;
NULL_var;
spiSurfaceMagnitude = spParamDictionary ->FindMagnitude("AREA");
spiSurfaceMagnitude = spParamDictionary ->FindMagnitude("AREA");
////Creating
Creating&&aggregating
aggregatingparameter
parameter
CATICkeParm_var
CATICkeParm_var spResultParam==spParamFactory
spResultParam spParamFactory->CreateDimension(…)
->CreateDimension(…)
Copyright DASSAULT SYSTEMES
Student Notes:
Relation creation sample (2/2)
////Creating
Creatingformula
formula'
[F]Area'
'[F]Area'
CATCkeListOf(Parm)
CATCkeListOf(Parm)ListOfParm;
ListOfParm;
ListOfParm.Append
ListOfParm.Append (spiSurfaceRef););
(spiSurfaceRef
CATICkeRelation_var
CATICkeRelation_varspAreaAsRelation
spAreaAsRelation==NULL_var;
NULL_var;
spAreaAsRelation = spParamFactory ->CreateFormula("[F]Area",
spAreaAsRelation = spParamFactory ->CreateFormula("[F]Area", //Name
//Nameofofthe
theformula
formula
"",
"", // blank
// blank
"",
"", ////blank
blank
spResultParam ,
spResultParam , // constrainedparameter
// constrained parameter
&ListOfParm,
&ListOfParm, //// Parameters usedininform.
Parameters used form.
"area(a1)",
"area(a1)", // formula expression where
// formula expression where
aiaicorresponds
correspondstotorank
ranki iobject
objectininparameter
parameterlist.
list.
NULL_var,
NULL_var, ////NULL_var
NULL_var
CATCke::False); // False
CATCke::False); // False
////Get
Getthe
theFunction
Functionfactory
factory
CATICkeFunctionFactory_var
CATICkeFunctionFactory_var spFunctionFactory=
spFunctionFactory=NULL_var;
NULL_var;
FunctionFactory=
FunctionFactory= CATCkeGlobalFunctions::GetFunctionFactory(); ;
CATCkeGlobalFunctions::GetFunctionFactory()
AddToCurrentRelationSet allows you to aggregate the
////Init
Initthe
theKware
KwareLibraries
LibrariesMethods
Methods formula, so keep it persistent and so it can be seen in
spFunctionFactory->Methods();
spFunctionFactory->Methods(); the specification tree
Copyright DASSAULT SYSTEMES
spFunctionFactory
spFunctionFactory->AddToCurrentRelationSet
->AddToCurrentRelationSet(spAreaAsRelation
(spAreaAsRelation););
Student Notes:
Parameter and Relation Set
Parameter Set
Creates a Parameter Set viewed as a Parameter Publisher.
CATICkeRelationFactory:: CreateParameterSet
Relation Set
Creates a Relation Set viewed as a Parameter Publisher.
CATICkeRelationFactory:: CreateRelationSet
Copyright DASSAULT SYSTEMES
Student Notes:
Knowledge Expert (KnowHow) Architecture
ReportObject CATIReportObject
Any Feature
GenericRule CATIGenericRule Container
BaseComponent BaseComponent
« Creates »
CATIRuleBaseFactory
RuleSetComponent CATIRuleSet
RuleBase CATIRuleBase
« Creates »
RuleBase CATIRuleBaseComponent
Component
Copyright DASSAULT SYSTEMES
Check CATICheck
Rule CATIRule
Student Notes:
Knowledge Expert Management [KnowHow] Interfaces (1/2)
CATICheck
Defining the basic possibilities of an Expert Check which goal is to check a condition
over a kind of objects
CATICheckReport
Retrieving information on the check
CATIGenericRuleBaseComponent
Defining the basic properties of the Knowledge Expert hierarchy of RuleBase, RuleSets,
Checks and Rules.
CATIReportObject
Dedicated to the Behavior of an Element of a Report.
CATIRule
Describing Expert Rules
CATIRuleBase
Copyright DASSAULT SYSTEMES
Student Notes:
Knowledge Expert Management [KnowHow] Interfaces (2/2)
CATIRuleBaseComponent
Describing the common contents of leaf nodes of the Knowledge Expert
hierarchy.
CATIRuleBaseFactory
Describe the Factory for Creation of RuleBases, RuleSets, Rules and Checks.
CATIRuleSet
Dedicated to elementary operations on a Rule Set.
Copyright DASSAULT SYSTEMES
Student Notes:
Exercise Presentation
Literal Volume Formula Creation in Interactive Mode.
And now practice on the 5 steps of the exercise, to learn about:
Initialization of Knowledgeware Tools
Create an Object Reference from the CATBody and GetBack a Parameter
Create a Volume type parameter
Create a Formula which calculates the Volume
Update the Relation for seeing Result
Dev
Copyright DASSAULT SYSTEMES
Student Notes:
You will learn what are the CATIA Product Structure and Assembly capabilities,
and which frameworks are involved to provide them.
Student Notes:
CATIA Product Structure and Assembly Objectives
Define the structure of a final product
A product is constituted by components.
These components can be a part (an atomic element) or another product (a sub-
assembly).
It manages different types of document to represent a component.
Components can be set in position to each other.
Provide also the capability to integrate data linked to the Product Structure
Student Notes:
The CATProduct Document overview
CATProduct CATIDocRoots
Product Container
The Product Container contains :
Root Product
ASMProduct (Root)
Instances Product
Assembly container (constraints)
ASMProduct
ASMProduct Instances
ASMProduct
Assembly Container
Constraint Constraint
Copyright DASSAULT SYSTEMES
Constraint Constraint
Student Notes:
Product Instance and Reference Product
CATPart
BRep Container
CATProduct
“BRep access”
Product Container
CGM Container
“Topological object”
ASMProduct (Root)
Student Notes:
Product Structure : ASMPRODUCT Feature
Reference Products and
Product Instances are
ASMPRODUCT features
properties of a product
Student Notes:
Product Structure : Root Feature
Retrieve the Root Product feature
CATDocument
CATDocument**pDoc
pDoc==NULL;
NULL;
rcrc==CATDocumentServices::New("Product",pDoc);
CATDocumentServices::New("Product",pDoc); The CATProduct document implements
the CATIDocRoots interface.
CATIDocRoots
CATIDocRoots**piDocRoots
piDocRoots==NULL;
NULL;
rcrc==pDoc->QueryInterface(IID_CATIDocRoots,
pDoc->QueryInterface(IID_CATIDocRoots,(void**)
(void**)&piDocRoots);
&piDocRoots);
Student Notes:
Product Structure : CATIProduct Interface
Instantiate an existing Reference Product
Open the existing document
Retrieve the Root Product feature of this document
Use it as the argument of the AddProduct method of the CATIProduct interface
It returns a Product Instance
CATIProduct_var AddProduct(CATIProduct_var
CATIProduct_varAddProduct( CATIProduct_var&&iProduct,
iProduct,
const
const CATIContainer_var&&iCont=NULL_var)
CATIContainer_var iCont=NULL_var)
CATIProduct_var AddProduct(const
CATIProduct_varAddProduct( constCATUnicodeString
CATUnicodeString&&iString,
iString,
const
const CATIContainer_var & iCont==NULL_var)
CATIContainer_var & iCont NULL_var)
Student Notes:
Product Structure : Product Context
When the product tree has more than 2 levels, some product instances will
exist in different contexts
A context is associated to a root product
Product A Product B
PartA.1
CATIProduct_var FindInstance(const
CATIProduct_var FindInstance( constCATIProduct_var
CATIProduct_var&&iProduct
iProduct) )
Student Notes:
Product Structure : Connectors introduction
Assembly constraints
…
Student Notes:
Product Structure : Connectors architecture
CATProduct CATPart
Assembly Container
Copyright DASSAULT SYSTEMES
Constraint CreateConstraint()
Create
Point on connectors or publications
global method
Student Notes:
Product Structure : CATIConnector Use
CATIProduct_var
CATIProduct_var spLeafProduct
spLeafProduct==Path
Path->FindElement(CATIProduct::ClassId());
->FindElement(CATIProduct::ClassId());
......
CATIConnector_var
CATIConnector_varspConnector;
spConnector;
spLeafProduct->AddConnector(spLinkable,
spLeafProduct->AddConnector(spLinkable,spConnector);
spConnector);
Copyright DASSAULT SYSTEMES
Student Notes:
Product Structure : CATIConnector Use (2/2)
Create a Constraint using connectors
....
....
CATLISTV(CATBaseUnknown_var)
CATLISTV(CATBaseUnknown_var) ConnectorList;
ConnectorList;
ConnectorList1.Append(spConnector1);
ConnectorList1.Append(spConnector1);
ConnectorList1.Append(spConnector2);
ConnectorList1.Append(spConnector2);
CATICst*piConstraint=NULL;
CATICst* piConstraint=NULL;
HRESULT
HRESULTResCstCreation=CreateConstraint(
ResCstCreation=CreateConstraint(catCstTypeOn,
catCstTypeOn,
ConnectorList,
ConnectorList,
NULL,
NULL,
spRootProductOfProduct,
spRootProductOfProduct,
&piConstraint);
&piConstraint);
Copyright DASSAULT SYSTEMES
Student Notes:
Product Structure: Publications
Student Notes:
Product Structure: CATIPrdObjectPublisher Use
....
....
See previous slides
CATIConnector
CATIConnector**ConnectorOnObjectToPublish
ConnectorOnObjectToPublish==……;
……;
....
....
Retrieve the product that wants publish an
CATIProduct_var
CATIProduct_varmyProduct
myProduct==……;
……; object
…..
…..
CATIPrdObjectPublisher_var myPublisher
CATIPrdObjectPublisher_var myPublisher==myProduct;
myProduct;
CATUnicodeString
CATUnicodeStringNameOfPublication=
NameOfPublication=“Face”;
“Face”;
myPublisher
myPublisher-> Publish(&NameOfPublication,(CATBaseUnknown
->Publish(&NameOfPublication, (CATBaseUnknown*)*)ConnectorOnObjectToPublish);
ConnectorOnObjectToPublish);
Copyright DASSAULT SYSTEMES
Student Notes:
Exercise Presentation
Product Structure & Assembly Exercise
And now practice on two exercises, to learn about:
Student Notes:
Programming Rules
C++ Source Checker: mkCheckSource
Test Tool: mkodt
Documentation Generation: mkMan
Copyright DASSAULT SYSTEMES
Student Notes:
CAA V5 Development Environment Quality Control Objectives
Know the C++ programming rules used by Dassault Systemes. It helps to
avoid naming conflicts of source files, Feature late types and to make the
code more readable by other developers or Hotline team.
Put in place some basic tests of your application to detect before a new
version’s delivery some potential impacts of some code modifications. That
guarantees data stability.
Copyright DASSAULT SYSTEMES
Student Notes:
CAA V5 C++ Programming Rules
That includes:
Naming convention
C++ Naming rules
C++ coding rules
Java coding rules
Architecture rules
User Interface look and feel
Copyright DASSAULT SYSTEMES
Student Notes:
CAA V5 Naming Convention
Naming conventions
To avoid name collisions between the entities that can be found together in the
same repository at run time.
Names are constituted by English names, each one starting with an uppercase.
Student Notes:
General rules
Variable names begin with a lowercase letter (int counter;)
* and & are to be collated to the variable name, not the type name, in order
to avoid ambiguities in case of multiple definitions on the same line
(V5Object *pFirstItem, *pSecondItem;)
Data members are to begin with an underscore (int _length). Data members
should never be assigned public (in the C++ sense) visibility
Copyright DASSAULT SYSTEMES
Student Notes:
Lifecycle Rules
Always initialize your pointers to NULL.
Student Notes:
C++ Source Checker: mkCheckSource
mkCheckSource (C++ Source Checker) is a C++ static controller which
analyzes a program and tries to discover potential defects or logical errors
without executing the program.
Student Notes:
mkCheckSource CAA wizard
Copyright DASSAULT SYSTEMES
Student Notes:
Other Tools used in the CAA V5 context
Rational Purify
A tool to detect any memory leak and to be used with mkodt
For example, classical detected errors are writing or reading a non allocated
block or reading an uninitialized memory block.
Student Notes:
Test Tool: mkodt
Like for development tasks, tests activities can take place in your
environment.
Batch Test
These test object are created in a special framework (with .tst extension)
and launch thanks to a shell.
Copyright DASSAULT SYSTEMES
Student Notes:
Test Framework Architecture
TSTFW.tst Framework test
TSTMod1.m
Executable module for batch test
TSTModi.m
TSTModn.m
src Batch program
Batch.cpp
FunctionTests
TestCases TSTModi.sh Shell launch with the
mkodt –s command
SwitchTestCases TestRecordi.sh
Which run test object.
InputData
TestRecord1.rec
Folder containing
Contains any data TestRecordi.rec the interactive test
required by shells TestRecordn.rec
capture.env
Contains any Files containing the
capture.rec interactive scenario
reference data
to check what capture.ver
Text file describing the
Copyright DASSAULT SYSTEMES
is produced TestRecordn.txt
interactive scenario
OutputRef
Output TSTModi.traces
OS_a Error traces
TestRecordi.traces
Student Notes:
Shell: Basic Sample
Shell variables are automatically set according to the current test
environment
SetOdtParam
SetOdtParamTYPE=RECORD
TYPE=RECORD
Record shell CNEXT
CNEXT
Student Notes:
Shell: Example
Student Notes:
Shell: Environment Variables
ADL_ODT_TMP
(Read only) References a temporary directory, for instance /tmp on Unix and
C:\TEMP on Windows.
ADL_ODT_IN
(Read only) References a directory where all data needed as input for a
program are stored.
ADL_ODT_OUT
(Read/write) References an output directory where any output data can be
stored
ADL_ODT_REF
(Read only) References a directory where reference data are stored. Reference
data are data used to compare what a program produces with what should be
produced....
ADL_ODT_NULL
(Read only) References a special file which can be used to redirect outputs
from a program (/dev/null with Unix or NUL with Windows.)
ADL_ODT_CONCATENATION
Copyright DASSAULT SYSTEMES
Student Notes:
Shell: SetOdtParam Instruction
A shell can include the SetOdtParam instruction to control some aspects of
its execution
SetOdtParam max_time=xx
max_time is the maximum time allowed for test to be completed. The default
value of max_time is 5 minutes.
SetOdtParam Replay_xxxx=NO
xxxx can be AIX, IRIX, SunOS, HP-UX, Unix, Windows_NT, aix_a, irix_a,
solaris_a, hpux_a, intel_a.
SetOdtParam USER=xxx
This instruction is used to specify the user (xxx) when the ODT will be replayed.
SetOdtParam ADL_ODT_XX=xxx
To valuate environment variables
Copyright DASSAULT SYSTEMES
Student Notes:
Shell: script rules
Forbidden Authorized
#!/bin/ksh #
No export of PATH, LIBPATH and ADL_ODT_xxx -
Don't use the rm and mv commands -
Don't use "/" in the PATH Use $ADL_ODT_SLASH
Don't use ":" in the PATH Use $ADL_ODT_SEPARATOR
Don't run process in background (process& ) -
No file Path: /myUser/… Use ADL_ODT_xxx variables
Don't use /tmp Use ADL_ODT_TMP
Don't use /dev/null Use ADL_ODT_NULL
- Test the return code
return xx exit xx
../../InputData (relative Path) Use ADL_ODT_xxx variables
/dir/WS/OS/code/bin/LOAD LOAD
Copyright DASSAULT SYSTEMES
Student Notes:
Interactive scenario
Interactive scenario is stored inside a folder called FW.tst\Inputdata\xxx.rec.
Inside this folder, you can create a text file to explain your interactive
scenario (it could be useful if you want to store again this scenario).
To finish your scenario, you have to click on file close and file exit (do not
save your document and do not use the cross icon).
Student Notes:
mkodt command
Run a Test: mkodt command
mkodt options:
Available by mkodt -h
mkodt
Copyright DASSAULT SYSTEMES
Student Notes:
mkodt options
-a
Replays all tests objects for a workspace, a framework, or a directory
TestCases or SwitchTestCases
-F framework
Specifies a framework directory or a list of framework directories of the
workspace
-k
Keeps the temporary directory set using ADL_ODT_TMP
-NOMaxTime
Disables the supervision of the ODT's execution time
-o output
Specifies an output directory and sets the ADL_ODT_OUT variable. Results of
mkodt ( .traces and .mkodt_results files) are generated in the directory
Output/Framework.tst/FunctionTests/Output/OSName
-s shell
Lists the shell script names to run
Copyright DASSAULT SYSTEMES
Student Notes:
mkodt options
-B debugger
Turns the debugger mode on and specifies the debugger to use. Useful with the
-b option. According to the operating system, available debuggers are (first one
is the default):
Solaris workshop, dbx
Irix cvd, dbx
AIX xldb, dbx
HP_UX dde
Windows msdev, purify, purcov
-b program
Uses the debugger on the given program. It must be a module or an EXE
containing a main.
Student Notes:
mkodt outputs
Traces window:
Demo Video
Student Notes:
Documentation Generation: mkmancpp
Interfaces, classes, and all the stuff they include, are documented thanks to
information enclosed into specific comments inserted in the header files.
/**
/**
*This
*Thisisisaacomment.
comment.
*/*/
At the top of the header file you have to put the following tags :
/**
/**
**@CAA2Level
@CAA2LevelL1
L1
**@CAA2Usage
@CAA2UsageU1U1
*/*/
The C++ statements and the comments are then processed to produce an
organized set of html files in which you and the users of your interfaces and
classes can navigate.
Copyright DASSAULT SYSTEMES
Student Notes:
MsDev Add-In
Copyright DASSAULT SYSTEMES
Student Notes:
Exercise Presentation
Development Environment Quality Control
And now practice two exercises, to learn about:
Run mkmancpp on the TSTScrewExercise
Create a TestCase (shell) in a test Framework
Create the Test Framework
Create a Batch Module
Create a Shell
Run mkodt command
Copyright DASSAULT SYSTEMES
Student Notes:
CAA V5 Administration
You will learn the CAA packaging, the prerequisites in order to use CAA and
how to deliver the applications built with CAA
Software Prerequisites
Student Notes:
CAA V5 Physical Packaging
Student Notes:
CAA V5 Installation Procedure
Check the CATIA installation
You need to have the same Release and Service Pack as for CAA
The directory path for CATIA mustn’t contains blank characters
Work with the same level of CATIA, CAA API and CAA RADE.
Installing CAA Service Pack update automatically the RADE service pack.
The Service Pack Management applies on CAA API and CAA RADE in the same way
as CATIA:
CAA API from CATIA Software Management Tool and the CAA API specific tab page
Start + Programs + Catia + Tools + Software Management
Copyright DASSAULT SYSTEMES
Student Notes:
UNIX/Windows same
capabilities
Student Notes:
Student Notes:
ENOVIA modelers
Student Notes:
QUALITY TESTING
Windows only
Enhance standard
capabilities with
Copyright DASSAULT SYSTEMES
additional products
Better visibility on
untested code
Copyright DASSAULT SYSTEMES
CAA V5 for CATIA - Getting Started
Student Notes:
Student Notes:
Student Notes:
Generated documentation
Allows customers to
publish their API
documentation
Copyright DASSAULT SYSTEMES
Student Notes:
Departement
Workspace
Collaborative and distributed across:
O.S. platforms
Enables concurrent
Workspace management
application
development
Hierarchical project integration
Software integration
support
Copyright DASSAULT SYSTEMES
Scalable
Reliability and
openness
Copyright DASSAULT SYSTEMES
CAA V5 for CATIA - Getting Started
Student Notes:
Ease-of-use
Copyright DASSAULT SYSTEMES
Maximizing resource
distribution
Student Notes:
CAA V5 Packaging and Portfolio
CAA-SCM CAA-SCM CAA-SCM CAA-SCM Add-on
CAA-ITC CAA-ITC CAA-ITC CAA-ITC Add-on CUT license is a necessary
CAA-CUT CAA-CUT CAA-CUT Add-on prerequisite to have ITC license
CAA-CSC CAA-CSC CAA-CSC Add-on
CAA-DMC Add-on
CAA-ABC CAA-CDV CAA-CDC CAA-TRC Configurations
CAA-CID CAA-CID
CAA-CDG CAA-CDG
CAA-CSC
Application Building
CAA-CUT CAA-TRM
RELEASE MGMT
Multi-Workspace
CAA-DMC
C++ Extended
TEAMWORK
Development
Development
Copyright DASSAULT SYSTEMES
C++ Base
Student Notes:
CAA V5 Licensing Mechanisms
CDC or CDV or TRC license is required to use CAA V5 RADE (C++)
CAA V5 can be used in two licensing modes just like standard DS products
Nodelock
Concurrent usage of licenses on a network.
Student Notes:
Delivering an Application On Windows (with the environment
editor)
You can use the Environment Editor to create a new environment:
Select Start + Programs + CATIA + Tools + Environment Editor
Then Environment / New and the following panel appear:
Environment Name
An icon (called MyEnv) will be created on your Windows Desktop which allow
you to launch CATIA with the others add-in.
Student Notes:
Delivering an Application On Unix (with the environment
editor)
You can also use the environment editor
To launch CATIA with the new environment, you can launch the following
command :
.. / B14 / OS / code / command / catstart –env myEnv –direnv myDirEnv
Copyright DASSAULT SYSTEMES
Student Notes:
Delivering an Application (without the environment editor)
Use the …\B14\OS_a\code\bin\setcatenv command to create a new
environment
The main options are :
-e : to specify the name of the new environment
-d: to specify the directory where the CATIA environments are stored
-p : to give the path
The path has to reference CATIA and the Runtime View of your CAA application
On Windows: setcatenv –e myEnv –d c : \ catia_v5 \ CATEnv –p c : \ catia_v5 ; c: \
myApplication1; c: \ myApplication2 ; …
On Unix: .. / B14 / OS / code / command / catstart –run “setcatenv –e myEnv –d / u / user /
CATEnv –p / u / catia_v5 : / u / user / myApplication1 : / u / user / myApplication2 : …”
If the path contains a blank character, use double quotes (")
Student Notes:
Runtime compatibility
Since V5R9 Dassault Systèmes insure le RunTime compatibility of client application.
Client do not need to recompile their application at each service pack
Compatibility between Release are not insure, client MUST recompile the application for
each Release
The L1 tag
Every Dassault Systèmes header file (provided with CAA) has some specific tags that
define it’s quality.
You can find more information about Dassault Systèmes tags in the Encyclopedia->Rade-
>Guides->CAA V5 Resources Usage
Automation interfaces
Dassault Systèmes doesn’t support Automation interfaces including in CAA V5 code
Student Notes:
Exercise Presentation
Development Environment
And now practice one exercise, to learn about:
Build a workspace in a shell window
Initialize the environment
Build the workspace
Launch CATIA
Copyright DASSAULT SYSTEMES
Student Notes:
Student Notes:
The product and part document
CATDocument CATDocument
CATPart CATIContainerOfDocument
“Mechanical Container”
“CGM Container”
“BRep Container”
“Product Container”
CATProduct CATIDocRoots
Copyright DASSAULT SYSTEMES
“Product Container”
“Assembly Container”
Student Notes:
Containers
CATIContainer
CATFeatCont CATICkeParmFactory
CATICkeRelationFactory
CATICstFactory
CATISketchFactory
CATIMechanicalRootFactory
“Merchanical Container”
CATIPrtFactory
CATIGSMFactory
CATIPrtContainer
CATICGMContainer
“CGM Container”
CATICstFactory
“BRep Container”
Copyright DASSAULT SYSTEMES
“Product Container”
“Assembly Container”
Student Notes:
Any features
CATISpecObject
LifeCycleObject
AnyFeature
CATIOsmExtendable
CATISpecAttrAccess
Copyright DASSAULT SYSTEMES
Student Notes:
Mechanical Root features
CATIMechanicalFeature
MechanicalFeature
CATIDescendants
CATIPrtPart
MechanicalPart
CATIPartRequest
HybridBody CATIMechanicalTool
CATIGSMTool
CATIBodyRequest
CATIMmiGeometricalSet
GSMTool CATIMmiOrderedGeometricalSet
CATIMmiNonOrderedGeometricalSet
Copyright DASSAULT SYSTEMES
CATISketch
Sketch CATI2DWFFactory
CATI2DConstraintFactory
Student Notes:
Surfacic and wireframe features
Input “Mechanical
CATIGSMFactory
attributes Container”
CATIBuild
“creates”
CATIGSMProceduralView GSMGeom
Student Notes:
Solid features
“Mechanical
ResultIN Input CATIPrtFactory
Solid Container”
specobject attributes
“creates”
CATIPrtProceduralView MechanicalShapeFeature
ResultOUT
Solid
specobject
Copyright DASSAULT SYSTEMES
Student Notes:
Drafting features
Drawing CATIDftDrawing
Sheet CATIDftSheet
1…N
view CATIDftView
2…N
0…N
“Generative results”
0…N
Annotations
“2D Geometries”
0…N
Constraints
CATISketch
Sketch CATI2DWFFactory
CATI2DConstraintFactory
Geometries”
View IDMxxx2D
“Generative
IDMxxx2D
Geometry”
Student Notes:
Tolerancing features
CATITPSSet
0…N
Annotation Set
CATITPSFactoryElementary
3D View CATITPSView
0…N
CATITPSComponent
CATITPSSemanticValidity
0…N
3D Annotation
CATITPSText
CATITPSDimension
CATITPS…
TTRS CATITTRS
0…N
Copyright DASSAULT SYSTEMES
Services CATITPSRetrieveServices
Factory CATITPSFactoryAdvanced
Student Notes:
ApplicationFrame architecture
Command
1,N
0,N
Frame Toolbar
0,N 1,N
Student Notes:
Dialog Architecture CATDialog
Containers Components
CATDlgWindow CATDlgNotify
CATDlgNotify
CATDlgControl
CATDlgFile
CATDlgFile
CATDlgDocument
CATDlgDocument
CATDlgDialog
CATDlgDialog
CATDlgPushButton
CATDlgPushButton
CATDlgContainer CATDlgRadioButton
CATDlgRadioButton
CATDlgContainer
CATDlgBox CATDlgSplitter CATDlgCheckButton
CATDlgCheckButton
CATDlgSplitter
CATDlgTabContainer
CATDlgTabContainer CATDlgSelectorList
CATDlgSelectorList
CATDlgTabPage
CATDlgTabPage CATDlgIMultiList
CATDlgIMultiList
CATDlgFrame
CATDlgFrame CATDlgCombo
CATDlgCombo
CATDlgIconBox
CATDlgIconBox CATDlgMenuItem CATDlgEditor
CATDlgEditor
CATDlgMenu CATDlgSpinner
CATDlgSpinner
CATDlgBarMenu
CATDlgBarMenu
CATDlgSlider
CATDlgSlider
CATDlgSubMenu
CATDlgSubMenu CATDlgPushItem
CATDlgPushItem
CATDlgScrollBar
CATDlgScrollBar
CATDlgContextualMenu
CATDlgContextualMenu CATDlgRadioItem
CATDlgRadioItem
CATDlgSeparator
Copyright DASSAULT SYSTEMES
CATDlgSeparator
CATDlgBar CATDlgCheckItem
CATDlgCheckItem
CATDlgLabel
CATDlgLabel
CATDlgToolBar
CATDlgToolBar CATDlgSeparatorItem
CATDlgSeparatorItem CATDlgProgress
CATDlgProgress
CATDlgStatusBar
CATDlgStatusBar
Student Notes:
Visualization architecture
VIEWER:
AddViewPoint()
Object allowing to navigate CATViewer
inside the visualized model and
to define the visualization mode.
CATViewPoint
VIEW POINT:
AddRep()
View point of the user on
the model CAT3DViewPoint CAT2DViewPoint
AddRep()
CATRep
AddChild()
REPRESENTATION:
CAT3DLineRep
Define the positioning and
the graphic attributes CAT2DLineRep
CAT3DCustomRep CAT3DPlanRep
CAT2DCustomRep CAT2DPointRep CAT3DBagRep
CATSurfacicRep … CAT2DBagRep
AddGP()
CATGraphicPrimitive
AddGP()
Visualized. CAT2DRectangle
CAT2DAnnotationTextGP
CAT3DMarkerGP
CAT3DAnnotationTextGP
…
CAT2DFixedArrow
CAT3DFixedArrow
…
Student Notes:
CGM architecture Objects in this
diagram are only
interfaces, even if
Contains they do not respect
CATICGMObject
the interface naming
CATICGMContainer convention: CATIXXX
CGM Creates
container
CATGeoFactory CATGeometry CATLaw
CATMacroPoint
CATCartesianPoint
CATTopology CATPoint CATPointOnCurve
CATPointOnSurface P is for
Parametric
CATConic
CATDomain CATTopObject CATLine CATPLine
CATNurbsCurve CATPCircle
CATCurve CATSplineCurve CATPEllipse
CATIForeignCurve CATPHyperbola
CATPCurve CATPParabola
CATBody CATCell CATEdgeCurve CATPNurbs
CATLump
CATShell
CATLoop CATElementarySurface
CATIForeignSurface
Copyright DASSAULT SYSTEMES
CATWire CATVolume
CATVertexInFace CATFace CATNurbsSurface
CATVertexInVolume CATEdge CATSurface CATOffsetSurface
CATVertex CATPlane
CATRevolutionSurface
CATTabulatedCylinder
Student Notes:
Body, Cell and Domain Relationship
CATBody
CATDomain CATCell
CATShell 1,*
CATFace
CATLoop 1,*
1,* CATEdge
CATVertexInFace
1
2
CATWire CATVertex
CATVertexInVolume
Copyright DASSAULT SYSTEMES
CATMacroPoint Associated
Geometry
CATEdgeCurve
CATSurface
Student Notes:
BRep Access Interfaces
CATIRSur
CATIREdge
CATIREdgeAccess CATIBorderREdge
CATIBRepAccess CATIWireREdge
CATIFVertex
CATIFVertexAccess CATIWireFVertex
Copyright DASSAULT SYSTEMES
CATIBorderFVertex
Student Notes:
BRep Feature Architecture
GeometricalSubElement CATIMfBRep
“Featurize”
FeatureREDGE CATIMfRedge
FeatureFEDGE CATIMfFedge
FeatureBORDERREDGE CATIMfBorderRedge
FeatureWIREREDGE CATIMfWireFvertex
FeatureFVERTEX CATIMfFvertex
FeatureBORDERFVERTEX CATIMfBorderFvertex
Copyright DASSAULT SYSTEMES
FeatureWIREFVERTEX CATIMfWireFvertex
Student Notes:
Literal Features Architecture
Any Feature
CATICkeParmFactory
Container
« Creates »
CATICkeParm
CATIParmAsStored
Literal
CATICkeInst
CATIParmEvents
String, integer, …
* ,1
Manipulator CATIParmManipulator
Define the range
of values
Magnitude CATICkeMagnitude
Length, time, …
Unit CATICkeUnit
Meter, centimeter, …
Student Notes:
Relation architecture Literal CATIRelationEvents
KnowledgeRelation CATICkeNaming
CATICkeRelation
« Creates »
CATICkeParmFactory
RelationExpressionnelle CATICkeRelationExp
RelationExpProg
RelationExpForm
« Creates »
CATICkeRelationFactory
Copyright DASSAULT SYSTEMES
Law CATICkeLaw
DesignTable CATIDesignTable
Student Notes:
Knowledge Expert (KnowHow) Architecture
ReportObject CATIReportObject
Any Feature
GenericRule CATIGenericRule Container
BaseComponent BaseComponent
« Creates »
CATIRuleBaseFactory
RuleSetComponent CATIRuleSet
RuleBase CATIRuleBase
« Creates »
RuleBase CATIRuleBaseComponent
Component
Copyright DASSAULT SYSTEMES
Check CATICheck
Rule CATIRule
Student Notes:
Connectors and publication architecture
CATProduct CATPart
Assembly Container
Copyright DASSAULT SYSTEMES
Constraint CreateConstraint()
Create
Point on connectors or publications
global method