OpenLexocad  27.1
GeomToolsOCC.h
Go to the documentation of this file.
1 #pragma warning(disable : 4251)
2 
3 #pragma once
4 
5 #include <Geom/Ax1.h>
6 #include <Geom/Ax2.h>
7 #include <Geom/Ax22d.h>
8 #include <Geom/Circ.h>
9 #include <Geom/Circ2d.h>
10 #include <Geom/Dir.h>
11 #include <Geom/Dir2d.h>
12 #include <Geom/Lin.h>
13 #include <Geom/Lin2d.h>
14 #include <Geom/Pln.h>
15 #include <Geom/Pnt.h>
16 #include <Geom/Pnt2d.h>
17 #include <Geom/Trsf.h>
18 #include <Geom/Vec.h>
19 #include <Geom/xyz.h>
20 
21 #include <gp_Ax1.hxx>
22 #include <gp_Ax2.hxx>
23 #include <gp_Ax22d.hxx>
24 #include <gp_Circ.hxx>
25 #include <gp_Dir.hxx>
26 #include <gp_Dir2d.hxx>
27 #include <gp_GTrsf.hxx>
28 #include <gp_Lin.hxx>
29 #include <gp_Lin2d.hxx>
30 #include <gp_Pln.hxx>
31 #include <gp_Pnt.hxx>
32 #include <gp_Pnt2d.hxx>
33 #include <gp_Vec.hxx>
34 #include <gp_Vec2d.hxx>
35 #include <gp_XYZ.hxx>
36 
37 #ifndef M_PI
38 #define M_PI 3.1415926535897932384626433832795029
39 #endif
40 
41 namespace Geom
42 {
43 class LX_GEOM_EXPORT GeomToolsOCC
44 {
45 public:
46  GeomToolsOCC(void);
47  ~GeomToolsOCC(void);
48 
49  static bool isEqual(const gp_XYZ& v1, const gp_XYZ& v2, double tolerance = 1E-06);
50  static bool isEqual(const gp_XY& v1, const gp_XY& v2, double tolerance = 1E-06);
51  static bool isEqual(const gp_Dir& d1, const gp_Dir& d2, double tolerance = 1E-06);
52  static bool isEqual(const gp_Dir2d& d1, const gp_Dir2d& d2, double tolerance = 1E-06);
53  static bool isEqual(const gp_Vec& v1, const gp_Vec& v2, double tolerance = 1E-06);
54  static bool isEqual(const gp_Vec2d& v1, const gp_Vec2d& v2, double tolerance = 1E-06);
55  static bool isEqual(const gp_Pnt& p1, const gp_Pnt& p2, double tolerance = 1E-06);
56  static bool isEqual(const gp_Pnt2d& p1, const gp_Pnt2d& p2, double tolerance = 1E-06);
57  static bool isEqual(const gp_Ax1& a1, const gp_Ax1& a2, double tolerance = 1E-06);
58  static bool isEqual(const gp_Ax2& a1, const gp_Ax2& a2, double tolerance = 1E-06);
59  static bool isEqual(const gp_Ax3& a1, const gp_Ax3& a2, double tolerance = 1E-06);
60  static bool isEqual(const gp_Ax22d& a1, const gp_Ax22d& a2, double tolerance = 1E-06);
61  static bool isEqual(const gp_Trsf& t1, const gp_Trsf& t2, double tolerance = 1E-06);
62  static bool isEqual(const gp_GTrsf& t1, const gp_GTrsf& t2, double tolerance = 1E-06);
63 
64 
65 
66  static Geom::Ax1 to_CA_Axis1(const gp_Ax1& value);
67  static gp_Ax2 to_gp_Ax2(const Geom::Ax2& value);
68  static Geom::Ax2 to_CA_Axis2(const gp_Ax2& value);
69  static Geom::Ax22d to_CA_Ax22d(const gp_Ax22d& value);
70  static gp_Ax2d to_gp_Ax2d(const Geom::Ax2d& value);
71  static gp_Ax22d to_gp_Ax22d(const Geom::Ax22d& value);
72  static gp_Pnt to_gp_Pnt(const Geom::Pnt& value);
73  static gp_Pnt to_gp_Pnt(const Geom::XYZ& value);
74  static Geom::Pnt to_CA_Point(const gp_Pnt& value);
75  static Geom::Pnt to_CA_Point(const gp_Pnt2d& value, const Geom::Pln& pln);
76  static gp_Vec to_gp_Vec(const Geom::Vec& value);
77  static gp_Vec to_gp_Vec(const Geom::XYZ& value);
78  static Geom::Vec to_CA_Vector(const gp_Vec& value);
79  static gp_Dir to_gp_Dir(const Geom::Dir& value);
80  static gp_Pnt2d to_gp_Pnt2d(const Geom::Pnt2d& value);
81  static Geom::Pnt2d to_CA_Pnt2d(const gp_Pnt2d& value);
82  static gp_Vec2d to_gp_Vec2d(const Geom::Vec2d& value);
83  static gp_Dir2d to_gp_Dir2d(const Geom::Dir2d& value);
84  static gp_Lin2d to_gp_Lin2d(const Geom::Lin2d& value);
85  static Geom::Dir to_CA_Direction(const gp_Dir& value);
86  static gp_Trsf to_gp_Trsf(const Geom::Trsf& value);
87  static gp_GTrsf to_gp_GTrsf(const Geom::GTrsf& value);
88  static gp_Mat to_gp_Mat(const Geom::Mat& value);
89  static Geom::Trsf to_CA_Transform(const gp_Trsf& value);
90  static gp_Pln to_gp_Pln(const Geom::Pln& value);
91  static Geom::Pln to_CA_Plane(const gp_Pln& value);
92  static gp_Lin to_gp_Lin(const Geom::Lin& value);
93  static Geom::Lin to_CA_Line(const gp_Lin& value);
94  static Geom::Circ to_CA_Circle(const gp_Circ& value);
95  static Geom::Circ2d to_CA_Circle2d(const gp_Circ2d& value);
96  static gp_Ax1 to_gp_Ax1(const Geom::Ax1& value);
97  static gp_Circ to_gp_Circ(const Geom::Circ& value);
98  static gp_Circ2d to_gp_Circ2d(const Geom::Circ2d& value);
99  static gp_Lin2d to_gp_Lin2d(const Geom::Lin& lin, const Geom::Pln& pln);
100  static gp_Lin to_gp_Lin(const gp_Lin2d& gpLin2d, const gp_Pln& gpPln);
101  static gp_Pnt2d to_gp_Pnt2d(const Geom::Pnt& pnt, const Geom::Pln& pln);
102  static gp_Circ to_gp_Circ(const gp_Circ2d& gpCirc2d, const gp_Pln& gpPln);
103  static gp_Circ to_gp_Circ(const gp_Circ2d& gpCirc2d, const Geom::Pln& pln);
104  static void debugOccTransform(const gp_Trsf& transform, const std::string& msg = "");
105  static void debugOccTransform(const gp_GTrsf& transform, const std::string& msg = "");
106 
107 private:
108 };
109 
110 } // namespace Geom
111 
112 
113  LX_GEOM_EXPORT std::ostream& operator<<(std::ostream& o, const gp_Vec& vec);
114  LX_GEOM_EXPORT std::ostream& operator<<(std::ostream& o, const gp_Dir& dir);
115  LX_GEOM_EXPORT std::ostream& operator<<(std::ostream& o, const gp_Pln& dir);
116  LX_GEOM_EXPORT std::ostream& operator<<(std::ostream& o, const gp_Pnt& pnt);
117  LX_GEOM_EXPORT std::ostream& operator<<(std::ostream& o, const gp_XYZ& xyz);
118  LX_GEOM_EXPORT std::ostream& operator<<(std::ostream& o, const gp_Ax2& placement);
119  LX_GEOM_EXPORT std::ostream& operator<<(std::ostream& o, const gp_Vec2d& vec);
120  LX_GEOM_EXPORT std::ostream& operator<<(std::ostream& o, const gp_Trsf& t);
Definition: Circ.h:53
Definition: Variant.h:60
Definition: Lin2d.h:51
Definition: Circ2d.h:57
Definition: GeomToolsOCC.h:43
Definition: Pln.h:57
Defines a non-persistent 3D Cartesian point.
Definition: Pnt.h:43
Definition: Mat.h:38
Definition: Ax2d.h:48
Definition: Dir2d.h:38
void transform(Container container, OutputIt out, BinaryFunction function)
Definition: Algorithms.h:29
Definition: Ax2.h:67
LX_GEOM_EXPORT std::ostream & operator<<(std::ostream &o, const gp_Vec &vec)
Definition: XYZ.h:43
Definition: Lin.h:48
Definition: Trsf.h:57
Definition: Dir.h:45
Defines a non-persistent vector in 2D space.
Definition: Vec2d.h:34
Definition: Ax1.h:50
Defines a non-persistent vector in 3D space.
Definition: Vec.h:44
Definition: GTrsf.h:47
Definition: Ax22d.h:50
Defines a non-persistent 2D cartesian point.
Definition: Pnt2d.h:33