#include <GeomAPI_Shape.h>
#include <Config_Common.h>
+#include <Config_PropManager.h>
+
#include <ModelAPI_AttributeString.h>
#include <ModelAPI_Data.h>
#include <ModelAPI_Document.h>
importFile(aFilePath);
}
+void ExchangePlugin_ImportFeature::customisePresentation(AISObjectPtr thePrs)
+{
+ std::vector<int> aRGB = Config_PropManager::color("Visualization", "import_feature_color",
+ IMPORTED_FEATURE_COLOR);
+ thePrs->setColor(aRGB[0], aRGB[1], aRGB[2]);
+ thePrs->redisplay();
+}
+
bool ExchangePlugin_ImportFeature::importFile(const std::string& theFileName)
{
// retrieve the file and plugin library names
#include <ExchangePlugin.h>
#include <ModelAPI_Feature.h>
+#include <GeomAPI_ICustomPrs.h>
+
#include <map>
-/**\class ExchangePlugin_ImportFeature
+#define IMPORTED_FEATURE_COLOR "#E0A01B"
+
+ /**\class ExchangePlugin_ImportFeature
* \ingroup Plugins
* \brief Feature for import shapes from the external files in CAD formats.
*
* The set of supported formats is defined in the configuration file.
*/
-class ExchangePlugin_ImportFeature : public ModelAPI_Feature
+class ExchangePlugin_ImportFeature : public ModelAPI_Feature, public GeomAPI_ICustomPrs
{
public:
/// Extrusion kind
return true;
}
+ /// Modifies the given presentation in the custom way.
+ virtual void customisePresentation(AISObjectPtr thePrs);
+
protected:
/// POerforms the import of the file
EXCHANGEPLUGIN_EXPORT bool importFile(const std::string& theFileName);
#include <ExchangePlugin_ImportFeature.h>
#include <ExchangePlugin_Validators.h>
+#include <Config_PropManager.h>
+
#include <ModelAPI_Session.h>
#include <ModelAPI_Validator.h>
ModelAPI_ValidatorsFactory* aFactory = aSession->validators();
aFactory->registerValidator("ExchangePlugin_ImportFormat",
new ExchangePlugin_ImportFormatValidator);
+
+ // register construction properties
+ Config_PropManager::registerProp("Visualization", "import_feature_color", "Imported feature color",
+ Config_Prop::Color, IMPORTED_FEATURE_COLOR);
}
FeaturePtr ExchangePlugin_Plugin::createFeature(string theFeatureID)