Equipment & Systems Engineering |
Electrical Harness Flattening |
Arranging junctionsHow to arrange junctions |
Use Case |
AbstractThis article discusses the ElecFlatteningItf use case. This use case explains how to arrange junctions |
This use case is intended to help you make your first steps in programming with CATIA EHF Interfaces. Its main intent is to allow you to arrange junctions.
[Top]
CAAEhfUIPArrangeJunction.m is a use case of the CAAElecFlatteningItf.edu framework that illustrates the CATIA EHF Interfaces framework capabilities.
[Top]
The goal of CAAEhfUIPArrangeJunction use case is to show how to arrange junctions.
[Top]
To launch CAAEhfUIPArrangeJunction , you will need to set up the build time environment, then compile CAAEhfUIPArrangeJunction along with its prerequisites, set up the run time environment, and then execute the sample.
To launch the use case, execute the following command:
mkrun
Open Extr_Flat.CATProduct
Under Windows, the path would indicate: 'WS'\intel_a\resources\graphic\ModelArrangeJunction directory.
[Top]
The CAAEhfUIPArrangeJunction sample is made of a single class named CAAEhfUIPArrangeJunction located in the CAAEhfUIPArrangeJunction.m module of the CAAElecFlatteningItf.edu framework:
Windows | InstallRootDirectory\CAAElecFlatteningItf.edu\CAAEhfUIPArrangeJunction.m\ |
Unix | InstallRootDirectory/CAAElecFlatteningItf.edu/CAAEhfUIPArrangeJunction.m/ |
where InstallRootDirectory
is the directory where the CAA CD-ROM
is installed.
This sample deals with the following classes:
CATMathVector | Class representing a mathematical vector in 3D |
CATMathLine | Class representing a mathematical line in 3D |
CATMathTransformation | Class representing a mathematical transformation in 3D |
CATMathPoint | Class representing a mathematical point in 3D |
[Top]
------------------------------------------
We will now comment all the steps. There are 10 logical steps :
[Top]
... if (( 2 > NbVectors ) || ( 2 > NbExtremities )) { retCode = E_FAIL; goto EscapeWay; } ... |
[Top]
... iFlatteningPlane.GetNormal(Normal); iFlatteningPlane.GetOrigin(Origin); ... |
[Top]
.... pRotationAxis = new CATMathLine(Origin,Normal); if (NULL == pRotationAxis) { retCode = E_FAIL; goto EscapeWay; } .... |
[Top]
.... RefVector = *(ioListOfDirections[1]); .... |
.... for (Index = 1; Index <= NbVectors; Index++) { delete ioListOfDirections[Index]; ioListOfDirections[Index] = NULL; } ioListOfDirections.RemoveAll(); .... |
.... pVector = new CATMathVector(RefVector); if (NULL == pVector) { retCode = E_FAIL; goto EscapeWay; } ioListOfDirections.Append(pVector) ; pVector = NULL; .... |
[Top]
... Angle = 15 * (Index-1); //Convert into Radians, because, CATMathTransfo need Radian Angle = Angle * CATDegreeToRadian ; pRotation = new CATMathTransformation(Angle, *pRotationAxis) ; if (NULL == pRotation) { retCode = E_FAIL; goto EscapeWay; } ... |
[Top]
.... pVector = new CATMathVector ((*pRotation) * RefVector); if (NULL == pVector) { retCode = E_FAIL; goto EscapeWay; } pVector->Normalize() ; .... |
[Top]
.... ioListOfDirections.Append(pVector) ; .... |
[Top]
.... delete pRotation; pRotation = NULL; .... |
[Top]
This use case has demonstrated the way to arrange junctions.
[Top]
Version: 1 [January 2007] | Document Created |
[Top] |
Copyright © 2007, Dassault Systèmes. All rights reserved.