MeshKit
1.0
|
00001 /* 00002 * AF2PlaneProjection.hpp 00003 * 00004 * A transformation between 2-dimensional space and 3-dimensional space 00005 * that transforms from three dimensions to two dimensions by subtracting 00006 * some origin point from the 3-dimensional point and removing the 00007 * component that is in the direction normal to the plane. In other words, 00008 * the transformation projects the 3-dimensional point onto a plane. 00009 * After the projection, the point is scaled in the plane. 00010 * 00011 * The inverse works by first reversing the scaling, and then firing a 00012 * ray from the plane in the direction normal to the plane and finding 00013 * the intersection of the ray with the surface. 00014 */ 00015 00016 #ifndef AF2PLANEPROJECTION_HPP 00017 #define AF2PLANEPROJECTION_HPP 00018 00019 // MeshKit 00020 #include "meshkit/iGeom.hpp" 00021 #include "meshkit/AF2LocalTransform.hpp" 00022 #include "meshkit/Matrix.hpp" 00023 00024 class AF2PlaneProjection : public AF2LocalTransform 00025 { 00026 private: 00027 00028 iGeom* iGeomPtr; 00029 iGeom::EntityHandle surface; 00030 MeshKit::Vector<3> pOrigin; 00031 MeshKit::Vector<3> pNormal; 00032 MeshKit::Vector<3> pXDir; 00033 MeshKit::Vector<3> pYDir; 00034 double scale; 00035 00036 public: 00037 00083 AF2PlaneProjection(iGeom* iGeomPtrArg, 00084 iGeom::EntityHandle srfcHandle, 00085 MeshKit::Vector<3> const & planeOrigin, 00086 MeshKit::Vector<3> const & planeNormal, 00087 MeshKit::Vector<3> const & planeXDir, 00088 double scaleFactor); 00089 00090 AF2Point2D* transformFromSurface(AF2Point3D const & srfcPnt, bool & legal) const; 00091 00092 AF2Point3D* transformToSurface(AF2Point2D const & planePnt, 00093 unsigned long const & pntId) const; 00094 }; 00095 00096 #endif