CATMatInterfaces Interface CATMatAppliedAccess

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


interface CATMatAppliedAccess

Services class to apply or retrieve material on support.
Role: Use these services to apply materials on objects.
Use also these services to retrieve materials applied on objects.

See also:


Method Index


o GetAllMaterialCovering(CATOmbObjectInContext* const,CATListPtrCATBaseUnknown&,CATUnicodeString&)
Returns the stack of all covering materials that cover support defined in ipObjInCont.
o GetMaterialCore(CATOmbObjectInContext* const,CATBaseUnknown*&,CATUnicodeString&)
Returns the core material applied on the provided support or inherited from an upper support in the same context.
o GetMaterialCovering(CATOmbObjectInContext* const,CATListPtrCATBaseUnknown&,CATUnicodeString&)
Returns the list of covering materials applied on the support defined in ipObjInCont.
o RemoveAppliedMaterial(CATIMatNewMaterialInstance*)
Removes applied material.
o SetMaterialCore(CATOmbObjectInContext* const,CATIMaterialGeneric*,int&,int,CATIMatNewMaterialInstance**)
Applies a core material on the support defined in ipObjInCont.
o SetMaterialCovering(CATOmbObjectInContext* const,CATIMaterialGeneric*,int&,int,CATIMatNewMaterialInstance**)
Applies a covering material on the support defined in ipObjInCont.

Methods


o GetAllMaterialCovering
public static GetAllMaterialCovering( const ipObjInCont,
oMaterialList,
const iClassName)
Returns the stack of all covering materials that cover support defined in ipObjInCont.
Takes into account covering materials defined in the context of ipObjInCont, and also in lower contexts (if they exist).
Parameters:
ipObjInCont
Defines the support and its context.
oMaterialList
[out, CATBaseUnknown#Release] The list of materials (references or applied-materials).
First material in list will be the upper covering material layer (the visible one).
You have to release pointers after use.
iClassName
the type of the returned CATBaseUnknown in list, either:
- CATIMaterialReference::ClassName() (to get the reference material directly).
- CATIMatNewMaterialInstance::ClassName() (to get the applied material, instance).
- CATIMaterialVector::ClassName() (to get the vector).
Returns:
An HRESULT
Legal values:
S_OK
At least one pointer is in the returned list.
E_FAIL
The operation failed. Nothing returned.
o GetMaterialCore
public static GetMaterialCore( const ipObjInCont,
opiMaterial,
const iClassName)
Returns the core material applied on the provided support or inherited from an upper support in the same context.
Parameters:
ipObjInCont
Defines the support and its context.
When the support (target of CATOmbObjectInContext) is an element inside a RepReference, a RepInstance must be defined.
opiMaterial
[out, CATBaseUnknown#Release] The returned material (reference or applied-material).
You have to release the pointer after use.
iClassName
the type of the returned CATBaseUnknown, either:
- CATIMaterialReference::ClassName() (to get the reference material directly).
- CATIMatNewMaterialInstance::ClassName() (to get the applied-material, instance).
- CATIMaterialVector::ClassName() (to get the vector).
Returns:
An HRESULT
Legal values:
S_OK
A pointer is successfully returned in opiMaterial.
E_INVALIDARG
If ipObjInCont is NULL or if ipObjInCont is not valid for materials.
If iClassName is neither CATIMaterialReference nor CATIMatNewMaterialInstance.
E_FAIL
The operation failed. Nothing returned.
o GetMaterialCovering
public static GetMaterialCovering( const ipObjInCont,
oMaterialList,
const iClassName)
Returns the list of covering materials applied on the support defined in ipObjInCont.
Only covering materials defined in the context of ipObjInCont will be retrieved.
If you expect get covering material from all contexts, use instead.
For more explanation, refer to the CAA encyclopedia.
Parameters:
ipObjInCont
Defines the support and its context.
oMaterialList
[out, CATBaseUnknown#Release] The list of materials (references or applied-materials).
First material in the list is the upper covering material layer.
You have to release pointers after use.
iClassName
the type of the returned CATBaseUnknown in list, either:
- CATIMaterialReference::ClassName() (to get the reference material directly).
- CATIMatNewMaterialInstance::ClassName() (to get the applied material, instance).
Returns:
An HRESULT
Legal values:
S_OK
At least one pointer is in the returned list.
E_FAIL
The operation failed. Nothing returned.
o RemoveAppliedMaterial
public static RemoveAppliedMaterial( ipiAppliedMaterial)
Removes applied material.
Warning: Release ipiAppliedMaterial after RemoveAppliedMaterial return. But do not use ipiAppliedMaterial object anymore, no behavior guarented.
Parameters:
ipiAppliedMaterial
Defines the applied material that will be removed.
Returns:
An HRESULT
Legal values:
S_OK
The operation of removing succeeded.
E_INVALIDARG
ipiAppliedMaterial is NULL.
E_FAIL
The operation failed.
o SetMaterialCore
public static SetMaterialCore( const ipObjInCont,
ipiMaterial,
oErrorCode,
const iReplace= 0,
opiMatCnx= NULL )
Applies a core material on the support defined in ipObjInCont.
Parameters:
ipObjInCont
Defines the support and the context used for applying material.
The context is the root reference defined by ipObjInCont.
If the support (target of ipObjInCont) is an element inside a RepReference then a RepInstance must be provided in ipObjInCont to make it valid.
iCoreMaterial
The material reference to be applied on the support.
oErrorCode
An error code.
iReplace
Need to replace an already existing core material on that support.
Legal values:
0
Do not replace existing core material (nothing is done).
1
Replace existing core material.
opiMatCnx
[out, CATBaseUnknown#Release] If it is valued : return in this variable the new Cnx created.
You have to release pointers after use.
Returns:
An HRESULT
Legal values:
S_OK
The operation of applying succeeded.
E_INVALIDARG
ipObjInCont is NULL or ipiMaterial is NULL.
E_FAIL
The operation failed.
o SetMaterialCovering
public static SetMaterialCovering( const ipObjInCont,
ipiMaterial,
oErrorCode,
const iReplace= 0,
opiMatCnx= NULL )
Applies a covering material on the support defined in ipObjInCont.
Parameters:
ipObjInCont
Defines the support and the context used for applying material.
The context is the root reference defined by ipObjInCont.
iCoreMaterial
The material reference to be applied on the support.
oErrorCode
An error code.
iReplace
Need to replace an already existing covering material on that support.
Legal values:
0
Do not replace existing core material (nothing is done).
1
Replace existing core material.
opiMatCnx
[out, CATBaseUnknown#Release] If it is valued : return in this variable the new Cnx created.
You have to release pointers after use.
Returns:
An HRESULT
Legal values:
S_OK
The operation of applying succeeded.
E_INVALIDARG
ipObjInCont is NULL or ipiMaterial is NULL.
E_FAIL
The operation failed.

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

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