]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Updating Primitive Box.
authorClarisse Genrault <clarisse.genrault@cea.fr>
Thu, 17 Nov 2016 07:54:04 +0000 (08:54 +0100)
committerClarisse Genrault <clarisse.genrault@cea.fr>
Thu, 17 Nov 2016 07:54:04 +0000 (08:54 +0100)
21 files changed:
src/GeomAlgoAPI/CMakeLists.txt
src/GeomAlgoAPI/GeomAlgoAPI.i
src/GeomAlgoAPI/GeomAlgoAPI_Box.cpp
src/GeomAlgoAPI/GeomAlgoAPI_Box.h
src/GeomAlgoAPI/GeomAlgoAPI_BoxPoints.cpp [deleted file]
src/GeomAlgoAPI/GeomAlgoAPI_BoxPoints.h [deleted file]
src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.cpp
src/GeomAlgoAPI/GeomAlgoAPI_swig.h
src/GeomAlgoAPI/Test/TestAPI_Box.py [new file with mode: 0644]
src/PrimitivesPlugin/CMakeLists.txt
src/PrimitivesPlugin/PrimitivesPlugin_Box.cpp
src/PrimitivesPlugin/PrimitivesPlugin_Box.h
src/PrimitivesPlugin/Test/APIDirectTestBox.py [deleted file]
src/PrimitivesPlugin/Test/TestBox.py [new file with mode: 0644]
src/PrimitivesPlugin/Test/UnitTestBox.py [deleted file]
src/PrimitivesPlugin/icons/SVG/box.svg [new file with mode: 0644]
src/PrimitivesPlugin/icons/SVG/box_2pt_32x32.svg [new file with mode: 0644]
src/PrimitivesPlugin/icons/SVG/box_dxyz_32x32.svg [new file with mode: 0644]
src/PrimitivesPlugin/icons/box.png
src/PrimitivesPlugin/icons/box_2pt_32x32.png
src/PrimitivesPlugin/plugin-Primitives.xml

index c4ff34d4d8ea4cf607ddba60454cd64a5fce2796..75015c1f351383375ee8c24eba6154934533cf20 100644 (file)
@@ -4,6 +4,7 @@ FIND_PACKAGE(SWIG REQUIRED)
 
 INCLUDE(${SWIG_USE_FILE})
 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
