1 // Created on: 1999-03-05
2 // Created by: Fabrice SERVANT
3 // Copyright (c) 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 _IntPolyh_Point_HeaderFile
18 #define _IntPolyh_Point_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <Standard_Real.hxx>
25 #include <Standard_Integer.hxx>
26 #include <Standard_Boolean.hxx>
27 class Adaptor3d_HSurface;
29 //! The class represents the point on the surface with
30 //! both 3D and 2D points.
39 myX(0.), myY(0.), myZ(0.), myU(0.), myV(0.), myPOC(1), myDegenerated(Standard_False)
42 IntPolyh_Point(const Standard_Real x,
43 const Standard_Real y,
44 const Standard_Real z,
45 const Standard_Real u,
46 const Standard_Real v)
48 myX(x), myY(y), myZ(z), myU(u), myV(v), myPOC(1), myDegenerated(Standard_False)
51 //! Returns X coordinate of the 3D point
52 Standard_Real X() const
56 //! Returns Y coordinate of the 3D point
57 Standard_Real Y() const
61 //! Returns the Z coordinate of the 3D point
62 Standard_Real Z() const
66 //! Returns the U coordinate of the 2D point
67 Standard_Real U() const
71 //! Returns the V coordinate of the 2D point
72 Standard_Real V() const
76 //! Returns 0 if the point is not common with the other surface
77 Standard_Integer PartOfCommon() const
83 void Set (const Standard_Real x,
84 const Standard_Real y,
85 const Standard_Real z,
86 const Standard_Real u,
87 const Standard_Real v,
88 const Standard_Integer II = 1)
97 //! Sets the X coordinate for the 3D point
98 void SetX (const Standard_Real x)
102 //! Sets the Y coordinate for the 3D point
103 void SetY (const Standard_Real y)
107 //! Sets the Z coordinate for the 3D point
108 void SetZ (const Standard_Real z)
112 //! Sets the U coordinate for the 2D point
113 void SetU (const Standard_Real u)
117 //! Sets the V coordinate for the 2D point
118 void SetV (const Standard_Real v)
122 //! Sets the part of common
123 void SetPartOfCommon (const Standard_Integer ii)
127 //! Creates middle point from P1 and P2 and stores it to this
128 Standard_EXPORT void Middle (const Handle(Adaptor3d_HSurface)& MySurface, const IntPolyh_Point& P1, const IntPolyh_Point& P2);
130 Standard_EXPORT IntPolyh_Point Add (const IntPolyh_Point& P1) const;
131 IntPolyh_Point operator + (const IntPolyh_Point& P1) const
136 Standard_EXPORT IntPolyh_Point Sub (const IntPolyh_Point& P1) const;
137 IntPolyh_Point operator - (const IntPolyh_Point& P1) const
142 Standard_EXPORT IntPolyh_Point Divide (const Standard_Real rr) const;
143 IntPolyh_Point operator / (const Standard_Real rr) const
148 Standard_EXPORT IntPolyh_Point Multiplication (const Standard_Real rr) const;
149 IntPolyh_Point operator * (const Standard_Real rr) const
151 return Multiplication(rr);
154 Standard_EXPORT Standard_Real SquareModulus() const;
155 //! Square distance to the other point
156 Standard_EXPORT Standard_Real SquareDistance (const IntPolyh_Point& P2) const;
158 Standard_EXPORT Standard_Real Dot (const IntPolyh_Point& P2) const;
160 Standard_EXPORT void Cross (const IntPolyh_Point& P1, const IntPolyh_Point& P2);
162 Standard_EXPORT void Dump() const;
164 Standard_EXPORT void Dump (const Standard_Integer i) const;
165 //! Sets the degenerated flag
166 void SetDegenerated (const Standard_Boolean theFlag)
168 myDegenerated = theFlag;
170 //! Returns the degenerated flag
171 Standard_Boolean Degenerated() const
173 return myDegenerated;
185 Standard_Integer myPOC;
186 Standard_Boolean myDegenerated;
190 #endif // _IntPolyh_Point_HeaderFile