2 #include "HYDROData_IPolyline.h"
6 #include <TDataStd_RealList.hxx>
8 IMPLEMENT_STANDARD_HANDLE(HYDROData_IPolyline, HYDROData_Entity)
9 IMPLEMENT_STANDARD_RTTIEXT(HYDROData_IPolyline, HYDROData_Entity)
11 HYDROData_IPolyline::HYDROData_IPolyline()
16 HYDROData_IPolyline::~HYDROData_IPolyline()
20 int HYDROData_IPolyline::NbPoints( const int theSectionIndex ) const
22 return GetPoints( theSectionIndex ).Length();
25 void HYDROData_IPolyline::getPointsLists( const int theSectionIndex,
26 Handle(TDataStd_RealList)& theListX,
27 Handle(TDataStd_RealList)& theListY,
28 const bool theIsCreate ) const
33 TDF_Label aLabel = myLab.FindChild( DataTag_Points, theIsCreate );
34 if ( aLabel.IsNull() )
37 TDF_Label aSectLabel = aLabel.FindChild( theSectionIndex, theIsCreate );
38 if ( aSectLabel.IsNull() )
41 TDF_Label aLabelX = aSectLabel.FindChild( 0, theIsCreate );
42 if ( !aLabelX.IsNull() )
44 if ( !aLabelX.FindAttribute( TDataStd_RealList::GetID(), theListX ) && theIsCreate )
45 theListX = TDataStd_RealList::Set( aLabelX );
48 TDF_Label aLabelY = aSectLabel.FindChild( 1, theIsCreate );
49 if ( !aLabelY.IsNull() )
51 if ( !aLabelY.FindAttribute( TDataStd_RealList::GetID(), theListY ) && theIsCreate )
52 theListY = TDataStd_RealList::Set( aLabelY );
56 void HYDROData_IPolyline::removePointsLists( const int theSectionIndex ) const
58 TDF_Label aLabel = myLab.FindChild( DataTag_Points, false );
59 if ( aLabel.IsNull() )
62 TDF_Label aSectLabel = aLabel.FindChild( theSectionIndex, false );
63 if ( !aSectLabel.IsNull() )
64 aSectLabel.ForgetAllAttributes();