sipClass = sipClass_HYDROData_Image;
break;
+ case KIND_POLYLINE:
+ sipClass = sipClass_HYDROData_Polyline;
+ break;
+
case KIND_BATHYMETRY:
sipClass = sipClass_HYDROData_Bathymetry;
break;
}
%End
-public:
- /**
- * Visual state data.
- */
- struct VisualState
- {
- bool Visibility;
- double Transparency;
- double ZValue;
-
- VisualState();
- };
-
- typedef QMap < int, HYDROData_Object::VisualState > ViewId2VisualStateMap;
- typedef QMapIterator< int, HYDROData_Object::VisualState > ViewId2VisualStateMapIterator;
-
public:
/**
*/
void SetName(const QString& theName);
- /**
- * Returns the object visibility state for the view with specified id.
- * \param theViewId view id
- * \returns visibility state
- */
- bool IsVisible( const int theViewId ) const;
-
- /**
- * Sets the object visibility state for the view with specified id.
- * \param theViewId view id
- * \param theVal visibility state
- */
- void SetVisible( const int theViewId,
- const bool theVal );
-
/**
* Checks is object exists in the data structure.
* \returns true is object is not exists in the data model
--- /dev/null
+// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// 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.
+//
+// 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
+//
+
+%ExportedHeaderCode
+#include <HYDROData_Polyline.h>
+%End
+
+struct PolylineSection
+{
+%TypeHeaderCode
+#include <HYDROData_Polyline.h>
+%End
+
+ enum SectionType{ SECTION_POLYLINE = 0, SECTION_SPLINE = 1 };
+
+ PolylineSection();
+
+ SectionType myType;
+ bool myIsClosed;
+ QList<double> myCoords;
+
+ QString mySectionName
+ {
+ %GetCode
+ sipPy = PyString_FromString( TCollection_AsciiString( sipCpp->mySectionName ).ToCString() );
+ %End
+
+ %SetCode
+ char* ptr;
+
+ if ( ( ptr = PyString_AsString( sipPy ) ) == NULL )
+ {
+ sipErr = 1;
+ }
+ else
+ {
+ sipCpp->mySectionName = TCollection_ExtendedString( ptr );
+ }
+ %End
+ };
+};
+
+class HYDROData_Polyline : HYDROData_Object
+{
+
+%ConvertToSubClassCode
+ if ( !Handle(HYDROData_Polyline)::DownCast( sipCpp ).IsNull() )
+ sipClass = sipClass_HYDROData_Polyline;
+ else
+ sipClass = NULL;
+%End
+
+public:
+
+ const ObjectKind GetKind() const;
+
+public:
+
+ /**
+ * Replace current polyline data by new sections list
+ * \param theSections the sections list
+ */
+ void setPolylineData( const QList<PolylineSection>& theSections );
+
+ /**
+ * Return polyline data
+ * \return polyline section list
+ */
+ QList<PolylineSection> getPolylineData();
+
+ /**
+ * Return polyline dimension
+ * \return polyline dimension (2 or 3)
+ */
+ int getDimension() const;
+
+ /**
+ * Set polyline dimension (2 or 3)
+ * \param theDimension the polyline dimension
+ */
+ void setDimension( int theDimension );
+
+ /**
+ * Remove all sections from polyline
+ */
+ void removeAll();
+
+
+ /**
+ * Returns the painter path. The painter path is construct by lines
+ */
+ QPainterPath painterPath();
+
+protected:
+
+ /**
+ * Creates new object in the internal data structure. Use higher level objects
+ * to create objects with real content.
+ */
+ HYDROData_Polyline();
+
+ /**
+ * Destructs properties of the object and object itself, removes it from the document.
+ */
+ ~HYDROData_Polyline();
+};
+
+