-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2019 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
// 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.
+// 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
class SalomeApp_Study;
+class GEOMGUI_DimensionProperty;
+typedef QSharedPointer<GEOMGUI_DimensionProperty> DimensionPropertyPtr;
+
/*!
* \brief Utility class to unpack/pack dimension presentations as object property of study.
*
Diameter* AsDiameter() { return static_cast<Diameter*>( this ); }
Angle* AsAngle() { return static_cast<Angle*>( this ); }
+ virtual void ToValues(std::vector<double>& theValues) const = 0;
+ virtual void FromValues(int& theIt, const std::vector<double>& theValues) = 0;
+
private:
DimensionType myType;
};
/*!
* \brief Inits property fields from the passed length object.
* \param theIO [in] the interactive presentation.
- * \param theLCS [in] the local coordiante system of parent object.
+ * \param theLCS [in] the local coordinate system of parent object.
*/
void Init( const Handle(AIS_LengthDimension)& theIO, const gp_Ax3& theLCS );
/*!
* \brief Updates length object properties from the fields.
* \param theIO [in/out] the interactive presentation.
- * \param theLCS [in] the local coordiante system of parent object.
+ * \param theLCS [in] the local coordinate system of parent object.
*/
void Update( Handle(AIS_LengthDimension)& theIO, const gp_Ax3& theLCS );
/*!
- * \brief Overload comparsion.
+ * \brief Packs properties to array of doubles.
+ * \param theValues [out] the values vector to populate.
+ */
+ void ToValues(std::vector<double>& theValues) const;
+
+ /*!
+ * \brief Unpacks properties from array of doubles.
+ * \param theIt [in/out] the array index iterator.
+ * \param theValues [in] the vector of values.
+ */
+ void FromValues(int& theIt, const std::vector<double>& theValues);
+
+ /*!
+ * \brief Overload comparison.
*/
bool operator == (const Length &theOther) const;
bool operator != (const Length &theOther) const { return !(operator == (theOther)); }
/*!
* \brief Inits property fields from the passed length object.
* \param theIO [in] the interactive presentation.
- * \param theLCS [in] the local coordiante system of parent object.
+ * \param theLCS [in] the local coordinate system of parent object.
*/
void Init( const Handle(AIS_DiameterDimension)& theIO, const gp_Ax3& theLCS );
/*!
* \brief Updates length object properties from the fields.
* \param theIO [in/out] the interactive presentation.
- * \param theLCS [in] the local coordiante system of parent object.
+ * \param theLCS [in] the local coordinate system of parent object.
*/
void Update( Handle(AIS_DiameterDimension)& theIO, const gp_Ax3& theLCS );
/*!
- * \brief Overload comparsion.
+ * \brief Packs properties to array of doubles.
+ * \param theValues [out] the values vector to populate.
+ */
+ void ToValues(std::vector<double>& theValues) const;
+
+ /*!
+ * \brief Unpacks properties from array of doubles.
+ * \param theIt [in/out] the array index iterator.
+ * \param theValues [in] the vector of values.
+ */
+ void FromValues(int& theIt, const std::vector<double>& theValues);
+
+ /*!
+ * \brief Overload comparison.
*/
bool operator == (const Diameter &theOther) const;
bool operator != (const Diameter &theOther) const { return !(operator == (theOther)); }
/*!
* \brief Inits property fields from the passed length object.
* \param theIO [in] the interactive presentation.
- * \param theLCS [in] the local coordiante system of parent object.
+ * \param theLCS [in] the local coordinate system of parent object.
*/
void Init( const Handle(AIS_AngleDimension)& theIO, const gp_Ax3& theLCS );
/*!
* \brief Updates length object properties from the fields.
* \param theIO [in/out] the interactive presentation.
- * \param theLCS [in] the local coordiante system of parent object.
+ * \param theLCS [in] the local coordinate system of parent object.
*/
void Update( Handle(AIS_AngleDimension)& theIO, const gp_Ax3& theLCS );
/*!
- * \brief Overload comparsion.
+ * \brief Packs properties to array of doubles.
+ * \param theValues [out] the values vector to populate.
+ */
+ void ToValues(std::vector<double>& theValues) const;
+
+ /*!
+ * \brief Unpacks properties from array of doubles.
+ * \param theIt [in/out] the array index iterator.
+ * \param theValues [in] the vector of values.
+ */
+ void FromValues(int& theIt, const std::vector<double>& theValues);
+
+ /*!
+ * \brief Overload comparison.
*/
bool operator == (const Angle &theOther) const;
bool operator != (const Angle &theOther) const { return !(operator == (theOther)); }
/*!
* \brief Constructor. Inits property from attribute.
*/
- GEOMGUI_DimensionProperty( SalomeApp_Study* theStudy, const std::string& theEntry );
+ GEOMGUI_DimensionProperty( const std::string& theEntry );
+
+ /*!
+ * \brief Constructor. Inits property from formatted QString.
+ */
+ GEOMGUI_DimensionProperty( const QString& theProperty );
/*!
* \brief Destructor.
/*!
* \brief Overload QVariant cast operator.
*/
- operator QVariant();
+ operator QVariant() const;
+
+ /*!
+ * \brief Overload QString cast operator.
+ */
+ operator QString() const;
/*!
- * \brief Overload comparsion.
+ * \brief Overload comparison.
*/
bool operator == (const GEOMGUI_DimensionProperty &theOther) const;
/*!
- * \brief Overload comparsion.
+ * \brief Overload comparison.
*/
bool operator != (const GEOMGUI_DimensionProperty &theOther) const
{
/*!
* \brief Loads properties data from attribute "AttributeTableOfReal".
- * \param theStudy [in] the study.
* \param theEntry [in] the entry of GEOM object to operate with.
*/
- void LoadFromAttribute( SalomeApp_Study* theStudy, const std::string& theEntry );
+ void LoadFromAttribute( const std::string& theEntry );
/*!
* \brief Saves properties data to attribute "AttributeTableOfReal".
- * \param theStudy [in] the study.
* \param theEntry [in] the entry of GEOM object to operate with.
*/
- void SaveToAttribute( SalomeApp_Study* theStudy, const std::string& theEntry );
+ void SaveToAttribute( const std::string& theEntry );
private: