0024002: Overall code and build procedure refactoring -- automatic
[occt.git] / src / AppDef / AppDef_MultiLine.hxx
1 // Created on: 1991-12-02
2 // Created by: Laurent PAINNOT
3 // Copyright (c) 1991-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _AppDef_MultiLine_HeaderFile
18 #define _AppDef_MultiLine_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
24 #include <AppDef_HArray1OfMultiPointConstraint.hxx>
25 #include <Standard_Integer.hxx>
26 #include <AppDef_Array1OfMultiPointConstraint.hxx>
27 #include <TColgp_Array1OfPnt.hxx>
28 #include <TColgp_Array1OfPnt2d.hxx>
29 #include <Standard_Real.hxx>
30 #include <Standard_OStream.hxx>
31 class Standard_ConstructionError;
32 class Standard_DimensionError;
33 class Standard_OutOfRange;
34 class AppDef_MultiPointConstraint;
35
36
37 //! This class describes the organized set of points used in the
38 //! approximations. A MultiLine is composed of n
39 //! MultiPointConstraints.
40 //! The approximation of the MultiLine will be done in the order
41 //! of the given n MultiPointConstraints.
42 //!
43 //! Example of a MultiLine composed of MultiPointConstraints:
44 //!
45 //! P1______P2_____P3______P4________........_____PNbMult
46 //!
47 //! Q1______Q2_____Q3______Q4________........_____QNbMult
48 //! .                                               .
49 //! .                                               .
50 //! .                                               .
51 //! R1______R2_____R3______R4________........_____RNbMult
52 //!
53 //! Pi, Qi, ..., Ri are points of dimension 2 or 3.
54 //!
55 //! (P1, Q1, ...R1), ...(Pn, Qn, ...Rn) n= 1,...NbMult are
56 //! MultiPointConstraints.
57 //! There are NbPoints points in each MultiPointConstraint.
58 class AppDef_MultiLine 
59 {
60 public:
61
62   DEFINE_STANDARD_ALLOC
63
64   
65   //! creates an undefined MultiLine.
66   Standard_EXPORT AppDef_MultiLine();
67   
68   //! given the number NbMult of MultiPointConstraints of this
69   //! MultiLine , it initializes all the fields.SetValue must be
70   //! called in order for the values of the multipoint
71   //! constraint to be taken into account.
72   //! An exception is raised if NbMult < 0.
73   Standard_EXPORT AppDef_MultiLine(const Standard_Integer NbMult);
74   
75   //! Constructs a MultiLine with an array of MultiPointConstraints.
76   Standard_EXPORT AppDef_MultiLine(const AppDef_Array1OfMultiPointConstraint& tabMultiP);
77   
78   //! The MultiLine constructed will have one line of
79   //! 3d points without their tangencies.
80   Standard_EXPORT AppDef_MultiLine(const TColgp_Array1OfPnt& tabP3d);
81   
82   //! The MultiLine constructed will have one line of
83   //! 2d points without their tangencies.
84   Standard_EXPORT AppDef_MultiLine(const TColgp_Array1OfPnt2d& tabP2d);
85   
86   //! returns the number of MultiPointConstraints of the
87   //! MultiLine.
88   Standard_EXPORT Standard_Integer NbMultiPoints() const;
89   
90   //! returns the number of Points from MultiPoints composing
91   //! the MultiLine.
92   Standard_EXPORT Standard_Integer NbPoints() const;
93   
94   //! Sets the value of the parameter for the
95   //! MultiPointConstraint at position Index.
96   //! Exceptions
97   //! -   Standard_OutOfRange if Index is less
98   //! than 0 or Index is greater than the number
99   //! of Multipoint constraints in the MultiLine.
100   Standard_EXPORT void SetParameter (const Standard_Integer Index, const Standard_Real U);
101   
102   //! It sets the MultiPointConstraint of range Index to the
103   //! value MPoint.
104   //! An exception is raised if Index < 0 or Index> MPoint.
105   //! An exception is raised if the dimensions of the
106   //! MultiPoints are different.
107   Standard_EXPORT void SetValue (const Standard_Integer Index, const AppDef_MultiPointConstraint& MPoint);
108   
109   //! returns the MultiPointConstraint of range Index
110   //! An exception is raised if Index<0 or Index>MPoint.
111   Standard_EXPORT AppDef_MultiPointConstraint Value (const Standard_Integer Index) const;
112   
113   //! Prints on the stream o information on the current
114   //! state of the object.
115   //! Is used to redefine the operator <<.
116   Standard_EXPORT void Dump (Standard_OStream& o) const;
117
118
119
120
121 protected:
122
123
124
125   Handle(AppDef_HArray1OfMultiPointConstraint) tabMult;
126
127
128 private:
129
130
131
132
133
134 };
135
136
137
138
139
140
141
142 #endif // _AppDef_MultiLine_HeaderFile