execute();
}
-//=================================================================================================
-void CollectionAPI_Field::setComponentsNum(const ModelHighAPI_Integer& theNum)
-{
- fillAttribute(theNum, mycomponentsNum);
- execute();
-}
-
//=================================================================================================
void CollectionAPI_Field::setComponentsNames(const std::list<std::string>& theNames)
{
const std::list<std::list<type> >& theComponents) \
{ \
myvalues->setSize(myselection->size() + 1, \
- mycomponentsNum->value(), mystepsNum->value()); \
+ mycomponentsNames->size(), mystepsNum->value()); \
mystamps->setValue(theStepNum.intValue(), theStamp.intValue()); \
int aRowIndex = 0; \
std::list<std::list<type> >::const_iterator \
theDumper<<aBase<<" = model.addField("<<aDocName<<", "<<mystepsNum->value()<<", \""
<<strByValueType(ModelAPI_AttributeTables::ValueType(myvaluesType->value()))<<"\", "
- <<mycomponentsNum->value()<<", ";
+ <<mycomponentsNames->size()<<", ";
theDumper<<mycomponentsNames<<", ";
theDumper<<myselection<<")"<<std::endl;
// set values step by step
std::shared_ptr<CollectionAPI_Field> aField(new CollectionAPI_Field(aFeature));
aField->setStepsNum(theStepsNum);
aField->setValuesType(theComponentType);
- aField->setComponentsNum(theComponentsNum);
aField->setComponentsNames(theComponentNames);
aField->setSelection(theSelectionList);
COLLECTIONAPI_EXPORT
virtual ~CollectionAPI_Field();
- INTERFACE_7(CollectionPlugin_Field::ID(),
+ INTERFACE_6(CollectionPlugin_Field::ID(),
selection, CollectionPlugin_Field::SELECTED_ID(),
ModelAPI_AttributeSelectionList, /** Field selection list*/,
- componentsNum, CollectionPlugin_Field::COMPONENTS_NB_ID(),
- ModelAPI_AttributeInteger, /** Number of components integer */,
componentsNames, CollectionPlugin_Field::COMPONENTS_NAMES_ID(),
ModelAPI_AttributeStringArray, /** Names of components list of strings */,
valuesType, CollectionPlugin_Field::VALUES_TYPE_ID(),
/// Set selected objects.
COLLECTIONAPI_EXPORT
void setSelection(const std::list<ModelHighAPI_Selection>& theFieldList);
- /// Set number of components
- COLLECTIONAPI_EXPORT
- void setComponentsNum(const ModelHighAPI_Integer& theNum);
/// Set names of components
COLLECTIONAPI_EXPORT
void setComponentsNames(const std::list<std::string>& theNames);
void CollectionPlugin_Field::initAttributes()
{
data()->addAttribute(SELECTED_ID(), ModelAPI_AttributeSelectionList::typeId());
- //data()->addAttribute(COMPONENTS_NB_ID(), ModelAPI_AttributeInteger::typeId());
data()->addAttribute(COMPONENTS_NAMES_ID(), ModelAPI_AttributeStringArray::typeId());
data()->addAttribute(VALUES_TYPE_ID(), ModelAPI_AttributeInteger::typeId());
data()->addAttribute(STEPS_NB_ID(), ModelAPI_AttributeInteger::typeId());
static const std::string MY_SELECTED_ID("selected");
return MY_SELECTED_ID;
}
- /// attribute name of components number
- inline static const std::string& COMPONENTS_NB_ID()
- {
- static const std::string MY_COMPONENTS_NB_ID("components_nb");
- return MY_COMPONENTS_NB_ID;
- }
/// attribute name of componenets titles array
inline static const std::string& COMPONENTS_NAMES_ID()
{
aSelectionListAttr.append("Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_1&Extrusion_1_1/To_Face_1_1")
aSelectionListAttr.append("Extrusion_1_1/Generated_Face_2&Extrusion_1_1/Generated_Face_1&Extrusion_1_1/To_Face_1_1")
aSelectionListAttr.append("Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_2&Extrusion_1_1/From_Face_1_1")
-aField.integer("components_nb").setValue(2) # two components
aComponentNames = aField.stringArray("components_names")
-aComponentNames.setSize(2)
+aComponentNames.setSize(2) # two components
aComponentNames.setValue(0, "temperatue")
aComponentNames.setValue(1, "porosity")
aField.integer("type").setValue(2) # double
aSelectionListAttr = aField.selectionList("selected")
aSelectionListAttr.setSelectionType("face")
aSelectionListAttr.append("Extrusion_1_1/Generated_Face_3")
-aField.integer("components_nb").setValue(1) # one component
aComponentNames = aField.stringArray("components_names")
-aComponentNames.setSize(1)
+aComponentNames.setSize(1) # one component
aComponentNames.setValue(0, "description")
aField.integer("type").setValue(3) # string
aField.integer("steps_nb").setValue(2) # two steps
aSelectionListAttr = aField.selectionList("selected")
aSelectionListAttr.setSelectionType("face")
aSelectionListAttr.append("Extrusion_1_1/Generated_Face_3")
-aField.integer("components_nb").setValue(1) # one component
aComponentNames = aField.stringArray("components_names")
-aComponentNames.setSize(1)
+aComponentNames.setSize(1) # one component
aComponentNames.setValue(0, "description")
aField.integer("type").setValue(1) # integer
aField.integer("steps_nb").setValue(1) # one step
aSelectionListAttr = aField.selectionList("selected")
aSelectionListAttr.setSelectionType("face")
aSelectionListAttr.append("Extrusion_1_1/Generated_Face_3")
-aField.integer("components_nb").setValue(1) # one component
aComponentNames = aField.stringArray("components_names")
-aComponentNames.setSize(1)
+aComponentNames.setSize(1) # one component
aComponentNames.setValue(0, "description")
aField.integer("type").setValue(0) # boolean
aField.integer("steps_nb").setValue(1) # one step