20 #ifndef CURVECREATOR_WIDGET_H
21 #define CURVECREATOR_WIDGET_H
27 #include <SUIT_ViewWindow.h>
28 #include <OCCViewer_ViewWindow.h>
30 #include <AIS_InteractiveObject.hxx>
31 #include <AIS_InteractiveContext.hxx>
32 #include <AIS_ListOfInteractive.hxx>
33 #include <Geom_Curve.hxx>
34 #include <V3d_View.hxx>
44 class OCCViewer_Viewer;
45 class OCCViewer_ViewPort3d;
57 DisableDetectionMode = 0x00000001,
58 DisableNewSection = 0x00000002,
59 DisableClosedSection = 0x00000004
72 const int theActionFlags = NoFlags,
73 const QStringList& theCoordTitles = QStringList(),
75 int theLocalPointRowLimit = 20);
78 void setOCCViewer( OCCViewer_Viewer* theViewer );
80 Handle(AIS_InteractiveContext) getAISContext();
81 OCCViewer_ViewPort3d* getViewPort();
82 int changeInteractionStyle(
int theStyle );
87 QList<
int> getSelectedSections();
88 void setSelectedSections( const QList<
int>& theSections );
90 void removeSelected();
93 void setActionMode( const ActionMode& theMode );
94 ActionMode getActionMode() const;
96 void SetViewer2DMode(const
bool To2D);
99 void selectionChanged();
100 void subOperationStarted(
QWidget*,
bool );
101 void subOperationFinished( QWidget* );
106 void onAdditionMode(
bool checked);
107 void onModificationMode(
bool checked);
108 void onDetectionMode(
bool checked);
109 void onModeChanged(
bool checked);
111 void onSelectionChanged();
112 void onAddNewSection();
113 void onEditSection(
int theSection );
114 void onModifySection();
115 void onCancelSection();
117 void onBringTogether();
122 void onSetPolyline();
123 void onCloseSections();
124 void onUncloseSections();
127 void onUndoSettings();
128 void onContextMenu(QPoint thePoint);
130 void onMousePress( SUIT_ViewWindow*, QMouseEvent* theEvent );
131 void onMouseRelease( SUIT_ViewWindow*, QMouseEvent* theEvent );
132 void onMouseMove( SUIT_ViewWindow*, QMouseEvent* theEvent );
133 void onLastViewClosed( SUIT_ViewManager* theManager );
135 void onMousePress( QMouseEvent* theEvent );
136 void onMouseRelease( QMouseEvent* theEvent );
137 void onMouseMove( QMouseEvent* theEvent );
139 void onCellChanged(
int theRow,
int theColumn );
142 void addCoordsByClick( QMouseEvent* );
166 OCCViewer_Viewer* getOCCViewer();
168 QAction* createAction( ActionId theId,
const QString& theName,
const QPixmap& theImage,
169 const QString& theToolTip,
const QKeySequence& theShortcut );
170 QAction* getAction(ActionId theId);
171 QAction* getAction(ActionMode theMode);
173 void updateActionsStates();
174 void updateUndoRedo();
176 void removeSection();
179 void insertPointToSelectedSegment(
const int theXPosition,
180 const int theYPosition );
181 void moveSelectedPoints(
const int theXPosition,
const int theYPosition );
182 void updateLocalPointView();
183 void setLocalPointContext(
const bool theOpen,
const bool isUpdateTable =
false );
185 void setDragStarted(
const bool theState,
const QPoint& thePoint = QPoint() );
191 void stopActionMode();
194 const bool theFillPoints =
true );
199 int findLocalPointIndex(
int theSectionId,
double theX,
double theY );
200 void findSectionsToPoints(
const double theX,
const double theY,
203 QMap<
int, QList<int> >& theConvPoints );
234 #endif // CURVECREATOR_WIDGET_H