]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Extrusion fuse
authordbv <dbv@opencascade.com>
Thu, 11 Jun 2015 14:57:06 +0000 (17:57 +0300)
committerdbv <dbv@opencascade.com>
Thu, 11 Jun 2015 14:57:22 +0000 (17:57 +0300)
src/FeaturesPlugin/CMakeLists.txt
src/FeaturesPlugin/FeaturesPlugin_ExtrusionFuse.h [new file with mode: 0644]
src/FeaturesPlugin/FeaturesPlugin_Plugin.cpp
src/FeaturesPlugin/extrusionfuse_widget.xml [new file with mode: 0644]
src/FeaturesPlugin/plugin-Features.xml

index 8e30c5499084f433b043c4a553f40109dd135a69..6d7a69b8af28ffbc73ba28235cd98019af93a89a 100644 (file)
@@ -16,6 +16,7 @@ SET(PROJECT_HEADERS
     FeaturesPlugin_CompositeBoolean.h
     FeaturesPlugin_ExtrusionBoolean.h
     FeaturesPlugin_ExtrusionCut.h
+    FeaturesPlugin_ExtrusionFuse.h
 )
 
 SET(PROJECT_SOURCES
@@ -35,6 +36,7 @@ SET(XML_RESOURCES
   plugin-Features.xml
   extrusion_widget.xml
   extrusioncut_widget.xml
+  extrusionfuse_widget.xml
   revolution_widget.xml
   rotation_widget.xml
   movement_widget.xml
diff --git a/src/FeaturesPlugin/FeaturesPlugin_ExtrusionFuse.h b/src/FeaturesPlugin/FeaturesPlugin_ExtrusionFuse.h
new file mode 100644 (file)
index 0000000..9b8c36c
--- /dev/null
@@ -0,0 +1,39 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+// File:        FeaturesPlugin_ExtrusionFuse.h
+// Created:     11 June 2015
+// Author:      Dmitry Bobylev
+
+#ifndef FeaturesPlugin_ExtrusionFuse_H_
+#define FeaturesPlugin_ExtrusionFuse_H_
+
+#include <FeaturesPlugin_ExtrusionBoolean.h>
+
+/** \class FeaturesPlugin_ExtrusionFuse
+ *  \ingroup Plugins
+ */
+class FeaturesPlugin_ExtrusionFuse : public FeaturesPlugin_ExtrusionBoolean
+{
+ public:
+  /// Feature kind.
+  inline static const std::string& ID()
+  {
+    static const std::string MY_REVOLUTION_ID("ExtrusionFuse");
+    return MY_REVOLUTION_ID;
+  }
+
+  /// \return the kind of a feature
+  FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
+  {
+    static std::string MY_KIND = FeaturesPlugin_ExtrusionFuse::ID();
+    return MY_KIND;
+  }
+
+  /// Use plugin manager for features creation.
+  FeaturesPlugin_ExtrusionFuse()
+  {
+    myBooleanOperationType = GeomAlgoAPI_Boolean::BOOL_FUSE;
+  }
+};
+
+#endif
index 844d77f829a395bdee4cfc39538bf10a5a85aeff..97643a705aa186a54381ffe4db301bfb27ad15fb 100644 (file)
@@ -5,6 +5,7 @@
 #include <FeaturesPlugin_Boolean.h>
 #include <FeaturesPlugin_Extrusion.h>
 #include <FeaturesPlugin_ExtrusionCut.h>
+#include <FeaturesPlugin_ExtrusionFuse.h>
 #include <FeaturesPlugin_Group.h>
 #include <FeaturesPlugin_Movement.h>
 #include <FeaturesPlugin_Placement.h>
@@ -46,6 +47,8 @@ FeaturePtr FeaturesPlugin_Plugin::createFeature(string theFeatureID)
     return FeaturePtr(new FeaturesPlugin_Placement);
   } else if (theFeatureID == FeaturesPlugin_ExtrusionCut::ID()) {
     return FeaturePtr(new FeaturesPlugin_ExtrusionCut);
+  } else if (theFeatureID == FeaturesPlugin_ExtrusionFuse::ID()) {
+    return FeaturePtr(new FeaturesPlugin_ExtrusionFuse);
   }
   // feature of such kind is not found
   return FeaturePtr();
diff --git a/src/FeaturesPlugin/extrusionfuse_widget.xml b/src/FeaturesPlugin/extrusionfuse_widget.xml
new file mode 100644 (file)
index 0000000..9f0803a
--- /dev/null
@@ -0,0 +1,48 @@
+<!-- Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
+
+<source>
+  <groupbox title="Extrusion">
+    <sketch_launcher id="sketch"
+      label="Sketch"
+      icon=":icons/sketch.png"
+      tooltip="Create or edit a sketch">/>
+    </sketch_launcher>
+    <groupbox title="From">
+      <shape_selector id="from_object"
+                      icon=":icons/plane.png"
+                      label="Plane face"
+                      tooltip="Select a planar face"
+                      shape_types="face"
+                      default="&lt;sketch&gt;">
+        <validator id="GeomValidators_Face" parameters="plane"/>
+      </shape_selector>
+      <doublevalue id="from_size" label="Size"
+        min="0" step="1.0" default="0"
+        icon=":icons/dimension_down.png"
+        tooltip="Height">
+      </doublevalue>
+    </groupbox>
+    <groupbox title="To">
+      <shape_selector id="to_object"
+                      icon=":icons/plane_inverted.png"
+                      label="Plane face"
+                      tooltip="Select a planar face"
+                      shape_types="face"
+                      default="&lt;sketch&gt;">
+        <validator id="GeomValidators_Face" parameters="plane"/>
+      </shape_selector>
+      <doublevalue  id="to_size"
+        label="Size" min="0" step="1.0" default="0"
+        icon=":icons/dimension_up.png"
+        tooltip="Height">
+      </doublevalue>
+    </groupbox>
+  </groupbox>
+  <multi_selector id="boolean_objects"
+    label="Fuse with:"
+    icon=":icons/cut_shape.png"
+    tooltip="Objects to fuse"
+    type_choice="Solids"
+    concealment="true">
+  </multi_selector>
+</source>
index a6af70516f91d58fc16b3ac2f7e9023a700a916e..30cd1569b439648ea01b66a827abdba388dc34ca 100644 (file)
@@ -24,6 +24,9 @@
       <feature id="ExtrusionCut" title="ExtrusionCut" tooltip="" icon=":icons/extrusion_cut.png">
         <source path="extrusioncut_widget.xml"/>
       </feature>
+      <feature id="ExtrusionFuse" title="ExtrusionFuse" tooltip="" icon=":icons/extrusion_fuse.png">
+        <source path="extrusionfuse_widget.xml"/>
+      </feature>
     </group>
     <group id="Collections">
       <feature id="Group"