]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
XXXXX CR35152
authorasozinov <alexey.sozinov@opencascade.com>
Wed, 15 Nov 2023 16:48:46 +0000 (16:48 +0000)
committerasozinov <alexey.sozinov@opencascade.com>
Wed, 15 Nov 2023 16:48:46 +0000 (16:48 +0000)
src/SketchPlugin/SketchPlugin_Circle.cpp
src/SketchPlugin/SketchPlugin_ConstraintMiddle.cpp
src/SketchPlugin/SketchPlugin_MacroCircle.cpp

index ca1059f554e91cc9cb133ea230fd16cc5c6e93b1..9fa234635318c128bfe37e5ca8f813cf99b27281 100644 (file)
@@ -70,7 +70,7 @@ void SketchPlugin_Circle::initDerivedClassAttributes()
   ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), ANGLE_ID());
 }
 
-/*static FeaturePtr CreatePoint(FeaturePtr theCircleFeature, SketchPlugin_Sketch* theSketch,
+static FeaturePtr CreatePoint(FeaturePtr theCircleFeature, SketchPlugin_Sketch* theSketch,
   GeomPnt2dPtr thePoint)
 {
   // create point at sewing point of circle
@@ -82,7 +82,7 @@ void SketchPlugin_Circle::initDerivedClassAttributes()
   aCoord->setValue(thePoint);
   aPointFeature->execute();
   return aPointFeature;
-}*/
+}
 
 void SketchPlugin_Circle::execute()
 {
@@ -132,8 +132,10 @@ void SketchPlugin_Circle::execute()
   aResult->setIsInHistory(false);
   setResult(aResult, 1);
 
-  /*if (!reference(ROTATE_REF_ID())->value())
+  if (!reference(ROTATE_REF_ID())->value())
   {
+    //this->keepCurrentFeature();
+    //this->restoreCurrentFeature();
     aWasBlocked = data()->blockSendAttributeUpdated(true);
     auto aCurCircle = this->document()->currentFeature(true);
     auto aCrPoint = CreatePoint(aCurCircle, sketch(), std::dynamic_pointer_cast<GeomDataAPI_Point2D>(data()->attribute(ROTATE_ID()))->pnt());
@@ -142,7 +144,7 @@ void SketchPlugin_Circle::execute()
     aCrPoint->boolean(AUXILIARY_ID())->setValue(boolean(AUXILIARY_ID())->value());
     reference(SketchPlugin_Circle::ROTATE_REF_ID())->setValue(aCrPoint);
     data()->blockSendAttributeUpdated(aWasBlocked, false);
-  }*/
+  }
 }
 
 bool SketchPlugin_Circle::isFixed() {
index 9d478833b9d44ff94445cb1572fbb09c2d960587..a563a446771d63f75eeae5b56b5217654446e08d 100644 (file)
@@ -26,6 +26,7 @@
 #include <ModelAPI_Validator.h>
 #include <ModelAPI_AttributeString.h>
 
+#include <iostream>
 #include <ModelAPI_Events.h>
 #include <SketchPlugin_Point.h>
 #include <SketchPlugin_Tools.h>
@@ -73,11 +74,11 @@ void SketchPlugin_ConstraintMiddle::CreatePoint()
 
 void SketchPlugin_ConstraintMiddle::initAttributes()
 {
-  data()->addAttribute(SketchPlugin_ConstraintMiddle::MIDDLE_TYPE(), ModelAPI_AttributeString::typeId());
-
   data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::typeId());
   data()->addAttribute(SketchPlugin_Constraint::ENTITY_B(), ModelAPI_AttributeRefAttr::typeId());
 
+  data()->addAttribute(SketchPlugin_ConstraintMiddle::MIDDLE_TYPE(), ModelAPI_AttributeString::typeId());
+  data()->string(SketchPlugin_ConstraintMiddle::MIDDLE_TYPE())->setValue(SketchPlugin_ConstraintMiddle::MIDDLE_TYPE_BY_LINE_AND_POINT());
   data()->addAttribute(POINT_REF_ID(), GeomDataAPI_Point2D::typeId());
 
   ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), POINT_REF_ID());
@@ -98,6 +99,10 @@ void SketchPlugin_ConstraintMiddle::execute()
 
     if (!attribute(ENTITY_B())->isInitialized())
       CreatePoint(); // Create new point
+    std::cout << attribute(ENTITY_A())->attributeType() << std::endl;
+    std::cout << refattr(ENTITY_A())->attributeType() << std::endl;
+    std::wcout << refattr(ENTITY_A())->object()->data()->name() << std::endl;
+    std::cout << refattr(ENTITY_A())->attr() << std::endl;
   }
 }
 
index 3cc52b32cd0d5cd9ec52b274cc83620955181ca0..c9ea40477f3be0b0844e1172e34f96dbb73c080e 100644 (file)
@@ -301,7 +301,7 @@ FeaturePtr SketchPlugin_MacroCircle::createCircleFeature()
   aCircleFeature->execute();
 
   // Create point
-  FeaturePtr aNPoint = CreatePoint(aCircleFeature, myRotPoint);
+  //FeaturePtr aNPoint = CreatePoint(aCircleFeature, myRotPoint);
 
   return aCircleFeature;
 }