#ifndef Postscript_STREAM_3 #define Postscript_STREAM_3 #include #include #include #include #include #include #include #include #include #include #include #include #include CGAL_BEGIN_NAMESPACE typedef Bbox_3 PS_BBox3; typedef Direction_3< Cartesian > Direction; typedef Aff_transformation_3< Cartesian > Transformation; typedef Vector_3< Cartesian > Vector3; typedef Point_3< Cartesian > Point3; typedef Point_2< Cartesian > Point2; typedef Cartesian R; typedef CGAL::Polygon_traits_2 Poly_Traits; typedef Poly_Traits::Point_2 Point; typedef std::list Container; typedef CGAL::Polygon_2 Polygon; typedef Halfedge_data_structure_polyhedron_default_3 HDS; typedef Polyhedron_default_traits_3 Traits; typedef Polyhedron_3 Polyhedron; typedef Polyhedron::Facet Facet; typedef Polyhedron::Plane Plane; typedef Polyhedron::Halfedge_const_handle Halfedge_handle; typedef Polyhedron::Facet_const_iterator FCI; typedef Polyhedron::Halfedge_around_facet_const_circulator HFCC; class PS_Stream_3 : public PS_Stream { private : // Define the bounding box PS_BBox3 _bbox3; // Define the point of view direction Direction _dir; //Define the transformation matrices Transformation _t; //Array of vertices of the bounding box Point3 v[8]; //Initialisation du tableau contenant les sommets de la bounding box void init(){ v[0]=Point3(_bbox3.xmin(),_bbox3.ymin(),_bbox3.zmin()); v[1]=Point3(_bbox3.xmin(),_bbox3.ymin(),_bbox3.zmax()); v[2]=Point3(_bbox3.xmin(),_bbox3.ymax(),_bbox3.zmin()); v[3]=Point3(_bbox3.xmin(),_bbox3.ymax(),_bbox3.zmax()); v[4]=Point3(_bbox3.xmax(),_bbox3.ymax(),_bbox3.zmax()); v[5]=Point3(_bbox3.xmax(),_bbox3.ymin(),_bbox3.zmin()); v[6]=Point3(_bbox3.xmax(),_bbox3.ymin(),_bbox3.zmax()); v[7]=Point3(_bbox3.xmax(),_bbox3.ymax(),_bbox3.zmin()); } public : // Constructor PS_Stream_3(const PS_BBox3& bb3,const Direction& d, ostream& os, OutputMode = QUIET ); PS_Stream_3(const PS_BBox3& bb3, const Direction& d, const char* fname, OutputMode = QUIET); PS_Stream_3(const PS_BBox3& bb3, const Direction& d, float H, const char* fname, OutputMode = QUIET); PS_Stream_3(const PS_BBox3& bb3,const Direction& d, float H, ostream& os, OutputMode = QUIET ); //Accessors PS_BBox3 bbox3() const {return _bbox3;} Direction direction() const {return _dir;} Transformation trans() const {return _t;} //Utils double norme(double x,double y,double z){return (sqrt(x*x+y*y+z*z));} double den(double x){return (sqrt(1-x*x));} Point2 transform( Transformation t, const Point3& p); double search_xmin(Point3 v[]); double search_xmax(Point3 v[]); double search_ymin(Point3 v[]); double search_ymax(Point3 v[]); Plane compute_plane_equations(const Facet& f); }; template < class R > PS_Stream_3& operator <<(PS_Stream_3& ps, Point_3& p) { Point2 p2; p2=ps.transform(ps.trans(),p); ps << p2; return ps; } CGAL_END_NAMESPACE #endif // Postscript_STREAM_3