X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROData%2FHYDROData_IPolyline.cxx;h=adc76d3b87fe47b3b677c041adabcca52240be77;hb=545854182f0363f61284d5abe34c3627d4f3b088;hp=687318cc064b4d81262b0323f33b98339e7c65e6;hpb=d84fadb6fba0d9ef3926995eab878175cc24e291;p=modules%2Fhydro.git diff --git a/src/HYDROData/HYDROData_IPolyline.cxx b/src/HYDROData/HYDROData_IPolyline.cxx index 687318cc..adc76d3b 100755 --- a/src/HYDROData/HYDROData_IPolyline.cxx +++ b/src/HYDROData/HYDROData_IPolyline.cxx @@ -1,3 +1,20 @@ +// Copyright (C) 2014-2015 EDF-R&D +// 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, 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 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// #include "HYDROData_IPolyline.h" @@ -7,17 +24,14 @@ #include #include #include - #include - -#include -#include +#include IMPLEMENT_STANDARD_HANDLE(HYDROData_IPolyline, HYDROData_Entity) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_IPolyline, HYDROData_Entity) HYDROData_IPolyline::HYDROData_IPolyline() -: HYDROData_Entity() +: HYDROData_Entity( Geom_2d ) { } @@ -25,34 +39,39 @@ HYDROData_IPolyline::~HYDROData_IPolyline() { } +void HYDROData_IPolyline::SetWireColor( const QColor& theColor ) +{ + SetColor( theColor, DataTag_WireColor ); +} + +QColor HYDROData_IPolyline::GetWireColor() const +{ + return GetColor( DefaultWireColor(), DataTag_WireColor ); +} + +QColor HYDROData_IPolyline::DefaultWireColor() +{ + return QColor( Qt::black ); +} + int HYDROData_IPolyline::NbPoints( const int theSectionIndex ) const { return GetPoints( theSectionIndex ).Length(); } -TopoDS_Shape HYDROData_IPolyline::getPolylineShape() const +TopoDS_Shape HYDROData_IPolyline::GetShape() const { - TDF_Label aShapeLabel = myLab.FindChild( DataTag_PolylineShape, false ); - if ( !aShapeLabel.IsNull() ) - { - Handle(TNaming_NamedShape) aNamedShape; - if ( aShapeLabel.FindAttribute( TNaming_NamedShape::GetID(), aNamedShape ) ) - return aNamedShape->Get(); - } - return TopoDS_Shape(); + return HYDROData_Entity::GetShape( DataTag_PolylineShape ); } -void HYDROData_IPolyline::setPolylineShape( const TopoDS_Shape& theShape ) +void HYDROData_IPolyline::SetShape( const TopoDS_Shape& theShape ) { - TNaming_Builder aBuilder( myLab.FindChild( DataTag_PolylineShape ) ); - aBuilder.Generated( theShape ); + HYDROData_Entity::SetShape( DataTag_PolylineShape, theShape ); } -void HYDROData_IPolyline::removePolylineShape() +void HYDROData_IPolyline::RemovePolylineShape() { - TDF_Label aShapeLabel = myLab.FindChild( DataTag_PolylineShape, false ); - if ( !aShapeLabel.IsNull() ) - aShapeLabel.ForgetAllAttributes(); + SetShape( TopoDS_Shape() ); } void HYDROData_IPolyline::getSectionsLists( Handle(TDataStd_ExtStringList)& theNamesList,