]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #1834: Fix length of lines
authorvsv <vitaly.smetannikov@opencascade.com>
Thu, 3 Nov 2016 10:20:15 +0000 (13:20 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Thu, 3 Nov 2016 10:20:35 +0000 (13:20 +0300)
src/PartSet/PartSet_Filters.h
src/PartSet/PartSet_PreviewPlanes.cpp
src/PartSet/PartSet_WidgetPoint2d.cpp
src/PartSet/PartSet_WidgetShapeSelector.cpp
src/PartSetAPI/PartSetAPI_Part.cpp
src/PartSetAPI/PartSetAPI_Part.h
src/PartSetPlugin/PartSetPlugin_Remove.cpp
src/PrimitivesAPI/PrimitivesAPI_Box.h
src/PrimitivesPlugin/PrimitivesPlugin_Box.cpp
src/SamplePanelPlugin/SamplePanelPlugin_ModelWidgetCreator.cpp
src/SamplePanelPlugin/SamplePanelPlugin_Plugin.cpp

index c4e727035453e9bbd1e5ec510b7a5582d45cff6f..71d60fe4c663d4afa80a4cd259560938a1358231 100644 (file)
@@ -26,7 +26,8 @@ public:
 
   /// Returns True if selected presentation can be selected
   /// \param theOwner an owner of the persentation
-  Standard_EXPORT virtual Standard_Boolean IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const;
+  Standard_EXPORT virtual Standard_Boolean 
+    IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const;
 
   DEFINE_STANDARD_RTTI(PartSet_GlobalFilter)
 };
@@ -49,7 +50,8 @@ public:
 
   /// Returns True if the given owner is acceptable for selection
   /// \param theOwner the selected owner
-  Standard_EXPORT virtual Standard_Boolean IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const;
+  Standard_EXPORT virtual Standard_Boolean 
+    IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const;
 
   DEFINE_STANDARD_RTTI(PartSet_CirclePointFilter)
 
