From 0dac688e40d37aa25c144d0d55f7feab357faeb6 Mon Sep 17 00:00:00 2001 From: rkv Date: Mon, 13 Jan 2014 11:04:32 +0000 Subject: [PATCH] SIP: HYDROData_PolylineXY is completed except one method. --- CMake/UsePyQt4EXT.cmake | 8 +++- src/HYDROPy/HYDROData_PolylineXY.sip | 60 ++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 1 deletion(-) diff --git a/CMake/UsePyQt4EXT.cmake b/CMake/UsePyQt4EXT.cmake index 1b5c1ab0..7472ff58 100644 --- a/CMake/UsePyQt4EXT.cmake +++ b/CMake/UsePyQt4EXT.cmake @@ -150,7 +150,13 @@ MACRO(PYQT4_WRAP_SIP_EXT outfiles) LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyTCollection_AsciiString.cc) SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyTCollection_AsciiString.cc) - + +# LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyNCollection_Sequence0100HYDROData_IPolylineSectionType.cc) +# SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyNCollection_Sequence0100HYDROData_IPolylineSectionType.cc) + +# LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyNCollection_Sequence0100TCollection_AsciiString.cc) +# SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyNCollection_Sequence0100TCollection_AsciiString.cc) + ADD_CUSTOM_COMMAND( OUTPUT ${_output} COMMAND ${SIP_EXECUTABLE} ${PYQT_SIPFLAGS} ${CMAKE_CURRENT_SOURCE_DIR}/${_input} diff --git a/src/HYDROPy/HYDROData_PolylineXY.sip b/src/HYDROPy/HYDROData_PolylineXY.sip index 37dadf7c..082269e8 100644 --- a/src/HYDROPy/HYDROData_PolylineXY.sip +++ b/src/HYDROPy/HYDROData_PolylineXY.sip @@ -46,6 +46,66 @@ class HYDROData_PolylineXY : HYDROData_IPolyline public: + /** + * Returns default wire color for new polyline. + */ + static QColor DefaultWireColor(); + + /** + * Returns the presentation of polyline section in Qt maner. + */ + static void BuildPainterPath( QPainterPath& thePath, + const SectionType& theType, + const bool& theIsClosed, + const NCollection_Sequence& thePoints ); + + /** + * Returns flag indicating that polyline can be edited or not. + */ + virtual bool IsEditable() const; + + + /** + * Returns true if polyline is closed + * \param theIsSimpleCheck flag indicating the type of checking + * - if true then all wires checked on closures + * - if false then for positive result polyline should consist of + * only one wire and which must be closed + */ + bool IsClosed( const bool theIsSimpleCheck = true ) const; + + /** + * Returns the distance beetwen first and point with index thePointIndex + * at the section with index theSectionIndex. -1 is returned if error is occurred. + */ + double GetDistance( const int theSectionIndex, + const int thePointIndex ) const; + + /** + * Adds new one section. + * \param theSectName name of the section + * \param theSectionType type of section + * \param theIsClosed flag indicates closures of section + */ +/*TODO: void GetSections( NCollection_Sequence& theSectNames, + NCollection_Sequence& theSectTypes, + NCollection_Sequence& theSectClosures /Constrained/) const; +*/ + /** + * Replaces point for section with index "theSectionIndex". + * \param theSectionIndex index of section + * \param thePoints new points + */ + void SetPoints( const int theSectionIndex, + const PointsList& thePoints ); + + /** + * Returns the painter path. + * Note: currently only the first section of the polyline data is taken into account. + * \return polyline painter path. + */ + virtual QPainterPath GetPainterPath() const; + protected: /** -- 2.39.2