64 std::vector<std::string> params;
65 params.push_back(
name);
67 params.push_back(
mesh);
87 object_model(object_model),
89 rotation_type(rotation_type),
90 orientation_x(orientation_x),
91 orientation_y(orientation_y),
92 orientation_z(orientation_z),
103 wxMessageDialog *dial =
new wxMessageDialog(
this,
104 wxT(
"Are you sure to quit?"), wxT(
"Quit"),
105 wxYES_NO | wxNO_DEFAULT | wxICON_QUESTION);
106 if (dial->ShowModal() == wxID_YES) {
115 if (descModelsDialog ->ShowModal() == wxID_SAVE) {
118 views.push_back(params);
119 for (
unsigned int i = 0; i <
views.size(); i++) {
120 std::string
name = this->name +
"_view_" + boost::lexical_cast<std::string>(i + 1);
140 for (
unsigned int i = 0; i <
views.size(); i++) {
141 std::string
name = this->name +
"_view_" + boost::lexical_cast<std::string>(i + 1);
153 descModelsDialog ->ShowModal();
161 wxMessageDialog *dial =
new wxMessageDialog(
this,
162 wxT(
"Are you sure to quit?"), wxT(
"Quit"),
163 wxYES_NO | wxNO_DEFAULT | wxICON_QUESTION);
164 if (dial->ShowModal() == wxID_YES) {
174 bool boxes_available =
true;
175 for (
unsigned int i = 0; i <
views.size(); i++) {
176 if (!(
views.at(i).getHasBoundingBox())) {
177 boxes_available =
false;
181 if (boxes_available) {
182 wxMessageDialog *dial =
new wxMessageDialog(
this,
183 wxT(
"Do you want to create the object with the selected values? This can take several minutes depending on your parameters!"), wxT(
"Finish"),
184 wxYES_NO | wxNO_DEFAULT | wxICON_QUESTION);
185 if (dial->ShowModal() == wxID_YES) {
187 if (createOutputFilesDialog->ShowModal() == wxID_OK) {
188 wxMessageDialog *dial =
new wxMessageDialog(
this,
189 wxT(
"All files successfully created!"), wxT(
"Success"), wxOK);
193 wxMessageDialog *dial =
new wxMessageDialog(
this,
194 wxT(
"Not all files could be created, please check the logfile in the output folder for more information. End the program anyway?"), wxT(
"Warning"),
195 wxYES_NO | wxNO_DEFAULT | wxICON_ERROR);
196 if (dial->ShowModal() == wxID_YES) {
202 wxMessageDialog *dial =
new wxMessageDialog(
this,
203 wxT(
"Please create a bounding box for all views (Select them by clicking on the image panel; clockwise, starting with the top left corner)"), wxT(
"Warning"), wxOK | wxICON_WARNING);
207 wxMessageDialog *dial =
new wxMessageDialog(
this,
208 wxT(
"Please create at least one view!"), wxT(
"Warning"), wxOK | wxICON_WARNING);
217 wxMessageDialog *dial =
new wxMessageDialog(
this,
218 wxT(
"Your created views will be lost if you go back, continue anyway?"), wxT(
"Warning"),
219 wxYES_NO | wxNO_DEFAULT | wxICON_WARNING);
220 if (dial->ShowModal() != wxID_YES) {
313 int pos_x =
event.GetX();
314 int pos_y =
event.GetY();
316 if ((pos_x > 0 && pos_x < 300) && (pos_y > 0 && pos_y < 225) && (
list_box_views->GetSelection() >= 0)) {
320 double pos_x_factor = pos_x / 300.0f;
321 double pos_y_factor = pos_y / 225.0f;
322 pos_x = (double)
views.at(
list_box_views->GetSelection()).getImage().Width() * pos_x_factor;
323 pos_y = (double)
views.at(
list_box_views->GetSelection()).getImage().Height() * pos_y_factor;
339 int pos_x =
event.GetX();
340 int pos_y =
event.GetY();
342 if ((pos_x > 0 && pos_x < 300) && (pos_y > 0 && pos_y < 225) && (
list_box_views->GetSelection() >= 0)) {
wxStaticText * label_invertible_value
wxStaticText * label_axis_1_x_value
void resetGuiValues()
Resets all the shown values to default.
std::vector< ViewParamsWrapper > views
std::string orientation_y
wxStaticText * label_max_scale_value
wxStaticText * label_horizontal_offset_value
void onAddModelClicked(wxCommandEvent &event)
void OnDialogClose(wxCloseEvent &event)
wxListBox * list_box_views
wxString trimDoubleString(wxString input)
Formats the given string by removing fractional zeros at the end of it.
void onFinishClicked(wxCommandEvent &event)
std::string orientation_z
void onEditModelClicked(wxCommandEvent &event)
HalconCpp::HImage drawBoundingBox(HalconCpp::HImage image, std::vector< Eigen::Vector2i > corner_points)
Draws a bounding box on the given image with the also given corner-points.
std::string rotation_type
wxStaticText * label_min_scale_value
wxButton * button_edit_model
wxStaticText * label_axis_2_y_value
void onDeleteModelClicked(wxCommandEvent &event)
wxStaticText * label_vertical_offset_value
wxStaticText * label_axis_1_angle_value
void onListBoxSelected(wxCommandEvent &event)
wxStaticText * label_axis_2_angle_value
wxStaticText * label_use_color_value
const std::string ROTATIONTYPE_SPHERE
wxStaticText * label_axis_1_y_value
const std::string ROTATIONTYPE_NO_ROTATION
wxStaticText * label_score_2D_value
wxStaticText * label_axis_2_z_value
std::vector< ViewParamsWrapper > getViews()
Returns the list of created 2D-views.
wxStaticText * label_axis_1_z_value
void onBackClicked(wxCommandEvent &event)
void onImageClickedRight(wxMouseEvent &event)
wxStaticText * label_orientation_x_value
void setImage(wxBitmap *image)
wxBitmap * createBitmap(const sensor_msgs::Image::ConstPtr &msg, int width, int height)
Converts a ros-image-message to a bitmap-file used by wxwidgets.
wxStaticText * label_orientation_z_value
wxStaticText * label_number_ferns_value
wxStaticText * label_depth_value
std::vector< std::string > getObjectParameters()
Returns the list of object parameters.
wxStaticText * label_patch_size_value
wxStaticText * label_orientation_y_value
void onCancelClicked(wxCommandEvent &event)
std::string orientation_x
wxStaticText * label_axis_2_x_value
void onImageClicked(wxMouseEvent &event)
DescModelsDialog(wxWindow *parent, std::string name, std::string object_model, std::string mesh, std::string rotation_type, std::string orientation_x, std::string orientation_y, std::string orientation_z, std::string diameter, std::string score_3D)
The constructor of this class.