bool HYDROData_PolylineOperator::Merge( const Handle( HYDROData_Document )& theDoc,
const TCollection_AsciiString& theName,
- const HYDROData_SequenceOfObjects& thePolylines )
+ const HYDROData_SequenceOfObjects& thePolylines,
+ bool isConnectByNewSegment )
{
//TODO
+
+ TopoDS_Shape aMergedPolyline;
+
+ Handle( HYDROData_PolylineXY ) aPolyline =
+ Handle( HYDROData_PolylineXY )::DownCast( theDoc->CreateObject( KIND_POLYLINEXY ) );
+ if( aPolyline.IsNull() )
+ return false;
+
+ aPolyline->SetShape( aMergedPolyline );
+ //TODO: set name
+
return true;
}
const HYDROData_SequenceOfObjects& thePolylines );
bool Merge( const Handle( HYDROData_Document )& theDoc,
const TCollection_AsciiString& theName,
- const HYDROData_SequenceOfObjects& thePolylines );
+ const HYDROData_SequenceOfObjects& thePolylines,
+ bool isConnectByNewSegment );
protected:
static std::vector<Handle( Geom2d_Curve )> GetCurves( const Handle( HYDROData_PolylineXY )& thePolyline );
#include <QLabel>
#include <QGridLayout>
#include <QLineEdit>
+#include <QCheckBox>
HYDROGUI_MergePolylinesDlg::HYDROGUI_MergePolylinesDlg( HYDROGUI_Module* theModule, const QString& theTitle )
: HYDROGUI_InputPanel( theModule, theTitle )
aLayout->addWidget( new QLabel( tr( "RESULT_NAME" ) ), 0, 0 );
aLayout->addWidget( myName, 0, 1 );
+ myIsConnect = new QCheckBox( tr( "IS_CONNECT" ), mainFrame() );
+ aLayout->addWidget( myIsConnect, 1, 0, 1, 2 );
+
myList = new HYDROGUI_ObjListBox( theModule, tr( "POLYLINES" ), KIND_POLYLINEXY, mainFrame() );
- aLayout->addWidget( myList, 1, 0, 1, 2 );
+ aLayout->addWidget( myList, 2, 0, 1, 2 );
}
HYDROGUI_MergePolylinesDlg::~HYDROGUI_MergePolylinesDlg()
{
return myName->text();
}
+
+bool HYDROGUI_MergePolylinesDlg::IsConnectByNewSegment() const
+{
+ return myIsConnect->isChecked();
+}
#include <HYDROData_Entity.h>
class QLineEdit;
+class QCheckBox;
class HYDROGUI_ObjListBox;
class HYDROGUI_MergePolylinesDlg : public HYDROGUI_InputPanel
void setSelectedPolylines( const HYDROData_SequenceOfObjects& );
void setPolylinesFromSelection();
+ bool IsConnectByNewSegment() const;
+
private:
QLineEdit* myName;
+ QCheckBox* myIsConnect;
HYDROGUI_ObjListBox* myList;
};
return false;
QString aName = aPanel->GetResultName();
+ bool isConnectByNewSegment = aPanel->IsConnectByNewSegment();
HYDROData_SequenceOfObjects aPolylinesList = aPanel->selectedPolylines();
HYDROData_PolylineOperator anOp;
- anOp.Merge( doc(), aName.toLatin1().data(), aPolylinesList );
+ anOp.Merge( doc(), aName.toLatin1().data(), aPolylinesList, isConnectByNewSegment );
theUpdateFlags = UF_Model | UF_OCCViewer | UF_OCC_Forced | UF_VTKViewer;
return true;
<source>RESULT_NAME</source>
<translation>Result name:</translation>
</message>
+ <message>
+ <source>IS_CONNECT</source>
+ <translation>Connect by a new segment</translation>
+ </message>
</context>
-
<context>
<name>HYDROGUI_MergePolylinesOp</name>
<message>