GMModelInterfaces Interface CATCGMPickOperator
Usage: an implementation of this interface is supplied and you must use it as is. You should not reimplement it.
interface CATCGMPickOperator
Picking operator.
Given one or more CATBody
s and a ray defined by a view point and a direction, the picking
operator finds the CATBody and the geometry (CATGeometry
) intersected by the ray.
Method Index
- o
AddAnotherInstanceOfPreviousBody(CATMathTransformation&,void*)
- This method can be called any number of times, after any/every call to AddBody().
- o
AddBody(CATBody&,CATMathTransformation&,void*,double,double,double)
- Adds a body to the picking operator.
- o
GetApertureRadius(double&)
- Gets the currently set aperture radius of picking.
- o
GetOnlyFirstHit(CATBoolean&)
- Gets the current state of the "OnlyFirstHit" option
Refer "SetOnlyFirstHit" for more details on this option
- o
GetResult(CATCGMPickOperatorResultIterator*&)
- Returns the results of picking.
- o
Run(CATMathPoint&,CATMathDirection&)
- Runs the picking operator.
- o
SetApertureRadius(double)
- Sets the aperture radius of picking.
- o
SetOnlyFirstHit(CATBoolean)
- Enables or disables the pick operator to pick only the first hit object(s).
Methods
o AddAnotherInstanceOfPreviousBody
public virtual AddAnotherInstanceOfPreviousBody( | const | iTransform, |
| const | iPartId) |
-
This method can be called any number of times, after any/every call to AddBody().
It adds another instance of the previous added body.
- Parameters:
-
- iTransform
- Transformation matrix corresponding to the positioning in global coordinates
of this instance of the previously added body.
- iPartId
- Void pointer that the caller can use to identify another instance
of the previously added body, for its own reference. Multiple iPartId's can be
associated with the same body (e.g. when there are multiple instances
of the same part in an assembly. This PartId is returned back in the
results, so that the caller can identify which instance of the body
got picked.
- Returns:
-
S_OK
if the instance is added successfully.
E_FAIL
otherwise.
o AddBody
public virtual AddBody( | | iPartBody, |
| const | iTransform, |
| const | iPartId, |
| | iSag, |
| | iStep | = CATMathInfinite, |
| | iMaxAngle | = 0.25* CATPI) |
-
Adds a body to the picking operator.
The last three parameters are the tessellation settings that are used should the operator
need to tessellate partly or fully the body for picking.
This function can be called multiple times for different bodies.
In order that an end user does not see any discrepancy during picking, the client may use the same
tessellation settings as it has used for visualization.
But note that, tighter the tessellation settings, higher will be the computation cost of the
pick operator.
- Parameters:
-
- iPartBody
- The body from the part that is added to the operator.
- iTransform
- The transformation matrix corresponding to the positioning
of this body in global coordinates.
- iPartId
- Void pointer that the caller can use to identify the given
body with a part for its own reference. Multiple iPartId's can be
associated with the same body (e.g. when there are multiple instances
of the same part in an assembly). This PartId is returned back in the
results, so that the caller can identify which instance of the body
got picked.
- iSag
- Tessellation parameter: Sag.
- iStep
- Tessellation parameter: An optional step size parameter not to be exceeded.
- iMaxAngle
- Tessellation parameter: An optional angle parameter not to be exceeded.
- Returns:
-
S_OK
if the CATBody
is added successfully.
E_FAIL
otherwise.
o GetApertureRadius
public virtual GetApertureRadius( | | oApertureRadius) |
-
Gets the currently set aperture radius of picking.
Refer "SetApertureRadius" for more details on aperture radius
- Parameters:
-
- oApertureRadius
- Currently set aperture radius of picking
- Returns:
-
S_OK
on success.
E_FAIL
otherwise.
o GetOnlyFirstHit
public virtual GetOnlyFirstHit( | | oOnlyFirstHit) |
-
Gets the current state of the "OnlyFirstHit" option
Refer "SetOnlyFirstHit" for more details on this option
- Parameters:
-
- oOnlyFirstHit
- Current state of the "OnlyFirstHit" option
- Returns:
-
S_OK
on success.
E_FAIL
otherwise.
o GetResult
public virtual GetResult( | | oResultIterator) |
-
Returns the results of picking.
- Parameters:
-
- oResultIterator
- Iterator that can be used to iterate through picked objects.
This returned iterator is owned by caller, i.e. the caller will need to delete it after use.
It can be deleted using regular C++ delete.
Note that the returned iterator is invalid after the next "Run" or if the operator is deleted.
The returned iterator should be deleted before the next Run or before the operator is deleted, whichever is earlier
- Returns:
-
S_OK
if an iterator is successfully returned.
S_FALSE
if no iterator is returned (no picked object.) ?
E_FAIL
otherwise.
o Run
public virtual Run( | const | iViewPoint, |
| const | iViewDirection) |
-
Runs the picking operator.
- Parameters:
-
- iViewPoint
- The start of the picking ray.
- iViewDirection
- The direction of the picking ray.
- Returns:
- 0 if the picking operator runs successfully and 1 otherwise.
o SetApertureRadius
public virtual SetApertureRadius( | | iApertureRadius) |
-
Sets the aperture radius of picking.
- Parameters:
-
- iApertureRadius
- Aperture radius to be used for picking of vertices and edges.
If this is too low, then picking of vertices and edges may become problematic.
By default, this value is 0.0, but it is recommended not to use this default value,
It is recommended that aperture radius be larger than tessellation sag.
- Returns:
-
S_OK
on success.
E_FAIL
if iApertureRadius is less than 0.
o SetOnlyFirstHit
public virtual SetOnlyFirstHit( | | iOnlyFirstHit) |
-
Enables or disables the pick operator to pick only the first hit object(s).
- Parameters:
-
- iOnlyFirstHit
- If this is TRUE, then the pick operator will pick only the first hit object(s).
Note that there could be multiple objects picked in the first hit, if the ray
simultaneously hits multiple objects (within aperture radius).
If this is FALSE, then the operator will pick all hit objects.
By default value of this option is TRUE.
Setting this to TRUE would give better performance than FALSE.
- Returns:
-
S_OK
on success.
E_FAIL
otherwise.
This object is included in the file: CATCGMPickOperator.h
If needed, your Imakefile.mk should include the module: CATGMModelInterfaces
Copyright © 1999-2015, Dassault Systèmes. All rights reserved.