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 <Adaptor3d_Surface.hxx>
22 //! The class represents the point on the surface with
23 //! both 3D and 2D points.
32 myX(0.), myY(0.), myZ(0.), myU(0.), myV(0.), myPOC(1), myDegenerated(Standard_False)
35 IntPolyh_Point(const Standard_Real x,
36 const Standard_Real y,
37 const Standard_Real z,
38 const Standard_Real u,
39 const Standard_Real v)
41 myX(x), myY(y), myZ(z), myU(u), myV(v), myPOC(1), myDegenerated(Standard_False)
44 //! Returns X coordinate of the 3D point
45 Standard_Real X() const
49 //! Returns Y coordinate of the 3D point
50 Standard_Real Y() const
54 //! Returns the Z coordinate of the 3D point
55 Standard_Real Z() const
59 //! Returns the U coordinate of the 2D point
60 Standard_Real U() const
64 //! Returns the V coordinate of the 2D point
65 Standard_Real V() const
69 //! Returns 0 if the point is not common with the other surface
70 Standard_Integer PartOfCommon() const
76 void Set (const Standard_Real x,
77 const Standard_Real y,
78 const Standard_Real z,
79 const Standard_Real u,
80 const Standard_Real v,
81 const Standard_Integer II = 1)
90 //! Sets the X coordinate for the 3D point
91 void SetX (const Standard_Real x)
95 //! Sets the Y coordinate for the 3D point
96 void SetY (const Standard_Real y)
100 //! Sets the Z coordinate for the 3D point
101 void SetZ (const Standard_Real z)
105 //! Sets the U coordinate for the 2D point
106 void SetU (const Standard_Real u)
110 //! Sets the V coordinate for the 2D point
111 void SetV (const Standard_Real v)
115 //! Sets the part of common
116 void SetPartOfCommon (const Standard_Integer ii)
120 //! Creates middle point from P1 and P2 and stores it to this
121 Standard_EXPORT void Middle (const Handle(Adaptor3d_Surface)& MySurface, const IntPolyh_Point& P1, const IntPolyh_Point& P2);
123 Standard_EXPORT IntPolyh_Point Add (const IntPolyh_Point& P1) const;
124 IntPolyh_Point operator + (const IntPolyh_Point& P1) const
129 Standard_EXPORT IntPolyh_Point Sub (const IntPolyh_Point& P1) const;
130 IntPolyh_Point operator - (const IntPolyh_Point& P1) const
135 Standard_EXPORT IntPolyh_Point Divide (const Standard_Real rr) const;
136 IntPolyh_Point operator / (const Standard_Real rr) const
141 Standard_EXPORT IntPolyh_Point Multiplication (const Standard_Real rr) const;
142 IntPolyh_Point operator * (const Standard_Real rr) const
144 return Multiplication(rr);
147 Standard_EXPORT Standard_Real SquareModulus() const;
148 //! Square distance to the other point
149 Standard_EXPORT Standard_Real SquareDistance (const IntPolyh_Point& P2) const;
151 Standard_EXPORT Standard_Real Dot (const IntPolyh_Point& P2) const;
153 Standard_EXPORT void Cross (const IntPolyh_Point& P1, const IntPolyh_Point& P2);
155 Standard_EXPORT void Dump() const;
157 Standard_EXPORT void Dump (const Standard_Integer i) const;
158 //! Sets the degenerated flag
159 void SetDegenerated (const Standard_Boolean theFlag)
161 myDegenerated = theFlag;
163 //! Returns the degenerated flag
164 Standard_Boolean Degenerated() const
166 return myDegenerated;
178 Standard_Integer myPOC;
179 Standard_Boolean myDegenerated;
183 #endif // _IntPolyh_Point_HeaderFile