//=================================================================================================
void CollectionAPI_Field::setValuesType(const std::string& theType)
{
- fillAttribute(int(valueTypeByStr(theType)), myvaluesType);
myvalues->setType(valueTypeByStr(theType));
execute();
}
//=================================================================================================
void CollectionAPI_Field::setStepsNum(const ModelHighAPI_Integer& theSteps)
{
- fillAttribute(theSteps, mystepsNum);
mystamps->setSize(theSteps.intValue());
execute();
}
const ModelHighAPI_Integer& theStamp, \
const std::list<std::list<type> >& theComponents) \
{ \
- myvalues->setSize(myselection->size() + 1, \
- mycomponentsNames->size(), mystepsNum->value()); \
mystamps->setValue(theStepNum.intValue(), theStamp.intValue()); \
int aRowIndex = 0; \
std::list<std::list<type> >::const_iterator \
FeaturePtr aBase = feature();
const std::string& aDocName = theDumper.name(aBase->document());
- theDumper<<aBase<<" = model.addField("<<aDocName<<", "<<mystepsNum->value()<<", \""
- <<strByValueType(ModelAPI_AttributeTables::ValueType(myvaluesType->value()))<<"\", "
- <<mycomponentsNames->size()<<", ";
+ theDumper<<aBase<<" = model.addField("<<aDocName<<", "<<myvalues->tables()<<", \""
+ <<strByValueType(myvalues->type())<<"\", "<<mycomponentsNames->size()<<", ";
theDumper<<mycomponentsNames<<", ";
theDumper<<myselection<<")"<<std::endl;
// set values step by step
for(int aCol = 0; aCol < myvalues->columns(); aCol++) {
if (aCol != 0)
theDumper<<", ";
- switch(myvaluesType->value()) {
+ switch(myvalues->type()) {
case ModelAPI_AttributeTables::BOOLEAN:
theDumper<<myvalues->value(aRow, aCol, aStep).myBool;
break;
}
}
+std::shared_ptr<ModelAPI_AttributeTables> CollectionAPI_Field::tableValues()
+{
+ return myvalues;
+}
+
//=================================================================================================
FieldPtr addField(const std::shared_ptr<ModelAPI_Document>& thePart,
const ModelHighAPI_Integer& theStepsNum,
aField->setValuesType(theComponentType);
aField->setComponentsNames(theComponentNames);
aField->setSelection(theSelectionList);
+ aField->tableValues()->setSize(
+ int(theSelectionList.size() + 1), theComponentsNum, theStepsNum.intValue());
return aField;
}
COLLECTIONAPI_EXPORT
virtual ~CollectionAPI_Field();
- INTERFACE_6(CollectionPlugin_Field::ID(),
+ INTERFACE_4(CollectionPlugin_Field::ID(),
selection, CollectionPlugin_Field::SELECTED_ID(),
ModelAPI_AttributeSelectionList, /** Field selection list*/,
componentsNames, CollectionPlugin_Field::COMPONENTS_NAMES_ID(),
ModelAPI_AttributeStringArray, /** Names of components list of strings */,
- valuesType, CollectionPlugin_Field::VALUES_TYPE_ID(),
- ModelAPI_AttributeInteger, /** Type of the values enumeration */,
- stepsNum, CollectionPlugin_Field::STEPS_NB_ID(),
- ModelAPI_AttributeInteger, /** Number of steps integer */,
stamps, CollectionPlugin_Field::STAMPS_ID(),
ModelAPI_AttributeIntArray, /** Identifiers of stamps */,
values, CollectionPlugin_Field::VALUES_ID(), ModelAPI_AttributeTables /** Table of values */,
/// Dump wrapped feature
COLLECTIONAPI_EXPORT
virtual void dump(ModelHighAPI_Dumper& theDumper) const;
+
+ /// Returns the internal values tables
+ COLLECTIONAPI_EXPORT
+ std::shared_ptr<ModelAPI_AttributeTables> tableValues();
+
};
/// Pointer on Field object.
{
data()->addAttribute(SELECTED_ID(), ModelAPI_AttributeSelectionList::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());
data()->addAttribute(STAMPS_ID(), ModelAPI_AttributeIntArray::typeId());
data()->addAttribute(VALUES_ID(), ModelAPI_AttributeTables::typeId());
}
static const std::string MY_COMPONENTS_NAMES_ID("components_names");
return MY_COMPONENTS_NAMES_ID;
}
- /// attribute name of values types integer identifier
- inline static const std::string& VALUES_TYPE_ID()
- {
- static const std::string MY_VALUES_TYPE_ID("type");
- return MY_VALUES_TYPE_ID;
- }
- /// attribute name of number of steps
- inline static const std::string& STEPS_NB_ID()
- {
- static const std::string MY_STEPS_NB_ID("steps_nb");
- return MY_STEPS_NB_ID;
- }
/// attribute name of stamps integer array
inline static const std::string& STAMPS_ID()
{
anExtrusionFt.string("CreationMethod").setValue("BySizes")
anExtrusionFt.real("to_size").setValue(50)
anExtrusionFt.real("from_size").setValue(50)
-anExtrusionFt.real("to_offset").setValue(0) #TODO: remove
-anExtrusionFt.real("from_offset").setValue(0) #TODO: remove
+anExtrusionFt.real("to_offset").setValue(0)
+anExtrusionFt.real("from_offset").setValue(0)
anExtrusionFt.execute()
aSession.finishOperation()
anExtrusionBody = modelAPI_ResultBody(anExtrusionFt.firstResult())
aComponentNames.setSize(2) # two components
aComponentNames.setValue(0, "temperatue")
aComponentNames.setValue(1, "porosity")
-aField.integer("type").setValue(2) # double
-aField.integer("steps_nb").setValue(1) # one step
aStamps = aField.intArray("stamps")
-aStamps.setSize(1)
+aStamps.setSize(1) # one step
aStamps.setValue(0, 10)
aTables = aField.tables("values")
-aTables.setType(2)
+aTables.setType(2) # double
aTables.setSize(1 + 3, 2, 1) # default row + number of selected, number of compoents, number of steps (tables)
aTables.setValue(20, 0, 0, 0) # value, index of selection, index of component, index of step
aTables.setValue(35, 1, 0, 0)
aComponentNames = aField.stringArray("components_names")
aComponentNames.setSize(1) # one component
aComponentNames.setValue(0, "description")
-aField.integer("type").setValue(3) # string
-aField.integer("steps_nb").setValue(2) # two steps
aStamps = aField.intArray("stamps")
-aStamps.setSize(2)
+aStamps.setSize(2) # two steps
aStamps.setValue(0, 1)
aStamps.setValue(1, 3)
aTables = aField.tables("values")
-aTables.setType(3)
+aTables.setType(3) # string
aTables.setSize(1 + 1, 1, 2) # default row + number of selected, number of compoents, number of steps (tables)
aTables.setValue("-default-", 0, 0, 0) # value, index of selection, index of component, index of step
aTables.setValue("-default-", 0, 0, 1)
aComponentNames = aField.stringArray("components_names")
aComponentNames.setSize(1) # one component
aComponentNames.setValue(0, "description")
-aField.integer("type").setValue(1) # integer
-aField.integer("steps_nb").setValue(1) # one step
aStamps = aField.intArray("stamps")
-aStamps.setSize(1)
+aStamps.setSize(1) # one step
aStamps.setValue(0, 0)
aTables = aField.tables("values")
-aTables.setType(1)
+aTables.setType(1) # integer
aTables.setSize(1 + 1, 1, 1) # default row + number of selected, number of compoents, number of steps (tables)
aTables.setValue(0, 0, 0, 0) # value, index of selection, index of component, index of step
aTables.setValue(2, 1, 0, 0)
aComponentNames = aField.stringArray("components_names")
aComponentNames.setSize(1) # one component
aComponentNames.setValue(0, "description")
-aField.integer("type").setValue(0) # boolean
-aField.integer("steps_nb").setValue(1) # one step
aStamps = aField.intArray("stamps")
-aStamps.setSize(1)
+aStamps.setSize(1) # one step
aStamps.setValue(0, 0)
aTables = aField.tables("values")
-aTables.setType(0)
+aTables.setType(0) # boolean
aTables.setSize(1 + 1, 1, 1) # default row + number of selected, number of compoents, number of steps (tables)
aTables.setValue(True, 0, 0, 0) # value, index of selection, index of component, index of step
aTables.setValue(False, 1, 0, 0)