| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| |
|
| | #ifndef MESHGUI_MESHEDITOR_H
|
| | #define MESHGUI_MESHEDITOR_H
|
| |
|
| | #include <QObject>
|
| |
|
| | #include <Mod/Mesh/Gui/ViewProvider.h>
|
| |
|
| |
|
| | class SoCoordinate3;
|
| | class SoFaceSet;
|
| | class SoEventCallback;
|
| | class SoPickedPoint;
|
| | class SoGroup;
|
| | class SoSeparator;
|
| | class SoRayPickAction;
|
| | class SbLine;
|
| | class SbVec3f;
|
| |
|
| | namespace Gui
|
| | {
|
| | class View3DInventor;
|
| | class View3DInventorViewer;
|
| | }
|
| | namespace Mesh
|
| | {
|
| | class MeshObject;
|
| | }
|
| | namespace Mesh
|
| | {
|
| | class Feature;
|
| | }
|
| | namespace MeshGui
|
| | {
|
| | class SoFCMeshPickNode;
|
| |
|
| | |
| | |
| |
|
| | class MeshGuiExport ViewProviderFace: public Gui::ViewProviderDocumentObject
|
| | {
|
| | PROPERTY_HEADER_WITH_OVERRIDE(MeshGui::ViewProviderFace);
|
| |
|
| | public:
|
| | ViewProviderFace();
|
| | ~ViewProviderFace() override;
|
| |
|
| |
|
| | void attach(App::DocumentObject* obj) override;
|
| | void setDisplayMode(const char* ModeName) override;
|
| | const char* getDefaultDisplayMode() const override;
|
| | std::vector<std::string> getDisplayModes() const override;
|
| | SoPickedPoint* getPickedPoint(const SbVec2s& pos, const Gui::View3DInventorViewer* viewer) const;
|
| |
|
| | ViewProviderMesh* mesh {nullptr};
|
| | std::vector<int> index;
|
| | int current_index {-1};
|
| |
|
| | SoCoordinate3* pcCoords;
|
| | SoFaceSet* pcFaces;
|
| | SoFCMeshPickNode* pcMeshPick;
|
| |
|
| | FC_DISABLE_COPY_MOVE(ViewProviderFace)
|
| | };
|
| |
|
| | |
| | |
| | |
| |
|
| | class MeshGuiExport MeshFaceAddition: public QObject
|
| | {
|
| | Q_OBJECT
|
| |
|
| | public:
|
| | explicit MeshFaceAddition(Gui::View3DInventor* parent);
|
| | ~MeshFaceAddition() override;
|
| |
|
| | void startEditing(ViewProviderMesh*);
|
| |
|
| | public Q_SLOTS:
|
| | void finishEditing();
|
| |
|
| | private Q_SLOTS:
|
| | void addFace();
|
| | void clearPoints();
|
| | void flipNormal();
|
| |
|
| | private:
|
| | bool addMarkerPoint();
|
| | void showMarker(SoPickedPoint*);
|
| | static void addFacetCallback(void* ud, SoEventCallback* n);
|
| |
|
| | private:
|
| | ViewProviderFace* faceView;
|
| |
|
| | Q_DISABLE_COPY_MOVE(MeshFaceAddition)
|
| | };
|
| |
|
| | class MeshGuiExport MeshHoleFiller
|
| | {
|
| | public:
|
| | MeshHoleFiller() = default;
|
| | virtual ~MeshHoleFiller() = default;
|
| | MeshHoleFiller(const MeshHoleFiller&) = delete;
|
| | MeshHoleFiller(MeshHoleFiller&&) = delete;
|
| | MeshHoleFiller& operator=(const MeshHoleFiller&) = delete;
|
| | MeshHoleFiller& operator=(MeshHoleFiller&&) = delete;
|
| | virtual bool fillHoles(
|
| | Mesh::MeshObject&,
|
| | const std::list<std::vector<Mesh::PointIndex>>&,
|
| | Mesh::PointIndex,
|
| | Mesh::PointIndex
|
| | )
|
| | {
|
| | return false;
|
| | }
|
| | };
|
| |
|
| | |
| | |
| | |
| |
|
| | class MeshGuiExport MeshFillHole: public QObject
|
| | {
|
| | Q_OBJECT
|
| |
|
| | public:
|
| | MeshFillHole(MeshHoleFiller& hf, Gui::View3DInventor* parent);
|
| | ~MeshFillHole() override;
|
| |
|
| | void startEditing(ViewProviderMesh*);
|
| |
|
| | public Q_SLOTS:
|
| | void finishEditing();
|
| |
|
| | private Q_SLOTS:
|
| | void closeBridge();
|
| |
|
| | private:
|
| | using TBoundary = std::vector<Mesh::PointIndex>;
|
| | using Connection = fastsignals::connection;
|
| |
|
| | static void fileHoleCallback(void* ud, SoEventCallback* n);
|
| | void createPolygons();
|
| | SoNode* getPickedPolygon(const SoRayPickAction& action) const;
|
| | float findClosestPoint(const SbLine& ray, const TBoundary& polygon, Mesh::PointIndex&, SbVec3f&) const;
|
| | void slotChangedObject(const App::DocumentObject& Obj, const App::Property& Prop);
|
| |
|
| | private:
|
| | SoSeparator* myBoundariesRoot;
|
| | SoGroup* myBoundariesGroup;
|
| | SoSeparator* myBoundaryRoot;
|
| | SoSeparator* myBridgeRoot;
|
| | SoCoordinate3* myVertex;
|
| | std::map<SoNode*, TBoundary> myPolygons;
|
| | Mesh::Feature* myMesh {nullptr};
|
| | int myNumPoints {0};
|
| | Mesh::PointIndex myVertex1 {0};
|
| | Mesh::PointIndex myVertex2 {0};
|
| | TBoundary myPolygon;
|
| | MeshHoleFiller& myHoleFiller;
|
| | Connection myConnection;
|
| |
|
| | Q_DISABLE_COPY_MOVE(MeshFillHole)
|
| | };
|
| |
|
| | }
|
| |
|
| |
|
| | #endif
|
| |
|