-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
-
-// File: CollectionAPI_Field.cpp
-// Created: 16 Nov 2016
-// Author: Mikhail Ponikarov
+// Copyright (C) 2014-2023 CEA, EDF
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
#include "CollectionAPI_Field.h"
//=================================================================================================
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;
}