]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #1865 : initial implementation of fields results and high level API
authormpv <mpv@opencascade.com>
Wed, 16 Nov 2016 14:20:37 +0000 (17:20 +0300)
committermpv <mpv@opencascade.com>
Wed, 16 Nov 2016 14:20:37 +0000 (17:20 +0300)
32 files changed:
src/CollectionAPI/CMakeLists.txt
src/CollectionAPI/CollectionAPI.i
src/CollectionAPI/CollectionAPI_Field.cpp [new file with mode: 0644]
src/CollectionAPI/CollectionAPI_Field.h [new file with mode: 0644]
src/CollectionPlugin/CollectionPlugin_Field.cpp
src/Model/CMakeLists.txt
src/Model/Model_AttributeTables.cpp
src/Model/Model_AttributeTables.h
src/Model/Model_Document.cpp
src/Model/Model_Document.h
src/Model/Model_Objects.cpp
src/Model/Model_Objects.h
src/Model/Model_ResultField.cpp [new file with mode: 0644]
src/Model/Model_ResultField.h [new file with mode: 0644]
src/ModelAPI/CMakeLists.txt
src/ModelAPI/ModelAPI.i
src/ModelAPI/ModelAPI_AttributeTables.h
src/ModelAPI/ModelAPI_Document.h
src/ModelAPI/ModelAPI_ResultField.cpp [new file with mode: 0644]
src/ModelAPI/ModelAPI_ResultField.h [new file with mode: 0644]
src/ModelAPI/ModelAPI_swig.h
src/ModelHighAPI/CMakeLists.txt
src/ModelHighAPI/ModelHighAPI.i
src/ModelHighAPI/ModelHighAPI_ComponentValue.cpp [new file with mode: 0644]
src/ModelHighAPI/ModelHighAPI_ComponentValue.h [new file with mode: 0644]
src/ModelHighAPI/ModelHighAPI_Dumper.cpp
src/ModelHighAPI/ModelHighAPI_Dumper.h
src/ModelHighAPI/ModelHighAPI_Integer.cpp
src/ModelHighAPI/ModelHighAPI_Integer.h
src/ModelHighAPI/ModelHighAPI_Tools.cpp
src/ModelHighAPI/ModelHighAPI_Tools.h
src/ModelHighAPI/ModelHighAPI_swig.h

index 9d43f619fed200ea49b72498acceace36cf439e1..cbe69c1f07fe33a10d813436c2dedc0f53e42f10 100644 (file)
@@ -5,10 +5,12 @@ INCLUDE(Common)
 SET(PROJECT_HEADERS
   CollectionAPI.h
   CollectionAPI_Group.h
+  CollectionAPI_Field.h
 )
 
 SET(PROJECT_SOURCES
   CollectionAPI_Group.cpp
+  CollectionAPI_Field.cpp
 )
 
 SET(PROJECT_LIBRARIES
index 0fbf143e00f6014bddcfe5260af0297efc7b3f6d..6bdd141e20a64c2f6dc875f801a000a9a02a8679 100644 (file)
@@ -10,6 +10,7 @@
 
   #include "CollectionAPI.h"
   #include "CollectionAPI_Group.h"
+  #include "CollectionAPI_Field.h"
 
 #endif // CollectionAPI_swig_H_
 %}
@@ -28,6 +29,8 @@
 
 // shared pointers
 %shared_ptr(CollectionAPI_Group)
+%shared_ptr(CollectionAPI_Field)
 
 // all supported interfaces
 %include "CollectionAPI_Group.h"
