Mesh: Apply clang-format

This commit is contained in:
wmayer
2023-09-23 00:29:09 +02:00
committed by wwmayer
parent 4e328682d9
commit 15b11bc360
78 changed files with 4221 additions and 3294 deletions

View File

@@ -27,8 +27,8 @@
#include <Gui/ViewProviderBuilder.h>
#include <Gui/ViewProviderGeometryObject.h>
#include <Mod/Mesh/App/Types.h>
#include <Mod/Mesh/App/Core/Elements.h>
#include <Mod/Mesh/App/Types.h>
class SoGroup;
@@ -49,35 +49,41 @@ class SbVec2f;
class SbBox2s;
class SbPlane;
namespace App {
class Color;
class PropertyColorList;
namespace App
{
class Color;
class PropertyColorList;
} // namespace App
namespace Base
{
class ViewProjMethod;
}
namespace Base {
class ViewProjMethod;
}
namespace Gui {
class View3DInventorViewer;
class SoFCSelection;
}
namespace Gui
{
class View3DInventorViewer;
class SoFCSelection;
} // namespace Gui
namespace MeshCore {
class MeshKernel;
struct Material;
}
namespace MeshCore
{
class MeshKernel;
struct Material;
} // namespace MeshCore
namespace Mesh {
namespace Mesh
{
class PropertyMaterial;
}
namespace MeshGui {
namespace MeshGui
{
class SoFCMeshObjectNode;
class SoFCMeshObjectShape;
class MeshGuiExport ViewProviderMeshBuilder : public Gui::ViewProviderBuilder
class MeshGuiExport ViewProviderMeshBuilder: public Gui::ViewProviderBuilder
{
public:
ViewProviderMeshBuilder() = default;
@@ -90,7 +96,7 @@ public:
* The ViewProviderExport class creates an empty node.
* @author Werner Mayer
*/
class MeshGuiExport ViewProviderExport : public Gui::ViewProviderDocumentObject
class MeshGuiExport ViewProviderExport: public Gui::ViewProviderDocumentObject
{
PROPERTY_HEADER_WITH_OVERRIDE(MeshGui::ViewProviderExport);
@@ -99,7 +105,10 @@ public:
~ViewProviderExport() override;
QIcon getIcon() const override;
SoSeparator* getRoot() const override {return nullptr;}
SoSeparator* getRoot() const override
{
return nullptr;
}
std::vector<std::string> getDisplayModes() const override;
const char* getDefaultDisplayMode() const override;
};
@@ -109,7 +118,7 @@ public:
* and many algorithms to work on or edit the mesh.
* @author Werner Mayer
*/
class MeshGuiExport ViewProviderMesh : public Gui::ViewProviderGeometryObject
class MeshGuiExport ViewProviderMesh: public Gui::ViewProviderGeometryObject
{
PROPERTY_HEADER_WITH_OVERRIDE(MeshGui::ViewProviderMesh);
@@ -127,24 +136,33 @@ public:
App::PropertyEnumeration Lighting;
App::PropertyColor LineColor;
void attach(App::DocumentObject *) override;
void attach(App::DocumentObject*) override;
void updateData(const App::Property*) override;
bool useNewSelectionModel() const override {return false;}
Gui::SoFCSelection* getHighlightNode() const { return pcHighlight; }
bool useNewSelectionModel() const override
{
return false;
}
Gui::SoFCSelection* getHighlightNode() const
{
return pcHighlight;
}
QIcon getIcon() const override;
/// Sets the correct display mode
void setDisplayMode(const char* ModeName) override;
/// returns a list of all possible modes
std::vector<std::string> getDisplayModes() const override;
bool exportToVrml(const char* filename, const MeshCore::Material&, bool binary=false) const;
void exportMesh(const char* filename, const char* fmt=nullptr) const;
bool exportToVrml(const char* filename, const MeshCore::Material&, bool binary = false) const;
void exportMesh(const char* filename, const char* fmt = nullptr) const;
void setupContextMenu(QMenu*, QObject*, const char*) override;
/// Get the python wrapper for that ViewProvider
PyObject* getPyObject() override;
/** @name Editing */
//@{
bool doubleClicked() override{ return false; }
bool doubleClicked() override
{
return false;
}
bool isFacetSelected(Mesh::FacetIndex facet);
void selectComponent(Mesh::FacetIndex facet);
void deselectComponent(Mesh::FacetIndex facet);
@@ -158,13 +176,18 @@ public:
void deleteSelection();
bool hasSelection() const;
void getFacetsFromPolygon(const std::vector<SbVec2f>& picked,
const Base::ViewProjMethod& proj, SbBool inner,
const Base::ViewProjMethod& proj,
SbBool inner,
std::vector<Mesh::FacetIndex>& indices) const;
std::vector<Mesh::FacetIndex> getFacetsOfRegion(const SbViewportRegion&, const SbViewportRegion&, SoCamera*) const;
std::vector<Mesh::FacetIndex> getVisibleFacetsAfterZoom(const SbBox2s&, const SbViewportRegion&, SoCamera*) const;
std::vector<Mesh::FacetIndex>
getFacetsOfRegion(const SbViewportRegion&, const SbViewportRegion&, SoCamera*) const;
std::vector<Mesh::FacetIndex>
getVisibleFacetsAfterZoom(const SbBox2s&, const SbViewportRegion&, SoCamera*) const;
std::vector<Mesh::FacetIndex> getVisibleFacets(const SbViewportRegion&, SoCamera*) const;
virtual void cutMesh(const std::vector<SbVec2f>& picked, const Base::ViewProjMethod& proj, SbBool inner);
virtual void trimMesh(const std::vector<SbVec2f>& picked, const Base::ViewProjMethod& proj, SbBool inner);
virtual void
cutMesh(const std::vector<SbVec2f>& picked, const Base::ViewProjMethod& proj, SbBool inner);
virtual void
trimMesh(const std::vector<SbVec2f>& picked, const Base::ViewProjMethod& proj, SbBool inner);
virtual void appendFacets(const std::vector<Mesh::FacetIndex>&);
virtual void removeFacets(const std::vector<Mesh::FacetIndex>&);
/*! The size of the array must be equal to the number of facets. */
@@ -182,8 +205,10 @@ protected:
void onChanged(const App::Property* prop) override;
virtual void showOpenEdges(bool);
void setOpenEdgeColorFrom(const App::Color& col);
virtual void splitMesh(const MeshCore::MeshKernel& toolMesh, const Base::Vector3f& normal, SbBool inner);
virtual void segmentMesh(const MeshCore::MeshKernel& toolMesh, const Base::Vector3f& normal, SbBool inner);
virtual void
splitMesh(const MeshCore::MeshKernel& toolMesh, const Base::Vector3f& normal, SbBool inner);
virtual void
segmentMesh(const MeshCore::MeshKernel& toolMesh, const Base::Vector3f& normal, SbBool inner);
virtual void faceInfo(Mesh::FacetIndex facet);
virtual void fillHole(Mesh::FacetIndex facet);
virtual void selectArea(short, short, short, short, const SbViewportRegion&, SoCamera*);
@@ -212,42 +237,45 @@ protected:
virtual SoNode* getCoordNode() const;
public:
static void faceInfoCallback(void * ud, SoEventCallback * n);
static void fillHoleCallback(void * ud, SoEventCallback * n);
static void markPartCallback(void * ud, SoEventCallback * n);
static void clipMeshCallback(void * ud, SoEventCallback * n);
static void trimMeshCallback(void * ud, SoEventCallback * n);
static void partMeshCallback(void * ud, SoEventCallback * n);
static void segmMeshCallback(void * ud, SoEventCallback * n);
static void selectGLCallback(void * ud, SoEventCallback * n);
static void faceInfoCallback(void* ud, SoEventCallback* n);
static void fillHoleCallback(void* ud, SoEventCallback* n);
static void markPartCallback(void* ud, SoEventCallback* n);
static void clipMeshCallback(void* ud, SoEventCallback* n);
static void trimMeshCallback(void* ud, SoEventCallback* n);
static void partMeshCallback(void* ud, SoEventCallback* n);
static void segmMeshCallback(void* ud, SoEventCallback* n);
static void selectGLCallback(void* ud, SoEventCallback* n);
/// Creates a tool mesh from the previous picked polygon on the viewer
static bool createToolMesh(const std::vector<SbVec2f>& rclPoly, const SbViewVolume& vol,
const Base::Vector3f& rcNormal, std::vector<MeshCore::MeshGeomFacet>&);
static bool createToolMesh(const std::vector<SbVec2f>& rclPoly,
const SbViewVolume& vol,
const Base::Vector3f& rcNormal,
std::vector<MeshCore::MeshGeomFacet>&);
private:
static void renderGLCallback(void * ud, SoAction * a);
static void boxZoom(const SbBox2s& box, const SbViewportRegion & vp, SoCamera* cam);
static void renderGLCallback(void* ud, SoAction* a);
static void boxZoom(const SbBox2s& box, const SbViewportRegion& vp, SoCamera* cam);
static void panCamera(SoCamera*, float, const SbPlane&, const SbVec2f&, const SbVec2f&);
protected:
enum class HighlighMode {
enum class HighlighMode
{
None,
Component,
Segment,
Color
};
//NOLINTBEGIN
// NOLINTBEGIN
HighlighMode highlightMode;
Gui::SoFCSelection * pcHighlight{nullptr};
SoGroup * pcShapeGroup{nullptr};
SoDrawStyle * pcLineStyle{nullptr};
SoDrawStyle * pcPointStyle{nullptr};
SoSeparator * pcOpenEdge{nullptr};
SoBaseColor * pOpenColor{nullptr};
SoMaterial * pLineColor{nullptr};
SoShapeHints * pShapeHints{nullptr};
SoMaterialBinding * pcMatBinding{nullptr};
//NOLINTEND
Gui::SoFCSelection* pcHighlight {nullptr};
SoGroup* pcShapeGroup {nullptr};
SoDrawStyle* pcLineStyle {nullptr};
SoDrawStyle* pcPointStyle {nullptr};
SoSeparator* pcOpenEdge {nullptr};
SoBaseColor* pOpenColor {nullptr};
SoMaterial* pLineColor {nullptr};
SoShapeHints* pShapeHints {nullptr};
SoMaterialBinding* pcMatBinding {nullptr};
// NOLINTEND
private:
static App::PropertyFloatConstraint::Constraints floatRange;
@@ -261,7 +289,7 @@ private:
* to render the mesh data structure.
* @author Werner Mayer
*/
class MeshGuiExport ViewProviderIndexedFaceSet : public ViewProviderMesh
class MeshGuiExport ViewProviderIndexedFaceSet: public ViewProviderMesh
{
PROPERTY_HEADER_WITH_OVERRIDE(MeshGui::ViewProviderIndexedFaceSet);
@@ -269,7 +297,7 @@ public:
ViewProviderIndexedFaceSet();
~ViewProviderIndexedFaceSet() override;
void attach(App::DocumentObject *) override;
void attach(App::DocumentObject*) override;
/// Update the Mesh representation
void updateData(const App::Property*) override;
@@ -279,8 +307,8 @@ protected:
SoNode* getCoordNode() const override;
private:
SoCoordinate3 * pcMeshCoord;
SoIndexedFaceSet * pcMeshFaces;
SoCoordinate3* pcMeshCoord;
SoIndexedFaceSet* pcMeshFaces;
};
/**
@@ -288,7 +316,7 @@ private:
* to directly render the mesh data structure.
* @author Werner Mayer
*/
class MeshGuiExport ViewProviderMeshObject : public ViewProviderMesh
class MeshGuiExport ViewProviderMeshObject: public ViewProviderMesh
{
PROPERTY_HEADER_WITH_OVERRIDE(MeshGui::ViewProviderMeshObject);
@@ -296,7 +324,7 @@ public:
ViewProviderMeshObject();
~ViewProviderMeshObject() override;
void attach(App::DocumentObject *pcFeat) override;
void attach(App::DocumentObject* pcFeat) override;
void updateData(const App::Property*) override;
protected:
@@ -305,12 +333,11 @@ protected:
void showOpenEdges(bool) override;
private:
SoFCMeshObjectNode * pcMeshNode;
SoFCMeshObjectShape * pcMeshShape;
SoFCMeshObjectNode* pcMeshNode;
SoFCMeshObjectShape* pcMeshShape;
};
} // namespace MeshGui
} // namespace MeshGui
#endif // MESHGUI_VIEWPROVIDERMESH_H
#endif // MESHGUI_VIEWPROVIDERMESH_H