]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue 1299 angle constraint: support of additional and complementary angles: value...
authornds <nds@opencascade.com>
Thu, 7 Apr 2016 13:41:45 +0000 (16:41 +0300)
committernds <nds@opencascade.com>
Thu, 7 Apr 2016 13:41:45 +0000 (16:41 +0300)
src/InitializationPlugin/InitializationPlugin_Plugin.cpp
src/SketchPlugin/SketchPlugin_ConstraintAngle.cpp
src/SketcherPrs/SketcherPrs_Angle.cpp

index b37e89ead260a28966c41385ae172dc625013aba..7418469e6202eeb8ff2643879214bd367a3ec658 100644 (file)
@@ -48,7 +48,7 @@ void InitializationPlugin_Plugin::processEvent(const std::shared_ptr<Events_Mess
 
     aFeatures.push_back(createPoint(aDoc));
     aFeatures.push_back(createPlane(aDoc, 1., 0., 0.));
-    aFeatures.push_back(createPlane(aDoc, 0., 1., 0.));
+    aFeatures.push_back(createPlane(aDoc, 0., -1., 0.));
     aFeatures.push_back(createPlane(aDoc, 0., 0., 1.));
     // for PartSet it is done outside of the transaction, so explicitly flush this creation
     Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_CREATED));
index 728d7dfd180a6c5736f2a0248da64463c28e9370..7b60a594c70e40a4bb8cd7f4fa0d70f9ad05f87f 100644 (file)
@@ -212,7 +212,7 @@ double SketchPlugin_ConstraintAngle::getAngleForType(double theAngle)
       anAngle = aPositiveNormal ? theAngle : 360 - theAngle;
     break;
     case SketcherPrs_Tools::ANGLE_COMPLEMENTARY:
-      anAngle = 180 - theAngle;
+      anAngle = fabs(180 - theAngle);
     break;
     case SketcherPrs_Tools::ANGLE_BACKWARD:
       anAngle = aPositiveNormal ? 360 - theAngle : theAngle;
index bd79f8b4b29846fe75698e4021a7a796d350d1aa..cbc4b9f8256ed58239ab2c709b5ff9de4e2ca566 100644 (file)
@@ -168,15 +168,13 @@ void SketcherPrs_Angle::Compute(const Handle(PrsMgr_PresentationManager3d)& theP
 
   // Angle value is in degrees
   AttributeDoublePtr aVal = aData->real(SketchPlugin_ConstraintAngle::ANGLE_VALUE_ID());
-  SetCustomValue(aVal->value() * PI / 180.0);
+  SetCustomValue(aVal->value());
 
   myAspect->SetExtensionSize(myAspect->ArrowAspect()->Length());
   myAspect->SetArrowTailSize(myAspect->ArrowAspect()->Length());
 
-  AttributeDoublePtr aValue = myConstraint->data()->real(SketchPlugin_ConstraintAngle::ANGLE_VALUE_ID());
-  SketcherPrs_Tools::setDisplaySpecialSymbol(this, aValue->usedParameters().size() > 0);
-
-  myStyleListener->updateDimensions(this, aValue);
+  SketcherPrs_Tools::setDisplaySpecialSymbol(this, aVal->usedParameters().size() > 0);
+  myStyleListener->updateDimensions(this, aVal);
 
   AIS_AngleDimension::Compute(thePresentationManager, thePresentation, theMode);
 }