#include <ModelAPI_AttributeSelectionList.h>
#include <ModelAPI_AttributeIntArray.h>
#include <ModelAPI_ResultGroup.h>
+#include <ModelAPI_Tools.h>
#include <sstream>
CollectionPlugin_Group::CollectionPlugin_Group()
AttributeSelectionListPtr aNewList = aNew->selectionList(LIST_ID());
aNewList->setSelectionType(aList->selectionType());
aNewList->append(anOldAttr->contextObject(), anOldAttr->value());
+ aNew->execute();
aResults.push_front(aNew); // to keep the order
}
aResults.push_back(data()->owner());
int aResSuf = aSuffix - 1;
std::string aResName = findName(firstResult()->data()->name(), aResSuf, aResNames);
aFeat->firstResult()->data()->setName(aResName);
- // set the same color of result as in origin
- if (firstResult()->data()->attribute(ModelAPI_Result::COLOR_ID()).get()) {
- AttributeIntArrayPtr aSourceColor =
- firstResult()->data()->intArray(ModelAPI_Result::COLOR_ID());
- if (aSourceColor.get() && aSourceColor->size()) {
- AttributeIntArrayPtr aDestColor =
- aFeat->firstResult()->data()->intArray(ModelAPI_Result::COLOR_ID());
- aDestColor->setSize(aSourceColor->size());
- for(int a = 0; a < aSourceColor->size(); a++)
- aDestColor->setValue(a, aSourceColor->value(a));
- }
- }
+ ModelAPI_Tools::copyVisualizationAttrs(firstResult(), aFeat->firstResult());
}
}
// remove also filters if split performed
/// Request for initialization of data model of the feature: adding all attributes.
FEATURESPLUGIN_EXPORT virtual void initAttributes();
- /// Creates a new part document if needed.
+ /// Performs the algorithm and stores results it in the data structure.
FEATURESPLUGIN_EXPORT virtual void execute();
public:
/// Request for initialization of data model of the feature: adding all attributes.
FEATURESPLUGIN_EXPORT virtual void initAttributes();
- /// Creates a new part document if needed.
+ /// Performs the algorithm and stores results it in the data structure.
FEATURESPLUGIN_EXPORT virtual void execute();
public:
/// Request for initialization of data model of the feature: adding all attributes.
FEATURESPLUGIN_EXPORT virtual void initAttributes();
- /// Creates a new part document if needed.
+ /// Performs the algorithm and stores results it in the data structure.
FEATURESPLUGIN_EXPORT virtual void execute();
public:
/// Request for initialization of data model of the feature: adding all attributes.
FEATURESPLUGIN_EXPORT virtual void initAttributes();
- /// Creates a new part document if needed.
+ /// Performs the algorithm and stores results it in the data structure.
FEATURESPLUGIN_EXPORT virtual void execute();
public:
/// Request for initialization of data model of the feature: adding all attributes.
FEATURESPLUGIN_EXPORT virtual void initAttributes();
- /// Creates a new part document if needed.
+ /// Performs the algorithm and stores results it in the data structure.
FEATURESPLUGIN_EXPORT virtual void execute();
public:
return MY_ANGLE_ID;
}
- /// Creates a new part document if needed.
+ /// Performs the algorithm and stores results it in the data structure.
FEATURESPLUGIN_EXPORT virtual void execute();
/// Request for initialization of data model of the feature: adding all attributes.
return MY_OBJECTS_ID;
}
- /// Creates a new part document if needed.
+ /// Performs the algorithm and stores results it in the data structure.
FEATURESPLUGIN_EXPORT virtual void executeCompositeBoolean();
protected:
/// Request for initialization of data model of the feature: adding all attributes.
FEATURESPLUGIN_EXPORT virtual void initAttributes();
- /// Creates a new part document if needed.
+ /// Performs the algorithm and stores results it in the data structure.
FEATURESPLUGIN_EXPORT virtual void execute();
protected:
return MY_KIND;
}
- /// Creates a new part document if needed.
+ /// Performs the algorithm and stores results it in the data structure.
FEATURESPLUGIN_EXPORT virtual void execute();
};
return MY_KIND;
}
- /// Creates a new part document if needed.
+ /// Performs the algorithm and stores results it in the data structure.
FEATURESPLUGIN_EXPORT virtual void execute();
private:
return START_RADIUS_ID();
}
- /// Creates a new part document if needed.
+ /// Performs the fillet algorithm and stores it in the data structure.
FEATURESPLUGIN_EXPORT virtual void execute();
/// Request for initialization of data model of the feature: adding all attributes.
return MY_RESULT_VALUES_ID;
}
- /// Creates a new part document if needed
+ /// Performs the algorithm and stores results it in the data structure.
FEATURESPLUGIN_EXPORT virtual void execute();
/// Request for initialization of data model of the feature: adding all attributes
return MY_KIND;
}
- /// Creates a new part document if needed.
+ /// Performs the algorithm and stores results it in the data structure.
FEATURESPLUGIN_EXPORT virtual void execute();
/// Request for initialization of data model of the feature: adding all attributes.
return MY_KIND;
}
- /// Creates a new part document if needed.
+ /// Performs the algorithm and stores results it in the data structure.
FEATURESPLUGIN_EXPORT virtual void execute();
/// Request for initialization of data model of the feature: adding all attributes.
return MY_KIND;
}
- /// Creates a new part document if needed
+ /// Performs the algorithm and stores results it in the data structure.
FEATURESPLUGIN_EXPORT virtual void execute();
/// Request for initialization of data model of the feature: adding all attributes
return MY_KIND;
}
- /// Creates a new part document if needed
+ /// Performs the algorithm and stores results it in the data structure.
FEATURESPLUGIN_EXPORT virtual void execute();
/// Request for initialization of data model of the feature: adding all attributes
return MY_KIND;
}
- /// Creates a new part document if needed
+ /// Performs the algorithm and stores results it in the data structure.
FEATURESPLUGIN_EXPORT virtual void execute();
/// Request for initialization of data model of the feature: adding all attributes
return MY_KIND;
}
- /// Creates a new part document if needed
+ /// Performs the algorithm and stores results it in the data structure.
FEATURESPLUGIN_EXPORT virtual void execute();
/// Request for initialization of data model of the feature: adding all attributes
/// \param[in] theID identifier of changed attribute.
FEATURESPLUGIN_EXPORT virtual void attributeChanged(const std::string& theID);
- /// Creates a new part document if needed.
+ /// Performs the algorithm and stores results it in the data structure.
FEATURESPLUGIN_EXPORT virtual void execute();
private:
return MY_KIND;
}
- /// Creates a new part document if needed.
+ /// Performs the algorithm and stores results it in the data structure.
FEATURESPLUGIN_EXPORT virtual void execute();
/// Request for initialization of data model of the feature: adding all attributes.
return MY_KIND;
}
- /// Creates a new part document if needed.
+ /// Performs the algorithm and stores results it in the data structure.
FEATURESPLUGIN_EXPORT virtual void execute();
};
return MY_KIND;
}
- /// Creates a new part document if needed.
+ /// Performs the algorithm and stores results it in the data structure.
FEATURESPLUGIN_EXPORT virtual void execute();
};
return MY_KIND;
}
- /// Creates a new part document if needed.
+ /// Performs the algorithm and stores results it in the data structure.
FEATURESPLUGIN_EXPORT virtual void execute();
/// Request for initialization of data model of the feature: adding all attributes.
return MY_KIND;
}
- /// Creates a new part document if needed.
+ /// Performs the algorithm and stores results it in the data structure.
FEATURESPLUGIN_EXPORT virtual void execute();
/// Request for initialization of data model of the feature: adding all attributes.
return MY_KIND;
}
- /// Creates a new part document if needed.
+ /// Performs the algorithm and stores results it in the data structure.
FEATURESPLUGIN_EXPORT virtual void execute();
/// Request for initialization of data model of the feature: adding all attributes.
return MY_KIND;
}
- /// Creates a new part document if needed.
+ /// Performs the algorithm and stores results it in the data structure.
FEATURESPLUGIN_EXPORT virtual void execute();
/// Request for initialization of data model of the feature: adding all attributes.
return MY_KIND;
}
- /// Creates a new part document if needed
+ /// Performs the algorithm and stores results it in the data structure.
FEATURESPLUGIN_EXPORT virtual void execute();
/// Request for initialization of data model of the feature: adding all attributes
}
// LCOV_EXCL_STOP
+void copyVisualizationAttrs(
+ std::shared_ptr<ModelAPI_Result>& theSource, std::shared_ptr<ModelAPI_Result>& theDest)
+{
+ // color
+ AttributeIntArrayPtr aSourceColor = theSource->data()->intArray(ModelAPI_Result::COLOR_ID());
+ if (aSourceColor.get() && aSourceColor->isInitialized() && aSourceColor->size()) {
+ AttributeIntArrayPtr aDestColor = theDest->data()->intArray(ModelAPI_Result::COLOR_ID());
+ if (aDestColor.get()) {
+ aDestColor->setSize(aSourceColor->size());
+ for(int a = 0; a < aSourceColor->size(); a++)
+ aDestColor->setValue(a, aSourceColor->value(a));
+ }
+ }
+ // deflection
+ AttributeDoublePtr aSourceDefl = theSource->data()->real(ModelAPI_Result::DEFLECTION_ID());
+ if (aSourceDefl.get() && aSourceDefl->isInitialized()) {
+ AttributeDoublePtr aDestDefl = theDest->data()->real(ModelAPI_Result::DEFLECTION_ID());
+ if (aDestDefl.get()) {
+ aDestDefl->setValue(aSourceDefl->value());
+ }
+ }
+ // transparency
+ AttributeDoublePtr aSourceTransp = theSource->data()->real(ModelAPI_Result::TRANSPARENCY_ID());
+ if (aSourceTransp.get() && aSourceTransp->isInitialized()) {
+ AttributeDoublePtr aDestTransp = theDest->data()->real(ModelAPI_Result::TRANSPARENCY_ID());
+ if (aDestTransp.get()) {
+ aDestTransp->setValue(aSourceTransp->value());
+ }
+ }
+}
+
} // namespace ModelAPI_Tools
*/
MODELAPI_EXPORT double getTransparency(const std::shared_ptr<ModelAPI_Result>& theResult);
+/*! Copies all visualization attributes from one result to another.
+* \param theSource a result that contains the copied attributes
+* \param theDest a destination result that takes the visualization attributes
+*/
+MODELAPI_EXPORT void copyVisualizationAttrs(std::shared_ptr<ModelAPI_Result>& theSource,
+ std::shared_ptr<ModelAPI_Result>& theDest);
+
}
#endif