All Frameworks  Class Hierarchy  This Framework  Previous  Next  Indexes

MechanicalModeler Class CATMmrApplicativeAttributes

CATMmrApplicativeAttributes
 

Usage: you must use this class as is. You should never derive it.


public class CATMmrApplicativeAttributes

Class to manage applicative attributes and colors on BRep features.
This class offers services for setting and retrieving applicative attributes and colors on BRep features. CATIPersistentSubElement methods are still available but those new methods are more efficient for setting and getting colors and applicative attributes on faces of large models because they use list of faces in input.


Method Index


o GetAttributesOnFaces(CATLISTP(CATIBRepAccess)&,CATListOfCATUnicodeString*,CATCkeListOfParm)
Retrieves applicative attributes of a list of faces.
o GetAttributesOnFaces(CATLISTV(CATBaseUnknown_var)&,CATListOfCATUnicodeString*,CATCkeListOfParm)
Retrieves applicative attributes of a list of faces.
o GetColorsAndOpacityOnFaces(CATLISTV(CATBaseUnknown_var)&,CATListOfInt&,CATListOfInt&,CATListOfInt&,CATListOfInt&)
Retrieves colors and opacity of a list of faces.
o GetColorsOnFaces(CATLISTP(CATIBRepAccess)&,CATListOfInt&,CATListOfInt&,CATListOfInt&)
Retrieves colors of a list of faces.
o GetColorsOnFaces(CATLISTV(CATBaseUnknown_var)&,CATListOfInt&,CATListOfInt&,CATListOfInt&)
Retrieves colors of a list of faces.
o RemoveAttributesOnFaces(CATLISTV(CATBaseUnknown_var)&,CATListOfCATUnicodeString**)
Removes Applicative Attributes from a list of faces.
o RemoveColorsOnFaces(CATLISTV(CATBaseUnknown_var)&)
Removes overloaded colors from a list of faces.
o SetAttributesOnFaces(CATLISTP(CATIBRepAccess)&,CATListOfCATUnicodeString**,CATCkeListOfParm*,CATListOfInt&)
Sets lists of applicative attributes on a list of faces.
o SetAttributesOnFaces(CATLISTV(CATBaseUnknown_var)&,CATListOfCATUnicodeString**,CATCkeListOfParm*,CATListOfInt&)
Sets lists of applicative attributes on a list of faces.
o SetColorsOnFaces(CATLISTP(CATIBRepAccess)&,CATListOfInt&,CATListOfInt&,CATListOfInt&,CATListOfInt&)
Sets lists of colors on a list of faces.
o SetColorsOnFaces(CATLISTV(CATBaseUnknown_var)&,CATListOfInt&,CATListOfInt&,CATListOfInt&,CATListOfInt&)
Sets lists of colors on a list of faces.

Methods


