Salome HOME
Update copyright
[modules/geom.git] / src / ShHealOper / ShHealOper_EdgeDivide.hxx
1 // Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 // File:      ShHealOper_EdgeDivide.hxx
24 // Created:   30.04.04 16:06:25
25 // Author:    Galina KULIKOVA
26 //
27 #ifndef ShHealOper_EdgeDivide_HeaderFile
28 #define ShHealOper_EdgeDivide_HeaderFile
29
30 #include <TColStd_HSequenceOfReal.hxx>
31 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
32 #include <TopoDS_Edge.hxx>
33 #include <TopoDS_Shape.hxx>
34 #include <ShHealOper_Tool.hxx>
35 #include <TColStd_SequenceOfReal.hxx>
36
37 ///  Class ShHealOper_EdgeDivide
38 //Intended for spitting edge in accordance to the specified mode and value.
39
40 class ShHealOper_EdgeDivide : public ShHealOper_Tool
41 {
42  public:
43   // ---------- PUBLIC METHODS ----------
44
45   
46   Standard_EXPORT ShHealOper_EdgeDivide () : ShHealOper_Tool() {}
47   /// Empty constructor
48  
49   Standard_EXPORT ShHealOper_EdgeDivide (const TopoDS_Shape& theShape);
50    /// Constructor initializes by shape.
51
52   Standard_EXPORT virtual void Init(const TopoDS_Shape& theShape);
53   //Method for initalization by whole shape.
54
55   Standard_EXPORT Standard_Boolean Perform(const TopoDS_Shape& theEdge, 
56                                            const Standard_Real theValue,
57                                            const Standard_Boolean theDivideParamMode = Standard_True);
58   //Performs spitting of the specified edge in the accoradnce to
59   //specified mode and value.
60   //If theDivideParamMode is equal to true edge will be splitted by parameter.
61   //Else edge will be spliited by length (default true).
62   //theValue is koefficient for splitting from 0 to 1.
63
64   Standard_EXPORT Standard_Boolean Perform(const TopoDS_Shape& theEdge, 
65                                            const TColStd_SequenceOfReal& theValues,
66                                            const Standard_Boolean theDivideParamMode = Standard_True);
67   //Performs spitting of the specified edge in the accoradnce to
68   //specified mode and sequence of values the same way as previous.
69
70  protected:
71   // ---------- PROTECTED METHODS ----------
72
73
74   Standard_Boolean build(const Handle(TColStd_HSequenceOfReal)& theValues);
75   
76   Standard_Boolean computeValues(const Handle(TColStd_HSequenceOfReal)& theValues,
77                                  Standard_Boolean& theHas3d,
78                                  Standard_Boolean& theHas2d,
79                                  Standard_Boolean& hasPCurves);
80
81  private:
82   // ---------- PRIVATE FIELDS ----------
83
84   TopTools_IndexedDataMapOfShapeListOfShape myMapEdgesFace;
85   Standard_Boolean myDivideParamMode;
86   TopoDS_Edge myEdge;
87
88  public:
89 // Declaration of CASCADE RTTI
90 //DEFINE_STANDARD_RTTI (ShHealOper_EdgeDivide)
91 };
92
93 // Definition of HANDLE object using Standard_DefineHandle.hxx
94 //DEFINE_STANDARD_HANDLE (ShHealOper_EdgeDivide, )
95
96
97 #endif