From 9d3578fd0411f759f8d1a179731fa1b2455fe735 Mon Sep 17 00:00:00 2001 From: adv Date: Mon, 24 Mar 2014 05:09:24 +0000 Subject: [PATCH] Method name corrected. --- src/HYDROData/HYDROData_Channel.cxx | 4 ++-- src/HYDROData/HYDROData_Channel.h | 8 ++++---- src/HYDROGUI/HYDROGUI_ChannelOp.cxx | 28 +++++++++++++++------------- 3 files changed, 21 insertions(+), 19 deletions(-) diff --git a/src/HYDROData/HYDROData_Channel.cxx b/src/HYDROData/HYDROData_Channel.cxx index cc8706e5..b7f8c7a8 100644 --- a/src/HYDROData/HYDROData_Channel.cxx +++ b/src/HYDROData/HYDROData_Channel.cxx @@ -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 ); diff --git a/src/HYDROData/HYDROData_Channel.h b/src/HYDROData/HYDROData_Channel.h index f497f36e..c7ed2841 100644 --- a/src/HYDROData/HYDROData_Channel.h +++ b/src/HYDROData/HYDROData_Channel.h @@ -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: diff --git a/src/HYDROGUI/HYDROGUI_ChannelOp.cxx b/src/HYDROGUI/HYDROGUI_ChannelOp.cxx index 4078af04..0a622785 100644 --- a/src/HYDROGUI/HYDROGUI_ChannelOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ChannelOp.cxx @@ -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 ); } -- 2.39.2