CATMecModUseItf Interface CATIMmiSubElemProperties

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


interface CATIMmiSubElemProperties

Interface to manage applicative attributes and colors on sub elements.
Use CATMmiUseServicesFactory::CreateSubElemPropertiesAccess to get the services component. This Interface offers services for setting and retrieving applicative attributes and colors on Sub Elements.


Method Index


o GetAttributesOnSubElements(CATLISTV(CATBaseUnknown_var)&,CATListOfCATUnicodeString*,CATCkeListOfParm)
Retrieves applicative attributes of a list of sub elements.
o GetColorsAndOpacityOnSubElements(CATLISTV(CATBaseUnknown_var)&,CATListOfInt&,CATListOfInt&,CATListOfInt&,CATListOfInt&)
Retrieves colors and opacity of a list of sub elements.
o GetColorsOnSubElements(CATLISTV(CATBaseUnknown_var)&,CATListOfInt&,CATListOfInt&,CATListOfInt&)
Retrieves colors of a list of sub elements.
o GetDirectAttributesOnSubElement(CATBaseUnknown_var,CATIMmiMechanicalFeature_var,CATListOfCATUnicodeString**,CATCkeListOfParm*)
Retrieves the names and the respective values of all attributes for selected sub element which rely on a specific feature.
o RemoveAttributesOnSubElements(CATLISTV(CATBaseUnknown_var)&,CATListOfCATUnicodeString**)
Removes Applicative Attributes from a list of sub elements.
o RemoveColorsOnSubElements(CATLISTV(CATBaseUnknown_var)&)
Removes overloaded colors from a list of sub elements.
o SetAttributesOnSubElements(CATLISTV(CATBaseUnknown_var)&,CATListOfCATUnicodeString**,CATCkeListOfParm*,CATListOfInt&)
Sets lists of applicative attributes on a list of sub elements.
o SetColorsOnSubElements(CATLISTV(CATBaseUnknown_var)&,CATListOfInt&,CATListOfInt&,CATListOfInt&,CATListOfInt&)
Sets lists of colors on a list of sub elements.

Methods


o GetAttributesOnSubElements
public virtual GetAttributesOnSubElements( iSubElementList,
oAttributNameList,
oCkeAttrValList)
Retrieves applicative attributes of a list of sub elements.
Role: this method returns an array of list of names and values corresponding to the sub element list. No performance enhancement with CATIPersistentSubElement. The following code is a template to use this method correctly.
 HRESULT rc = E_FAIL;
 int NbBreps= iSubElementList.Size(); //list of BRepAccess
 CATListOfCATUnicodeString * oAttributNameList = new CATListOfCATUnicodeString[NbBreps];
 CATCkeListOfParm  oCkeAttrValList = new CATListValCATBaseUnknown_var[NbBreps];
 rc = CATMmrApplicativeAttributes::GetAttributesOnSubElements(iSubElementList, oAttributNameList, oCkeAttrValList );
 if (SUCCEEDED(rc))
 {
  CATListOfCATUnicodeString templiststring;
  CATListValCATBaseUnknown_var tempCke;
  for (int k=1;k<=NbBreps;k++)
  {
   //retrieve a list a position k (arrays start at position zero).
   templiststring =  (oAttributNameList)[k-1];
   tempCke = (oCkeAttrValList)[k-1];
   //......
  }
 }
 //deallocation :
 for  (int i=0; i < NbBreps;i++)
 {
  oAttributNameList[i].RemoveAll();
  oCkeAttrValList[i].RemoveAll();
 }
 delete [] oAttributNameList;	oAttributNameList = NULL;
 delete [] oCkeAttrValList;	oCkeAttrValList = NULL;
 
