mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0028714: Dimension of TDataStd_Real is not serialized to document
Added a comments and Standard_DEPRECATED macros to obsolete methods that these methods will be removed and that the corresponding field myDimension is not stored in the document.
This commit is contained in:
@@ -204,7 +204,9 @@ void TDataStd_Real::Restore(const Handle(TDF_Attribute)& With)
|
||||
{
|
||||
Handle(TDataStd_Real) R = Handle(TDataStd_Real)::DownCast (With);
|
||||
myValue = R->Get();
|
||||
Standard_DISABLE_DEPRECATION_WARNINGS
|
||||
myDimension = R->GetDimension();
|
||||
Standard_ENABLE_DEPRECATION_WARNINGS
|
||||
myID = R->ID();
|
||||
}
|
||||
|
||||
@@ -220,7 +222,9 @@ void TDataStd_Real::Paste (const Handle(TDF_Attribute)& Into,
|
||||
{
|
||||
Handle(TDataStd_Real) R = Handle(TDataStd_Real)::DownCast (Into);
|
||||
R->Set(myValue);
|
||||
Standard_DISABLE_DEPRECATION_WARNINGS
|
||||
R->SetDimension(myDimension);
|
||||
Standard_ENABLE_DEPRECATION_WARNINGS
|
||||
R->SetID(myID);
|
||||
}
|
||||
|
||||
@@ -232,7 +236,9 @@ void TDataStd_Real::Paste (const Handle(TDF_Attribute)& Into,
|
||||
Standard_OStream& TDataStd_Real::Dump (Standard_OStream& anOS) const
|
||||
{
|
||||
anOS << "Real ";
|
||||
TDataStd::Print(GetDimension(),anOS);
|
||||
Standard_DISABLE_DEPRECATION_WARNINGS
|
||||
TDataStd::Print(GetDimension(), anOS);
|
||||
Standard_ENABLE_DEPRECATION_WARNINGS
|
||||
anOS << myValue;
|
||||
Standard_Character sguid[Standard_GUID_SIZE_ALLOC];
|
||||
myID.ToCString(sguid);
|
||||
|
@@ -63,8 +63,14 @@ public:
|
||||
|
||||
Standard_EXPORT TDataStd_Real();
|
||||
|
||||
//! Obsolete method that will be removed in next versions.
|
||||
//! This field is not supported in the persistence mechanism.
|
||||
Standard_DEPRECATED("TDataStd_Real::SetDimension() is deprecated. Please avoid usage of this method.")
|
||||
Standard_EXPORT void SetDimension (const TDataStd_RealEnum DIM);
|
||||
|
||||
//! Obsolete method that will be removed in next versions.
|
||||
//! This field is not supported in the persistence mechanism.
|
||||
Standard_DEPRECATED("TDataStd_Real::GetDimension() is deprecated. Please avoid usage of this method.")
|
||||
Standard_EXPORT TDataStd_RealEnum GetDimension() const;
|
||||
|
||||
|
||||
@@ -107,6 +113,7 @@ private:
|
||||
|
||||
|
||||
Standard_Real myValue;
|
||||
//! An obsolete field that will be removed in next versions.
|
||||
TDataStd_RealEnum myDimension;
|
||||
Standard_GUID myID;
|
||||
|
||||
|
@@ -114,6 +114,18 @@ Handle(TDataStd_Real) TDataStd_Variable::Real() const
|
||||
return R;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Set
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void TDataStd_Variable::Set (const Standard_Real value) const
|
||||
{
|
||||
Handle(TDataStd_Real) R = TDataStd_Real::Set(Label(), value);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Set
|
||||
//purpose :
|
||||
@@ -123,7 +135,9 @@ void TDataStd_Variable::Set (const Standard_Real value, const TDataStd_RealEnum
|
||||
{
|
||||
if (!IsValued()) {
|
||||
Handle(TDataStd_Real) R = TDataStd_Real::Set(Label(),value);
|
||||
Standard_DISABLE_DEPRECATION_WARNINGS
|
||||
R->SetDimension (dimension);
|
||||
Standard_ENABLE_DEPRECATION_WARNINGS
|
||||
}
|
||||
else {
|
||||
Handle(TDataStd_Real) R = TDataStd_Real::Set(Label(),value);
|
||||
|
@@ -76,12 +76,16 @@ public:
|
||||
//! returns string stored in the associated Name
|
||||
//! attribute.
|
||||
Standard_EXPORT const TCollection_ExtendedString& Name() const;
|
||||
|
||||
|
||||
//! retrieve or create the associated real attribute and
|
||||
//! set the value <value>. if creation, dimension is
|
||||
//! written.
|
||||
Standard_EXPORT void Set (const Standard_Real value, const TDataStd_RealEnum dimension = TDataStd_SCALAR) const;
|
||||
//! set the value <value>.
|
||||
Standard_EXPORT void Set (const Standard_Real value) const;
|
||||
|
||||
//! Obsolete method that will be removed in next versions.
|
||||
//! The dimension argument is not supported in the persistence mechanism.
|
||||
Standard_DEPRECATED("TDataStd_Variable::Set(value, dimension) is deprecated. Please use TDataStd_Variable::Set(value) instead.")
|
||||
Standard_EXPORT void Set (const Standard_Real value, const TDataStd_RealEnum dimension) const;
|
||||
|
||||
//! returns True if a Real attribute is associated.
|
||||
Standard_EXPORT Standard_Boolean IsValued() const;
|
||||
|
||||
|
Reference in New Issue
Block a user