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
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _AppDef_MultiLine_HeaderFile
18 #define _AppDef_MultiLine_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
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;
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.
43 //! Example of a MultiLine composed of MultiPointConstraints:
45 //! P1______P2_____P3______P4________........_____PNbMult
47 //! Q1______Q2_____Q3______Q4________........_____QNbMult
51 //! R1______R2_____R3______R4________........_____RNbMult
53 //! Pi, Qi, ..., Ri are points of dimension 2 or 3.
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
65 //! creates an undefined MultiLine.
66 Standard_EXPORT AppDef_MultiLine();
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);
75 //! Constructs a MultiLine with an array of MultiPointConstraints.
76 Standard_EXPORT AppDef_MultiLine(const AppDef_Array1OfMultiPointConstraint& tabMultiP);
78 //! The MultiLine constructed will have one line of
79 //! 3d points without their tangencies.
80 Standard_EXPORT AppDef_MultiLine(const TColgp_Array1OfPnt& tabP3d);
82 //! The MultiLine constructed will have one line of
83 //! 2d points without their tangencies.
84 Standard_EXPORT AppDef_MultiLine(const TColgp_Array1OfPnt2d& tabP2d);
86 //! returns the number of MultiPointConstraints of the
88 Standard_EXPORT Standard_Integer NbMultiPoints() const;
90 //! returns the number of Points from MultiPoints composing
92 Standard_EXPORT Standard_Integer NbPoints() const;
94 //! Sets the value of the parameter for the
95 //! MultiPointConstraint at position Index.
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);
102 //! It sets the MultiPointConstraint of range Index to the
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);
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;
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;
125 Handle(AppDef_HArray1OfMultiPointConstraint) tabMult;
142 #endif // _AppDef_MultiLine_HeaderFile