Salome HOME
Merge branch 'master' into cgt/devCEA
[modules/shaper.git] / src / BuildPlugin / BuildPlugin_Plugin.cpp
index 5cd553df67f4a12b7bd4c91fca1e9e9b8aeac14b..8849b519ab7156dd87d467ad107f073a8e62327f 100644 (file)
@@ -1,15 +1,34 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
-
-// File:        BuildPlugin_Plugin.cpp
-// Created:     18 April 2016
-// Author:      Dmitry Bobylev
+// Copyright (C) 2014-2017  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
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or
+// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+//
 
 #include "BuildPlugin_Plugin.h"
 
 #include <ModelAPI_Session.h>
 #include <ModelAPI_Validator.h>
 
+#include <BuildPlugin_Vertex.h>
+#include <BuildPlugin_Edge.h>
 #include <BuildPlugin_Wire.h>
+#include <BuildPlugin_Face.h>
+#include <BuildPlugin_Shell.h>
+#include <BuildPlugin_SubShapes.h>
 #include <BuildPlugin_Validators.h>
 
 // the only created instance of this plugin
@@ -21,8 +40,14 @@ BuildPlugin_Plugin::BuildPlugin_Plugin()
   // Register validators.
   SessionPtr aMgr = ModelAPI_Session::get();
   ModelAPI_ValidatorsFactory* aFactory = aMgr->validators();
+  aFactory->registerValidator("BuildPlugin_ValidatorBaseForBuild",
+                              new BuildPlugin_ValidatorBaseForBuild());
   aFactory->registerValidator("BuildPlugin_ValidatorBaseForWire",
                               new BuildPlugin_ValidatorBaseForWire());
+  aFactory->registerValidator("BuildPlugin_ValidatorBaseForFace",
+                              new BuildPlugin_ValidatorBaseForFace());
+  aFactory->registerValidator("BuildPlugin_ValidatorSubShapesSelection",
+                              new BuildPlugin_ValidatorSubShapesSelection());
 
   // Register this plugin.
   ModelAPI_Session::get()->registerPlugin(this);
@@ -31,8 +56,18 @@ BuildPlugin_Plugin::BuildPlugin_Plugin()
 //=================================================================================================
 FeaturePtr BuildPlugin_Plugin::createFeature(std::string theFeatureID)
 {
-  if (theFeatureID == BuildPlugin_Wire::ID()) {
+  if(theFeatureID == BuildPlugin_Vertex::ID()) {
+    return FeaturePtr(new BuildPlugin_Vertex());
+  } else if(theFeatureID == BuildPlugin_Edge::ID()) {
+    return FeaturePtr(new BuildPlugin_Edge());
+  } else if(theFeatureID == BuildPlugin_Wire::ID()) {
     return FeaturePtr(new BuildPlugin_Wire());
+  } else if(theFeatureID == BuildPlugin_Face::ID()) {
+    return FeaturePtr(new BuildPlugin_Face());
+  } else if(theFeatureID == BuildPlugin_Shell::ID()) {
+    return FeaturePtr(new BuildPlugin_Shell());
+  } else if(theFeatureID == BuildPlugin_SubShapes::ID()) {
+    return FeaturePtr(new BuildPlugin_SubShapes());
   }
 
   // Feature of such kind is not found.