Parameters:
iSubElementList
[in] The list of sub elements colors will be researched on.
oAttributNameList
[out] The list of attribute names list.
oCkeAttrValList
[out] The list of attribute values list.
Returns:
S_OK
Applicative attributes have been properly retrieved on every sub elements.
S_FALSE
Applicative attributes have not be successfully retrieved on one or more sub element. If none have been retrieved on any sub element, returns E_FAIL.
E_INVALIDARG
iSubElementList is NULL or empty.
E_INVALIDARG
oAttributNameList or oAttributNameList are NULL.
E_FAIL
No attributes can be retrieved.
o GetColorsAndOpacityOnSubElements
public virtual GetColorsAndOpacityOnSubElements( iSubElementList,
oRedList,
oGreenList,
oBlueList,
oOpacityList)
Retrieves colors and opacity of a list of sub elements.
Role: this method returns RGB component values and opacity value of a list of sub elements in four different lists. the four ouput lists are cleaned inside this method. Excepting E_INVALIDARG returned value, the four list will always have the same size. If a color couldn't be successfully retrieved on sub element i, the red/green/blue component list have for this sub element a component value equal to -1.
Parameters:
iSubElementList
[in] The list of sub elements colors will be researched on.
oRedList
[out] The list of Red Colors.
oGreenList
[out] The list of Green Colors.
oBlueList
[out] The list of Blue Colors.
oOpacityList
[out] The list of Opacity.
Returns:
S_OK
The colors and the opacity have been properly retrieved on every sub elements.
S_FALSE
A color or an opacity hasn't be successfully retrieved on one or more sub element. -1 is set at position i in the three list to indicate the color couldn't be retrieved for sub element i. If none have been retrieved on any sub element, returns E_FAIL.
E_INVALIDARG
iSubElementList is NULL or empty.
E_FAIL
No color can be retrieved.
o GetColorsOnSubElements
public virtual GetColorsOnSubElements( iSubElementList,
oRedList,
oGreenList,
oBlueList)
Retrieves colors of a list of sub elements.
Role: this method returns RGB component values of a list of sub elements in three different lists. the three ouput lists are cleaned inside this method. Excepting E_INVALIDARG returned value, the three list will always have the same size. If a color couldn't be successfully retrieved on sub element i, the red/green/blue component list have for this sub element a component value equal to -1.
Parameters:
iSubElementList
[in] The list of sub elements colors will be researched on.
oRedList
[out] The list of Red Colors.
oGreenList
[out] The list of Green Colors.
oBlueList
[out] The list of Blue Colors.
Returns:
S_OK
The colors have been properly retrieved on every sub elements.
S_FALSE
A color hasn't be successfully retrieved on one or more sub element. -1 is set at position i in the three list to indicate the color couldn't be retrieved for sub element i. If none have been retrieved on any sub element, returns E_FAIL.
E_INVALIDARG
iSubElementList is NULL or empty.
E_FAIL
No color can be retrieved.
o GetDirectAttributesOnSubElement
public virtual GetDirectAttributesOnSubElement( iSubElement,
iMechanicalFeature,
oAttrNameList,
oCkeAttrValList)
Retrieves the names and the respective values of all attributes for selected sub element which rely on a specific feature.

Role: This method retrieves the names of all the attributes on a specific feature, from a selected sub element as well as their respective values.

Note:


Parameters:
iSubElement
[in] The sub element you want to retrieve attributes from.
iMechanicalFeature
[in] The feature used in order to retrieve the attributes.
This can be seen as the design-level where the attributes are being looked for.

oAttrNameList
The names of the attributes.
This is a list containing the names of the attributes, each one being stored as a CATUnicodeString.
Note:
  • This list has the same size as oCkeAttrValList .


oCkeAttrValList
The values of the attributes.
This is a pointer to a list containing the values of the attributes, each one being stored as a CATICkeParm_var.
Note:
  • The list oCkeAttrValList is actually a pointer to CATLISTV(CATBaseUnknown_var) ( see CATICkeRelationForwards.h for more details ). Because of the presence of a pointer in this definition, some extra care must be taken when calling this method.
  • This list has the same size as oAttrNameList .


Returns:
  • S_OK if the names and the values of the attributes have been properly found.
  • E_FAIL if oAttrNameList and oCkeAttrValList do not have the same size. In that case, both lists will be emptied before exiting.
  • E_UNEXPECTED if the current selecting object is invalid .
  • E_INVALIDARG if iMechanicalFeature is not a valid ancestor for the CATIPersistentSubElement.
  • E_INVALIDARG if oAttrNameList is NULL (invalid list) or if the list is not empty. In that case, the list will be emptied before exiting.
  • E_INVALIDARG if oCkeAttrValList is NULL (invalid list) or if the list is not empty. In that case, the list will be emptied before exiting.
o RemoveAttributesOnSubElements
public virtual RemoveAttributesOnSubElements( iSubElementList,
iAttributNameList)
Removes Applicative Attributes from a list of sub elements.
Role: this method remove Applicative Attributes from a list of sub elements.
You can remove different attributes on different sub elements: the attribute name list i will be removed from the sub element i. If the attribute name list i is empty, all attributes will be removed from the sub element i. This method also removes applicative attributes issued of synchronization through copy paste as result with link or synchronization via if imported part has no more link with its reference part.
Parameters:
iSubElementList
[in] The list of sub elements attributes will be removed from. A sub element must appear only once in the iSubElementList, otherwise the stability of applicative attributes is not guaranted. No check is done inside this method to verify a sub element doesn't appear twice or more, you have to do it before calling this method.
iAttributNameList
[in] The name of the attributes.
This is an array of pointers to lists containing the names of the attributes.
Legal values: Can't be NULL and must have the same size as iSubElementList
Returns:
S_OK
At least one applicative attribute has been removed on every sub element
S_FALSE
no applicative attribute has been removed on at least one sub element because no attributes were found on these sub elements
E_INVALIDARG
iSubElementList is empty or iAttributNameList is NULL
E_FAIL
An error occured while removing attributes. The method can return a class, that you retrieve thanks the global function. The possible case of error are:
  • AttributesERR_1011: If no applicative attribute has been removed , this error indicates that one or more sub elements belong to an imported feature where applicative attribute inherited from synchronization can be found and this feature still has link with its reference feature.
