Salome HOME
projects
/
modules
/
hydro.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
refs #727, #736: fix for the first bug and for the second part (Bug2) of the last...
[modules/hydro.git]
/
src
/
HYDROGUI
/
HYDROGUI_ChannelOp.cxx
diff --git
a/src/HYDROGUI/HYDROGUI_ChannelOp.cxx
b/src/HYDROGUI/HYDROGUI_ChannelOp.cxx
index 8bf96b1365f9e645b5a224526b93c57f495acdf3..99bf0cb70ca9fff56f3364274e98c3657bd11c72 100644
(file)
--- a/
src/HYDROGUI/HYDROGUI_ChannelOp.cxx
+++ b/
src/HYDROGUI/HYDROGUI_ChannelOp.cxx
@@
-1,8
+1,4
@@
-// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
+// Copyright (C) 2014-2015 EDF-R&D
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
@@
-28,6
+24,7
@@
#include "HYDROGUI_Module.h"
#include "HYDROGUI_Shape.h"
#include "HYDROGUI_Tool.h"
#include "HYDROGUI_Module.h"
#include "HYDROGUI_Shape.h"
#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
#include "HYDROGUI_UpdateFlags.h"
#include <HYDROData_Iterator.h>
#include "HYDROGUI_UpdateFlags.h"
#include <HYDROData_Iterator.h>
@@
-111,7
+108,7
@@
void HYDROGUI_ChannelOp::startOperation()
}
// collect information about existing profiles
}
// collect information about existing profiles
- QStringList aProfiles = HYDROGUI_Tool::FindExistingObjectsNames( doc(), KIND_PROFILE,
tru
e );
+ QStringList aProfiles = HYDROGUI_Tool::FindExistingObjectsNames( doc(), KIND_PROFILE,
fals
e );
aPanel->setObjectName( anObjectName );
aPanel->setObjectName( anObjectName );
@@
-179,29
+176,43
@@
bool HYDROGUI_ChannelOp::processApply( int& theUpdateFlags,
if ( !myIsEdit )
{
if ( !myIsEdit )
{
- myEditedObject->SetFillingColor(
get
DefaultFillingColor() );
- myEditedObject->SetBorderColor(
get
DefaultBorderColor() );
+ myEditedObject->SetFillingColor(
myEditedObject->
DefaultFillingColor() );
+ myEditedObject->SetBorderColor(
myEditedObject->
DefaultBorderColor() );
}
QString aGuideLineName = aPanel->getGuideLineName();
QString aProfileName = aPanel->getProfileName();
}
QString aGuideLineName = aPanel->getGuideLineName();
QString aProfileName = aPanel->getProfileName();
- if ( aGuideLineName.isEmpty() || aProfileName.isEmpty() )
+
/*
if ( aGuideLineName.isEmpty() || aProfileName.isEmpty() )
{
myEditedObject->RemoveGuideLine();
myEditedObject->RemoveProfile();
}
{
myEditedObject->RemoveGuideLine();
myEditedObject->RemoveProfile();
}
- else
+ else
*/
{
Handle(HYDROData_Polyline3D) aGuideLine = Handle(HYDROData_Polyline3D)::DownCast(
HYDROGUI_Tool::FindObjectByName( module(), aGuideLineName, KIND_POLYLINE ) );
{
Handle(HYDROData_Polyline3D) aGuideLine = Handle(HYDROData_Polyline3D)::DownCast(
HYDROGUI_Tool::FindObjectByName( module(), aGuideLineName, KIND_POLYLINE ) );
+ if ( aGuideLine.IsNull() )
+ {
+ theErrorMsg = tr( "GUIDE_LINE_IS_NOT_SELECTED" );
+ return false;
+ }
+
+ myEditedObject->RemoveGuideLine();
myEditedObject->SetGuideLine( aGuideLine );
Handle(HYDROData_Profile) aProfile = Handle(HYDROData_Profile)::DownCast(
HYDROGUI_Tool::FindObjectByName( module(), aProfileName, KIND_PROFILE ) );
myEditedObject->SetGuideLine( aGuideLine );
Handle(HYDROData_Profile) aProfile = Handle(HYDROData_Profile)::DownCast(
HYDROGUI_Tool::FindObjectByName( module(), aProfileName, KIND_PROFILE ) );
+ if ( aProfile.IsNull() )
+ {
+ theErrorMsg = tr( "PROFILE_IS_NOT_SELECTED" );
+ return false;
+ }
+
+ myEditedObject->RemoveProfile();
myEditedObject->SetProfile( aProfile );
}
myEditedObject->SetProfile( aProfile );
}
- if ( myEditedObject->IsMustBeUpdated() )
+ if ( myEditedObject->IsMustBeUpdated(
HYDROData_Entity::Geom_2d
) )
myEditedObject->Update();
erasePreview();
myEditedObject->Update();
erasePreview();
@@
-225,16
+236,6
@@
Handle(HYDROData_Channel) HYDROGUI_ChannelOp::createNewObject() const
return Handle(HYDROData_Channel)::DownCast( doc()->CreateObject( KIND_CHANNEL ) );
}
return Handle(HYDROData_Channel)::DownCast( doc()->CreateObject( KIND_CHANNEL ) );
}
-QColor HYDROGUI_ChannelOp::getDefaultFillingColor() const
-{
- return HYDROData_Channel::DefaultFillingColor();
-}
-
-QColor HYDROGUI_ChannelOp::getDefaultBorderColor() const
-{
- return HYDROData_Channel::DefaultBorderColor();
-}
-
void HYDROGUI_ChannelOp::onCreatePreview()
{
HYDROGUI_ChannelDlg* aPanel = ::qobject_cast<HYDROGUI_ChannelDlg*>( inputPanel() );
void HYDROGUI_ChannelOp::onCreatePreview()
{
HYDROGUI_ChannelDlg* aPanel = ::qobject_cast<HYDROGUI_ChannelDlg*>( inputPanel() );
@@
-267,8
+268,8
@@
void HYDROGUI_ChannelOp::onCreatePreview()
{
myPreviewPrs = new HYDROGUI_Shape( aCtx, NULL, getPreviewZLayer() );
{
myPreviewPrs = new HYDROGUI_Shape( aCtx, NULL, getPreviewZLayer() );
- QColor aFillingColor =
getDefaultFillingColor()
;
- QColor aBorderColor =
getDefaultBorderColor()
;
+ QColor aFillingColor =
Qt::blue
;
+ QColor aBorderColor =
Qt::transparent
;
if ( !myEditedObject.IsNull() )
{
aFillingColor = myEditedObject->GetFillingColor();
if ( !myEditedObject.IsNull() )
{
aFillingColor = myEditedObject->GetFillingColor();