]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Show ISO lines only on bodies and with highlighting also
authorvsv <vsv@opencascade.com>
Thu, 13 Feb 2020 13:22:38 +0000 (16:22 +0300)
committervsv <vsv@opencascade.com>
Thu, 13 Feb 2020 13:22:38 +0000 (16:22 +0300)
src/ModelAPI/ModelAPI_Tools.cpp
src/ModuleBase/ModuleBase_ResultPrs.cpp

index 3d293492e517645cf583bdf62eb22a8c7fdea2d4..0c312f3955c162af9e8bbc0ddeb993efa422d02e 100644 (file)
@@ -30,6 +30,7 @@
 #include <ModelAPI_AttributeDocRef.h>
 #include <ModelAPI_Validator.h>
 #include <ModelAPI_AttributeIntArray.h>
+#include <ModelAPI_ResultConstruction.h>
 #include <list>
 #include <map>
 #include <iostream>
@@ -852,13 +853,19 @@ void getColor(const std::shared_ptr<ModelAPI_Result>& theResult, std::vector<int
 void getIsoLines(const std::shared_ptr<ModelAPI_Result>& theResult, std::vector<int>& theNbLines)
 {
   theNbLines.clear();
-  // get color from the attribute of the result
-  if (theResult.get() != NULL &&
-    theResult->data()->attribute(ModelAPI_Result::ISO_LINES_ID()).get() != NULL) {
-    AttributeIntArrayPtr aAttr = theResult->data()->intArray(ModelAPI_Result::ISO_LINES_ID());
-    if (aAttr.get() && aAttr->size()) {
-      theNbLines.push_back(aAttr->value(0));
-      theNbLines.push_back(aAttr->value(1));
+  if (theResult->groupName() == ModelAPI_ResultConstruction::group()) {
+    theNbLines.push_back(0);
+    theNbLines.push_back(0);
+  }
+  else {
+    // get color from the attribute of the result
+    if (theResult.get() != NULL &&
+      theResult->data()->attribute(ModelAPI_Result::ISO_LINES_ID()).get() != NULL) {
+      AttributeIntArrayPtr aAttr = theResult->data()->intArray(ModelAPI_Result::ISO_LINES_ID());
+      if (aAttr.get() && aAttr->size()) {
+        theNbLines.push_back(aAttr->value(0));
+        theNbLines.push_back(aAttr->value(1));
+      }
     }
   }
 }
index fceb96c2f220183bf26cad71b7f4e30b22d56194..5fb170087ad61bfb8dd7d0603edb859ba8d49f5a 100644 (file)
@@ -98,8 +98,6 @@ ModuleBase_ResultPrs::ModuleBase_ResultPrs(ResultPtr theResult)
   aDrawer->SetUIsoAspect(myUIsoAspect);
   aDrawer->SetVIsoAspect(myVIsoAspect);
 
-  aDrawer->SetIsoOnPlane(false);
-
   if (aDrawer->HasOwnPointAspect())
     aDrawer->PointAspect()->SetTypeOfMarker(Aspect_TOM_PLUS);
   else
@@ -109,17 +107,11 @@ ModuleBase_ResultPrs::ModuleBase_ResultPrs(ResultPtr theResult)
   if (aDrawer.IsNull()) {
     if (!ModuleBase_IViewer::DefaultHighlightDrawer.IsNull()) {
       aDrawer = new Prs3d_Drawer(*ModuleBase_IViewer::DefaultHighlightDrawer);
-      Handle(Prs3d_IsoAspect) aUIsoAspect = new Prs3d_IsoAspect(aColor, Aspect_TOL_SOLID, 1, 0);
-      Handle(Prs3d_IsoAspect) aVIsoAspect = new Prs3d_IsoAspect(aColor, Aspect_TOL_SOLID, 1, 0);
-      aDrawer->SetUIsoAspect(aUIsoAspect);
-      aDrawer->SetVIsoAspect(aVIsoAspect);
+      aDrawer->SetUIsoAspect(myUIsoAspect);
+      aDrawer->SetVIsoAspect(myVIsoAspect);
       SetDynamicHilightAttributes(aDrawer);
     }
-  } else {
-    aDrawer->VIsoAspect()->SetNumber(0);
-    aDrawer->UIsoAspect()->SetNumber(0);
   }
-  aDrawer->SetIsoOnPlane(false);
 
   myHiddenSubShapesDrawer = new AIS_ColoredDrawer(myDrawer);
   Handle(Prs3d_ShadingAspect) aShadingAspect = new Prs3d_ShadingAspect();