o RemoveColorsOnSubElements
public virtual RemoveColorsOnSubElements( iSubElementList)
Removes overloaded colors from a list of sub elements.
Role: this method remove overloaded color from a list of sub elements.
This method also removes color issued of synchronization through copy paste as result with link or synchronization via if imported part has no more link with its reference part.
Parameters:
iSubElementList
[in] The list of sub elements colors will be removed from.
Returns:
S_OK
At least one color has been properly removed on every sub elements.
S_FALSE
no color has been removed on at least one sub element because no colors were found on these sub elements
E_INVALIDARG
iSubElementList is NULL or empty.
E_FAIL
An error occured while removing colors.The method can return a class, that you retrieve thanks the global function. The possible case of error are:
  • AttributesERR_1012: If no color has been removed , this error indicates that one or more sub elements belong to an imported feature where color inherited from synchronization can be found and this feature still has link with its reference feature.
o SetAttributesOnSubElements
public virtual SetAttributesOnSubElements( iSubElementList,
iAttributNameList,
iCkeAttrValList,
oFailedSubElemIndex)
Sets lists of applicative attributes on a list of sub elements.
Role: this method sets lists of applicative attributes on a list of sub elements.
You can set different attributes on different sub elements: the sub element i will have the attribute name list i and attribute value list i.
Parameters:
iSubElementList
[in] The list of sub elements attributes and colors will be set on. A sub element must appear only once in the iSubElementList, otherwise the stability of applicative attributes is not guaranted. No check is done inside this method to verify a sub element doesn't appear twice or more, you have to do it before calling this method.
iAttributNameList
[in] The name of the attributes.
This is an array of pointers to lists containing the names of the attributes.
Legal values: No check is done to test this array has the same size as iSubElementList. However it's a necessary condition. i attribute name list has the same size as i attribute value list.
iCkeAttrValList
[in] The value of the attributes.
This is an array of pointers to list containing values of the attributes.
Legal values: No check is done to test this array has the same size as iSubElementList. However it's a necessary condition. i attribute value list has the same size as i attribute name list.
oFailedSubElemIndex
[out] The index list of sub elements on which setting attributes failed.
Returns:
S_OK
All attributes or all colors have successfully been set.
S_FALSE
One of the attribute list have not been properly set. If none have been set on any sub element, returns E_FAIL.
E_INVALIDARG
iSubElementList is NULL or empty.
E_INVALIDARG
One of iAttrNameList and iCkeAttrValList is NULL while the other is not NULL.
E_INVALIDARG
For the i sub element, the i attribute name list and the i attribute value list have different sizes.
E_FAIL
No attribute has been set.
o SetColorsOnSubElements
public virtual SetColorsOnSubElements( iSubElementList,
iRedList,
iGreenList,
iBlueList,
oFailedSubElemIndex)
Sets lists of colors on a list of sub elements.
Role: this method sets colors on a list of sub elements.
You can set different color on different sub elements: the sub element i will have the red/green/blue component i
Parameters:
iSubElementList
[in] The list of sub elements attributes and colors will be set on. A sub element must appear only once in the iSubElementList, otherwise the stability of colors is not guaranted. No check is done inside this method to verify a sub element doesn't appear twice or more, you have to do it before calling this method.
iRedList
[in] The Red color component list.
Legal values: This list should have the same size as iSubElementList, iGreenList and iBlueList.
iGreenList
[in] The Green color component list.
Legal values: This list has the same size as iSubElementList, iRedList and iBlueList.
iBlueList
[in] The Blue color component list.
Legal values: This list has the same size as iSubElementList, iRedList and iGreenList.
oFailedSubElemIndex
[out] The index list of sub elements on which setting color component failed.
Returns:
S_OK
All attributes or all colors have successfully been set.
S_FALSE
One of the color list have not been properly set. If none have been set on any sub element, returns E_FAIL.
E_INVALIDARG
iSubElementList is NULL or empty.
E_INVALIDARG
iSubElementList, iRedList, iGreenList and iBlueList have different size.
E_FAIL
No color has been set.

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

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