mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +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:
parent
fa6fc587b9
commit
58e5d30edc
@ -68,10 +68,12 @@ void DDataStd::DumpConstraint (const Handle(TDataXtd_Constraint)& CTR, Standard_
|
|||||||
anOS << " V (";
|
anOS << " V (";
|
||||||
TDF_Tool::Entry(CTR->GetValue()->Label(),S);
|
TDF_Tool::Entry(CTR->GetValue()->Label(),S);
|
||||||
anOS << S << ") ";
|
anOS << S << ") ";
|
||||||
TDataStd_RealEnum t = CTR->GetValue()->GetDimension();
|
Standard_DISABLE_DEPRECATION_WARNINGS
|
||||||
|
TDataStd_RealEnum t = CTR->GetValue()->GetDimension();
|
||||||
TDataStd::Print(t,anOS);
|
TDataStd::Print(t,anOS);
|
||||||
Standard_Real val = CTR->GetValue()->Get();
|
Standard_Real val = CTR->GetValue()->Get();
|
||||||
if (t == TDataStd_ANGULAR) val = (180.*val)/M_PI;
|
if (t == TDataStd_ANGULAR) val = (180.*val)/M_PI;
|
||||||
|
Standard_ENABLE_DEPRECATION_WARNINGS
|
||||||
anOS << " ";
|
anOS << " ";
|
||||||
anOS << val;
|
anOS << val;
|
||||||
}
|
}
|
||||||
|
@ -339,7 +339,9 @@ Handle(Draw_Drawable3D) DDataStd_DrawDriver::DrawableConstraint (const Handle(TD
|
|||||||
if (!D.IsNull()) {
|
if (!D.IsNull()) {
|
||||||
if (!A->GetValue().IsNull()) {
|
if (!A->GetValue().IsNull()) {
|
||||||
Standard_Real val = A->GetValue()->Get();
|
Standard_Real val = A->GetValue()->Get();
|
||||||
if (A->GetValue()->GetDimension() == TDataStd_ANGULAR) val = (180.*val)/M_PI;
|
Standard_DISABLE_DEPRECATION_WARNINGS
|
||||||
|
if (A->GetValue()->GetDimension() == TDataStd_ANGULAR) val = (180. * val) / M_PI;
|
||||||
|
Standard_ENABLE_DEPRECATION_WARNINGS
|
||||||
D->SetValue(val);
|
D->SetValue(val);
|
||||||
}
|
}
|
||||||
// unverified constraints are red (default is white)
|
// unverified constraints are red (default is white)
|
||||||
|
@ -37,9 +37,11 @@ public:
|
|||||||
//! Import transient attribuite from the persistent data.
|
//! Import transient attribuite from the persistent data.
|
||||||
void Import (const Handle(TDataStd_Real)& theAttribute) const
|
void Import (const Handle(TDataStd_Real)& theAttribute) const
|
||||||
{
|
{
|
||||||
theAttribute->Set (myValue);
|
theAttribute->Set (myValue);
|
||||||
|
Standard_DISABLE_DEPRECATION_WARNINGS
|
||||||
theAttribute->SetDimension (static_cast<TDataStd_RealEnum> (myDimension));
|
theAttribute->SetDimension (static_cast<TDataStd_RealEnum> (myDimension));
|
||||||
theAttribute->SetID(TDataStd_Real::GetID());
|
Standard_ENABLE_DEPRECATION_WARNINGS
|
||||||
|
theAttribute->SetID (TDataStd_Real::GetID());
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -204,7 +204,9 @@ void TDataStd_Real::Restore(const Handle(TDF_Attribute)& With)
|
|||||||
{
|
{
|
||||||
Handle(TDataStd_Real) R = Handle(TDataStd_Real)::DownCast (With);
|
Handle(TDataStd_Real) R = Handle(TDataStd_Real)::DownCast (With);
|
||||||
myValue = R->Get();
|
myValue = R->Get();
|
||||||
|
Standard_DISABLE_DEPRECATION_WARNINGS
|
||||||
myDimension = R->GetDimension();
|
myDimension = R->GetDimension();
|
||||||
|
Standard_ENABLE_DEPRECATION_WARNINGS
|
||||||
myID = R->ID();
|
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);
|
Handle(TDataStd_Real) R = Handle(TDataStd_Real)::DownCast (Into);
|
||||||
R->Set(myValue);
|
R->Set(myValue);
|
||||||
|
Standard_DISABLE_DEPRECATION_WARNINGS
|
||||||
R->SetDimension(myDimension);
|
R->SetDimension(myDimension);
|
||||||
|
Standard_ENABLE_DEPRECATION_WARNINGS
|
||||||
R->SetID(myID);
|
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
|
Standard_OStream& TDataStd_Real::Dump (Standard_OStream& anOS) const
|
||||||
{
|
{
|
||||||
anOS << "Real ";
|
anOS << "Real ";
|
||||||
TDataStd::Print(GetDimension(),anOS);
|
Standard_DISABLE_DEPRECATION_WARNINGS
|
||||||
|
TDataStd::Print(GetDimension(), anOS);
|
||||||
|
Standard_ENABLE_DEPRECATION_WARNINGS
|
||||||
anOS << myValue;
|
anOS << myValue;
|
||||||
Standard_Character sguid[Standard_GUID_SIZE_ALLOC];
|
Standard_Character sguid[Standard_GUID_SIZE_ALLOC];
|
||||||
myID.ToCString(sguid);
|
myID.ToCString(sguid);
|
||||||
|
@ -63,8 +63,14 @@ public:
|
|||||||
|
|
||||||
Standard_EXPORT TDataStd_Real();
|
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);
|
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;
|
Standard_EXPORT TDataStd_RealEnum GetDimension() const;
|
||||||
|
|
||||||
|
|
||||||
@ -107,6 +113,7 @@ private:
|
|||||||
|
|
||||||
|
|
||||||
Standard_Real myValue;
|
Standard_Real myValue;
|
||||||
|
//! An obsolete field that will be removed in next versions.
|
||||||
TDataStd_RealEnum myDimension;
|
TDataStd_RealEnum myDimension;
|
||||||
Standard_GUID myID;
|
Standard_GUID myID;
|
||||||
|
|
||||||
|
@ -114,6 +114,18 @@ Handle(TDataStd_Real) TDataStd_Variable::Real() const
|
|||||||
return R;
|
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
|
//function : Set
|
||||||
//purpose :
|
//purpose :
|
||||||
@ -123,7 +135,9 @@ void TDataStd_Variable::Set (const Standard_Real value, const TDataStd_RealEnum
|
|||||||
{
|
{
|
||||||
if (!IsValued()) {
|
if (!IsValued()) {
|
||||||
Handle(TDataStd_Real) R = TDataStd_Real::Set(Label(),value);
|
Handle(TDataStd_Real) R = TDataStd_Real::Set(Label(),value);
|
||||||
|
Standard_DISABLE_DEPRECATION_WARNINGS
|
||||||
R->SetDimension (dimension);
|
R->SetDimension (dimension);
|
||||||
|
Standard_ENABLE_DEPRECATION_WARNINGS
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Handle(TDataStd_Real) R = TDataStd_Real::Set(Label(),value);
|
Handle(TDataStd_Real) R = TDataStd_Real::Set(Label(),value);
|
||||||
|
@ -76,12 +76,16 @@ public:
|
|||||||
//! returns string stored in the associated Name
|
//! returns string stored in the associated Name
|
||||||
//! attribute.
|
//! attribute.
|
||||||
Standard_EXPORT const TCollection_ExtendedString& Name() const;
|
Standard_EXPORT const TCollection_ExtendedString& Name() const;
|
||||||
|
|
||||||
//! retrieve or create the associated real attribute and
|
//! retrieve or create the associated real attribute and
|
||||||
//! set the value <value>. if creation, dimension is
|
//! set the value <value>.
|
||||||
//! written.
|
Standard_EXPORT void Set (const Standard_Real value) const;
|
||||||
Standard_EXPORT void Set (const Standard_Real value, const TDataStd_RealEnum dimension = TDataStd_SCALAR) 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.
|
//! returns True if a Real attribute is associated.
|
||||||
Standard_EXPORT Standard_Boolean IsValued() const;
|
Standard_EXPORT Standard_Boolean IsValued() const;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user