3D PLM PPR Hub Open Gateway |
Knowledge Modeler |
Using ManipulatorsHow to create a manipulator and associate it with a literal |
Use Case |
AbstractThis article explains how to associate a manipulator with a literal. |
In this use case, you will learn to create a manipulator and specify its value range.
[Top]
When editing a parameter, right-clicking the value field displays a
contextual menu which provides you with commands to help you select the value
to be assigned to a parameter.
When you modify the parameter value, you use the use the arrows to increment or decrement the amount to be specified. This object which appears to the end user as up and down arrows is called a spinner. The object which describes how the spinner behaves is called a manipulator.
You can describe a manipulator as an object which has bounds, which increments or decrements its value by a certain number of the appropriate units etc., but a manipulator is only meaningful when applied to a parameter.
The manipulator dictates the lower and upper bounds of the parameter value (Range command in the contextual menu), the number of steps to be memorized by the system when you add a new step from the Change Step command or a list of authorized values for multiple-value parameters.
Other data related to parameters (tolerance, measure and comments) are not controlled by manipulators.
[Top]
CAALifParametersMani is a use case of the CAALiteralFeatures.edu framework that illustrates KnowledgeInterfaces framework capabilities.
[Top]
The CAALifParametersMani sample:
[Top]
To launch CAALifParametersMani, you will need to set up the build time environment, then compile CAALifParametersMani along with its prerequisites, set up the run time environment, and then execute the use case [1].
[Top]
The CAALifParametersMani use case is located in:
Windows | InstallRootDirectory\CAALiteralFeatures.edu\CAALifParameters.m\ |
Unix | InstallRootDirectory/CAALiteralFeatures.edu/CAALifParameters.m/ |
where InstallRootDirectory
is the directory where the CAA
CD-ROM is installed.
The CAALifParametersMani is in the CAALifParametersMani .cpp file. The main program related to this file is CAALifParametersMain.
[Top]
The CAALifParametersMani use case is made up of eight steps:
[Top]
// Create a manipulator CATICkeParmFactory_var spFact = cont; CATIParmManipulator_var spManip = spFact->CreateParmManipulator (); |
A manipulator is created by using the CATICkeParmFactory::CreateParmManipulator method which returns a CATIParmManipulator.
[Top]
Code to Provide |
A manipulator is not persistent. In a global application, you have to create it the first time you enter the editor.
[Top]
// Specify the manipulator range spManip->SetAccurateRange (10,1,20,2); |
The lower and upper bounds of the manipulator are specified.
The CATIParmManipulator::SetAccurateRange takes as its arguments:
[Top]
The "lengthParam" length type parameter is created [2].
[Top]
... s->ValuateStored (15); ... |
The "lengthParam" parameter is assigned a value in model unit. Let's remind you that the model unit for length is the mm.
This means that the parameter value is 15 mm.
[Top]
Code to Provide |
A test is performed to determine whether the value 10 is authorized. Normally, it should be.10 is the lower bound but the lower bound has been specified as a possible value. The value returned by the CATIParmManipulator::TestValue method is described by the enum below:
enum TestRC { Ok =0, MinReached =1, NotInEnum =3, // only for enumerated type NotAuthorized =4 // value type is wrong }; |
0 is returned.
[Top]
Another test is performed to determine whether the value 21 is authorized. Normally, it should not be as 21 is beyond the upper bound. The value returned by CATIParmManipulator::TestValue is 2 indicating that the upper bound has been overtaken.
[Top]
Testing a value does not mean that the value is applied to the parameter. Now, the value 10 is assigned to "lengthParam". Displaying the actual parameter value gives 10.
The value 20 is assigned to "lengthParam". Displaying the actual parameter value gives 10, the last authorized value assigned to the parameter.
[Top]
A manipulator allows you to define how the parameter values can be specified in terms of bounds, increment/decrement amounts, steps to be memorized. A manipulator is to be associated with a parameter.
[Top]
[1] | Building and Launching CAA V5 Samples |
[2] | Using Persistent Parameters |
[Top] |
Version: 1 [Jun 2000] | Document created |
[Top] |
Copyright © 2000, Dassault Systèmes. All rights reserved.