Skip to content

Commit

Permalink
surface edition now available in sbgatgui
Browse files Browse the repository at this point in the history
  • Loading branch information
bbercovici committed Feb 10, 2019
1 parent 800fc9c commit 0e115a1
Show file tree
Hide file tree
Showing 12 changed files with 730 additions and 229 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,13 @@ to apply the update (if any).

### [SBGAT 2.02.2](https://github.com/bbercovici/SBGAT/releases/tag/2.02.2)

### New
- Shape models can now be modified from within SBGATGui, by selecting a vertex and applying a Gaussian interpolation of the vertex displacement to a neighborhood of arbitrary choice.

### Improvements
- Camera is now positioned at the correct distance from the targeted shape body upon loading
- Improved visual aspect of selected facet
- Improved visual aspect of loaded shapes

### Bug fixes:
- Fixed bug in SBGATGui that prevented proper alignment of the shape model with its principal axes
Expand Down
2 changes: 2 additions & 0 deletions SbgatGui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,10 @@ add_executable(${EXE_NAME}
source/SurfacePGMWindow.cpp
source/SelectMapperWindow.cpp
source/PickInteractorStyle.cpp
source/VertexEditionWindow.cpp
include/RenderingPropertiesWindow.hpp
include/PickInteractorStyle.hpp
include/VertexEditionWindow.hpp
include/Mainwindow.hpp
include/ModelDataWrapper.hpp
include/SettingsWindow.hpp
Expand Down
113 changes: 0 additions & 113 deletions SbgatGui/include/InteractorStyle.hpp

This file was deleted.

9 changes: 9 additions & 0 deletions SbgatGui/include/Mainwindow.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,13 @@ through the user interface layer brought by Qt.}

// Slots
private slots:


/**
When triggered, opens a non-modal window allowing the edition of the selected entities
(facets or points)
*/
void edit_selection();

/**
When triggered, switches the interactor style to facet selection
Expand Down Expand Up @@ -522,6 +529,8 @@ through the user interface layer brought by Qt.}

QPushButton * select_facets_button;
QPushButton * select_points_button;
QPushButton * edit_selection_button;


DataMap wrapped_shape_data;

Expand Down
38 changes: 38 additions & 0 deletions SbgatGui/include/PickInteractorStyle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,49 @@ namespace SBGAT_GUI {

PickInteractorStyle();
void SetMainwindow(Mainwindow * mainwindow);

/**
Returns the number of plotted entities in the current selection. Does not necessarily return 1 if one
facet is selected, since the facet actor is constituted by a number of edges/points
*/
int GetSelectionSize() const;

void Clear();

virtual void OnLeftButtonDown();

/**
Returns world coordinates of query point
*/
void GetQueriedPoint(double * query);

/**
Get coordinates of normal at queried point
*/
void GetNormalAtSelectedPoint(double * normal) const;

/**
Get coordinates of normal at specified point
*/
void GetNormalAtPoint(vtkIdType id, double * normal) const;

/**
Returns selected actor
*/
vtkSmartPointer<vtkActor> GetSelectedActor(){return this -> selectedActor;}

/**
Returns index of query point
*/
vtkIdType GetQueriedPointId() const {return this -> selected_point_id;}


double GetSelectedBodySize() const{return this -> object_size;}


vtkSmartPointer<vtkPolyData> Data = nullptr;
double object_size;
vtkIdType selected_point_id;
vtkSmartPointer<vtkDataSetMapper> selectedMapper;
vtkSmartPointer<vtkActor> selectedActor;
Mainwindow * mainwindow;
Expand Down
13 changes: 0 additions & 13 deletions SbgatGui/include/RenderingPropertiesWindow.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ namespace SBGAT_GUI {
*/
RenderingPropertiesWindow(Mainwindow * parent) ;


public slots:
/**
Triggered after a prop has been removed from the main window. Ensures that a
Expand All @@ -71,11 +70,6 @@ namespace SBGAT_GUI {
private slots:

void change_focus();
// void add_light();
// void remove_light();
// void enable_mutual_shadows(int state);




protected:
Expand All @@ -84,13 +78,6 @@ namespace SBGAT_GUI {
void init();
QComboBox * prop_combo_box;

// QComboBox * current_light_combo_box;
// QPushButton * remove_light_button;
// QComboBox * new_light_combo_box ;

// void make_light_box_consistent();





Expand Down
93 changes: 93 additions & 0 deletions SbgatGui/include/VertexEditionWindow.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
/** MIT License
Copyright (c) 2018 Benjamin Bercovici and Jay McMahon
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/


#ifndef HEADER_VertexEditionWindow
#define HEADER_VertexEditionWindow

#include <QMainWindow>
#include <QComboBox>
#include <QVTKOpenGLWidget.h>
#include <QDialog.h>
#include <QSlider>
#include <vtkActor.h>
#include <vtkDataSetMapper.h>
#include <QSpinBox.h>

#include "Mainwindow.hpp"

namespace SBGAT_GUI {

class Mainwindow;

/*!
@class VertexEditionWindow
\author Benjamin Bercovici
\date February 2019
\brief VertexEditionWindow
\details A window where the user can move the selected vertex or vertex neighborhood
*/

class VertexEditionWindow : public QDialog {
Q_OBJECT

public:

/**
Creates the window
@param parent pointer to parent window.
*/
VertexEditionWindow(Mainwindow * parent) ;

private slots:
void move_vertex();
void update_direction(int index);
void close();
void accept();
void update_neighborhood_size(int neighborhood_size);
void update_neighbors_positions();


protected:

vtkSmartPointer<vtkActor> line_actor;
vtkSmartPointer<vtkDataSetMapper> line_mapper;
std::vector< vtkSmartPointer<vtkActor> > neighbors_actors_vector;
std::vector< double > neighbors_distances_vector;


std::vector< vtkIdType > neighbors_indices_vector;

QSlider * position_slider;
QComboBox * direction_combo_box;
QSpinBox * neighborhood_spin_box;
Mainwindow * parent;
double dir[3];
double queried_point[3];
void init();



};
}
#endif
Loading

0 comments on commit 0e115a1

Please sign in to comment.