File size: 4,558 Bytes
985c397
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
// SPDX-License-Identifier: LGPL-2.1-or-later

/***************************************************************************
 *   Copyright (c) 2014 Nathan Miller <Nathan.A.Mill[at]gmail.com>         *
 *                                                                         *
 *   This file is part of the FreeCAD CAx development system.              *
 *                                                                         *
 *   This library is free software; you can redistribute it and/or         *
 *   modify it under the terms of the GNU Library General Public           *
 *   License as published by the Free Software Foundation; either          *
 *   version 2 of the License, or (at your option) any later version.      *
 *                                                                         *
 *   This library  is distributed in the hope that it will be useful,      *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU Library General Public License for more details.                  *
 *                                                                         *
 *   You should have received a copy of the GNU Library General Public     *
 *   License along with this library; see the file COPYING.LIB. If not,    *
 *   write to the Free Software Foundation, Inc., 59 Temple Place,         *
 *   Suite 330, Boston, MA  02111-1307, USA                                *
 *                                                                         *
 ***************************************************************************/

#ifndef SURFACE_FEATUREFILLING_H
#define SURFACE_FEATUREFILLING_H

#include <App/PropertyLinks.h>
#include <Mod/Part/App/FeaturePartSpline.h>
#include <Mod/Surface/SurfaceGlobal.h>


class BRepFill_Filling;

namespace Surface
{

class SurfaceExport Filling: public Part::Spline
{
    PROPERTY_HEADER_WITH_OVERRIDE(Surface::Filling);

public:
    Filling();

    // Properties of Curves
    App::PropertyLinkSubList BoundaryEdges;  // Boundary Edges (C0 is required for edges without a
                                             // corresponding face)
    App::PropertyStringList BoundaryFaces;   // Boundary Faces (C0, G1 and G2 are possible)
    App::PropertyIntegerList BoundaryOrder;  // Order of constraint on border faces
    App::PropertyLinkSubList UnboundEdges;   // Unbound constraint edges (C0 is required for edges
                                             // without a corresponding face)
    App::PropertyStringList UnboundFaces;   // Unbound constraint faces (C0, G1 and G2 are possible)
    App::PropertyIntegerList UnboundOrder;  // Order of constraint on curve faces
    App::PropertyLinkSubList FreeFaces;     // Free constraint faces
    App::PropertyIntegerList FreeOrder;     // Order of constraint on free faces
    App::PropertyLinkSubList Points;        // Constraint Points (on Surface)
    App::PropertyLinkSub InitialFace;       // Initial Face to use

    // Algorithm Variables
    App::PropertyInteger Degree;           // Starting degree
    App::PropertyInteger PointsOnCurve;    // Number of points on an edge for constraint
    App::PropertyInteger Iterations;       // Number of iterations
    App::PropertyBool Anisotropy;          // Anisotropy
    App::PropertyFloat Tolerance2d;        // 2D Tolerance
    App::PropertyFloat Tolerance3d;        // 3D Tolerance
    App::PropertyFloat TolAngular;         // G1 tolerance
    App::PropertyFloat TolCurvature;       // G2 tolerance
    App::PropertyInteger MaximumDegree;    // Maximum curve degree
    App::PropertyInteger MaximumSegments;  // Maximum number of segments

    // recalculate the feature
    App::DocumentObjectExecReturn* execute() override;
    short mustExecute() const override;
    /// returns the type name of the view provider
    const char* getViewProviderName() const override
    {
        return "SurfaceGui::ViewProviderFilling";
    }

private:
    void addConstraints(
        BRepFill_Filling& builder,
        const App::PropertyLinkSubList& edges,
        const App::PropertyStringList& faces,
        const App::PropertyIntegerList& orders,
        Standard_Boolean bnd
    );
    void addConstraints(
        BRepFill_Filling& builder,
        const App::PropertyLinkSubList& faces,
        const App::PropertyIntegerList& orders
    );
    void addConstraints(BRepFill_Filling& builder, const App::PropertyLinkSubList& points);
};

}  // Namespace Surface

#endif