From 98f7db3b8e1b5c5cb629a76308f9370905952f4b Mon Sep 17 00:00:00 2001 From: apo Date: Wed, 25 Jun 2008 13:26:02 +0000 Subject: [PATCH] To intialize class attributes before to use them --- src/VISU_I/VISU_ColoredPrs3d_i.cc | 26 +++++++++++++++++--------- src/VISU_I/VISU_CutLines_i.cc | 3 ++- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/VISU_I/VISU_ColoredPrs3d_i.cc b/src/VISU_I/VISU_ColoredPrs3d_i.cc index 10e26802..5d2b629d 100644 --- a/src/VISU_I/VISU_ColoredPrs3d_i.cc +++ b/src/VISU_I/VISU_ColoredPrs3d_i.cc @@ -170,6 +170,12 @@ VISU::ColoredPrs3d_i:: ColoredPrs3d_i(EPublishInStudyMode thePublishInStudyMode) : myPublishInStudyMode(thePublishInStudyMode), myIsTimeStampFixed(thePublishInStudyMode == EPublishUnderTimeStamp), + myEntity( VISU::Entity( -1 ) ), + myPreviousEntity( VISU::Entity( -1 ) ), + myTimeStampNumber( -1 ), + myPreviousTimeStampNumber( -1 ), + myIsUnits( true ), + myOrientation( VISU::ColoredPrs3dBase::HORIZONTAL ), myColoredPL(NULL), myIsFixedRange(false), myIsRestored(true) @@ -341,7 +347,7 @@ void VISU::ColoredPrs3d_i ::SetEntity(VISU::Entity theEntity) { - if(myEntity == theEntity) + if ( myEntity == theEntity ) return; VISU::TSetModified aModified(this); @@ -425,7 +431,7 @@ void VISU::ColoredPrs3d_i ::SetTimeStampNumber(CORBA::Long theTimeStampNumber) { - if(myTimeStampNumber == theTimeStampNumber) + if ( myTimeStampNumber == theTimeStampNumber ) return; VISU::TSetModified aModified(this); @@ -931,7 +937,7 @@ void VISU::ColoredPrs3d_i ::SetBarOrientation(VISU::ColoredPrs3dBase::Orientation theOrientation) { - if(myOrientation == theOrientation) + if ( myOrientation == theOrientation ) return; VISU::TSetModified aModified(this); @@ -1177,13 +1183,15 @@ VISU::ColoredPrs3d_i //---------------------------------------------------------------------------- void VISU::ColoredPrs3d_i -::SetUnitsVisible(CORBA::Boolean isVisible) +::SetUnitsVisible(CORBA::Boolean theIsVisible) { - if( myIsUnits != isVisible ){ - VISU::TSetModified aModified(this); - myIsUnits = isVisible; - myParamsTime.Modified(); - } + if ( myIsUnits == theIsVisible ) + return; + + VISU::TSetModified aModified( this ); + + myIsUnits = theIsVisible; + myParamsTime.Modified(); } //---------------------------------------------------------------------------- diff --git a/src/VISU_I/VISU_CutLines_i.cc b/src/VISU_I/VISU_CutLines_i.cc index 06f6f87a..118faa11 100644 --- a/src/VISU_I/VISU_CutLines_i.cc +++ b/src/VISU_I/VISU_CutLines_i.cc @@ -102,6 +102,7 @@ VISU::CutLines_i:: CutLines_i(EPublishInStudyMode thePublishInStudyMode) : ColoredPrs3d_i(thePublishInStudyMode), ScalarMap_i(thePublishInStudyMode), + myUseAbsLength( false ), myCutLinesPL(NULL) {} @@ -551,7 +552,7 @@ void VISU::CutLines_i ::SetUseAbsoluteLength(CORBA::Boolean theAbsLength) { - if(myUseAbsLength == theAbsLength) + if ( myUseAbsLength == theAbsLength ) return; VISU::TSetModified aModified(this); -- 2.39.2