]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
Method name corrected.
authoradv <adv@opencascade.com>
Mon, 24 Mar 2014 05:09:24 +0000 (05:09 +0000)
committeradv <adv@opencascade.com>
Mon, 24 Mar 2014 05:09:24 +0000 (05:09 +0000)
src/HYDROData/HYDROData_Channel.cxx
src/HYDROData/HYDROData_Channel.h
src/HYDROGUI/HYDROGUI_ChannelOp.cxx

index cc8706e5c2695f2a8f658139fa75c2839f1bd04f..b7f8c7a8a46875e95f32ab729b045ef435eb35aa 100644 (file)
@@ -84,7 +84,7 @@ TopoDS_Shape HYDROData_Channel::GetShape3D() const
   return getShape3D();
 }
 
-bool HYDROData_Channel::CreatePresentaions( const Handle(HYDROData_Polyline3D)& theGuideLine,
+bool HYDROData_Channel::CreatePresentations( const Handle(HYDROData_Polyline3D)& theGuideLine,
                                             const Handle(HYDROData_Profile)&    theProfile,
                                             PrsDefinition&                      thePrs )
 {
@@ -137,7 +137,7 @@ void HYDROData_Channel::Update()
   Handle(HYDROData_Profile) aProfile = GetProfile();
 
   PrsDefinition aResultPrs;
-  if ( !CreatePresentaions( aGuideLine, aProfile, aResultPrs ) )
+  if ( !CreatePresentations( aGuideLine, aProfile, aResultPrs ) )
     return;
 
   SetShape3D( aResultPrs.myPrs3D );
index f497f36efc489673f1cbd9c9b6a5eee3f360d024..c7ed284136032d235faf640318adc1de60ef94e3 100644 (file)
@@ -50,11 +50,11 @@ public:
 public:
 
   /**
-   * Creates the presentation by given guide line and profile.
+   * Creates the presentations(2D and 3D) by given guide line and profile.
    */
-  HYDRODATA_EXPORT static bool CreatePresentaions( const Handle(HYDROData_Polyline3D)& theGuideLine,
-                                                   const Handle(HYDROData_Profile)&    theProfile,
-                                                   PrsDefinition&                      thePrs );
+  HYDRODATA_EXPORT static bool CreatePresentations( const Handle(HYDROData_Polyline3D)& theGuideLine,
+                                                    const Handle(HYDROData_Profile)&    theProfile,
+                                                    PrsDefinition&                      thePrs );
 
 public:
 
index 4078af047d4ddd77aeeff284df7a183f56883768..0a6227851bcce28a3f74afdb2faab14bc741189f 100644 (file)
@@ -156,7 +156,7 @@ bool HYDROGUI_ChannelOp::processApply( int& theUpdateFlags,
     return false;
   }
 
-  if( !myIsEdit || ( !myEditedObject.IsNull() && myEditedObject->GetName() != anObjectName ) )
+  if ( !myIsEdit || ( !myEditedObject.IsNull() && myEditedObject->GetName() != anObjectName ) )
   {
     // check that there are no other objects with the same name in the document
     Handle(HYDROData_Entity) anObject = HYDROGUI_Tool::FindObjectByName( module(), anObjectName );
@@ -256,7 +256,20 @@ void HYDROGUI_ChannelOp::onCreatePreview()
     {
       Handle(AIS_InteractiveContext) aCtx = aViewer->getAISContext();
       if ( !aCtx.IsNull() )
+      {
         myPreviewPrs = new HYDROGUI_Shape( aCtx, NULL, getPreviewZLayer() );
+
+        QColor aFillingColor = getDefaultFillingColor();
+        QColor aBorderColor = getDefaultBorderColor();
+        if ( !myEditedObject.IsNull() )
+        {
+          aFillingColor = myEditedObject->GetFillingColor();
+          aBorderColor = myEditedObject->GetBorderColor();
+        }
+
+        myPreviewPrs->setFillingColor( aFillingColor, false, false );
+        myPreviewPrs->setBorderColor( aBorderColor, false, false );
+      }
     }
   }
 
@@ -270,23 +283,12 @@ void HYDROGUI_ChannelOp::onCreatePreview()
     HYDROGUI_Tool::FindObjectByName( module(), aProfileName, KIND_PROFILE ) );
 
   HYDROData_Channel::PrsDefinition aPrsDef;
-  if ( !HYDROData_Channel::CreatePresentaions( aGuideLine, aProfile, aPrsDef ) )
+  if ( !HYDROData_Channel::CreatePresentations( aGuideLine, aProfile, aPrsDef ) )
   {
     erasePreview();
     return;
   }
 
-  QColor aFillingColor = getDefaultFillingColor();
-  QColor aBorderColor = getDefaultBorderColor();
-  if ( !myEditedObject.IsNull() )
-  {
-    aFillingColor = myEditedObject->GetFillingColor();
-    aBorderColor = myEditedObject->GetBorderColor();
-  }
-
-  myPreviewPrs->setFillingColor( aFillingColor, false, false );
-  myPreviewPrs->setBorderColor( aBorderColor, false, false );
-
   myPreviewPrs->setShape( aPrsDef.myPrs2D );
 }