Salome HOME
Issue #1834: Fix length of lines
authorvsv <vitaly.smetannikov@opencascade.com>
Thu, 3 Nov 2016 13:45:24 +0000 (16:45 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Thu, 3 Nov 2016 13:45:37 +0000 (16:45 +0300)
31 files changed:
src/PartSet/PartSet_CustomPrs.cpp
src/PartSet/PartSet_ExternalObjectsMgr.cpp
src/PartSet/PartSet_FilterInfinite.cpp
src/PartSet/PartSet_FilterInfinite.h
src/PartSet/PartSet_Filters.cpp
src/PartSet/PartSet_IconFactory.cpp
src/PartSet/PartSet_MenuMgr.cpp
src/PartSet/PartSet_Module.cpp
src/PartSet/PartSet_Module.h
src/PartSet/PartSet_MouseProcessor.h
src/PartSet/PartSet_OperationPrs.cpp
src/PartSet/PartSet_OperationPrs.h
src/PartSet/PartSet_OverconstraintListener.cpp
src/PartSet/PartSet_ResultSketchPrs.cpp
src/PartSet/PartSet_ResultSketchPrs.h
src/PartSet/PartSet_SketcherMgr.h
src/PartSet/PartSet_SketcherReetntrantMgr.cpp
src/PartSet/PartSet_SketcherReetntrantMgr.h
src/PartSet/PartSet_Tools.cpp
src/PartSet/PartSet_Tools.h
src/PartSet/PartSet_Validators.cpp
src/PartSet/PartSet_Validators.h
src/PartSet/PartSet_WidgetFileSelector.cpp
src/PartSet/PartSet_WidgetMultiSelector.cpp
src/PartSet/PartSet_WidgetPoint2d.h
src/PartSet/PartSet_WidgetPoint2dDistance.cpp
src/PartSet/PartSet_WidgetPoint2dDistance.h
src/PartSet/PartSet_WidgetSketchCreator.cpp
src/PartSet/PartSet_WidgetSketchCreator.h
src/PartSet/PartSet_WidgetSketchLabel.cpp
src/PartSet/PartSet_WidgetSubShapeSelector.cpp

index 604e593c2d711f41d2dadf84d650090edde09517..c313ef059c9544e51e879e967145b429a85ce28e 100755 (executable)
@@ -149,8 +149,9 @@ bool PartSet_CustomPrs::displayPresentation(
   return isModified;
 }
 
-bool PartSet_CustomPrs::erasePresentation(const ModuleBase_IModule::ModuleBase_CustomizeFlag& theFlag,
-                                          const bool theUpdateViewer)
+bool PartSet_CustomPrs::erasePresentation(
+                          const ModuleBase_IModule::ModuleBase_CustomizeFlag& theFlag,
+                          const bool theUpdateViewer)
 {
   bool isErased = false;
   XGUI_Workshop* aWorkshop = workshop();
@@ -159,7 +160,8 @@ bool PartSet_CustomPrs::erasePresentation(const ModuleBase_IModule::ModuleBase_C
   return isErased;
 }
 
-void PartSet_CustomPrs::clearPresentation(const ModuleBase_IModule::ModuleBase_CustomizeFlag& theFlag)
+void PartSet_CustomPrs::clearPresentation(
+  const ModuleBase_IModule::ModuleBase_CustomizeFlag& theFlag)
 {
   AISObjectPtr aPresentation = getPresentation(theFlag, false);
   if (aPresentation.get()) {
@@ -218,7 +220,8 @@ void PartSet_CustomPrs::processEvent(const std::shared_ptr<Events_Message>& theM
     myPresentationIsEmpty = true; /// store state to analize it after display/erase is finished
 }
 
-void PartSet_CustomPrs::initPresentation(const ModuleBase_IModule::ModuleBase_CustomizeFlag& theFlag)
+void PartSet_CustomPrs::initPresentation(
+  const ModuleBase_IModule::ModuleBase_CustomizeFlag& theFlag)
 {
   AISObjectPtr anOperationPrs = AISObjectPtr(new GeomAPI_AISObject());
   Handle(PartSet_OperationPrs) anAISPrs = new PartSet_OperationPrs(myWorkshop);
index 3128285f1b8b23202dabca00d18ac7d84a26bffc..17ecdeda6f9bff42672d2eda711ea7f37e66eede 100755 (executable)
@@ -96,7 +96,8 @@ void PartSet_ExternalObjectsMgr::removeExternalObject(const ObjectPtr& theObject
     if (aFeature.get() != NULL) {
       QObjectPtrList anObjects;
       anObjects.append(aFeature);
-      // the external feature should be removed with all references, composite sketch feature will be ignored
+      // the external feature should be removed with all references, 
+      // composite sketch feature will be ignored
       workshop(theWorkshop)->deleteFeatures(anObjects);
     }
   }
index df38f4ceb781ddcaf9b37a13f6f025fc60c897e3..33e6cfd2f9893fca72f7115191ee353e024e1bdb 100755 (executable)
@@ -34,7 +34,8 @@ Standard_Boolean PartSet_FilterInfinite::IsOk(const Handle(SelectMgr_EntityOwner
   ResultPtr aResult = myWorkshop->selection()->getResult(aPrs);
   // to filter infinite construction results
   if (aResult.get() && aResult->groupName() == ModelAPI_ResultConstruction::group()) {
-    ResultConstructionPtr aConstruction = std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aResult);
+    ResultConstructionPtr aConstruction = 
+      std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aResult);
     if (aConstruction.get() && aConstruction->isInfinite()) {
       Handle(StdSelect_BRepOwner) aBRepOwner = Handle(StdSelect_BRepOwner)::DownCast(theOwner);
       if (!aBRepOwner.IsNull() && aBRepOwner->HasShape()) {
@@ -47,9 +48,12 @@ Standard_Boolean PartSet_FilterInfinite::IsOk(const Handle(SelectMgr_EntityOwner
           TopoDS_Shape aResultTopoShape = aResultShape->impl<TopoDS_Shape>();
           aResultShapeType = aResultTopoShape.ShapeType();
         }
-        // for infinite object, the selection is possible only for shapes of owners, which are coincide
-        // to the shape of corresponded AIS object. In other words, for axis, only edge can be selected
-        // (vertices are not selectable), for planes, only faces can be selected (not edges or vertices)
+        // for infinite object, the selection is possible only 
+        // for shapes of owners, which are coincide
+        // to the shape of corresponded AIS object. 
+        // In other words, for axis, only edge can be selected
+        // (vertices are not selectable), for planes,
+        // only faces can be selected (not edges or vertices)
         aValid = anOwnerShapeType == aResultShapeType;
       }
     }
index f6caa6666459f6196c8dbc6bd9d8e752660d0e11..2e14b81ba48e66b3e4ec8949424f22d771977eac 100755 (executable)
@@ -28,7 +28,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_FilterInfinite)
 
index f2c82f246a353219b02736eff3d7f65bf096633d..6c4e5e1b2cf8464dafbce67b3771f0021e793149 100644 (file)
@@ -42,8 +42,8 @@ Standard_Boolean PartSet_GlobalFilter::IsOk(const Handle(SelectMgr_EntityOwner)&
       ObjectPtr aObj = myWorkshop->findPresentedObject(aAISObj);
       if (aObj) {
         ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(aObj);
-        // result of parts belongs to PartSet document and can be selected only when PartSet is active
-        // in order to do not select the result of the active part.
+        // result of parts belongs to PartSet document and can be selected only when PartSet
+        //  is active in order to do not select the result of the active part.
         if (aResult.get() && aResult->groupName() == ModelAPI_ResultPart::group()) {
           SessionPtr aMgr = ModelAPI_Session::get();
           aValid = aMgr->activeDocument() == aMgr->moduleDocument();
@@ -69,7 +69,8 @@ Standard_Boolean PartSet_GlobalFilter::IsOk(const Handle(SelectMgr_EntityOwner)&
 IMPLEMENT_STANDARD_HANDLE(PartSet_CirclePointFilter, SelectMgr_Filter);
 IMPLEMENT_STANDARD_RTTIEXT(PartSet_CirclePointFilter, SelectMgr_Filter);
 
-Standard_Boolean PartSet_CirclePointFilter::IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const
+Standard_Boolean 
+  PartSet_CirclePointFilter::IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const
 {
   ModuleBase_Operation* anOperation = myWorkshop->module()->currentOperation();
   if(!anOperation) {
@@ -90,7 +91,8 @@ Standard_Boolean PartSet_CirclePointFilter::IsOk(const Handle(SelectMgr_EntityOw
     return Standard_True;
   }
 
-  Handle(ModuleBase_ResultPrs) aResultPrs = Handle(ModuleBase_ResultPrs)::DownCast(theOwner->Selectable());
+  Handle(ModuleBase_ResultPrs) aResultPrs = 
+    Handle(ModuleBase_ResultPrs)::DownCast(theOwner->Selectable());
   if(aResultPrs.IsNull()) {
     return Standard_True;
   }
index 1636a6ca234bf5c34ce2b8c8edeb4c3c7de0cea9..bf3fcebb355181b20a589a4fe609a5d99749473d 100644 (file)
@@ -100,7 +100,8 @@ QIcon PartSet_IconFactory::getIcon(ObjectPtr theObj)
 
 void PartSet_IconFactory::processEvent(const std::shared_ptr<Events_Message>& theMessage)
 {
-  if (theMessage->eventID() == Events_Loop::loop()->eventByName(Config_FeatureMessage::GUI_EVENT())) {
+  if (theMessage->eventID() == 
+      Events_Loop::loop()->eventByName(Config_FeatureMessage::GUI_EVENT())) {
     std::shared_ptr<Config_FeatureMessage> aFeatureMsg =
        std::dynamic_pointer_cast<Config_FeatureMessage>(theMessage);
     if (!aFeatureMsg->isInternal()) {
index 46bba030766bddb305291746b842115b2505654d..640c1b897fed0483b21f92d6794bfcccbf2bb14c 100644 (file)
@@ -374,7 +374,8 @@ void PartSet_MenuMgr::setAuxiliary(const bool isChecked)
           std::string anAttribute = SketchPlugin_SketchEntity::AUXILIARY_ID();
 
           std::shared_ptr<ModelAPI_AttributeBoolean> anAuxiliaryAttr = 
-            std::dynamic_pointer_cast<ModelAPI_AttributeBoolean>(aSketchFeature->data()->attribute(anAttribute));
+            std::dynamic_pointer_cast<ModelAPI_AttributeBoolean>(
+            aSketchFeature->data()->attribute(anAttribute));
           if (anAuxiliaryAttr)
             anAuxiliaryAttr->setValue(isChecked);
         }
@@ -402,7 +403,8 @@ bool PartSet_MenuMgr::canSetAuxiliary(bool& theValue) const
   // 1. change auxiliary type of a created feature
   if (myModule->sketchMgr()->isNestedCreateOperation(anOperation, aSketch) &&
     PartSet_SketcherMgr::isEntity(anOperation->id().toStdString()) ) {
-    ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>(anOperation);
+    ModuleBase_OperationFeature* aFOperation =
+      dynamic_cast<ModuleBase_OperationFeature*>(anOperation);
     if (aFOperation)
       anObjects.append(aFOperation->feature());
   }
@@ -429,7 +431,8 @@ bool PartSet_MenuMgr::canSetAuxiliary(bool& theValue) const
           std::string anAttribute = SketchPlugin_SketchEntity::AUXILIARY_ID();
 
           std::shared_ptr<ModelAPI_AttributeBoolean> anAuxiliaryAttr = 
-            std::dynamic_pointer_cast<ModelAPI_AttributeBoolean>(aSketchFeature->data()->attribute(anAttribute));
+            std::dynamic_pointer_cast<ModelAPI_AttributeBoolean>(
+            aSketchFeature->data()->attribute(anAttribute));
           if (anAuxiliaryAttr)
             isNotAuxiliaryFound = !anAuxiliaryAttr->value();
         }
index b35aaf442d332bf922a924764eca4f2ebb804005..04c57f58a69602f7176e9205148a7811a06dd4ba 100755 (executable)
@@ -164,9 +164,6 @@ PartSet_Module::PartSet_Module(ModuleBase_IWorkshop* theWshop)
   Config_PropManager::registerProp("Visualization", "operation_highlight_color",
                           "Multi selector item color in operation", Config_Prop::Color,
                           PartSet_CustomPrs::OPERATION_HIGHLIGHT_COLOR());
-
-  //Config_PropManager::registerProp(SKETCH_TAB_NAME, "disable_input_fields", "Disable input fields",
-  //                        Config_Prop::Boolean, "true");
 }
 
 PartSet_Module::~PartSet_Module()
@@ -247,11 +244,12 @@ void PartSet_Module::registerProperties()
                                    PLANE_SIZE);
   Config_PropManager::registerProp(SKETCH_TAB_NAME, "planes_thickness", "Thickness",
                                    Config_Prop::Integer, SKETCH_WIDTH);
-  Config_PropManager::registerProp(SKETCH_TAB_NAME, "rotate_to_plane", "Rotate to plane when selected",
-    Config_Prop::Boolean, "false");
+  Config_PropManager::registerProp(SKETCH_TAB_NAME, "rotate_to_plane", 
+    "Rotate to plane when selected", Config_Prop::Boolean, "false");
 }
 
-void PartSet_Module::connectToPropertyPanel(ModuleBase_ModelWidget* theWidget, const bool isToConnect)
+void PartSet_Module::connectToPropertyPanel(ModuleBase_ModelWidget* theWidget, 
+                                            const bool isToConnect)
 {
   mySketchMgr->connectToPropertyPanel(theWidget, isToConnect);
 }
@@ -265,7 +263,8 @@ void PartSet_Module::operationCommitted(ModuleBase_Operation* theOperation)
   /// Restart sketcher operations automatically
   if (!mySketchReentrantMgr->operationCommitted(theOperation)) {
 
-    ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>(theOperation);
+    ModuleBase_OperationFeature* aFOperation = 
+      dynamic_cast<ModuleBase_OperationFeature*>(theOperation);
     if (aFOperation && !aFOperation->isEditOperation()) {
       // the selection is cleared after commit the create operation
       // in order to do not use the same selected objects in the restarted operation
@@ -306,15 +305,17 @@ void PartSet_Module::operationStarted(ModuleBase_Operation* theOperation)
     bool isOperationCommitted = false;
     if (!aFOperation->isEditOperation()) {
       std::string aGreedAttributeId = ModuleBase_Tools::findGreedAttribute(workshop(), aFeature);
-      // if there is a greed attribute, automatic commit by preselection for this feature is prohibited
+      // if there is a greed attribute, automatic commit by preselection 
+      // for this feature is prohibited
       aFilledWidget = aFOperation->activateByPreselection(aGreedAttributeId);
       if (currentOperation() != aFOperation)
         isOperationCommitted = true;
       else {
         if (aGreedAttributeId.empty()) {
           // a signal should be emitted before the next widget activation
-          // because, the activation of the next widget will give a focus to the widget. As a result
-          // the value of the widget is initialized. And commit may happens until the value is entered.
+          // because, the activation of the next widget will give a focus to the widget. 
+          // As a result the value of the widget is initialized. 
+          // And commit may happens until the value is entered.
           if (aFilledWidget) {
             if (mySketchReentrantMgr->canBeCommittedByPreselection())
               isOperationCommitted = mySketchMgr->operationActivatedByPreselection();
@@ -375,7 +376,8 @@ void PartSet_Module::updateSketcherOnStart(ModuleBase_Operation* theOperation)
 
 void PartSet_Module::updatePresentationsOnStart(ModuleBase_Operation* theOperation)
 {
-  ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>(theOperation);
+  ModuleBase_OperationFeature* aFOperation =
+    dynamic_cast<ModuleBase_OperationFeature*>(theOperation);
   if (aFOperation) {
     myCustomPrs->activate(aFOperation->feature(), ModuleBase_IModule::CustomizeArguments, true);
     myCustomPrs->activate(aFOperation->feature(), ModuleBase_IModule::CustomizeResults, true);
@@ -386,7 +388,8 @@ void PartSet_Module::operationResumed(ModuleBase_Operation* theOperation)
 {
   ModuleBase_IModule::operationResumed(theOperation);
 
-  ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>(theOperation);
+  ModuleBase_OperationFeature* aFOperation = 
+    dynamic_cast<ModuleBase_OperationFeature*>(theOperation);
   if (aFOperation) {
     myCustomPrs->activate(aFOperation->feature(), ModuleBase_IModule::CustomizeArguments, true);
     myCustomPrs->activate(aFOperation->feature(), ModuleBase_IModule::CustomizeResults, true);
@@ -412,8 +415,8 @@ void PartSet_Module::operationStopped(ModuleBase_Operation* theOperation)
     aDisplayer->updateViewer();
   }
 
-  QMap<PartSet_Tools::ConstraintVisibleState, bool>::const_iterator anIt = myHasConstraintShown.begin(),
-                                                                    aLast = myHasConstraintShown.end();
+  QMap<PartSet_Tools::ConstraintVisibleState, bool>::const_iterator 
+    anIt = myHasConstraintShown.begin(), aLast = myHasConstraintShown.end();
   for (; anIt != aLast; anIt++) {
     mySketchMgr->updateBySketchParameters(anIt.key(), anIt.value());
   }
@@ -492,7 +495,8 @@ bool PartSet_Module::canActivateSelection(const ObjectPtr& theObject) const
   if (isSketchOp || isNestedOp) {
     // in active sketch operation it is possible to activate operation object in selection
     // in the edit operation, e.g. points of the line can be moved when the line is edited
-    ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>(anOperation);
+    ModuleBase_OperationFeature* aFOperation = 
+      dynamic_cast<ModuleBase_OperationFeature*>(anOperation);
     aCanActivate = aCanActivate || (aFOperation && aFOperation->isEditOperation());
   }
   return aCanActivate;
@@ -586,7 +590,8 @@ void PartSet_Module::clearViewer()
 
 void PartSet_Module::propertyPanelDefined(ModuleBase_Operation* theOperation)
 {
-  ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>(theOperation);
+  ModuleBase_OperationFeature* aFOperation =
+    dynamic_cast<ModuleBase_OperationFeature*>(theOperation);
   if (!aFOperation)
     return;
 
@@ -601,7 +606,8 @@ bool PartSet_Module::createWidgets(ModuleBase_Operation* theOperation,
 {
   bool aProcessed = false;
 
-  ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>(theOperation);
+  ModuleBase_OperationFeature* aFOperation = 
+    dynamic_cast<ModuleBase_OperationFeature*>(theOperation);
   XGUI_Workshop* aWorkshop = getWorkshop();
   XGUI_PropertyPanel* aPropertyPanel = aWorkshop->propertyPanel();
   if (mySketchMgr->activeSketch().get() && aFOperation && aPropertyPanel) {
@@ -615,11 +621,12 @@ bool PartSet_Module::createWidgets(ModuleBase_Operation* theOperation,
       FeaturePtr aFeature = ModelAPI_Feature::feature(anObject);
       FeaturePtr anOpFeature = aFOperation->feature();
       GeomShapePtr aShape = aSelectedPrs->shape();
-      // click on the digit of dimension constrain comes here with an empty shape, so we need the check
+      // click on the digit of dimension constrain comes here 
+      // with an empty shape, so we need the check
       if (aFeature == anOpFeature && aShape.get() && !aShape->isNull()) {
         const TopoDS_Shape& aTDShape = aShape->impl<TopoDS_Shape>();
         AttributePtr anAttribute = PartSet_Tools::findAttributeBy2dPoint(anObject, aTDShape,
-                                                                         mySketchMgr->activeSketch());
+                                                               mySketchMgr->activeSketch());
         if (anAttribute.get()) {
           QString aXmlRepr = aFOperation->getDescription()->xmlRepresentation();
           ModuleBase_WidgetFactory aFactory(aXmlRepr.toStdString(), workshop());
@@ -813,8 +820,10 @@ bool PartSet_Module::deleteObjects()
     anOpMgr->startOperation(anOpAction);
 
     // WORKAROUND, should be done to avoid viewer highlight update after deletetion of objects
-    // the problem is in AIS Dimensions recompute if a line and the dim are removed, line is the first
-    // it causes the AIS recompute, where the base line is null, the result is empty AIS in the viewer
+    // the problem is in AIS Dimensions recompute 
+    // if a line and the dim are removed, line is the first
+    // it causes the AIS recompute, where the base line is null, 
+    // the result is empty AIS in the viewer
     XGUI_Tools::workshop(myWorkshop)->selector()->clearSelection();
 
     // 4. delete features
@@ -978,7 +987,8 @@ bool PartSet_Module::isCustomPrsActivated(const ModuleBase_CustomizeFlag& theFla
   return myCustomPrs->isActive(theFlag);
 }
 
-void PartSet_Module::activateCustomPrs(const FeaturePtr& theFeature, const ModuleBase_CustomizeFlag& theFlag,
+void PartSet_Module::activateCustomPrs(const FeaturePtr& theFeature, 
+                                       const ModuleBase_CustomizeFlag& theFlag,
                                        const bool theUpdateViewer)
 {
   myCustomPrs->activate(theFeature, theFlag, theUpdateViewer);
@@ -1292,7 +1302,8 @@ void PartSet_Module::onViewCreated(ModuleBase_IViewWindow*)
   if (aOperation) {
     ModuleBase_ModelWidget* anActiveWidget = activeWidget();
     if (anActiveWidget) {
-      ModuleBase_WidgetSelector* aWSelector = dynamic_cast<ModuleBase_WidgetSelector*>(anActiveWidget);
+      ModuleBase_WidgetSelector* aWSelector = 
+        dynamic_cast<ModuleBase_WidgetSelector*>(anActiveWidget);
       if (aWSelector)
         aWSelector->activateSelectionAndFilters(true);
     }
index 64ae1c0994aa42677256bb440f90ea018cb586ac..6687e7aa65338a0456023f8aacbb0a10212d1536 100755 (executable)
@@ -51,7 +51,8 @@ Q_OBJECT
 enum RestartingMode {
   RM_None, /// the operation should not be restarted
   RM_Forbided, /// the operation should not be restarted after there is no active widget
-  RM_LastFeatureUsed, /// the operation is restarted and use the previous feature for own initialization
+  RM_LastFeatureUsed, /// the operation is restarted and use the previous feature 
+                      /// for own initialization
   RM_EmptyFeatureUsed /// the operation is restarted and does not use the previous feature
 };
 
@@ -84,7 +85,8 @@ public:
   /// Call back forlast tuning of property panel before operation performance
   virtual void propertyPanelDefined(ModuleBase_Operation* theOperation);
 
-  /// If there is found selected attribute, widgets are created and contains only a widget for the attribute
+  /// If there is found selected attribute, widgets are created and contains 
+  /// only a widget for the attribute
   /// It is important for Property Panel filling by sketch point attribute
   /// \param theOperation a started operation
   /// \param theWidgets a list of created widgets
index 08f9eedce19bf6fb81c6f5d4dd91e94b5970e5f5..0ef59ef8ddc1b8308dda47905e5181a8ce91db5c 100755 (executable)
@@ -22,19 +22,23 @@ public:
   /// Processing the mouse move event in the viewer
   /// \param theWindow a view window
   /// \param theEvent a mouse event
-  PARTSET_EXPORT virtual void mouseMoved(ModuleBase_IViewWindow* theWindow, QMouseEvent* theEvent) {}
+  PARTSET_EXPORT virtual void mouseMoved(ModuleBase_IViewWindow* theWindow,
+                                         QMouseEvent* theEvent) {}
   /// Processing the mouse press event in the viewer
   /// \param theWindow a view window
   /// \param theEvent a mouse event
-  PARTSET_EXPORT virtual void mousePressed(ModuleBase_IViewWindow* theWindow, QMouseEvent* theEvent) {}
+  PARTSET_EXPORT virtual void mousePressed(ModuleBase_IViewWindow* theWindow,
+                                           QMouseEvent* theEvent) {}
   /// Processing the mouse release event in the viewer
   /// \param theWindow a view window
   /// \param theEvent a mouse event
-  PARTSET_EXPORT virtual void mouseReleased(ModuleBase_IViewWindow* theWindow, QMouseEvent* theEvent) {}
+  PARTSET_EXPORT virtual void mouseReleased(ModuleBase_IViewWindow* theWindow, 
+                                            QMouseEvent* theEvent) {}
   /// Processing the mouse double click event in the viewer
   /// \param theWindow a view window
   /// \param theEvent a mouse event
-  PARTSET_EXPORT virtual void mouseDoubleClick(ModuleBase_IViewWindow* theWindow, QMouseEvent* theEvent) {}
+  PARTSET_EXPORT virtual void mouseDoubleClick(ModuleBase_IViewWindow* theWindow, 
+                                               QMouseEvent* theEvent) {}
 };
 
 #endif
index 529f0371d81c69019491ee8b0a35c1f883f2c68a..3204fa097413a71ff10e2b67a2e578ff8a8a5c08 100755 (executable)
@@ -89,9 +89,10 @@ void PartSet_OperationPrs::useAISWidth()
   myUseAISWidth = true;
 }
 
-void PartSet_OperationPrs::Compute(const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
-                                   const Handle(Prs3d_Presentation)& thePresentation, 
-                                   const Standard_Integer theMode)
+void PartSet_OperationPrs::Compute(
+            const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
+            const Handle(Prs3d_Presentation)& thePresentation, 
+            const Standard_Integer theMode)
 {
 #ifdef DEBUG_OPERATION_PRS
   qDebug("PartSet_OperationPrs::Compute -- begin");
@@ -107,8 +108,8 @@ void PartSet_OperationPrs::Compute(const Handle(PrsMgr_PresentationManager3d)& t
   BRep_Builder aBuilder;
   TopoDS_Compound aComp;
   aBuilder.MakeCompound(aComp);
-  for(NCollection_DataMap<TopoDS_Shape, Handle(AIS_InteractiveObject)>::Iterator anIter(myShapeToPrsMap);
-      anIter.More(); anIter.Next()) {
+  for(NCollection_DataMap<TopoDS_Shape, Handle(AIS_InteractiveObject)>::Iterator 
+      anIter(myShapeToPrsMap); anIter.More(); anIter.Next()) {
     const TopoDS_Shape& aShape = anIter.Key();
     aBuilder.Add(aComp, aShape);
     // change deviation coefficient to provide more precise circle
@@ -170,7 +171,8 @@ void PartSet_OperationPrs::addValue(const ObjectPtr& theObject, const GeomShapeP
   if (theObject.get()) {
     ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(theObject);
     if (aResult.get()) {
-      ResultCompSolidPtr aCompsolidResult = std::dynamic_pointer_cast<ModelAPI_ResultCompSolid>(theObject);
+      ResultCompSolidPtr aCompsolidResult = 
+        std::dynamic_pointer_cast<ModelAPI_ResultCompSolid>(theObject);
       if (aCompsolidResult.get()) {
         if (aCompsolidResult->numberOfSubs() > 0) {
           for(int i = 0; i < aCompsolidResult->numberOfSubs(); i++) {
@@ -187,7 +189,8 @@ void PartSet_OperationPrs::addValue(const ObjectPtr& theObject, const GeomShapeP
       else {
         FeaturePtr aFeature = ModelAPI_Feature::feature(theObject);
         if (aFeature.get()) {
-          AttributeBooleanPtr aCopyAttr = aFeature->data()->boolean(SketchPlugin_SketchEntity::COPY_ID());
+          AttributeBooleanPtr aCopyAttr = 
+            aFeature->data()->boolean(SketchPlugin_SketchEntity::COPY_ID());
           if (aCopyAttr.get()) {
             bool isCopy = aCopyAttr->value();
             if (isCopy)
@@ -291,7 +294,8 @@ void PartSet_OperationPrs::getFeatureShapes(const FeaturePtr& theFeature,
       ObjectPtr anObject;
       GeomShapePtr aShape;
       if (anAttrType == ModelAPI_AttributeRefAttr::typeId()) {
-        AttributeRefAttrPtr anAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(anAttribute);
+        AttributeRefAttrPtr anAttr = 
+          std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(anAttribute);
         if (anAttr->isObject()) {
           anObject = anAttr->object();
         }
@@ -306,12 +310,14 @@ void PartSet_OperationPrs::getFeatureShapes(const FeaturePtr& theFeature,
         }
       }
       if (anAttrType == ModelAPI_AttributeSelection::typeId()) {
-        AttributeSelectionPtr anAttr = std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(anAttribute);
+        AttributeSelectionPtr anAttr = 
+          std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(anAttribute);
         anObject = anAttr->context();
         aShape = anAttr->value();
       }
       if (anAttrType == ModelAPI_AttributeReference::typeId()) {
-        AttributeReferencePtr anAttr = std::dynamic_pointer_cast<ModelAPI_AttributeReference>(anAttribute);
+        AttributeReferencePtr anAttr = 
+          std::dynamic_pointer_cast<ModelAPI_AttributeReference>(anAttribute);
         anObject = anAttr->value();
       }
       addValue(anObject, aShape, theFeature, theWorkshop, theObjectShapes);
@@ -344,7 +350,8 @@ void PartSet_OperationPrs::getResultShapes(const FeaturePtr& theFeature,
 }
 
 void PartSet_OperationPrs::getHighlightedShapes(ModuleBase_IWorkshop* theWorkshop,
-                                                QMap<ObjectPtr, QList<GeomShapePtr> >& theObjectShapes)
+                                                QMap<ObjectPtr, 
+                                                QList<GeomShapePtr> >& theObjectShapes)
 {
   theObjectShapes.clear();
 
@@ -383,9 +390,11 @@ bool PartSet_OperationPrs::isSelectionAttribute(const AttributePtr& theAttribute
          anAttrType == ModelAPI_AttributeReference::typeId();
 }
 
-void PartSet_OperationPrs::fillShapeList(const QMap<ObjectPtr, QList<GeomShapePtr> >& theFeatureShapes,
+void PartSet_OperationPrs::fillShapeList(
+                            const QMap<ObjectPtr, QList<GeomShapePtr> >& theFeatureShapes,
                             ModuleBase_IWorkshop* theWorkshop,
-                            NCollection_DataMap<TopoDS_Shape, Handle(AIS_InteractiveObject)>& theShapeToPrsMap)
+                            NCollection_DataMap<TopoDS_Shape, 
+                            Handle(AIS_InteractiveObject)>& theShapeToPrsMap)
 {
   theShapeToPrsMap.Clear();
 
index cc1416451b8e923a8f083b2d5d2e612d34035b9b..4577d7b7756dc38693e5638ec7ef8cab63894c58 100755 (executable)
@@ -139,11 +139,14 @@ private:
           NCollection_DataMap<TopoDS_Shape, Handle(AIS_InteractiveObject)>& theShapeToPrsMap);
 
 private:
-  NCollection_DataMap<TopoDS_Shape, Handle(AIS_InteractiveObject)> myShapeToPrsMap; /// list of visualized shapes
+  /// list of visualized shapes
+  NCollection_DataMap<TopoDS_Shape, Handle(AIS_InteractiveObject)> myShapeToPrsMap;
 
   ModuleBase_IWorkshop* myWorkshop; /// current workshop
   Quantity_Color myShapeColor; /// color of feature depended shapes
-  bool myUseAISWidth; /// flag if the width of a shape object should be used for the shape visualization
+
+  /// flag if the width of a shape object should be used for the shape visualization
+  bool myUseAISWidth;
 
   friend class PartSet_CustomPrs;
 };
index 52d84913e823221a05a3b20edcace7f9c4041780..769c54bca3d97833d6467ab538429137b44f7daa 100755 (executable)
@@ -63,9 +63,11 @@ void PartSet_OverconstraintListener::processEvent(
 
   QString aCurrentInfoStr = getObjectsInfo(myConflictingObjects);
 
-  qDebug(QString("PartSet_OverconstraintListener::processEvent: %1,\nobjects count = %2:%3\ncurrent objects count = %4:%5")
-                .arg(isRepaired ? "REPAIRED" : "FAILED")
-                .arg(aCount).arg(anInfoStr).arg(myConflictingObjects.size()).arg(aCurrentInfoStr).toStdString().c_str());
+  QString aMsg("PartSet_OverconstraintListener::processEvent: %1,\nobjects  \
+ count = %2:%3\ncurrent objects count = %4:%5");
+  qDebug(aMsg.arg(isRepaired ? "REPAIRED" : "FAILED")
+             .arg(aCount).arg(anInfoStr).arg(myConflictingObjects.size())
+             .arg(aCurrentInfoStr).toStdString().c_str());
 #endif
 
   if (theMessage->eventID() == Events_Loop::eventByName(EVENT_SOLVER_FAILED)) {
@@ -102,14 +104,15 @@ void PartSet_OverconstraintListener::processEvent(
 }
 
 bool PartSet_OverconstraintListener::appendConflictingObjects(
-                                                  const std::set<ObjectPtr>& theConflictingObjects)
+                                               const std::set<ObjectPtr>& theConflictingObjects)
 {
   std::set<ObjectPtr> aModifiedObjects;
   std::vector<int> aColor;
   getConflictingColor(aColor);
 
   // set error state for new objects and append them in the internal map of objects
-  std::set<ObjectPtr>::const_iterator anIt = theConflictingObjects.begin(), aLast = theConflictingObjects.end();
+  std::set<ObjectPtr>::const_iterator 
+    anIt = theConflictingObjects.begin(), aLast = theConflictingObjects.end();
   for (; anIt != aLast; anIt++) {
     ObjectPtr anObject = *anIt;
     if (myConflictingObjects.find(anObject) == myConflictingObjects.end()) { // it is not found
@@ -125,12 +128,13 @@ bool PartSet_OverconstraintListener::appendConflictingObjects(
 }
 
 bool PartSet_OverconstraintListener::repairConflictingObjects(
-                                                  const std::set<ObjectPtr>& theConflictingObjects)
+                                              const std::set<ObjectPtr>& theConflictingObjects)
 {
   std::set<ObjectPtr> aModifiedObjects;
   // erase error state of absent current objects in the parameter list
   std::set<ObjectPtr>::const_iterator anIt, aLast;
-  for (anIt = theConflictingObjects.begin(), aLast = theConflictingObjects.end() ; anIt != aLast; anIt++) {
+  for (anIt = theConflictingObjects.begin(), aLast = theConflictingObjects.end(); 
+       anIt != aLast; anIt++) {
     ObjectPtr anObject = *anIt;
     if (theConflictingObjects.find(anObject) != theConflictingObjects.end()) { // it is found
       myConflictingObjects.erase(anObject);
index 3c0fbf920b87f94b7f1fe9bb83a004e8c43a385c..e0d6010c50e896e62382c1b21899bcc53ed5a11a 100755 (executable)
@@ -66,9 +66,10 @@ PartSet_ResultSketchPrs::PartSet_ResultSketchPrs(ResultPtr theResult)
   ModuleBase_Tools::setPointBallHighlighting(this);
 }
 
-void PartSet_ResultSketchPrs::Compute(const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
-                                      const Handle(Prs3d_Presentation)& thePresentation, 
-                                      const Standard_Integer theMode)
+void PartSet_ResultSketchPrs::Compute(
+                      const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
+                      const Handle(Prs3d_Presentation)& thePresentation, 
+                      const Standard_Integer theMode)
 {
   thePresentation->Clear();
 
@@ -102,7 +103,8 @@ void PartSet_ResultSketchPrs::Compute(const Handle(PrsMgr_PresentationManager3d)
   }
 
   if (!aReadyToDisplay) {
-    Events_InfoMessage("PartSet_ResultSketchPrs", "An empty AIS presentation: PartSet_ResultSketchPrs").send();
+    Events_InfoMessage("PartSet_ResultSketchPrs", 
+                       "An empty AIS presentation: PartSet_ResultSketchPrs").send();
     static const Events_ID anEvent = Events_Loop::eventByName(EVENT_EMPTY_AIS_PRESENTATION);
     ModelAPI_EventCreator::get()->sendUpdated(myResult, anEvent);
   }
@@ -114,7 +116,8 @@ void debugInfo(const TopoDS_Shape& theShape, const TopAbs_ShapeEnum theType)
   TopTools_IndexedMapOfShape aSubShapes;
   TopExp::MapShapes (theShape, theType, aSubShapes);
 
-  Standard_Boolean isComesFromDecomposition = !((aSubShapes.Extent() == 1) && (theShape == aSubShapes (1)));
+  Standard_Boolean 
+    isComesFromDecomposition = !((aSubShapes.Extent() == 1) && (theShape == aSubShapes (1)));
   int anExtent = aSubShapes.Extent();
   for (Standard_Integer aShIndex = 1; aShIndex <= aSubShapes.Extent(); ++aShIndex)
   {
index f303adec9999dcfec9b41c35a4335a3b5ee2370c..bb816a81b6d1203347ab02ea08dd817ff70963be 100755 (executable)
@@ -32,7 +32,8 @@ public:
   DEFINE_STANDARD_RTTI(PartSet_ResultSketchPrs)
 protected:
   /// Redefinition of virtual function
-  Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
+  Standard_EXPORT virtual void Compute(
+    const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
     const Handle(Prs3d_Presentation)& thePresentation, const Standard_Integer theMode = 0);
 
   /// Redefinition of virtual function
@@ -45,7 +46,8 @@ private:
   /// \param theShape a shape
   /// \param theTypeOfSelection type of selection: VERTEX, EDGE, WIRE
   void appendShapeSelection(const Handle(SelectMgr_Selection)& theSelection,
-                            const TopoDS_Shape& theShape, const TopAbs_ShapeEnum& theTypeOfSelection);
+                            const TopoDS_Shape& theShape, 
+                            const TopAbs_ShapeEnum& theTypeOfSelection);
 
   /// Sets color/line style/width of the presentation depending on the parameter state
   /// \param isAuxiliary a boolean value if the properties are for auxiliary objects
index 47ea8850adf1add3897ecfc827f1cc791ff78e40..06b553b57f2275322a0881d1e6f1bfa645bf44be 100644 (file)
@@ -213,7 +213,8 @@ public:
   bool isObjectOfSketch(const ObjectPtr& theObject) const;
 
   /// Saves the current selection in the viewer into an internal container
-  /// It obtains the selected attributes. The highlighted objects can be processes as the selected ones
+  /// It obtains the selected attributes. 
+  /// The highlighted objects can be processes as the selected ones
   /// \param theHighlightedOnly a boolean flag
   void storeSelection(const bool theHighlightedOnly = false);
 
@@ -284,7 +285,8 @@ private slots:
   void onLeaveViewPort();
   /// Listens to the value changed signal and display the current operation feature
   void onBeforeValuesChangedInPropertyPanel();
-  /// Listens to the signal about the modification of the values have been done in the property panel
+  /// Listens to the signal about the modification of the values 
+  /// have been done in the property panel
   void onAfterValuesChangedInPropertyPanel();
 
   void onMousePressed(ModuleBase_IViewWindow*, QMouseEvent*);
@@ -347,7 +349,8 @@ private:
 
   /// Erase or display the feature of the current operation. If the mouse over the active view or
   /// a current value is changed by property panel, the feature is displayed otherwise it is hidden
-  /// \param theOperation an operation which feature is to be displayed, it is nested create operation
+  /// \param theOperation an operation which feature is to be displayed, 
+  ///                     it is nested create operation
   /// \param isToDisplay a flag about the display or erase the feature
   void visualizeFeature(const FeaturePtr& theFeature, const bool isEditOperation,
                         const bool isToDisplay, const bool isFlushRedisplay = true);
@@ -369,7 +372,8 @@ private:
   bool myIsDragging;
   bool myDragDone;
   bool myIsMouseOverWindow; /// the state that the mouse over the view
-  bool myIsMouseOverViewProcessed; /// the state whether the over view state is processed by mouseMove method
+  /// the state whether the over view state is processed by mouseMove method
+  bool myIsMouseOverViewProcessed; 
   bool myIsPopupMenuActive; /// the state of the popup menu is shown
   Point myCurrentPoint;
   //Point myClickedPoint;
index 5bc007456d2a4c577573406ff582b592adc27ca5..cb2bc68ccc164b810a145e737c31b65e2f423ead 100755 (executable)
@@ -218,10 +218,13 @@ bool PartSet_SketcherReetntrantMgr::processMouseReleased(ModuleBase_IViewWindow*
       myPreviousFeature = aFOperation->feature();
 
       /// selection should be obtained from workshop before ask if the operation can be started as
-      /// the canStartOperation method performs commit/abort of previous operation. Sometimes commit/abort
-      /// may cause selection clear(Sketch operation) as a result it will be lost and is not used for preselection.
+      /// the canStartOperation method performs commit/abort of previous operation.
+      /// Sometimes commit/abort
+      /// may cause selection clear(Sketch operation) as a result 
+      /// it will be lost and is not used for preselection.
       ModuleBase_ISelection* aSelection = myWorkshop->selection();
-      QList<ModuleBase_ViewerPrsPtr> aPreSelected = aSelection->getSelected(ModuleBase_ISelection::AllControls);
+      QList<ModuleBase_ViewerPrsPtr> aPreSelected = 
+        aSelection->getSelected(ModuleBase_ISelection::AllControls);
 
       restartOperation();
       myPreviousFeature = FeaturePtr();
@@ -230,7 +233,8 @@ bool PartSet_SketcherReetntrantMgr::processMouseReleased(ModuleBase_IViewWindow*
       // fill the first widget by the mouse event point
       // if the active widget is not the first, it means that the restarted operation is filled by
       // the current preselection.
-      PartSet_WidgetPoint2D* aPoint2DWdg = dynamic_cast<PartSet_WidgetPoint2D*>(module()->activeWidget());
+      PartSet_WidgetPoint2D* aPoint2DWdg = 
+        dynamic_cast<PartSet_WidgetPoint2D*>(module()->activeWidget());
       ModuleBase_ModelWidget* aFirstWidget = aPanel->findFirstAcceptingValueWidget();
       if (aPoint2DWdg && aPoint2DWdg == aFirstWidget) {
         if (!aPreSelected.empty())
@@ -440,9 +444,11 @@ bool PartSet_SketcherReetntrantMgr::startInternalEdit(const std::string& thePrev
             if (aPreviousAttributeWidget == aPanel->activeWidget()) {
               aPanel->activateWidget(NULL, false);
             }
-            // if there is no the next widget to be automatically activated, the Ok button in property
+            // if there is no the next widget to be automatically activated,
+            // the Ok button in property
             // panel should accept the focus(example is parallel constraint on sketch lines)
-            QToolButton* anOkBtn = dynamic_cast<XGUI_PropertyPanel*>(aPanel)->findButton(PROP_PANEL_OK);
+            QToolButton* anOkBtn = 
+              dynamic_cast<XGUI_PropertyPanel*>(aPanel)->findButton(PROP_PANEL_OK);
             if (anOkBtn)
               anOkBtn->setFocus(Qt::TabFocusReason);
           }
@@ -537,7 +543,8 @@ void PartSet_SketcherReetntrantMgr::createInternalFeature()
 void PartSet_SketcherReetntrantMgr::deleteInternalFeature()
 {
   if (myInternalActiveWidget) {
-    ModuleBase_WidgetSelector* aWSelector = dynamic_cast<ModuleBase_WidgetSelector*>(myInternalActiveWidget);
+    ModuleBase_WidgetSelector* aWSelector = 
+      dynamic_cast<ModuleBase_WidgetSelector*>(myInternalActiveWidget);
     if (aWSelector)
       aWSelector->activateSelectionAndFilters(false);
     myInternalActiveWidget = 0;
index a18db6bcd458ecb6ebfa7ee25a2b51b664774214..647d214eed91f79f0bdac0ac078eea7567c0086c 100755 (executable)
@@ -29,7 +29,8 @@ class PartSet_Module;
 /// ('internal' edit operation), with the ability to simultaneously create the next entity
 /// of same type (re-entrance of the operation).
 /// OK valids the current edition and exits from the operation (no re-entrance).
-/// Cancel removes (undo) the entity currently edited and exits from the operation (no re-entrance).
+/// Cancel removes (undo) the entity currently edited and 
+/// exits from the operation (no re-entrance).
 class PARTSET_EXPORT PartSet_SketcherReetntrantMgr : public QObject
 {
 Q_OBJECT
@@ -38,7 +39,8 @@ Q_OBJECT
 enum RestartingMode {
   RM_None, /// the operation should not be restarted
   RM_Forbided, /// the operation should not be restarted after there is no active widget
-  RM_LastFeatureUsed, /// the operation is restarted and use the previous feature for own initialization
+  RM_LastFeatureUsed, /// the operation is restarted and use 
+                      /// the previous feature for own initialization
   RM_EmptyFeatureUsed /// the operation is restarted and does not use the previous feature
 };
 
@@ -164,7 +166,8 @@ private:
   bool isTangentArc(ModuleBase_Operation* theOperation,
                     const std::shared_ptr<ModelAPI_CompositeFeature>& /*theSketch*/) const;
 
-  /// Accept All action is enabled if an internal edit is started. It updates the state of the button
+  /// Accept All action is enabled if an internal edit is started. 
+  /// It updates the state of the button
   void updateAcceptAllAction();
 
   /// Returns the workshop
index 7a420b78135eb90c238841bc6c5e9472ed996f18..425e1b5b56533685df8adc68d578433408d93c95 100755 (executable)
@@ -175,7 +175,8 @@ std::shared_ptr<GeomAPI_Pnt2d> PartSet_Tools::convertTo2D(FeaturePtr theSketch,
 }
 
 
-std::shared_ptr<GeomAPI_Pnt> PartSet_Tools::convertTo3D(const double theX, const double theY, FeaturePtr theSketch)
+std::shared_ptr<GeomAPI_Pnt> PartSet_Tools::convertTo3D(const double theX, const double theY,
+                                                        FeaturePtr theSketch)
 {
   std::shared_ptr<ModelAPI_Data> aData = theSketch->data();
 
@@ -326,8 +327,9 @@ std::shared_ptr<GeomDataAPI_Point2D> PartSet_Tools::findFirstEqualPointInArgumen
   return aFeaturePoint;
 }
 
-std::shared_ptr<GeomDataAPI_Point2D> PartSet_Tools::findFirstEqualPoint(const FeaturePtr& theFeature,
-                                                      const std::shared_ptr<GeomAPI_Pnt2d>& thePoint)
+std::shared_ptr<GeomDataAPI_Point2D> PartSet_Tools::findFirstEqualPoint(
+                                              const FeaturePtr& theFeature,
+                                              const std::shared_ptr<GeomAPI_Pnt2d>& thePoint)
 {
   std::shared_ptr<GeomDataAPI_Point2D> aFPoint;
 
@@ -475,9 +477,11 @@ ResultPtr PartSet_Tools::createFixedObjectByExternal(const TopoDS_Shape& theShap
 
         std::shared_ptr<ModelAPI_Data> aData = aMyFeature->data();
         std::shared_ptr<GeomDataAPI_Point2D> aPoint1 = 
-          std::dynamic_pointer_cast<GeomDataAPI_Point2D>(aData->attribute(SketchPlugin_Line::START_ID()));
+          std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+          aData->attribute(SketchPlugin_Line::START_ID()));
         std::shared_ptr<GeomDataAPI_Point2D> aPoint2 = 
-          std::dynamic_pointer_cast<GeomDataAPI_Point2D>(aData->attribute(SketchPlugin_Line::END_ID()));
+          std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+          aData->attribute(SketchPlugin_Line::END_ID()));
 
         aPoint1->setValue(aPnt2d1);
         aPoint2->setValue(aPnt2d2);
@@ -518,7 +522,8 @@ ResultPtr PartSet_Tools::createFixedObjectByExternal(const TopoDS_Shape& theShap
 
       ResultPtr aRes = std::dynamic_pointer_cast<ModelAPI_Result>(theObject);
       // selection shape has no result owner => the trihedron axis
-      // TODO: make reference to the real axes when they are implemented in the initialization plugin
+      // TODO: make reference to the real axes when 
+      // they are implemented in the initialization plugin
       if (!aRes.get()) {
         ObjectPtr aPointObj = ModelAPI_Session::get()->moduleDocument()->objectByName(
           ModelAPI_ResultConstruction::group(), "Origin");
@@ -558,7 +563,8 @@ ResultPtr PartSet_Tools::createFixedObjectByExternal(const TopoDS_Shape& theShap
         (aData->attribute(SketchPlugin_SketchEntity::EXTERNAL_ID()));
 
       ResultPtr aRes = std::dynamic_pointer_cast<ModelAPI_Result>(theObject);
-      // if there is no object, it means that this is the origin point: search it in the module document
+      // if there is no object, 
+      // it means that this is the origin point: search it in the module document
       if (!aRes.get()) {
         ObjectPtr aPointObj = ModelAPI_Session::get()->moduleDocument()->objectByName(
           ModelAPI_ResultConstruction::group(), "Origin");
@@ -579,7 +585,8 @@ ResultPtr PartSet_Tools::createFixedObjectByExternal(const TopoDS_Shape& theShap
 
         std::shared_ptr<GeomAPI_Pnt2d> aPnt2d = convertTo2D(theSketch, aPnt);
         std::shared_ptr<GeomDataAPI_Point2D> aPoint = 
-          std::dynamic_pointer_cast<GeomDataAPI_Point2D>(aData->attribute(SketchPlugin_Point::COORD_ID()));
+          std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+          aData->attribute(SketchPlugin_Point::COORD_ID()));
         aPoint->setValue(aPnt2d);
         if ((aPnt->x() < Precision::Confusion()) && 
             (aPnt->y() < Precision::Confusion()) &&
@@ -621,7 +628,8 @@ bool PartSet_Tools::isContainPresentation(const QList<ModuleBase_ViewerPrsPtr>&
   return false;
 }
 
-ResultPtr PartSet_Tools::findExternalEdge(CompositeFeaturePtr theSketch, std::shared_ptr<GeomAPI_Edge> theEdge)
+ResultPtr PartSet_Tools::findExternalEdge(CompositeFeaturePtr theSketch, 
+                                          std::shared_ptr<GeomAPI_Edge> theEdge)
 {
   for (int i = 0; i < theSketch->numberOfSubs(); i++) {
     FeaturePtr aFeature = theSketch->subFeature(i);
@@ -650,7 +658,8 @@ ResultPtr PartSet_Tools::findExternalEdge(CompositeFeaturePtr theSketch, std::sh
 }
 
 
-ResultPtr PartSet_Tools::findExternalVertex(CompositeFeaturePtr theSketch, std::shared_ptr<GeomAPI_Vertex> theVert)
+ResultPtr PartSet_Tools::findExternalVertex(CompositeFeaturePtr theSketch, 
+                                            std::shared_ptr<GeomAPI_Vertex> theVert)
 {
   for (int i = 0; i < theSketch->numberOfSubs(); i++) {
     FeaturePtr aFeature = theSketch->subFeature(i);
@@ -746,8 +755,9 @@ GeomShapePtr PartSet_Tools::findShapeBy2DPoint(const AttributePtr& theAttribute,
   return aShape;
 }
 
-std::shared_ptr<GeomAPI_Pnt2d> PartSet_Tools::getPoint(std::shared_ptr<ModelAPI_Feature>& theFeature,
-                                                       const std::string& theAttribute)
+std::shared_ptr<GeomAPI_Pnt2d> PartSet_Tools::getPoint(
+                                                  std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                                  const std::string& theAttribute)
 {
   std::shared_ptr<GeomDataAPI_Point2D> aPointAttr = ModelGeomAlgo_Point2D::getPointOfRefAttr(
                                           theFeature.get(), theAttribute, SketchPlugin_Point::ID(),
@@ -757,7 +767,8 @@ std::shared_ptr<GeomAPI_Pnt2d> PartSet_Tools::getPoint(std::shared_ptr<ModelAPI_
   return std::shared_ptr<GeomAPI_Pnt2d>();
 }
 
-FeaturePtr findFirstCoincidenceByData(const DataPtr& theData, std::shared_ptr<GeomAPI_Pnt2d> thePoint)
+FeaturePtr findFirstCoincidenceByData(const DataPtr& theData, 
+                                      std::shared_ptr<GeomAPI_Pnt2d> thePoint)
 {
   FeaturePtr aCoincident;
 
@@ -895,7 +906,7 @@ void PartSet_Tools::findCoincidences(FeaturePtr theStartCoin, QList<FeaturePtr>&
 std::shared_ptr<GeomAPI_Pnt2d> PartSet_Tools::getCoincedencePoint(FeaturePtr theStartCoin)
 {
   std::shared_ptr<GeomAPI_Pnt2d> aPnt = SketcherPrs_Tools::getPoint(theStartCoin.get(), 
-                                                                    SketchPlugin_Constraint::ENTITY_A());
+                                                        SketchPlugin_Constraint::ENTITY_A());
   if (aPnt.get() == NULL)
     aPnt = SketcherPrs_Tools::getPoint(theStartCoin.get(), SketchPlugin_Constraint::ENTITY_B());
   return aPnt;
@@ -927,7 +938,8 @@ AttributePtr PartSet_Tools::findAttributeBy2dPoint(ObjectPtr theObj,
           if (!aCurPoint->isInitialized())
             continue;
 
-          std::shared_ptr<GeomAPI_Pnt> aPnt = convertTo3D(aCurPoint->x(), aCurPoint->y(), theSketch);
+          std::shared_ptr<GeomAPI_Pnt> aPnt = 
+            convertTo3D(aCurPoint->x(), aCurPoint->y(), theSketch);
           if (aPnt && (aPnt->distance(aValue) < Precision::Confusion())) {
             anAttribute = aCurPoint;
             break;
index 3bbebc781b5dbd17262dccfa6d3e79cb0d36e93d..7e92c4d24adedc6bede4bcbc1e1261f9ecf41a73 100755 (executable)
@@ -78,13 +78,15 @@ public:
   /// \param theSketch the sketch feature
   /// \param thePnt the 3D point in the viewer
   /// \returns the converted point object
-  static std::shared_ptr<GeomAPI_Pnt2d> convertTo2D(FeaturePtr theSketch, const std::shared_ptr<GeomAPI_Pnt>& thePnt);
+  static std::shared_ptr<GeomAPI_Pnt2d> convertTo2D(FeaturePtr theSketch, 
+                                                    const std::shared_ptr<GeomAPI_Pnt>& thePnt);
 
   /// \brief Converts the 2D projected coodinates on the sketch plane to the 3D point.
   /// \param theX the X coordinate
   /// \param theY the Y coordinate
   /// \param theSketch the sketch feature
-  static std::shared_ptr<GeomAPI_Pnt> convertTo3D(const double theX, const double theY, FeaturePtr theSketch);
+  static std::shared_ptr<GeomAPI_Pnt> convertTo3D(const double theX, const double theY, 
+                                                  FeaturePtr theSketch);
 
   /// Returns pointer to the root document.
   static std::shared_ptr<ModelAPI_Document> document();
@@ -205,7 +207,8 @@ public:
   /// \param theView a 3D view
   /// \param theX the output horizontal coordinate of the point
   /// \param theY the output vertical coordinate of the point
-  static bool hasVertexShape(const std::shared_ptr<ModuleBase_ViewerPrs>& thePrs, FeaturePtr theSketch,
+  static bool hasVertexShape(const std::shared_ptr<ModuleBase_ViewerPrs>& thePrs, 
+                             FeaturePtr theSketch,
                              Handle_V3d_View theView, double& theX, double& theY);
 
 
index 831f9d914f85c32f17f36c109a90f1dd20564e17..6cd04eb542d909dcf254a9aaedf52297b8c4fe5e 100755 (executable)
@@ -82,7 +82,8 @@ std::shared_ptr<GeomAPI_Pln> sketcherPlane(ModuleBase_Operation* theOperation)
 {
   std::shared_ptr<GeomAPI_Pln> aEmptyPln;
   if (theOperation) {
-    ModuleBase_OperationFeature* aFeatureOp = dynamic_cast<ModuleBase_OperationFeature*>(theOperation);
+    ModuleBase_OperationFeature* aFeatureOp =
+      dynamic_cast<ModuleBase_OperationFeature*>(theOperation);
     if (aFeatureOp) {
       CompositeFeaturePtr aFeature = 
         std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(aFeatureOp->feature());
@@ -96,7 +97,8 @@ std::shared_ptr<GeomAPI_Pln> sketcherPlane(ModuleBase_Operation* theOperation)
 
 bool isEmptySelectionValid(ModuleBase_Operation* theOperation)
 {
-  ModuleBase_OperationFeature* aFeatureOp = dynamic_cast<ModuleBase_OperationFeature*>(theOperation);
+  ModuleBase_OperationFeature* aFeatureOp = 
+    dynamic_cast<ModuleBase_OperationFeature*>(theOperation);
   // during the create operation empty selection is always valid
   if (!aFeatureOp->isEditOperation()) {
     return true;
@@ -109,12 +111,14 @@ bool isEmptySelectionValid(ModuleBase_Operation* theOperation)
       else 
         return false;
     }
-    else// in edit operation an empty selection is always valid, performed for re-entrant operrations
+    else
+      // in edit operation an empty selection is always valid, performed for re-entrant operrations
       return true;
   }
 }
 
-bool PartSet_DistanceSelection::isValid(const ModuleBase_ISelection* theSelection, ModuleBase_Operation* theOperation) const
+bool PartSet_DistanceSelection::isValid(const ModuleBase_ISelection* theSelection,
+                                        ModuleBase_Operation* theOperation) const
 {
   if (theSelection->getSelected(ModuleBase_ISelection::Viewer).size() == 0) {
     return isEmptySelectionValid(theOperation);
@@ -124,7 +128,8 @@ bool PartSet_DistanceSelection::isValid(const ModuleBase_ISelection* theSelectio
   }
 }
 
-bool PartSet_LengthSelection::isValid(const ModuleBase_ISelection* theSelection, ModuleBase_Operation* theOperation) const
+bool PartSet_LengthSelection::isValid(const ModuleBase_ISelection* theSelection,
+                                      ModuleBase_Operation* theOperation) const
 {
   if (theSelection->getSelected(ModuleBase_ISelection::Viewer).size() == 0) {
     return isEmptySelectionValid(theOperation);
@@ -134,7 +139,8 @@ bool PartSet_LengthSelection::isValid(const ModuleBase_ISelection* theSelection,
   }
 }
 
-bool PartSet_PerpendicularSelection::isValid(const ModuleBase_ISelection* theSelection, ModuleBase_Operation* theOperation) const
+bool PartSet_PerpendicularSelection::isValid(const ModuleBase_ISelection* theSelection,
+                                             ModuleBase_Operation* theOperation) const
 {
   if (theSelection->getSelected(ModuleBase_ISelection::Viewer).size() == 0) {
     return isEmptySelectionValid(theOperation);
@@ -144,7 +150,8 @@ bool PartSet_PerpendicularSelection::isValid(const ModuleBase_ISelection* theSel
   }
 }
 
-bool PartSet_ParallelSelection::isValid(const ModuleBase_ISelection* theSelection, ModuleBase_Operation* theOperation) const
+bool PartSet_ParallelSelection::isValid(const ModuleBase_ISelection* theSelection,
+                                        ModuleBase_Operation* theOperation) const
 {
   if (theSelection->getSelected(ModuleBase_ISelection::Viewer).size() == 0) {
     return isEmptySelectionValid(theOperation);
@@ -154,12 +161,14 @@ bool PartSet_ParallelSelection::isValid(const ModuleBase_ISelection* theSelectio
   }
 }
 
-bool PartSet_RadiusSelection::isValid(const ModuleBase_ISelection* theSelection, ModuleBase_Operation* theOperation) const
+bool PartSet_RadiusSelection::isValid(const ModuleBase_ISelection* theSelection,
+                                      ModuleBase_Operation* theOperation) const
 {
   if (theSelection->getSelected(ModuleBase_ISelection::Viewer).size() == 0) {
     return isEmptySelectionValid(theOperation);
   } else {
-    QList<ModuleBase_ViewerPrsPtr> aList = theSelection->getSelected(ModuleBase_ISelection::Viewer);
+    QList<ModuleBase_ViewerPrsPtr> aList = 
+      theSelection->getSelected(ModuleBase_ISelection::Viewer);
     int aCount = 0;
     foreach (ModuleBase_ViewerPrsPtr aPrs, aList) {
       const GeomShapePtr& aShape = aPrs->shape();
@@ -179,18 +188,21 @@ bool PartSet_RadiusSelection::isValid(const ModuleBase_ISelection* theSelection,
   }
 }
 
-bool PartSet_RigidSelection::isValid(const ModuleBase_ISelection* theSelection, ModuleBase_Operation* theOperation) const
+bool PartSet_RigidSelection::isValid(const ModuleBase_ISelection* theSelection,
+                                     ModuleBase_Operation* theOperation) const
 {
   if (theSelection->getSelected(ModuleBase_ISelection::Viewer).size() == 0) {
     return isEmptySelectionValid(theOperation);
   } else {
-    QList<ModuleBase_ViewerPrsPtr> aList = theSelection->getSelected(ModuleBase_ISelection::Viewer);
+    QList<ModuleBase_ViewerPrsPtr> aList = 
+      theSelection->getSelected(ModuleBase_ISelection::Viewer);
     return (aList.count() == 1);
   }
 }
 
 
-bool PartSet_CoincidentSelection::isValid(const ModuleBase_ISelection* theSelection, ModuleBase_Operation* theOperation) const
+bool PartSet_CoincidentSelection::isValid(const ModuleBase_ISelection* theSelection,
+                                          ModuleBase_Operation* theOperation) const
 {
   if (theSelection->getSelected(ModuleBase_ISelection::Viewer).size() == 0) {
     return isEmptySelectionValid(theOperation);
@@ -202,7 +214,8 @@ bool PartSet_CoincidentSelection::isValid(const ModuleBase_ISelection* theSelect
   }
 }
 
-bool PartSet_HVDirSelection::isValid(const ModuleBase_ISelection* theSelection, ModuleBase_Operation* theOperation) const
+bool PartSet_HVDirSelection::isValid(const ModuleBase_ISelection* theSelection,
+                                     ModuleBase_Operation* theOperation) const
 {
   if (theSelection->getSelected(ModuleBase_ISelection::Viewer).size() == 0) {
     return isEmptySelectionValid(theOperation);
@@ -212,7 +225,8 @@ bool PartSet_HVDirSelection::isValid(const ModuleBase_ISelection* theSelection,
   }
 }
 
-bool PartSet_FilletSelection::isValid(const ModuleBase_ISelection* theSelection, ModuleBase_Operation* theOperation) const
+bool PartSet_FilletSelection::isValid(const ModuleBase_ISelection* theSelection,
+                                      ModuleBase_Operation* theOperation) const
 {
   if (theSelection->getSelected(ModuleBase_ISelection::Viewer).size() == 0) {
     return isEmptySelectionValid(theOperation);
@@ -222,7 +236,8 @@ bool PartSet_FilletSelection::isValid(const ModuleBase_ISelection* theSelection,
   }
 }
 
-bool PartSet_TangentSelection::isValid(const ModuleBase_ISelection* theSelection, ModuleBase_Operation* theOperation) const
+bool PartSet_TangentSelection::isValid(const ModuleBase_ISelection* theSelection,
+                                       ModuleBase_Operation* theOperation) const
 {
   if (theSelection->getSelected(ModuleBase_ISelection::Viewer).size() == 0) {
     return isEmptySelectionValid(theOperation);
@@ -259,7 +274,8 @@ bool PartSet_TangentSelection::isValid(const ModuleBase_ISelection* theSelection
   }
 }
 
-bool PartSet_AngleSelection::isValid(const ModuleBase_ISelection* theSelection, ModuleBase_Operation* theOperation) const
+bool PartSet_AngleSelection::isValid(const ModuleBase_ISelection* theSelection,
+                                     ModuleBase_Operation* theOperation) const
 {
   if (theSelection->getSelected(ModuleBase_ISelection::Viewer).size() == 0) {
     return isEmptySelectionValid(theOperation);
@@ -269,12 +285,14 @@ bool PartSet_AngleSelection::isValid(const ModuleBase_ISelection* theSelection,
   }
 }
 
-bool PartSet_EqualSelection::isValid(const ModuleBase_ISelection* theSelection, ModuleBase_Operation* theOperation) const
+bool PartSet_EqualSelection::isValid(const ModuleBase_ISelection* theSelection, 
+                                     ModuleBase_Operation* theOperation) const
 {
   if (theSelection->getSelected(ModuleBase_ISelection::Viewer).size() == 0) {
     return isEmptySelectionValid(theOperation);
   } else {
-    QList<ModuleBase_ViewerPrsPtr> aList = theSelection->getSelected(ModuleBase_ISelection::Viewer);
+    QList<ModuleBase_ViewerPrsPtr> aList =
+      theSelection->getSelected(ModuleBase_ISelection::Viewer);
     int aCount = 0;
     int aType = 0;
     foreach (ModuleBase_ViewerPrsPtr aPrs, aList) {
@@ -305,7 +323,8 @@ bool PartSet_EqualSelection::isValid(const ModuleBase_ISelection* theSelection,
   }
 }
 
-bool PartSet_CollinearSelection::isValid(const ModuleBase_ISelection* theSelection, ModuleBase_Operation* theOperation) const
+bool PartSet_CollinearSelection::isValid(const ModuleBase_ISelection* theSelection,
+                                         ModuleBase_Operation* theOperation) const
 {
   if (theSelection->getSelected(ModuleBase_ISelection::Viewer).size() == 0) {
     return isEmptySelectionValid(theOperation);
@@ -315,7 +334,8 @@ bool PartSet_CollinearSelection::isValid(const ModuleBase_ISelection* theSelecti
   }
 }
 
-bool PartSet_MiddlePointSelection::isValid(const ModuleBase_ISelection* theSelection, ModuleBase_Operation* theOperation) const
+bool PartSet_MiddlePointSelection::isValid(const ModuleBase_ISelection* theSelection,
+                                           ModuleBase_Operation* theOperation) const
 {
   if (theSelection->getSelected(ModuleBase_ISelection::Viewer).size() == 0)
     return isEmptySelectionValid(theOperation);
@@ -360,13 +380,15 @@ bool PartSet_DifferentObjectsValidator::isValid(const AttributePtr& theAttribute
 {
   FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(theAttribute->owner());
 
-  // the type of validated attributes should be equal, attributes with different types are not validated
+  // the type of validated attributes should be equal, attributes with 
+  // different types are not validated
   // Check RefAttr attributes
   std::string anAttrType = theAttribute->attributeType();
   std::list<std::shared_ptr<ModelAPI_Attribute> > anAttrs;
 
   if (anAttrType == ModelAPI_AttributeRefAttr::typeId()) {
-    AttributeRefAttrPtr anAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(theAttribute);
+    AttributeRefAttrPtr anAttr = 
+      std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(theAttribute);
     bool isObject = anAttr->isObject();
     ObjectPtr anObject = anAttr->object();
 
@@ -376,7 +398,7 @@ bool PartSet_DifferentObjectsValidator::isValid(const AttributePtr& theAttribute
       for(; anAttrIter != anAttrs.end(); anAttrIter++) {
       if ((*anAttrIter).get() && (*anAttrIter)->id() != theAttribute->id()) {
           std::shared_ptr<ModelAPI_AttributeRefAttr> aRef =
-                                      std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(*anAttrIter);
+                              std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(*anAttrIter);
           if (aRef->isObject() != isObject)
             continue;
           if (isObject) {
@@ -400,7 +422,8 @@ bool PartSet_DifferentObjectsValidator::isValid(const AttributePtr& theAttribute
     }
   }
   else if (anAttrType == ModelAPI_AttributeSelection::typeId()) {
-    AttributeSelectionPtr anAttr = std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(theAttribute);
+    AttributeSelectionPtr anAttr = 
+      std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(theAttribute);
     ResultPtr aContext = anAttr->context();
     GeomShapePtr aShape = anAttr->value();
 
@@ -411,7 +434,7 @@ bool PartSet_DifferentObjectsValidator::isValid(const AttributePtr& theAttribute
       for(; anAttr != anAttrs.end(); anAttr++) {
         if ((*anAttr).get() && (*anAttr)->id() != theAttribute->id()) {
           std::shared_ptr<ModelAPI_AttributeSelection> aRef =
-                                        std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(*anAttr);
+                              std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(*anAttr);
           // check the object is already presented
           if (aRef->context() == aContext) {
             bool aHasShape = aShape.get() != NULL;
@@ -425,7 +448,8 @@ bool PartSet_DifferentObjectsValidator::isValid(const AttributePtr& theAttribute
     }
   }
   else if (anAttrType == ModelAPI_AttributeReference::typeId()) {
-    AttributeReferencePtr anAttr = std::dynamic_pointer_cast<ModelAPI_AttributeReference>(theAttribute);
+    AttributeReferencePtr anAttr = 
+      std::dynamic_pointer_cast<ModelAPI_AttributeReference>(theAttribute);
     ObjectPtr anObject = anAttr->value();
     // Check selection attributes
     anAttrs = aFeature->data()->attributes(ModelAPI_AttributeReference::typeId());
@@ -467,7 +491,8 @@ bool PartSet_DifferentObjectsValidator::isValid(const AttributePtr& theAttribute
             for(int j = 0; j < aRefSelList->size(); j++) {
               std::shared_ptr<ModelAPI_AttributeSelection> aRefSel = aRefSelList->value(j);
               ResultPtr aRefSelContext = aRefSel->context();
-              ResultCompSolidPtr aRefSelCompSolidPtr = ModelAPI_Tools::compSolidOwner(aRefSelContext);
+              ResultCompSolidPtr aRefSelCompSolidPtr = 
+                ModelAPI_Tools::compSolidOwner(aRefSelContext);
               std::shared_ptr<GeomAPI_Shape> aRefSelCompSolid;
               if(aRefSelCompSolidPtr.get()) {
                 aRefSelCompSolid = aRefSelCompSolidPtr->shape();
index 0b25943aabdd08c49a4112e6ae90253243de9139..aa2a5d7e6be3e0667589e05bacfbac5b0dcdedee 100644 (file)
@@ -23,7 +23,8 @@
 class PartSet_DistanceSelection : public ModuleBase_SelectionValidator
 {
 public:
-  PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection, ModuleBase_Operation* theOperation) const;
+  PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection, 
+                                      ModuleBase_Operation* theOperation) const;
 };
 
 //! \ingroup Validators
@@ -31,7 +32,8 @@ public:
 class PartSet_LengthSelection : public ModuleBase_SelectionValidator
 {
 public:
-  PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection, ModuleBase_Operation* theOperation) const;
+  PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection, 
+                                      ModuleBase_Operation* theOperation) const;
 };
 
 //! \ingroup Validators
@@ -39,7 +41,8 @@ public:
 class PartSet_PerpendicularSelection : public ModuleBase_SelectionValidator
 {
 public:
-  PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection, ModuleBase_Operation* theOperation) const;
+  PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection, 
+                                      ModuleBase_Operation* theOperation) const;
 };
 
 //! \ingroup Validators
@@ -47,7 +50,8 @@ public:
 class PartSet_ParallelSelection : public ModuleBase_SelectionValidator
 {
 public:
-  PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection, ModuleBase_Operation* theOperation) const;
+  PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection,
+                                      ModuleBase_Operation* theOperation) const;
 };
 
 //! \ingroup Validators
@@ -55,7 +59,8 @@ public:
 class PartSet_RadiusSelection : public ModuleBase_SelectionValidator
 {
 public:
-  PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection, ModuleBase_Operation* theOperation) const;
+  PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection,
+                                      ModuleBase_Operation* theOperation) const;
 };
 
 //! \ingroup Validators
@@ -63,7 +68,8 @@ public:
 class PartSet_RigidSelection : public ModuleBase_SelectionValidator
 {
 public:
-  PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection, ModuleBase_Operation* theOperation) const;
+  PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection,
+                                      ModuleBase_Operation* theOperation) const;
 };
 
 
@@ -72,7 +78,8 @@ public:
 class PartSet_CoincidentSelection : public ModuleBase_SelectionValidator
 {
 public:
-  PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection, ModuleBase_Operation* theOperation) const;
+  PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection,
+                                      ModuleBase_Operation* theOperation) const;
 };
 
 //! \ingroup Validators
@@ -80,7 +87,8 @@ public:
 class PartSet_HVDirSelection : public ModuleBase_SelectionValidator
 {
 public:
-  PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection, ModuleBase_Operation* theOperation) const;
+  PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection,
+                                      ModuleBase_Operation* theOperation) const;
 };
 
 //! \ingroup Validators
@@ -88,7 +96,8 @@ public:
 class PartSet_TangentSelection : public ModuleBase_SelectionValidator
 {
 public:
-  PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection, ModuleBase_Operation* theOperation) const;
+  PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection,
+                                      ModuleBase_Operation* theOperation) const;
 };
 
 //! \ingroup Validators
@@ -96,7 +105,8 @@ public:
 class PartSet_FilletSelection : public ModuleBase_SelectionValidator
 {
 public:
-  PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection, ModuleBase_Operation* theOperation) const;
+  PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection,
+                                      ModuleBase_Operation* theOperation) const;
 };
 
 //! \ingroup Validators
@@ -104,7 +114,8 @@ public:
 class PartSet_AngleSelection : public ModuleBase_SelectionValidator
 {
 public:
-  PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection, ModuleBase_Operation* theOperation) const;
+  PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection,
+                                      ModuleBase_Operation* theOperation) const;
 };
 
 //! \ingroup Validators
@@ -112,7 +123,8 @@ public:
 class PartSet_EqualSelection : public ModuleBase_SelectionValidator
 {
 public:
-  PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection, ModuleBase_Operation* theOperation) const;
+  PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection,
+                                      ModuleBase_Operation* theOperation) const;
 };
 
 //! \ingroup Validators
@@ -120,7 +132,8 @@ public:
 class PartSet_CollinearSelection : public ModuleBase_SelectionValidator
 {
 public:
-  PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection, ModuleBase_Operation* theOperation) const;
+  PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection,
+                                      ModuleBase_Operation* theOperation) const;
 };
 
 //! \ingroup Validators
@@ -128,7 +141,8 @@ public:
 class PartSet_MiddlePointSelection : public ModuleBase_SelectionValidator
 {
 public:
-  PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection, ModuleBase_Operation* theOperation) const;
+  PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection,
+                                      ModuleBase_Operation* theOperation) const;
 };
 
 ////////////// Attribute validators ////////////////
index f8c46f4082fb2bc275a5891ef9ec2787c3d78d64..c1bf231f2042b32d61a833bc66bd7c6bb85df94f 100644 (file)
@@ -29,7 +29,8 @@ bool PartSet_WidgetFileSelector::restoreValueCustom()
 
   DataPtr aData = myFeature->data();
   AttributeStringPtr aStringAttr = aData->string(ExchangePlugin_ExportFeature::FILE_PATH_ID());
-  mySelectedFilter = formatToFilter(shortFormatToFullFormat(QString::fromStdString(aStringAttr->value())));
+  mySelectedFilter = 
+    formatToFilter(shortFormatToFullFormat(QString::fromStdString(aStringAttr->value())));
 
   return ModuleBase_WidgetFileSelector::restoreValueCustom();
 }
index 1cdac35fa5988ddb145a48cf715c7f876836a3e8..60fffb15d3728f5c68fd37dbcd854275953b09d5 100755 (executable)
@@ -87,7 +87,8 @@ void PartSet_WidgetMultiSelector::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 {
         anExternalObject = theObject;
index dcb39aa4e40fbab4c713c97a1c0eec14c8d55cdc..3c9fc33a45d0a1c44aa9bca0cbee6e64524eeb56 100755 (executable)
@@ -200,8 +200,10 @@ private:
   ModuleBase_ParamSpinBox* myXSpin;  ///< the spin box for the X coordinate
   ModuleBase_ParamSpinBox* myYSpin;  ///< the spin box for the Y coordinate
 
-  std::shared_ptr<ModuleBase_ViewerPrs> myPreSelected; ///< value used as selection in mouse release method
-  ///< it is important during restart operation
+   /// value used as selection in mouse release method
+  std::shared_ptr<ModuleBase_ViewerPrs> myPreSelected;
+
+  /// it is important during restart operation
   CompositeFeaturePtr mySketch;
 
   bool myValueIsCashed; /// boolean state if the value is cashed during value state change
index 2c7daebdedc25ba8f850d6e3ed8010bf3b012ddf..79d1217bc3330ffc29226312b7f30ecedbd1a2a9 100644 (file)
@@ -85,13 +85,15 @@ void PartSet_WidgetPoint2dDistance::setPoint(FeaturePtr theFeature,
   }
 }
 
-double PartSet_WidgetPoint2dDistance::computeValue(const std::shared_ptr<GeomAPI_Pnt2d>& theFirstPnt,
-                                                   const std::shared_ptr<GeomAPI_Pnt2d>& theCurrentPnt)
+double PartSet_WidgetPoint2dDistance::computeValue(
+                              const std::shared_ptr<GeomAPI_Pnt2d>& theFirstPnt,
+                              const std::shared_ptr<GeomAPI_Pnt2d>& theCurrentPnt)
 {
   return theCurrentPnt->distance(theFirstPnt);
 }
 
-void PartSet_WidgetPoint2dDistance::mouseReleased(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent)
+void PartSet_WidgetPoint2dDistance::mouseReleased(ModuleBase_IViewWindow* theWnd,
+                                                  QMouseEvent* theEvent)
 {
   // the contex menu release by the right button should not be processed by this widget
   if (theEvent->button() != Qt::LeftButton)
@@ -113,7 +115,8 @@ void PartSet_WidgetPoint2dDistance::mouseReleased(ModuleBase_IViewWindow* theWnd
     emit focusOutWidget(this);
 }
 
-void PartSet_WidgetPoint2dDistance::mouseMoved(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent)
+void PartSet_WidgetPoint2dDistance::mouseMoved(ModuleBase_IViewWindow* theWnd, 
+                                               QMouseEvent* theEvent)
 {
   if (isEditingMode())
     return;
index 0836b20b1a22a84197fc7490dcf993e1362d8bc0..63fe24778f7b285cd31143a814dec69e4537575f 100644 (file)
@@ -86,7 +86,8 @@ protected:
   /// \return true if the widget current value is reset
   virtual bool resetCustom();
 
-  /// Set the second point which defines a value in the widget as a distance with a first point defined by feature
+  /// Set the second point which defines a value in the widget as 
+  /// a distance with a first point defined by feature
   void setPoint(FeaturePtr theFeature, const std::shared_ptr<GeomAPI_Pnt2d>& thePnt);
 
   /// Compute the distance between points
index 394756ca5affe473441f8f46e3f2c554b9c78ba3..9e03258187a161f975b9913a4e88f6368200823b 100644 (file)
@@ -265,7 +265,8 @@ bool PartSet_WidgetSketchCreator::setSelection(QList<ModuleBase_ViewerPrsPtr>& t
   bool aDone = false;
   if (!startSketchOperation(theValues)) {
     myIsCustomAttribute = true;
-    QList<ModuleBase_ViewerPrsPtr>::const_iterator anIt = theValues.begin(), aLast = theValues.end();
+    QList<ModuleBase_ViewerPrsPtr>::const_iterator 
+      anIt = theValues.begin(), aLast = theValues.end();
     bool aProcessed = false;
     for (; anIt != aLast; anIt++) {
       ModuleBase_ViewerPrsPtr aValue = *anIt;
@@ -278,7 +279,8 @@ bool PartSet_WidgetSketchCreator::setSelection(QList<ModuleBase_ViewerPrsPtr>& t
       emit valuesChanged();
       updateObject(myFeature);
       setVisibleSelectionControl(false);
-      // manually deactivation because the widget was not activated as has no focus acceptin controls
+      // manually deactivation because the widget was 
+      // not activated as has no focus acceptin controls
       deactivate();
       emit focusOutWidget(this);
     }
@@ -298,7 +300,8 @@ void PartSet_WidgetSketchCreator::updateOnSelectionChanged(const bool theDone)
 {
 }
 
-bool PartSet_WidgetSketchCreator::startSketchOperation(const QList<ModuleBase_ViewerPrsPtr>& theValues)
+bool PartSet_WidgetSketchCreator::startSketchOperation(
+                              const QList<ModuleBase_ViewerPrsPtr>& theValues)
 {
   bool aSketchStarted = false;
 
@@ -313,7 +316,8 @@ bool PartSet_WidgetSketchCreator::startSketchOperation(const QList<ModuleBase_Vi
   /// sketch should not started by object(face) selected as global. If Local face is selected,
   /// sketch is started
   if (aResult.get() && aValue->shape().get() && aResult->shape()->isEqual(aValue->shape())) {
-    ResultConstructionPtr aConstruction = std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aResult);
+    ResultConstructionPtr aConstruction = 
+      std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aResult);
     if (!aConstruction.get() || !aConstruction->isInfinite())
       return aSketchStarted;
   }
@@ -350,7 +354,8 @@ bool PartSet_WidgetSketchCreator::focusTo()
     return true;
   }
   else
-    connect(myModule, SIGNAL(resumed(ModuleBase_Operation*)), SLOT(onResumed(ModuleBase_Operation*)));
+    connect(myModule, SIGNAL(resumed(ModuleBase_Operation*)), 
+            SLOT(onResumed(ModuleBase_Operation*)));
 
   return true;
 }
@@ -489,14 +494,16 @@ bool PartSet_WidgetSketchCreator::validateSelectionList() const
     XGUI_Workshop* aWorkshop = XGUI_Tools::workshop(myModule->workshop());
     // TODO(spo): translate
     QMessageBox::question(aWorkshop->desktop(), tr("Apply current feature"),
-                  tr("Sketch is invalid and will be deleted.\nError: %1").arg(anError.messageString().c_str()),
+                  tr("Sketch is invalid and will be deleted.\nError: %1")
+                  .arg(anError.messageString().c_str()),
                   QMessageBox::Ok);
   }
   return isValidPComposite;
 }
 
-void PartSet_WidgetSketchCreator::setSketchObjectToList(const CompositeFeaturePtr& theCompositeFeature,
-                                                        const AttributePtr& theAttribute)
+void PartSet_WidgetSketchCreator::setSketchObjectToList(
+                            const CompositeFeaturePtr& theCompositeFeature,
+                            const AttributePtr& theAttribute)
 {
   if (!theCompositeFeature.get() || theCompositeFeature->numberOfSubs() != 1)
     return;
@@ -513,7 +520,8 @@ void PartSet_WidgetSketchCreator::setSketchObjectToList(const CompositeFeaturePt
   }
 
   ResultPtr aSketchRes = aSketchFeature->results().front();
-  ResultConstructionPtr aConstruction = std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aSketchRes);
+  ResultConstructionPtr aConstruction = 
+    std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aSketchRes);
   if(!aConstruction.get()) {
     return;
   }
index 60a3cf30ea04b00a3775d2830107640fc556d1d9..5e8ed26e62c8b33e9f251d36d8f5b750d29a5e8e 100644 (file)
@@ -42,7 +42,8 @@ public:
   /// \return a control list
   virtual QList<QWidget*> getControls() const;
 
-  /// Set focus to the first control of the current widget. The focus policy of the control is checked.
+  /// Set focus to the first control of the current widget. 
+  /// The focus policy of the control is checked.
   /// If the widget has the NonFocus focus policy, it is skipped.
   /// \return the state whether the widget can accept the focus
   virtual bool focusTo();
index a19b96a37ac9d41fc21da278b5df09ae03e4a416..33872cf953c52049b9df41ba9d6b3b71c3aa2346 100644 (file)
@@ -97,7 +97,8 @@ PartSet_WidgetSketchLabel::PartSet_WidgetSketchLabel(QWidget* theParent,
   myViewInverted = new QCheckBox(tr("Reversed"), aViewBox);
   aViewLayout->addWidget(myViewInverted);
 
-  QPushButton* aSetViewBtn = new QPushButton(QIcon(":icons/plane_view.png"), tr("Set plane view"), aViewBox);
+  QPushButton* aSetViewBtn = 
+    new QPushButton(QIcon(":icons/plane_view.png"), tr("Set plane view"), aViewBox);
   connect(aSetViewBtn, SIGNAL(clicked(bool)), this, SLOT(onSetPlaneView()));
   aViewLayout->addWidget(aSetViewBtn);
 
@@ -209,8 +210,9 @@ void PartSet_WidgetSketchLabel::blockAttribute(const AttributePtr& theAttribute,
   }
 }
 
-bool PartSet_WidgetSketchLabel::setSelectionInternal(const QList<ModuleBase_ViewerPrsPtr>& theValues,
-                                                     const bool theToValidate)
+bool PartSet_WidgetSketchLabel::setSelectionInternal(
+                                          const QList<ModuleBase_ViewerPrsPtr>& theValues,
+                                          const bool theToValidate)
 {
   bool aDone = false;
   if (theValues.empty()) {
index 50f81218d9c380d5008baac0d6b09bbbd360adce..d2beed18e6b47e2eb6629dd2be8ee14df9d501da 100755 (executable)
@@ -183,7 +183,8 @@ bool PartSet_WidgetSubShapeSelector::setSelection(
 
       /// find the points in coincident features
       PntToAttributesMap aRefAttributes = myCashedReferences[aBaseObject];
-      PntToAttributesMap::const_iterator aRIt = aRefAttributes.begin(), aRLast = aRefAttributes.end();
+      PntToAttributesMap::const_iterator 
+        aRIt = aRefAttributes.begin(), aRLast = aRefAttributes.end();
       for (; aRIt != aRLast; aRIt++) {
         std::shared_ptr<GeomDataAPI_Point2D> anAttribute = aRIt->first;
         std::shared_ptr<GeomAPI_Pnt> aPoint = aRIt->second;