o GetAttributesOnFaces
public static HRESULT GetAttributesOnFaces(CATLISTP(CATIBRepAccess)& iFacesList,
CATListOfCATUnicodeString* oAttributNameList,
CATCkeListOfParm oCkeAttrValList)
Retrieves applicative attributes of a list of faces.
Role: this method returns an array of list of names and values corresponding to the face list. No performance enhancement with CATIPersistentSubElement. The following code is a template to use this method correctly.
 HRESULT rc = E_FAIL;
 int NbBreps= iFacesList.Size(); //list of BRepAccess
 CATListOfCATUnicodeString * oAttributNameList = new CATListOfCATUnicodeString[NbBreps];
 CATCkeListOfParm  oCkeAttrValList = new CATListValCATBaseUnknown_var[NbBreps];
 rc = CATMmrApplicativeAttributes::GetAttributesOnFaces(iFacesList, 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:
iFacesList
[in] The list of faces 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 faces.
S_FALSE
Applicative attributes have not be successfully retrieved on one or more face. If none have been retrieved on any face, returns E_FAIL.
E_INVALIDARG
iFacesList is NULL or empty.
E_INVALIDARG
oAttributNameList or oAttributNameList are NULL.
E_FAIL
No attributes can be retrieved.
o GetAttributesOnFaces
public static HRESULT GetAttributesOnFaces(CATLISTV(CATBaseUnknown_var)& iFacesList,
CATListOfCATUnicodeString* oAttributNameList,
CATCkeListOfParm oCkeAttrValList)
Retrieves applicative attributes of a list of faces.
Role: this method returns an array of list of names and values corresponding to the face list. No performance enhancement with CATIPersistentSubElement. The following code is a template to use this method correctly.
 HRESULT rc = E_FAIL;
 int NbBreps= iFacesList.Size(); //list of BRepAccess
 CATListOfCATUnicodeString * oAttributNameList = new CATListOfCATUnicodeString[NbBreps];
 CATCkeListOfParm  oCkeAttrValList = new CATListValCATBaseUnknown_var[NbBreps];
 rc = CATMmrApplicativeAttributes::GetAttributesOnFaces(iFacesList, 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:
iFacesList
[in] The list of faces 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 faces.
S_FALSE
Applicative attributes have not be successfully retrieved on one or more face. If none have been retrieved on any face, returns E_FAIL.
E_INVALIDARG
iFacesList is NULL or empty.
E_INVALIDARG
oAttributNameList or oAttributNameList are NULL.
E_FAIL
No attributes can be retrieved.
o GetColorsAndOpacityOnFaces
public static HRESULT GetColorsAndOpacityOnFaces(CATLISTV(CATBaseUnknown_var)& iFacesList,
CATListOfInt& oRedList,
CATListOfInt& oGreenList,
CATListOfInt& oBlueList,
CATListOfInt& oOpacityList)
Retrieves colors and opacity of a list of faces.
Role: this method returns RGB component values and opacity value of a list of faces 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 face i, the red/green/blue component list have for this face a component value equal to -1.
Parameters:
iFacesList
[in] The list of faces 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 faces.
S_FALSE
A color or an opacity hasn't be successfully retrieved on one or more face. -1 is set at position i in the three list to indicate the color couldn't be retrieved for face i. If none have been retrieved on any face, returns E_FAIL.
E_INVALIDARG
iFacesList is NULL or empty.
E_FAIL
No color can be retrieved.
o GetColorsOnFaces
public static HRESULT GetColorsOnFaces(CATLISTP(CATIBRepAccess)& iFacesList,
CATListOfInt& oRedList,
CATListOfInt& oGreenList,
CATListOfInt& oBlueList)
Retrieves colors of a list of faces.
Role: this method returns RGB component values of a list of faces 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 face i, the red/green/blue component list have for this face a component value equal to -1.
Parameters:
iFacesList
[in] The list of faces 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 faces.
S_FALSE
A color hasn't be successfully retrieved on one or more face. -1 is set at position i in the three list to indicate the color couldn't be retrieved for face i. If none have been retrieved on any face, returns E_FAIL.
E_INVALIDARG
iFacesList is NULL or empty.
E_FAIL
No color can be retrieved.
o GetColorsOnFaces
public static HRESULT GetColorsOnFaces(CATLISTV(CATBaseUnknown_var)& iFacesList,
CATListOfInt& oRedList,
CATListOfInt& oGreenList,
CATListOfInt& oBlueList)
Retrieves colors of a list of faces.
Role: this method returns RGB component values of a list of faces 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 face i, the red/green/blue component list have for this face a component value equal to -1.
Parameters:
iFacesList
[in] The list of faces 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 faces.
S_FALSE
A color hasn't be successfully retrieved on one or more face. -1 is set at position i in the three list to indicate the color couldn't be retrieved for face i. If none have been retrieved on any face, returns E_FAIL.
E_INVALIDARG
iFacesList is NULL or empty.
E_FAIL
No color can be retrieved.
o RemoveAttributesOnFaces
public static HRESULT RemoveAttributesOnFaces(CATLISTV(CATBaseUnknown_var)& iFacesList,
CATListOfCATUnicodeString** iAttributNameList)
Removes Applicative Attributes from a list of faces.
Role: this method remove Applicative Attributes from a list of faces.
You can remove different attributes on different faces: the attribute name list i will be removed from the face i. If the attribute name list i is empty, all attributes will be removed from the face i. This method also removes applicative attributes issued of synchronization through copy paste as result with link or synchronization via CATIMmiBRepAttributeSynchronize if imported part has no more link with its reference part.
Parameters:
iFacesList
[in] The list of faces attributes will be removed from. A face must appear only once in the iFacesList, otherwise the stability of applicative attributes is not guaranted. No check is done inside this method to verify a face 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 iFacesList
Returns:
S_OK
At least one applicative attribute has been removed on every face
S_FALSE
no applicative attribute has been removed on at least one face because no attributes were found on these faces
E_INVALIDARG
iFacesList is empty or iAttributNameList is NULL
E_FAIL
An error occured while removing attributes. The method can return a CATError class, that you retrieve thanks the CATError.CATGetLastError global function. The possible case of error are:
  • AttributesERR_1011: If no applicative attribute has been removed , this error indicates that one or more faces 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 RemoveColorsOnFaces
public static HRESULT RemoveColorsOnFaces(CATLISTV(CATBaseUnknown_var)& iFacesList)
Removes overloaded colors from a list of faces.
Role: this method remove overloaded color from a list of faces.
This method also removes color issued of synchronization through copy paste as result with link or synchronization via CATIMmiBRepAttributeSynchronize if imported part has no more link with its reference part.
Parameters:
iFacesList
[in] The list of faces colors will be removed from.
Returns:
S_OK
At least one color has been properly removed on every faces.
S_FALSE
no color has been removed on at least one face because no colors were found on these faces
E_INVALIDARG
iFacesList is NULL or empty.
E_FAIL
An error occured while removing colors.The method can return a CATError class, that you retrieve thanks the CATError.CATGetLastError global function. The possible case of error are:
  • AttributesERR_1012: If no color has been removed , this error indicates that one or more faces belong to an imported feature where color inherited from synchronization can be found and this feature still has link with its reference feature.
o SetAttributesOnFaces
public static HRESULT SetAttributesOnFaces(CATLISTP(CATIBRepAccess)& iFacesList,
CATListOfCATUnicodeString** iAttributNameList,
CATCkeListOfParm* iCkeAttrValList,
CATListOfInt& oFailedFacesIndex)
Sets lists of applicative attributes on a list of faces.
Role: this method sets lists of applicative attributes on a list of faces.
You can set different attributes on different faces: the face i will have the attribute name list i and attribute value list i.
Parameters:
iFacesList
[in] The list of faces attributes and colors will be set on. A face must appear only once in the iFacesList, otherwise the stability of applicative attributes is not guaranted. No check is done inside this method to verify a face 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 iFacesList. 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 iFacesList. However it's a necessary condition. i attribute value list has the same size as i attribute name list.
oFailedFacesIndex
[out] The index list of faces 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 face, returns E_FAIL.
E_INVALIDARG
iFacesList is NULL or empty.
E_INVALIDARG
One of iAttrNameList and iCkeAttrValList is NULL while the other is not NULL.
E_INVALIDARG
For the i face, the i attribute name list and the i attribute value list have different sizes.
E_FAIL
No attribute has been set.
o SetAttributesOnFaces
public static HRESULT SetAttributesOnFaces(CATLISTV(CATBaseUnknown_var)& iFacesList,
CATListOfCATUnicodeString** iAttributNameList,
CATCkeListOfParm* iCkeAttrValList,
CATListOfInt& oFailedFacesIndex)
Sets lists of applicative attributes on a list of faces.
Role: this method sets lists of applicative attributes on a list of faces.
You can set different attributes on different faces: the face i will have the attribute name list i and attribute value list i.
Parameters:
iFacesList
[in] The list of faces attributes and colors will be set on. A face must appear only once in the iFacesList, otherwise the stability of applicative attributes is not guaranted. No check is done inside this method to verify a face 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 iFacesList. 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 iFacesList. However it's a necessary condition. i attribute value list has the same size as i attribute name list.
oFailedFacesIndex
[out] The index list of faces 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 face, returns E_FAIL.
E_INVALIDARG
iFacesList is NULL or empty.
E_INVALIDARG
One of iAttrNameList and iCkeAttrValList is NULL while the other is not NULL.
E_INVALIDARG
For the i face, the i attribute name list and the i attribute value list have different sizes.
E_FAIL
No attribute has been set.
o SetColorsOnFaces
public static HRESULT SetColorsOnFaces(CATLISTP(CATIBRepAccess)& iFacesList,
CATListOfInt& iRedList,
CATListOfInt& iGreenList,
CATListOfInt& iBlueList,
CATListOfInt& oFailedFacesIndex)
Sets lists of colors on a list of faces.
Role: this method sets colors on a list of faces.
You can set different color on different faces: the face i will have the red/green/blue component i
Parameters:
iFacesList
[in] The list of faces attributes and colors will be set on. A face must appear only once in the iFacesList, otherwise the stability of colors is not guaranted. No check is done inside this method to verify a face 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 iFacesList, iGreenList and iBlueList.
iGreenList
[in] The Green color component list.
Legal values: This list has the same size as iFacesList, iRedList and iBlueList.
iBlueList
[in] The Blue color component list.
Legal values: This list has the same size as iFacesList, iRedList and iGreenList.
oFailedFacesIndex
[out] The index list of faces 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 face, returns E_FAIL.
E_INVALIDARG
iFacesList is NULL or empty.
E_INVALIDARG
iFacesList, iRedList, iGreenList and iBlueList have different size.
E_FAIL
No color has been set.
o SetColorsOnFaces
public static HRESULT SetColorsOnFaces(CATLISTV(CATBaseUnknown_var)& iFacesList,
CATListOfInt& iRedList,
CATListOfInt& iGreenList,
CATListOfInt& iBlueList,
CATListOfInt& oFailedFacesIndex)
Sets lists of colors on a list of faces.
Role: this method sets colors on a list of faces.
You can set different color on different faces: the face i will have the red/green/blue component i
Parameters:
iFacesList
[in] The list of faces attributes and colors will be set on. A face must appear only once in the iFacesList, otherwise the stability of colors is not guaranted. No check is done inside this method to verify a face 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 iFacesList, iGreenList and iBlueList.
iGreenList
[in] The Green color component list.
Legal values: This list has the same size as iFacesList, iRedList and iBlueList.
iBlueList
[in] The Blue color component list.
Legal values: This list has the same size as iFacesList, iRedList and iGreenList.
oFailedFacesIndex
[out] The index list of faces 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 face, returns E_FAIL.
E_INVALIDARG
iFacesList is NULL or empty.
E_INVALIDARG
iFacesList, iRedList, iGreenList and iBlueList have different size.
E_FAIL
No color has been set.

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

Copyright © 2003, Dassault Systèmes. All rights reserved.