ADD_SUBDIRECTORY (src/ExchangePlugin)
ADD_SUBDIRECTORY (src/GeomValidators)
ADD_SUBDIRECTORY (src/InitializationPlugin)
+ADD_SUBDIRECTORY (src/ParametersPlugin)
IF(${HAVE_SALOME})
ADD_SUBDIRECTORY (src/NewGeom)
<plugin library="FeaturesPlugin" configuration="plugin-Features.xml"/>
<plugin library="ExchangePlugin" configuration="plugin-Exchange.xml"/>
<plugin script="ConnectorPlugin" configuration="plugin-Connector.xml" dependency="Geometry"/>
+ <plugin library="ParametersPlugin" configuration="plugin-Parameters.xml"/>
<plugin library="SketchSolver"/>
<plugin library="GeomValidators"/>
<plugin library="DFBrowser" internal="true"/>
public:
/// Constructor
/// \param theParent the parent object
- /// \param theData the widget configuation. The attribute of the model widget is obtained from
+ /// \param theData the widget configuration.
/// \param theParentId is Id of a parent of the current attribute
ModuleBase_WidgetLineEdit(QWidget* theParent,
const Config_WidgetAPI* theData,
--- /dev/null
+INCLUDE(Common)
+
+INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/Events
+ ${PROJECT_SOURCE_DIR}/src/Config
+ ${PROJECT_SOURCE_DIR}/src/ModelAPI
+)
+
+SET(PROJECT_HEADERS
+ ParametersPlugin.h
+ ParametersPlugin_Plugin.h
+ ParametersPlugin_Parameter.h
+)
+
+SET(PROJECT_SOURCES
+ ParametersPlugin_Plugin.cpp
+ ParametersPlugin_Parameter.cpp
+)
+
+SET(XML_RESOURCES
+ plugin-Parameters.xml
+)
+
+SET(PROJECT_LIBRARIES
+ Events
+ Config
+ ModelAPI
+)
+
+ADD_DEFINITIONS(-DPARAMETERSPLUGIN_EXPORTS)
+ADD_LIBRARY(ParametersPlugin MODULE ${PROJECT_SOURCES} ${PROJECT_HEADERS} ${XML_RESOURCES})
+
+TARGET_LINK_LIBRARIES(ParametersPlugin ${PROJECT_LIBRARIES})
+
+INSTALL(TARGETS ParametersPlugin DESTINATION plugins)
+INSTALL(FILES ${XML_RESOURCES} DESTINATION plugins)
--- /dev/null
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+#ifndef PARAMETERSPLUGIN_H
+#define PARAMETERSPLUGIN_H
+
+#if defined PARAMETERSPLUGIN_EXPORTS
+#if defined WIN32
+#define PARAMETERSPLUGIN_EXPORT __declspec( dllexport )
+#else
+#define PARAMETERSPLUGIN_EXPORT
+#endif
+#else
+#if defined WIN32
+#define PARAMETERSPLUGIN_EXPORT __declspec( dllimport )
+#else
+#define PARAMETERSPLUGIN_EXPORT
+#endif
+#endif
+
+#endif
+
--- /dev/null
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
+
+// File: ParametersPlugin_Parameter.cpp
+// Created: 23 MArch 2015
+// Author: sbh
+
+#include "ParametersPlugin_Parameter.h"
+#include <ModelAPI_AttributeString.h>
+
+ParametersPlugin_Parameter::ParametersPlugin_Parameter()
+{
+}
+
+void ParametersPlugin_Parameter::initAttributes()
+{
+ data()->addAttribute(ParametersPlugin_Parameter::VARIABLE_ID(), ModelAPI_AttributeString::type());
+ data()->addAttribute(ParametersPlugin_Parameter::EXPRESSION_ID(), ModelAPI_AttributeString::type());
+}
+
+void ParametersPlugin_Parameter::execute()
+{
+}
--- /dev/null
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
+
+// File: ParametersPlugin_Parameter.h
+// Created: 23 MArch 2015
+// Author: sbh
+
+#ifndef PARAMETERSPLUGIN_PARAMETER_H_
+#define PARAMETERSPLUGIN_PARAMETER_H_
+
+#include "ParametersPlugin.h"
+#include <ModelAPI_Feature.h>
+
+class ParametersPlugin_Parameter : public ModelAPI_Feature
+{
+ public:
+ /// Extrusion kind
+ inline static const std::string& ID()
+ {
+ static const std::string MY_EXTRUSION_ID("Parameter");
+ return MY_EXTRUSION_ID;
+ }
+ /// attribute name of references sketch entities list, it should contain a sketch result or
+ /// a pair a sketch result to sketch face
+ inline static const std::string& VARIABLE_ID()
+ {
+ static const std::string MY_VARIABLE_ID("variable");
+ return MY_VARIABLE_ID;
+ }
+
+ /// attribute name of extrusion size
+ inline static const std::string& EXPRESSION_ID()
+ {
+ static const std::string MY_EXPRESSION_ID("expression");
+ return MY_EXPRESSION_ID;
+ }
+
+ /// Returns the kind of a feature
+ PARAMETERSPLUGIN_EXPORT virtual const std::string& getKind()
+ {
+ static std::string MY_KIND = ParametersPlugin_Parameter::ID();
+ return MY_KIND;
+ }
+
+ /// Creates a new part document if needed
+ PARAMETERSPLUGIN_EXPORT virtual void execute();
+
+ /// Request for initialization of data model of the feature: adding all attributes
+ PARAMETERSPLUGIN_EXPORT virtual void initAttributes();
+
+ /// Use plugin manager for features creation
+ ParametersPlugin_Parameter();
+};
+
+#endif
--- /dev/null
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+#include <ParametersPlugin_Plugin.h>
+#include <ParametersPlugin_Parameter.h>
+
+#include <ModelAPI_Session.h>
+
+#include <memory>
+
+// the only created instance of this plugin
+static ParametersPlugin_Plugin* MY_PARAMETERSPLUGIN_INSTANCE = new ParametersPlugin_Plugin();
+
+ParametersPlugin_Plugin::ParametersPlugin_Plugin()
+{
+ // register this plugin
+ SessionPtr aSession = ModelAPI_Session::get();
+ aSession->registerPlugin(this);
+}
+
+FeaturePtr ParametersPlugin_Plugin::createFeature(std::string theFeatureID)
+{
+ // TODO: register some features
+ if (theFeatureID == ParametersPlugin_Parameter::ID()) {
+ return FeaturePtr(new ParametersPlugin_Parameter);
+ }
+ return FeaturePtr();
+}
+
--- /dev/null
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+#ifndef PARAMETERSPLUGIN_PLUGIN_H_
+#define PARAMETERSPLUGIN_PLUGIN_H_
+
+#include <ParametersPlugin.h>
+#include <ModelAPI_Plugin.h>
+#include <ModelAPI_Feature.h>
+
+/**\class ParametersPlugin_Plugin
+ * TODO: Add documentation
+ */
+class PARAMETERSPLUGIN_EXPORT ParametersPlugin_Plugin : public ModelAPI_Plugin
+{
+ public:
+ /// Creates the feature object of this plugin by the feature string ID
+ virtual FeaturePtr createFeature(std::string theFeatureID);
+
+ public:
+ ParametersPlugin_Plugin();
+};
+
+#endif
+
--- /dev/null
+<!-- Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
+
+<plugin>
+ <workbench id="Part">
+ <group id="Parameters">
+ <feature id="Parameter" title="New Variable" tooltip="Creates a variable" icon=":pictures/expression.png">
+ <stringvalue id="variable" label="Name"/>
+ <stringvalue id="expression" icon="Value"/>
+ </feature>
+ </group>
+ </workbench>
+</plugin>
<file>pictures/module.png</file>
<file>pictures/shading.png</file>
<file>pictures/wireframe.png</file>
+ <file>pictures/expression.png</file>
</qresource>
</RCC>