gp_Lin aMidLin( aMiddlePoint2d, gp::DZ() );
TopoDS_Edge aMidEdge = BRepLib_MakeEdge( aMidLin );
- TopoDS_Iterator anIt( TopoDS::Wire( GetShape3D() ) );
+ const TopoDS_Wire& aProf = TopoDS::Wire( GetShape3D() );
+ if (aProf.IsNull())
+ return aMiddlePoint;
+ TopoDS_Iterator anIt( aProf );
for ( ; anIt.More(); anIt.Next()) {
const TopoDS_Edge& anEdge = TopoDS::Edge( anIt.Value() );
myProfileLabel = new QLabel( tr( "CHANNEL_PROFILE" ), aParamGroup);
myProfileModeButton = new QRadioButton( tr( "VIA_PROFILE" ), myObjectNameGroup );
- QRadioButton* ProfileModeButton2 = new QRadioButton( tr( "PREDEF" ), myObjectNameGroup );
+ myProfileModeButton2 = new QRadioButton( tr( "PREDEF" ), myObjectNameGroup );
QGridLayout* aParamsLayout = new QGridLayout( aParamGroup );
aParamsLayout->setMargin( 5 );
aParamsLayout->addWidget( myGuideLines, 0, 1 );
aParamsLayout->addWidget( myProfileModeButton, 1, 0 );
- aParamsLayout->addWidget( ProfileModeButton2, 1, 1 );
+ aParamsLayout->addWidget( myProfileModeButton2, 1, 1 );
aParamsLayout->addWidget( myProfileLabel, 2, 0 );
aParamsLayout->addWidget( myProfiles, 2, 1 );
return myProfileModeButton->isChecked();
}
+void HYDROGUI_ChannelDlg::setProfileMode(bool mode)
+{
+ myProfileModeButton->setChecked(mode);
+ myProfileModeButton2->setChecked(!mode);
+}
+
double HYDROGUI_ChannelDlg::getEquiDistance() const
{
return myEquiDistance->value();
void setInvertDirection( bool isChecked );
bool getProfileMode();
+ void setProfileMode(bool);
+
double getLCValue() const;
void setLCValue( double );
QtxDoubleSpinBox* myCoteZVal;
QRadioButton* myProfileModeButton;
+ QRadioButton* myProfileModeButton2;
+
};
#endif
myEditedObject.Nullify();
QString aSelectedGuideLine, aSelectedProfile;
+ bool profile_mode = true;
+
QString anObjectName = HYDROGUI_Tool::GenerateObjectName( module(), tr( "DEFAULT_CHANNEL_NAME" ) );
if ( myIsEdit )
Handle(HYDROData_Profile) aRefProfile = myEditedObject->GetProfile();
if ( !aRefProfile.IsNull() )
aSelectedProfile = aRefProfile->GetName();
+
+ profile_mode = myEditedObject->GetProfileMode();
}
}
aPanel->setProfileName( aSelectedProfile );
if( !myEditedObject.IsNull() )
+ {
aPanel->setEquiDistance( myEditedObject->GetEquiDistance() );
+ if (!profile_mode) //predef
+ {
+ aPanel->setLCValue( myEditedObject->GetLCValue() );
+ aPanel->setCoteZValue( myEditedObject->GetCoteZValue() );
+ aPanel->setDeltaZValue( myEditedObject->GetDeltaZValue() );
+ }
+ }
else
aPanel->setEquiDistance( 1.0 );
aPanel->setInvertDirection( false );
aPanel->blockSignals( false );
+ aPanel->setProfileMode(profile_mode);
onCreatePreview();
}