CATMatInterfaces Interface CATIMaterialReference
Usage: an implementation of this interface is supplied and you must use it as is. You should not reimplement it.
interface CATIMaterialReference
Interface to Material Reference.
Role: Interface designed to add/suppress Material Domains and to get information on the Material.
Method Index
- o
AddConnection(CATIMaterialRefCnx*&,CATIType_var&,CATIAdpEnvironment*)
- Adds a connection to this material.
- o
AddMaterialDomain(CATIType_var&,CATIMaterialDomain*&,CATLISTV(CATICkeParm_var)*,CATIAdpEnvironment*)
- Creates a new material domain representation which is added to this material reference.
- o
GetAllConnections(CATListPtrCATBaseUnknown&,CATIType_var&,CATIAdpEnvironment*)
- Returns all the connections of a given type of this material.
- o
GetAttributes(CATListOfCATUnicodeString&,CATLISTV(CATIValue_var)&)
- Retrieves the list of attributes and associated values.
- o
GetAttributes(CATListValCATUnicodeString&,CATListValCATUnicodeString&)
-
- o
GetDefaultConnection(CATIMaterialRefCnx*&,CATIType_var&,CATIAdpEnvironment*)
- Returns the default connection among connections of type iType.
- o
GetMaterialDomain(CATLISTV(CATIType_var)&,CATListPtrCATBaseUnknown&)
- Returns the list of Domains exisiting on this material reference.
- o
RemoveConnection(CATIMaterialRefCnx*&)
- Remove the given connection.
- o
SetAttributes(CATListOfCATUnicodeString&,CATLISTV(CATIValue_var)&)
- Sets the list of attributes and associated values.
- o
SetAttributes(CATListValCATUnicodeString&,CATListValCATUnicodeString&)
-
Methods
o AddConnection
public virtual AddConnection( | | opiCnx, |
| const | iType, |
| | ipiEnv | = NULL ) |
-
Adds a connection to this material.
Such a connection enables to gather and expose part of the content of a domain.
- Parameters:
-
- opiCnx
- [out, CATBaseUnknown#Release] The created connection.
You have to release the pointer after use.
- iType
- The type of creation to create.
- ipiEnv
- The environment (if null the current one will be used).
- Returns:
- An HRESULT
Legal values:
- S_OK
- The connection is successfully created.
- E_INVALIDARG
- iType is not valid.
- E_FAIL
- The operation failed during the creation of connection.
- Example:
-
To create a CATIType
CATIType_var spiCnxType;
CATCkePLMNavPublicServices::RetrieveKnowledgeType( "dsc_matrefelem_cnx_SmaBehavior", spiCnxType );
- See also:
-
- o AddMaterialDomain
-
public virtual AddMaterialDomain( | const | iType, |
| | opiDomainRep, |
| | ipListAttributes | = NULL, |
| | ipiEnv | = NULL ) |
-
Creates a new material domain representation which is added to this material reference.
Role: If domains of type iType are designed as unique, this method checks before that such a domain is not
already aggregated to the material. This check is only done with data loaded in session.
The initilization business logic is called when creating a material domain.
- Parameters:
-
- iType
- The type of the domain representation.
- opiDomainRep
- [out, CATBaseUnknown#Release] Return the created material domain.
You have to release the pointer after use.
- iListAttributes
- List of attributes to valuate on the created material domain representation
(may overide values computed by BL).
- ipiEnv
- Environment in which the domain is created.
- Returns:
- An HRESULT
Legal values:
- S_OK
- The domain was created.
- E_FAIL
- The operation failed and the domain is not created.
- Example:
-
To create a CATIType
CATIType_var spiRenderingType = NULL_var;
CATMaterialTools::GetDomainRenderingType( spiRenderingType ) ;
- See also:
-
- Example:
-
to create a list of CATLISTV(CATICkeParm_var)
CATListValCATUnicodeString iCtxAttrNameList;
CATListValCATUnicodeString iCtxAttrValueList;
for(...)
{
iCtxAttrNameList.Append(...);
iCtxAttrValueList.Append(...);
}
int sizeValue = iCtxAttrValueList.Size();
CATICkeParmFactory_var spCkeFactory = CATCKEVolatileFactory;
CATLISTV(CATICkeParm_var) spAttrAsParm;
for(int j = 1; j <= sizeValue; j++ )
{
spAttrAsParm.Append( spCkeFactory -> CreateString( iCtxAttrNameList[j], iCtxAttrValueList[j] ) );
}
- See also:
-
- o GetAllConnections
-
public virtual GetAllConnections( | | opListCnx, |
| const | iType, |
| | ipiEnv | = NULL ) |
-
Returns all the connections of a given type of this material.
- Parameters:
-
- opListCnx
- [out, CATBaseUnknown#Release] The returned connections.
The caller should release the list elements.
You have to release the pointers after use.
- iType
- The type of connection to retrieve.
It will return every connection of type iType or that derives from iType.
- ipiEnv
- The environment (if null the current one will be used).
- Returns:
- An HRESULT
Legal values:
- S_OK
- The connections were successfully removed.
- E_FAIL
- The operation failed. Nothing returned.
- Example:
-
To create a CATIType.
CATIType_var spiCnxType;
CATCkePLMNavPublicServices::RetrieveKnowledgeType( "dsc_matrefelem_cnx_SmaBehavior", spiCnxType );
- See also:
-
- o GetAttributes
-
public virtual GetAttributes( | const | iListName, |
| | oListValue) |
-
Retrieves the list of attributes and associated values.
It is advised to use CATCkeObjectAttrWriteServices.
- Example:
-
CATICkeObject * piInstance = NULL;
if(SUCCEEDED(piMatRef->QueryInterface(IID_CATICkeObject, (void**)& piInstance)) && piInstance)
{
CATUnicodeString attributeDisc = "V_discipline";
CATCkeObjectAttrWriteServices::GetValueAsString(piInstance, attributeDisc, CoreOrCovering);
.........
piInstance -> Release(); piInstance = NULL;
}
- See also:
-
- o GetAttributes
-
public virtual GetAttributes( | | iAttributeNameList, |
| | iAttributeValueList) |
-
- Deprecated:
- : Use GetAttributes with CATIValue list instead
- o GetDefaultConnection
-
public virtual GetDefaultConnection( | | opiCnx, |
| const | iType, |
| | ipiEnv | = NULL ) |
-
Returns the default connection among connections of type iType.
- Parameters:
-
- opiCnx
- [out, CATBaseUnknown#Release] The returned default connection.
You have to release the pointer after use.
- iType
- Used to filter connection kind.
Connection taken into account will be of type iType or of a derived type from iType.
- ipiEnv
- The environment (if null the current one will be used).
- Returns:
- An HRESULT
Legal values:
- S_OK
- A default connection found and returned.
- E_FAIL
- The operation failed. Nothing is returned. The reasons could be
an error, an unvalid iType, there is no connection in given type or
among all of the type's connections none is default.
- Example:
-
To create a CATIType.
CATIType_var spiCnxType;
CATCkePLMNavPublicServices::RetrieveKnowledgeType( "dsc_matrefelem_cnx_SmaBehavior", spiCnxType );
- See also:
-
- o GetMaterialDomain
-
public virtual GetMaterialDomain( | const | iTypesList, |
| | opDomainList) |
-
Returns the list of Domains exisiting on this material reference.
- Parameters:
-
- iTypesList
- A list of identifier used to filter the type of domains wanted.
- opDomainList
- [out, CATBaseUnknown#Release] The returned domains. CATBaseUnknown pointers that can
be casted to CATIMaterialDomain.
You have to release the pointers after use.
- Returns:
- An HRESULT
Legal values:
- S_OK
- The list has at least a domain pointer.
- E_FAIL
- No domain returned(the list is empty).
- Example:
-
To create the list of CATITypes
CATIType_var spDomSimulationType;
CATIType_var spDomCompositesType;
CATMaterialTools::GetDomainSimulationType( spDomSimulationType );
CATMaterialTools::GetDomainCompositesType( spDomCompositesType );
CATLISTV(CATIType_var) filterList;
filterList.Append( spDomSimulationType );
filterList.Append( spDomCompositesType );
hResult = spMatRef-> GetMaterialDomain( filterList, piDomainList );
.........
for(...)
{
piDomainList[i]->Release(); piDomainList[i] = NULL;
}
piDomainList.RemoveAll();
- See also:
-
- o RemoveConnection
-
public virtual RemoveConnection( | | ipiCnx) |
-
Remove the given connection.
- Parameters:
-
- ipiCnx
- The connection to remove.
WARNING: After this call all pointers on the connection object are invalid.
You should not use any of them afterwards except for Releasing.
WARNING: After deleting a default connection, there may not be anymore default
among remaining connections.
- Returns:
- An HRESULT
Legal values:
- S_OK
- The connection was successfully removed.
- E_INVALIDARG
- The given connection is not owned by this material.
- E_FAIL
- The operation failed.
- o SetAttributes
-
public virtual SetAttributes( | const | iListName, |
| const | iListValue) |
-
Sets the list of attributes and associated values.
This method should be prefered over SetAttributes with list of CATUnicodeStrings as it
is robust to customization of the PLMEntity.
It is prefered to use a CATICkeObject instead.
- Example:
-
With a CATICkeObject
CATICkeObject * piInstance = NULL;
if(SUCCEEDED(piMatRef->QueryInterface(IID_CATICkeObject, (void**)& piInstance)) && piInstance)
{
CATUnicodeString attributeDisc = "V_discipline";
CATCkeObjectAttrWriteServices::SetValueWithString(piInstance, attributeDisc, CoreOrCovering);
.........
piInstance -> Release(); piInstance = NULL;
}
- See also:
-
- o SetAttributes
-
public virtual SetAttributes( | | iAttributeNameList, |
| | iAttributeValueList) |
-
- Deprecated:
- : Use SetAttributes with CATIValue list instead
This object is included in the file: CATIMaterialReference.h
If needed, your Imakefile.mk should include the module: CATMatInterfaces
Copyright © 1999-2014, Dassault Systèmes. All rights reserved.