+%include "CollectionAPI_Field.h"
diff --git a/src/CollectionAPI/CollectionAPI_Field.cpp b/src/CollectionAPI/CollectionAPI_Field.cpp
new file mode 100644 (file)
index 0000000..b0441e4
--- /dev/null
@@ -0,0 +1,155 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
+
+// File:        CollectionAPI_Field.cpp
+// Created:     16 Nov 2016
+// Author:      Mikhail Ponikarov
+
+#include "CollectionAPI_Field.h"
+
+#include <ModelHighAPI_Dumper.h>
+#include <ModelHighAPI_Integer.h>
+#include <ModelHighAPI_Selection.h>
+#include <ModelHighAPI_Tools.h>
+#include <ModelHighAPI_ComponentValue.h>
+#include <ModelAPI_AttributeTables.h>
+#include <ModelAPI_AttributeStringArray.h>
+
+#include <algorithm> // for std::transform
+
+//=================================================================================================
+CollectionAPI_Field::CollectionAPI_Field(const std::shared_ptr<ModelAPI_Feature>& theFeature)
+: ModelHighAPI_Interface(theFeature)
+{
+  initialize();
+}
+
+//=================================================================================================
+CollectionAPI_Field::~CollectionAPI_Field()
+{
+}
+
+//=================================================================================================
+void CollectionAPI_Field::setSelection(const std::list<ModelHighAPI_Selection>& theFieldList)
+{
+  fillAttribute(theFieldList, myselection);
+  execute();
+}
+
+//=================================================================================================
+void CollectionAPI_Field::setComponentsNum(const ModelHighAPI_Integer& theNum)
+{
+  fillAttribute(theNum, mycomponentsNum);
+  execute();
+}
+
+//=================================================================================================
+void CollectionAPI_Field::setComponentsNames(const std::list<std::string>& theNames)
+{
+  fillAttribute(theNames, mycomponentsNames);
+  execute();
+}
+
+//=================================================================================================
+void CollectionAPI_Field::setValuesType(const std::string& theType)
+{
+  fillAttribute(int(valueTypeByStr(theType)), myvaluesType);
+  execute();
+}
+
+//=================================================================================================
+void CollectionAPI_Field::setStepsNum(const ModelHighAPI_Integer& theSteps)
+{
+  fillAttribute(theSteps, mystepsNum);
+  execute();
+}
+
+//=================================================================================================
+void CollectionAPI_Field::setStamps(const std::list<ModelHighAPI_Integer>& theStamps)
+{
+  fillAttribute(theStamps, mystamps);
+  execute();
+}
+
+//=================================================================================================
+void CollectionAPI_Field::addStep(const ModelHighAPI_Integer& theStepNum,
+  const ModelHighAPI_Integer& theStamp,
+  const std::list<std::list<ModelHighAPI_ComponentValue> >& theComponents)
+{
+  // set the table size to be sure the values are up to date
+  myvalues->setSize(myselection->size() + 1 /* with defaults */,
+    mycomponentsNum->value(), mystepsNum->value());
+
+  // set values one by one
+  int aRowIndex = 0;
+  std::list<std::list<ModelHighAPI_ComponentValue> >::const_iterator 
+    aRowsIter = theComponents.begin();
+  for(; aRowsIter != theComponents.end(); aRowsIter++, aRowIndex++) {
+    int aColIndex = 0;
+    std::list<ModelHighAPI_ComponentValue>::const_iterator aColIter = aRowsIter->begin();
+    for(; aColIter != aRowsIter->end(); aColIter++, aColIndex++) {
+      aColIter->fill(myvalues, theStepNum.intValue(), aColIndex, aRowIndex);
+    }
+  }
+  execute();
+}
+
+//=================================================================================================
+void CollectionAPI_Field::dump(ModelHighAPI_Dumper& theDumper) const
+{
+  FeaturePtr aBase = feature();
+  const std::string& aDocName = theDumper.name(aBase->document());
+
+  theDumper<<aBase<<" = model.addField("<<aDocName<<", "<<mystepsNum<<", "
+    <<strByValueType(ModelAPI_AttributeTables::ValueType(myvaluesType->value()))<<", "
+    <<mycomponentsNum->value()<<", ";
+  theDumper<<mycomponentsNames<<", ";
+  theDumper<<myselection<<")"<<std::endl;
+  // set values step by step
+  for(int aStep = 0; aStep < myvalues->tables(); aStep++) {
+    theDumper<<aBase<<".addStep("<<aStep<<", "<<mystamps->value(aStep)<<", [";
+    for(int aRow = 0; aRow < myvalues->rows(); aRow++) {
+      if (aRow != 0)
+        theDumper<<", ";
+      theDumper<<"[";
+      for(int aCol = 0; aCol < myvalues->columns(); aCol++) {
+        if (aCol != 0)
+          theDumper<<", ";
+        switch(myvalues->type()) {
+        case ModelAPI_AttributeTables::BOOLEAN:
+          theDumper<<myvalues->value(aRow, aCol, aStep).myBool;
+          break;
+        case ModelAPI_AttributeTables::INTEGER:
+          theDumper<<myvalues->value(aRow, aCol, aStep).myInt;
+          break;
+        case ModelAPI_AttributeTables::DOUBLE:
+          theDumper<<myvalues->value(aRow, aCol, aStep).myDouble;
+          break;
+        case ModelAPI_AttributeTables::STRING:
+          theDumper<<myvalues->value(aRow, aCol, aStep).myStr;
+          break;
+        }
+      }
+      theDumper<<"]";
+    }
+    theDumper<<")"<<std::endl;
+  }
+}
+
+//=================================================================================================
+FieldPtr addField(const std::shared_ptr<ModelAPI_Document>& thePart,
+                  const ModelHighAPI_Integer& theStepsNum,
+                  std::string& theComponentType,
+                  const int theComponentsNum,
+                  const std::list<std::string>& theComponentNames,
+                  const std::list<ModelHighAPI_Selection>& theSelectionList)
+{
+  std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(CollectionAPI_Field::ID());
+  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);
+
+  return aField;
+}
diff --git a/src/CollectionAPI/CollectionAPI_Field.h b/src/CollectionAPI/CollectionAPI_Field.h
new file mode 100644 (file)
index 0000000..8f0b5ec
--- /dev/null
@@ -0,0 +1,93 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
+
+// File:        CollectionAPI_Field.h
+// Created:     16 Nov 2016
+// Author:      Mikhail Ponikarov
+
+#ifndef CollectionAPI_Field_H_
+#define CollectionAPI_Field_H_
+
+#include "CollectionAPI.h"
+
+#include <CollectionPlugin_Field.h>
+
+#include <ModelHighAPI_Interface.h>
+#include <ModelHighAPI_Macro.h>
+
+class ModelHighAPI_Dumper;
+class ModelHighAPI_Selection;
+class ModelHighAPI_Integer;
+class ModelHighAPI_ComponentValue;
+
+/// \class CollectionAPI_Field
+/// \inField CPPHighAPI
+/// \brief Interface for Field feature.
+class CollectionAPI_Field: public ModelHighAPI_Interface
+{
+public:
+  /// Constructor without values.
+  COLLECTIONAPI_EXPORT
+  explicit CollectionAPI_Field(const std::shared_ptr<ModelAPI_Feature>& theFeature);
+
+  /// Destructor.
+  COLLECTIONAPI_EXPORT
+  virtual ~CollectionAPI_Field();
+
+  INTERFACE_7(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(),
+    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 */,
+    )
+
+  /// 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);
+  /// Set type of values
+  COLLECTIONAPI_EXPORT
+  void setValuesType(const std::string& theType);
+  /// Set number of steps
+  COLLECTIONAPI_EXPORT
+  void setStepsNum(const ModelHighAPI_Integer& theSteps);
+  /// Set stamps identifiers
+  COLLECTIONAPI_EXPORT
+  void setStamps(const std::list<ModelHighAPI_Integer>& theStamps);
+  /// Sets the values of specific step
+  COLLECTIONAPI_EXPORT
+  void addStep(const ModelHighAPI_Integer& theStepNum, const ModelHighAPI_Integer& theStamp,
+    const std::list<std::list<ModelHighAPI_ComponentValue> >& theComponents);
+
+  /// Dump wrapped feature
+  COLLECTIONAPI_EXPORT
+  virtual void dump(ModelHighAPI_Dumper& theDumper) const;
+};
+
+/// Pointer on Field object.
+typedef std::shared_ptr<CollectionAPI_Field> FieldPtr;
+
+/// \inField CPPHighAPI
+/// \brief Create Field feature.
+COLLECTIONAPI_EXPORT
+FieldPtr addField(const std::shared_ptr<ModelAPI_Document>& thePart,
+                  const ModelHighAPI_Integer& theStepsNum,
+                  std::string& theComponentType,
+                  const int theComponentsNum,
+                  const std::list<std::string>& theComponentNames,
+                  const std::list<ModelHighAPI_Selection>& theSelectionList);
+
+#endif // CollectionAPI_Field_H_
index d3ef250e33d077138e3b42632b6341af2e06bc0f..bc2daf57eb425add624205a406b8f8ccd28e7ed7 100644 (file)
@@ -13,6 +13,7 @@
 #include <ModelAPI_AttributeSelectionList.h>
 #include <ModelAPI_AttributeIntArray.h>
 #include <ModelAPI_AttributeTables.h>