+INCLUDE(UnitTest)
 
 SET(PROJECT_HEADERS
     GeomAlgoAPI.h
@@ -42,7 +43,6 @@ SET(PROJECT_HEADERS
     GeomAlgoAPI_ShapeAPI.h
     GeomAlgoAPI_Exception.h
     GeomAlgoAPI_Box.h
-    GeomAlgoAPI_BoxPoints.h
     GeomAlgoAPI_XAOExport.h
     GeomAlgoAPI_XAOImport.h
     GeomAlgoAPI_Copy.h
@@ -84,7 +84,6 @@ SET(PROJECT_SOURCES
     GeomAlgoAPI_ShapeAPI.cpp
     GeomAlgoAPI_Exception.cpp
     GeomAlgoAPI_Box.cpp
-    GeomAlgoAPI_BoxPoints.cpp
     GeomAlgoAPI_XAOExport.cpp
     GeomAlgoAPI_XAOImport.cpp
     GeomAlgoAPI_Copy.cpp
@@ -151,3 +150,7 @@ ENDIF(WIN32)
 INSTALL(TARGETS _GeomAlgoAPI DESTINATION ${SHAPER_INSTALL_SWIG})
 INSTALL(TARGETS GeomAlgoAPI DESTINATION ${SHAPER_INSTALL_BIN})
 INSTALL(FILES ${SWIG_SCRIPTS} DESTINATION ${SHAPER_INSTALL_SWIG})
+
+ADD_UNIT_TESTS(TestAPI_Box.py
+)
+
index 7e62725059446925b87181bfc3c3ed6da98fced6..be79ae0132fbc72b38c9b7561437cca30f026fc7 100644 (file)
@@ -34,7 +34,6 @@
 %shared_ptr(GeomAlgoAPI_Translation)
 %shared_ptr(GeomAlgoAPI_Transform)
 %shared_ptr(GeomAlgoAPI_Box)
-%shared_ptr(GeomAlgoAPI_BoxPoints)
 %shared_ptr(GeomAlgoAPI_Copy)
 
 // all supported interfaces
index c8b7baa94a4273f21ab94c8c786890f51c575a28..7543812f29e1b0bc3a4b1186c8bc383d00f6499b 100644 (file)
@@ -20,19 +20,57 @@ GeomAlgoAPI_Box::GeomAlgoAPI_Box(const double theDx, const double theDy, const d
   myDx = theDx;
   myDy = theDy;
   myDz = theDz;
+  myMethodType = MethodType::BOX_DIM;
+}
+
+//=================================================================================================
+GeomAlgoAPI_Box::GeomAlgoAPI_Box(std::shared_ptr<GeomAPI_Pnt> theFirstPoint,
+                                 std::shared_ptr<GeomAPI_Pnt> theSecondPoint)
+:GeomAlgoAPI_Box()
+{
+  myFirstPoint = theFirstPoint;
+  mySecondPoint = theSecondPoint;
+  myMethodType = MethodType::BOX_POINTS;
 }
 
 //=================================================================================================
 bool GeomAlgoAPI_Box::check()
 {
-  if (myDx < Precision::Confusion()) {
-    myError = "Box builder with dimensions  :: Dx is null.";
-    return false;
-  } else if (myDy < Precision::Confusion()) {
-    myError = "Box builder with dimensions  :: Dy is null.";
-    return false;
-  } else if (myDz < Precision::Confusion()) {
-    myError = "Box builder with dimensions  :: Dz is null.";
+  if (myMethodType == MethodType::BOX_DIM) {
+    if (myDx < Precision::Confusion()) {
+      myError = "Box builder with dimensions :: Dx is null.";
+      return false;
+    } else if (myDy < Precision::Confusion()) {
+      myError = "Box builder with dimensions :: Dy is null.";
+      return false;
+    } else if (myDz < Precision::Confusion()) {
+      myError = "Box builder with dimensions :: Dz is null.";
+      return false;
+    }
+  } else if (myMethodType == MethodType::BOX_POINTS) {
+    if (!myFirstPoint.get()) {
+      myError = "Box builder with points :: the first point is not a correct";
+      return false;
+    }
+    if (!mySecondPoint.get()) {
+      myError = "Box builder with points :: the second point is not a correct";
+      return false;
+    }
+    if (myFirstPoint->distance(mySecondPoint) < Precision::Confusion()) {
+      myError = "Box builder with points :: the distance between the two points is null.";
+      return false;
+    }
+    double aDiffX = myFirstPoint->x() - mySecondPoint->x();
+    double aDiffY = myFirstPoint->y() - mySecondPoint->y();
+    double aDiffZ = myFirstPoint->z() - mySecondPoint->z();
+    if (fabs(aDiffX)  < Precision::Confusion() ||
+        fabs(aDiffY)  < Precision::Confusion() ||
+        fabs(aDiffZ)  < Precision::Confusion()) {
+      myError = "The points belong both to one of the OXY, OYZ or OZX planes";
+      return false;
+    }
+  } else {
+    myError = "Box builder :: Method not implemented.";
     return false;
   }
   return true;
@@ -41,31 +79,80 @@ bool GeomAlgoAPI_Box::check()
 //=================================================================================================
 void GeomAlgoAPI_Box::build()
 {
-  myCreatedFaces.clear();
+  if (myMethodType == MethodType::BOX_DIM) {
+    buildWithDimensions();
+  } else if (myMethodType == MethodType::BOX_POINTS) {
+    buildWithPoints();
+  } else {
+    myError = "Box builder :: Method not implemented.";
+    return;
+  }
+}
 
+//=================================================================================================
+void GeomAlgoAPI_Box::buildWithDimensions()
+{
+  myCreatedFaces.clear();
+  
   // Construct the box
   BRepPrimAPI_MakeBox *aBoxMaker = new BRepPrimAPI_MakeBox(myDx, myDy, myDz);
   aBoxMaker->Build();
-
+    
   // Test the algorithm
   if (!aBoxMaker->IsDone()) {
     myError = "Box builder with dimensions  :: algorithm failed.";
     return;
   }
-
+  
   TopoDS_Shape aResult = aBoxMaker->Shape();
   std::shared_ptr<GeomAPI_Shape> aShape(new GeomAPI_Shape());
   aShape->setImpl(new TopoDS_Shape(aResult));
   setShape(aShape);
-
+  
   // Test on the shapes
   if (!aShape.get() || aShape->isNull()) {
     myError = "Box builder with dimensions  :: resulting shape is null.";
     return;
   }
-
+  
   setImpl(aBoxMaker);
+  
+  setDone(true);
+}
 
+
+//=================================================================================================
+void GeomAlgoAPI_Box::buildWithPoints()
+{
+  myCreatedFaces.clear();
+  
+  const gp_Pnt& aFirstPoint = myFirstPoint->impl<gp_Pnt>();
+  const gp_Pnt& aSecondPoint = mySecondPoint->impl<gp_Pnt>();
+
+  // Construct the box
+  BRepPrimAPI_MakeBox *aBoxMaker = new  BRepPrimAPI_MakeBox(aFirstPoint, aSecondPoint);
+  aBoxMaker->Build();
+  
+  // Test the algorithm
+  if(!aBoxMaker->IsDone()) {
+    myError = "Box builder with two points  :: algorithm failed.";
+    return;
+  }
+    
+  TopoDS_Shape aResult = aBoxMaker->Shape();
+  
+  std::shared_ptr<GeomAPI_Shape> aShape(new GeomAPI_Shape());
+  aShape->setImpl(new TopoDS_Shape(aResult));
+  setShape(aShape);
+  
+  // Tests on the shape
+  if (!aShape.get() || aShape->isNull()) {
+    myError = "Box builder with two points  :: resulting shape is null.";
+    return;
+  }
+  
+  setImpl(aBoxMaker);
+  
   setDone(true);
 }
 
@@ -79,16 +166,16 @@ void GeomAlgoAPI_Box::prepareNamingFaces()
   std::shared_ptr<GeomAPI_Shape> aShapeBack(new GeomAPI_Shape);
   aShapeBack->setImpl(new TopoDS_Shape(aBoxMaker.BackFace()));
   myCreatedFaces["Back"] = aShapeBack;
-  std::shared_ptr<GeomAPI_Shape> aShapeTop(new GeomAPI_Shape);
+  std::shared_ptr<GeomAPI_Shape> aShapeTop(new GeomAPI_Shape); 
   aShapeTop->setImpl(new TopoDS_Shape(aBoxMaker.TopFace()));
   myCreatedFaces["Top"] = aShapeTop;
-  std::shared_ptr<GeomAPI_Shape> aShapeBottom(new GeomAPI_Shape);
+  std::shared_ptr<GeomAPI_Shape> aShapeBottom(new GeomAPI_Shape); 
   aShapeBottom->setImpl(new TopoDS_Shape(aBoxMaker.BottomFace()));
   myCreatedFaces["Bottom"] = aShapeBottom;
-  std::shared_ptr<GeomAPI_Shape> aShapeLeft(new GeomAPI_Shape);
+  std::shared_ptr<GeomAPI_Shape> aShapeLeft(new GeomAPI_Shape); 
   aShapeLeft->setImpl(new TopoDS_Shape(aBoxMaker.LeftFace()));
   myCreatedFaces["Left"] = aShapeLeft;
-  std::shared_ptr<GeomAPI_Shape> aShapeRight(new GeomAPI_Shape);
+  std::shared_ptr<GeomAPI_Shape> aShapeRight(new GeomAPI_Shape); 
   aShapeRight->setImpl(new TopoDS_Shape(aBoxMaker.RightFace()));
   myCreatedFaces["Right"] = aShapeRight;
 }
index 4f772eed40cea54cee2e38c8ae1780abef0ff87b..c012131313003acfef337b706e5c313c2531dc5d 100644 (file)
 class GeomAlgoAPI_Box : public GeomAlgoAPI_MakeShape
 {
  public:
+  /// Type of box operation
+  enum MethodType {
+    BOX_DIM,   ///< Box with dimensions
+    BOX_POINTS,  ///< Box with points
+  };
+  
   GEOMALGOAPI_EXPORT GeomAlgoAPI_Box();
-
+  
   /// Creates a box using the dimensions.
   /// \param theDx The dimension on X
   /// \param theDy The dimension on Y
   /// \param theDz The dimension on Z
   GEOMALGOAPI_EXPORT GeomAlgoAPI_Box(const double theDx, const double theDy, const double theDz);
-
-  /// Checks if each dimension "Dx", Dy" and "Dz" for the box construction is OK.
+  
+  /// Creates a box using the two points that defined a diagonal.
+  /// \param theFirstPoint One extermity of the diagonal
+  /// \param theSecondPoint The other extremity of the diagonal
+  GEOMALGOAPI_EXPORT GeomAlgoAPI_Box(std::shared_ptr<GeomAPI_Pnt> theFirstPoint,
+                                     std::shared_ptr<GeomAPI_Pnt> theSecondPoint);
+  
+  /// Checks if data for the box construction is OK.
   GEOMALGOAPI_EXPORT bool check();
-
-  /// Builds the box with the dimensions "Dx", "Dy" and "Dz".
+  
+  /// Builds the box.
   GEOMALGOAPI_EXPORT void build();
-
+  
   /// Prepare the naming (redifined because it is specific for a box).
   GEOMALGOAPI_EXPORT void prepareNamingFaces();
 
  private:
+  /// Builds the box with the dimensions "Dx", "Dy" and "Dz".
+  void buildWithDimensions();
+  /// Builds the box with two points
+  void buildWithPoints();
+  
   double myDx; /// Dimension on X to create a box.
   double myDy; /// Dimension on Y to create a box.
   double myDz; /// Dimension Z to create a box.
+  std::shared_ptr<GeomAPI_Pnt> myFirstPoint; /// First point to create a box.
+  std::shared_ptr<GeomAPI_Pnt> mySecondPoint; /// Second point to create a box.
+  MethodType myMethodType; /// Type of method used.
 };
 
 
diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_BoxPoints.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_BoxPoints.cpp
deleted file mode 100644 (file)
index c177f86..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright (C) 2014-2016 CEA/DEN, EDF R&D
-
-// File:        GeomAlgoAPI_BoxPoints.cpp
-// Created:     17 Mar 2016
-// Author:      Clarisse Genrault (CEA)
-
-#include <GeomAlgoAPI_BoxPoints.h>
-
-#include <BRepPrimAPI_MakeBox.hxx>
-#include <TopoDS_Shape.hxx>
-
-#include <iostream>
-
-//=================================================================================================
-GeomAlgoAPI_BoxPoints::GeomAlgoAPI_BoxPoints(std::shared_ptr<GeomAPI_Pnt> theFirstPoint,
-                                             std::shared_ptr<GeomAPI_Pnt> theSecondPoint)
-:GeomAlgoAPI_Box()
-{
-  myFirstPoint = theFirstPoint;
-  mySecondPoint = theSecondPoint;
-}
-
-//=================================================================================================
-bool GeomAlgoAPI_BoxPoints::check()
-{
-  // The distance between myFirstPoint and mySecondPoint must not be null.
-  if (myFirstPoint->distance(mySecondPoint) < Precision::Confusion())
-    return false;
-  return true;
-}
-
-//=================================================================================================
-void GeomAlgoAPI_BoxPoints::build()
-{
-  myCreatedFaces.clear();
-
-  const gp_Pnt& aFirstPoint = myFirstPoint->impl<gp_Pnt>();
-  const gp_Pnt& aSecondPoint = mySecondPoint->impl<gp_Pnt>();
-
-  // Construct the box
-  BRepPrimAPI_MakeBox *aBoxMaker = new  BRepPrimAPI_MakeBox(aFirstPoint, aSecondPoint);
-  aBoxMaker->Build();
-
-  // Test the algorithm
-  if(!aBoxMaker->IsDone()) {
-    myError = "Box builder with two points  :: algorithm failed.";
-    return;
-  }
-
-  TopoDS_Shape aResult = aBoxMaker->Shape();
-
-  std::shared_ptr<GeomAPI_Shape> aShape(new GeomAPI_Shape());
-  aShape->setImpl(new TopoDS_Shape(aResult));
-  setShape(aShape);
-
-  // Tests on the shape
-  if (!aShape.get() || aShape->isNull()) {
-    myError = "Box builder with two points  :: resulting shape is null.";
-    return;
-  }
-
-  setImpl(aBoxMaker);
-
-  setDone(true);
-}
diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_BoxPoints.h b/src/GeomAlgoAPI/GeomAlgoAPI_BoxPoints.h
deleted file mode 100644 (file)
index f6cedd3..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright (C) 2014-2016 CEA/DEN, EDF R&D
-
-// File:        GeomAlgoAPI_BoxPoints.h
-// Created:     17 Mar 2016
-// Author:      Clarisse Genrault (CEA)
-
-#ifndef GeomAlgoAPI_BoxPoints_H_
-#define GeomAlgoAPI_BoxPoints_H_
-
-#include <GeomAPI_Pnt.h>
-#include <GeomAlgoAPI_Box.h>
-
-/**\class GeomAlgoAPI_BoxPoints
- * \ingroup DataAlgo
- * \brief Allows to create Box Primitives using the two points that defined a diagonal.
- */
-class GeomAlgoAPI_BoxPoints : public GeomAlgoAPI_Box
-{
- public:
-  /// Creates a box using the two points that defined a diagonal.
-  /// \param theFirstPoint One extermity of the diagonal
-  /// \param theSecondPoint The other extremity of the diagonal
-  GEOMALGOAPI_EXPORT GeomAlgoAPI_BoxPoints(std::shared_ptr<GeomAPI_Pnt> theFirstPoint,
-                                           std::shared_ptr<GeomAPI_Pnt> theSecondPoint);
-
-  /// \return true if the data of the construction of the box were correct.
-  GEOMALGOAPI_EXPORT bool check();
-
-  /// Builds the box.
-  GEOMALGOAPI_EXPORT void build();
-
- private:
-  std::shared_ptr<GeomAPI_Pnt> myFirstPoint; /// First point to create a box.
-  std::shared_ptr<GeomAPI_Pnt> mySecondPoint; /// Second point to create a box.
-};
-
-
-#endif
index f6126bddc624a5b5da408939bf354ce669b48c22..420b323d8e5a318534e70d0e24be01b4a3b1d7d2 100644 (file)
@@ -6,7 +6,6 @@
 
 #include "GeomAlgoAPI_ShapeAPI.h"
 #include <GeomAlgoAPI_Box.h>
-#include <GeomAlgoAPI_BoxPoints.h>
 
 #include <GeomAPI_Pnt.h>
 #include <GeomAPI_Edge.h>
@@ -43,7 +42,7 @@ namespace GeomAlgoAPI_ShapeAPI
     std::shared_ptr<GeomAPI_Pnt> theFirstPoint,
     std::shared_ptr<GeomAPI_Pnt> theSecondPoint) throw (GeomAlgoAPI_Exception)
   {
-    GeomAlgoAPI_BoxPoints aBoxAlgo(theFirstPoint, theSecondPoint);
+    GeomAlgoAPI_Box aBoxAlgo(theFirstPoint, theSecondPoint);
 
     if (!aBoxAlgo.check()) {
       throw GeomAlgoAPI_Exception(aBoxAlgo.getError());
index 39468c70168230ce158870dedc4f07ef2fafa9ed..df537f6200f0cd6bcac6a9ecb8b3e95ab77cd1cf 100644 (file)
@@ -44,7 +44,6 @@
   #include "GeomAlgoAPI_Exception.h"
   #include "GeomAlgoAPI_ShapeAPI.h"
   #include "GeomAlgoAPI_Box.h"
-  #include "GeomAlgoAPI_BoxPoints.h"
   #include "GeomAlgoAPI_Copy.h"
 
   #include <memory>
diff --git a/src/GeomAlgoAPI/Test/TestAPI_Box.py b/src/GeomAlgoAPI/Test/TestAPI_Box.py
new file mode 100644 (file)
index 0000000..01103fa
--- /dev/null
@@ -0,0 +1,47 @@
+# Copyright (C) 2014-2016 CEA/DEN, EDF R&D
+
+# File:        TestAPI_Box.py
+# Created:     16 Sept 2016
+# Author:      Clarisse Genrault (CEA)
+
+from GeomAlgoAPI import GeomAlgoAPI_ShapeAPI as shaperpy
+from GeomAlgoAPI import GeomAlgoAPI_Exception as myExcept
+from GeomAPI import GeomAPI_Pnt as pnt
+
+# Create a box with dimensions    
+try :    
+  box1 = shaperpy.makeBox(5.,15.,5.)
+  
+except myExcept,ec:
+  print ec.what()
+
+# Create a box with two points defining the diagonal   
+try :    
+  pnt1 = pnt(0.,0.,0.)
+  pnt2 = pnt(10.,10.,10.)
+  box2 = shaperpy.makeBox(pnt1,pnt2)
+  
+except myExcept,ec:
+  print ec.what()
+  
+# Create a box with null dimensions
+try :    
+  box3 = shaperpy.makeBox(0.,0.,0.)
+  
+except myExcept,ec:
+  print ec.what()
+  
+# Create a box with negative dimensions
+try :    
+  box4 = shaperpy.makeBox(-5.,15.,5.)
+  
+except myExcept,ec:
+  print ec.what()
+  
+# Create a box with two same points   
+try :    
+  pnt1 = pnt(0.,0.,0.)
+  box5 = shaperpy.makeBox(pnt1,pnt1)
+  
+except myExcept,ec:
+  print ec.what()
\ No newline at end of file
index 86a5f1683ce5c8d85cceeba5bdce17176e742f55..faa66cc8aff627aef2b6fdda5856bc19dfbaac08 100644 (file)
@@ -1,8 +1,8 @@
-# Copyright (C) 2015-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2014-2016 CEA/DEN, EDF R&D
 
 # File:        CMakeLists.txt
 # Created:     07 Apr 2016
-# Author:      CEA (delegation to Alyotech)
+# Author:      Clarisse genrault (CEA)
 
 INCLUDE(UnitTest)
 
@@ -44,7 +44,6 @@ INSTALL(TARGETS PrimitivesPlugin DESTINATION ${SHAPER_INSTALL_PLUGIN_FILES})
 INSTALL(FILES ${XML_RESOURCES} DESTINATION ${SHAPER_INSTALL_XML_RESOURCES})
 INSTALL(DIRECTORY icons/ DESTINATION ${SHAPER_INSTALL_XML_RESOURCES}/icons/Primitives)
 
-ADD_UNIT_TESTS(UnitTestBox.py
-               APIDirectTestBox.py
+ADD_UNIT_TESTS(TestBox.py
 )
 
index 709c3c8d4dac20bb4877665a765cfcdd0a228d36..554e7012bab8424fca68e51a1f6cec91e053f027 100644 (file)
@@ -91,7 +91,7 @@ void PrimitivesPlugin_Box::createBoxByTwoPoints()
   AttributeSelectionPtr aRef1 = data()->selection(PrimitivesPlugin_Box::POINT_FIRST_ID());
   AttributeSelectionPtr aRef2 = data()->selection(PrimitivesPlugin_Box::POINT_SECOND_ID());
 
-  std::shared_ptr<GeomAlgoAPI_BoxPoints> aBoxAlgo;
+  std::shared_ptr<GeomAlgoAPI_Box> aBoxAlgo;
 
   if ((aRef1.get() != NULL) && (aRef2.get() != NULL)) {
     GeomShapePtr aShape1 = aRef1->value();
@@ -103,8 +103,7 @@ void PrimitivesPlugin_Box::createBoxByTwoPoints()
     if (aShape1 && aShape2){
       std::shared_ptr<GeomAPI_Pnt> aFirstPoint = GeomAlgoAPI_PointBuilder::point(aShape1);
       std::shared_ptr<GeomAPI_Pnt> aSecondPoint = GeomAlgoAPI_PointBuilder::point(aShape2);
-      aBoxAlgo = std::shared_ptr<GeomAlgoAPI_BoxPoints>(
-                                  new GeomAlgoAPI_BoxPoints(aFirstPoint,aSecondPoint));
+      aBoxAlgo = std::shared_ptr<GeomAlgoAPI_Box>(new GeomAlgoAPI_Box(aFirstPoint,aSecondPoint));
     }
   }
 
index c13403c9257d4bd0beff4ed80ba5974874cf2d1d..5f63df2eb588695c4ef100b315576a2d0ba6573e 100644 (file)
@@ -10,7 +10,6 @@
 #include <PrimitivesPlugin.h>
 #include <ModelAPI_Feature.h>
 #include <GeomAlgoAPI_Box.h>
-#include <GeomAlgoAPI_BoxPoints.h>
 
 class GeomAPI_Shape;
 class ModelAPI_ResultBody;
diff --git a/src/PrimitivesPlugin/Test/APIDirectTestBox.py b/src/PrimitivesPlugin/Test/APIDirectTestBox.py
deleted file mode 100644 (file)
index 57927ac..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-from GeomAlgoAPI import GeomAlgoAPI_ShapeAPI as shaperpy
-from GeomAlgoAPI import GeomAlgoAPI_Exception as myExcept
-from GeomAPI import GeomAPI_Pnt as pnt
-
-# Create a box with dimensions    
-try :    
-  box1 = shaperpy.makeBox(5.,15.,5.)
-  
-except myExcept,ec:
-  print ec.what()
-
-# Create a box with two points defining the diagonal   
-try :    
-  pnt1 = pnt(0.,0.,0.)
-  pnt2 = pnt(10.,10.,10.)
-  box2 = shaperpy.makeBox(pnt1,pnt2)
-  
-except myExcept,ec:
-  print ec.what()
-  
-
-# Create a box with null dimensions
-try :    
-  box3 = shaperpy.makeBox(0.,0.,0.)
-  
-except myExcept,ec:
-  print ec.what()
\ No newline at end of file
diff --git a/src/PrimitivesPlugin/Test/TestBox.py b/src/PrimitivesPlugin/Test/TestBox.py
new file mode 100644 (file)
index 0000000..3caff58
--- /dev/null
@@ -0,0 +1,53 @@
+"""
+Test case for Primitive Box feature. 
+Written on High API.
+"""
+from ModelAPI import *
+from GeomAPI import *
+
+import model
+
+# Get session
+aSession = ModelAPI_Session.get()
+
+# Create a part
+aDocument = aSession.activeDocument()
+aSession.startOperation()
+model.addPart(aDocument)
+aDocument = aSession.activeDocument()
+aSession.finishOperation()
+
+# Create a box with dimensions
+aSession.startOperation()
+aBox1 = model.addBox(aDocument, 10, 10, 10).result()
+aSession.finishOperation()
+assert (aBox1 is not None)
+
+# Create a first point
+aSession.startOperation()
+aFirstPoint = model.addPoint(aDocument, 0, 0, 0).result()
+aSession.finishOperation()
+
+# Create a second point
+aSession.startOperation()
+aSecondPoint = model.addPoint(aDocument, 50, 50, 50).result()
+aSession.finishOperation()
+
+# Create a box with 2 points
+aSession.startOperation()
+aBox2 = model.addBox(aDocument, aFirstPoint, aSecondPoint).result()
+aSession.finishOperation()
+assert (aBox2 is not None)
+
+# Create a box with dimensions (error)
+aSession.startOperation()
+aBox3 = model.addBox(aDocument, -10, 10, 10).result()
+aSession.finishOperation()
+assert (aBox3 is not None)
+
+# Create a box with 2 points (error)
+aSession.startOperation()
+aBox4 = model.addBox(aDocument, aFirstPoint, aFirstPoint).result()
+aSession.finishOperation()
+assert (aBox4 is not None)
+
diff --git a/src/PrimitivesPlugin/Test/UnitTestBox.py b/src/PrimitivesPlugin/Test/UnitTestBox.py
deleted file mode 100644 (file)
index ebbac55..0000000
+++ /dev/null
@@ -1,154 +0,0 @@
-"""
-    UnitTestBox.py
-    Unit Test of PrimitivesPlugin_Box class
-
-class PrimitivesPlugin_Box : public ModelAPI_Feature
-    static const std::string MY_BOX_ID("Box");
-    static const std::string METHOD_ATTR("CreationMethod");
-    static const std::string MY_POINT_FIRST("FirstPoint");
-    static const std::string MY_POINT_SECOND("SecondPoint");
-    static const std::string MY_DX("dx");
-    static const std::string MY_DY("dy");
-    static const std::string MY_DZ("dz");
-
-    data()->addAttribute(METHOD(), ModelAPI_AttributeString::typeId());
-    data()->addAttribute(POINT_FIRST(), ModelAPI_AttributeSelection::typeId());
-    data()->addAttribute(POINT_SECOND(), ModelAPI_AttributeSelection::typeId());
-    data()->addAttribute(DX(), ModelAPI_AttributeDouble::typeId());
-    data()->addAttribute(DY(), ModelAPI_AttributeDouble::typeId());
-    data()->addAttribute(DZ(), ModelAPI_AttributeDouble::typeId());
-
-"""
-
-#=========================================================================
-# Initialization of the test
-#=========================================================================
-from ModelAPI import *
-from GeomDataAPI import *
-from GeomAlgoAPI import *
-from GeomAPI import *
-import math
-
-__updated__ = "2016-01-04"
-
-aSession = ModelAPI_Session.get()
-aDocument = aSession.moduleDocument()
-# Create a part for creation of a box
-aSession.startOperation()
-aPartFeature = aDocument.addFeature("Part")
-aSession.finishOperation()
-assert (len(aPartFeature.results()) == 1)
-
-aPartResult = modelAPI_ResultPart(aPartFeature.firstResult())
-aPart = aPartResult.partDoc()
-#=========================================================================
-# Creation of a Box by coordinates
-#=========================================================================
-aSession.startOperation()
-aBoxBy3Dims = aPart.addFeature("Box")
-assert (aBoxBy3Dims.getKind() == "Box")
-
-aBoxBy3Dims.string("CreationMethod").setValue("BoxByDimensions")
-aBoxBy3Dims.real("dx").setValue(1.6)
-aBoxBy3Dims.real("dy").setValue(1.6)
-aBoxBy3Dims.real("dz").setValue(1.6)
-aBoxBy3Dims.execute()
-
-# Check box results
-assert (len(aBoxBy3Dims.results()) > 0)
-aBoxResult = modelAPI_ResultBody(aBoxBy3Dims.firstResult())
-assert (aBoxResult is not None)
-
-# Check box volume
-aRefVolume = 1.6 * 1.6 * 1.6
-aResVolume = GeomAlgoAPI_ShapeTools_volume(aBoxResult.shape())
-assert (math.fabs(aResVolume - aRefVolume) < 10 ** -5)
-
-
-#Check the naming by selecting a face and making a plane out of it
-aPlaneTop = aPart.addFeature("Plane")
-assert(aPlaneTop.getKind() == "Plane")
-aPlaneTop.string("creation_method").setValue("by_other_plane")
-aSelectionAttr = aPlaneTop.selection("plane")
-aSelectionAttr.selectSubShape("face", "Box_1_1/Top_1")
-aPlaneTop.string("by_other_plane_option").setValue("by_distance_from_other")
-aPlaneTop.real("distance").setValue(0.4)
-aPlaneTop.execute()
-
-#The face should be at 1.6, so the plane should be at 1.6 + 0.4 = 2.
-aRefPlaneTopLocation = 2.
-
-#location() is a method from GeomAPI_Face that returns a GeomAPI_Pnt, from which we can extract the z coordinate
-aPlaneTopResult = aPlaneTop.firstResult()
-aPlaneTopFace = GeomAPI_Face(aPlaneTopResult.shape())
-aPlaneTestLocation = aPlaneTopFace.getPlane()
-aPlaneLocation = aPlaneTestLocation.location().z()
-assert(math.fabs(aPlaneLocation - aRefPlaneTopLocation) < 10 ** -5)
-
-aSession.finishOperation()
-
-#=========================================================================
-# Creation of a Box by two points
-#=========================================================================
-
-aSession.startOperation()
-
-#Create two points
-aPoint1 = aPart.addFeature("Point")
-aPoint2 = aPart.addFeature("Point")
-assert(aPoint1.getKind() == "Point")
-assert(aPoint2.getKind() == "Point")
-# aPoint1.string("creation_method").setValue("by_xyz")
-aPoint1.real("x").setValue(2.0)
-aPoint1.real("y").setValue(2.0)
-aPoint1.real("z").setValue(2.0)
-# aPoint2.string("creation_method").setValue("by_xyz")
-aPoint2.real("x").setValue(2.5)
-aPoint2.real("y").setValue(2.5)
-aPoint2.real("z").setValue(2.5)
-aPoint1.execute()
-aPoint2.execute()
-aPoint1Result = aPoint1.firstResult()
-aPoint2Result = aPoint2.firstResult()
-aPoint1Vertex = aPoint1Result.shape()
-aPoint2Vertex = aPoint2Result.shape()
-
-aBoxBy2Pts = aPart.addFeature("Box")
-assert (aBoxBy2Pts.getKind() == "Box")
-aBoxBy2Pts.string("CreationMethod").setValue("BoxByTwoPoints")
-aBoxBy2Pts.selection("FirstPoint").setValue(aPoint1Result, aPoint1Vertex)
-aBoxBy2Pts.selection("SecondPoint").setValue(aPoint2Result, aPoint2Vertex)
-aBoxBy2Pts.execute()
-
-# Check box volume
-aBoxResult2 = modelAPI_ResultBody(aBoxBy2Pts.firstResult())
-aRefVolume2 = 0.5 * 0.5 * 0.5
-aResVolume2 = GeomAlgoAPI_ShapeTools_volume(aBoxResult2.shape())
-assert (math.fabs(aResVolume2 - aRefVolume2) < 10 ** -5)
-
-#Check the naming by selecting a face and making a plane out of it
-aPlaneRight = aPart.addFeature("Plane")
-assert(aPlaneRight.getKind() == "Plane")
-aPlaneRight.string("creation_method").setValue("by_other_plane")
-aSelectionAttr = aPlaneRight.selection("plane")
-aSelectionAttr.selectSubShape("face", "Box_2_1/Right_1")
-aPlaneRight.string("by_other_plane_option").setValue("by_distance_from_other")
-aPlaneRight.real("distance").setValue(0.5)
-aPlaneRight.execute()
-
-#The face should be at 2.5, so the plane should be at 2.5 + 0.5 = 3.
-aRefPlaneRightLocation = 3.
-
-#location() is a method from GeomAPI_Face that returns a GeomAPI_Pnt,
-#from which we can extract the y coordinate
-aPlaneRightResult = aPlaneRight.firstResult()
-aPlaneRightFace = GeomAPI_Face(aPlaneRightResult.shape())
-aPlaneTestLocation = aPlaneRightFace.getPlane()
-aPlaneLocation = aPlaneTestLocation.location().y()
-assert(math.fabs(aPlaneLocation - aRefPlaneRightLocation) < 10 ** -5)
-
-aSession.finishOperation()
-
-#=========================================================================
-# End of test
-#=========================================================================
diff --git a/src/PrimitivesPlugin/icons/SVG/box.svg b/src/PrimitivesPlugin/icons/SVG/box.svg
new file mode 100644 (file)
index 0000000..f9dd6a3
--- /dev/null
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="16"
+   height="16"
+   id="svg2994"
+   version="1.1"
+   inkscape:version="0.48.4 r9939"
+   sodipodi:docname="dessin-1.svg">
+  <defs
+     id="defs2996" />
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="31.678384"
+     inkscape:cx="10.142429"
+     inkscape:cy="6.86954"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="true"
+     inkscape:showpageshadow="false"
+     inkscape:window-width="1261"
+     inkscape:window-height="854"
+     inkscape:window-x="185"
+     inkscape:window-y="192"
+     inkscape:window-maximized="0">
+    <inkscape:grid
+       type="xygrid"
+       id="grid3002"
+       empspacing="5"
+       visible="true"
+       enabled="true"
+       snapvisiblegridlinesonly="true" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata2999">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Calque 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(0,-1036.3622)">
+    <path
+       style="fill:#b7d9ea;stroke:#000000;stroke-width:0;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1;fill-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
+       d="M 6,1 15,1 11,5 2,5 z"
+       id="path3861"
+       inkscape:connector-curvature="0"
+       transform="translate(0,1036.3622)" />
+    <path
+       style="fill:#b7d9ea;fill-opacity:1;stroke:#000000;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       d="m 10.65276,1041.9203 0,10 5,-5 0,-10 z"
+       id="path3857"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#b7d9ea;fill-opacity:1;stroke:#000000;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       d="m 1.1578363,1051.8887 0,-10 8.9999997,0 0,10 c 0,0 -8.9999997,0 -8.9999997,0 z"
+       id="path3855"
+       inkscape:connector-curvature="0" />
+    <path
+       inkscape:connector-curvature="0"
+       id="path4768"
+       d="m 15.407143,1036.9199 -4.889234,4.9317 0,9.8635"
+       style="fill:none;stroke:#1b4955;stroke-width:0.98199999000000004;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;fill-opacity:1" />
+    <path
+       inkscape:connector-curvature="0"
+       id="path4766"
+       d="m 0.79020106,1051.8933 9.77846994,0 4.889235,-4.9318"
+       style="fill:none;stroke:#1b4955;stroke-width:0.98208702;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+    <path
+       style="fill:none;stroke:#1b4955;stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
+       d="m 15.431789,1036.9834 0,10"
+       id="path3059"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:none;stroke:#1b4955;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
+       d="m 0.74746186,1051.8887 0,-10"
+       id="path3847"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#b7ffea;stroke:#1b4955;stroke-width:0.98990493999999996px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:1"
+       d="m 10.536534,1041.794 -9.79911626,0"
+       id="path3849"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#b7ffea;stroke:#1b4955;stroke-width:0.99432135000000021px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:1"
+       d="m 0.74462252,1041.7968 5.13194768,-4.8162"
+       id="path3851"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#b7ffea;stroke:#1b4955;stroke-width:1.01877272000000008px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:1"
+       d="m 5.9872958,1036.9518 9.3410802,0"
+       id="path3853"
+       inkscape:connector-curvature="0" />
+  </g>
+</svg>
diff --git a/src/PrimitivesPlugin/icons/SVG/box_2pt_32x32.svg b/src/PrimitivesPlugin/icons/SVG/box_2pt_32x32.svg
new file mode 100644 (file)
index 0000000..fe8517b
--- /dev/null
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="32px"
+   height="32px"
+   id="svg5094"
+   version="1.1"
+   inkscape:version="0.48.4 r9939"
+   sodipodi:docname="box_2pt_32x32.svg"
+   inkscape:export-filename="/home/cg246364/Shaper/icones_240/box_2pt_32x32.png"
+   inkscape:export-xdpi="119.76"
+   inkscape:export-ydpi="119.76">
+  <defs
+     id="defs5096" />
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="15.836083"
+     inkscape:cx="15.869472"
+     inkscape:cy="15.646401"
+     inkscape:current-layer="layer1"
+     showgrid="true"
+     inkscape:grid-bbox="true"
+     inkscape:document-units="px"
+     inkscape:showpageshadow="false"
+     inkscape:window-width="924"
+     inkscape:window-height="764"
+     inkscape:window-x="368"
+     inkscape:window-y="230"
+     inkscape:window-maximized="0">
+    <inkscape:grid
+       type="xygrid"
+       id="grid5102"
+       empspacing="5"
+       visible="true"
+       enabled="true"
+       snapvisiblegridlinesonly="true" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata5099">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     id="layer1"
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer">
+    <path
+       style="fill:#b7d9ea;stroke:#1b4955;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none;fill-opacity:1"
+       d="m 5,27 0,-15 15,0 0,15 z"
+       id="path5104"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#b7d9ea;stroke:#1b4955;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none;fill-opacity:1"
+       d="m 5,12 7,-7 15,0 -7,7 z"
+       id="path5106"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#b7d9ea;stroke:#1b4955;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none;fill-opacity:1"
+       d="m 20,12 7,-7 0,15 -7,7 z"
+       id="path5108"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:none;stroke:#ff0000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       d="m 3.0632835,28.949341 2,-2 2,-2"
+       id="path5069"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:none;stroke:#ff0000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       d="m 3.0632835,24.949341 4,4"
+       id="path5071"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:none;stroke:#ff0000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       d="m 24.599511,7.3955372 2,-2 2,-2"
+       id="path5069-7"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:none;stroke:#ff0000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       d="m 24.599511,3.3955372 4,4"
+       id="path5071-1"
+       inkscape:connector-curvature="0" />
+  </g>
+</svg>
diff --git a/src/PrimitivesPlugin/icons/SVG/box_dxyz_32x32.svg b/src/PrimitivesPlugin/icons/SVG/box_dxyz_32x32.svg
new file mode 100644 (file)
index 0000000..6913b55
--- /dev/null
@@ -0,0 +1,227 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="32px"
+   height="32px"
+   id="svg5094"
+   version="1.1"
+   inkscape:version="0.48.4 r9939"
+   sodipodi:docname="box_dxyz_32x32.svg"
+   inkscape:export-filename="/home/cg246364/Shaper/icones_240/box_dxyz_32x32.png"
+   inkscape:export-xdpi="119.76"
+   inkscape:export-ydpi="119.76">
+  <defs
+     id="defs5096">
+    <linearGradient
+       id="linearGradient8999"
+       osb:paint="solid">
+      <stop
+         style="stop-color:#ff0000;stop-opacity:1;"
+         offset="0"
+         id="stop9001" />
+    </linearGradient>
+    <marker
+       inkscape:stockid="TriangleOutS"
+       orient="auto"
+       refY="0.0"
+       refX="0.0"
+       id="TriangleOutS"
+       style="overflow:visible">
+      <path
+         id="path3989"
+         d="M 5.77,0.0 L -2.88,5.0 L -2.88,-5.0 L 5.77,0.0 z "
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt"
+         transform="scale(0.2)" />
+    </marker>
+    <marker
+       inkscape:stockid="TriangleOutL"
+       orient="auto"
+       refY="0.0"
+       refX="0.0"
+       id="TriangleOutL"
+       style="overflow:visible">
+      <path
+         id="path3983"
+         d="M 5.77,0.0 L -2.88,5.0 L -2.88,-5.0 L 5.77,0.0 z "
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt"
+         transform="scale(0.8)" />
+    </marker>
+    <marker
+       inkscape:stockid="Arrow1Send"
+       orient="auto"
+       refY="0.0"
+       refX="0.0"
+       id="Arrow1Send"
+       style="overflow:visible;">
+      <path
+         id="path3856"
+         d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;"
+         transform="scale(0.2) rotate(180) translate(6,0)" />
+    </marker>
+    <marker
+       inkscape:stockid="Arrow1Mend"
+       orient="auto"
+       refY="0.0"
+       refX="0.0"
+       id="Arrow1Mend"
+       style="overflow:visible;">
+      <path
+         id="path3850"
+         d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;"
+         transform="scale(0.4) rotate(180) translate(10,0)" />
+    </marker>
+    <marker
+       inkscape:stockid="DotM"
+       orient="auto"
+       refY="0.0"
+       refX="0.0"
+       id="DotM"
+       style="overflow:visible">
+      <path
+         id="path3905"
+         d="M -2.5,-1.0 C -2.5,1.7600000 -4.7400000,4.0 -7.5,4.0 C -10.260000,4.0 -12.5,1.7600000 -12.5,-1.0 C -12.5,-3.7600000 -10.260000,-6.0 -7.5,-6.0 C -4.7400000,-6.0 -2.5,-3.7600000 -2.5,-1.0 z "
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt"
+         transform="scale(0.4) translate(7.4, 1)" />
+    </marker>
+    <marker
+       inkscape:stockid="Arrow1Lend"
+       orient="auto"
+       refY="0.0"
+       refX="0.0"
+       id="Arrow1Lend"
+       style="overflow:visible;">
+      <path
+         id="path3844"
+         d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;"
+         transform="scale(0.8) rotate(180) translate(12.5,0)" />
+    </marker>
+    <marker
+       inkscape:stockid="Arrow2Lend"
+       orient="auto"
+       refY="0.0"
+       refX="0.0"
+       id="Arrow2Lend"
+       style="overflow:visible;">
+      <path
+         id="path3862"
+         style="fill-rule:evenodd;stroke-width:0.62500000;stroke-linejoin:round;"
+         d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
+         transform="scale(1.1) rotate(180) translate(1,0)" />
+    </marker>
+    <marker
+       inkscape:stockid="TriangleOutS"
+       orient="auto"
+       refY="0"
+       refX="0"
+       id="TriangleOutS-9"
+       style="overflow:visible">
+      <path
+         inkscape:connector-curvature="0"
+         id="path3989-8"
+         d="m 5.77,0 -8.65,5 0,-10 8.65,5 z"
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt"
+         transform="scale(0.2,0.2)" />
+    </marker>
+    <marker
+       inkscape:stockid="TriangleOutS"
+       orient="auto"
+       refY="0"
+       refX="0"
+       id="TriangleOutS-2"
+       style="overflow:visible">
+      <path
+         inkscape:connector-curvature="0"
+         id="path3989-4"
+         d="m 5.77,0 -8.65,5 0,-10 8.65,5 z"
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt"
+         transform="scale(0.2,0.2)" />
+    </marker>
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="22.395603"
+     inkscape:cx="23.187875"
+     inkscape:cy="14.744242"
+     inkscape:current-layer="layer1"
+     showgrid="true"
+     inkscape:grid-bbox="true"
+     inkscape:document-units="px"
+     inkscape:showpageshadow="false"
+     inkscape:window-width="1205"
+     inkscape:window-height="897"
+     inkscape:window-x="404"
+     inkscape:window-y="208"
+     inkscape:window-maximized="0">
+    <inkscape:grid
+       type="xygrid"
+       id="grid5102"
+       empspacing="5"
+       visible="true"
+       enabled="true"
+       snapvisiblegridlinesonly="true" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata5099">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     id="layer1"
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer">
+    <path
+       style="fill:#b7d9ea;stroke:#1b4955;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none;fill-opacity:1"
+       d="m 5,27 0,-15 15,0 0,15 z"
+       id="path5104"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#b7d9ea;stroke:#1b4955;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none;fill-opacity:1"
+       d="m 5,12 7,-7 15,0 -7,7 z"
+       id="path5106"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#b7d9ea;stroke:#1b4955;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none;fill-opacity:1"
+       d="m 20,12 7,-7 0,15 -7,7 z"
+       id="path5108"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#ff0000;fill-opacity:1;stroke:#ff0000;stroke-width:1.8;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker-end:url(#TriangleOutS)"
+       d="m 13.934027,19.021179 0,-9.4164093"
+       id="path7345"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:#ff0000;fill-opacity:1;stroke:#ff0000;stroke-width:1.8;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker-end:url(#TriangleOutS)"
+       d="m 13.223752,18.138229 7.802955,0"
+       id="path7345-9"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:none;stroke:#ff0000;stroke-width:1.8;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker-end:url(#TriangleOutS-2)"
+       d="M 13.795837,18.204163 8.9070412,23.130217"
+       id="path9029"
+       inkscape:connector-curvature="0" />
+  </g>
+</svg>
index 8e707cbc668bae30e2f4c3d9c43e1727212eae3e..2b0757b055f0b982a04cb52ab53c3379201c1720 100644 (file)
Binary files a/src/PrimitivesPlugin/icons/box.png and b/src/PrimitivesPlugin/icons/box.png differ
index 900cb41e1673805263dc47cecd6c5fed2feadfe1..1294e0391f6564f2b2a4daecc0caac78ddde40e2 100644 (file)
Binary files a/src/PrimitivesPlugin/icons/box_2pt_32x32.png and b/src/PrimitivesPlugin/icons/box_2pt_32x32.png differ
index 22a4b366a01cb7063441c87e230de8d460724fb6..e3ababf71245c1bc6db147a792aebc567e61f5ab 100644 (file)
@@ -1,6 +1,5 @@
 <!-- Copyright (C) 2014-2016 CEA/DEN, EDF R&D -->
-
-<!--  Modified by CEA (delegation to Alyotech) : 29 Mar 2016 -->
+<!-- Created by Clarisse Genrault (CEA) : 10 Mar 2016 -->
 
 <plugin> 
   <workbench id="Primitives" document="Part">