X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FDDS%2FDDS_DicItem.cxx;h=b1f2f5a95f5833670ba1a4b8efbb9f568e50b75c;hb=e6caa123c65e3c4a3017364ec5bb4225fd898465;hp=6a8954546c2fe97cab83b5d3d50996816d0b6968;hpb=1c889394b028b786898a995d38c07c8f3d564837;p=modules%2Fgui.git diff --git a/src/DDS/DDS_DicItem.cxx b/src/DDS/DDS_DicItem.cxx index 6a8954546..b1f2f5a95 100644 --- a/src/DDS/DDS_DicItem.cxx +++ b/src/DDS/DDS_DicItem.cxx @@ -1,24 +1,25 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// 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) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // -// 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 -// version 2.1 of the License. +// 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 +// version 2.1 of the License, or (at your option) any later version. // -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + #include "DDS_DicItem.h" #include "DDS_Dictionary.h" @@ -199,7 +200,7 @@ Standard_Real DDS_DicItem::GetMinValue() const /*! \brief Get the minimum value of the parameter for the specified units system \a theSystem. - + Returned value is converted to SI. \param theUnitsSystem units system @@ -774,9 +775,9 @@ void DDS_DicItem::FillDataMap( TCollection_AsciiString theID, const LDOM_Element { // Read the text in the element "value" //LDOM_Text aListItemTxt = (const LDOM_Text&)aListItemValue.getFirstChild(); - LDOM_Node aNode = aListItemValue.getFirstChild(); - const LDOM_Text& aText = (const LDOM_Text&) aNode; - LDOM_Text aListItemTxt(aText); + LDOM_Node aNode = aListItemValue.getFirstChild(); + const LDOM_Text& aText = (const LDOM_Text&) aNode; + LDOM_Text aListItemTxt(aText); if ( !aListItemTxt.isNull() ) { // adding ID and text value to sequence @@ -855,12 +856,12 @@ void DDS_DicItem::FillDataMap( TCollection_AsciiString theID, const LDOM_Element LDOMString v = attr.getValue(); if( v.Type()==LDOMBasicString::LDOM_Integer ) { - Standard_Integer ival; - v.GetInteger( ival ); - value = TCollection_ExtendedString( ival ); + Standard_Integer ival; + v.GetInteger( ival ); + value = TCollection_ExtendedString( ival ); } else - value = ( Standard_CString )v.GetString(); + value = ( Standard_CString )v.GetString(); } else continue; @@ -894,7 +895,7 @@ void DDS_DicItem::FillDataMap( TCollection_AsciiString theID, const LDOM_Element else if ( anUnitData.myUnits.ToCString()[0] ) // treat '%' as unit with scale 100 anUnitData.myScale = 0.01; } - catch( Standard_Failure ) { + catch( Standard_Failure ) { anUnitData.myUnits.Clear(); } @@ -1290,3 +1291,188 @@ DDS_DicItem::UnitSystem DDS_DicItem::GetActiveUnitSystem() const aSystem = aComponent->GetActiveUnitSystem(); return aSystem; } + +/*! + \brief Set item's identify string. + \param theId identify string. +*/ +void DDS_DicItem::SetId( const TCollection_AsciiString& theId ) +{ + myId = theId; +} + +/*! + \brief Set item's component pointer. + \param theComponent component pointer. +*/ +void DDS_DicItem::SetComponent( const Handle(Standard_Transient)& theComponent ) +{ + myComponent = theComponent; +} + +/*! + \brief Set item's label string. + \param theLabel label string. +*/ +void DDS_DicItem::SetLabel( const TCollection_AsciiString& theLabel ) +{ + myLabel = theLabel; +} + +/*! + \brief Set item's filter string. + \param theFilter filter string. +*/ +void DDS_DicItem::SetFilter( const TCollection_AsciiString& theFilter ) +{ + myFilter = theFilter; +} + +/*! + \brief Set item's required value. + \param theRequired required value string. +*/ +void DDS_DicItem::SetRequired( const TCollection_AsciiString& theRequired ) +{ + myRequired = theRequired; +} + +/*! + \brief Set item's warning level value. + \param theWarningLevel warning level value. +*/ +void DDS_DicItem::SetWarningLevel( const Standard_Integer& theWarningLevel ) +{ + myWarnLevel = theWarningLevel; +} + +/*! + \brief Set item's minimum zoom value. + \param theMinZoom minimum zoom value. +*/ +void DDS_DicItem::SetMinZoom( const Standard_Real& theMinZoom ) +{ + myMinZoom = theMinZoom; +} + +/*! + \brief Set item's maximum zoom value. + \param theMaxZoom maximum zoom value. +*/ +void DDS_DicItem::SetMaxZoom( const Standard_Real& theMaxZoom ) +{ + myMaxZoom = theMaxZoom; +} + +/*! + \brief Set item's zoom order value. + \param theZoomOrder zoom order value. +*/ +void DDS_DicItem::SetZoomOrder( const Standard_Real& theZoomOrder ) +{ + myZoomOrder = theZoomOrder; +} + +/*! + \brief Set item's short description. + \param theShortDescr short description string. +*/ +void DDS_DicItem::SetShortDescription( const TCollection_ExtendedString& theShortDescr ) +{ + myShortDescr = theShortDescr; +} + +/*! + \brief Set item's long description. + \param theLongDescr long description string. +*/ +void DDS_DicItem::SetLongDescription( const TCollection_ExtendedString& theLongDescr ) +{ + myLongDescr = theLongDescr; +} + +/*! + \brief Add item's option. + \param theOptionName option name string. + \param theOptionValue option value string. +*/ +bool DDS_DicItem::SetOption( const TCollection_AsciiString& theOptionName, + const TCollection_AsciiString& theOptionValue ) +{ + return myOptions.Bind( theOptionName, theOptionValue ); +} + +/*! + \brief Set item's type value. + \param theType item value type. +*/ +void DDS_DicItem::SetType( const DDS_DicItem::Type& theType ) +{ + myType = theType; +} + +/*! + \brief Set item's minimum value. + \param theMinVal minimum possible value. +*/ +void DDS_DicItem::SetMin( const Standard_Real& theMinVal ) +{ + myData |= MinValue; + myMin = theMinVal; +} + +/*! + \brief Set item's maximum value. + \param theMaxVal maximum possible value. +*/ +void DDS_DicItem::SetMax( const Standard_Real& theMaxVal ) +{ + myData |= MaxValue; + myMax = theMaxVal; +} + +/*! + \brief Set item's default value as a real number. + \param theDefVal default value. +*/ +void DDS_DicItem::SetDefaultValue( const Standard_Real& theDefVal ) +{ + myData |= DefaultValue; + myDefValue = theDefVal; +} + +/*! + \brief Set item's default value as a string. + \param theDefStr default value. +*/ +void DDS_DicItem::SetDefaultValue( const TCollection_AsciiString& theDefStr ) +{ + myDefString = theDefStr; +} + +/*! + \brief Set item's value list. + \param theStrings list of value strings. + \param theIntegers list of integer values associated with string item. +*/ +void DDS_DicItem::SetListOfValues( const Handle(TColStd_HArray1OfExtendedString)& theStrings, + const Handle(TColStd_HArray1OfInteger)& theIntegers ) +{ + myListRef = theStrings; + myListRefID = theIntegers; +} + +/*! + \brief Set item's value list and icons. + \param theStrings list of value strings. + \param theIntegers list of integer values associated with string item. + \param theIcons list of icons associated with string item. +*/ +void DDS_DicItem::SetListOfValues( const Handle(TColStd_HArray1OfExtendedString)& theStrings, + const Handle(TColStd_HArray1OfInteger)& theIntegers, + const Handle(TColStd_HArray1OfExtendedString)& theIcons ) +{ + myListRef = theStrings; + myListRefID = theIntegers; + myListRefIcons = theIcons; +}