+#include <ModelAPI_ResultField.h>
 
 CollectionPlugin_Field::CollectionPlugin_Field()
 {
@@ -32,7 +33,7 @@ void CollectionPlugin_Field::initAttributes()
 void CollectionPlugin_Field::execute()
 {
   if (results().empty() || firstResult()->isDisabled()) { // just create result if not exists
-    //ResultPtr aField = document()->createField(data());
-    //setResult(aField);
+    ResultPtr aField = document()->createField(data());
+    setResult(aField);
   }
 }
index d7f1441ed1099474a0a2c9f768d5b49adc437f49..fe49abf6a00dd04a657cccf592fa07e78ac9dd2e 100644 (file)
@@ -33,6 +33,7 @@ SET(PROJECT_HEADERS
     Model_ResultCompSolid.h
     Model_ResultConstruction.h
     Model_ResultPart.h
+    Model_ResultField.h
     Model_ResultGroup.h
     Model_ResultParameter.h
     Model_FeatureValidator.h
@@ -70,6 +71,7 @@ SET(PROJECT_SOURCES
     Model_ResultCompSolid.cpp
     Model_ResultConstruction.cpp
     Model_ResultPart.cpp
+    Model_ResultField.cpp
     Model_ResultGroup.cpp
     Model_ResultParameter.cpp
     Model_FeatureValidator.cpp
index b6c2c4e8c9f5dde20f2ec42633faa3117297f5c1..923caa3d7074eadc4a499d36675fea52c9192805 100644 (file)
@@ -163,7 +163,7 @@ void Model_AttributeTables::setType(ModelAPI_AttributeTables::ValueType theType)
   }
 }
 
-const ModelAPI_AttributeTables::ValueType& Model_AttributeTables::type(ValueType) const
+const ModelAPI_AttributeTables::ValueType& Model_AttributeTables::type() const
 {
   return myType;
 }
index 311b947515ead5dd9115299031b2e2ea774e5bf8..8752ffa72848a65cfc5ba2675ec22de04466021b 100644 (file)
@@ -44,7 +44,7 @@ public:
   /// Defines the tyoe of values in the table. If it differs from the current, erases the content.
   MODEL_EXPORT virtual void setType(ValueType theType);
   /// Defines the tyoe of values in the table. If it differs from the current, erases the content.
-  MODEL_EXPORT virtual const ValueType& type(ValueType) const;
+  MODEL_EXPORT virtual const ValueType& type() const;
   /// Defines the value by the index in the tables set (indexes are zero-based).
   MODEL_EXPORT virtual void setValue(
     const Value theValue, const int theRow, const int theColumn, const int theTable = 0);
index 61331514c539ed8b772b7178ec315ebc1a6f7141..c8b567cf72be377dc583fac64e9aebebe231647e 100755 (executable)
@@ -1170,6 +1170,12 @@ std::shared_ptr<ModelAPI_ResultGroup> Model_Document::createGroup(
   return myObjs->createGroup(theFeatureData, theIndex);
 }
 
+std::shared_ptr<ModelAPI_ResultField> Model_Document::createField(
+    const std::shared_ptr<ModelAPI_Data>& theFeatureData, const int theIndex)
+{
+  return myObjs->createField(theFeatureData, theIndex);
+}
+
 std::shared_ptr<ModelAPI_ResultParameter> Model_Document::createParameter(
       const std::shared_ptr<ModelAPI_Data>& theFeatureData, const int theIndex)
 {
index 0fe3b29888a770b0a253bc6d402f648dd98419df..80daeb237f27a8ccc4d089b077d5a7c779b3f56e 100644 (file)
@@ -174,6 +174,9 @@ class Model_Document : public ModelAPI_Document
   /// Creates a group result
   MODEL_EXPORT virtual std::shared_ptr<ModelAPI_ResultGroup> createGroup(
       const std::shared_ptr<ModelAPI_Data>& theFeatureData, const int theIndex = 0);
+  /// Creates a field result
+  MODEL_EXPORT virtual std::shared_ptr<ModelAPI_ResultField> createField(
+      const std::shared_ptr<ModelAPI_Data>& theFeatureData, const int theIndex = 0);
   /// Creates a parameter result
   MODEL_EXPORT virtual std::shared_ptr<ModelAPI_ResultParameter> createParameter(
       const std::shared_ptr<ModelAPI_Data>& theFeatureData, const int theIndex = 0);
index 715bc6896794871c6d61e8b00568d637303eb65a..164b088207d493e5e0fbef70db6dc2017b05da16 100644 (file)
@@ -14,6 +14,7 @@
 #include <Model_ResultBody.h>
 #include <Model_ResultCompSolid.h>
 #include <Model_ResultGroup.h>
+#include <Model_ResultField.h>
 #include <Model_ResultParameter.h>
 #include <ModelAPI_Validator.h>
 #include <ModelAPI_CompositeFeature.h>
@@ -1008,6 +1009,23 @@ std::shared_ptr<ModelAPI_ResultGroup> Model_Objects::createGroup(
   return aResult;
 }
 
+std::shared_ptr<ModelAPI_ResultField> Model_Objects::createField(
+    const std::shared_ptr<ModelAPI_Data>& theFeatureData, const int theIndex)
+{
+  TDF_Label aLab = resultLabel(theFeatureData, theIndex);
+  TDataStd_Comment::Set(aLab, ModelAPI_ResultField::group().c_str());
+  ObjectPtr anOldObject = object(aLab);
+  std::shared_ptr<ModelAPI_ResultField> aResult;
+  if (anOldObject.get()) {
+    aResult = std::dynamic_pointer_cast<ModelAPI_ResultField>(anOldObject);
+  }
+  if (!aResult.get()) {
+    aResult = std::shared_ptr<ModelAPI_ResultField>(new Model_ResultField(theFeatureData));
+    storeResult(theFeatureData, aResult, theIndex);
+  }
+  return aResult;
+}
+
 std::shared_ptr<ModelAPI_ResultParameter> Model_Objects::createParameter(
       const std::shared_ptr<ModelAPI_Data>& theFeatureData, const int theIndex)
 {
@@ -1106,6 +1124,8 @@ void Model_Objects::updateResults(FeaturePtr theFeature)
           break;
         } else if (aGroup->Get() == ModelAPI_ResultGroup::group().c_str()) {
           aNewBody = createGroup(theFeature->data(), aResIndex);
+        } else if (aGroup->Get() == ModelAPI_ResultField::group().c_str()) {
+          aNewBody = createField(theFeature->data(), aResIndex);
         } else if (aGroup->Get() == ModelAPI_ResultParameter::group().c_str()) {
           theFeature->attributeChanged("expression"); // just produce a value
           break;
index 23ae72453252cbcd35df21c2aae225fd35f317d2..af366689b81557d544219a97d764fc0d39750002 100644 (file)
@@ -116,6 +116,9 @@ class Model_Objects
   /// Creates a group result
   std::shared_ptr<ModelAPI_ResultGroup> createGroup(
       const std::shared_ptr<ModelAPI_Data>& theFeatureData, const int theIndex = 0);
+  /// Creates a field result
+  std::shared_ptr<ModelAPI_ResultField> createField(
+      const std::shared_ptr<ModelAPI_Data>& theFeatureData, const int theIndex = 0);
   /// Creates a parameter result
   std::shared_ptr<ModelAPI_ResultParameter> createParameter(
       const std::shared_ptr<ModelAPI_Data>& theFeatureData, const int theIndex = 0);
diff --git a/src/Model/Model_ResultField.cpp b/src/Model/Model_ResultField.cpp
new file mode 100644 (file)
index 0000000..15509ef
--- /dev/null
@@ -0,0 +1,46 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+// File:        Model_ResultField.cpp
+// Created:     08 Jul 2014
+// Author:      Mikhail PONIKAROV
+
+#include <Model_ResultField.h>
+#include <ModelAPI_AttributeSelectionList.h>
+
+#include <GeomAlgoAPI_CompoundBuilder.h>
+
+#include <Config_PropManager.h>
+
+Model_ResultField::Model_ResultField(std::shared_ptr<ModelAPI_Data> theOwnerData)
+{
+  myOwnerData = theOwnerData;
+}
+
+void Model_ResultField::colorConfigInfo(std::string& theSection, std::string& theName,
+                                       std::string& theDefault)
+{
+  theSection = "Visualization";
+  theName = "result_field_color";
+  theDefault = DEFAULT_COLOR();
+}
+
+std::shared_ptr<GeomAPI_Shape> Model_ResultField::shape()
+{
+  std::shared_ptr<GeomAPI_Shape> aResult;
+  if (myOwnerData) {
+    AttributeSelectionListPtr aList = myOwnerData->selectionList("selected");
+    if (aList) {
+      std::list<std::shared_ptr<GeomAPI_Shape> > aSubs;
+      for(int a = aList->size() - 1; a >= 0; a--) {
+        std::shared_ptr<GeomAPI_Shape> aSelection = aList->value(a)->value();
+        if (aSelection && !aSelection->isNull()) {
+          aSubs.push_back(aSelection);
+        }
+      }
+      if (!aSubs.empty()) {
+        aResult = GeomAlgoAPI_CompoundBuilder::compound(aSubs);
+      }
+    }
+  }
+  return aResult;
+}
diff --git a/src/Model/Model_ResultField.h b/src/Model/Model_ResultField.h
new file mode 100644 (file)
index 0000000..b895428
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+// File:        Model_ResultField.h
+// Created:     16 Nov 2016
+// Author:      Mikhail PONIKAROV
+
+#ifndef Model_ResultField_H_
+#define Model_ResultField_H_
+
+#include "Model.h"
+#include <ModelAPI_ResultField.h>
+
+/**\class Model_ResultField
+ * \ingroup DataModel
+ * \brief The fields result.
+ *
+ * Provides a compound of selected elements, without storage, one the fly.
+ */
+class Model_ResultField : public ModelAPI_ResultField
+{
+  std::shared_ptr<ModelAPI_Data> myOwnerData;  ///< data of owner of this result
+public:
+
+  /// Retuns the parameters of color definition in the resources config manager
+  MODEL_EXPORT virtual void colorConfigInfo(std::string& theSection, std::string& theName,
+                                            std::string& theDefault);
+
+  /// Returns the compound of selected entities
+  MODEL_EXPORT virtual std::shared_ptr<GeomAPI_Shape> shape();
+
+  /// Removes the stored builders
+  MODEL_EXPORT virtual ~Model_ResultField() {}
+
+protected:
+  /// Makes a body on the given feature data
+  Model_ResultField(std::shared_ptr<ModelAPI_Data> theOwnerData);
+
+  friend class Model_Objects;
+};
+
+#endif
index 011828a4cf629b456f5947d83e6192a51029f38d..6fbe8f77e0b606137e6e517bfcee17e2ef94f2d3 100644 (file)
@@ -38,6 +38,7 @@ SET(PROJECT_HEADERS
     ModelAPI_ResultBody.h
     ModelAPI_ResultCompSolid.h
     ModelAPI_ResultConstruction.h
+    ModelAPI_ResultField.h
     ModelAPI_ResultGroup.h
     ModelAPI_ResultParameter.h
     ModelAPI_ResultPart.h
@@ -78,6 +79,7 @@ SET(PROJECT_SOURCES
     ModelAPI_ResultBody.cpp
     ModelAPI_ResultCompSolid.cpp
     ModelAPI_ResultConstruction.cpp
+    ModelAPI_ResultField.cpp
     ModelAPI_ResultGroup.cpp
     ModelAPI_ResultPart.cpp
     ModelAPI_ResultParameter.cpp
index d4f81591a8d3c2da40b8294173509bb8642d7d65..b0cab6686e48afc0c7a4afb5c0d97422313c3d76 100644 (file)
@@ -66,6 +66,7 @@
 %shared_ptr(ModelAPI_ResultBody)
 %shared_ptr(ModelAPI_ResultPart)
 %shared_ptr(ModelAPI_ResultGroup)
+%shared_ptr(ModelAPI_ResultField)
 %shared_ptr(ModelAPI_ResultParameter)
 %shared_ptr(ModelAPI_ResultCompSolid)
 
 %include "ModelAPI_ResultBody.h"
 %include "ModelAPI_ResultPart.h"
 %include "ModelAPI_ResultGroup.h"
+%include "ModelAPI_ResultField.h"
 %include "ModelAPI_ResultParameter.h"
 %include "ModelAPI_Tools.h"
 %include "ModelAPI_ResultCompSolid.h"
@@ -127,6 +129,7 @@ template<class T1, class T2> std::shared_ptr<T1> shared_ptr_cast(std::shared_ptr
 %template(modelAPI_ResultPart) shared_ptr_cast<ModelAPI_ResultPart, ModelAPI_Result>;
 %template(modelAPI_ResultParameter) shared_ptr_cast<ModelAPI_ResultParameter, ModelAPI_Result>;
 %template(modelAPI_ResultGroup) shared_ptr_cast<ModelAPI_ResultPart, ModelAPI_ResultGroup>;
+%template(modelAPI_ResultField) shared_ptr_cast<ModelAPI_ResultPart, ModelAPI_ResultField>;
 %template(modelAPI_ResultCompSolid) shared_ptr_cast<ModelAPI_ResultCompSolid, ModelAPI_ResultBody>;
 
 // Attribute casts
index 1fe3e9614d694dcb0de79f5f8f97c826e6f22e66..2534897851eb4e02eacdf67379071a8dd21797ed 100644 (file)
@@ -55,13 +55,13 @@ public:
   /// Defines the tyoe of values in the table. If it differs from the current, erases the content.
   MODELAPI_EXPORT virtual void setType(ValueType theType) = 0;
   /// Defines the tyoe of values in the table. If it differs from the current, erases the content.
-  MODELAPI_EXPORT virtual const ValueType& type(ValueType) const = 0;
+  MODELAPI_EXPORT virtual const ValueType& type() const = 0;
   /// Defines the value by the index in the tables set (indexes are zero-based).
   MODELAPI_EXPORT virtual void setValue(
-    const Value theValue, const int theRow, const int theColumn, const int theTable = 1) = 0;
+    const Value theValue, const int theRow, const int theColumn, const int theTable = 0) = 0;
   /// Returns the value by the index (indexes are zero-based).
   MODELAPI_EXPORT virtual Value value(
-    const int theRow, const int theColumn, const int theTable = 1) = 0;
+    const int theRow, const int theColumn, const int theTable = 0) = 0;
 
   /// Returns the type of this class of attributes
   MODELAPI_EXPORT static std::string typeId()
index 8e6f138ad28f901b58ca6dfac58a60a272608ffc..90b87621b71869b567d5e2c7640124583fa07ecf 100644 (file)
@@ -23,6 +23,7 @@ class ModelAPI_ResultConstruction;
 class ModelAPI_ResultBody;
 class ModelAPI_ResultPart;
 class ModelAPI_ResultGroup;
+class ModelAPI_ResultField;
 class ModelAPI_ResultParameter;
 class ModelAPI_Data;
 class GeomAPI_Shape;
@@ -140,6 +141,9 @@ public:
   //! Creates a group result
   virtual std::shared_ptr<ModelAPI_ResultGroup> createGroup(
       const std::shared_ptr<ModelAPI_Data>& theFeatureData, const int theIndex = 0) = 0;
+  //! Creates a field result
+  virtual std::shared_ptr<ModelAPI_ResultField> createField(
+      const std::shared_ptr<ModelAPI_Data>& theFeatureData, const int theIndex = 0) = 0;
   //! Creates a parameter result
   virtual std::shared_ptr<ModelAPI_ResultParameter> createParameter(
       const std::shared_ptr<ModelAPI_Data>& theFeatureData, const int theIndex = 0) = 0;
diff --git a/src/ModelAPI/ModelAPI_ResultField.cpp b/src/ModelAPI/ModelAPI_ResultField.cpp
new file mode 100644 (file)
index 0000000..20fd5c4
--- /dev/null
@@ -0,0 +1,17 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+// File:        ModelAPI_ResultField.cpp
+// Created:     16 Nov 2016
+// Author:      Mikhail PONIKAROV
+
+#include "ModelAPI_ResultField.h"
+
+ModelAPI_ResultField::~ModelAPI_ResultField()
+{
+
+}
+
+std::string ModelAPI_ResultField::groupName()
+{
+  return group();
+}
diff --git a/src/ModelAPI/ModelAPI_ResultField.h b/src/ModelAPI/ModelAPI_ResultField.h
new file mode 100644 (file)
index 0000000..65888b5
--- /dev/null
@@ -0,0 +1,47 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+// File:        ModelAPI_ResultField.hxx
+// Created:     16 Nov 2016
+// Author:      Mikhail PONIKAROV
+
+#ifndef ModelAPI_ResultField_H_
+#define ModelAPI_ResultField_H_
+
+#include "ModelAPI_Result.h"
+#include <GeomAPI_Shape.h>
+#include <memory>
+#include <string>
+
+/**\class ModelAPI_ResultField
+ * \ingroup DataModel
+ * \brief The fields result.
+ *
+ * Provides a compound of selected elements, without storage, one the fly.
+ */
+class ModelAPI_ResultField : public ModelAPI_Result
+{
+public:
+  MODELAPI_EXPORT virtual ~ModelAPI_ResultField();
+  /// Returns the group identifier of this result
+  MODELAPI_EXPORT virtual std::string groupName();
+
+  /// Returns the group identifier of this result
+  inline static std::string group()
+  {
+    static std::string MY_GROUP = "Fields";
+    return MY_GROUP;
+  }
+
+  /// default color for a result body
+  inline static const std::string& DEFAULT_COLOR()
+  {
+    static const std::string RESULT_GROUP_COLOR("150,150,180");
+    return RESULT_GROUP_COLOR;
+  }
+
+};
+
+//! Pointer on feature object
+typedef std::shared_ptr<ModelAPI_ResultField> ResultFieldPtr;
+
+#endif
index cfc4ce703f237fa38aa9f9cd2c44af01c28be91c..157cf66ee01fd36fdd1d9f798fb0672eb3f4e802 100644 (file)
@@ -43,6 +43,7 @@
   #include "ModelAPI_ResultPart.h"
   #include "ModelAPI_ResultParameter.h"
   #include "ModelAPI_ResultGroup.h"
+  #include "ModelAPI_ResultField.h"
   #include "ModelAPI_Tools.h"
   #include "ModelAPI_ResultCompSolid.h"
 
index 9607e5fa2fbc8616f882ad1a45ccb455c935f78a..76e151451c1d22e415e101f62a41091a9dbf20c0 100644 (file)
@@ -12,6 +12,7 @@ SET(PROJECT_HEADERS
   ModelHighAPI_RefAttr.h
   ModelHighAPI_Reference.h
   ModelHighAPI_Selection.h
+  ModelHighAPI_ComponentValue.h
   ModelHighAPI_Services.h
   ModelHighAPI_Tools.h
   ModelHighAPI_FeatureStore.h
@@ -25,6 +26,7 @@ SET(PROJECT_SOURCES
   ModelHighAPI_RefAttr.cpp
   ModelHighAPI_Reference.cpp
   ModelHighAPI_Selection.cpp
+  ModelHighAPI_ComponentValue.cpp
   ModelHighAPI_Services.cpp
   ModelHighAPI_Tools.cpp
   ModelHighAPI_FeatureStore.cpp
index 2ad5dc461571a9b09b04abed28a3e974c014463a..0d2daf0f31f1f8c7da8fa880d4a3345889e3c071 100644 (file)
 %include "ModelHighAPI_RefAttr.h"
 %include "ModelHighAPI_Reference.h"
 %include "ModelHighAPI_Selection.h"
+%include "ModelHighAPI_ComponentValue.h"
 %include "ModelHighAPI_Services.h"
 %include "ModelHighAPI_Macro.h"
 %include "ModelHighAPI_Tools.h"
diff --git a/src/ModelHighAPI/ModelHighAPI_ComponentValue.cpp b/src/ModelHighAPI/ModelHighAPI_ComponentValue.cpp
new file mode 100644 (file)
index 0000000..9c20968
--- /dev/null
@@ -0,0 +1,75 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+// Name   : ModelHighAPI_ComponentValue.cpp
+// Purpose:
+//
+// History:
+// 29/03/16 - Sergey POKHODENKO - Creation of the file
+
+//--------------------------------------------------------------------------------------
+#include "ModelHighAPI_ComponentValue.h"
+
+#include <ModelAPI_AttributeInteger.h>
+
+#include <sstream>
+
+//--------------------------------------------------------------------------------------
+ModelHighAPI_ComponentValue::ModelHighAPI_ComponentValue(const bool theValue)
+  : myType(ModelAPI_AttributeTables::BOOLEAN)
+{
+  // initialize everything since in python there may be problem with correct typification
+  myValue.myBool = theValue;
+  myValue.myInt = theValue ? 1 : 0;
+  myValue.myDouble = theValue ? 1. : 0.;
+  myValue.myStr = theValue ? "True" : "False";
+}
+//--------------------------------------------------------------------------------------
+ModelHighAPI_ComponentValue::ModelHighAPI_ComponentValue(const int theValue)
+  : myType(ModelAPI_AttributeTables::INTEGER)
+{
+  // initialize everything since in python there may be problem with correct typification
+  myValue.myBool = theValue == 0 ? false : true;
+  myValue.myInt = theValue;
+  myValue.myDouble = theValue;
+  std::ostringstream s;
+  s << theValue;
+  myValue.myStr = s.str();
+}
+//--------------------------------------------------------------------------------------
+ModelHighAPI_ComponentValue::ModelHighAPI_ComponentValue(const double theValue)
+  : myType(ModelAPI_AttributeTables::DOUBLE)
+{
+  // initialize everything since in python there may be problem with correct typification
+  myValue.myBool = theValue == 0. ? false : true;
+  myValue.myInt = int(theValue);
+  myValue.myDouble = theValue;
+  std::ostringstream s;
+  s << theValue;
+  myValue.myStr = s.str();
+}
+//--------------------------------------------------------------------------------------
+ModelHighAPI_ComponentValue::ModelHighAPI_ComponentValue(const std::string& theValue)
+  : myType(ModelAPI_AttributeTables::STRING)
+{
+  myValue.myBool = (theValue.empty() || theValue == "False" || theValue == "0") ? false : true;
+
+  std::stringstream stream1(theValue);
+  myValue.myInt = 0;
+  stream1 >> myValue.myInt;
+  std::stringstream stream2(theValue);
+  myValue.myDouble = 0.;
+  stream2 >> myValue.myDouble;
+
+  myValue.myStr = theValue;
+}
+
+//--------------------------------------------------------------------------------------
+ModelHighAPI_ComponentValue::~ModelHighAPI_ComponentValue()
+{
+}
+
+//--------------------------------------------------------------------------------------
+void ModelHighAPI_ComponentValue::fill(const std::shared_ptr<ModelAPI_AttributeTables>& theAttr,
+    const int theTable, const int theColumn, const int theRow) const
+{
+  theAttr->setValue(myValue, theRow, theColumn, theTable);
+}
diff --git a/src/ModelHighAPI/ModelHighAPI_ComponentValue.h b/src/ModelHighAPI/ModelHighAPI_ComponentValue.h
new file mode 100644 (file)
index 0000000..d7dd41c
--- /dev/null
@@ -0,0 +1,46 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+// Name   : ModelHighAPI_ComponentValue.h
+// Purpose:
+//
+// History:
+// 16/11/16 - Mikhail Ponikarov - Creation of the file
+
+#ifndef SRC_MODELHIGHAPI_ModelHighAPI_ComponentValue_H_
+#define SRC_MODELHIGHAPI_ModelHighAPI_ComponentValue_H_
+
+//--------------------------------------------------------------------------------------
+#include "ModelHighAPI.h"
+
+#include <ModelAPI_AttributeTables.h>
+
+//--------------------------------------------------------------------------------------
+/**\class ModelHighAPI_ComponentValue
+ * \ingroup CPPHighAPI
+ * \brief Class for filling ModelAPI_AttributeTable elements
+ */
+class ModelHighAPI_ComponentValue
+{
+public:
+  /// Constructor for Boolean
+  MODELHIGHAPI_EXPORT ModelHighAPI_ComponentValue(const bool theValue = false);
+  /// Constructor for int
+  MODELHIGHAPI_EXPORT ModelHighAPI_ComponentValue(const int theValue);
+  /// Constructor for double
+  MODELHIGHAPI_EXPORT ModelHighAPI_ComponentValue(const double theValue);
+  /// Constructor for std::string
+  MODELHIGHAPI_EXPORT ModelHighAPI_ComponentValue(const std::string & theValue);
+  /// Destructor
+  MODELHIGHAPI_EXPORT virtual ~ModelHighAPI_ComponentValue();
+
+  /// Sets value to the table
+  MODELHIGHAPI_EXPORT virtual void fill(const std::shared_ptr<ModelAPI_AttributeTables>& theAttr,
+    const int theTable, const int theColumn, const int theRow) const;
+
+private:
+  ModelAPI_AttributeTables::ValueType myType; ///< type of the value set
+  ModelAPI_AttributeTables::Value myValue; ///< value itself
+};
+
+//--------------------------------------------------------------------------------------
+//--------------------------------------------------------------------------------------
+#endif /* SRC_MODELHIGHAPI_ModelHighAPI_ComponentValue_H_ */
index 09338cc1c089a2e8a4a18a205ef190eed489226b..1176de251e001ef09757c5da6134a53f99c1ee79 100644 (file)
@@ -28,6 +28,7 @@
 #include <ModelAPI_AttributeSelection.h>
 #include <ModelAPI_AttributeSelectionList.h>
 #include <ModelAPI_AttributeString.h>
+#include <ModelAPI_AttributeStringArray.h>
 #include <ModelAPI_CompositeFeature.h>
 #include <ModelAPI_Document.h>
 #include <ModelAPI_Entity.h>
@@ -833,8 +834,22 @@ ModelHighAPI_Dumper& ModelHighAPI_Dumper::operator<<(
   return *this;
 }
 
+ModelHighAPI_Dumper& ModelHighAPI_Dumper::operator<<(
+  const std::shared_ptr<ModelAPI_AttributeStringArray>& theArray)
+{
+  myDumpBuffer<<"[";
+  for(int anIndex = 0; anIndex < theArray->size(); ++anIndex) {
+
+    myDumpBuffer<<"\""<<theArray->value(anIndex)<<"\"";
+    if (anIndex != 0)
+      myDumpBuffer<<", ";
+  }
+
+  myDumpBuffer<<"]";
+  return *this;
+}
+
 /// Dump std::endl
-MODELHIGHAPI_EXPORT
 ModelHighAPI_Dumper& operator<<(ModelHighAPI_Dumper& theDumper,
                                 std::basic_ostream<char>& (*theEndl)(std::basic_ostream<char>&))
 {
index d124548611d8e0d98541c0164c5500b11d310fed..ee432d271dad58dee3cf395d979d814d9324e456 100644 (file)
@@ -35,6 +35,7 @@ class ModelAPI_AttributeRefList;
 class ModelAPI_AttributeSelection;
 class ModelAPI_AttributeSelectionList;
 class ModelAPI_AttributeString;
+class ModelAPI_AttributeStringArray;
 class ModelAPI_CompositeFeature;
 class ModelAPI_Document;
 class ModelAPI_Entity;
@@ -214,6 +215,9 @@ public:
   /// Dump AttributeReference
   MODELHIGHAPI_EXPORT ModelHighAPI_Dumper&
   operator<<(const std::shared_ptr<ModelAPI_AttributeReference>& theReference);
+  /// Dump AttributeStringArray
+  MODELHIGHAPI_EXPORT ModelHighAPI_Dumper&
+    operator<<(const std::shared_ptr<ModelAPI_AttributeStringArray>& theArray);
 
   /// Clear dump buffer
   MODELHIGHAPI_EXPORT
index 3742dc5fad7487d457225106c3ff0b6bc123f724..fc17205d6608ca440596b79ac9b8f06c2635438e 100644 (file)
@@ -43,3 +43,9 @@ void ModelHighAPI_Integer::fillAttribute(
     case VT_STRING: theAttribute->setText(myString); return;
   }
 }
+
+int ModelHighAPI_Integer::intValue() const
+{
+  // needed for array of integer, which supports no text
+  return myInt;
+}
index 35fb0d77f20fd0be0f4cb532b04ab062a812646b..111e8fbf459164db412396e86743bbdb0f446e22 100644 (file)
@@ -25,7 +25,7 @@ class ModelHighAPI_Integer
 public:
   /// Constructor for int
   MODELHIGHAPI_EXPORT
-  ModelHighAPI_Integer(int theValue = 0.);
+  ModelHighAPI_Integer(int theValue = 0);
   /// Constructor for std::string
   MODELHIGHAPI_EXPORT
   ModelHighAPI_Integer(const std::string & theValue);
@@ -40,6 +40,9 @@ public:
   MODELHIGHAPI_EXPORT
   virtual void fillAttribute(const std::shared_ptr<ModelAPI_AttributeInteger> & theAttribute) const;
 
+  /// Returns a value (must be used only for attributes which support no text)
+  MODELHIGHAPI_EXPORT virtual int intValue() const;
+
 private:
   enum VariantType { VT_INT, VT_STRING } myVariantType;
   int myInt;
index 76b914b19ab3d0ba9d588e5426da67e674612f29..119a0a1ebe7419fde56a05551a71a9065197b255 100644 (file)
@@ -29,6 +29,7 @@
 #include <ModelAPI_AttributeSelection.h>
 #include <ModelAPI_AttributeSelectionList.h>
 #include <ModelAPI_AttributeString.h>
+#include <ModelAPI_AttributeStringArray.h>
 #include <ModelAPI_AttributeDoubleArray.h>
 #include <ModelAPI_Session.h>
 #include <ModelAPI_Tools.h>
@@ -194,12 +195,36 @@ void fillAttribute(const std::string & theValue,
 {
   theAttribute->setValue(theValue);
 }
+
+//--------------------------------------------------------------------------------------
 void fillAttribute(const char * theValue,
                    const std::shared_ptr<ModelAPI_AttributeString> & theAttribute)
 {
   theAttribute->setValue(theValue);
 }
 
+//--------------------------------------------------------------------------------------
+void fillAttribute(const std::list<std::string> & theValue,
+                   const std::shared_ptr<ModelAPI_AttributeStringArray> & theAttribute)
+{
+  theAttribute->setSize(int(theValue.size()));
+
+  int anIndex = 0;
+  for (auto it = theValue.begin(); it != theValue.end(); ++it, ++anIndex)
+    theAttribute->setValue(anIndex, *it); 
+}
+
+//--------------------------------------------------------------------------------------
+void fillAttribute(const std::list<ModelHighAPI_Integer> & theValue,
+                   const std::shared_ptr<ModelAPI_AttributeIntArray> & theAttribute)
+{
+  theAttribute->setSize(int(theValue.size()));
+
+  int anIndex = 0;
+  for (auto it = theValue.begin(); it != theValue.end(); ++it, ++anIndex)
+    theAttribute->setValue(anIndex, it->intValue()); // use only values, no text support in array
+}
+
 //==================================================================================================
 GeomAPI_Shape::ShapeType shapeTypeByStr(std::string theShapeTypeStr)
 {
@@ -260,6 +285,32 @@ GeomAPI_Shape::ShapeType getShapeType(const ModelHighAPI_Selection& theSelection
   return aShapeType;
 }
 
+//--------------------------------------------------------------------------------------
+ModelAPI_AttributeTables::ValueType valueTypeByStr(const std::string& theValueTypeStr)
+{
+  std::string aType = theValueTypeStr;
+  std::transform(aType.begin(), aType.end(), aType.begin(), ::tolower);
+  if (aType == "boolean")
+    return ModelAPI_AttributeTables::BOOLEAN;
+  else if (aType == "integer")
+    return ModelAPI_AttributeTables::INTEGER;
+  else if (aType == "string")
+    return ModelAPI_AttributeTables::STRING;
+  return ModelAPI_AttributeTables::DOUBLE; // default
+}
+
+//--------------------------------------------------------------------------------------
+std::string strByValueType(const ModelAPI_AttributeTables::ValueType theType)
+{
+  switch(theType) {
+  case ModelAPI_AttributeTables::BOOLEAN: return "BOOLEAN";
+  case ModelAPI_AttributeTables::INTEGER: return "INTEGER";
+  case ModelAPI_AttributeTables::DOUBLE: return "DOUBLE";
+  case ModelAPI_AttributeTables::STRING: return "STRING";
+  }
+  return ""; // bad case
+}
+
 /// stores the features information, recoursively stores sub-documetns features
 std::string storeFeatures(const std::string& theDocName, DocumentPtr theDoc,
   std::map<std::string, std::map<std::string, ModelHighAPI_FeatureStore> >& theStore,
index 74198a3cfb3d31c3f41ef8703d7f40a4a87f3068..fc59e5edc71d8ae0fb1bac9ae00b8a5e2b4bb4b3 100644 (file)
@@ -10,6 +10,7 @@
 
 //--------------------------------------------------------------------------------------
 #include "ModelHighAPI.h"
+#include <ModelAPI_AttributeTables.h>
 
 #include <GeomAPI_Shape.h>
 
@@ -36,6 +37,7 @@ class ModelAPI_AttributeRefList;
 class ModelAPI_AttributeSelection;
 class ModelAPI_AttributeSelectionList;
 class ModelAPI_AttributeString;
+class ModelAPI_AttributeStringArray;
 class ModelAPI_Object;
 //--------------------------------------------------------------------------------------
 class ModelHighAPI_Double;
@@ -124,12 +126,26 @@ MODELHIGHAPI_EXPORT
 void fillAttribute(const char * theValue,
                    const std::shared_ptr<ModelAPI_AttributeString> & theAttribute);
 
+MODELHIGHAPI_EXPORT
+void fillAttribute(const std::list<std::string> & theValue,
+                   const std::shared_ptr<ModelAPI_AttributeStringArray> & theAttribute);
+
+MODELHIGHAPI_EXPORT
+void fillAttribute(const std::list<ModelHighAPI_Integer> & theValue,
+                   const std::shared_ptr<ModelAPI_AttributeIntArray> & theAttribute);
+
 MODELHIGHAPI_EXPORT
 GeomAPI_Shape::ShapeType shapeTypeByStr(std::string theShapeTypeStr);
 
 MODELHIGHAPI_EXPORT
 GeomAPI_Shape::ShapeType getShapeType(const ModelHighAPI_Selection& theSelection);
 
+MODELHIGHAPI_EXPORT 
+ModelAPI_AttributeTables::ValueType valueTypeByStr(const std::string& theValueTypeStr);
+
+MODELHIGHAPI_EXPORT 
+std::string strByValueType(const ModelAPI_AttributeTables::ValueType theType);
+
 /// Performs the high level API dump, then closes all and executes the script:
 /// model must be recreated fully, with all attributes
 /// \returns true if check is well done
index c9230d49ef728b4bfd1af5784d03ebd4668d7a58..250b8f8666c6515a60e07f28f8555235b453513a 100644 (file)
@@ -20,6 +20,7 @@
   #include "ModelHighAPI_RefAttr.h"
   #include "ModelHighAPI_Reference.h"
   #include "ModelHighAPI_Selection.h"
+  #include "ModelHighAPI_ComponentValue.h"
   #include "ModelHighAPI_Services.h"
   #include "ModelHighAPI_Tools.h"