#include <GeomAPI_ShapeExplorer.h>
+static const std::string COMPOSITESKETCH_VERSION_1("v9.6");
+
static void storeSubShape(const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape,
ResultBodyPtr theResultBody,
const GeomShapePtr theShape,
// Initialize selection list.
if(theInitFlags & InitBaseObjectsList) {
- data()->addAttribute(BASE_OBJECTS_ID(), ModelAPI_AttributeSelectionList::typeId());
+ AttributeSelectionListPtr anObjectsAttr =
+ std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(
+ data()->addAttribute(BASE_OBJECTS_ID(), ModelAPI_AttributeSelectionList::typeId()));
myCurrentSelectionType = selectionList(BASE_OBJECTS_ID())->selectionType();
- selectionList(BASE_OBJECTS_ID())->setWholeResultAllowed(true);
+ anObjectsAttr->setWholeResultAllowed(true);
+ if (!anObjectsAttr->isInitialized()) {
+ // new feature, specify the version
+ data()->setVersion(COMPOSITESKETCH_VERSION_1);
+ }
}
}
AttributeSelectionListPtr aListAttr =
std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
- const std::string& aSelType = aListAttr->selectionType();
+ const std::string& aVersion = theAttribute->owner()->data()->version();
+ std::string aSelType;
+ if (!aVersion.empty())
+ aSelType = aListAttr->selectionType();
+
std::list<std::string> anApplicableTypes;
switch (GeomValidators_ShapeType::shapeType(aSelType)) {
case GeomValidators_ShapeType::Vertex: