// Save coordinates
Handle(TDataStd_RealArray) aCoordsArray =
TDataStd_RealArray::Set( myLab.FindChild( DataTag_AltitudePoints ), 0, thePoints.size() * 3 - 1 );
+ aCoordsArray->SetID(TDataStd_RealArray::GetID());
HYDROData_Bathymetry::AltitudePoints::const_iterator anIter = thePoints.begin(), aLast = thePoints.end();
for ( int i = 0 ; anIter!=aLast; ++i, ++anIter )
if (!aLabel.FindAttribute(TDataStd_RealArray::GetID(), aCoordsArray))
return 0;
- TDataStd_Integer::Set( myLab.FindChild( DataTag_Quadtree ), key );
+ Handle(TDataStd_Integer) anAttr = TDataStd_Integer::Set( myLab.FindChild( DataTag_Quadtree ), key );
+ anAttr->SetID(TDataStd_Integer::GetID());
DEBTRACE("GetQuadtreeNodes init " << this << " " << key);
HYDROData_QuadtreeNode* aQuadtree = new HYDROData_QuadtreeNode(0, 30, 5, 0.);
myQuadtrees[key] = aQuadtree;
if (!aLabel.FindAttribute(TDataStd_RealArray::GetID(), aCoordsArray))
return 0;
- TDataStd_Integer::Set( myLab.FindChild( DataTag_Delaunay ), key );
+ Handle(TDataStd_Integer) anAttr = TDataStd_Integer::Set( myLab.FindChild( DataTag_Delaunay ), key );
+ anAttr->SetID(TDataStd_Integer::GetID());
DEBTRACE("GetVtkDelaunay2D init " << this << " " << key);
vtkPoints *points = vtkPoints::New();
points->Allocate(aCoordsArray->Upper() +1);
void HYDROData_Bathymetry::SetFilePath( const TCollection_AsciiString& theFilePath )
{
- TDataStd_AsciiString::Set( myLab.FindChild( DataTag_FilePath ), theFilePath );
+ Handle(TDataStd_AsciiString) anAttr = TDataStd_AsciiString::Set( myLab.FindChild( DataTag_FilePath ), theFilePath );
+ anAttr->SetID(TDataStd_AsciiString::GetID());
}
void HYDROData_Bathymetry::SetFilePaths( const QStringList& theFilePaths )
{
int i = 1;
Handle_TDataStd_ExtStringArray TExtStrArr = TDataStd_ExtStringArray::Set( myLab.FindChild( DataTag_FilePaths ), 1, theFilePaths.size() );
+ TExtStrArr->SetID(TDataStd_ExtStringArray::GetID());
foreach (QString filepath, theFilePaths)
{
std::string sstr = filepath.toStdString();
if ( anIsAltitudesInverted == theIsInverted )
return;
- TDataStd_Integer::Set( myLab.FindChild( DataTag_AltitudesInverted ), (Standard_Integer)theIsInverted );
-
+ Handle(TDataStd_Integer) anAttr = TDataStd_Integer::Set( myLab.FindChild( DataTag_AltitudesInverted ), (Standard_Integer)theIsInverted );
+ anAttr->SetID(TDataStd_Integer::GetID());
Changed( Geom_Z );
if ( !theIsUpdate )
void HYDROData_CalculationCase::SetAssignmentMode( AssignmentMode theMode )
{
TDF_Label aModeLab = myLab.FindChild( DataTag_AssignmentMode );
- TDataStd_Integer::Set( aModeLab, ( int ) theMode );
-
+ Handle(TDataStd_Integer) anAttr = TDataStd_Integer::Set( aModeLab, ( int ) theMode );
+ anAttr->SetID(TDataStd_Integer::GetID());
// Indicate model of the need to update splitting
Changed( Geom_2d );
}
{
Handle(TDataStd_Real) anAttr;
if ( !aLabel.FindAttribute( TDataStd_Real::GetID(), anAttr ) )
- aLabel.AddAttribute( anAttr = new TDataStd_Real() );
+ {
+ anAttr = new TDataStd_Real();
+ aLabel.AddAttribute(anAttr);
+ anAttr->SetID(TDataStd_Real::GetID());
+ }
anAttr->Set( theCoeff );
}
}
{
Handle(TDataStd_Integer) anAttr;
if ( !aLabel.FindAttribute( TDataStd_Integer::GetID(), anAttr ) )
- aLabel.AddAttribute( anAttr = new TDataStd_Integer() );
+ {
+ anAttr = new TDataStd_Integer();
+ aLabel.AddAttribute(anAttr);
+ anAttr->SetID(TDataStd_Integer::GetID());
+ }
anAttr->Set( nbQuad );
}
}
{
Handle(TDataStd_Integer) anAttr;
if ( !aLabel.FindAttribute( TDataStd_Integer::GetID(), anAttr ) )
- aLabel.AddAttribute( anAttr = new TDataStd_Integer() );
+ {
+ anAttr = new TDataStd_Integer();
+ aLabel.AddAttribute(anAttr);
+ anAttr->SetID(TDataStd_Integer::GetID());
+ }
anAttr->Set( nbDelaunay );
}
}
Handle(TDataStd_Integer) anInt;
if (!anIDLab.FindAttribute(TDataStd_Integer::GetID(), anInt)) {
anInt = TDataStd_Integer::Set(anIDLab, 0);
+ anInt->SetID(TDataStd_Integer::GetID());
}
// just increment value and return
anInt->Set(anInt->Get() + 1);
TDF_Label aLocalCSLab = LabelOfLocalCS();
Handle( TDataXtd_Position ) aLocalCS;
if( !aLocalCSLab.FindAttribute( TDataXtd_Position::GetID(), aLocalCS ) )
+ {
aLocalCS = TDataXtd_Position::Set( aLocalCSLab );
+ aLocalCS->SetID(TDataXtd_Position::GetID());
+ }
gp_Pnt aLocalCS3d( theLX, theLY, 0 );
aLocalCS->SetPosition( aLocalCS3d );
void HYDROData_Entity::SetName(const QString& theName, bool isDefault)
{
- TDataStd_Name::Set(myLab, TCollection_ExtendedString(theName.toLatin1().constData()));
+ Handle(TDataStd_Name) A = TDataStd_Name::Set(myLab, TCollection_ExtendedString(theName.toLatin1().constData()));
+ A->SetID(TDataStd_Name::GetID());
if (isDefault)
+ {
+ TDF_Label aDefaultNameLabel = myLab.FindChild( DataTag_DefaultName, true );
+ if ( aDefaultNameLabel.IsNull() )
+ return;
+ Handle(TDataStd_AsciiString) theDefaultName;
+
+ if ( !aDefaultNameLabel.FindAttribute( TDataStd_AsciiString::GetID(), theDefaultName ))
{
- TDF_Label aDefaultNameLabel = myLab.FindChild( DataTag_DefaultName, true );
- if ( aDefaultNameLabel.IsNull() )
- return;
- Handle(TDataStd_AsciiString) theDefaultName;
-
- if ( !aDefaultNameLabel.FindAttribute( TDataStd_AsciiString::GetID(), theDefaultName ))
- {
- TCollection_AsciiString aName = theName.toStdString().c_str();
- theDefaultName = TDataStd_AsciiString::Set(myLab.FindChild( DataTag_DefaultName), aName );
- theDefaultName->SetID( TDataStd_AsciiString::GetID() );
- }
+ TCollection_AsciiString aName = theName.toStdString().c_str();
+ theDefaultName = TDataStd_AsciiString::Set(myLab.FindChild( DataTag_DefaultName), aName );
+ theDefaultName->SetID( TDataStd_AsciiString::GetID() );
}
+ }
}
QStringList HYDROData_Entity::DumpToPython( const QString& thePyScriptPath,
void HYDROData_Entity::ClearChanged()
{
- TDataStd_Integer::Set( myLab.FindChild( DataTag_GeomChange ), 0 );
+ Handle(TDataStd_Integer) A = TDataStd_Integer::Set( myLab.FindChild( DataTag_GeomChange ), 0 );
+ A->SetID(TDataStd_Integer::GetID());
}
int HYDROData_Entity::GetGeomChangeFlag() const
void HYDROData_Entity::SetZLevel( const Standard_Integer& theLevel )
{
- TDataStd_Integer::Set( myLab.FindChild( DataTag_ZLevel ), theLevel );
+ Handle(TDataStd_Integer) A = TDataStd_Integer::Set( myLab.FindChild( DataTag_ZLevel ), theLevel );
+ A->SetID(TDataStd_Integer::GetID());
}
void HYDROData_Entity::RemoveZLevel()
Handle(TDataStd_ReferenceList) aRefs = getReferenceList( theTag, true );
aRefs->Append( theObj->Label() );
+ aRefs->SetID(TDataStd_ReferenceList::GetID());
}
void HYDROData_Entity::SetReferenceObject( const Handle(HYDROData_Entity)& theObj,
Handle(TDataStd_IntegerArray) aColorArray;
if ( !aLabel.FindAttribute( TDataStd_IntegerArray::GetID(), aColorArray ) )
+ {
aColorArray = TDataStd_IntegerArray::Set( aLabel, 1, 4 );
+ aColorArray->SetID(TDataStd_IntegerArray::GetID());
+ }
aColorArray->SetValue( 1, theColor.red() );
aColorArray->SetValue( 2, theColor.green() );
{
TNaming_Builder aBuilder( myLab.FindChild( theTag ) );
aBuilder.Generated( theShape );
+ aBuilder.NamedShape()->SetID(TNaming_NamedShape::GetID());
}
TopoDS_Shape HYDROData_Entity::GetShape( int theTag ) const
return;
if ( !aSectLabel.FindAttribute( TDataStd_ExtStringList::GetID(), theNamesList ) && theIsCreate )
+ {
theNamesList = TDataStd_ExtStringList::Set( aSectLabel );
+ theNamesList->SetID(TDataStd_ExtStringList::GetID());
+ }
if ( !aSectLabel.FindAttribute( TDataStd_IntegerList::GetID(), theTypesList ) && theIsCreate )
+ {
theTypesList = TDataStd_IntegerList::Set( aSectLabel );
+ theTypesList->SetID(TDataStd_IntegerList::GetID());
+ }
if ( !aSectLabel.FindAttribute( TDataStd_BooleanList::GetID(), theClosuresList ) && theIsCreate )
+ {
theClosuresList = TDataStd_BooleanList::Set( aSectLabel );
+ theClosuresList->SetID(TDataStd_BooleanList::GetID());
+ }
}
void HYDROData_IPolyline::removeSectionsLists()
if ( !aLabelX.IsNull() )
{
if ( !aLabelX.FindAttribute( TDataStd_RealList::GetID(), theListX ) && theIsCreate )
+ {
theListX = TDataStd_RealList::Set( aLabelX );
+ theListX->SetID(TDataStd_RealList::GetID());
+ }
}
TDF_Label aLabelY = aSectLabel.FindChild( 1, theIsCreate );
if ( !aLabelY.IsNull() )
{
if ( !aLabelY.FindAttribute( TDataStd_RealList::GetID(), theListY ) && theIsCreate )
+ {
theListY = TDataStd_RealList::Set( aLabelY );
+ theListY->SetID(TDataStd_RealList::GetID());
+ }
}
}
Handle(TDataStd_IntegerArray) aParams;
if (!myLab.FindAttribute(TDataStd_IntegerArray::GetID(), aParams)) {
aParams = TDataStd_IntegerArray::Set(myLab, 1, 4);
+ aParams->SetID(TDataStd_IntegerArray::GetID());
}
aParams->SetValue(1, anImage.width());
aParams->SetValue(2, anImage.height());
void HYDROData_Image::SetFilePath( const QString& theFilePath )
{
TCollection_AsciiString anAsciiStr( theFilePath.toStdString().c_str() );
- TDataStd_AsciiString::Set( myLab.FindChild( DataTag_FilePath ), anAsciiStr );
-
+ Handle(TDataStd_AsciiString) anAttr = TDataStd_AsciiString::Set( myLab.FindChild( DataTag_FilePath ), anAsciiStr );
+ anAttr->SetID(TDataStd_AsciiString::GetID());
Changed( Geom_2d );
}
if (!myLab.FindAttribute(TDataStd_RealArray::GetID(), anArray)) {
if (theTrsf.isIdentity()) return; // no need to store identity transformation
anArray = TDataStd_RealArray::Set(myLab, 1, 9);
+ anArray->SetID(TDataStd_RealArray::GetID());
}
anArray->SetValue(1, theTrsf.m11());
anArray->SetValue(2, theTrsf.m12());
{
Handle(TDataStd_RealArray) anArray;
if ( !myLab.FindChild( DataTag_TrsfPoints ).FindAttribute( TDataStd_RealArray::GetID(), anArray ) )
+ {
anArray = TDataStd_RealArray::Set( myLab.FindChild( DataTag_TrsfPoints ), 1, 12 );
+ anArray->SetID(TDataStd_RealArray::GetID());
+ }
anArray->SetValue( 1, thePointA.x() );
anArray->SetValue( 2, thePointA.y() );
{
Handle(TDataStd_RealArray) anArray;
if ( !myLab.FindChild( DataTag_TrsfPoints ).FindAttribute( TDataStd_RealArray::GetID(), anArray ) )
+ {
anArray = TDataStd_RealArray::Set( myLab.FindChild( DataTag_TrsfPoints ), 1, 12 );
+ anArray->SetID(TDataStd_RealArray::GetID());
+ }
anArray->SetValue( 7, thePointA.x() );
anArray->SetValue( 8, thePointA.y() );
void HYDROData_Image::SetTrsfMode( const TransformationMode& theMode )
{
- TDataStd_Integer::Set( myLab.FindChild( DataTag_TrsfMode ), (int)theMode );
+ Handle(TDataStd_Integer) anAttr = TDataStd_Integer::Set( myLab.FindChild( DataTag_TrsfMode ), (int)theMode );
+ anAttr->SetID(TDataStd_Integer::GetID());
Changed( Geom_2d );
}
void HYDROData_Image::SetOperatorName( const QString theOpName )
{
TCollection_AsciiString anAsciiStr( theOpName.toStdString().c_str() );
- TDataStd_AsciiString::Set( myLab.FindChild( DataTag_Operator ), anAsciiStr );
+ Handle(TDataStd_AsciiString) anAttr = TDataStd_AsciiString::Set( myLab.FindChild( DataTag_Operator ), anAsciiStr );
+ anAttr->SetID(TDataStd_AsciiString::GetID());
Changed( Geom_2d );
}
Handle(TDataStd_NamedData) aNamedData;
theNewLabel.FindAttribute( TDataStd_NamedData::GetID(), aNamedData );
- aNamedData->SetInteger( "ObjectKind", theObjectKind );
+ aNamedData->SetInteger( "ObjectKind", theObjectKind ); //??CAF
return Object( theNewLabel );
}
void HYDROData_LandCover::SetStricklerType( const QString& theType )
{
TCollection_AsciiString anAsciiStr( theType.toStdString().c_str() );
- TDataStd_AsciiString::Set( myLab.FindChild( DataTag_StricklerType ), anAsciiStr );
+ Handle(TDataStd_AsciiString) anAttr = TDataStd_AsciiString::Set( myLab.FindChild( DataTag_StricklerType ), anAsciiStr );
+ anAttr->SetID(TDataStd_AsciiString::GetID());
+
}
QString HYDROData_LandCover::GetStricklerType() const
}
Handle( TDataStd_ExtStringArray ) aTypes = TDataStd_ExtStringArray::Set( myLab.FindChild( DataTag_Types ), 0, aSTypes.size() - 1, Standard_True );
+ aTypes->SetID(TDataStd_ExtStringArray::GetID());
int k = 0;
foreach (QString aST, aSTypes)
{
void HYDROData_Object::SetIsSubmersible( bool isSubmersible ) const
{
- TDataStd_Integer::Set( myLab, isSubmersible ? 1 : 0 );
+ Handle(TDataStd_Integer) anAttr = TDataStd_Integer::Set( myLab, isSubmersible ? 1 : 0 );
+ anAttr->SetID(TDataStd_Integer::GetID());
}
void HYDROData_Object::GetBoundaries( QList<TopoDS_Shape>& theBoundShapes,
void HYDROData_Obstacle::SetFilePath( const QString& theFilePath )
{
TCollection_AsciiString anAsciiStr( theFilePath.toStdString().c_str() );
- TDataStd_AsciiString::Set( myLab.FindChild( DataTag_FilePath ), anAsciiStr );
+ Handle(TDataStd_AsciiString) anAttr = TDataStd_AsciiString::Set( myLab.FindChild( DataTag_FilePath ), anAsciiStr );
+ anAttr->SetID(TDataStd_AsciiString::GetID());
}
QString HYDROData_Obstacle::GetFilePath() const
void HYDROData_Obstacle::SetGeomObjectEntry( const TCollection_AsciiString& theEntry )
{
- TDataStd_AsciiString::Set( myLab.FindChild( DataTag_GeomObjectEntry ), theEntry );
+ Handle(TDataStd_AsciiString) anAttr = TDataStd_AsciiString::Set( myLab.FindChild( DataTag_GeomObjectEntry ), theEntry );
+ anAttr->SetID(TDataStd_AsciiString::GetID());
}
TCollection_AsciiString HYDROData_Obstacle::GetGeomObjectEntry() const
}
Handle(TDataStd_RealArray) aCoeffsArray = TDataStd_RealArray::Set( aLabel, 1, 3 );
+ aCoeffsArray->SetID(TDataStd_RealArray::GetID());
aCoeffsArray->SetValue( 1, aCurDx );
aCoeffsArray->SetValue( 2, aCurDy );
aCoeffsArray->SetValue( 3, aCurDz );
void HYDROData_PolylineXY::SetGeomObjectEntry( const TCollection_AsciiString& theEntry )
{
- TDataStd_AsciiString::Set( myLab.FindChild( DataTag_GeomObjectEntry ), theEntry );
+ Handle(TDataStd_AsciiString) anAttr = TDataStd_AsciiString::Set( myLab.FindChild( DataTag_GeomObjectEntry ), theEntry );
+ anAttr->SetID(TDataStd_AsciiString::GetID());
}
TCollection_AsciiString HYDROData_PolylineXY::GetGeomObjectEntry() const
TDF_Label anObj1Lab = aNewRuleLab.FindChild( Object1_Tag );
Handle(TDataStd_ReferenceList) aRefs = TDataStd_ReferenceList::Set( anObj1Lab );
+ aRefs->SetID(TDataStd_ReferenceList::GetID());
aRefs->Append( theObject1->Label() );
TDF_Label aPriorityLab = aNewRuleLab.FindChild( Priority_Tag );
- TDataStd_Integer::Set( aPriorityLab, thePriority );
+ Handle(TDataStd_Integer) anPLAttr = TDataStd_Integer::Set( aPriorityLab, thePriority );
+ anPLAttr->SetID(TDataStd_Integer::GetID());
TDF_Label anObj2Lab = aNewRuleLab.FindChild( Object2_Tag );
aRefs = TDataStd_ReferenceList::Set( anObj2Lab );
+ aRefs->SetID(TDataStd_ReferenceList::GetID());
aRefs->Append( theObject2->Label() );
TDF_Label aMergeLab = aNewRuleLab.FindChild( Merge_Tag );
- TDataStd_Integer::Set( aMergeLab, theMergeType );
+ Handle(TDataStd_Integer) anMLAttr = TDataStd_Integer::Set( aMergeLab, theMergeType );
+ anMLAttr->SetID(TDataStd_Integer::GetID());
// Increment the last rule index
- TDataStd_Integer::Set( theRulesLabel, aRuleIndex + 1 );
+ Handle(TDataStd_Integer) anRLAttr = TDataStd_Integer::Set( theRulesLabel, aRuleIndex + 1 );
+ anRLAttr->SetID(TDataStd_Integer::GetID());
}
HYDROData_ListOfRules HYDROData_PriorityQueue::GetRules( const TDF_Label& theRulesLabel )
Handle(TDataStd_RealArray) anArray;
if ( !aLabel.FindAttribute( TDataStd_RealArray::GetID(), anArray ) )
+ {
anArray = TDataStd_RealArray::Set( aLabel, 0, 1 );
+ anArray->SetID(TDataStd_RealArray::GetID());
+ }
anArray->SetValue( 0, aLPoint.X() );
anArray->SetValue( 1, aLPoint.Y() );
Handle(TDataStd_RealArray) anArray;
if ( !aLabel.FindAttribute( TDataStd_RealArray::GetID(), anArray ) )
+ {
anArray = TDataStd_RealArray::Set( aLabel, 0, 1 );
+ anArray->SetID(TDataStd_RealArray::GetID());
+ }
anArray->SetValue( 0, aLPoint.X() );
anArray->SetValue( 1, aLPoint.Y() );
void HYDROData_Profile::SetFilePath( const TCollection_AsciiString& theFilePath )
{
- TDataStd_AsciiString::Set( myLab.FindChild( DataTag_FilePath ), theFilePath );
+ Handle(TDataStd_AsciiString) anAttr = TDataStd_AsciiString::Set( myLab.FindChild( DataTag_FilePath ), theFilePath );
+ anAttr->SetID(TDataStd_AsciiString::GetID());
}
TCollection_AsciiString HYDROData_Profile::GetFilePath() const
int n = theArray.size();
Handle(TDataStd_RealArray) aParamsArray =
TDataStd_RealArray::Set( aLabel, 1, n );
+ aParamsArray->SetID(TDataStd_RealArray::GetID());
for ( int i = 0; i < n; ++i )
{
const Standard_Real& aParam = theArray[i];
return false;
}
- TDataStd_AsciiString::Set( myLab.FindChild( DataTag_AttrName ), HYDROData_Tool::toExtString( theAttrName ) );
+ Handle(TDataStd_AsciiString) anAttr = TDataStd_AsciiString::Set( myLab.FindChild( DataTag_AttrName ), HYDROData_Tool::toExtString( theAttrName ) );
+ anAttr->SetID(TDataStd_AsciiString::GetID());
return true;
}
TCollection_AsciiString aString;
Handle(TDataStd_AsciiString) aState;
if( !myLab.FindAttribute( TDataStd_AsciiString::GetID(), aState ) )
+ {
aState = TDataStd_AsciiString::Set( myLab, aString );
+ aState->SetID(TDataStd_AsciiString::GetID());
+ }
aString.AssignCat( theState.c_str() );
aState->Set( aString );
}
void HYDROData_Zone::SetMergeType( const MergeType& theType )
{
- TDataStd_Integer::Set( myLab.FindChild( DataTag_MergeType ), (int)theType );
+ Handle(TDataStd_Integer) anAttr = TDataStd_Integer::Set( myLab.FindChild( DataTag_MergeType ), (int)theType );
+ anAttr->SetID(TDataStd_Integer::GetID());
}
HYDROData_Zone::MergeType HYDROData_Zone::GetMergeType() const