Gui: Apply clang-format on DlgProjectionOnSurface and fix linter warnings

This commit is contained in:
wmayer
2024-03-23 14:00:59 +01:00
committed by wwmayer
parent 2f04fce75e
commit 05dc17a61a
2 changed files with 996 additions and 942 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -36,22 +36,24 @@
#include <Mod/Part/App/PartFeature.h>
namespace PartGui {
namespace PartGui
{
class Ui_DlgProjectionOnSurface;
class Ui_DlgProjectionOnSurface;
namespace Ui {
class DlgProjectionOnSurface;
}
namespace Ui
{
class DlgProjectionOnSurface;
}
class DlgProjectionOnSurface : public QWidget,
public Gui::SelectionObserver,
public App::DocumentObserver
class DlgProjectionOnSurface: public QWidget,
public Gui::SelectionObserver,
public App::DocumentObserver
{
Q_OBJECT
public:
explicit DlgProjectionOnSurface(QWidget *parent = nullptr);
explicit DlgProjectionOnSurface(QWidget* parent = nullptr);
~DlgProjectionOnSurface() override;
void apply();
@@ -74,57 +76,64 @@ private:
void onDoubleSpinBoxSolidDepthValueChanged(double arg1);
private:
struct SShapeStore
{
TopoDS_Shape inputShape;
TopoDS_Face surfaceToProject;
gp_Dir aProjectionDir;
TopoDS_Face aFace;
TopoDS_Edge aEdge;
std::vector<TopoDS_Wire> aWireVec;
std::vector<TopoDS_Wire> aProjectedWireVec;
std::vector<TopoDS_Edge> aProjectedEdgeVec;
std::vector<TopoDS_Wire> aProjectedWireInParametricSpaceVec;
TopoDS_Face aProjectedFace;
TopoDS_Shape aProjectedSolid;
Part::Feature* partFeature = nullptr;
std::string partName;
bool is_selectable = false;
long transparency = 0;
double extrudeValue = 0.0;
};
struct SShapeStore
{
TopoDS_Shape inputShape;
TopoDS_Face surfaceToProject;
gp_Dir aProjectionDir;
TopoDS_Face aFace;
TopoDS_Edge aEdge;
std::vector<TopoDS_Wire> aWireVec;
std::vector<TopoDS_Wire> aProjectedWireVec;
std::vector<TopoDS_Edge> aProjectedEdgeVec;
std::vector<TopoDS_Wire> aProjectedWireInParametricSpaceVec;
TopoDS_Face aProjectedFace;
TopoDS_Shape aProjectedSolid;
Part::Feature* partFeature = nullptr;
std::string partName;
bool is_selectable = false;
long transparency = 0;
float extrudeValue = 0.0f;
};
//from Gui::SelectionObserver
void onSelectionChanged(const Gui::SelectionChanges& msg) override;
// from Gui::SelectionObserver
void onSelectionChanged(const Gui::SelectionChanges& msg) override;
void get_camera_direction();
void store_current_selected_parts(std::vector<SShapeStore>& iStoreVec, const unsigned int iColor);
bool store_part_in_vector(SShapeStore& iCurrentShape, std::vector<SShapeStore>& iStoreVec);
void create_projection_wire(std::vector<SShapeStore>& iCurrentShape);
TopoDS_Shape create_compound(const std::vector<SShapeStore>& iShapeVec);
void show_projected_shapes(const std::vector<SShapeStore>& iShapeStoreVec);
void disable_ui_elements(const std::vector<QWidget*>& iObjectVec, QWidget* iExceptThis);
void enable_ui_elements(const std::vector<QWidget*>& iObjectVec, QWidget* iExceptThis);
void higlight_object(Part::Feature* iCurrentObject, const std::string& iShapeName, bool iHighlight, const unsigned int iColor);
void get_all_wire_from_face(SShapeStore& ioCurrentSahpe);
void create_projection_face_from_wire(std::vector<SShapeStore>& iCurrentShape);
TopoDS_Wire sort_and_heal_wire(const TopoDS_Shape& iShape, const TopoDS_Face& iFaceToProject);
TopoDS_Wire sort_and_heal_wire(const std::vector<TopoDS_Edge>& iEdgeVec, const TopoDS_Face& iFaceToProject);
void create_face_extrude(std::vector<SShapeStore>& iCurrentShape);
void store_wire_in_vector(const SShapeStore& iCurrentShape, const TopoDS_Shape& iParentShape, std::vector<SShapeStore>& iStoreVec, const unsigned int iColor);
void set_xyz_dir_spinbox(QDoubleSpinBox* icurrentSpinBox);
void transform_shape_to_global_position(TopoDS_Shape& ioShape, Part::Feature* iPart);
void get_camera_direction();
void store_current_selected_parts(std::vector<SShapeStore>& iStoreVec,
unsigned int iColor);
bool store_part_in_vector(SShapeStore& iCurrentShape, std::vector<SShapeStore>& iStoreVec);
void create_projection_wire(std::vector<SShapeStore>& iCurrentShape);
TopoDS_Shape create_compound(const std::vector<SShapeStore>& iShapeVec);
void show_projected_shapes(const std::vector<SShapeStore>& iShapeStoreVec);
void disable_ui_elements(const std::vector<QWidget*>& iObjectVec, QWidget* iExceptThis);
void enable_ui_elements(const std::vector<QWidget*>& iObjectVec, QWidget* iExceptThis);
void higlight_object(Part::Feature* iCurrentObject,
const std::string& iShapeName,
bool iHighlight,
unsigned int iColor);
void get_all_wire_from_face(SShapeStore& ioCurrentSahpe);
void create_projection_face_from_wire(std::vector<SShapeStore>& iCurrentShape);
TopoDS_Wire sort_and_heal_wire(const TopoDS_Shape& iShape, const TopoDS_Face& iFaceToProject);
TopoDS_Wire sort_and_heal_wire(const std::vector<TopoDS_Edge>& iEdgeVec,
const TopoDS_Face& iFaceToProject);
void create_face_extrude(std::vector<SShapeStore>& iCurrentShape);
void store_wire_in_vector(const SShapeStore& iCurrentShape,
const TopoDS_Shape& iParentShape,
std::vector<SShapeStore>& iStoreVec,
unsigned int iColor);
void set_xyz_dir_spinbox(QDoubleSpinBox* icurrentSpinBox);
void transform_shape_to_global_position(TopoDS_Shape& ioShape, Part::Feature* iPart);
private:
/** Checks if the given document is about to be closed */
void slotDeletedDocument(const App::Document& Doc) override;
/** Checks if the given object is about to be removed. */
void slotDeletedObject(const App::DocumentObject& Obj) override;
/** Checks if the given document is about to be closed */
void slotDeletedDocument(const App::Document& Doc) override;
/** Checks if the given object is about to be removed. */
void slotDeletedObject(const App::DocumentObject& Obj) override;
private:
Ui::DlgProjectionOnSurface *ui;
Ui::DlgProjectionOnSurface* ui;
std::vector<SShapeStore> m_shapeVec;
std::vector<SShapeStore> m_projectionSurfaceVec;
@@ -134,9 +143,9 @@ private:
std::vector<QWidget*> m_guiObjectVec;
const QString m_projectionObjectName;
Part::Feature* m_projectionObject;
App::Document* m_partDocument;
float m_lastDepthVal;
Part::Feature* m_projectionObject = nullptr;
App::Document* m_partDocument = nullptr;
double m_lastDepthVal;
class EdgeSelection;
EdgeSelection* filterEdge;
@@ -145,28 +154,28 @@ private:
FaceSelection* filterFace;
};
class TaskProjectionOnSurface : public Gui::TaskView::TaskDialog
class TaskProjectionOnSurface: public Gui::TaskView::TaskDialog
{
Q_OBJECT
Q_OBJECT
public:
TaskProjectionOnSurface();
TaskProjectionOnSurface();
public:
bool accept() override;
bool reject() override;
void clicked(int) override;
bool accept() override;
bool reject() override;
void clicked(int id) override;
QDialogButtonBox::StandardButtons getStandardButtons() const override
{
return QDialogButtonBox::Ok | QDialogButtonBox::Cancel;
}
QDialogButtonBox::StandardButtons getStandardButtons() const override
{
return QDialogButtonBox::Ok | QDialogButtonBox::Cancel;
}
private:
DlgProjectionOnSurface* widget;
Gui::TaskView::TaskBox* taskbox;
DlgProjectionOnSurface* widget = nullptr;
Gui::TaskView::TaskBox* taskbox = nullptr;
};
} // namespace PartGui
#endif // PARTGUI_DLGPROJECTIONONSURFACE_H
} // namespace PartGui
#endif // PARTGUI_DLGPROJECTIONONSURFACE_H