-// Copyright (C) 2014-2020 CEA/DEN, EDF R&D
+// Copyright (C) 2014-2022 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
#include <ModelAPI_Session.h>
#include <ModelAPI_ResultPart.h>
#include <ModelAPI_Tools.h>
+#include <ModelAPI_Validator.h>
static const std::wstring THE_NEW_PART_STR(L"New Part");
{
data()->addAttribute(FILE_PATH_ID(), ModelAPI_AttributeString::typeId());
data()->addAttribute(TARGET_PART_ID(), ModelAPI_AttributeInteger::typeId());
- data()->addAttribute(TARGET_PARTS_LIST_ID(), ModelAPI_AttributeStringArray::typeId());
+ data()->addAttribute(TARGET_PARTS_LIST_ID(), ModelAPI_AttributeStringArray::typeId());
}
void ExchangePlugin_Import::initAttributes()
ExchangePlugin_ImportBase::initAttributes();
data()->addAttribute(STEP_FILE_PATH_ID(), ModelAPI_AttributeString::typeId());
- data()->addAttribute(IMPORT_TYPE_ID(), ModelAPI_AttributeString::typeId());
+ data()->addAttribute(IMPORT_TYPE_ID(), ModelAPI_AttributeString::typeId());
data()->addAttribute(STEP_TARGET_PART_ID(), ModelAPI_AttributeInteger::typeId());
data()->addAttribute(STEP_TARGET_PARTS_LIST_ID(), ModelAPI_AttributeStringArray::typeId());
data()->addAttribute(STEP_MATERIALS_ID(), ModelAPI_AttributeBoolean::typeId());
data()->addAttribute(STEP_COLORS_ID(), ModelAPI_AttributeBoolean::typeId());
data()->addAttribute(STEP_SCALE_INTER_UNITS_ID(), ModelAPI_AttributeBoolean::typeId());
+
+#ifndef HAVE_SALOME
+ ModelAPI_Session::get()->validators()->registerNotObligatory(
+ getKind(), ExchangePlugin_Import::IMPORT_TYPE_ID());
+ ModelAPI_Session::get()->validators()->registerNotObligatory(
+ getKind(), ExchangePlugin_Import::STEP_FILE_PATH_ID());
+ ModelAPI_Session::get()->validators()->registerNotObligatory(
+ getKind(), ExchangePlugin_Import::STEP_TARGET_PART_ID());
+ ModelAPI_Session::get()->validators()->registerNotObligatory(
+ getKind(), ExchangePlugin_Import::STEP_TARGET_PARTS_LIST_ID());
+ ModelAPI_Session::get()->validators()->registerNotObligatory(
+ getKind(), ExchangePlugin_Import::STEP_MATERIALS_ID());
+ ModelAPI_Session::get()->validators()->registerNotObligatory(
+ getKind(), ExchangePlugin_Import::STEP_COLORS_ID());
+ ModelAPI_Session::get()->validators()->registerNotObligatory(
+ getKind(), ExchangePlugin_Import::STEP_SCALE_INTER_UNITS_ID());
+#endif
}
/*
void ExchangePlugin_Import_Image::execute()
{
- AttributeStringPtr aFilePathAttr = string(ExchangePlugin_ImportBase::FILE_PATH_ID());
+ AttributeStringPtr aFilePathAttr = string(ExchangePlugin_ImportBase::FILE_PATH_ID());
std::string aFilePath = aFilePathAttr->value();
if (aFilePath.empty()) {
setError("File path is empty.");
if (aDoc.get()) {
FeaturePtr aImportFeature = aDoc->addFeature(ExchangePlugin_Import_ImageFeature::ID());
DataPtr aData = aImportFeature->data();
- AttributeStringPtr aPathAttr = aData->string(ExchangePlugin_Import_ImageFeature::FILE_PATH_ID());
+ AttributeStringPtr aPathAttr =
+ aData->string(ExchangePlugin_Import_ImageFeature::FILE_PATH_ID());
aPathAttr->setValue(aFilePathAttr->value());
aImportFeature->execute();
}