CATMecModUIUseItf Interface CATIMmiTemporaryVisProperties

Usage: an implementation of this interface is supplied and you must use it as is. You should not reimplement it.


interface CATIMmiTemporaryVisProperties

Interface to apply temporary graphic properties.


Role: This interface enables to overload temporarily the graphic attributes of a component, and to visualize them in the 3D representation. This interface is implemented on 2D surface objects of selection (subelements - implementing - of solid, surface and volume features). The permanent (i.e persistent) graphic attributes are the ones specified by CATIVisProperties interface. Supplied graphic properties are the ones defined for CATVisGeomType 'CATVPMesh'.

In principle, overloading takes place inside a command. After using SetTemporaryVisProperties, calling ResetTemporaryVisProperties before the end of the command is mandatory. Permanent graphic attributes must be restored before switching to another command.

In both methods, 3D visualization refresh of the resulting graphic properties is included : do not send any refresh event by yourself. If temporary properties are applied to a surface, their visualization overrides the one of the persistent properties.

Using this interface will not make your document dirty : temporary properties cannot be saved ; they do not modify the persistent properties applied using CATIVisProperties.


Method Index


o ResetTemporaryVisProperties(CATBoolean)
Erases temporary graphic properties, and restores the 3D visualization.
o SetTemporaryVisProperties(CATVisPropertiesValues&,CATVisPropertyType,CATVisGeomType)
Applies temporary graphic properties, and refreshes 3D visualization.

Methods


o ResetTemporaryVisProperties
public virtual ResetTemporaryVisProperties( iGlobalReset= FALSE)
Erases temporary graphic properties, and restores the 3D visualization.


Role: Call this method on each object of selection for which temporary graphic properties have been applied using SetTemporaryVisProperties. Be careful there must always be as many calls to ResetTemporaryVisProperties as there have been to SetTemporaryVisProperties, whatever the iGlobalReset value.

Parameters:
iGlobalReset
[in] Defines how the visualization refresh is computed.
Use mode TRUE especially when several objects of selection get reset (for instance when leaving a command). Choosing between FALSE and TRUE is a question of CPU time performances :
  • FALSE

  • the surface cells matching the object of selection in the visualized geometry are computed, and their represented graphic properties get refreshed one by one.
  • TRUE

  • the graphic properties of the whole geometry to which the surfaces belong are recomputed.

When many objects of selection are involved, solving each of them in the represented geometry can be more time consuming than reapplying the graphic properties on the whole representation. Note that visualization gets refreshed by sending events, which are bufferized and optimized : if several events get sent involving the same object, only one will eventually be treated.
Returns:

S_OK if temporary graphic properties had been applied on the corresponding surface subelements, and could be reset
E_FAIL otherwise
o SetTemporaryVisProperties
public virtual SetTemporaryVisProperties( iValues,
iPropertyType,
iGeomType)
Applies temporary graphic properties, and refreshes 3D visualization.


Role: This method applies temporary graphic properties to an object, and refreshes 3D visualization with respect to these properties.

To use this method, create an object of selection on the surface that is to modify (using the method in CATIMmiUseBRepDecodeServices). The surface cells matching the object of selection in the visualized geometry are computed, and their represented graphic properties are refreshed taking into account the temporary properties.


For example, to change a color :
int red, green, blue;
CATVisPropertiesValues color;
color.SetColor(red, green, blue);
object of selection -> SetTemporaryVisProperties(color, CATVPColor, CATVPMesh);

Parameters:
iValues
[in] The temporary graphic properties.
iPropertyType
[in] The property type.
The supported types for this method are : CATVPColor, CATVPOpacity, CATVPAllPropertyType.
iGeomType
[in] The geometry type.
The only supported type for this method is : CATVPMesh
Returns:

S_OK if temporary graphic properties could be applied
E_INVALIDARG : bad argument.
E_FAIL otherwise.

This object is included in the file: CATIMmiTemporaryVisProperties.h
If needed, your Imakefile.mk should include the module: CATMecModUIUseItf

Copyright © 1999-2014, Dassault Systèmes. All rights reserved.