X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FCollectionAPI%2FCollectionAPI_Field.cpp;h=e1337dafb20f01218c380d4b4e9b51c1b4885673;hb=0a332f5f970393cdf4d83f92aafd629dbe20b607;hp=98110e8614372fb272e78498ad9f7d00b2f000c8;hpb=6aad2cb97127ef5663ff507d8e84b1c277c05a16;p=modules%2Fshaper.git diff --git a/src/CollectionAPI/CollectionAPI_Field.cpp b/src/CollectionAPI/CollectionAPI_Field.cpp index 98110e861..e1337dafb 100644 --- a/src/CollectionAPI/CollectionAPI_Field.cpp +++ b/src/CollectionAPI/CollectionAPI_Field.cpp @@ -1,8 +1,21 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D --> - -// File: CollectionAPI_Field.cpp -// Created: 16 Nov 2016 -// Author: Mikhail Ponikarov +// Copyright (C) 2014-2019 CEA/DEN, EDF R&D +// +// 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" @@ -44,7 +57,6 @@ void CollectionAPI_Field::setComponentsNames(const std::list& theNa //================================================================================================= void CollectionAPI_Field::setValuesType(const std::string& theType) { - fillAttribute(int(valueTypeByStr(theType)), myvaluesType); myvalues->setType(valueTypeByStr(theType)); execute(); } @@ -52,7 +64,6 @@ void CollectionAPI_Field::setValuesType(const std::string& theType) //================================================================================================= void CollectionAPI_Field::setStepsNum(const ModelHighAPI_Integer& theSteps) { - fillAttribute(theSteps, mystepsNum); mystamps->setSize(theSteps.intValue()); execute(); } @@ -70,8 +81,6 @@ void CollectionAPI_Field::addStep(const ModelHighAPI_Integer& theStepNum, \ const ModelHighAPI_Integer& theStamp, \ const std::list >& theComponents) \ { \ - myvalues->setSize(myselection->size() + 1, \ - mycomponentsNames->size(), mystepsNum->value()); \ mystamps->setValue(theStepNum.intValue(), theStamp.intValue()); \ int aRowIndex = 0; \ std::list >::const_iterator \ @@ -101,9 +110,8 @@ void CollectionAPI_Field::dump(ModelHighAPI_Dumper& theDumper) const FeaturePtr aBase = feature(); const std::string& aDocName = theDumper.name(aBase->document()); - theDumper<value()<<", \"" - <value()))<<"\", " - <size()<<", "; + theDumper<tables()<<", \"" + <type())<<"\", "<size()<<", "; theDumper<columns(); aCol++) { if (aCol != 0) theDumper<<", "; - switch(myvaluesType->value()) { + switch(myvalues->type()) { case ModelAPI_AttributeTables::BOOLEAN: theDumper<value(aRow, aCol, aStep).myBool; break; @@ -137,6 +145,11 @@ void CollectionAPI_Field::dump(ModelHighAPI_Dumper& theDumper) const } } +std::shared_ptr CollectionAPI_Field::tableValues() +{ + return myvalues; +} + //================================================================================================= FieldPtr addField(const std::shared_ptr& thePart, const ModelHighAPI_Integer& theStepsNum, @@ -151,6 +164,8 @@ FieldPtr addField(const std::shared_ptr& thePart, aField->setValuesType(theComponentType); aField->setComponentsNames(theComponentNames); aField->setSelection(theSelectionList); + aField->tableValues()->setSize( + int(theSelectionList.size() + 1), theComponentsNum, theStepsNum.intValue()); return aField; }