index 4e362145d770269559708af823b72eb8b6e64886..71ddfdb3a70d56edddfce2d3a75e968ee3d7179d 100755 (executable)
@@ -124,7 +124,8 @@ AISObjectPtr PartSet_PreviewPlanes::createPreviewPlane(std::shared_ptr<GeomAPI_P
                                                        const int theRGB[3])
 {
   double aSize = Config_PropManager::integer(SKETCH_TAB_NAME, "planes_size", PLANE_SIZE);
-  std::shared_ptr<GeomAPI_Shape> aFace = GeomAlgoAPI_FaceBuilder::squareFace(theOrigin, theNorm, aSize);
+  std::shared_ptr<GeomAPI_Shape> aFace = 
+    GeomAlgoAPI_FaceBuilder::squareFace(theOrigin, theNorm, aSize);
   AISObjectPtr aAIS = AISObjectPtr(new GeomAPI_AISObject());
   aAIS->createShape(aFace);
   aAIS->setWidth(Config_PropManager::integer(SKETCH_TAB_NAME, "planes_thickness", SKETCH_WIDTH));
index 110ae2648e4294b7eabfc9a6eaf230e6bd6dfcc1..e83e75751a2c18ad28dc32890978230b4e1281f8 100644 (file)
@@ -449,7 +449,8 @@ void PartSet_WidgetPoint2D::mouseReleased(ModuleBase_IViewWindow* theWindow, QMo
   Handle(V3d_View) aView = theWindow->v3dView();
 
   QList<ModuleBase_ViewerPrsPtr> aList = aSelection->getSelected(ModuleBase_ISelection::Viewer);
-  ModuleBase_ViewerPrsPtr aFirstValue = aList.size() > 0 ? aList.first() : ModuleBase_ViewerPrsPtr();
+  ModuleBase_ViewerPrsPtr aFirstValue = 
+    aList.size() > 0 ? aList.first() : ModuleBase_ViewerPrsPtr();
   if (!aFirstValue.get() && myPreSelected.get()) {
     aFirstValue = myPreSelected;
   }
@@ -485,7 +486,8 @@ void PartSet_WidgetPoint2D::mouseReleased(ModuleBase_IViewWindow* theWindow, QMo
           bool anOrphanPoint = aShape.ShapeType() == TopAbs_VERTEX ||
                                isOrphanPoint(aSelectedFeature, mySketch, aX, aY);
           if (anExternal) {
-            anOrphanPoint = true; // we should not stop reentrant operation on external objects because
+            // we should not stop reentrant operation on external objects because
+            anOrphanPoint = true; 
             // they are not participate in the contour creation excepting external vertices
             if (aShape.ShapeType() == TopAbs_VERTEX) {
               FeaturePtr aFixedFeature = ModelAPI_Feature::feature(aFixedObject);
@@ -494,10 +496,12 @@ void PartSet_WidgetPoint2D::mouseReleased(ModuleBase_IViewWindow* theWindow, QMo
               }
             }
             else {
-              // point is taken from mouse event and set in attribute. It should be done before setting
-              // coinident constraint to the external line. If a point is created, it should be in the mouse
-              // clicked point
-              gp_Pnt aPoint = PartSet_Tools::convertClickToPoint(theEvent->pos(), theWindow->v3dView());
+              // point is taken from mouse event and set in attribute. 
+              // It should be done before setting
+              // coinident constraint to the external line. If a point is created, it should be 
+              // in the mouse clicked point
+              gp_Pnt aPoint =
+                PartSet_Tools::convertClickToPoint(theEvent->pos(), theWindow->v3dView());
               double aX, anY;
               PartSet_Tools::convertTo2D(aPoint, mySketch, aView, aX, anY);
               setPoint(aX, anY);
@@ -505,8 +509,8 @@ void PartSet_WidgetPoint2D::mouseReleased(ModuleBase_IViewWindow* theWindow, QMo
           }
           if (aFixedObject.get())
             setConstraintWith(aFixedObject);
-          // fignal updated should be flushed in order to visualize possible created external objects
-          // e.g. selection of trihedron axis when input end arc point
+          // fignal updated should be flushed in order to visualize possible created 
+          // external objects e.g. selection of trihedron axis when input end arc point
           updateObject(feature());
 
           if (!anOrphanPoint)
@@ -536,8 +540,8 @@ void PartSet_WidgetPoint2D::mouseReleased(ModuleBase_IViewWindow* theWindow, QMo
         }
         else if (aShape.ShapeType() == TopAbs_EDGE) {
           // point is taken from mouse event and set in attribute. It should be done before setting
-          // coinident constraint to the external line. If a point is created, it should be in the mouse
-          // clicked point
+          // coinident constraint to the external line. If a point is created, it should be in 
+          // the mouse clicked point
           gp_Pnt aPoint = PartSet_Tools::convertClickToPoint(theEvent->pos(), theWindow->v3dView());
           PartSet_Tools::convertTo2D(aPoint, mySketch, aView, aX, aY);
           setPoint(aX, aY);
@@ -588,7 +592,8 @@ void PartSet_WidgetPoint2D::mouseReleased(ModuleBase_IViewWindow* theWindow, QMo
   }
 }
 
-void PartSet_WidgetPoint2D::setPreSelection(const std::shared_ptr<ModuleBase_ViewerPrs>& thePreSelected)
+void PartSet_WidgetPoint2D::setPreSelection(
+  const std::shared_ptr<ModuleBase_ViewerPrs>& thePreSelected)
 {
   myPreSelected = thePreSelected;
 }
index 22dc4225d5da348333c6dc7a9340a14ad2412240..42d4fb9b70e4d734136d3e89b04167d6b9641311 100755 (executable)
@@ -77,7 +77,8 @@ void PartSet_WidgetShapeSelector::getGeomSelection(const ModuleBase_ViewerPrsPtr
   FeaturePtr aSelectedFeature = ModelAPI_Feature::feature(theObject);
   std::shared_ptr<SketchPlugin_Feature> aSPFeature = 
           std::dynamic_pointer_cast<SketchPlugin_Feature>(aSelectedFeature);
-  // there is no a sketch feature is selected, but the shape exists, try to create an exernal object
+  // there is no a sketch feature is selected, but the shape exists, 
+  // try to create an exernal object
   // TODO: unite with the same functionality in PartSet_WidgetShapeSelector
   if (aSPFeature.get() == NULL) {
     ObjectPtr anExternalObject = ObjectPtr();
@@ -91,7 +92,8 @@ void PartSet_WidgetShapeSelector::getGeomSelection(const ModuleBase_ViewerPrsPtr
             aShape = aResult->shape();
         }
         if (aShape.get() != NULL && !aShape->isNull())
-          anExternalObject = myExternalObjectMgr->externalObject(theObject, aShape, sketch(), myIsInValidate);
+          anExternalObject = 
+            myExternalObjectMgr->externalObject(theObject, aShape, sketch(), myIsInValidate);
       }
       else { /// use objects of found selection
         anExternalObject = theObject;
index 9460819c648d4ed791b81dc9dc3de6e09d8ac86a..349651cf3d8241b039127239c808cbb6e9746ba1 100644 (file)
@@ -1,3 +1,4 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
 // Name   : PartSetAPI_Part.cpp
 // Purpose: 
 //
index 46b1dd5586ca273aa29a25d26232398f89a1780c..4913e8195e51456bf9192faa71f7102126bb947d 100644 (file)
@@ -1,3 +1,4 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
 // Name   : PartSetAPI_Part.h
 // Purpose: 
 //
index a1c7bcfda295ab77636711299d7130911498015e..19ca7ae08e58261fd8813d8a89977193e8bdef27 100644 (file)
@@ -33,8 +33,8 @@ void PartSetPlugin_Remove::execute()
       aRoot->refsToFeature(aFeature, aRefFeatures);
       if (aRefFeatures.empty()) {
         aRoot->removeFeature(aFeature);
-        // the redisplay signal should be flushed in order to erase the feature presentation in the viewer
-        // after removeFeature from the document
+        // the redisplay signal should be flushed in order to erase the feature presentation 
+        // in the viewer after removeFeature from the document
         Events_Loop::loop()->flush(Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY));
       }
     }
index acf8bdffb6e810a8cf1da05664ba9b89ea0315e8..a753ee92cc052a6739210658c420dec51b705d60 100644 (file)
@@ -47,11 +47,16 @@ public:
   INTERFACE_6(PrimitivesPlugin_Box::ID(), 
              creationMethod, PrimitivesPlugin_Box::CREATION_METHOD(),
              ModelAPI_AttributeString, /** Creation method */,
-             dx, PrimitivesPlugin_Box::DX_ID(), ModelAPI_AttributeDouble, /** Dimension in X */,
-             dy, PrimitivesPlugin_Box::DY_ID(), ModelAPI_AttributeDouble, /** Dimension in Y */,
-             dz, PrimitivesPlugin_Box::DZ_ID(), ModelAPI_AttributeDouble, /** Dimension in Z */,
-             firstPoint, PrimitivesPlugin_Box::POINT_FIRST_ID(), ModelAPI_AttributeSelection, /** First point */,
-             secondPoint, PrimitivesPlugin_Box::POINT_SECOND_ID(), ModelAPI_AttributeSelection, /** Second point */)
+             dx, PrimitivesPlugin_Box::DX_ID(),
+             ModelAPI_AttributeDouble, /** Dimension in X */,
+             dy, PrimitivesPlugin_Box::DY_ID(),
+             ModelAPI_AttributeDouble, /** Dimension in Y */,
+             dz, PrimitivesPlugin_Box::DZ_ID(),
+             ModelAPI_AttributeDouble, /** Dimension in Z */,
+             firstPoint, PrimitivesPlugin_Box::POINT_FIRST_ID(), 
+             ModelAPI_AttributeSelection, /** First point */,
+             secondPoint, PrimitivesPlugin_Box::POINT_SECOND_ID(), 
+             ModelAPI_AttributeSelection, /** Second point */)
   
   /// Set dimensions
   PRIMITIVESAPI_EXPORT
index 8f150802e728eff70e36841e75a2ea400345a99e..35541e240fab56bef2599e907f7d29d1f48824f8 100644 (file)
@@ -30,8 +30,10 @@ void PrimitivesPlugin_Box::initAttributes()
   data()->addAttribute(PrimitivesPlugin_Box::DY_ID(), ModelAPI_AttributeDouble::typeId());
   data()->addAttribute(PrimitivesPlugin_Box::DZ_ID(), ModelAPI_AttributeDouble::typeId());
 
-  data()->addAttribute(PrimitivesPlugin_Box::POINT_FIRST_ID(), ModelAPI_AttributeSelection::typeId());
-  data()->addAttribute(PrimitivesPlugin_Box::POINT_SECOND_ID(), ModelAPI_AttributeSelection::typeId());
+  data()->addAttribute(PrimitivesPlugin_Box::POINT_FIRST_ID(), 
+                       ModelAPI_AttributeSelection::typeId());
+  data()->addAttribute(PrimitivesPlugin_Box::POINT_SECOND_ID(),
+                       ModelAPI_AttributeSelection::typeId());
 }
 
 //=================================================================================================
@@ -56,7 +58,8 @@ void PrimitivesPlugin_Box::createBoxByDimensions()
 
   std::shared_ptr<GeomAlgoAPI_Box> aBoxAlgo(new GeomAlgoAPI_Box(aDx,aDy,aDz));
   
-  // These checks should be made to the GUI for the feature but the corresponding validator does not exist yet.
+  // These checks should be made to the GUI for the feature but 
+  // the corresponding validator does not exist yet.
   if (!aBoxAlgo->check()) {
     // The error is not displayed in a popup window. It must be in the status bar.
     setError(aBoxAlgo->getError(), false);
@@ -100,11 +103,13 @@ 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_BoxPoints>(
+                                  new GeomAlgoAPI_BoxPoints(aFirstPoint,aSecondPoint));
     }
   }
   
-  // These checks should be made to the GUI for the feature but the corresponding validator does not exist yet.
+  // These checks should be made to the GUI for the feature but 
+  // the corresponding validator does not exist yet.
   if (!aBoxAlgo->check()) {
     // The error is not displayed in a popup window. It must be in the message console.
     setError(aBoxAlgo->getError(), false);
@@ -144,8 +149,10 @@ void PrimitivesPlugin_Box::loadNamingDS(std::shared_ptr<GeomAlgoAPI_Box> theBoxA
   
   // Insert to faces
   int num = 1;
-  std::map< std::string, std::shared_ptr<GeomAPI_Shape> > listOfFaces = theBoxAlgo->getCreatedFaces();
-  for (std::map< std::string, std::shared_ptr<GeomAPI_Shape> >::iterator it=listOfFaces.begin(); it!=listOfFaces.end(); ++it) {
+  std::map< std::string, std::shared_ptr<GeomAPI_Shape> > listOfFaces = 
+    theBoxAlgo->getCreatedFaces();
+  for (std::map< std::string, std::shared_ptr<GeomAPI_Shape> >::iterator 
+       it=listOfFaces.begin(); it!=listOfFaces.end(); ++it) {
     std::shared_ptr<GeomAPI_Shape> aFace = (*it).second;
     theResultBox->generated(aFace, (*it).first, num++);
   }
index e2509d1a8b909c616c0d19a910f62e2a3d3b437c..e1dab9ee8d09ca7438b4b45895ae728dc8638ca2 100755 (executable)
@@ -20,7 +20,8 @@ void SamplePanelPlugin_ModelWidgetCreator::widgetTypes(std::set<std::string>& th
   theTypes = myModelWidgetTypes;
 }
 
-ModuleBase_ModelWidget* SamplePanelPlugin_ModelWidgetCreator::createWidgetByType(const std::string& theType,
+ModuleBase_ModelWidget* SamplePanelPlugin_ModelWidgetCreator::createWidgetByType(
+                                                            const std::string& theType,
                                                             QWidget* theParent,
                                                             Config_WidgetAPI* theWidgetApi,
                                                             ModuleBase_IWorkshop* /*theWorkshop*/)
index 88a9221b9a1c830c5e93f7217e24b7920deff5c0..644c72c493d2df1e773b9cb49bae7e4a3ae63da3 100755 (executable)
@@ -25,7 +25,8 @@ SamplePanelPlugin_Plugin::SamplePanelPlugin_Plugin()
   aWidgetCreatorFactory->registerCreator(
           std::shared_ptr<SamplePanelPlugin_WidgetCreator>(new SamplePanelPlugin_WidgetCreator()));
   aWidgetCreatorFactory->registerCreator(
-   std::shared_ptr<SamplePanelPlugin_ModelWidgetCreator>(new SamplePanelPlugin_ModelWidgetCreator()));
+   std::shared_ptr<SamplePanelPlugin_ModelWidgetCreator>(
+   new SamplePanelPlugin_ModelWidgetCreator()));
 
   // register this plugin
   ModelAPI_Session::get()->registerPlugin(this);